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.LinearAlgebra.IntegralLattices |
| 4 | import Lib.Adelic.Unitary.ComponentsAndBlockSums |
| 5 | import Lib.Adelic.Witt.WittTheorem |
| 6 | import Lib.General.LinearAlgebra.HermiteForm |
| 7 | |
| 8 | /-! |
| 9 | # Rows and columns of integral matrices, primitive matrices and the law of partners |
| 10 | |
| 11 | This file develops linear algebra over a subring `O` of a commutative ring `R`, for the local |
| 12 | computations with partner functions. The index set `n` is split by `e : b ⊕ a ≃ n`. For |
| 13 | `k ∈ GL n R`, `New.firstCols e k` is the matrix of the columns `b` of `k`, and |
| 14 | `New.invLastRows e k`, `New.invFirstRows e k` are the matrices of the rows `a` and `b` of `k⁻¹`. |
| 15 | |
| 16 | ## Main definitions and results |
| 17 | |
| 18 | * `New.AreMatched`: two functions `Φ`, `Ψ` supported on the blocks `New.invLastRows e k` and |
| 19 | `New.firstCols e k` of `k ∈ GL n O`, whose values differ by the factor `χ (det k)`. |
| 20 | * `New.IsPrimitiveMatrix.mul_iff`: for primitive `y`, the matrix `y * x` is primitive exactly if `x` |
| 21 | is primitive. |
| 22 | * `New.exists_firstCols_eq_mul`: multiplying `firstCols e k` by an element of `GL b O` and |
| 23 | `invLastRows e k` by an element of `GL a O` gives the blocks of another element of `GL n O`, |
| 24 | whose determinant is computed. |
| 25 | * `New.IsValuationPair.exists_firstCols_iff`: if `New.IsValuationPair O` holds, the primitive |
| 26 | matrices are the `firstCols e k` with `k` in `GL n O`. |
| 27 | * `New.AreMatched.lift_of_reduction`: partners over `R` lift along a surjective local homomorphism |
| 28 | `O → R`; here `O` is a subring of another ring `F`. |
| 29 | * `New.AreMatched.left_mul`, `New.AreMatched.right_mul`: the transformation laws of the two |
| 30 | partners, exchanged by `New.AreMatched.transpose`. |
| 31 | |
| 32 | Notions from other files: |
| 33 | * `New.intGL n O`: the group `GL n O` as a subgroup of `GL n R`. |
| 34 | * `New.IsPrimitiveMatrix O y`: the matrix `y` and some left inverse of it have entries in `O`. |
| 35 | * `New.HasLeftInv X`: the matrix `X` has a left inverse over `R`. |
| 36 | * `New.liftIntegralFn π f`: the function that is `f` at the image under `π` of a matrix over `O` |
| 37 | and zero at every other matrix. |
| 38 | * `New.IsValuationPair O`: for all `u`, `v` in `R` there is an idempotent `ε` in `O` such that `u` |
| 39 | and `v` are `O`-multiples of `(1 - ε) u + ε v`. |
| 40 | |
| 41 | ## Relation to the literature |
| 42 | |
| 43 | Known; see `Lib.SiegelWeil.Tower.LargeSideConstantTerm` for sources. |
| 44 | -/ |
| 45 | |
| 46 | @[expose] public section |
| 47 | |
| 48 | noncomputable section |
| 49 | |
| 50 | /-! ## Invertibility detected after a local ring homomorphism -/ |
| 51 | |
| 52 | /-- A square matrix is invertible if its image under a local ring homomorphism is invertible. -/ |
| 53 | lemma New.isUnit_of_mapMatrix {R n : Type*} [CommRing R] [Fintype n] [DecidableEq n] {S : Type*} |
| 54 | [CommRing S] (f : R →+* S) [IsLocalHom f] {M : Matrix n n R} |
| 55 | (h_map : IsUnit (f.mapMatrix M)) : IsUnit M := by |
| 56 | rw [Matrix.isUnit_iff_isUnit_det] at h_map ⊢ |
| 57 | exact isUnit_of_map_unit f M.det (by rwa [f.map_det]) |
| 58 | |
| 59 | namespace New |
| 60 | |
| 61 | open Matrix Function |
| 62 | |
| 63 | section Blocks |
| 64 | |
| 65 | variable {R a b n : Type} [CommRing R] |
| 66 | [Fintype n] [DecidableEq n] (O : Subring R) {y : Matrix n b R} (e : b ⊕ a ≃ n) (k : GL n R) |
| 67 | |
| 68 | /-! ### Blocks of an invertible matrix and partners -/ |
| 69 | |
| 70 | /-- For `k` invertible and the indices split by `e : b ⊕ a ≃ n`, the rows of `k⁻¹` indexed by the |
| 71 | block `a`. -/ |
| 72 | abbrev invLastRows : Matrix a n R := k⁻¹.val.submatrix (e ∘ Sum.inr) id |
| 73 | |
| 74 | /-- For `k` invertible and the indices split by `e : b ⊕ a ≃ n`, the columns of `k` indexed by the |
| 75 | block `b`. -/ |
| 76 | abbrev firstCols : Matrix n b R := k.val.submatrix id (e ∘ Sum.inl) |
| 77 | |
| 78 | /-- Right multiplication of the last rows of the inverse corresponds to left translation |
| 79 | of the original matrix by the inverse of the multiplier. -/ |
| 80 | lemma invLastRows_mul (g k : GL n R) : |
| 81 | invLastRows e k * g.val = invLastRows e (g⁻¹ * k) := by |
| 82 | change k⁻¹.val.submatrix (e ∘ Sum.inr) id * g.val = |
| 83 | (g⁻¹ * k)⁻¹.val.submatrix (e ∘ Sum.inr) id |
| 84 | rw [_root_.mul_inv_rev, inv_inv, Units.val_mul, |
| 85 | submatrix_mul _ _ _ id _ bijective_id, submatrix_id_id] |
| 86 | |
| 87 | /-- Left multiplication of the selected columns agrees with selection after multiplication. -/ |
| 88 | lemma mul_firstCols (g k : GL n R) : |
| 89 | g.val * firstCols e k = firstCols e (g * k) := rfl |
| 90 | |
| 91 | /-- The functions `Φ` on `a × n` matrices and `Ψ` on `n × b` matrices are partners for the |
| 92 | multiplicative character `χ` over `O` if `Φ` vanishes off the matrices `invLastRows e k` and `Ψ` off |
| 93 | the matrices `firstCols e k`, for `k` in `GL_n(O)`, and |
| 94 | `Φ (invLastRows e k) = χ (det k) * Ψ (firstCols e k)` for all such `k`. -/ |
| 95 | structure AreMatched (χ : MulChar R ℂ) (Φ : Matrix a n R → ℂ) (Ψ : Matrix n b R → ℂ) where |
| 96 | /-- `Φ` vanishes off the matrices `invLastRows e k`, the rows `a` of `k⁻¹`, for `k` in |
| 97 | `GL_n(O)`. -/ |
| 98 | supp_left (x : Matrix a n R) : Φ x ≠ 0 → ∃ k ∈ intGL n O, x = invLastRows e k |
| 99 | /-- `Ψ` vanishes off the matrices `firstCols e k`, the columns `b` of `k`, for `k` in |
| 100 | `GL_n(O)`. -/ |
| 101 | supp_right (y : Matrix n b R) : Ψ y ≠ 0 → ∃ k ∈ intGL n O, y = firstCols e k |
| 102 | /-- For `k` in `GL_n(O)` the values of `Φ` and `Ψ` differ by the factor `χ (det k)`. -/ |
| 103 | apply_eq : ∀ k ∈ intGL n O, Φ (invLastRows e k) = χ k.val.det * Ψ (firstCols e k) |
| 104 | |
| 105 | variable {O} |
| 106 | |
| 107 | /-! ### Left inverses and primitive matrices -/ |
| 108 | |
| 109 | /-- For `k ∈ GL n R` and the indices split as `b ⊕ a`, the rows of `k⁻¹` indexed by `b`. -/ |
| 110 | abbrev invFirstRows : Matrix b n R := k⁻¹.val.submatrix (e ∘ Sum.inl) id |
| 111 | |
| 112 | /-- The rows `b` of `k⁻¹` form a left inverse of the columns `b` of `k`. -/ |
| 113 | lemma invFirstRows_mul_firstCols [DecidableEq b] : invFirstRows e k * firstCols e k = 1 := by |
| 114 | simp [← submatrix_mul, ← ext_iff, Matrix.one_apply] |
| 115 | |
| 116 | /-- The rows `a` of the inverse of `invTransposeGL k = (kᵀ)⁻¹` are the transposed columns `a` of |
| 117 | `k`. -/ |
| 118 | lemma invLastRows_invTransposeGL : |
| 119 | invLastRows e (invTransposeGL k) = (firstCols ((Equiv.sumComm a b).trans e) k)ᵀ := |
| 120 | rfl |
| 121 | |
| 122 | /-- The transposed rows `a` of `k⁻¹` are the columns `a` of `invTransposeGL k = (kᵀ)⁻¹`. -/ |
| 123 | lemma transpose_invLastRows : |
| 124 | (invLastRows e k)ᵀ = firstCols ((Equiv.sumComm a b).trans e) (invTransposeGL k) := |
| 125 | rfl |
| 126 | |
| 127 | /-- The transpose of `invLastRows e k` has a left inverse. -/ |
| 128 | lemma hasLeftInv_invLastRows_transpose [DecidableEq a] : HasLeftInv (invLastRows e k)ᵀ := by |
| 129 | rw [transpose_invLastRows] |
| 130 | exact ⟨_, invFirstRows_mul_firstCols _ _⟩ |
| 131 | |
| 132 | omit [DecidableEq n] in |
| 133 | /-- Multiplication on the left by a primitive matrix preserves and reflects integrality. -/ |
| 134 | lemma IsPrimitiveMatrix.isIntMatrix_mul_iff [Fintype b] [DecidableEq b] |
| 135 | {x : Matrix b a R} (hy : IsPrimitiveMatrix O y) : |
| 136 | IsIntMatrix O (y * x) ↔ IsIntMatrix O x := by |
| 137 | obtain ⟨hy_int, L, hL_int, hL⟩ := hy |
| 138 | refine ⟨fun h ↦ ?_, hy_int.mul⟩ |
| 139 | simpa [← L.mul_assoc, hL] using hL_int.mul h |
| 140 | |
| 141 | omit [DecidableEq n] in |
| 142 | /-- Let `y` be primitive over `O`, that is, integral with an integral left inverse. Then `y * x` is |
| 143 | primitive if and only if `x` is. -/ |
| 144 | lemma IsPrimitiveMatrix.mul_iff [DecidableEq a] [Fintype b] [DecidableEq b] |
| 145 | {x : Matrix b a R} (hy_prim : IsPrimitiveMatrix O y) : |
| 146 | IsPrimitiveMatrix O (y * x) ↔ IsPrimitiveMatrix O x := by |
| 147 | have h_int := hy_prim.isIntMatrix_mul_iff (x := x) |
| 148 | obtain ⟨hy, L, hL_int, hL⟩ := hy_prim |
| 149 | refine ⟨fun ⟨hyx, M, hM_int, hM⟩ ↦ ?_, fun ⟨hx, M, hM_int, hM⟩ ↦ ?_⟩ |
| 150 | · -- Multiplication by `y` reflects integrality, and `M * y` is a left inverse of `x`. |
| 151 | exact ⟨h_int.1 hyx, M * y, hM_int.mul hy, by rwa [M.mul_assoc]⟩ |
| 152 | · -- `M * L` is a left inverse of `y * x`. |
| 153 | exact ⟨h_int.2 hx, M * L, hM_int.mul hL_int, by simp [← L.mul_assoc, hL, hM, Matrix.mul_assoc]⟩ |
| 154 | |
| 155 | /-- An invertible matrix is primitive over `O` if and only if it lies in `GL n O`. -/ |
| 156 | lemma isPrimitiveMatrix_iff_mem_intGL : IsPrimitiveMatrix O k.val ↔ k ∈ intGL n O := by |
| 157 | simp [isPrimitiveMatrix_iff, Units.val_inj] |
| 158 | |
| 159 | /-- A block of columns of a matrix in `GL n O` is primitive over `O`. -/ |
| 160 | lemma isPrimitiveMatrix_firstCols [DecidableEq b] {k : GL n R} (hk : k ∈ intGL n O) : |
| 161 | IsPrimitiveMatrix O (firstCols e k) := |
| 162 | ((isPrimitiveMatrix_iff_mem_intGL k).2 hk).submatrix_cols (e.injective.comp Sum.inl_injective) |
| 163 | |
| 164 | /-! ### Columns of a matrix and rows of its inverse -/ |
| 165 | |
| 166 | /-- A matrix consists of the rows `a` of `k⁻¹` for some `k ∈ GL n O` exactly if its transpose |
| 167 | consists of the columns `a` of some `k ∈ GL n O`. -/ |
| 168 | lemma exists_invLastRows_iff_transpose {x : Matrix a n R} : |
| 169 | (∃ k ∈ intGL n O, x = invLastRows e k) ↔ |
| 170 | ∃ k ∈ intGL n O, xᵀ = firstCols (Equiv.trans (Equiv.sumComm a b) e) k := by |
| 171 | -- Reparametrise by the involution `invTransposeGL`, which preserves `GL n O`. |
| 172 | refine invTransposeGL.exists_congr' fun k ↦ ?_ |
| 173 | change invTransposeGL k ∈ intGL n O ∧ x = invLastRows e (invTransposeGL k) ↔ _ |
| 174 | rw [invLastRows_invTransposeGL, invTransposeGL_mem_intGL, ← transpose_inj, transpose_transpose] |
| 175 | |
| 176 | /-- The rows `a` of `k⁻¹` kill the columns `b` of `k`. -/ |
| 177 | lemma invLastRows_mul_firstCols : invLastRows e k * firstCols e k = 0 := by |
| 178 | simp [← submatrix_mul, ← ext_iff] |
| 179 | |
| 180 | variable [Fintype a] [Fintype b] |
| 181 | |
| 182 | omit [Fintype a] in |
| 183 | /-- Complete the rows `invLastRows e k` by rows `s` to a square matrix. Its determinant times |
| 184 | `det k` is the determinant of `s * firstCols e k`. -/ |
| 185 | lemma det_fromRows_invLastRows [Finite a] [DecidableEq b] (s : Matrix b n R) : |
| 186 | ((fromRows s (invLastRows e k)).submatrix e.symm id).det * k.val.det = |
| 187 | (s * firstCols e k).det := by |
| 188 | classical |
| 189 | let := Fintype.ofFinite a |
| 190 | -- In the blocks given by `e`, the product with `k` is upper triangular with diagonal blocks |
| 191 | -- `s * firstCols e k` and `1`, since the rows `invLastRows e k` are rows of `k⁻¹`. |
| 192 | let lastCols : Matrix n a R := k.val.submatrix id (e ∘ Sum.inr) |
| 193 | have h_one : invLastRows e k * lastCols = 1 := by |
| 194 | simp [lastCols, ← submatrix_mul, ← ext_iff, Matrix.one_apply] |
| 195 | have h_blocks : ((fromRows s (invLastRows e k)).submatrix e.symm id * k.val).submatrix e e = |
| 196 | fromBlocks (s * firstCols e k) (s * lastCols) 0 1 := by |
| 197 | have h_cols : k.val.submatrix id e = fromCols (firstCols e k) lastCols := by |
| 198 | ext i (j | j) <;> rfl |
| 199 | simp [submatrix_mul _ _ e id e bijective_id, h_cols, |
| 200 | invLastRows_mul_firstCols, h_one] |
| 201 | rw [← det_mul, ← det_submatrix_equiv_self e, h_blocks, det_fromBlocks_zero₂₁, det_one, mul_one] |
| 202 | |
| 203 | omit [Fintype a] in |
| 204 | /-- A matrix `y` that is killed by `invLastRows e k` is a combination of the columns |
| 205 | `firstCols e k`, with coefficients `invFirstRows e k * y`. -/ |
| 206 | lemma firstCols_mul_invFirstRows_mul [Finite a] (h_kill : invLastRows e k * y = 0) : |
| 207 | firstCols e k * (invFirstRows e k * y) = y := by |
| 208 | let := Fintype.ofFinite a |
| 209 | let lastCols : Matrix n a R := k.val.submatrix id (e ∘ Sum.inr) |
| 210 | -- Cut the product `k * k⁻¹ = 1` along `e`. |
| 211 | have h_sum : firstCols e k * invFirstRows e k + lastCols * invLastRows e k = 1 := by |
| 212 | rw [← k.mul_inv] |
| 213 | ext i j |
| 214 | simp [lastCols, Matrix.mul_apply, ← e.sum_comp, Fintype.sum_sum_type] |
| 215 | simpa [Matrix.add_mul, Matrix.mul_assoc, h_kill] using congrArg (· * y) h_sum |
| 216 | |
| 217 | /-- If the rows `a` of `γ⁻¹` and `γ'⁻¹` agree, then the columns `b` of `γ'` are those of `γ` |
| 218 | multiplied on the right by an invertible `h` with `det γ' = det γ * det h`. -/ |
| 219 | lemma Exchange.exists_firstCols_eq_mul_of_invLastRows_eq {R a b n : Type} [Fintype a] [Fintype b] |
| 220 | [DecidableEq b] [Fintype n] [DecidableEq n] [CommRing R] {e : b ⊕ a ≃ n} {γ γ' : GL n R} |
| 221 | (h_eq : invLastRows e γ = invLastRows e γ') : |
| 222 | ∃ h : GL b R, firstCols e γ' = firstCols e γ * h.val ∧ γ'.val.det = γ.val.det * h.val.det := by |
| 223 | have h_cols : firstCols e γ * (invFirstRows e γ * firstCols e γ') = firstCols e γ' := |
| 224 | firstCols_mul_invFirstRows_mul e γ (by rw [h_eq, invLastRows_mul_firstCols]) |
| 225 | let h : GL b R := .mk'' (invFirstRows e γ * firstCols e γ') <| |
| 226 | isUnit_det_of_left_inverse (B := invFirstRows e γ' * firstCols e γ) <| by |
| 227 | rw [Matrix.mul_assoc, h_cols, invFirstRows_mul_firstCols] |
| 228 | refine ⟨h, h_cols.symm, ?_⟩ |
| 229 | let d : R := ((fromRows (invFirstRows e γ) (invLastRows e γ)).submatrix e.symm id).det |
| 230 | have h_one : d * γ.val.det = 1 := by |
| 231 | rw [det_fromRows_invLastRows, invFirstRows_mul_firstCols, det_one] |
| 232 | have h_mixed : d * γ'.val.det = h.val.det := by |
| 233 | simp only [d, h, h_eq, det_fromRows_invLastRows, GeneralLinearGroup.val_mk''] |
| 234 | linear_combination γ.val.det * h_mixed - γ'.val.det * h_one |
| 235 | |
| 236 | variable [DecidableEq a] [DecidableEq b] |
| 237 | |
| 238 | /-- For `g ∈ GL b O`, `f ∈ GL a O` and `k ∈ GL n O`, the matrices `firstCols e k * g` and |
| 239 | `f * invLastRows e k` come from one `j ∈ GL n O`, with `det j * det f = det k * det g`. -/ |
| 240 | lemma exists_firstCols_eq_mul (O : Subring R) (g : GL b R) (hg : g ∈ intGL b O) (f : GL a R) |
| 241 | (hf : f ∈ intGL a O) (hk : k ∈ intGL n O) : |
| 242 | ∃ j ∈ intGL n O, |
| 243 | firstCols e j = firstCols e k * g.val ∧ |
| 244 | invLastRows e j = f.val * invLastRows e k ∧ |
| 245 | j.val.det * f.val.det = k.val.det * g.val.det := by |
| 246 | -- Multiply `k` on the right by the block diagonal matrix `d` with blocks `g` and `f⁻¹`. |
| 247 | let d : GL n R := reindexGL e (blockGL (g, f⁻¹)) |
| 248 | have hd : d ∈ intGL n O := by simp_all [d, mem_intGL, reindex_equiv e, ← map_inv] |
| 249 | refine ⟨k * d, mul_mem hk hd, ?_, ?_, by simp [d, mul_assoc, Ring.inverse_mul_cancel]⟩ <;> |
| 250 | simp [d, Matrix.mul_apply, reindex_equiv e, ← map_inv, ← ext_iff] |
| 251 | |
| 252 | omit [Fintype b] [DecidableEq b] in |
| 253 | /-- The set of the matrices `invLastRows e k` (rows `a` of `k⁻¹`) with `k ∈ GL n O` is stable under |
| 254 | left multiplication by `GL a O`. -/ |
| 255 | lemma exists_eq_invLastRows_of_mul_eq [Finite b] {f : GL a R} (hf : f ∈ intGL a O) |
| 256 | {x : Matrix a n R} (h : ∃ k ∈ intGL n O, f.val * x = invLastRows e k) : |
| 257 | ∃ k ∈ intGL n O, x = invLastRows e k := by |
| 258 | classical |
| 259 | let := Fintype.ofFinite b |
| 260 | obtain ⟨k, hk, hx⟩ := h |
| 261 | obtain ⟨j, hj, -, hj_rows, -⟩ := exists_firstCols_eq_mul e k O 1 (one_mem _) _ (inv_mem hf) hk |
| 262 | exact ⟨j, hj, by simp [hj_rows, ← hx]⟩ |
| 263 | |
| 264 | omit [Fintype a] [DecidableEq a] in |
| 265 | /-- The set of the matrices `firstCols e k` (columns `b` of `k`) with `k ∈ GL n O` is stable under |
| 266 | right multiplication by `GL b O`. -/ |
| 267 | lemma exists_mul_eq_firstCols_iff [Finite a] {g : GL b R} (hg : g ∈ intGL b O) : |
| 268 | (∃ k ∈ intGL n O, y * g.val = firstCols e k) ↔ ∃ k ∈ intGL n O, y = firstCols e k := by |
| 269 | classical |
| 270 | let := Fintype.ofFinite a |
| 271 | refine ⟨fun ⟨k, hk, hy⟩ ↦ ?_, ?_⟩ |
| 272 | · obtain ⟨j, hj, hj_cols, -⟩ := exists_firstCols_eq_mul e k O g⁻¹ (inv_mem hg) 1 (one_mem _) hk |
| 273 | exact ⟨j, hj, by simp [hj_cols, ← hy]⟩ |
| 274 | · rintro ⟨k, hk, rfl⟩ |
| 275 | obtain ⟨j, hj, hj_cols, -⟩ := exists_firstCols_eq_mul e k O g hg 1 (one_mem _) hk |
| 276 | exact ⟨j, hj, hj_cols.symm⟩ |
| 277 | |
| 278 | omit [Fintype a] [Fintype b] [DecidableEq a] in |
| 279 | /-- If the subring `O` of `R` satisfies `New.IsValuationPair` (any two elements `u`, `v` of `R` are |
| 280 | `O`-multiples of `(1 - ε) u + ε v` for an idempotent `ε` of `O`), then an `n × b` matrix `y` is the |
| 281 | block of the columns `b` of an element of `GL n O` exactly when `y` has entries in `O` and a left |
| 282 | inverse over `O`. -/ |
| 283 | lemma _root_.New.IsValuationPair.exists_firstCols_iff [Finite a] [Finite b] |
| 284 | (hO : IsValuationPair O) : |
| 285 | (∃ k ∈ intGL n O, y = firstCols e k) ↔ IsPrimitiveMatrix O y := by |
| 286 | classical |
| 287 | let := Fintype.ofFinite b |
| 288 | refine ⟨?_, fun hy ↦ ?_⟩ |
| 289 | · rintro ⟨k, hk, rfl⟩ |
| 290 | exact isPrimitiveMatrix_firstCols e hk |
| 291 | -- Hermite form: `y = firstCols e k * D` with `k` integral and `D` square. |
| 292 | obtain ⟨k, hk, D, -, rfl : y = firstCols e k * D, -⟩ := |
| 293 | hO.hermite (Embedding.inl.trans e.toEmbedding) y |
| 294 | -- The square factor `D` is primitive, so it is an element `g` of `GL b O`. |
| 295 | obtain ⟨g, hg, rfl⟩ := isPrimitiveMatrix_iff.1 ((isPrimitiveMatrix_firstCols e hk).mul_iff.1 hy) |
| 296 | -- The factor `g` is absorbed into the basis. |
| 297 | exact (exists_mul_eq_firstCols_iff e (inv_mem hg)).1 ⟨k, hk, by simp [Matrix.mul_assoc]⟩ |
| 298 | |
| 299 | end Blocks |
| 300 | |
| 301 | /-! ### Lifting along a local homomorphism -/ |
| 302 | |
| 303 | section Lift |
| 304 | |
| 305 | variable {R a b n : Type} [CommRing R] [Fintype n] [DecidableEq n] {F : Type} [CommRing F] |
| 306 | {O : Subring F} {l m : Type} [Fintype l] [Fintype m] |
| 307 | |
| 308 | /-- If the lift `liftIntegralFn π f` does not vanish at `S`, then `S` comes from a matrix `M` over |
| 309 | the subring `O`, and `f` does not vanish at the image of `M` under `π`. -/ |
| 310 | lemma exists_map_coe_eq_of_liftIntegralFn_ne_zero {π : O →+* R} {f : Matrix l m R → ℂ} |
| 311 | {S : Matrix l m F} (hS : liftIntegralFn π f S ≠ 0) : |
| 312 | ∃ M : Matrix l m O, M.map (↑) = S ∧ f (M.map π) ≠ 0 := by |
| 313 | have hS_int : ∀ (i : l) (j : m), S i j ∈ O := by_contra fun h_not ↦ hS (dite_eq_right h_not) |
| 314 | exact ⟨of fun i j ↦ ⟨S i j, hS_int i j⟩, rfl, by rwa [← liftIntegralFn_map_subtype π f]⟩ |
| 315 | |
| 316 | /-- Let `π : O → R` be a surjective local homomorphism from a subring `O` of `F`. If the image under |
| 317 | `π` of a matrix `y` over `O` is the block `firstCols e k` of columns of some `k ∈ GL n R`, then `y` |
| 318 | is the block `firstCols e j` of columns of some `j ∈ GL n O`. -/ |
| 319 | lemma exists_map_coe_eq_firstCols {π : O →+* R} [IsLocalHom π] (hπ : Surjective π) |
| 320 | {e : b ⊕ a ≃ n} {y : Matrix n b O} {k : GL n R} (hy_map : y.map π = firstCols e k) : |
| 321 | ∃ j ∈ intGL n O, y.map (↑) = firstCols e j := by |
| 322 | -- Lift the other columns of `k`; the resulting matrix is invertible as `π` is local. |
| 323 | let M : Matrix n n O := of fun i c ↦ (e.symm c).elim (y i) fun _ ↦ surjInv hπ (k i c) |
| 324 | have hM : π.mapMatrix M = k := Matrix.ext fun i c ↦ match h : e.symm c with |
| 325 | | .inl j => by simpa [M, e.symm_apply_eq.mp h] using congr_fun₂ hy_map i j |
| 326 | | .inr _ => by simp [M, h, surjInv_eq hπ] |
| 327 | obtain ⟨j, hj⟩ : IsUnit M := isUnit_of_mapMatrix π (hM ▸ k.isUnit) |
| 328 | exact ⟨GeneralLinearGroup.map O.subtype j, ⟨j, rfl⟩, Matrix.ext fun i c ↦ by simp [hj, M]⟩ |
| 329 | |
| 330 | end Lift |
| 331 | |
| 332 | /-! ### The laws of partners -/ |
| 333 | |
| 334 | namespace AreMatched |
| 335 | |
| 336 | variable {R a b n : Type} [CommRing R] [Fintype a] [Fintype b] [Fintype n] [DecidableEq n] |
| 337 | |
| 338 | omit [Fintype a] [Fintype b] in |
| 339 | /-- Transposing both matrix arguments exchanges the two partners and preserves the |
| 340 | matching character. -/ |
| 341 | lemma transpose {O : Subring R} {e : b ⊕ a ≃ n} {χ : MulChar R ℂ} |
| 342 | {Φ : Matrix a n R → ℂ} {Ψ : Matrix n b R → ℂ} (h : AreMatched O e χ Φ Ψ) : |
| 343 | AreMatched O ((Equiv.sumComm a b).trans e) χ (fun x ↦ Ψ xᵀ) (fun y ↦ Φ yᵀ) := by |
| 344 | refine ⟨fun x hx ↦ ?_, fun y hy ↦ ?_, fun k hk ↦ ?_⟩ |
| 345 | · exact (exists_invLastRows_iff_transpose _).2 (h.supp_right xᵀ hx) |
| 346 | · exact (exists_invLastRows_iff_transpose e).1 (h.supp_left yᵀ hy) |
| 347 | · change Ψ (firstCols e (invTransposeGL k)) = χ k.val.det * Φ (invLastRows e (invTransposeGL k)) |
| 348 | -- Inverse transpose interchanges the blocks and inverts the determinant. |
| 349 | have h_det : k.val.det * (invTransposeGL k).val.det = 1 := by |
| 350 | change k.val.det * k⁻¹.valᵀ.det = 1 |
| 351 | rw [det_transpose, ← det_mul] |
| 352 | simp |
| 353 | rw [h.apply_eq _ ((invTransposeGL_mem_intGL _).2 hk), ← mul_assoc, ← map_mul, h_det, |
| 354 | map_one, one_mul] |
| 355 | |
| 356 | /-- Let `π : O → R` be a surjective local homomorphism from a subring `O` of `F`, and let `χ'` agree |
| 357 | with `χ ∘ π` on the units of `O`. If `Φ`, `Ψ` are partners for `χ` over all of `R` (supported on the |
| 358 | rows `a` of `k⁻¹` and the columns `b` of `k` for `k ∈ GL n R`, with values differing by the |
| 359 | factor `χ (det k)`), then their lifts `New.liftIntegralFn` (read through `π` on matrices over `O`, |
| 360 | zero on other matrices) are partners for `χ'` over `O`. -/ |
| 361 | lemma lift_of_reduction {e : b ⊕ a ≃ n} {χ : MulChar R ℂ} {Φ : Matrix a n R → ℂ} |
| 362 | {Ψ : Matrix n b R → ℂ} {F : Type} [CommRing F] {O : Subring F} (π : O →+* R) |
| 363 | (hπ_local : IsLocalHom π) (hπ : Surjective π) {χ' : MulChar F ℂ} |
| 364 | (hχ : ∀ u : O, IsUnit u → χ' u = χ (π u)) (h : AreMatched ⊤ e χ Φ Ψ) : |
| 365 | AreMatched O e χ' (liftIntegralFn π Φ) (liftIntegralFn π Ψ) := by |
| 366 | refine ⟨fun x hx ↦ ?_, fun y hy ↦ ?_, ?_⟩ |
| 367 | · -- The rows of an inverse are treated as the columns of a matrix, by transposition. |
| 368 | obtain ⟨X, rfl, hΦ⟩ := exists_map_coe_eq_of_liftIntegralFn_ne_zero hx |
| 369 | obtain ⟨k, -, hk⟩ := (exists_invLastRows_iff_transpose e).1 (h.supp_left (X.map π) hΦ) |
| 370 | rw [exists_invLastRows_iff_transpose, ← transpose_map] |
| 371 | exact exists_map_coe_eq_firstCols hπ (by rwa [transpose_map]) |
| 372 | · obtain ⟨Y, rfl, hΨ⟩ := exists_map_coe_eq_of_liftIntegralFn_ne_zero hy |
| 373 | obtain ⟨k, -, hk⟩ := h.supp_right (Y.map π) hΨ |
| 374 | exact exists_map_coe_eq_firstCols hπ hk |
| 375 | · -- For `k ∈ GL n O`, the identity at its image `j` over `F` is the identity of `h` at its |
| 376 | -- image `m` over `R`. |
| 377 | rintro _ ⟨k, rfl⟩ |
| 378 | let j : GL n F := GeneralLinearGroup.map O.subtype k |
| 379 | let m : GL n R := GeneralLinearGroup.map π k |
| 380 | have h_det : χ' j.val.det = χ m.val.det := by |
| 381 | simpa [j, m, RingHom.map_det, ← O.subtype_apply] using hχ k.val.det (isUnits_det_units k) |
| 382 | calc liftIntegralFn π Φ (invLastRows e j) |
| 383 | = Φ (invLastRows e m) := liftIntegralFn_map_subtype π Φ (invLastRows e k) |
| 384 | _ = χ m.val.det * Ψ (firstCols e m) := h.apply_eq m (by simp [mem_intGL]) |
| 385 | _ = χ' j.val.det * liftIntegralFn π Ψ (firstCols e j) := |
| 386 | congrArg₂ (· * ·) h_det.symm (liftIntegralFn_map_subtype π Ψ (firstCols e k)).symm |
| 387 | |
| 388 | variable [DecidableEq a] [DecidableEq b] |
| 389 | |
| 390 | variable {O : Subring R} {e : b ⊕ a ≃ n} {χ : MulChar R ℂ} {Φ : Matrix a n R → ℂ} |
| 391 | {Ψ : Matrix n b R → ℂ} |
| 392 | omit [Fintype b] [DecidableEq b] in |
| 393 | /-- If `Φ`, `Ψ` are partners for `χ` over `O` (supported on the rows `a` of `k⁻¹` and the columns |
| 394 | `b` of `k` for `k ∈ GL n O`, with values differing by the factor `χ (det k)`), then |
| 395 | `χ (det g) * Φ (g * x) = Φ x` for all `g ∈ GL a O` and all `a × n` matrices `x`. -/ |
| 396 | lemma left_mul [Finite b] (h : AreMatched O e χ Φ Ψ) {g : GL a R} {x : Matrix a n R} |
| 397 | (hg : g ∈ intGL a O) : |
| 398 | χ g.val.det * Φ (g.val * x) = Φ x := by |
| 399 | classical |
| 400 | let := Fintype.ofFinite b |
| 401 | by_cases hx : ∃ k ∈ intGL n O, x = invLastRows e k |
| 402 | · -- `g * invLastRows e k = invLastRows e j`, where `j` has the same columns `firstCols` as `k` |
| 403 | -- and `det j * det g = det k` |
| 404 | obtain ⟨k, hk, rfl⟩ := hx |
| 405 | obtain ⟨j, hj, hj_cols, hj_rows, hj_det⟩ := exists_firstCols_eq_mul e k O 1 (one_mem _) g hg hk |
| 406 | simp only [Units.val_one, Matrix.mul_one, det_one, mul_one] at hj_cols hj_det |
| 407 | calc χ g.val.det * Φ (g.val * invLastRows e k) |
| 408 | = χ g.val.det * (χ j.val.det * Ψ (firstCols e j)) := by rw [← hj_rows, h.apply_eq j hj] |
| 409 | _ = χ k.val.det * Ψ (firstCols e k) := by rw [← hj_det, hj_cols, map_mul]; ring |
| 410 | _ = Φ (invLastRows e k) := (h.apply_eq k hk).symm |
| 411 | · -- `g * x` is not of the form `invLastRows e k` either, so both sides vanish |
| 412 | have h_left : Φ (g.val * x) = 0 := by_contra fun h_ne ↦ |
| 413 | hx (exists_eq_invLastRows_of_mul_eq e hg (h.supp_left (g.val * x) h_ne)) |
| 414 | rw [h_left, by_contra fun h_ne ↦ hx (h.supp_left x h_ne), mul_zero] |
| 415 | |
| 416 | omit [Fintype a] [DecidableEq a] in |
| 417 | /-- If `Φ`, `Ψ` are partners for `χ` over `O` (supported on the rows `a` of `k⁻¹` and the columns |
| 418 | `b` of `k` for `k ∈ GL n O`, with values differing by the factor `χ (det k)`), then |
| 419 | `Ψ (y * g) * χ (det g) = Ψ y` for all `g ∈ GL b O` and all `n × b` matrices `y`. -/ |
| 420 | lemma right_mul [Finite a] (h : AreMatched O e χ Φ Ψ) (g : GL b R) (hg : g ∈ intGL b O) |
| 421 | (y : Matrix n b R) : |
| 422 | Ψ (y * g.val) * χ g.val.det = Ψ y := by |
| 423 | simpa [Matrix.transpose_mul, mul_comm] using |
| 424 | h.transpose.left_mul (g := transposeGL g) (x := yᵀ) ((transposeGL_mem_intGL_iff g).2 hg) |
| 425 | |
| 426 | end AreMatched |
| 427 | |
| 428 | end New |
| 429 | |
| 430 | end |