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 New.UpperBound.Objects.LiftLawsModuloN |
| 4 | public import New.UpperBound.Seesaw.AdmissibleCombinations |
| 5 | public import New.UpperBound.Seesaw.EdgePairEvaluation -- shake: keep (needed public by an exposed definition) |
| 6 | |
| 7 | /-! |
| 8 | # The neighbour lattice of a pair of edges |
| 9 | |
| 10 | Take definite spaces with bases indexed by `X ⊕ Unit`, `X'` and `X'' ⊕ Unit`, written `X`, `X'`, |
| 11 | `X''` for short, and let `e` and `e''` be the last basis vectors of the first and of the third. An |
| 12 | explicit unitary carries the standard lattice of `Hom (X', X⁻ ⊕ X'')` to `neighbourLattice`. Away |
| 13 | from `N` this lattice is the standard one with scaled rows. Above `N` it is a neighbour of the |
| 14 | standard lattice, and the translations `neighbourTranslation` represent it modulo its integral |
| 15 | points. The sums `neighbourCosetRep` of these and of scaled rows away from `N` represent the whole |
| 16 | lattice modulo its integral points. |
| 17 | |
| 18 | Notions from other files: |
| 19 | * `𝔸f E` is the ring of finite adeles of the CM field `E` and `Ô E` its subring of integral adeles; |
| 20 | `star` is complex conjugation and `idem S` is the adele that is `1` on `S` and `0` off it. |
| 21 | * `IsSplitLevel P N`: the places above the prime `N` are those in `P` and their conjugates, all |
| 22 | split of degree one and unramified. |
| 23 | * `IsSplitSquarefree P N π`: the idele `π` is a uniformiser on `P` and a unit elsewhere, |
| 24 | `N = π π̄`, and `P` does not meet its conjugate. |
| 25 | * `stdLattice E ι` consists of the vectors with integral entries, `integralBox ι S` of those whose |
| 26 | entries are integral at the places of `S`; `S.conjClosure` is `S` with its conjugate places. |
| 27 | * `residueOverN y` is the adele `y / N` at `P`, for residues `y` modulo `N` at the places of `P`. |
| 28 | * `Gf E ι` is the group of unitary matrices over `𝔸f E` with rows and columns indexed by `ι`. |
| 29 | |
| 30 | ## Relation to the literature |
| 31 | |
| 32 | See `New.UpperBound.Seesaw.SeesawIdentity` for related work. |
| 33 | -/ |
| 34 | |
| 35 | @[expose] public section |
| 36 | |
| 37 | namespace New.Seesaw |
| 38 | |
| 39 | noncomputable section |
| 40 | |
| 41 | open Matrix Space WeilData Kronecker Exchange Finset Weil Valued stdLattice |
| 42 | |
| 43 | section Denominators |
| 44 | |
| 45 | open NumberField |
| 46 | |
| 47 | variable {E n n₀ : Type} [Field E] [NumberField E] [IsCMField E] [Fintype n] {q : ℕ} |
| 48 | |
| 49 | /-- The denominators allowed on `X⁻ ⊕ X''`: the integral adele `β` on the first block of indices |
| 50 | and its conjugate on the second. -/ |
| 51 | def selfOrConj {ι κ : Type*} (β : Ô E) (j : ι ⊕ κ) : 𝔸f E := |
| 52 | if j.isLeft then (β : 𝔸f E) else star (β : 𝔸f E) |
| 53 | |
| 54 | omit [IsCMField E] in |
| 55 | /-- A vector `x` lies in `weightedTranslations q d` if and only if, for each index `i` and each |
| 56 | finite place `w` not dividing `q`, the absolute values `v` at `w` of `d i` and `x i` have product at |
| 57 | most one. -/ |
| 58 | lemma mem_weightedTranslations {ι : Type*} {d x : ι → 𝔸f E} : |
| 59 | x ∈ weightedTranslations q d ↔ |
| 60 | ∀ (i : ι) (w : FinPlace E), ↑q ∉ w.asIdeal → v (d i w) * v (x i w) ≤ 1 := by |
| 61 | simp [weightedTranslations] |
| 62 | |
| 63 | /-- The group `weightedTranslations q d` consists of the vectors `y` with denominators `d` away from |
| 64 | `q`: for every index `i` and every place `w` not dividing `q` one has `v (d i w) * v (y i w) ≤ 1`. |
| 65 | The adjoint of an integral matrix `M` maps this group to the one for `d'`, provided that `M i j` |
| 66 | vanishes at the conjugate place `star w` whenever `d i` and `d' j` have different valuations at |
| 67 | `w`. -/ |
| 68 | lemma conjTranspose_mulVec_mem_weightedTranslations {M : Matrix n n₀ (𝔸f E)} |
| 69 | (hM_int : IsIntMatrix (Ô E) M) {d y : n → 𝔸f E} {d' : n₀ → 𝔸f E} |
| 70 | (hy : y ∈ weightedTranslations q d) (hM_zero : ∀ (i : n) (j : n₀) (w : FinPlace E), |
| 71 | v (d i w) ≠ v (d' j w) → M i j (star w) = 0) : |
| 72 | Mᴴ *ᵥ y ∈ weightedTranslations q d' := by |
| 73 | -- `Mᴴ y` is the sum over the rows `i` of the conjugate of row `i` times `y i`. |
| 74 | have h_rows : Mᴴ *ᵥ y = ∑ i, fun j ↦ star (M i j) * y i := |
| 75 | funext fun j ↦ by simp [mulVec, dotProduct] |
| 76 | rw [h_rows] |
| 77 | refine sum_mem fun i _ ↦ mem_weightedTranslations.2 fun j w hw ↦ ?_ |
| 78 | by_cases h_val : v (d i w) = v (d' j w) |
| 79 | · calc v (d' j w) * v ((star (M i j) * y i) w) |
| 80 | = v (M i j (star w)) * (v (d i w) * v (y i w)) := by simp [h_val, mul_left_comm] |
| 81 | _ ≤ 1 := |
| 82 | mul_le_one' (mem_Ô.1 (hM_int i j) (star w)) (mem_weightedTranslations.1 hy i w hw) |
| 83 | · simp [hM_zero i j w h_val] |
| 84 | |
| 85 | /-- If `x` lies in `weightedTranslations q d`, then `i ↦ c * star (x (f i))` lies in |
| 86 | `weightedTranslations q` for `i ↦ star (d (f i))`. Here `c` is integral (`hc`) and `f` is any change |
| 87 | of indices. -/ |
| 88 | lemma star_mem_weightedTranslations {ι X : Type*} {c : 𝔸f E} (hc : c ∈ Ô E) {d x : ι → 𝔸f E} |
| 89 | (hx : x ∈ weightedTranslations q d) (f : X → ι) : |
| 90 | (fun i : X ↦ c * star (x (f i))) ∈ weightedTranslations q fun i : X ↦ star (d (f i)) := by |
| 91 | refine mem_weightedTranslations.2 fun i w hw ↦ ?_ |
| 92 | calc v (star (d (f i)) w) * v ((c * star (x (f i))) w) |
| 93 | = v (c w) * v ((d (f i) * x (f i)) (star w)) := by simp [mul_left_comm] |
| 94 | _ ≤ 1 := mul_le_one' (mem_Ô.1 hc w) (hx (f i) (star w) (by simpa using hw)) |
| 95 | |
| 96 | end Denominators |
| 97 | |
| 98 | /-- The basis indices of the sum `X⁻ ⊕ X''` of two definite spaces: those of the first space are |
| 99 | `X ⊕ Unit` and those of the second `X'' ⊕ Unit`, `Unit` indexing a last basis vector. -/ |
| 100 | abbrev PairIndex (X X'' : Type) : Type := (X ⊕ Unit) ⊕ X'' ⊕ Unit |
| 101 | |
| 102 | /-- The index of the last basis vector `e` of the first space. -/ |
| 103 | abbrev PairIndex.lastSource {X X'' : Type} : PairIndex X X'' := Sum.inl (Sum.inr ()) |
| 104 | |
| 105 | /-- The index of the last basis vector `e''` of the second space. -/ |
| 106 | abbrev PairIndex.lastTarget {X X'' : Type} : PairIndex X X'' := Sum.inr (Sum.inr ()) |
| 107 | |
| 108 | open PairIndex |
| 109 | |
| 110 | section Neighbour |
| 111 | |
| 112 | variable {E X X' X'' : Type} [Field E] [CMType E] [WeilData E] |
| 113 | |
| 114 | /-- The gluing conditions on a vector `x` of `X⁻ ⊕ X''` and an adele `c`, which in the application |
| 115 | is the coefficient of an isotropic vector: `x` is integral except at `e` and `e''`, where it has |
| 116 | denominator at most `π̄`, and its entries there, divided by `π`, are congruent to `c` and `η̄ c`. -/ |
| 117 | structure IsNeighbourVector (π : (𝔸f E)ˣ) (δ c : 𝔸f E) (x : PairIndex X X'' → 𝔸f E) : Prop where |
| 118 | /-- The coefficient `c` is unchanged by `δ`. -/ |
| 119 | mul_coeff : δ * c = c |
| 120 | /-- The entries other than those at `e` and `e''` are integral. -/ |
| 121 | mem_of_ne (i : PairIndex X X'') (h_source : i ≠ lastSource) (h_target : i ≠ lastTarget) : |
| 122 | x i ∈ Ô E |
| 123 | /-- All entries have denominator at most `π̄`. -/ |
| 124 | star_mul_mem (i : PairIndex X X'') : star (π : 𝔸f E) * x i ∈ Ô E |
| 125 | /-- The entry at `e`, divided by `π`, differs from `c` by an integral adele. -/ |
| 126 | sub_source_mem : c - ↑π⁻¹ * x lastSource ∈ Ô E |
| 127 | /-- The entry at `e''`, divided by `π`, differs from `η̄ c` by an integral adele, where `η` is the |
| 128 | unit `normNegOne` of norm `-1`. -/ |
| 129 | sub_target_mem : star (normNegOne (E := E) : 𝔸f E) * c - ↑π⁻¹ * x lastTarget ∈ Ô E |
| 130 | |
| 131 | /-- The factors `κ` by which the rows of the standard lattice are scaled at the places dividing |
| 132 | `β` and `β̄`: each is `1` or a fixed adele `δ` of norm one, and nothing happens above `N`. In the |
| 133 | application `β β̄` is the auxiliary level `M` and `δ` generates the ideal `(β / β̄)`. -/ |
| 134 | structure IsScalingAtM (N : ℕ) (β : Ô E) (δ : 𝔸f E) (κ : PairIndex X X'' → 𝔸f E) : Prop where |
| 135 | /-- `δ` has norm one. -/ |
| 136 | mul_star_self_eq_one : δ * star δ = 1 |
| 137 | /-- `δ` is `1` above `N`. -/ |
| 138 | apply_eq_one (w : FinPlace E) (hw : ↑N ∈ w.asIdeal) : δ w = 1 |
| 139 | /-- `β` is a unit above `N`. -/ |
| 140 | v_eq_one (w : FinPlace E) (hw : ↑N ∈ w.asIdeal) : v ((β : 𝔸f E) w) = 1 |
| 141 | /-- Each factor is `1` or `δ`. -/ |
| 142 | eq_one_or_eq (b : PairIndex X X'') : κ b = 1 ∨ κ b = δ |
| 143 | /-- Each factor has denominator at most `β̄`. -/ |
| 144 | star_mul_mem (b : PairIndex X X'') : star (β : 𝔸f E) * κ b ∈ Ô E |
| 145 | /-- The factors on `X⁻` have denominator at most `β`, those on `X''` at most `β̄`. -/ |
| 146 | selfOrConj_mul_mem (b : PairIndex X X'') : selfOrConj β b * κ b ∈ Ô E |
| 147 | |
| 148 | variable [Fintype X] [DecidableEq X] [Fintype X'] [DecidableEq X'] [Fintype X''] [DecidableEq X''] |
| 149 | |
| 150 | variable (X X'') (P : Finset (FinPlace E)) (π : (𝔸f E)ˣ) |
| 151 | |
| 152 | /-- The vector `ρ = e + η̄ j̄ e''`, where `j` is the idempotent of `P` and `η` the unit of norm |
| 153 | `-1`. It is `e` except at the places conjugate to `P`, where it is `e + η̄ e''`. It has norm one |
| 154 | when `P` is disjoint from its conjugate. -/ |
| 155 | def neighbourAxis : PairIndex X X'' → 𝔸f E := |
| 156 | (0 ⊕ᵥ fun _ ↦ 1) ⊕ᵥ (0 ⊕ᵥ fun _ ↦ star ((normNegOne (E := E) : 𝔸f E) * idem P)) |
| 157 | |
| 158 | /-- The adele `A` such that, when `P` is disjoint from its conjugate, `1 + A` is `π` at `P`, `π̄⁻¹` |
| 159 | at the conjugate places and `1` elsewhere. -/ |
| 160 | def neighbourScale : 𝔸f E := |
| 161 | idem P * ((π : 𝔸f E) - 1) + star (idem P) * (star (↑π⁻¹ : 𝔸f E) - 1) |
| 162 | |
| 163 | /-- The matrix `γ = 1 + A ρ ρ*`. When `P` is disjoint from its conjugate, so that `ρ` has norm one, |
| 164 | it scales `ρ` by `1 + A` and fixes its orthogonal complement; its columns then span a neighbour at |
| 165 | `N` of the standard lattice. -/ |
| 166 | def neighbourMatrix : Matrix (PairIndex X X'') (PairIndex X X'') (𝔸f E) := |
| 167 | 1 + neighbourScale P π • vecMulVec (neighbourAxis X X'' P) (star (neighbourAxis X X'' P)) |
| 168 | |
| 169 | /-- The coefficient of the isotropic vector that goes with each column of `neighbourMatrix`; it is |
| 170 | zero except for the columns of `e` and `e''`. -/ |
| 171 | def neighbourCoeff : PairIndex X X'' → 𝔸f E := |
| 172 | (0 ⊕ᵥ fun _ ↦ neighbourScale P π * (↑π⁻¹ : 𝔸f E) * star (idem P)) ⊕ᵥ |
| 173 | (0 ⊕ᵥ fun _ ↦ neighbourScale P π * (↑π⁻¹ : 𝔸f E) * ((normNegOne (E := E) : 𝔸f E) * idem P)) |
| 174 | |
| 175 | /-- The translation `n y` attached to residues `y` at `P`: the matrix with row `η ȳ / N` at `e`, |
| 176 | row `-ȳ / N` at `e''` and zero elsewhere. It is supported at the places conjugate to `P`. -/ |
| 177 | def neighbourTranslation {P : Finset (FinPlace E)} {N : ℕ} (y : X' → P → ZMod N) |
| 178 | (i : PairIndex X X'' × X') : 𝔸f E := |
| 179 | Sum.elim (0 ⊕ᵥ fun _ ↦ (normNegOne (E := E) : 𝔸f E) * star (residueOverN (y i.2))) |
| 180 | (0 ⊕ᵥ fun _ ↦ -star (residueOverN (y i.2))) i.1 |
| 181 | |
| 182 | end Neighbour |
| 183 | |
| 184 | variable {E X X' X'' : Type} [Field E] [CMType E] [WeilData E] [Fintype X] |
| 185 | [Fintype X'] [DecidableEq X'] [Fintype X''] {N : ℕ} {P : Finset (FinPlace E)} |
| 186 | |
| 187 | section Unitary |
| 188 | |
| 189 | variable {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} {κ : PairIndex X X'' → 𝔸f E} |
| 190 | |
| 191 | section Relations |
| 192 | |
| 193 | omit [WeilData E] [Fintype X] [Fintype X'] [Fintype X''] |
| 194 | |
| 195 | /-- The matrix that scales a unit vector `ρ` by a factor `1 + A` of norm one and fixes its |
| 196 | orthogonal complement is unitary. -/ |
| 197 | lemma conjTranspose_mul_one_add_smul_vecMulVec {R n : Type*} [CommRing R] [StarRing R] [Fintype n] |
| 198 | [DecidableEq n] {ρ : n → R} {A : R} (hρ : star ρ ⬝ᵥ ρ = 1) (hA : star (1 + A) * (1 + A) = 1) : |
| 199 | (1 + A • vecMulVec ρ (star ρ))ᴴ * (1 + A • vecMulVec ρ (star ρ)) = 1 := by |
| 200 | -- The projection `Q = ρ ρ*` is hermitian and idempotent. |
| 201 | set Q : Matrix n n R := vecMulVec ρ (star ρ) with hQ |
| 202 | have h_adj : Qᴴ = Q := by rw [hQ, conjTranspose_vecMulVec, star_star] |
| 203 | have h_sq : Q * Q = Q := by rw [hQ, vecMulVec_mul_vecMulVec, hρ, one_smul] |
| 204 | have h_sum : star A + A + star A * A = 0 := by grind [star_one] |
| 205 | calc (1 + A • Q)ᴴ * (1 + A • Q) |
| 206 | _ = 1 + (star A + A + star A * A) • Q := by |
| 207 | simp [h_adj, add_mul, mul_add, smul_smul, h_sq, add_smul, add_assoc, mul_comm] |
| 208 | _ = 1 := by simp [h_sum] |
| 209 | |
| 210 | /-- If `π` is split squarefree for `N` at the places `P`, |
| 211 | then `P` does not meet its set of complex conjugate places. -/ |
| 212 | lemma IsSplitSquarefree.isConjDisjoint (hπ : IsSplitSquarefree P (N : E) π) : |
| 213 | Set.IsConjDisjoint (P : Set (FinPlace E)) := |
| 214 | Set.disjoint_left.2 hπ.star_notMem |
| 215 | |
| 216 | /-- If `π` is split squarefree for `N`, then `N` equals `π * star π` in the finite adeles. -/ |
| 217 | lemma IsSplitSquarefree.natCast_eq_mul_star (hπ : IsSplitSquarefree P (N : E) π) : |
| 218 | (N : 𝔸f E) = π * star (π : 𝔸f E) := by |
| 219 | simpa using hπ.algebraMap_eq_mul_star |
| 220 | |
| 221 | /-- If `π` is split squarefree for `N`, then `π` is an integral adele. -/ |
| 222 | lemma IsSplitSquarefree.mem_integralAdeles (hπ : IsSplitSquarefree P (N : E) π) : |
| 223 | (π : 𝔸f E) ∈ Ô E := by |
| 224 | refine mem_Ô.2 fun w ↦ ?_ |
| 225 | rw [hπ.v_apply] |
| 226 | split_ifs |
| 227 | exacts [(WithZero.exp_le_exp.2 (by simp)).trans_eq WithZero.exp_zero, le_rfl] |
| 228 | |
| 229 | /-- If `π` is split squarefree for `N`, then its conjugate `star π` is an integral adele. -/ |
| 230 | lemma IsSplitSquarefree.star_mem_integralAdeles (hπ : IsSplitSquarefree P (N : E) π) : |
| 231 | star (π : 𝔸f E) ∈ Ô E := |
| 232 | star_mem_Ô hπ.mem_integralAdeles |
| 233 | |
| 234 | /-- If `π` is a uniformiser on `P` and a unit elsewhere, then `π⁻¹` is integral off `P`. -/ |
| 235 | lemma IsSplitSquarefree.one_sub_idem_mul_inv_mem (hπ : IsSplitSquarefree P (N : E) π) : |
| 236 | (1 - idem P) * (↑π⁻¹ : 𝔸f E) ∈ Ô E := by |
| 237 | rw [← idem_compl, idem_mul_mem_Ô] |
| 238 | intro w (hw : w ∉ P) |
| 239 | simp [idele_inv_apply_and_ne_zero, hπ.v_apply, hw] |
| 240 | |
| 241 | /-- The conjugate of the idempotent `idem S` is idempotent. -/ |
| 242 | lemma star_idem_mul_self (S : Set (FinPlace E)) : |
| 243 | star (idem S) * star (idem S) = (star (idem S) : 𝔸f E) := by |
| 244 | rw [← star_mul', idem_mul_self] |
| 245 | |
| 246 | /-- The conjugates of a unit `π` and of its inverse multiply to one. -/ |
| 247 | lemma star_mul_star_inv (π : (𝔸f E)ˣ) : star (π : 𝔸f E) * star (↑π⁻¹ : 𝔸f E) = 1 := by |
| 248 | rw [← star_mul', π.mul_inv, star_one] |
| 249 | |
| 250 | /-- Every scaling factor has norm one. -/ |
| 251 | lemma IsScalingAtM.apply_mul_star_eq_one (hκ : IsScalingAtM N β δ κ) (i : PairIndex X X'') : |
| 252 | κ i * star (κ i) = 1 := by |
| 253 | rcases hκ.eq_one_or_eq i with h | h <;> simp [h, hκ.mul_star_self_eq_one] |
| 254 | |
| 255 | /-- If the places above `N` are `P` and its conjugate, the scaling adele `δ`, which is `1` above |
| 256 | `N`, is `1` at `P`. -/ |
| 257 | lemma IsScalingAtM.idem_mul (hκ : IsScalingAtM N β δ κ) |
| 258 | (hP : IsSplitLevel P N) : idem P * δ = idem P := by |
| 259 | ext w |
| 260 | by_cases hw : w ∈ P <;> simp [hw, hκ.apply_eq_one, hP.natCast_mem_iff] |
| 261 | |
| 262 | /-- If the places above `N` are `P` and its conjugate, the scaling adele `δ`, which is `1` above |
| 263 | `N`, is `1` at the places conjugate to `P`. -/ |
| 264 | lemma IsScalingAtM.star_idem_mul (hκ : IsScalingAtM N β δ κ) |
| 265 | (hP : IsSplitLevel P N) : star (idem P) * δ = star (idem P) := by |
| 266 | rw [star_idem] |
| 267 | ext w |
| 268 | by_cases hw : star w ∈ P |
| 269 | · simp [hκ.apply_eq_one w ((hP.natCast_mem_iff w).2 (Or.inr hw))] |
| 270 | · simp [hw] |
| 271 | |
| 272 | /-- Let `N = π π̄` with `π` a uniformiser on `P` and a unit elsewhere, and let `P` be disjoint from |
| 273 | its conjugate (`IsSplitSquarefree`). The adele `A = neighbourScale P π`, which is `π - 1` at `P`, |
| 274 | `π̄⁻¹ - 1` at the conjugate places and `0` elsewhere, has denominator at most `π̄`: the product |
| 275 | `π̄ A` is integral. -/ |
| 276 | lemma star_mul_neighbourScale_mem (hπ : IsSplitSquarefree P (N : E) π) : |
| 277 | star (π : 𝔸f E) * neighbourScale P π ∈ Ô E := by |
| 278 | have h_eq : star (π : 𝔸f E) * neighbourScale P π = |
| 279 | star (π : 𝔸f E) * (idem P * (π : 𝔸f E) - idem P - star (idem P)) + star (idem P) := by |
| 280 | rw [neighbourScale] |
| 281 | linear_combination star (idem P) * star_mul_star_inv π |
| 282 | have hj : idem P ∈ Ô E := idem_mem_Ô _ |
| 283 | rw [h_eq] |
| 284 | exact add_mem (mul_mem hπ.star_mem_integralAdeles |
| 285 | (sub_mem (sub_mem (mul_mem hj hπ.mem_integralAdeles) hj) (star_mem_Ô hj))) (star_mem_Ô hj) |
| 286 | |
| 287 | /-- The adele `neighbourScale P π` vanishes at each place outside `P` and its conjugate. -/ |
| 288 | lemma neighbourScale_apply_of_notMem {w : FinPlace E} (hw : w ∉ P) (hw_star : star w ∉ P) : |
| 289 | evalAt w (neighbourScale P π) = 0 := by |
| 290 | simp [neighbourScale, star_idem, hw, hw_star] |
| 291 | |
| 292 | end Relations |
| 293 | |
| 294 | section Entries |
| 295 | |
| 296 | omit [Fintype X] [Fintype X'] [Fintype X''] |
| 297 | |
| 298 | omit [WeilData E] in |
| 299 | /-- Let `π` be split squarefree for `N` at the finite set of places `P` (`IsSplitSquarefree`): |
| 300 | `N = π π̄`, the idele `π` is a uniformiser at each place of `P` and a unit at all others, and no |
| 301 | place of `P` has its conjugate in `P`. For `A = neighbourScale P π` the adele `1 + A`, which is `π` |
| 302 | at `P`, `π̄⁻¹` at the conjugate places and `1` elsewhere, has norm one: its product with its own |
| 303 | conjugate is `1`. -/ |
| 304 | lemma star_one_add_neighbourScale_mul (hπ : IsSplitSquarefree P (N : E) π) : |
| 305 | star (1 + neighbourScale P π) * (1 + neighbourScale P π) = 1 := by |
| 306 | simp only [neighbourScale, star_add, star_sub, star_mul', star_one, star_star] |
| 307 | linear_combination |
| 308 | ((π : 𝔸f E) - 1) * ((↑π⁻¹ : 𝔸f E) - 1) * idem_mul_self (P : Set (FinPlace E)) + |
| 309 | (star (π : 𝔸f E) - 1) * (star (↑π⁻¹ : 𝔸f E) - 1) * star_idem_mul_self (P : Set (FinPlace E)) + |
| 310 | (((π : 𝔸f E) - 1) * (star (π : 𝔸f E) - 1) + |
| 311 | ((↑π⁻¹ : 𝔸f E) - 1) * (star (↑π⁻¹ : 𝔸f E) - 1)) * idem_mul_star hπ.isConjDisjoint + |
| 312 | idem (P : Set (FinPlace E)) * π.mul_inv + |
| 313 | star (idem (P : Set (FinPlace E))) * star_mul_star_inv π |
| 314 | |
| 315 | lemma normNegOne_mem : (normNegOne (E := E) : 𝔸f E) ∈ Ô E := |
| 316 | SetLike.coe_mem _ |
| 317 | |
| 318 | lemma neighbourAxis_mem (i : PairIndex X X'') : neighbourAxis X X'' P i ∈ Ô E := by |
| 319 | rcases i with (i | i) | (i | i) <;> |
| 320 | simp [neighbourAxis, zero_mem, one_mem, star_mem_Ô, mul_mem, idem_mem_Ô] |
| 321 | |
| 322 | /-- The entries of `γ = 1 + A ρ ρ*`, where `A = neighbourScale P π` and |
| 323 | `ρ = neighbourAxis X X'' P`. -/ |
| 324 | lemma neighbourMatrix_apply [DecidableEq X] [DecidableEq X''] (i m : PairIndex X X'') : |
| 325 | neighbourMatrix X X'' P π i m = (if i = m then 1 else 0) + |
| 326 | neighbourScale P π * (neighbourAxis X X'' P i * star (neighbourAxis X X'' P m)) := by |
| 327 | simp [neighbourMatrix, vecMulVec_apply, Matrix.one_apply] |
| 328 | |
| 329 | /-- Off `P` and its conjugate, `γ = neighbourMatrix X X'' P π` is the identity. -/ |
| 330 | lemma neighbourMatrix_apply_of_notMem [DecidableEq X] [DecidableEq X''] |
| 331 | {w : FinPlace E} (hw : w ∉ P) (hw_star : star w ∉ P) (i m : PairIndex X X'') : |
| 332 | evalAt w (neighbourMatrix X X'' P π i m) = if i = m then 1 else 0 := by |
| 333 | rw [neighbourMatrix_apply, map_add, map_mul, neighbourScale_apply_of_notMem hw hw_star] |
| 334 | split_ifs <;> simp |
| 335 | |
| 336 | /-- The coefficient `neighbourCoeff X X'' P π m` attached to each column `m` of `neighbourMatrix` |
| 337 | has component `0` at every place `w` outside `P` and its conjugate. -/ |
| 338 | lemma neighbourCoeff_apply_of_notMem {w : FinPlace E} (hw : w ∉ P) (hw_star : star w ∉ P) |
| 339 | (m : PairIndex X X'') : evalAt w (neighbourCoeff X X'' P π m) = 0 := by |
| 340 | rcases m with (m | m) | (m | m) <;> |
| 341 | simp only [neighbourCoeff, Sum.elim_inl, Sum.elim_inr, Pi.zero_apply, map_zero, map_mul, |
| 342 | neighbourScale_apply_of_notMem hw hw_star, zero_mul] |
| 343 | |
| 344 | /-- Let `P` and its conjugates be the places above `N` (`IsSplitLevel`). Let `δ` be the |
| 345 | scaling adele of `IsScalingAtM`, which is `1` above `N`. Then multiplying by `δ` does not change the |
| 346 | coefficient `neighbourCoeff X X'' P π m` of the isotropic vector that goes with column `m` of |
| 347 | `neighbourMatrix`. -/ |
| 348 | lemma mul_neighbourCoeff (hP : IsSplitLevel P N) (hκ : IsScalingAtM N β δ κ) |
| 349 | (m : PairIndex X X'') : |
| 350 | δ * neighbourCoeff X X'' P π m = neighbourCoeff X X'' P π m := by |
| 351 | have h_scale : δ * neighbourScale P π = neighbourScale P π := by |
| 352 | rw [neighbourScale] |
| 353 | linear_combination ((π : 𝔸f E) - 1) * hκ.idem_mul hP + |
| 354 | (star (↑π⁻¹ : 𝔸f E) - 1) * hκ.star_idem_mul hP |
| 355 | rcases m with (m | m) | (m | m) <;> simp [neighbourCoeff, ← mul_assoc, h_scale] |
| 356 | |
| 357 | /-- Let `π` be split squarefree for `N` at `P`: `N = π π̄`, `π` is a uniformiser on `P` and a unit |
| 358 | elsewhere, and `P` does not meet its conjugate. The matrix `γ = neighbourMatrix X X'' P π` is |
| 359 | `1 + A ρ ρ*`, with rows and columns indexed by the bases of two spaces with last vectors `e` |
| 360 | (index `lastSource`) and `e''` (index `lastTarget`); here `A = neighbourScale P π`, |
| 361 | `j = idem P` is `1` at `P` and `0` elsewhere, `η = normNegOne` has norm `-1`, and |
| 362 | `ρ = e + η̄ j̄ e''`. The adele `neighbourCoeff X X'' P π m` is `A π⁻¹ j̄` for the column of `e`, |
| 363 | `A π⁻¹ η j` for that of `e''` and `0` for the others. This lemma computes it minus `π⁻¹` times |
| 364 | the entry `γ lastSource m`: it is `-ϖ` if `m` is the index of `e` and `0` otherwise, where |
| 365 | `ϖ = j + (1 - j) π⁻¹` is `1` at `P` and `π⁻¹` elsewhere. -/ |
| 366 | lemma neighbourCoeff_sub_lastSource [DecidableEq X] [DecidableEq X''] |
| 367 | (hπ : IsSplitSquarefree P (N : E) π) (m : PairIndex X X'') : |
| 368 | neighbourCoeff X X'' P π m - (↑π⁻¹ : 𝔸f E) * neighbourMatrix X X'' P π lastSource m = |
| 369 | -(idem P + (1 - idem P) * (↑π⁻¹ : 𝔸f E)) * if lastSource = m then 1 else 0 := by |
| 370 | let π' : 𝔸f E := ↑π⁻¹ |
| 371 | have h_corner : neighbourScale P π * π' * star (idem P) - π' * (1 + neighbourScale P π) = |
| 372 | -(idem P + (1 - idem P) * π') := by |
| 373 | -- Off the places conjugate to `P`, the adele `A` is `π - 1` at `P` and `0` elsewhere. |
| 374 | have hA_off : neighbourScale P π * (1 - star (idem P)) = idem P * ((π : 𝔸f E) - 1) := by |
| 375 | rw [neighbourScale] |
| 376 | linear_combination (1 - (π : 𝔸f E)) * idem_mul_star hπ.isConjDisjoint + |
| 377 | (1 - star π') * star_idem_mul_self (P : Set (FinPlace E)) |
| 378 | linear_combination -π' * hA_off - idem P * π.mul_inv |
| 379 | rw [neighbourMatrix_apply] |
| 380 | rcases m with (m | m) | (m | m) |
| 381 | case inl.inr => simpa [neighbourCoeff, neighbourAxis] using h_corner |
| 382 | all_goals simp [neighbourCoeff, neighbourAxis, mul_assoc, mul_left_comm] |
| 383 | |
| 384 | /-- Let `π` be split squarefree for `N` at `P`: `N = π π̄`, `π` is a uniformiser on `P` and a unit |
| 385 | elsewhere, and `P` does not meet its conjugate. The matrix `γ = neighbourMatrix X X'' P π` is |
| 386 | `1 + A ρ ρ*`, with rows and columns indexed by the bases of two spaces with last vectors `e` |
| 387 | (index `lastSource`) and `e''` (index `lastTarget`); here `A = neighbourScale P π`, |
| 388 | `j = idem P` is `1` at `P` and `0` elsewhere, `η = normNegOne` has norm `-1`, and |
| 389 | `ρ = e + η̄ j̄ e''`. The adele `neighbourCoeff X X'' P π m` is `A π⁻¹ j̄` for the column of `e`, |
| 390 | `A π⁻¹ η j` for that of `e''` and `0` for the others. This lemma computes `η̄` times it minus |
| 391 | `π⁻¹` times the entry `γ lastTarget m`: it is `-ϖ` if `m` is the index of `e''` and `0` |
| 392 | otherwise, where `ϖ = j + (1 - j) π⁻¹` is `1` at `P` and `π⁻¹` elsewhere. -/ |
| 393 | lemma star_normNegOne_mul_neighbourCoeff_sub_lastTarget [DecidableEq X] [DecidableEq X''] |
| 394 | (hπ : IsSplitSquarefree P (N : E) π) (m : PairIndex X X'') : |
| 395 | star (normNegOne (E := E) : 𝔸f E) * neighbourCoeff X X'' P π m - |
| 396 | (↑π⁻¹ : 𝔸f E) * neighbourMatrix X X'' P π lastTarget m = |
| 397 | -(idem P + (1 - idem P) * (↑π⁻¹ : 𝔸f E)) * if lastTarget = m then 1 else 0 := by |
| 398 | let η : 𝔸f E := normNegOne (E := E) |
| 399 | let π' : 𝔸f E := ↑π⁻¹ |
| 400 | have h_corner : star η * (neighbourScale P π * π' * (η * idem P)) - |
| 401 | π' * (1 + neighbourScale P π * (star η * star (idem P) * (η * idem P))) = |
| 402 | -(idem P + (1 - idem P) * π') := by |
| 403 | -- At `P` the adele `neighbourScale P π` is `π - 1`. |
| 404 | have hA_on : neighbourScale P π * idem P = idem P * ((π : 𝔸f E) - 1) := by |
| 405 | rw [neighbourScale] |
| 406 | linear_combination ((π : 𝔸f E) - 1) * idem_mul_self (P : Set (FinPlace E)) + |
| 407 | (star π' - 1) * idem_mul_star hπ.isConjDisjoint |
| 408 | linear_combination |
| 409 | neighbourScale P π * π' * idem P * star_normNegOne_mul_self (E := E) - |
| 410 | π' * neighbourScale P π * (star η * η) * idem_mul_star hπ.isConjDisjoint - |
| 411 | π' * hA_on - idem P * π.mul_inv |
| 412 | rw [neighbourMatrix_apply] |
| 413 | rcases m with (m | m) | (m | m) |
| 414 | case inr.inr => simpa [neighbourCoeff, neighbourAxis] using h_corner |
| 415 | all_goals simp [neighbourCoeff, neighbourAxis, mul_assoc, mul_left_comm] |
| 416 | |
| 417 | /-- The coefficients of the isotropic vector are supported above `N`. -/ |
| 418 | lemma idem_conjClosure_mul_neighbourCoeff (hπ : IsSplitSquarefree P (N : E) π) |
| 419 | (m : PairIndex X X'') : |
| 420 | idem (P : Set (FinPlace E)).conjClosure * neighbourCoeff X X'' P π m = |
| 421 | neighbourCoeff X X'' P π m := by |
| 422 | rw [idem_conjClosure_eq_add_star hπ.isConjDisjoint] |
| 423 | rcases m with (m | m) | (m | m) <;> |
| 424 | simp only [neighbourCoeff, Sum.elim_inl, Sum.elim_inr, Pi.zero_apply] <;> |
| 425 | grind [idem_mul_self (P : Set (FinPlace E)), star_idem_mul_self (P : Set (FinPlace E)), |
| 426 | idem_mul_star hπ.isConjDisjoint] |
| 427 | |
| 428 | /-- Suppose that the places above the prime `N` are `P` and its conjugate, that `N = π π̄` with `π` |
| 429 | a uniformiser on `P` and a unit elsewhere, and that `κ` are factors `1` or `δ` for an adele `δ` of |
| 430 | norm one that is `1` above `N`, with the denominators bounded by `β` and `β̄` (`IsScalingAtM`). Let |
| 431 | `x` be column `m` of `γ = neighbourMatrix X X'' P π = 1 + A ρ ρ*` and `c` its coefficient |
| 432 | `neighbourCoeff`. Then `δ c = c`; `x` is integral except at `e` and `e''`; all of `π̄ x` is |
| 433 | integral; and `c - π⁻¹ x_e` and `η̄ c - π⁻¹ x_e''` are integral, with `η = normNegOne` of norm `-1`. |
| 434 | These are the conditions `IsNeighbourVector`. -/ |
| 435 | lemma isNeighbourVector_col_neighbourMatrix [DecidableEq X] [DecidableEq X''] |
| 436 | (hP : IsSplitLevel P N) |
| 437 | (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) (m : PairIndex X X'') : |
| 438 | IsNeighbourVector π δ (neighbourCoeff X X'' P π m) ((neighbourMatrix X X'' P π).col m) := by |
| 439 | have h_one (i) : (if i = m then 1 else 0) ∈ Ô E := by split_ifs <;> simp |
| 440 | have hϖ_mem : -(idem P + (1 - idem P) * (↑π⁻¹ : 𝔸f E)) ∈ Ô E := |
| 441 | neg_mem (add_mem (idem_mem_Ô _) hπ.one_sub_idem_mul_inv_mem) |
| 442 | refine |
| 443 | { mul_coeff := mul_neighbourCoeff hP hκ m |
| 444 | mem_of_ne := fun i hi₁ hi₂ ↦ by |
| 445 | rcases i with (i | ⟨⟩) | (i | ⟨⟩) <;> |
| 446 | simp_all [neighbourMatrix_apply, neighbourAxis] |
| 447 | star_mul_mem := fun i ↦ by |
| 448 | rw [Matrix.col_apply, neighbourMatrix_apply, mul_add, ← mul_assoc] |
| 449 | exact add_mem (mul_mem hπ.star_mem_integralAdeles (h_one i)) |
| 450 | (mul_mem (star_mul_neighbourScale_mem hπ) |
| 451 | (mul_mem (neighbourAxis_mem i) (star_mem_Ô (neighbourAxis_mem m)))) |
| 452 | sub_source_mem := by |
| 453 | simpa [neighbourCoeff_sub_lastSource hπ] using mul_mem hϖ_mem (h_one _) |
| 454 | sub_target_mem := by |
| 455 | simpa [star_normNegOne_mul_neighbourCoeff_sub_lastTarget hπ] using |
| 456 | mul_mem hϖ_mem (h_one _) } |
| 457 | |
| 458 | end Entries |
| 459 | |
| 460 | /-- The inner product of `ρ = e + η̄ j̄ e''` with a vector `x` is the sum of the entry at `e` and |
| 461 | `η j` times the entry at `e''`, where `j` is the idempotent of `P` and `η` the unit of norm `-1`. -/ |
| 462 | lemma star_neighbourAxis_dotProduct (x : PairIndex X X'' → 𝔸f E) : |
| 463 | star (neighbourAxis X X'' P) ⬝ᵥ x = |
| 464 | x lastSource + (normNegOne (E := E) : 𝔸f E) * idem P * x lastTarget := by |
| 465 | simp [neighbourAxis, dotProduct, Fintype.sum_sum_type] |
| 466 | |
| 467 | /-- The vector `ρ = neighbourAxis X X'' P` satisfies `star ρ ⬝ᵥ ρ = 1` when `π` is a split |
| 468 | squarefree idele for `N` at `P` (`hπ`), so that `P` is disjoint from its conjugate. -/ |
| 469 | lemma star_neighbourAxis_dotProduct_self (hπ : IsSplitSquarefree P (N : E) π) : |
| 470 | star (neighbourAxis X X'' P) ⬝ᵥ neighbourAxis X X'' P = 1 := by |
| 471 | rw [star_neighbourAxis_dotProduct] |
| 472 | simp only [neighbourAxis, Sum.elim_inl, Sum.elim_inr, star_mul'] |
| 473 | -- The product at `e''` has the factor `j j̄ = 0`. |
| 474 | grind [idem_mul_star hπ.isConjDisjoint] |
| 475 | |
| 476 | /-- Multiplication by `γ = neighbourMatrix X X'' P π` adds to a vector `x` the multiple `A ⟨ρ, x⟩ ρ` |
| 477 | of `ρ`. Here `A` is `neighbourScale P π`, `ρ` is `neighbourAxis X X'' P`, and `⟨ρ, x⟩ = x |
| 478 | lastSource + normNegOne * idem P * x lastTarget`. -/ |
| 479 | lemma neighbourMatrix_mulVec [DecidableEq X] [DecidableEq X''] |
| 480 | (x : PairIndex X X'' → 𝔸f E) (i : PairIndex X X'') : |
| 481 | (neighbourMatrix X X'' P π *ᵥ x) i = x i + neighbourScale P π * |
| 482 | (x lastSource + (normNegOne (E := E) : 𝔸f E) * idem P * x lastTarget) * |
| 483 | neighbourAxis X X'' P i := by |
| 484 | simp [neighbourMatrix, add_mulVec, smul_mulVec, vecMulVec_mulVec, star_neighbourAxis_dotProduct, |
| 485 | mul_comm, mul_left_comm] |
| 486 | |
| 487 | variable (X X'') in |
| 488 | /-- The matrix `γ` (`neighbourMatrix`) as a finite point of the unitary group, for a split |
| 489 | squarefree idele `π` for `N` at `P`. -/ |
| 490 | def neighbourUnitary [DecidableEq X] [DecidableEq X''] |
| 491 | (hπ : IsSplitSquarefree P (N : E) π) : Gf E (PairIndex X X'') := |
| 492 | U.of isUnit_one (neighbourMatrix X X'' P π) <| by |
| 493 | rw [mul_one] |
| 494 | exact conjTranspose_mul_one_add_smul_vecMulVec (star_neighbourAxis_dotProduct_self hπ) |
| 495 | (star_one_add_neighbourScale_mul hπ) |
| 496 | |
| 497 | /-- The matrix of `neighbourUnitary` is `γ`. -/ |
| 498 | lemma coe_neighbourUnitary [DecidableEq X] [DecidableEq X''] (hπ : IsSplitSquarefree P (N : E) π) : |
| 499 | (neighbourUnitary X X'' hπ : Matrix (PairIndex X X'') (PairIndex X X'') (𝔸f E)) = |
| 500 | neighbourMatrix X X'' P π := |
| 501 | rfl |
| 502 | |
| 503 | omit [Fintype X] [Fintype X''] [WeilData E] in |
| 504 | /-- If `P` is a split level for `N` (`IsSplitLevel P N`) and `κ` satisfies |
| 505 | `IsScalingAtM N β δ κ`, then each factor `κ i` is `1` at the places of `P`: |
| 506 | `idem P * κ i = idem P`. -/ |
| 507 | lemma IsScalingAtM.idem_mul_apply (hκ : IsScalingAtM N β δ κ) |
| 508 | (hP : IsSplitLevel P N) (i : PairIndex X X'') : idem P * κ i = idem P := by |
| 509 | rcases hκ.eq_one_or_eq i with h | h <;> simp [h, hκ.idem_mul hP] |
| 510 | |
| 511 | omit [Fintype X] [Fintype X''] [WeilData E] in |
| 512 | /-- If `P` is a split level for `N` (`IsSplitLevel P N`) and `κ` satisfies |
| 513 | `IsScalingAtM N β δ κ`, then each factor `κ i` is `1` at the places conjugate to `P`: |
| 514 | `star (idem P) * κ i = star (idem P)`. -/ |
| 515 | lemma IsScalingAtM.star_idem_mul_apply (hκ : IsScalingAtM N β δ κ) |
| 516 | (hP : IsSplitLevel P N) (i : PairIndex X X'') : star (idem P) * κ i = star (idem P) := by |
| 517 | rcases hκ.eq_one_or_eq i with h | h <;> simp [h, hκ.star_idem_mul hP] |
| 518 | |
| 519 | variable [DecidableEq X] [DecidableEq X''] |
| 520 | |
| 521 | /-- At a level prime `N` split as `P` and its conjugate, the matrix `γ` commutes with the diagonal |
| 522 | matrix of the scaling factors `κ`: it differs from `1` only above `N`, where all of these factors |
| 523 | are `1`. -/ |
| 524 | lemma commute_neighbourMatrix_diagonal (hP : IsSplitLevel P N) |
| 525 | (hκ : IsScalingAtM N β δ κ) : Commute (neighbourMatrix X X'' P π) (diagonal κ) := by |
| 526 | have h_scale (i : PairIndex X X'') : neighbourScale P π * κ i = neighbourScale P π := by |
| 527 | grind [neighbourScale, hκ.idem_mul_apply hP i, hκ.star_idem_mul_apply hP i] |
| 528 | ext i m : 1 |
| 529 | rw [mul_diagonal, diagonal_mul] |
| 530 | simp only [neighbourMatrix, Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, Matrix.one_apply] |
| 531 | grind [h_scale i, h_scale m] |
| 532 | |
| 533 | /-- The diagonal matrix of the factors `κ`, each of which has norm one, as a finite point of the |
| 534 | unitary group. -/ |
| 535 | def scalingUnitary (hκ : IsScalingAtM N β δ κ) : Gf E (PairIndex X X'') := |
| 536 | U.of isUnit_one (diagonal κ) <| by simp [mul_comm (star _), hκ.apply_mul_star_eq_one] |
| 537 | |
| 538 | section Vanishing |
| 539 | |
| 540 | omit [WeilData E] |
| 541 | |
| 542 | /-- The vectors that vanish at the places of `P` and at their conjugates. For a split level `N` |
| 543 | these are the places above `N`. -/ |
| 544 | def vanishingAbove (ι : Type) (P : Finset (FinPlace E)) : AddSubgroup (ι → 𝔸f E) := |
| 545 | ((idem (P : Set (FinPlace E)).conjClosure : 𝔸f E) • AddMonoidHom.id (ι → 𝔸f E)).ker |
| 546 | |
| 547 | /-- A vector `x` lies in `vanishingAbove ι P` if and only if `idem P.conjClosure • x = 0`. -/ |
| 548 | lemma mem_vanishingAbove {ι : Type} {x : ι → 𝔸f E} : |
| 549 | x ∈ vanishingAbove ι P ↔ (idem (P : Set (FinPlace E)).conjClosure : 𝔸f E) • x = 0 := |
| 550 | .rfl |
| 551 | |
| 552 | /-- A matrix maps `vanishingAbove ι P` into `vanishingAbove ι' P`. -/ |
| 553 | lemma mulVec_mem_vanishingAbove {ι ι' : Type} {x : ι → 𝔸f E} [Fintype ι] (M : Matrix ι' ι (𝔸f E)) |
| 554 | (hx : x ∈ vanishingAbove ι P) : M *ᵥ x ∈ vanishingAbove ι' P := by |
| 555 | rw [mem_vanishingAbove, ← mulVec_smul, mem_vanishingAbove.1 hx, mulVec_zero] |
| 556 | |
| 557 | /-- The part of a vector off `P` and its conjugate vanishes at these places. -/ |
| 558 | lemma sub_idem_smul_mem_vanishingAbove {ι : Type} (x : ι → 𝔸f E) : |
| 559 | x - (idem (P : Set (FinPlace E)).conjClosure : 𝔸f E) • x ∈ vanishingAbove ι P := by |
| 560 | rw [mem_vanishingAbove, smul_sub, smul_smul, idem_mul_self, sub_self] |
| 561 | |
| 562 | end Vanishing |
| 563 | |
| 564 | section Lattices |
| 565 | |
| 566 | variable (X') |
| 567 | /-- The homomorphism `g ↦ g ⊗ 1`. Its values act on matrices with columns indexed by `X'` by left |
| 568 | multiplication with `g`. -/ |
| 569 | def kroneckerOne (ι : Type) [Fintype ι] [DecidableEq ι] : Gf E ι →* Gf E (ι × X') := |
| 570 | (U.kroneckerHom (S := (1 : Matrix X' X' (𝔸f E))) (one_mul 1) (by simp)).comp |
| 571 | (MonoidHom.inr (U (1 : Matrix X' X' (𝔸f E))) (Gf E ι)) |
| 572 | |
| 573 | /-- The unitary `(γ κ) ⊗ 1`. It carries the standard lattice of `Hom (X', X⁻ ⊕ X'')` to the lattice |
| 574 | that is the neighbour above `N` and has its rows scaled by `κ` elsewhere. -/ |
| 575 | def latticeUnitary (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 576 | Gf E (PairIndex X X'' × X') := |
| 577 | kroneckerOne X' (PairIndex X X'') (neighbourUnitary X X'' hπ * scalingUnitary hκ) |
| 578 | |
| 579 | /-- The image of the standard lattice under `latticeUnitary`. For a pair of edges it is the lattice |
| 580 | `zeroTermLattice` of their splitting, by `DoubleLiftData.zeroTermLattice_splitting_eq`. -/ |
| 581 | def neighbourLattice (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 582 | AddSubgroup (PairIndex X X'' × X' → 𝔸f E) := |
| 583 | (stdLattice E (PairIndex X X'' × X')).map |
| 584 | (DistribSMul.toAddMonoidHom (PairIndex X X'' × X' → 𝔸f E) (latticeUnitary X' hπ hκ)) |
| 585 | |
| 586 | /-- The elements of the lattice that vanish above `N`. -/ |
| 587 | def awayLattice (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 588 | AddSubgroup (PairIndex X X'' × X' → 𝔸f E) := |
| 589 | neighbourLattice X' hπ hκ ⊓ vanishingAbove (PairIndex X X'' × X') P |
| 590 | |
| 591 | /-- The classes of `awayLattice` modulo its integral points. Only the rows scaled by `δ` can fail |
| 592 | to be integral. -/ |
| 593 | abbrev AwayLatticeQuotient (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 594 | Type := |
| 595 | awayLattice X' hπ hκ ⧸ (stdLattice E (PairIndex X X'' × X')).addSubgroupOf (awayLattice X' hπ hκ) |
| 596 | |
| 597 | end Lattices |
| 598 | |
| 599 | omit [WeilData E] in |
| 600 | /-- The matrix of `g ⊗ 1` is the Kronecker product of that of `g` with the identity. -/ |
| 601 | lemma coe_kroneckerOne {ι : Type} [Fintype ι] [DecidableEq ι] (g : Gf E ι) : |
| 602 | (kroneckerOne X' ι g : Matrix (ι × X') (ι × X') (𝔸f E)) = |
| 603 | (g : Matrix ι ι (𝔸f E)) ⊗ₖ (1 : Matrix X' X' (𝔸f E)) := by |
| 604 | simp [kroneckerOne] |
| 605 | |
| 606 | omit [WeilData E] in |
| 607 | /-- The action of `g ⊗ 1` on a matrix `x` multiplies each column of `x` by `g`. -/ |
| 608 | lemma kroneckerOne_smul {ι : Type} [Fintype ι] [DecidableEq ι] (g : Gf E ι) (x : ι × X' → 𝔸f E) |
| 609 | (i : ι × X') : |
| 610 | (kroneckerOne X' ι g • x) i = ((g : Matrix ι ι (𝔸f E)) *ᵥ fun l : ι ↦ x (l, i.2)) i.1 := by |
| 611 | change ((kroneckerOne X' ι g : Matrix (ι × X') (ι × X') (𝔸f E)) *ᵥ x) i = _ |
| 612 | simp [coe_kroneckerOne, mulVec, dotProduct, Fintype.sum_prod_type, Matrix.one_apply] |
| 613 | |
| 614 | omit [WeilData E] in |
| 615 | /-- The conjugate of `residueOverN y` (the adele `y w / N` at `w ∈ P`, `0` elsewhere) is unchanged |
| 616 | by multiplication with the conjugate of `idem P`, so it is supported at the places conjugate to |
| 617 | `P`. -/ |
| 618 | lemma star_idem_mul_star_residueOverN [Fact N.Prime] (y : P → ZMod N) : |
| 619 | star (idem P) * star (residueOverN y) = star (residueOverN y) := by |
| 620 | rw [← star_mul', idem_mul_residueOverN] |
| 621 | |
| 622 | omit [Fintype X'] [DecidableEq X'] in |
| 623 | /-- Let `π` be split squarefree for `N` at `P`, `j = idem P` the adele `1` at `P` and `0` elsewhere |
| 624 | and `η = normNegOne` of norm `-1`. The matrix `x` has rows indexed by `PairIndex X X''`, with last |
| 625 | indices `e = lastSource` and `e'' = lastTarget`, and columns by `X'`. Let |
| 626 | `γ = neighbourMatrix X X'' P π`, let `ρ = neighbourAxis X X'' P = e + η̄ j̄ e''` and, for residues |
| 627 | `y` modulo `N` at the places of `P`, let `n y = neighbourTranslation X X'' y` be the matrix with row |
| 628 | `η ȳ / N` at `e`, row `-ȳ / N` at `e''` and zero elsewhere. After multiplication by `j̄`, each |
| 629 | column of `γ x + n y` is that of `x` plus `ρ` times `j̄ (π̄⁻¹ x_e + η ȳ / N) - j̄ x_e`. -/ |
| 630 | lemma star_idem_mul_neighbour_add_translation (hπ : IsSplitSquarefree P (N : E) π) |
| 631 | (x : PairIndex X X'' × X' → 𝔸f E) (y : X' → P → ZMod N) (i : PairIndex X X'' × X') : |
| 632 | star (idem P) * ((neighbourMatrix X X'' P π *ᵥ fun l : PairIndex X X'' ↦ x (l, i.2)) i.1 + |
| 633 | neighbourTranslation X X'' y i) = |
| 634 | star (idem P) * x i + neighbourAxis X X'' P i.1 * |
| 635 | (star (idem P) * (star (↑π⁻¹ : 𝔸f E) * x (lastSource, i.2) + |
| 636 | (normNegOne (E := E) : 𝔸f E) * star (residueOverN (y i.2))) - |
| 637 | star (idem P) * x (lastSource, i.2)) := by |
| 638 | obtain ⟨b, a⟩ := i |
| 639 | simp only [neighbourMatrix_mulVec, neighbourTranslation, neighbourScale] |
| 640 | have h_star_sq : star (idem P) * star (idem P) = (star (idem P) : 𝔸f E) := |
| 641 | star_idem_mul_self _ |
| 642 | have h_disjoint : idem P * star (idem P) = (0 : 𝔸f E) := idem_mul_star hπ.isConjDisjoint |
| 643 | have h_norm : star (normNegOne (E := E) : 𝔸f E) * (normNegOne (E := E) : 𝔸f E) = -1 := |
| 644 | star_normNegOne_mul_self |
| 645 | rcases b with (b | b) | (b | b) |
| 646 | -- The four kinds of row index differ only in the entries of `ρ` and of `n y`. |
| 647 | all_goals |
| 648 | simp only [neighbourAxis, star_mul', Sum.elim_inl, Sum.elim_inr, Pi.zero_apply] |
| 649 | grind |
| 650 | |
| 651 | /-- Let the prime `N` be split as `P` and its conjugate, let `π` be split squarefree for `N` at `P`, |
| 652 | let `η = normNegOne` have norm `-1` and, for residues `y` modulo `N` at the places of `P`, let |
| 653 | `residueOverN y` be the adele `y / N` at `P` and `0` elsewhere. Multiplication by the conjugate of |
| 654 | `idem P` keeps only the places conjugate to `P`. If `t` is integral there, then `π̄⁻¹ t + η ȳ / N` |
| 655 | is integral there for exactly one family of residues `y`, and otherwise for none. -/ |
| 656 | lemma exists_class_star_idem_mul_mem_iff [Fact N.Prime] (hP : IsSplitLevel P N) |
| 657 | (hπ : IsSplitSquarefree P (N : E) π) (t : 𝔸f E) : |
| 658 | ∃ y₀ : P → ZMod N, ∀ y : P → ZMod N, |
| 659 | star (idem P) * (star (↑π⁻¹ : 𝔸f E) * t + |
| 660 | (normNegOne (E := E) : 𝔸f E) * star (residueOverN y)) ∈ Ô E ↔ |
| 661 | star (idem P) * t ∈ Ô E ∧ y₀ = y := by |
| 662 | set η : 𝔸f E := ↑(normNegOne (E := E)) |
| 663 | have hη_norm : star η * η = -1 := star_normNegOne_mul_self |
| 664 | have hη_mem : η ∈ Ô E := normNegOne_mem |
| 665 | -- The map `w ↦ η w̄` preserves integrality in both directions. |
| 666 | have h_twist (w : 𝔸f E) : η * star w ∈ Ô E ↔ w ∈ Ô E := by |
| 667 | refine ⟨fun h ↦ ?_, fun h ↦ mul_mem hη_mem (star_mem_Ô h)⟩ |
| 668 | have h_inv : η * star (η * star w) = -w := by |
| 669 | rw [star_mul', star_star, ← mul_assoc, mul_comm η (star η), hη_norm, neg_one_mul] |
| 670 | simpa only [h_inv, neg_mem_iff] using mul_mem hη_mem (star_mem_Ô h) |
| 671 | -- It turns the left side into `z - y / N` at `P`. |
| 672 | set z : 𝔸f E := η * ↑π⁻¹ * star t with hz |
| 673 | obtain ⟨y₀, hy₀⟩ : ∃ y₀ : P → ZMod N, ∀ y : P → ZMod N, |
| 674 | idem P * (z - residueOverN y) ∈ Ô E ↔ idem P * ((N : 𝔸f E) * z) ∈ Ô E ∧ y₀ = y := |
| 675 | hP.exists_sub_residueOverN_mem_iff z |
| 676 | refine ⟨y₀, fun y ↦ ?_⟩ |
| 677 | have h_sub : η * star (star (idem P) * (star (↑π⁻¹ : 𝔸f E) * t + η * star (residueOverN y))) = |
| 678 | idem P * (z - residueOverN y) := by |
| 679 | simp only [hz, star_mul', star_add, star_star] |
| 680 | grind |
| 681 | -- `N z = η π̄ t̄`, and `π̄` is a unit at `P`. |
| 682 | have h_mul : idem P * ((N : 𝔸f E) * z) = star (π : 𝔸f E) * (η * star (star (idem P) * t)) := by |
| 683 | simp only [hz, hπ.natCast_eq_mul_star, star_mul', star_star] |
| 684 | grind [π.mul_inv] |
| 685 | have h_div : η * star (star (idem P) * t) = |
| 686 | star ((1 - idem P) * (↑π⁻¹ : 𝔸f E)) * (idem P * ((N : 𝔸f E) * z)) := by |
| 687 | simp only [h_mul, star_sub, star_one, star_mul', star_star] |
| 688 | grind [idem_mul_star hπ.isConjDisjoint, star_mul_star_inv π] |
| 689 | rw [← h_twist, h_sub, hy₀, ← h_twist (star (idem (P : Set (FinPlace E))) * t)] |
| 690 | refine and_congr_left' ⟨fun h ↦ ?_, fun h ↦ ?_⟩ |
| 691 | · rw [h_div] |
| 692 | exact mul_mem (star_mem_Ô hπ.one_sub_idem_mul_inv_mem) h |
| 693 | · rw [h_mul] |
| 694 | exact mul_mem hπ.star_mem_integralAdeles h |
| 695 | |
| 696 | /-- Let the prime `N` be split as `P` and its conjugate and `π` split squarefree for `N` at `P`. |
| 697 | `kroneckerOne` lets the unitary `γ` act on each column. Let `η = normNegOne` have norm `-1`. For |
| 698 | residues `y` modulo `N` at `P`, `n y = neighbourTranslation X X'' y` has row `η ȳ / N` at `e`, row |
| 699 | `-ȳ / N` at `e''` and zero elsewhere. At the places conjugate to `P`, `γ x + n y` is integral for |
| 700 | exactly one `y` if `x` is integral there, and for none otherwise. -/ |
| 701 | lemma exists_add_neighbourTranslation_mem_iff [Fact N.Prime] (hP : IsSplitLevel P N) |
| 702 | (hπ : IsSplitSquarefree P (N : E) π) (x : PairIndex X X'' × X' → 𝔸f E) : |
| 703 | ∃ y₀ : X' → P → ZMod N, ∀ y : X' → P → ZMod N, |
| 704 | kroneckerOne X' (PairIndex X X'') (neighbourUnitary X X'' hπ) • x + |
| 705 | neighbourTranslation X X'' y ∈ integralBox (PairIndex X X'' × X') |
| 706 | (star ⁻¹' (P : Set (FinPlace E))) ↔ |
| 707 | x ∈ integralBox (PairIndex X X'' × X') (star ⁻¹' (P : Set (FinPlace E))) ∧ y₀ = y := by |
| 708 | -- In column `a`, take the residues attached to the entry of `x` at `lastSource`. |
| 709 | choose y₀ hy₀ using fun a : X' ↦ exists_class_star_idem_mul_mem_iff hP hπ (x (lastSource, a)) |
| 710 | refine ⟨y₀, fun y ↦ ?_⟩ |
| 711 | simp only [mem_integralBox, ← star_idem, Pi.add_apply, kroneckerOne_smul, |
| 712 | coe_neighbourUnitary, star_idem_mul_neighbour_add_translation hπ] |
| 713 | refine ⟨fun h ↦ ?_, fun ⟨hx, hy⟩ i ↦ ?_⟩ |
| 714 | · -- The row at `lastSource` decides the residues; then, times `j̄`, all entries differ from those |
| 715 | -- of `x` by integral adeles. |
| 716 | have h_row (a : X') : star (idem P) * (star (↑π⁻¹ : 𝔸f E) * x (lastSource, a) + |
| 717 | (normNegOne (E := E) : 𝔸f E) * star (residueOverN (y a))) ∈ Ô E := by |
| 718 | simpa [neighbourAxis] using h (lastSource, a) |
| 719 | have h_residues (a : X') : star (idem P) * x (lastSource, a) ∈ Ô E ∧ y₀ a = y a := |
| 720 | (hy₀ a (y a)).1 (h_row a) |
| 721 | refine ⟨fun i ↦ ?_, funext fun a ↦ (h_residues a).2⟩ |
| 722 | exact (add_mem_cancel_right |
| 723 | (mul_mem (neighbourAxis_mem i.1) (sub_mem (h_row i.2) (h_residues i.2).1))).1 (h i) |
| 724 | · exact add_mem (hx i) (mul_mem (neighbourAxis_mem i.1) |
| 725 | (sub_mem ((hy₀ i.2 (y i.2)).2 ⟨hx (lastSource, i.2), congrFun hy i.2⟩) |
| 726 | (hx (lastSource, i.2)))) |
| 727 | |
| 728 | omit [Fintype X] [Fintype X'] [Fintype X''] [DecidableEq X] [DecidableEq X'] [DecidableEq X''] in |
| 729 | /-- The translation `n y = neighbourTranslation X X'' y` is supported at the places conjugate to |
| 730 | `P`: multiplication by `star (idem P)`, the idempotent `j̄` of these places, fixes it. -/ |
| 731 | lemma star_idem_smul_neighbourTranslation [Fact N.Prime] (y : X' → P → ZMod N) : |
| 732 | star (idem P : 𝔸f E) • neighbourTranslation X X'' y = neighbourTranslation X X'' y := by |
| 733 | ext1 ⟨i, a⟩ |
| 734 | rcases i with (i | i) | (i | i) <;> |
| 735 | simp [neighbourTranslation, mul_left_comm _ (normNegOne (E := E) : 𝔸f E), |
| 736 | star_idem_mul_star_residueOverN (y a)] |
| 737 | |
| 738 | omit [WeilData E] in |
| 739 | /-- The element `scalingUnitary hκ ⊗ 1`, where `scalingUnitary hκ` is the diagonal matrix of the |
| 740 | factors `κ`, multiplies row `i.1` of a matrix `x` by `κ i.1`. -/ |
| 741 | lemma kroneckerOne_scalingUnitary_smul (hκ : IsScalingAtM N β δ κ) |
| 742 | (x : PairIndex X X'' × X' → 𝔸f E) (i : PairIndex X X'' × X') : |
| 743 | (kroneckerOne X' (PairIndex X X'') (scalingUnitary hκ) • x) i = κ i.1 * x i := by |
| 744 | rw [kroneckerOne_smul] |
| 745 | exact mulVec_diagonal κ _ i.1 |
| 746 | |
| 747 | /-- For a split level `N` with chosen places `P`, the matrix of `latticeUnitary` is |
| 748 | `(diagonal κ * γ) ⊗ 1`, where `γ = neighbourMatrix X X'' P π`. -/ |
| 749 | lemma coe_latticeUnitary (hP : IsSplitLevel P N) |
| 750 | (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 751 | (latticeUnitary X' hπ hκ : Matrix (PairIndex X X'' × X') (PairIndex X X'' × X') (𝔸f E)) = |
| 752 | (diagonal κ * neighbourMatrix X X'' P π) ⊗ₖ (1 : Matrix X' X' (𝔸f E)) := by |
| 753 | rw [latticeUnitary, coe_kroneckerOne, ← (commute_neighbourMatrix_diagonal hP hκ).eq] |
| 754 | rfl |
| 755 | |
| 756 | /-- Acting by `latticeUnitary` means scaling the rows by `κ`, then acting by `γ ⊗ 1`. -/ |
| 757 | lemma latticeUnitary_smul (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 758 | (x : PairIndex X X'' × X' → 𝔸f E) : |
| 759 | latticeUnitary X' hπ hκ • x = |
| 760 | kroneckerOne X' (PairIndex X X'') (neighbourUnitary X X'' hπ) • |
| 761 | fun i : PairIndex X X'' × X' ↦ κ i.1 * x i := by |
| 762 | rw [latticeUnitary, map_mul, mul_smul, funext (kroneckerOne_scalingUnitary_smul hκ x)] |
| 763 | |
| 764 | instance (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 765 | Fintype (AwayLatticeQuotient X' hπ hκ) := by |
| 766 | -- The integral points have finite index in the whole lattice. |
| 767 | refine AddSubgroup.fintypeOfIndexNeZero fun h_zero ↦ ?_ |
| 768 | exact relIndex_map_stdLattice_ne_zero (latticeUnitary X' hπ hκ) |
| 769 | (AddSubgroup.relIndex_eq_zero_of_le_right inf_le_left h_zero) |
| 770 | |
| 771 | end Unitary |
| 772 | |
| 773 | section AwayFromN |
| 774 | |
| 775 | /-- Let `π` be split squarefree for `N` at `P`, and let `κ` be row factors that are `1` or a fixed |
| 776 | adele `δ` of norm one (`IsScalingAtM`). The unitary `latticeUnitary` is `(γ κ) ⊗ 1` for |
| 777 | `γ = neighbourMatrix X X'' P π`. On a matrix `x` that vanishes at `P` and its conjugate, where `γ` |
| 778 | acts trivially, it multiplies row `b` by `κ b`. -/ |
| 779 | lemma latticeUnitary_smul_of_mem_vanishingAbove {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 780 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] |
| 781 | (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 782 | {x : PairIndex X X'' × X' → 𝔸f E} (hx : x ∈ vanishingAbove (PairIndex X X'' × X') P) : |
| 783 | latticeUnitary X' hπ hκ • x = fun i : PairIndex X X'' × X' ↦ κ i.1 * x i := by |
| 784 | have h_zero (i : PairIndex X X'' × X') : (idem P + star (idem P)) * x i = 0 := by |
| 785 | simpa [← idem_conjClosure_eq_add_star hπ.isConjDisjoint] using |
| 786 | congrFun (mem_vanishingAbove.1 hx) i |
| 787 | have h_scale (i : PairIndex X X'' × X') : neighbourScale P π * x i = 0 := by |
| 788 | grind [neighbourScale, h_zero i, idem_mul_self (P : Set (FinPlace E)), |
| 789 | star_idem_mul_self (P : Set (FinPlace E)), idem_mul_star hπ.isConjDisjoint] |
| 790 | ext1 i |
| 791 | simp only [latticeUnitary_smul, kroneckerOne_smul, coe_neighbourUnitary, neighbourMatrix_mulVec] |
| 792 | grind [h_scale (lastSource, i.2), h_scale (lastTarget, i.2)] |
| 793 | |
| 794 | /-- Let `π` be split squarefree for `N` at `P`. Let `κ` be row factors that are `1` or a fixed adele |
| 795 | `δ` of norm one, with denominators bounded by `β` and `β̄` (`IsScalingAtM`). Off `P` and its |
| 796 | conjugate, `neighbourLattice` is the standard lattice with its rows scaled by `κ`: if a matrix `x` |
| 797 | vanishes at `P` and its conjugate and lies in `neighbourLattice`, then `κ⁻¹ x = κ̄ x` has integral |
| 798 | entries. -/ |
| 799 | lemma star_mul_mem_of_mem_neighbourLattice {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 800 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] |
| 801 | (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 802 | {x : PairIndex X X'' × X' → 𝔸f E} (hx : x ∈ vanishingAbove (PairIndex X X'' × X') P) |
| 803 | (hmem : x ∈ neighbourLattice X' hπ hκ) (i : PairIndex X X'' × X') : |
| 804 | star (κ i.1) * x i ∈ Ô E := by |
| 805 | -- The matrix `x` is the image of `κ̄ x`. |
| 806 | have h_vanish : (fun i ↦ star (κ i.1) * x i) ∈ vanishingAbove (PairIndex X X'' × X') P := |
| 807 | funext fun i ↦ (mul_left_comm _ _ _).trans (mul_eq_zero_of_right _ (congrFun hx i)) |
| 808 | have h_image : latticeUnitary X' hπ hκ • (fun i ↦ star (κ i.1) * x i) = x := by |
| 809 | simp only [latticeUnitary_smul_of_mem_vanishingAbove hπ hκ h_vanish, ← mul_assoc, |
| 810 | hκ.apply_mul_star_eq_one, one_mul] |
| 811 | obtain ⟨x₀, hx₀, h_eq⟩ := hmem |
| 812 | obtain rfl : x₀ = fun i ↦ star (κ i.1) * x i := |
| 813 | MulAction.injective (latticeUnitary X' hπ hκ) (h_eq.trans h_image.symm) |
| 814 | exact hx₀ i |
| 815 | |
| 816 | /-- Let `π` be split squarefree for `N` at `P`, and let `κ` be row factors of norm one with |
| 817 | denominator at most `β` in the first block and `β̄` in the second (`IsScalingAtM`). An element of |
| 818 | `awayLattice`, the part of `neighbourLattice` that vanishes at `P` and its conjugate, is `κ` times |
| 819 | an integral matrix. So its rows, times `β` in the first block and `β̄` in the second, are integral |
| 820 | at every place, in particular at those not dividing `n`, as `weightedTranslations n` asks. -/ |
| 821 | lemma awayLattice_le_weightedTranslations {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 822 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] |
| 823 | (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) (n : ℕ) : |
| 824 | awayLattice X' hπ hκ ≤ |
| 825 | weightedTranslations n fun i : PairIndex X X'' × X' ↦ selfOrConj β i.1 := by |
| 826 | rintro x ⟨hx, hx_zero⟩ i w - |
| 827 | have h_eq : selfOrConj β i.1 * x i = selfOrConj β i.1 * κ i.1 * (star (κ i.1) * x i) := by |
| 828 | linear_combination -(selfOrConj β i.1 * x i) * hκ.apply_mul_star_eq_one i.1 |
| 829 | rw [h_eq] |
| 830 | exact mem_Ô.1 (mul_mem (hκ.selfOrConj_mul_mem i.1) |
| 831 | (star_mul_mem_of_mem_neighbourLattice hπ hκ hx_zero hx i)) w |
| 832 | |
| 833 | /-- Let `π` be split squarefree for `N` at `P` (`IsSplitSquarefree`): `N = π π̄`, `π` is a |
| 834 | uniformiser on `P` and a unit elsewhere, and `P` does not meet its conjugate. Let `κ` be row factors |
| 835 | that are `1` or a fixed adele `δ`, with denominator at most `β̄` (`IsScalingAtM`). The matrices have |
| 836 | rows indexed by `PairIndex X X''`, the basis indices of a sum of two definite spaces, and columns |
| 837 | indexed by `X'`. The group `awayLattice` consists of the matrices in `neighbourLattice` that vanish |
| 838 | at `P` and its conjugate. `AwayLatticeQuotient` is its quotient by the matrices all of whose entries |
| 839 | lie in the integral adeles `Ô E`. The order of this quotient divides the number of such matrices |
| 840 | with entries in `Ô E ⧸ (β)`. -/ |
| 841 | lemma card_awayLatticeQuotient_dvd {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 842 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] |
| 843 | (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) : |
| 844 | Fintype.card (AwayLatticeQuotient X' hπ hκ) ∣ |
| 845 | Nat.card (PairIndex X X'' × X' → Ô E ⧸ Ideal.span {β}) := by |
| 846 | -- Reduce the conjugate of `κ̄ x` modulo `β`. If it is `0`, then `x` is `β̄ κ` times an integral |
| 847 | -- matrix, hence integral. |
| 848 | have h_int (x : awayLattice X' hπ hκ) (i : PairIndex X X'' × X') : |
| 849 | star (κ i.1) * x.val i ∈ Ô E := |
| 850 | star_mul_mem_of_mem_neighbourLattice hπ hκ x.property.2 x.property.1 i |
| 851 | let reduction : awayLattice X' hπ hκ →+ PairIndex X X'' × X' → Ô E ⧸ Ideal.span {β} := |
| 852 | AddMonoidHom.mk' (fun x i ↦ Ideal.Quotient.mk _ (star ⟨_, h_int x i⟩)) fun x y ↦ by |
| 853 | ext i |
| 854 | exact congrArg (Ideal.Quotient.mk _) (Subtype.ext (by simp [mul_add])) |
| 855 | have h_ker : reduction.ker ≤ |
| 856 | (stdLattice E (PairIndex X X'' × X')).addSubgroupOf (awayLattice X' hπ hκ) := by |
| 857 | intro x hx i |
| 858 | obtain ⟨z, hz⟩ : ∃ z : Ô E, star ⟨_, h_int x i⟩ = β * z := |
| 859 | (Ideal.Quotient.eq_zero_iff_dvd β _).1 (congrFun hx i) |
| 860 | have hz_coe : star (star (κ i.1) * x.val i) = (β : 𝔸f E) * z := congrArg Subtype.val hz |
| 861 | have hx_eq : x.val i = star (β : 𝔸f E) * κ i.1 * star (z : 𝔸f E) := by |
| 862 | rw [mul_comm _ (κ i.1), mul_assoc, ← star_mul', ← hz_coe, star_star, ← mul_assoc, |
| 863 | hκ.apply_mul_star_eq_one, one_mul] |
| 864 | change x.val i ∈ Ô E |
| 865 | rw [hx_eq] |
| 866 | exact mul_mem (hκ.star_mul_mem i.1) (star_mem_Ô z.property) |
| 867 | rw [← Nat.card_eq_fintype_card] |
| 868 | exact (AddSubgroup.dvd_index_map _ h_ker).trans (AddSubgroup.index_dvd_card _) |
| 869 | |
| 870 | end AwayFromN |
| 871 | |
| 872 | /-- Let the prime `N` be split as `P` and its conjugate, let `N = π π̄` with `π` a uniformiser on |
| 873 | `P` and a unit elsewhere, and let `κ` be row factors that are `1` or `δ`, where `δ` is `1` above `N` |
| 874 | (`IsScalingAtM`). Then every translation `n y` attached to residues `y` modulo `N` at `P` lies in |
| 875 | `neighbourLattice`, the image of the standard lattice under `(γ κ) ⊗ 1` for |
| 876 | `γ = neighbourMatrix X X'' P π`. -/ |
| 877 | lemma neighbourTranslation_mem_neighbourLattice {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 878 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] [Fact N.Prime] |
| 879 | (hP : IsSplitLevel P N) (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 880 | (y : X' → P → ZMod N) : neighbourTranslation X X'' y ∈ neighbourLattice X' hπ hκ := by |
| 881 | -- Write `-n y = γ x`; then `x` is integral at `star ⁻¹' P`. |
| 882 | set γ := kroneckerOne X' (PairIndex X X'') (neighbourUnitary X X'' hπ) |
| 883 | set x := γ⁻¹ • (-neighbourTranslation X X'' y) |
| 884 | have hx : γ • x = -neighbourTranslation X X'' y := smul_inv_smul γ _ |
| 885 | obtain ⟨_, hy₀⟩ := exists_add_neighbourTranslation_mem_iff hP hπ x |
| 886 | refine ⟨fun i ↦ -(star (idem P) * x i), fun i ↦ neg_mem ?_, ?_⟩ |
| 887 | · simpa [star_idem] using mem_integralBox.1 ((hy₀ y).1 (by simp [γ, hx])).1 i |
| 888 | · have h_scaled : (fun i ↦ κ i.1 * -(star (idem P) * x i)) = -(star (idem P : 𝔸f E) • x) := |
| 889 | funext fun i ↦ by simp [mul_left_comm (κ i.1), ← mul_assoc, hκ.star_idem_mul_apply hP i.1] |
| 890 | have h_comm : γ • star (idem P : 𝔸f E) • x = star (idem P : 𝔸f E) • γ • x := mulVec_smul .. |
| 891 | rw [DistribSMul.toAddMonoidHom_apply, latticeUnitary_smul, h_scaled, smul_neg, h_comm, hx, |
| 892 | smul_neg, neg_neg, star_idem_smul_neighbourTranslation] |
| 893 | |
| 894 | /-- Let `N = π π̄` with `π` a uniformiser on `P` and a unit elsewhere, and let `P` be disjoint from |
| 895 | its conjugate (`IsSplitSquarefree`). An adele is integral at `P` if its product with `idem P`, |
| 896 | which is `1` at `P` and `0` elsewhere, is integral. The matrices have rows indexed by |
| 897 | `PairIndex X X''`, with last indices `e` and `e''`, and columns by `X'`; `kroneckerOne` lets the |
| 898 | unitary `γ` (`neighbourUnitary`, with matrix `neighbourMatrix X X'' P π`) act on each column, and |
| 899 | `n y = neighbourTranslation X X'' y` has row `η ȳ / N` at `e` and `-ȳ / N` at `e''`, both |
| 900 | supported at the places conjugate to `P`. If `z` is integral at `P`, then so is `γ z + n y`: at |
| 901 | `P`, `γ` is integral and `n y` is `0`. -/ |
| 902 | lemma idem_mul_neighbour_add_translation_mem {π : (𝔸f E)ˣ} [DecidableEq X] [DecidableEq X''] |
| 903 | [Fact N.Prime] (hπ : IsSplitSquarefree P (N : E) π) |
| 904 | {z : PairIndex X X'' × X' → 𝔸f E} (hz : ∀ i : PairIndex X X'' × X', idem P * z i ∈ Ô E) |
| 905 | (y : X' → P → ZMod N) (i : PairIndex X X'' × X') : |
| 906 | idem P * (kroneckerOne X' (PairIndex X X'') (neighbourUnitary X X'' hπ) • z + |
| 907 | neighbourTranslation X X'' y) i ∈ Ô E := by |
| 908 | have h_translation : idem P * neighbourTranslation X X'' y i = 0 := by |
| 909 | simpa [← mul_assoc, idem_mul_star hπ.isConjDisjoint] using |
| 910 | congrArg (idem P * ·) (congrFun (star_idem_smul_neighbourTranslation y) i).symm |
| 911 | set c : 𝔸f E := idem P * z (lastSource, i.2) + |
| 912 | (normNegOne (E := E) : 𝔸f E) * (idem P * z (lastTarget, i.2)) with hc |
| 913 | have h_entry : idem P * (neighbourMatrix X X'' P π *ᵥ fun l ↦ z (l, i.2)) i.1 = |
| 914 | idem P * z i + ((π : 𝔸f E) - 1) * c * neighbourAxis X X'' P i.1 := by |
| 915 | rw [neighbourMatrix_mulVec, neighbourScale, hc] |
| 916 | grind [idem_mul_self (P : Set (FinPlace E)), idem_mul_star hπ.isConjDisjoint] |
| 917 | rw [Pi.add_apply, mul_add, h_translation, add_zero, kroneckerOne_smul, coe_neighbourUnitary, |
| 918 | h_entry] |
| 919 | exact add_mem (hz i) (mul_mem (mul_mem (sub_mem hπ.mem_integralAdeles (one_mem _)) |
| 920 | (add_mem (hz _) (mul_mem normNegOne_mem (hz _)))) (neighbourAxis_mem i.1)) |
| 921 | |
| 922 | /-- Let the prime `N` be split as `P` and its conjugate, let `N = π π̄` with `π` a uniformiser on |
| 923 | `P` and a unit elsewhere, and let `κ` be row factors that are `1` above `N` (`IsScalingAtM`). Above |
| 924 | `N` the translations `n y` represent `neighbourLattice` modulo its integral points: for each element |
| 925 | `x` there is exactly one family `y` of residues modulo `N` at `P` such that `x + n y` is integral at |
| 926 | `P` and its conjugate, the places above `N`. -/ |
| 927 | lemma existsUnique_add_neighbourTranslation_mem {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 928 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] [Fact N.Prime] |
| 929 | (hP : IsSplitLevel P N) (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 930 | {x : PairIndex X X'' × X' → 𝔸f E} (hx : x ∈ neighbourLattice X' hπ hκ) : |
| 931 | ∃! y : X' → P → ZMod N, x + neighbourTranslation X X'' y ∈ |
| 932 | integralBox (PairIndex X X'' × X') (P : Set (FinPlace E)).conjClosure := by |
| 933 | obtain ⟨x₀, hx₀, rfl⟩ := hx |
| 934 | set z : PairIndex X X'' × X' → 𝔸f E := fun i ↦ κ i.1 * x₀ i with hz |
| 935 | -- Above `N` the factors `κ` are `1`, so `z = κ x₀` is integral there. |
| 936 | have hz_idem (i : PairIndex X X'' × X') : idem P * z i ∈ Ô E := by |
| 937 | simpa only [hz, ← mul_assoc, hκ.idem_mul_apply hP] using mul_mem (idem_mem_Ô _) (hx₀ i) |
| 938 | have hz_box : z ∈ integralBox (PairIndex X X'' × X') (star ⁻¹' (P : Set (FinPlace E))) := by |
| 939 | simpa only [mem_integralBox, hz, ← star_idem, ← mul_assoc, hκ.star_idem_mul_apply hP] using |
| 940 | fun i ↦ mul_mem (star_mem_Ô (idem_mem_Ô _)) (hx₀ i) |
| 941 | -- At the places conjugate to `P`, the sum `γ z + n y` is integral for exactly one family `y₀`. |
| 942 | obtain ⟨y₀, hy₀⟩ := exists_add_neighbourTranslation_mem_iff hP hπ z |
| 943 | have h_iff (y : X' → P → ZMod N) : |
| 944 | latticeUnitary X' hπ hκ • x₀ + neighbourTranslation X X'' y ∈ |
| 945 | integralBox (PairIndex X X'' × X') (P : Set (FinPlace E)).conjClosure ↔ y₀ = y := by |
| 946 | -- At `P` the sum is integral, so only the conjugate places count. |
| 947 | have h_conj : kroneckerOne X' (PairIndex X X'') (neighbourUnitary X X'' hπ) • z + |
| 948 | neighbourTranslation X X'' y ∈ integralBox (PairIndex X X'' × X') |
| 949 | (star ⁻¹' (P : Set (FinPlace E))) ↔ y₀ = y := |
| 950 | (hy₀ y).trans (and_iff_right hz_box) |
| 951 | simp only [← h_conj, latticeUnitary_smul, ← hz, mem_integralBox, add_mul, ← star_idem, |
| 952 | idem_conjClosure_eq_add_star hπ.isConjDisjoint, |
| 953 | add_mem_cancel_left (idem_mul_neighbour_add_translation_mem hπ hz_idem y _)] |
| 954 | exact ⟨y₀, (h_iff y₀).2 rfl, fun y hy ↦ ((h_iff y).1 hy).symm⟩ |
| 955 | |
| 956 | omit [Fintype X] [Fintype X'] [Fintype X''] [DecidableEq X'] in |
| 957 | /-- Under `hπ`, the translations `n y = neighbourTranslation X X'' y` are supported above `N`: |
| 958 | multiplication by the idempotent `idem` of `P` and its conjugate places fixes them. -/ |
| 959 | lemma idem_conjClosure_smul_neighbourTranslation {π : (𝔸f E)ˣ} [Fact N.Prime] |
| 960 | (hπ : IsSplitSquarefree P (N : E) π) (y : X' → P → ZMod N) : |
| 961 | (idem (P : Set (FinPlace E)).conjClosure : 𝔸f E) • neighbourTranslation X X'' y = |
| 962 | neighbourTranslation X X'' y := by |
| 963 | rw [← star_idem_smul_neighbourTranslation, smul_smul, |
| 964 | idem_conjClosure_eq_add_star hπ.isConjDisjoint, |
| 965 | add_mul, idem_mul_star hπ.isConjDisjoint, star_idem_mul_self, zero_add] |
| 966 | |
| 967 | /-- The representative `n y + t`, where `n y = neighbourTranslation X X'' y` is attached to residues |
| 968 | `y` at `P` and `t` is the chosen representative of a class in `AwayLatticeQuotient`. -/ |
| 969 | def neighbourCosetRep {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} {κ : PairIndex X X'' → 𝔸f E} |
| 970 | [DecidableEq X] [DecidableEq X''] |
| 971 | {hπ : IsSplitSquarefree P (N : E) π} {hκ : IsScalingAtM N β δ κ} |
| 972 | (a : (X' → P → ZMod N) × AwayLatticeQuotient X' hπ hκ) : PairIndex X X'' × X' → 𝔸f E := |
| 973 | neighbourTranslation X X'' a.1 + a.2.out.val |
| 974 | |
| 975 | /-- Let `N` be prime, `IsSplitLevel P N`, `IsSplitSquarefree P (N : E) π` and |
| 976 | `IsScalingAtM N β δ κ`. Then `neighbourCosetRep a` lies in `neighbourLattice X' hπ hκ`, the image of |
| 977 | the standard lattice under `latticeUnitary`. -/ |
| 978 | lemma neighbourCosetRep_mem_neighbourLattice {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 979 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] [Fact N.Prime] |
| 980 | (hP : IsSplitLevel P N) (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 981 | (a : (X' → P → ZMod N) × AwayLatticeQuotient X' hπ hκ) : |
| 982 | neighbourCosetRep a ∈ neighbourLattice X' hπ hκ := |
| 983 | add_mem (neighbourTranslation_mem_neighbourLattice hP hπ hκ a.1) a.2.out.property.1 |
| 984 | |
| 985 | /-- For a prime `N` and a finite set `P` of places with `N = π π̄` split and squarefree |
| 986 | (`IsSplitSquarefree`), let `z` be a matrix indexed by `PairIndex X X'' × X'`, let `y` be residues |
| 987 | modulo `N` at `P` and `q` a class in `AwayLatticeQuotient`, with `κ` the factors scaling the rows |
| 988 | at the places dividing `β` and `β̄`, each `1` or an adele `δ` of norm one that is `1` above `N` |
| 989 | (`IsScalingAtM`), and let `e` be the idempotent of `P` and its conjugate places. Then |
| 990 | `z - neighbourCosetRep (y, q)` is integral (`stdLattice`) if and only if the part above `N` of |
| 991 | `neighbourTranslation X X'' y - z` is integral and `z - e • z` differs from a representative of |
| 992 | `q` by an integral matrix. -/ |
| 993 | private lemma sub_neighbourCosetRep_mem_stdLattice_iff {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 994 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] [Fact N.Prime] |
| 995 | (hπ : IsSplitSquarefree P (N : E) π) {hκ : IsScalingAtM N β δ κ} |
| 996 | (z : PairIndex X X'' × X' → 𝔸f E) (y : X' → P → ZMod N) |
| 997 | (q : AwayLatticeQuotient X' hπ hκ) : |
| 998 | let e : 𝔸f E := idem (P : Set (FinPlace E)).conjClosure |
| 999 | z - neighbourCosetRep (y, q) ∈ stdLattice E _ ↔ |
| 1000 | e • (-z + neighbourTranslation X X'' y) ∈ stdLattice E _ ∧ |
| 1001 | -q.out.val + (z - e • z) ∈ stdLattice E _ := by |
| 1002 | intro e |
| 1003 | have h_part : e • (z - neighbourCosetRep (y, q)) = |
| 1004 | -(e • (-z + neighbourTranslation X X'' y)) := by |
| 1005 | rw [neighbourCosetRep, smul_sub, smul_add, mem_vanishingAbove.1 q.out.property.2, smul_add, |
| 1006 | smul_neg] |
| 1007 | abel |
| 1008 | have h_split : z - neighbourCosetRep (y, q) = |
| 1009 | -(e • (-z + neighbourTranslation X X'' y)) + (-q.out.val + (z - e • z)) := by |
| 1010 | rw [neighbourCosetRep, smul_add, smul_neg, idem_conjClosure_smul_neighbourTranslation hπ] |
| 1011 | abel |
| 1012 | refine ⟨fun h ↦ ?_, fun ⟨h_int, h_away⟩ ↦ ?_⟩ |
| 1013 | · have h_neg : -(e • (-z + neighbourTranslation X X'' y)) ∈ stdLattice E _ := |
| 1014 | by simpa only [← h_part] using smul_mem_stdLattice (idem_mem_Ô _) h |
| 1015 | rw [h_split, add_mem_cancel_left h_neg] at h |
| 1016 | exact ⟨neg_mem_iff.1 h_neg, h⟩ |
| 1017 | · rw [h_split] |
| 1018 | exact add_mem (neg_mem h_int) h_away |
| 1019 | |
| 1020 | /-- Let the prime `N` be split as `P` and its conjugate, let `N = π π̄` with `π` a uniformiser on |
| 1021 | `P` and a unit elsewhere, and let `κ` be row factors that are `1` above `N` (`IsScalingAtM`). Then |
| 1022 | each `z` in `neighbourLattice` differs by a matrix with integral entries (`stdLattice`) from |
| 1023 | `neighbourCosetRep (y, q)` for exactly one pair `(y, q)`. Here `y` is a family of residues modulo |
| 1024 | `N` at `P`, `q` is a class of lattice elements vanishing above `N` modulo integral ones, and |
| 1025 | `neighbourCosetRep (y, q)` is `neighbourTranslation X X'' y` plus the chosen representative of |
| 1026 | `q`. -/ |
| 1027 | lemma existsUnique_sub_neighbourCosetRep_mem {π : (𝔸f E)ˣ} {β : Ô E} {δ : 𝔸f E} |
| 1028 | {κ : PairIndex X X'' → 𝔸f E} [DecidableEq X] [DecidableEq X''] [Fact N.Prime] |
| 1029 | (hP : IsSplitLevel P N) (hπ : IsSplitSquarefree P (N : E) π) (hκ : IsScalingAtM N β δ κ) |
| 1030 | {z : PairIndex X X'' × X' → 𝔸f E} (hz : z ∈ neighbourLattice X' hπ hκ) : |
| 1031 | ∃! a : (X' → P → ZMod N) × AwayLatticeQuotient X' hπ hκ, |
| 1032 | z - neighbourCosetRep a ∈ stdLattice E (PairIndex X X'' × X') := by |
| 1033 | -- The part of `z` above `N` decides `y`; the part `z'` away from `N` decides the class `q`. |
| 1034 | set e : 𝔸f E := idem (P : Set (FinPlace E)).conjClosure |
| 1035 | have h_above : e • z ∈ neighbourLattice X' hπ hκ := by |
| 1036 | obtain ⟨x, hx, rfl⟩ := hz |
| 1037 | exact ⟨e • x, smul_mem_stdLattice (idem_mem_Ô _) hx, mulVec_smul ..⟩ |
| 1038 | let z' : awayLattice X' hπ hκ := |
| 1039 | ⟨z - e • z, AddSubgroup.mem_inf.2 ⟨sub_mem hz h_above, sub_idem_smul_mem_vanishingAbove z⟩⟩ |
| 1040 | obtain ⟨y₀, hy₀, hy₀_unique⟩ : |
| 1041 | ∃! y : X' → P → ZMod N, e • (-z + neighbourTranslation X X'' y) ∈ stdLattice E _ := |
| 1042 | existsUnique_add_neighbourTranslation_mem hP hπ hκ (neg_mem hz) |
| 1043 | have h_iff (y : X' → P → ZMod N) (q : AwayLatticeQuotient X' hπ hκ) : |
| 1044 | z - neighbourCosetRep (y, q) ∈ stdLattice E _ ↔ |
| 1045 | e • (-z + neighbourTranslation X X'' y) ∈ stdLattice E _ ∧ q = z' := by |
| 1046 | have h_class : q = z' ↔ -q.out.val + (z - e • z) ∈ stdLattice E _ := by |
| 1047 | conv_lhs => rw [← q.out_eq', QuotientAddGroup.eq] |
| 1048 | rfl |
| 1049 | rw [h_class] |
| 1050 | exact sub_neighbourCosetRep_mem_stdLattice_iff hπ z y q |
| 1051 | refine ⟨(y₀, z'), (h_iff _ _).2 ⟨hy₀, rfl⟩, fun ⟨y, q⟩ h ↦ ?_⟩ |
| 1052 | obtain ⟨hy, hq⟩ := (h_iff y q).1 h |
| 1053 | exact Prod.ext (hy₀_unique y hy) hq |
| 1054 | |
| 1055 | end |
| 1056 | |
| 1057 | end New.Seesaw |