Skip to content

Relative-Trace Unfolding, Bessel Translates, and the Two Moment Bounds ​

This page explains the central unfolding hub of Stage 04 — src/New/Spanning/Unfolding/Moments.lean (04_spanning/moments, 40 declarations, 0 stub truncations) — together with its upstream Bessel-vector foundation in src/New/Spanning/Bessel/{LargeFunction,SchurBound,CutTailBound}.lean and the Laplace-method period lower bound in src/New/Appendix/DiscreteSeries/Periods.lean. Return to the Stage 04 Overview, read Target Dimension, Multiplicity Equality & Spanning, or continue to Kloosterman Sieve & Remaining Terms.

Level 1 · First-Principles

Level 1 — First-Principles ​

In the previous essay, SpanningTheorem.lean turned two operator inequalities on the scaled Poincaré map P—good-forms near isometryHilbert–Schmidt norm and the whole-group second moment—into the spreading theorem. Where do those two inequalities come from? They come from opening up the operator Ps=P∗ρ(s)P on the source space and reading its matrix entries directly.

Because P is constructed by averaging a local Bessel function W over rational group elements, pairing ρ(s)P against P unfolds into a block matrix indexed by pairs of double-coset classes (c,c′) of the definite subgroup U(X0). Each block is the complex conjugate of a normalized sum of archimedean overlap integrals Aγ=∫βc(y)βc′(γ−1y)W(y)⊗W(γ−1y)∗dyBessel orbital integral over rational elements γ whose finite-prime reduction matches s, divided by the unipotent covolume ν (HasAmplitudeBlocks).

Once Ps is unfolded into these amplitude blocks, Moments.lean separates the finite level group G¯=Gp0×Gp1 into three clean regimes:

Matrix block anatomy of P_s = P* rho(s) P unfolded into Bessel orbital amplitude sums across the Bessel subgroup R_0, the open generic cell, and the remaining-term regimes

  1. Near the Bessel subgroup R¯0 (why P∗P≈1): Rational elements γ inside the Bessel subgroup do not scramble orbits; their block sum builds an explicit unitary Bessel translate operator rψ(s) on the source space that equals the identity at s=1 and intertwines ρ|R¯0 with P (ρ(t)P=Prψ(t)). Whenever s∈G¯ agrees with R¯0 at one of the two level primesprime number, every term outside the Bessel subgroup adds up to at most b−12Did (sum_hilbertSchmidtNorm_sub_besselTranslate_sq_le). Because ∥Pt−rψ(t)∥HS2=∥P∗P−1∥HS2 is identical across all t∈R¯0, dividing by #R¯0 immediately forces∥P∗P−1∥HS2≤b−12DX(hilbertSchmidtNorm_sub_one_sq_le).
  2. Across the whole group G¯ (the second moment): Summing ∥Ps∥HS2 over all s∈G¯ combines the Bessel-subgroup contribution, the truncation error between the full and cut Bessel function, the big-cell one-sided Poisson summation sieveKloosterman sieve from EnergyEstimate.lean, and the common-link sublattice and weighted Schur test boundslink lattice from RemainingTerms/Sum.lean to prove∑s∈G¯∥P∗ρ(s)P∥HS2≤(1+9b−4)Dmain(sum_hilbertSchmidtNorm_sq_le).
  3. Why two level primes p0,p1 make bad types harmless: Knowing P∗P≈1 is not enough on its own—Stage 04 needs the projected map e0P onto good forms to stay nearly isometric, where e0=ep0⊗ep1 is a tensor product of two prime-level orthogonal projections selecting allowed primitive polynomial labelscentral idempotent. Because there are two primes (M=p0p1), Stage 04 splits the complement1−ep0⊗ep1=(1−ep0)⊗1+ep0⊗(1−ep1)and bounds each prime pi while holding the other prime pi+1 fixed at 1. Holding s(i+1)=1 forces every contributing Bessel-subgroup element to become purely unipotent (mem_besselU_of_reduction_eq_one), so tr(rψ(s)) simplifies to DX times the unipotent character ψU(s). Averaging over conjugates replaces ψU by its class-function mean ψU♮, which satisfies the sharp L2 bound ∑s∈G¯|ψU♮(s)|2≤2 (sum_norm_reducedCharMean_sq_le). Pairing 2 with the bad-type share b−8/2 gives at most b−4DX per prime (plus b−6DX from non-Bessel remainders), summing across both primes to ∥(1−e0)P∥HS2≤4b−4DX, and combining with ∥P∗P−1∥HS2≤b−12DX to yield the near-isometry error 5b−4 (isNearIsometry_piTensorElem_comp).

Where this analogy breaks ​

Presenting Moments.lean as a clean three-regime decomposition of one block matrix skips an essential archimedean bridge that sits underneath HasAmplitudeBlocks. The Poincaré map unfolds natively to the full discrete-series Bessel function W (.full), which is smooth and integrable but not compactly supported modulo the Bessel subgroup. By contrast, both EnergyEstimate.lean and RemainingTerms/Sum.lean require the compactly supported cut Bessel function W♭ (.cut), cut off at Bessel length b6n+2. Ensuring that W is non-degenerate at a stationary point (LargeFunction.lean + Appendix/DiscreteSeries/Periods.lean's Laplace method), controlling its derivatives via Harish-Chandra Schur orthogonality (SchurBound.lean), and proving that W−W♭ has negligible L2 tail (CutTailBound.lean) take 21 upstream files before Moments.lean ever runs.

Level 2 · Undergrad Bridge

Level 2 — Undergrad Bridge ​

1. Amplitude blocks and the unitary Bessel translate rψ(s) (Moments.lean, lines 75–397) ​

Let S:Filling E s be admissible filling data over a CM field E carrying WeilData E (in particular HasPrimitiveRoot5040 E), with finite residue group G¯=S.ResidueGL=G0×G1 above the two level primes p0,p1, source space Hsrc=EuclideanSpace C (S.Classes×S.BesselCoord) of dimension DX=S.sourceDim, and unitary representation ρ:G¯→U(V).

  • HasAmplitudeBlocks ρ P states that for all s∈G¯ and basis vectors e(c,i),e(c′,j), the (c,c′) block of Ps=P∗ρ(s)P is Afull(c,s,c′)/ν―, where Afull(c,s,c′)=S.amplitudeSum .full .univ c s c′ sums the archimedean orbital integrals over all rational γ∈S.termsOver c s c′ and ν=S.unipotentCovolume>0. By hasAmplitudeBlocks_smul_of_inner_eq, rescaling an unnormalized Poincaré map by (cν)−1/2 achieves HasAmplitudeBlocks, and hilbertSchmidtNorm_sq_eq_secondMoment identifies∥Ps∥HS2=secondMoment(S.amplitudeSum .full .univ) {s}.
  • besselTranslate s (rψ(s):Hsrc→CHsrc) is defined by the same block formula summed only over γ∈besselS (block unitriangular elements times U(X0)). Its algebraic laws are:
    • rψ(s)=0 outside R¯0=S.reducedImage besselS (besselTranslate_eq_zero);
    • rψ(1)=1, rψ(st)=rψ(s)rψ(t) for s,t∈R¯0, rψ(ts)=rψ(t)rψ(s) for t∈R¯0,s∈G¯, and rψ(s)∗=rψ(s−1) (besselTranslate_one, besselTranslate_mul, besselTranslate_mul_left, adjoint_besselTranslate);
    • two-sided equivariance: Pst=Psrψ(t), ρ(t)P=Prψ(t), and Pts=rψ(t)Ps for all t∈R¯0 (adjoint_comp_rep_mul_right, rep_comp_eq_comp_besselTranslate, adjoint_comp_rep_mul_left).

2. The two core Hilbert–Schmidt bounds (Moments.lean, lines 399–583) ​

  1. Near-R¯0 bound and P∗P≈1: Subtracting rψ(s) removes the Bessel-subgroup terms: ∥Ps−rψ(s)∥HS2=secondMoment(S.amplitudeSum .full besselSc) {s} (hilbertSchmidtNorm_sub_besselTranslate_sq). Pulling in Unfolding/SquareExpansion.lean (which consumes RemainingTerms/Sum.lean and the cut-tail bounds), sum_hilbertSchmidtNorm_sub_besselTranslate_sq_le bounds the slice where s agrees with R¯0 above the complementary prime pi+1:∑s∈G¯∃t∈R¯0,si+1=ti+1∥Ps−rψ(s)∥HS2≤b−12Did,Did=#R¯0⋅DX.For every t∈R¯0, unitary equivariance gives ∥Pt−rψ(t)∥HS2=∥rψ(t)(P∗P−1)∥HS2=∥P∗P−1∥HS2. Restricting the sum to t∈R¯0 gives #R¯0⋅∥P∗P−1∥HS2≤b−12Did, and dividing by #R¯0 (le_sourceDim_div_of_card_nsmul_le) proves hilbertSchmidtNorm_sub_one_sq_le:∥P∗P−1∥HS2≤DXb12(hence also ∥P∗P∥HS2≤2DX).
  2. Whole-group second moment (sum_hilbertSchmidtNorm_sq_le): Pulling in Unfolding/MomentBounds.lean—which partitions G¯ into open reductions (EnergyEstimate.lean::linkSecondMoment_isOpenElement_le, contributing (1+b−4)Dmain), meeting reductions (RemainingTerms/Sum.lean::linkSecondMoment_le_of_le_meetNorm), cross-link/g=0 terms (secondMoment_remainingTerms_le), Bessel-subgroup terms, and the .full-vs-.cut tail—proves∑s∈G¯∥P∗ρ(s)P∥HS2≤(1+9b4)Dmain,Dmain=DX2deg⋅massr.

3. Two level primes and the bad-type projection loss (Moments.lean, lines 591–1256) ​

Let gi∈C[Gi] (i∈{0,1}) be central idempotents above p0,p1 with Re((1−gi)(1))≤b−8/2, and let e0=g0⊗g1=piTensorElem g. Setting xi=1−gi (embedded in G¯ via Pi.mulSingle i, so the other prime component is 1):

  1. Remainder term (hilbertSchmidtNorm_sum_smul_sub_besselTranslate_sq_le): Because every t∈Gi embedded via Pi.mulSingle i has (i+1)-component equal to 1∈R¯0,i+1, the sum ∑t∈Gixi(t)(Pt−rψ(t)) lies inside the near-R¯0 slice. By Cauchy–Schwarz and sum_norm_sq_coeff_of_isCentralProj (∑|xi(t)|2=Rexi(1)≤1),‖∑t∈Gixi(t)(Pt−rψ(t))‖HS2≤DXb12.
  2. Why holding the second prime at 1 isolates unipotent elements (mem_besselU_of_reduction_eq_one → trace_besselTranslate_eq_mul_reducedChar): If γ∈besselS conjugates into k=hc−1γhc∈S.latticeStabilizer and reduces to 1 above pi+1, then the definite U(X0) factor of γ must be 1 (free level above pi+1), forcing k∈besselU. Consequently, tr(rψ(s))=DX⋅ψU(s) whenever si+1=1, where ψU=S.reducedChar is the additive character u↦ψf(−σ(u)/(Mϖ)) extended by 0 off U¯0.
  3. Induced unipotent character L2 bound (sum_norm_reducedCharMean_sq_le): Averaging ψU over conjugates in G¯ produces the class function ψU♮=S.reducedCharMean, which matches the local K-orbital integral vol(K)−1∫KχM(yly−1)dy (extendedBesselChar_toPlaces_eq_reducedChar, integral_extendedBesselChar_conj_eq). Evaluating the L2 sum of conjugate integrals (sum_sq_norm_integral_extendedBesselChar_conjugate_le) gives∑s∈G¯|ψU♮(s)|2≤2.
  4. One prime → both primes → near-isometry: Since xi is a class function, tr(rψ(xi))=DX∑t∈Gixi(t)ψU♮(t), so Cauchy–Schwarz gives Retr(rψ(xi))≤DXb−8/22=b−4DX (re_sum_coeff_mul_trace_besselTranslate_le). Adding the remainder contribution b−6DX≤b−4DX yields ∥xiP∥HS2≤2b−4DX (hilbertSchmidtNorm_asAlgebraHom_comp_sq_le). Applying hilbertSchmidtNorm_one_sub_mul_comp_sq_le to 1−g0⊗g1 sums the two prime losses:‖(1−e0)P‖HS2≤4b−4DX(hilbertSchmidtNorm_one_sub_piTensorElem_comp_sq_le).Finally, IsNearIsometry.proj_comp combines IsNearIsometry P b⁻⁴ (from b−6≤b−4) with ∥(1−e0)P∥HS2≤4b−4DX to prove isNearIsometry_piTensorElem_comp: IsNearIsometry (e₀ ∘ₗ P) (5 * b⁻⁴).

4. Upstream discrete-series Bessel vectors (.full vs. .cut) ​

The filling data S = D.filling instantiated in Moments.lean relies on four upstream archimedean pillars:

  • src/New/Appendix/DiscreteSeries/Periods.lean (IsLaplaceDatum.laplace_method): Proves an explicit polynomial-in-β lower bound on restriction periods of steep discrete-series matrix coefficients via Laplace's method near the identity (the integrand stays in a cone around the positive real axis up to exponentially small error).
  • src/New/Spanning/Bessel/LargeFunction.lean (IsDiscreteSeriesBessel, IsSteep.exists_stationary_point): Uses Witt's theorem and Periods.lean to construct a stationary point x of bounded Bessel length where the average W(y)=c∫Rcλ(x−1sy)π(s)−1vds is large and reproduced under right convolution by the discrete-series idempotent deg⋅cλ.
  • src/New/Spanning/Bessel/SchurBound.lean (HasSchurBound): Proves smoothness and Harish-Chandra Schur-orthogonality L2 bounds for all right derivatives of W of order ≤2n2.
  • src/New/Spanning/Bessel/CutTailBound.lean (besselCut, exists_isCutPair_besselAverage): Truncates W to the compactly supported cut Bessel function W♭ (besselCut, supported on besselLength g ≤ b^{6n+2}) and bounds ∥W−W♭∥L2 explicitly, allowing Moments.lean to pass safely between .full (unfolded Poincaré inner products) and .cut (sieve and remaining-term estimates).
Level 3 · Formal Lean Contract

Level 3 — Formal Lean Contract ​

The extracted skeleton skeleton/04_spanning/moments.lean mirrors src/New/Spanning/Unfolding/Moments.lean at pinned upstream commit 41c2716658c42ba08eb0648994a2efe83082a95c, containing 40 declarations and 0 stub truncations.

Headline Theorem Signatures ​

From skeleton/04_spanning/moments.lean (upstream src/New/Spanning/Unfolding/Moments.lean:434–1256):

lean
theorem New.Filling.HasAmplitudeBlocks.sum_hilbertSchmidtNorm_sub_besselTranslate_sq_le [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) (i : Fin 2) :
    ∑ s : S.ResidueGL with ∃ t ∈ S.reducedImage besselS, s (i + 1) = t (i + 1),
      hilbertSchmidtNorm (P.adjoint ∘ₗ ρ s ∘ₗ P - S.besselTranslate s) ^ 2 ≤
      (S.b ^ 12)⁻¹ * S.identitySecondMoment

theorem New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sub_one_sq_le [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) :
    hilbertSchmidtNorm (P.adjoint ∘ₗ P - 1) ^ 2 ≤ S.sourceDim / S.b ^ 12

theorem New.Filling.HasAmplitudeBlocks.sum_hilbertSchmidtNorm_sq_le [WeilData E] (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) :
    ∑ s : S.ResidueGL, hilbertSchmidtNorm (P.adjoint ∘ₗ ρ s ∘ₗ P) ^ 2 ≤
      (1 + 9 / S.b ^ 4) * S.mainSecondMoment

theorem New.Filling.sum_norm_reducedCharMean_sq_le [ok : S.IsAdmissible] :
    ∑ s : S.ResidueGL, ‖S.reducedCharMean s‖ ^ 2 ≤ 2

theorem New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_one_sub_piTensorElem_comp_sq_le [WeilData E]
    (hP : S.HasAmplitudeBlocks ρ P) (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x,
      y⟫_ℂ)
    (hg : ∀ i : Fin 2, IsCentralProj (g i))
    (hg_small : ∀ i : Fin 2, ((1 - g i).coeff 1).re ≤ (S.b ^ 8)⁻¹ / 2) :
    hilbertSchmidtNorm ((1 - ρ.asAlgebraHom (piTensorElem g)) ∘ₗ P) ^ 2 ≤
      4 * (S.b ^ 4)⁻¹ * S.sourceDim

theorem New.Filling.HasAmplitudeBlocks.isNearIsometry_piTensorElem_comp [WeilData E]
    (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ)
    (hg : ∀ i : Fin 2, IsCentralProj (g i))
    (hg_small : ∀ i : Fin 2, ((1 - g i).coeff 1).re ≤ (S.b ^ 8)⁻¹ / 2) :
    IsNearIsometry (ρ.asAlgebraHom (piTensorElem g) ∘ₗ P) (5 * (S.b ^ 4)⁻¹)
  • Verification status (audit/verification-status.json): Local Lean compilation and kernel replay remain build_status: unverified-locally at pinned commit 41c2716658c42ba08eb0648994a2efe83082a95c (41c2716658c4). Static token scanning has scan_scope: entry, covering only Challenge.lean, src/Main.lean, and src/Statements.lean (0 forbidden tokens in solution files, 5 expected sorry tokens in Challenge.lean). Moments.lean and the upstream Bessel/ and Appendix/DiscreteSeries/ files have not been locally compiled, kernel-checked, or statically scanned here.

lemma New.IsCentralProj.isSymmetricProjection — Upstream source (src/New/Spanning/Unfolding/Moments.lean L75-L82)

lean
/-- In a unitary representation `ρ` of a finite group, a central idempotent `z` of the group algebra
(an idempotent whose coefficients form a class function) acts as an orthogonal projection. -/
lemma New.IsCentralProj.isSymmetricProjection {H : Type} [Group H] [Fintype H]
    {ρ : Representation ℂ H V} (hρ : ∀ (s : H) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ)
    {z : MonoidAlgebra ℂ H} (hz : IsCentralProj z) :
    (ρ.asAlgebraHom z).IsSymmetricProjection := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:75-82 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=ef21c44f582d8fa13dc61b647f2c045b03a2603613aed146acc2e83e9da3cab1]

def New.Filling.HasAmplitudeBlocks — Upstream source (src/New/Spanning/Unfolding/Moments.lean L86-L100)

lean
/-- Let `Ḡ = S.ResidueGL` be the product of the general linear groups over the residue fields at the
chosen places of `S`. The source is the Euclidean space with coordinates `(c, i)`, where `c` is a
class (a double coset of the definite unitary group `U(X₀)` for the level) and `i` is a coordinate
of the Bessel function `W` at the infinite places. For a representation `ρ` of `Ḡ` on `V` and a
linear map `P` from the source to `V`, this says that the block `(c, c')` of `P_s = P* ρ(s) P` is
the complex conjugate of `A(c, s, c') / ν`. Here `ν = unipotentCovolume`, and
`A(c, s, c') = amplitudeSum .full .univ c s c'` is the sum of the amplitudes
`∫ β_c(y) β_c'(γ⁻¹ y) W(y) ⊗ W(γ⁻¹ y)^* dy` over all terms, the rational `γ` such that
`h_c⁻¹ γ h_c'` is integral with reduction `s`; `h_c` represents the class `c` and
`β_c = classCutoff c`. This holds for the Poincaré map after scaling. -/
def New.Filling.HasAmplitudeBlocks (ρ : Representation ℂ S.ResidueGL V)
    (P : EuclideanSpace ℂ (S.Classes × S.BesselCoord) →ₗ[ℂ] V) : Prop := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:86-100 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=a5d7cb3624a4a2a558f978701bf06a2bfed3f1a48686d720e360f4b6e78fd7f9]

lemma New.Filling.hasAmplitudeBlocks_smul_of_inner_eq — Upstream source (src/New/Spanning/Unfolding/Moments.lean L107-L126)

lean
/-- Let `S` be filling data for a unitary group over the CM field `E`, and `Ḡ = S.ResidueGL` the
product of the general linear groups over the residue fields at the chosen places. Let `ρ` be a
representation of `Ḡ` on `V` and `P` a linear map to `V` from the Euclidean space with basis `e_x`,
where `x` is a pair of a class (a double coset of the definite unitary group `U(X₀)` for the level)
and a coordinate of the Bessel function `W` at the infinite places. Suppose that
`⟪ρ(s) P e_y, P e_x⟫` is `c > 0` times the entry of `amplitudeSum .full .univ`, the sum over all
rational terms of the amplitude integrals of the uncut function `W`. Then `(c ν) ^ (-1/2) P`
satisfies `HasAmplitudeBlocks`, the same identity with `ν⁻¹` in place of `c`, where
`ν = S.unipotentCovolume > 0`. -/
lemma New.Filling.hasAmplitudeBlocks_smul_of_inner_eq {c : ℝ} (hc : 0 < c)
    (hP : ∀ (s : S.ResidueGL) (x y : S.Classes × S.BesselCoord),
      ⟪ρ s (P (.single y 1)), P (.single x 1)⟫_ℂ =
        ofReal c * S.amplitudeSum .full .univ x.1 s y.1 (x.2, y.2)) :
    S.HasAmplitudeBlocks ρ (ofReal √(c * S.unipotentCovolume)⁻¹ • P) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:107-126 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=7 body_sha256=f4be9dec82032e42a40e9ba8d1b2a013d57348a054b3a8e35f6e2f32071d0b9c]

lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sq_eq_secondMoment — Upstream source (src/New/Spanning/Unfolding/Moments.lean L129-L153)

lean
/-- Let `S` be filling data (`Filling`) for a unitary group `G` over the CM field `E`, and let
`Ḡ = S.ResidueGL` be the product of the general linear groups over the residue fields at the chosen
places above the two level primes `p₀`, `p₁`. The source is the Euclidean space with coordinates
`(c, i)`, where `c` is a class (a double coset of the definite unitary group `U(X₀)` for the level)
and `i` is a coordinate of the Bessel function `W` at the infinite places. Let `ρ` be a
representation of `Ḡ` on `V` and `P` a linear map from the source to `V`. Suppose
`HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the conjugate of
`A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum, over the
rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral of
`W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Then the squared
Hilbert–Schmidt norm of `P_s` is `∑ ‖A(c, s, c')‖² / ν²` over pairs of classes, the second moment at
`s` of all terms (`.univ`) for the uncut function `W` (`.full`). -/
lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sq_eq_secondMoment (hP : S.HasAmplitudeBlocks ρ P)
    (s : S.ResidueGL) :
    hilbertSchmidtNorm (P.adjoint ∘ₗ ρ s ∘ₗ P) ^ 2 =
      secondMoment (S.amplitudeSum .full .univ) {s} := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:129-153 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=10 body_sha256=94a4e1ab26bde1d1274f0f9da5a1b05336a72f165a1245db65a152138321b2ce]

def New.Filling.besselTranslate — Upstream source (src/New/Spanning/Unfolding/Moments.lean L157-L167)

lean
/-- The operator `r_ψ(s)` on the source: its blocks are the complex conjugates of the sums of
amplitudes (`amplitudeSum`) of the terms in the Bessel subgroup, divided by `unipotentCovolume`. For
`s` in the image `R̄₀` of the Bessel subgroup it is the translation by `s`, twisted by the
character: each class `c` has a term of the Bessel subgroup over some block `(c, s, c')`
(`exists_besselS_mem_termsOver`), its matrix is given by `besselFn_mul_of_eq_embedH`, and
`besselTranslate_apply` gives the value of the operator. -/
noncomputable def New.Filling.besselTranslate (s : S.ResidueGL) :
    EuclideanSpace ℂ (S.Classes × S.BesselCoord) →ₗ[ℂ]
      EuclideanSpace ℂ (S.Classes × S.BesselCoord) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:157-167 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=a5fa76bc225c778dea312a5ec62fd74d8fce3c907abe63fd4a0ef22bbc752ee2]

lemma New.Filling.besselTranslate_eq_zero — Upstream source (src/New/Spanning/Unfolding/Moments.lean L170-L176)

lean
/-- The operator `r_ψ(s) = besselTranslate s`, whose blocks are sums over rational elements of the
Bessel subgroup with reduction `s`, vanishes for `s` off the image of that subgroup in
`S.ResidueGL`. -/
lemma New.Filling.besselTranslate_eq_zero {s : S.ResidueGL} (hs : s ∉ S.reducedImage besselS) :
    S.besselTranslate s = 0 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:170-176 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=9af472ef71a68300dc9dfc64b369056ef80a4484297e51578ef88196745e4c86]

lemma New.Filling.besselTranslate_apply — Upstream source (src/New/Spanning/Unfolding/Moments.lean L178-L197)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which contains
a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. Let
`r_ψ(s) = S.besselTranslate s` be the operator on the source `ℂ^(classes × Bessel coordinates)`
whose blocks are the complex conjugates of the normalised amplitude sums of the rational elements of
the Bessel subgroup `besselS`. Let `γ` be a rational element of that subgroup over the block
`(c, s, c')`: `h_c⁻¹ γ h_c'` is integral with reduction `s`, where `h_c` represents the class `c`.
Suppose `W(γ y) = M W(y)` for all points `y` of `G` at the infinite places, where
`W = S.besselFn .full` is the vector of Bessel functions. Then the value of `r_ψ(s) φ` at the class
`c` is the entrywise conjugate of `M` applied to the value of `φ` at `c'`. -/
lemma New.Filling.besselTranslate_apply [HasPrimitiveRoot5040 E] {γ : S.G E} {c c' : S.Classes}
    {s : S.ResidueGL} (hγ : γ ∈ besselS) (hγ_over : γ ∈ S.termsOver c s c')
    {M : Matrix S.BesselCoord S.BesselCoord ℂ}
    (hM : ∀ y : NumberField.InfinitePlace E → 𝔰.G₁,
      S.besselFn .full (S.ratToInf γ * y) = M *ᵥ S.besselFn .full y)
    (φ : EuclideanSpace ℂ (S.Classes × S.BesselCoord)) (i : S.BesselCoord) :
    S.besselTranslate s φ (c, i) = ∑ j : S.BesselCoord, star (M i j) * φ (c', j) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:178-197 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=4 body_sha256=f7b8210694a2cac6f073ba03602816df7d55a2a5024782f0b3970f72c741fc63]

lemma New.Filling.besselTranslate_one — Upstream source (src/New/Spanning/Unfolding/Moments.lean L199-L205)

lean
/-- For admissible filling data `S` over a CM field `E` with a primitive `5040`-th root of unity,
the operator `r_ψ(1) = besselTranslate 1` is the identity. -/
lemma New.Filling.besselTranslate_one [HasPrimitiveRoot5040 E] : S.besselTranslate 1 = 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:199-205 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=65fafca037b928840c65fab5a6a1bf368f09ea5efc2a9d34704d43d0d7bac626]

lemma New.Filling.besselTranslate_mul — Upstream source (src/New/Spanning/Unfolding/Moments.lean L207-L229)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which contains
a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. Then
`r_ψ(s t) = r_ψ(s) r_ψ(t)` for `s` and `t` in `R̄₀`. -/
lemma New.Filling.besselTranslate_mul [HasPrimitiveRoot5040 E] {s t : S.ResidueGL}
    (hs : s ∈ S.reducedImage besselS) (ht : t ∈ S.reducedImage besselS) :
    S.besselTranslate (s * t) = S.besselTranslate s * S.besselTranslate t := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:207-229 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=17 body_sha256=76045f66ac7e4c3a3e4d47277e3eb0037bfdd37bbd31ea425c9e8f6b9deaf6df]

lemma New.Filling.besselTranslate_mul_left — Upstream source (src/New/Spanning/Unfolding/Moments.lean L231-L241)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which contains
a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. Then
`r_ψ(t s) = r_ψ(t) r_ψ(s)` for `t` in `R̄₀` and every `s` in `Ḡ`. -/
lemma New.Filling.besselTranslate_mul_left [HasPrimitiveRoot5040 E] {t : S.ResidueGL}
    (ht : t ∈ S.reducedImage besselS) (s : S.ResidueGL) :
    S.besselTranslate (t * s) = S.besselTranslate t * S.besselTranslate s := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:231-241 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=ea14f513e2b7138250bc80a75b1e61a6ebf220b4748fe6694c133ab9f382f669]

lemma New.Filling.adjoint_besselTranslate — Upstream source (src/New/Spanning/Unfolding/Moments.lean L243-L253)

lean
/-- Let `S` be admissible filling data over a CM field `E` with a primitive `5040`-th root of unity.
The adjoint of `r_ψ(s) = besselTranslate s` is `r_ψ(s⁻¹)`. So, by `besselTranslate_mul` and
`besselTranslate_one`, `r_ψ` is a unitary representation of the image of the Bessel subgroup. -/
lemma New.Filling.adjoint_besselTranslate [HasPrimitiveRoot5040 E] (s : S.ResidueGL) :
    (S.besselTranslate s).adjoint = S.besselTranslate s⁻¹ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:243-253 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=7 body_sha256=6be51e035e312742ff5e53e88f9ad4d86d41e25070c4d36df8ce10df594ec1a9]

lemma New.Filling.hilbertSchmidtNorm_besselTranslate_comp — Upstream source (src/New/Spanning/Unfolding/Moments.lean L255-L273)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which contains
a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. For `t`
in `R̄₀` the operator `r_ψ(t)` is unitary, so composing an operator `A` of the source on the left
with it does not change the Hilbert–Schmidt norm. -/
lemma New.Filling.hilbertSchmidtNorm_besselTranslate_comp [HasPrimitiveRoot5040 E] {t : S.ResidueGL}
    (ht : t ∈ S.reducedImage besselS)
    (A : EuclideanSpace ℂ (S.Classes × S.BesselCoord) →ₗ[ℂ]
      EuclideanSpace ℂ (S.Classes × S.BesselCoord)) :
    hilbertSchmidtNorm (S.besselTranslate t ∘ₗ A) = hilbertSchmidtNorm A := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:255-273 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=10 body_sha256=2c0947012befb255e37f9492c344c859e6067df1aac88261d6cad1511ae99353]

lemma New.Filling.trace_besselTranslate — Upstream source (src/New/Spanning/Unfolding/Moments.lean L275-L286)

lean
/-- Let `S` be admissible filling data over a CM field `E` with a primitive `5040`-th root of unity.
The trace of `r_ψ(s) = besselTranslate s` is a sum over classes `c` and Bessel coordinates `i`. Each
summand is the `(i, i)` entry of the full amplitude sum `amplitudeSum` of the terms in the Bessel
subgroup `besselS` over the block `(c, s⁻¹, c)`, divided by `unipotentCovolume`. -/
lemma New.Filling.trace_besselTranslate [HasPrimitiveRoot5040 E] (s : S.ResidueGL) :
    LinearMap.trace ℂ (EuclideanSpace ℂ (S.Classes × S.BesselCoord)) (S.besselTranslate s) =
      ∑ y : S.Classes × S.BesselCoord,
        S.amplitudeSum .full (S.ratMiddle E).besselS y.1 s⁻¹ y.1 (y.2, y.2) /
          S.unipotentCovolume := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:275-286 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=4 body_sha256=85234c4e938616792a4c1755dda3238534f6692ddce5c7a4a7da47a23f2bae55]

lemma New.Filling.HasAmplitudeBlocks.adjoint_comp_rep_mul_right — Upstream source (src/New/Spanning/Unfolding/Moments.lean L288-L337)

lean
/-- Equivariance on the right. Let `S` be admissible filling data for a unitary group `G` over the
CM field `E`, which contains a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the
product of the general linear groups over the residue fields at the chosen places above the two
level primes `p₀`, `p₁`. The source is the Euclidean space with coordinates `(c, i)`, where `c` is a
class (a double coset of the definite unitary group `U(X₀)` for the level) and `i` is a coordinate
of the Bessel function `W` at the infinite places. Let `ρ` be a representation of `Ḡ` on `V` and `P`
a linear map from the source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of
`P_s = P* ρ(s) P` is the conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and
`A(c, s, c')` is the sum, over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with
reduction `s`, of an integral of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class
`c`). Let `r_ψ(s) = S.besselTranslate s` be the operator on the source with the same blocks, but
summed only over the `γ` in the Bessel subgroup `besselS` (block unitriangular elements times
`U(X₀)`), and let `R̄₀` be the image of that subgroup in `Ḡ`. Then `P_(s t) = P_s r_ψ(t)` for `t` in
`R̄₀`. -/
lemma New.Filling.HasAmplitudeBlocks.adjoint_comp_rep_mul_right [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) (s : S.ResidueGL) {t : S.ResidueGL}
      (ht : t ∈ S.reducedImage besselS) :
    P.adjoint ∘ₗ ρ (s * t) ∘ₗ P = (P.adjoint ∘ₗ ρ s ∘ₗ P) ∘ₗ S.besselTranslate t := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:288-337 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=33 body_sha256=b4ea3782ccc8f11122d1d20b7e7af18fd9be12c06bfb54a1209634711489e044]

lemma New.Filling.HasAmplitudeBlocks.rep_comp_eq_comp_besselTranslate — Upstream source (src/New/Spanning/Unfolding/Moments.lean L339-L371)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which contains
a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. The
source is the Euclidean space with coordinates `(c, i)`, where `c` is a class (a double coset of the
definite unitary group `U(X₀)` for the level) and `i` is a coordinate of the Bessel function `W` at
the infinite places. Let `ρ` be a unitary representation of `Ḡ` on `V` and `P` a linear map from the
source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the
conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum,
over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral
of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Let
`r_ψ(s) = S.besselTranslate s` be the operator on the source with the same blocks, but summed only
over the `γ` in the Bessel subgroup `besselS` (block unitriangular elements times `U(X₀)`), and let
`R̄₀` be the image of that subgroup in `Ḡ`. Then `ρ(t) P = P r_ψ(t)` for `t` in `R̄₀`. -/
lemma New.Filling.HasAmplitudeBlocks.rep_comp_eq_comp_besselTranslate [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) {t : S.ResidueGL}
    (ht : t ∈ S.reducedImage besselS) :
    ρ t ∘ₗ P = P ∘ₗ S.besselTranslate t := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:339-371 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=16 body_sha256=dd4ed075365749e6bb741590919c4296a04c95ac309feb476a1afabdc90ef677]

lemma New.Filling.HasAmplitudeBlocks.adjoint_comp_rep_mul_left — Upstream source (src/New/Spanning/Unfolding/Moments.lean L373-L397)

lean
/-- Equivariance on the left. Let `S` be admissible filling data for a unitary group `G` over the CM
field `E`, which contains a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the
product of the general linear groups over the residue fields at the chosen places above the two
level primes `p₀`, `p₁`. The source is the Euclidean space with coordinates `(c, i)`, where `c` is a
class (a double coset of the definite unitary group `U(X₀)` for the level) and `i` is a coordinate
of the Bessel function `W` at the infinite places. Let `ρ` be a unitary representation of `Ḡ` on `V`
and `P` a linear map from the source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of
`P_s = P* ρ(s) P` is the conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and
`A(c, s, c')` is the sum, over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with
reduction `s`, of an integral of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class
`c`). Let `r_ψ(s) = S.besselTranslate s` be the operator on the source with the same blocks, but
summed only over the `γ` in the Bessel subgroup `besselS` (block unitriangular elements times
`U(X₀)`), and let `R̄₀` be the image of that subgroup in `Ḡ`. Then `P_(t s) = r_ψ(t) P_s` for `t` in
`R̄₀`. -/
lemma New.Filling.HasAmplitudeBlocks.adjoint_comp_rep_mul_left [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) (s : S.ResidueGL)
    {t : S.ResidueGL} (ht : t ∈ S.reducedImage besselS) :
    P.adjoint ∘ₗ ρ (t * s) ∘ₗ P = S.besselTranslate t ∘ₗ (P.adjoint ∘ₗ ρ s ∘ₗ P) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:373-397 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=7 body_sha256=603a2aaeebb2f9f964b26549d891d4cee85256dc0e24c6f0ef9ffd9ec21e330d]

lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sub_besselTranslate_sq — Upstream source (src/New/Spanning/Unfolding/Moments.lean L399-L431)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which contains
a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. The
source is the Euclidean space with coordinates `(c, i)`. Suppose `HasAmplitudeBlocks`: the block
`(c, c')` of `P_s = P* ρ(s) P` is the conjugate of `A(c, s, c') / ν`, where
`ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum, over the rational `γ` in `G` such that
`h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs
(`h_c` represents the class `c`). Then the squared Hilbert–Schmidt norm of `P_s - r_ψ(s)` is the
second moment `∑ ‖A'(c, s, c')‖² / ν²` over pairs of classes, where `A'` is summed over the `γ`
outside the Bessel subgroup and `‖·‖` is the Euclidean norm of the entries. -/
lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sub_besselTranslate_sq [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) (s : S.ResidueGL) :
    hilbertSchmidtNorm (P.adjoint ∘ₗ ρ s ∘ₗ P - S.besselTranslate s) ^ 2 =
      secondMoment (S.amplitudeSum .full (S.ratMiddle E).besselSᶜ) {s} := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:399-431 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=20 body_sha256=e7b3b82ecfc0e030c334ac10afce19a96dd3c0680483a8af7e4a2f76fcdccfc1]

theorem New.Filling.HasAmplitudeBlocks.sum_hilbertSchmidtNorm_sub_besselTranslate_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L434-L459)

lean
/-- **Second moment near the Bessel subgroup.** Let `S` be admissible filling data for a unitary
group `G` over the CM field `E`, which contains a primitive `5040`-th root of unity, and let
`Ḡ = S.ResidueGL` be the product of the general linear groups over the residue fields at the chosen
places above the two level primes `p₀`, `p₁`. The source is the Euclidean space with coordinates
`(c, i)`, where `c` is a class (a double coset of the definite unitary group `U(X₀)` for the level)
and `i` is a coordinate of the Bessel function `W` at the infinite places. Let `ρ` be a
representation of `Ḡ` on `V` and `P` a linear map from the source to `V`. Suppose
`HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the conjugate of
`A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum, over the
rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral of
`W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Let
`r_ψ(s) = S.besselTranslate s` be the operator on the source with the same blocks, but summed only
over the `γ` in the Bessel subgroup `besselS` (block unitriangular elements times `U(X₀)`), and let
`R̄₀` be the image of that subgroup in `Ḡ`. Then `∑ ‖P_s - r_ψ(s)‖² ≤ b⁻¹² 𝒟_id` in Hilbert–Schmidt
norm, the sum being over the `s` that coincide with an element of `R̄₀` above the prime `p_(i+1)`
other than `p_i`. Here `b = S.b ≥ 1000` is the size parameter of `S`, and
`𝒟_id = S.identitySecondMoment` is `#R̄₀` times the dimension of the source. -/
theorem New.Filling.HasAmplitudeBlocks.sum_hilbertSchmidtNorm_sub_besselTranslate_sq_le [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) (i : Fin 2) :
    ∑ s : S.ResidueGL with ∃ t ∈ S.reducedImage besselS, s (i + 1) = t (i + 1),
      hilbertSchmidtNorm (P.adjoint ∘ₗ ρ s ∘ₗ P - S.besselTranslate s) ^ 2 ≤
      (S.b ^ 12)⁻¹ * S.identitySecondMoment := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:434-459 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=6549b587bdb21f2c02135238af3d2e46fb1f96f0fc2da0ec93a187b14ca9e355]

lemma New.Filling.le_sourceDim_div_of_card_nsmul_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L463-L471)

lean
/-- If `#R̄₀ · y ≤ b⁻¹² 𝒟_id`, then `y ≤ b⁻¹² D_X`. Here `R̄₀` is the image of the Bessel subgroup
in `S.ResidueGL`, `b = S.b`, `D_X = sourceDim` and `𝒟_id = identitySecondMoment = #R̄₀ · D_X`. -/
lemma New.Filling.le_sourceDim_div_of_card_nsmul_le {y : ℝ}
    (h_le : #{s : S.ResidueGL | s ∈ S.reducedImage besselS} • y ≤
      (S.b ^ 12)⁻¹ * S.identitySecondMoment) :
    y ≤ S.sourceDim / S.b ^ 12 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:463-471 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=4 body_sha256=29c4a1637558bd080dc33c29f19aaae9076863f70052aa32464c900252ee9578]

theorem New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sub_one_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L473-L512)

lean
/-- **Near isometry.** Let `S` be admissible filling data for a unitary group `G` over the CM field
`E`, which contains a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the product of
the general linear groups over the residue fields at the chosen places above the two level primes
`p₀`, `p₁`. The source is the Euclidean space with coordinates `(c, i)`, where `c` is a class (a
double coset of the definite unitary group `U(X₀)` for the level) and `i` is a coordinate of the
Bessel function `W` at the infinite places. Let `ρ` be a representation of `Ḡ` on `V` and `P` a
linear map from the source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of
`P_s = P* ρ(s) P` is the conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and
`A(c, s, c')` is the sum, over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with
reduction `s`, of an integral of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class
`c`). Then `‖P* P - 1‖² ≤ b⁻¹² D_X` in Hilbert–Schmidt norm, where `D_X = S.sourceDim` is the
dimension of the source and `b = S.b ≥ 1000` is the size parameter of `S`. -/
theorem New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sub_one_sq_le [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) :
    hilbertSchmidtNorm (P.adjoint ∘ₗ P - 1) ^ 2 ≤ S.sourceDim / S.b ^ 12 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:473-512 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=26 body_sha256=0a619e16d586335958b521a133657dfbdaebb8cc36083a34d8f49bf9d7b2bafc]

lemma New.Filling.hilbertSchmidtNorm_one_sq_eq_sourceDim — Upstream source (src/New/Spanning/Unfolding/Moments.lean L515-L519)

lean
/-- The identity of the source has squared Hilbert–Schmidt norm `D_X = sourceDim`. -/
lemma New.Filling.hilbertSchmidtNorm_one_sq_eq_sourceDim :
    hilbertSchmidtNorm (1 : End ℂ (EuclideanSpace ℂ (S.Classes × S.BesselCoord))) ^ 2 =
      S.sourceDim := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:515-519 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=7ebc0c766e0869b99f71d06592ed6333c65a4429ba7cb654dfeac54245da46ae]

lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_adjoint_comp_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L521-L552)

lean
/-- Let `S` be admissible filling data (`Filling`, `IsAdmissible`) for a unitary group `G` over the
CM field `E`, which contains a primitive `5040`-th root of unity, and let `Ḡ = S.ResidueGL` be the
product of the general linear groups over the residue fields at the chosen places above the two
level primes `p₀`, `p₁`. The source is the Euclidean space with coordinates `(c, i)`, where `c` is a
class (a double coset of the definite unitary group `U(X₀)` for the level) and `i` is a coordinate
of the Bessel function `W` at the infinite places. Let `ρ` be a representation of `Ḡ` on `V` and `P`
a linear map from the source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of
`P_s = P* ρ(s) P` is the conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and
`A(c, s, c')` is the sum, over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with
reduction `s`, of an integral of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class
`c`). Then `‖P* P‖² ≤ 2 D_X` in Hilbert–Schmidt norm, where `D_X = S.sourceDim` is the dimension of
the source. -/
lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_adjoint_comp_sq_le [HasPrimitiveRoot5040 E]
    (hP : S.HasAmplitudeBlocks ρ P) :
    hilbertSchmidtNorm (P.adjoint ∘ₗ P) ^ 2 ≤ 2 * S.sourceDim := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:521-552 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=18 body_sha256=9e75e78f342c349a5ff4c85cb3017d21ee21269c97d76e80528c734ee5d27164]

theorem New.Filling.HasAmplitudeBlocks.sum_hilbertSchmidtNorm_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L554-L583)

lean
/-- **Second moment.** Let `S` be admissible filling data (`Filling`, `IsAdmissible`) for a unitary
group `G` over the CM field `E`, which carries Weil data (a primitive `5040`-th root of unity and a
splitting character, see `WeilData`), and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. The
source is the Euclidean space with coordinates `(c, i)`, where `c` is a class (a double coset of the
definite unitary group `U(X₀)` for the level) and `i` is a coordinate of the Bessel function `W` at
the infinite places. Let `ρ` be a unitary representation of `Ḡ` on `V` and `P` a linear map from the
source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the
conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum,
over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral
of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Then
`∑ ‖P_s‖² ≤ (1 + 9 b⁻⁴) 𝒟_main` in Hilbert–Schmidt norm, the sum being over all `s` in `Ḡ`. Here
`b = S.b ≥ 1000` is the size parameter of `S`, and `𝒟_main = S.mainSecondMoment` is the square of
the dimension of the source divided by the product of `S.besselDegree` (the product of the degree
constants of the local Bessel systems) and `New.mass` (the sum of `1 / #Aut` over the genus of the
standard lattice). -/
theorem New.Filling.HasAmplitudeBlocks.sum_hilbertSchmidtNorm_sq_le [WeilData E] (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ) :
    ∑ s : S.ResidueGL, hilbertSchmidtNorm (P.adjoint ∘ₗ ρ s ∘ₗ P) ^ 2 ≤
      (1 + 9 / S.b ^ 4) * S.mainSecondMoment := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:554-583 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=11 body_sha256=293cc522ef1fea7b9dffb43458107169bbd4f22ba48192c16bff930b2d7723ef]

lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sum_smul_sub_besselTranslate_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L591-L667)

lean
/-- **The remainder.** Let `S` be admissible filling data (`Filling`, `IsAdmissible`) for a unitary
group `G` over the CM field `E`, which contains a primitive `5040`-th root of unity, and let
`Ḡ = S.ResidueGL` be the product of the general linear groups over the residue fields at the chosen
places above the two level primes `p₀`, `p₁`. The source is the Euclidean space with coordinates
`(c, i)`, where `c` is a class (a double coset of the definite unitary group `U(X₀)` for the level)
and `i` is a coordinate of the Bessel function `W` at the infinite places. Let `ρ` be a unitary
representation of `Ḡ` on `V` and `P` a linear map from the source to `V`. Suppose
`HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the conjugate of
`A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum, over the
rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral of
`W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Let
`r_ψ(s) = S.besselTranslate s` be the operator on the source with the same blocks, but summed only
over the `γ` in the Bessel subgroup `besselS` (block unitriangular elements times `U(X₀)`). Write
`Ḡ = G_0 × G_1`, where `G_i` is the factor above `p_i`, made of matrices indexed by the basis
`𝔰.BesselIndex` of the hermitian space of shape `𝔰`, and embedded by `Pi.mulSingle i`. Then for a
central idempotent `x = ∑ x(t) t` of `ℂ[G_i]` (an idempotent whose coefficients form a class
function; it is then self-adjoint) we have `‖∑ x(t) (P_t - r_ψ(t))‖² ≤ b⁻¹² D_X` in Hilbert–Schmidt
norm, the sum being over `t` in `G_i`. Here `b = S.b ≥ 1000` is the size parameter of `S` and
`D_X = S.sourceDim` is the dimension of the source. -/
lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_sum_smul_sub_besselTranslate_sq_le [S.IsAdmissible]
    [HasPrimitiveRoot5040 E] {ρ : Representation ℂ S.ResidueGL V}
    {P : EuclideanSpace ℂ (S.Classes × S.BesselCoord) →ₗ[ℂ] V} (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (v v' : V), ⟪ρ s v, ρ s v'⟫_ℂ = ⟪v, v'⟫_ℂ) (i : Fin 2)
    {x : MonoidAlgebra ℂ (∀ w : S.chosenPlaces i, GL 𝔰.BesselIndex (ResField w.val))}
    (hx : IsCentralProj x) :
    hilbertSchmidtNorm (∑ t : ∀ w : S.chosenPlaces i, GL 𝔰.BesselIndex (ResField w.val),
        x.coeff t •
          (P.adjoint ∘ₗ ρ (Pi.mulSingle i t) ∘ₗ P - S.besselTranslate (Pi.mulSingle i t))) ^ 2 ≤
      S.sourceDim / S.b ^ 12 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:591-667 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=49 body_sha256=6bcf16e41a09c4be87d913bda7a7417412e24997c3e42cac2f181d4d244ee68b]

lemma New.Filling.sum_norm_sq_coeff_of_isCentralProj — Upstream source (src/New/Spanning/Unfolding/Moments.lean L683-L692)

lean
/-- For a finite group `G` and a central idempotent `x` of the complex group algebra
`MonoidAlgebra ℂ G` (`IsCentralProj x`), `∑ s, ‖x.coeff s‖² = (x.coeff 1).re`. -/
lemma New.Filling.sum_norm_sq_coeff_of_isCentralProj {G : Type*} [Group G] [Fintype G] {x : MonoidAlgebra ℂ G}
    (hx : IsCentralProj x) :
    ∑ s : G, ‖x.coeff s‖ ^ 2 = (x.coeff 1).re := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:683-692 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=6 body_sha256=ca1cdd952a1241c5b21e9b2a4b27b1bdca5877c6e39ab5c061f9b3244d68835c]

lemma New.Filling.mem_besselU_of_reduction_eq_one — Upstream source (src/New/Spanning/Unfolding/Moments.lean L694-L726)

lean
/-- Let `S` be admissible filling data over a CM field `E` with Weil data. Let `γ` be in the Bessel
subgroup and `k = translateByClassReps c c γ`, that is `h_c⁻¹ γ h_c` for the representative `h_c` of
the class `c`. If `k` lies in the stabilizer `latticeStabilizer` of the lattice and reduces to `1`
at the chosen places above the level prime `p_j`, then `k` lies in the unipotent subgroup
`besselU`. -/
lemma New.Filling.mem_besselU_of_reduction_eq_one {c : S.Classes} {γ : S.G E} {j : Fin 2}
    {k : S.latticeStabilizer}
    (hγ : γ ∈ (S.ratMiddle E).besselS) (hk : k.val = S.translateByClassReps c c γ)
    (hk_red : S.reduction k j = 1) :
    k.val ∈ (S.latticeMiddle (𝔸f E)).besselU := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:694-726 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=24 body_sha256=7c048a7a13cfa4ed6ccefa8aec6e55ba991ac0d86452209fb57fb9671744fffe]

def New.Filling.reducedChar — Upstream source (src/New/Spanning/Unfolding/Moments.lean L728-L736)

lean
/-- The character `ψ_U` on the image `Ū₀` of the integral unipotent elements in the finite group
`S.ResidueGL`, extended by `0`. Its value at `s` is `S.unipotentChar k` for a unipotent `k` that
reduces to `s`; the choice does not matter (`extendedBesselChar_toPlaces_eq_reducedChar`). -/
noncomputable def New.Filling.reducedChar (s : S.ResidueGL) : ℂ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:728-736 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=dd418c7b547efac0b16a6c18ef768a1b613f2ec5f8f67ae83d231ba0d2890cb1]

def New.Filling.reducedCharMean — Upstream source (src/New/Spanning/Unfolding/Moments.lean L738-L741)

lean
/-- The mean `ψ_U^♮(s)` of `ψ_U = reducedChar`, extended by `0`, over the conjugates of `s` in the
finite group `S.ResidueGL`. -/
noncomputable def New.Filling.reducedCharMean (s : S.ResidueGL) : ℂ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:738-741 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=707d89bdb5e973b5d4283bfcf616157a0989e4d0774c1b07528122b2be966b76]

lemma New.Filling.reducedCharMean_conj — Upstream source (src/New/Spanning/Unfolding/Moments.lean L744-L747)

lean
/-- The mean `ψ_U^♮` of `ψ_U` over conjugates is a class function. -/
lemma New.Filling.reducedCharMean_conj (g s : S.ResidueGL) :
    S.reducedCharMean (g * s * g⁻¹) = S.reducedCharMean s := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:744-747 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=7a0611321f43fab4efa00e1e7f77830faab5c64cd4722403c22b7daf7793a029]

lemma New.Filling.trace_besselTranslate_eq_mul_reducedChar — Upstream source (src/New/Spanning/Unfolding/Moments.lean L749-L777)

lean
/-- Let `S` be admissible filling data over a CM field `E` with Weil data, and let `s` in
`S.ResidueGL` be `1` above the level prime `p_j`. The trace of `r_ψ(s) = S.besselTranslate s`, the
translation of the source by `s` twisted by the Bessel character, is `D_X ψ_U(s)`. Here
`D_X = S.sourceDim` and `ψ_U = S.reducedChar` is the character of the integral unipotent group, read
on reductions and extended by `0` off its image. -/
lemma New.Filling.trace_besselTranslate_eq_mul_reducedChar {j : Fin 2} {s : S.ResidueGL} (hs : s j = 1) :
    LinearMap.trace ℂ (EuclideanSpace ℂ (S.Classes × S.BesselCoord)) (S.besselTranslate s) =
      S.sourceDim * S.reducedChar s := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:749-777 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=22 body_sha256=45a8e3289a4f4411a87048d5cd07595a5365db54ef35e500cd3fb0a72848f915]

lemma New.Filling.extendedBesselChar_toPlaces_eq_reducedChar — Upstream source (src/New/Spanning/Unfolding/Moments.lean L780-L824)

lean
/-- Let `S` be filling data for a unitary group `G` over the CM field `E`, with level primes `p₀`,
`p₁`, and let `Ḡ = S.ResidueGL` be the product of the general linear groups over the residue fields
at the chosen places above them. Let `M = p₀ p₁`, and let `T` be a finite conjugation-stable set of
finite places off which `M⁻¹` is integral, so that `T` contains the places above `M`. Over the
product `LocProd T` of the completions at `T`, let `K` be the group of integral points of `G` and
`K(M)` its principal congruence subgroup of level `M`. Let `F` be a filling datum (`IsFillingData`):
a large lattice datum with `3ϱ + 6` hyperbolic pairs and `k - (6ϱ + 13)` orthonormal vectors, for
the ranks `ϱ = 𝔰.ϱ` and `k = 𝔰.k` of the shape, with modulus `F.levelUnit = M` and local character
`ψ(x) = ψ_f(-x / ϖ)`, where `ϖ` generates the different. The function
`χ_M = extendedBesselChar F.levelUnit` is `ψ(σ(u) / M)` on `u K(M)` for `u` in the block
unitriangular group `𝖴 = besselU`, with `σ(u)` the sum of the entries at the simple roots, and `0`
off `𝖴 K(M)`. Then for `l` in the stabilizer of the lattice, `χ_M` at the component of `l` at `T` is
`ψ_U` at the reduction of `l`, where `ψ_U = S.reducedChar` is the character `u ↦ ψ_f(-σ(u) / (M ϖ))`
of the integral points of `𝖴`, read on their reductions in `Ḡ` and extended by `0`. -/
lemma New.Filling.extendedBesselChar_toPlaces_eq_reducedChar {T : Finset (FinPlace E)} [T.StarStable]
    [Fact (S.ideleM⁻¹.val ∈ integralOff T)] [hInt : IntegralPlace (LocProd T)]
    {F : PlaceData (Fin (𝔰.k - (6 * 𝔰.ϱ + 13))) (S.latticeMiddle (LocProd T)) (𝔰.ϱ + 1 + 2 * 𝔰.ϱ +
      5)}
    (hF : S.IsFillingData T F) (l : S.latticeStabilizer) :
    extendedBesselChar F.levelUnit (S.toPlaces T l) = S.reducedChar (S.reduction l) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:780-824 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=26 body_sha256=20f5d9def97dd952b731ff33f8d3222c3e6bae8076e897d15d8bb303633e6029]

lemma New.Filling.integral_extendedBesselChar_conj_eq — Upstream source (src/New/Spanning/Unfolding/Moments.lean L827-L886)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, and let
`Ḡ = S.ResidueGL` be the product of the general linear groups over the residue fields at the chosen
places above the two level primes `p₀`, `p₁`. Let `M = p₀ p₁`, and let `T` be a finite
conjugation-stable set of finite places off which `M⁻¹` is integral, so that `T` contains the places
above `M`. Over the product `LocProd T` of the completions at `T`, let `K` be the group of integral
points of `G` and `K(M)` its principal congruence subgroup of level `M`. Let `F` be a filling datum
(`IsFillingData`): a large lattice datum with `3ϱ + 6` hyperbolic pairs and `k - (6ϱ + 13)`
orthonormal vectors, for the ranks `ϱ = 𝔰.ϱ` and `k = 𝔰.k` of the shape, with modulus
`F.levelUnit = M` and local character `ψ(x) = ψ_f(-x / ϖ)`, where `ϖ` generates the different. The
function `χ_M = extendedBesselChar F.levelUnit` is `ψ(σ(u) / M)` on `u K(M)` for `u` in the block
unitriangular group `𝖴 = besselU`, with `σ(u)` the sum of the entries at the simple roots, and `0`
off `𝖴 K(M)`. Then for `l` in the stabilizer of the lattice, `∫_K χ_M(y l y⁻¹) dy` for the measure
`dy = F.groupMeasure` is `vol(K)` times the value at the reduction of `l` of `S.reducedCharMean`,
the mean of `ψ_U` over conjugates. Here `ψ_U = S.reducedChar` is the character
`u ↦ ψ_f(-σ(u) / (M ϖ))` of the integral points of `𝖴`, read on their reductions in `Ḡ` and extended
by `0`. -/
lemma New.Filling.integral_extendedBesselChar_conj_eq {T : Finset (FinPlace E)} [T.StarStable]
    [Fact (S.ideleM⁻¹.val ∈ integralOff T)] [hInt : IntegralPlace (LocProd T)]
    {F : PlaceData (Fin (𝔰.k - (6 * 𝔰.ϱ + 13))) (S.latticeMiddle (LocProd T)) (𝔰.ϱ + 1 + 2 * 𝔰.ϱ +
      5)}
    (hF : S.IsFillingData T F) (l : S.latticeStabilizer) :
    ∫ y : (S.latticeMiddle (LocProd T)).G
        in unitaryLevel hInt.integers 1 (S.latticeMiddle (LocProd T)).splitGram,
        extendedBesselChar F.levelUnit (y * S.toPlaces T l * y⁻¹) ∂F.groupMeasure =
      F.groupMeasure.real (unitaryLevel hInt.integers 1 (S.latticeMiddle (LocProd T)).splitGram) •
        S.reducedCharMean (S.reduction l) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:827-886 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=35 body_sha256=bb0103a23c2eb71b32a71c95aca084a22f7b113b558066ae6b390ab8bb10229a]

lemma New.Filling.sum_sq_norm_integral_extendedBesselChar_conjugate_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L889-L968)

lean
/-- Let `S` be admissible filling data for a unitary group `G` over the CM field `E`, which carries
Weil data, and let `Ḡ = S.ResidueGL` be the product of the general linear groups over the residue
fields at the chosen places above the two level primes `p₀`, `p₁`. Let `M = p₀ p₁`, and let `T` be a
finite conjugation-stable set of finite places off which `M⁻¹` is integral, so that `T` contains the
places above `M`. Over the product `LocProd T` of the completions at `T`, let `K` be the group of
integral points of `G` and `K(M)` its principal congruence subgroup of level `M`. Let `F` be a
filling datum (`IsFillingData`): a large lattice datum with `3ϱ + 6` hyperbolic pairs and
`k - (6ϱ + 13)` orthonormal vectors, for the ranks `ϱ = 𝔰.ϱ` and `k = 𝔰.k` of the shape, with
modulus `F.levelUnit = M` and local character `ψ(x) = ψ_f(-x / ϖ)`, where `ϖ` generates the
different. The function `χ_M = extendedBesselChar F.levelUnit` is `ψ(τ(u) / M)` on `u K(M)` for `u`
in the block unitriangular group `𝖴 = besselU`, with `τ(u)` the sum of the entries at the simple
roots, and `0` off `𝖴 K(M)`. Suppose that `T` consists of chosen places and their conjugates, and
put `a z = ∫_K χ_M(y z y⁻¹) dy` for the measure `dy = F.groupMeasure`. For a finite family `σ` in
the stabilizer of the lattice whose members have different reductions in `Ḡ` we have
`∑ |a (σ s)|² ≤ 2 vol(K)²`, where `a` is evaluated at the component of `σ s` at `T`. -/
lemma New.Filling.sum_sq_norm_integral_extendedBesselChar_conjugate_le {T : Finset (FinPlace E)} [T.StarStable]
    [Fact (S.ideleM⁻¹.val ∈ integralOff T)] (hT : T ⊆ S.chosenPlacesAndConj)
    [hInt : IntegralPlace (LocProd T)]
    {F : PlaceData (Fin (𝔰.k - (6 * 𝔰.ϱ + 13))) (S.latticeMiddle (LocProd T)) (𝔰.ϱ + 1 + 2 * 𝔰.ϱ +
      5)}
    (hF : S.IsFillingData T F) {ι : Type*} [Fintype ι] {σ : ι → S.latticeStabilizer}
    (hσ : Function.Injective fun s : ι ↦ S.reduction (σ s)) :
    ∑ s : ι,
        ‖∫ y : (S.latticeMiddle (LocProd T)).G
            in unitaryLevel hInt.integers 1 (S.latticeMiddle (LocProd T)).splitGram,
          extendedBesselChar F.levelUnit (y * S.toPlaces T (σ s) * y⁻¹) ∂F.groupMeasure‖ ^ 2 ≤
      2 * F.groupMeasure.real
        (unitaryLevel hInt.integers 1 (S.latticeMiddle (LocProd T)).splitGram) ^ 2 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:889-968 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=53 body_sha256=6b798e3839f3ecea290278f5829212ffe965f1432126e00c68ec45c29a0d93a3]

lemma New.Filling.inv_ideleM_mem_integralOff — Upstream source (src/New/Spanning/Unfolding/Moments.lean L971-L988)

lean
/-- Let `S` be filling data over the CM field `E`, with level primes `p₀`, `p₁` and, for each `p_i`,
a chosen set `S.chosenPlaces i` of places of norm `p_i`, such that the chosen places and their
conjugates have product `M = p₀ p₁`. If a finite set `T` of finite places contains all of these,
then the inverse of the finite idele `S.ideleM` of `M` is integral off `T`. -/
lemma New.Filling.inv_ideleM_mem_integralOff {T : Finset (FinPlace E)}
    (hT_mem : ∀ (i : Fin 2) (w : S.chosenPlaces i), w.val ∈ T ∧ star w.val ∈ T) :
    S.ideleM⁻¹.val ∈ integralOff T := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:971-988 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=12 body_sha256=ebcb63344830437098c0176d8a062f7954da4011878525fe0c184a1b97519759]

theorem New.Filling.sum_norm_reducedCharMean_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L991-L1029)

lean
/-- **The induced character.** Let `S` be admissible filling data for a unitary group `G` over the
CM field `E`, which carries Weil data, and let `Ḡ = S.ResidueGL` be the product of the general
linear groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`.
Let `ψ_U = S.reducedChar` be the additive character (`unipotentChar`) of the integral block
unitriangular elements of `G`, read on their reductions in `Ḡ` and extended by `0`, and let
`ψ_U^♮(s) = S.reducedCharMean s` be its mean over the conjugates of `s`. Then `∑ |ψ_U^♮(s)|² ≤ 2`,
the sum being over all `s` in `Ḡ`. -/
theorem New.Filling.sum_norm_reducedCharMean_sq_le [ok : S.IsAdmissible] :
    ∑ s : S.ResidueGL, ‖S.reducedCharMean s‖ ^ 2 ≤ 2 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:991-1029 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=31 body_sha256=a268790e34a430687165e9aa1d7c130d3122ac77fd6c8447433aa6008fcd415f]

lemma New.Filling.re_sum_coeff_mul_trace_besselTranslate_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L1032-L1081)

lean
/-- **The trace.** Let `S` be admissible filling data for a unitary group `G` over the CM field `E`,
which carries Weil data, and let `Ḡ = S.ResidueGL` be the product of the general linear groups over
the residue fields at the chosen places above the two level primes `p₀`, `p₁`. Let
`r_ψ(s) = S.besselTranslate s` be the operator on the source `ℂ^(classes × Bessel coordinates)`
whose blocks are the complex conjugates of the normalised amplitude sums of the rational elements of
the Bessel subgroup `besselS`. Let `x` be a central idempotent of the group algebra of the factor of
`Ḡ` above `p_i`, made of matrices indexed by the basis `𝔰.BesselIndex` of the hermitian space, with
`Re x(1) ≤ b⁻⁸ / 2`. Then the trace of `r_ψ(x) = ∑ x(s) r_ψ(s)` has real part at most `b⁻⁴ D_X`. -/
lemma New.Filling.re_sum_coeff_mul_trace_besselTranslate_le {i : Fin 2}
    {x : MonoidAlgebra ℂ (∀ w : S.chosenPlaces i, GL 𝔰.BesselIndex (ResField w.val))}
    (hx : IsCentralProj x) (hx_small : (x.coeff 1).re ≤ (S.b ^ 8)⁻¹ / 2) :
    (∑ s : ∀ w : S.chosenPlaces i, GL 𝔰.BesselIndex (ResField w.val), x.coeff s *
        LinearMap.trace ℂ (EuclideanSpace ℂ (S.Classes × S.BesselCoord))
          (S.besselTranslate (mulSingle i s))).re ≤
      (S.b ^ 4)⁻¹ * S.sourceDim := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:1032-1081 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=36 body_sha256=d624f89e219b5c4189a9c16b4f42afb69b78b5da004fe92db95f27f4d6767cb8]

lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_asAlgebraHom_comp_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L1098-L1166)

lean
/-- **One prime.** Let `S` be admissible filling data (`Filling`, `IsAdmissible`) for a unitary
group `G` over the CM field `E`, which carries Weil data (a primitive `5040`-th root of unity and a
splitting character, see `WeilData`), and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. The
source is the Euclidean space with coordinates `(c, i)`, where `c` is a class (a double coset of the
definite unitary group `U(X₀)` for the level) and `i` is a coordinate of the Bessel function `W` at
the infinite places. Let `ρ` be a unitary representation of `Ḡ` on `V` and `P` a linear map from the
source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the
conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum,
over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral
of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Let `x` be a central
idempotent (an idempotent whose coefficients form a class function; it is then self-adjoint) of the
group algebra of the factor of `Ḡ` above `p_i`, made of matrices indexed by the basis
`𝔰.BesselIndex` of the hermitian space, with `Re x(1) ≤ b⁻⁸ / 2`, where `b = S.b ≥ 1000` is the size
parameter of `S`. Then `‖x P‖² ≤ 2 b⁻⁴ D_X` in Hilbert–Schmidt norm, where `x` acts on `V` through
`ρ` and `D_X = S.sourceDim` is the dimension of the source. -/
lemma New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_asAlgebraHom_comp_sq_le [WeilData E]
    (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (v v' : V), ⟪ρ s v, ρ s v'⟫_ℂ = ⟪v, v'⟫_ℂ) (i : Fin 2)
    {x : MonoidAlgebra ℂ (∀ w : S.chosenPlaces i, GL 𝔰.BesselIndex (ResField w.val))}
    (hx : IsCentralProj x) (hx_small : (x.coeff 1).re ≤ (S.b ^ 8)⁻¹ / 2) :
    hilbertSchmidtNorm
        (Representation.asAlgebraHom (ρ.comp (MonoidHom.mulSingle
          (fun j : Fin 2 ↦ ∀ w : S.chosenPlaces j, GL 𝔰.BesselIndex (ResField w.val)) i)) x ∘ₗ
          P) ^ 2 ≤
      2 * (S.b ^ 4)⁻¹ * S.sourceDim := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:1098-1166 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=44 body_sha256=5a77b8314eb8890aa22ff8cb5d8b0cb4f821ef94c0b5399b6881be806587fd96]

lemma New.Filling.finrank_source_eq_sourceDim — Upstream source (src/New/Spanning/Unfolding/Moments.lean L1172-L1175)

lean
/-- The source has dimension `D_X = S.sourceDim`. -/
lemma New.Filling.finrank_source_eq_sourceDim :
    (finrank ℂ (EuclideanSpace ℂ (S.Classes × S.BesselCoord)) : ℝ) = S.sourceDim := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:1172-1175 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=501e67fff5ce9b68cae553e21d77bc8d2aeee04a94d7d5239c16e37e402dadc8]

theorem New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_one_sub_piTensorElem_comp_sq_le — Upstream source (src/New/Spanning/Unfolding/Moments.lean L1177-L1217)

lean
/-- **Both primes.** Let `S` be admissible filling data (`Filling`, `IsAdmissible`) for a unitary
group `G` over the CM field `E`, which carries Weil data (a primitive `5040`-th root of unity and a
splitting character, see `WeilData`), and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. The
source is the Euclidean space with coordinates `(c, i)`, where `c` is a class (a double coset of the
definite unitary group `U(X₀)` for the level) and `i` is a coordinate of the Bessel function `W` at
the infinite places. Let `ρ` be a unitary representation of `Ḡ` on `V` and `P` a linear map from the
source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the
conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum,
over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral
of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Let `g_i` be a central
idempotent (an idempotent whose coefficients form a class function; it is then self-adjoint) of the
group algebra of the factor of `Ḡ` above `p_i`, such that the coefficient of `1 - g_i` at `1` has
real part at most `b⁻⁸ / 2`, where `b = S.b ≥ 1000` is the size parameter of `S`. Let
`e₀ = piTensorElem g` be the tensor product `g₀ ⊗ g₁` in `ℂ[Ḡ]`, acting on `V` through `ρ`. Then
`‖(1 - e₀) P‖² ≤ 4 b⁻⁴ D_X` in Hilbert–Schmidt norm, where `D_X = S.sourceDim` is the dimension of
the source. -/
theorem New.Filling.HasAmplitudeBlocks.hilbertSchmidtNorm_one_sub_piTensorElem_comp_sq_le [WeilData E]
    (hP : S.HasAmplitudeBlocks ρ P) (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x,
      y⟫_ℂ)
    (hg : ∀ i : Fin 2, IsCentralProj (g i))
    (hg_small : ∀ i : Fin 2, ((1 - g i).coeff 1).re ≤ (S.b ^ 8)⁻¹ / 2) :
    hilbertSchmidtNorm ((1 - ρ.asAlgebraHom (piTensorElem g)) ∘ₗ P) ^ 2 ≤
      4 * (S.b ^ 4)⁻¹ * S.sourceDim := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:1177-1217 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=18 body_sha256=fb1498d7e65a8445e2efca3ec288f6afe35f432b21d34d3fb37e379d337c2872]

theorem New.Filling.HasAmplitudeBlocks.isNearIsometry_piTensorElem_comp — Upstream source (src/New/Spanning/Unfolding/Moments.lean L1219-L1256)

lean
/-- **Good forms.** Let `S` be admissible filling data (`Filling`, `IsAdmissible`) for a unitary
group `G` over the CM field `E`, which carries Weil data (a primitive `5040`-th root of unity and a
splitting character, see `WeilData`), and let `Ḡ = S.ResidueGL` be the product of the general linear
groups over the residue fields at the chosen places above the two level primes `p₀`, `p₁`. The
source is the Euclidean space with coordinates `(c, i)`, where `c` is a class (a double coset of the
definite unitary group `U(X₀)` for the level) and `i` is a coordinate of the Bessel function `W` at
the infinite places. Let `ρ` be a unitary representation of `Ḡ` on `V` and `P` a linear map from the
source to `V`. Suppose `HasAmplitudeBlocks`: the block `(c, c')` of `P_s = P* ρ(s) P` is the
conjugate of `A(c, s, c') / ν`, where `ν = S.unipotentCovolume > 0` and `A(c, s, c')` is the sum,
over the rational `γ` in `G` such that `h_c⁻¹ γ h_c'` is integral with reduction `s`, of an integral
of `W(y) ⊗ W(γ⁻¹ y)^*` against cutoffs (`h_c` represents the class `c`). Let `g_i` be a central
idempotent (an idempotent whose coefficients form a class function; it is then self-adjoint) of the
group algebra of the factor of `Ḡ` above `p_i`, such that the coefficient of `1 - g_i` at `1` has
real part at most `b⁻⁸ / 2`, where `b = S.b ≥ 1000` is the size parameter of `S`. Let
`e₀ = piTensorElem g` be the tensor product `g₀ ⊗ g₁` in `ℂ[Ḡ]`, acting on `V` through `ρ`. Then
`e₀ P` is almost an isometry from below in mean square (`IsNearIsometry`) with error `5 b⁻⁴`:
`‖e₀ P pr_U‖² ≥ dim U - 5 b⁻⁴ D_X` in Hilbert–Schmidt norm for every subspace `U` of the source,
where `pr_U` is the orthogonal projection onto `U` and `D_X` is the dimension of the source. -/
theorem New.Filling.HasAmplitudeBlocks.isNearIsometry_piTensorElem_comp [WeilData E]
    (hP : S.HasAmplitudeBlocks ρ P)
    (hρ : ∀ (s : S.ResidueGL) (x y : V), ⟪ρ s x, ρ s y⟫_ℂ = ⟪x, y⟫_ℂ)
    (hg : ∀ i : Fin 2, IsCentralProj (g i))
    (hg_small : ∀ i : Fin 2, ((1 - g i).coeff 1).re ≤ (S.b ^ 8)⁻¹ / 2) :
    IsNearIsometry (ρ.asAlgebraHom (piTensorElem g) ∘ₗ P) (5 * (S.b ^ 4)⁻¹) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Spanning/Unfolding/Moments.lean:1219-1256 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=15 body_sha256=d416cac47a74cc2b2d4b19c52122bd4e3907fb2206c0c35c92d5bbc9304702eb]

Page Glossary ​

Hilbert–Schmidt norm
The Frobenius-style root-sum-of-squares norm on linear maps whose second moment over group translates, paired with near-isometry on the good subspace, proves Welch-style spreading and Wolsey greedy covering for Theorem B.
Bessel orbital integral
An archimedean correlation integral ∫ β_c(y) β_{c'}(γ⁻¹ y) W(y) ⊗ W(γ⁻¹ y)* dy unfolding Petersson inner products P* ρ(s) P into class-indexed amplitude blocks.
prime number
A whole number greater than 1 whose only positive whole-number divisors are 1 and itself; every integer above 1 factors uniquely into a product of them.
Kloosterman sieve
A global entry-by-entry one-sided Poisson summation engine pairing archimedean band-limited Bessel Gram matrices with finite Kloosterman densities to bound the big-cell second moment by (1 + b⁻⁴) b⁻⁶ᵏ|S_g| D_main ν².
link lattice
The Hermitian sublattice shared by two rational filling terms over one reduction block, whose discriminant and Bombieri–Vaaler Siegel's lemma counts crush cross-link and non-open terms via a weighted Schur test.
central idempotent
A class-function element of a finite group algebra satisfying z² = z that acts as a G-equivariant orthogonal projection, splitting good cuspidal types from rare bad types across two level primes.