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.LSeries.DirichletContinuation |
| 4 | public import Lib.Speed |
| 5 | |
| 6 | /-! |
| 7 | # Dirichlet characters and the primitive characters that induce them |
| 8 | |
| 9 | `New.exists_isPrimitive_changeLevel_eq`: every Dirichlet character is induced by a primitive one. |
| 10 | -/ |
| 11 | |
| 12 | @[expose] public section |
| 13 | |
| 14 | open Complex DirichletCharacter |
| 15 | |
| 16 | variable {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) |
| 17 | |
| 18 | /-- Every complex Dirichlet character χ mod N, with N ≥ 1, is induced by a primitive character ψ |
| 19 | mod M for some divisor M ≥ 1 of N. -/ |
| 20 | lemma New.exists_isPrimitive_changeLevel_eq : |
| 21 | ∃ (M : ℕ) (hM : M ∣ N) (ψ : DirichletCharacter ℂ M), |
| 22 | NeZero M ∧ IsPrimitive ψ ∧ changeLevel hM ψ = χ := |
| 23 | ⟨χ.conductor, χ.conductor_dvd_level, χ.primitiveCharacter, ⟨χ.conductor_ne_zero⟩, |
| 24 | χ.primitiveCharacter_isPrimitive, χ.changeLevel_primitiveCharacter⟩ |