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.Order.Star.Real |
| 4 | import Mathlib.Algebra.Ring.IsFormallyReal |
| 5 | import Mathlib.RingTheory.Etale.Weakly |
| 6 | import Mathlib.RingTheory.PicardGroup |
| 7 | import Mathlib.RingTheory.TotallySplit |
| 8 | import TauCeti.LinearAlgebra.Matrix.Rank |
| 9 | public import New.Spanning.Unfolding.Terms |
| 10 | import Lib.Adelic.Unitary.GramMatrix |
| 11 | import Lib.DiscreteSeries.Bruhat.BigCell |
| 12 | |
| 13 | /-! |
| 14 | # Links of isometries, the link isometry Υ_γ, and invariance under `besselU` |
| 15 | |
| 16 | Let `γ` be an isometry of the form `T.splitGram`, which is made of `ϱ` hyperbolic planes and a |
| 17 | middle space with Gram matrix `T`. Let `A` be the span of the first `ϱ` basis vectors, and let |
| 18 | `New.frameImage γ` be the image of the frame `(e₁, …, e_ϱ, z)`. The link of `γ` is the set of pairs |
| 19 | of middle coordinates of `t` and `γ⁻¹ t`, for `t` orthogonal to `A` and `γ A`. |
| 20 | |
| 21 | A filling `S` over a CM field `E` provides a prime `N = S.N`. Its middle space is `X₀ ⊥ E z_N`, |
| 22 | where `X₀` has an orthonormal basis indexed by `𝔰.κ` and `z = z_N` has the norm `-N`. The positive |
| 23 | space `X₀ ⊥ E z⁺` has the same coordinates, and `z⁺` has the norm `N`. After an exchange of the |
| 24 | `z_N`-coordinates of the two members of each pair (`linkSource`, `linkTarget`), the link is the |
| 25 | graph of an isometry `Υ_γ` (`linkIsometry`) of the positive space. The quantity `termDisc γ` |
| 26 | vanishes if and only if the spans of the frame and of its image under `γ` share a nonzero vector. |
| 27 | |
| 28 | ## Main definitions and results |
| 29 | |
| 30 | * `New.Filling.link_inv_mul_mul_of_mem_besselU`, |
| 31 | `New.Filling.frameDisc_frameGram_inv_mul_mul_of_mem_besselU`: the link and `New.frameDisc` are |
| 32 | unchanged under `γ ↦ u⁻¹ γ u'` with `u`, `u'` in `besselU`. |
| 33 | * `New.NormOnePairOccursFrom.besselU_mul`, `New.NormOnePairOccursFrom.inv`: the norm-one pair |
| 34 | condition is preserved by left multiplication by `besselU` and by inversion. With the invariance |
| 35 | of the minors and of `termDisc`, this makes the cells stable (`New.Filling.isStable_hasCellRank`). |
| 36 | * `New.Filling.frameDisc_weylElem_mul`, `New.Filling.link_weylElem_mul_eq_iff`: values on the big |
| 37 | cell, at `weylElem 𝔰.ϱ p * σ` with `σ` an isometry of the middle space. There the link determines |
| 38 | `σ`. |
| 39 | * `New.Filling.linkIsometry`, `New.Filling.mem_link_iff_linkIsometry`: the isometry `Υ_γ`, and the |
| 40 | link as its graph. |
| 41 | * `New.Filling.linkIsometry_frameImage_mulVec`: the link on combinations of the second frame. |
| 42 | * `New.Filling.termDisc_eq_zero_of_inf_ne_bot`: the sufficient condition for the vanishing of |
| 43 | `termDisc γ`. |
| 44 | |
| 45 | Notions from other files: |
| 46 | * `New.Shape.Form.splitGram`: the Gram matrix of `ϱ` hyperbolic planes and a middle space with Gram |
| 47 | matrix `T`. The basis is `e₁, …, e_ϱ`, the middle vectors, `e*₁, …, e*_ϱ` (indices `New.eStar`). |
| 48 | * `New.Shape.Form.besselU`: the isometries that are block upper unitriangular for this basis. |
| 49 | * `New.Shape.Form.frameGram`: the `(ϱ + 1) × (ϱ + 1)` matrix of the products `h(f_j, γ f_l)` of the |
| 50 | frame `f` with its image under `γ`, where `h` is the form `T.splitGram`. |
| 51 | * `New.Filling`: arithmetic data over a CM field `E`, among them the prime `S.N`. The matrix |
| 52 | `S.ratMiddle E` is the Gram matrix of `X₀ ⊥ E z_N`, `S.ratGram` is its `splitGram`, `S.G E` is the |
| 53 | group of isometries of `S.ratGram`, and `S.frameProducts γ` is the frame Gram matrix of `γ`. |
| 54 | * `New.frameDisc`: for a matrix of size `ϱ + 1` with leading minors `D_l`, the quantity |
| 55 | `|D_{ϱ+1}|² - N² |D_ϱ|²`. Its value at `S.N` and the frame Gram matrix of `γ` is |
| 56 | `New.Filling.termDisc γ`. |
| 57 | * `New.NormOnePairOccursFrom j γ`, the condition that a norm-one pair occurs from `j`: there is a |
| 58 | `c` with `c c̄ = 1` such that, for every frame index `a ≥ j` (counted from `0`), the flags of `f` |
| 59 | and `γ f` share a vector with leading coefficients `c` and `1` at `a`. |
| 60 | -/ |
| 61 | |
| 62 | @[expose] public section |
| 63 | |
| 64 | noncomputable section |
| 65 | |
| 66 | /-! |
| 67 | ## Invariance of links and cells under the unipotent group |
| 68 | |
| 69 | A vector `t` is orthogonal to `A` and `γ A` iff the coordinates at the `e*_a` of `t` and `γ⁻¹ t` |
| 70 | vanish. This describes the link in coordinates and gives its invariance under `besselU`. |
| 71 | -/ |
| 72 | |
| 73 | section StableCells |
| 74 | open Matrix Fin Fintype New.Floors FloorGroups Sum Function |
| 75 | |
| 76 | namespace New |
| 77 | |
| 78 | variable {F : Type*} [CommRing F] [StarRing F] {𝔰 : Shape} {T : Shape.Form 𝔰 F} |
| 79 | |
| 80 | omit [StarRing F] in |
| 81 | /-- The form `T.splitGram` exchanges the first and last blocks of coordinates of `v` and applies `T` |
| 82 | to the middle block. -/ |
| 83 | lemma splitGram_mulVec (v : 𝔰.BesselIndex → F) : |
| 84 | T.splitGram *ᵥ v = (fun a : Fin 𝔰.ϱ ↦ v (eStar a)) ⊕ᵥ |
| 85 | (T *ᵥ (fun b : 𝔰.MiddleIndex ↦ v (inr (inl b))) ⊕ᵥ fun a : Fin 𝔰.ϱ ↦ v (inl a)) := by |
| 86 | simp [funext_iff, splitGram, fromBlocks_mulVec, comp_def] |
| 87 | |
| 88 | /-- The matrix `linkMatrix γ` sends `t` to the pair of the middle blocks of `t` and of `γ⁻¹ t`. -/ |
| 89 | @[simp↓] |
| 90 | lemma linkMatrix_mulVec {γ : T.G} (t : 𝔰.BesselIndex → F) : |
| 91 | linkMatrix γ *ᵥ t = (fun b : 𝔰.MiddleIndex ↦ t (inr (inl b))) ⊕ᵥ |
| 92 | fun b : 𝔰.MiddleIndex ↦ (γ⁻¹.val.val *ᵥ t) (inr (inl b)) := by |
| 93 | ext (b | b) <;> simp [mulVec_eq_sum, linkMatrix, Matrix.one_apply] |
| 94 | |
| 95 | /-- A vector `t` is orthogonal to `A = ⟨e₁, …, e_ϱ⟩` and to `γ A` (so to the span `A + γ A` of the |
| 96 | columns of `isotropicFramePair γ`) iff the last `ϱ` coordinates, those at the `e*_a`, of both `t` |
| 97 | and `γ⁻¹ t` vanish. -/ |
| 98 | @[simp↓] |
| 99 | lemma orthogonal_isotropicFramePair_iff {γ : T.G} {t : 𝔰.BesselIndex → F} : |
| 100 | t ∈ ((isotropicFramePair γ)ᴴ * T.splitGram).mulVecLin.ker ↔ |
| 101 | (∀ a : Fin 𝔰.ϱ, t (eStar a) = 0) ∧ ∀ a : Fin 𝔰.ϱ, (γ⁻¹.val.val *ᵥ t) (eStar a) = 0 := by |
| 102 | -- The products of `t` with the `e_a`, then with the `γ e_a`. |
| 103 | have h_rows : ((isotropicFramePair γ)ᴴ * T.splitGram) *ᵥ t = |
| 104 | (fun a : Fin 𝔰.ϱ ↦ (T.splitGram *ᵥ t) (inl a)) ⊕ᵥ |
| 105 | fun a : Fin 𝔰.ϱ ↦ ((γ.val.valᴴ * T.splitGram) *ᵥ t) (inl a) := by |
| 106 | simp only [← mulVec_mulVec] |
| 107 | ext (a | a) <;> simp [mulVec_apply_eq_sum, Matrix.one_apply, apply_ite star] |
| 108 | -- As `γ` is unitary, `γᴴ` moves onto `t` as `γ⁻¹`; the form then picks the coordinates `eStar a`. |
| 109 | rw [LinearMap.mem_ker, mulVecLin_apply, h_rows, ← U.form_mul_inv_eq γ, ← mulVec_mulVec] |
| 110 | simp [-mulVec_mulVec, splitGram_mulVec, funext_iff] |
| 111 | |
| 112 | /-- The link in coordinates: a pair `p = (y, y')` of middle vectors is in the link of `γ` iff, |
| 113 | for some `a`, `γ` maps the vector with blocks `(a, y', 0)` to a vector with last two blocks |
| 114 | `(y, 0)`. -/ |
| 115 | lemma mem_link {γ : T.G} {p : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → F} : |
| 116 | p ∈ link γ ↔ ∃ a : Fin 𝔰.ϱ → F, (γ.val.val *ᵥ (a ⊕ᵥ (p ∘ inr ⊕ᵥ 0))) ∘ inr = p ∘ inl ⊕ᵥ 0 := by |
| 117 | constructor |
| 118 | · rintro ⟨t, h_orth, rfl⟩ |
| 119 | obtain ⟨ht, hγt⟩ := orthogonal_isotropicFramePair_iff.1 h_orth |
| 120 | -- The blocks of `γ⁻¹ t` are a free one, the second member of the pair, and `0`. |
| 121 | have h_blocks : (fun a : Fin 𝔰.ϱ ↦ (γ⁻¹.val.val *ᵥ t) (inl a)) ⊕ᵥ |
| 122 | ((linkMatrix γ *ᵥ t) ∘ inr ⊕ᵥ 0) = γ⁻¹.val.val *ᵥ t := by |
| 123 | ext (a | b | a) |
| 124 | exacts [rfl, by simp, (hγt a).symm] |
| 125 | refine ⟨fun a ↦ (γ⁻¹.val.val *ᵥ t) (inl a), ?_⟩ |
| 126 | rw [mulVecLin_apply, h_blocks] |
| 127 | ext (b | a) <;> simp [ht] |
| 128 | · rintro ⟨a, ha⟩ |
| 129 | refine ⟨γ.val.val *ᵥ (a ⊕ᵥ (p ∘ inr ⊕ᵥ 0)), orthogonal_isotropicFramePair_iff.2 |
| 130 | ⟨fun a' ↦ congrFun ha (inr a'), by simp⟩, ?_⟩ |
| 131 | ext (b | b) |
| 132 | exacts [by simpa using congrFun ha (inl b), by simp] |
| 133 | |
| 134 | /-- Let `f = (e₁, …, e_ϱ, z)` be the frame. The condition `NormOnePairOccursFrom j γ` says that, for |
| 135 | some `c` with `c c̄ = 1` and every index `a ≥ j`, there are combinations of `f` and of `γ f` that |
| 136 | are equal, have no coefficients above `a`, and have the coefficients `c` and `1` at `a`. If it holds |
| 137 | for `γ`, then it holds for `γ⁻¹`. -/ |
| 138 | lemma NormOnePairOccursFrom.inv {j : ℕ} {γ : T.G} (h_occurs : NormOnePairOccursFrom j γ) : |
| 139 | NormOnePairOccursFrom j γ⁻¹ := by |
| 140 | -- Apply `γ⁻¹` to the shared vector, exchange the two sides and scale by `star c = c⁻¹`. |
| 141 | obtain ⟨c, hc, h_shared⟩ := h_occurs |
| 142 | refine ⟨star c, by simpa [mul_comm] using hc, fun a ha ↦ ?_⟩ |
| 143 | obtain ⟨x, y, hxy, hx_lead, hy_lead, h_above⟩ := h_shared a ha |
| 144 | have hyx : frameImage 1 *ᵥ y = frameImage γ⁻¹.val.val *ᵥ x := by |
| 145 | simp [frameImage_mulVec γ.val.val⁻¹, hxy, frameImage_mulVec γ.val.val] |
| 146 | refine ⟨star c • y, star c • x, ?_, by simp [hy_lead], ?_, fun b hb ↦ by simp [h_above b hb]⟩ |
| 147 | · rw [mulVec_smul, mulVec_smul, hyx] |
| 148 | · simp [hx_lead, mul_comm, hc] |
| 149 | |
| 150 | /-- Let `f = frameImage 1` be the frame `(e₁, …, e_ϱ, z)`, and let `frameImage γ` be its image |
| 151 | `γ f`. Suppose `PairOccursAt γ c 1 a` holds for each index `a ≥ j`: some combination of `f` equals |
| 152 | some combination of `γ f`, with no coefficients above `a` and with coefficients `c` and `1` at `a`. |
| 153 | Then for every `y` there are `x` and `y'` with `frameImage 1 *ᵥ x = frameImage γ *ᵥ y'` and |
| 154 | `y' a = y a` for all `a ≥ j`. -/ |
| 155 | lemma Filling.exists_frameImage_eq_of_pairOccursAt {γ : T.G} {j : Fin (𝔰.ϱ + 2)} {c : F} |
| 156 | (h_shared : ∀ a : Fin (𝔰.ϱ + 1), j.val ≤ a.val → PairOccursAt γ c 1 a) (y : Fin (𝔰.ϱ + 1) → F) : |
| 157 | ∃ x y' : Fin (𝔰.ϱ + 1) → F, (∀ a : Fin (𝔰.ϱ + 1), j.val ≤ a.val → y' a = y a) ∧ |
| 158 | frameImage 1 *ᵥ x = frameImage γ.val.val *ᵥ y' := by |
| 159 | -- Descending induction on `j`: the coefficients `Y` of a vector shared at `j` are `1` at `j` and |
| 160 | -- `0` above, so a multiple of them corrects the entry at `j` and leaves the later ones alone. |
| 161 | induction j using reverseInduction with |
| 162 | | last => exact ⟨0, 0, fun a ha ↦ absurd a.is_lt (not_lt.2 ha), by simp⟩ |
| 163 | | cast j ih => |
| 164 | obtain ⟨x, z, hzy, hxz⟩ := ih fun a ha ↦ h_shared a (le_of_lt ha) |
| 165 | obtain ⟨X, Y, hXY, -, hY_one, h_above⟩ := h_shared j le_rfl |
| 166 | refine ⟨x + (y - z) j • X, z + (y - z) j • Y, fun a ha ↦ (eq_or_lt_of_le (a := j) ha).elim |
| 167 | (fun | rfl => by simp [hY_one]) (fun hlt ↦ by simp [h_above a hlt, hzy a hlt]), |
| 168 | by simp [mulVec_add, mulVec_smul, hxz, hXY]⟩ |
| 169 | |
| 170 | /-- Let `γ` satisfy the norm-one pair condition from some `j ≤ ϱ + 1` (for some `c` of norm `1`, the |
| 171 | flags of the frame `f = (e₁, …, e_ϱ, z)` and of `γ f` share a vector with leading coefficients `c` |
| 172 | and `1` at each index `a ≥ j`). Then for every `y` the spans of `f` and `γ f` share a vector whose |
| 173 | coefficients `y'` in `γ f` agree with `y` at the indices `a ≥ j`. -/ |
| 174 | lemma Filling.exists_frameImage_eq_of_normOnePairOccursFrom {γ : T.G} {j : Fin (𝔰.ϱ + 2)} |
| 175 | (h_occurs : NormOnePairOccursFrom j γ) (y : Fin (𝔰.ϱ + 1) → F) : |
| 176 | ∃ x y' : Fin (𝔰.ϱ + 1) → F, (∀ a : Fin (𝔰.ϱ + 1), j.val ≤ a.val → y' a = y a) ∧ |
| 177 | frameImage 1 *ᵥ x = frameImage γ.val.val *ᵥ y' := |
| 178 | let ⟨_, _, h_shared⟩ := h_occurs |
| 179 | exists_frameImage_eq_of_pairOccursAt h_shared y |
| 180 | |
| 181 | /-- Let `f = (e₁, …, e_ϱ, z)` be the frame. The norm-one pair condition from `j` says that there is |
| 182 | one `c` with `c c̄ = 1` such that, for every index `a ≥ j`, some combination of `f` equals some |
| 183 | combination of `γ f`, both with no coefficients above `a` and with the coefficients `c` and `1` at |
| 184 | `a`. If it holds for `γ` and `u` is in `besselU`, the group of the isometries that are block upper |
| 185 | unitriangular for the basis `e₁, …, e_ϱ`, middle vectors, `e*₁, …, e*_ϱ`, then it holds for |
| 186 | `u γ`. -/ |
| 187 | lemma NormOnePairOccursFrom.besselU_mul {j : ℕ} {γ u : T.G} (hu : u ∈ besselU) |
| 188 | (h_occurs : NormOnePairOccursFrom j γ) : |
| 189 | NormOnePairOccursFrom j (u * γ) := by |
| 190 | -- `u` acts on the span of the frame by the unitriangular matrix `frameMatrix u`. |
| 191 | obtain ⟨c, hc, h_shared⟩ := h_occurs |
| 192 | refine ⟨c, hc, fun a ha ↦ ?_⟩ |
| 193 | obtain ⟨x, y, hxy, hx_lead, hy_lead, h_above⟩ : ∃ x y : Fin (𝔰.ϱ + 1) → F, |
| 194 | frameImage 1 *ᵥ x = frameImage γ.val.val *ᵥ y ∧ x a = c ∧ y a = 1 ∧ |
| 195 | ∀ b > a, x b = 0 ∧ y b = 0 := h_shared a ha |
| 196 | -- `x` vanishes above `a`, so `frameMatrix u *ᵥ x` has the same entries as `x` at `a` and above. |
| 197 | have h_entry (b : Fin (𝔰.ϱ + 1)) (hb : a ≤ b) : (frameMatrix u *ᵥ x) b = x b := by |
| 198 | have h_off (i : Fin (𝔰.ϱ + 1)) (hi : i ≠ b) : frameMatrix u b i * x i = 0 := by |
| 199 | obtain h_lt | h_gt := lt_or_gt_of_ne hi |
| 200 | · simp [frameMatrix_unitriangular hu b i h_lt.le, hi.symm] |
| 201 | · simp [h_above i (hb.trans_lt h_gt)] |
| 202 | simp [mulVec_apply_eq_sum, sum_eq_single b h_off, frameMatrix_unitriangular hu b b le_rfl] |
| 203 | refine ⟨frameMatrix u *ᵥ x, y, ?_, (h_entry a le_rfl).trans hx_lead, hy_lead, |
| 204 | fun b hb ↦ by simpa only [h_entry b hb.le] using h_above b hb⟩ |
| 205 | calc frameImage 1 *ᵥ frameMatrix u *ᵥ x |
| 206 | _ = u.val.val *ᵥ frameImage 1 *ᵥ x := by |
| 207 | simp [← submatrix_mul_besselFrame, frameImage_mulVec u.val.val, hu] |
| 208 | _ = u.val.val *ᵥ frameImage γ.val.val *ᵥ y := by rw [hxy] |
| 209 | _ = frameImage (u * γ).val.val *ᵥ y := by |
| 210 | simp [frameImage_mulVec γ.val.val, frameImage_mulVec (u.val.val * _), Matrix.mul_assoc] |
| 211 | |
| 212 | /-- An element of the unipotent group `besselU` fixes the last two blocks of coordinates of a vector |
| 213 | whose last block vanishes. -/ |
| 214 | lemma mulVec_apply_inr_of_mem_besselU {u : T.G} (hu : u ∈ besselU) {t : 𝔰.BesselIndex → F} |
| 215 | (ht : ∀ a : Fin 𝔰.ϱ, t (eStar a) = 0) (i : 𝔰.MiddleIndex ⊕ Fin 𝔰.ϱ) : |
| 216 | (u.val.val *ᵥ t) (inr i) = t (inr i) := by |
| 217 | rcases i with b | a <;> simp [mulVec_apply_eq_sum, apply_inr_of_mem_besselU hu, ht] |
| 218 | |
| 219 | /-- Let `u` and `u'` lie in `besselU`, the group of the isometries that are block upper |
| 220 | unitriangular for the basis `e₁, …, e_ϱ`, middle vectors, `e*₁, …, e*_ϱ`, and so induce the identity |
| 221 | on the middle space. Then the link of `u⁻¹ γ u'` is the link of `γ`. -/ |
| 222 | lemma Filling.link_inv_mul_mul_of_mem_besselU {γ u u' : T.G} (hu : u ∈ besselU) |
| 223 | (hu' : u' ∈ besselU) : link (u⁻¹ * γ * u') = link γ := by |
| 224 | -- `t ↦ v *ᵥ t` carries the vectors that define one link to those that define the other. |
| 225 | have h_le {v w g : T.G} (hv : v ∈ besselU) (hw : w ∈ besselU) : link g ≤ link (v * g * w⁻¹) := by |
| 226 | rintro _ ⟨t, h_orth, rfl⟩ |
| 227 | obtain ⟨ht, hgt⟩ : (∀ a : Fin 𝔰.ϱ, t (eStar a) = 0) ∧ |
| 228 | ∀ a : Fin 𝔰.ϱ, (g⁻¹.val.val *ᵥ t) (eStar a) = 0 := |
| 229 | orthogonal_isotropicFramePair_iff.1 h_orth |
| 230 | have h_inv : (v * g * w⁻¹)⁻¹.val.val *ᵥ v.val.val *ᵥ t = w.val.val *ᵥ g⁻¹.val.val *ᵥ t := by |
| 231 | simp [← mulVec_mulVec, inv_mulVec_eq_vec rfl] |
| 232 | refine ⟨v.val.val *ᵥ t, orthogonal_isotropicFramePair_iff.2 ⟨fun a ↦ ?_, fun a ↦ ?_⟩, ?_⟩ |
| 233 | · rw [mulVec_apply_inr_of_mem_besselU hv ht, ht] |
| 234 | · rw [h_inv, mulVec_apply_inr_of_mem_besselU hw hgt, hgt] |
| 235 | · simp only [mulVecLin_apply, linkMatrix_mulVec, h_inv, |
| 236 | mulVec_apply_inr_of_mem_besselU hv ht, mulVec_apply_inr_of_mem_besselU hw hgt] |
| 237 | exact le_antisymm (by simpa [mul_assoc] using h_le (g := u⁻¹ * γ * u') hu hu') |
| 238 | (by simpa using h_le (g := γ) (inv_mem hu) (inv_mem hu')) |
| 239 | |
| 240 | /-- For `u` and `u'` in the unipotent group `besselU`, the quantity `New.frameDisc N`, that is |
| 241 | `|D_{ϱ+1}|² - N² |D_ϱ|²` in the leading minors `D_l`, of the frame Gram matrix is the same for |
| 242 | `u⁻¹ γ u'` as for `γ`. -/ |
| 243 | lemma Filling.frameDisc_frameGram_inv_mul_mul_of_mem_besselU {F : Type} [CommRing F] [StarRing F] |
| 244 | {T : 𝔰.Form F} {γ u u' : T.G} (hu : u ∈ besselU) (hu' : u' ∈ besselU) (N : F) : |
| 245 | frameDisc N (T.frameGram (u⁻¹ * γ * u').val) = frameDisc N (T.frameGram γ) := by |
| 246 | -- The determinant is the last of the leading minors. |
| 247 | have h_det : det (T.frameGram (u⁻¹ * γ * u').val) = det (T.frameGram γ) := |
| 248 | leadingMinor_frameGram_besselU_mul hu hu' ⊤ |
| 249 | simp only [frameDisc, h_det, leadingMinor_frameGram_besselU_mul hu hu'] |
| 250 | |
| 251 | /-- Terms with nonzero discriminant and a fixed link are stable under the Bessel unipotent group. -/ |
| 252 | lemma Filling.isStable_termsOfLink {E : Type} [Field E] [CMType E] {S : Filling E 𝔰} |
| 253 | (Λ : Submodule E (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E)) : |
| 254 | S.IsStable (S.termsOfLink Λ) := by |
| 255 | intro u hu u' hu' γ |
| 256 | simp [termsOfLink, frameDisc_frameGram_inv_mul_mul_of_mem_besselU hu hu', |
| 257 | link_inv_mul_mul_of_mem_besselU hu hu'] |
| 258 | |
| 259 | /-- Let `D_l` be the leading minors of the frame Gram matrix `S.frameProducts γ`, the matrix of the |
| 260 | products `h(f_b, γ f_l)` of the frame `f = (e₁, …, e_ϱ, z_N)` with its image under `γ`, so that |
| 261 | `S.termDisc γ = |D_{ϱ+1}|² - N² |D_ϱ|²`. The cell of rank `j` consists of the `γ` in `S.G E` such |
| 262 | that: for some `c` with `c c̄ = 1` and every index `a ≥ j`, a combination of `f` equals one of |
| 263 | `γ f`, both with no coefficients above `a` and with `c`, `1` at `a`; `D_j ≠ 0`; and |
| 264 | `S.termDisc γ ≠ 0` exactly if `j = ϱ + 1`. This cell is stable: for `u`, `u'` in the unipotent group |
| 265 | `besselU`, it contains `u⁻¹ γ u'` if and only if it contains `γ`. -/ |
| 266 | lemma Filling.isStable_hasCellRank {E : Type} [Field E] [CMType E] {S : Filling E 𝔰} |
| 267 | (j : Fin (𝔰.ϱ + 1 + 1)) : S.IsStable {γ : S.G E | S.HasCellRank j γ} := by |
| 268 | intro u hu u' hu' γ |
| 269 | -- The norm-one pair condition survives inversion and left multiplication by `besselU`, hence also |
| 270 | -- right multiplication; the minors and `termDisc` do not change. |
| 271 | have h_occurs : NormOnePairOccursFrom j.val (u⁻¹ * γ * u') ↔ NormOnePairOccursFrom j.val γ := |
| 272 | ⟨fun h ↦ by simpa [mul_assoc] using ((h.besselU_mul hu).inv.besselU_mul hu').inv, fun h ↦ by |
| 273 | simpa [mul_assoc] using ((h.besselU_mul (inv_mem hu)).inv.besselU_mul (inv_mem hu')).inv⟩ |
| 274 | have h_minor : leadingMinor (S.frameProducts (u⁻¹ * γ * u')) j = |
| 275 | leadingMinor (S.frameProducts γ) j := leadingMinor_frameGram_besselU_mul hu hu' j |
| 276 | have h_disc : S.termDisc (u⁻¹ * γ * u') = S.termDisc γ := |
| 277 | frameDisc_frameGram_inv_mul_mul_of_mem_besselU hu hu' _ |
| 278 | simp only [Set.mem_ofPred_eq, hasCellRank_iff, h_occurs, h_minor, h_disc] |
| 279 | |
| 280 | /-! ### The big cell -/ |
| 281 | |
| 282 | /-- Over a field `A` with involution, let `T.splitGram` be hermitian and invertible, with isometry |
| 283 | group `T.G`. Let `σ` fix the hyperbolic planes, and let `w_p = weylElem 𝔰.ϱ p` send `e_a` to |
| 284 | `p a • e*_a`. Let `t = T.frameGram σ 𝔰.top 𝔰.top` be the product of the last frame vector `z` with |
| 285 | `σ z`, and let `d` be the product of the first `ϱ` units of `p`. Let `T.frameGram (w_p σ)` be the |
| 286 | matrix of products of the frame `(e₁, …, e_ϱ, z)` with its image under `w_p σ`. Then `frameDisc N` |
| 287 | of this matrix, that is `|D_{ϱ+1}|² - N² |D_ϱ|²` in its leading minors `D_l`, equals |
| 288 | `d d̄ (t t̄ - N²)`. -/ |
| 289 | theorem Filling.frameDisc_weylElem_mul {A : Type} [Field A] [StarRing A] {T : 𝔰.Form A} |
| 290 | {σ : T.G} {p : ℕ → Aˣ} (hσ : σ ∈ floorGroup 𝔰.ϱ) (N : A) : |
| 291 | let t : A := T.frameGram σ 𝔰.top 𝔰.top |
| 292 | let d : A := ∏ a : Fin 𝔰.ϱ, (p a).val |
| 293 | frameDisc N (T.frameGram (weylElem 𝔰.ϱ p * σ).val) = d * star d * (t * star t - N ^ 2) := by |
| 294 | intro t d |
| 295 | -- The matrix is diagonal, with entries `p a` and `t`. |
| 296 | have h_det : (T.frameGram (weylElem 𝔰.ϱ p * σ).val).det = d * t := by |
| 297 | rw [frameGram_weylElem_mul hσ] |
| 298 | simp [prod_univ_castSucc, d, t] |
| 299 | have h_minor : leadingMinor (T.frameGram (weylElem 𝔰.ϱ p * σ).val) 𝔰.top.castSucc = d := by |
| 300 | rw [frameGram_weylElem_mul hσ] |
| 301 | simp [leadingMinor, submatrix_diagonal, castLE_injective, snoc, d] |
| 302 | rw [frameDisc, h_det, h_minor, star_mul'] |
| 303 | ring |
| 304 | |
| 305 | /-- Over a field with involution, let `T.splitGram` be hermitian and invertible. Let `ρ` fix the |
| 306 | hyperbolic planes, and let `w_r = weylElem 𝔰.ϱ r` send `e_a` to `r a • e*_a`. The link of `w_r ρ` is |
| 307 | the graph of the middle block of `ρ`: a pair lies in it if and only if its first member is the image |
| 308 | of the second under this block. -/ |
| 309 | lemma Filling.mem_link_weylElem_mul_iff {A : Type} [Field A] [StarRing A] {T : 𝔰.Form A} |
| 310 | {ρ : T.G} (hρ : ρ ∈ floorGroup 𝔰.ϱ) (r : ℕ → Aˣ) |
| 311 | {v : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → A} : |
| 312 | v ∈ link (weylElem 𝔰.ϱ r * ρ) ↔ ρ.val.val.toBlocks₂₂.toBlocks₁₁ *ᵥ (v ∘ inr) = v ∘ inl := by |
| 313 | -- `mem_link` asks for an `a` with one block of `w_r ρ` sending it to `0`: `a = 0` will do. |
| 314 | have h_ker (M : Matrix (Fin 𝔰.ϱ) (Fin 𝔰.ϱ) A) : ∃ a, M *ᵥ a = 0 := ⟨0, mulVec_zero M⟩ |
| 315 | rw [mem_link, coe_weylElem_mul hρ] |
| 316 | simp [← elim_add_add, elim_eq_iff, h_ker, fromBlocks_mulVec] |
| 317 | |
| 318 | /-- Over a field with involution, let `T.splitGram` be hermitian and invertible. Let `σ`, `τ` fix |
| 319 | the hyperbolic planes, and let `w_p = weylElem 𝔰.ϱ p` send `e_a` to `p a • e*_a`. Then `w_p σ` and |
| 320 | `w_q τ` have the same link exactly when `σ = τ`. -/ |
| 321 | theorem Filling.link_weylElem_mul_eq_iff {A : Type} [Field A] [StarRing A] {T : 𝔰.Form A} |
| 322 | {σ τ : T.G} {p q : ℕ → Aˣ} (hσ : σ ∈ floorGroup 𝔰.ϱ) |
| 323 | (hτ : τ ∈ floorGroup 𝔰.ϱ) : |
| 324 | link (weylElem 𝔰.ϱ p * σ) = link (weylElem 𝔰.ϱ q * τ) ↔ σ = τ := by |
| 325 | -- The link of `w_p σ` is the graph of the middle block of `σ`, and this block determines `σ`. |
| 326 | constructor |
| 327 | · intro h_link |
| 328 | have h_mid : σ.val.val.toBlocks₂₂.toBlocks₁₁ = τ.val.val.toBlocks₂₂.toBlocks₁₁ := by |
| 329 | refine ext_iff_mulVec.2 fun b ↦ ?_ |
| 330 | -- The pair of `τ b` and `b` lies in the link of `w_q τ`, hence in that of `w_p σ`. |
| 331 | have h_mem : (τ.val.val.toBlocks₂₂.toBlocks₁₁ *ᵥ b) ⊕ᵥ b ∈ link (weylElem 𝔰.ϱ p * σ) := by |
| 332 | simp [h_link, mem_link_weylElem_mul_iff hτ] |
| 333 | simpa using (mem_link_weylElem_mul_iff hσ p).1 h_mem |
| 334 | refine mul_left_cancel (a := weylElem 𝔰.ϱ p) (Subtype.ext (Units.ext ?_)) |
| 335 | rw [coe_weylElem_mul hσ, coe_weylElem_mul hτ, h_mid] |
| 336 | · rintro rfl |
| 337 | ext v |
| 338 | simp [mem_link_weylElem_mul_iff, hσ] |
| 339 | |
| 340 | end New |
| 341 | |
| 342 | end StableCells |
| 343 | |
| 344 | /-! |
| 345 | ## The link as an isometry |
| 346 | |
| 347 | The middle form is that of `X₀ ⊥ E z_N`, where `z_N` has the norm `-N`. |
| 348 | |
| 349 | A vector `y` orthogonal to `A` and `γ A` gives two classes in `A^⊥ / A = X₀ ⊥ E z_N`, those of `y` |
| 350 | and of `γ⁻¹ y`. |
| 351 | -/ |
| 352 | |
| 353 | section LinkIsometry |
| 354 | |
| 355 | open Matrix Module Fin Sum Function |
| 356 | |
| 357 | namespace New |
| 358 | |
| 359 | /-- The columns of two matrices set side by side span the sum of the two column spaces. -/ |
| 360 | lemma colSpan_fromCols {K m n₁ n₂ : Type*} [CommRing K] [Fintype n₁] [Fintype n₂] |
| 361 | (A : Matrix m n₁ K) (B : Matrix m n₂ K) : colSpan (A.fromCols B) = colSpan A ⊔ colSpan B := by |
| 362 | ext v |
| 363 | simp only [Submodule.mem_sup, LinearMap.mem_range, mulVecLin_apply, exists_exists_eq_and] |
| 364 | exact ⟨fun ⟨c, hc⟩ ↦ ⟨c ∘ inl, c ∘ inr, by rw [← hc, fromCols_mulVec]⟩, |
| 365 | fun ⟨a, b, hab⟩ ↦ ⟨a ⊕ᵥ b, (fromCols_mulVec_sumElim A B a b).trans hab⟩⟩ |
| 366 | |
| 367 | namespace Filling |
| 368 | |
| 369 | variable {E : Type} [Field E] [CMType E] {𝔰 : Shape} {S : Filling E 𝔰} |
| 370 | |
| 371 | /-- The space `M A` spanned by the columns `M e_1, …, M e_ϱ`, where `A = ⟨e_1, …, e_ϱ⟩`. -/ |
| 372 | def isotropicSpan (M : Matrix 𝔰.BesselIndex 𝔰.BesselIndex E) : Submodule E (𝔰.BesselIndex → E) := |
| 373 | colSpan ((frameImage M).submatrix id castSucc) |
| 374 | |
| 375 | /-- The space `I_γ = A ∩ γ A`, where `A = ⟨e_1, …, e_ϱ⟩`. -/ |
| 376 | def commonIsotropic (γ : S.G E) : Submodule E (𝔰.BesselIndex → E) := |
| 377 | isotropicSpan 1 ⊓ isotropicSpan γ.val.val |
| 378 | |
| 379 | /-- The orthogonal complement `(A + γ A)^⊥`, where `A = ⟨e_1, …, e_ϱ⟩`, for the form |
| 380 | `S.ratGram = (S.ratMiddle E).splitGram` of `ϱ` hyperbolic planes and the space `X₀ ⊥ E z_N`. -/ |
| 381 | def isotropicPerp (γ : S.G E) : Submodule E (𝔰.BesselIndex → E) := |
| 382 | ((isotropicFramePair γ)ᴴ * S.ratGram).mulVecLin.ker |
| 383 | |
| 384 | variable (S) in |
| 385 | /-- The Gram matrix of the positive space `X₀ ⊥ E z⁺`, where `X₀` has an orthonormal basis and `z⁺` |
| 386 | has the norm `S.N`, the prime of the filling `S`. -/ |
| 387 | def positiveGram : 𝔰.Form E := diagonal (1 ⊕ᵥ fun _ : Unit ↦ S.N) |
| 388 | |
| 389 | variable (E 𝔰) in |
| 390 | /-- The map that sends the pair of classes `(y₀ + λ' z_N, y₀' + λ z_N)` to `y₀ + λ z⁺`. -/ |
| 391 | def linkSource : (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E) →ₗ[E] (𝔰.MiddleIndex → E) := |
| 392 | .funLeft E E (Sum.elim (inl ∘ inl) (inr ∘ inr)) |
| 393 | |
| 394 | variable (E 𝔰) in |
| 395 | /-- The map that sends the pair of classes `(y₀ + λ' z_N, y₀' + λ z_N)` to `y₀' + λ' z⁺`. -/ |
| 396 | def linkTarget : (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E) →ₗ[E] (𝔰.MiddleIndex → E) := |
| 397 | .funLeft E E (Sum.elim (inr ∘ inl) (inl ∘ inr)) |
| 398 | |
| 399 | omit [CMType E] in |
| 400 | /-- A pair `p` of classes (a function on `𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex`) is determined by its two |
| 401 | images `linkSource E 𝔰 p` and `linkTarget E 𝔰 p` in `X₀ ⊥ E z⁺`. -/ |
| 402 | lemma eq_of_linkSource_eq_of_linkTarget_eq {p q : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} |
| 403 | (h_source : linkSource E 𝔰 p = linkSource E 𝔰 q) |
| 404 | (h_target : linkTarget E 𝔰 p = linkTarget E 𝔰 q) : p = q := by |
| 405 | ext ((j | z) | (j | z)) |
| 406 | exacts [congrFun h_source (inl j), congrFun h_target (inr z), congrFun h_target (inl j), |
| 407 | congrFun h_source (inr z)] |
| 408 | |
| 409 | /-- The form `S.positiveGram` of `X₀ ⊥ E z⁺` in coordinates: `𝔰.κ` indexes an orthonormal basis of |
| 410 | `X₀`, and `z⁺`, at the index `inr ()`, has the norm `S.N`. -/ |
| 411 | lemma dotProduct_positiveGram_mulVec_eq_sum_add (a b : 𝔰.MiddleIndex → E) : |
| 412 | star a ⬝ᵥ S.positiveGram *ᵥ b = |
| 413 | ∑ j : 𝔰.κ, star (a (inl j)) * b (inl j) + S.N * (star (a (inr ())) * b (inr ())) := by |
| 414 | simp [positiveGram, dotProduct, mulVec_diagonal, mul_left_comm] |
| 415 | |
| 416 | /-- The form `S.ratMiddle E` of `X₀ ⊥ E z_N` in coordinates: `𝔰.κ` indexes an orthonormal basis of |
| 417 | `X₀`, and `z_N`, at the index `inr ()`, has the norm `-S.N`. -/ |
| 418 | lemma dotProduct_ratMiddle_mulVec_eq_sum_sub (a b : 𝔰.MiddleIndex → E) : |
| 419 | star a ⬝ᵥ S.ratMiddle E *ᵥ b = |
| 420 | ∑ j : 𝔰.κ, star (a (inl j)) * b (inl j) - S.N * (star (a (inr ())) * b (inr ())) := by |
| 421 | simp [Shape.middleGram, dotProduct, mulVec, mul_left_comm, sub_eq_add_neg, |
| 422 | Matrix.one_apply] |
| 423 | |
| 424 | /-- The form of the space `X₀ ⊥ E z⁺` is anisotropic: only the zero vector has norm `0`. -/ |
| 425 | lemma eq_zero_of_positiveGram_form_eq_zero {a : 𝔰.MiddleIndex → E} |
| 426 | (h_norm : star a ⬝ᵥ S.positiveGram *ᵥ a = 0) : a = 0 := by |
| 427 | let v : NumberField.InfinitePlace E := Classical.ofNonempty |
| 428 | -- At an infinite place the norm is a sum of squares with positive weights. |
| 429 | have h_sum : ∑ j : 𝔰.κ, ‖Φ v (a (inl j))‖ ^ 2 + S.N * ‖Φ v (a (inr ()))‖ ^ 2 = 0 := by |
| 430 | simpa [dotProduct_positiveGram_mulVec_eq_sum_add, ← Complex.ofReal_inj, Complex.conj_mul'] using |
| 431 | congrArg (Φ v) h_norm |
| 432 | rw [add_eq_zero_iff_of_nonneg (by positivity) (by positivity), |
| 433 | Finset.sum_eq_zero_iff_of_nonneg fun _ _ ↦ sq_nonneg _] at h_sum |
| 434 | simpa [funext_iff, Unique.forall_iff, S.N_prime.ne_zero] using h_sum |
| 435 | |
| 436 | /-! ### The rank of the link and the link isometry -/ |
| 437 | |
| 438 | /-- A vector `y` is orthogonal to `A` and `γ A`, where `A` is the span of `e_1, …, e_ϱ`, if and only |
| 439 | if the coordinates of `y` and of `γ⁻¹ y` at the dual basis vectors `e*_a` vanish. -/ |
| 440 | lemma mem_isotropicPerp {γ : S.G E} {y : 𝔰.BesselIndex → E} : y ∈ isotropicPerp γ ↔ |
| 441 | (∀ a : Fin 𝔰.ϱ, y (eStar a) = 0) ∧ ∀ a : Fin 𝔰.ϱ, (γ⁻¹.val.val *ᵥ y) (eStar a) = 0 := |
| 442 | orthogonal_isotropicFramePair_iff |
| 443 | |
| 444 | /-- The link of `γ` is the image of `(A + γ A)^⊥` under the map `linkMatrix γ`, which sends `y` to |
| 445 | the pair of the middle coordinates of `y` and of `γ⁻¹ y`. -/ |
| 446 | lemma link_eq_map (γ : S.G E) : link γ = (isotropicPerp γ).map (linkMatrix γ).mulVecLin := rfl |
| 447 | |
| 448 | /-- A pair lies in the link of `γ` if and only if it consists of the middle coordinates of `y` and |
| 449 | of `γ⁻¹ y` for some `y` in `(A + γ A)^⊥`. -/ |
| 450 | lemma mem_link_iff_exists_mem_isotropicPerp {γ : S.G E} {p : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} : |
| 451 | p ∈ link γ ↔ ∃ y ∈ isotropicPerp γ, linkMatrix γ *ᵥ y = p := Submodule.mem_map |
| 452 | |
| 453 | /-- The classes in `X₀ ⊥ E z_N` of `y` and `γ⁻¹ y`, for `y` orthogonal to `A` and `γ A`, form a |
| 454 | pair in the link of `γ`. -/ |
| 455 | lemma linkMatrix_mulVec_mem_link {γ : S.G E} {y : 𝔰.BesselIndex → E} (hy : y ∈ isotropicPerp γ) : |
| 456 | linkMatrix γ *ᵥ y ∈ link γ := ⟨y, hy, rfl⟩ |
| 457 | |
| 458 | /-- The map `linkSource` sends the pair `linkMatrix γ *ᵥ y` of middle blocks of `y` and `γ⁻¹ y` to |
| 459 | `y₀ + λ z⁺`, where `y₀` are the coordinates of `y` in `X₀` (indices `𝔰.indexX₀`) and `λ` is the |
| 460 | coordinate of `γ⁻¹ y` at `z_N` (index `𝔰.z`). -/ |
| 461 | lemma linkSource_linkMatrix_mulVec {γ : S.G E} (y : 𝔰.BesselIndex → E) : |
| 462 | linkSource E 𝔰 (linkMatrix γ *ᵥ y) = |
| 463 | (y ∘ 𝔰.indexX₀) ⊕ᵥ fun _ : Unit ↦ (γ⁻¹.val.val *ᵥ y) 𝔰.z := by |
| 464 | rw [linkMatrix_mulVec] |
| 465 | ext (i | i) <;> rfl |
| 466 | |
| 467 | /-- The map `linkTarget` sends the pair `linkMatrix γ *ᵥ y` of middle blocks of `y` and `γ⁻¹ y` to |
| 468 | `y₀' + λ' z⁺`, where `y₀'` are the coordinates of `γ⁻¹ y` in `X₀` (indices `𝔰.indexX₀`) and `λ'` |
| 469 | is the coordinate of `y` at `z_N` (index `𝔰.z`). -/ |
| 470 | lemma linkTarget_linkMatrix_mulVec {γ : S.G E} (y : 𝔰.BesselIndex → E) : |
| 471 | linkTarget E 𝔰 (linkMatrix γ *ᵥ y) = |
| 472 | ((γ⁻¹.val.val *ᵥ y) ∘ 𝔰.indexX₀) ⊕ᵥ fun _ : Unit ↦ y 𝔰.z := by |
| 473 | rw [linkMatrix_mulVec] |
| 474 | ext (i | i) <;> rfl |
| 475 | |
| 476 | /-- If `y` and `y'` lie in `A^⊥`, that is, their coordinates at the `e*_a` vanish, then their |
| 477 | product for the form `S.ratGram` of the whole space is the product of their middle coordinates for |
| 478 | the form `S.ratMiddle E` of `A^⊥ / A = X₀ ⊥ E z_N`. -/ |
| 479 | lemma ratGram_form_of_eStar_eq_zero {y y' : 𝔰.BesselIndex → E} |
| 480 | (hy : ∀ a : Fin 𝔰.ϱ, y (eStar a) = 0) (hy' : ∀ a : Fin 𝔰.ϱ, y' (eStar a) = 0) : |
| 481 | star y ⬝ᵥ S.ratGram *ᵥ y' = |
| 482 | star (fun b : 𝔰.MiddleIndex ↦ y (inr (inl b))) ⬝ᵥ |
| 483 | S.ratMiddle E *ᵥ fun b : 𝔰.MiddleIndex ↦ y' (inr (inl b)) := by |
| 484 | simp [splitGram_mulVec, dotProduct, hy, hy'] |
| 485 | |
| 486 | /-- For pairs `p`, `q` in the link of `γ`, the product in the positive space `X₀ ⊥ E z⁺` of their |
| 487 | images under `linkSource` equals that of their images under `linkTarget`. -/ |
| 488 | lemma form_linkSource_eq_form_linkTarget {γ : S.G E} {p q : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} |
| 489 | (hp : p ∈ link γ) (hq : q ∈ link γ) : |
| 490 | star (linkSource E 𝔰 p) ⬝ᵥ S.positiveGram *ᵥ linkSource E 𝔰 q = |
| 491 | star (linkTarget E 𝔰 p) ⬝ᵥ S.positiveGram *ᵥ linkTarget E 𝔰 q := by |
| 492 | obtain ⟨y, hy_perp, rfl⟩ : ∃ y ∈ isotropicPerp γ, linkMatrix γ *ᵥ y = p := |
| 493 | mem_link_iff_exists_mem_isotropicPerp.1 hp |
| 494 | obtain ⟨hy, hγy⟩ : (∀ a : Fin 𝔰.ϱ, y (eStar a) = 0) ∧ |
| 495 | ∀ a : Fin 𝔰.ϱ, (γ⁻¹.val.val *ᵥ y) (eStar a) = 0 := mem_isotropicPerp.1 hy_perp |
| 496 | -- Likewise `q` comes from some `y'`. |
| 497 | obtain ⟨y', hy'_perp, rfl⟩ := mem_link_iff_exists_mem_isotropicPerp.1 hq |
| 498 | obtain ⟨hy', hγy'⟩ := mem_isotropicPerp.1 hy'_perp |
| 499 | -- Compare the product of `y`, `y'` with that of `γ⁻¹ y`, `γ⁻¹ y'`, and move the terms in `z_N`. |
| 500 | have h_unitary : star (γ⁻¹.val.val *ᵥ y) ⬝ᵥ S.ratGram *ᵥ γ⁻¹.val.val *ᵥ y' = |
| 501 | star y ⬝ᵥ S.ratGram *ᵥ y' := U.form_mulVec_mulVec γ⁻¹ y y' |
| 502 | rw [ratGram_form_of_eStar_eq_zero hγy hγy', ratGram_form_of_eStar_eq_zero hy hy', |
| 503 | dotProduct_ratMiddle_mulVec_eq_sum_sub, dotProduct_ratMiddle_mulVec_eq_sum_sub] at h_unitary |
| 504 | simp only [dotProduct_positiveGram_mulVec_eq_sum_add, linkMatrix_mulVec, linkSource, linkTarget, |
| 505 | LinearMap.funLeft_apply, elim_inl, elim_inr, Function.comp_apply] |
| 506 | linear_combination -h_unitary |
| 507 | |
| 508 | /-- A pair `p = (y₀ + λ' z_N, y₀' + λ z_N)` in the link vanishes as soon as one of its images |
| 509 | `linkSource p = y₀ + λ z⁺` and `linkTarget p = y₀' + λ' z⁺` in the positive space `X₀ ⊥ E z⁺` |
| 510 | vanishes. -/ |
| 511 | lemma eq_zero_of_linkSource_or_linkTarget_eq_zero {γ : S.G E} |
| 512 | {p : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} |
| 513 | (hp : p ∈ link γ) (h_zero : linkSource E 𝔰 p = 0 ∨ linkTarget E 𝔰 p = 0) : p = 0 := by |
| 514 | -- The two images have the same norm in a positive space, so they vanish together. |
| 515 | have h_norm := form_linkSource_eq_form_linkTarget hp hp |
| 516 | obtain ⟨h_source, h_target⟩ : linkSource E 𝔰 p = 0 ∧ linkTarget E 𝔰 p = 0 := by |
| 517 | obtain h | h := h_zero |
| 518 | · exact ⟨h, eq_zero_of_positiveGram_form_eq_zero (S := S) (by simp [← h_norm, h])⟩ |
| 519 | · exact ⟨eq_zero_of_positiveGram_form_eq_zero (S := S) (by simp [h_norm, h]), h⟩ |
| 520 | exact eq_of_linkSource_eq_of_linkTarget_eq (by simp [h_source]) (by simp [h_target]) |
| 521 | |
| 522 | omit [CMType E] in |
| 523 | /-- A vector lies in the span `A` of `e_1, …, e_ϱ` if and only if its coordinates outside the first |
| 524 | block vanish. -/ |
| 525 | lemma mem_isotropicSpan_one {y : 𝔰.BesselIndex → E} : |
| 526 | y ∈ isotropicSpan (𝔰 := 𝔰) 1 ↔ ∀ i : 𝔰.MiddleIndex ⊕ Fin 𝔰.ϱ, y (inr i) = 0 := by |
| 527 | constructor |
| 528 | · rintro ⟨c, rfl⟩ i |
| 529 | simp [mulVec, dotProduct] |
| 530 | · intro hy |
| 531 | refine ⟨fun a ↦ y (inl a), funext fun i ↦ ?_⟩ |
| 532 | rcases i with a | i <;> simp [mulVec, dotProduct, Matrix.one_apply, hy] |
| 533 | |
| 534 | omit [CMType E] in |
| 535 | /-- The span of `M e_1, …, M e_ϱ` is the image under `M` of the span `A` of `e_1, …, e_ϱ`. -/ |
| 536 | lemma isotropicSpan_eq_map (M : Matrix 𝔰.BesselIndex 𝔰.BesselIndex E) : |
| 537 | isotropicSpan M = (isotropicSpan 1).map M.mulVecLin := by |
| 538 | rw [isotropicSpan, isotropicSpan, colSpan, colSpan, ← LinearMap.range_comp, ← mulVecLin_mul] |
| 539 | congr 2 |
| 540 | ext i a |
| 541 | simp [Matrix.mul_apply, Matrix.one_apply] |
| 542 | |
| 543 | /-- A vector `y` lies in `γ A` if and only if `γ⁻¹ y` lies in `A`, the span of `e_1, …, e_ϱ`. -/ |
| 544 | lemma mem_isotropicSpan_coe {γ : S.G E} {y : 𝔰.BesselIndex → E} : |
| 545 | y ∈ isotropicSpan γ ↔ γ⁻¹.val.val *ᵥ y ∈ isotropicSpan 1 := by |
| 546 | rw [isotropicSpan_eq_map, Submodule.mem_map] |
| 547 | refine ⟨?_, fun hy ↦ ⟨γ⁻¹.val.val *ᵥ y, hy, by simp⟩⟩ |
| 548 | rintro ⟨x, hx, rfl⟩ |
| 549 | simpa using hx |
| 550 | |
| 551 | /-- A vector `y` lies in `commonIsotropic γ` if and only if it lies in `isotropicPerp γ` and |
| 552 | `linkMatrix γ *ᵥ y = 0`. -/ |
| 553 | lemma mem_commonIsotropic {γ : S.G E} {y : 𝔰.BesselIndex → E} : |
| 554 | y ∈ commonIsotropic γ ↔ y ∈ isotropicPerp γ ∧ linkMatrix γ *ᵥ y = 0 := by |
| 555 | rw [commonIsotropic, Submodule.mem_inf, mem_isotropicSpan_coe, mem_isotropicSpan_one, |
| 556 | mem_isotropicSpan_one, mem_isotropicPerp, linkMatrix_mulVec] |
| 557 | -- Both sides say that the middle and the last block of `y` and of `γ⁻¹ y` vanish. |
| 558 | simp only [funext_iff, Sum.forall (α := 𝔰.MiddleIndex), elim_inl, elim_inr, Pi.zero_apply] |
| 559 | rw [and_and_and_comm, and_comm] |
| 560 | |
| 561 | /-- The image of the Bessel frame under an isometry consists of distinct columns of its |
| 562 | invertible matrix, hence is linearly independent. -/ |
| 563 | lemma linearIndependent_col_frameImage (γ : S.G E) : |
| 564 | LinearIndependent E (frameImage γ.val.val).col := |
| 565 | (linearIndependent_cols_of_isUnit γ.val.isUnit).comp _ besselFrame_injective |
| 566 | |
| 567 | /-- The space `γ A`, spanned by `γ e_1, …, γ e_ϱ`, has rank `ϱ`. -/ |
| 568 | lemma finrank_isotropicSpan_coe (γ : S.G E) : finrank E (isotropicSpan γ.val.val) = 𝔰.ϱ := by |
| 569 | rw [isotropicSpan, colSpan, range_mulVecLin, finrank_span_eq_card, Fintype.card_fin] |
| 570 | exact (linearIndependent_col_frameImage γ).comp _ (castSucc_injective 𝔰.ϱ) |
| 571 | |
| 572 | /-- The columns `e_1, …, e_ϱ, γ e_1, …, γ e_ϱ` of `isotropicFramePair γ` span `A + γ A`, where `A` |
| 573 | is the span of `e_1, …, e_ϱ`. -/ |
| 574 | lemma colSpan_isotropicFramePair (γ : S.G E) : |
| 575 | colSpan (isotropicFramePair γ) = isotropicSpan 1 ⊔ isotropicSpan γ.val.val := by |
| 576 | rw [isotropicSpan, isotropicSpan, ← colSpan_fromCols] |
| 577 | congr 1 |
| 578 | ext i (a | a) <;> rfl |
| 579 | |
| 580 | /-- Let `A` be the span of `e_1, …, e_ϱ`. The rank of `A + γ A`, the column space of |
| 581 | `isotropicFramePair γ`, and the rank of `commonIsotropic γ = A ∩ γ A` add up to `2 ϱ`. -/ |
| 582 | lemma rank_isotropicFramePair_add_finrank_commonIsotropic (γ : S.G E) : |
| 583 | (isotropicFramePair γ).rank + finrank E (commonIsotropic γ) = 2 * 𝔰.ϱ := by |
| 584 | have h_one : finrank E (isotropicSpan (1 : Matrix 𝔰.BesselIndex 𝔰.BesselIndex E)) = 𝔰.ϱ := |
| 585 | finrank_isotropicSpan_coe (1 : S.G E) |
| 586 | rw [← finrank_range_mulVecLin, ← colSpan, colSpan_isotropicFramePair, commonIsotropic, |
| 587 | Submodule.finrank_sup_add_finrank_inf_eq, h_one, finrank_isotropicSpan_coe, two_mul] |
| 588 | |
| 589 | /-- The column rank of a matrix and the dimension of its orthogonal complement for |
| 590 | the nonsingular form `S.ratGram` add up to the ambient dimension. -/ |
| 591 | lemma rank_add_finrank_ker_perp (S : Filling E 𝔰) {ι : Type} [Fintype ι] |
| 592 | (M : Matrix 𝔰.BesselIndex ι E) : |
| 593 | M.rank + finrank E (Mᴴ * S.ratGram).mulVecLin.ker = 𝔰.r := by |
| 594 | have h_unit : IsUnit S.ratGram.det := (isUnit_iff_isUnit_det _).1 Floors.IsHermitianUnit.isUnit |
| 595 | simpa only [finrank_range_mulVecLin, rank_mul_eq_left_of_isUnit_det _ _ h_unit, |
| 596 | rank_conjTranspose_of_field, finrank_fintype_fun_eq_card, Shape.r] using |
| 597 | (Mᴴ * S.ratGram).mulVecLin.finrank_range_add_finrank_ker |
| 598 | |
| 599 | /-- Let `A = ⟨e_1, …, e_ϱ⟩`. The rank of `A + γ A`, which is the column space of |
| 600 | `isotropicFramePair γ`, plus the rank of its orthogonal complement `isotropicPerp γ` equals the rank |
| 601 | `𝔰.r` of the whole space. -/ |
| 602 | lemma rank_add_finrank_isotropicPerp (γ : S.G E) : |
| 603 | (isotropicFramePair γ).rank + finrank E (isotropicPerp γ) = 𝔰.r := by |
| 604 | exact S.rank_add_finrank_ker_perp (isotropicFramePair γ) |
| 605 | |
| 606 | /-- The rank of `link γ` plus the rank of `commonIsotropic γ` (the space `I_γ = A ∩ γ A`, with |
| 607 | `A = ⟨e_1, …, e_ϱ⟩`) equals the rank of `isotropicPerp γ = (A + γ A)^⊥`. So the link has the rank of |
| 608 | `(A + γ A)^⊥ / I_γ`. -/ |
| 609 | lemma finrank_link_add_finrank_commonIsotropic (γ : S.G E) : |
| 610 | finrank E (link γ) + finrank E (commonIsotropic γ) = finrank E (isotropicPerp γ) := by |
| 611 | have h_ker : commonIsotropic γ = isotropicPerp γ ⊓ (linkMatrix γ).mulVecLin.ker := |
| 612 | Submodule.ext fun _ ↦ mem_commonIsotropic |
| 613 | rw [link_eq_map, h_ker] |
| 614 | simpa only [← Module.finrank_eq_rank, ← Nat.cast_add, Nat.cast_inj] using |
| 615 | (linkMatrix γ).mulVecLin.rank_map_add_rank_inf_ker (isotropicPerp γ) |
| 616 | |
| 617 | /-- The link `link γ` consists of the pairs of middle blocks of `y` and `γ⁻¹ y`, for `y` orthogonal |
| 618 | to `A = ⟨e_1, …, e_ϱ⟩` and to `γ A`. It has rank `𝔰.k + 1`, where `𝔰.k` is the rank of `X₀`. -/ |
| 619 | lemma finrank_link (γ : S.G E) : finrank E (link γ) = 𝔰.k + 1 := by |
| 620 | -- The rank is that of `(A + γ A)^⊥ / I_γ`, which is `r - 2 ϱ`. |
| 621 | have h_quot : finrank E (link γ) + finrank E (commonIsotropic γ) = finrank E (isotropicPerp γ) := |
| 622 | finrank_link_add_finrank_commonIsotropic γ |
| 623 | have h_sum : (isotropicFramePair γ).rank + finrank E (commonIsotropic γ) = 2 * 𝔰.ϱ := |
| 624 | rank_isotropicFramePair_add_finrank_commonIsotropic γ |
| 625 | have h_perp : (isotropicFramePair γ).rank + finrank E (isotropicPerp γ) = 𝔰.r := |
| 626 | rank_add_finrank_isotropicPerp γ |
| 627 | have h_r : 𝔰.r = 𝔰.ϱ + (𝔰.k + 1 + 𝔰.ϱ) := by simp [Shape.r] |
| 628 | lia |
| 629 | |
| 630 | /-- A linear map from pairs of middle coordinate vectors to middle coordinate vectors that is |
| 631 | injective on the link of `γ` is a bijection from the link onto the middle coordinate vectors. -/ |
| 632 | lemma bijective_domRestrict_link {γ : S.G E} |
| 633 | {f : (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E) →ₗ[E] (𝔰.MiddleIndex → E)} |
| 634 | (h_inj : ∀ p ∈ link γ, f p = 0 → p = 0) : Bijective (f.domRestrict (link γ)) := by |
| 635 | have h_injective : Injective (f.domRestrict (link γ)) := |
| 636 | (injective_iff_map_eq_zero _).2 fun ⟨p, hp⟩ h ↦ Subtype.ext (h_inj p hp h) |
| 637 | exact ⟨h_injective, (LinearMap.injective_iff_surjective_of_finrank_eq_finrank |
| 638 | (by simp [finrank_link])).1 h_injective⟩ |
| 639 | |
| 640 | /-- The bijection `(y₀ + λ' z_N, y₀' + λ z_N) ↦ y₀ + λ z⁺` from the link onto `X₀ ⊥ E z⁺`. -/ |
| 641 | def linkSourceEquiv (γ : S.G E) : link γ ≃ₗ[E] (𝔰.MiddleIndex → E) := |
| 642 | .ofBijective ((linkSource E 𝔰).domRestrict (link γ)) |
| 643 | (bijective_domRestrict_link fun _ hp h ↦ |
| 644 | eq_zero_of_linkSource_or_linkTarget_eq_zero hp (.inl h)) |
| 645 | |
| 646 | /-- The bijection `(y₀ + λ' z_N, y₀' + λ z_N) ↦ y₀' + λ' z⁺` from the link onto `X₀ ⊥ E z⁺`. -/ |
| 647 | def linkTargetEquiv (γ : S.G E) : link γ ≃ₗ[E] (𝔰.MiddleIndex → E) := |
| 648 | .ofBijective ((linkTarget E 𝔰).domRestrict (link γ)) |
| 649 | (bijective_domRestrict_link fun _ hp h ↦ |
| 650 | eq_zero_of_linkSource_or_linkTarget_eq_zero hp (.inr h)) |
| 651 | |
| 652 | lemma linkSourceEquiv_apply (γ : S.G E) (p : link γ) : linkSourceEquiv γ p = linkSource E 𝔰 p := |
| 653 | rfl |
| 654 | |
| 655 | lemma linkTargetEquiv_apply (γ : S.G E) (p : link γ) : linkTargetEquiv γ p = linkTarget E 𝔰 p := |
| 656 | rfl |
| 657 | |
| 658 | /-- The link isometry `Υ_γ` of `X₀ ⊥ E z⁺`: for a pair `(y₀ + λ' z_N, y₀' + λ z_N)` in the link of |
| 659 | `γ`, it sends `y₀ + λ z⁺` to `y₀' + λ' z⁺`. Here `z_N` has the norm `-N` and `z⁺` the norm `N`, |
| 660 | for the prime `N = S.N` of the filling `S`. -/ |
| 661 | def linkIsometry (γ : S.G E) : (𝔰.MiddleIndex → E) ≃ₗ[E] (𝔰.MiddleIndex → E) := |
| 662 | (linkSourceEquiv γ).symm ≪≫ₗ linkTargetEquiv γ |
| 663 | |
| 664 | /-- For `p = (y₀ + λ' z_N, y₀' + λ z_N)` in the link of `γ`, the isometry `Υ_γ` sends |
| 665 | `linkSource p = y₀ + λ z⁺` to `linkTarget p = y₀' + λ' z⁺`. -/ |
| 666 | lemma linkIsometry_linkSource {γ : S.G E} {p : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} |
| 667 | (hp : p ∈ link γ) : linkIsometry γ (linkSource E 𝔰 p) = linkTarget E 𝔰 p := by |
| 668 | rw [← linkSourceEquiv_apply γ ⟨p, hp⟩, ← linkTargetEquiv_apply γ ⟨p, hp⟩, linkIsometry, |
| 669 | LinearEquiv.trans_apply, LinearEquiv.symm_apply_apply] |
| 670 | |
| 671 | /-- The map `linkSource` sends the link of `γ` onto `X₀ ⊥ E z⁺`. -/ |
| 672 | lemma exists_mem_link_linkSource_eq (γ : S.G E) (a : 𝔰.MiddleIndex → E) : |
| 673 | ∃ p ∈ link γ, linkSource E 𝔰 p = a := by |
| 674 | obtain ⟨p, hpa⟩ := (linkSourceEquiv γ).surjective a |
| 675 | exact ⟨p, p.property, (linkSourceEquiv_apply γ p).symm.trans hpa⟩ |
| 676 | |
| 677 | /-- The map `Υ_γ = linkIsometry γ` preserves the form of the positive space `X₀ ⊥ E z⁺`, whose Gram |
| 678 | matrix is `S.positiveGram`. -/ |
| 679 | theorem dotProduct_positiveGram_mulVec_linkIsometry (γ : S.G E) (a b : 𝔰.MiddleIndex → E) : |
| 680 | star (linkIsometry γ a) ⬝ᵥ S.positiveGram *ᵥ linkIsometry γ b = |
| 681 | star a ⬝ᵥ S.positiveGram *ᵥ b := by |
| 682 | obtain ⟨p, hp, rfl⟩ := exists_mem_link_linkSource_eq γ a |
| 683 | obtain ⟨q, hq, rfl⟩ := exists_mem_link_linkSource_eq γ b |
| 684 | rw [linkIsometry_linkSource hp, linkIsometry_linkSource hq, |
| 685 | form_linkSource_eq_form_linkTarget hp hq] |
| 686 | |
| 687 | /-- The map `y ↦ y₀ + λ z⁺` on `(A + γ A)^⊥`, where `y₀` is the `X₀`-part of `y` and `λ` is the |
| 688 | `z_N`-coordinate of `γ⁻¹ y`. -/ |
| 689 | def perpToPositive (γ : S.G E) : isotropicPerp γ →ₗ[E] (𝔰.MiddleIndex → E) := |
| 690 | (linkSource E 𝔰 ∘ₗ (linkMatrix γ).mulVecLin).domRestrict (isotropicPerp γ) |
| 691 | |
| 692 | lemma perpToPositive_apply (γ : S.G E) (y : isotropicPerp γ) : |
| 693 | perpToPositive γ y = linkSource E 𝔰 (linkMatrix γ *ᵥ y) := |
| 694 | rfl |
| 695 | |
| 696 | /-- Let `A` be the span of `e_1, …, e_ϱ`. The space `commonIsotropic γ = A ∩ γ A` lies in |
| 697 | `isotropicPerp γ = (A + γ A)^⊥`. -/ |
| 698 | lemma commonIsotropic_le_isotropicPerp (γ : S.G E) : commonIsotropic γ ≤ isotropicPerp γ := |
| 699 | fun _ hy ↦ (mem_commonIsotropic.1 hy).1 |
| 700 | |
| 701 | /-- Let `A` be the span of `e_1, …, e_ϱ`, and let `γ` lie in the unitary group `S.G E`. The map |
| 702 | `perpToPositive γ` sends `y` in `isotropicPerp γ = (A + γ A)^⊥` to `y₀ + λ z⁺` in the positive space |
| 703 | `X₀ ⊥ E z⁺`. Here `z⁺` is a vector of norm `S.N`, `y₀` is the `X₀`-part of `y`, and `λ` is the |
| 704 | `z_N`-coordinate of `γ⁻¹ y`. The kernel of `perpToPositive γ` is `commonIsotropic γ = A ∩ γ A`, |
| 705 | viewed inside `isotropicPerp γ`. -/ |
| 706 | lemma ker_perpToPositive (γ : S.G E) : |
| 707 | (perpToPositive γ).ker = (commonIsotropic γ).submoduleOf (isotropicPerp γ) := by |
| 708 | ext ⟨y, hy⟩ |
| 709 | -- A pair in the link vanishes exactly when its image under `linkSource` vanishes. |
| 710 | have h_zero : linkSource E 𝔰 (linkMatrix γ *ᵥ y) = 0 ↔ linkMatrix γ *ᵥ y = 0 := |
| 711 | ⟨fun h ↦ eq_zero_of_linkSource_or_linkTarget_eq_zero (linkMatrix_mulVec_mem_link hy) (.inl h), |
| 712 | fun h ↦ by rw [h, map_zero]⟩ |
| 713 | calc (⟨y, hy⟩ : isotropicPerp γ) ∈ (perpToPositive γ).ker |
| 714 | _ ↔ linkMatrix γ *ᵥ y = 0 := by rw [LinearMap.mem_ker, perpToPositive_apply, h_zero] |
| 715 | _ ↔ y ∈ commonIsotropic γ := by rw [mem_commonIsotropic, and_iff_right hy] |
| 716 | _ ↔ (⟨y, hy⟩ : isotropicPerp γ) ∈ (commonIsotropic γ).submoduleOf (isotropicPerp γ) := Iff.rfl |
| 717 | |
| 718 | /-- The map `perpToPositive γ`, `y ↦ y₀ + λ z⁺`, sends `isotropicPerp γ = (A + γ A)^⊥` onto |
| 719 | `X₀ ⊥ E z⁺`, where `A` is the span of `e_1, …, e_ϱ`. -/ |
| 720 | lemma perpToPositive_surjective (γ : S.G E) : Surjective (perpToPositive γ) := by |
| 721 | intro a |
| 722 | obtain ⟨p, hp, rfl⟩ := exists_mem_link_linkSource_eq γ a |
| 723 | obtain ⟨y, hy, rfl⟩ := mem_link_iff_exists_mem_isotropicPerp.1 hp |
| 724 | exact ⟨⟨y, hy⟩, perpToPositive_apply γ ⟨y, hy⟩⟩ |
| 725 | |
| 726 | /-- The space `commonIsotropic γ = A ∩ γ A`, for `A` the span of `e_1, …, e_ϱ`, lies in |
| 727 | `isotropicPerp γ = (A + γ A)^⊥`. The map `perpToPositive γ`, `y ↦ y₀ + λ z⁺`, sends `y` to its |
| 728 | `X₀`-part `y₀` plus `λ z⁺`, where `λ` is the `z_N`-coordinate of `γ⁻¹ y`. It has kernel `A ∩ γ A` |
| 729 | and is surjective, so it induces a bijection from `(A + γ A)^⊥ / (A ∩ γ A)` onto `X₀ ⊥ E z⁺`. -/ |
| 730 | theorem ker_perpToPositive_and_surjective (γ : S.G E) : |
| 731 | commonIsotropic γ ≤ isotropicPerp γ ∧ |
| 732 | (perpToPositive γ).ker = (commonIsotropic γ).submoduleOf (isotropicPerp γ) ∧ |
| 733 | Surjective (perpToPositive γ) := |
| 734 | ⟨commonIsotropic_le_isotropicPerp γ, ker_perpToPositive γ, perpToPositive_surjective γ⟩ |
| 735 | |
| 736 | /-- The link of `γ` is the graph of `Υ_γ`: a pair `p` lies in it if and only if `Υ_γ` sends |
| 737 | `linkSource p` to `linkTarget p`. -/ |
| 738 | lemma mem_link_iff_linkIsometry {γ : S.G E} {p : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} : |
| 739 | p ∈ link γ ↔ linkIsometry γ (linkSource E 𝔰 p) = linkTarget E 𝔰 p := by |
| 740 | refine ⟨linkIsometry_linkSource, fun h ↦ ?_⟩ |
| 741 | obtain ⟨q, hq, h_source⟩ := exists_mem_link_linkSource_eq γ (linkSource E 𝔰 p) |
| 742 | have h_target : linkTarget E 𝔰 q = linkTarget E 𝔰 p := by |
| 743 | rw [← linkIsometry_linkSource hq, h_source, h] |
| 744 | rwa [← eq_of_linkSource_eq_of_linkTarget_eq h_source h_target] |
| 745 | |
| 746 | /-- Two elements of `S.G E` with the same link have the same link isometry. -/ |
| 747 | theorem linkIsometry_eq_of_link_eq {γ γ' : S.G E} (h : link γ = link γ') : |
| 748 | linkIsometry γ = linkIsometry γ' := by |
| 749 | refine LinearEquiv.ext fun a ↦ ?_ |
| 750 | obtain ⟨p, hp, rfl⟩ := exists_mem_link_linkSource_eq γ a |
| 751 | rw [linkIsometry_linkSource hp, linkIsometry_linkSource (h.le hp)] |
| 752 | |
| 753 | /-- The product of two pairs `p`, `q` for the form `S.linkForm = T ⊕ -T`, where `T` is the form of |
| 754 | `X₀ ⊥ E z_N`, is the difference of the products, in the positive space `X₀ ⊥ E z⁺` with Gram matrix |
| 755 | `S.positiveGram`, of their images under `linkSource` and of their images under `linkTarget`. -/ |
| 756 | lemma dotProduct_linkForm_mulVec_eq_sub (S : Filling E 𝔰) |
| 757 | (p q : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E) : |
| 758 | star p ⬝ᵥ S.linkForm *ᵥ q = |
| 759 | star (linkSource E 𝔰 p) ⬝ᵥ S.positiveGram *ᵥ linkSource E 𝔰 q - |
| 760 | star (linkTarget E 𝔰 p) ⬝ᵥ S.positiveGram *ᵥ linkTarget E 𝔰 q := by |
| 761 | have h_split : star p ⬝ᵥ S.linkForm *ᵥ q = star (p ∘ inl) ⬝ᵥ S.ratMiddle E *ᵥ (q ∘ inl) - |
| 762 | star (p ∘ inr) ⬝ᵥ S.ratMiddle E *ᵥ (q ∘ inr) := by |
| 763 | simp [fromBlocks_mulVec, neg_mulVec, dotProduct, sub_eq_add_neg] |
| 764 | simp only [h_split, dotProduct_ratMiddle_mulVec_eq_sum_sub, |
| 765 | dotProduct_positiveGram_mulVec_eq_sum_add, linkSource, linkTarget, |
| 766 | LinearMap.funLeft_apply, elim_inl, elim_inr, Function.comp_apply] |
| 767 | ring |
| 768 | |
| 769 | /-- The link of `γ` consists of the pairs of middle blocks of `y` and `γ⁻¹ y`, for `y` orthogonal to |
| 770 | `A = ⟨e_1, …, e_ϱ⟩` and to `γ A`. It is its own orthogonal complement for the form `S.linkForm` on |
| 771 | pairs of middle vectors, which is `S.ratMiddle E` on the first member minus `S.ratMiddle E` on the |
| 772 | second. -/ |
| 773 | lemma _root_.New.mem_link_iff_orthogonal {γ : S.G E} {p : 𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E} : |
| 774 | p ∈ link γ ↔ ∀ q ∈ link γ, star q ⬝ᵥ S.linkForm *ᵥ p = 0 := by |
| 775 | simp only [dotProduct_linkForm_mulVec_eq_sub, sub_eq_zero] |
| 776 | refine ⟨fun hp q hq ↦ form_linkSource_eq_form_linkTarget hq hp, fun h_orth ↦ ?_⟩ |
| 777 | -- The difference `d` of `Υ_γ (linkSource p)` and `linkTarget p` is `linkTarget q` for some `q` in |
| 778 | -- the link, and the hypothesis at `q` says that `d` has norm `0`. |
| 779 | rw [mem_link_iff_linkIsometry, ← sub_eq_zero] |
| 780 | obtain ⟨q, hq, hq'⟩ := exists_mem_link_linkSource_eq γ |
| 781 | ((linkIsometry γ).symm (linkIsometry γ (linkSource E 𝔰 p) - linkTarget E 𝔰 p)) |
| 782 | refine eq_zero_of_positiveGram_form_eq_zero (S := S) ?_ |
| 783 | rw [mulVec_sub, dotProduct_sub, sub_eq_zero, ← (linkIsometry γ).apply_symm_apply (_ - _), ← hq', |
| 784 | dotProduct_positiveGram_mulVec_linkIsometry, linkIsometry_linkSource hq, h_orth q hq] |
| 785 | |
| 786 | /-! ### The link on the second frame, and the vanishing of `termDisc` -/ |
| 787 | |
| 788 | /-- Let `S` be a filling over the CM field `E`, with the prime `N = S.N`, and let `γ` lie in |
| 789 | `S.G E`. The columns of `frameImage γ` are the images under `γ` of the frame |
| 790 | `f = (e_1, …, e_ϱ, z_N)`. Let their combination `y = γ f · c` have the products `(0, …, 0, c')` with |
| 791 | `f`. Let `y₀` be the `X₀`-part of `y` and `c_z = c 𝔰.top` the last coefficient. Then |
| 792 | `linkIsometry γ`, the isometry of `X₀ ⊥ E z⁺` read off from the link of `γ`, where `z⁺` has the norm |
| 793 | `N`, sends `y₀ + c_z z⁺` to `-(c' / N) z⁺`. -/ |
| 794 | theorem linkIsometry_frameImage_mulVec {γ : S.G E} {c : Fin (𝔰.ϱ + 1) → E} {c' : E} |
| 795 | (h_products : S.frameProducts γ *ᵥ c = Pi.single 𝔰.top c') : |
| 796 | linkIsometry γ (((frameImage γ *ᵥ c) ∘ 𝔰.indexX₀) ⊕ᵥ fun _ : Unit ↦ c 𝔰.top) = |
| 797 | (0 : 𝔰.κ → E) ⊕ᵥ fun _ : Unit ↦ -(c' / S.N) := by |
| 798 | -- The classes of `y` and `γ⁻¹ y = f · c` are `y₀ - (c' / N) z_N` and `c_z z_N`. |
| 799 | set y : 𝔰.BesselIndex → E := frameImage γ *ᵥ c with hy |
| 800 | have h_coord : y 𝔰.z = -(c' / S.N) := by |
| 801 | simp [← neg_mul_frameImage_mulVec_z_eq h_products, hy, neg_div, S.N_prime.ne_zero] |
| 802 | have h_inv : γ⁻¹.val.val *ᵥ y = init c ⊕ᵥ ((0 ⊕ᵥ fun _ : Unit ↦ c 𝔰.top) ⊕ᵥ 0) := by |
| 803 | simp [← frameImage_one_mulVec, hy, frameImage_mulVec γ.val.val] |
| 804 | have h_perp : y ∈ isotropicPerp γ := mem_isotropicPerp.2 |
| 805 | ⟨frameImage_mulVec_eStar_eq_zero h_products, fun a ↦ congrFun h_inv (eStar a)⟩ |
| 806 | have h_image := linkIsometry_linkSource (linkMatrix_mulVec_mem_link h_perp) |
| 807 | rwa [linkSource_linkMatrix_mulVec, linkTarget_linkMatrix_mulVec, h_inv, h_coord] at h_image |
| 808 | |
| 809 | /-- Let `f = (e_1, …, e_ϱ, z)` be the frame and let `y = γ f · c` have the products |
| 810 | `S.frameProducts γ *ᵥ c = (0, …, 0, c')` with `f`. Then `y` is a combination of `f` if and only if |
| 811 | its `X₀`-part vanishes. -/ |
| 812 | lemma exists_frameImage_eq_iff {γ : S.G E} {c : Fin (𝔰.ϱ + 1) → E} {c' : E} |
| 813 | (h_products : S.frameProducts γ *ᵥ c = Pi.single 𝔰.top c') : |
| 814 | (∃ x : Fin (𝔰.ϱ + 1) → E, frameImage 1 *ᵥ x = frameImage γ *ᵥ c) ↔ |
| 815 | (frameImage γ *ᵥ c) ∘ 𝔰.indexX₀ = 0 := by |
| 816 | constructor |
| 817 | · rintro ⟨x, hx⟩ |
| 818 | simp [← hx, ↓frameImage_one_mulVec, funext_iff] |
| 819 | · intro h_zero |
| 820 | refine ⟨(frameImage γ *ᵥ c) ∘ 𝔰.besselFrame, ?_⟩ |
| 821 | have h_middle (i : 𝔰.κ) : (frameImage γ *ᵥ c) (𝔰.indexX₀ i) = 0 := congrFun h_zero i |
| 822 | simp [↓frameImage_one_mulVec, init, frameImage_mulVec_eStar_eq_zero h_products, h_middle, |
| 823 | funext_iff] |
| 824 | |
| 825 | /-- Let `f = (e_1, …, e_ϱ, z)` be the frame. If `y = frameImage γ *ᵥ c` is orthogonal to the whole |
| 826 | frame `f`, that is `S.frameProducts γ *ᵥ c = 0`, then `y` equals `frameImage 1 *ᵥ x` for some `x`, |
| 827 | so it is a combination of `f`. -/ |
| 828 | lemma exists_frameImage_eq_of_frameProducts_mulVec_eq_zero {γ : S.G E} {c : Fin (𝔰.ϱ + 1) → E} |
| 829 | (h_ker : S.frameProducts γ *ᵥ c = 0) : |
| 830 | ∃ x : Fin (𝔰.ϱ + 1) → E, frameImage 1 *ᵥ x = frameImage γ *ᵥ c := by |
| 831 | have h_products : S.frameProducts γ *ᵥ c = Pi.single 𝔰.top 0 := by rw [h_ker, Pi.single_zero] |
| 832 | -- The link isometry sends `y₀ + c_z z⁺` to `0`, so this vector and its `X₀`-part `y₀` vanish. |
| 833 | have h_zero : (((frameImage γ *ᵥ c) ∘ 𝔰.indexX₀) ⊕ᵥ fun _ : Unit ↦ c 𝔰.top) = 0 := |
| 834 | (linkIsometry γ).map_eq_zero_iff.1 |
| 835 | (by simp [linkIsometry_frameImage_mulVec h_products, funext_iff]) |
| 836 | exact (exists_frameImage_eq_iff h_products).2 (funext fun i ↦ congrFun h_zero (inl i)) |
| 837 | |
| 838 | /-- Let `S` be a filling over the CM field `E`, with the prime `N = S.N`. Let `f = frameImage 1` be |
| 839 | the frame `(e_1, …, e_ϱ, z)`, and let `frameImage γ` be its image `γ f`. Let `δ` be the determinant |
| 840 | of the matrix of products of `f` with `γ f`, and `δ'` its leading minor of size `ϱ`. Then |
| 841 | `S.termDisc γ = |δ|² - N² |δ'|²` vanishes if and only if there are coefficient vectors `x` and |
| 842 | `y ≠ 0` with `frameImage 1 *ᵥ x = frameImage γ *ᵥ y`. -/ |
| 843 | lemma termDisc_eq_zero_iff_exists {γ : S.G E} : |
| 844 | S.termDisc γ = 0 ↔ |
| 845 | ∃ x y : Fin (𝔰.ϱ + 1) → E, y ≠ 0 ∧ frameImage 1 *ᵥ x = frameImage γ *ᵥ y := by |
| 846 | by_cases h_det : (S.frameProducts γ).det = 0 |
| 847 | · -- Here `termDisc γ = 0`, and a nonzero vector of the kernel is shared. |
| 848 | obtain ⟨y, hy, h_ker⟩ := exists_mulVec_eq_zero_iff.2 h_det |
| 849 | obtain ⟨x, hxy⟩ := exists_frameImage_eq_of_frameProducts_mulVec_eq_zero h_ker |
| 850 | exact iff_of_true ((termDisc_pos_or_eq_zero γ).resolve_left fun h ↦ h.2 h_det) ⟨x, y, hy, hxy⟩ |
| 851 | -- The last column `c` of the adjugate has the products `(0, …, 0, δ)` and the last entry `δ'`, |
| 852 | -- so `termDisc γ` is `N ⟨y₀, y₀⟩` for the `X₀`-part `y₀` of `γ f · c`. |
| 853 | obtain ⟨c, h_products, hc_top⟩ := exists_mulVec_eq_single_det (S.frameProducts γ) |
| 854 | have h_disc : S.termDisc γ = 0 ↔ (frameImage γ *ᵥ c) ∘ 𝔰.indexX₀ = 0 := by |
| 855 | rw [termDisc, frameDisc, ← hc_top, ← mul_dotProduct_comp_indexX₀_eq_sub h_products, |
| 856 | mul_eq_zero_iff_left (Nat.cast_ne_zero.2 S.N_prime.ne_zero)] |
| 857 | -- The standard hermitian form on the middle coordinates is anisotropic. |
| 858 | exact ⟨eq_zero_of_star_dotProduct_self, fun h ↦ by rw [h, dotProduct_zero]⟩ |
| 859 | rw [h_disc] |
| 860 | constructor |
| 861 | · intro h_zero |
| 862 | obtain ⟨x, hx⟩ := (exists_frameImage_eq_iff h_products).2 h_zero |
| 863 | exact ⟨x, c, fun h ↦ h_det (by simpa [h, eq_comm] using h_products), hx⟩ |
| 864 | · -- The coefficients `y` of a shared vector are a multiple of `c`. |
| 865 | rintro ⟨x, y, hy, hxy⟩ |
| 866 | have h_products' := frameProducts_mulVec_of_frameImage_eq hxy |
| 867 | let t : E := -S.N * x 𝔰.top / (S.frameProducts γ).det |
| 868 | have h_multiple : y = t • c := by |
| 869 | apply mulVec_injective_of_isUnit ((isUnit_iff_isUnit_det _).2 (Ne.isUnit h_det)) |
| 870 | rw [h_products', mulVec_smul, h_products, ← Pi.single_smul, smul_eq_mul, |
| 871 | div_mul_cancel₀ _ h_det] |
| 872 | have h_zero : (frameImage γ *ᵥ y) ∘ 𝔰.indexX₀ = 0 := |
| 873 | (exists_frameImage_eq_iff h_products').1 ⟨x, hxy⟩ |
| 874 | rwa [h_multiple, mulVec_smul, Pi.smul_comp, |
| 875 | smul_eq_zero_iff_right fun ht ↦ hy (by rw [h_multiple, ht, zero_smul])] at h_zero |
| 876 | |
| 877 | /-- The vectors `γ e_1, …, γ e_ϱ, γ z`, the columns of `frameImage γ`, are linearly independent. -/ |
| 878 | lemma frameImage_mulVec_eq_zero_iff {γ : S.G E} {y : Fin (𝔰.ϱ + 1) → E} : |
| 879 | frameImage (𝔰 := 𝔰) γ *ᵥ y = 0 ↔ y = 0 := by |
| 880 | simpa only [mulVec_zero] using |
| 881 | (mulVec_injective_iff.mpr (linearIndependent_col_frameImage γ)).eq_iff (a := y) (b := 0) |
| 882 | |
| 883 | /-- The quantity `S.termDisc γ`, formed from the last two leading minors of the matrix of products |
| 884 | of the frame `f = (e_1, …, e_ϱ, z)` with `γ f`, vanishes if the spans of `f` and of `γ f` have a |
| 885 | nonzero intersection. -/ |
| 886 | theorem termDisc_eq_zero_of_inf_ne_bot {γ : S.G E} |
| 887 | (h : colSpan (frameImage 1) ⊓ colSpan (frameImage γ.val.val) ≠ ⊥) : |
| 888 | S.termDisc γ = 0 := by |
| 889 | obtain ⟨t, ⟨⟨x, hxy⟩, ⟨y, rfl⟩⟩, h_ne⟩ := (Submodule.ne_bot_iff _).1 h |
| 890 | exact termDisc_eq_zero_iff_exists.2 ⟨x, y, frameImage_mulVec_eq_zero_iff.not.1 h_ne, hxy⟩ |
| 891 | |
| 892 | end Filling |
| 893 | |
| 894 | end New |
| 895 | |
| 896 | end LinkIsometry |
| 897 | |
| 898 | end |