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 Lib.Adelic.Unitary.Defs |
| 4 | public import Lib.General.LinearAlgebra.IntegralLattices |
| 5 | import Lib.Adelic.Adeles.IdeleModulus |
| 6 | import Lib.General.LinearAlgebra.HermiteForm |
| 7 | import Lib.General.LinearAlgebra.PolarDecomposition |
| 8 | |
| 9 | /-! |
| 10 | # Normalisation of adelic frames |
| 11 | |
| 12 | A rectangular frame with a left inverse can be made orthonormal at infinity and primitive at |
| 13 | the finite places by a change of basis preserving the flag of column weights. |
| 14 | -/ |
| 15 | |
| 16 | @[expose] public section |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | open Matrix NumberField |
| 21 | |
| 22 | namespace New |
| 23 | |
| 24 | variable {E : Type*} [Field E] [NumberField E] {n k : Type*} |
| 25 | [Fintype n] [Fintype k] [DecidableEq k] |
| 26 | |
| 27 | /-- The columns are orthonormal at each infinite place. At the finite places both the matrix and |
| 28 | a left inverse have integral entries. -/ |
| 29 | structure IsNormalizedAdelicFrame (X : Matrix n k (𝔸 E)) : Prop where |
| 30 | /-- The columns are orthonormal at the infinite place `w`. -/ |
| 31 | orthonormal (w : InfinitePlace E) : (X.map (evalInf w))ᴴ * X.map (evalInf w) = 1 |
| 32 | /-- At the finite places, the frame and a left inverse have integral entries. -/ |
| 33 | primitive : IsPrimitiveMatrix (Ô E) (X.map (RingHom.snd (InfinitePlace E → ℂ) (𝔸f E))) |
| 34 | |
| 35 | /-- The columns of an adelic frame can be normalised by a block upper triangular change of basis |
| 36 | for any natural-number weights on the columns. -/ |
| 37 | theorem exists_blockTriangular_normalizedFrame [DecidableEq n] {X : Matrix n k (𝔸 E)} |
| 38 | (hX : HasLeftInv X) (wt : k → ℕ) : |
| 39 | ∃ b : GL k (𝔸 E), b.val.BlockTriangular wt ∧ IsNormalizedAdelicFrame (X * b.val) := by |
| 40 | let fin := RingHom.snd (InfinitePlace E → ℂ) (𝔸f E) |
| 41 | choose a ha horth using fun w : InfinitePlace E ↦ exists_orthonormal_mul wt (hX.map (evalInf w)) |
| 42 | obtain ⟨c, hc, hprim⟩ := isValuationPair_Ô.exists_isPrimitiveMatrix_mul (hX.map fin) wt |
| 43 | refine ⟨mkAdelicGL (a, c), fun i j hij ↦ Prod.ext (funext fun w ↦ ha w hij) (hc hij), ?_⟩ |
| 44 | constructor |
| 45 | · intro w |
| 46 | rw [Matrix.map_mul] |
| 47 | exact horth w |
| 48 | · rw [Matrix.map_mul] |
| 49 | exact hprim |
| 50 | |
| 51 | end New |