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.Topology.Algebra.Group.Units |
| 4 | public import Mathlib.Topology.Separation.CompletelyRegular |
| 5 | import Mathlib.MeasureTheory.Integral.Pi |
| 6 | import Mathlib.Topology.Maps.Proper.CompactlyGenerated |
| 7 | public import Lib.Adelic.Adeles.Basic |
| 8 | public import Lib.General.Groups.CongruenceSubgroups |
| 9 | import Lib.Adelic.Adeles.AdditiveCharacter |
| 10 | |
| 11 | /-! |
| 12 | # Principal ideles and a majorant on the complex torus |
| 13 | |
| 14 | * `New.principalAdeleUnits`: the principal ideles, a discrete subgroup of the units of the adele |
| 15 | ring. |
| 16 | * `New.integrable_prod_inv_one_add_log_sq`: `∏ x, (1 + (log |a x|) ^ 2)⁻¹` is integrable for Haar |
| 17 | measure on `(ι → ℂ)ˣ`; it serves as a majorant at the infinite places. |
| 18 | |
| 19 | Notions from other files: |
| 20 | |
| 21 | * `New.CMType E`: E is a CM number field with, for each infinite place, a chosen complex embedding |
| 22 | inducing it. |
| 23 | * `New.toAdele`: the diagonal embedding of E in its adeles, given at the infinite places by the |
| 24 | chosen embeddings. |
| 25 | * `New.ratAdeles E`: the image of E under `New.toAdele`, a lattice in the adeles. |
| 26 | -/ |
| 27 | |
| 28 | @[expose] public section |
| 29 | |
| 30 | namespace New |
| 31 | |
| 32 | open MeasureTheory Measure Complex |
| 33 | |
| 34 | variable (E : Type*) {ι : Type*} [Field E] [CMType E] |
| 35 | |
| 36 | /-- The principal ideles: the image of E^× in the unit group of the adeles. -/ |
| 37 | noncomputable def principalAdeleUnits : Subgroup (𝔸 E)ˣ := |
| 38 | (Units.map (toAdele (E := E)).toMonoidHom).range |
| 39 | |
| 40 | /-- For a CM field E, the principal ideles, that is the image of E^× in the units of the adele ring, |
| 41 | form a discrete subgroup: they map into the discrete set `New.ratAdeles E`, the image of E in the |
| 42 | adeles. -/ |
| 43 | instance : DiscreteTopology (principalAdeleUnits E) := by |
| 44 | -- The principal ideles lie in the preimage of the discrete set of rational adeles. |
| 45 | have h_rat : IsDiscrete (ratAdeles E : Set (𝔸 E)) := |
| 46 | ⟨isCovolOneLattice_ratAdeles.toDiscreteTopology⟩ |
| 47 | have h_subset : |
| 48 | (principalAdeleUnits E : Set (𝔸 E)ˣ) ⊆ Units.val ⁻¹' (ratAdeles E : Set (𝔸 E)) := by |
| 49 | simp [principalAdeleUnits, ratAdeles, Set.range_subset_iff] |
| 50 | have h_discrete : IsDiscrete (Units.val ⁻¹' (ratAdeles E : Set (𝔸 E))) := |
| 51 | h_rat.preimage (by fun_prop) Units.val_injective |
| 52 | exact (h_discrete.mono h_subset).to_subtype |
| 53 | |
| 54 | @[simp] |
| 55 | lemma piUnits_val_apply_ne_zero (a : (ι → ℂ)ˣ) (x : ι) : a.val x ≠ 0 := (a.isUnit.apply x).ne_zero |
| 56 | |
| 57 | /-- The coordinatewise logarithmic moduli send Haar measure on the complex torus to |
| 58 | an additive Haar measure. -/ |
| 59 | lemma isAddHaarMeasure_map_log_norm [Fintype ι] (μ : Measure (ι → ℂ)ˣ) [IsHaarMeasure μ] : |
| 60 | IsAddHaarMeasure (μ.map fun a : (ι → ℂ)ˣ ↦ fun x ↦ Real.log ‖a.val x‖) := by |
| 61 | let L : Additive (ι → ℂ)ˣ →+ (ι → ℝ) := |
| 62 | { toFun := fun a x ↦ Real.log ‖a.toMul.val x‖ |
| 63 | map_zero' := by ext x; simp |
| 64 | map_add' := fun a b ↦ by ext x; simp [Real.log_mul] } |
| 65 | have h_apply (a : (ι → ℂ)ˣ) (x : ι) : L a x = Real.log ‖a.val x‖ := rfl |
| 66 | -- The polar coordinates allow all phases, a compact space at fixed moduli. |
| 67 | let polar (p : (ι → ℝ) × (ι → Circle)) : (ι → ℂ)ˣ := |
| 68 | (by simp [Pi.isUnit_iff] : IsUnit fun x : ι ↦ exp (p.1 x : ℝ) * (p.2 x : Circle)).unit |
| 69 | have h_polar : Continuous polar := by |
| 70 | rw [Units.isOpenEmbedding_val.isInducing.continuous_iff] |
| 71 | simp only [polar, Function.comp_def, IsUnit.unit_spec] |
| 72 | fun_prop |
| 73 | have hL : Continuous L := continuous_pi fun x ↦ |
| 74 | (continuous_apply x |>.comp Units.continuous_val).norm.log fun a ↦ by simp |
| 75 | have h_section (p : (ι → ℝ) × (ι → Circle)) : L (polar p) = p.1 := by |
| 76 | ext x |
| 77 | change Real.log ‖(polar p).val x‖ = p.1 x |
| 78 | simp [polar] |
| 79 | have h_proper : IsProperMap L := by |
| 80 | apply isProperMap_of_comp_of_surj h_polar hL |
| 81 | · exact (funext h_section : L ∘ polar = Prod.fst).symm ▸ isProperMap_fst_of_compactSpace |
| 82 | · refine fun a ↦ ⟨(L a, fun x ↦ Circle.exp (arg (a.val x))), ?_⟩ |
| 83 | ext x |
| 84 | simp [polar, h_apply, exp_log, ofReal_log] |
| 85 | let μAdd : Measure (Additive (ι → ℂ)ˣ) := μ |
| 86 | let _ : IsAddHaarMeasure μAdd := |
| 87 | { map_add_left_eq_self := fun a ↦ map_mul_left_eq_self μ a.toMul |
| 88 | lt_top_of_isCompact := fun _ hK ↦ hK.measure_lt_top (μ := μ) |
| 89 | open_pos := fun _ hU hne ↦ (hU.measure_pos μ hne).ne' } |
| 90 | exact isAddHaarMeasure_map μAdd L hL (fun t ↦ ⟨polar (t, 1), h_section _⟩) |
| 91 | (isProperMap_iff_tendsto_cocompact.1 h_proper).2 |
| 92 | |
| 93 | /-- An almost everywhere strongly measurable function on the real logarithmic coordinates is |
| 94 | Lebesgue integrable if and only if its pullback by the coordinatewise logarithmic modulus is |
| 95 | integrable for Haar measure on the complex torus. -/ |
| 96 | lemma integrable_comp_log_norm_iff [Fintype ι] {B : Type*} [NormedAddCommGroup B] |
| 97 | (μ : Measure (ι → ℂ)ˣ) [IsHaarMeasure μ] {F : (ι → ℝ) → B} |
| 98 | (hF : AEStronglyMeasurable F volume) : |
| 99 | Integrable (fun a : (ι → ℂ)ˣ ↦ F (fun x ↦ Real.log ‖a.val x‖)) μ ↔ |
| 100 | Integrable F volume := by |
| 101 | let L (a : (ι → ℂ)ˣ) (x : ι) : ℝ := Real.log ‖a.val x‖ |
| 102 | have hL : Measurable L := measurable_pi_iff.2 fun _ ↦ .log (.norm (.eval (by fun_prop))) |
| 103 | let _ : IsAddHaarMeasure (μ.map L) := isAddHaarMeasure_map_log_norm μ |
| 104 | let c := addHaarScalarFactor (μ.map L) volume |
| 105 | have h_scale : μ.map L = c • volume := (μ.map L).isAddLeftInvariant_eq_smul volume |
| 106 | have hc : 0 < c := addHaarScalarFactor_pos_of_isAddHaarMeasure (μ.map L) volume |
| 107 | have hF_map : AEStronglyMeasurable F (μ.map L) := by |
| 108 | rw [h_scale] |
| 109 | exact hF.smul_measure c |
| 110 | change Integrable (F ∘ L) μ ↔ Integrable F volume |
| 111 | rw [← integrable_map_measure hF_map hL.aemeasurable, h_scale] |
| 112 | exact integrable_smul_measure (ENNReal.coe_ne_zero.2 hc.ne') ENNReal.coe_ne_top |
| 113 | |
| 114 | /-- For a finite index type `ι`, the function `a ↦ ∏ x, (1 + (log |a x|) ^ 2)⁻¹` on the group |
| 115 | `(ι → ℂ)ˣ` is integrable for Haar measure. -/ |
| 116 | lemma integrable_prod_inv_one_add_log_sq [Fintype ι] : |
| 117 | Integrable (fun a : (ι → ℂ)ˣ ↦ ∏ x : ι, (1 + Real.log ‖a.val x‖ ^ 2)⁻¹) haar := by |
| 118 | have hF : Integrable (fun t : ι → ℝ ↦ ∏ x, (1 + t x ^ 2)⁻¹) volume := |
| 119 | Integrable.fintype_prod fun _ ↦ integrable_inv_one_add_sq |
| 120 | exact (integrable_comp_log_norm_iff haar hF.aestronglyMeasurable).2 hF |
| 121 | |
| 122 | end New |