Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | module |
| 2 | |
| 3 | public import Aesop.BuiltinRules |
| 4 | import Mathlib.Data.Set.Finite.Monad |
| 5 | import Mathlib.FieldTheory.Galois.Profinite |
| 6 | import Mathlib.Topology.Algebra.ClopenNhdofOne |
| 7 | import TauCeti.NumberTheory.Chebotarev.Density.ResidueDegree |
| 8 | import TauCeti.NumberTheory.NumberField.ResidueDegree |
| 9 | public import Lib.Adelic.Adeles.Basic |
| 10 | public import Lib.ClassField.Places.GaloisDefs |
| 11 | import Lib.ClassField.GaloisCohomology.KummerCyclicClasses |
| 12 | import Lib.ClassField.Places.DecompositionCompletion |
| 13 | import Lib.ClassField.Places.ProfiniteGalois |
| 14 | |
| 15 | /-! |
| 16 | # Chebotarev: Frobenii at primes of degree one in every nonempty open set |
| 17 | |
| 18 | The qualitative form of Chebotarev's theorem used in the proof: `New.chebotarev`, deduced from |
| 19 | Tau Ceti's Chebotarev density theorem for primes of residue degree one over `ℚ` |
| 20 | (`NumberField.Chebotarev.infinite_frobeniusPrimeSet_inter_setOf_inertiaDeg_eq_one`). |
| 21 | |
| 22 | Notions from other files: |
| 23 | * `New.IsFrob`: `σ` stabilises the valuation subring `A` and `σ • x ≡ x ^ q` modulo the maximal |
| 24 | ideal for all `x ∈ A`. |
| 25 | * `New.IsPlaceOver`: `IsPlaceOver A v` says that the valuation subring `A` of `Ω` lies over the |
| 26 | prime `v` of `K`: an integer of `K` is in the maximal ideal of `A` exactly when it lies in `v`. |
| 27 | |
| 28 | ## Relation to the literature |
| 29 | |
| 30 | Known result: Chebotarev's density theorem, existence form. Only existence is proved, namely that |
| 31 | Frobenius elements at primes of degree one outside a finite set are dense in the absolute Galois |
| 32 | group, and no density value is given. The proof here goes through Tau Ceti's degree-one Chebotarev |
| 33 | density theorem. Source: J. S. Milne, Class Field Theory, VIII 7.4; Stevenhagen–Lenstra, |
| 34 | Chebotarëv and his density theorem, Math. Intelligencer 18 (1996). |
| 35 | -/ |
| 36 | |
| 37 | @[expose] public section |
| 38 | |
| 39 | open Subgroup New Nat |
| 40 | open scoped NumberField |
| 41 | |
| 42 | /-- If `w` is a finite place of a finite normal intermediate field `L / K` lying over |
| 43 | `v : FinPlace K` and `τ : Gal(Ω/K)` is an arithmetic Frobenius at `placeOver w` for `v.q`, then the |
| 44 | restriction `τ.restrictNormal L` is an arithmetic Frobenius at `w.asIdeal` over `𝓞 K`. -/ |
| 45 | private lemma New.IsFrob.isArithFrobAt_restrictNormal {K : Type} [Field K] [NumberField K] |
| 46 | [Algebra K Ω] {L : IntermediateField K Ω} [Normal K L] [NumberField L] |
| 47 | {v : FinPlace K} {w : FinPlace L} [w.asIdeal.LiesOver v.asIdeal] {τ : Gal(Ω/K)} |
| 48 | (hτ : IsFrob (placeOver w) v.q τ) : |
| 49 | IsArithFrobAt (𝓞 K) (τ.restrictNormal L) w.asIdeal := by |
| 50 | intro x |
| 51 | have h_mem : τ.restrictNormal L • x - x ^ v.q ∈ w.asIdeal := |
| 52 | w.isPlaceOver_placeOver.sub_pow_mem_asIdeal hτ (by simp [AlgEquiv.restrictNormal_commutes]) |
| 53 | simpa [← w.asIdeal.over_def v.asIdeal, FinPlace.q, Ideal.absNorm_apply, Submodule.cardQuot_apply] |
| 54 | using h_mem |
| 55 | |
| 56 | /-- Chebotarev's theorem, existence form (no density is given). Let `W` be a nonempty open subset of |
| 57 | the absolute Galois group `Gal(Ω/K)` of the number field `K`, and `S` a finite set of finite places |
| 58 | of `K`. Then (a) some place `v ∉ S` has prime norm `v.q` (the size of its residue field), with a |
| 59 | place `A` of `Ω` over it (a valuation subring, `New.IsPlaceOver`); (b) some arithmetic Frobenius |
| 60 | at `A` for `v.q` lies in `W`; (c) every arithmetic Frobenius at `A` for `v.q` lies in `W`. -/ |
| 61 | lemma New.chebotarev {K : Type} [Field K] [NumberField K] [Algebra K Ω] {W : Set Gal(Ω/K)} |
| 62 | (hW : IsOpen W) (hW_ne : W.Nonempty) {S : Set (FinPlace K)} (hS : S.Finite) : |
| 63 | -- (a) |
| 64 | ∃ v : FinPlace K, v ∉ S ∧ |
| 65 | v.q.Prime ∧ |
| 66 | ∃ A : ClosurePlace, |
| 67 | IsPlaceOver A v ∧ |
| 68 | -- (b) |
| 69 | ∃ σ ∈ W, |
| 70 | IsFrob A v.q σ ∧ |
| 71 | -- (c) |
| 72 | ∀ τ : Gal(Ω/K), IsFrob A v.q τ → τ ∈ W := by |
| 73 | -- Take `g ∈ W`, an open normal `U` with `g U ⊆ W`, and its finite Galois fixed field `L`. |
| 74 | -- Tau Ceti's Chebotarev theorem gives a prime `v ∉ S` of residue degree one over `ℚ`, unramified |
| 75 | -- in `L`, whose Artin class in `Gal(L/K)` is that of `g|_L`. |
| 76 | obtain ⟨g, hg_mem⟩ : ∃ g : Gal(Ω/K), g ∈ W := hW_ne |
| 77 | have h_one_mem : (1 : Gal(Ω/K)) ∈ (fun x : Gal(Ω/K) ↦ g * x) ⁻¹' W := by simpa using hg_mem |
| 78 | obtain ⟨⟨U, hU_normal⟩, hU : ∀ x ∈ U.toSubgroup, g * x ∈ W⟩ := |
| 79 | ProfiniteGrp.exist_openNormalSubgroup_sub_open_nhds_of_one |
| 80 | (hW.preimage (continuous_const_mul g)) h_one_mem |
| 81 | have : Fact U.toSubgroup.IsOpen := ⟨U.isOpen'⟩ |
| 82 | let L : IntermediateField K Ω := fixedFieldOf U.toSubgroup |
| 83 | let gL : L ≃ₐ[K] L := g.restrictNormal L |
| 84 | have h_inf : |
| 85 | (NumberField.Chebotarev.frobeniusPrimeSet K L (ConjClasses.mk gL) ∩ |
| 86 | {v : FinPlace K | v.asIdeal.inertiaDeg ℤ = 1}).Infinite := |
| 87 | NumberField.Chebotarev.infinite_frobeniusPrimeSet_inter_setOf_inertiaDeg_eq_one K L _ |
| 88 | obtain ⟨(v : FinPlace K), ⟨hv_frob, hv_deg⟩, hv_notMem⟩ := (h_inf.sdiff hS).nonempty |
| 89 | have hv_prime : v.q.Prime := by |
| 90 | rw [FinPlace.q, TauCeti.absNorm_eq_rationalPrimeBelow_pow, hv_deg, pow_one] |
| 91 | exact TauCeti.prime_rationalPrimeBelow v |
| 92 | -- Realise `gL` as the arithmetic Frobenius at a prime `Q` of `𝓞 L` over `v`, and lift `Q` to a |
| 93 | -- place `A = placeOver w` of `Ω`. |
| 94 | obtain ⟨⟨Q, hQ_prime, hQ_over⟩, hgL_frob⟩ := |
| 95 | NumberField.Chebotarev.exists_isArithFrobAt_of_mem_frobeniusPrimeSet_mk hv_frob |
| 96 | have : Algebra.IsUnramifiedAt (𝓞 K) Q := |
| 97 | NumberField.Chebotarev.isUnramifiedAt_of_mem_frobeniusPrimeSet hv_frob Q |
| 98 | let w : FinPlace L := ⟨Q, hQ_prime, Ideal.ne_bot_of_liesOver_of_ne_bot v.ne_bot Q⟩ |
| 99 | have hw_below : w.below K = v := |
| 100 | IsDedekindDomain.HeightOneSpectrum.ext (Q.over_def v.asIdeal).symm |
| 101 | have hA : IsPlaceOver (placeOver w) v := by |
| 102 | rw [← hw_below] |
| 103 | exact w.isPlaceOver_placeOver.isPlaceOver_below |
| 104 | -- Every Frobenius `τ` at `placeOver w` restricts to an arithmetic Frobenius at `Q`, hence agrees |
| 105 | -- with `gL` on `L` by unramifiedness; so `g⁻¹ * τ ∈ U` and `τ ∈ W`. |
| 106 | have h_all (τ : Gal(Ω/K)) (hτ : IsFrob (placeOver w) v.q τ) : τ ∈ W := by |
| 107 | have hτL : IsArithFrobAt (𝓞 K) (τ.restrictNormal L) Q := hτ.isArithFrobAt_restrictNormal |
| 108 | have h_eq : τ.restrictNormal L = gL := |
| 109 | NumberField.isArithFrobAt_eq_of_isUnramifiedAt hτL hgL_frob |
| 110 | have h_mem : g⁻¹ * τ ∈ U.toSubgroup := by |
| 111 | rw [← fixingSubgroup_fixedFieldOf (Γ := Gal(Ω/K)) (K := K) (H := U.toSubgroup)] |
| 112 | change g⁻¹ * τ ∈ L.fixingSubgroup |
| 113 | rw [← L.restrictNormalHom_ker, MonoidHom.mem_ker, map_mul, map_inv, inv_mul_eq_one] |
| 114 | exact h_eq.symm |
| 115 | simpa using hU _ h_mem |
| 116 | obtain ⟨σ, hσ⟩ := hA.exists_isFrob Gal(Ω/K) |
| 117 | exact ⟨v, hv_notMem, hv_prime, placeOver w, hA, σ, h_all σ hσ, hσ, h_all⟩ |
| 118 | |
| 119 | /-- Choose distinct finite primes outside `S` whose Frobenius elements lie in prescribed nonempty |
| 120 | open subsets of the absolute Galois group, one prime for each index in a finite family. -/ |
| 121 | lemma New.chebotarev_family {K ι : Type} [Field K] [NumberField K] [Algebra K Ω] [Finite ι] |
| 122 | {W : ι → Set Gal(Ω/K)} (hW : ∀ i, IsOpen (W i)) (hW_ne : ∀ i, (W i).Nonempty) |
| 123 | {S : Set (FinPlace K)} (hS : S.Finite) : |
| 124 | ∃ (v : ι → FinPlace K) (A : ι → ClosurePlace) (σ : ι → Gal(Ω/K)), |
| 125 | Function.Injective v ∧ ∀ i, v i ∉ S ∧ IsPlaceOver (A i) (v i) ∧ σ i ∈ W i ∧ |
| 126 | IsFrob (A i) (v i).q (σ i) := by |
| 127 | classical |
| 128 | -- Make a sequence of choices, each avoiding every prime in the earlier families. |
| 129 | have h_choose (T : Set (ι → FinPlace K)) (hT : T.Finite) : |
| 130 | ∃ v : ι → FinPlace K, ∀ i, |
| 131 | (v i ∉ S ∧ v i ∉ T.seq Set.univ) ∧ |
| 132 | ∃ A : ClosurePlace, IsPlaceOver A (v i) ∧ ∃ σ ∈ W i, IsFrob A (v i).q σ := by |
| 133 | choose v hv _hprime A hA σ hσ hfrob _hall using fun i ↦ |
| 134 | chebotarev (hW i) (hW_ne i) (hS.union (hT.seq Set.finite_univ)) |
| 135 | exact ⟨v, fun i ↦ ⟨not_or.mp (hv i), A i, hA i, σ i, hσ i, hfrob i⟩⟩ |
| 136 | obtain ⟨u, hu⟩ := Set.seq_of_forall_finite_exists h_choose |
| 137 | -- Take each index from a different family in the sequence. |
| 138 | obtain ⟨e, he⟩ := exists_injective_nat ι |
| 139 | choose hv A hA σ hσ hfrob using fun i : ι ↦ hu (e i) i |
| 140 | have h_avoid (i : ι) : ∀ n < e i, ∀ j : ι, u n j ≠ u (e i) i := by |
| 141 | simpa [Set.mem_seq_iff] using (hv i).2 |
| 142 | exact ⟨fun i ↦ u (e i) i, A, σ, by grind [Function.Injective], |
| 143 | fun i ↦ ⟨(hv i).1, hA i, hσ i, hfrob i⟩⟩ |