Skip to content

Regular Twist Families and the Assembly of Theorem C ​

This page explains the two files in src/New/Determinant/Twist/: src/New/Determinant/Twist/FitTwists.lean (05_determinant/fit_twists, 17 declarations, 0 stub truncations) — the 7-consumer contract defining regular families of m-fold twists — and src/New/Determinant/Twist/LongForms.lean (05_determinant/long_forms, 9 declarations, 0 stub truncations) — the culminating assembly of Theorem C (New.Data.integral_forms_long) feeding directly into Stage 01's Main Cancellation Inequality. Return to the Stage 05 Overview, or revisit Siegel–Weil Exchange and the Commuting Theta Square and Chain Determinant Factorization and Two-Grid Auxiliary Forms.

Level 1 · First-Principles

Level 1 — First-Principles ​

Stage 05 ends by turning all the automorphic machinery of Theorem C into one crisp arithmetic inequality. Two files carry that final step: FitTwists.lean writes down the exact contract that a family of twists must satisfy so Stages 06 and 07 can speak to each other cleanly, and LongForms.lean gathers four inputs into Stage 01's twisted-lattice height inequalitytwisted lattice to prove Theorem C.

Four-input convergence blueprint showing how SpanningForms, NormOfChain, Stage 06 LiftVolumeHeight, and Stage 07 FitTwistsExist assemble inside TwistedLattice.covolume_add_index_nonneg to prove Theorem C (New.Data.integral_forms_long)

Part 1: The 7-consumer contract of regular twist families (FitTwists.lean) ​

First, a helpful naming note from upstream GUIDE.md §2: the file is named FitTwists.lean ("fit for regular"), whereas the Lean structure it defines is called New.Data.IsRegularFamily.

Why does Theorem C need a family of twists rather than one twist? Inside Stage 01's twisted lattice, each primeprime number ℓ and field isomorphism ι:C≃Q―ℓ can use its own m-fold twistregular twist family θ(ι) whose modulus Q(θ(ι)) is coprime to ℓ. To make every piece of Stages 05, 06, and 07 click together, FitTwists.lean specifies what makes θ a regular twist family:

  1. Small L-value ratios (HasSmallRatios): For every ι∣ℓ, Nm(Q(θ(ι))) is coprime to ℓ, and for every lift 1≤j≤m and every ramified critical pairHecke L-value ratio p=(ν,z), the inverse Hecke L-value ratio (p.ratio(θ(ι)j,±1))−1 has global arithmetic heightarithmetic height at most x1. (Notice the subtle Euler-factor convention: in p.ratio(ϑ,s)=|LS(z,(νϑs)−1)|/|LS(z,ν−1)|, the denominator omits the chosen places and their conjugates, whereas the numerator omits both the chosen places and the twist places Q and their conjugates.)
  2. Denominators within budget (IsDenominatorBound): For every lift 1≤j≤m, there are real numbers γ(ℓ) summing over any finite set of primes to at most the denominator budget falog3⁡b/(mk), such that at every ι∣ℓ the j-th power θ(ι)j satisfies both clauses of HasDenominatorsLe:
    • Projection clearing (ClearsProjection): an operator Λ on the space of good lifts D.goodLift from Wj with log⁡|ι(detΛ)|≥−(dim⁡Z)rγ(ℓ) clears ℓ-adic denominators when projecting integral forms orthogonal to false lifts onto the lift subspace.
    • Main pair projection control: for every main pair p for j (each automatically ramified, IsMainPair.isRamified), the inner product of projections of two test forms onto the line of the rank-one theta lift of νθ(ι)j has ℓ-adic norm at most eγ(ℓ).

Seven landmark files sit around this single interface: Stage 05's norm_of_chain and spanning_forms consume HasSmallRatios; Stage 06 (06_one_lift/three_exchanges, 06_one_lift/twisted_value_heights, feeding 06_one_lift/lift_volume_height) consumes IsRegularFamily to bound each single-lift volume height; and Stage 07 (07_congruences/rows_from_eigensystems, 07_congruences/denominator_bound, 07_congruences/twisting_theorem, feeding 07_congruences/fit_twists_exist) constructs a regular twist family via Galois representations, Ribet's method, and Selmer-group twisting.

Part 2: Four inputs converge into Theorem C (LongForms.lean) ​

LongForms.lean contains only 9 declarations, yet it closes the entire lower-bound side of the proof in five clean steps:

  1. Wrap basis-completion forms (IsAuxiliaryForm, exists_span_isAuxiliaryForm_eq_top): Applying the good projectioncentral idempotent D.goodProjTranslate 1 to Stage 05's exists_span_short_lifts_eq_top spans D.targetForms by auxiliary spanning formsauxiliary spanning form whose untwisted lifts have squared norm at most exp⁡(2x12b2) and whose twisted lifts stay integral after scaling by γ(ϑ) with ∥γ(ϑ)∥=Nm(Q)e/2∏i,j<mturnRatioi,j(ϑ).
  2. Bound the turn-ratio scalar and completion cost (heightLe_inv_rpow_mul_prod_turnRatio, mul_completion_cost_le): Under small ratios, the inverse m2-turn product has height ≤m2tx1. Squaring it for |γ(θι)|−2 gives height ≤2m2tx1≤b (LongForms.lean:231–233). Each missing basis vector therefore costs at most 2x12b2+b. When Theorem B gives n≥(1−4/b2)d, there are at most n′=d−n≤4d/b2 missing vectors, so b2 cancels and the total completion cost is at most db.
  3. Pull in Stage 07 and Stage 06 (exists_hasSmallRatios_heightLe_liftDeterminant_div): Invoke Stage 07's exists_isRegularFamily to obtain a regular family θ, and feed it into Stage 06's heightLe_liftDeterminant_ratio for each 1≤j≤m. Because k⋅log⁡b⋅denominatorBudget=falog4⁡b/m, each single lift determinantRallis inner product formula ratio Zj(1)/Zj(θ(ι)j) has height at mostd⋅(falog4⁡bm−k⋅D.directionAmount).
  4. Sum the m single-lift heights (exists_chainDeterminant_one_div_eq, heightLe_chainDeterminant_one_div): Inverting NormOfChain's factorization expresses Z(1)/Z(θ(ι)) as the inverse quotient-ratio scalar (height m2tx1≤b, raised to power d) times the product of the m single-lift ratios. Adding heights across j=1,…,m uses m⋅k⋅D.directionAmount=D.mainAmount to giveHeightLe(d⋅(b+falog4⁡b−D.mainAmount))onZ(1)Z(θ(ι)).
  5. Apply TwistedLattice ⟹ Theorem C (integral_forms_long_with_completion_cost ⇒ integral_forms_long): Completing any linearly independent family y1,…,yn (of squared Gram-determinant volume boundGram determinant ≤c and index ≤δ) to a full basis of D.targetForms with n′=d−n auxiliary forms and invoking Stage 01's TwistedLattice.covolume_add_index_nonneg yieldsd⋅(D.mainAmount−falog4⁡b−b)≤c+2δ+(d−n)(2x12b2+b).Using mul_completion_cost_le to bound (d−n)(2x12b2+b)≤db and absorbing the two db terms into 2dfalog4⁡b gives Theorem C (New.Data.integral_forms_long):d⋅(D.mainAmount−3falog4⁡b)≤c+2δ.Inside Stage 01 main-inequality (New.star_inequality), this exact lower bound meets Theorem A's upper covolume bound and Theorem B's spanning count: d⋅D.mainAmount cancels identically from both sides, forcing m⋅D.totalRemainder≤falog5⁡b and completing the road to GRH.

Where this analogy breaks ​

Reading LongForms.lean as a 9-lemma algebraic wrap-up makes Theorem C look almost effortless—just adding m numbers and invoking TwistedLattice.covolume_add_index_nonneg. That brevity is a deliberate architectural payoff, not an absence of depth: the entire minus sign −D.mainAmount that drives the contradiction in star_inequality comes from the negative height of Zj(1)/Zj(θ(ι)j) proved in Stage 06 (06_one_lift) (breaking the naive 2/3 barrier via three exchanges, gluing maps, and rank-one L-value heights), while the existence of θ with denominators inside denominatorBudget is the full 53-file Galois-representation and Selmer-group engine of Stage 07 (07_congruences).

Level 2 · Undergrad Bridge

Level 2 — Undergrad Bridge ​

1. The regular-twist interface (FitTwists.lean, 17 decls, 0 truncations) ​

DeclarationRole in the 7-consumer interface
Twist.toAutChar_one, Twist.Q_one, MFoldTwist.toTwist_one, toAutChar_one_and_toTwist_one_and_Q_oneNormalization lemmas certifying that the trivial twist 1 has character 1, empty modulus Q = ∅, and underlies the trivial m-fold twist.
CriticalPair.ratio p ϑ sComplex coercion of |Lchosen∪Q(z,(νϑs)−1)|/|Lchosen(z,ν−1)| (default s=1). Note the numerator omits both chosen and ϑ.Q (and conjugates), while the denominator omits chosen (and conjugates).
RankOneIndex zIndex type of cardinality 20+(2z−20)=2z (for z≥10), split into blocks of ranks 12,4,4,2z−20, used for rank-one theta lifts of main-pair characters in Stage 06.
goodLift ϑ jRestriction of D.singleLift ϑ j to D.goodForms (D.spaceW j) →ₗ[ℂ] (D.descentPair ϑ j).FormV (takes D.TameChar directly).
CriticalPair.IsRamified, CriticalPair.IsMainPair, IsMainPair.isRamifiedIsRamified: tame part nontrivial iff at a chosen place. IsMainPair j: HasLiftRank (RankOneIndex p.z), m<z≤r, 1≤j≤m, tame part D.chiMLocal ^ j, weight wj+r−t≤c≤wj. Because D.chiMLocal has order >8m at chosen places, every main pair is ramified (IsMainPair.isRamified).
denominatorBudgetD.errorUnit/(D.m⋅D.k)=falog3⁡b/(mk), translating in LongForms.lean via klog⁡b⋅denominatorBudget=falog4⁡b/m.
ClearsProjection, HasDenominatorsLe, IsDenominatorBound, IsNegligibleEncodes ℓ-adic projection clearing ($\log
HasSmallRatios, IsRegularFamilyHasSmallRatios θ: Nat.Coprime ι.1 (θ ι).normQ and HeightLe D.x₁ on (p.ratio((θ ι)j,±1))−1 for every ramified pair. IsRegularFamily θ extends HasSmallRatios θ with ∃ γ, D.IsDenominatorBound θ j γ for every 1≤j≤m.

2. Step-by-step walk through all 9 declarations of LongForms.lean ​

  1. New.Data.IsAuxiliaryForm (L47–54): A target form y∈D.targetForms is auxiliary for γ:D.MFoldTwist→C if γ(ϑ)⋅D.Θ(ϑ)(y)∈integralForms ι.place whenever gcd(ι.1,Nm(Q(ϑ)))=1, and (D.Θ(1)(y)).normSqAt σ≤exp⁡(2x12b2) for all σ∈Aut(C).
  2. New.Data.exists_span_isAuxiliaryForm_eq_top (L63–105): Applies D.goodProjTranslate 1 (surjective onto D.targetForms) to exists_span_short_lifts_eq_top, setting γ(ϑ)=c(ϑ)/c(1) (so γ(1)=1, γ(ϑ)≠0, ∥γ(ϑ)∥=Nm(Q)e/2∏i,j<mturnRatioi,j(ϑ)) and using x99+x202b2≤2x12b2 (D.le_of_hasLogBound).
  3. New.Data.HasSmallRatios.heightLe_inv_rpow_mul_prod_turnRatio (L112–119): Proves HeightLe (D.m * D.m * (D.t * D.x₁)) on (Nm(Q)e/2∏i,j<mturnRatioi,j(θ ι))−1. Inside integral_forms_long_with_completion_cost (LongForms.lean:231–235), squaring this bound gives HeightLe D.b on ((‖γ(θι)‖)2)−1 via 2 * (D.m * D.m * (D.t * D.x₁)) ≤ D.b (D.le_of_hasLogBound).
  4. New.Data.mul_completion_cost_le (L124–134): From (1−4/b2)d≤n and d=n+n′, derives n′≤(4/b2)d and multiplies by 2x12b2+b:n′(2x12b2+b)≤d⋅4(2x12+b−1)≤d⋅b,using 4 * (2 * D.x₁ ^ 2 + D.b⁻¹) ≤ D.b (D.le_of_hasLogBound).
  5. New.Data.exists_hasSmallRatios_heightLe_liftDeterminant_div (L142–154): Calls exists_isRegularFamily D (Stage 07) and heightLe_liftDeterminant_ratio hθ j (Stage 06), rewriting klog⁡b⋅denominatorBudget=falog4⁡b/m to produce HeightLe (d * (f * a * logB^4 / m - k * directionAmount)) on liftDeterminant 1 j / liftDeterminant (θ ι) j.
  6. New.Data.exists_chainDeterminant_one_div_eq (L165–175): Inverts NormOfChain's exists_chainDeterminant_pos_and_div_chainDeterminant_one_eq to express chainDeterminant 1 / chainDeterminant ϑ as the d-th power of the inverse quotient-ratio scalar times ∏j=1mliftDeterminant 1 j/liftDeterminant ϑ j.
  7. New.Data.heightLe_chainDeterminant_one_div (L183–207): Upgrades heightLe_inv_rpow_mul_prod_quotientRatio to HeightLe D.b via D.m * D.m * (D.t * D.x₁) ≤ D.b, raises to power d, and multiplies by the product of the m single-lift heights (using m⋅k⋅D.directionAmount=D.mainAmount) to prove HeightLe (d * (b + f * a * logB^4 - mainAmount)) on Z(1)/Z(θ(ι)).
  8. New.Data.integral_forms_long_with_completion_cost (L214–246): Extends y:Finn→D.targetForms to a basis with n′=d−n auxiliary forms (exists_extend_basis_of_span_eq_top), invokes Stage 01's TwistedLattice.covolume_add_index_nonneg with injective_lift_targetLattice, the squared turn-ratio scalar bound (LongForms.lean:231–235), and heightLe_chainDeterminant_one_div, yieldingd(D.mainAmount−falog4⁡b−b)≤c+2δ+(d−n)(2x12b2+b).
  9. New.Data.integral_forms_long (L254–266 — Theorem C): Applies mul_completion_cost_le to replace (d−n)(2x12b2+b) by db, then uses D.targetDim * D.b ≤ D.targetDim * (D.f * D.a * D.logB ^ 4) to fold both db terms into 2dfalog4⁡b, giving d⋅(D.mainAmount−3falog4⁡b)≤c+2δ.
Level 3 · Formal Lean Contract

Level 3 — Formal Lean Contract ​

The extracted skeletons skeleton/05_determinant/fit_twists.lean (17 declarations, 0 stub truncations) and skeleton/05_determinant/long_forms.lean (9 declarations, 0 stub truncations) mirror src/New/Determinant/Twist/FitTwists.lean and src/New/Determinant/Twist/LongForms.lean at pinned upstream commit 41c2716658c42ba08eb0648994a2efe83082a95c. All 26 declarations across both files extract completely untruncated.

Headline Signatures ​

lean
-- skeleton/05_determinant/fit_twists.lean (upstream FitTwists.lean:216-233)
structure New.Data.HasSmallRatios (θ : PrimePadicIso → D.MFoldTwist) : Prop where
  coprime (ι : PrimePadicIso) : Nat.Coprime ι.1 (θ ι).normQ
  height_le (j : D.LiftIndex) (p : D.CriticalPair) (s : ℤˣ) (hp : p.IsRamified) :
    HeightLe (D.x₁) fun ι : PrimePadicIso ↦ (p.ratio ((θ ι).powTwist j) s)⁻¹

structure New.Data.IsRegularFamily (θ : PrimePadicIso → D.MFoldTwist) : Prop extends D.HasSmallRatios θ where
  exists_denominator_bound (j : D.LiftIndex) : ∃ γ : ℕ → ℝ, D.IsDenominatorBound θ j γ

-- skeleton/05_determinant/long_forms.lean (upstream LongForms.lean:177-266)
lemma New.Data.heightLe_chainDeterminant_one_div {θ : PrimePadicIso → D.MFoldTwist} (hθ : D.HasSmallRatios θ)
    (h_single : ∀ j ∈ Icc 1 D.m,
      HeightLe (D.targetDim * (D.f * D.a * D.logB ^ 4 / D.m - D.k * D.directionAmount))
        fun ι : PrimePadicIso ↦ D.liftDeterminant 1 j / D.liftDeterminant (θ ι) j) :
    HeightLe (D.targetDim * (D.b + D.f * D.a * D.logB ^ 4 - D.mainAmount))
      fun ι : PrimePadicIso ↦ D.chainDeterminant (1 : D.MFoldTwist) / D.chainDeterminant (θ ι)

theorem New.Data.integral_forms_long_with_completion_cost {n : ℕ} {y : Fin n → D.targetForms} {δ c : ℝ}
    (hy : LinearIndependent ℂ y)
    (hδ : D.targetLattice.IndexLe y δ) (hc : D.targetLattice.CovolumeLe y c) :
    D.targetDim * (D.mainAmount - D.f * D.a * D.logB ^ 4 - D.b) ≤
      c + 2 * δ + ((D.targetDim : ℝ) - n) * (2 * D.x₁ ^ 2 * D.b ^ 2 + D.b)

theorem New.Data.integral_forms_long {n : ℕ} {y : Fin n → D.targetForms} {δ c : ℝ}
    (hy : LinearIndependent ℂ y) (hn : (1 - 4 / D.b ^ 2) * D.targetDim ≤ n)
    (hδ : D.targetLattice.IndexLe y δ) (hc : D.targetLattice.CovolumeLe y c) :
    D.targetDim * (D.mainAmount - 3 * (D.f * D.a * D.logB ^ 4)) ≤ c + 2 * δ
  • Handoff to Stage 01: New.Data.integral_forms_long is consumed directly by 01_reduction/main_inequality (New.star_inequality in The Main Cancellation Inequality and Theorems A & B).
  • 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). Neither FitTwists.lean nor LongForms.lean has been locally compiled, kernel-checked, or statically scanned here.

lemma New.Data.Twist.toAutChar_one — Upstream source (src/New/Determinant/Twist/FitTwists.lean L59-L61)

lean
/-- The trivial twist has the trivial character of `U(1)(𝔸)`. -/
lemma New.Data.Twist.toAutChar_one : (1 : D.Twist).toAutChar = 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:59-61 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=8fd55f0f44bbc477f43ecdbab9916420f312d687b202a5a69fcfd2d701c19bde]

lemma New.Data.Twist.Q_one — Upstream source (src/New/Determinant/Twist/FitTwists.lean L63-L65)

lean
/-- The modulus `Q` of the trivial twist, its finite set of finite places, is empty. -/
lemma New.Data.Twist.Q_one : (1 : D.Twist).Q = ∅ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:63-65 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=8fd55f0f44bbc477f43ecdbab9916420f312d687b202a5a69fcfd2d701c19bde]

lemma New.Data.MFoldTwist.toTwist_one — Upstream source (src/New/Determinant/Twist/FitTwists.lean L67-L69)

lean
/-- The twist underlying the trivial `m`-fold twist is the trivial twist. -/
lemma New.Data.MFoldTwist.toTwist_one : (1 : D.MFoldTwist).toTwist = 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:67-69 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=8fd55f0f44bbc477f43ecdbab9916420f312d687b202a5a69fcfd2d701c19bde]

lemma New.Data.toAutChar_one_and_toTwist_one_and_Q_one — Upstream source (src/New/Determinant/Twist/FitTwists.lean L71-L76)

lean
/-- Let `D` be admissible data, with CM field `E = D.E` and number of lifts `m = D.m`. The trivial
twist has the trivial character, underlies the trivial `m`-fold twist, and has empty modulus. -/
lemma New.Data.toAutChar_one_and_toTwist_one_and_Q_one :
    ((1 : D.Twist).toAutChar = 1 ∧ (1 : D.MFoldTwist).toTwist = 1) ∧
      (1 : D.Twist).Q = ∅ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:71-76 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=1e9a667ca39f00da0cc0f917817964c05957835c6892b2ec2af0dd46a52fd130]

def New.Data.CriticalPair.ratio — Upstream source (src/New/Determinant/Twist/FitTwists.lean L78-L84)

lean
/-- For a pair `p = (ν, z)`, a tame character `ϑ` and a sign `s` (by default `1`), the ratio
`|L(z, (ν ϑ^s)⁻¹)| / |L(z, ν⁻¹)|`, as a complex number. Both L-functions omit the Euler factors at
the chosen places and their conjugates. The numerator also omits those at the places `Q` of `ϑ` and
their conjugates. -/
noncomputable def New.Data.CriticalPair.ratio (p : D.CriticalPair) (ϑ : D.TameChar) (s : ℤˣ := 1) : ℂ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:78-84 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=8e4f4d61bb709f370996ea32e985b78c3e692fd48b17dae6f42a5a35b0737728]

abbrev New.Data.RankOneIndex — Upstream source (src/New/Determinant/Twist/FitTwists.lean L101-L104)

lean
/-- An index type with `20 + (2 z - 20)` elements, so `2 z` for `z ≥ 10`: the basis of the
definite space `E ^ (2 z)` to which the character of a main pair is lifted, split into four blocks
of ranks `12`, `4`, `4` and `2 z - 20`. -/
abbrev New.Data.RankOneIndex (z : ℕ) : Type := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:101-104 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=b7edd7336189ca26300b5f58e449bcc1bf218f193feb5642c3022f71f133b956]

abbrev New.Data.goodLift — Upstream source (src/New/Determinant/Twist/FitTwists.lean L106-L114)

lean
/-- The theta lift `New.Data.singleLift` for the tame character `ϑ` and index `j`, restricted to the
good forms. It takes forms on the hermitian space `W_j = D.spaceW j` of rank `D.r` to forms on the
definite space `V` of rank `D.r + D.t`; `D.descentPair ϑ j` is the datum of this lift. The good
forms are the forms fixed by the principal congruence subgroup at the chosen places that lie in the
image of `D.e₀`, an idempotent of the group algebra of the product of the groups `GL_r (k_w)` over
the residue fields `k_w` of the chosen places. -/
noncomputable abbrev New.Data.goodLift (ϑ : D.TameChar) (j : ℕ) :
    D.goodForms (D.spaceW j) →ₗ[ℂ] (D.descentPair ϑ j).FormV := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:106-114 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=6cf3b78adb93ad1e375e3d798f25ace7dc5dc0382a38cedd4feb59e046678847]

def New.Data.CriticalPair.IsRamified — Upstream source (src/New/Determinant/Twist/FitTwists.lean L116-L120)

lean
/-- A pair `p = (ν, z)` is ramified if the tame part `ψ` of `ν`, a character `ψ_w` of the residue
field at each finite place `w` of `E`, is nontrivial exactly at the chosen places, those dividing
the integer `D.piM` of norm `p₀ p₁` of the imaginary quadratic field `K`. -/
def New.Data.CriticalPair.IsRamified {D : Data P} (p : D.CriticalPair) : Prop := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:116-120 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=9180177fc0714e936a99adb7f6b182029182ca8841eee4ec6fd8c956f74c4f5e]

structure New.Data.CriticalPair.IsMainPair — Upstream source (src/New/Determinant/Twist/FitTwists.lean L122-L140)

lean
/-- The pair `p = (ν, z)`, with `ν` of weight `-c`, is a main pair for `j`: the type
`RankOneIndex z` has `2 z` elements and `2 ≤ z` (`HasLiftRank`), `m < z ≤ r`, `1 ≤ j ≤ m`, the tame
part of `ν` is `D.chiMLocal ^ j`, and `w_j + r - t ≤ c ≤ w_j` at every infinite place. Here
`m = D.m` is the number of lifts, `r = D.r` the rank of the spaces `W_j` and `t = D.t = 5 r`;
`D.chiMLocal` is the fixed family of residue characters that is trivial off the chosen places, and
`w_j = D.liftWeight j` is minus the weight of the character of the `j`-th lift. -/
structure New.Data.CriticalPair.IsMainPair {D : Data P} (p : D.CriticalPair) (j : ℕ) : Prop where
  /-- The type `RankOneIndex z` has `2 z` elements, and `2 ≤ z`. -/
  hasLiftRank : p.HasLiftRank (RankOneIndex p.z)
  /-- The point satisfies `m < z ≤ r`. -/
  z_mem : p.z ∈ Ioc D.m D.r
  /-- The index satisfies `1 ≤ j ≤ m`. -/
  j_mem : j ∈ D.LiftIndex
  /-- The tame part of `ν` is `ω ^ j`, with `ω = D.chiMLocal`. -/
  tamePart_eq : p.tamePart = D.chiMLocal ^ (j : ℤ)
  /-- The upper bound `c ≤ w_j` at each infinite place. -/
  negWeight_le (v : D.Φ) : p.negWeight v ≤ D.liftWeight j v
  /-- The lower bound `w_j + r - t ≤ c` at each infinite place, written without subtraction. -/
  le_negWeight (v : D.Φ) : D.liftWeight j v + D.r ≤ p.negWeight v + D.t

lemma New.Data.CriticalPair.IsMainPair.isRamified — Upstream source (src/New/Determinant/Twist/FitTwists.lean L142-L151)

lean
/-- Let `D` be admissible data, with CM field `E = D.E` and number of lifts `m = D.m`. If `p` is a
main pair for `j`, so in particular `1 ≤ j ≤ m` and the tame part is `ω ^ j` for the fixed family
`ω = D.chiMLocal` of residue characters, trivial off the chosen places and of order above `8 m` at
them, then `p` is ramified: its tame part is nontrivial exactly at the chosen places. -/
lemma New.Data.CriticalPair.IsMainPair.isRamified {D : Data P} {p : D.CriticalPair} {j : ℕ}
    (hp : p.IsMainPair j) :
    p.IsRamified := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:142-151 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=4 body_sha256=11f0e13f0d70a7c2efb609e7ff69ced8a80892fc53d2611380e6461893d11342]

abbrev New.Data.denominatorBudget — Upstream source (src/New/Determinant/Twist/FitTwists.lean L153-L157)

lean
/-- The bound `denominatorBudget = f a log³ b / (m k)` for the sum over all primes of the
logarithmic denominator bounds. The numerator is `D.errorUnit`, with `f` the number of infinite
places of `E`, `b` the weight scale of the data and `a = x b` for `x` the length of the prime sum;
`m` is the number of lifts and `k = r + 1 - m`. -/
noncomputable abbrev New.Data.denominatorBudget : ℝ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:153-157 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=0080d39ade68428d695fadca27736db3640c2d1f45efb0a8d5963f71bd75fd42]

def New.Data.ClearsProjection — Upstream source (src/New/Determinant/Twist/FitTwists.lean L160-L175)

lean
/-- Let `Z` be the space of lifts from `W_j` for the twist `ϑ`, the range of `D.goodLift ϑ j` in the
forms on the space `V` of the lift datum `D.descentPair ϑ j`, and let `pr` be the orthogonal
projection to `Z`. Some operator `Λ` on `Z`, with `log |ι (det Λ)| ≥ -(dim Z) r β` for `r = D.r`,
makes `Λ (pr y)` integral at `ι` for every form `y` that is integral at `ι` and orthogonal to the
false lifts. A form is integral (`integralForms`) if all its values lie in the unit ball of the
`ℓ`-adic gauge at `ι`. The false lifts (`IsOrthogonalToFalseLifts`) are the forms orthogonal to `Z`,
in the image of the idempotent `D.e₀`, that are killed by the Hecke polynomial at its test value at
some split place off the level. -/
def New.Data.ClearsProjection {ℓ : ℕ} [Fact ℓ.Prime] (ι : ℂ ≃+* PadicAlgCl ℓ) (ϑ : D.Twist) (j : ℕ)
    (β : ℝ) : Prop := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/FitTwists.lean:160-175 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=6 body_sha256=cd22611773ee6a386d4d3dcaf26ddfe4f15c787277e47c5852715bcda8026e49]

structure New.Data.HasDenominatorsLe — Upstream source (src/New/Determinant/Twist/FitTwists.lean L177-L196)

lean
/-- At `ι` and for the twist `ϑ`, two bounds hold. An operator on the space `Z` of lifts from `W_j`,
with determinant of norm at least `exp (-(dim Z) r β)` at `ι`, clears the denominators of the
projection to `Z` (`ClearsProjection`). For each main pair `p = (ν, z)` for `j`, the inner product
of the projections of two test forms (`IsTestForm`) to the line of the lift of `ν ϑ` has norm at
most `exp β`. Here `p.lValueData _ ϑ` is the datum of the theta lift of the character `ν ϑ` from
`U(1)` to the definite space of rank `2 z`, its `descentPair.FormV` is the space of forms on that
space, and its `trivialLift` is the lifted form. -/
structure New.Data.HasDenominatorsLe {ℓ : ℕ} [Fact ℓ.Prime] (ι : ℂ ≃+* PadicAlgCl ℓ) (ϑ : D.Twist) (j : ℕ)
    (β : ℝ) : Prop where
  /-- An operator of controlled determinant clears the denominator of the projection. -/
  clearsProjection : D.ClearsProjection ι ϑ j β
  /-- For a main pair for `j` and two test forms (`IsTestForm`: integral above `ℓ` and orthogonal to
  the false lifts in the kernel of the adjoint of the lift), the inner product of the projections to
  the line of the lift of the constant function has norm at most `exp β` at `ι`. -/
  mainPair (p : D.CriticalPair) (hp : p.IsMainPair j)
    {Ξ Ξ' : (p.lValueData hp.hasLiftRank ϑ).descentPair.FormV}
    (hΞ : (p.lValueData hp.hasLiftRank ϑ).descentPair.IsTestForm ℓ Ξ)
    (hΞ' : (p.lValueData hp.hasLiftRank ϑ).descentPair.IsTestForm ℓ Ξ') :
    ‖ι (inner ℂ ((ℂ ∙ (p.lValueData hp.hasLiftRank ϑ).trivialLift).starProjection Ξ)
      ((ℂ ∙ (p.lValueData hp.hasLiftRank ϑ).trivialLift).starProjection Ξ'))‖ ≤ Real.exp β

structure New.Data.IsDenominatorBound — Upstream source (src/New/Determinant/Twist/FitTwists.lean L198-L207)

lean
/-- The reals `γ ℓ`, one for each prime `ℓ`, bound the logarithms of the denominators
(`HasDenominatorsLe`) for the `j`-th powers of the twists `θ ι`, and their sum stays within the
budget `denominatorBudget`. -/
structure New.Data.IsDenominatorBound (θ : PrimePadicIso → D.MFoldTwist) (j : D.LiftIndex) (γ : ℕ → ℝ) :
    Prop where
  /-- The sum of `γ ℓ` over a finite set of primes is at most `denominatorBudget`. -/
  sum_le (T : Finset ℕ) (hT : ∀ ℓ ∈ T, ℓ.Prime) : ∑ ℓ ∈ T, γ ℓ ≤ D.denominatorBudget
  /-- At `ι`, with prime `ℓ = ι.1`, both bounds of `HasDenominatorsLe` hold for the `j`-th power of
  `θ ι` with `β = γ ℓ`. -/
  hasDenominatorsLe (ι : PrimePadicIso) : D.HasDenominatorsLe ι.2 ((θ ι).powTwist j) j (γ ι.1)

structure New.Data.IsNegligible — Upstream source (src/New/Determinant/Twist/FitTwists.lean L209-L214)

lean
/-- Reals `e ℓ`, one for each `ℓ`, are negligible, with the exponent `C`, if
`∑ e ℓ log ℓ ≤ x ^ C`, the sum taken over any finite set of primes. Here `x = D.x` is the length of
the prime sum, the smallest scale of the data. -/
structure New.Data.IsNegligible (C : ℕ) (e : ℕ → ℝ) : Prop where
  /-- The sum of `e ℓ log ℓ` over a finite set of primes is at most `x ^ C`. -/
  sum_mul_log_le (T : Finset ℕ) (hT : ∀ ℓ ∈ T, ℓ.Prime) : ∑ ℓ ∈ T, e ℓ * Real.log ℓ ≤ D.x ^ C

structure New.Data.HasSmallRatios — Upstream source (src/New/Determinant/Twist/FitTwists.lean L216-L226)

lean
/-- A family of `m`-fold twists `θ ι`, one for each prime `ℓ` and `ι : ℂ ≃ ℚ̄_ℓ`, has small ratios
if the modulus of `θ ι` is prime to `ℓ` and, for `1 ≤ j ≤ m`, the `j`-th powers `(θ ι).powTwist j`
and their inverses have, for every ramified pair, inverse ratios of L-values of height at most
`D.x₁`, the second cut-off of the data. -/
structure New.Data.HasSmallRatios (θ : PrimePadicIso → D.MFoldTwist) : Prop where
  /-- The norm of the modulus of `θ ι` is prime to the prime `ℓ = ι.1` of `ι`. -/
  coprime (ι : PrimePadicIso) : Nat.Coprime ι.1 (θ ι).normQ
  /-- For a ramified pair, the inverse ratios of L-values at the `j`-th powers of the twists
  (`s = 1`) or at their inverses (`s = -1`) form a family of height at most `D.x₁`. -/
  height_le (j : D.LiftIndex) (p : D.CriticalPair) (s : ℤˣ) (hp : p.IsRamified) :
    HeightLe (D.x₁) fun ι : PrimePadicIso ↦ (p.ratio ((θ ι).powTwist j) s)⁻¹

structure New.Data.IsRegularFamily — Upstream source (src/New/Determinant/Twist/FitTwists.lean L228-L233)

lean
/-- A family of `m`-fold twists `θ ι`, one for each prime `ℓ` and `ι : ℂ ≃ ℚ̄_ℓ`, is regular if it
has small ratios (`HasSmallRatios`) and, for `1 ≤ j ≤ m`, the `j`-th powers `(θ ι).powTwist j`
have denominators within the budget `denominatorBudget` (`IsDenominatorBound`). -/
structure New.Data.IsRegularFamily (θ : PrimePadicIso → D.MFoldTwist) : Prop extends D.HasSmallRatios θ where
  /-- Some reals `γ ℓ` bound the denominators of the `j`-th powers within `denominatorBudget`. -/
  exists_denominator_bound (j : D.LiftIndex) : ∃ γ : ℕ → ℝ, D.IsDenominatorBound θ j γ

structure New.Data.IsAuxiliaryForm — Upstream source (src/New/Determinant/Twist/LongForms.lean L44-L54)

lean
/-- A target form `y` is auxiliary for the scalars `γ ϑ`, one for each `m`-fold twist `ϑ`, if its
lifts `γ ϑ • D.Θ ϑ y` are integral at primes not dividing `ϑ.normQ` and every conjugate of its lift
`D.Θ 1 y` has squared norm at most `exp (2 x₁² b²)`. -/
structure New.Data.IsAuxiliaryForm (γ : D.MFoldTwist → ℂ) (y : D.targetForms) : Prop where
  /-- The form `γ ϑ • Θ_ϑ y` is integral at `ι : ℂ ≃ ℚ̄_l` whenever the norm `ϑ.normQ` of the
  modulus of `ϑ` is prime to `l = ι.1`. -/
  smul_lift_mem_integralForms (ι : PrimePadicIso) (ϑ : D.MFoldTwist)
    (hϑ : Nat.Coprime ι.1 ϑ.normQ) : γ ϑ • D.Θ ϑ y ∈ integralForms ι.place
  /-- The conjugate of `Θ₁ y` by each automorphism `σ` of `ℂ` has squared norm at most
  `exp (2 x₁² b²)`. -/
  normSqAt_lift_le (σ : ℂ ≃+* ℂ) : (D.Θ 1 y).normSqAt σ ≤ exp (2 * D.x₁ ^ 2 * D.b ^ 2)

theorem New.Data.exists_span_isAuxiliaryForm_eq_top — Upstream source (src/New/Determinant/Twist/LongForms.lean L57-L105)

lean
/-- **Auxiliary forms.** There are an integer `e` and numbers `γ ϑ ≠ 0`, for the `m`-fold twists
`ϑ`, such that `γ 1 = 1`, the absolute value of `γ ϑ` is the norm `ϑ.normQ` of the modulus of `ϑ` to
the power `e / 2` times the numbers `D.turnRatio i j ϑ` for `0 ≤ i, j < m`, and the space
`D.targetForms` is spanned by the forms `y` that are auxiliary for `γ`: each lift `γ ϑ • D.Θ ϑ y` is
integral at the primes not dividing `ϑ.normQ`, and every conjugate of `D.Θ 1 y` has squared norm at
most `exp (2 x₁² b²)`, for the scales `x₁`, `b` of `D`. -/
theorem New.Data.exists_span_isAuxiliaryForm_eq_top :
    ∃ (e : ℤ) (γ : D.MFoldTwist → ℂ),
      (∀ ϑ : D.MFoldTwist, γ ϑ ≠ 0) ∧
      γ 1 = 1 ∧
      (∀ ϑ : D.MFoldTwist, ‖γ ϑ‖ = (ϑ.normQ : ℝ) ^ (e / 2 : ℝ) *
        ∏ i ∈ Finset.range D.m, ∏ j ∈ Finset.range D.m, D.turnRatio i j ϑ) ∧
      span ℂ {y : D.targetForms | D.IsAuxiliaryForm γ y} = ⊤ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:57-105 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=37 body_sha256=c052d7c146bf09ed653f8de5b70e299b19caac7d57bb687e43f83170fb52d667]

lemma New.Data.HasSmallRatios.heightLe_inv_rpow_mul_prod_turnRatio — Upstream source (src/New/Determinant/Twist/LongForms.lean L107-L119)

lean
/-- Let `ξ_ι = θ ι` be a family of `m`-fold twists, one for each `ι : ℂ ≃ ℚ̄_l`. Assume the family
has small ratios: `Nm Q(ξ_ι) = (θ ι).normQ` is prime to `l`, and the inverse ratios of Hecke
L-values have height at most `x₁`. Let `e` be an integer. Then the inverse of the product of
`Nm Q(ξ_ι) ^ (e / 2)` and the `m²` numbers `D.turnRatio i j ξ_ι` (for `i, j < m`) has height at most
`m² t x₁`. -/
lemma New.Data.HasSmallRatios.heightLe_inv_rpow_mul_prod_turnRatio {θ : PrimePadicIso → D.MFoldTwist}
    (hθ : D.HasSmallRatios θ) (e : ℤ) :
    HeightLe (D.m * D.m * (D.t * D.x₁)) fun ι : PrimePadicIso ↦
      ((((θ ι).normQ : ℝ) ^ (e / 2 : ℝ) *
        ∏ i ∈ Finset.range D.m, ∏ j ∈ Finset.range D.m, D.turnRatio i j (θ ι) : ℝ) : ℂ)⁻¹ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:107-119 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=4 body_sha256=5a80fbb9ca052bd9f6aee644f53b84f4dbc89d438fdf6e8bac9f8c2ca9eb4fed]

lemma New.Data.mul_completion_cost_le — Upstream source (src/New/Determinant/Twist/LongForms.lean L121-L134)

lean
/-- The cost of completing a family to a basis: if `n ≥ (1 - 4 / b²) d` and `d = n + n'`, where
`d = D.targetDim`, then `n' (2 x₁² b² + b) ≤ d b`. That is, `n'` forms, each costing `2 x₁² b² + b`,
cost at most `d b` in total. -/
lemma New.Data.mul_completion_cost_le {n n' : ℕ} (hn : (1 - 4 / D.b ^ 2) * D.targetDim ≤ n)
    (h_card : D.targetDim = n + n') :
    n' * (2 * D.x₁ ^ 2 * D.b ^ 2 + D.b) ≤ D.targetDim * D.b := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:121-134 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=9 body_sha256=ba1c0ed98196f0767f1285d614ce782899c6827579a69760bcbe7eeb52aa8972]

theorem New.Data.exists_hasSmallRatios_heightLe_liftDeterminant_div — Upstream source (src/New/Determinant/Twist/LongForms.lean L139-L154)

lean
/-- **Single lifts at good twists.** There is a family of `m`-fold twists `ξ_ι = θ ι`, one for each
prime `l` and `ι : ℂ ≃ ℚ̄_l`, with small ratios such that for `1 ≤ j ≤ m` the family
`Z_j(1) / Z_j(ξ_ι ^ j)` has height at most `d (f a log⁴ b / m - k D.directionAmount)`. -/
theorem New.Data.exists_hasSmallRatios_heightLe_liftDeterminant_div :
    ∃ θ : PrimePadicIso → D.MFoldTwist, D.HasSmallRatios θ ∧ ∀ j ∈ Icc 1 D.m,
      HeightLe (D.targetDim * (D.f * D.a * D.logB ^ 4 / D.m - D.k * D.directionAmount))
        fun ι : PrimePadicIso ↦ D.liftDeterminant 1 j / D.liftDeterminant (θ ι) j := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:139-154 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=10 body_sha256=2240e450286423de3b7bc9774e3a77c190156a6b2b96b74f746f6a50bf95362c]

lemma New.Data.exists_chainDeterminant_one_div_eq — Upstream source (src/New/Determinant/Twist/LongForms.lean L157-L175)

lean
/-- The inverted factorisation of the Gram determinant `D.chainDeterminant ϑ` of the lift `D.Θ ϑ`:
for an integer `e` independent of the `m`-fold twist `ϑ`, the quotient
`D.chainDeterminant 1 / D.chainDeterminant ϑ` is the product of the same quotients for the Gram
determinants `D.liftDeterminant` of the single lifts, times the `D.targetDim`-th power of the
inverse of a scalar. The scalar is the norm `ϑ.normQ` of the modulus of `ϑ` to the power `e / 2`,
times the numbers `D.quotientRatio i j ϑ` for `1 ≤ i < j ≤ m`, each the product of `D.t` ratios of
Hecke L-values of the character `D.untwistedLiftChar j / D.untwistedLiftChar i` at `ϑ ^ (j - i)`;
the characters `D.untwistedLiftChar j` of `U(1)(𝔸)` are those of the lifts at the trivial twist. -/
lemma New.Data.exists_chainDeterminant_one_div_eq :
    ∃ e : ℤ, ∀ ϑ : D.MFoldTwist,
      D.chainDeterminant 1 / D.chainDeterminant ϑ =
        (((ϑ.normQ : ℝ) ^ (e / 2 : ℝ) *
            ∏ i ∈ Ioc 0 D.m, ∏ j ∈ Ioc i D.m, D.quotientRatio i j ϑ : ℝ) : ℂ)⁻¹ ^ D.targetDim *
          ∏ j ∈ Icc 1 D.m, D.liftDeterminant 1 j / D.liftDeterminant ϑ j := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:157-175 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=6 body_sha256=f273259ab9f1557797cfcc126cacfee31669f91440b5cc568a89223b0a633f3b]

lemma New.Data.heightLe_chainDeterminant_one_div — Upstream source (src/New/Determinant/Twist/LongForms.lean L177-L207)

lean
/-- **The inverse ratio.** Let the family of `m`-fold twists `ξ_ι = θ ι`, one for each
`ι : ℂ ≃ ℚ̄_l`, have small ratios, and suppose that for `1 ≤ j ≤ m` the family
`D.liftDeterminant 1 j / D.liftDeterminant ξ_ι j` of quotients of Gram determinants of the `j`-th
single lift has height at most `d (f a log⁴ b / m - k D.directionAmount)`. Then the family
`Z(1) / Z(ξ_ι)` has height at most `d (b + f a log⁴ b - D.mainAmount)`, where
`D.mainAmount = m k D.directionAmount`. -/
lemma New.Data.heightLe_chainDeterminant_one_div {θ : PrimePadicIso → D.MFoldTwist} (hθ : D.HasSmallRatios θ)
    (h_single : ∀ j ∈ Icc 1 D.m,
      HeightLe (D.targetDim * (D.f * D.a * D.logB ^ 4 / D.m - D.k * D.directionAmount))
        fun ι : PrimePadicIso ↦ D.liftDeterminant 1 j / D.liftDeterminant (θ ι) j) :
    HeightLe (D.targetDim * (D.b + D.f * D.a * D.logB ^ 4 - D.mainAmount))
      fun ι : PrimePadicIso ↦ D.chainDeterminant (1 : D.MFoldTwist) / D.chainDeterminant (θ ι) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:177-207 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=20 body_sha256=a056eb96a595eae1d7276ebd74662b609c49e217043f5dfefa90537c5bb8c798]

theorem New.Data.integral_forms_long_with_completion_cost — Upstream source (src/New/Determinant/Twist/LongForms.lean L211-L246)

lean
/-- The covolume bound with the cost of each of the `d - n` auxiliary forms made explicit.
Here `d = D.targetDim`, and every independent family with index at most `δ` and covolume at most
`c` can be completed using forms of cost at most `2 x₁² b² + b` each. -/
theorem New.Data.integral_forms_long_with_completion_cost {n : ℕ} {y : Fin n → D.targetForms} {δ c : ℝ}
    (hy : LinearIndependent ℂ y)
    (hδ : D.targetLattice.IndexLe y δ) (hc : D.targetLattice.CovolumeLe y c) :
    D.targetDim * (D.mainAmount - D.f * D.a * D.logB ^ 4 - D.b) ≤
      c + 2 * δ + ((D.targetDim : ℝ) - n) * (2 * D.x₁ ^ 2 * D.b ^ 2 + D.b) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:211-246 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=29 body_sha256=c14632ca5ead751d38a0e834ae5271612902752613be120879b6bbe8541abf28]

theorem New.Data.integral_forms_long — Upstream source (src/New/Determinant/Twist/LongForms.lean L248-L266)

lean
/-- **Theorem C: integral forms are long.** Let `y_1, …, y_n` be independent target forms with
`n ≥ (1 - 4 / b²) d`. Suppose that `y` has index at most `δ`: there are `δ_l ≥ 0` with
`∑ δ_l log l ≤ δ` such that for each `ι` an `ι`-integral matrix, with determinant of valuation at
most `δ_l`, takes `y` to forms integral at `ι`. Suppose that `y` has covolume at most `c`: the Gram
determinant of every conjugate of the untwisted lift `D.Θ 1 y` is at most `exp c` in absolute value.
Then `c + 2 δ ≥ d (D.mainAmount - 3 f a log⁴ b)`. -/
theorem New.Data.integral_forms_long {n : ℕ} {y : Fin n → D.targetForms} {δ c : ℝ}
    (hy : LinearIndependent ℂ y) (hn : (1 - 4 / D.b ^ 2) * D.targetDim ≤ n)
    (hδ : D.targetLattice.IndexLe y δ) (hc : D.targetLattice.CovolumeLe y c) :
    D.targetDim * (D.mainAmount - 3 * (D.f * D.a * D.logB ^ 4)) ≤ c + 2 * δ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Determinant/Twist/LongForms.lean:248-266 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=10 body_sha256=dc1fa22055d2261c3aed474971ae0d78d1d3a10dcc802fcf7f49889d864bc02a]

Page Glossary ​

twisted lattice
A family of linear lifts from one complex vector space into inner-product spaces—one per twist—equipped with prime-by-prime integrality lattices so each prime can pick its own allowed twist.
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.
regular twist family
A prime-by-prime family of m-fold anticyclotomic twists theta(iota) with modulus coprime to l, inverse L-value ratios of height at most x_1, and lift/projection denominators summing within f*a*(log b)^3 / (m*k).
Hecke L-value ratio
The ratio |L^S(z, (nu * theta^s)^-1)| / |L^S(z, nu^-1)| of twisted to untwisted partial Hecke L-values at a critical pair (nu, z), tracking how Siegel–Weil exchange constants scale under twisting across chain quotients and grid turns.
arithmetic height
A logarithmic measure combining ordinary archimedean size with prime-by-prime p-adic divisibility, locked together by the product formula so a nonzero algebraic quantity cannot be simultaneously small at every place.
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.
auxiliary spanning form
A target form whose m-step lifts stay p-integral (after a shared twist scalar) and bounded in archimedean norm by exp(2*x_1^2*b^2), completing an almost-spanning family to a full basis of Y_0 at total cost at most d*b.
Rallis inner product formula
Relating the squared norm (and Gram determinant) of a theta lift or m-step chain of lifts to spherical Hecke operators and single-lift determinants—factoring Z(theta)/Z(1) across m lifts up to quotient L-value ratios.
Gram determinant
The determinant of the matrix of pairwise inner products of a family of vectors, measuring the squared volume of the parallelotope they span and controlled by Hadamard's and Fischer's inequalities.