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 Mathlib.NumberTheory.Cyclotomic.CyclotomicCharacter |
| 4 | public import Mathlib.Order.CompletePartialOrder |
| 5 | public import Mathlib.RingTheory.IsGaloisGroup.Defs |
| 6 | import Mathlib.Algebra.Pointwise.Stabilizer |
| 7 | import Mathlib.RingTheory.SimpleRing.Principal |
| 8 | import TauCeti.RingTheory.Valuation.ValuationSubring |
| 9 | public import Lib.Speed |
| 10 | |
| 11 | /-! |
| 12 | # Vocabulary of Galois theory: places, decomposition, Frobenius elements and inertia |
| 13 | |
| 14 | This file sets up the vocabulary of Galois theory used by the cohomology files. A Galois group is an |
| 15 | abstract group `Γ` acting on a field `Ω`, and a place of `Ω` is a valuation subring `A`. |
| 16 | `New.IsFrob A q σ` says that `σ` stabilises `A` and that `σ • x - x ^ q` lies in the maximal ideal |
| 17 | for every `x` in `A`. Inertia is the case `q = 1`. |
| 18 | |
| 19 | * `New.IsProGalois`, `New.IsLocalGalois`: `Γ` is the profinite Galois group of `Ω / K`; in the local |
| 20 | case `Ω` is moreover algebraically closed of characteristic `0`, `Γ` stabilises `A`, and `A ∩ K` |
| 21 | (`New.valRingBelow`) is a discrete valuation ring with finite residue field. |
| 22 | * `New.decompGroup`, `New.inertiaGroup`, `New.IsFrob`, `New.IsPlaceOver`: decomposition group, |
| 23 | inertia group, Frobenius elements, and places over a nonzero prime of the ring of integers |
| 24 | `𝓞 K` of a field `K`. |
| 25 | * `New.IsComplexConj`, `New.cyclotomicChar`, `New.cyclotomicCharIn`: complex conjugations and the |
| 26 | `l`-adic cyclotomic character. |
| 27 | |
| 28 | Notions from Mathlib used in the statements: |
| 29 | * `A : ValuationSubring Ω`: a subring that contains `x` or `x⁻¹` for every nonzero `x`, with its |
| 30 | valuation `A.valuation`; `A.valuation x ≤ 1` means `x ∈ A`, and `< 1` means `x` lies in the |
| 31 | maximal ideal. |
| 32 | * `IsGaloisGroup Γ K Ω`: `Γ` acts faithfully on `Ω`, fixing `K`, and the elements of `Ω` fixed by |
| 33 | `Γ` are those of `K`. |
| 34 | |
| 35 | ## Relation to the literature |
| 36 | |
| 37 | Known; see `Lib.ClassField.Places.LocalFields` for sources. |
| 38 | -/ |
| 39 | |
| 40 | @[expose] public section |
| 41 | |
| 42 | noncomputable section |
| 43 | |
| 44 | open NumberField Pointwise MulAction Units MulSemiringAction ValuationSubring SetLike |
| 45 | |
| 46 | namespace New |
| 47 | |
| 48 | /-- The field `Ω` is an algebraic closure of `ℚ`: it has characteristic zero, is algebraically |
| 49 | closed and is algebraic over `ℚ`. -/ |
| 50 | def Ω : Type := AlgebraicClosure ℚ |
| 51 | deriving Field, IsAlgClosed, CharZero |
| 52 | |
| 53 | instance : Algebra.IsAlgebraic ℚ Ω := AlgebraicClosure.isAlgebraic ℚ |
| 54 | |
| 55 | /-- The type of valuation subrings of `New.Ω`, the algebraic closure of `ℚ`. -/ |
| 56 | abbrev ClosurePlace : Type := ValuationSubring Ω |
| 57 | |
| 58 | /-- The element c of Γ is a complex conjugation: for some embedding j : Ω → ℂ, j(cx) is the |
| 59 | complex conjugate of j(x) for all x. -/ |
| 60 | def IsComplexConj {Γ : Type*} [SMul Γ Ω] (c : Γ) : Prop := |
| 61 | ∃ j : Ω →+* ℂ, ∀ x : Ω, j (c • x) = star (j x) |
| 62 | |
| 63 | variable (O Γ : Type*) |
| 64 | (K Ω : outParam Type*) [Group Γ] [Field K] [Field Ω] [Algebra K Ω] [MulSemiringAction Γ Ω] |
| 65 | (l : ℕ) [Fact l.Prime] [CommRing O] [Algebra ℤ_[l] O] |
| 66 | |
| 67 | /-- The multiplicative group Ω^×, written additively; it is given the discrete topology. -/ |
| 68 | abbrev DiscreteUnits : Type _ := Additive Ωˣ |
| 69 | |
| 70 | instance : TopologicalSpace (DiscreteUnits Ω) := ⊥ |
| 71 | |
| 72 | instance : DiscreteTopology (DiscreteUnits Ω) := ⟨rfl⟩ |
| 73 | |
| 74 | /-! ### Profinite and local Galois groups -/ |
| 75 | |
| 76 | /-- The profinite group Γ acts on the Galois extension Ω/K as its Galois group, with open |
| 77 | stabilisers. -/ |
| 78 | class IsProGalois [TopologicalSpace Γ] extends IsGaloisGroup Γ K Ω, IsGalois K Ω, |
| 79 | IsTopologicalGroup Γ, CompactSpace Γ, TotallyDisconnectedSpace Γ where |
| 80 | /-- The stabiliser of every element of `Ω` is open in `Γ`. -/ |
| 81 | isOpen_stabilizer (x : Ω) : IsOpen (stabilizer Γ x : Set Γ) |
| 82 | |
| 83 | /-- A place `A` of `Ω` is read as its valuation: `A x`. -/ |
| 84 | scoped instance : CoeFun (ValuationSubring Ω) (Ω → ·.ValueGroup) := ⟨(·.valuation)⟩ |
| 85 | |
| 86 | variable {Ω} (A : ValuationSubring Ω) |
| 87 | |
| 88 | /-- The decomposition group of a valuation subring A of Ω: the elements of Γ mapping A onto |
| 89 | itself. -/ |
| 90 | abbrev decompGroup : Subgroup Γ := stabilizer Γ A |
| 91 | |
| 92 | /-- For a valuation subring A of Ω and x in K, the value of the image of x in Ω under the |
| 93 | multiplicative valuation attached to A. -/ |
| 94 | abbrev valuationVia (x : K) : A.ValueGroup := A (algebraMap K Ω x) |
| 95 | |
| 96 | /-- The valuation subring A ∩ K of K. -/ |
| 97 | abbrev valRingBelow : ValuationSubring K := (A.valuation.comap (algebraMap K Ω)).valuationSubring |
| 98 | |
| 99 | /-- Γ = Gal(Ω/K) with Ω algebraically closed of characteristic 0 stabilises A, and A ∩ K is a |
| 100 | discrete valuation ring with finite residue field. The field K need not be complete. -/ |
| 101 | class IsLocalGalois (A : outParam (ValuationSubring Ω)) |
| 102 | [TopologicalSpace Γ] extends IsProGalois Γ K Ω, IsAlgClosed Ω, CharZero Ω where |
| 103 | /-- Every element of `Γ` maps the valuation ring `A` to itself. -/ |
| 104 | mem_decompGroup (g : Γ) : g ∈ decompGroup Γ A |
| 105 | /-- The valuation ring of `K` under `A` is a discrete valuation ring. -/ |
| 106 | isDiscreteValuationRing : IsDiscreteValuationRing (valRingBelow K A) |
| 107 | /-- The residue field of the valuation ring of `K` under `A` is finite. -/ |
| 108 | finite_residue : Finite (IsLocalRing.ResidueField (valRingBelow K A)) |
| 109 | |
| 110 | variable {Γ K} (v : IsDedekindDomain.HeightOneSpectrum (𝓞 K)) |
| 111 | |
| 112 | /-- The ℤ-linear representation of Γ on Ω^× (written additively) coming from the action of Γ on |
| 113 | the field Ω by ring automorphisms. -/ |
| 114 | def unitsRep : Representation ℤ Γ (DiscreteUnits Ω) := |
| 115 | letI : MulDistribMulAction Γ Ωˣ := mulDistribMulActionRight |
| 116 | Representation.ofMulDistribMulAction Γ Ωˣ |
| 117 | |
| 118 | /-! ### Frobenius elements, places and inertia -/ |
| 119 | |
| 120 | /-- `σ` stabilises the valuation subring `A` and `σ • x ≡ x ^ q` modulo the maximal ideal for all |
| 121 | `x ∈ A`. For `q` the order of the residue field of the base this is an arithmetic Frobenius; |
| 122 | for `q = 1` it is membership in the inertia group `New.inertiaGroup`. -/ |
| 123 | def IsFrob (q : ℕ) (σ : Γ) : Prop := |
| 124 | σ ∈ decompGroup Γ A ∧ ∀ x : Ω, A.valuation x ≤ 1 → A.valuation (σ • x - x ^ q) < 1 |
| 125 | |
| 126 | /-- The valuation subring `A` of `Ω` lies over the nonzero prime `v` of the ring of integers `𝓞 K`: |
| 127 | an element of `𝓞 K` is in the maximal ideal of `A` exactly when it lies in `v`. -/ |
| 128 | def IsPlaceOver : Prop := ∀ x : 𝓞 K, A.valuation (algebraMap K Ω x) < 1 ↔ x ∈ v.asIdeal |
| 129 | |
| 130 | end New |
| 131 | |
| 132 | namespace New |
| 133 | |
| 134 | variable (O : Type*) {Γ : Type*} {K Ω : outParam Type*} [Group Γ] [Field K] [Field Ω] [Algebra K Ω] |
| 135 | [MulSemiringAction Γ Ω] (l : ℕ) [Fact l.Prime] [CommRing O] [Algebra ℤ_[l] O] |
| 136 | {A : ValuationSubring Ω} {q : ℕ} {σ τ g : Γ} |
| 137 | {Γ' Ω' : Type*} [Group Γ'] [Field Ω'] [MulSemiringAction Γ' Ω'] |
| 138 | {φ : Γ' → Γ} {j : Ω →+* Ω'} {A' : ValuationSubring Ω'} {q' : ℕ} |
| 139 | |
| 140 | lemma IsFrob.mem_decompGroup (h : IsFrob A q σ) : σ ∈ decompGroup Γ A := h.left |
| 141 | |
| 142 | /-- A Frobenius element for `q` sends each `x` of `A` to `x ^ q` modulo the maximal ideal of `A`. -/ |
| 143 | lemma IsFrob.valuation_sub_pow_lt_one (h : IsFrob A q σ) {x : Ω} (hx : A.valuation x ≤ 1) : |
| 144 | A.valuation (σ • x - x ^ q) < 1 := |
| 145 | h.right x hx |
| 146 | |
| 147 | lemma mem_decompGroup_iff : σ ∈ decompGroup Γ A ↔ ∀ x : Ω, σ • x ∈ A ↔ x ∈ A := |
| 148 | ext'_iff.trans mem_stabilizer_set |
| 149 | |
| 150 | lemma conj_mem_decompGroup_smul (hσ : σ ∈ decompGroup Γ A) : |
| 151 | g * σ * g⁻¹ ∈ decompGroup Γ (g • A) := by |
| 152 | simp [mem_stabilizer_iff, mul_smul, mem_stabilizer_iff.mp hσ] |
| 153 | |
| 154 | lemma isEquiv_comap : (comap A' j).valuation.IsEquiv (A'.valuation.comap j) := |
| 155 | Valuation.isEquiv_of_val_le_one fun {x} ↦ by |
| 156 | rw [valuation_le_one_iff, mem_comap, Valuation.comap_apply, valuation_le_one_iff] |
| 157 | |
| 158 | lemma comap_apply_lt_one_iff {x : Ω} : (comap A' j) x < 1 ↔ A' (j x) < 1 := |
| 159 | isEquiv_comap.lt_one_iff_lt_one |
| 160 | |
| 161 | lemma smul_apply_smul_lt_one_iff (g : Γ) {x : Ω} : (g • A) (g • x) < 1 ↔ A x < 1 := by |
| 162 | rw [pointwise_smul_eq_comap, comap_apply_lt_one_iff] |
| 163 | simp |
| 164 | |
| 165 | /-- Let `j : Ω → Ω'` be a ring map and `φ : Γ' → Γ` a map with `j (φ g • x) = g • j x` |
| 166 | (`h_equivariant`). If `s` stabilises `A'`, then `φ s` stabilises the pulled-back subring |
| 167 | `A'.comap j`. -/ |
| 168 | lemma decompGroup.map (h_equivariant : ∀ (g : Γ') (x : Ω), j (φ g • x) = g • j x) |
| 169 | {A' : ValuationSubring Ω'} {s : Γ'} (hs : s ∈ decompGroup Γ' A') : |
| 170 | φ s ∈ decompGroup Γ (A'.comap j) := by |
| 171 | rw [mem_decompGroup_iff] at hs ⊢ |
| 172 | intro x |
| 173 | rw [mem_comap, mem_comap, h_equivariant s x, hs] |
| 174 | |
| 175 | /-- Let `j : Ω → Ω'` be a ring map and `φ : Γ' → Γ` a map with `j (φ g • x) = g • j x` |
| 176 | (`h_equivariant`). If `s` is a Frobenius element for `q` at `A'`, then `φ s` is one at the |
| 177 | pulled-back subring `A'.comap j`. -/ |
| 178 | lemma IsFrob.map (h_equivariant : ∀ (g : Γ') (x : Ω), j (φ g • x) = g • j x) |
| 179 | {A' : ValuationSubring Ω'} {s : Γ'} (hs_frob : IsFrob A' q s) : |
| 180 | IsFrob (A'.comap j) q (φ s) := by |
| 181 | refine ⟨decompGroup.map h_equivariant hs_frob.mem_decompGroup, fun x hx ↦ ?_⟩ |
| 182 | have hjx : A'.valuation (j x) ≤ 1 := by |
| 183 | rwa [valuation_le_one_iff, mem_comap, ← valuation_le_one_iff] at hx |
| 184 | have h_image : j (φ s • x - x ^ q) = s • j x - j x ^ q := by |
| 185 | rw [map_sub, map_pow, h_equivariant s x] |
| 186 | rw [comap_apply_lt_one_iff, h_image] |
| 187 | exact hs_frob.valuation_sub_pow_lt_one hjx |
| 188 | |
| 189 | /-! ### The calculus of Frobenius elements -/ |
| 190 | |
| 191 | open IsLocalRing Polynomial in |
| 192 | /-- On an infinite residue field, a Frobenius element determines its exponent. The two power maps |
| 193 | agree on every residue, so their monomials have equal degree. -/ |
| 194 | lemma IsFrob.exponent_eq [Infinite (ResidueField A)] (h : IsFrob A q σ) (h' : IsFrob A q' σ) : |
| 195 | q = q' := by |
| 196 | have power {n : ℕ} (hn : IsFrob A n σ) (x : A) : |
| 197 | residue A ⟨σ • (x : Ω), (mem_decompGroup_iff.mp hn.1 _).2 x.2⟩ = residue A x ^ n := by |
| 198 | rw [← map_pow] |
| 199 | exact (Ideal.Quotient.mk_eq_mk_iff_sub_mem _ _).2 <| (A.valuation_lt_one_iff _).2 <| |
| 200 | hn.valuation_sub_pow_lt_one ((A.valuation_le_one_iff _).2 x.2) |
| 201 | have eq : (X : (ResidueField A)[X]) ^ q = X ^ q' := by |
| 202 | apply Polynomial.funext |
| 203 | intro z |
| 204 | obtain ⟨x, rfl⟩ := residue_surjective z |
| 205 | simpa only [eval_pow, eval_X] using (power h x).symm.trans (power h' x) |
| 206 | simpa only [natDegree_X_pow] using congrArg natDegree eq |
| 207 | |
| 208 | /-- If `σ` is a Frobenius element for `q` at `A`, then `g * σ * g⁻¹` is one at `g • A`. -/ |
| 209 | lemma IsFrob.conj (h : IsFrob A q σ) (g : Γ) : IsFrob (g • A) q (g * σ * g⁻¹) := by |
| 210 | refine ⟨conj_mem_decompGroup_smul h.mem_decompGroup, fun x hx ↦ ?_⟩ |
| 211 | -- Put `y = g⁻¹ • x`: it lies in `A`, and `(g σ g⁻¹) • x - x ^ q = g • (σ • y - y ^ q)`. |
| 212 | have hy : A.valuation (g⁻¹ • x) ≤ 1 := by |
| 213 | rwa [valuation_le_one_iff, mem_pointwise_smul_iff_inv_smul_mem, ← valuation_le_one_iff] at hx |
| 214 | have h_eq : (g * σ * g⁻¹) • x - x ^ q = g • (σ • (g⁻¹ • x) - (g⁻¹ • x) ^ q) := by |
| 215 | simp [smul_sub, smul_pow', mul_smul] |
| 216 | rw [h_eq] |
| 217 | exact (smul_apply_smul_lt_one_iff g).mpr (h.valuation_sub_pow_lt_one hy) |
| 218 | |
| 219 | /-- Let `σ` be a Frobenius element for `q` at `A`. Then `σ τ` is a Frobenius element for `q * q'` |
| 220 | if and only if `τ` is one for `q'`. -/ |
| 221 | lemma IsFrob.mul_iff (h : IsFrob A q σ) : IsFrob A (q * q') (σ * τ) ↔ IsFrob A q' τ := by |
| 222 | refine (mul_mem_cancel_left h.mem_decompGroup).and (forall₂_congr fun x hx ↦ ?_) |
| 223 | -- `σ τ x - x ^ (q * q') = σ (τ x - x ^ q') + (σ y - y ^ q)` with `y = x ^ q'`; the last term is |
| 224 | -- small as `σ` is a Frobenius, and `σ` preserves smallness as it stabilises `A` |
| 225 | have h_small : σ • x ^ q' - (x ^ q') ^ q ∈ A.nonunits := |
| 226 | h.valuation_sub_pow_lt_one (by simpa using pow_le_one' hx q') |
| 227 | have h_split : |
| 228 | (σ * τ) • x - x ^ (q * q') = σ • (τ • x - x ^ q') + (σ • x ^ q' - (x ^ q') ^ q) := by |
| 229 | rw [mul_smul, smul_sub, pow_mul'] |
| 230 | abel |
| 231 | have hσ_stab : σ • A = A := h.mem_decompGroup |
| 232 | calc |
| 233 | _ ↔ A.valuation (σ • (τ • x - x ^ q')) < 1 := by |
| 234 | rw [h_split, ← ValuationSubring.mem_nonunits_iff, add_mem_cancel_right h_small, |
| 235 | ValuationSubring.mem_nonunits_iff] |
| 236 | _ ↔ (σ • A).valuation (σ • (τ • x - x ^ q')) < 1 := by rw [hσ_stab] |
| 237 | _ ↔ A.valuation (τ • x - x ^ q') < 1 := smul_apply_smul_lt_one_iff σ |
| 238 | |
| 239 | lemma isFrob_one_one : IsFrob A 1 (1 : Γ) := |
| 240 | ⟨one_mem _, fun x _ ↦ by simp⟩ |
| 241 | |
| 242 | lemma IsFrob.pow (h : IsFrob A q σ) (n : ℕ) : IsFrob A (q ^ n) (σ ^ n) := by |
| 243 | induction n with |
| 244 | | zero => simpa using isFrob_one_one |
| 245 | | succ n ih => |
| 246 | rw [pow_succ, pow_succ] |
| 247 | exact ih.mul_iff.mpr h |
| 248 | |
| 249 | variable (Γ A) in |
| 250 | /-- The inertia group of A: the σ in Γ stabilising the valuation subring A with σx − x in the |
| 251 | maximal ideal for every x in A. -/ |
| 252 | def inertiaGroup : Subgroup Γ where |
| 253 | carrier := {σ : Γ | IsFrob A 1 σ} |
| 254 | mul_mem' hσ hτ := hσ.mul_iff.2 hτ |
| 255 | one_mem' := by simp [↓ IsFrob] |
| 256 | inv_mem' hσ := hσ.mul_iff.1 (by simp [↓ IsFrob]) |
| 257 | |
| 258 | lemma mem_inertiaGroup_iff : σ ∈ inertiaGroup Γ A ↔ IsFrob A 1 σ := Iff.rfl |
| 259 | |
| 260 | /-- An element that stabilises the place conjugates its inertia group into itself. -/ |
| 261 | lemma conj_mem_inertiaGroup_of_mem_decompGroup {g : Γ} (hg : g ∈ decompGroup Γ A) |
| 262 | (hσ : σ ∈ inertiaGroup Γ A) : g * σ * g⁻¹ ∈ inertiaGroup Γ A := by |
| 263 | have h := hσ.conj g |
| 264 | rwa [MulAction.mem_stabilizer_iff.mp hg] at h |
| 265 | |
| 266 | /-- Two Frobenius elements `σ`, `τ` for the same `q` at `A` differ by inertia: `σ⁻¹ τ` lies in the |
| 267 | inertia group. -/ |
| 268 | lemma IsFrob.inv_mul_mem_inertiaGroup (h : IsFrob A q σ) (hτ : IsFrob A q τ) : |
| 269 | σ⁻¹ * τ ∈ inertiaGroup Γ A := by |
| 270 | rw [mem_inertiaGroup_iff, ← h.mul_iff, mul_one, _root_.mul_inv_cancel_left] |
| 271 | exact hτ |
| 272 | |
| 273 | variable (Ω) |
| 274 | |
| 275 | /-- The `l`-adic cyclotomic character Γ → ℤ_l^× of a group Γ acting on the field Ω by ring |
| 276 | automorphisms. -/ |
| 277 | def cyclotomicChar : Γ →* ℤ_[l]ˣ := (cyclotomicCharacter Ω l).comp (toRingAut Γ Ω) |
| 278 | |
| 279 | /-- The `l`-adic cyclotomic character of Γ composed with ℤ_l^× → O^×, for a commutative |
| 280 | ℤ_l-algebra O. -/ |
| 281 | abbrev cyclotomicCharIn : Γ →* Oˣ := (map (algebraMap ℤ_[l] O).toMonoidHom).comp |
| 282 | (cyclotomicChar (Γ := Γ) Ω l) |
| 283 | |
| 284 | end New |
| 285 | |
| 286 | end |