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.General.Groups.CongruenceSubgroups |
| 4 | |
| 5 | /-! |
| 6 | # The action x ↦ hxg⁻¹ on matrices as a map of unitary groups |
| 7 | |
| 8 | `New.U.kroneckerHom` sends `(g, h)` in `U S × U T` to the Kronecker product `h ⊗ₖ g⁻¹ᵀ`, the matrix |
| 9 | of `x ↦ h x g⁻¹` on matrices indexed by pairs (row, column). Here `New.U J` is the group of |
| 10 | invertible `g` with `gᴴ J g = J`. |
| 11 | |
| 12 | * `Matrix.GeneralLinearGroup.kronecker`: Mathlib's Kronecker product of two invertible matrices, |
| 13 | as an invertible matrix. |
| 14 | * `New.U.kroneckerHom`: the homomorphism of unitary groups. |
| 15 | * `New.map_kronecker`: applying a ring homomorphism entrywise commutes with the Kronecker product. |
| 16 | |
| 17 | ## Relation to the literature |
| 18 | |
| 19 | Known; see `Lib.Weil.DualPair.ThetaLiftConvergence` for sources. |
| 20 | -/ |
| 21 | |
| 22 | @[expose] public section |
| 23 | |
| 24 | open Matrix Kronecker |
| 25 | |
| 26 | variable {m n R : Type*} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] |
| 27 | |
| 28 | attribute [local simp] Matrix.GeneralLinearGroup.kronecker |
| 29 | |
| 30 | /-- For SK = 1 and J = T ⊗ Kᵀ, the homomorphism (g, h) ↦ h ⊗ (g⁻¹)ᵀ from U(S) × U(T) to U(J). -/ |
| 31 | @[simps! apply_coe_val] |
| 32 | noncomputable def New.U.kroneckerHom [CommRing R] [StarRing R] {S K : Matrix n n R} |
| 33 | {T : Matrix m m R} {J : Matrix (m × n) (m × n) R} (hS : S * K = 1) (h : J = T ⊗ₖ Kᵀ) : |
| 34 | U S × U T →* U J := |
| 35 | MonoidHom.mk' |
| 36 | (fun p ↦ |
| 37 | ⟨Matrix.GeneralLinearGroup.kronecker p.2 (transposeGL p.1⁻¹), by |
| 38 | -- For `p = (x, y)`: the Kronecker product of `yᴴ T y = T` and the inverse transpose of |
| 39 | -- `xᴴ S x = S`. |
| 40 | simpa [mem_unitaryGroupOf_iff, star_eq_conjTranspose, inv_eq_right_inv hS, h, |
| 41 | conjTranspose_nonsing_inv, conjTranspose_kronecker, |
| 42 | conjTranspose_transpose_eq_transpose_conjTranspose, ← mul_kronecker_mul, |
| 43 | Matrix.mul_inv_rev] using! |
| 44 | congr($(mem_unitaryGroupOf_iff.1 p.2.2) ⊗ₖ $(mem_unitaryGroupOf_iff.1 p.1.2)⁻¹ᵀ)⟩) |
| 45 | (fun _ _ ↦ Subtype.ext <| Units.ext <| by simp [← mul_kronecker_mul]) |
| 46 | |
| 47 | /-- Applying a ring homomorphism `f` entrywise commutes with the Kronecker product: |
| 48 | (A ⊗ B).map f = A.map f ⊗ B.map f. -/ |
| 49 | lemma New.map_kronecker {a b c d R S : Type*} [NonAssocSemiring R] [NonAssocSemiring S] |
| 50 | (f : R →+* S) (A : Matrix a b R) (B : Matrix c d R) : |
| 51 | (A ⊗ₖ B).map f = A.map f ⊗ₖ B.map f := by |
| 52 | aesop |