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.Int |
| 4 | import Mathlib.Algebra.Order.Star.Real |
| 5 | import Mathlib.RingTheory.Etale.Weakly |
| 6 | import Mathlib.RingTheory.TotallySplit |
| 7 | public import New.Spanning.RemainingTerms.Data |
| 8 | public import New.Spanning.RemainingTerms.FrameCount |
| 9 | import New.Spanning.Unfolding.ReducedPoints |
| 10 | |
| 11 | /-! |
| 12 | # The part in `X₀` of a frame, moves, and lifts of a lattice |
| 13 | |
| 14 | The lemmas that are used to count, round by round, the frames over a lattice `L ⊆ Λ ∩ X₀`, where `Λ` |
| 15 | is the lattice of a class. A move is a unipotent element of the congruence level `M` that fixes the |
| 16 | standard frame. For a term, `Ξ₀` consists of the first `ϱ` rows of the matrix of products, and `δ` |
| 17 | is the leading minor of that matrix whose order is the cell rank of the term. |
| 18 | |
| 19 | Notions from other files: |
| 20 | * The frame is `e₁, …, e_ϱ, z`, `A` is the isotropic space spanned by the `e_i`, and `X₀` is the |
| 21 | space with the indices `𝔰.κ`; `frameMiddle` takes the coordinates in `X₀ ⊕ Ez` of a frame. |
| 22 | * `frameProducts γ` is the matrix of products of the frame with its image under `γ`. |
| 23 | * `translateByClassReps c c' γ` is `h_c⁻¹ γ h_c'`, and `γ ∈ termsOver c s c'` says that it |
| 24 | stabilises the standard lattice and has the reduction `s`. |
| 25 | * `classCoordX₀ c` gives the coordinates of vectors of `X₀` in the lattice `Λ` of the class `c`; |
| 26 | `classLatticeX₀ c` is `Λ ∩ X₀`. |
| 27 | * `termLattice c c' γ` consists of the vectors `v` of `Λ ∩ X₀` such that some vector of |
| 28 | `v + M (Λ ∩ A)` is orthogonal to the frame of `γ`. |
| 29 | |
| 30 | ## Main definitions and results |
| 31 | |
| 32 | * `New.Filling.exists_framePartX₀_mul_eq_sub_smul`: every row `η` of vectors of `Λ ∩ X₀` gives a |
| 33 | move, which subtracts `M η Ξ₀` from the part in `X₀` of a frame. |
| 34 | * `New.Filling.exists_isLift`, `New.Filling.exists_conjTranspose_mul_eq_of_row_mem`: if `L` lies in |
| 35 | the lattice of a term, it lifts linearly to vectors orthogonal to the frame; two lifts in one |
| 36 | coset of the products with vectors of `L` differ by the products with a rational row `η`. |
| 37 | * `New.Filling.complementLattice`: the lattice `P = Λ ∩ X₀ ∩ L^⊥`, which has the corank of `L` as |
| 38 | its rank. |
| 39 | * `New.Filling.HasCellRank.exists_framePartX₀_sub_eq`: parts in `X₀` that are congruent modulo |
| 40 | `M δ` differ by `M η Ξ₀`. |
| 41 | -/ |
| 42 | |
| 43 | @[expose] public section |
| 44 | |
| 45 | namespace New.Filling |
| 46 | |
| 47 | open NumberField Matrix Module Fintype ENNReal Pointwise |
| 48 | |
| 49 | variable {E : Type} [Field E] [CMType E] |
| 50 | |
| 51 | /-! ## Matrices and lattices over the finite adeles -/ |
| 52 | |
| 53 | lemma finAdeleMatrix_mul {l m n : Type} [Fintype m] (A : Matrix l m E) (B : Matrix m n E) : |
| 54 | finAdeleMatrix (A * B) = finAdeleMatrix A * finAdeleMatrix B := |
| 55 | Matrix.map_mul (f := algebraMap E (𝔸f E)) |
| 56 | |
| 57 | lemma finAdeleMatrix_add {m n : Type} (A B : Matrix m n E) : |
| 58 | finAdeleMatrix (A + B) = finAdeleMatrix A + finAdeleMatrix B := |
| 59 | Matrix.map_add _ (map_add (algebraMap E (𝔸f E))) A B |
| 60 | |
| 61 | /-- A linear system `M w = T` over `E` that has a solution `s` over the finite adeles |
| 62 | (`finAdeleMatrix` reads a rational matrix there) has rational solutions near `s`: every open set |
| 63 | that contains `s` contains one. -/ |
| 64 | lemma exists_mul_eq_of_finAdeleMatrix_mul_eq {m n ι : Type} [Fintype m] [Fintype n] |
| 65 | {M : Matrix m n E} |
| 66 | {T : Matrix m ι E} {U : Set (Matrix n ι (𝔸f E))} (hU : IsOpen U) {s : Matrix n ι (𝔸f E)} |
| 67 | (hs : s ∈ U) (h_solves : finAdeleMatrix M * s = finAdeleMatrix T) : |
| 68 | ∃ w : Matrix n ι E, finAdeleMatrix w ∈ U ∧ M * w = T := by |
| 69 | -- Take a basis `y` of the kernel of `M` and write `1 = y e + b M`. The solutions are the matrices |
| 70 | -- `y t + b T`, and `t` can be approximated by a rational matrix. |
| 71 | classical |
| 72 | let d : ℕ := finrank E M.mulVecLin.ker |
| 73 | obtain ⟨y, -, hy⟩ : ∃ y : Matrix n (Fin d) E, HasLeftInv y ∧ colSpan y = M.mulVecLin.ker := |
| 74 | exists_hasLeftInv_colSpan_eq M.mulVecLin.ker |
| 75 | obtain ⟨e, b, h_one⟩ : ∃ (e : Matrix (Fin d) n E) (b : Matrix n m E), y * e + b * M = 1 := |
| 76 | exists_mul_add_mul_eq_one hy.ge |
| 77 | have h_ker : M * y = 0 := mul_eq_zero_of_colSpan_le_ker hy.le |
| 78 | have h_split : finAdeleMatrix y * (finAdeleMatrix e * s) + finAdeleMatrix (b * T) = s := |
| 79 | calc finAdeleMatrix y * (finAdeleMatrix e * s) + finAdeleMatrix (b * T) |
| 80 | = finAdeleMatrix (y * e + b * M) * s := by |
| 81 | rw [finAdeleMatrix_mul b T, ← h_solves] |
| 82 | simp [finAdeleMatrix_add, Matrix.add_mul, Matrix.mul_assoc] |
| 83 | _ = s := by simp [h_one] |
| 84 | have h_special : M * (b * T) = T := by |
| 85 | apply Matrix.map_injective (algebraMap E (𝔸f E)).injective |
| 86 | calc finAdeleMatrix (M * (b * T)) |
| 87 | = finAdeleMatrix M * |
| 88 | (finAdeleMatrix y * (finAdeleMatrix e * s) + finAdeleMatrix (b * T)) := by |
| 89 | rw [Matrix.mul_add, ← Matrix.mul_assoc (finAdeleMatrix M), ← finAdeleMatrix_mul, |
| 90 | ← finAdeleMatrix_mul, h_ker] |
| 91 | simp |
| 92 | _ = finAdeleMatrix T := by rw [h_split, h_solves] |
| 93 | let V : Set (Matrix (Fin d) ι (𝔸f E)) := {t | finAdeleMatrix y * t + finAdeleMatrix (b * T) ∈ U} |
| 94 | have h_mem : finAdeleMatrix e * s ∈ V := by rwa [Set.mem_ofPred_eq, h_split] |
| 95 | have h_dense : DenseRange (finAdeleMatrix : Matrix (Fin d) ι E → Matrix (Fin d) ι (𝔸f E)) := |
| 96 | .piMap fun _ ↦ .piMap fun _ ↦ denseRange_algebraMap_finAdele |
| 97 | obtain ⟨t, ht⟩ : ∃ t : Matrix (Fin d) ι E, finAdeleMatrix t ∈ V := |
| 98 | h_dense.exists_mem_open (hU.preimage (by fun_prop)) ⟨finAdeleMatrix e * s, h_mem⟩ |
| 99 | refine ⟨y * t + b * T, ?_, ?_⟩ |
| 100 | · rwa [finAdeleMatrix_add, finAdeleMatrix_mul] |
| 101 | · rw [Matrix.mul_add, ← Matrix.mul_assoc, h_ker, Matrix.zero_mul, zero_add, h_special] |
| 102 | |
| 103 | /-- Scaling a matrix by an idele scales the lattice spanned by its columns. -/ |
| 104 | lemma colLattice_smul {σ ι : Type} [Fintype ι] (a : (𝔸f E)ˣ) (M : Matrix σ ι (𝔸f E)) : |
| 105 | colLattice (Ô E) (a • M) = a • colLattice (Ô E) M := by |
| 106 | ext w |
| 107 | simp [colLattice, Submodule.mem_smul_pointwise_iff_exists, Units.smul_def] |
| 108 | |
| 109 | /-- If the finite adelic image of a rational vector lies in `d • L`, dividing the vector by |
| 110 | the nonzero rational number represented by `d` puts its image in `L`. -/ |
| 111 | lemma inv_smul_mem_of_finAdele_mem_smul {ι : Type} {v : ι → E} |
| 112 | {L : Submodule (Ô E) (ι → 𝔸f E)} {δ : E} (hδ : δ ≠ 0) {d : (𝔸f E)ˣ} (hd : d.val = δ) |
| 113 | (hv : ((↑) : E → 𝔸f E) ∘ v ∈ d • L) : ((↑) : E → 𝔸f E) ∘ (δ⁻¹ • v) ∈ L := by |
| 114 | obtain ⟨x, hx, h⟩ := hv |
| 115 | suffices ((↑) : E → 𝔸f E) ∘ (δ⁻¹ • v) = x by rwa [this] |
| 116 | funext i |
| 117 | have hi : d.val * x i = v i := congrFun h i |
| 118 | change ((δ⁻¹ * v i : E) : 𝔸f E) = x i |
| 119 | rw [map_mul, ← hi, hd, ← mul_assoc, ← map_mul, inv_mul_cancel₀ hδ, map_one, one_mul] |
| 120 | |
| 121 | /-- Let the idele `d` be the nonzero number `δ`. If the columns of the rational matrix `v` lie in |
| 122 | `d` times the lattice of the vectors that `H` makes integral, then `H` makes `δ⁻¹ v` integral. -/ |
| 123 | lemma isIntMatrix_mul_finAdeleMatrix_inv_smul {σ κ n : Type} [Fintype κ] {H : Matrix σ κ (𝔸f E)} |
| 124 | {v : Matrix κ n E} {δ : E} (hδ : δ ≠ 0) {d : (𝔸f E)ˣ} (hd : d.val = δ) |
| 125 | (h_mem : ∀ i : n, ((↑) : E → 𝔸f E) ∘ v.col i ∈ d • preimageLattice (Ô E) H) : |
| 126 | IsIntMatrix (Ô E) (H * finAdeleMatrix (δ⁻¹ • v)) := by |
| 127 | exact fun r i ↦ (inv_smul_mem_of_finAdele_mem_smul hδ hd (h_mem i)) r |
| 128 | |
| 129 | variable [HasPrimitiveRoot5040 E] {𝔰 : Shape} {S : Filling E 𝔰} |
| 130 | |
| 131 | /-- Let `m` have a left inverse, and let `A` be invertible over the finite adeles, with integral |
| 132 | entries. Then the lattice spanned by the columns of `m A` has index `[det A]`, the generalised |
| 133 | index, in the lattice spanned by the columns of `m`. -/ |
| 134 | lemma submoduleIndex_colLattice_mul {κ τ : Type} [Fintype κ] [Fintype τ] [DecidableEq τ] |
| 135 | {m : Matrix κ τ (𝔸f E)} (hm : HasLeftInv m) {A : GL τ (𝔸f E)} (hA : IsIntMatrix (Ô E) A.val) : |
| 136 | submoduleIndex (colLattice (Ô E) (m * A.val)) (colLattice (Ô E) m) = genIndex A.val.det := by |
| 137 | have h_inj : Function.Injective (m.mulVecLin.restrictScalars (Ô E)).toAddMonoidHom := |
| 138 | hm.injective_mulVec |
| 139 | have h_unfold : colLattice (Ô E) m = |
| 140 | (intVectors (Ô E) τ).map (m.mulVecLin.restrictScalars (Ô E)) := rfl |
| 141 | rw [← submoduleIndex_colLattice_intVectors hA, colLattice_mul, h_unfold, submoduleIndex, |
| 142 | Submodule.map_toAddSubgroup, Submodule.map_toAddSubgroup] |
| 143 | exact congrArg Nat.cast (AddSubgroup.relIndex_map_map_of_injective _ _ h_inj) |
| 144 | |
| 145 | /-- Let the columns of the rational matrix `y` be independent, and let `L` be the lattice with the |
| 146 | basis `B = y a`, where `Bᴴ B` is integral. The rows of the products of `B` with the vectors of `L` |
| 147 | are the integral combinations of the rows of `Bᴴ B`. Their index among all integral rows, that is |
| 148 | the index of `L` in its dual lattice, is the square of `discriminant r L`, which is by definition |
| 149 | the square root of the generalised index of the Gram determinant `det (Bᴴ B)`. -/ |
| 150 | lemma submoduleIndex_colLattice_gram_transpose {κ : Type} [Fintype κ] {r : ℕ} |
| 151 | {y : Matrix κ (Fin r) E} (hy : HasLeftInv y) (a : GL (Fin r) (𝔸f E)) |
| 152 | (h_int : IsIntMatrix (Ô E) ((finAdeleMatrix y * a.val)ᴴ * (finAdeleMatrix y * a.val))) : |
| 153 | (submoduleIndex (colLattice (Ô E) ((finAdeleMatrix y * a.val)ᴴ * (finAdeleMatrix y * a.val))ᵀ) |
| 154 | (intVectors (Ô E) (Fin r)) : ℝ) = |
| 155 | discriminant r (colLattice (Ô E) (finAdeleMatrix y * a.val)) ^ 2 := by |
| 156 | rw [discriminant_colLattice hy] |
| 157 | set Γ : Matrix (Fin r) (Fin r) (𝔸f E) := (finAdeleMatrix y * a.val)ᴴ * (finAdeleMatrix y * a.val) |
| 158 | have h_pos : 0 < genIndex Γ.det := genIndex_det_gram_finAdeleMatrix_mul_pos hy a |
| 159 | obtain ⟨G, hG⟩ : IsUnit Γᵀ := (isUnit_transpose Γ).2 |
| 160 | ((isUnit_iff_isUnit_det Γ).2 (genIndex.apply_ne_zero_iff.1 h_pos.ne')) |
| 161 | have hG_int : IsIntMatrix (Ô E) G.val := by |
| 162 | rw [hG] |
| 163 | exact h_int.transpose |
| 164 | rw [Real.sq_sqrt h_pos.le, ← hG, submoduleIndex_colLattice_intVectors hG_int, hG, det_transpose] |
| 165 | |
| 166 | section Saturated |
| 167 | |
| 168 | variable {κ P : Type} [Fintype κ] [DecidableEq κ] [Fintype P] {H' : Matrix κ P (𝔸f E)} |
| 169 | {H : Matrix P κ (𝔸f E)} |
| 170 | |
| 171 | /-- Let the adelic matrix `H` have a left inverse. A rational vector of the subspace `V` that `H` |
| 172 | makes integral lies in the saturated lattice of `V`, the lattice of the vectors in the adelic span |
| 173 | of `V` that `H` makes integral. -/ |
| 174 | lemma coe_mem_saturatedLattice (h_inv : H' * H = 1) {V : Submodule E (κ → E)} {v : κ → E} |
| 175 | (hv : v ∈ V) (hv_int : ((↑) : E → 𝔸f E) ∘ v ∈ preimageLattice (Ô E) H) : |
| 176 | ((↑) : E → 𝔸f E) ∘ v ∈ saturatedLattice h_inv V := by |
| 177 | classical |
| 178 | -- The vector has coordinates `s` in the basis `m` of the saturated lattice. They are integral, |
| 179 | -- since `H m` has an integral left inverse `p`. |
| 180 | let m : Matrix κ (Fin (finrank E V)) (𝔸f E) := (sublatticeBasis h_inv V).val |
| 181 | obtain ⟨⟨-, p, hp_int, hp⟩, y, a, -, hy, hm⟩ : IsPrimitiveMatrix (Ô E) (H * m) ∧ |
| 182 | ∃ y : Matrix κ (Fin (finrank E V)) E, ∃ a : GL (Fin (finrank E V)) (𝔸f E), |
| 183 | HasLeftInv y ∧ colSpan y = V ∧ m = finAdeleMatrix y * a.val := |
| 184 | (sublatticeBasis h_inv V).property |
| 185 | obtain ⟨t, rfl⟩ : ∃ t : Fin (finrank E V) → E, y *ᵥ t = v := hy.ge hv |
| 186 | obtain ⟨s, hs⟩ : ∃ s : Fin (finrank E V) → 𝔸f E, m *ᵥ s = ((↑) : E → 𝔸f E) ∘ (y *ᵥ t) := |
| 187 | ⟨a⁻¹.val *ᵥ (((↑) : E → 𝔸f E) ∘ t), funext fun i ↦ by |
| 188 | simp [hm, Matrix.mul_assoc, (algebraMap E (𝔸f E)).map_mulVec]⟩ |
| 189 | have hs_int : p *ᵥ H *ᵥ m *ᵥ s ∈ intVectors (Ô E) (Fin (finrank E V)) := by |
| 190 | rw [hs] |
| 191 | exact hp_int.mulVec hv_int |
| 192 | rw [mulVec_mulVec, mulVec_mulVec, Matrix.mul_assoc, hp, one_mulVec] at hs_int |
| 193 | exact ⟨s, hs_int, hs⟩ |
| 194 | |
| 195 | /-- Let the adelic matrix `H` have the left inverse `H'`, and let `Λ` be the saturated lattice of |
| 196 | the subspace `V`, the lattice of the vectors in the adelic span of `V` that `H` makes integral. For |
| 197 | a finite idele `d` in `Ô`, the index of `d Λ` in `Λ` as additive groups is `[d] ^ dim V`. Here |
| 198 | `[d] = genIndex d` is the generalised index, the inverse of the factor by which `d` scales Haar |
| 199 | measure on the finite adeles. -/ |
| 200 | lemma submoduleIndex_smul_saturatedLattice (h_inv : H' * H = 1) (V : Submodule E (κ → E)) |
| 201 | {d : (𝔸f E)ˣ} (hd : d.val ∈ Ô E) : |
| 202 | (submoduleIndex (d • saturatedLattice h_inv V) (saturatedLattice h_inv V) : ℝ) = |
| 203 | genIndex d.val ^ finrank E V := by |
| 204 | -- If `m` is the basis of `Λ`, then `d Λ` has the basis `m A`, with `A` the scalar matrix of `d`. |
| 205 | let m : Matrix κ (Fin (finrank E V)) (𝔸f E) := (sublatticeBasis h_inv V).val |
| 206 | let A : GL (Fin (finrank E V)) (𝔸f E) := d • 1 |
| 207 | obtain ⟨p, -, hp : p * (H * m) = 1⟩ := (isPrimitiveMatrix_mul_sublatticeBasis h_inv V).right |
| 208 | have hm : HasLeftInv m := ⟨p * H, by rw [Matrix.mul_assoc, hp]⟩ |
| 209 | have hA : A.val = d.val • 1 := rfl |
| 210 | have h_basis : d • saturatedLattice h_inv V = colLattice (Ô E) (m * A.val) := by |
| 211 | rw [hA, Matrix.mul_smul, Matrix.mul_one, saturatedLattice, ← colLattice_smul, Units.smul_def] |
| 212 | calc (submoduleIndex (d • saturatedLattice h_inv V) (saturatedLattice h_inv V) : ℝ) |
| 213 | = genIndex A.val.det := by |
| 214 | rw [h_basis] |
| 215 | exact submoduleIndex_colLattice_mul hm (.smul hd .one) |
| 216 | _ = genIndex d.val ^ finrank E V := by simp [hA] |
| 217 | |
| 218 | end Saturated |
| 219 | |
| 220 | /-! ## The part in `X₀` of a frame, and moves -/ |
| 221 | |
| 222 | /-- The part in `X₀` of the frame of `γ`: the coordinates at the indices `𝔰.κ` of the images of the |
| 223 | frame vectors. -/ |
| 224 | def framePartX₀ (γ : S.G E) : Matrix 𝔰.κ (Fin (𝔰.ϱ + 1)) E := (frameMiddle γ.val.val).toRows₁ |
| 225 | |
| 226 | omit [HasPrimitiveRoot5040 E] in |
| 227 | /-- The product of an isotropic frame vector with the image of a frame vector is the coordinate of |
| 228 | the image at the dual isotropic vector. -/ |
| 229 | lemma frameProducts_castSucc_apply (γ : S.G E) (i : Fin 𝔰.ϱ) (a : Fin (𝔰.ϱ + 1)) : |
| 230 | S.frameProducts γ i.castSucc a = γ.val.val (.inr (.inr i)) (𝔰.besselFrame a) := by |
| 231 | simp [frameGram, Matrix.mul_apply] |
| 232 | |
| 233 | omit [HasPrimitiveRoot5040 E] in |
| 234 | /-- The product of `z` with the image of a frame vector is `-N` times the coordinate of the image |
| 235 | along `z`. -/ |
| 236 | lemma frameProducts_top_apply (γ : S.G E) (a : Fin (𝔰.ϱ + 1)) : |
| 237 | S.frameProducts γ 𝔰.top a = -(S.N : E) * γ.val.val 𝔰.z (𝔰.besselFrame a) := by |
| 238 | simp [frameGram, Shape.Form.splitGram, Shape.middleGram, Matrix.mul_apply] |
| 239 | |
| 240 | omit [HasPrimitiveRoot5040 E] in |
| 241 | /-- Two frames with the same products and the same part in `X₀` agree outside the isotropic |
| 242 | space. -/ |
| 243 | lemma apply_inr_besselFrame_eq {γ γ' : S.G E} (hZ : S.frameProducts γ' = S.frameProducts γ) |
| 244 | (h_part : framePartX₀ γ' = framePartX₀ γ) (i : 𝔰.MiddleIndex ⊕ Fin 𝔰.ϱ) (a : Fin (𝔰.ϱ + 1)) : |
| 245 | γ'.val (.inr i) (𝔰.besselFrame a) = γ.val (.inr i) (𝔰.besselFrame a) := by |
| 246 | rcases i with (i | i) | i |
| 247 | · exact congrFun₂ h_part i a |
| 248 | · simpa [frameProducts_top_apply, S.N_prime.ne_zero] using congrFun₂ hZ 𝔰.top a |
| 249 | · simpa [frameProducts_castSucc_apply] using congrFun₂ hZ i.castSucc a |
| 250 | |
| 251 | /-- Let `E` contain a primitive 5040th root of unity, let `S` be a filling of shape `𝔰` with the |
| 252 | congruence level `M = S.M`, and let the `ϱ` columns of `η` be rational vectors of `Λ ∩ X₀`. Then |
| 253 | there is a move `u`, that is, a rational unipotent element of level `M` for `Λ` that fixes the |
| 254 | standard frame, with the following property. For every `γ`, the coordinates in `X₀` of the frame of |
| 255 | `u γ` (`framePartX₀`) are those of the frame of `γ` minus `M η Ξ₀`. -/ |
| 256 | lemma exists_framePartX₀_mul_eq_sub_smul (c : S.Classes) {η : Matrix 𝔰.κ (Fin 𝔰.ϱ) E} |
| 257 | (hη : IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix η)) : |
| 258 | ∃ u ∈ S.classUnipotent₀ c, ∀ γ : S.G E, |
| 259 | framePartX₀ (u * γ) = framePartX₀ γ - (S.M : E) • |
| 260 | (η * isotropicRows (S.frameProducts γ)) := by |
| 261 | -- The Eichler map made from `η` fixes the standard frame, as `η` is orthogonal to it. |
| 262 | let v : Matrix 𝔰.BesselIndex (Fin 𝔰.ϱ) E := fromRows 0 ((η.fromRows 0).fromRows 0) |
| 263 | let x : Matrix 𝔰.BesselIndex (Fin 𝔰.ϱ) E := inclMatrix E Sum.inl |
| 264 | have hv_int : IsIntMatrix (Ô E) (S.classCoord c * finAdeleMatrix v) := by |
| 265 | simpa [v, classCoord_eq_fromBlocks, IsIntMatrix, Matrix.mul_apply] using hη |
| 266 | have hv_frame (b : Fin 𝔰.ϱ) (a : Fin (𝔰.ϱ + 1)) : |
| 267 | (vᴴ * S.ratGram) b (𝔰.besselFrame a) = 0 := by |
| 268 | cases a using Fin.lastCases <;> simp [v, Shape.Form.splitGram, Shape.middleGram, |
| 269 | Matrix.mul_apply] |
| 270 | obtain ⟨u, -, hu, τ, hu_eq⟩ : ∃ u ∈ S.classUnipotent c, |
| 271 | ((∀ (b : Fin 𝔰.ϱ) (a : Fin (𝔰.ϱ + 1)), (vᴴ * S.ratGram) b (𝔰.besselFrame a) = 0) → |
| 272 | u ∈ S.classUnipotent₀ c) ∧ |
| 273 | ∃ τ : E, u.val.val = 1 + (S.M : E) • |
| 274 | (x * (vᴴ * S.ratGram) - (v + x * (τ • (vᴴ * S.ratGram * v) - 0)) * (xᴴ * S.ratGram)) := |
| 275 | S.exists_mem_classUnipotent_eq_one_add_smul c id v 0 (by simp [v]) (by simp) hv_int |
| 276 | (by simp [IsIntMatrix]) rfl |
| 277 | refine ⟨u, hu hv_frame, fun γ ↦ Matrix.ext fun i b ↦ ?_⟩ |
| 278 | -- In the coordinates of `X₀` the rows of `x` vanish, and those of `v` are those of `η`. |
| 279 | change (u.val.val * frameImage γ.val.val) (𝔰.indexX₀ i) b = |
| 280 | (framePartX₀ γ - (S.M : E) • (η * isotropicRows (S.frameProducts γ))) i b |
| 281 | have h_products : |
| 282 | xᴴ * (S.ratGram * frameImage γ.val.val) = isotropicRows (S.frameProducts γ) := by |
| 283 | rw [← Matrix.mul_assoc, inclMatrix_conjTranspose_mul_frameImage] |
| 284 | have hx (Y : Matrix (Fin 𝔰.ϱ) (Fin (𝔰.ϱ + 1)) E) : (x * Y) (𝔰.indexX₀ i) b = 0 := by |
| 285 | simp [x, inclMatrix, Matrix.mul_apply] |
| 286 | have hv (Y : Matrix (Fin 𝔰.ϱ) (Fin (𝔰.ϱ + 1)) E) : (v * Y) (𝔰.indexX₀ i) b = (η * Y) i b := |
| 287 | rfl |
| 288 | simp only [hu_eq, Matrix.add_mul, Matrix.sub_mul, Matrix.smul_mul, Matrix.mul_assoc, |
| 289 | Matrix.one_mul, h_products] |
| 290 | rw [Matrix.add_apply, Matrix.smul_apply, Matrix.sub_apply, hx, Matrix.add_apply, hx, hv, |
| 291 | Matrix.sub_apply, Matrix.smul_apply, zero_sub, add_zero, smul_neg, ← sub_eq_add_neg] |
| 292 | rfl |
| 293 | |
| 294 | omit [HasPrimitiveRoot5040 E] in |
| 295 | /-- The middle part of the frame of the translate by class representatives `h_c⁻¹ γ h_c'`, in the |
| 296 | coordinates of the lattice of the class `c`: the part in `X₀` is carried over by `S.classCoordX₀ c`, |
| 297 | and the part along `z` stays. -/ |
| 298 | lemma frameMiddle_translateByClassReps (c c' : S.Classes) (γ : S.G E) : |
| 299 | frameMiddle (S.translateByClassReps c c' γ).val.val = |
| 300 | (S.classCoordX₀ c).fromCols (fromRows 0 (1 : Matrix Unit Unit (𝔸f E))) * |
| 301 | finAdeleMatrix (frameMiddle γ.val.val) := by |
| 302 | refine Matrix.ext fun i b ↦ ?_ |
| 303 | simp [frameMiddle, frameImage_translateByClassReps, classCoord_eq_fromBlocks, Matrix.mul_apply] |
| 304 | |
| 305 | omit [HasPrimitiveRoot5040 E] in |
| 306 | /-- The `frameMiddle` of the translate gives the coordinates in `X₀ ⊕ Ez` of the image of the frame |
| 307 | under `γ`, in the basis of the lattice `h_c Λ₀` of `c`. Take the products of these vectors with the |
| 308 | columns of `S.classCoordX₀ c`, using the Gram matrix `S.latticeMiddle (𝔸f E)` of `X₀ ⊕ Ez` in the |
| 309 | lattice basis. They equal the conjugate transpose of `framePartX₀ γ`, the coordinates in `X₀` of |
| 310 | that image, embedded in the finite adeles. -/ |
| 311 | lemma frameMiddle_translateByClassReps_mul_classCoordX₀ (c c' : S.Classes) (γ : S.G E) : |
| 312 | (frameMiddle (S.translateByClassReps c c' γ).val.val)ᴴ * S.latticeMiddle (𝔸f E) * |
| 313 | S.classCoordX₀ c = |
| 314 | (finAdeleMatrix (framePartX₀ γ))ᴴ := by |
| 315 | -- The basis of `X₀` is orthonormal and orthogonal to `z`. |
| 316 | have h_gram : ((S.classCoordX₀ c).fromCols (fromRows 0 (1 : Matrix Unit Unit (𝔸f E))))ᴴ * |
| 317 | S.latticeMiddle (𝔸f E) * S.classCoordX₀ c = (S.ratMiddle (𝔸f E)).toCols₁ := by |
| 318 | simpa only [mul_fromCols, toCols₁_fromCols] using |
| 319 | congrArg Matrix.toCols₁ (gram_classCoordMiddle c) |
| 320 | rw [frameMiddle_translateByClassReps, conjTranspose_mul, |
| 321 | Matrix.mul_assoc _ _ (S.latticeMiddle (𝔸f E)), Matrix.mul_assoc, h_gram] |
| 322 | exact Matrix.ext fun b k ↦ by simp [framePartX₀, middleGram, Matrix.mul_apply, Matrix.one_apply] |
| 323 | |
| 324 | omit [HasPrimitiveRoot5040 E] in |
| 325 | /-- Let `Λ` be the lattice of the class `c`. The parts in `X₀` of two frames of terms over `c` with |
| 326 | the same matrix of products differ by vectors of `Λ ∩ X₀`. -/ |
| 327 | lemma col_framePartX₀_sub_mem {c c' c'' : S.Classes} {s s' : S.ResidueGL} {γ γ' : S.G E} |
| 328 | (h_over : γ ∈ S.termsOver c s c') (h_over' : γ' ∈ S.termsOver c s' c'') |
| 329 | (hZ : S.frameProducts γ' = S.frameProducts γ) (i : Fin (𝔰.ϱ + 1)) : |
| 330 | ((↑) : E → 𝔸f E) ∘ (framePartX₀ γ' - framePartX₀ γ).col i ∈ S.classLatticeX₀ c := by |
| 331 | -- Both frames lie in `Λ`, and they have the same part along `z`. |
| 332 | have hz_eq : γ'.val.val 𝔰.z (𝔰.besselFrame i) = γ.val.val 𝔰.z (𝔰.besselFrame i) := by |
| 333 | simpa [frameProducts_top_apply, S.N_prime.ne_zero] using congrFun₂ hZ 𝔰.top i |
| 334 | intro k |
| 335 | have h_entry : (S.classCoordX₀ c *ᵥ ((↑) : E → 𝔸f E) ∘ (framePartX₀ γ' - framePartX₀ γ).col i) k = |
| 336 | frameMiddle (S.translateByClassReps c c'' γ').val.val k i - |
| 337 | frameMiddle (S.translateByClassReps c c' γ).val.val k i := by |
| 338 | rw [frameMiddle_translateByClassReps, frameMiddle_translateByClassReps] |
| 339 | simp [framePartX₀, hz_eq, Matrix.mul_apply, mulVec, dotProduct, mul_sub] |
| 340 | change (S.classCoordX₀ c *ᵥ ((↑) : E → 𝔸f E) ∘ (framePartX₀ γ' - framePartX₀ γ).col i) k ∈ Ô E |
| 341 | rw [h_entry] |
| 342 | exact sub_mem (termsOver.isIntMatrix_translateByClassReps h_over' _ _) |
| 343 | (termsOver.isIntMatrix_translateByClassReps h_over _ _) |
| 344 | |
| 345 | /-! ## Lifts of a lattice -/ |
| 346 | |
| 347 | /-- Let `L` be the lattice with the basis `y a`, where `y` is rational and `a` is adelic, let |
| 348 | `e_1, …, e_ϱ` be the basis of the isotropic space `A` and of the lattice `Λ ∩ A`, and let `M = S.M`. |
| 349 | The matrix `w` gives a linear map from `L` to `M (Λ ∩ A)`, namely `y t ↦ M ∑ e_i (w t)_i`, such that |
| 350 | each vector of `L` plus its image is orthogonal to the frame of `γ`. -/ |
| 351 | structure IsLift {r : ℕ} (γ : S.G E) (y : Matrix 𝔰.κ (Fin r) E) (a : GL (Fin r) (𝔸f E)) |
| 352 | (w : Matrix (Fin 𝔰.ϱ) (Fin r) E) : Prop where |
| 353 | /-- The map takes the basis `y a` into `M (Λ ∩ A)`. -/ |
| 354 | isIntMatrix : IsIntMatrix (Ô E) (finAdeleMatrix w * a.val) |
| 355 | /-- The lifted vectors are orthogonal to the frame of `γ`. -/ |
| 356 | orthogonal : (framePartX₀ γ)ᴴ * y + (S.M : E) • ((isotropicRows (S.frameProducts γ))ᴴ * w) = 0 |
| 357 | |
| 358 | omit [HasPrimitiveRoot5040 E] in |
| 359 | /-- The lattice `L_γ = S.termLattice c c' γ` consists of the vectors `v` of `Λ ∩ X₀` such that some |
| 360 | vector of `v + M (Λ ∩ A)` is orthogonal to the frame of `γ`. If the lattice spanned by the columns |
| 361 | of `y a` lies in `L_γ`, then it has a rational lift: a linear map to `M (Λ ∩ A)`, given by a |
| 362 | rational matrix `w`, such that each vector plus its image is orthogonal to the frame of `γ`. -/ |
| 363 | lemma exists_isLift {c c' : S.Classes} {γ : S.G E} {r : ℕ} {y : Matrix 𝔰.κ (Fin r) E} |
| 364 | {a : GL (Fin r) (𝔸f E)} |
| 365 | (h_le : colLattice (Ô E) (finAdeleMatrix y * a.val) ≤ S.termLattice c c' γ) : |
| 366 | ∃ w : Matrix (Fin 𝔰.ϱ) (Fin r) E, IsLift γ y a w := by |
| 367 | -- By the definition of `L_γ`, each vector of the basis `y a` has a lift over the finite adeles. |
| 368 | let lift : Matrix (Fin (𝔰.ϱ + 1)) (Fin 𝔰.ϱ) E := (S.M : E) • (isotropicRows (S.frameProducts γ))ᴴ |
| 369 | obtain ⟨W, hW_int, hW⟩ : ∃ W : Matrix (Fin 𝔰.ϱ) (Fin r) (𝔸f E), IsIntMatrix (Ô E) W ∧ |
| 370 | finAdeleMatrix lift * W = |
| 371 | (finAdeleMatrix (framePartX₀ γ))ᴴ * (finAdeleMatrix y * a.val) := by |
| 372 | refine exists_isIntMatrix_mul_eq (colLattice_le fun k ↦ ?_) |
| 373 | have h_lift : finAdeleMatrix lift = |
| 374 | S.ideleM • (isotropicRows (finAdeleMatrix (S.frameProducts γ)))ᴴ := by |
| 375 | ext b i |
| 376 | simp [lift, Units.smul_def, ideleM_val] |
| 377 | obtain ⟨-, h_mem⟩ := h_le (col_mem_colLattice k) |
| 378 | rwa [frameGram_translateByClassReps, frameMiddle_translateByClassReps_mul_classCoordX₀, |
| 379 | ← colLattice_smul, ← h_lift] at h_mem |
| 380 | -- The lifts solve a rational linear system, so there is a rational one near `-W a⁻¹`. |
| 381 | obtain ⟨w, hw_int, hw⟩ : ∃ w : Matrix (Fin 𝔰.ϱ) (Fin r) E, |
| 382 | IsIntMatrix (Ô E) (finAdeleMatrix w * a.val) ∧ lift * w = -((framePartX₀ γ)ᴴ * y) := by |
| 383 | refine exists_mul_eq_of_finAdeleMatrix_mul_eq (U := {s | IsIntMatrix (Ô E) (s * a.val)}) |
| 384 | (isOpen_Ô.matrix.preimage (by fun_prop)) (s := -(W * a⁻¹.val)) |
| 385 | (by simpa [Matrix.mul_assoc] using hW_int.neg) ?_ |
| 386 | rw [Matrix.mul_neg, ← Matrix.mul_assoc, hW] |
| 387 | simp [Matrix.mul_assoc, finAdeleMatrix_conjTranspose, Matrix.map_neg] |
| 388 | exact ⟨w, hw_int, by rw [← Matrix.smul_mul, hw, add_neg_cancel]⟩ |
| 389 | |
| 390 | /-- Let `E` contain a primitive 5040th root of unity. Let `L ⊆ Λ ∩ X₀` have the basis `B = y a`, |
| 391 | where `Λ` is the lattice of the class `c` and the columns of `y` are independent. The lattice |
| 392 | spanned by the rows of `Bᴴ B` has the index `(disc L) ^ 2` in the integral rows: this is the index |
| 393 | of `L` in its dual. -/ |
| 394 | lemma submoduleIndex_gram_eq_discriminant_sq {c : S.Classes} {r : ℕ} {y : Matrix 𝔰.κ (Fin r) E} |
| 395 | {a : GL (Fin r) (𝔸f E)} (hy : HasLeftInv y) |
| 396 | (h_le : colLattice (Ô E) (finAdeleMatrix y * a.val) ≤ S.classLatticeX₀ c) : |
| 397 | (submoduleIndex (colLattice (Ô E) ((finAdeleMatrix y * a.val)ᴴ * (finAdeleMatrix y * a.val))ᵀ) |
| 398 | (intVectors (Ô E) (Fin r)) : ℝ) = |
| 399 | discriminant r (colLattice (Ô E) (finAdeleMatrix y * a.val)) ^ 2 := by |
| 400 | have h_int : IsIntMatrix (Ô E) (S.classCoordX₀ c * (finAdeleMatrix y * a.val)) := |
| 401 | colLattice_le_preimageLattice_iff.1 h_le |
| 402 | exact submoduleIndex_colLattice_gram_transpose hy a |
| 403 | (isIntMatrix_conjTranspose_mul_of_classCoordX₀ h_int h_int) |
| 404 | |
| 405 | omit [HasPrimitiveRoot5040 E] in |
| 406 | /-- Let `Λ` be the lattice of the class `c`, and let `L ⊆ Λ ∩ X₀` have the basis `m = y a`, where |
| 407 | the columns of the rational matrix `y` are independent. Let `w` be a rational matrix such that each |
| 408 | row of `w a` is an integral combination of the rows of the Gram matrix `mᴴ m`; that is, the map |
| 409 | `y t ↦ w t` is given by products with vectors of `L` over the finite adeles. Then it is given by the |
| 410 | products with a row `η` of rational vectors of `Λ ∩ X₀`. -/ |
| 411 | lemma exists_conjTranspose_mul_eq_of_row_mem {c : S.Classes} {r : ℕ} {y : Matrix 𝔰.κ (Fin r) E} |
| 412 | {a : GL (Fin r) (𝔸f E)} {w : Matrix (Fin 𝔰.ϱ) (Fin r) E} (hy : HasLeftInv y) |
| 413 | (h_le : colLattice (Ô E) (finAdeleMatrix y * a.val) ≤ S.classLatticeX₀ c) |
| 414 | (h_rows : ∀ i : Fin 𝔰.ϱ, (finAdeleMatrix w * a.val) i ∈ |
| 415 | colLattice (Ô E) ((finAdeleMatrix y * a.val)ᴴ * (finAdeleMatrix y * a.val))ᵀ) : |
| 416 | ∃ η : Matrix 𝔰.κ (Fin 𝔰.ϱ) E, |
| 417 | IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix η) ∧ ηᴴ * y = w := by |
| 418 | -- The row `η = y (yᴴ y)⁻¹ wᴴ` is rational and has the products `w`. If `w a = tᴴ mᴴ m` with `t` |
| 419 | -- integral, then `η = m t` over the finite adeles, so `η` lies in `L`. |
| 420 | let m : Matrix 𝔰.κ (Fin r) (𝔸f E) := finAdeleMatrix y * a.val |
| 421 | have h_unit : IsUnit (yᴴ * y).det := (det_gram_ne_zero hy).isUnit |
| 422 | obtain ⟨T, hT_int, hT⟩ : ∃ T : Matrix (Fin r) (Fin 𝔰.ϱ) (𝔸f E), |
| 423 | IsIntMatrix (Ô E) T ∧ (mᴴ * m)ᵀ * T = (finAdeleMatrix w * a.val)ᵀ := |
| 424 | exists_isIntMatrix_mul_eq (colLattice_le h_rows) |
| 425 | let t : Matrix (Fin r) (Fin 𝔰.ϱ) (𝔸f E) := Tᵀᴴ |
| 426 | have h_products : finAdeleMatrix w = (m * t)ᴴ * finAdeleMatrix y := by |
| 427 | refine a.val.mul_left_inj_of_invertible.1 ?_ |
| 428 | rw [← transpose_transpose (finAdeleMatrix w * a.val), ← hT, transpose_mul, transpose_transpose, |
| 429 | conjTranspose_mul m, conjTranspose_conjTranspose, Matrix.mul_assoc, Matrix.mul_assoc] |
| 430 | let η : Matrix 𝔰.κ (Fin 𝔰.ϱ) E := y * (yᴴ * y)⁻¹ * wᴴ |
| 431 | have h_adelic : finAdeleMatrix η = m * t := |
| 432 | calc finAdeleMatrix η |
| 433 | = finAdeleMatrix (y * (yᴴ * y)⁻¹) * ((finAdeleMatrix y)ᴴ * (m * t)) := by |
| 434 | rw [finAdeleMatrix_mul, finAdeleMatrix_conjTranspose w, h_products, conjTranspose_mul, |
| 435 | conjTranspose_conjTranspose] |
| 436 | _ = finAdeleMatrix (y * ((yᴴ * y)⁻¹ * (yᴴ * y))) * a.val * t := by |
| 437 | -- regroup, as `m = y a` |
| 438 | simp only [m, Matrix.map_mul, finAdeleMatrix_conjTranspose, Matrix.mul_assoc] |
| 439 | _ = m * t := by rw [nonsing_inv_mul _ h_unit, Matrix.mul_one] |
| 440 | refine ⟨η, ?_, ?_⟩ |
| 441 | · rw [h_adelic, ← Matrix.mul_assoc] |
| 442 | exact (colLattice_le_preimageLattice_iff.1 h_le).mul hT_int.transpose.conjTranspose |
| 443 | · simp [η, conjTranspose_nonsing_inv, Matrix.mul_assoc, nonsing_inv_mul _ h_unit] |
| 444 | |
| 445 | /-- Let `L ⊆ Λ ∩ X₀` have the basis `m = y a`, with `Λ` the lattice of the class `c` and the columns |
| 446 | of `y` independent. Let `M = S.M` be the congruence level, let `Ξ₀` be the first `ϱ` rows of the |
| 447 | matrix of products of the standard frame with its image under `γ`, and write `F(γ) = framePartX₀ γ` |
| 448 | for the coordinates in `X₀` of that image. Let `w` be a lift of `L` for `γ`: the matrix `w a` is |
| 449 | integral and `F(γ)ᴴ y + M Ξ₀ᴴ w = 0`. Let each row of `w' a - w a` be an integral combination of the |
| 450 | rows of `mᴴ m`. Then `F(u γ)ᴴ y = -M Ξ₀ᴴ w'` for some move `u ∈ S.classUnipotent₀ c`. -/ |
| 451 | lemma IsLift.exists_conjTranspose_framePartX₀_mul_eq_neg {c : S.Classes} {r : ℕ} |
| 452 | {y : Matrix 𝔰.κ (Fin r) E} {γ : S.G E} {a : GL (Fin r) (𝔸f E)} |
| 453 | {w w' : Matrix (Fin 𝔰.ϱ) (Fin r) E} |
| 454 | (hw : IsLift γ y a w) (hy : HasLeftInv y) |
| 455 | (h_le : colLattice (Ô E) (finAdeleMatrix y * a.val) ≤ S.classLatticeX₀ c) |
| 456 | (h_congr : ∀ i : Fin 𝔰.ϱ, (finAdeleMatrix w' * a.val) i - (finAdeleMatrix w * a.val) i ∈ |
| 457 | colLattice (Ô E) ((finAdeleMatrix y * a.val)ᴴ * (finAdeleMatrix y * a.val))ᵀ) : |
| 458 | ∃ u ∈ S.classUnipotent₀ c, |
| 459 | (framePartX₀ (u * γ))ᴴ * y = -((S.M : E) • ((isotropicRows (S.frameProducts γ))ᴴ * w')) := by |
| 460 | have h_sub : finAdeleMatrix (w' - w) = finAdeleMatrix w' - finAdeleMatrix w := |
| 461 | Matrix.map_sub _ (map_sub (algebraMap E (𝔸f E))) w' w |
| 462 | obtain ⟨η, hη, h_product⟩ : ∃ η : Matrix 𝔰.κ (Fin 𝔰.ϱ) E, |
| 463 | IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix η) ∧ ηᴴ * y = w' - w := by |
| 464 | refine exists_conjTranspose_mul_eq_of_row_mem hy h_le fun i ↦ ?_ |
| 465 | rw [h_sub, Matrix.sub_mul] |
| 466 | exact h_congr i |
| 467 | obtain ⟨u, hu, h_moved⟩ : ∃ u ∈ S.classUnipotent₀ c, ∀ γ : S.G E, |
| 468 | framePartX₀ (u * γ) = framePartX₀ γ - (S.M : E) • (η * isotropicRows (S.frameProducts γ)) := |
| 469 | exists_framePartX₀_mul_eq_sub_smul c hη |
| 470 | have h_orth : (framePartX₀ γ)ᴴ * y = -((S.M : E) • ((isotropicRows (S.frameProducts γ))ᴴ * w)) := |
| 471 | eq_neg_of_add_eq_zero_left hw.orthogonal |
| 472 | refine ⟨u, hu, ?_⟩ |
| 473 | calc (framePartX₀ (u * γ))ᴴ * y |
| 474 | = (framePartX₀ γ)ᴴ * y - (S.M : E) • ((isotropicRows (S.frameProducts γ))ᴴ * (ηᴴ * y)) := by |
| 475 | simp [h_moved, Matrix.sub_mul, Matrix.mul_assoc] |
| 476 | _ = -((S.M : E) • ((isotropicRows (S.frameProducts γ))ᴴ * w')) := by |
| 477 | rw [h_orth, h_product, Matrix.mul_sub, smul_sub] |
| 478 | abel |
| 479 | |
| 480 | /-! ## The lattice orthogonal to `L` -/ |
| 481 | |
| 482 | /-- The lattice `P = Λ ∩ X₀ ∩ L^⊥`, where `Λ` is the lattice of the class `c` and the columns of `y` |
| 483 | span the same space as `L`. -/ |
| 484 | noncomputable def complementLattice (S : Filling E 𝔰) {r : ℕ} (c : S.Classes) |
| 485 | (y : Matrix 𝔰.κ (Fin r) E) : Submodule (Ô E) (𝔰.κ → 𝔸f E) := |
| 486 | saturatedLattice (S.gram_classCoordX₀ c) (LinearMap.ker yᴴ.mulVecLin) |
| 487 | |
| 488 | /-- Let `Λ` be the lattice of the class `c`. A rational vector of `Λ ∩ X₀` that is orthogonal to the |
| 489 | columns of `y` lies in the lattice `P = complementLattice c y`. -/ |
| 490 | lemma coe_mem_complementLattice {c : S.Classes} {r : ℕ} {y : Matrix 𝔰.κ (Fin r) E} {v : 𝔰.κ → E} |
| 491 | (h_orthogonal : yᴴ *ᵥ v = 0) (hv : ((↑) : E → 𝔸f E) ∘ v ∈ S.classLatticeX₀ c) : |
| 492 | ((↑) : E → 𝔸f E) ∘ v ∈ S.complementLattice c y := |
| 493 | coe_mem_saturatedLattice (S.gram_classCoordX₀ c) h_orthogonal hv |
| 494 | |
| 495 | /-- Let `Λ` be the lattice of the class `c`, and let `P` be the lattice of the vectors of `Λ ∩ X₀` |
| 496 | orthogonal to the columns of `y`. If these `r` columns are independent and `r + l = k`, then `P` has |
| 497 | the rank `l`: for a finite idele `d` in `Ô`, the index of `d P` in `P` is `[d] ^ l`, where `[d]` is |
| 498 | the generalised index. -/ |
| 499 | lemma submoduleIndex_smul_complementLattice {c : S.Classes} {r : ℕ} {y : Matrix 𝔰.κ (Fin r) E} |
| 500 | {l : ℕ} (hy : HasLeftInv y) (h_rank : r + l = 𝔰.k) {d : (𝔸f E)ˣ} (hd : d.val ∈ Ô E) : |
| 501 | (submoduleIndex (d • S.complementLattice c y) (S.complementLattice c y) : ℝ) = |
| 502 | genIndex d.val ^ l := by |
| 503 | rw [complementLattice, submoduleIndex_smul_saturatedLattice _ _ hd, |
| 504 | finrank_ker_conjTranspose h_rank hy] |
| 505 | |
| 506 | /-! ## Congruent parts in `X₀` -/ |
| 507 | |
| 508 | variable {c : S.Classes} {j : Fin (𝔰.ϱ + 2)} {γ γ' : S.G E} |
| 509 | |
| 510 | omit [HasPrimitiveRoot5040 E] in |
| 511 | /-- Let `γ` and `γ'` have the same matrix `Z` of products of the standard frame with its image, and |
| 512 | the cell rank `j`. For `γ` this means, with `D_i` the leading minor of order `i` of `Z`: for some |
| 513 | `t` with `t star t = 1` and every index `a ≥ j`, the flags of the frame and of its image share a |
| 514 | vector with leading coefficients `t` and `1` at `a`; `D_j ≠ 0`; and |
| 515 | `S.termDisc γ = |D_{ϱ+1}|² - N² |D_ϱ|²`, with `N = S.N`, is nonzero exactly when `j = ϱ + 1`. Let |
| 516 | `Y` be the first `j` rows of `Z` completed by rows of `1`, and let `v` be the difference of the |
| 517 | coordinates in `X₀` of the two images of the frame. The last column and the columns `k ≥ j` of |
| 518 | `v Y⁻¹` have length below `1` under the complex embedding `Φ w` of every infinite place `w`, as each |
| 519 | is the difference of two vectors of squared length at most `1/5`. -/ |
| 520 | lemma HasCellRank.sum_norm_sq_sub_mul_inv_lt_one (hγ : S.HasCellRank j γ) |
| 521 | (hγ' : S.HasCellRank j γ') (hZ : S.frameProducts γ' = S.frameProducts γ) {k : Fin (𝔰.ϱ + 1)} |
| 522 | (hk : j.val ≤ k.val ∨ k = 𝔰.top) (w : InfinitePlace E) : |
| 523 | ∑ i : 𝔰.κ, ‖Φ w (((framePartX₀ γ' - framePartX₀ γ) * |
| 524 | (paddedLeading j (S.frameProducts γ))⁻¹) i k)‖ ^ 2 < 1 := by |
| 525 | let y (g : S.G E) (i : 𝔰.κ) : E := |
| 526 | (frameImage g.val.val *ᵥ (paddedLeading j (S.frameProducts γ))⁻¹.col k) (𝔰.indexX₀ i) |
| 527 | have hk_top : k.val < j.val → k = 𝔰.top := fun h_lt ↦ hk.resolve_left h_lt.not_ge |
| 528 | have h_short : 5 * ∑ i : 𝔰.κ, ‖Φ w (y γ i)‖ ^ 2 ≤ 1 := |
| 529 | (hγ.mulVec_eStar_eq_zero_and_sum_indexX₀_le k hk_top).right w |
| 530 | have h_short' : 5 * ∑ i : 𝔰.κ, ‖Φ w (y γ' i)‖ ^ 2 ≤ 1 := by |
| 531 | simpa only [y, hZ] using (hγ'.mulVec_eStar_eq_zero_and_sum_indexX₀_le k hk_top).right w |
| 532 | have h_col (i : 𝔰.κ) : ((framePartX₀ γ' - framePartX₀ γ) * |
| 533 | (paddedLeading j (S.frameProducts γ))⁻¹) i k = y γ' i - y γ i := by |
| 534 | rw [Matrix.sub_mul] |
| 535 | rfl |
| 536 | calc ∑ i : 𝔰.κ, ‖Φ w (((framePartX₀ γ' - framePartX₀ γ) * |
| 537 | (paddedLeading j (S.frameProducts γ))⁻¹) i k)‖ ^ 2 |
| 538 | = ∑ i : 𝔰.κ, ‖Φ w (y γ' i) - Φ w (y γ i)‖ ^ 2 := by simp only [h_col, map_sub] |
| 539 | _ ≤ ∑ i : 𝔰.κ, 2 * (‖Φ w (y γ' i)‖ ^ 2 + ‖Φ w (y γ i)‖ ^ 2) := by |
| 540 | grw [norm_sub_le, add_sq_le] |
| 541 | _ < 1 := by |
| 542 | rw [← Finset.mul_sum, Finset.sum_add_distrib] |
| 543 | linarith |
| 544 | |
| 545 | omit [HasPrimitiveRoot5040 E] in |
| 546 | /-- Let `E` contain a primitive 5040th root of unity, and let `S` have the congruence level |
| 547 | `M = S.M`. Let `γ` and `γ'` have the same integral matrix `Z = S.frameProducts γ` of products of the |
| 548 | standard frame with its image, with the leading minor `δ` of order `j`. Let both have the cell rank |
| 549 | `j`: the flags of the frame and of its image share vectors at all indices from `j` on, up to a |
| 550 | number of norm one, `δ ≠ 0`, and `S.termDisc`, formed from the last two leading minors of `Z`, is |
| 551 | nonzero exactly when `j = ϱ + 1`. Let the idele `d` be the number `M δ`. If the coordinates in `X₀` |
| 552 | of the images of the frame under `γ'` and `γ` (`framePartX₀`) are congruent modulo `d (Λ ∩ X₀)`, |
| 553 | with `Λ` the lattice of the class `c`, then they differ by `M η Ξ₀`, where the columns of `η` are |
| 554 | rational vectors of `Λ ∩ X₀` and `Ξ₀` consists of the first `ϱ` rows of `Z`. -/ |
| 555 | lemma HasCellRank.exists_framePartX₀_sub_eq {d : (𝔸f E)ˣ} (hγ : S.HasCellRank j γ) |
| 556 | (hγ' : S.HasCellRank j γ') (hZ : S.frameProducts γ' = S.frameProducts γ) |
| 557 | (hd : d.val = ((S.M * leadingMinor (S.frameProducts γ) j : E) : 𝔸f E)) |
| 558 | (hZ_int : ∀ a b : Fin (𝔰.ϱ + 1), IsIntegral ℤ (S.frameProducts γ a b)) |
| 559 | (h_congr : ∀ i : Fin (𝔰.ϱ + 1), |
| 560 | ((↑) : E → 𝔸f E) ∘ (framePartX₀ γ' - framePartX₀ γ).col i ∈ d • S.classLatticeX₀ c) : |
| 561 | ∃ η : Matrix 𝔰.κ (Fin 𝔰.ϱ) E, IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix η) ∧ |
| 562 | framePartX₀ γ' - framePartX₀ γ = (S.M : E) • (η * isotropicRows (S.frameProducts γ)) := by |
| 563 | -- Let `v` be the difference and `Y` the first `j` rows of `Z` completed by rows of `1`. Then |
| 564 | -- `v Y⁻¹ = M η'` with the columns of `η'` in `Λ ∩ X₀`. The last column and the columns `k ≥ j` of |
| 565 | -- `M η'` are so short that they vanish. |
| 566 | set Y : Matrix (Fin (𝔰.ϱ + 1)) (Fin (𝔰.ϱ + 1)) E := paddedLeading j (S.frameProducts γ) |
| 567 | set v : Matrix 𝔰.κ (Fin (𝔰.ϱ + 1)) E := framePartX₀ γ' - framePartX₀ γ |
| 568 | have hM_ne : (S.M : E) ≠ 0 := Nat.cast_ne_zero.2 (zero_lt_two.trans_le two_le_M).ne' |
| 569 | have hδ : Y.det = leadingMinor (S.frameProducts γ) j := det_paddedLeading |
| 570 | have h_det : Y.det ≠ 0 := hδ.trans_ne hγ.leadingMinor_ne_zero |
| 571 | rw [← hδ] at hd |
| 572 | let η' : Matrix 𝔰.κ (Fin (𝔰.ϱ + 1)) E := (S.M * Y.det)⁻¹ • v * Y.adjugate |
| 573 | have hη' : IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix η') := by |
| 574 | rw [finAdeleMatrix_mul, ← Matrix.mul_assoc] |
| 575 | exact (isIntMatrix_mul_finAdeleMatrix_inv_smul (mul_ne_zero hM_ne h_det) hd h_congr).mul |
| 576 | (isIntMatrix_paddedLeading hZ_int).adjugate |
| 577 | have h_inv : v * Y⁻¹ = (S.M : E) • η' := by |
| 578 | simp only [η', Matrix.inv_def, Ring.inverse_eq_inv', Matrix.mul_smul, Matrix.smul_mul, |
| 579 | smul_smul, mul_inv, mul_inv_cancel_left₀ hM_ne] |
| 580 | have h_int : IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix (v * Y⁻¹)) := by |
| 581 | simpa [h_inv, finAdeleMatrix_smul] using hη'.smul (natCast_mem (Ô E) S.M) |
| 582 | have h_zero (i : 𝔰.κ) (k : Fin (𝔰.ϱ + 1)) (hk : j.val ≤ k.val ∨ k = 𝔰.top) : η' i k = 0 := by |
| 583 | have h_col : (v * Y⁻¹).col k = 0 := |
| 584 | col_eq_zero_of_norm_lt_one h_int (hγ.sum_norm_sq_sub_mul_inv_lt_one hγ' hZ hk) |
| 585 | rw [h_inv] at h_col |
| 586 | exact (smul_eq_zero_iff_right hM_ne).1 (congrFun h_col i) |
| 587 | refine ⟨η'.submatrix id Fin.castSucc, fun r i ↦ hη' r i.castSucc, ?_⟩ |
| 588 | calc v = v * Y⁻¹ * Y := (Y.nonsing_inv_mul_cancel_right v h_det.isUnit).symm |
| 589 | _ = (S.M : E) • (η'.submatrix id Fin.castSucc * isotropicRows (S.frameProducts γ)) := by |
| 590 | rw [h_inv, Matrix.smul_mul, mul_paddedLeading_eq_submatrix_mul_isotropicRows h_zero] |
| 591 | |
| 592 | /-- Let `γ` and `γ'` have the same matrix `Z = S.frameProducts γ`, with integral entries, of |
| 593 | hermitian products of the standard frame `(e₁, …, e_ϱ, z)` with its image under `γ`, and let `δ` be |
| 594 | the leading minor of `Z` of order `j`. Let both have cell rank `j` (`S.HasCellRank j`): the flags of |
| 595 | the frame and of its image share vectors at all indices from `j` on, up to a number of norm one, |
| 596 | `δ ≠ 0`, and `S.termDisc`, formed from the last two leading minors of `Z`, is nonzero exactly when |
| 597 | `j = ϱ + 1`. Let the idele `d` equal `M δ`. Suppose the coordinates in the definite summand `X₀` of |
| 598 | the images of the frame under `γ'` and `γ` (`framePartX₀`) are congruent modulo `d (Λ ∩ X₀)`. Then |
| 599 | `framePartX₀ (u γ') = framePartX₀ γ` for some `u ∈ S.classUnipotent₀ c`. -/ |
| 600 | lemma HasCellRank.exists_framePartX₀_mul_eq_of_sub_mem {d : (𝔸f E)ˣ} (hγ : S.HasCellRank j γ) |
| 601 | (hγ' : S.HasCellRank j γ') (hZ : S.frameProducts γ' = S.frameProducts γ) |
| 602 | (hd : d.val = ((S.M * leadingMinor (S.frameProducts γ) j : E) : 𝔸f E)) |
| 603 | (hZ_int : ∀ a b : Fin (𝔰.ϱ + 1), IsIntegral ℤ (S.frameProducts γ a b)) |
| 604 | (h_congr : ∀ i : Fin (𝔰.ϱ + 1), |
| 605 | ((↑) : E → 𝔸f E) ∘ (framePartX₀ γ' - framePartX₀ γ).col i ∈ d • S.classLatticeX₀ c) : |
| 606 | ∃ u ∈ S.classUnipotent₀ c, framePartX₀ (u * γ') = framePartX₀ γ := by |
| 607 | obtain ⟨η, hη, h_diff⟩ : ∃ η : Matrix 𝔰.κ (Fin 𝔰.ϱ) E, |
| 608 | IsIntMatrix (Ô E) (S.classCoordX₀ c * finAdeleMatrix η) ∧ |
| 609 | framePartX₀ γ' - framePartX₀ γ = (S.M : E) • (η * isotropicRows (S.frameProducts γ)) := |
| 610 | hγ.exists_framePartX₀_sub_eq hγ' hZ hd hZ_int h_congr |
| 611 | obtain ⟨u, hu, h_moved⟩ : ∃ u ∈ S.classUnipotent₀ c, ∀ γ : S.G E, |
| 612 | framePartX₀ (u * γ) = framePartX₀ γ - (S.M : E) • (η * isotropicRows (S.frameProducts γ)) := |
| 613 | exists_framePartX₀_mul_eq_sub_smul c hη |
| 614 | exact ⟨u, hu, by rw [h_moved, hZ, ← h_diff, _root_.sub_sub_cancel]⟩ |
| 615 | |
| 616 | /-! ## The moduli of the second and the third round -/ |
| 617 | |
| 618 | variable [S.IsAdmissible] |
| 619 | |
| 620 | omit [HasPrimitiveRoot5040 E] [S.IsAdmissible] in |
| 621 | /-- An element of `E` whose squared absolute value is at most `b ^ e` at every infinite place has |
| 622 | generalised index at most `b ^ (e f)`, where `b = S.b` and `f` is the number of infinite places. -/ |
| 623 | lemma genIndex_algebraMap_le_pow_of_norm_sq_le {x : E} {e : ℕ} |
| 624 | (h_place : ∀ v : InfinitePlace E, ‖Φ v x‖ ^ 2 ≤ S.b ^ e) : |
| 625 | genIndex (x : 𝔸f E) ≤ S.b ^ (e * numInfPlaces E) := by |
| 626 | grw [genIndex_algebraMap, abs_norm_eq_prod_norm_sq, pow_mul, h_place] |
| 627 | simp |
| 628 | |
| 629 | omit [HasPrimitiveRoot5040 E] [S.IsAdmissible] in |
| 630 | private lemma genIndex_le_of_norm_le_frame_bound {x : E} |
| 631 | (h : ∀ v : InfinitePlace E, ‖Φ v x‖ ≤ S.M * S.b ^ (270 * 𝔰.n ^ 2)) : |
| 632 | genIndex (x : 𝔸f E) ≤ S.b ^ (2 * 𝔰.n ^ 3 * numInfPlaces E) := by |
| 633 | refine genIndex_algebraMap_le_pow_of_norm_sq_le fun v ↦ ?_ |
| 634 | have hb : 0 < S.b := b_pos |
| 635 | calc ‖Φ v x‖ ^ 2 ≤ (S.b ^ 23 * S.b ^ (270 * 𝔰.n ^ 2)) ^ 2 := by grw [h, M_le_b_pow] |
| 636 | _ ≤ S.b ^ (2 * 𝔰.n ^ 3) := by |
| 637 | rw [← pow_add, ← pow_mul] |
| 638 | apply pow_le_pow_right₀ S.one_le_b |
| 639 | have h_cube : 300 * 𝔰.n ^ 2 ≤ 𝔰.n ^ 3 := S.mul_sq_le_cube (by norm_num) |
| 640 | linarith [pow_pos 𝔰.ϱ.succ_pos 2] |
| 641 | |
| 642 | omit [HasPrimitiveRoot5040 E] in |
| 643 | /-- Let `S` be admissible, with size parameter `b = S.b` and `M = S.M`, the product of the two level |
| 644 | primes. Let `ϱ = 𝔰.ϱ` and `n = 𝔰.n = ϱ + 1`, and let `f` be the number of infinite places. Let `γ` |
| 645 | be near: for some archimedean point `y`, both `y` and `γ⁻¹ y` lie in `S.boxedPoints`. Let |
| 646 | `δ = leadingMinor (S.frameProducts γ) j` be the leading minor of order `j ≤ ϱ + 1` of the matrix of |
| 647 | products of the standard frame with its image under `γ`. The generalised index of `M δ`, the |
| 648 | absolute value of its norm to `ℚ`, is at most `b ^ (2 n³ f)`. -/ |
| 649 | lemma IsNear.genIndex_M_mul_leadingMinor_le {γ : S.G E} (j : Fin (𝔰.ϱ + 2)) (h_near : S.IsNear γ) : |
| 650 | genIndex ((S.M * leadingMinor (S.frameProducts γ) j : E) : 𝔸f E) ≤ |
| 651 | S.b ^ (2 * 𝔰.n ^ 3 * numInfPlaces E) := by |
| 652 | refine genIndex_le_of_norm_le_frame_bound fun v ↦ ?_ |
| 653 | simp only [map_mul, map_natCast, norm_mul, Complex.norm_natCast] |
| 654 | gcongr |
| 655 | have hb : 1 ≤ S.b ^ (270 * 𝔰.n ^ 2) := one_le_pow₀ S.one_le_b |
| 656 | exact le_of_sq_le_sq |
| 657 | ((h_near.norm_map_leadingMinor_sq_le j v).trans (le_self_pow₀ hb two_ne_zero)) |
| 658 | (zero_le_one.trans hb) |
| 659 | |
| 660 | omit [S.IsAdmissible] [HasPrimitiveRoot5040 E] in |
| 661 | /-- If `Z` has integral entries, then the modulus `S.frameModulus j Z = M det (Y Yᴴ)` is integral, |
| 662 | where `M = S.M` and `Y` consists of the first `j` rows of `Z` completed by rows of `1`. -/ |
| 663 | lemma frameModulus_mem_integralAdeles_of_isIntegral {j : Fin (𝔰.ϱ + 2)} |
| 664 | {Z : Matrix (Fin (𝔰.ϱ + 1)) (Fin (𝔰.ϱ + 1)) E} |
| 665 | (hZ : ∀ a b : Fin (𝔰.ϱ + 1), IsIntegral ℤ (Z a b)) : |
| 666 | (S.frameModulus j Z : 𝔸f E) ∈ Ô E := by |
| 667 | let O : Subring E := (Ô E).comap (algebraMap E (𝔸f E)) |
| 668 | have : IsStarStable O := isStarStable_comap_Ô |
| 669 | have hY : IsIntMatrix O (paddedLeading j Z) := isIntMatrix_paddedLeading hZ |
| 670 | exact nsmul_mem (hY.mul hY.conjTranspose).det_mem S.M |
| 671 | |
| 672 | omit [HasPrimitiveRoot5040 E] in |
| 673 | /-- Let `S` be admissible, with the size parameter `b = S.b` and the congruence level `M = S.M`, let |
| 674 | `n = ϱ + 1`, and let `f` be the number of infinite places. Let `γ` be near: for some archimedean |
| 675 | point `y`, both `y` and `γ⁻¹ y` lie in `S.boxedPoints`. Let `δ` be the leading minor of any order |
| 676 | `j ≤ ϱ + 1` of the matrix of products of the standard frame with its image under `γ`. The modulus |
| 677 | `S.frameModulus` is `M δ star δ`. Its generalised index, the absolute value of its norm to `ℚ`, is |
| 678 | at most `b ^ (2 n³ f)`. -/ |
| 679 | lemma IsNear.genIndex_frameModulus_le {j : Fin (𝔰.ϱ + 2)} {γ : S.G E} (h_near : S.IsNear γ) : |
| 680 | genIndex (S.frameModulus j (S.frameProducts γ) : 𝔸f E) ≤ |
| 681 | S.b ^ (2 * 𝔰.n ^ 3 * numInfPlaces E) := by |
| 682 | refine genIndex_le_of_norm_le_frame_bound fun v ↦ ?_ |
| 683 | simpa [frameModulus, sq, mul_assoc] using |
| 684 | mul_le_mul_of_nonneg_left (h_near.norm_map_leadingMinor_sq_le j v) (Nat.cast_nonneg S.M) |
| 685 | |
| 686 | end New.Filling |