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 Aesop.BuiltinRules |
| 4 | import Mathlib.LinearAlgebra.Matrix.Module |
| 5 | import Mathlib.NumberTheory.SumFourSquares |
| 6 | import Mathlib.Topology.UniformSpace.Uniformizable |
| 7 | public import Lib.Shimura.ComplexTheta.DimensionFormula |
| 8 | import Lib.General.Analysis.GaussianIntegral |
| 9 | import Lib.PadicComparison.Descent.TestCategory |
| 10 | import Lib.Shimura.GoodReduction.TorsionSizes |
| 11 | import Lib.Shimura.Uniformisation.HolomorphicFamilies |
| 12 | |
| 13 | /-! |
| 14 | # Hermitian tori with multiplications, Gauss sums and unfolding of the Poincaré kernel |
| 15 | |
| 16 | Let `V / L` be a complex torus with multiplications `F` by a ring `R` with involution and a |
| 17 | polarising hermitian form `B`. The hypothesis `New.ThetaTori.IsHermitianAction` gives the |
| 18 | compatibilities between these data. |
| 19 | |
| 20 | ## Main definitions and results |
| 21 | |
| 22 | * `New.ThetaTori.IsHermitianAction`: `B` is positive hermitian, its Riemann form is integral on `L`, |
| 23 | `F (star a)` is adjoint to `F a`, and `star β = 1 - β`. |
| 24 | * `New.ThetaTori.IsHermitianAction.isAppellHumbert`: the canonical multiplier |
| 25 | `New.ThetaTori.IsHermitianAction.multiplier` of `F β` gives Appell–Humbert data. |
| 26 | * `New.ThetaTori.IsHermitianAction.MulKernel`, `New.ThetaTori.IsHermitianAction.card_mulKernel`: the |
| 27 | kernel `a⁻¹ L / L` of `a ≠ 0` on the torus has order `|det (F a)|²`. |
| 28 | * `New.ThetaTori.IsHermitianAction.normShift_sum_eq_char_smul`: averaging normalised translates over |
| 29 | this kernel against a character gives an eigenvector. |
| 30 | * `New.ThetaTori.IsHermitianAction.sum_conj_pow_four_eq_sum_pow_four`: a quadratic Gauss sum over |
| 31 | `κ⁻¹ L / L` has a real fourth power. |
| 32 | * `New.ThetaTori.IsHermitianAction.isSelfAdjoint_quotMean_pow`: the mean of `x ↦ K(c̄ x, c x)` times |
| 33 | `conj (det c̄)` has a real fourth power; unfolding writes the mean as a Gauss sum times a Gaussian |
| 34 | integral. |
| 35 | |
| 36 | Notions from other files: |
| 37 | * `New.RealComplexForm.riemannForm`: The Riemann form of B: the alternating real form |
| 38 | E(u, v) = Im(B(u,v) − B(v,u))/(2π). |
| 39 | * `New.ThetaTori.normalizedShift`: The twisted translation `New.RealComplexForm.thetaShift`, |
| 40 | f ↦ (z ↦ exp(−B(x, z) − B(x, x)/2) f(z + x)), divided by the canonical multiplier at x. |
| 41 | * `New.IsAppellHumbert`: Appell–Humbert data: Re B is symmetric, and on L one has |χ| = 1 and |
| 42 | χ(l + m) = χ(l)χ(m)·exp(πi E(m, l)), E the Riemann form of B. |
| 43 | * `New.ThetaTori.LatticeForm.poincareSeries`: |
| 44 | K(x, y) = ∑_{l ∈ L} exp(B(x, y − x + l) − B(l,y) − B(l,l)/2)/χ(l), the sum of the terms |
| 45 | `New.ThetaTori.LatticeForm.poincareTerm`. |
| 46 | |
| 47 | ## Relation to the literature |
| 48 | |
| 49 | Known; see `Lib.Shimura.GoodReduction.MultiplicativeNorm` for sources. |
| 50 | -/ |
| 51 | |
| 52 | @[expose] public section |
| 53 | |
| 54 | noncomputable section |
| 55 | |
| 56 | section HermitianAction |
| 57 | |
| 58 | open Complex ComplexConjugate QuotientAddGroup LinearMap LinearEquiv NeZero Algebra.IsAlgebraic |
| 59 | |
| 60 | namespace New.ThetaTori |
| 61 | |
| 62 | variable {V R : Type} [FinComplexSpace V] [CommRing R] [StarRing R] |
| 63 | (L : Submodule ℤ V) (B : LatticeForm L) (F : R →+* V →L[ℂ] V) |
| 64 | (β : R) [IsDomain R] [Module.Finite ℤ R] |
| 65 | |
| 66 | /-! ### Hermitian data and invertibility of multiplications -/ |
| 67 | |
| 68 | /-- B : LatticeForm L is a positive definite hermitian form on V, ℂ-valued and ℂ-linear in its |
| 69 | second argument, with Riemann form integral on L, the action F of R on the finite-dimensional |
| 70 | complex space V (`FinComplexSpace V`) preserves L with ā adjoint to a, and β̄ = 1 − β. -/ |
| 71 | structure IsHermitianAction where |
| 72 | /-- Every multiplication `F a` maps the lattice `L` into itself. -/ |
| 73 | map_mem (a : R) : ∀ l ∈ L, F a l ∈ L |
| 74 | /-- The form `B` is hermitian. -/ |
| 75 | conj_symm (x y : V) : B x y = conj (B y x) |
| 76 | /-- The form `B` is positive definite. -/ |
| 77 | pos : ∀ x ≠ (0 : V), 0 < (B x x).re |
| 78 | /-- The adjoint of `F a` for `B` is `F (star a)`. -/ |
| 79 | adjoint (a : R) (x y : V) : B (F a x) y = B x (F (star a) y) |
| 80 | /-- The Riemann form of `B` takes integer values on `L`. -/ |
| 81 | riemannForm_integral : ∀ l ∈ L, ∀ m ∈ L, ∃ n : ℤ, B.riemannForm l m = n |
| 82 | /-- The element `β` and its conjugate add up to `1`. -/ |
| 83 | star_eq_one_sub : star β = 1 - β |
| 84 | |
| 85 | variable {L B F β} {x y : V} {f : V → ℂ} (h : IsHermitianAction L B F β) (a : R) [NeZero a] |
| 86 | |
| 87 | /-- `star a` is nonzero when `a` is. -/ |
| 88 | instance : NeZero (star a) := ⟨by simp [NeZero.ne a]⟩ |
| 89 | |
| 90 | omit [StarRing R] [IsDomain R] [Module.Finite ℤ R] in |
| 91 | /-- The multiplications `F r` and `F s` commute, as `R` is commutative. -/ |
| 92 | lemma action_comm (r s : R) (x : V) : F r (F s x) = F s (F r x) := by |
| 93 | simpa using DFunLike.congr_fun (congrArg F (mul_comm r s)) x |
| 94 | |
| 95 | omit [StarRing R] [Module.Finite ℤ R] in |
| 96 | /-- A nonzero element of the domain `R`, algebraic over `ℤ`, acts injectively on `V`. -/ |
| 97 | lemma action_injective [Algebra.IsAlgebraic ℤ R] : (⇑(F a)).Injective := by |
| 98 | -- `a` divides a nonzero integer `r`, and `F r` is multiplication by `r` on a complex space. |
| 99 | obtain ⟨b, r, hr, hab⟩ := exists_smul_eq_mul ℤ 1 (NeZero.ne a) |
| 100 | intro x y hxy |
| 101 | have h_key : F (r • 1) (x - y) = F (a * b) (x - y) := by rw [hab] |
| 102 | -- the left side is `r • (x - y)` and the right side is `F b (F a x - F a y) = 0` |
| 103 | have h_smul : (r : ℂ) • (x - y) = 0 := by |
| 104 | simpa [hxy, action_comm a, ← Int.cast_smul_eq_zsmul ℂ] using h_key |
| 105 | exact sub_eq_zero.mp ((smul_eq_zero.mp h_smul).resolve_left (Int.cast_ne_zero.mpr hr)) |
| 106 | |
| 107 | omit [StarRing R] [Module.Finite ℤ R] in |
| 108 | /-- A nonzero element of the domain `R`, algebraic over `ℤ`, acts invertibly on the |
| 109 | finite-dimensional complex space `V`. -/ |
| 110 | @[simp] |
| 111 | lemma action_isInvertible [Algebra.IsAlgebraic ℤ R] : (F a).IsInvertible := |
| 112 | ⟨(ofInjectiveEndo _ (action_injective a)).toContinuousLinearEquiv, rfl⟩ |
| 113 | |
| 114 | namespace IsHermitianAction |
| 115 | |
| 116 | /-! ### Multiplier, normalised translations and kernels -/ |
| 117 | |
| 118 | /-- The canonical multiplier x ↦ exp(πi E(βx, x)) of the hermitian data, where E is the Riemann |
| 119 | form of B. The hermitian data only fix `B`, `F` and `β`. -/ |
| 120 | @[simp] |
| 121 | abbrev multiplier (_ : IsHermitianAction L B F β) : V → ℂ := canonicalMultiplier B (F β) |
| 122 | |
| 123 | /-- Normalised translation by x, acting on functions V → ℂ: the twisted translation |
| 124 | `New.RealComplexForm.thetaShift` for B, divided by exp(πi E(βx, x)), E the Riemann form of B. The |
| 125 | hermitian data only fix `B`, `F` and `β`. -/ |
| 126 | @[simp] |
| 127 | abbrev normShift (_ : IsHermitianAction L B F β) : V → (V → ℂ) →ₗ[ℂ] V → ℂ := |
| 128 | normalizedShift B (F β) |
| 129 | |
| 130 | variable (L F) in |
| 131 | /-- The lattice a⁻¹L: the additive subgroup of the vectors y of V with ay in L, where a acts |
| 132 | through F. -/ |
| 133 | def divLattice (a : R) : AddSubgroup V := |
| 134 | L.toAddSubgroup.comap (F a).toAddMonoidHom |
| 135 | |
| 136 | /-- The kernel a⁻¹L / L of multiplication by a on the torus V/L. The hermitian action |
| 137 | provides the finite quotient instance. -/ |
| 138 | abbrev MulKernel (_ : IsHermitianAction L B F β) : Type := |
| 139 | divLattice L F a ⧸ L.toAddSubgroup.addSubgroupOf (divLattice L F a) |
| 140 | |
| 141 | omit [StarRing R] [IsDomain R] [Module.Finite ℤ R] [NeZero a] in |
| 142 | @[simp] |
| 143 | lemma map_divLattice_mem (z : divLattice L F a) : F a z ∈ L := z.prop |
| 144 | |
| 145 | omit [IsDomain R] [Module.Finite ℤ R] [NeZero a] in |
| 146 | /-- The chosen representative of a class in a⁻¹L / L lies in L exactly for the zero class. -/ |
| 147 | lemma out_mem_iff_eq_zero (z : h.MulKernel a) : z.out.val ∈ L ↔ z = 0 := by |
| 148 | conv_rhs => rw [← out_eq' z, eq_zero_iff] |
| 149 | rfl |
| 150 | |
| 151 | section |
| 152 | |
| 153 | omit [IsDomain R] [Module.Finite ℤ R] |
| 154 | |
| 155 | /-- For hermitian data `h` and the Riemann form `E` of `B`: `E(β u, w) = E(u, w) - E(u, β w)`, so |
| 156 | that `F β` behaves as one half of the identity. -/ |
| 157 | lemma riemannForm_apply_beta_eq_sub (h : IsHermitianAction L B F β) (u w : V) : |
| 158 | B.riemannForm (F β u) w = B.riemannForm u w - B.riemannForm u (F β w) := by |
| 159 | -- Move `F β` across the form by adjointness, and use `star β = 1 - β`. |
| 160 | simp [riemannForm, h.adjoint, h.star_eq_one_sub] |
| 161 | ring |
| 162 | |
| 163 | /-- For hermitian data `h`, the canonical multiplier of `F β` (`h.multiplier`) and `B` are |
| 164 | Appell–Humbert data (`New.IsAppellHumbert`). -/ |
| 165 | lemma isAppellHumbert (h : IsHermitianAction L B F β) : IsAppellHumbert B h.multiplier := |
| 166 | isAppellHumbert_canonicalMultiplier h.riemannForm_apply_beta_eq_sub |
| 167 | (fun x y ↦ by rw [h.conj_symm x y, conj_re]) |
| 168 | (fun u hu w hw ↦ h.riemannForm_integral _ (h.map_mem β u hu) _ hw) |
| 169 | |
| 170 | /-- Let `x` lie in the dual lattice of `B` (`E(x, l)` is an integer for `l ∈ L`, `E` the Riemann |
| 171 | form) and let `F (star a) y ∈ L`. Then the phase `exp (2πi E(F a x, y))` is `1`. -/ |
| 172 | lemma riemannPhase_eq_one (h : IsHermitianAction L B F β) {a : R} (hx : x ∈ B.dualLattice) |
| 173 | (hy : F (star a) y ∈ L) : |
| 174 | B.riemannPhase (F a x) y = 1 := by |
| 175 | -- By adjointness the exponent is `2πi` times the integer `B.riemannForm x (F (star a) y)`. |
| 176 | obtain ⟨n, hn⟩ : ∃ n : ℤ, B.riemannForm x (F (star a) y) = n := hx _ hy |
| 177 | have h_adj : B.riemannForm (F a x) y = n := by grind [riemannForm_def, h.adjoint, star_star] |
| 178 | simp [h_adj, mul_comm _ (n : ℂ)] |
| 179 | |
| 180 | /-- For `u, w ∈ L` the normalised translations by `u` and `w` compose to that by `u + w`: on `L` |
| 181 | the phase in their composition law is `1`. -/ |
| 182 | lemma normShift_normShift_of_mem (h : IsHermitianAction L B F β) {u w : V} (hu : u ∈ L) |
| 183 | (hw : w ∈ L) (g : V → ℂ) : h.normShift u (h.normShift w g) = h.normShift (u + w) g := by |
| 184 | rw [h.isAppellHumbert.normalizedShift_normalizedShift h.riemannForm_apply_beta_eq_sub, |
| 185 | h.riemannPhase_eq_one (h.riemannForm_integral u hu) (h.map_mem _ w hw), one_smul] |
| 186 | |
| 187 | /-- Let `f` be fixed by the normalised translations by `a l`, `l ∈ L`. For `z ∈ a⁻¹ L`, the chosen |
| 188 | representative of the class of `z` in `a⁻¹ L / L` gives the same translate of `f` as `z`. -/ |
| 189 | lemma normShift_map_out (h : IsHermitianAction L B F β) {a : R} |
| 190 | (hf : ∀ l ∈ L, h.normShift (F a l) f = f) (z : divLattice L F a) : |
| 191 | h.normShift (F a ((z : h.MulKernel a).out : V)) f = h.normShift (F a (z : V)) f := by |
| 192 | -- the representative is `z + l` with `l ∈ L`, and the translation by `a l` fixes `f` |
| 193 | obtain ⟨l, hl⟩ : ∃ l : L.toAddSubgroup.addSubgroupOf (divLattice L F a), |
| 194 | (z : h.MulKernel a).out = z + l := mk_out_eq_add (L.toAddSubgroup.addSubgroupOf _) z |
| 195 | have hz_mem : F a (z : V) ∈ L := z.property |
| 196 | have hl_mem : ((l : divLattice L F a) : V) ∈ L := l.property |
| 197 | rw [hl, AddSubgroup.coe_add, map_add, |
| 198 | ← normShift_normShift_of_mem h hz_mem (h.map_mem a _ hl_mem), hf _ hl_mem] |
| 199 | |
| 200 | /-- The canonical multiplier written with `B` and `F (star β)`, without the Riemann form: it equals |
| 201 | `exp (B x (F (star β) x) - B x x / 2)`. -/ |
| 202 | lemma multiplier_eq_exp (h : IsHermitianAction L B F β) : |
| 203 | h.multiplier x = exp (B x (F (star β) x) - B x x / 2) := by |
| 204 | grind [canonicalMultiplier, h.isAppellHumbert.sub_eq_riemannForm, h.star_eq_one_sub, h.adjoint] |
| 205 | |
| 206 | /-- Hermitian data stay hermitian data when `B` is multiplied by a positive integer `m`. -/ |
| 207 | lemma nsmul (h : IsHermitianAction L B F β) {m : ℕ} (hm : m ≠ 0) : |
| 208 | IsHermitianAction L (m • B) F β := by |
| 209 | refine ⟨h.map_mem, fun x y ↦ ?_, fun x hx ↦ ?_, fun a x y ↦ ?_, |
| 210 | (h.isAppellHumbert.nsmul m).le_dualLattice, h.star_eq_one_sub⟩ |
| 211 | · -- `m • B` is hermitian |
| 212 | simp [← h.conj_symm] |
| 213 | · -- `m • B` is positive definite |
| 214 | simp [hm.pos, h.pos x hx] |
| 215 | · -- `F (star a)` is adjoint to `F a` for `m • B` |
| 216 | simp [h.adjoint] |
| 217 | |
| 218 | end |
| 219 | |
| 220 | variable [IsFullRankLattice L] |
| 221 | |
| 222 | include h |
| 223 | |
| 224 | /-! ### Finite kernels and their eigenvectors -/ |
| 225 | |
| 226 | /-- For hermitian data `h` and a full-rank lattice `L`, the kernel `a⁻¹ L / L` of multiplication by |
| 227 | `a ≠ 0` has order `det (F a) * conj (det (F a))`. -/ |
| 228 | lemma card_mulKernel : Nat.card (h.MulKernel a) = (F a).det * conj (F a).det := |
| 229 | relIndex_comap_eq_det_mul_conj_det (h.map_mem a) (action_injective a) |
| 230 | |
| 231 | instance : Fintype (h.MulKernel a) := |
| 232 | -- The index is `|det (F a)|²`, which is not zero as `F a` is injective. |
| 233 | AddSubgroup.fintypeOfIndexNeZero (ne_of_apply_ne _ ((h.card_mulKernel a).trans_ne |
| 234 | (by simp [det_eq_zero_iff_ker_ne_bot, ker_eq_bot, action_injective]))) |
| 235 | |
| 236 | /-- Let `h` be hermitian data and `a ≠ 0`. Let `f` be fixed by the normalised translations by `a l`, |
| 237 | `l ∈ L`, let `ξ` be a character of the finite kernel `a⁻¹ L / L`, and let |
| 238 | `s = ∑_k ξ(−k) • (normalised translate of f by a k.out)`, where `k.out` is the chosen |
| 239 | representative of the class `k`; the terms do not depend on that choice. For `y ∈ a⁻¹ L`, the |
| 240 | normalised translation by `a y` multiplies `s` by `ξ(y)`. -/ |
| 241 | lemma normShift_sum_eq_char_smul (hf : ∀ l ∈ L, h.normShift (F a l) f = f) |
| 242 | (ξ : AddChar (h.MulKernel a) ℂ) (y : divLattice L F a) {s : V → ℂ} |
| 243 | (hs : s = ∑ k : h.MulKernel a, ξ (-k) • h.normShift (F a k.out) f) : |
| 244 | h.normShift (F a y) s = ξ y • s := by |
| 245 | -- Reindex the sum by `k ↦ y + k` and compare term by term. |
| 246 | rw [hs, map_sum, Finset.smul_sum] |
| 247 | refine Fintype.sum_equiv (.addLeft ↑y) _ _ fun k ↦ ?_ |
| 248 | -- `y + k.out` represents `y + k`; its translate is that by `k.out` followed by that by `y`. |
| 249 | have h_class : ((y + k.out : divLattice L F a) : h.MulKernel a) = y + k := by simp |
| 250 | have h_term : h.normShift (F a ((y : h.MulKernel a) + k).out) f = |
| 251 | h.normShift (F a y) (h.normShift (F a k.out) f) := by |
| 252 | rw [← h_class, normShift_map_out h hf, AddSubgroup.coe_add, map_add, |
| 253 | normShift_normShift_of_mem h (map_divLattice_mem (L := L) (F := F) a y) |
| 254 | (map_divLattice_mem (L := L) (F := F) a k.out)] |
| 255 | change h.normShift (F a y) (ξ (-k) • h.normShift (F a k.out) f) = |
| 256 | ξ y • ξ (-(y + k)) • h.normShift (F a ((y : h.MulKernel a) + k).out) f |
| 257 | rw [h_term, _root_.map_smul, smul_smul, ← ξ.map_add_eq_mul, neg_add, add_neg_cancel_left] |
| 258 | |
| 259 | end IsHermitianAction |
| 260 | |
| 261 | end New.ThetaTori |
| 262 | |
| 263 | end HermitianAction |
| 264 | |
| 265 | /-! |
| 266 | ## Gauss sums and the mean of the Poincaré kernel |
| 267 | |
| 268 | Here `K = B.poincareSeries h.multiplier` is the Poincaré kernel for the multiplier |
| 269 | `h.multiplier`, and `New.quotMean` is the mean over `V / L` (total mass one). |
| 270 | -/ |
| 271 | |
| 272 | namespace New.ThetaTori.IsHermitianAction |
| 273 | |
| 274 | open Complex ComplexConjugate Matrix Module MeasureTheory ComplexOrder QuotientAddGroup Fintype Fock |
| 275 | |
| 276 | variable {V R : Type} [FinComplexSpace V] [CommRing R] [StarRing R] |
| 277 | {L : Submodule ℤ V} {B : LatticeForm L} {F : R →+* V →L[ℂ] V} {β : R} |
| 278 | (h : IsHermitianAction L B F β) {x y : V} |
| 279 | |
| 280 | /-- The fourth power of a Gauss sum is real. Let `h` be hermitian data, `κ ≠ 0`, and let `q` be a |
| 281 | function on the finite group `κ⁻¹ L / L` with `q z = exp (B x (F r x))` for every lift `x ∈ κ⁻¹ L` |
| 282 | of `z`. Then the sums of `q` and of its complex conjugate have the same fourth power. -/ |
| 283 | lemma sum_conj_pow_four_eq_sum_pow_four [IsFullRankLattice L] [IsDomain R] [Module.Finite ℤ R] |
| 284 | {κ r : R} [NeZero κ] (q : h.MulKernel κ → ℂ) |
| 285 | (hq : ∀ x : divLattice L F κ, q x = exp (B x (F r x))) : |
| 286 | (∑ z : h.MulKernel κ, conj (q z)) ^ 4 = (∑ z : h.MulKernel κ, q z) ^ 4 := by |
| 287 | -- With `N` the order of the group, `q z ^ N ^ 2 = 1`, so `conj (q z) = q z ^ (N ^ 2 - 1)`. Write |
| 288 | -- `N ^ 2 - 1` as a sum of four squares; the quaternion matrix `M` with `M Mᵀ = N ^ 2 - 1` |
| 289 | -- permutes the quadruples `p`, and it turns the product of the `q (p i)` into its |
| 290 | -- `(N ^ 2 - 1)`-th power. |
| 291 | set N : ℕ := card (h.MulKernel κ) with hN |
| 292 | have q_pow (z : h.MulKernel κ) : q z ^ N ^ 2 = 1 := by |
| 293 | obtain ⟨x, rfl⟩ := mk_surjective z |
| 294 | -- Both `N • x` and `0` are lifts of `0`. |
| 295 | have h_one : exp (B (N • x) (F r (N • x))) = 1 := by |
| 296 | simpa [hN, hq, ← mk_zero] using (hq (N • x)).symm |
| 297 | simpa [hq, sq, ← exp_nsmul, pow_mul] using h_one |
| 298 | have q_conj (z : h.MulKernel κ) : conj (q z) = q z ^ (N ^ 2 - 1) := by |
| 299 | -- `q z` is a root of unity, so its conjugate is its inverse `q z ^ (N ^ 2 - 1)` |
| 300 | have h_mul : q z ^ (N ^ 2 - 1) * q z = 1 := by simpa [pow_sub_one_mul, hN] using q_pow z |
| 301 | rw [← inv_eq_conj (norm_eq_one_of_pow_eq_one (q_pow z) (by simp [hN])), |
| 302 | inv_eq_of_mul_eq_one_left h_mul] |
| 303 | obtain ⟨a, b, c, d, h_sq⟩ := (N ^ 2 - 1).sum_four_squares |
| 304 | let M : Matrix (Fin 4) (Fin 4) ℤ := !![(a : ℤ), b, c, d; -b, a, -d, c; -c, d, a, -b; -d, -c, b, a] |
| 305 | -- On a group killed by `N`, `M Mᵀ = N ^ 2 - 1` acts as `-1`, so `-Mᵀ` is a right inverse of `M`. |
| 306 | have M_surj : Function.Surjective fun p : Fin 4 → h.MulKernel κ ↦ M • p := by |
| 307 | refine fun p ↦ ⟨-Mᵀ • p, funext fun j ↦ ?_⟩ |
| 308 | calc (M • -Mᵀ • p) j = (a ^ 2 + b ^ 2 + c ^ 2 + d ^ 2) • -p j := by |
| 309 | fin_cases j <;> simp [M, Fin.sum_univ_four] <;> module |
| 310 | -- `↓`: rewrite by `h_sq` before simp takes the sum of squares apart |
| 311 | _ = p j := by simp [↓h_sq, hN, sq, sub_nsmul, NeZero.one_le, mul_smul] |
| 312 | have prod_M (p : Fin 4 → h.MulKernel κ) : ∏ i, q (p i) ^ (N ^ 2 - 1) = ∏ i, q ((M • p) i) := by |
| 313 | obtain ⟨y, rfl⟩ := mk_surjective.comp_left p |
| 314 | -- Expand both exponents; since `Mᵀ M = N ^ 2 - 1` as well, the mixed terms cancel. |
| 315 | simp [← mk_zsmul, ← mk_add, hq, ← h_sq, ← Complex.exp_nsmul, ← exp_sum, M, Fin.sum_univ_four] |
| 316 | grind |
| 317 | simp only [q_conj, sum_pow, prod_M] |
| 318 | exact Finset.sum_bijective (fun p ↦ M • p) (Finite.surjective_iff_bijective.mp M_surj) |
| 319 | (by simp) (by simp) |
| 320 | |
| 321 | include h |
| 322 | |
| 323 | /-- For hermitian data `h` and `x, y ∈ L`, the number `B x y - B y x` lies in `2 π i ℤ`, so adding |
| 324 | it does not change an exponential: `s = t + B x y - B y x` gives `exp s = exp t`. -/ |
| 325 | lemma exp_eq_of_mem_lattice {s t : ℂ} (hx : x ∈ L) (hy : y ∈ L) (hst : s = t + B x y - B y x) : |
| 326 | exp s = exp t := by |
| 327 | grind [exp_eq_exp_iff_exists_int, h.riemannForm_integral, h.isAppellHumbert.sub_eq_riemannForm, |
| 328 | ofReal_intCast] |
| 329 | |
| 330 | /-- For hermitian data `h`, the Poincaré kernel `K` (`B.poincareSeries h.multiplier`) under |
| 331 | translation of its first argument by a lattice vector `l`: |
| 332 | `K(x + l, y) = χ(l)⁻¹ exp (-(B l x + B l l / 2)) K(x, y)`, with `χ = h.multiplier`. -/ |
| 333 | lemma poincareSeries_add (l : V) (hl : l ∈ L) : |
| 334 | B.poincareSeries h.multiplier (x + l) y = |
| 335 | (h.multiplier l)⁻¹ * exp (-(B l x + B l l / 2)) * B.poincareSeries h.multiplier x y := by |
| 336 | -- Shift the summation index by `l`; each term then changes by the same factor. |
| 337 | calc |
| 338 | _ = ∑' m : L, B.poincareTerm h.multiplier (x + l) y (m + ⟨l, hl⟩) := |
| 339 | ((Equiv.addRight (⟨l, hl⟩ : L)).tsum_eq _).symm |
| 340 | _ = ∑' m : L, |
| 341 | (h.multiplier l)⁻¹ * exp (-(B l x + B l l / 2)) * B.poincareTerm h.multiplier x y m := by |
| 342 | refine tsum_congr fun m ↦ ?_ |
| 343 | simp [ThetaTori.LatticeForm.poincareTerm, h.isAppellHumbert.semicharacter, hl, ← exp_add, |
| 344 | field] |
| 345 | -- what remains is an identity of exponents, with `B u v - B v u` written by the Riemann form |
| 346 | grind [h.isAppellHumbert.sub_eq_riemannForm] |
| 347 | _ = _ := tsum_mul_left |
| 348 | |
| 349 | /-- For hermitian data `h`, the function `x ↦ K(ā (x + w), a (x + w))` is continuous and |
| 350 | `L`-periodic, where `K` is the Poincaré kernel and `ā = star a`. -/ |
| 351 | lemma isContPeriodic_poincareSeries [IsFullRankLattice L] (a : R) (w : V) : |
| 352 | IsContPeriodic L.toAddSubgroup fun x : V ↦ |
| 353 | B.poincareSeries h.multiplier (F (star a) (x + w)) (F a (x + w)) := by |
| 354 | obtain ⟨-, h_cont, h_theta, -⟩ := h.isAppellHumbert.poincareSeries_mem_thetaSpace_and_quotMean |
| 355 | h.pos |
| 356 | refine ⟨by fun_prop, fun l hl x ↦ ?_⟩ |
| 357 | -- Both arguments move by lattice vectors: use `poincareSeries_add` in the first, the theta |
| 358 | -- relation in the second. As `star a` is adjoint to `a`, the two factors of automorphy cancel. |
| 359 | simp only [add_rotate l, map_add _ (x + w), h.poincareSeries_add, (h_theta _).2, h.map_mem _ l hl] |
| 360 | simp [canonicalMultiplier, riemannForm, action_comm, h.adjoint, exp_neg, exp_add, field] |
| 361 | |
| 362 | /-- For hermitian data `h` and `κ = c - star c`, let `α = star β * κ - c`. On `κ⁻¹ L` the number |
| 363 | `exp (B x (F (κ * α) x))` depends only on the class of `x` modulo `L`. -/ |
| 364 | private lemma exp_mul_sub_eq_of_sub_mem {c κ : R} (hκ : κ = c - star c) (x : divLattice L F κ) |
| 365 | (y : V) (hxy : (x : V) - y ∈ L) : |
| 366 | exp (B x (F (κ * (star β * κ - c)) x)) = exp (B y (F (κ * (star β * κ - c)) y)) := by |
| 367 | -- the two exponents differ by `B u v - B v u` for two lattice vectors `u`, `v` |
| 368 | have h_mem : F (star β * κ - c) (F κ x - F (β * κ) ((x : V) - y)) ∈ L := |
| 369 | h.map_mem _ _ (sub_mem x.property (h.map_mem (β * κ) _ hxy)) |
| 370 | refine h.exp_eq_of_mem_lattice hxy h_mem ?_ |
| 371 | simp [hκ, h.adjoint, action_comm, h.star_eq_one_sub] |
| 372 | ring |
| 373 | |
| 374 | variable [IsFullRankLattice L] [IsDomain R] [Module.Finite ℤ R] |
| 375 | |
| 376 | /-- For hermitian data `h` and `κ = c - star c ≠ 0`, with `α = star β * κ - c`: the Poincaré |
| 377 | kernel `K(c̄ x, c x)` is the sum over `l ∈ L` of the Gauss sums |
| 378 | `∑ z, exp (B z (F (κ α) z)) * exp (B w (F (κ c) w))`, `w = l + x + z`, over representatives `z` of |
| 379 | `κ⁻¹ L / L`. -/ |
| 380 | private lemma hasSum_poincareSeries_mulKernel {c κ : R} [NeZero κ] (hκ : κ = c - star c) (x : V) : |
| 381 | HasSum (fun l : L ↦ ∑ z : h.MulKernel κ, |
| 382 | exp (B z.out (F (κ * (star β * κ - c)) z.out)) * |
| 383 | exp (B ((l : V) + x + z.out) (F (κ * c) ((l : V) + x + z.out)))) |
| 384 | (B.poincareSeries h.multiplier (F (star c) x) (F c x)) := by |
| 385 | obtain ⟨h_summable, -, -, -, -⟩ := h.isAppellHumbert.poincareSeries_mem_thetaSpace_and_quotMean |
| 386 | h.pos |
| 387 | -- `(l, z) ↦ z.out + l` identifies `L × κ⁻¹ L / L` with `κ⁻¹ L` (representatives of the classes) |
| 388 | let e_rep : L × h.MulKernel κ ≃ divLattice L F κ := |
| 389 | ((preimageMkEquivAddSubgroupProdSet (L.toAddSubgroup.addSubgroupOf (divLattice L F κ)) |
| 390 | Set.univ).trans |
| 391 | (.prodCongr (L.toAddSubgroup.addSubgroupOfEquivOfLe (h.map_mem κ)).toEquiv |
| 392 | (Equiv.Set.univ _))).symm.trans (Equiv.Set.univ _) |
| 393 | -- and multiplication by `κ` identifies `κ⁻¹ L` with `L` |
| 394 | let e_mul : divLattice L F κ ≃ L := |
| 395 | (LinearEquiv.ofInjectiveEndo _ (action_injective κ)).subtypeEquivOfSubtype |
| 396 | -- the series of `K(c̄ x, c x)`, reindexed by `(l, z) ↦ κ (z.out + l)`, summed over the fibres |
| 397 | have h_reindexed : HasSum (fun p : L × h.MulKernel κ ↦ |
| 398 | B.poincareTerm h.multiplier (F (star c) x) (F c x) (e_mul (e_rep p))) |
| 399 | (B.poincareSeries h.multiplier (F (star c) x) (F c x)) := |
| 400 | -- elaborated without the expected type, which `?f ∘ e` would only match by unfolding `HasSum` |
| 401 | ((e_rep.trans e_mul).hasSum_iff.mpr (h_summable _ _).hasSum :) |
| 402 | refine h_reindexed.prod_fiberwise fun l ↦ (hasSum_fintype _).congr_fun fun z ↦ ?_ |
| 403 | -- The term of index `κ w`, `w = z.out + l`, is `exp (B w (F (κ α) w)) * exp (B v (F (κ c) v))`, |
| 404 | -- `v = w + x`: compare the exponents. |
| 405 | change B.poincareTerm h.multiplier _ _ ⟨F κ (z.out + l), _⟩ = _ |
| 406 | -- `↓`: apply the class invariance of the Gauss factor before simp unfolds the exponentials |
| 407 | simp [↓h.exp_mul_sub_eq_of_sub_mem hκ _ (z.out + l), ← exp_add, h.multiplier_eq_exp, ← exp_sub, |
| 408 | hκ, h.adjoint, action_comm, ThetaTori.LatticeForm.poincareTerm] |
| 409 | grind |
| 410 | |
| 411 | /-- Let `h` say that `B` is a positive definite hermitian form whose Riemann form is integral on the |
| 412 | full-rank lattice `L`, and that `F` is an action of `R` preserving `L` with `F (star a)` adjoint to |
| 413 | `F a` and `star β = 1 - β`. Let `K(x, y) = ∑_{l ∈ L} exp(B(x, y - x + l) - B(l, y) - B(l, |
| 414 | l)/2) / χ(l)` be the Poincaré series of the Appell–Humbert data `h.isAppellHumbert`, and let |
| 415 | `κ = c - star c` be non-zero. Then the mean over `V / L` of `x ↦ K(c̄ x, c x)`, where `c̄ = star c`, |
| 416 | times the complex conjugate of the determinant of `F c̄` on `V`, has a real fourth power. -/ |
| 417 | lemma isSelfAdjoint_quotMean_pow (c : R) {κ : R} [NeZero κ] (hκ : κ = c - star c) : |
| 418 | IsSelfAdjoint |
| 419 | ((quotMean L.toAddSubgroup |
| 420 | (fun x : V ↦ B.poincareSeries h.multiplier (F (star c) x) (F c x)) * |
| 421 | conj (F (star c)).det) ^ 4) := by |
| 422 | -- Write the terms of the series as `l = κ z`, `z ∈ κ⁻¹ L`. Unfolding turns the mean into a Gauss |
| 423 | -- sum over `h.MulKernel κ` times a Gaussian integral over `V`, divided by the covolume of `L`. |
| 424 | -- The integral is `1 / conj (det (M κ) * det c̄)`, with `M κ` the matrix of `B x (κ y)`; the |
| 425 | -- Gauss sum and `det (M κ)` have real fourth powers. |
| 426 | have : DiscreteTopology L.toAddSubgroup := (inferInstance : DiscreteTopology L) |
| 427 | borelize V |
| 428 | -- `μ` is Lebesgue measure on `V` in the coordinates `e` of a basis `b`, divided by `π ^ dim V`. |
| 429 | let b : Basis (Fin (finrank ℂ V)) ℂ V := finBasis ℂ V |
| 430 | let e : (Fin (finrank ℂ V) → ℂ) ≃L[ℂ] V := b.equivFun.symm.toContinuousLinearEquiv |
| 431 | let μ : Measure V := (normalizedVolume _).map e |
| 432 | have : IsFiniteMeasure (L.toAddSubgroup.quotMeasure μ) := |
| 433 | isFiniteMeasure_addOrbitMeasure μ isCocompact_of_isFullRankLattice |
| 434 | -- `M a` is the matrix of the form `(x, y) ↦ B x (a y)` in the basis `b`. |
| 435 | let M (a : R) : Matrix (Fin (finrank ℂ V)) (Fin (finrank ℂ V)) ℂ := |
| 436 | (.pi (fun i ↦ B (b i)) ∘ₗ (F a).toLinearMap ∘ₗ e.toLinearEquiv.toLinearMap).toMatrix' |
| 437 | have M_adj (a : R) : (M a)ᴴ = M (star a) := by ext; simp [M, e, ← h.conj_symm, h.adjoint] |
| 438 | have M_form (a : R) (x : Fin (finrank ℂ V) → ℂ) : |
| 439 | star x ⬝ᵥ M a *ᵥ x = conj (B (F a (e x)) (e x)) := by |
| 440 | simp [M, e, dotProduct, ← h.conj_symm] |
| 441 | have M_mul : M (κ * star c) = M κ * (F (star c)).toMatrix b b := by |
| 442 | -- `F (κ c̄) = F κ ∘ F c̄`, and the matrix of a composite is the product |
| 443 | refine .trans ?_ (LinearMap.toMatrix'_mul ..) |
| 444 | ext; simp [M, e] |
| 445 | -- Since `κ c̄ + κ̄ c = κ̄ κ`, this hermitian form is `B (κ x) (κ x)`. |
| 446 | have h_pos : ((M (κ * star c))ᴴ + (M (κ * star c))ᴴᴴ).PosDef := by |
| 447 | refine .of_dotProduct_mulVec_pos (isHermitian_add_transpose_self _) fun x _ ↦ ?_ |
| 448 | have hx : F κ (e x) ≠ 0 := by simpa [map_eq_zero_iff, action_injective] |
| 449 | refine (zero_lt_real.mpr (h.pos _ hx)).trans_eq ?_ |
| 450 | simp [re_eq_add_conj, h.adjoint, ← h.conj_symm, M_adj, M_form, hκ, add_mulVec] |
| 451 | ring |
| 452 | obtain ⟨h_det_M, h_det_c⟩ : (M κ).det ≠ 0 ∧ (F (star c)).det ≠ 0 := by |
| 453 | simpa [M_mul, and_comm] using IsAccretive.det_ne_zero h_pos |
| 454 | -- `M κ` is skew-hermitian, as `κ̄ = -κ`. |
| 455 | have h_real : conj (M κ).det ^ 4 = (M κ).det ^ 4 := by |
| 456 | have h_star : star κ = -κ := by rw [hκ, star_sub, star_star, neg_sub] |
| 457 | have h_skew : (M κ)ᴴ = -M κ := by rw [M_adj, h_star]; ext; simp [M] |
| 458 | have h_four : (M κ)ᴴ ^ 4 = M κ ^ 4 := by rw [h_skew, Even.neg_pow (by decide)] |
| 459 | simpa [det_pow] using congrArg det h_four |
| 460 | -- `g c` is the Gaussian, and `g α` below gives the terms of the Gauss sum. |
| 461 | let g (a : R) (x : V) : ℂ := exp (B x (F (κ * a) x)) |
| 462 | have h_gauss : ∫ x, g c x ∂μ = (conj (M κ).det)⁻¹ * (conj (F (star c)).det)⁻¹ := by |
| 463 | -- This is `integral_gauss` for `(M (κ * star c))ᴴ = -M (κ * c)`. |
| 464 | refine .trans ?_ ((integral_gauss h_pos 0).trans (by simp [M_mul])) |
| 465 | simp (disch := fun_prop) [μ, integral_map, g, ← h.conj_symm, M_adj, M_form, hκ] |
| 466 | have h_gauss_ne : ∫ x, g c x ∂μ ≠ 0 := by simp [h_gauss, h_det_M, h_det_c] |
| 467 | have h_intg (z : V) (c' : ℂ) : Integrable (fun x ↦ c' * g c (x + z)) μ := |
| 468 | ((Integrable.of_integral_ne_zero h_gauss_ne).comp_add_right z).const_mul c' |
| 469 | let α : R := star β * κ - c |
| 470 | have h_sum (x : V) : HasSum (fun l : L ↦ ∑ z : h.MulKernel κ, g α z.out * g c (l + x + z.out)) |
| 471 | (B.poincareSeries h.multiplier (F (star c) x) (F c x)) := |
| 472 | h.hasSum_poincareSeries_mulKernel hκ x |
| 473 | -- Unfold: the mean of a sum over `L` is the integral over `V` divided by the covolume. |
| 474 | rw [quotMean_tsum_eq_integral _ μ (integrable_finsetSum _ fun _ _ ↦ h_intg ..) |
| 475 | (by simpa using h.isContPeriodic_poincareSeries c 0) h_sum] |
| 476 | have h_sum_real : |
| 477 | (∑ z : h.MulKernel κ, conj (g α z.out)) ^ 4 = (∑ z : h.MulKernel κ, g α z.out) ^ 4 := |
| 478 | -- on `κ⁻¹ L` the factor `g α` depends only on the class modulo `L` |
| 479 | h.sum_conj_pow_four_eq_sum_pow_four (fun z ↦ g α z.out) fun x ↦ |
| 480 | h.exp_mul_sub_eq_of_sub_mem hκ _ x (eq_iff_sub_mem.mp (out_eq' (x : h.MulKernel κ))) |
| 481 | -- Each translated Gaussian has the integral `h_gauss`, so the integral of the sum is the Gauss |
| 482 | -- sum times that integral. |
| 483 | have h_int_sum : ∫ x, ∑ z : h.MulKernel κ, g α z.out * g c (x + z.out) ∂μ = |
| 484 | (∑ z : h.MulKernel κ, g α z.out) * ∫ x, g c x ∂μ := by |
| 485 | rw [integral_finsetSum _ fun z _ ↦ h_intg z.out (g α z.out), Finset.sum_mul] |
| 486 | simp [integral_const_mul, integral_add_right_eq_self (g c)] |
| 487 | -- `conj (det c̄)` cancels; the covolume is real, and the Gauss sum and `det (M κ)` have real |
| 488 | -- fourth powers. |
| 489 | rw [h_int_sum, h_gauss, smul_mul_assoc, mul_assoc, inv_mul_cancel_right₀ (by simpa using h_det_c)] |
| 490 | simp [IsSelfAdjoint, mul_pow, h_sum_real, h_real] |
| 491 | |
| 492 | end New.ThetaTori.IsHermitianAction |
| 493 | |
| 494 | end |