Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | module |
| 2 | |
| 3 | public import Lib.Weil.Periods.Grading |
| 4 | import Lib.Adelic.Adeles.IdeleModulus |
| 5 | import Lib.Adelic.Unitary.GramMatrix |
| 6 | import Lib.Adelic.Witt.WittTheorem |
| 7 | import Lib.General.LinearAlgebra.HermiteForm |
| 8 | |
| 9 | /-! |
| 10 | # The lattice of a finite point of a graded space |
| 11 | |
| 12 | A finite point `x` of the unitary group of a hermitian space `V` gives a self-dual lattice |
| 13 | `New.Space.lattice` over `Ô`, spanned by the orthonormal frame `V.xFin * x`. A grading |
| 14 | (`New.Grading`) writes `V = X ⊕ X^⊥`, where `X^⊥` is spanned by the string. The lattice has an |
| 15 | intersection `Λ'⁻` with `X^⊥` (`New.Grading.latticeMinus`) and a projection `Λ'⁺` to `X^⊥` |
| 16 | (`New.Grading.latticePlus`); `Λ⁻` is the intersection for the point `1`. |
| 17 | |
| 18 | * `New.Space.mem_lattice_iff_formFin`: the lattice of a point is self-dual. |
| 19 | * `New.Space.lattice_eq_iff`: two points have the same lattice if and only if they differ by an |
| 20 | integral unitary matrix. |
| 21 | * `New.Grading.mem_latticeMinus_iff_formFin`, `New.Grading.mem_latticePlus_iff_formFin`: the |
| 22 | intersection and the projection are dual to each other. |
| 23 | * `New.Grading.exists_lattice_inclXFin_mul_eq`: lattices of points with the same intersection with |
| 24 | `X^⊥` are conjugate under the unitary group of `X`, assuming `[HasPrimitiveRoot5040 E]`. |
| 25 | |
| 26 | Notions from other files: |
| 27 | * `𝔸f E`, `Ô E`: the finite adeles of the CM field `E` and their subring of integral adeles. |
| 28 | * `Gf E ι`, `stdLevel E ι`: the matrices `g` over `𝔸f E` with `gᴴ g = 1`, and those with integral |
| 29 | entries. |
| 30 | * `Space E ι ε`: a Gram matrix `V.J` over `E` with a frame `V.xFin` over `𝔸f E` in which the form is |
| 31 | standard; `V.ratCoordMatrixFin g` is the matrix `V.xFin * g * V.xFin⁻¹`. |
| 32 | * `Grading V N X s`: an identification `Y.indexEquiv` of the basis indices with `X ⊕ Fin s`, for |
| 33 | which the form is standard on `X` and the string of `s` vectors is orthogonal to `X`. |
| 34 | |
| 35 | ## Relation to the literature |
| 36 | |
| 37 | The results are known: duality of lattices, and Witt's theorem for unimodular hermitian lattices. |
| 38 | Sources: O'Meara, Introduction to Quadratic Forms; Jacobowitz, Hermitian forms over local fields |
| 39 | (1962). |
| 40 | -/ |
| 41 | |
| 42 | @[expose] public section |
| 43 | |
| 44 | open Matrix Pointwise |
| 45 | |
| 46 | noncomputable section |
| 47 | |
| 48 | namespace New |
| 49 | |
| 50 | section |
| 51 | |
| 52 | variable {E ι : Type} [Field E] [CMType E] [Fintype ι] [DecidableEq ι] |
| 53 | |
| 54 | omit [Fintype ι] [DecidableEq ι] in |
| 55 | /-- An inclusion `c • A ≤ B` of lattices of finite adelic vectors can be checked on the vectors of |
| 56 | `A`. -/ |
| 57 | lemma smul_le_iff_forall {c : 𝔸f E} {A B : Submodule (Ô E) (ι → 𝔸f E)} : |
| 58 | c • A ≤ B ↔ ∀ y ∈ A, c • y ∈ B := |
| 59 | Submodule.map_le_iff_le_comap |
| 60 | |
| 61 | namespace Space |
| 62 | |
| 63 | variable {ε : ι → ℤˣ} (V : Space E ι ε) |
| 64 | |
| 65 | /-- The lattice of a finite point `x`, in rational coordinates: the vectors whose coordinates in |
| 66 | the frame `V.xFin * x` are integral. -/ |
| 67 | def lattice (x : Gf E ι) : Submodule (Ô E) (ι → 𝔸f E) := |
| 68 | preimageLattice (Ô E) (V.xFin * x.val)⁻¹.val |
| 69 | |
| 70 | /-- The hermitian form of `V` on finite adelic vectors, conjugate linear in the first variable. -/ |
| 71 | def formFin (y z : ι → 𝔸f E) : 𝔸f E := star y ⬝ᵥ V.J.map (algebraMap E (𝔸f E)) *ᵥ z |
| 72 | |
| 73 | variable {V} {x x' g : Gf E ι} {y z : ι → 𝔸f E} |
| 74 | |
| 75 | lemma mem_lattice : y ∈ V.lattice x ↔ ∀ i : ι, ((V.xFin * x.val)⁻¹.val *ᵥ y) i ∈ Ô E := Iff.rfl |
| 76 | |
| 77 | /-- The lattice of `x` consists of the images of the integral vectors in the frame |
| 78 | `V.xFin * x`. -/ |
| 79 | lemma mulVec_mem_lattice : (V.xFin * x.val).val *ᵥ y ∈ V.lattice x ↔ ∀ i : ι, y i ∈ Ô E := by |
| 80 | rw [mem_lattice, mulVec_mulVec, Units.inv_mul, one_mulVec] |
| 81 | |
| 82 | /-- For a finite point `x`, the frame `V.xFin * x` is orthonormal for the form of `V`. -/ |
| 83 | lemma gram_xFin_mul_eq_one (x : Gf E ι) : |
| 84 | (V.xFin * x.val).valᴴ * V.J.map (algebraMap E (𝔸f E)) * (V.xFin * x.val).val = 1 := |
| 85 | gram_mul_of_gram_eq V.gram_xFin (mem_unitaryGroupOf_iff.1 x.property) |
| 86 | |
| 87 | /-- The Gram matrix of `V` is `g⁻¹ᴴ g⁻¹` for the orthonormal frame `g = V.xFin * x`. -/ |
| 88 | lemma gram_frame_inv (x : Gf E ι) : |
| 89 | (V.xFin * x.val)⁻¹.valᴴ * (V.xFin * x.val)⁻¹.val = V.J.map (algebraMap E (𝔸f E)) := by |
| 90 | simpa only [mul_one] using gram_inv_of_gram_eq (gram_xFin_mul_eq_one x) |
| 91 | |
| 92 | /-- For a finite point `x`, the form of `V` is the standard form in the coordinates of the frame |
| 93 | `V.xFin * x`. -/ |
| 94 | lemma formFin_eq_dotProduct (x : Gf E ι) (y z : ι → 𝔸f E) : |
| 95 | V.formFin y z = star ((V.xFin * x.val)⁻¹.val *ᵥ y) ⬝ᵥ (V.xFin * x.val)⁻¹.val *ᵥ z := by |
| 96 | rw [formFin, ← gram_frame_inv x, ← mulVec_mulVec, dotProduct_mulVec, star_mulVec] |
| 97 | |
| 98 | /-- The form of `V` on finite adelic vectors is hermitian. -/ |
| 99 | lemma star_formFin (y z : ι → 𝔸f E) : star (V.formFin y z) = V.formFin z y := by |
| 100 | rw [formFin_eq_dotProduct 1, formFin_eq_dotProduct 1, ← star_dotProduct] |
| 101 | |
| 102 | /-- A scalar moves from the second argument of the form of `V` to the first with a conjugation. -/ |
| 103 | lemma formFin_star_smul (c : 𝔸f E) (y z : ι → 𝔸f E) : |
| 104 | V.formFin y (star c • z) = V.formFin (c • y) z := by |
| 105 | simp only [formFin, mulVec_smul, dotProduct_smul, star_smul, smul_dotProduct] |
| 106 | |
| 107 | /-- The lattice of a point is its own dual: `z` lies in it if and only if its products with all |
| 108 | vectors of the lattice are integral. -/ |
| 109 | lemma mem_lattice_iff_formFin : z ∈ V.lattice x ↔ ∀ y ∈ V.lattice x, V.formFin y z ∈ Ô E := by |
| 110 | simp only [formFin_eq_dotProduct x] |
| 111 | refine ⟨fun hz y hy ↦ ?_, fun h ↦ mem_lattice.2 fun i ↦ ?_⟩ |
| 112 | · exact sum_mem fun i _ ↦ mul_mem (star_mem_Ô (mem_lattice.1 hy i)) (mem_lattice.1 hz i) |
| 113 | · -- The coordinate `i` of `z` is its pairing with the column `i` of the frame. |
| 114 | simpa only [mulVec_mulVec, Units.inv_mul, one_mulVec, Pi.star_single, star_one, |
| 115 | single_one_dotProduct] using h _ (mulVec_mem_lattice.2 (single_mem_intVectors i)) |
| 116 | |
| 117 | /-- The point `g`, acting in rational coordinates, carries the lattice of `x` onto that of |
| 118 | `g x`. -/ |
| 119 | lemma mulVec_mem_lattice_mul : |
| 120 | V.ratCoordMatrixFin g *ᵥ y ∈ V.lattice (g * x) ↔ y ∈ V.lattice x := by |
| 121 | have h_coord : (V.xFin * (g * x).val)⁻¹ * (V.xFin * g.val * V.xFin⁻¹) = (V.xFin * x.val)⁻¹ := by |
| 122 | simp [Gf.coe_mul, mul_assoc] |
| 123 | simp only [mem_lattice, mulVec_mulVec, ratCoordMatrixFin, ← Units.val_mul, h_coord] |
| 124 | |
| 125 | /-- The lattice of `x'` is contained in that of `x` if and only if the change of frame `x⁻¹ * x'` |
| 126 | is integral, that is, lies in `stdLevel E ι`. -/ |
| 127 | lemma lattice_le_iff : V.lattice x' ≤ V.lattice x ↔ x⁻¹ * x' ∈ stdLevel E ι := by |
| 128 | have h_frame : (V.xFin * x.val)⁻¹ = (x⁻¹ * x').val * (V.xFin * x'.val)⁻¹ := by |
| 129 | simp [Gf.coe_mul, Gf.coe_inv, mul_assoc] |
| 130 | refine ⟨fun h ↦ mem_stdLevel.2 fun i j ↦ ?_, fun h y hy ↦ ?_⟩ |
| 131 | · -- The column `j` of the frame of `x'` lies in the lattice of `x`. |
| 132 | have h_column : (V.xFin * x'.val).val *ᵥ Pi.single j 1 ∈ V.lattice x := |
| 133 | h (mulVec_mem_lattice.2 (single_mem_intVectors j)) |
| 134 | rw [mem_lattice, mulVec_mulVec, ← Units.val_mul, h_frame, inv_mul_cancel_right, |
| 135 | mulVec_single_one] at h_column |
| 136 | exact h_column i |
| 137 | · rw [mem_lattice, h_frame, Units.val_mul, ← mulVec_mulVec] |
| 138 | exact IsIntMatrix.mulVec (mem_stdLevel.1 h) hy |
| 139 | |
| 140 | /-- Two points have the same lattice if and only if they differ by an integral unitary matrix. -/ |
| 141 | lemma lattice_eq_iff : V.lattice x = V.lattice x' ↔ x⁻¹ * x' ∈ stdLevel E ι := by |
| 142 | refine ⟨fun h ↦ lattice_le_iff.1 h.ge, fun h ↦ le_antisymm ?_ (lattice_le_iff.2 h)⟩ |
| 143 | simpa [lattice_le_iff] using inv_mem h |
| 144 | |
| 145 | /-- If `g`, acting through its matrix `V.ratCoordMatrixFin g` in rational coordinates, maps the |
| 146 | lattice of `x` into itself, then the conjugate `x⁻¹ g x` lies in the group `stdLevel E ι` of |
| 147 | integral unitary matrices. -/ |
| 148 | lemma conj_mem_stdLevel_of_mapsTo_lattice |
| 149 | (h : ∀ y ∈ V.lattice x, V.ratCoordMatrixFin g *ᵥ y ∈ V.lattice x) : |
| 150 | x⁻¹ * (g * x) ∈ stdLevel E ι := by |
| 151 | refine (lattice_le_iff (V := V)).1 fun z hz ↦ ?_ |
| 152 | obtain ⟨y, rfl⟩ : ∃ y, V.ratCoordMatrixFin g *ᵥ y = z := |
| 153 | ⟨V.ratCoordMatrixFin g⁻¹ *ᵥ z, by simp [ratCoordMatrixFin, Gf.coe_inv, mul_assoc]⟩ |
| 154 | exact h y (mulVec_mem_lattice_mul.1 hz) |
| 155 | |
| 156 | /-- The matrix of a finite point `g` in rational coordinates preserves the Gram matrix of `V`. -/ |
| 157 | lemma ratCoordMatrixFin_isometry (g : Gf E ι) : |
| 158 | (V.ratCoordMatrixFin g)ᴴ * V.J.map (algebraMap E (𝔸f E)) * V.ratCoordMatrixFin g = |
| 159 | V.J.map (algebraMap E (𝔸f E)) := |
| 160 | -- By definition this matrix is `(V.xFin * g) * V.xFin⁻¹`. |
| 161 | gram_mul_of_gram_eq (x := V.xFin * g.val) (gram_xFin_mul_eq_one g) |
| 162 | (gram_inv_of_gram_eq V.gram_xFin) |
| 163 | |
| 164 | end Space |
| 165 | |
| 166 | end |
| 167 | |
| 168 | namespace Grading |
| 169 | |
| 170 | variable {E X ι : Type} [Field E] [CMType E] [Fintype ι] [DecidableEq ι] |
| 171 | [DecidableEq X] {ε : ι → ℤˣ} {s : ℕ} {N : E} {V : Space E ι ε} (Y : Grading V N X s) |
| 172 | |
| 173 | /-- The projection to the span of the basis vectors `i` of grade `d`, that is, with |
| 174 | `Y.gradeOf i = d`, where `Y.gradeOf` is the integer grade that the grading attaches to each |
| 175 | index. -/ |
| 176 | def gradeProj (d : ℤ) : (ι → 𝔸f E) →ₗ[𝔸f E] ι → 𝔸f E := |
| 177 | (diagonal fun i : ι ↦ if Y.gradeOf i = d then 1 else 0).mulVecLin |
| 178 | |
| 179 | /-- The orthogonal projection to `X^⊥`, the span of the string. -/ |
| 180 | def stringProj : (ι → 𝔸f E) →ₗ[𝔸f E] ι → 𝔸f E := |
| 181 | (diagonal fun i : ι ↦ if (Y.indexEquiv.symm i).isRight then 1 else 0).mulVecLin |
| 182 | |
| 183 | /-- A lattice is graded if it contains, for each integer `d`, the part `Y.gradeProj d y` of grade |
| 184 | `d` of each of its vectors `y`. -/ |
| 185 | def IsGraded (L : Submodule (Ô E) (ι → 𝔸f E)) : Prop := ∀ d : ℤ, ∀ y ∈ L, Y.gradeProj d y ∈ L |
| 186 | |
| 187 | /-- The intersection `Λ'⁻` of the lattice of `x` with `X^⊥`. -/ |
| 188 | def latticeMinus (x : Gf E ι) : Submodule (Ô E) (ι → 𝔸f E) := |
| 189 | V.lattice x ⊓ Y.stringProj.range.restrictScalars (Ô E) |
| 190 | |
| 191 | /-- The projection `Λ'⁺` of the lattice of `x` to `X^⊥`. -/ |
| 192 | def latticePlus (x : Gf E ι) : Submodule (Ô E) (ι → 𝔸f E) := |
| 193 | (V.lattice x).map (Y.stringProj.restrictScalars (Ô E)) |
| 194 | |
| 195 | /-- The bounds `q̄ ^ k Λ⁻ ⊆ Λ'⁻` and `q ^ k Λ'⁻ ⊆ Λ⁻`, where `Λ'⁻` and `Λ⁻` are the intersections |
| 196 | with `X^⊥` of the lattices of `x` and of `1`. -/ |
| 197 | structure HasLatticeBounds (q : 𝔸f E) (k : ℕ) (x : Gf E ι) : Prop where |
| 198 | /-- `q̄ ^ k Λ⁻ ⊆ Λ'⁻`. -/ |
| 199 | lower : star q ^ k • Y.latticeMinus 1 ≤ Y.latticeMinus x |
| 200 | /-- `q ^ k Λ'⁻ ⊆ Λ⁻`. -/ |
| 201 | upper : q ^ k • Y.latticeMinus x ≤ Y.latticeMinus 1 |
| 202 | |
| 203 | /-- The orbit of `x` under the finite Bessel subgroup has a point whose lattice is graded and |
| 204 | satisfies the bounds `New.Grading.HasLatticeBounds`. -/ |
| 205 | def HasBoundedOrbit (q : 𝔸f E) (k : ℕ) (x : Gf E ι) : Prop := |
| 206 | ∃ r ∈ Y.besselFin, Y.IsGraded (V.lattice (r * x)) ∧ Y.HasLatticeBounds q k (r * x) |
| 207 | |
| 208 | /-- The finite part of the matrix `Y.stringMap Y'` (the second component of each of its entries), |
| 209 | acting on vectors: the map between two graded spaces that kills `X` and sends each string vector to |
| 210 | a multiple of the string vector with the same number. -/ |
| 211 | def stringMapFin {X' ι' : Type} [Fintype ι'] [DecidableEq ι'] [DecidableEq X'] {ε' : ι' → ℤˣ} |
| 212 | {s' : ℕ} {V' : Space E ι' ε'} (Y' : Grading V' N X' s') : (ι → 𝔸f E) →ₗ[𝔸f E] ι' → 𝔸f E := |
| 213 | ((Y.stringMap Y').map Prod.snd).mulVecLin |
| 214 | |
| 215 | variable {Y} {x x' : Gf E ι} {y z : ι → 𝔸f E} {c : 𝔸f E} |
| 216 | |
| 217 | lemma stringProj_apply_inl (y : ι → 𝔸f E) (a : X) : |
| 218 | Y.stringProj y (Y.indexEquiv (.inl a)) = 0 := by |
| 219 | simp [stringProj, mulVec_diagonal] |
| 220 | |
| 221 | lemma stringProj_apply_inr (y : ι → 𝔸f E) (b : Fin s) : |
| 222 | Y.stringProj y (Y.indexEquiv (.inr b)) = y (Y.indexEquiv (.inr b)) := by |
| 223 | simp [stringProj, mulVec_diagonal] |
| 224 | |
| 225 | /-- A vector is fixed by the projection to `X^⊥` if and only if its coordinates on `X` vanish. -/ |
| 226 | lemma stringProj_eq_self_iff : Y.stringProj y = y ↔ ∀ a : X, y (Y.indexEquiv (.inl a)) = 0 := by |
| 227 | simp [funext_iff, Y.indexEquiv.forall_congr_right.symm, stringProj_apply_inl, |
| 228 | stringProj_apply_inr, eq_comm] |
| 229 | |
| 230 | /-- The projection to `X^⊥` is idempotent. -/ |
| 231 | lemma stringProj_stringProj (y : ι → 𝔸f E) : Y.stringProj (Y.stringProj y) = Y.stringProj y := |
| 232 | stringProj_eq_self_iff.2 (stringProj_apply_inl y) |
| 233 | |
| 234 | /-- A vector lies in the intersection `Λ'⁻` of the lattice of `x` with `X^⊥` if and only if it lies |
| 235 | in the lattice of `x` and is fixed by the projection to `X^⊥`. -/ |
| 236 | lemma mem_latticeMinus : y ∈ Y.latticeMinus x ↔ y ∈ V.lattice x ∧ Y.stringProj y = y := by |
| 237 | simp only [latticeMinus, Submodule.mem_inf, Submodule.restrictScalars_mem, LinearMap.mem_range] |
| 238 | refine and_congr_right fun _ ↦ ⟨?_, fun h ↦ ⟨y, h⟩⟩ |
| 239 | rintro ⟨z, rfl⟩ |
| 240 | exact stringProj_stringProj z |
| 241 | |
| 242 | /-- A vector lies in the projection `Λ'⁺` of the lattice of `x` to `X^⊥` if and only if it is the |
| 243 | projection of a vector of the lattice. -/ |
| 244 | lemma mem_latticePlus : y ∈ Y.latticePlus x ↔ ∃ z ∈ V.lattice x, Y.stringProj z = y := Iff.rfl |
| 245 | |
| 246 | /-- Vectors of the projection `Λ'⁺` are fixed by the projection to `X^⊥`. -/ |
| 247 | lemma stringProj_eq_of_mem_latticePlus (hy : y ∈ Y.latticePlus x) : Y.stringProj y = y := by |
| 248 | obtain ⟨z, -, rfl⟩ := mem_latticePlus.1 hy |
| 249 | exact stringProj_stringProj z |
| 250 | |
| 251 | /-- Multiples of vectors of the projection `Λ'⁺` lie in `X^⊥`. -/ |
| 252 | lemma stringProj_smul_of_mem_latticePlus (hy : y ∈ Y.latticePlus x) : |
| 253 | Y.stringProj (c • y) = c • y := by |
| 254 | rw [map_smul, stringProj_eq_of_mem_latticePlus hy] |
| 255 | |
| 256 | /-- The intersection `Λ'⁻` is contained in the lattice of `x`. -/ |
| 257 | lemma latticeMinus_le_lattice : Y.latticeMinus x ≤ V.lattice x := inf_le_left |
| 258 | |
| 259 | /-- The intersection `Λ'⁻` is contained in the projection `Λ'⁺`. -/ |
| 260 | lemma latticeMinus_le_latticePlus : Y.latticeMinus x ≤ Y.latticePlus x := |
| 261 | fun y hy ↦ mem_latticePlus.2 ⟨y, mem_latticeMinus.1 hy⟩ |
| 262 | |
| 263 | variable [Fintype X] |
| 264 | |
| 265 | /-- The projection to `X^⊥` is self-adjoint for the form of `V`. -/ |
| 266 | lemma formFin_stringProj (y z : ι → 𝔸f E) : |
| 267 | V.formFin (Y.stringProj y) z = V.formFin y (Y.stringProj z) := by |
| 268 | -- The Gram matrix has no entries between `X` and the string. |
| 269 | simp [Space.formFin, Y.gram_eq, gradedGram, dotProduct, mulVec, ← Y.indexEquiv.sum_comp, |
| 270 | stringProj_apply_inl, stringProj_apply_inr, Finset.mul_sum] |
| 271 | |
| 272 | /-- A vector `z` of `X^⊥` lies in the intersection `Λ'⁻` of the lattice of `x` with `X^⊥` if and |
| 273 | only if its products with the projection `Λ'⁺` of this lattice to `X^⊥` are integral. -/ |
| 274 | lemma mem_latticeMinus_iff_formFin (hz : Y.stringProj z = z) : |
| 275 | z ∈ Y.latticeMinus x ↔ ∀ y ∈ Y.latticePlus x, V.formFin y z ∈ Ô E := by |
| 276 | rw [mem_latticeMinus, and_iff_left hz, Space.mem_lattice_iff_formFin] |
| 277 | simp [mem_latticePlus, formFin_stringProj, hz] |
| 278 | |
| 279 | /-- The form of `V` is nondegenerate on `X^⊥`: vectors with the same products against `X^⊥` have the |
| 280 | same projection to `X^⊥`. -/ |
| 281 | lemma stringProj_eq_of_formFin_eq {z' : ι → 𝔸f E} |
| 282 | (h_eq : ∀ y : ι → 𝔸f E, Y.stringProj y = y → V.formFin y z = V.formFin y z') : |
| 283 | Y.stringProj z = Y.stringProj z' := by |
| 284 | -- The Gram matrix is invertible, so it suffices to compare the images under it. |
| 285 | refine mulVec_injective_of_isUnit (V.isUnit_J.map (algebraMap E (𝔸f E)).mapMatrix) (funext |
| 286 | fun i ↦ ?_) |
| 287 | have h_form : V.formFin (Pi.single i 1) (Y.stringProj z) = |
| 288 | V.formFin (Pi.single i 1) (Y.stringProj z') := by |
| 289 | rw [← formFin_stringProj, ← formFin_stringProj, h_eq _ (stringProj_stringProj _)] |
| 290 | simpa [Space.formFin] using h_form |
| 291 | |
| 292 | variable (Y x) in |
| 293 | omit [Fintype X] in |
| 294 | /-- The space `X^⊥` has a basis `B` that is primitive in the lattice of `x`: read in the frame |
| 295 | `V.xFin * x`, the matrix `B` is integral with an integral left inverse. -/ |
| 296 | lemma exists_isPrimitiveMatrix_basis : |
| 297 | ∃ B : Matrix ι (Fin s) (𝔸f E), IsPrimitiveMatrix (Ô E) ((V.xFin * x.val)⁻¹.val * B) ∧ |
| 298 | ∀ y : ι → 𝔸f E, Y.stringProj y = y ↔ ∃ c : Fin s → 𝔸f E, B *ᵥ c = y := by |
| 299 | -- The string vectors form a basis `S`. Some invertible `b` makes the coordinates of `S * b` in |
| 300 | -- the frame of `x` primitive. |
| 301 | let S : Matrix ι (Fin s) (𝔸f E) := inclMatrix (𝔸f E) fun b ↦ Y.indexEquiv (.inr b) |
| 302 | have h_left : Sᵀ * S = 1 := |
| 303 | Matrix.ext fun a b ↦ by simp [S, inclMatrix, Matrix.mul_apply, Matrix.one_apply, eq_comm] |
| 304 | have h_proj (y : ι → 𝔸f E) : Y.stringProj y = S *ᵥ Sᵀ *ᵥ y := funext fun i ↦ by |
| 305 | obtain ⟨a | a, rfl⟩ := Y.indexEquiv.surjective i <;> |
| 306 | simp [S, inclMatrix, mulVec, dotProduct, Matrix.one_apply, stringProj_apply_inl, |
| 307 | stringProj_apply_inr] |
| 308 | have h_inv : HasLeftInv ((V.xFin * x.val)⁻¹.val * S) := |
| 309 | ⟨Sᵀ * (V.xFin * x.val).val, by simpa [Matrix.mul_assoc] using h_left⟩ |
| 310 | obtain ⟨b, -, hb⟩ := isValuationPair_Ô.exists_isPrimitiveMatrix_mul h_inv |
| 311 | refine ⟨S * b.val, by rwa [← Matrix.mul_assoc], fun y ↦ ⟨fun hy ↦ ⟨(b⁻¹.val * Sᵀ) *ᵥ y, |
| 312 | by simpa [h_proj, mulVec_mulVec, Matrix.mul_assoc] using hy⟩, fun ⟨c, hc⟩ ↦ hc ▸ by |
| 313 | simp [h_proj, mulVec_mulVec, ← Matrix.mul_assoc, h_left]⟩⟩ |
| 314 | |
| 315 | /-- A vector `z` of `X^⊥` lies in the projection `Λ'⁺` of the lattice of `x` to `X^⊥` if and only |
| 316 | if its products with the intersection `Λ'⁻` of this lattice with `X^⊥` are integral. -/ |
| 317 | lemma mem_latticePlus_iff_formFin (hz : Y.stringProj z = z) : |
| 318 | z ∈ Y.latticePlus x ↔ ∀ y ∈ Y.latticeMinus x, V.formFin y z ∈ Ô E := by |
| 319 | refine ⟨fun hz_mem y hy ↦ ?_, fun h ↦ ?_⟩ |
| 320 | · rw [← Space.star_formFin] |
| 321 | exact star_mem_Ô ((mem_latticeMinus_iff_formFin (mem_latticeMinus.1 hy).right).1 hy z hz_mem) |
| 322 | -- The products `t` of `z` with a primitive basis `B` of `X^⊥` are integral. An integral left |
| 323 | -- inverse `L` of `g⁻¹ B`, for the frame `g` of `x`, gives a vector `w` of the lattice with |
| 324 | -- the same products. |
| 325 | obtain ⟨B, hB, hB_span : ∀ y : ι → 𝔸f E, Y.stringProj y = y ↔ ∃ c : Fin s → 𝔸f E, B *ᵥ c = y⟩ := |
| 326 | Y.exists_isPrimitiveMatrix_basis x |
| 327 | set g : GL ι (𝔸f E) := V.xFin * x.val |
| 328 | obtain ⟨hB_int : IsIntMatrix (Ô E) (g⁻¹.val * B), L, hL_int : IsIntMatrix (Ô E) L, |
| 329 | hLB : L * (g⁻¹.val * B) = 1⟩ := hB |
| 330 | let J : Matrix ι ι (𝔸f E) := V.J.map (algebraMap E (𝔸f E)) |
| 331 | have h_basis (c : Fin s → 𝔸f E) (w : ι → 𝔸f E) : |
| 332 | V.formFin (B *ᵥ c) w = star c ⬝ᵥ (Bᴴ * J) *ᵥ w := by |
| 333 | rw [Space.formFin, star_mulVec, ← dotProduct_mulVec, mulVec_mulVec] |
| 334 | let t : Fin s → 𝔸f E := (Bᴴ * J) *ᵥ z |
| 335 | have ht : t ∈ intVectors (Ô E) (Fin s) := fun j ↦ by |
| 336 | have h_col : B *ᵥ Pi.single j 1 ∈ Y.latticeMinus x := by |
| 337 | rw [mem_latticeMinus, Space.mem_lattice, mulVec_mulVec] |
| 338 | exact ⟨hB_int.mulVec (single_mem_intVectors j), (hB_span _).2 ⟨Pi.single j 1, rfl⟩⟩ |
| 339 | simpa only [h_basis, Pi.star_single, star_one, single_one_dotProduct] using h _ h_col |
| 340 | let w : ι → 𝔸f E := g.val *ᵥ Lᴴ *ᵥ t |
| 341 | have hw : w ∈ V.lattice x := Space.mulVec_mem_lattice.2 (hL_int.conjTranspose.mulVec ht) |
| 342 | have h_gram : g⁻¹.valᴴ * g⁻¹.val = J := Space.gram_frame_inv x |
| 343 | have h_adj : Bᴴ * J * g.val * Lᴴ = 1 := |
| 344 | calc _ = Bᴴ * (g⁻¹.valᴴ * (g⁻¹.val * g.val * Lᴴ)) := by simp only [← h_gram, Matrix.mul_assoc] |
| 345 | _ = (L * (g⁻¹.val * B))ᴴ := by simp [Matrix.mul_assoc] |
| 346 | _ = 1 := by rw [hLB, conjTranspose_one] |
| 347 | have h_products (y : ι → 𝔸f E) (hy : Y.stringProj y = y) : V.formFin y w = V.formFin y z := by |
| 348 | obtain ⟨c, rfl⟩ := (hB_span y).1 hy |
| 349 | rw [h_basis, h_basis, mulVec_mulVec, mulVec_mulVec, h_adj, one_mulVec] |
| 350 | exact mem_latticePlus.2 ⟨w, hw, (stringProj_eq_of_formFin_eq h_products).trans hz⟩ |
| 351 | |
| 352 | /-- Let `Λ'⁻` and `Λ'⁺` be the intersection with `X^⊥` and the projection to `X^⊥` of the lattice |
| 353 | of `x`. If `c A ⊆ Λ'⁻`, then every vector of `c̄ Λ'⁺` has integral products with the vectors of |
| 354 | `A`. -/ |
| 355 | lemma formFin_star_smul_mem {A : Submodule (Ô E) (ι → 𝔸f E)} (h_le : c • A ≤ Y.latticeMinus x) |
| 356 | (hz : z ∈ Y.latticePlus x) : ∀ y ∈ A, V.formFin y (star c • z) ∈ Ô E := fun y hy ↦ by |
| 357 | rw [Space.formFin_star_smul] |
| 358 | exact (mem_latticePlus_iff_formFin (stringProj_eq_of_mem_latticePlus hz)).1 hz _ |
| 359 | (smul_le_iff_forall.1 h_le y hy) |
| 360 | |
| 361 | /-- Multiplication by `c` sends the intersection lattice at `x` into that at `x'` exactly when |
| 362 | multiplication by `star c` sends the projection lattice at `x'` into that at `x`. -/ |
| 363 | lemma smul_latticeMinus_le_iff : |
| 364 | c • Y.latticeMinus x ≤ Y.latticeMinus x' ↔ star c • Y.latticePlus x' ≤ Y.latticePlus x := by |
| 365 | constructor |
| 366 | · intro h_le |
| 367 | exact smul_le_iff_forall.2 fun _ hz ↦ (mem_latticePlus_iff_formFin |
| 368 | (stringProj_smul_of_mem_latticePlus hz)).2 (formFin_star_smul_mem h_le hz) |
| 369 | · intro h_le |
| 370 | refine smul_le_iff_forall.2 fun z hz ↦ (mem_latticeMinus_iff_formFin |
| 371 | (stringProj_smul_of_mem_latticePlus (latticeMinus_le_latticePlus hz))).2 ?_ |
| 372 | intro y hy |
| 373 | have hy_star := smul_le_iff_forall.1 h_le y hy |
| 374 | have h_int := (mem_latticeMinus_iff_formFin (mem_latticeMinus.1 hz).2).1 hz _ hy_star |
| 375 | rwa [← Space.formFin_star_smul, star_star] at h_int |
| 376 | |
| 377 | /-- Let `Λ'⁻` and `Λ'⁺` be the intersection with `X^⊥` and the projection to `X^⊥` of the lattice |
| 378 | of `x`. An inclusion `c Λ'⁺ ⊆ Λ'⁻` gives `c̄ Λ'⁺ ⊆ Λ'⁻` by duality. -/ |
| 379 | lemma star_smul_latticePlus_le_latticeMinus (h_le : c • Y.latticePlus x ≤ Y.latticeMinus x) : |
| 380 | star c • Y.latticePlus x ≤ Y.latticeMinus x := |
| 381 | smul_le_iff_forall.2 fun _ hz ↦ (mem_latticeMinus_iff_formFin |
| 382 | (stringProj_smul_of_mem_latticePlus hz)).2 (formFin_star_smul_mem h_le hz) |
| 383 | |
| 384 | /-- A finite point `g` whose matrix `V.ratCoordMatrixFin g` in rational coordinates fixes `X^⊥` |
| 385 | (the span of the string) pointwise is in the image of the embedding `Y.inclXFin` of the unitary |
| 386 | group of `X`. -/ |
| 387 | lemma exists_inclXFin_eq_of_mulVec_eq {g : Gf E ι} |
| 388 | (hg : ∀ y : ι → 𝔸f E, Y.stringProj y = y → V.ratCoordMatrixFin g *ᵥ y = y) : |
| 389 | ∃ a : Gf E X, Y.inclXFin a = g := by |
| 390 | -- The matrix `M` of `g` is an isometry and is the identity on `X^⊥`, so it is block diagonal |
| 391 | -- with an isometry `A` of `X` in the first block. |
| 392 | let M : Matrix ι ι (𝔸f E) := V.ratCoordMatrixFin g |
| 393 | -- For `y` in `X^⊥` we have `⟨y, M z⟩ = ⟨M y, M z⟩ = ⟨y, z⟩`, so `M z - z` lies in `X`. |
| 394 | have h_proj (z : ι → 𝔸f E) : Y.stringProj (M *ᵥ z) = Y.stringProj z := by |
| 395 | refine stringProj_eq_of_formFin_eq fun y hy ↦ ?_ |
| 396 | calc V.formFin y (M *ᵥ z) = V.formFin (M *ᵥ y) (M *ᵥ z) := by rw [hg y hy] |
| 397 | _ = V.formFin y z := by |
| 398 | rw [Space.formFin, star_mulVec, ← dotProduct_mulVec, mulVec_mulVec, mulVec_mulVec, |
| 399 | Space.ratCoordMatrixFin_isometry, Space.formFin] |
| 400 | let A : Matrix X X (𝔸f E) := of fun a b ↦ M (Y.indexEquiv (.inl a)) (Y.indexEquiv (.inl b)) |
| 401 | have h_row (a : Fin s) (j : ι) : |
| 402 | M (Y.indexEquiv (.inr a)) j = (1 : Matrix ι ι (𝔸f E)) (Y.indexEquiv (.inr a)) j := by |
| 403 | simpa [stringProj_apply_inr, Matrix.one_apply, Pi.single_apply] using |
| 404 | congrFun (h_proj (Pi.single j 1)) (Y.indexEquiv (.inr a)) |
| 405 | have h_col (i : ι) (b : Fin s) : |
| 406 | M i (Y.indexEquiv (.inr b)) = (1 : Matrix ι ι (𝔸f E)) i (Y.indexEquiv (.inr b)) := by |
| 407 | simpa [Matrix.one_apply, Pi.single_apply] using congrFun |
| 408 | (hg (Pi.single (Y.indexEquiv (.inr b)) 1) (stringProj_eq_self_iff.2 (by simp))) i |
| 409 | have h_blocks : M = gradedBlocks Y.indexEquiv Y.indexEquiv A 1 := by |
| 410 | ext1 i j |
| 411 | obtain ⟨i' | i', rfl⟩ := Y.indexEquiv.surjective i <;> |
| 412 | obtain ⟨j' | j', rfl⟩ := Y.indexEquiv.surjective j <;> |
| 413 | simp [A, h_row, h_col, Matrix.one_apply] |
| 414 | have hA : Aᴴ * 1 * A = 1 := by |
| 415 | have h_isom := Space.ratCoordMatrixFin_isometry (V := V) g |
| 416 | rw [show V.ratCoordMatrixFin g = _ from h_blocks, Y.gram_eq] at h_isom |
| 417 | -- Read off the block of `X`, on which the form is standard (the Gram matrix is `1`). |
| 418 | simpa [gradedGram, ← submatrix_map, fromBlocks_map, submatrix_mul_equiv, fromBlocks_multiply, |
| 419 | fromBlocks_conjTranspose] using |
| 420 | congrArg (fun Z ↦ (Z.submatrix Y.indexEquiv Y.indexEquiv).toBlocks₁₁) h_isom |
| 421 | let a : Gf E X := ⟨(Units.mkOfMulEqOne (Aᴴ * 1) A hA)⁻¹, mem_unitaryGroupOf_iff.2 hA⟩ |
| 422 | -- The points have the same matrix, and conjugation by `V.xFin` is injective. |
| 423 | exact ⟨a, Subtype.ext (mul_left_cancel (mul_right_cancel (b := V.xFin⁻¹) (Units.ext |
| 424 | ((Y.ratCoordMatrixFin_inclXFin a).trans h_blocks.symm))))⟩ |
| 425 | |
| 426 | /-- Assume that `E` contains a primitive root of unity of order 5040 |
| 427 | (`[HasPrimitiveRoot5040 E]`). If the lattices of two points have the same intersection with |
| 428 | `X^⊥`, then some finite point `a` of the unitary group of `X`, embedded by `Y.inclXFin` in that of |
| 429 | `V`, carries one lattice to the other. -/ |
| 430 | lemma exists_lattice_inclXFin_mul_eq [HasPrimitiveRoot5040 E] |
| 431 | (h_minus : Y.latticeMinus x = Y.latticeMinus x') : |
| 432 | ∃ a : Gf E X, V.lattice (Y.inclXFin a * x) = V.lattice x' := by |
| 433 | -- A basis `B` of `X^⊥` that is primitive for `x` spans the common intersection, so it is |
| 434 | -- primitive for `x'`. Witt's theorem over `Ô` gives `k` that carries the coordinates of `B` for |
| 435 | -- `x` to those for `x'`, so `x' * k * x⁻¹` fixes `B`. |
| 436 | obtain ⟨B, hB, hB_span⟩ := Y.exists_isPrimitiveMatrix_basis x |
| 437 | let T (u : Gf E ι) : Matrix ι (Fin s) (𝔸f E) := (V.xFin * u.val)⁻¹.val * B |
| 438 | have h_mem (u : Gf E ι) (c : Fin s → 𝔸f E) : |
| 439 | B *ᵥ c ∈ Y.latticeMinus u ↔ T u *ᵥ c ∈ intVectors (Ô E) ι := by |
| 440 | change _ ↔ ∀ i : ι, (T u *ᵥ c) i ∈ Ô E |
| 441 | simp only [T, mem_latticeMinus, and_iff_left ((hB_span _).2 ⟨c, rfl⟩), Space.mem_lattice, |
| 442 | mulVec_mulVec] |
| 443 | have hB' : IsPrimitiveMatrix (Ô E) (T x') := by |
| 444 | obtain ⟨⟨L, hLB : L * T x = 1⟩, h_int⟩ := |
| 445 | isValuationPair_Ô.isPrimitiveMatrix_iff_mulVec_mem_intVectors.1 hB |
| 446 | have h_inv : HasLeftInv (T x') := ⟨L * (V.xFin * x.val)⁻¹.val * (V.xFin * x'.val).val, |
| 447 | by simpa [T, Matrix.mul_assoc] using hLB⟩ |
| 448 | refine isValuationPair_Ô.isPrimitiveMatrix_iff_mulVec_mem_intVectors.2 ⟨h_inv, fun c ↦ ?_⟩ |
| 449 | rw [← h_mem, ← h_minus, h_mem] |
| 450 | exact h_int c |
| 451 | have h_gram (u : Gf E ι) : (T u)ᴴ * T u = Bᴴ * V.J.map (algebraMap E (𝔸f E)) * B := by |
| 452 | simp only [T, ← Space.gram_frame_inv u, conjTranspose_mul, Matrix.mul_assoc] |
| 453 | obtain ⟨k, hk, hkB⟩ : ∃ k ∈ stdLevel E ι, k.val.val * T x = T x' := |
| 454 | witt_Ô hB hB' ((h_gram x).trans (h_gram x').symm) |
| 455 | have h_fix : V.ratCoordMatrixFin (x' * k * x⁻¹) * B = B := |
| 456 | calc V.ratCoordMatrixFin (x' * k * x⁻¹) * B = (V.xFin * x'.val).val * (k.val.val * T x) := by |
| 457 | simp [T, Space.ratCoordMatrixFin, Matrix.mul_assoc] |
| 458 | _ = B := by rw [hkB, ← Matrix.mul_assoc, Units.mul_inv, Matrix.one_mul] |
| 459 | obtain ⟨a, ha⟩ : ∃ a : Gf E X, Y.inclXFin a = x' * k * x⁻¹ := by |
| 460 | refine exists_inclXFin_eq_of_mulVec_eq fun y hy ↦ ?_ |
| 461 | obtain ⟨c, rfl⟩ := (hB_span y).1 hy |
| 462 | rw [mulVec_mulVec, h_fix] |
| 463 | refine ⟨a, (Space.lattice_eq_iff.2 ?_).symm⟩ |
| 464 | rwa [ha, inv_mul_cancel_right, inv_mul_cancel_left] |
| 465 | |
| 466 | end Grading |
| 467 | |
| 468 | end New |
| 469 | |
| 470 | end |