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 Aesop.BuiltinRules |
| 4 | public import Lib.GLn.SchurModule.Basic |
| 5 | import TauCeti.Order.Hom.Basic |
| 6 | import Lib.GLn.SchurModule.SchurMatrix |
| 7 | import Lib.General.LinearAlgebra.MinorProducts |
| 8 | |
| 9 | /-! |
| 10 | # The Weyl module inside the tensors of its diagram |
| 11 | |
| 12 | A tensor in the product of exterior powers, one factor for each column of the diagram, is written as |
| 13 | a function on the column fillings `New.ColumnFilling`, which index the basis tensors. |
| 14 | |
| 15 | * `New.fillingMatrix`: the integral matrix that embeds the Weyl module into tensors. Its row at a |
| 16 | column filling holds the coordinates, in the standard basis, of the product of minors |
| 17 | `New.fillingPoly` of that filling. |
| 18 | * `New.fillingMatrixOver_mul_schur`: the Schur matrix of a family of square matrices, one for each |
| 19 | place `τ`, is the restriction of their action `New.minorsMatrix` on tensors. |
| 20 | * `New.span_fillingPoly`: the products of minors span the module of Borel semi-invariants, whose |
| 21 | dual is the Weyl module. |
| 22 | * `New.exists_fillingMatrix_leftInverse`: the Weyl module is a direct summand of the integral |
| 23 | tensors. |
| 24 | |
| 25 | Notions from other files: |
| 26 | * A `Tableau` lists the entries of each column; `tableauPoly R e T` is the product, over the columns |
| 27 | of the tableau `T`, of the `minor` whose rows are the images under `e` of the entries. Here |
| 28 | `minor R I` is the determinant of the variables `y` in the rows `I` and the first columns; |
| 29 | `MatrixPoly ι R` is the ring of polynomials in these variables `y`, indexed by `ι × ℕ` (a row and |
| 30 | a column number). |
| 31 | * `nablaBasis R n κ`, the standard basis, is a chosen basis of products of minors of the module |
| 32 | `nablaFamily R n κ`, indexed by `WeylIndexFamily n κ`; `nablaCombination κ` takes a coordinate |
| 33 | vector to its combination of this basis. A vector of the Weyl module is given by its coordinates |
| 34 | `WeylIndexFamily n κ → R` in the dual basis. |
| 35 | * `rowSubst z` substitutes `z y` for `y`, and row `i` of `schur κ z` holds the coordinates of |
| 36 | `rowSubst z` of the basis element `i`; so `schur κ z` acts on the Weyl module. |
| 37 | |
| 38 | ## Relation to the literature |
| 39 | |
| 40 | Known result: the Weyl module over `ℤ` as a direct summand as a ℤ-module of a tensor product of |
| 41 | exterior powers. Source: Akin, Buchsbaum and Weyman, Schur functors and Schur complexes. |
| 42 | -/ |
| 43 | |
| 44 | @[expose] public section |
| 45 | |
| 46 | noncomputable section |
| 47 | |
| 48 | open MvPolynomial Finset Matrix Fintype Function New «GL» |
| 49 | |
| 50 | namespace New |
| 51 | |
| 52 | section Tensors |
| 53 | |
| 54 | variable {Φ R : Type} [CommRing R] {n : Φ → Type} [∀ τ : Φ, Fintype (n τ)] {κ : Φ → ℕ → ℕ} |
| 55 | |
| 56 | /-- The strictly increasing sequences of length `h` in `Fin N`. -/ |
| 57 | abbrev IncreasingMap (N h : ℕ) : Type := {f : Fin h → Fin N // StrictMono f} |
| 58 | |
| 59 | /-- The Cauchy–Binet formula as a sum over increasing sequences: the determinant of the product of |
| 60 | an `h × N` and an `N × h` matrix is the sum, over the increasing sequences `I` of length `h`, of |
| 61 | the products of the two minors at `I`. -/ |
| 62 | lemma det_mul_eq_sum_increasing {N h : ℕ} |
| 63 | (A : Matrix (Fin h) (Fin N) R) (B : Matrix (Fin N) (Fin h) R) : |
| 64 | (A * B).det = |
| 65 | ∑ I : IncreasingMap N h, (A.submatrix id I.val).det * (B.submatrix I.val id).det := by |
| 66 | -- A set `S` of `h` indices is the same as its increasing enumeration `enumSubset S`. |
| 67 | rw [det_mul_eq_sum_minors] |
| 68 | exact Fintype.sum_equiv |
| 69 | (Set.powersetCard.ofFinEmbEquiv.symm.trans OrderEmbedding.equivSubtypeStrictMono) |
| 70 | _ _ fun _ ↦ mul_comm _ _ |
| 71 | |
| 72 | /-- For an `h` by `n τ` matrix `c`, the determinant of `c y`, where `y` consists of the first `h` |
| 73 | columns of the variables at the place `τ`, is the sum over increasing row numbers `I` of the minor |
| 74 | of `c` with columns `I` times the minor of `y` with rows `I`. Here `rankAt n τ` is the number of |
| 75 | elements of `n τ`, and the row numbers are read as elements of `n τ` through their numbering |
| 76 | `rowEquivFin n τ`. -/ |
| 77 | lemma det_sum_smul_X (τ : Φ) {h : ℕ} (c : Matrix (Fin h) (n τ) R) : |
| 78 | (of fun s t : Fin h ↦ ∑ a : n τ, c s a • X (R := R) ((⟨τ, a⟩ : Σ τ : Φ, n τ), (t : ℕ))).det = |
| 79 | ∑ I : IncreasingMap (rankAt n τ) h, (c.submatrix id ((rowEquivFin n τ).symm ∘ I.val)).det • |
| 80 | minor R (Sigma.mk τ ∘ (rowEquivFin n τ).symm ∘ I.val) := by |
| 81 | have hproduct : (of fun s t : Fin h ↦ |
| 82 | ∑ a : n τ, c s a • X (R := R) ((⟨τ, a⟩ : Σ τ, n τ), (t : ℕ))) = |
| 83 | ((c.submatrix id (rowEquivFin n τ).symm).map C : |
| 84 | Matrix (Fin h) (Fin (rankAt n τ)) (MatrixPoly (Σ τ : Φ, n τ) R)) * |
| 85 | of fun (a : Fin (rankAt n τ)) (t : Fin h) ↦ |
| 86 | X (R := R) ((⟨τ, (rowEquivFin n τ).symm a⟩ : Σ τ, n τ), (t : ℕ)) := by |
| 87 | ext s t : 1 |
| 88 | simp only [of_apply, smul_eq_C_mul] |
| 89 | exact (Equiv.sum_comp (rowEquivFin n τ).symm _).symm |
| 90 | rw [hproduct, det_mul_eq_sum_increasing] |
| 91 | -- Both sides are products of the same minors, by the definition of the matrix of variables. |
| 92 | exact Finset.sum_congr rfl fun I _ ↦ by |
| 93 | simp [smul_eq_C_mul, RingHom.map_det, minor, Matrix.submatrix, Matrix.map, |
| 94 | Function.comp_def] |
| 95 | |
| 96 | variable (n κ) in |
| 97 | /-- The index set of the basis tensors for the diagram with `κ τ h` columns of height `h` at `τ`, |
| 98 | for the heights below the rank `rankAt n τ`, the number of elements of `n τ`: an increasing sequence |
| 99 | of `h` row numbers for each column. -/ |
| 100 | abbrev ColumnFilling : Type := |
| 101 | ∀ (τ : Φ) (h : Fin (rankAt n τ)), Fin (κ τ h) → IncreasingMap (rankAt n τ) h |
| 102 | |
| 103 | /-- The tableau of a column filling at `τ`, with row numbers read as rows through `rowEquivFin n τ`, |
| 104 | the numbering of `n τ` by `Fin (rankAt n τ)`. -/ |
| 105 | def fillingRows (T : ColumnFilling n κ) (τ : Φ) : Tableau (n τ) (rankAt n τ) (κ τ) := |
| 106 | fun (h : Fin (rankAt n τ)) (j : Fin (κ τ h)) (s : Fin h) ↦ (rowEquivFin n τ).symm ((T τ h j).1 s) |
| 107 | |
| 108 | variable [Fintype Φ] |
| 109 | |
| 110 | variable (R) in |
| 111 | /-- The product of the minors of the variables on the columns of a filling: a column of height `h` |
| 112 | gives the minor with the rows of its entries and the first `h` columns of variables. -/ |
| 113 | def fillingPoly (T : ColumnFilling n κ) : MatrixPoly (Σ τ : Φ, n τ) R := |
| 114 | ∏ τ : Φ, tableauPoly R (Sigma.mk τ) (fillingRows T τ) |
| 115 | |
| 116 | variable (κ) in |
| 117 | /-- The matrix by which `z` acts on tensors: the entry at `(T, T')` is the product, over the |
| 118 | columns of the diagram, of the minor of `z τ` with rows from `T` and columns from `T'`, where `τ` |
| 119 | is the place of the column. -/ |
| 120 | def minorsMatrix (z : ∀ τ : Φ, Matrix (n τ) (n τ) R) : |
| 121 | Matrix (ColumnFilling n κ) (ColumnFilling n κ) R := |
| 122 | of fun T T' : ColumnFilling n κ ↦ ∏ τ : Φ, ∏ h : Fin (rankAt n τ), ∏ j : Fin (κ τ h), |
| 123 | ((z τ).submatrix (fillingRows T τ h j) (fillingRows T' τ h j)).det |
| 124 | |
| 125 | end Tensors |
| 126 | |
| 127 | section Action |
| 128 | |
| 129 | variable {Φ R : Type} [CommRing R] {n : Φ → Type} [∀ τ : Φ, Fintype (n τ)] {κ : Φ → ℕ → ℕ} |
| 130 | [Fintype Φ] |
| 131 | |
| 132 | /-- The action `minorsMatrix` of transposed matrices on tensors is the transpose of the action. -/ |
| 133 | lemma minorsMatrix_transpose (z : ∀ τ : Φ, Matrix (n τ) (n τ) R) : |
| 134 | minorsMatrix κ (fun τ : Φ ↦ (z τ)ᵀ) = (minorsMatrix κ z)ᵀ := by |
| 135 | ext T T' |
| 136 | simp only [minorsMatrix, of_apply, transpose_apply, ← transpose_submatrix, det_transpose] |
| 137 | |
| 138 | variable [DecidableEq Φ] |
| 139 | |
| 140 | omit [DecidableEq Φ] [Fintype Φ] in |
| 141 | /-- Substituting `z y` for the variables `y` in the minor with rows `J` at the place `τ` gives the |
| 142 | sum, over increasing row numbers `I`, of the minor of `z τ` with rows `J` and columns `I` times the |
| 143 | minor of `y` with rows `I`. -/ |
| 144 | lemma rowSubst_minor_comp_sigmaMk (z : ∀ τ : Φ, Matrix (n τ) (n τ) R) (τ : Φ) {h : ℕ} |
| 145 | (J : Fin h → n τ) : |
| 146 | rowSubst z (minor R (Sigma.mk τ ∘ J)) = ∑ I : IncreasingMap (rankAt n τ) h, |
| 147 | ((z τ).submatrix J ((rowEquivFin n τ).symm ∘ I.val)).det • |
| 148 | minor R (Sigma.mk τ ∘ (rowEquivFin n τ).symm ∘ I.val) := by |
| 149 | refine Eq.trans ?_ (det_sum_smul_X τ ((z τ).submatrix J id)) |
| 150 | simp [minor, AlgHom.map_det, rowSubst, Matrix.map] |
| 151 | |
| 152 | /-- For a family of tableaux `U`, substituting `z y` for the variables `y` in the product of the |
| 153 | minors on the columns of `U` gives the sum over column fillings `T` of the product of minors |
| 154 | `fillingPoly` of `T`, times the product over the columns of the minor of `z τ` with rows from `U` |
| 155 | and columns from `T`, where `τ` is the place of the column. -/ |
| 156 | lemma rowSubst_prod_tableauPoly (z : ∀ τ : Φ, Matrix (n τ) (n τ) R) |
| 157 | (U : ∀ τ : Φ, Tableau (n τ) (rankAt n τ) (κ τ)) : |
| 158 | rowSubst z (∏ τ : Φ, tableauPoly R (Sigma.mk τ) (U τ)) = |
| 159 | ∑ T : ColumnFilling n κ, (∏ τ : Φ, ∏ h : Fin (rankAt n τ), ∏ j : Fin (κ τ h), |
| 160 | ((z τ).submatrix (U τ h j) (fillingRows T τ h j)).det) • fillingPoly R T := by |
| 161 | simp only [fillingPoly, tableauPoly, map_prod, rowSubst_minor_comp_sigmaMk, Fintype.prod_sum, |
| 162 | Finset.prod_smul] |
| 163 | -- The rows of the column filling are `fillingRows T` by definition. |
| 164 | rfl |
| 165 | |
| 166 | /-- Substituting `z y` for `y` in the product of minors `fillingPoly` of a column filling `T` gives |
| 167 | the combination of these products with row `T` of the matrix `minorsMatrix` as coefficients. -/ |
| 168 | lemma rowSubst_fillingPoly (z : ∀ τ : Φ, Matrix (n τ) (n τ) R) (T : ColumnFilling n κ) : |
| 169 | rowSubst z (fillingPoly R T) = |
| 170 | ∑ T' : ColumnFilling n κ, minorsMatrix κ z T T' • fillingPoly R T' := |
| 171 | rowSubst_prod_tableauPoly z (fillingRows T) |
| 172 | |
| 173 | end Action |
| 174 | |
| 175 | section Embedding |
| 176 | |
| 177 | variable {Φ R : Type} [CommRing R] {n : Φ → Type} [∀ τ : Φ, Fintype (n τ)] {κ : Φ → ℕ → ℕ} |
| 178 | [Fintype Φ] [DecidableEq Φ] [∀ τ : Φ, DecidableEq (n τ)] |
| 179 | |
| 180 | variable (n κ) in |
| 181 | /-- The integral matrix of the embedding of the Weyl module into tensors: row `T` holds the |
| 182 | coordinates, in the standard basis, of the product of minors of `T`. -/ |
| 183 | def fillingMatrix : Matrix (ColumnFilling n κ) (WeylIndexFamily n κ) ℤ := |
| 184 | of fun T : ColumnFilling n κ ↦ invFun (nablaCombination (R := ℤ) κ) (fillingPoly ℤ T) |
| 185 | |
| 186 | variable (R n κ) in |
| 187 | /-- The matrix `fillingMatrix` with its entries mapped into `R`. -/ |
| 188 | abbrev fillingMatrixOver : Matrix (ColumnFilling n κ) (WeylIndexFamily n κ) R := |
| 189 | (fillingMatrix n κ).map (Int.cast : ℤ → R) |
| 190 | |
| 191 | omit [(τ : Φ) → DecidableEq (n τ)] in |
| 192 | lemma fillingMatrixOver_int : fillingMatrixOver ℤ n κ = fillingMatrix n κ := by |
| 193 | ext T i |
| 194 | simp |
| 195 | |
| 196 | /-- For a column filling `T` (an increasing sequence of rows in each column of the diagram `κ`), the |
| 197 | row `T` of the embedding `fillingMatrixOver` of the Weyl module into tensors is the coordinate |
| 198 | vector of the product of minors `fillingPoly R T`: the map `nablaCombination`, which takes |
| 199 | coordinates to the combination of the standard basis of products of minors, sends it to that |
| 200 | product. -/ |
| 201 | lemma nablaCombination_fillingMatrixOver (T : ColumnFilling n κ) : |
| 202 | nablaCombination κ (fillingMatrixOver R n κ T : WeylIndexFamily n κ → R) = fillingPoly R T := by |
| 203 | -- By definition, row `T` of `fillingMatrix` holds coordinates of `fillingPoly ℤ T`. |
| 204 | have hZ : ∑ i : WeylIndexFamily n κ, fillingMatrix n κ T i • nablaBasis ℤ n κ i = |
| 205 | fillingPoly ℤ T := |
| 206 | sum_coords_nablaBasis (prod_tableauPoly_mem_nabla (T := fillingRows T)) |
| 207 | have hmap : MvPolynomial.map (Int.castRingHom R) (fillingPoly ℤ T) = fillingPoly R T := by |
| 208 | simp [fillingPoly, tableauPoly, minor, RingHom.map_det, Matrix.map] |
| 209 | -- Apply the change of rings from `ℤ` to `R` to the expansion over `ℤ`. |
| 210 | simp [← hmap, ← hZ, Fintype.linearCombination_apply, smul_eq_C_mul] |
| 211 | |
| 212 | /-- The embedding `fillingMatrixOver` of the Weyl module into tensors sends the vector `weylEval`, |
| 213 | of the values at `y` of the standard basis of products of minors, to the vector whose coordinate at |
| 214 | a column filling `T` is the value at `y` of the product of minors `fillingPoly R T`. -/ |
| 215 | lemma fillingMatrixOver_mulVec_weylEval (y : (Σ τ : Φ, n τ) × ℕ → R) (T : ColumnFilling n κ) : |
| 216 | (fillingMatrixOver R n κ *ᵥ weylEval n κ y) T = eval y (fillingPoly R T) := by |
| 217 | simp [← nablaCombination_fillingMatrixOver T, Fintype.linearCombination_apply, mulVec, dotProduct, |
| 218 | weylEval] |
| 219 | |
| 220 | /-- For a tensor `v`, given by its values on column fillings, the transposed embedding |
| 221 | `(fillingMatrixOver R n κ)ᵀ` takes `v` to the coordinates of the combination with coefficients `v` |
| 222 | of the products of minors `fillingPoly`. Here `nablaCombination` takes coordinates to the |
| 223 | combination of the standard basis of products of minors. -/ |
| 224 | lemma nablaCombination_transpose_mulVec (v : ColumnFilling n κ → R) : |
| 225 | nablaCombination κ ((fillingMatrixOver R n κ)ᵀ *ᵥ v) = |
| 226 | ∑ T : ColumnFilling n κ, v T • fillingPoly R T := by |
| 227 | -- The transposed matrix sends `v` to the combination of the rows with coefficients `v`. |
| 228 | simp only [mulVec_transpose, vecMul_eq_sum, map_sum, map_smul, nablaCombination_fillingMatrixOver] |
| 229 | |
| 230 | /-- For a family `z` of square matrices, the embedding `fillingMatrixOver` of the Weyl module into |
| 231 | tensors intertwines the Schur matrix `schur κ z`, the action of `z` on the Weyl module, with |
| 232 | `minorsMatrix κ z`, the action of `z` on tensors by products of minors. -/ |
| 233 | lemma fillingMatrixOver_mul_schur (z : ∀ τ : Φ, Matrix (n τ) (n τ) R) : |
| 234 | fillingMatrixOver R n κ * schur κ z = minorsMatrix κ z * fillingMatrixOver R n κ := by |
| 235 | refine funext fun T : ColumnFilling n κ ↦ ?_ |
| 236 | -- Both rows are compared as combinations of the standard basis, which is independent. |
| 237 | apply nablaCombination_injective |
| 238 | calc nablaCombination κ ((fillingMatrixOver R n κ * schur κ z) T) |
| 239 | = rowSubst z (nablaCombination κ (fillingMatrixOver R n κ T)) := by |
| 240 | simp [mul_apply_eq_vecMul, vecMul_eq_sum, |
| 241 | Fintype.linearCombination_apply] |
| 242 | _ = nablaCombination κ ((minorsMatrix κ z * fillingMatrixOver R n κ) T) := by |
| 243 | simp [nablaCombination_fillingMatrixOver, rowSubst_fillingPoly, mul_apply_eq_vecMul, |
| 244 | vecMul_eq_sum] |
| 245 | |
| 246 | variable (R n κ) in |
| 247 | /-- The module `nablaFamily R n κ` of Borel semi-invariants is the span of the products of minors |
| 248 | `fillingPoly R T` over all column fillings `T`, the coordinates of the tensor of the variables. -/ |
| 249 | lemma span_fillingPoly : |
| 250 | Submodule.span R (Set.range fun T : ColumnFilling n κ ↦ fillingPoly R T) = |
| 251 | nablaFamily R n κ := by |
| 252 | refine le_antisymm (Submodule.span_le.2 <| Set.range_subset_iff.2 fun T ↦ |
| 253 | prod_tableauPoly_mem_nabla (T := fillingRows T)) ?_ |
| 254 | rw [← range_nablaCombination, Fintype.range_linearCombination, Submodule.span_le] |
| 255 | refine Set.range_subset_iff.2 fun i ↦ ?_ |
| 256 | -- Substituting the identity matrices into a basis element, a product of minors with rows in |
| 257 | -- any order, expands it in the products with increasing rows. |
| 258 | rw [(rowSubst_one (nablaBasis R n κ i)).symm.trans <| |
| 259 | rowSubst_prod_tableauPoly (fun τ ↦ (1 : Matrix (n τ) (n τ) R)) fun τ ↦ (i τ).val] |
| 260 | exact Submodule.sum_mem _ fun T _ ↦ Submodule.smul_mem _ _ (Submodule.subset_span ⟨T, rfl⟩) |
| 261 | |
| 262 | /-- The integral matrix `fillingMatrix`, which embeds the Weyl module of the diagram `κ` (with basis |
| 263 | indexed by `WeylIndexFamily n κ`) into tensors (with basis indexed by column fillings), has an |
| 264 | integral left inverse. So the Weyl module is a direct summand of the integral tensors. -/ |
| 265 | lemma exists_fillingMatrix_leftInverse : |
| 266 | ∃ Q : Matrix (WeylIndexFamily n κ) (ColumnFilling n κ) ℤ, Q * fillingMatrix n κ = 1 := by |
| 267 | -- The map from tensors onto the span of the products of minors splits, as its target is free: |
| 268 | -- choose a tensor `v i` over each basis element. |
| 269 | have h_onto (i : WeylIndexFamily n κ) : ∃ v : ColumnFilling n κ → ℤ, |
| 270 | ∑ T : ColumnFilling n κ, v T • fillingPoly ℤ T = nablaBasis ℤ n κ i := by |
| 271 | rw [← Submodule.mem_span_range_iff_exists_fun, span_fillingPoly, nablaBasis] |
| 272 | exact prod_tableauPoly_mem_nabla |
| 273 | choose v hv using h_onto |
| 274 | refine ⟨of v, funext fun i : WeylIndexFamily n κ ↦ ?_⟩ |
| 275 | apply nablaCombination_injective |
| 276 | have h_row : (of v * fillingMatrix n κ) i = (fillingMatrixOver ℤ n κ)ᵀ *ᵥ v i := by |
| 277 | rw [fillingMatrixOver_int, mulVec_transpose, mul_apply_eq_vecMul] |
| 278 | rfl |
| 279 | rw [h_row, nablaCombination_transpose_mulVec, hv] |
| 280 | simp [Matrix.one_apply, Fintype.linearCombination_apply] |
| 281 | |
| 282 | end Embedding |
| 283 | |
| 284 | end New |