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.Algebra.AffineMonoid.UniqueSums |
| 4 | public import New.OneLift.ComparisonOperator.ExchangeData |
| 5 | import Lib.General.LinearAlgebra.HermiteForm |
| 6 | |
| 7 | /-! |
| 8 | # Products of determinants and first-column coordinates under substitution |
| 9 | |
| 10 | This file studies polynomials in the entries of variable matrices `x_τ`, one for each `τ : Φ`, with |
| 11 | rows indexed by `N` and columns by `L`. It studies how these polynomials transform under the |
| 12 | two-sided linear substitutions `New.Rows.twoSidedSubst`, `x_τ ↦ c_τᵀ x_τ g_τᵀ`. It treats products |
| 13 | of determinants of constant matrices stacked over `x_τ`. It also treats the coordinates of a |
| 14 | polynomial in its first `p` columns, where `p` is a number of columns. |
| 15 | |
| 16 | ## Main definitions and results |
| 17 | |
| 18 | * `New.Rows.stackedDetProd`, `New.Rows.twoSidedSubst_stackedDetProd`: a product of determinants of |
| 19 | constant matrices stacked over `x_τ` (`New.Rows.stackedDet`). The substitution sends the product |
| 20 | for the matrices `M τ k * (g τ)ᵀ` to a scalar multiple of the product for the matrices `M τ k`. |
| 21 | * `New.Rows.firstColsCoord`, `New.Rows.twoSidedSubst_firstColsCoord`: the coordinates of a |
| 22 | polynomial in its first `p` columns; if the substitution with column matrices |
| 23 | `fromBlocks 1 0 0 (g τ)` (fixing the first `p` columns) sends `F'` to a multiple of `F`, the |
| 24 | coordinates of `F'` and `F` are related by the Schur matrix (`New.schur`). |
| 25 | |
| 26 | Notions from other files: |
| 27 | * `New.nablaBasis`, `New.schur`: products of minors indexed by families of standard fillings |
| 28 | (`New.WeylIndexFamily`), and the matrix of a substitution of rows in these polynomials. |
| 29 | -/ |
| 30 | |
| 31 | @[expose] public section |
| 32 | |
| 33 | noncomputable section |
| 34 | |
| 35 | section StackedDeterminants |
| 36 | |
| 37 | open Matrix MvPolynomial Finset Fintype |
| 38 | |
| 39 | variable {Φ a L N : Type} [Fintype a] [DecidableEq a] [Fintype N] [DecidableEq N] [Fintype L] |
| 40 | [DecidableEq L] |
| 41 | |
| 42 | /-- Let `Z` be a complex matrix with rows indexed by `L` and columns by `N`, and let `e` identify |
| 43 | `L` with `a ⊕ N`. There are a matrix `Y` and a constant `γ` such that for all `X` the determinant |
| 44 | of the square matrix `(X | Z)`, with columns ordered by `e`, is `γ * det (Y X)ᵀ`. -/ |
| 45 | lemma New.exists_det_fromCols_eq_mul_det (e : L ≃ a ⊕ N) (Z : Matrix L N ℂ) : |
| 46 | ∃ (Y : Matrix a L ℂ) (γ : ℂ), ∀ X : Matrix L a ℂ, |
| 47 | ((fromCols X Z).submatrix id e).det = γ * (Y * X)ᵀ.det := by |
| 48 | -- Choose an invertible `(U₁ | U₂)` with `U₁ᴴ Z = 0` and put `Y = U₁ᴴ`. Then `(U₁ | U₂)ᴴ (X | Z)` |
| 49 | -- is block triangular; compare determinants. |
| 50 | let colsZ : N ↪ L := Function.Embedding.inr.trans e.symm.toEmbedding |
| 51 | obtain ⟨V, -, hV⟩ : ∃ V ∈ intGL L (⊤ : Subring ℂ), |
| 52 | ∀ i : N, ∀ j ∉ Set.range colsZ, (Zᴴ * (V : Matrix L L ℂ)) i j = 0 := |
| 53 | isValuationPair_top.exists_mul_clear_cols Zᴴ colsZ |
| 54 | let U₁ : Matrix L a ℂ := ((V : Matrix L L ℂ).submatrix id e.symm).toCols₁ |
| 55 | let U₂ : Matrix L N ℂ := ((V : Matrix L L ℂ).submatrix id e.symm).toCols₂ |
| 56 | have hV_eq : (fromCols U₁ U₂).submatrix id e = V := by simp [U₁, U₂] |
| 57 | have hZU : Zᴴ * U₁ = 0 := Matrix.ext fun i j ↦ hV i (e.symm (.inl j)) (by simp [colsZ]) |
| 58 | have hUZ : U₁ᴴ * Z = 0 := conjTranspose_injective (by simpa using hZU) |
| 59 | refine ⟨U₁ᴴ, (U₂ᴴ * Z).det / star (V : Matrix L L ℂ).det, fun X ↦ ?_⟩ |
| 60 | have h_block : (V : Matrix L L ℂ)ᴴ * (fromCols X Z).submatrix id e = |
| 61 | (fromBlocks (U₁ᴴ * X) 0 (U₂ᴴ * X) (U₂ᴴ * Z)).submatrix e e := by |
| 62 | rw [← hV_eq, ← hUZ, ← fromRows_mul_fromCols, ← conjTranspose_fromCols_eq_fromRows_conjTranspose] |
| 63 | rfl |
| 64 | have h_det : star (V : Matrix L L ℂ).det * ((fromCols X Z).submatrix id e).det = |
| 65 | (U₁ᴴ * X).det * (U₂ᴴ * Z).det := by |
| 66 | simp [← det_conjTranspose, ← det_mul, h_block] |
| 67 | rw [det_transpose, div_mul_eq_mul_div, eq_div_iff (star_ne_zero.2 V.det_ne_zero)] |
| 68 | linear_combination h_det |
| 69 | |
| 70 | namespace New.Rows |
| 71 | |
| 72 | /-- The substitution `x_τ ↦ c_τᵀ x_τ g_τᵀ` on complex polynomials in the entries of `N × L` |
| 73 | matrices `x_τ`. -/ |
| 74 | abbrev twoSidedSubst (c : Φ → Matrix N N ℂ) (g : Φ → Matrix L L ℂ) : |
| 75 | MvPolynomial (Φ × N × L) ℂ →ₐ[ℂ] MvPolynomial (Φ × N × L) ℂ := |
| 76 | aeval (R := ℂ) fun ((τ, a, b) : Φ × N × L) ↦ |
| 77 | ∑ i : N, ∑ j : L, (c τ i a * g τ b j) • X (R := ℂ) (τ, i, j) |
| 78 | |
| 79 | /-- Rewrites a polynomial in matrix entries `x_{τ,i,j}` as a polynomial in the first `p` columns, |
| 80 | with coefficients polynomials in the entries of the columns indexed by `L`. -/ |
| 81 | def inFirstCols {p : ℕ} : |
| 82 | MvPolynomial (Φ × N × (Fin p ⊕ L)) ℂ →ₐ[ℂ] |
| 83 | MatrixPoly ((_ : Φ) × N) (MvPolynomial (Φ × N × L) ℂ) := |
| 84 | aeval (R := ℂ) fun ((τ, a, b) : Φ × N × (Fin p ⊕ L)) ↦ |
| 85 | Sum.elim (fun i : Fin p ↦ X ⟨⟨τ, a⟩, i.val⟩) (fun l : L ↦ C (X (τ, a, l))) b |
| 86 | |
| 87 | /-- The product over `τ` and `k` of the determinants of `M τ k` stacked over the variable matrix |
| 88 | `x_τ` (`New.Rows.stackedDet`), columns ordered by `e`. -/ |
| 89 | def stackedDetProd (e : a ⊕ N ≃ L) [Fintype Φ] {ι : Φ → Type} [∀ τ : Φ, Fintype (ι τ)] |
| 90 | (M : (τ : Φ) → ι τ → Matrix a L ℂ) : MvPolynomial (Φ × N × L) ℂ := |
| 91 | ∏ τ : Φ, ∏ k : ι τ, stackedDet τ (M τ k) e |
| 92 | |
| 93 | /-- Write `det (A; x_τ)` for the determinant of a constant matrix `A` stacked over the variable |
| 94 | matrix `x_τ`; `stackedDetProd` is a product of these. Substituting `x_τ ↦ c_τᵀ x_τ g_τᵀ` in the |
| 95 | product of the `det (M τ k * g_τᵀ; x_τ)` gives the product of the `det (M τ k; x_τ)`, each factor |
| 96 | at `τ` multiplied by `det c_τ * det g_τ`. -/ |
| 97 | lemma twoSidedSubst_stackedDetProd (e : a ⊕ N ≃ L) [Fintype Φ] {ι : Φ → Type} |
| 98 | [∀ τ : Φ, Fintype (ι τ)] (M : (τ : Φ) → ι τ → Matrix a L ℂ) (c : Φ → Matrix N N ℂ) |
| 99 | (g : Φ → Matrix L L ℂ) : |
| 100 | twoSidedSubst c g (stackedDetProd e fun (τ : Φ) (k : ι τ) ↦ M τ k * (g τ)ᵀ) = |
| 101 | (∏ τ : Φ, ((c τ).det * (g τ).det) ^ Fintype.card (ι τ)) • stackedDetProd e M := by |
| 102 | -- It suffices to treat one factor. If `A` is its matrix on the right, the matrix on the left is |
| 103 | -- `diag(1, c)ᵀ · A · gᵀ`. |
| 104 | have h_factor (τ : Φ) (B : Matrix a L ℂ) : |
| 105 | twoSidedSubst c g (stackedDet τ (B * (g τ)ᵀ) e) = |
| 106 | ((c τ).det * (g τ).det) • stackedDet τ B e := by |
| 107 | let A : Matrix (a ⊕ N) (a ⊕ N) (MvPolynomial (Φ × N × L) ℂ) := |
| 108 | ((B.map C).fromRows (of fun i j ↦ X (τ, i, j))).submatrix id e |
| 109 | have h_left : twoSidedSubst c g (stackedDet τ (B * (g τ)ᵀ) e) = |
| 110 | (C.mapMatrix (fromBlocks 1 0 0 (c τ))ᵀ * (A * C.mapMatrix ((g τ).submatrix e e)ᵀ)).det := by |
| 111 | rw [stackedDet, AlgHom.map_det] |
| 112 | congr 1 |
| 113 | ext (i | i) j : 2 |
| 114 | · simp [A, Matrix.mul_apply, Matrix.one_apply, ← e.sum_comp] |
| 115 | · simp [A, Matrix.mul_apply, mul_sum, mul_add, mul_assoc, mul_comm (X _), ← e.sum_comp, |
| 116 | ← C_mul'] |
| 117 | simp only [h_left, det_mul, ← RingHom.map_det] |
| 118 | simpa [stackedDet, A, ← C_mul', mul_assoc] using .inl (mul_comm _ _) |
| 119 | simp only [stackedDetProd, map_prod, h_factor, prod_smul, prod_const, card_univ] |
| 120 | |
| 121 | /-- The coordinate `l` of `F` in the first `p` columns: regard `F` as a polynomial in these |
| 122 | columns (`New.Rows.inFirstCols`), pair it with the basis polynomial `l` of weight `κ` (a product of |
| 123 | minors, `nablaBasis`) by the form `⟨P, Q⟩ = P(∂) Q (0)` (`fockPairing`) and divide by the hook |
| 124 | number. This is the integer `⟨f, f⟩` for the product `f` of the leading principal minors with |
| 125 | exponents `κ`, at the ranks `rankAt (fun _ ↦ N) τ = card N`. The result is a polynomial in the |
| 126 | entries of the columns `L`. If `F` is the polynomial (`toPoly`) of a vector `ζ (z)` of the Weyl |
| 127 | module of weight `κ`, with `z` the columns `L`, these are the coordinates of `ζ (z)`. -/ |
| 128 | def firstColsCoord {p : ℕ} [Fintype Φ] (κ : Φ → ℕ → ℕ) (F : MvPolynomial (Φ × N × (Fin p ⊕ L)) ℂ) |
| 129 | (l : WeylIndexFamily (fun _ : Φ ↦ N) κ) : MvPolynomial (Φ × N × L) ℂ := |
| 130 | (hookNumber κ (rankAt fun _ : Φ ↦ N) : ℂ)⁻¹ • |
| 131 | fockPairing (MvPolynomial (Φ × N × L) ℂ) (inFirstCols F) |
| 132 | (nablaBasis (MvPolynomial (Φ × N × L) ℂ) (fun _ : Φ ↦ N) κ l) |
| 133 | |
| 134 | omit [DecidableEq L] in |
| 135 | /-- Let `F`, `F'` be polynomials in the entries of matrices `x_τ` with columns `Fin p ⊕ L`, and |
| 136 | suppose that the substitution `x_τ ↦ c_τᵀ x_τ diag(1, g_τ)ᵀ` (`twoSidedSubst`) sends `F'` to |
| 137 | `s • F`. Let `b_l` be the products of minors of weight `κ` in the first `p` columns (`nablaBasis`), |
| 138 | indexed by families `l` of standard fillings. The coordinate `firstColsCoord κ F l` is the Fock |
| 139 | pairing of `F` with `b_l` in these columns, divided by the hook number; it is a polynomial in the |
| 140 | entries `z_τ` of the columns `L`. The Schur matrix is given by |
| 141 | `b_l (c y) = ∑ l', schur κ c l l' * b_l' (y)`. Then the combination of the coordinates of `F'` by |
| 142 | its row `l` goes to `s` times the coordinate `l` of `F` under `z_τ ↦ c_τᵀ z_τ g_τᵀ`. -/ |
| 143 | lemma twoSidedSubst_firstColsCoord {p : ℕ} [Fintype Φ] (c : Φ → Matrix N N ℂ) |
| 144 | (g : Φ → Matrix L L ℂ) [DecidableEq Φ] {F F' : MvPolynomial (Φ × N × (Fin p ⊕ L)) ℂ} |
| 145 | {s : ℂ} (h_subst : twoSidedSubst c (fun τ : Φ ↦ fromBlocks 1 0 0 (g τ)) F' = s • F) |
| 146 | (κ : Φ → ℕ → ℕ) (l : WeylIndexFamily (fun _ : Φ ↦ N) κ) : |
| 147 | twoSidedSubst c g |
| 148 | (∑ l' : WeylIndexFamily (fun _ : Φ ↦ N) κ, schur κ c l l' • firstColsCoord κ F' l') = |
| 149 | s • firstColsCoord κ F l := by |
| 150 | -- Take coordinates in `h_subst`. Under `inFirstCols` the substitution by `(c, diag(1, g))` splits |
| 151 | -- into `twoSidedSubst c g` on the coefficients and `rowSubst cᵀ` on the first columns; the |
| 152 | -- adjoint of the latter is `rowSubst c` (`fockPairing_rowSubst`), which acts on the basis by the |
| 153 | -- Schur matrix (`sum_schur_smul_nablaBasis`). |
| 154 | let R : Type := MvPolynomial (Φ × N × L) ℂ |
| 155 | let φ : R →+* R := twoSidedSubst c g |
| 156 | have h_split : (inFirstCols (p := p)).comp (twoSidedSubst c fun τ ↦ fromBlocks 1 0 0 (g τ)) = |
| 157 | ((rowSubst fun τ ↦ ((c τ).map C)ᵀ).restrictScalars ℂ).comp |
| 158 | ((mapAlgHom (twoSidedSubst c g)).comp inFirstCols) := |
| 159 | algHom_ext <| by simp [inFirstCols, rowSubst, ← C_mul', Matrix.one_apply] |
| 160 | let v : WeylIndexFamily (fun _ : Φ ↦ N) κ → MatrixPoly ((_ : Φ) × N) R := nablaBasis R _ κ |
| 161 | -- `φ` passes through the pairing with a basis vector, since it fixes that vector. |
| 162 | have h_pass (l' : WeylIndexFamily (fun _ : Φ ↦ N) κ) (G : MatrixPoly ((_ : Φ) × N) R) : |
| 163 | twoSidedSubst c g (fockPairing R G (v l')) = fockPairing R (map φ G) (v l') := by |
| 164 | simpa [φ, v] using map_fockPairing φ G (v l') |
| 165 | have h_schur : rowSubst (fun τ ↦ (c τ).map C) (v l) = ∑ l', (C (schur κ c l l') : R) • v l' := by |
| 166 | simp [R, v, ← sum_schur_smul_nablaBasis, schur_map] |
| 167 | have h_adjoint : fockPairing R (inFirstCols (s • F)) (v l) = |
| 168 | ∑ l', schur κ c l l' • fockPairing R (map φ (inFirstCols F')) (v l') := by |
| 169 | rw [← h_subst, ← inFirstCols.comp_apply, h_split] |
| 170 | simp [φ, fockPairing_rowSubst, h_schur, C_mul'] |
| 171 | have h_smul : s • firstColsCoord κ F l = firstColsCoord κ (s • F) l := by |
| 172 | simp [firstColsCoord, smul_comm s] |
| 173 | rw [h_smul, firstColsCoord, h_adjoint] |
| 174 | simp only [firstColsCoord, map_sum, map_smul, h_pass, smul_sum, smul_comm (schur ..), R, v] |
| 175 | |
| 176 | end New.Rows |
| 177 | |
| 178 | end StackedDeterminants |
| 179 | |
| 180 | end |