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 | import Mathlib.FieldTheory.Galois.Profinite |
| 4 | import Mathlib.Topology.Sheaves.Presheaf |
| 5 | public import Lib.ClassField.Local.ArtinMap |
| 6 | import Lib.ClassField.Global.AlbertBrauerHasseNoether |
| 7 | import Lib.ClassField.Global.ArtinMap |
| 8 | import Lib.ClassField.Global.ArtinReciprocity |
| 9 | |
| 10 | /-! |
| 11 | # Surjectivity of the Artin map, Hasse's norm theorem and norm groups of cyclic extensions |
| 12 | |
| 13 | Global class field theory for cyclic extensions of a number field `K`, deduced from the reciprocity |
| 14 | law, the second inequality `New.second_inequality` and `New.albert_brauer_hasse_noether`. |
| 15 | |
| 16 | * `New.artinMap_surjective`: the Artin map from the finite ideles onto `Γ^ab` is surjective. |
| 17 | * `New.exists_isProGalois_ker_of_isCyclic`: a cyclic extension `L/K` is cut out by a character. |
| 18 | * `New.hasse_norm`: Hasse's norm theorem, for totally positive elements. |
| 19 | * `New.index_ker_abelianLift_comp_artinMap`, `New.abelianLift_artinMap_eq_one_iff`: if `χ` cuts out |
| 20 | `L`, the kernel of `χ ∘ artinMap` has index `[L : K]` and consists of totally positive elements of |
| 21 | `Kˣ` times norms from `L`. |
| 22 | |
| 23 | Notions from other files: |
| 24 | * `New.Ω` is an algebraic closure of `ℚ`, and `New.EmbeddedNumberField K` is a number field `K` |
| 25 | with an embedding in `Ω`. `New.IsProGalois Γ K Ω` says that `Γ` is the profinite Galois group of |
| 26 | `Ω/K`. |
| 27 | * `New.artinMap Γ` is the global Artin map from the finite ideles `(𝔸f K)ˣ` of `K` to the |
| 28 | topological abelianisation `Γ^ab` of `Γ`, chosen so that a character takes at `artinMap Γ a` the |
| 29 | product of its values at the local Artin symbols of the components of `a`. |
| 30 | * A `χ : New.QZChar Γ` is a continuous character `Γ → ℚ/ℤ`; `New.QZChar.toHom χ` and |
| 31 | `New.QZChar.abelianLift χ` are its multiplicative forms on `Γ` and `Γ^ab`. "`χ` cuts out `L`" is |
| 32 | the instance `IsProGalois (ker χ) L Ω`, with `New.QZChar.ker`. |
| 33 | * `New.IsTotallyPositive x`: every ring homomorphism `K → ℝ` sends `x` to a positive number. |
| 34 | |
| 35 | ## Relation to the literature |
| 36 | |
| 37 | Known; see `Lib.ClassField.Global.AlbertBrauerHasseNoether` for sources. |
| 38 | -/ |
| 39 | |
| 40 | @[expose] public section |
| 41 | |
| 42 | namespace New |
| 43 | |
| 44 | open Subgroup QZChar QuotientGroup Set Module Function IsScalarTower Algebra |
| 45 | |
| 46 | variable (Γ : Type) |
| 47 | {K L : Type} [Group Γ] [TopologicalSpace Γ] [Field K] [EmbeddedNumberField K] |
| 48 | [MulSemiringAction Γ Ω] [IsProGalois Γ K Ω] |
| 49 | (χ : QZChar Γ) [Field L] [EmbeddedNumberField L] [Algebra K L] |
| 50 | |
| 51 | open Pointwise in |
| 52 | /-- The image of the global Artin map from the finite ideles of `K` to `Γ^ab` is closed. -/ |
| 53 | lemma isClosed_range_artinMap : IsClosed (artinMap (K := K) Γ).range.carrier := by |
| 54 | -- `H` is open and contains the totally positive principal ideles, so it has finite index; |
| 55 | -- thus the range is a finite union of translates of the compact image of the unit ideles. |
| 56 | let H : Subgroup (𝔸f K)ˣ := idelesUnitOff ∅ ⊔ (artinMap Γ).ker |
| 57 | have hH_fin : H.FiniteIndex := |
| 58 | finiteIndex_idele_subgroup_of_isOpen H (isOpen_mono le_sup_left (isOpen_idelesUnitOff _)) |
| 59 | fun x hx ↦ mem_sup_right (artinMap_principalIdele_eq_one_of_isTotallyPositive hx) |
| 60 | let C : Set (TopologicalAbelianization Γ) := artinMap Γ '' idelesUnitOff (K := K) ∅ |
| 61 | have h_compact : IsCompact C := isCompact_idelesUnitOff_empty.image (by fun_prop) |
| 62 | have h_range : (artinMap (K := K) Γ).range.carrier = ⋃ q : (𝔸f K)ˣ ⧸ H, artinMap Γ q.out • C := by |
| 63 | change range (artinMap (K := K) Γ) = _ |
| 64 | simp [← image_univ, H, C, univ_eq_iUnion_smul H, image_iUnion, image_smul_distrib, |
| 65 | ← coe_map, Subgroup.map_sup] |
| 66 | rw [h_range] |
| 67 | exact (isCompact_iUnion fun q : (𝔸f K)ˣ ⧸ H ↦ h_compact.smul (artinMap Γ q.out)).isClosed |
| 68 | |
| 69 | /-- The global Artin map from the finite ideles of `K` to the topological abelianisation `Γ^ab` of |
| 70 | the absolute Galois group `Γ` of `K` is surjective. |
| 71 | |
| 72 | A consequence of Artin's global reciprocity law. -/ |
| 73 | lemma artinMap_surjective : Surjective (artinMap (K := K) Γ) := by |
| 74 | -- The range of `artinMap` is closed, so by duality (`mem_of_forall_abelianLift`) it suffices to |
| 75 | -- show that a character `ψ` killing it is trivial. In the fixed field of `ker ψ` every prime |
| 76 | -- splits completely, and counting primes of degree one shows that this field is `K`. |
| 77 | intro σ |
| 78 | rw [← MonoidHom.mem_range] |
| 79 | refine mem_of_forall_abelianLift (isClosed_range_artinMap Γ) σ fun ψ hψ ↦ ?_ |
| 80 | let U : Subgroup Γ := ker ψ |
| 81 | let F : IntermediateField K Ω := fixedFieldOf U |
| 82 | suffices h_index : U.index = 1 by |
| 83 | have h_top : U = ⊤ := index_eq_one.mp h_index |
| 84 | obtain ⟨g, rfl⟩ : ∃ g : Γ, (g : TopologicalAbelianization Γ) = σ := |
| 85 | QuotientGroup.mk_surjective σ |
| 86 | rw [abelianLift_mk, ← QZChar.toHom_apply, ← MonoidHom.mem_ker] |
| 87 | exact h_top.ge (mem_top g) |
| 88 | -- `ψ` kills every local symbol, so all decomposition groups lie in `U` and every `v` splits. |
| 89 | have h_count (v : FinPlace K) : |
| 90 | {w : FinPlace F | w.below K = v ∧ w.q = v.q}.ncard = finrank K F := by |
| 91 | have h_dec : decompGroup Γ (placeOver v) ≤ U := |
| 92 | (v.isPlaceOver_placeOver.artinAt_trivial_iff_decompGroup_le ψ).mp fun x ↦ |
| 93 | hψ (artinAt Γ v x) (MonoidHom.mem_range.mpr ⟨locIdele v x, artinMap_locIdele v x⟩) |
| 94 | have h_same_q (w : FinPlace F) (hw : w.below K = v) : w.q = v.q := |
| 95 | (v.isPlaceOver_placeOver.q_eq_and_comap_ne_self_of_decompGroup_le h_dec w hw).1 |
| 96 | rw [← v.isPlaceOver_placeOver.ncard_above_eq_finrank_of_decompGroup_le (L := F) h_dec] |
| 97 | congr! with w |
| 98 | exact and_iff_left_of_imp (h_same_q w) |
| 99 | -- The family `v ↦ #{places of F over v with the same norm}` has density `1` |
| 100 | -- (`hasPrimeDensity_card_degree_one`); by `h_count` it is the constant `[F : K]`, so |
| 101 | -- `[F : K] ≤ 1`. |
| 102 | have h_re_le : (finrank K F : ℂ).re ≤ (1 : ℂ).re := |
| 103 | (hasPrimeDensity_const (K := K) (finrank K F : ℂ)).re_le_re |
| 104 | (hasPrimeDensity_card_degree_one F 1) (.of_forall fun v _ ↦ by simp [h_count v]) |
| 105 | -- The degree `[F : K]` is the index of `U` (`finrank_fixedFieldOf`). |
| 106 | have h_le : finrank K F ≤ 1 := by simpa using h_re_le |
| 107 | exact (finrank_fixedFieldOf U).symm.trans (h_le.antisymm finrank_pos) |
| 108 | |
| 109 | variable {Γ} [IsScalarTower K L Ω] [hχ : IsProGalois (ker χ) L Ω] [IsGalois K L] |
| 110 | |
| 111 | /-- Let L/K be a cyclic extension of number fields inside an algebraic closure Ω of ℚ. There is |
| 112 | a continuous character χ : Gal(Ω/K) → ℚ/ℤ whose kernel acts on Ω as the Galois group of Ω/L. -/ |
| 113 | lemma exists_isProGalois_ker_of_isCyclic (h_cyc : IsCyclic Gal(L/K)) : |
| 114 | ∃ χ : QZChar Gal(Ω/K), IsProGalois (ker χ) L Ω := by |
| 115 | -- Pull back a faithful character `ψ` of the cyclic group `Gal(L/K)` along restriction `φ`. |
| 116 | let φ : Gal(Ω/K) →ₜ* Gal(L/K) := |
| 117 | ⟨AlgEquiv.restrictNormalHom L, continuous_of_equivariant_emb (algebraMap L Ω) |
| 118 | fun g x ↦ g.restrictNormal_commutes L x⟩ |
| 119 | obtain ⟨ψ, hψ⟩ : ∃ ψ : QZChar Gal(L/K), ker ψ = ⊥ := |
| 120 | exists_ker_eq_of_isCyclic ⟨⊥, by simp⟩ (quotientBot.isCyclic.mpr h_cyc) |
| 121 | refine ⟨comap φ ψ, .of_fixingSubgroup_eq (K := K) ?_⟩ |
| 122 | change _ = (ker ψ).comap φ.toMonoidHom |
| 123 | rw [hψ, MonoidHom.comap_bot] |
| 124 | exact (AlgEquiv.ker_restrictNormalHom (F := K) (K₁ := Ω) L).symm |
| 125 | |
| 126 | omit [EmbeddedNumberField K] [EmbeddedNumberField L] in |
| 127 | variable [NumberField K] [NumberField L] in |
| 128 | /-- Hasse's norm theorem. Let `L / K` be a cyclic extension of number fields. A totally positive `x` |
| 129 | in `K` that is a local norm (a limit of norms from `L` in the completion `LocField v` of `K` at `v`) |
| 130 | at every finite place `v` is a norm. |
| 131 | |
| 132 | A case of the Hasse norm theorem, with x assumed totally positive, which is stronger than being a |
| 133 | local norm at each real place. -/ |
| 134 | lemma hasse_norm [IsCyclic Gal(L/K)] (x : Kˣ) |
| 135 | (h_loc : ∀ v : FinPlace K, |
| 136 | algebraMap K (LocField v) x ∈ closure |
| 137 | (range fun y : L ↦ algebraMap K (LocField v) (Algebra.norm K y))) |
| 138 | (hx_pos : IsTotallyPositive x.val) : |
| 139 | ∃ z : Lˣ, z.map (Algebra.norm K) = x := by |
| 140 | -- Embed `L` in `Ω` and let `χ` cut it out. Then `x` is a norm exactly when the symbol `(χ, x)` |
| 141 | -- vanishes in the Brauer group, which by Albert–Brauer–Hasse–Noether |
| 142 | -- (`albert_brauer_hasse_noether`) can be checked place by place; total positivity takes care of |
| 143 | -- the real places. |
| 144 | algebraize [Ω.fieldEmb L, (Ω.fieldEmb L).comp (algebraMap K L)] |
| 145 | obtain ⟨χ, hχ⟩ := exists_isProGalois_ker_of_isCyclic (K := K) (L := L) inferInstance |
| 146 | -- `α` is the symbol `(χ, x)` in the Brauer group. |
| 147 | set α : (unitsModule Gal(Ω/K)).H2 := |
| 148 | cyclicClass (unitsModule Gal(Ω/K)).ρ χ (DiscreteUnits.ofBase Gal(Ω/K) Ω (Additive.ofMul x)) |
| 149 | obtain ⟨U, hU_conj, hU_res⟩ : ∃ U : OpenSubgroup Gal(Ω/K), |
| 150 | (∀ c : Gal(Ω/K), IsComplexConj c → c ∈ U) ∧ (unitsModule Gal(Ω/K)).resH2 U α = 0 := |
| 151 | hx_pos.exists_resH2_cyclicClass_eq_zero (χ := χ) |
| 152 | -- At a finite place `v` the symbol vanishes since `x` is a limit of norms in `K_v`. |
| 153 | have h_dec {A : ClosurePlace} {v : FinPlace K} (hv : IsPlaceOver A v) : |
| 154 | (unitsModule Gal(Ω/K)).resH2 (decompGroup Gal(Ω/K) A) α = 0 := |
| 155 | hv.abelianLift_artinAt_eq_one_iff.mp (abelianLift_artinAt_eq_one_of_mem_closure (h_loc v)) |
| 156 | have hα_zero : α = 0 := albert_brauer_hasse_noether α h_dec U hU_conj hU_res |
| 157 | exact (cyclicClass_eq_zero_iff_norm (J := hχ) x).mp hα_zero |
| 158 | |
| 159 | omit [IsGalois K L] in |
| 160 | /-- If the kernel of `χ` is the Galois group of `Ω / L`, then the kernel of `χ ∘ artinMap` has index |
| 161 | `[L : K]` in the finite ideles of `K`. -/ |
| 162 | lemma index_ker_abelianLift_comp_artinMap : |
| 163 | ((abelianLift χ).comp (artinMap Γ)).ker.index = finrank K L := by |
| 164 | -- The index of `(abelianLift χ).ker` is unchanged by pulling back along the surjection |
| 165 | -- `artinMap Γ`, and along the quotient map from `Γ`, where the kernel becomes the group `ker χ` |
| 166 | -- fixing `L`. |
| 167 | calc |
| 168 | _ = (abelianLift χ).ker.index := index_comap_of_surjective _ (artinMap_surjective _) |
| 169 | _ = (ker χ).index := (index_comap_of_surjective _ (mk'_surjective _)).symm |
| 170 | _ = finrank K L := (eq_fixingSubgroup_of_isProGalois (Γ := Γ) (L := L)).right |
| 171 | |
| 172 | /-- The norm group of the extension `L / K` cut out by `χ`: a finite idele `a` of `K` is killed by |
| 173 | `χ ∘ artinMap` exactly when it is a totally positive element of `Kˣ` times the norm of a finite |
| 174 | idele of `L`. A case of the Artin reciprocity law. -/ |
| 175 | lemma abelianLift_artinMap_eq_one_iff (a : (𝔸f K)ˣ) : |
| 176 | abelianLift χ (artinMap Γ a) = 1 ↔ |
| 177 | ∃ (x : Kˣ) (y : (𝔸f L)ˣ), |
| 178 | IsTotallyPositive x.val ∧ a = principalIdele x * Units.map (adeleNorm K L) y := by |
| 179 | -- Let `W` be the group generated by the totally positive elements and the norms from `L`. It lies |
| 180 | -- in the kernel of `χ ∘ artinMap`, which has index `[L : K]`, while the second inequality |
| 181 | -- (`second_inequality`) bounds the index of `W` by `[L : K]`. Hence the two groups are equal. |
| 182 | let P : Subgroup Kˣ := ⨅ φ : K →+* ℝ, (Units.posSubgroup ℝ).comap (Units.map φ) |
| 183 | have h_mem_P (x : Kˣ) : x ∈ P ↔ IsTotallyPositive x.val := mem_iInf |
| 184 | let W : Subgroup (𝔸f K)ˣ := P.map principalIdele ⊔ (Units.map (adeleNorm K L)).range |
| 185 | have hW_open : IsOpen (W : Set (𝔸f K)ˣ) := |
| 186 | isOpen_mono le_sup_right (isOpen_range_finite_idele_norm K L) |
| 187 | have hW_pos (x : Kˣ) (hx : IsTotallyPositive x.val) : principalIdele x ∈ W := |
| 188 | mem_sup_left ⟨x, (h_mem_P x).mpr hx, rfl⟩ |
| 189 | have hW_norm (y : (𝔸f L)ˣ) : Units.map (adeleNorm K L) y ∈ W := mem_sup_right ⟨y, rfl⟩ |
| 190 | -- `hW_fin` is used below as an instance, by `index_strictAnti`. |
| 191 | obtain ⟨(hW_fin : W.FiniteIndex), (hW_index : W.index ≤ finrank K L), -⟩ := |
| 192 | second_inequality L hW_open hW_pos hW_norm |
| 193 | -- `N` is the kernel of `χ ∘ artinMap`. Reciprocity puts the totally positive elements in it, |
| 194 | -- norm compatibility the norms. |
| 195 | let N : Subgroup (𝔸f K)ˣ := ((abelianLift χ).comp (artinMap Γ)).ker |
| 196 | have h_pos_le : P.map principalIdele ≤ N := by |
| 197 | rintro _ ⟨x, hx, rfl⟩ |
| 198 | simp [N, artinMap_principalIdele_eq_one_of_isTotallyPositive ((h_mem_P x).mp hx)] |
| 199 | have h_norm_le : (Units.map (adeleNorm K L)).range ≤ N := by |
| 200 | rintro _ ⟨y, rfl⟩ |
| 201 | exact abelianLift_artinMap_adeleNorm y |
| 202 | -- A strict inclusion `W < N` would make the index of `N` smaller than `[L : K]`. |
| 203 | have hW_eq : W = N := by |
| 204 | refine eq_of_le_of_not_lt (sup_le h_pos_le h_norm_le) fun hlt ↦ ?_ |
| 205 | have h_lt : N.index < W.index := index_strictAnti hlt |
| 206 | have h_ker_index : N.index = finrank K L := index_ker_abelianLift_comp_artinMap χ |
| 207 | omega |
| 208 | -- Membership in `W`, written out, is the right side. |
| 209 | change a ∈ N ↔ _ |
| 210 | rw [← hW_eq] |
| 211 | simp [W, mem_sup, h_mem_P, eq_comm] |
| 212 | |
| 213 | end New |