module import Mathlib.Algebra.Order.Star.Real import Mathlib.Algebra.Ring.IsFormallyReal import Mathlib.RingTheory.PiTensorProduct import Mathlib.Topology.Separation.CompletelyRegular import TauCeti.NumberTheory.NumberField.Countable import TauCeti.Topology.Algebra.Group.Units import TauCeti.Topology.Instances.Matrix public import New.Spanning.Bessel.Basic public import Lib.Adelic.Hecke.ClassSums public import Lib.General.NumberTheory.EmbeddingsAndDifferent public import Lib.Adelic.Reduction.DefiniteClassSums -- shake: keep (needed public by an exposed definition) /-! # The data, standing hypotheses and amplitudes of the filling theorem The data and the vocabulary of the filling theorem. The space is `V` = (`ϱ` hyperbolic planes) ⊕ `X₀ ⊕ E z`, with `X₀` definite of rank `k = |κ|` and `h(z, z) = -N`. Its Gram matrix is `New.Shape.Form.splitGram`, its indices are `New.Shape.BesselIndex`, and the frame `New.Shape.besselFrame` is `(e₁, …, e_ϱ, z)`. * `New.Filling`, `New.Filling.IsAdmissible`: the data with its size hypotheses, and the standing hypotheses. * `New.Filling.G`, `New.Filling.GFin`, `New.Filling.ResidueGL`: `U(V)` over a ring, over the finite adeles in the lattice basis, and the product of `GL` over the residue fields of the chosen places. * `New.Filling.ratToInf`, `New.Filling.ratToFin`, `New.Filling.reduction`: the maps to the infinite places (rescaled to `New.Shape.G₁`), to the finite adeles, and reduction. * `New.Filling.termsOver`, `New.Filling.amplitude`, `New.Filling.amplitudeSum`: the rational terms over a block `(c, s, c')`, made of two classes and an element of `ResidueGL`; the amplitude of a term; and the sum of the amplitudes over a set `T` of terms. Divided by `unipotentCovolume`, this sum is the contribution of `T` to the block. Integrals over the quotients of G_∞ by the groups `classUnipotent c` are written with the cutoffs `classCutoff c`. * `New.Filling.Agrees`, `New.Filling.IsStable`, `New.Filling.termsOfLink`: the elements of `ResidueGL` that respect the unipotent character, the stable sets of terms, and the terms of nonzero discriminant with a given link. Letters in the docstrings: 𝖴 = `New.Shape.Form.besselU` is the unipotent group, 𝖴⁰ = `New.Shape.Form.besselU0` is its subgroup fixing the frame, and H is `U(X₀)`. The group `New.Shape.Form.besselS` is generated by 𝖴 and H. G_∞ is the product of copies of `New.Shape.G₁` over the infinite places. K = `latticeStabilizer`, K(M) = `principalLevel`, h_c = `classRep c`, Λ = `frameScaleProd`, and f_0, …, f_ϱ is the frame. Notions from other files: * `New.Shape`: the number ϱ, the index set κ of X₀ and one index k₀ in κ; k = |κ| and n = ϱ + 1. * `New.BesselSystem`: for the real number b, two continuous functions W (`FullOrCut.full`) and W♭ (`FullOrCut.cut`) from G₁ to ℂ^I, I a finite index set, that satisfy bounds in b and in a positive constant `deg`; they are Bessel functions of an irreducible representation of U(k) on ℂ^I. * `New.frameDisc`: for Z of size ϱ+1 with leading minors D_l, the quantity |D_{ϱ+1}|² − N²|D_ϱ|², where |x|² means x x̄. -/ @[expose] public section noncomputable section open Finset Set NumberField MeasureTheory Matrix Real Fintype Fin Complex Valued namespace New /-- The data of the filling theorem over the CM field `E`, for `ϱ` hyperbolic planes and a definite space `X₀` with basis `κ`: a prime `N = π π̄`, given by the finite idele `piN = π`; two primes p₀, p₁ (`levelPrime`) different from `N`, with finite sets `chosenPlaces i` of places of norm p_i; a purely imaginary generator ϖ = `deltaE` of the different; a free level `sourceLevel` in `U(X₀)`; and a Bessel system at each infinite place. The two sets of chosen places are disjoint and contain no conjugate of a chosen place; M = p₀ p₁ is the product of the chosen places and their conjugates in the sense of `M_dvd_iff`. The remaining fields are size conditions on ϱ, k = |κ|, the degree, the root discriminant and the primes, many of them in terms of the real parameter `b`. They also require 5 ≤ N. -/ structure Filling (E : Type) [Field E] [CMType E] (𝔰 : Shape) where /-- The rational prime N = π π̄. -/ N : ℕ /-- The two primes p₀, p₁ whose product is the level M. -/ levelPrime : Fin 2 → ℕ /-- The finite idele π, with π π̄ = N. -/ piN : (𝔸f E)ˣ /-- A generator ϖ of the different of E. -/ deltaE : 𝓞 E /-- The real parameter b in whose powers all sizes are measured. -/ b : ℝ /-- The chosen set of finite places for each of p₀, p₁. -/ chosenPlaces : Fin 2 → Set (FinPlace E) /-- Each set of chosen places is finite. -/ [fintypeChosen (i : Fin 2) : Fintype (chosenPlaces i)] /-- The level: a subgroup of the finite adelic points of the definite unitary group U(X₀). -/ sourceLevel : Subgroup (Gf E 𝔰.κ) /-- The level is free: the rational points meet each of its conjugates trivially. -/ classAut_eq_bot (g : Gf E 𝔰.κ) : classAut (stdSpace E 𝔰.κ).Γf sourceLevel g = ⊥ /-- The level satisfies the conditions `IsLevel`. -/ [isLevel_sourceLevel : IsLevel sourceLevel] /-- A Bessel system at each infinite place, for the parameter b. -/ besselSystem : InfinitePlace E → BesselSystem 𝔰 b (Core.numInfPlaces E) /-- The product of π with its conjugate is N. -/ piN_mul_star : piN * star piN.val = N /-- N is prime. -/ N_prime : N.Prime /-- At each finite place w, either π is a unit, or w has norm N and π is a unit at w̄. -/ N_split (w : FinPlace E) : v (piN.val w) = 1 ∨ w.q = N ∧ v (piN.val (star w)) = 1 /-- π is integral at every finite place. -/ piN_mem : ↑piN ∈ Ô E /-- p₀ and p₁ are primes different from N. -/ levelPrime_prime_and_ne (i : Fin 2) : (levelPrime i).Prime ∧ levelPrime i ≠ N /-- b¹⁰ ≤ p_i. -/ le_levelPrime (i : Fin 2) : b ^ 10 ≤ levelPrime i /-- p_i ≤ b¹¹. -/ levelPrime_le (i : Fin 2) : levelPrime i ≤ b ^ 11 /-- The places chosen for p_i have norm p_i. -/ chosenPlaces_q (i : Fin 2) : ∀ w ∈ chosenPlaces i, w.q = levelPrime i /-- No place is chosen for both indices. -/ chosenPlaces_injective : (·.2.val : (Σ i : Fin 2, chosenPlaces i) → FinPlace E).Injective /-- The conjugate of a chosen place is not chosen. -/ star_notMem_chosenPlaces {i j : Fin 2} {w : FinPlace E} : w ∈ chosenPlaces i → star w ∉ chosenPlaces j /-- An integral finite adele r is divisible by M = p₀ p₁ if and only if r and r̄ vanish modulo every chosen place. -/ M_dvd_iff (r : Ô E) : ↑(levelPrime 0 * levelPrime 1) ∣ r ↔ ∀ p : Σ i : Fin 2, chosenPlaces i, reduceAt p.2 r = 0 ∧ reduceAt p.2.val (star r) = 0 /-- For each p_i there are as many chosen places as E has infinite places. -/ card_chosenPlaces (i : Fin 2) : Fintype.card (chosenPlaces i) = Core.numInfPlaces E /-- ϖ is purely imaginary. -/ star_deltaE : star deltaE = -deltaE /-- ϖ generates the different of E over ℚ. -/ span_deltaE : differentIdeal ℤ (𝓞 E) = Ideal.span {deltaE} /-- 10⁵ ≤ ϱ. -/ ten_pow_five_le_varrho : 10 ^ 5 ≤ 𝔰.ϱ /-- 2^(−ϱ) ≤ b^(−6). -/ half_pow_le_inv_pow_six : 2⁻¹ ^ 𝔰.ϱ ≤ b⁻¹ ^ 6 /-- (ϱ + 1) [E : ℚ] ≤ 2^(2ϱ). -/ mul_finrank_le_pow : (𝔰.ϱ + 1) * Module.finrank ℚ E ≤ 2 ^ (2 * 𝔰.ϱ) /-- 1000 (2ϱ + 2)⁹ ≤ k. -/ pow_le_k : 1000 * (2 * 𝔰.ϱ + 2) ^ 9 ≤ 𝔰.k /-- k is at most the number f of infinite places of E. -/ k_le_f : 𝔰.k ≤ Core.numInfPlaces E /-- (200 f k rd)¹⁰⁰⁰ ≤ b, with f the number of infinite places and rd the root discriminant of E. -/ mul_rootDiscr_pow_le : (200 * (Core.numInfPlaces E * 𝔰.k) * rootDiscr E) ^ 1000 ≤ b /-- f ≤ b / 1000, with f the number of infinite places of E. -/ numInfPlaces_le_div : Core.numInfPlaces E ≤ b / 1000 /-- k ≤ b. -/ k_le_b : 𝔰.k ≤ b /-- The root discriminant of E is at most b. -/ rootDiscr_le_b : rootDiscr E ≤ b /-- ϱ + 1 ≤ b. -/ succ_le_b : ↑(𝔰.ϱ + 1) ≤ b /-- 1000 ≤ b. -/ thousand_le_b : 1000 ≤ b /-- 1 ≤ b. -/ one_le_b : 1 ≤ b /-- M = p₀ p₁ is at most b²³. -/ M_le_b_pow : ↑(levelPrime 0 * levelPrime 1) ≤ b ^ 23 /-- M = p₀ p₁ is at least b¹⁹. -/ le_M : b ^ 19 ≤ ↑(levelPrime 0 * levelPrime 1) /-- 5 ≤ N. -/ five_le_N : (5 : ℝ) ≤ N variable {E : Type} [Field E] [CMType E] {𝔰 : Shape} (S : Filling E 𝔰) namespace Filling export Core (numInfPlaces) attribute [instance] fintypeChosen isLevel_sourceLevel attribute [scoped simp] N_prime levelPrime_prime_and_ne /-- 1000 (2ϱ + 2) ≤ k. -/ lemma thousand_mul_le_k (S : Filling E 𝔰) : 1000 * (2 * 𝔰.ϱ + 2) ≤ 𝔰.k := Nat.le_trans (Nat.mul_le_mul_left 1000 (Nat.le_self_pow (by decide : 9 ≠ 0) _)) S.pow_le_k /-- With n = ϱ + 1: 10¹⁰ n⁴ ≤ n⁶, 3 n⁶ + 12 ≤ n⁷ and n⁷ ≤ k. -/ lemma pow_chain (S : Filling E 𝔰) : 10 ^ 10 * 𝔰.n ^ 4 ≤ 𝔰.n ^ 6 ∧ 3 * 𝔰.n ^ 6 + 12 ≤ 𝔰.n ^ 7 ∧ 𝔰.n ^ 7 ≤ 𝔰.k := by have hn : 10 ^ 5 ≤ 𝔰.n := Nat.le_trans S.ten_pow_five_le_varrho (Nat.le_succ _) refine ⟨?_, ?_, ?_⟩ · calc 10 ^ 10 * 𝔰.n ^ 4 ≤ 𝔰.n ^ 2 * 𝔰.n ^ 4 := Nat.mul_le_mul_right _ (Nat.pow_le_pow_left hn 2) _ = 𝔰.n ^ 6 := (Nat.pow_add 𝔰.n 2 4).symm · have hpos : 1 ≤ 𝔰.n ^ 6 := Nat.one_le_pow _ _ 𝔰.ϱ.succ_pos calc 3 * 𝔰.n ^ 6 + 12 ≤ 𝔰.n ^ 6 * 15 := by omega _ ≤ 𝔰.n ^ 6 * 𝔰.n := Nat.mul_le_mul_left _ (by omega) _ = 𝔰.n ^ 7 := (Nat.pow_succ 𝔰.n 6).symm · calc 𝔰.n ^ 7 ≤ 𝔰.n ^ 9 := Nat.pow_le_pow_right 𝔰.ϱ.succ_pos (by decide) _ ≤ (2 * 𝔰.ϱ + 2) ^ 9 := Nat.pow_le_pow_left (by unfold Shape.n; omega) _ _ ≤ 𝔰.k := by have := S.pow_le_k; omega /-! ### Groups, classes and reduction -/ /-- The natural number M = p₀p₁, the product of the two primes of the data. -/ abbrev M : ℕ := S.levelPrime 0 * S.levelPrime 1 /-- For a commutative ring R, the diagonal Gram matrix over R of X₀ ⊕ Ez in the standard basis: 1 on κ and −N at z. -/ abbrev ratMiddle (R : Type) [CommRing R] : 𝔰.Form R := 𝔰.middleGram (S.N : R) /-- For a commutative ring R, the Gram matrix over R of X₀ ⊕ Ez in the lattice basis, where e_{k₀} is replaced by e_{k₀}/π̄ + z/N, with π = `piN`. -/ abbrev latticeMiddle (R : Type) [CommRing R] : 𝔰.Form R := latticeMiddleGram 𝔰 (S.N : R) /-- For a commutative ring R with involution, the unitary group over R of the form made of ϱ hyperbolic pairs and the middle Gram matrix `New.Filling.ratMiddle` (standard basis). -/ abbrev G (R : Type) [CommRing R] [StarRing R] : Subgroup (GL 𝔰.BesselIndex R) := (S.ratMiddle R).G /-- The unitary group over the finite adeles of E of the form made of ϱ hyperbolic pairs and the middle Gram matrix `New.Filling.latticeMiddle` (lattice basis). -/ abbrev GFin : Subgroup (GL 𝔰.BesselIndex (𝔸f E)) := (S.latticeMiddle (𝔸f E)).G /-- The product, over i = 0, 1 and the chosen places w above p_i, of the groups of invertible matrices of size dim V over the residue fields at w. -/ abbrev ResidueGL : Type := ∀ (i : Fin 2) (w : S.chosenPlaces i), GL 𝔰.BesselIndex (ResField w.val) /-- The set of tuples choosing, for each infinite place v, one coordinate index of the Bessel system at v. -/ abbrev BesselCoord : Type := ∀ v : InfinitePlace E, (S.besselSystem v).Index /-- The set of double cosets U(X₀)(E⁺) \ U(X₀)(𝔸_f) / `sourceLevel`, for the unitary group of the standard form on κ. -/ def Classes : Type := DoubleCosets (stdSpace E 𝔰.κ).Γf S.sourceLevel deriving Nonempty variable (side : FullOrCut) /-- For a rational element γ of the unitary group, the matrix Z(γ) = (h(f_j, γf_l)) of products between the frame and its image under γ. -/ abbrev frameProducts (γ : S.G E) : Matrix (Fin (𝔰.ϱ + 1)) (Fin (𝔰.ϱ + 1)) E := (S.ratMiddle E).frameGram γ /-- The subgroup K of the finite adelic unitary group (lattice basis) of elements that are invertible matrices over the integral finite adeles `Ô E`. -/ def latticeStabilizer : Subgroup S.GFin := (intGL 𝔰.BesselIndex (Ô E)).subgroupOf S.GFin /-- The homomorphism from the integral subgroup K to the finite group `ResidueGL` reducing matrix entries modulo each chosen place above p₀ and p₁. -/ protected def reduction : S.latticeStabilizer →* S.ResidueGL := MonoidHom.pi fun _ ↦ MonoidHom.pi fun v ↦ (intGL.map (reduceAt v.val)).comp (S.GFin.subtype.subgroupComap (intGL 𝔰.BesselIndex (Ô E))) /-- The principal congruence subgroup K(M): the kernel of the reduction from K to `ResidueGL`, as a subgroup of the finite adelic unitary group. -/ def principalLevel : Subgroup S.GFin := S.reduction.ker.map S.latticeStabilizer.subtype /-- For a subgroup A of the finite adelic unitary group, the image of A ∩ K in the finite group `ResidueGL` under reduction. -/ def reducedImage (A : Subgroup S.GFin) : Subgroup S.ResidueGL := (A.subgroupOf S.latticeStabilizer).map S.reduction /-! ### Scales at the infinite places, and constants -/ /-- The real number κ_v (no relation to the index set κ), the real part of M·v(ϖ)/(2πi), where v(ϖ) is the image of ϖ = `deltaE` under the chosen embedding `Φ v`. By `coe_realM` the quotient is real. -/ def realM (v : InfinitePlace E) : ℝ := (S.M * Φ v S.deltaE.val / (2 * π * Complex.I)).re /-- The scales of the normalised basis at v: κ_v^(ϱ−a+1)/√N on e_a (a = 1, …, ϱ), 1 on κ, 1/√N on z, and the inverse of the scale of e_a on e*_a. -/ def basisScale (v : InfinitePlace E) : 𝔰.BesselIndex → ℂ := let s (a : ℕ) : ℝ := S.realM v ^ (𝔰.ϱ - a) / √S.N (fun a : Fin 𝔰.ϱ ↦ (s a : ℂ)) ⊕ᵥ ((1 ⊕ᵥ fun _ : Unit ↦ (s 𝔰.ϱ : ℂ)) ⊕ᵥ (fun a : Fin 𝔰.ϱ ↦ (s a : ℂ))⁻¹) /-- A ring homomorphism R → R' maps the Gram matrix of V over R in the standard basis, with middle block `ratMiddle`, to the same matrix over R'. -/ lemma map_splitGram_ratMiddle (R : Type) [CommRing R] {R' : Type} [CommRing R'] (f : R →+* R') : (S.ratMiddle R).splitGram.map f = (S.ratMiddle R').splitGram := by -- The map is entrywise: it fixes the entries 0 and 1 and sends -N in R to -N in R'. simp [splitGram, Floors.hyperbolicGram, middleGram, fromBlocks_map, fromCols_map, fromRows_map, ← Matrix.ext_iff] /-- The additive character x ↦ ψ_f(−x/ϖ) of the finite adeles of E, with values in ℂ. As ϖ generates the different of E, the ring Ô is its own dual for this character. -/ def selfDualChar : AddChar (𝔸f E) ℂ := (Circle.coeHom.compAddChar (ψf E)).mulShift ↑(-S.deltaE.val⁻¹) /-- The generator ϖ = `S.deltaE` of the different of `E` is nonzero. -/ @[simp high] lemma deltaE_ne_zero : S.deltaE.val ≠ 0 := mod_cast ne_zero_of_differentIdeal_eq_span S.span_deltaE /-- The counts of the free entries of the unipotent rows, in reverse order, sum to `r (r + k)`. -/ lemma sum_unipotent_row_exponents (r k : ℕ) : ∑ a ∈ range r, (a + (k + 1) + a) = r * (r + k) := by induction r with | zero => simp | succ r ih => grind [sum_range_succ] /-- The number κ_v^(2(ϱ−a))/N, the square of the scale of the frame vector of index a at v. -/ def frameScaleSq (v : InfinitePlace E) (a : ℕ) : ℝ := S.realM v ^ (2 * (𝔰.ϱ - a)) / S.N /-- The product Λ over infinite places v and a = 0,…,ϱ of (κ_v^(2(ϱ−a))/N)^(k+2(ϱ−a)), where k is the size of κ. -/ def frameScaleProd : ℝ := ∏ v : InfinitePlace E, ∏ a : Fin (𝔰.ϱ + 1), S.frameScaleSq v a ^ (𝔰.k + 2 * (𝔰.ϱ - a)) /-- The number (M^(ϱ(2(ϱ+k)+1))/N^k)^f · vol(Ô)^(−ϱ(ϱ+k)) · |D_E|^(ϱ/4) / Λ, k = |κ|, f the number of infinite places; for every class c it serves as the covolume of 𝖴_c(M) (`classUnipotent c`) in 𝖴_∞. -/ def unipotentCovolume : ℝ := let d : ℕ := ∑ a ∈ Finset.range 𝔰.ϱ, (a + (𝔰.k + 1) + a) (S.M ^ (2 * d + 𝔰.ϱ) / S.N ^ 𝔰.k) ^ numInfPlaces E / volÔ E ^ d * √√|NumberField.discr E| ^ 𝔰.ϱ / S.frameScaleProd /-- The constant `c_S = (π^k / ((k - 1)! N^k))^f · |disc E|^(1/4) · vol(Ô)^k`, where `k = |κ|`, `f` is the number of infinite places and `vol(Ô) = New.volÔ E`. With the root discriminant `rd` one has `|disc E| = rd^(2f)` and `vol(Ô) = (2 / rd)^f` (`New.volÔ_eq`), so that `c_S = ((2π)^k rd^(1/2 - k) / ((k - 1)! N^k))^f`. -/ def siegelConst : ℝ := (π ^ 𝔰.k / (𝔰.k - 1).factorial / S.N ^ 𝔰.k) ^ numInfPlaces E * √√|NumberField.discr E| * volÔ E ^ 𝔰.k /-- For a rational γ, the element |D_{ϱ+1}|² − N²|D_ϱ|² of E formed from the last two leading minors of Z(γ). -/ abbrev termDisc (γ : S.G E) : E := frameDisc ↑S.N (S.frameProducts γ) /-- On the frame vector `besselFrame a`, a = 0, …, ϱ, the scale at v is κ_v^(ϱ − a)/√N, with κ_v = `realM v`. -/ lemma basisScale_besselFrame (v : InfinitePlace E) : ∀ a : Fin (𝔰.ϱ + 1), S.basisScale v (𝔰.besselFrame a) = S.realM v ^ (𝔰.ϱ - a) / √S.N := by simp [basisScale, forall_fin_succ'] /-- The real number κ_v = `realM v`, viewed in ℂ, equals M·v(ϖ)/(2πi). -/ lemma coe_realM (v : InfinitePlace E) : S.realM v = S.M * Φ v S.deltaE / (2 * π * Complex.I) := by -- The right side is real: `Φ v ϖ` is purely imaginary by `star_deltaE`. have h_star : (starRingEnd ℂ) (Φ v S.deltaE.val) = -Φ v S.deltaE.val := by simpa using congrArg (fun x : 𝓞 E ↦ Φ v x.val) S.star_deltaE rw [realM, ← conj_eq_iff_re] simp [h_star, map_ofNat] /-- The number κ_v is nonzero. -/ @[simp] lemma realM_ne_zero (v : InfinitePlace E) : S.realM v ≠ 0 := by simp [← ofReal_ne_zero, coe_realM, Nat.Prime.ne_zero] /-- The square of the scale of a frame vector, `frameScaleSq`, is positive. -/ @[simp] lemma frameScaleSq_pos (v : InfinitePlace E) (a : ℕ) : 0 < S.frameScaleSq v a := div_pos ((even_two_mul _).pow_pos (S.realM_ne_zero v)) (mod_cast S.N_prime.pos) /-- The product Λ of the powers of the squared frame scales, `frameScaleProd`, is positive. -/ lemma frameScaleProd_pos : 0 < S.frameScaleProd := prod_pos fun v _ ↦ prod_pos fun a _ ↦ pow_pos (S.frameScaleSq_pos v a) _ /-- All the scales of the normalised basis at v are nonzero. -/ @[simp] lemma basisScale_ne_zero (v : InfinitePlace E) : ∀ i : 𝔰.BesselIndex, S.basisScale v i ≠ 0 := by simp [basisScale, Nat.Prime.ne_zero] /-- The invertible diagonal complex matrix whose entries are the scales `New.Filling.basisScale` of the normalised basis at v. -/ def basisScaleGL (v : InfinitePlace E) : GL 𝔰.BesselIndex ℂ := diagGL fun i : 𝔰.BesselIndex ↦ Units.mk0 (S.basisScale v i) (S.basisScale_ne_zero v i) /-- Let V = (ϱ hyperbolic planes) ⊕ X₀ ⊕ Ez. Rescaling the basis by the diagonal matrix `basisScaleGL v` carries the Gram matrix of V over ℂ whose block on X₀ ⊕ Ez is diag(1, …, 1, −N) (`ratMiddle ℂ`) to the one whose block is diag(1, …, 1, −1) (`middleGram 1`). -/ lemma conjTranspose_basisScaleGL_mul_splitGram_mul (v : InfinitePlace E) : (S.basisScaleGL v).valᴴ * (S.ratMiddle ℂ).splitGram * (S.basisScaleGL v).val = (𝔰.middleGram 1).splitGram := by -- Entrywise: all scales are real, those of e_a and e*_a are inverse, and 1/√N squares to 1/N. simp +contextual [basisScaleGL, basisScale, ← ext_iff, ← ofReal_pow, splitGram, middleGram, Nat.Prime.ne_zero, Matrix.one_apply, fieldEq] /-! ### The maps between the groups, and terms -/ /-- The invertible matrix over the finite adeles whose columns are the lattice basis of V (e_{k₀} replaced by e_{k₀}/π̄ + z/(π π̄), with π = `piN`) in the standard basis. -/ abbrev latticeBasis : GL 𝔰.BesselIndex (𝔸f E) := besselLatticeBasis 𝔰 S.piN /-- The isomorphism from the finite adelic unitary group in the standard basis to that in the lattice basis, given by conjugation with the change of basis matrix. -/ def toLatticeBasis : S.G (𝔸f E) ≃* S.GFin := (U.conj (besselLatticeBasis 𝔰 S.piN) (gram_besselLatticeBasis S.piN S.N S.piN_mul_star)).symm /-- The homomorphism from the rational unitary group to the adelic unitary group induced entrywise by the diagonal map from E to its adeles. -/ def ratToAdelic : S.G E →* S.G (𝔸 E) := U.map toAdele (h := map_splitGram_ratMiddle S E toAdele) /-- The homomorphism from the adelic unitary group to the product of copies of G₁, taking each infinite component and conjugating by the diagonal rescaling matrix there. -/ def adelicToInf : S.G (𝔸 E) →* (InfinitePlace E → 𝔰.G₁) := MonoidHom.pi fun v ↦ MonoidHom.comp (U.conj (S.basisScaleGL v) (S.conjTranspose_basisScaleGL_mul_splitGram_mul v)).symm (U.map (evalInf v) (h := map_splitGram_ratMiddle S (𝔸 E) (evalInf v))) /-- The homomorphism from the adelic unitary group to the finite adelic unitary group in the lattice basis: take the finite part, then change basis. -/ def adelicToFin : S.G (𝔸 E) →* S.GFin := MonoidHom.comp S.toLatticeBasis (U.map (RingHom.snd (InfinitePlace E → ℂ) (𝔸f E)) (h := map_splitGram_ratMiddle S (𝔸 E) (RingHom.snd (InfinitePlace E → ℂ) (𝔸f E)))) /-- The homomorphism sending a rational element of the unitary group to its tuple of rescaled images in G₁ at all infinite places. -/ def ratToInf : S.G E →* InfinitePlace E → 𝔰.G₁ := S.adelicToInf.comp S.ratToAdelic /-- The homomorphism sending a rational element of the unitary group to its image in the finite adelic unitary group, written in the lattice basis. -/ def ratToFin : S.G E →* S.GFin := S.adelicToFin.comp S.ratToAdelic /-- The homomorphism including the finite adelic points of U(X₀) in the finite adelic unitary group of V, written in the lattice basis. -/ def inclHFin : U (1 : Matrix 𝔰.κ 𝔰.κ (𝔸f E)) →* S.GFin := S.toLatticeBasis.toMonoidHom.comp (toBesselH 𝔰 (S.N : 𝔸f E)) /-- There are finitely many classes. -/ instance : Fintype S.Classes := haveI : Finite S.Classes := HasFiniteType.finite_classes ofFinite S.Classes /-- For a double coset class c, the image h_c in the finite adelic unitary group of V of a chosen representative of c. -/ abbrev classRep (c : S.Classes) : S.GFin := S.inclHFin c.out /-- The element h_c⁻¹ γ h_c' of the finite adelic unitary group, for classes c, c' and a rational element γ. -/ def translateByClassReps (c c' : S.Classes) (γ : S.G E) : S.GFin := (S.classRep c)⁻¹ * S.ratToFin γ * S.classRep c' /-- The set of terms over (c, s, c'): rational γ such that h_c⁻¹ γ h_c' lies in K and has reduction s. -/ def termsOver (c : S.Classes) (s : S.ResidueGL) (c' : S.Classes) : Set (S.G E) := {γ : S.G E | ∃ k : S.latticeStabilizer, S.reduction k = s ∧ k.val = S.translateByClassReps c c' γ} /-- The group 𝖴_c(M) of rational points u of the unipotent group 𝖴 with h_c⁻¹ u h_c ∈ K(M). -/ def classUnipotent (c : S.Classes) : Subgroup (S.G E) := besselU ⊓ (S.principalLevel.comap ↑(MulAut.conj (S.classRep c)⁻¹)).comap S.ratToFin /-- The subgroup 𝖴⁰_c(M) of the elements of 𝖴_c(M) that fix every frame vector. -/ def classUnipotent₀ (c : S.Classes) : Subgroup (S.G E) := S.classUnipotent c ⊓ besselU0 /-! ### Boxes, Bessel kernels, dimensions and second moments -/ /-- The number `b ^ (37 n)`, the radius of the boxes `frameBox` in which the terms near the frame are counted. -/ def frameBoxRadius : ℝ := S.b ^ (37 * 𝔰.n) /-- The multiples `M x` of the level, for integers `x` of `E`, as tuples over the infinite places. -/ def levelMultiples : AddSubgroup (InfinitePlace E → ℂ) := (AddMonoidHom.mk' (fun (x : 𝓞 E) (v : InfinitePlace E) ↦ Φ v (S.M * (x : E))) fun x y ↦ by simp [funext_iff, mul_add]).range /-- The set `D` is a measurable set of representatives for the tuples of complex numbers, one for each infinite place, modulo `M 𝓞_E`, and its points have modulus at most `b ^ 26` at all places. -/ structure IsResidueDomain (D : Set (InfinitePlace E → ℂ)) : Prop where /-- `D` is measurable. -/ measurableSet : MeasurableSet D /-- The points of `D` have modulus at most `b ^ 26` at every place. -/ norm_le (w : InfinitePlace E → ℂ) (v : InfinitePlace E) : w ∈ D → ‖w v‖ ≤ S.b ^ 26 /-- Every tuple has exactly one translate by `M 𝓞_E` in `D`. -/ existsUnique_add_mem (w : InfinitePlace E → ℂ) : ∃! l : S.levelMultiples, l.val + w ∈ D /-- The entry `(a, b)` of the triangular matrices `New.gramSchmidtMatrix (y v)`, read in the rational frame in place of the normalised one, as a tuple over the infinite places. -/ def ratTriangle (y : InfinitePlace E → 𝔰.G₁) (a b : Fin (𝔰.ϱ + 1)) (v : InfinitePlace E) : ℂ := gramSchmidtMatrix (y v) a b * (S.basisScale v (𝔰.besselFrame a) / S.basisScale v (𝔰.besselFrame b)) /-- The points `y` for which all entries of `New.Filling.ratTriangle y` above the diagonal lie in `D`. -/ def reducedPoints (D : Set (InfinitePlace E → ℂ)) : Set (InfinitePlace E → 𝔰.G₁) := {y : InfinitePlace E → 𝔰.G₁ | ∀ a b : Fin (𝔰.ϱ + 1), a < b → S.ratTriangle y a b ∈ D} /-- The indicator of the reduced points for a chosen set of representatives satisfying `New.Filling.IsResidueDomain` (arbitrary if there is none). -/ def reducedIndicator : (InfinitePlace E → 𝔰.G₁) → ENNReal := (S.reducedPoints (Classical.epsilon S.IsResidueDomain)).indicator 1 /-- A partition of unity `ω` on G_∞ in boxes, for the group 𝖴_c(M) = `classUnipotent c` modulo its subgroup 𝖴⁰_c(M) = `classUnipotent₀ c` fixing the frame: `ω` is measurable, at most one and left invariant under the fixer of the frame, it vanishes outside boxes for the frame vectors, and its translates add up to one. -/ structure IsBoxPartitionOfUnity (c : S.Classes) (ω : (InfinitePlace E → 𝔰.G₁) → ENNReal) : Prop where /-- `ω` is measurable. -/ measurable : Measurable ω /-- If `ω y ≠ 0`, every component `y v` lies in the box `frameBox (b ^ 27 * besselLength (y v))`: its frame vectors have norm at most `b ^ 27` times `besselLength (y v)`. -/ mem_frameBox_besselLength (y : InfinitePlace E → 𝔰.G₁) (v : InfinitePlace E) : ω y ≠ 0 → y v ∈ frameBox (S.b ^ 27 * besselLength (y v)) /-- The translates of `ω` add up to one against every weight `a` on `classUnipotent c` whose sum over each right coset of `classUnipotent₀ c` is one. -/ tsum_mul_eq_one (y : InfinitePlace E → 𝔰.G₁) (a : S.classUnipotent c → ENNReal) : (∀ γ : S.classUnipotent c, ∑' u : (S.classUnipotent₀ c).subgroupOf (S.classUnipotent c), a (u.val * γ) = 1) → ∑' γ : S.classUnipotent c, a γ * ω (S.ratToInf γ * y) = 1 /-- `ω` is at most one. -/ le_one (y : InfinitePlace E → 𝔰.G₁) : ω y ≤ 1 /-- `ω` is left invariant under the fixer of the frame at each place. -/ besselFixer_invariant (s y : InfinitePlace E → 𝔰.G₁) : (∀ v : InfinitePlace E, s v ∈ besselFixer) → ω (s * y) = ω y /-- For y in G_∞ and a tuple i of indices, the product over infinite places v of the i_v-th coordinate of the local Bessel function (full or cut, according to `side`) at y_v. -/ def besselFn (y : InfinitePlace E → 𝔰.G₁) (i : S.BesselCoord) : ℂ := ∏ v : InfinitePlace E, (S.besselSystem v).besselFn side (y v) (i v) /-- For a side, rational γ and y in G_∞, the tensor W(y) ⊗ W(γ⁻¹y)^*, with coordinates W_i(y) conj(W_j(γ⁻¹y)). Here W is the Bessel vector `New.Filling.besselFn` of that side. -/ def besselKernel (γ : S.G E) (y : InfinitePlace E → 𝔰.G₁) : EuclideanSpace ℂ (S.BesselCoord × S.BesselCoord) := WithLp.toLp 2 fun i ↦ S.besselFn side y i.1 * star (S.besselFn side ((S.ratToInf γ)⁻¹ * y) i.2) /-- The number of classes times the number of index tuples of the Bessel systems: the dimension of the space of source forms. -/ def sourceDim : ℕ := Fintype.card S.Classes * Fintype.card S.BesselCoord /-- The product over infinite places of the constants deg of the local Bessel systems. -/ def besselDegree : ℝ := ∏ v : InfinitePlace E, (S.besselSystem v).deg /-- The product `besselDegree` of the degrees of the local Bessel systems is positive. -/ lemma besselDegree_pos : 0 < S.besselDegree := prod_pos fun v _ ↦ (S.besselSystem v).deg_pos /-- The real number `sourceDim`² / (`besselDegree` · mass), with the mass `New.mass` of the genus of the standard lattice of rank dim V. -/ def mainSecondMoment : ℝ := S.sourceDim ^ 2 / (S.besselDegree * mass E 𝔰.r) /-- The number M^(fϱ(2k + 2ϱ + 1)), with k = |κ| and f the number of infinite places of E: the order of the reduction of the integral points of 𝖴. -/ abbrev unipotentOrder : ℕ := S.M ^ (numInfPlaces E * (𝔰.ϱ * (2 * 𝔰.k + 2 * 𝔰.ϱ + 1))) /-- The constant a_* = |R̄₀| · M^(fϱ(2k + 2ϱ + 1)) · (number of classes) · c_S, with R̄₀ the image in `ResidueGL` of the Bessel subgroup, c_S = `siegelConst`, k = |κ|, f the number of infinite places. -/ def scaledSiegelConst : ℝ := Nat.card (S.reducedImage besselS) * S.unipotentOrder * Fintype.card S.Classes * S.siegelConst /-- The real number |R̄₀| · `sourceDim`, where R̄₀ is the image of the Bessel subgroup in `ResidueGL`. -/ def identitySecondMoment : ℝ := Nat.card (S.reducedImage besselS) * S.sourceDim /-- The real number τ = b^{kf/4}, with k = |κ| and f the number of infinite places of E. -/ def tailScale : ℝ := S.b ^ (𝔰.k * numInfPlaces E / 4 : ℝ) /-! ### The standing hypotheses -/ /-- The standing hypotheses: `sourceLevel` is the preimage of K(M), `reduction` is onto, and size inequalities hold between b, M and ϖ, κ_v, N, the constant `scaledSiegelConst`, the second moments, the number of Bessel coordinates and an index. -/ class IsAdmissible : Prop where /-- The level is the preimage in U(X₀) of the principal congruence subgroup K(M). -/ sourceLevel_eq : S.sourceLevel = S.principalLevel.comap S.inclHFin /-- Reduction at the chosen places maps `latticeStabilizer` onto `ResidueGL`. -/ reduction_surjective : Function.Surjective S.reduction /-- |ϖ| ≤ b at every infinite place. -/ norm_deltaE_le (v : InfinitePlace E) : ‖Φ v S.deltaE.val‖ ≤ S.b /-- 1 ≤ |κ_v| at every infinite place v. -/ one_le_abs_realM (v : InfinitePlace E) : 1 ≤ |S.realM v| /-- |κ_v| ≤ b²³ at every infinite place v. -/ abs_realM_le (v : InfinitePlace E) : |S.realM v| ≤ S.b ^ 23 /-- N ≤ b^(60(ϱ + 1)). -/ N_le : S.N ≤ S.b ^ (60 * 𝔰.n) /-- The ratio of `mainSecondMoment` to `identitySecondMoment` is at least b^(11 k f). -/ mul_identitySecondMoment_le : S.b ^ (11 * (𝔰.k * numInfPlaces E)) * S.identitySecondMoment ≤ S.mainSecondMoment /-- The ratio of `mainSecondMoment` to `identitySecondMoment` is at most (M / b⁶)^(k f). -/ mainSecondMoment_le : S.mainSecondMoment ≤ (S.M / S.b ^ 6) ^ (𝔰.k * numInfPlaces E) * S.identitySecondMoment /-- The tensor product of the Bessel systems has at most b^(2 k f) coordinates. -/ card_besselCoord_le : Fintype.card S.BesselCoord ≤ S.b ^ (2 * 𝔰.k * numInfPlaces E) /-- In the stabiliser `stdLevel E κ` of the standard lattice of X₀, the elements that `inclHFin` maps into `latticeStabilizer` form a subgroup whose index (0 if infinite) is at least (N^k / b)^f. -/ le_relIndex : (S.N ^ 𝔰.k / S.b) ^ numInfPlaces E ≤ (S.latticeStabilizer.comap S.inclHFin).relIndex (stdLevel E 𝔰.κ) /-- `scaledSiegelConst` is at most (1 + b⁻⁹) times the product of `mainSecondMoment`, `besselDegree`, the f-th power of `openCellConst`, vol(Ô)^(−(ϱ+1)) and the square of the quotient of `unipotentCovolume` · Λ by the number of Bessel coordinates. -/ scaledSiegelConst_le : S.scaledSiegelConst ≤ (1 + S.b⁻¹ ^ 9) * S.mainSecondMoment * S.besselDegree * 𝔰.openCellConst ^ numInfPlaces E / volÔ E ^ 𝔰.n * (S.unipotentCovolume * S.frameScaleProd / Fintype.card S.BesselCoord) ^ 2 /-! ### Discreteness, cutoffs and amplitudes -/ /-- The entry (i, j) of the component at v of `adelicToInf γ`, for an adelic γ, is the v-component of the entry (i, j) of γ times the quotient `basisScale v j / basisScale v i` of the scales. -/ lemma adelicToInf_apply (γ : S.G (𝔸 E)) (v : InfinitePlace E) (i j : 𝔰.BesselIndex) : (S.adelicToInf γ v).val i j = (γ.val i j).1 v * (S.basisScale v j / S.basisScale v i) := by simp! [adelicToInf, basisScaleGL, U.map, diagGL, fieldEq] /-- For a rational γ, an infinite place v and indices i, j, the (i, j) entry of `ratToInf γ v` is `Φ v` of the (i, j) entry of γ times `basisScale v j / basisScale v i`. Here `ratToInf γ v` is the rescaled image of γ in G₁ at v. -/ @[simp] lemma ratToInf_apply (γ : S.G E) (v : InfinitePlace E) (i j : 𝔰.BesselIndex) : (S.ratToInf γ v).val i j = Φ v (γ.val i j) * (S.basisScale v j / S.basisScale v i) := -- The adelic image of γ has the components `Φ v γ` at infinity, by definition. S.adelicToInf_apply (S.ratToAdelic γ) v i j /-- The finite adelic image of a rational γ is its matrix conjugated by `latticeBasis` into the lattice basis. -/ lemma coe_ratToFin (γ : S.G E) : (S.ratToFin γ : GL 𝔰.BesselIndex (𝔸f E)) = S.latticeBasis⁻¹ * GeneralLinearGroup.map (algebraMap E (𝔸f E)) γ * S.latticeBasis := rfl /-- The rational points of the unitary group form a countable set. -/ instance : Countable (S.G E) := Units.val_injective.injOn.injective.countable /-- Take a class `c` in `S.Classes`, a map `f` from a finite type `m` to the basis index `𝔰.BesselIndex`, and a compact set `C` of families of complex `m × m` matrices indexed by the infinite places of `E`. Then only finitely many points of `C` have the form v ↦ the submatrix on rows and columns `f` of `S.ratToInf u v`, the rescaled image of u at v. Here u runs over 𝖴_c(M) = `S.classUnipotent c`: the rational unipotent u with h_c⁻¹ u h_c in the principal level K(M). -/ lemma finite_classUnipotent_inter_compact (c : S.Classes) {m : Type*} [Finite m] (f : m → 𝔰.BesselIndex) {C : Set (InfinitePlace E → Matrix m m ℂ)} (hC : IsCompact C) : (C ∩ Set.range fun (u : S.classUnipotent c) (v : InfinitePlace E) ↦ (S.ratToInf u v).val.val.submatrix f f).Finite := by -- The `(f i, f j)` entry of `u` is a rational point of a compact set of adeles, so there are -- finitely many values (`finite_setOf_toAdele_mem`): at infinity it is bounded by `C`, -- and at the finite places `(S.latticeBasis * S.classRep c)⁻¹ u (S.latticeBasis * S.classRep c)` -- is integral. let entry (i j : m) (z : (InfinitePlace E → Matrix m m ℂ) × GL 𝔰.BesselIndex (𝔸f E)) : 𝔸 E := (fun v ↦ z.1 v i j * S.basisScale v (f i) / S.basisScale v (f j), MulAut.conj (S.latticeBasis * S.classRep c) z.2 (f i) (f j)) have h_fin (i j : m) : {x : E | toAdele x ∈ entry i j '' C ×ˢ intGL 𝔰.BesselIndex (Ô E)}.Finite := by refine finite_setOf_toAdele_mem ((hC.prod (isCompact_intGL isCompact_Ô)).image ?_) dsimp [entry] fun_prop -- Hence every entry of a point of the intersection takes one of finitely many values. refine (Finite.pi' fun v ↦ Finite.pi' fun i ↦ Finite.pi' fun j ↦ (h_fin i j).image fun x : E ↦ Φ v x * (S.basisScale v (f j) / S.basisScale v (f i))).subset ?_ rintro _ ⟨hu, ⟨u, hu_unip, k, hk_ker, hk⟩, rfl⟩ v i j let z : InfinitePlace E → Matrix m m ℂ := fun w ↦ (S.ratToInf u w).val.val.submatrix f f -- The element `k` of K(M) is `h_c⁻¹ u h_c`, so `(z, k)` gives the adele of the entry. have hk_eq : k.val = (S.classRep c)⁻¹ * S.ratToFin u * S.classRep c := hk have h_entry : entry i j (z, k.val.val) = toAdele (u.val (f i) (f j)) := by simp [entry, z, hk_eq, coe_ratToFin, mul_assoc, Prod.ext_iff, funext_iff] exact ⟨u.val (f i) (f j), ⟨(z, k.val.val), ⟨hu, k.property⟩, h_entry⟩, by simp⟩ /-- Let 𝖴_c(M) = `classUnipotent c` be the group of rational unipotent elements of level M at the class c. The image of any subgroup `K` of 𝖴_c(M) at the infinite places (`ratToInf`) is discrete. -/ lemma discreteTopology_map_ratToInf {c : S.Classes} (K : Subgroup (S.classUnipotent c)) : DiscreteTopology (Subgroup.map (S.ratToInf.domRestrict (S.classUnipotent c)) K) := by -- A compact set of matrices meets the image in a finite set. let Γ : Subgroup (InfinitePlace E → 𝔰.G₁) := Subgroup.map (S.ratToInf.domRestrict (S.classUnipotent c)) K let toMatrices (γ : Γ) (v : InfinitePlace E) : Matrix 𝔰.BesselIndex 𝔰.BesselIndex ℂ := (γ.val v).val.val have h_inj : Function.Injective toMatrices := fun γ γ' h ↦ Subtype.ext (funext fun v ↦ Subtype.ext (Units.ext (congrFun h v))) have h_cont : Continuous toMatrices := continuous_pi fun v ↦ Units.continuous_val.comp (continuous_subtypeVal.comp ((continuous_apply v).comp continuous_subtypeVal)) refine h_cont.discrete_of_tendsto_cofinite_cocompact (tendsto_cofinite_cocompact_iff.2 fun C hC ↦ ?_) -- The matrices of `Γ` are among those of 𝖴_c(M), of which only finitely many lie in `C`. refine (S.finite_classUnipotent_inter_compact c id hC).of_injOn (f := toMatrices) ?_ h_inj.injOn rintro ⟨_, u, hu, rfl⟩ hγ exact ⟨hγ, u, rfl⟩ /-- Take a class `c` in `S.Classes` and a subgroup `K` of 𝖴_c(M) = `S.classUnipotent c`: the rational unipotent u with h_c⁻¹ u h_c in the principal level K(M). Let Γ be the image of `K` under `S.ratToInf`, the rescaled images at the infinite places of `E`. Then Γ lies in the product of the unitary groups `𝔰.G₁` and is discrete. There is a measurable β with values in [0, ∞] such that ∑_{u∈K} β(`S.ratToInf u` · y) = 1 for all y. Also β is a cutoff (`New.IsCutoff`) for Γ with counting measure: its sum over Γ-translates is 1. -/ lemma exists_cutoff_classUnipotent {c : S.Classes} (K : Subgroup (S.classUnipotent c)) : let Γ := Subgroup.map (S.ratToInf.domRestrict (S.classUnipotent c)) K ∃ β : (InfinitePlace E → 𝔰.G₁) → ENNReal, Measurable β ∧ (∀ y : InfinitePlace E → 𝔰.G₁, ∑' u : K, β (S.ratToInf u * y) = 1) ∧ DiscreteTopology Γ ∧ IsCutoff (H := Γ) Measure.count β := by intro Γ have h_disc : DiscreteTopology Γ := S.discreteTopology_map_ratToInf K -- An entry of `u` is determined by its image under an embedding, so `K` maps injectively. have h_inj : Function.Injective (S.ratToInf.domRestrict (S.classUnipotent c)) := fun u ↦ by simp [funext_iff, ← SetLike.coe_eq_coe, GeneralLinearGroup.ext_iff, (RingHom.injective _).eq_iff] -- Take a cutoff `β` of `Γ` for the counting measure; `K` maps bijectively onto `Γ`. obtain ⟨β, hβ_meas, hβ_int⟩ := (hasCutoff_count (Γ := Γ)).out refine ⟨β, hβ_meas, fun y ↦ ?_, h_disc, hβ_meas, hβ_int⟩ calc ∑' u : K, β (S.ratToInf u * y) = ∑' γ : Γ, β (γ • y) := (K.equivMapOfInjective _ h_inj).tsum_eq fun γ ↦ β (γ • y) _ = ∫⁻ γ : Γ, β (γ • y) ∂Measure.count := (lintegral_count _).symm _ = 1 := hβ_int y /-- The function β_c at the infinite places: a chosen cutoff for 𝖴⁰_c(M) times the indicator `New.Filling.reducedIndicator` of the reduced points. The properties of the first factor are stated in `exists_classCutoff_eq_mul`. -/ @[irreducible] def classCutoff (c : S.Classes) : (InfinitePlace E → 𝔰.G₁) → ENNReal := (S.exists_cutoff_classUnipotent ((S.classUnipotent₀ c).subgroupOf (S.classUnipotent c))).choose * S.reducedIndicator /-- For each class `c` there is a measurable β on tuples y : `InfinitePlace E → G₁` with `classCutoff c` = β · `reducedIndicator`, and with ∑ β(`ratToInf u` · y) = 1 for all y, the sum over u in 𝖴⁰_c(M) = `classUnipotent₀ c`. `reducedIndicator` is the indicator of the points y whose entries of `ratTriangle y` above the diagonal lie in the chosen set of representatives modulo M 𝓞_E. -/ lemma exists_classCutoff_eq_mul (c : S.Classes) : ∃ β : (InfinitePlace E → 𝔰.G₁) → ENNReal, S.classCutoff c = β * S.reducedIndicator ∧ Measurable β ∧ ∀ y : InfinitePlace E → 𝔰.G₁, ∑' u : (S.classUnipotent₀ c).subgroupOf (S.classUnipotent c), β (S.ratToInf u * y) = 1 := by obtain ⟨hβ_meas, hβ_sum, -⟩ := (S.exists_cutoff_classUnipotent ((S.classUnipotent₀ c).subgroupOf (S.classUnipotent c))).choose_spec exact ⟨_, by rw [classCutoff], hβ_meas, hβ_sum⟩ /-- The amplitude of γ over the classes c, c': the integral over G_∞ of β_c(y) β_c'(γ⁻¹y) W(y) ⊗ W(γ⁻¹y)^*, with β_c = `classCutoff c` and the tensor of Bessel functions `besselKernel`. -/ def amplitude (c c' : S.Classes) (γ : S.G E) : EuclideanSpace ℂ (S.BesselCoord × S.BesselCoord) := ∫ y : InfinitePlace E → 𝔰.G₁, (S.classCutoff c y * S.classCutoff c' ((S.ratToInf γ)⁻¹ * y)).toReal • S.besselKernel side γ y /-- The integral over G_∞ of β_c(y) β_c'(γ⁻¹y) ‖W(y) ⊗ W(γ⁻¹y)^*‖, with values in [0, ∞], for β_c = `classCutoff c` and the tensor of Bessel functions `besselKernel`. -/ def amplitudeMajorant (c c' : S.Classes) (γ : S.G E) : ENNReal := ∫⁻ y : InfinitePlace E → 𝔰.G₁, S.classCutoff c y * S.classCutoff c' ((S.ratToInf γ)⁻¹ * y) * ‖S.besselKernel side γ y‖ₑ /-- The sum A_T(c, s, c') of the amplitudes of the elements of T that are terms over (c, s, c'). -/ def amplitudeSum (T : Set (S.G E)) (c : S.Classes) (s : S.ResidueGL) (c' : S.Classes) : EuclideanSpace ℂ (S.BesselCoord × S.BesselCoord) := ∑' γ : ↥(T ∩ S.termsOver c s c'), S.amplitude side c c' γ /-! ### Scales, Gram matrices and the covolume -/ /-- The absolute value of κ_v = `realM v` is `S.M * ‖Φ v ϖ‖ / (2π)`, where ϖ = `S.deltaE` is the generator of the different and `Φ v` is the chosen complex embedding at `v`. -/ lemma abs_realM_eq (v : InfinitePlace E) : |S.realM v| = S.M * ‖Φ v S.deltaE‖ / (2 * π) := by simpa [abs_of_pos pi_pos] using congrArg (fun z : ℂ ↦ ‖z‖) (S.coe_realM v) /-- Let γ be rational, v an infinite place and a, b frame indices in 0, …, ϱ. The (a, b) frame product of the rescaled image `ratToInf γ v` of γ in G₁ is the image under the embedding `Φ v` of the (a, b) entry of Z(γ) = `frameProducts γ`, times κ_v^(ϱ-a) κ_v^(ϱ-b) / N. -/ @[simp] lemma realFrameGram_ratToInf (γ : S.G E) (v : InfinitePlace E) : ∀ a b : Fin (𝔰.ϱ + 1), realFrameGram (S.ratToInf γ v) a b = ↑(S.realM v ^ (𝔰.ϱ - a) * S.realM v ^ (𝔰.ϱ - b) / S.N) * Φ v (S.frameProducts γ a b) := by simp [frameGram, Matrix.mul_apply, basisScale, ← ofReal_pow, splitGram, middleGram, Nat.Prime.ne_zero, forall_fin_succ', Matrix.one_apply, fieldEq] /-- Let γ be rational, v an infinite place with chosen embedding `Φ v : E →+* ℂ`, and `e` a finite family of frame indices. On rows and columns `e`, the minor of the frame products of the rescaled image of γ at v is the image under `Φ v` of the minor of Z(γ) = `frameProducts γ`, times the product over `a` of the factors κ_v^(2(ϱ - e a)) / N. Here κ_v = `realM v`, and the prime N of the data divides once in each factor. -/ lemma det_submatrix_realFrameGram_ratToInf (γ : S.G E) (v : InfinitePlace E) {n : Type*} [Fintype n] [DecidableEq n] (e : n → Fin (𝔰.ϱ + 1)) : ((realFrameGram (S.ratToInf γ v)).submatrix e e).det = (∏ a : n, S.realM v ^ (2 * (𝔰.ϱ - e a)) / S.N : ℝ) * Φ v ((S.frameProducts γ).submatrix e e).det := by -- Expand both determinants. By `realFrameGram_ratToInf` each term picks up a power of `S.realM v` -- for every row and for every column, and their product does not depend on the permutation. simp [realFrameGram_ratToInf, det_apply, sq, mul_sum, mul_smul_comm, prod_pow_eq_pow_sum, Equiv.sum_comp _ fun a ↦ 𝔰.ϱ - e a, prod_mul_distrib, pow_mul'] /-- The number `unipotentCovolume` is positive. It serves as the covolume of the groups `classUnipotent c` in the unipotent group at the infinite places, and does not depend on the class c. -/ lemma unipotentCovolume_pos : 0 < S.unipotentCovolume := by have h_M : 0 < S.M := by simp [Nat.Prime.pos] have h_N : 0 < S.N := S.N_prime.pos have h_discr : NumberField.discr E ≠ 0 := NumberField.discr_ne_zero E have h_Λ : 0 < S.frameScaleProd := S.frameScaleProd_pos have h_vol : volÔ E ≠ 0 := volÔ_ne_zero rw [unipotentCovolume] positivity /-! ### The level as a unit, and conditions on reductions and on sets of terms -/ /-- The level M = p₀p₁ as a unit of the finite adeles of E. -/ def ideleM : (𝔸f E)ˣ := Units.map (algebraMap E (𝔸f E)).toMonoidHom (Units.mk0 S.M (by simp [Nat.Prime.ne_zero])) /-- For u in the finite adelic unitary group, the number ψ_f(−σ(u)/(Mϖ)), where σ(u) sums the entries just above the diagonal in the frame block of u. -/ def unipotentChar (u : S.GFin) : ℂ := S.selfDualChar (S.ideleM⁻¹.val * simpleRootSum u) /-- The element s of `ResidueGL` agrees: integral u, u' ∈ 𝖴 whose reductions satisfy ū s = s ū' have the same value of `New.Filling.unipotentChar`. -/ def Agrees (s : S.ResidueGL) : Prop := ∀ u u' : S.latticeStabilizer, u.val ∈ besselU → u'.val ∈ besselU → S.reduction u * s = s * S.reduction u' → S.unipotentChar u = S.unipotentChar u' /-- A set T of rational elements is stable if, for all rational points u, u' of 𝖴 and every γ, u⁻¹γu' lies in T if and only if γ does. -/ def IsStable (T : Set (S.G E)) : Prop := ∀ u ∈ besselU, ∀ u' ∈ besselU, ∀ γ : S.G E, u⁻¹ * γ * u' ∈ T ↔ γ ∈ T /-- The set of rational elements γ of the unitary group with `termDisc γ ≠ 0` whose link (`New.link`) is the given submodule `Λ`. -/ def termsOfLink (Λ : Submodule E (𝔰.MiddleIndex ⊕ 𝔰.MiddleIndex → E)) : Set (S.G E) := {γ : S.G E | S.termDisc γ ≠ 0 ∧ link γ = Λ} export IsAdmissible (one_le_abs_realM abs_realM_le N_le) end Filling end New end