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 TauCeti.LinearAlgebra.Matrix.Range |
| 4 | public import New.Spanning.RemainingTerms.BorderedDeterminant |
| 5 | public import Lib.General.NumberTheory.LatticeCovolumes |
| 6 | import Lib.Adelic.Adeles.StrongApproximation |
| 7 | |
| 8 | /-! |
| 9 | # Orthogonal lifts and the two isotropic lists of a link |
| 10 | |
| 11 | Let `γ` have cell rank `j`, let `Λ` be the lattice of a class, `A` the span of `e₁, …, e_ϱ`, |
| 12 | `I = A ∩ γ A`, and let `z` be the last vector of the frame, of norm `-N`. This file defines |
| 13 | orthogonal lifts of a basis `v` of the link of `γ`. These are vectors orthogonal to `A` and `γ A` |
| 14 | over the columns of `(0 | v)`, whose first columns form a basis of `I`. It proves that such lifts |
| 15 | exist and that they are isometric to `v` for `S.linkMetric` after a correction by their products |
| 16 | with `z` and `γ z`. It then adjoins two vectors `z'`, `z''` of norm `N` and computes the |
| 17 | discriminant of the isotropic lists `(e_a, z + z')` and `(γ e_a, γ z + z'')`, `a < j`. It also |
| 18 | shows that `torsionIndex k` divides the index of the classes of the `e_a` and `k e_a` in the |
| 19 | integral vectors of their span, for finite-adelic `k`. |
| 20 | |
| 21 | Notions from other files: |
| 22 | * `framePair γ` has the columns `e₁, …, e_ϱ, z` and their images under `γ`; |
| 23 | `isotropicFramePair γ` leaves out `z` and `γ z`. |
| 24 | * `linkMatrix γ` sends `t` to the middle coordinates of `t` and `γ⁻¹ t`; `link γ` is its image of |
| 25 | the orthogonal complement of `A + γ A`. |
| 26 | * `HasCellRank j γ` says that `γ` has cell rank `j`: `NormOnePairOccursFrom j γ`, the leading |
| 27 | `j`-minor of the products of the two frames is nonzero, and `S.termDisc γ ≠ 0` exactly when |
| 28 | `j = ϱ + 1`. |
| 29 | * `isotropicRowsIndex j k` is the index, among the products of `Λ ∩ A` with the frame of `k`, of |
| 30 | those from the `e_a`, `a < j`; `torsionIndex k` is the index of the lattice spanned by the |
| 31 | `e_a` and `k e_a` in the integral vectors of their span. |
| 32 | |
| 33 | ## Main definitions and results |
| 34 | |
| 35 | * `New.Filling.IsOrthogonalLift`, `New.Filling.exists_orthogonal_lift`: orthogonal lifts of a basis |
| 36 | of the link, and their existence for `γ` of cell rank `j`. |
| 37 | * `New.Filling.abs_norm_det_gram_eq_abs_norm_subframeMinor_sq`, |
| 38 | `New.Filling.isotropicRowsIndex_mul_dvd_submoduleIndex`: the discriminant of the two lists, and |
| 39 | a divisor of the index attached to the classes of the `e_a` and `k e_a`, `a < j`. |
| 40 | -/ |
| 41 | |
| 42 | @[expose] public section |
| 43 | |
| 44 | namespace New.Filling |
| 45 | |
| 46 | open Matrix Fintype Equiv Fin Algebra Sum Submodule RingHom Pointwise |
| 47 | |
| 48 | variable {E : Type} [Field E] [CMType E] {𝔰 : Shape} {τ : Type} |
| 49 | {S : Filling E 𝔰} {c c' : S.Classes} {j : Fin (𝔰.ϱ + 2)} {γ : S.G E} |
| 50 | |
| 51 | /-! ### A basis of `I` and lifts of a basis of the link -/ |
| 52 | |
| 53 | /-- The indices `b ≥ j` of the basis vectors `e_b` of `A`. -/ |
| 54 | abbrev IndexNotBelow (j : Fin (𝔰.ϱ + 2)) : Type := {a : Fin 𝔰.ϱ // ¬a.val < j} |
| 55 | |
| 56 | /-- The vectors `z` and `k z`, as columns. -/ |
| 57 | abbrev lastPair {R : Type} [CommRing R] [StarRing R] {T : 𝔰.Form R} (k : T.G) : |
| 58 | Matrix 𝔰.BesselIndex (Unit ⊕ Unit) R := |
| 59 | (framePair k).submatrix id (.map (fun _ ↦ 𝔰.top) fun _ ↦ 𝔰.top) |
| 60 | |
| 61 | /-- The matrix whose columns are the basis vectors `e*_b` with `b ≥ j`. -/ |
| 62 | noncomputable def eStarCols (R : Type) [CommRing R] (j : Fin (𝔰.ϱ + 2)) : |
| 63 | Matrix 𝔰.BesselIndex (IndexNotBelow j) R := |
| 64 | (diagonal 1).submatrix id (inr ∘ inr ∘ sumCompl (fun a : Fin 𝔰.ϱ ↦ a.val < j) ∘ inr) |
| 65 | |
| 66 | /-- An orthogonal lift of `v` at cell rank `j`. The columns of `u` are orthogonal to the isotropic |
| 67 | space `A = ⟨e₁, …, e_ϱ⟩` and to `γ A`. The first ones, one for each index `b ≥ j`, are dual to the |
| 68 | vectors `e*_b` and are sent to zero by `linkMatrix γ` (the map to the middle coordinates of `t` and |
| 69 | `γ⁻¹ t`). The others are orthogonal to the `e*_b` and are sent to the columns of `v`. -/ |
| 70 | structure IsOrthogonalLift (j : Fin (𝔰.ϱ + 2)) (γ : S.G E) |
| 71 | (v : Matrix (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex) τ E) |
| 72 | (u : Matrix 𝔰.BesselIndex (IndexNotBelow j ⊕ τ) E) : Prop where |
| 73 | /-- The columns of `u` are orthogonal to `A` and `γ A`. -/ |
| 74 | orthogonal : (isotropicFramePair γ)ᴴ * S.ratGram * u = 0 |
| 75 | /-- The map `linkMatrix γ` kills the first columns of `u` and sends the others to those of `v`. -/ |
| 76 | linkMatrix_mul : linkMatrix γ * u = fromCols 0 v |
| 77 | /-- The first columns of `u` are dual to the `e*_b` with `b ≥ j`, the others are orthogonal to |
| 78 | them. -/ |
| 79 | dual : (eStarCols E j)ᴴ * S.ratGram * u = fromCols 1 0 |
| 80 | |
| 81 | /-- Let `γ` have cell rank `j`. For any `d`, some vector of `A ∩ γ A`, where `A` is the span of the |
| 82 | isotropic `e_a`, has the coordinates `d a` at the indices `a ≥ j`. It is given by its coefficients |
| 83 | `x` in the frame `e₁, …, e_ϱ, z` (the columns of `frameImage 1`, `z` at the index `𝔰.top`), those of |
| 84 | its image under `γ⁻¹` being `y`. -/ |
| 85 | lemma HasCellRank.exists_isotropic_inter_vector (hj : S.HasCellRank j γ) (d : Fin 𝔰.ϱ → E) : |
| 86 | ∃ x y : Fin (𝔰.ϱ + 1) → E, x 𝔰.top = 0 ∧ y 𝔰.top = 0 ∧ |
| 87 | (∀ a : Fin 𝔰.ϱ, j.val ≤ a.val → x a.castSucc = d a) ∧ |
| 88 | γ⁻¹.val.val *ᵥ frameImage 1 *ᵥ x = frameImage 1 *ᵥ y := by |
| 89 | by_cases h_low : j.val ≤ 𝔰.ϱ |
| 90 | · obtain ⟨h_form, -, -⟩ := hj |
| 91 | obtain ⟨y, x, hx, hxy⟩ := exists_frameImage_eq_of_normOnePairOccursFrom h_form.inv (snoc d 0) |
| 92 | have hx_top : x 𝔰.top = 0 := (hx 𝔰.top h_low).trans (snoc_last ..) |
| 93 | have h_last : star (y 𝔰.top) * y 𝔰.top = star (x 𝔰.top) * x 𝔰.top := |
| 94 | star_mul_last_eq_of_frameImage_eq hxy |
| 95 | have hy_top : y 𝔰.top = 0 := by simpa [hx_top] using h_last |
| 96 | have h_frame : γ⁻¹.val.val *ᵥ frameImage 1 *ᵥ x = frameImage 1 *ᵥ y := |
| 97 | (frameImage_mulVec _ x).symm.trans hxy.symm |
| 98 | refine ⟨x, y, hx_top, hy_top, fun a ha ↦ ?_, h_frame⟩ |
| 99 | simpa using hx a.castSucc ha |
| 100 | · exact ⟨0, 0, rfl, rfl, fun a ha ↦ by omega, by simp⟩ |
| 101 | |
| 102 | /-- For filling data `S` of shape `𝔰` over a CM field `E`, let `γ` have cell rank `j`, let `A` be |
| 103 | the span of the isotropic basis vectors `e₁, …, e_ϱ`, let `w` lie in `link γ`, and let |
| 104 | `target : IndexNotBelow j → E`. Then there is a vector `u : 𝔰.BesselIndex → E` that is orthogonal |
| 105 | to `A` and `γ A` for `S.ratGram`, maps to `w` under `linkMatrix γ`, and has pairings |
| 106 | `(eStarCols E j)ᴴ * S.ratGram *ᵥ u = target` with the dual basis vectors `e*_a` for `a ≥ j`. -/ |
| 107 | private lemma HasCellRank.exists_orthogonal_lift_vec (hj : S.HasCellRank j γ) |
| 108 | {w : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} (hw : w ∈ link γ) |
| 109 | (target : IndexNotBelow j → E) : |
| 110 | ∃ u : 𝔰.BesselIndex → E, |
| 111 | ((isotropicFramePair γ)ᴴ * S.ratGram) *ᵥ u = 0 ∧ |
| 112 | linkMatrix γ *ᵥ u = w ∧ |
| 113 | ((eStarCols E j)ᴴ * S.ratGram) *ᵥ u = target := by |
| 114 | -- A vector `t` meets the first two conditions, as `w` lies in the link. |
| 115 | obtain ⟨t, ht, ht_link⟩ : ∃ t : 𝔰.BesselIndex → E, |
| 116 | t ∈ ((isotropicFramePair γ)ᴴ * S.ratGram).mulVecLin.ker ∧ linkMatrix γ *ᵥ t = w := |
| 117 | mem_map.1 hw |
| 118 | obtain ⟨ht_eStar, ht_inv_eStar⟩ := orthogonal_isotropicFramePair_iff.1 ht |
| 119 | let d : Fin 𝔰.ϱ → E := fun a ↦ if ha : ¬a.val < j then target ⟨a, ha⟩ else 0 |
| 120 | -- A vector of `A ∩ γ A` corrects the coordinates at the indices `≥ j`. |
| 121 | obtain ⟨x, y, hx_top, hy_top, hx, hframe⟩ : ∃ x y : Fin (𝔰.ϱ + 1) → E, |
| 122 | x 𝔰.top = 0 ∧ y 𝔰.top = 0 ∧ |
| 123 | (∀ a : Fin 𝔰.ϱ, j.val ≤ a.val → x a.castSucc = d a - t (inl a)) ∧ |
| 124 | γ⁻¹.val.val *ᵥ frameImage 1 *ᵥ x = frameImage 1 *ᵥ y := |
| 125 | hj.exists_isotropic_inter_vector (d - t ∘ inl) |
| 126 | refine ⟨t + frameImage 1 *ᵥ x, ?_, ?_, ?_⟩ |
| 127 | · refine LinearMap.mem_ker.1 (orthogonal_isotropicFramePair_iff.2 ?_) |
| 128 | rw [mulVec_add, hframe] |
| 129 | simpa [frameImage_one_mulVec, ht_eStar] using ht_inv_eStar |
| 130 | · have h_link_zero : linkMatrix γ *ᵥ (frameImage 1 *ᵥ x) = 0 := by |
| 131 | rw [linkMatrix, fromRows_mulVec] |
| 132 | ext (i | i) |
| 133 | · change ((1 : S.G E).val.val *ᵥ frameImage 1 *ᵥ x) (inr (inl i)) = 0 |
| 134 | rcases i with i | i <;> simp [frameImage_one_mulVec, hx_top] |
| 135 | · change (γ⁻¹.val.val *ᵥ frameImage 1 *ᵥ x) (inr (inl i)) = 0 |
| 136 | rw [hframe] |
| 137 | rcases i with i | i <;> simp [frameImage_one_mulVec, hy_top] |
| 138 | rw [mulVec_add, h_link_zero, ht_link, add_zero] |
| 139 | · ext a |
| 140 | -- The product with `e*_a` reads off the coordinate at `e_a`, where `x` is `d - t`. |
| 141 | simpa [d, not_lt.1 a.property, eStarCols, frameImage_one_mulVec, init, mulVec, dotProduct, |
| 142 | Matrix.mul_apply, Matrix.one_apply, eq_sub_iff_add_eq'] using hx a.val (not_lt.1 a.property) |
| 143 | |
| 144 | /-- Let `A` be the span of the isotropic basis vectors `e₁, …, e_ϱ`, and let `e*_b` be the isotropic |
| 145 | basis vector dual to `e_b`. If `γ` has cell rank `j` and the columns of `v` span its link, then `v` |
| 146 | has an orthogonal lift `u`: its columns are orthogonal to `A` and `γ A`, their images in the link |
| 147 | are the columns of `(0 | v)`, and their products with the `e*_b`, `b ≥ j`, form the matrix |
| 148 | `(1 | 0)`. -/ |
| 149 | lemma exists_orthogonal_lift [Fintype τ] [DecidableEq τ] (hj : S.HasCellRank j γ) |
| 150 | {v : Matrix (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex) τ E} (hL : colSpan v = link γ) : |
| 151 | ∃ u : Matrix 𝔰.BesselIndex (IndexNotBelow j ⊕ τ) E, IsOrthogonalLift j γ v u := by |
| 152 | let m : Matrix 𝔰.BesselIndex (Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ) E := isotropicFramePair γ |
| 153 | let s : Matrix 𝔰.BesselIndex (IndexNotBelow j) E := eStarCols E j |
| 154 | -- The three conditions form one linear system, solved column by column. |
| 155 | have hcol (b : IndexNotBelow j ⊕ τ) : |
| 156 | ((fromRows 0 (fromCols 0 v)).fromRows (fromCols (diagonal 1) 0)).col b ∈ |
| 157 | colSpan (((mᴴ * S.ratGram).fromRows (linkMatrix γ)).fromRows (sᴴ * S.ratGram)) := by |
| 158 | have hv_col : (fromCols 0 v).col b ∈ colSpan v := by |
| 159 | rcases b with b | b |
| 160 | · exact zero_mem (colSpan v) |
| 161 | · exact ⟨Pi.single b 1, v.mulVec_single_one b⟩ |
| 162 | obtain ⟨u, h_orth, h_link, h_dual⟩ : ∃ u : 𝔰.BesselIndex → E, |
| 163 | (mᴴ * S.ratGram) *ᵥ u = 0 ∧ |
| 164 | linkMatrix γ *ᵥ u = (fromCols 0 v).col b ∧ |
| 165 | (sᴴ * S.ratGram) *ᵥ u = (fromCols (diagonal 1) 0).col b := |
| 166 | hj.exists_orthogonal_lift_vec (hL.le hv_col) ((fromCols (diagonal 1) 0).col b) |
| 167 | use u |
| 168 | rw [mulVecLin_apply, fromRows_mulVec, fromRows_mulVec, h_orth, h_link, h_dual] |
| 169 | ext ((a | a) | a) <;> rfl |
| 170 | obtain ⟨u, hu⟩ : ∃ u : Matrix 𝔰.BesselIndex (IndexNotBelow j ⊕ τ) E, |
| 171 | ((mᴴ * S.ratGram).fromRows (linkMatrix γ)).fromRows (sᴴ * S.ratGram) * u = |
| 172 | (fromRows 0 (fromCols 0 v)).fromRows (fromCols (diagonal 1) 0) := |
| 173 | exists_mul_eq_of_range_le hcol |
| 174 | obtain ⟨⟨h_orth, h_link⟩, h_dual⟩ : |
| 175 | (mᴴ * S.ratGram * u = 0 ∧ linkMatrix γ * u = fromCols 0 v) ∧ |
| 176 | sᴴ * S.ratGram * u = fromCols (diagonal 1) 0 := by |
| 177 | simpa only [fromRows_mul, fromRows_ext_iff] using hu |
| 178 | exact ⟨u, h_orth, h_link, h_dual⟩ |
| 179 | |
| 180 | section OrthogonalLift |
| 181 | |
| 182 | variable {τ : Type} {v : Matrix (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex) τ E} |
| 183 | {u : Matrix 𝔰.BesselIndex (IndexNotBelow j ⊕ τ) E} |
| 184 | |
| 185 | /-- Let `u` be an orthogonal lift. In its row of the isotropic basis vector `e_i`, `i ≥ j`, it has |
| 186 | the identity in its first block of columns and zero in the second. -/ |
| 187 | lemma IsOrthogonalLift.apply_inl (hu : IsOrthogonalLift j γ v u) (i : IndexNotBelow j) |
| 188 | (a : IndexNotBelow j) : u (inl i.val) (inl a) = if i = a then 1 else 0 := by |
| 189 | simpa [eStarCols, Matrix.mul_apply, Matrix.one_apply] using congrFun₂ hu.dual i (inl a) |
| 190 | |
| 191 | /-- If `u` is an orthogonal lift (`IsOrthogonalLift j γ v u`), its first columns `u.toCols₁` are |
| 192 | orthogonal, for the form `S.ratGram`, to the columns of `isotropicFramePair γ`, which span `A` and |
| 193 | `γ A`. -/ |
| 194 | lemma IsOrthogonalLift.orthogonal_toCols₁ (hu : IsOrthogonalLift j γ v u) : |
| 195 | (isotropicFramePair γ)ᴴ * S.ratGram * u.toCols₁ = 0 := |
| 196 | congrArg toCols₁ hu.orthogonal |
| 197 | |
| 198 | /-- The map `linkMatrix γ` kills the first columns of an orthogonal lift. -/ |
| 199 | lemma IsOrthogonalLift.linkMatrix_mul_toCols₁ (hu : IsOrthogonalLift j γ v u) : |
| 200 | linkMatrix γ * u.toCols₁ = 0 := |
| 201 | congrArg toCols₁ hu.linkMatrix_mul |
| 202 | |
| 203 | /-- The first columns of an orthogonal lift lie in `A`. -/ |
| 204 | lemma IsOrthogonalLift.toCols₁_eq_fromRows (hu : IsOrthogonalLift j γ v u) : |
| 205 | u.toCols₁ = fromRows u.toCols₁.toRows₁ 0 := by |
| 206 | ext (a | a | a) y |
| 207 | · rfl |
| 208 | · simpa [linkMatrix, Matrix.mul_apply, Matrix.one_apply] using |
| 209 | congrFun₂ hu.linkMatrix_mul_toCols₁ (inl a) y |
| 210 | · simpa [Matrix.mul_apply, Matrix.one_apply, splitGram, apply_ite star] using |
| 211 | congrFun₂ hu.orthogonal_toCols₁ (inl a) y |
| 212 | |
| 213 | /-- The first columns of an orthogonal lift are orthogonal to the frame `γ e_a`, `γ z`. This is |
| 214 | stated for their coordinates in `A` and the products of the `e_a` with that frame. -/ |
| 215 | lemma IsOrthogonalLift.conjTranspose_isotropicRows_mul_eq_zero (hu : IsOrthogonalLift j γ v u) : |
| 216 | (isotropicRows (S.frameProducts γ))ᴴ * u.toCols₁.toRows₁ = 0 := by |
| 217 | have h_last : zRowBlockDiagonal (S.ratMiddle E) * linkMatrix γ * u.toCols₁ = 0 := by |
| 218 | rw [Matrix.mul_assoc, hu.linkMatrix_mul_toCols₁, Matrix.mul_zero] |
| 219 | have h_middle : u.toCols₁.toRows₂.toRows₁ = 0 := |
| 220 | congrArg (fun M ↦ M.toRows₂.toRows₁) hu.toCols₁_eq_fromRows |
| 221 | rw [← neg_eq_zero, ← Matrix.mul_neg, |
| 222 | isotropicRows_conjTranspose_mul_eq hu.orthogonal_toCols₁ h_last, h_middle, Matrix.mul_zero] |
| 223 | |
| 224 | /-- The first columns of an orthogonal lift are orthogonal to both frames `e_a`, `z` and `γ e_a`, |
| 225 | `γ z`. -/ |
| 226 | lemma IsOrthogonalLift.toCols₁_mul_framePair (hu : IsOrthogonalLift j γ v u) : |
| 227 | u.toCols₁ᴴ * S.ratGram * framePair γ = 0 := by |
| 228 | have h_image : u.toCols₁.toRows₁ᴴ * isotropicRows (S.frameProducts γ) = 0 := by |
| 229 | simpa using congrArg conjTranspose hu.conjTranspose_isotropicRows_mul_eq_zero |
| 230 | rw [hu.toCols₁_eq_fromRows] |
| 231 | ext a (b | b) |
| 232 | · cases b using lastCases <;> simp [Matrix.mul_apply, Matrix.one_apply, splitGram] |
| 233 | · simpa [Matrix.mul_apply, Matrix.one_apply, frameGram, splitGram] using |
| 234 | congrFun₂ h_image a b |
| 235 | |
| 236 | /-- The first columns of an orthogonal lift are orthogonal to all its columns. -/ |
| 237 | lemma IsOrthogonalLift.toCols₁_mul_self (hu : IsOrthogonalLift j γ v u) : |
| 238 | u.toCols₁ᴴ * S.ratGram * u = 0 := by |
| 239 | simpa [hu.linkMatrix_mul_toCols₁] using |
| 240 | (gram_linkMatrix_mul hu.orthogonal_toCols₁ hu.orthogonal 1 0).symm |
| 241 | |
| 242 | /-- The isometry: the Gram matrix of the lifts of `v`, corrected by `N⁻¹` times their products with |
| 243 | `z` and `γ z`, is the Gram matrix of `v` for the positive form `S.linkMetric` on pairs of middle |
| 244 | coordinates. -/ |
| 245 | lemma IsOrthogonalLift.gram_add_border (hu : IsOrthogonalLift j γ v u) : |
| 246 | u.toCols₂ᴴ * S.ratGram * u.toCols₂ + (S.N⁻¹ : E) • |
| 247 | (((lastPair γ)ᴴ * S.ratGram * u.toCols₂)ᴴ * ((lastPair γ)ᴴ * S.ratGram * u.toCols₂)) = |
| 248 | vᴴ * S.linkMetric * v := by |
| 249 | -- On vectors orthogonal to `A` and `γ A` the form factors through `linkMatrix γ`. |
| 250 | have h_orth : (isotropicFramePair γ)ᴴ * S.ratGram * u.toCols₂ = 0 := |
| 251 | congrArg toCols₂ hu.orthogonal |
| 252 | have h_link : linkMatrix γ * u.toCols₂ = v := congrArg toCols₂ hu.linkMatrix_mul |
| 253 | have h_half : vᴴ * fromBlocks ((2⁻¹ : E) • S.ratMiddle E) 0 0 ((2⁻¹ : E) • S.ratMiddle E) * v = |
| 254 | u.toCols₂ᴴ * S.ratGram * u.toCols₂ := by |
| 255 | simpa [h_link, sub_neg_eq_add, ← add_smul, show (2⁻¹ + 2⁻¹ : E) = 1 by norm_num] using |
| 256 | gram_linkMatrix_mul h_orth h_orth 2⁻¹ (-2⁻¹) |
| 257 | have h_last : |
| 258 | (lastPair γ)ᴴ * S.ratGram * u.toCols₂ = zRowBlockDiagonal (S.ratMiddle E) * v := by |
| 259 | rw [framePair_last_eq_zRowBlockDiagonal_mul, Matrix.mul_assoc, h_link] |
| 260 | rw [← h_half, h_last, linkMetric] |
| 261 | simp [fromBlocks_smul, Matrix.mul_assoc, Matrix.mul_add, Matrix.add_mul] |
| 262 | |
| 263 | end OrthogonalLift |
| 264 | |
| 265 | /-! ### The two lists and their index -/ |
| 266 | |
| 267 | /-- The vectors `e_a` and `k e_a` with `a < j`, as columns. -/ |
| 268 | abbrev listPair {R : Type} [CommRing R] [StarRing R] {T : 𝔰.Form R} (j : Fin (𝔰.ϱ + 2)) (k : T.G) : |
| 269 | Matrix 𝔰.BesselIndex (IndexBelow j ⊕ IndexBelow j) R := |
| 270 | (isotropicFramePair k).submatrix id (.map Subtype.val Subtype.val) |
| 271 | |
| 272 | /-- Take the Gram matrix of the vectors `e_a`, `γ e_a` (`a < j`), `z`, `γ z`, and add `N` to the |
| 273 | diagonal entries of `z` and `γ z`. The norm to `ℚ` of its determinant has the absolute value |
| 274 | `(Nm δ_*)²`, where `δ_* = S.subframeMinor j γ` is the determinant of the products of the subframe |
| 275 | `(e_a, z)`, `a < j`, with its image under `γ`. -/ |
| 276 | lemma abs_norm_det_gram_eq_abs_norm_subframeMinor_sq : |
| 277 | |(norm ℚ ((fromCols (listPair j γ) (lastPair γ))ᴴ * S.ratGram * |
| 278 | fromCols (listPair j γ) (lastPair γ) + fromBlocks 0 0 0 ((S.N : E) • 1)).det : ℝ)| = |
| 279 | |(norm ℚ (S.subframeMinor j γ) : ℝ)| ^ 2 := by |
| 280 | set G : Matrix ((IndexBelow j ⊕ IndexBelow j) ⊕ Unit ⊕ Unit) |
| 281 | ((IndexBelow j ⊕ IndexBelow j) ⊕ Unit ⊕ Unit) E := |
| 282 | (fromCols (listPair j γ) (lastPair γ))ᴴ * S.ratGram * |
| 283 | fromCols (listPair j γ) (lastPair γ) + fromBlocks 0 0 0 ((S.N : E) • 1) |
| 284 | let index : IndexBelow j ⊕ Unit → Fin (𝔰.ϱ + 1) := Sum.elim (·.val.castSucc) fun _ ↦ 𝔰.top |
| 285 | let position : (IndexBelow j ⊕ IndexBelow j) ⊕ Unit ⊕ Unit → Fin (𝔰.ϱ + 1) ⊕ Fin (𝔰.ϱ + 1) := |
| 286 | Sum.elim (.map (·.val.castSucc) (·.val.castSucc)) (.map (fun _ ↦ 𝔰.top) fun _ ↦ 𝔰.top) |
| 287 | let C : Matrix (IndexBelow j ⊕ Unit) (IndexBelow j ⊕ Unit) E := |
| 288 | (S.frameProducts γ).submatrix index index |
| 289 | have h_mem (x : IndexBelow j ⊕ Unit) : index x ∈ subframeIndices j := by |
| 290 | rcases x with x | x |
| 291 | · simp [index, x.property] |
| 292 | · simp [index] |
| 293 | have h_bijective : Function.Bijective fun x ↦ (⟨index x, h_mem x⟩ : subframeIndices j) := by |
| 294 | refine ⟨?_, fun ⟨a, ha⟩ ↦ ?_⟩ |
| 295 | · -- The index of `e_a` is never the last one, that of `z`. |
| 296 | rintro (x | x) (x' | x') h <;> |
| 297 | simp_all [index, Subtype.ext_iff, (castSucc_lt_last _).ne, (castSucc_lt_last _).ne'] |
| 298 | · cases a using lastCases with |
| 299 | | last => exact ⟨inr (), rfl⟩ |
| 300 | | cast a => exact ⟨inl ⟨a, by simpa using ha⟩, rfl⟩ |
| 301 | have hC : C.det = S.subframeMinor j γ := |
| 302 | det_submatrix_equiv_self (.ofBijective _ h_bijective) |
| 303 | ((S.frameProducts γ).submatrix Subtype.val Subtype.val) |
| 304 | -- Order the vectors list by list, and exchange the two halves of the rows. |
| 305 | let e : (IndexBelow j ⊕ Unit) ⊕ (IndexBelow j ⊕ Unit) ≃ |
| 306 | (IndexBelow j ⊕ IndexBelow j) ⊕ Unit ⊕ Unit := |
| 307 | sumSumSumComm (IndexBelow j) Unit (IndexBelow j) Unit |
| 308 | let swap : Perm ((IndexBelow j ⊕ Unit) ⊕ (IndexBelow j ⊕ Unit)) := |
| 309 | sumComm (IndexBelow j ⊕ Unit) (IndexBelow j ⊕ Unit) |
| 310 | have h_blocks : (G.submatrix e e).submatrix swap id = fromBlocks Cᴴ 0 0 C := by |
| 311 | have h_gram : (framePair γ)ᴴ * S.ratGram * framePair γ = |
| 312 | fromBlocks (single 𝔰.top 𝔰.top (-S.N : E)) (S.frameProducts γ) (S.frameProducts γ)ᴴ |
| 313 | (single 𝔰.top 𝔰.top (-S.N : E)) := gram_framePair _ (by simp) γ |
| 314 | have h_entry (x y : (IndexBelow j ⊕ IndexBelow j) ⊕ Unit ⊕ Unit) : G x y = |
| 315 | ((framePair γ)ᴴ * S.ratGram * framePair γ) (position x) (position y) + |
| 316 | fromBlocks 0 0 0 ((S.N : E) • 1) x y := by |
| 317 | rcases x with (x | x) | (x | x) <;> rcases y with (y | y) | (y | y) <;> rfl |
| 318 | ext ((a | a) | (a | a)) ((b | b) | (b | b)) <;> |
| 319 | simp [h_entry, h_gram, C, e, swap, index, position, (castSucc_lt_last _).ne'] |
| 320 | have h_det : Perm.sign swap * G.det = star C.det * C.det := by |
| 321 | rw [← det_submatrix_equiv_self e G, ← det_permute, h_blocks, det_fromBlocks_zero₂₁, |
| 322 | det_conjTranspose] |
| 323 | rw [← hC] |
| 324 | simpa [sq, abs_norm_eq_prod_norm_sq, abs_unit_intCast] using |
| 325 | congrArg (fun x : E ↦ |(norm ℚ x : ℝ)|) h_det |
| 326 | |
| 327 | section Index |
| 328 | |
| 329 | variable {k : S.GFin} {σ μ : Type} [Fintype σ] [Fintype μ] [DecidableEq μ] |
| 330 | {ι : Matrix 𝔰.BesselIndex σ (𝔸f E)} {B : Matrix 𝔰.BesselIndex μ (𝔸f E)} |
| 331 | {q : Matrix μ 𝔰.BesselIndex (𝔸f E)} |
| 332 | |
| 333 | /-- Let `M` and `P` be matrices over the finite adeles `𝔸f E`, and call a vector integral if its |
| 334 | entries lie in the ring `Ô E` of integral finite adeles. Suppose that the columns of `P` lie in the |
| 335 | `𝔸f E`-span of those of `M`. Then the index of the `Ô E`-span `colLattice M` of the columns of `M` |
| 336 | in the integral vectors of the span of `P` divides the index of the integral vectors in the module |
| 337 | `preimageLattice M` of the `y` with `M y` integral. -/ |
| 338 | lemma submoduleIndex_colLattice_dvd_preimageLattice {μ : Type} |
| 339 | {α β : Type} [Fintype α] [Fintype β] |
| 340 | {M : Matrix μ α (𝔸f E)} {P : Matrix μ β (𝔸f E)} |
| 341 | (h_span : ∀ x : β, P.col x ∈ colSpan M) : |
| 342 | submoduleIndex (colLattice (Ô E) M) |
| 343 | (intVectors (Ô E) μ ⊓ (colSpan P).restrictScalars (Ô E)) ∣ |
| 344 | submoduleIndex (intVectors (Ô E) α) (preimageLattice (Ô E) M) := by |
| 345 | refine submoduleIndex_dvd_of_le (M.mulVecLin.restrictScalars (Ô E)) |
| 346 | (fun x hx ↦ ⟨x, hx, rfl⟩) fun x ⟨hx_int, hx_span⟩ ↦ mem_sup_left ?_ |
| 347 | obtain ⟨y, rfl⟩ : x ∈ colSpan M := by |
| 348 | choose w hw using h_span |
| 349 | have h_eq : M * (of w)ᵀ = P := ext_col hw |
| 350 | obtain ⟨y, rfl⟩ := hx_span |
| 351 | exact ⟨(of w)ᵀ *ᵥ y, by rw [mulVecLin_apply, mulVec_mulVec, h_eq, mulVecLin_apply]⟩ |
| 352 | exact ⟨y, hx_int, rfl⟩ |
| 353 | |
| 354 | /-- Let `k` be finite-adelic, acting on the standard lattice with Gram matrix |
| 355 | `latticeMiddle.splitGram`. The products of the vectors `k e₁, …, k e_ϱ, k z` with the `e_a` form the |
| 356 | conjugate transpose of the rows `isotropicRows` of the `e_a` in the matrix `frameGram k` of frame |
| 357 | products, and those with the `k e_a` vanish. -/ |
| 358 | lemma toRows₂_gram_framePair_isotropicFramePair (k : S.GFin) : |
| 359 | ((framePair k)ᴴ * (S.latticeMiddle (𝔸f E)).splitGram * isotropicFramePair k).toRows₂ = |
| 360 | fromCols (isotropicRows ((S.latticeMiddle (𝔸f E)).frameGram k))ᴴ 0 := by |
| 361 | refine Matrix.ext fun a b ↦ ?_ |
| 362 | rcases b with b | b |
| 363 | · simp [frameGram, splitGram, Matrix.mul_apply, Matrix.one_apply, apply_ite star] |
| 364 | · have h_form : k.val.valᴴ * (S.latticeMiddle (𝔸f E)).splitGram * k.val.val = |
| 365 | (S.latticeMiddle (𝔸f E)).splitGram := mem_unitaryGroupOf_iff.1 k.property |
| 366 | refine (congrFun₂ h_form _ _).trans ?_ |
| 367 | cases a using lastCases <;> simp |
| 368 | |
| 369 | /-- Let `k` be finite-adelic. The products of the vectors `e₁, …, e_ϱ, z` with the `e_a` vanish, |
| 370 | and those with the `k e_a` form the conjugate transpose of the rows `isotropicRows` of the `e_a` in |
| 371 | the matrix of frame products of `k⁻¹`. -/ |
| 372 | lemma toRows₁_gram_framePair_isotropicFramePair (k : S.GFin) : |
| 373 | ((framePair k)ᴴ * (S.latticeMiddle (𝔸f E)).splitGram * isotropicFramePair k).toRows₁ = |
| 374 | fromCols 0 (isotropicRows ((S.latticeMiddle (𝔸f E)).frameGram k⁻¹.val.val))ᴴ := by |
| 375 | refine Matrix.ext fun a b ↦ ?_ |
| 376 | rcases b with b | b |
| 377 | · cases a using lastCases <;> |
| 378 | simp [splitGram, Matrix.mul_apply, Matrix.one_apply, apply_ite star] |
| 379 | · rw [frameGram_inv] |
| 380 | simp [frameGram, Matrix.mul_apply, Matrix.one_apply, apply_ite star] |
| 381 | |
| 382 | /-- Let `(ι, B, q)` be a basis of `(Λ ∩ I^⊥)/(Λ ∩ I)`, with `B` indexed by `μ`. Suppose `Λ ∩ I` lies |
| 383 | in the lattice of the columns `e_a`, `k e_a` of `isotropicFramePair k` and is orthogonal to them. |
| 384 | Then the torsion index `S.torsionIndex k` divides the index of the classes `q e_a`, `q k e_a` in |
| 385 | the integral vectors of their span. Here `Λ` is the standard lattice of integral vectors, `I` is the |
| 386 | span of the columns of `ι`, and the vectors `k e_a` are assumed integral. -/ |
| 387 | lemma torsionIndex_dvd_submoduleIndex |
| 388 | (hq : IsQuotientBasis (Ô E) (S.latticeMiddle (𝔸f E)).splitGram ι B q) |
| 389 | (hk : IsIntMatrix (Ô E) (isotropicFramePair k)) |
| 390 | (h_orth : ιᴴ * (S.latticeMiddle (𝔸f E)).splitGram * isotropicFramePair k = 0) |
| 391 | (hι : ∀ x : σ, ι.col x ∈ colLattice (Ô E) (isotropicFramePair k)) : |
| 392 | S.torsionIndex k ∣ submoduleIndex (colLattice (Ô E) (q * isotropicFramePair k)) |
| 393 | (intVectors (Ô E) μ ⊓ (colSpan (q * isotropicFramePair k)).restrictScalars (Ô E)) := by |
| 394 | obtain ⟨l, hl_int, hl⟩ := hq.exists_eq_add |
| 395 | let P : Matrix μ (Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ) (𝔸f E) := q * isotropicFramePair k |
| 396 | -- A vector in the span of the `e_a` and `k e_a` differs from the representative of its class by |
| 397 | -- a vector of `I`. |
| 398 | have h_class (y : Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ → 𝔸f E) : isotropicFramePair k *ᵥ y = |
| 399 | ι *ᵥ l *ᵥ isotropicFramePair k *ᵥ y + B *ᵥ P *ᵥ y := by |
| 400 | simp only [mulVec_mulVec, ← add_mulVec] |
| 401 | rw [← hl h_orth] |
| 402 | -- For `y` with `isotropicFramePair k *ᵥ y` integral, the correction in `I` is in the lattice of |
| 403 | -- the `e_a` and `k e_a`. |
| 404 | have h_correction {y : Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ → 𝔸f E} |
| 405 | (hy : isotropicFramePair k *ᵥ y ∈ intVectors (Ô E) 𝔰.BesselIndex) : |
| 406 | ι *ᵥ l *ᵥ isotropicFramePair k *ᵥ y ∈ colLattice (Ô E) (isotropicFramePair k) := |
| 407 | colLattice_le hι ⟨_, hl_int.mulVec hy, rfl⟩ |
| 408 | -- `B` maps the classes to representatives, which are congruent to the vectors modulo `ι`. |
| 409 | refine submoduleIndex_dvd_of_le (B.mulVecLin.restrictScalars (Ô E)) ?_ ?_ |
| 410 | · rintro _ ⟨y, hy, rfl⟩ |
| 411 | change B *ᵥ P *ᵥ y ∈ colLattice (Ô E) (isotropicFramePair k) |
| 412 | rw [eq_sub_of_add_eq' (h_class y).symm] |
| 413 | exact sub_mem ⟨y, hy, rfl⟩ (h_correction (hk.mulVec hy)) |
| 414 | · rintro _ ⟨hx, y, rfl⟩ |
| 415 | rw [mulVecLin_apply, h_class y] |
| 416 | refine add_mem (mem_sup_right (h_correction hx)) |
| 417 | (mem_sup_left ⟨P *ᵥ y, ⟨?_, y, rfl⟩, rfl⟩) |
| 418 | rw [← mulVec_mulVec] |
| 419 | exact hq.isIntMatrix_coord.mulVec hx |
| 420 | |
| 421 | /-- Let `k` be a finite-adelic element such that the frame `e₁, …, e_ϱ, z` and its image under `k` |
| 422 | (`framePair k`) are integral. Let `Λ` be the standard lattice of integral vectors and `I` the span |
| 423 | of the columns of `ι`. Let these columns be a basis of `Λ ∩ I`, orthogonal to the frame and its |
| 424 | image under `k` and in the lattice of the `e_a` and `k e_a`, and let `q` give the classes in |
| 425 | `(Λ ∩ I^⊥)/(Λ ∩ I)`. Suppose that the classes of the `e_a` and `k e_a` with `a < j` span those of |
| 426 | all `e_a` and `k e_a`. Consider the module `preimageLattice` of the coefficient vectors `y` for |
| 427 | which the combination `(q * listPair j k) y` of the classes with `a < j` is integral. Then the index |
| 428 | of the integral coefficient vectors in it (`0` if infinite) is a multiple of the product of |
| 429 | `S.isotropicRowsIndex j k`, `S.isotropicRowsIndex j k⁻¹` and the torsion index |
| 430 | `S.torsionIndex k`. -/ |
| 431 | lemma isotropicRowsIndex_mul_dvd_submoduleIndex |
| 432 | (hq : IsQuotientBasis (Ô E) (S.latticeMiddle (𝔸f E)).splitGram ι B q) |
| 433 | (hk : IsIntMatrix (Ô E) (framePair k)) |
| 434 | (h_orth : ιᴴ * (S.latticeMiddle (𝔸f E)).splitGram * framePair k = 0) |
| 435 | (hι : ∀ x : σ, ι.col x ∈ colLattice (Ô E) (isotropicFramePair k)) |
| 436 | (h_span : ∀ x : Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ, |
| 437 | (q * isotropicFramePair k).col x ∈ colSpan (q * listPair j k)) : |
| 438 | S.isotropicRowsIndex j k * S.isotropicRowsIndex j k⁻¹ * S.torsionIndex k ∣ |
| 439 | submoduleIndex (intVectors (Ô E) (IndexBelow j ⊕ IndexBelow j)) |
| 440 | (preimageLattice (Ô E) (q * listPair j k)) := by |
| 441 | -- The chain `L₁ ⊆ L₂ ⊆ L₃ ⊆ L₄` adds in turn the classes of the `e_a`, those of the `k e_a`, and |
| 442 | -- the integral vectors of their span. Each step has an index divisible by one of the factors. |
| 443 | set J : Matrix 𝔰.BesselIndex 𝔰.BesselIndex (𝔸f E) := (S.latticeMiddle (𝔸f E)).splitGram |
| 444 | let P : Matrix μ (Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ) (𝔸f E) := q * isotropicFramePair k |
| 445 | let L₁ : Submodule (Ô E) (μ → 𝔸f E) := colLattice (Ô E) (q * listPair j k) |
| 446 | let L₂ : Submodule (Ô E) (μ → 𝔸f E) := |
| 447 | colLattice (Ô E) (P.submatrix id (.map id (Subtype.val : IndexBelow j → Fin 𝔰.ϱ))) |
| 448 | let L₃ : Submodule (Ô E) (μ → 𝔸f E) := colLattice (Ô E) P |
| 449 | let L₄ : Submodule (Ô E) (μ → 𝔸f E) := |
| 450 | intVectors (Ô E) μ ⊓ (colSpan P).restrictScalars (Ô E) |
| 451 | have h_herm : Jᴴ = J := (S.isUnimodular_latticeMiddle.splitGram (R := Ô E)).1 |
| 452 | have h_pair : ιᴴ * J * isotropicFramePair k = 0 := |
| 453 | congrArg (fun M ↦ M.submatrix id (Sum.map castSucc castSucc)) h_orth |
| 454 | -- The products with the two frames are defined on classes. |
| 455 | have h_products : (framePair k)ᴴ * J * B * P = (framePair k)ᴴ * J * isotropicFramePair k := |
| 456 | hq.mul_basis_mul_coord (orthogonal_symm h_herm h_orth) h_pair |
| 457 | have h_first : S.isotropicRowsIndex j k ∣ submoduleIndex L₁ L₂ := by |
| 458 | let φ : Matrix (Fin (𝔰.ϱ + 1)) μ (𝔸f E) := ((framePair k)ᴴ * J * B).toRows₂ |
| 459 | have h_image : φ * P = fromCols (isotropicRows ((S.latticeMiddle (𝔸f E)).frameGram k))ᴴ 0 := |
| 460 | (congrArg toRows₂ h_products).trans (toRows₂_gram_framePair_isotropicFramePair k) |
| 461 | have h_col (x : Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ) : φ *ᵥ P.col x = |
| 462 | (fromCols (isotropicRows ((S.latticeMiddle (𝔸f E)).frameGram k))ᴴ 0).col x := |
| 463 | congrArg (Matrix.col · x) h_image |
| 464 | refine submoduleIndex_dvd_of_le (mulVecBilin ℕ _ φ) (colLattice_le ?_) |
| 465 | (colLattice_le fun a ↦ mem_sup_left ⟨_, col_mem_colLattice (inl a), h_col (inl a)⟩) |
| 466 | rintro (a | a) |
| 467 | · change φ *ᵥ P.col (inl a.val) ∈ colLattice (Ô E) _ |
| 468 | rw [h_col] |
| 469 | exact col_mem_colLattice a |
| 470 | · change φ *ᵥ P.col (inr a.val) ∈ colLattice (Ô E) _ |
| 471 | rw [h_col] |
| 472 | exact zero_mem _ |
| 473 | have h_second : S.isotropicRowsIndex j k⁻¹ ∣ submoduleIndex L₂ L₃ := by |
| 474 | let φ : Matrix (Fin (𝔰.ϱ + 1)) μ (𝔸f E) := ((framePair k)ᴴ * J * B).toRows₁ |
| 475 | have h_frame : φ * P = |
| 476 | fromCols 0 (isotropicRows ((S.latticeMiddle (𝔸f E)).frameGram k⁻¹.val.val))ᴴ := |
| 477 | (congrArg toRows₁ h_products).trans (toRows₁_gram_framePair_isotropicFramePair k) |
| 478 | have h_col (x : Fin 𝔰.ϱ ⊕ Fin 𝔰.ϱ) : φ *ᵥ P.col x = |
| 479 | (fromCols 0 (isotropicRows ((S.latticeMiddle (𝔸f E)).frameGram k⁻¹.val.val))ᴴ).col x := |
| 480 | congrArg (Matrix.col · x) h_frame |
| 481 | refine submoduleIndex_dvd_of_le (mulVecBilin ℕ _ φ) (colLattice_le ?_) |
| 482 | (colLattice_le fun a ↦ mem_sup_left ⟨_, col_mem_colLattice (inr a), h_col (inr a)⟩) |
| 483 | rintro (a | a) |
| 484 | · change φ *ᵥ P.col (inl a) ∈ colLattice (Ô E) _ |
| 485 | rw [h_col] |
| 486 | exact zero_mem _ |
| 487 | · change φ *ᵥ P.col (inr a.val) ∈ colLattice (Ô E) _ |
| 488 | rw [h_col] |
| 489 | exact col_mem_colLattice a |
| 490 | have hk' : IsIntMatrix (Ô E) (isotropicFramePair k) := fun a b ↦ hk a _ |
| 491 | have h_torsion : S.torsionIndex k ∣ submoduleIndex L₃ L₄ := |
| 492 | torsionIndex_dvd_submoduleIndex hq hk' h_pair hι |
| 493 | have h₁₂ : L₁ ≤ L₂ := colLattice_le fun x ↦ by |
| 494 | rcases x with a | a |
| 495 | · exact col_mem_colLattice (inl a.val) |
| 496 | · exact col_mem_colLattice (inr a) |
| 497 | have h₂₃ : L₂ ≤ L₃ := colLattice_le fun x ↦ col_mem_colLattice _ |
| 498 | have h₃₄ : L₃ ≤ L₄ := |
| 499 | le_inf (colLattice_le fun x a ↦ hq.isIntMatrix_coord.mul hk' a x) LinearMap.map_le_range |
| 500 | have h_chain : submoduleIndex L₁ L₂ * submoduleIndex L₂ L₃ * submoduleIndex L₃ L₄ = |
| 501 | submoduleIndex L₁ L₄ := by |
| 502 | rw [AddSubgroup.relIndex_mul_relIndex _ _ _ h₁₂ h₂₃, |
| 503 | AddSubgroup.relIndex_mul_relIndex _ _ _ (h₁₂.trans h₂₃) h₃₄] |
| 504 | exact (mul_dvd_mul (mul_dvd_mul h_first h_second) h_torsion).trans |
| 505 | (h_chain.dvd.trans (submoduleIndex_colLattice_dvd_preimageLattice h_span)) |
| 506 | |
| 507 | end Index |
| 508 | |
| 509 | end New.Filling |