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.RingTheory.Polynomial.IsIntegral |
| 4 | import Mathlib.RingTheory.Valuation.LocalSubring |
| 5 | public import Mathlib.Topology.LocallyConstant.Algebra -- shake: keep (needed public by an exposed definition) |
| 6 | public import Lib.Adelic.Adeles.LocalFactors |
| 7 | public import Lib.General.LinearAlgebra.IdempotentRadical |
| 8 | public import Lib.Weil.Unramified.HeckeGL |
| 9 | |
| 10 | /-! |
| 11 | # Test functions and the two local conditions of the comparison of traces |
| 12 | |
| 13 | Test functions on a topological group, their translates, and the function `a ⋆ 1_K` of an element |
| 14 | `a` of the group algebra. On the finite adelic group the comparison of traces asks for two |
| 15 | conditions: the test function is cuspidal at a split place (`IsCuspidalAt`), and at a second place |
| 16 | the components of the elements of its support are integral with a simple eigenvalue zero modulo the |
| 17 | place. `HasSimpleZero` is this last property of one matrix over the completion at the place. |
| 18 | |
| 19 | Notions from other files: |
| 20 | * `Gf E n`: the group of finite adelic points of the unitary group of the `n × n` identity matrix; |
| 21 | * `LocField w`, `LocInt w`, `ResField w`, `localIntGL n w`: the completion at a finite place `w`, |
| 22 | its ring of integers, its residue field, and `GL_n` of that ring inside `GL_n` of the completion; |
| 23 | * `ofSplitPlace hw`: at a split place `w`, the map from `GL_n` of the completion at `w` to `Gf E n`; |
| 24 | * `radicalHom`: for an idempotent `ε`, the homomorphism `Y ↦ 1 + ε Y (1 - ε)` onto the unipotent |
| 25 | radical of the parabolic subgroup that keeps the image of `ε`. |
| 26 | |
| 27 | ## Relation to the literature |
| 28 | |
| 29 | Known; see `Lib.Adelic.TraceFormula.TraceComparison` for sources. |
| 30 | -/ |
| 31 | |
| 32 | @[expose] public section |
| 33 | |
| 34 | open NumberField Polynomial Matrix Finset IsLocalRing Multiplicative |
| 35 | |
| 36 | namespace New |
| 37 | |
| 38 | section Group |
| 39 | |
| 40 | variable {G : Type} [Group G] [TopologicalSpace G] [IsTopologicalGroup G] [T2Space G] |
| 41 | |
| 42 | /-- The space of test functions on `G`: the locally constant complex functions of compact |
| 43 | support. -/ |
| 44 | abbrev TestFunction (G : Type) [TopologicalSpace G] : Submodule ℂ (G → ℂ) := |
| 45 | schwartzBruhat (Set.univ : Set G) |
| 46 | |
| 47 | /-- The composite of a test function with `x ↦ a⁻¹ * x * b` is again a test function. -/ |
| 48 | lemma TestFunction.comp_mul_mem {f : G → ℂ} (hf : f ∈ TestFunction G) (a b : G) : |
| 49 | (f ∘ fun x : G ↦ a⁻¹ * x * b) ∈ TestFunction G := |
| 50 | schwartzBruhat.comp hf (fun x : G ↦ a * (x * b⁻¹)) (fun x ↦ by group) (Set.mapsTo_univ _ _) |
| 51 | |
| 52 | /-- Left and right translation of test functions: `(a, b)` takes `f` to `x ↦ f (a⁻¹ * x * b)`. -/ |
| 53 | def TestFunction.translate : Representation ℂ (G × G) (TestFunction G) where |
| 54 | toFun g := (LinearMap.funLeft ℂ ℂ fun x : G ↦ g.1⁻¹ * x * g.2).restrict |
| 55 | fun _ hf ↦ TestFunction.comp_mul_mem hf g.1 g.2 |
| 56 | map_one' := by |
| 57 | ext f x |
| 58 | simp |
| 59 | map_mul' g h := by |
| 60 | ext f x |
| 61 | simp [mul_assoc] |
| 62 | |
| 63 | /-- The translate of `f` by the pair `g = (a, b)` takes `x` to `f (a⁻¹ * x * b)`. -/ |
| 64 | @[simp] lemma TestFunction.translate_apply (g : G × G) (f : TestFunction G) (x : G) : |
| 65 | (translate g f : G → ℂ) x = (f : G → ℂ) (g.1⁻¹ * x * g.2) := rfl |
| 66 | |
| 67 | /-- The characteristic function of a compact open subgroup. -/ |
| 68 | noncomputable def TestFunction.indicator {K : Subgroup G} (hK_open : IsOpen (K : Set G)) |
| 69 | (hK_compact : IsCompact (K : Set G)) : TestFunction G := |
| 70 | ⟨Set.indicator K 1, |
| 71 | (LocallyConstant.indicator 1 ⟨K.isClosed_of_isOpen hK_open, hK_open⟩).isLocallyConstant, |
| 72 | HasCompactSupport.intro hK_compact fun _ hx ↦ Set.indicator_of_notMem hx _, Set.subset_univ _⟩ |
| 73 | |
| 74 | /-- The linear map `a ↦ a ⋆ 1_K` from the group algebra to the test functions, for a compact open |
| 75 | subgroup `K`: the group element `b` goes to the characteristic function of the coset `b K`. -/ |
| 76 | noncomputable def convIndicator {K : Subgroup G} (hK_open : IsOpen (K : Set G)) |
| 77 | (hK_compact : IsCompact (K : Set G)) : MonoidAlgebra ℂ G →ₗ[ℂ] TestFunction G := |
| 78 | (Representation.asAlgebraHom (TestFunction.translate.comp (.inl G G))).toLinearMap.flip |
| 79 | (TestFunction.indicator hK_open hK_compact) |
| 80 | |
| 81 | open scoped Classical in |
| 82 | /-- For a compact open subgroup `K`, a group element `b` and a scalar `c`, the test function |
| 83 | `(c b) ⋆ 1_K` given by `convIndicator` is `c` on the coset `b K` and zero elsewhere. -/ |
| 84 | lemma convIndicator_single {K : Subgroup G} (hK_open : IsOpen (K : Set G)) |
| 85 | (hK_compact : IsCompact (K : Set G)) (b : G) (c : ℂ) (x : G) : |
| 86 | (convIndicator hK_open hK_compact (.single b c) : G → ℂ) x = |
| 87 | if b⁻¹ * x ∈ K then c else 0 := by |
| 88 | simp [convIndicator, TestFunction.indicator, Set.indicator_apply] |
| 89 | |
| 90 | /-- For a compact open subgroup `K` and an element `a` of the group algebra, write `a ⋆ 1_K` for |
| 91 | the test function given by `convIndicator`. Then `(c b * a) ⋆ 1_K` is `c` times the left translate |
| 92 | of `a ⋆ 1_K` by the group element `b`. -/ |
| 93 | lemma convIndicator_single_mul {K : Subgroup G} (hK_open : IsOpen (K : Set G)) |
| 94 | (hK_compact : IsCompact (K : Set G)) (b : G) (c : ℂ) (a : MonoidAlgebra ℂ G) (x : G) : |
| 95 | (convIndicator hK_open hK_compact (.single b c * a) : G → ℂ) x = |
| 96 | c * (convIndicator hK_open hK_compact a : G → ℂ) (b⁻¹ * x) := by |
| 97 | simp [convIndicator] |
| 98 | |
| 99 | open MonoidAlgebra in |
| 100 | /-- Convolution of the lift of `a` by `f` with `1_K` vanishes at `x` if no coset |
| 101 | `f y K` for `y` in the support of `a` contains `x`. -/ |
| 102 | lemma convIndicator_mapDomain_eq_zero {H : Type*} {K : Subgroup G} |
| 103 | (hK_open : IsOpen (K : Set G)) (hK_compact : IsCompact (K : Set G)) |
| 104 | {f : H → G} (a : MonoidAlgebra ℂ H) {x : G} |
| 105 | (h : ∀ y ∈ a.coeff.support, (f y)⁻¹ * x ∉ K) : |
| 106 | (convIndicator hK_open hK_compact (mapDomain f a)).val x = 0 := by |
| 107 | classical |
| 108 | rw [← sum_coeff_single a, mapDomain_sum] |
| 109 | simp only [Finsupp.sum, map_sum, Submodule.coe_sum, Finset.sum_apply] |
| 110 | exact Finset.sum_eq_zero fun y hy ↦ by simp [convIndicator_single, h y hy] |
| 111 | |
| 112 | /-- The representation of `G × G` on test functions by translation is smooth: each test function is |
| 113 | fixed by all translations near the identity. -/ |
| 114 | instance : IsSmoothRep (TestFunction.translate (G := G)) := by |
| 115 | refine ⟨fun f : TestFunction G ↦ ?_⟩ |
| 116 | have h_const : IsLocallyConstant fun (g : G × G) (x : G) ↦ f.val (g.1⁻¹ * x * g.2) := |
| 117 | schwartzBruhat.isLocallyConstant_curry f.property (fun (g : G × G) (x : G) ↦ g.1⁻¹ * x * g.2) |
| 118 | (fun (g : G × G) (x : G) ↦ g.1 * (x * g.2⁻¹)) (fun g x ↦ by group) |
| 119 | filter_upwards [h_const.eventually_eq 1] with g hg |
| 120 | ext x |
| 121 | simpa using congrFun hg x |
| 122 | |
| 123 | end Group |
| 124 | |
| 125 | section Radical |
| 126 | |
| 127 | variable {n k : Type} [Fintype n] [DecidableEq n] [CommRing k] (T : Finset n) |
| 128 | |
| 129 | /-- The diagonal projector on the coordinates in `T`. -/ |
| 130 | noncomputable def coordProjector : Matrix n n k := diagonal fun i : n ↦ if i ∈ T then 1 else 0 |
| 131 | |
| 132 | lemma isIdempotentElem_coordProjector : IsIdempotentElem (coordProjector (k := k) T) := by |
| 133 | simp [IsIdempotentElem, coordProjector, ← ite_and] |
| 134 | |
| 135 | /-- A ring homomorphism `f`, applied entrywise, takes the element `1 + ε Z (1 - ε)` of the unipotent |
| 136 | radical (`radicalHom`), with `ε` the diagonal projector on the coordinates in `T`, to the element |
| 137 | attached in the same way to `T` and `f(Z)`. -/ |
| 138 | lemma map_radicalHom_coordProjector {k' : Type} [CommRing k'] (f : k →+* k') (Z : Matrix n n k) : |
| 139 | GeneralLinearGroup.map f (radicalHom (isIdempotentElem_coordProjector T) (ofAdd Z)) = |
| 140 | radicalHom (isIdempotentElem_coordProjector T) (ofAdd (Z.map f)) := by |
| 141 | ext1 |
| 142 | simp [radicalHom, coordProjector, Matrix.map_add, Matrix.map_sub, apply_ite f] |
| 143 | |
| 144 | end Radical |
| 145 | |
| 146 | variable {E n : Type} [Field E] [NumberField E] [IsCMField E] [Fintype n] [DecidableEq n] |
| 147 | {w : FinPlace E} |
| 148 | |
| 149 | /-- The test function `φ` is cuspidal at the split place `w`. Let `U` be the unipotent radical of a |
| 150 | proper parabolic subgroup of `GL_n(F_w)`, with `F_w` the residue field at `w`, that is cut out by a |
| 151 | set `T` of coordinates. Then every left translate of `φ` has sum zero over each coset `U t`, lifted |
| 152 | to `GL_n(O_w)` and put into the adelic group at `w` by `ofSplitPlace`. In detail, the sum runs over |
| 153 | all matrices `Z` over `F_w`, each with a lift of the element `radicalHom Z * t` of the coset; every |
| 154 | element is met equally often, and every choice of these lifts is allowed. -/ |
| 155 | def IsCuspidalAt (hw : w.IsSplit) (φ : TestFunction (Gf E n)) : Prop := |
| 156 | ∀ T : Finset n, T ≠ ∅ → T ≠ univ → ∀ (t : GL n (ResField w)) |
| 157 | (lift : Matrix n n (ResField w) → localIntGL n w), |
| 158 | (∀ Z : Matrix n n (ResField w), |
| 159 | reduceGL (lift Z) = radicalHom (isIdempotentElem_coordProjector T) (ofAdd Z) * t) → |
| 160 | ∀ g : Gf E n, ∑ᶠ Z : Matrix n n (ResField w), φ.val (g * ofSplitPlace hw (lift Z)) = 0 |
| 161 | |
| 162 | omit [IsCMField E] in |
| 163 | /-- Let `T` be a set of coordinates. Every element `1 + ε Z (1 - ε)` (`radicalHom`, with `ε` the |
| 164 | projector on `T`) over the residue field at `w` is the reduction (`reduceGL`) of an element |
| 165 | `1 + ε Y (1 - ε)` over `E_w` that lies in `localIntGL n w`, the group `GL_n(O_w)`. -/ |
| 166 | lemma exists_radicalHom_reduceGL_eq (T : Finset n) (Z : Matrix n n (ResField w)) : |
| 167 | ∃ (Y : Matrix n n (LocField w)) (hY : |
| 168 | radicalHom (isIdempotentElem_coordProjector T) (ofAdd Y) ∈ localIntGL n w), |
| 169 | reduceGL ⟨radicalHom (isIdempotentElem_coordProjector T) (ofAdd Y), hY⟩ = |
| 170 | radicalHom (isIdempotentElem_coordProjector T) (ofAdd Z) := by |
| 171 | obtain ⟨Y, rfl⟩ : ∃ Y : Matrix n n (LocInt w), Y.map (residue (LocInt w)) = Z := |
| 172 | residue_surjective.comp_left.comp_left Z |
| 173 | refine ⟨Y.map (LocInt w).subtype, ?_⟩ |
| 174 | rw [← map_radicalHom_coordProjector T (LocInt w).subtype Y] |
| 175 | refine ⟨⟨radicalHom (isIdempotentElem_coordProjector T) (ofAdd Y), rfl⟩, ?_⟩ |
| 176 | -- the reduction of the image of an integral matrix is computed entrywise |
| 177 | change GeneralLinearGroup.map (residue (LocInt w)) |
| 178 | (radicalHom (isIdempotentElem_coordProjector T) (ofAdd Y)) = _ |
| 179 | exact map_radicalHom_coordProjector T (residue (LocInt w)) Y |
| 180 | |
| 181 | /-- Let the test function `φ` on the finite adelic group `Gf E n` be cuspidal at the split place |
| 182 | `w` and let `T` be a set of coordinates, neither empty nor everything. Then there is a finite |
| 183 | nonempty family `κ` of matrices over `E_w`, written multiplicatively, with the following property: |
| 184 | for every `k` in `GL_n(O_w)`, the right translates of `φ` by the images in `Gf E n` of the products |
| 185 | `(1 + ε (κ i) (1 - ε)) * k` sum to zero over `i`. Here `1 + ε (κ i) (1 - ε)` is `radicalHom` of |
| 186 | `κ i` for the projector `ε` on `T`, and the images are taken under the embedding `ofSplitPlace` at |
| 187 | `w`. -/ |
| 188 | lemma IsCuspidalAt.exists_sum_translate_eq_zero {hw : w.IsSplit} {φ : TestFunction (Gf E n)} |
| 189 | (hφ : IsCuspidalAt hw φ) {T : Finset n} (hT_empty : T ≠ ∅) (hT_univ : T ≠ univ) : |
| 190 | ∃ (ι : Type) (_ : Fintype ι) (_ : Nonempty ι) |
| 191 | (κ : ι → Multiplicative (Matrix n n (LocField w))), ∀ k ∈ localIntGL n w, |
| 192 | ∑ i : ι, TestFunction.translate |
| 193 | (1, ofSplitPlace hw (radicalHom (isIdempotentElem_coordProjector T) (κ i) * k)) φ = 0 := by |
| 194 | -- Take for `κ` one lift of each matrix over the residue field. |
| 195 | choose Y hY_mem hY using exists_radicalHom_reduceGL_eq (w := w) T |
| 196 | let _ : Fintype (Matrix n n (ResField w)) := .ofFinite _ |
| 197 | refine ⟨Matrix n n (ResField w), inferInstance, inferInstance, ofAdd ∘ Y, |
| 198 | fun (k : GL n (LocField w)) (hk : k ∈ localIntGL n w) ↦ ?_⟩ |
| 199 | ext g |
| 200 | let lift (Z : Matrix n n (ResField w)) : localIntGL n w := |
| 201 | ⟨radicalHom (isIdempotentElem_coordProjector T) (ofAdd (Y Z)), hY_mem Z⟩ * ⟨k, hk⟩ |
| 202 | have h_lift (Z : Matrix n n (ResField w)) : |
| 203 | reduceGL (lift Z) = radicalHom (isIdempotentElem_coordProjector T) (ofAdd Z) * reduceGL |
| 204 | ⟨k, hk⟩ := by |
| 205 | rw [← hY Z] |
| 206 | exact reduceGL.map_mul _ _ |
| 207 | have h_sum : ∑ᶠ Z : Matrix n n (ResField w), φ.val (g * ofSplitPlace hw (lift Z)) = 0 := |
| 208 | hφ T hT_empty hT_univ _ lift h_lift g |
| 209 | simpa [lift, finsum_eq_sum_of_fintype] using h_sum |
| 210 | |
| 211 | /-- Let `K` be a compact open subgroup of the finite adelic group `Gf E n` and `a`, `b` elements of |
| 212 | its group algebra. If the test function `a ⋆ 1_K` (`convIndicator`) is cuspidal at the split place |
| 213 | `w` (`IsCuspidalAt`: zero sums over the cosets of unipotent radicals modulo `w`), then so is |
| 214 | `(b * a) ⋆ 1_K`. -/ |
| 215 | lemma IsCuspidalAt.convIndicator_mul {hw : w.IsSplit} {K : Subgroup (Gf E n)} |
| 216 | {hK_open : IsOpen (K : Set (Gf E n))} {hK_compact : IsCompact (K : Set (Gf E n))} |
| 217 | {a : MonoidAlgebra ℂ (Gf E n)} (ha : IsCuspidalAt hw (convIndicator hK_open hK_compact a)) |
| 218 | (b : MonoidAlgebra ℂ (Gf E n)) : |
| 219 | IsCuspidalAt hw (convIndicator hK_open hK_compact (b * a)) := by |
| 220 | intro T hT_empty hT_univ t lift h_lift g |
| 221 | induction b using MonoidAlgebra.induction_linear with |
| 222 | | zero => simp |
| 223 | | add b b' hb hb' => |
| 224 | simp [add_mul, finsum_add_distrib (Set.toFinite _) (Set.toFinite _), hb, hb'] |
| 225 | | single x c => |
| 226 | simp [convIndicator_single_mul, ← mul_assoc, ← mul_finsum, |
| 227 | ha T hT_empty hT_univ t lift h_lift (x⁻¹ * g)] |
| 228 | |
| 229 | attribute [local instance] Polynomial.algebra in |
| 230 | /-- If `R` is integrally closed in `A` and `p` becomes a `j`-th power over `A`, then `p` is |
| 231 | a `j`-th power over `R`. -/ |
| 232 | lemma exists_eq_pow_of_map_eq_pow {R A : Type*} [CommRing R] [CommRing A] [Algebra R A] |
| 233 | [IsIntegrallyClosedIn R A] {p : R[X]} {Q : A[X]} {j : ℕ} |
| 234 | (h_map : p.map (algebraMap R A) = Q ^ j) : ∃ P : R[X], p = P ^ j := by |
| 235 | have hinj := Polynomial.map_injective _ (IsIntegralClosure.algebraMap_injective R R A) |
| 236 | obtain rfl | hj := Nat.eq_zero_or_pos j |
| 237 | · exact ⟨1, hinj (by simpa using h_map)⟩ |
| 238 | -- A positive power in the image makes Q integral over R[X], hence every coefficient integral. |
| 239 | have hQ : IsIntegral R[X] Q := IsIntegral.of_pow hj (h_map ▸ isIntegral_algebraMap (x := p)) |
| 240 | obtain ⟨P, hP⟩ := Q.mem_lifts.mp <| (Q.lifts_iff_coeff_lifts (f := algebraMap R A)).mpr |
| 241 | fun n ↦ IsIntegrallyClosedIn.isIntegral_iff.mp (hQ.coeff n) |
| 242 | exact ⟨P, hinj (by rw [Polynomial.map_pow, hP, h_map])⟩ |
| 243 | |
| 244 | /-- If `R` is integrally closed in `A` and `p` becomes a `j`-th power over `A`, then `j` divides |
| 245 | each root multiplicity after mapping the coefficients of `p` to a domain. For the zero polynomial, |
| 246 | `rootMultiplicity` is zero. -/ |
| 247 | lemma dvd_rootMultiplicity_map_of_map_eq_pow {R A S : Type*} [CommRing R] [CommRing A] |
| 248 | [Algebra R A] [IsIntegrallyClosedIn R A] [CommRing S] [IsDomain S] {p : R[X]} {Q : A[X]} |
| 249 | {j : ℕ} (h_map : p.map (algebraMap R A) = Q ^ j) (f : R →+* S) (x : S) : |
| 250 | j ∣ (p.map f).rootMultiplicity x := by |
| 251 | classical |
| 252 | obtain ⟨P, hP⟩ := exists_eq_pow_of_map_eq_pow h_map |
| 253 | exact ⟨(P.map f).roots.count x, by |
| 254 | rw [← count_roots, hP, Polynomial.map_pow, roots_pow, Multiset.count_nsmul]⟩ |
| 255 | |
| 256 | omit [IsCMField E] in |
| 257 | /-- If the matrix `g` has entries in `O_w` and `0` is a simple root of its characteristic polynomial |
| 258 | modulo `w` (`HasSimpleZero g`), then the characteristic polynomial of `g` over `E_w` itself is no |
| 259 | `j`-th power for `j > 1`. -/ |
| 260 | lemma HasSimpleZero.charpoly_ne_pow {g : GL n (LocField w)} (hg : HasSimpleZero g) |
| 261 | (Q : (LocField w)[X]) {j : ℕ} (hj : 1 < j) : g.val.charpoly ≠ Q ^ j := by |
| 262 | classical |
| 263 | intro h_pow |
| 264 | obtain ⟨h_int, h_simple⟩ : (∀ a b : n, Valued.v (g a b) ≤ 1) ∧ |
| 265 | (g.val.map residueOrZero).charpoly.rootMultiplicity 0 = 1 := hg |
| 266 | let M : Matrix n n (LocInt w) := of fun a b : n ↦ ⟨g a b, h_int a b⟩ |
| 267 | have h_red : g.val.map residueOrZero = M.map (residue (LocInt w)) := |
| 268 | Matrix.ext fun a b : n ↦ residueOrZero_coe (M a b) |
| 269 | have h_map : M.charpoly.map (algebraMap (LocInt w) (LocField w)) = Q ^ j := by |
| 270 | rw [← charpoly_map, show M.map (algebraMap (LocInt w) (LocField w)) = g.val from rfl, h_pow] |
| 271 | have h_multiplicity : (M.charpoly.map (residue (LocInt w))).rootMultiplicity 0 = 1 := by |
| 272 | rw [← charpoly_map, ← h_red, h_simple] |
| 273 | have h_dvd := dvd_rootMultiplicity_map_of_map_eq_pow h_map (residue (LocInt w)) 0 |
| 274 | exact hj.ne' (Nat.dvd_one.1 (h_multiplicity ▸ h_dvd)) |
| 275 | |
| 276 | end New |