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.MixedModel.AdaptedSplitting |
| 4 | import Lib.ClassField.HeckeCharacter.SplitTameCharacters |
| 5 | public import Lib.Weil.DualPair.WeilAction -- shake: keep (needed public by an exposed definition) |
| 6 | |
| 7 | /-! |
| 8 | # Coordinates on a line parabolic and Poisson's formula for terms along lines |
| 9 | |
| 10 | This file concerns the stabiliser of an isotropic line in a hermitian space `V'`, split by |
| 11 | `D : V'.Splitting V Unit` into a hyperbolic plane and `V`. It gives coordinates on the unipotent |
| 12 | radical and on the Levi factor of this stabiliser. |
| 13 | |
| 14 | ## Main definitions and results |
| 15 | |
| 16 | * `New.Exchange.lineTerm`: two families, indexed by an adele, of operators from `Hom(W', V')` data |
| 17 | to those of `Hom(W, V)`: a rank-one translation, then both zero terms. |
| 18 | * `New.Exchange.lineTerm_pairWeil_levi`: if the line of `W'` is fixed or `W` and `V` have equal |
| 19 | rank, they intertwine the Weil representations `New.pairWeil` on Levi elements, up to a scalar and |
| 20 | a rescaling of the adele. |
| 21 | * `New.Exchange.tsum_lineTerm`: the theta sums over `E` of the two families agree, since they are |
| 22 | the two mixed models of one hyperbolic plane. |
| 23 | * `New.Exchange.lineTermSplitting`, `New.Exchange.frameAt_lineTermSplitting`: the splittings behind |
| 24 | the two models, and their frames. |
| 25 | |
| 26 | Notions from other files: |
| 27 | * `New.Space`: a hermitian space over `E` with Gram matrix `J` and an adelic frame `x` that |
| 28 | diagonalises `J` at every place; `𝒮 V` is its data space and `θ V` the theta functional on it. |
| 29 | * `New.Space.Splitting`: for `D : V.Splitting V₀ p`, dual isotropic frames `k`, `l` indexed by `p` |
| 30 | and an isometric embedding `i` of `V₀` orthogonal to both, which together fill `V`. |
| 31 | * `New.Space.Splitting.zeroTerm`: the map `𝒮 V → 𝒮 V₀` that averages over the adelic span of `k` |
| 32 | modulo its rational points; `D.slice x` is translation by `l x` followed by it. |
| 33 | * `New.Space.Splitting.levi`: the homomorphism sending `(m, g₀)` to the element that acts by `m` on |
| 34 | the frame `k`, by `g₀` on `V₀` and by `m*⁻¹` on the frame `l`. |
| 35 | * `New.pairWeil W V a b`: the Weil representation of the two unitary groups on `𝒮 (W.hom V)`, |
| 36 | twisted by the automorphic characters `a` and `b` of the determinants. |
| 37 | |
| 38 | ## Relation to the literature |
| 39 | |
| 40 | Known; see `Lib.SiegelWeil.Tower.LargeSideConstantTerm` for sources. |
| 41 | -/ |
| 42 | |
| 43 | @[expose] public section |
| 44 | |
| 45 | noncomputable section |
| 46 | |
| 47 | namespace New.Exchange |
| 48 | |
| 49 | /-! |
| 50 | ## Coordinates on the radical and Levi factor of a line stabiliser |
| 51 | |
| 52 | For a splitting `D : V'.Splitting V Unit` of `V'` into a hyperbolic plane and `V`, coordinates on |
| 53 | the stabiliser of the isotropic line: `New.Exchange.lineRadical` on the unipotent radical and |
| 54 | `New.Exchange.lineLevi` on the Levi factor. |
| 55 | -/ |
| 56 | |
| 57 | section LineParabolic |
| 58 | |
| 59 | variable {E n m : Type} [Field E] [CMType E] [WeilData E] [Fintype n] [DecidableEq n] [Fintype m] |
| 60 | [DecidableEq m] {s : n → ℤˣ} {t : m → ℤˣ} {V' : Space E m t} {V : Space E n s} |
| 61 | (D : V'.Splitting V Unit) |
| 62 | |
| 63 | /-- The element `D.radicalElement c b` of the unipotent radical with `c = V.x⁻¹ * q.1` and |
| 64 | `b = 2 q.2`. -/ |
| 65 | abbrev lineRadical (q : Matrix n Unit (𝔸 E) × Matrix Unit Unit (𝔸 E)) : G E t := |
| 66 | D.radicalElement (V.x⁻¹.val * q.1) (toAdele (2 : E) • q.2) |
| 67 | |
| 68 | /-- The homomorphism that sends an idele `a` and an element `g` of the group of `V` to the Levi |
| 69 | element `D.levi (a⁻¹, g)`, which acts by `a⁻¹` on the isotropic line. -/ |
| 70 | def lineLevi : (𝔸 E)ˣ × G E s →* G E t := |
| 71 | D.levi.comp (((Matrix.GeneralLinearGroup.scalar Unit).comp invMonoidHom).prodMap (.id (G E s))) |
| 72 | |
| 73 | end LineParabolic |
| 74 | |
| 75 | /-! |
| 76 | ## Terms along a line in two models and Poisson's formula |
| 77 | |
| 78 | Let `A` split `W'` as a hyperbolic plane plus `W`, and `X` split `V'` as a hyperbolic plane plus `V` |
| 79 | (`New.Space.Splitting`: isotropic dual frames `k`, `l` and an isometry `i`; `kAdelic`, `lAdelic`, |
| 80 | `iAdelic` are these in adelic coordinates, `kCoord`, `lCoord`, `iCoord` the forms that give the |
| 81 | three coordinates of a vector). |
| 82 | -/ |
| 83 | |
| 84 | section TwoLineTerms |
| 85 | |
| 86 | open Matrix Kronecker Fintype WeilData Space Splitting Function |
| 87 | |
| 88 | variable {E : Type} [Field E] [CMType E] [WeilData E] {n n' r r' : Type} [Fintype n] [DecidableEq n] |
| 89 | [Fintype n'] [DecidableEq n'] [Fintype r] [DecidableEq r] [Fintype r'] [DecidableEq r'] |
| 90 | {s : n → ℤˣ} {s' : n' → ℤˣ} {t : r → ℤˣ} {t' : r' → ℤˣ} {W : Space E n s} {W' : Space E n' s'} |
| 91 | {V : Space E r t} {V' : Space E r' t'} (A : W'.Splitting W Unit) (X : V'.Splitting V Unit) |
| 92 | |
| 93 | /-- The term at the adele `a`, from `𝒮 (W'.hom V')` to `𝒮 (W.hom V)`, in the model `β`. For |
| 94 | `β = true` it is translation by the map `a • X.kAdelic * A.kCoord`, followed by the zero term along |
| 95 | the line of `A` and then the one along the line of `X`. For `β = false` it is translation by |
| 96 | `a • X.lAdelic * A.lCoord`, followed by the zero term along the line of `X` and then that of `A`. -/ |
| 97 | noncomputable def lineTerm (β : Bool) (a : 𝔸 E) : 𝒮 (W'.hom V') →L[ℂ] 𝒮 (W.hom V) := |
| 98 | if β then (X.homTarget W).zeroTerm ∘L A.homSlice V' (a • X.kAdelic) |
| 99 | else (A.homSource V).zeroTerm ∘L (X.homTarget W').zeroTerm ∘L |
| 100 | ϱ (W'.hom V') (matrixToVec (a • X.lAdelic * A.lCoord)) |
| 101 | |
| 102 | section |
| 103 | |
| 104 | omit [WeilData E] |
| 105 | |
| 106 | /-- The block on `W` of the Levi element of `A` attached to an invertible `m` and a unitary `g` |
| 107 | is `g`. -/ |
| 108 | lemma iCoord_levi_iAdelic (m : GL Unit (𝔸 E)) (g : G E s) : |
| 109 | A.iCoord * ((A.levi (m, g)).adeleMatrix * A.iAdelic) = g.adeleMatrix := by |
| 110 | simp [Splitting.levi, Matrix.mul_assoc, G.adeleMatrix_ofMatrix, Matrix.add_mul, coord_mul_frame, |
| 111 | coord_mul_frame_mul] |
| 112 | |
| 113 | private lemma lineLevi_inv (c : (𝔸 E)ˣ) (h : G E t) : |
| 114 | (lineLevi X (c, h))⁻¹ = X.levi (GeneralLinearGroup.scalar Unit c, h⁻¹) := by |
| 115 | rw [← map_inv] |
| 116 | change X.levi (GeneralLinearGroup.scalar Unit ((c⁻¹)⁻¹), h⁻¹) = _ |
| 117 | rw [inv_inv] |
| 118 | |
| 119 | /-- The Levi element of `A` acting by the scalar `u` on its line, on the right, and the inverse of |
| 120 | `lineLevi X (c, h)`, on the left, scale the rank-one map `X.kAdelic * A.kCoord` by `c * u`. -/ |
| 121 | lemma lineLevi_inv_mul_kAdelic_mul_levi (u c : (𝔸 E)ˣ) (g : G E s) (h : G E t) : |
| 122 | (lineLevi X (c, h))⁻¹.adeleMatrix * |
| 123 | (X.kAdelic * (A.kCoord * (A.levi (GeneralLinearGroup.scalar Unit u, g)).adeleMatrix)) = |
| 124 | (↑(c * u) : 𝔸 E) • (X.kAdelic * A.kCoord) := by |
| 125 | rw [lineLevi_inv, ← Matrix.mul_assoc, X.actsOnFrame_levi _ _] |
| 126 | simp [A.adeleMatrix_levi, Matrix.mul_add, ← Matrix.mul_assoc A.kCoord, ← smul_eq_diagonal_mul, |
| 127 | Matrix.mul_assoc, smul_smul, mul_comm] |
| 128 | |
| 129 | /-- The Levi element of `A` acting by the scalar `u` on its line, on the right, and the inverse of |
| 130 | `lineLevi X (c, h)`, on the left, scale the rank-one map `X.lAdelic * A.lCoord` by the conjugate of |
| 131 | `(c * u)⁻¹`. -/ |
| 132 | lemma lineLevi_inv_mul_lAdelic_mul_levi (u c : (𝔸 E)ˣ) (g : G E s) (h : G E t) : |
| 133 | (lineLevi X (c, h))⁻¹.adeleMatrix * |
| 134 | (X.lAdelic * (A.lCoord * (A.levi (GeneralLinearGroup.scalar Unit u, g)).adeleMatrix)) = |
| 135 | star (↑(c * u)⁻¹ : 𝔸 E) • (X.lAdelic * A.lCoord) := by |
| 136 | rw [lineLevi_inv, ← Matrix.mul_assoc, X.levi_mul_lAdelic _ _, |
| 137 | A.lCoord_mul_adeleMatrix (A.actsOnFrame_levi _ _)] |
| 138 | simp [Pi.star_def, ← smul_eq_diagonal_mul, Matrix.mul_assoc, smul_smul, mul_comm] |
| 139 | |
| 140 | end |
| 141 | |
| 142 | /-- Equivariance of `lineTerm` under Levi elements. `lineTerm A X β ξ` is the term at the adele `ξ` |
| 143 | from data on `Hom(W', V')` to data on `Hom(W, V)`, in one of two models chosen by `β`. Let the idele |
| 144 | `u` act on the line of `A` in `W'` and `c⁻¹` on that of `X` in `V'`, and assume that `u = 1` or that |
| 145 | `W` and `V` have equal rank. Apply these Levi elements (with `g`, `h` on `W`, `V`) in the |
| 146 | representation twisted by `a * upsilonU1`, with `upsilonU1` the fixed splitting character on |
| 147 | norm-one ideles. The result is the following, with `x = c * u`: replace `ξ` by `ξ x` if `β` holds |
| 148 | and by `ξ (star x)⁻¹` otherwise, apply `(g, h)` in the representation twisted by `a`, and multiply |
| 149 | by `√|u|^(2 card r + 2) / (a.spaceChar (card n) x * √|x|^(card n + 2))`, where the `+ 2` in the last |
| 150 | exponent is present only when `β` is false. Here `a.spaceChar k` is the idele character attached to |
| 151 | `a` in rank `k`, and `|·|` is the idele norm `ideleAbs`. -/ |
| 152 | lemma lineTerm_pairWeil_levi {u : (𝔸 E)ˣ} (hu : u = 1 ∨ card r = card n) (a : AutChar E) (β : Bool) |
| 153 | (ξ : 𝔸 E) (g : G E s) (c : (𝔸 E)ˣ) (h : G E t) (f : 𝒮 (W'.hom V')) : |
| 154 | let x : (𝔸 E)ˣ := c * u |
| 155 | lineTerm A X β ξ (pairWeil W' V' (a * upsilonU1) (a * upsilonU1) |
| 156 | (A.levi (GeneralLinearGroup.scalar Unit u, g), lineLevi X (c, h)) f) = |
| 157 | (√(ideleAbs u) ^ (2 * card r + 2) / |
| 158 | ((a.spaceChar (card n)).val x * √(ideleAbs x) ^ (card n + (if β then 0 else 2))) : ℂ) • |
| 159 | pairWeil W V a a (g, h) (lineTerm A X β (ξ * (if β then ↑x else star ↑x⁻¹)) f) := by |
| 160 | intro x |
| 161 | -- The zero terms along the lines of `X` and of `A` under a Levi point, for any partner `T`. |
| 162 | have h_target {m : Type} [Fintype m] [DecidableEq m] {σ : m → ℤˣ} (T : Space E m σ) |
| 163 | (b b' : AutChar E) (k : G E σ) (φ : 𝒮 (T.hom V')) : |
| 164 | (X.homTarget T).zeroTerm (pairWeil T V' b (b' * upsilonU1) (k, lineLevi X (c, h)) φ) = |
| 165 | (((b.spaceChar (card m)).val c : ℂ)⁻¹ * (√(ideleAbs c) ^ card m : ℂ)⁻¹) • |
| 166 | pairWeil T V b b' (k, h) ((X.homTarget T).zeroTerm φ) := by |
| 167 | simpa [lineLevi] using X.homTarget_zeroTerm_pairWeil T b b' _ h _ |
| 168 | (X.actsOnFrame_levi (.scalar _ c⁻¹) h) (iCoord_levi_iAdelic X _ h) k φ |
| 169 | have h_source {m : Type} [Fintype m] [DecidableEq m] {σ : m → ℤˣ} (T : Space E m σ) |
| 170 | (b b' : AutChar E) (k : G E σ) (φ : 𝒮 (W'.hom T)) : |
| 171 | (A.homSource T).zeroTerm (pairWeil W' T (b * upsilonU1) b' (A.levi (.scalar _ u, g), k) φ) = |
| 172 | (((b'.spaceChar (card m)).val u : ℂ)⁻¹ * √(ideleAbs u) ^ card m) • |
| 173 | pairWeil W T b b' (g, k) ((A.homSource T).zeroTerm φ) := by |
| 174 | simpa using A.homSource_zeroTerm_pairWeil T b b' _ g _ |
| 175 | (A.actsOnFrame_levi (.scalar _ u) g) (iCoord_levi_iAdelic A _ g) k φ |
| 176 | -- The scalars given by the two laws agree with the stated one: if `u = 1` or the ranks are equal, |
| 177 | -- the powers of the splitting character and of the norm at `u` match, by field arithmetic. |
| 178 | obtain ⟨h_scalar_k, h_scalar_l⟩ : |
| 179 | (((a * upsilonU1).spaceChar (card r')).val u : ℂ)⁻¹ * √(ideleAbs u) ^ card r' * |
| 180 | (((a.spaceChar (card n)).val c : ℂ)⁻¹ * (√(ideleAbs c) ^ card n : ℂ)⁻¹) = |
| 181 | √(ideleAbs u) ^ (2 * card r + 2) / ((a.spaceChar (card n)).val x * √(ideleAbs x) ^ card n) ∧ |
| 182 | (((a * upsilonU1).spaceChar (card n')).val c : ℂ)⁻¹ * (√(ideleAbs c) ^ card n' : ℂ)⁻¹ * |
| 183 | (((a.spaceChar (card r)).val u : ℂ)⁻¹ * √(ideleAbs u) ^ card r) = |
| 184 | √(ideleAbs u) ^ (2 * card r + 2) / |
| 185 | ((a.spaceChar (card n)).val x * √(ideleAbs x) ^ (card n + 2)) := by |
| 186 | have h_abs (y : (𝔸 E)ˣ) : (√(ideleAbs y) : ℂ) ≠ 0 := |
| 187 | Complex.ofReal_ne_zero.mpr |
| 188 | ((Real.sqrt_ne_zero ideleAbs_nonneg_and_ne_zero.1).mpr ideleAbs_nonneg_and_ne_zero.2) |
| 189 | obtain hu | hu := hu |
| 190 | · simp only [AutChar.spaceChar, map_mul, baseChange_upsilonU1, X.card_eq, card_unique, mul_one, |
| 191 | pow_add, inv_pow, Subgroup.coe_mul, SubmonoidClass.coe_pow, InvMemClass.coe_inv, hu, |
| 192 | ContinuousMonoidHom.mul_apply, map_one, ContinuousMonoidHom.pow_apply, one_pow, |
| 193 | circleChar_inv_apply, inv_one, Circle.coe_one, Real.sqrt_one, Complex.ofReal_one, |
| 194 | Circle.coe_mul, Circle.coe_inv, Circle.coe_pow, _root_.mul_inv_rev, inv_inv, one_mul, |
| 195 | one_div, A.card_eq, x] |
| 196 | exact ⟨by ring, by field_simp [Circle.coe_ne_zero, h_abs]⟩ |
| 197 | · simp only [AutChar.spaceChar, map_mul, baseChange_upsilonU1, X.card_eq, hu, card_unique, |
| 198 | mul_one, pow_add, inv_pow, Subgroup.coe_mul, SubmonoidClass.coe_pow, InvMemClass.coe_inv, |
| 199 | ContinuousMonoidHom.mul_apply, ContinuousMonoidHom.pow_apply, circleChar_inv_apply, |
| 200 | Circle.coe_mul, Circle.coe_pow, Circle.coe_inv, _root_.mul_inv_rev, inv_inv, pow_mul', |
| 201 | mul_pow, ideleAbs_nonneg_and_ne_zero, Real.sqrt_mul, Complex.ofReal_mul, A.card_eq, x] |
| 202 | exact ⟨by field_simp [Circle.coe_ne_zero, h_abs], by field_simp [Circle.coe_ne_zero, h_abs]⟩ |
| 203 | -- In each model move `ϱ` across `pairWeil`, which rescales `ξ`, then apply the two laws. |
| 204 | cases β |
| 205 | · simp only [lineTerm, Bool.false_eq_true, ↓reduceIte, smul_mul, ContinuousLinearMap.comp_apply, |
| 206 | rho_pairWeil, vecToMatrix_matrixToVec, Matrix.mul_smul, Matrix.mul_assoc, |
| 207 | lineLevi_inv_mul_lAdelic_mul_levi, _root_.mul_inv_rev, Units.val_mul, star_mul', smul_smul, |
| 208 | h_target, map_smul, h_source, h_scalar_l, map_mul, Circle.coe_mul, ideleAbs_nonneg_and_ne_zero, |
| 209 | Real.sqrt_mul, Complex.ofReal_mul, x] |
| 210 | · simp only [lineTerm, ↓reduceIte, homSlice, smul_mul, ContinuousLinearMap.comp_apply, |
| 211 | rho_pairWeil, vecToMatrix_matrixToVec, Matrix.mul_smul, Matrix.mul_assoc, |
| 212 | lineLevi_inv_mul_kAdelic_mul_levi, Units.val_mul, smul_smul, h_source, map_smul, h_target, |
| 213 | h_scalar_k, map_mul, Circle.coe_mul, ideleAbs_nonneg_and_ne_zero, Real.sqrt_mul, |
| 214 | Complex.ofReal_mul, add_zero, x] |
| 215 | |
| 216 | /-- The index set of the isotropic frames that split `W'.hom V'` over `W.hom V`. The right summand |
| 217 | indexes one line of the hyperbolic plane `Hom(A, B) ⊕ Hom(A*, B*)`, where `A`, `A*` are the lines |
| 218 | spanned by `A.k`, `A.l` and `B`, `B*` those spanned by `X.k`, `X.l`. -/ |
| 219 | abbrev LineIndex (n r : Type) : Type := (Unit × (n ⊕ Unit) ⊕ r × Unit) ⊕ Unit × Unit |
| 220 | |
| 221 | /-- A shortcut: the search for this instance inside larger index sets exceeds the default size. -/ |
| 222 | instance : DecidableEq (LineIndex n r) := inferInstance |
| 223 | |
| 224 | /-- The splitting of `Hom(W', V')` along `Hom(W ⊕ A*, B) ⊕ Hom(A*, V)`, over the plane |
| 225 | `Hom(A, B) ⊕ Hom(A*, B*)` plus `Hom(W, V)`. Here `hyperbolicSum p T` is the orthogonal sum of |
| 226 | `card p` hyperbolic planes and `T`, and `A`, `A*`, `B`, `B*` are the lines as in `LineIndex`. -/ |
| 227 | noncomputable def planeSplitting : |
| 228 | (W'.hom V').Splitting (hyperbolicSum (Unit × Unit) (W.hom V)) |
| 229 | (Unit × (n ⊕ Unit) ⊕ r × Unit) := by |
| 230 | -- `A.kᴴ * W'.J`, `A.lᴴ * W'.J` and `W.J⁻¹ * A.iᴴ * W'.J` are the coordinates on `W'` along |
| 231 | -- `A*`, `A` and `W`. The relations of the frame follow from those of `A` and `X`. |
| 232 | use fromCols (X.k ⊗ₖ (fromRows (W.J * (W.J⁻¹ * A.iᴴ * W'.J)) (A.kᴴ * W'.J))ᵀ) |
| 233 | ((X.i * V.J⁻¹) ⊗ₖ (A.kᴴ * W'.J)ᵀ), |
| 234 | fromCols (X.l ⊗ₖ (fromRows (W.J⁻¹ * A.iᴴ * W'.J) (A.lᴴ * W'.J))ᵀ) (X.i ⊗ₖ (A.lᴴ * W'.J)ᵀ), |
| 235 | fromCols (fromCols (X.k ⊗ₖ (A.lᴴ * W'.J)ᵀ) (X.l ⊗ₖ (A.kᴴ * W'.J)ᵀ)) |
| 236 | (X.i ⊗ₖ (W.J⁻¹ * A.iᴴ * W'.J)ᵀ) |
| 237 | all_goals |
| 238 | simp [hom, hyperbolicSum, conjTranspose_J, ← W'.J⁻¹.mul_assoc, ← Matrix.mul_assoc _ (i _), |
| 239 | conjTranspose_nonsing_inv, conjTranspose_fromCols_eq_fromRows_conjTranspose, |
| 240 | conjTranspose_fromRows_eq_fromCols_conjTranspose, gram_kk, gram_ki, gram_ll, gram_li, gram_il, |
| 241 | gram_ii, gram_lk, gram_kl, gram_ik, conjTranspose_kronecker, |
| 242 | conjTranspose_transpose_eq_transpose_conjTranspose, ← mul_kronecker_mul, ← transpose_mul] |
| 243 | -- `↓`: the Gram relations must fire before their subterms are simplified. |
| 244 | all_goals simp [← ext_iff, A.card_eq, X.card_eq, Matrix.mul_assoc, ↓gram_ik, ↓gram_ii, ↓gram_il, |
| 245 | fromBlocks_one] |
| 246 | ring |
| 247 | |
| 248 | variable (W V) in |
| 249 | /-- The two splittings over `Hom(W, V)` of the plane `Hom(A, B) ⊕ Hom(A*, B*)` plus `Hom(W, V)`. |
| 250 | For `β = true` the first line is the frame `l` of the translation and the second the frame `k` of |
| 251 | the zero term; for `β = false` the two lines are exchanged. -/ |
| 252 | noncomputable def planeModel (β : Bool) : |
| 253 | (hyperbolicSum (Unit × Unit) (W.hom V)).Splitting (W.hom V) (Unit × Unit) := |
| 254 | cond β (removePlanes (Unit × Unit) (W.hom V)) (removePlanes (Unit × Unit) (W.hom V)).symm |
| 255 | |
| 256 | /-- In each model, the adelic frame `l` of the plane, embedded in `Hom(W', V')` by `planeSplitting`, |
| 257 | is the Kronecker product of the frames of the two lines that translate in `lineTerm`. -/ |
| 258 | lemma planeSplitting_iAdelic_mul_planeModel_lAdelic (β : Bool) : |
| 259 | (planeSplitting A X).iAdelic * (planeModel W V β).lAdelic = |
| 260 | cond β (X.kAdelic ⊗ₖ A.kCoordᵀ) (X.lAdelic ⊗ₖ A.lCoordᵀ) := by |
| 261 | cases β <;> simp [planeModel, planeSplitting, removePlanes, Splitting.symm, kAdelic, lAdelic, |
| 262 | iAdelic, kCoord, lCoord, Space.map_J, hom_point_inv_mul_kronecker, conjTranspose_map_toAdele, |
| 263 | Matrix.mul_assoc, ratMap_mul_toAdele, fromCols_mul_fromRows, -coe_units_inv, -transpose_mul] |
| 264 | |
| 265 | /-- Each line term is the zero term for `planeSplitting` followed by the mixed term `slice` |
| 266 | (translation by `l`, then the zero term) of `planeModel W V β`, the model `β` of the hyperbolic |
| 267 | plane, at the vector with single coordinate `a`. -/ |
| 268 | lemma lineTerm_eq_comp_zeroTerm (β : Bool) (a : 𝔸 E) : |
| 269 | lineTerm A X β a = |
| 270 | (planeModel W V β).slice (matrixToVec (scalar Unit a)) ∘L (planeSplitting A X).zeroTerm := by |
| 271 | -- Both sides are a zero term in stages after the same translation. |
| 272 | have h_zeroTerm : cond β ((A.homSource V').comp (X.homTarget W)).zeroTerm |
| 273 | ((X.homTarget W').comp (A.homSource V)).zeroTerm = |
| 274 | ((planeSplitting A X).comp (planeModel W V β)).zeroTerm := by |
| 275 | -- The hypotheses of `zeroTerm_congr`: the frames `k` are orthogonal, the embeddings `i` equal. |
| 276 | cases β <;> apply zeroTerm_congr <;> |
| 277 | simp [planeModel, planeSplitting, removePlanes, Splitting.symm, Splitting.comp, hom, |
| 278 | homSource, homTarget, conjTranspose_J, ← Matrix.mul_assoc _ (i _), |
| 279 | conjTranspose_nonsing_inv, conjTranspose_fromCols_eq_fromRows_conjTranspose, |
| 280 | fromCols_mul_fromRows, conjTranspose_fromRows_eq_fromCols_conjTranspose, gram_kk, gram_ki, |
| 281 | gram_kl, gram_lk, conjTranspose_kronecker, |
| 282 | conjTranspose_transpose_eq_transpose_conjTranspose, ← mul_kronecker_mul, ← transpose_mul] |
| 283 | -- `↓`: the Gram relation must fire before its product is reassociated. |
| 284 | all_goals simp [Matrix.mul_assoc, ↓gram_ik] |
| 285 | have h_point : ((planeSplitting A X).iAdelic * (planeModel W V β).lAdelic) *ᵥ |
| 286 | matrixToVec (diagonal fun _ : Unit ↦ a) = |
| 287 | a • matrixToVec (cond β (X.kAdelic * A.kCoord) (X.lAdelic * A.lCoord)) := by |
| 288 | cases β <;> simp [planeSplitting_iAdelic_mul_planeModel_lAdelic, matrixToVec_smul, |
| 289 | kronecker_mulVec_eq_matrixToVec, ← smul_eq_mul_diagonal, vecToMatrix_matrixToVec] |
| 290 | ext1 f |
| 291 | cases β <;> simp [lineTerm, homSlice, slice, ← zeroTerm_rho_iAdelic, ← zeroTerm_comp, h_point, |
| 292 | ← h_zeroTerm] |
| 293 | |
| 294 | /-- Poisson's formula along the line: the values of the theta functional `θ` at the line terms, |
| 295 | summed over the rational points `ξ : E`, have the same sum in the model `β` as in `true`. -/ |
| 296 | lemma tsum_lineTerm (β : Bool) (f : 𝒮 (W'.hom V')) : |
| 297 | ∑' ξ : E, θ (W.hom V) (lineTerm A X true (toAdele ξ) f) = |
| 298 | ∑' ξ : E, θ (W.hom V) (lineTerm A X β (toAdele ξ) f) := by |
| 299 | -- Both sums are the theta value of the zero term of `f` for `planeSplitting`. |
| 300 | have h_sum (b : Bool) : ∑' ξ : E, θ (W.hom V) (lineTerm A X b (toAdele ξ) f) = |
| 301 | θ (hyperbolicSum (Unit × Unit) (W.hom V)) ((planeSplitting A X).zeroTerm f) := by |
| 302 | let _ : Unique (Unit × Unit) := Unique.mk' (Unit × Unit) |
| 303 | let e : (Unit × Unit → E) ≃ E := Equiv.funUnique (Unit × Unit) E |
| 304 | have h_point (ξ : E) : matrixToVec (scalar Unit (toAdele ξ)) = toAdele ∘ e.symm ξ := |
| 305 | funext fun _ ↦ by simp [e, matrixToVec] |
| 306 | simp only [lineTerm_eq_comp_zeroTerm, h_point, ContinuousLinearMap.comp_apply] |
| 307 | rw [← ((planeModel W V b).hasSum_theta_slice _).tsum_eq, ← e.symm.tsum_eq] |
| 308 | rw [h_sum, h_sum] |
| 309 | |
| 310 | /-- The splitting of `Hom(W', V')` over `Hom(W, V)` behind the model `β`. -/ |
| 311 | noncomputable def lineTermSplitting (β : Bool) : (W'.hom V').Splitting (W.hom V) (LineIndex n r) := |
| 312 | (planeSplitting A X).comp (planeModel W V β) |
| 313 | |
| 314 | variable (W V) in |
| 315 | /-- The block-diagonal change of basis, built from `star W.x` and `adaptedHomBasis Unit V`, in which |
| 316 | the frame of `lineTermSplitting` is adapted (`isAdapted_lineTermSplitting`). -/ |
| 317 | noncomputable def lineTermBasis : GL (LineIndex n r) (𝔸 E) := |
| 318 | blockGL (blockGL (Matrix.GeneralLinearGroup.kronecker 1 (transposeGL (blockGL (star W.x, 1))), |
| 319 | adaptedHomBasis Unit V), 1) |
| 320 | |
| 321 | /-- Each line term is the mixed term `slice` (translation by `l`, then the zero term) of |
| 322 | `lineTermSplitting`, the composite of `planeSplitting` and the model `β`, at the vector with last |
| 323 | coordinate `a` and all others `0`, transformed by the conjugate transpose of the inverse of the |
| 324 | basis `lineTermBasis` (`matrixToVec` reads a matrix as a vector). -/ |
| 325 | lemma lineTerm_eq_slice (β : Bool) (a : 𝔸 E) : |
| 326 | lineTerm A X β a = (lineTermSplitting A X β).slice |
| 327 | ((lineTermBasis W V)⁻¹.valᴴ *ᵥ (0 ⊕ᵥ matrixToVec (scalar Unit a))) := by |
| 328 | -- Both sides are one zero term, taken in stages, after the same translation. |
| 329 | have h_point (v : Unit × Unit → 𝔸 E) : |
| 330 | ((lineTermSplitting A X β).lAdelic * (lineTermBasis W V)⁻¹.valᴴ) *ᵥ (0 ⊕ᵥ v) = |
| 331 | ((planeSplitting A X).iAdelic * (planeModel W V β).lAdelic) *ᵥ v := by |
| 332 | rw [lineTermSplitting, comp_lAdelic] |
| 333 | simp [lineTermBasis, ← map_inv, fromBlocks_conjTranspose, fromCols_mul_fromBlocks, |
| 334 | -coe_units_inv] |
| 335 | ext1 f |
| 336 | simp [lineTerm_eq_comp_zeroTerm, slice, ← h_point, lineTermSplitting, ← zeroTerm_rho_iAdelic, |
| 337 | ← zeroTerm_comp, -coe_units_inv] |
| 338 | |
| 339 | /-- The frame of `lineTermSplitting` in the basis `lineTermBasis` at the group element `1` |
| 340 | (`frameAt`: the columns of `l`, `k` and `i` in adelic coordinates), as a block matrix of Kronecker |
| 341 | products of the frames of `X` and `A`; `stdForm` is the diagonal matrix of the signs. The two models |
| 342 | differ by the exchange of two columns. -/ |
| 343 | lemma frameAt_lineTermSplitting (β : Bool) : |
| 344 | (lineTermSplitting A X β).frameAt 1 (lineTermBasis W V) = |
| 345 | ((((X.lAdelic ⊗ₖ fromCols A.iCoordᵀ A.kCoordᵀ).fromCols (X.iAdelic ⊗ₖ A.kCoordᵀ)).fromCols |
| 346 | (cond β (X.kAdelic ⊗ₖ A.kCoordᵀ) (X.lAdelic ⊗ₖ A.lCoordᵀ))).fromCols |
| 347 | (((X.kAdelic ⊗ₖ fromCols (A.iAdelicᴴ * stdForm E s')ᵀ A.lCoordᵀ).fromCols |
| 348 | ((X.iAdelic * stdForm E t) ⊗ₖ A.lCoordᵀ)).fromCols |
| 349 | (cond β (X.lAdelic ⊗ₖ A.lCoordᵀ) (X.kAdelic ⊗ₖ A.kCoordᵀ)))).fromCols |
| 350 | (X.iAdelic ⊗ₖ A.iCoordᵀ) := by |
| 351 | -- Compare the three column blocks: the basis and its dual are block diagonal, so they act on each |
| 352 | -- frame separately. |
| 353 | simp only [Splitting.frameAt, inv_one, G.adeleMatrix_one, Matrix.one_mul, fromCols_ext_iff] |
| 354 | -- Open `hom` only after rewriting with `hom_point_inv_mul_kronecker`. |
| 355 | cases β <;> |
| 356 | simp only [lAdelic, lineTermSplitting, Splitting.comp, planeSplitting, Matrix.mul_assoc, |
| 357 | mul_inv_cancel_left_of_invertible, planeModel, removePlanes, Splitting.symm, cond_eq_ite, |
| 358 | Bool.false_eq_true, ↓reduceIte, fromCols_mul_fromRows, Matrix.mul_one, Matrix.mul_zero, |
| 359 | add_zero, zero_add, fromCols_map, mul_fromCols, hom_point_inv_mul_kronecker, fromRows_map, |
| 360 | Matrix.map_mul, map_J_inv, Space.map_J, fromRows_mul, Units.inv_mul_cancel_right, |
| 361 | lineTermBasis, |
| 362 | Matrix.GeneralLinearGroup.kronecker, Units.val_one, transposeGL, star, val_blockGL_apply, |
| 363 | ← map_inv, Prod.inv_mk, |
| 364 | Units.inv_mk, inv_one, adaptedHomBasis, inv_inv, fromBlocks_conjTranspose, |
| 365 | conjTranspose_kronecker, conjTranspose_one, |
| 366 | conjTranspose_transpose_eq_transpose_conjTranspose, |
| 367 | conjTranspose_conjTranspose, conjTranspose_zero, fromCols_mul_fromBlocks, ← mul_kronecker_mul, |
| 368 | ← transpose_mul, iCoord, iAdelic, ratMap, conjTranspose_mul, conjTranspose_map_toAdele, |
| 369 | kCoord, kAdelic, lCoord] |
| 370 | <;> simp only [coe_units_inv, conjTranspose_nonsing_inv, fromBlocks_mul_fromRows, |
| 371 | isUnits_det_units, nonsing_inv_mul_cancel_left, Matrix.zero_mul, add_zero, Matrix.one_mul, |
| 372 | zero_add, transpose_fromRows, det_conjTranspose, isUnit_star, mul_nonsing_inv, mul_one, |
| 373 | and_self, hom, ← mul_kronecker_mul, Matrix.mul_assoc, ← transpose_mul] |
| 374 | |
| 375 | /-- If the frames of `A` and `X` are orthonormal at the infinite places and integral at the finite |
| 376 | ones, so is the frame of `lineTermSplitting` in the basis `lineTermBasis`. -/ |
| 377 | lemma isAdapted_lineTermSplitting [hA : IsBaseAdapted A] [hX : IsBaseAdapted X] (β : Bool) : |
| 378 | (lineTermSplitting A X β).IsAdapted 1 (lineTermBasis W V) := by |
| 379 | -- Up to signs `stdForm` on both sides, the frame is a choice of columns, listed by `cols`, of the |
| 380 | -- Kronecker product of the adapted frame of `X` and the entrywise conjugate of that of `A`. Here |
| 381 | -- `colMap .inl` lists the columns of the frame `l` and `colMap .inr` those of `k`. |
| 382 | let colMap (x : Unit → Unit ⊕ Unit) : LineIndex n r → ((Unit ⊕ Unit) ⊕ r) × ((Unit ⊕ Unit) ⊕ n) |
| 383 | | .inl (.inl (b, .inl i)) => (.inl (x b), .inr i) |
| 384 | | .inl (.inl (b, .inr a)) => (.inl (x b), .inl (x a)) |
| 385 | | .inl (.inr (j, a)) => (.inr j, .inl (x a)) |
| 386 | | .inr (b, a) => (.inl (cond β (x b).swap (x b)), .inl (cond β (x a) (x a).swap)) |
| 387 | let signs : (LineIndex n r ⊕ LineIndex n r) ⊕ r × n → ℤˣ := |
| 388 | (fun p : Unit × (n ⊕ Unit) ↦ (s ⊕ᵥ 1) p.2) ⊕ᵥ 1 ⊕ᵥ 1 ⊕ᵥ |
| 389 | (1 ⊕ᵥ (fun p : r × Unit ↦ t p.1) ⊕ᵥ 1) ⊕ᵥ fun p : r × n ↦ s p.2 |
| 390 | let cols : (LineIndex n r ⊕ LineIndex n r) ⊕ r × n → ((Unit ⊕ Unit) ⊕ r) × ((Unit ⊕ Unit) ⊕ n) := |
| 391 | colMap .inl ⊕ᵥ colMap .inr ⊕ᵥ Prod.map .inr .inr |
| 392 | let inv : ((Unit ⊕ Unit) ⊕ r) × ((Unit ⊕ Unit) ⊕ n) → |
| 393 | (LineIndex n r ⊕ LineIndex n r) ⊕ r × n |
| 394 | | (.inl (.inl ()), .inr i) => .inl (.inl (.inl (.inl ((), .inl i)))) |
| 395 | | (.inl (.inr ()), .inr i) => .inl (.inr (.inl (.inl ((), .inl i)))) |
| 396 | | (.inr j, .inl (.inl ())) => .inl (.inl (.inl (.inr (j, ())))) |
| 397 | | (.inr j, .inl (.inr ())) => .inl (.inr (.inl (.inr (j, ())))) |
| 398 | | (.inr j, .inr i) => .inr (j, i) |
| 399 | | (.inl (.inl ()), .inl (.inl ())) => .inl (.inl (.inl (.inl ((), .inr ())))) |
| 400 | | (.inl (.inr ()), .inl (.inr ())) => .inl (.inr (.inl (.inl ((), .inr ())))) |
| 401 | | (.inl (.inl ()), .inl (.inr ())) => |
| 402 | cond β (.inl (.inr (.inr ((), ()))) ) (.inl (.inl (.inr ((), ())))) |
| 403 | | (.inl (.inr ()), .inl (.inl ())) => |
| 404 | cond β (.inl (.inl (.inr ((), ()))) ) (.inl (.inr (.inr ((), ())))) |
| 405 | have h_cols : Injective cols := by |
| 406 | refine LeftInverse.injective (g := inv) fun a ↦ ?_ |
| 407 | cases β <;> |
| 408 | rcases a with (⟨⟨⟨_, _ | _⟩ | _⟩ | _⟩ | ⟨⟨⟨_, _ | _⟩ | _⟩ | _⟩) | ⟨_, _⟩ <;> rfl |
| 409 | refine .of_eq_submatrix_mul (.mul (.of_stdForm fun p ↦ s' p.2) |
| 410 | (hX.isOrthoIntegral.kronecker hA.isOrthoIntegral)) cols (.of_stdForm signs) ?_ h_cols |
| 411 | rw [frameAt_lineTermSplitting] |
| 412 | -- The matrix identity, block by block: every entry is a signed product of entries of the frames. |
| 413 | clear hA hX h_cols inv |
| 414 | cases β <;> |
| 415 | simp only [iCoord, stdForm, iAdelic, Matrix.mul_assoc, transpose_mul, diagonal_transpose, |
| 416 | kCoord, lCoord, cond_eq_ite, Bool.false_eq_true, ↓reduceIte, |
| 417 | conjTranspose_fromCols_eq_fromRows_conjTranspose, Sum.swap_inl, Sum.swap_inr, ← ext_iff, |
| 418 | mul_diagonal, submatrix_apply, id_eq, diagonal_mul, kroneckerMap_apply, transpose_apply, |
| 419 | Sum.forall, fromCols_apply_inl, Sum.elim_inl, Prod.forall, conjTranspose_apply, |
| 420 | fromRows_apply_inr, fromCols_apply_inr, fromRows_apply_inl, Sum.elim_inr, Pi.one_apply, |
| 421 | Units.val_one, Int.cast_one, Subsingleton.forall₂_iff, Prod.map_fst, Prod.map_snd, cols, |
| 422 | colMap, signs] |
| 423 | <;> ac_nf |
| 424 | <;> simp only [eq_self, and_self, implies_true] |
| 425 | |
| 426 | end TwoLineTerms |
| 427 | |
| 428 | end New.Exchange |
| 429 | |
| 430 | end |