Skip to content

Crystalline Lifting, Kummer Charts, and Local Dual Defect ​

This page explains the two local p-adic Hodge landmarks of Stage 07: src/New/Congruences/Lifting/CupOrthogonalityBounds.lean (07_congruences/cup_orthogonality_bounds, 25 declarations, 0 stub truncations) and src/New/Congruences/LocalLoss/CrystallineDefect.lean (07_congruences/crystalline_defect, 18 declarations, 0 stub truncations)—43 declarations in total, every single one extracted completely untruncated. Return to the Stage 07 Overview, or continue to Galois Main Summands and the Anticyclotomic Selmer Twisting Theorem and First-Order Ribet Denominator Bounds and Existence of Regular Twist Families.

Level 1 · First-Principles

Level 1 — First-Principles ​

When Ribet's method turns a congruence modulo ℓM between lifted and non-lifted modular forms into a Galois cocycle valued in a torsion module (O/ℓMO)d, that cocycle satisfies linear relations inherited from the Galois representations of the congruent forms, yet it does not automatically lift to a crystalline cocycle above the primeprime number ℓ. (Recall from GUIDE.md §2 that "lifting" in New/Congruences/Lifting/ means this local p-adic Hodge lifting of cocycles, not theta lifting.)

When all Hodge–Tate weights of a Galois lattice stay strictly below ℓ−1, classical integral p-adic Hodge theory guarantees zero obstruction. Inside this proof, however, the Hodge–Tate jump windowsGalois main summand of a main summand reach out to weight b=a/x, vastly larger than small and medium primes ℓ. By local Tate duality, the length by which Ribet's torsion cocycles can miss true crystalline cocycles is controlled by the crystalline dual defectcrystalline dual defect dualDefect: the length of the crystalline cocycles Zf(L∨(1)) of the Tate dual modulo those orthogonal under local cup products to crystalline cocycles of congruent lattices.

Two-panel diagram showing Left: opposite Hodge–Tate jump windows FitsWindows and Behrend-sparse b-letters along a Frobenius orbit avoiding three-in-a-row short gaps; Right: the four prime regimes converging into defectBound D l and summing across primes to 4 times 10^6 e^180 f (m/k) b log b well below D.denominatorBudget

Part 1: Four prime regimes for local crystalline lifting (CupOrthogonalityBounds.lean) ​

CupOrthogonalityBounds.lean translates Galois lattices into Kummer chart cup orthogonalityKummer chart cup orthogonality. A Kummer chart k is a power-series ring W(Fpf)\llbracketz\rrbracket⊂Ainf adapted to an open subgroup Γ≤Gp, whose finite-field Teichmüller "letters" i∈k.Letter cycle under the p-th-power Frobenius map letterFrob : i ↦ i^p (paralleling Stage 03's cyclic Frobenius orbitsFrobenius cycle). Packaging a lattice L, its crystalline cocycles Zf(L), and its letter-by-letter jump sets into a pairing side KummerChart.universalSide lets Kisin-module Frobenius safe-move walks (SafeMoves, CutExponentBounds, FewLowJumps) bound dualDefect or produce an explicit cup exponent e (so peZf(L)⊆cupOrthogonal) across four exact regimes:

  1. Generic large primes with no small negative jump (dualDefect_eq_zero_and_dualDefect_le part (a)): Let k be unramified, p≥5, η≥1, bi+W+η≤(p−3)a, 6(a+η+W)<bi, and NoMultipleNear p (6(a + η + W)) (b i) (p divides no nonzero integer within 6(a+η+W) of 0 or ±bi). With U and U′ in opposite windows [−η,η]∪∓εi[bi,bi+W], if U and U′ avoid [−a,0) (or U′⊆[−η,0]), then dualDefect = 0 identically.
  2. Few low jumps (dualDefect_eq_zero_and_dualDefect_le part (b) / dualDefect_le_of_few_low_weights): Under the same generic separation, if L has at most m jumps in [−η,η] at each embedding, thendualDefect(InClass ⊤ ⊥ U,L)≤11f(m(a+1)+rank(L)⋅(W+1))⋅len(O/p).
  3. Two-size far windows—any pattern and Behrend-sparse b-letters (hasCupExponent_any_pattern, hasCupExponent_sparse_thick): When p is smaller than the far weight b, the far window sits at b on b-letters (IsBLetter i) and at the smaller weight G elsewhere:
    • Any pattern (hasCupExponent_any_pattern): For unramified k, p≥7, V+4η≤M, 0<G≤b<Kp2, 2G<Kp, and M≤K, the cup exponent is at most 104(K+⌊logp⁡(2(b+M))⌋).
    • Behrend-sparse b-letters (hasCupExponent_sparse_thick): When G+V≤η (so non-b far windows merge into [−η,η]) and no three b-letters follow one another along letterFrob with both gaps in [1,J]—directly consuming Stage 01's Behrend progression-free construction of D.bPlaces—the cup exponent drops to the rank-independent bound 103(δ+(J+1)M) (holding both for unramified k with p≥7, 10pJη≤b and for possibly ramified k with constant sign ε and 8e≤pJ+1).
  4. Tame inertial types at the level primes p0,p1 (IsTameType, hasCupExponent_of_isTameType): At the two level primes p0,p1, inertia is no longer unramified: it is killed by Xe−1 with e=lcm1≤i≤r(pi−1)≤pr2 (lcm_pow_sub_one_le) and by a monic polynomial over Zp of degree ≤N. Descending along a tame inertial chart TameChart of ramification index e (TameChart.inClass_of_pow_sub_one, exists_tameChart_e_eq_lcm, with p>b+6(W+η)+r2(N+1)2+2) yields cup exponent 3r2(N+1)2+150(η+W+1) completely independent of e.

Part 2: One uniform prime-by-prime bound (CrystallineDefect.lean) ​

LocalLoss/CrystallineDefect.lean plugs the admissible data D into those four regimes. At each embedding σ of E, the far jump window starts at farWindowStart D i σ =wi(σ)−2t (built from b=D.natB on D.bPlaces and D.offWeight elsewhere) with width 4t and low window [−η,η] (η=h22+1, h2=D.halfGap=D.r8), so fitsWindows_and_image_neg_sub_one places U and its Tate-dual jumps −u−1 into opposite windows.

For small primes ℓ≤kt, notMem_bPlaces_of_coefficientEmbedding_eq_pow turns Stage 01's D.sparse into the exact three-in-a-row Frobenius exclusion (J = ⌊log_ℓ(h₂³)⌋), and eventually_exists_lettersReadThick packages the chart data for every large coefficient ring O. Grouping the rank-r main summand Lnone and the t inverse-cyclotomic character summands Lsomec into a summand class IsSummandClass yields the headline local theorem New.Selmer.normLength_dualDefect_le_of_isSummandClass: at every prime ℓ,

normLength(dualDefect(InClass F K U,(Lc)∨(1)))≤[Gℓ:Γ]⋅rank(Lc)⋅defectBound(D,ℓ)x,

where x=1 for the main summand (c = none) and x=D.t for each character summand (c = some c'), with exact crystalline loss and defectBound formulas

crystallineLoss(h,b,ℓ)=vℓ((2b)!⋅(∏k∈(b−30h3,b+30h3]k)h3),defectBound(D,ℓ)=106⋅mk(bvℓ(M)+crystallineLoss(h2,b,ℓ)),

where h2=D.halfGap=D.r8 and the lower endpoint b−30h3 uses truncated N-subtraction (max(b−30h3,0)). When FitTwistsExist.lean sums localDefectBound D ℓ = 4 f · defectBound D ℓ weighted by log⁡ℓ across all primes, the entire local p-adic Hodge loss stays within 4⋅106e180f(m/k)blog⁡b—dwarfed by the denominator budgetregular twist family D.denominatorBudget=falog3⁡b/(mk) in global arithmetic heightarithmetic height.

Where this analogy breaks ​

Thinking of defectBound D ℓ as a uniform smooth function of ℓ obscures its discrete prime-by-prime behavior. Above ℓ>2b (and ℓ∤M), the (2b)! factor contributes zero; the only large primes that pay any nonzero crystallineLoss are those dividing an integer inside the narrow window (b−30h23,b+30h23] (where NoMultipleNear fails). Moreover, splitting x=1 for the main summand versus x=D.t for the t characters is vital: without dividing by D.t on each character summand, summing over c∈Fint would lose a factor of t=5r on every single prime.

Level 2 · Undergrad Bridge

Level 2 — Undergrad Bridge ​

1. All 25 declarations of CupOrthogonalityBounds.lean (0 truncations) ​

GroupDeclarations (Count)Mathematical Role
Tame type & side setupIsTameType, letterJumps, universalSide, mem_letterJumps, fitsWindows_letterJumps, FitsWindows.neg_add_le_of_opposite, le_of_mem_jumpSet_tateDualSide, sum_card_algHom_le_finrank, length_quotient_mul_length_residueField, InClass.sum_jump_le_finrank, lcm_pow_sub_one_le, sum_jumpMultiplicity_le, pow_smul_mem_cupOrthogonal_of_isScaledCupCoboundary (13)Defines IsTameType (Xe−1 with e=lcm1≤i≤r(pi−1)≤pr2 plus monic Zp-poly of degree ≤N) and KummerChart.universalSide; maps embeddings to letters (∑ #g ≤ finrank O) and transfers opposite-window jump bounds and IsScaledCupCoboundary into cupOrthogonal.
Generic primes & few low jumpscrysCocycles_le_cupOrthogonal_of_no_small_neg_jump, dualDefect_le_of_few_low_weights, dualDefect_eq_zero_and_dualDefect_le (3)Regime 1 (dualDefect = 0 when U,U′ avoid [−a,0) or U′⊆[−η,0]) and Regime 2 (dualDefect ≤ 11 f (m(a + 1) + rank L · (W + 1)) len(O/p)).
Two-size & Behrend-sparse b-lettershasCupExponent_any_pattern, hasCupExponent_sparse_thick (2)Regime 3: general exponent 104(K+⌊logp⁡(2(b+M))⌋) and Behrend-sparse exponent 103(δ+(J+1)M) excluding 3 consecutive b-letters with gaps in [1,J].
Tame inertial descentlinearFrob_comp_subtype, TameChart.linearFrob_eq_one, TameChart.inClass_of_pow_sub_one, exists_tameChart_e_eq_lcm, TameChart.differentBound_le_one, noMultipleNear_of_add_lt, hasCupExponent_of_isTameType (7)Regime 4: restricts InClass F K U to d.subgroup on a TameChart with d.e=lcm1≤i≤r(pi−1) and d.differentBound ≤ 1, proving HasCupExponent 3r2(N+1)2+150(η+W+1) for p>b+6(W+η)+r2(N+1)2+2.

2. All 18 declarations of CrystallineDefect.lean (0 truncations) ​

  1. Windows & Behrend-sparse charts (8 decls): farWindowStart, fitsWindows_and_image_neg_sub_one, sum_count_neg_sub_one_le, smul_eq_pow_of_coefficientEmbedding_eq_pow, complexEmbeddingOf_eq_of_coefficientEmbedding_eq, pow_ordProj_pow_sub_one_eq_one, notMem_bPlaces_of_coefficientEmbedding_eq_pow, eventually_exists_lettersReadThick.
  2. Cyclotomic splitting, jump floors & arithmetic comparisons (5 decls): mem_range_of_modEq_one (ℓ≡1(modD.cyclotomicConductor)⇒j surjective, used at the level primes p0,p1), IsMainSummandWeights.le_two_mul_natAbs (|u|≥h2/2), two_mul_tame_exponent_le_defectBound (absorbs 2(3r2((r+t)r+1)2+150(h22+4t+2))≤defectBound(D,pn)/x using just the bvℓ(M) term), crystalline_bound_le_defectBound (absorbs 105(ρ⌊2λ/(kt)⌋m+⌊ρm/(kx)⌋λ)≤ρ⋅defectBound(D,ℓ)/x), and crystallineSizes_data.
  3. Summand classes & main local theorem (5 decls): IsSummandClass, hasFewLowJumps_tateDual_of_isMainSummandWeights (≤⌊rm/k⌋ dual jumps in [−η,η]), subset_Icc_of_jump_eq_single (character dual jump −c−1∈[−η,0]), normLength_dualDefect_le_defectBound_of_isTameType (tame branch at p0,p1), and normLength_dualDefect_le_of_isSummandClass (unified prime-by-prime theorem).
Level 3 · Formal Lean Contract

Level 3 — Formal Lean Contract ​

Both extracted skeletons skeleton/07_congruences/cup_orthogonality_bounds.lean (25 declarations, 0 stub truncations) and skeleton/07_congruences/crystalline_defect.lean (18 declarations, 0 stub truncations) mirror src/New/Congruences/Lifting/CupOrthogonalityBounds.lean and src/New/Congruences/LocalLoss/CrystallineDefect.lean at pinned upstream commit 41c2716658c42ba08eb0648994a2efe83082a95c. All 43 declarations across both files extract completely untruncated.

Headline Signatures ​

lean
-- skeleton/07_congruences/cup_orthogonality_bounds.lean (upstream CupOrthogonalityBounds.lean:346-589)
lemma New.Lift.KummerChart.dualDefect_eq_zero_and_dualDefect_le ... :
    ((∀ (g : O →ₐ[ℤ_[p]] ℂ_[p]) (u : ℤ), u ∈ U g ∨ u ∈ U' g → u ∉ Ico (-a : ℤ) 0) ∨
        (∀ g : O →ₐ[ℤ_[p]] ℂ_[p], U' g ⊆ Icc (-η : ℤ) 0) →
      dualDefect (InClass ⊤ ⊥ U) L = 0) ∧
    ∀ m : ℕ, (∀ g : O →ₐ[ℤ_[p]] ℂ_[p], ∑ u ∈ Icc (-η : ℤ) η, jump L.ρ g u ≤ m) →
      dualDefect (InClass ⊤ ⊥ U) L ≤
        (11 * (k.f * (m * (a + 1) + finrank O L * (W + 1))) : ℕ) *
          length O (O ⧸ Ideal.span {(p : O)})

lemma New.Lift.KummerChart.hasCupExponent_sparse_thick ... :
    HasCupExponent (InClass ⊤ ⊥ U) L (10 ^ 3 * (δ + (J + 1) * M))

lemma New.Lift.hasCupExponent_of_isTameType ... :
    HasCupExponent (InClass F K U) L (3 * (r ^ 2 * (N + 1) ^ 2) + 150 * (η + W + 1))

-- skeleton/07_congruences/crystalline_defect.lean (upstream CrystallineDefect.lean:519-624)
lemma New.Selmer.normLength_dualDefect_le_of_isSummandClass {P : Parameters} {ℓ : ℕ} {Γ : Type}
    {D : Data P} [hp : ThePrime ℓ] [PadicIso ℓ] [Group Γ] [𝒥 : OverGp Γ ℓ] [TopologicalSpace Γ]
    {e : D.E →+* PadicAlgCl ℓ} {r t : ℕ} {J : (D.E →+* ℂ) → Multiset ℤ}
    (hJ : IsMainSummandWeights D r t J) (h_group : IsCompletionGroup e 𝒥.toGp) :
    ∀ᶠ O : CoeffRing ℓ in Filter.atTop,
      ∀ {L : Option (Fin t) → GalLattice O Γ} {F : Filter Γ} {K : Γ → Polynomial O → Prop}
        {U : (O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) → Finset ℤ},
      IsSummandClass D r (fun g : Gp ℓ ↦ J (complexEmbeddingOf e g)) L F K U →
      ∀ c : Option (Fin t), InClass F K U (L c) →
        O.normLength (dualDefect (InClass F K U) (L c).tateDual) ≤
          𝒥.toGp.range.index *
            ↑(finrank O (L c) * (defectBound D ℓ / (if c = none then 1 else D.t : ℕ)))
  • 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. Neither CupOrthogonalityBounds.lean nor CrystallineDefect.lean has been locally compiled, kernel-checked, or statically scanned here.

def New.Lift.IsTameType — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L76-L80)

lean
/-- `K` holds for `X ^ e - 1`, with `e` the least common multiple of the `p ^ i - 1` for
`1 ≤ i ≤ r`, and for some monic polynomial over `ℤ_[p]` of degree at most `N`. -/
def New.Lift.IsTameType (K : O[X] → Prop) : Prop := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:76-80 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=c551df3653977ba752331b6113fcda1b1a1002084d8c8ee47b3beb9575083839]

def New.Lift.KummerChart.letterJumps — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L83-L87)

lean
/-- The jump set at the letter `i`: the union of `{0}` and the sets `U g` for the embeddings `g` of
`O` with `g ζ = θ(ω(i))`, where `ω(i)` is the Teichmüller lift `k.letterTeich i`. -/
noncomputable def New.Lift.KummerChart.letterJumps (U : (O →ₐ[ℤ_[p]] ℂ_[p]) → Finset ℤ) (i : k.Letter) :
    Finset ℤ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:83-87 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=1af9b89cbe7e6cd6abd29409e54679d79ccd78975a7fd9e2084c3c1171eb06a2]

abbrev New.Lift.KummerChart.universalSide — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L89-L106)

lean
/-- Let the sets of the filter F contain the subgroup `k.subgroup` of the chart, and let L lie in
the class (`New.Lift.InClass`) along F with jump sets U. The side (a lattice with jump sets at the
letters and a parametrised module of cocycles) is formed by L, the parameter lattice Z_f(L) of all
crystalline cocycles, and the jump sets `New.Lift.KummerChart.letterJumps` of U at the letters.
Membership in the class makes L potentially crystalline, so Z_f(L) is finitely generated. -/
noncomputable abbrev New.Lift.KummerChart.universalSide {F : Filter Γ}
    (hF : Filter.map k.subgroup.subtype ⊤ ≤ F) (h : InClass F ⊥ U L) : PairingSide ⟨O, ζ⟩ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:89-106 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=11 body_sha256=19bd43f21850000ef8b18172f58e5e61858971086790f72cdff2f04918de640f]

lemma New.Lift.KummerChart.mem_letterJumps — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L108-L113)

lean
/-- The jumps at the letter `i` are `0` and the elements of the sets `U g` of the embeddings `g`
with `g ζ = theta (k.letterTeich i)`, the image under `theta` of the Teichmüller lift of `i`. -/
lemma New.Lift.KummerChart.mem_letterJumps {i : k.Letter} {u : ℤ} :
    u ∈ k.letterJumps ζ U i ↔
      u = 0 ∨ ∃ g : O →ₐ[ℤ_[p]] ℂ_[p], g ζ = (theta (k.letterTeich i) : ℂ_[p]) ∧ u ∈ U g := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:108-113 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=14d2914d92ee7eefa108411d82c6761a8834c82571e0dc47cb762f92632d0992]

lemma New.Lift.KummerChart.fitsWindows_letterJumps — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L115-L120)

lean
/-- If the sets `U g` of all embeddings `g` lie in a window `[-η, η] ∪ ε [b, b + W]`, then so does
the jump set `letterJumps` at each letter. -/
lemma New.Lift.KummerChart.fitsWindows_letterJumps {η b W : ℕ} {ε : ℤˣ}
    (hU : ∀ g : O →ₐ[ℤ_[p]] ℂ_[p], FitsWindows η ε b W (U g)) (i : k.Letter) :
    FitsWindows η ε b W (k.letterJumps ζ U i) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:115-120 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=2 body_sha256=58606032d1fdb15c3ee038a92404b68a7812a139ee63fbabb7702f1c871f8796]

lemma New.Lift.FitsWindows.neg_add_le_of_opposite — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L122-L132)

lean
/-- For opposite far windows, the negative sum is bounded by the larger of the
near-near bound and the near-far bound. -/
lemma New.Lift.FitsWindows.neg_add_le_of_opposite {η b W : ℕ} {ε : ℤˣ} {V V' : Finset ℤ}
    (hV : FitsWindows η (-ε) b W V) (hV' : FitsWindows η ε b W V')
    {v v' : ℤ} (hv : v ∈ V) (hv' : v' ∈ V') :
    -(v + v') ≤ max (2 * (η : ℤ)) (b + W + η : ℤ) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:122-132 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=6 body_sha256=41af95ebeb94408f10969d3491c30afe3dd36672e154a6e38378a5e0276f5ff3]

lemma New.Lift.KummerChart.le_of_mem_jumpSet_tateDualSide — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L134-L142)

lean
/-- Let `P` pair the lattices of the sides `S` and `S'`. The jumps at the letter `i` of the side
`P.tateDualSide` of the Tate dual of their tensor product are `0` and the `-(v + v') - 1`, with `v`
and `v'` jumps of `S` and `S'` at `i`; so a common bound `B ≥ 0` for these bounds its jump set. -/
lemma New.Lift.KummerChart.le_of_mem_jumpSet_tateDualSide {S S' : k.PairingSide ⟨O, ζ⟩}
    (P : S.SidePairing S') {i : k.Letter} {B : ℤ} (hB : 0 ≤ B)
    (h_le : ∀ v ∈ S.jumpSet i, ∀ v' ∈ S'.jumpSet i, -(v + v') - 1 ≤ B)
    (u : ℤ) (hu : u ∈ P.tateDualSide.jumpSet i) : u ≤ B := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:134-142 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=22e96bf206a2698561b2c03ca06e3f0deee1b381e8cde3065f20214fbe094526]

lemma New.Lift.KummerChart.sum_card_algHom_le_finrank — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L145-L161)

lean
/-- Write `ω(i)` for the Teichmüller lift `k.letterTeich i` and `θ` for Fontaine's map `theta` from
`A_inf` to `O_C`. Let `ζ` be an element of `O` with `ζ ^ (p ^ k.f - 1) = 1`. An embedding `g` of `O`
into `ℂ_[p]` satisfies `g ζ = θ(ω(i))` for at most one letter `i`, so the numbers of such `g` for
the different letters add up to at most the rank of `O` over `ℤ_[p]`. -/
lemma New.Lift.KummerChart.sum_card_algHom_le_finrank (k : KummerChart Γ) (ζ : k.LetterRoot O) :
    ∑ i : k.Letter, #{g : O →ₐ[ℤ_[p]] ℂ_[p] | g ζ = (theta (k.letterTeich i) : ℂ_[p])} ≤
      finrank ℤ_[p] O := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:145-161 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=11 body_sha256=9c9ba8c97a0a6f852c57571f0c8bffcd3b70e2bb2cab3fe169d49a93c9091c5d]

lemma New.Lift.length_quotient_mul_length_residueField — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L164-L176)

lean
/-- The length of `O / p` over `O` times the residue degree of `O` is the rank of `O` over
`ℤ_[p]`. -/
lemma New.Lift.length_quotient_mul_length_residueField :
    length O (O ⧸ Ideal.span {(p : O)}) * length (ResidueField ℤ_[p]) (ResidueField O) =
      finrank ℤ_[p] O := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:164-176 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=9 body_sha256=53ca7e3fa762414d80473260b37684abc816d3236b15264f84895630c79c052b]

lemma New.Lift.InClass.sum_jump_le_finrank — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L178-L186)

lean
/-- For a lattice `L` in the class `InClass F K U` and an embedding `g : O →ₐ[ℤ_[p]] ℂ_[p]`, the
Hodge–Tate jumps of `L` at `g` in a finite set `J`, counted with multiplicity (`jump L.ρ g u`),
number at most `finrank O L`. -/
lemma New.Lift.InClass.sum_jump_le_finrank {F : Filter Γ} {K : Γ → O[X] → Prop} (hL : InClass F K U L)
    (J : Finset ℤ) (g : O →ₐ[ℤ_[p]] ℂ_[p]) : ∑ u ∈ J, jump L.ρ g u ≤ finrank O L := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:178-186 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=e0436472dd00c375b1ca2e2843354471ae597098ad5185c9c65cb39e03ddc8cc]

lemma New.Lift.lcm_pow_sub_one_le — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L188-L197)

lean
/-- For `q > 1`, the least common multiple of the `q ^ i - 1` for `1 ≤ i ≤ r` is at most
`q ^ r ^ 2`. -/
lemma New.Lift.lcm_pow_sub_one_le {q : ℕ} (hq : 1 < q) (r : ℕ) :
    ((Icc 1 r).lcm fun i : ℕ ↦ q ^ i - 1) ≤ q ^ r ^ 2 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:188-197 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=7 body_sha256=c0378e933cb5517f0c026adace5358f54ebd0d090d6fa9158290db36bd12a126]

lemma New.Lift.KummerChart.sum_jumpMultiplicity_le — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L200-L211)

lean
/-- Let the sets of the filter `F` contain the subgroup `k.subgroup` (`hF`), and let `L` lie in the
class `InClass F ⊥ U` (`h`). Suppose that at each embedding `g` the jumps of `L` in `J`, counted
with multiplicity, number at most `n`. Then the jumps in `J` of the side `k.universalSide ζ hF h` at
the letter `i`, counted with multiplicity, number at most `n` times the number of embeddings `g`
with `g ζ = theta (k.letterTeich i)`. -/
lemma New.Lift.KummerChart.sum_jumpMultiplicity_le {F : Filter Γ}
    (hF : Filter.map k.subgroup.subtype ⊤ ≤ F) (h : InClass F ⊥ U L) {J : Finset ℤ} {n : ℕ}
    (hn : ∀ g : O →ₐ[ℤ_[p]] ℂ_[p], ∑ u ∈ J, jump L.ρ g u ≤ n) (i : k.Letter) :
    ∑ u ∈ J, (k.universalSide ζ hF h).jumpMultiplicity i u ≤
      #{g : O →ₐ[ℤ_[p]] ℂ_[p] | g ζ = (theta (k.letterTeich i) : ℂ_[p])} * n := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:200-211 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=af58c192b84483c4909dcf992762b676dfbf70bd3335c0771f01a6efb9e94c88]

lemma New.Lift.KummerChart.pow_smul_mem_cupOrthogonal_of_isScaledCupCoboundary — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L213-L228)

lean
/-- Let `Γ → Gp p = Gal(ℚ̄_p / ℚ_p)` be an open embedding and `F` a filter on `Γ` whose sets contain
the subgroup `k.subgroup` of the chart. Let the lattices `Y` with property `Q` lie in
`InClass F ⊥ U` and `L` in `InClass F ⊥ U'`. Let `x` be a crystalline cocycle of `L` such that, for
all such `Y`, all pairings `P` and all crystalline cocycles `c` of `Y`, the cup product of `c` and
`p ^ e • x` is a coboundary. Then `p ^ e • x` lies in the annihilator `cupOrthogonal Q L` of these
lattices under cup products. -/
lemma New.Lift.KummerChart.pow_smul_mem_cupOrthogonal_of_isScaledCupCoboundary [TopologicalSpace Γ]
    (k : KummerChart Γ) (ζ : k.LetterRoot O) (ho : IsOpenEmbedding Γ.overGp.toGp)
    {F : Filter Γ} (hF : Filter.map k.subgroup.subtype ⊤ ≤ F)
    {Q : GalLattice O Γ → Prop} (hQ : Q ≤ InClass F ⊥ U) (hL : InClass F ⊥ U' L) (e : ℕ)
    (x : crysCocycles L.ρ)
    (h_cup : ∀ (Y : GalLattice O Γ) (hY : Q Y)
      (P : (k.universalSide ζ hF (hQ Y hY)).SidePairing (k.universalSide ζ hF hL))
      (c : crysCocycles Y.ρ), P.IsScaledCupCoboundary e c x) :
    (p : O) ^ e • (x : Γ → L) ∈ cupOrthogonal Q L := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:213-228 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=ca4804e11655b6e59c7a5c19cfd29bd195e892026957aaffd5084fad839632b1]

lemma New.Lift.KummerChart.crysCocycles_le_cupOrthogonal_of_no_small_neg_jump — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L230-L283)

lean
/-- Let `Γ → Gp p = Gal(ℚ̄_p / ℚ_p)` be an open embedding, let the chart `k` be unramified and
`p ≥ 5`, and at each letter `i` let `b i + W + η ≤ (p - 3) a` and let `p`
divide no nonzero integer within `6 (a + η + W)` of `0` or `± b i` (`NoMultipleNear`). Let `L` be
crystalline with Hodge–Tate jumps in `U'`, and at each letter let the jump sets of `U` and `U'` lie
in `[-η, η] ∪ ∓ε i [b i, b i + W]`, with opposite signs. If `U` and `U'` avoid `[-a, 0)`, or `U'`
lies in `[-η, 0]`, then every crystalline cocycle of `L` lies in `cupOrthogonal`: its cup product
with every crystalline cocycle of a crystalline lattice with jumps in `U` is a coboundary. -/
lemma New.Lift.KummerChart.crysCocycles_le_cupOrthogonal_of_no_small_neg_jump [TopologicalSpace Γ]
    (k : KummerChart Γ)
    (ζ : k.LetterRoot O) (ho : IsOpenEmbedding Γ.overGp.toGp) (hk : k.IsUnramified)
    (hp : 5 ≤ p) {a η W : ℕ} {b : k.Letter → ℕ} {ε : k.Letter → ℤˣ}
    (h_height : ∀ i : k.Letter, b i + W + η ≤ (p - 3) * a)
    (h_gap : ∀ i : k.Letter, NoMultipleNear p (6 * (a + η + W)) (b i)) (hL : InClass ⊤ ⊥ U' L)
    (hU : ∀ i : k.Letter, FitsWindows η (-ε i) (b i) W (k.letterJumps ζ U i))
    (hU' : ∀ i : k.Letter, FitsWindows η (ε i) (b i) W (k.letterJumps ζ U' i))
    (h_small : (∀ (g : O →ₐ[ℤ_[p]] ℂ_[p]) (u : ℤ), u ∈ U g ∨ u ∈ U' g → u ∉ Ico (-a : ℤ) 0) ∨
      ∀ g : O →ₐ[ℤ_[p]] ℂ_[p], U' g ⊆ Icc (-η : ℤ) 0) :
    crysCocycles L.ρ ≤ cupOrthogonal (InClass ⊤ ⊥ U) L := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:230-283 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=37 body_sha256=59689e7ce2b29492c6d1d24999ad42c2821c298fa209eaabb69976b1583ffe11]

lemma New.Lift.KummerChart.dualDefect_le_of_few_low_weights — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L285-L344)

lean
/-- Few low jumps. Let `Γ → Gp p` be an open embedding, let the chart be unramified, `p ≥ 5`,
`η ≥ 1`, and at each letter `i` let `b i + W + η ≤ (p - 3) a`, `6 (a + η + W) < b i`, and let `p`
divide no nonzero integer within `6 (a + η + W)` of `0` or `± b i` (`NoMultipleNear`). Let `L` be
crystalline with jumps in `U'`, and at each letter let the jump sets of `U` and `U'` lie in
`[-η, η]` and in far windows `[b i, b i + W]` of opposite signs. If `L` has at most `m` jumps in
`[-η, η]` at each embedding, then the defect `dualDefect`, the length of the crystalline cocycles of
`L` modulo those orthogonal to the crystalline lattices with jumps in `U`, is at most
`11 f (m (a + 1) + rank L · (W + 1))` times the length of `O / p`, where `f = k.f`. -/
lemma New.Lift.KummerChart.dualDefect_le_of_few_low_weights [TopologicalSpace Γ] (k : KummerChart Γ)
    (ζ : k.LetterRoot O) (ho : IsOpenEmbedding Γ.overGp.toGp) (hk : k.IsUnramified) (hp : 5 ≤ p)
    {a η W m : ℕ} {b : k.Letter → ℕ} {ε : k.Letter → ℤˣ}
    (h_height : ∀ i : k.Letter, b i + W + η ≤ (p - 3) * a) (hη : 1 ≤ η)
    (h_far : ∀ i : k.Letter, 6 * (a + η + W) < b i)
    (h_gap : ∀ i : k.Letter, NoMultipleNear p (6 * (a + η + W)) (b i)) (hL : InClass ⊤ ⊥ U' L)
    (hU : ∀ i : k.Letter, FitsWindows η (-ε i) (b i) W (k.letterJumps ζ U i))
    (hU' : ∀ i : k.Letter, FitsWindows η (ε i) (b i) W (k.letterJumps ζ U' i))
    (hm : ∀ g : O →ₐ[ℤ_[p]] ℂ_[p], ∑ u ∈ Icc (-η : ℤ) η, jump L.ρ g u ≤ m) :
    dualDefect (InClass ⊤ ⊥ U) L ≤
      (11 * (k.f * (m * (a + 1) + finrank O L * (W + 1))) : ℕ) *
        length O (O ⧸ Ideal.span {(p : O)}) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:285-344 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=41 body_sha256=30a6547af17eaa046cece67c76b926251cf1f2c763145fee259e8ce75caa094a]

lemma New.Lift.KummerChart.dualDefect_eq_zero_and_dualDefect_le — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L346-L376)

lean
/-- The defect at generic primes. Let `Γ → Gp p` be an open embedding, and let the root `ζ` assign
the embeddings of `O` to the letters of the chart `k`. Let `k` be unramified, `p ≥ 5`, `η ≥ 1`, and
at each letter `i` let `b i + W + η ≤ (p - 3) a`, `6 (a + η + W) < b i`, and let `p` divide no
nonzero integer within `6 (a + η + W)` of `0` or `± b i`. Let `L` be crystalline with jumps in `U'`,
where `U` and `U'` lie at each letter in `[-η, η]` and in the opposite far windows
`∓ε i [b i, b i + W]`.

The defect `dualDefect` is the length of the crystalline cocycles of `L` modulo those orthogonal to
the crystalline lattices with jumps in `U`. It vanishes if `U` and `U'` avoid `[-a, 0)` or `U'` lies
in `[-η, 0]`. If `L` has at most `m` jumps in `[-η, η]` at each embedding, it is at most
`11 f (m (a + 1) + rank L · (W + 1))` times the length of `O / p`, where `f = k.f`. -/
lemma New.Lift.KummerChart.dualDefect_eq_zero_and_dualDefect_le [TopologicalSpace Γ] (k : KummerChart Γ)
    (ζ : k.LetterRoot O) (ho : IsOpenEmbedding Γ.overGp.toGp) (hk : k.IsUnramified) (hp : 5 ≤ p)
    {a η W : ℕ} {b : k.Letter → ℕ} {ε : k.Letter → ℤˣ}
    (h_height : ∀ i : k.Letter, b i + W + η ≤ (p - 3) * a) (hη : 1 ≤ η)
    (h_far : ∀ i : k.Letter, 6 * (a + η + W) < b i)
    (h_gap : ∀ i : k.Letter, NoMultipleNear p (6 * (a + η + W)) (b i)) (hL : InClass ⊤ ⊥ U' L)
    (hU : ∀ i : k.Letter, FitsWindows η (-ε i) (b i) W (k.letterJumps ζ U i))
    (hU' : ∀ i : k.Letter, FitsWindows η (ε i) (b i) W (k.letterJumps ζ U' i)) :
    -- (a) the defect vanishes, if `U` and `U'` avoid `[-a, 0)` or `U'` lies in `[-η, 0]`
    ((∀ (g : O →ₐ[ℤ_[p]] ℂ_[p]) (u : ℤ), u ∈ U g ∨ u ∈ U' g → u ∉ Ico (-a : ℤ) 0) ∨
        (∀ g : O →ₐ[ℤ_[p]] ℂ_[p], U' g ⊆ Icc (-η : ℤ) 0) →
      dualDefect (InClass ⊤ ⊥ U) L = 0) ∧
    -- (b) a bound for the defect, if at most `m` jumps lie in `[-η, η]`
    ∀ m : ℕ, (∀ g : O →ₐ[ℤ_[p]] ℂ_[p], ∑ u ∈ Icc (-η : ℤ) η, jump L.ρ g u ≤ m) →
      dualDefect (InClass ⊤ ⊥ U) L ≤
        (11 * (k.f * (m * (a + 1) + finrank O L * (W + 1))) : ℕ) *
          length O (O ⧸ Ideal.span {(p : O)}) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:346-376 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=b5d141ff644eeb3bc1adad0b601f4e1b3e8f97056d081794af926320630c89e9]

lemma New.Lift.KummerChart.hasCupExponent_any_pattern — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L378-L397)

lean
/-- Let `Γ → Gp p` be an open embedding, and let the root `ζ` assign the embeddings of `O` to the
letters of the chart `k`. Let `k` be unramified, `p ≥ 7`, `η ≥ 1` and `V + 4 η ≤ M`. Let `L` be
crystalline with jumps in `U'`, where `U` and `U'` lie at each letter in `[-η, η]` and in opposite
far windows of width `V`, which start at `b` at the b-letters (those with `IsBLetter i`) and at `G`
at the others, with `0 < G ≤ b`. If `b < K p ^ 2`, `2 G < K p` and `M ≤ K`, then
`p ^ (10⁴ (K + ⌊log_p (2 (b + M))⌋))` times any crystalline cocycle of `L` is orthogonal under cup
products to the crystalline cocycles of the crystalline lattices with jumps in `U`. -/
lemma New.Lift.KummerChart.hasCupExponent_any_pattern [TopologicalSpace Γ] (k : KummerChart Γ)
    (ζ : k.LetterRoot O) (ho : IsOpenEmbedding Γ.overGp.toGp) (hk : k.IsUnramified) (hp : 7 ≤ p)
    {η V M G b K : ℕ} {IsBLetter : k.Letter → Prop} [DecidablePred IsBLetter] {ε : k.Letter → ℤˣ}
    (hη : 1 ≤ η) (hM : V + 4 * η ≤ M) (hL : InClass ⊤ ⊥ U' L)
    (hU : ∀ i : k.Letter,
      FitsWindows η (-ε i) (if IsBLetter i then b else G) V (k.letterJumps ζ U i))
    (hU' : ∀ i : k.Letter,
      FitsWindows η (ε i) (if IsBLetter i then b else G) V (k.letterJumps ζ U' i))
    (hG_pos : 0 < G) (hGb : G ≤ b) (hbK : b < K * p ^ 2) (hGK : 2 * G < K * p) (hMK : M ≤ K) :
    HasCupExponent (InClass ⊤ ⊥ U) L (10 ^ 4 * (K + p.log (2 * (b + M)))) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:378-397 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=1e0fac82d7e64323c42d60f41c58b3d9b6b4f95349255c6bbb40bfae3ee3eab8]

lemma New.Lift.KummerChart.hasCupExponent_sparse_thick — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L399-L429)

lean
/-- Let `Γ → Gp p` be an open embedding, and let the root `ζ` assign the embeddings of `O` to the
letters of the chart `k`. Let `η ≥ 1`, and let `L` be crystalline with jumps in `U'`, where `U` and
`U'` lie at each letter in `[-η, η]` and in opposite far windows of width `V`, which start at `b` at
the b-letters (those with `IsBLetter i`) and at `G` at the others, with `G + V ≤ η`; so the low
window `[-η, η]` contains the far windows of the other letters. Suppose that no three b-letters
follow one another along the orbits of `letterFrob : i ↦ i ^ p` with both gaps between `1` and
`J ≥ 1`. Suppose also that either the chart is unramified with `p ≥ 7` and `10 p ^ J η ≤ b`, or the
sign `ε` is constant and `8 e ≤ p ^ (J + 1)`. Let `2 e (b + 5 η) ≤ p ^ (J + 1) δ` and
`20 (J + 1 + d) η + ⌊log_p (2 (b + 5 η))⌋ ≤ M`, where `e = k.e` is the ramification index and
`d = k.differentBound` is `0` for `e = 1` and `v_p(e) + 1` otherwise. Then
`p ^ (10³ (δ + (J + 1) M))` times any crystalline cocycle of `L` is orthogonal under cup products to
the crystalline cocycles of the crystalline lattices with jumps in `U`. -/
lemma New.Lift.KummerChart.hasCupExponent_sparse_thick [TopologicalSpace Γ] (k : KummerChart Γ)
    (ζ : k.LetterRoot O) (ho : IsOpenEmbedding Γ.overGp.toGp) {η V G b J M δ : ℕ}
    {IsBLetter : k.Letter → Prop} [DecidablePred IsBLetter] {ε : k.Letter → ℤˣ} (hη : 1 ≤ η)
    (hL : InClass ⊤ ⊥ U' L)
    (hU : ∀ i : k.Letter,
      FitsWindows η (-ε i) (if IsBLetter i then b else G) V (k.letterJumps ζ U i))
    (hU' : ∀ i : k.Letter,
      FitsWindows η (ε i) (if IsBLetter i then b else G) V (k.letterJumps ζ U' i))
    (hG : G + V ≤ η) (hJ : 1 ≤ J)
    (h_sparse : ∀ i : k.Letter, ∀ s ∈ Icc 1 J, ∀ t ∈ Icc 1 J,
      IsBLetter i → IsBLetter ((k.letterFrob ^ s) i) → ¬IsBLetter ((k.letterFrob ^ (s + t)) i))
    (h_unramified_or_sign : (k.IsUnramified ∧ 7 ≤ p ∧ 10 * p ^ J * η ≤ b) ∨
      ((∀ i i' : k.Letter, ε i = ε i') ∧ 8 * k.e ≤ p ^ (J + 1)))
    (h_depth : k.e * (2 * (b + 5 * η)) ≤ p ^ (J + 1) * δ)
    (hM : 20 * (J + 1 + k.differentBound) * η + p.log (2 * (b + 5 * η)) ≤ M) :
    HasCupExponent (InClass ⊤ ⊥ U) L (10 ^ 3 * (δ + (J + 1) * M)) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:399-429 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=38c5c667a02884152164599b91b7026a6998acb8b8ec4850d99e4e13ef468f13]

lemma New.Lift.KummerChart.linearFrob_comp_subtype — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L431-L440)

lean
/-- Let `Γ → Gp p` be injective. Restricting a lattice `Y` to the subgroup `k.subgroup` of a chart
does not change the operator `linearFrob` of `(s, m)` on the potentially crystalline periods. -/
lemma New.Lift.KummerChart.linearFrob_comp_subtype (h_inj : Injective Γ.overGp.toGp)
    (Y : GalLattice O Γ) (s : k.subgroup) (m : ℕ) :
    linearFrob (MonoidHom.comp Y.ρ k.subgroup.subtype) s m = linearFrob Y.ρ s m := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:431-440 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=6 body_sha256=4e0fdcad7386c415006c062b21c698ce9006d61c64cdcf6148a46b29680e9e8a]

lemma New.Lift.TameChart.linearFrob_eq_one — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L442-L470)

lean
/-- Let `Γ → Gp p` be bijective, let `d` be a tame chart with subgroup `d.subgroup` and ramification
index `d.e`, and let `Y` be potentially crystalline. The elements `s` of inertia
(`IsWeilPair (toGp s) 0`) act on the periods of `Y` by `linearFrob Y.ρ s 0`. If `X ^ d.e - 1` kills
all these operators (`IsKilledBy`), then those of inertia elements in `d.subgroup` are trivial. -/
lemma New.Lift.TameChart.linearFrob_eq_one (d : TameChart Γ) (h_bij : Bijective Γ.overGp.toGp)
    {Y : GalLattice O Γ} (hY : IsPotentiallyCrystalline Y.ρ)
    (h_killed : ∀ s : Γ, IsWeilPair (toGp s) 0 → IsKilledBy Y.ρ s 0 (X ^ d.e - 1))
    (s : d.subgroup) (hs : IsWeilPair (toGp (s : Γ)) 0) : linearFrob Y.ρ s 0 = 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:442-470 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=22 body_sha256=0ea38a932af3e8df0aeec55c9558c6b385652b9b841ca45c893b44ef7a8025a1]

lemma New.Lift.TameChart.inClass_of_pow_sub_one — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L472-L493)

lean
/-- Descent along a tame chart. Let `Γ → Gp p` be a surjective open embedding, `F` any filter on
`Γ`, and `d` a tame chart with subgroup `d.subgroup` and ramification index `d.e`. Let the lattice
`Y` lie in `InClass F K U`: its periods fixed near `1` and on a set of `F` span, its jumps at each
embedding `g` lie in `U g`, and each polynomial allowed by `K s` kills `s` on the periods, for `s`
in inertia. If `K s` allows `X ^ d.e - 1` at every `s` in inertia, then `Y` is crystalline over
`d.subgroup` with jumps in `U`: it lies in the class of the filter of the sets containing
`d.subgroup` and the empty relation `⊥`. -/
lemma New.Lift.TameChart.inClass_of_pow_sub_one [TopologicalSpace Γ]
    (ho : IsOpenEmbedding Γ.overGp.toGp) {F : Filter Γ}
    (d : TameChart Γ) (h_surj : Surjective Γ.overGp.toGp)
    {K : Γ → O[X] → Prop} (hK : ∀ s : Γ, IsWeilPair (toGp s) 0 → K s (X ^ d.e - 1))
    (Y : GalLattice O Γ) (hY : InClass F K U Y) : InClass (map d.subgroup.subtype ⊤) ⊥ U Y := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:472-493 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=11 body_sha256=d1653b334d6b0e52a278f64dff30037491a53d08366671464052e77519f02ba7]

lemma New.Lift.exists_tameChart_e_eq_lcm — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L495-L501)

lean
/-- If `Γ` maps onto `Gp p` and the number `r` is less than the prime `p`, there is a tame chart
whose ramification index is the least common multiple of the `p ^ i - 1` for `1 ≤ i ≤ r`. -/
lemma New.Lift.exists_tameChart_e_eq_lcm (h_surj : Surjective Γ.overGp.toGp) (hr : r < p) :
    ∃ d : TameChart Γ, d.e = (Icc 1 r).lcm fun i : ℕ ↦ p ^ i - 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:495-501 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=4 body_sha256=1e2bfbce1fd8ec40bbc85ad9bcb7f203aa6575a7ab4fe2351ec2f20198560d99]

lemma New.Lift.TameChart.differentBound_le_one — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L503-L507)

lean
/-- The number `differentBound` of a tame chart is at most `1`, since `p` does not divide the
ramification index. -/
lemma New.Lift.TameChart.differentBound_le_one (d : TameChart Γ) : d.differentBound ≤ 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:503-507 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=fe60fbbf6c3833dff40fe59061767a3be6110dbc74464e0b03829b056e51f249]

lemma New.Lift.noMultipleNear_of_add_lt — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L509-L511)

lean
/-- If `b + n < q`, then `q` divides no nonzero integer within distance `n` of `0`, `b` or `-b`. -/
lemma New.Lift.noMultipleNear_of_add_lt {q n b : ℕ} (h_lt : b + n < q) : NoMultipleNear q n b := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:509-511 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=1 body_sha256=fa06e4fb4ac612f987b32439933379b5f4aea22e3e120d58b1ea05ce52824137]

lemma New.Lift.hasCupExponent_of_isTameType — Upstream source (src/New/Congruences/Lifting/CupOrthogonalityBounds.lean L513-L589)

lean
/-- Let `Γ → Gp p = Gal(ℚ̄_p / ℚ_p)` be a surjective open embedding. For each `s` in inertia let
`K s` be a tame type: it holds for `X ^ e - 1`, with `e` the least common multiple of the
`p ^ i - 1` for `1 ≤ i ≤ r`, and for a monic polynomial over `ℤ_[p]` of degree at most `N`. A
lattice lies in `InClass F K U` if its periods fixed on a neighbourhood of `1` that belongs to the
filter `F` span, its Hodge–Tate jumps at each embedding `g` of `O` lie in `U g`, and each polynomial
allowed by `K s` kills `s` on its periods, for `s` in inertia. Let `L` lie in the class for `U'` and
`s ↦ K s⁻¹`. If `U` and `U'` lie at each embedding in `[-η, η]` and in the opposite far windows
`∓ε [b, b + W]`, and `p > b + 6 (W + η) + r² (N + 1)² + 2`, then
`p ^ (3 r² (N + 1)² + 150 (η + W + 1))` times any crystalline cocycle of `L` has cup product a
coboundary with every crystalline cocycle of a lattice in `InClass F K U` paired with `L`. -/
lemma New.Lift.hasCupExponent_of_isTameType [TopologicalSpace Γ] (ho : IsOpenEmbedding Γ.overGp.toGp)
    (h_surj : Surjective Γ.overGp.toGp) {F : Filter Γ} {K : Γ → O[X] → Prop}
    (hL : InClass F (fun s : Γ ↦ K s⁻¹) U' L)
    (hK : ∀ s : Γ, IsWeilPair (toGp s) 0 → IsTameType p r N (K s)) {η W b : ℕ} {ε : ℤˣ}
    (hU : ∀ g : O →ₐ[ℤ_[p]] ℂ_[p], FitsWindows η (-ε) b W (U g))
    (hU' : ∀ g : O →ₐ[ℤ_[p]] ℂ_[p], FitsWindows η ε b W (U' g))
    (hp : b + 6 * (W + η) + r ^ 2 * (N + 1) ^ 2 + 2 < p) :
    HasCupExponent (InClass F K U) L (3 * (r ^ 2 * (N + 1) ^ 2) + 150 * (η + W + 1)) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/Lifting/CupOrthogonalityBounds.lean:513-589 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=60 body_sha256=0fec6056dc2f87b726b1708a37d7acd6ea22fc86dc7fa013968a177a5d1b5945]

abbrev New.Selmer.farWindowStart — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L52-L59)

lean
/-- The start of the far window at the embedding `σ` that holds the jumps near `∓ w_i`: it is
`D.natB` if the place of `σ` lies in `D.bPlaces` and `D.offWeight` otherwise, plus `i Δ + h₂ - 2 t`
with `Δ = D.gap`, `h₂ = D.halfGap` and `t = D.t`. -/
noncomputable abbrev New.Selmer.farWindowStart {P : Parameters} (D : Data P) (i : ℕ)
    (σ : D.E →+* ℂ) : ℕ := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:52-59 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=3 body_sha256=4e905107bcdd8c2ff0842bc2fbe612a06304f470ea3f83e6d6c6b27084e379c8]

lemma New.Selmer.fitsWindows_and_image_neg_sub_one — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L61-L102)

lean
/-- Let `w_i = D.liftWeight i` be the `i`-th weight at the place of `σ`, and let `ε = cmSign σ` be
`1` if `σ` is in the CM type and `-1` otherwise. Let each member of `J` be low
(`Δ / 4 ≤ |u| ≤ 2 m Δ` with `Δ = D.gap`) or within `D.t` of `-ε w_i`, and let each member of `U` lie
in `J` or in `[0, t)`, with `t ≤ D.t`. Put `η = h₂² + 1` with `h₂ = D.halfGap`, and let
`S = farWindowStart D i σ`, which equals `w_i - 2 D.t`. Then `U` lies in the union of `[-η, η]` and
`-ε [S, S + 4 D.t]`, and the dual jumps `-u - 1` lie in the union of `[-η, η]` and
`ε [S, S + 4 D.t]`. -/
lemma New.Selmer.fitsWindows_and_image_neg_sub_one {P : Parameters} {D : Data P} {t i : ℕ}
    {σ : D.E →+* ℂ} {J : Multiset ℤ} {U : Finset ℤ} (ht : t ≤ D.t)
    (hJ : ∀ u ∈ J, D.gap ≤ 4 * u.natAbs ∧ u.natAbs ≤ 2 * D.m * D.gap ∨
      |cmSign σ * u + D.liftWeight i (InfinitePlace.mk σ)| ≤ D.t)
    (hU : ∀ u ∈ U, u ∈ J ∨ ∃ c < t, u = (c : ℕ)) :
    FitsWindows (D.halfGap ^ 2 + 1) (-cmSign σ) (farWindowStart D i σ) (4 * D.t) U ∧
      FitsWindows (D.halfGap ^ 2 + 1) (cmSign σ) (farWindowStart D i σ) (4 * D.t)
        (U.image fun u : ℤ ↦ -u - 1) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:61-102 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=28 body_sha256=d79f53094dc684fb92118f2c815051b20ea5a480e53ffc5a9ff73a418a9923b6]

lemma New.Selmer.sum_count_neg_sub_one_le — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L104-L116)

lean
/-- If `2 ≤ h²`, the members `a` of `J` whose dual jump `-a - 1` lies in `[-h² - 1, h² + 1]` are
at most as many as those with `|a| ≤ 2 h²`, both counted with multiplicity. -/
lemma New.Selmer.sum_count_neg_sub_one_le {h : ℕ} (hh : 2 ≤ h ^ 2) (J : Multiset ℤ) :
    ∑ u ∈ Finset.Icc (-1 + -(h : ℤ) ^ 2) ((h : ℤ) ^ 2 + 1), Multiset.count (-u - 1) J ≤
      J.countP (·.natAbs ≤ 2 * h ^ 2) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:104-116 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=9 body_sha256=3d08df0a3837e6f184e13f3ba73c0b8567eb473b10ca79c063e6defda62d49e1]

lemma New.Selmer.smul_eq_pow_of_coefficientEmbedding_eq_pow — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L118-L128)

lean
/-- A relation between two letters determines the action on roots of unity: if `ζ` in `O` is a
primitive `N`-th root of unity and `g' ζ = (g ζ) ^ n`, then `g' g⁻¹` raises every `N`-th root of
unity to the power `n`. -/
lemma New.Selmer.smul_eq_pow_of_coefficientEmbedding_eq_pow {ℓ N n : ℕ} [ThePrime ℓ] [NeZero N]
    {O : CoeffRing ℓ} {ζ : ↑O} (hζ : IsPrimitiveRoot ζ N) {g g' : Gp ℓ}
    (h_pow : coefficientEmbedding O g' ζ = coefficientEmbedding O g ζ ^ n) :
    ∀ z : PadicAlgCl ℓ, z ^ N = 1 → (g' * g⁻¹) • z = z ^ n := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:118-128 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=0c54a4255377091f34b709bc8fd8beb0ccc55ebae78ced4989d092b2e0aa6a87]

lemma New.Selmer.complexEmbeddingOf_eq_of_coefficientEmbedding_eq — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L130-L152)

lean
/-- Let `𝒥.toGp : Γ → G_ℓ` be an open embedding onto the elements of `G_ℓ = Gal(ℚ̄_ℓ / ℚ_ℓ)` that
fix `e E`. Let `k` be a Kummer chart of `Γ` (a subring `W(𝔽_{ℓ^f})⟦z⟧` of `A_inf` adapted to `Γ`)
that is unramified, with `f = k.f`, and let `ζ` in `O` be a primitive `(ℓ ^ f - 1)`-th root of
unity. If `g ζ = g' ζ`, where `coefficientEmbedding O g` is the embedding `x ↦ g x` of `O ⊆ ℚ̄_ℓ`
into `ℂ_ℓ`, then `g` and `g'` give the same complex embedding of `E`. -/
lemma New.Selmer.complexEmbeddingOf_eq_of_coefficientEmbedding_eq {P : Parameters} {D : Data P}
    {ℓ : ℕ} [ThePrime ℓ] [PadicIso ℓ] {Γ : Type} [Group Γ] [𝒥 : OverGp Γ ℓ] [TopologicalSpace Γ]
    {e : D.E →+* PadicAlgCl ℓ} (h_group : IsCompletionGroup e 𝒥.toGp) {k : KummerChart ⟨Γ⟩}
    (h_un : k.IsUnramified) {O : CoeffRing ℓ} {ζ : ↑O} (hζ : IsPrimitiveRoot ζ (ℓ ^ k.f.val - 1))
    {g g' : Gp ℓ} (h_eq : coefficientEmbedding O g ζ = coefficientEmbedding O g' ζ) :
    complexEmbeddingOf e g = complexEmbeddingOf e g' := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:130-152 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=13 body_sha256=1439c6a9304ead97ff8590f5b002f45d6cb9a9763b36a696e63a86e48890bef8]

lemma New.Selmer.pow_ordProj_pow_sub_one_eq_one — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L154-L168)

lean
/-- If a Frobenius `F` for `ℓ ^ f` (`IsFrob (intQpBar ℓ) (ℓ ^ f) F`) fixes a primitive `N`-th root
of unity `z`, then `z ^ ℓ ^ v` is an `(ℓ ^ f - 1)`-th root of unity. Here `v = N.factorization ℓ` is
the `ℓ`-adic valuation of `N`, so `z ^ ℓ ^ v` has order prime to `ℓ`. -/
lemma New.Selmer.pow_ordProj_pow_sub_one_eq_one {ℓ N : ℕ} [hp : ThePrime ℓ] [NeZero N] {f : ℕ+}
    {F : Gp ℓ} (hF : IsFrob (intQpBar ℓ) (ℓ ^ f.val) F) {z : PadicAlgCl ℓ}
    (hz : IsPrimitiveRoot z N) (h_fix : F z = z) :
    (z ^ ℓ ^ N.factorization ℓ) ^ (ℓ ^ f.val - 1) = 1 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:154-168 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=9 body_sha256=1ebb3a14d6df56fe61b54803dd829e86437c8ddb8717dd9af0ee649956debfd5]

lemma New.Selmer.notMem_bPlaces_of_coefficientEmbedding_eq_pow — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L170-L208)

lean
/-- No three b-places follow one another closely along `z ↦ z ^ ℓ`, for `ℓ ≤ D.k * D.t`. Here
`D.bPlaces` is the sparse set of infinite places of `E = D.E` of weight `D.natB`. Let `j : Γ → G_ℓ`
be an open embedding onto the elements that fix `e E`, let its image contain `F` acting as
`x ↦ x ^ ℓ ^ f` on the residue field of the valuation ring `intQpBar ℓ` of `ℚ̄_ℓ`, and let `ζ` in
`O` be a primitive `(ℓ ^ f - 1)`-th root of unity. Write `g ζ` for `coefficientEmbedding O g ζ`. If
`g₁ ζ = (g₀ ζ) ^ ℓ ^ a` and `g₂ ζ = (g₀ ζ) ^ ℓ ^ (a + b)` with `1 ≤ a, b ≤ ⌊log_ℓ (D.halfGap ^ 3)⌋`,
and the complex embeddings `complexEmbeddingOf e g` of `E` for `g = g₀` and `g = g₂` lie at places
in `D.bPlaces`, then that for `g = g₁` does not. -/
lemma New.Selmer.notMem_bPlaces_of_coefficientEmbedding_eq_pow {P : Parameters} {D : Data P} {ℓ : ℕ}
    [hp : ThePrime ℓ] [PadicIso ℓ] {Γ : Type} [Group Γ] [TopologicalSpace Γ]
    {e : D.E →+* PadicAlgCl ℓ} {j : Γ →* Gp ℓ} (hj : IsCompletionGroup e j) {f : ℕ+} {F : Gp ℓ}
    (hF_mem : F ∈ j.range) (hF : IsFrob (intQpBar ℓ) (ℓ ^ f.val) F) (hℓ : ℓ ≤ D.k * D.t)
    {O : CoeffRing ℓ} {ζ : ↑O} (hζ : IsPrimitiveRoot ζ (ℓ ^ f.val - 1)) {a b : ℕ}
    (ha : a ∈ Icc 1 (ℓ.log (D.halfGap ^ 3))) (hb : b ∈ Icc 1 (ℓ.log (D.halfGap ^ 3)))
    {g₀ g₁ g₂ : Gp ℓ} (hg₁ : coefficientEmbedding O g₁ ζ = coefficientEmbedding O g₀ ζ ^ ℓ ^ a)
    (hg₂ : coefficientEmbedding O g₂ ζ = coefficientEmbedding O g₀ ζ ^ ℓ ^ (a + b))
    (h_mem₀ : InfinitePlace.mk (complexEmbeddingOf e g₀) ∈ D.bPlaces)
    (h_mem₂ : InfinitePlace.mk (complexEmbeddingOf e g₂) ∈ D.bPlaces) :
    InfinitePlace.mk (complexEmbeddingOf e g₁) ∉ D.bPlaces := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:170-208 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=21 body_sha256=f47a212aca4c8e731f21558b09be224d92115f532991c3cd8225f93dfaa2854a]

lemma New.Selmer.eventually_exists_lettersReadThick — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L210-L293)

lean
/-- Let `𝒥.toGp : Γ → G_ℓ` be an open embedding onto the elements of `G_ℓ = Gal(ℚ̄_ℓ / ℚ_ℓ)` that
fix `e E`, where `E = D.E`, and put `Q = D.k * D.t`. For `O` large there are a Kummer chart of `Γ`
(a subring `W(𝔽_{ℓ^f})⟦z⟧` of `A_inf` adapted to `Γ`, of ramification `k.e` and with `f = k.f`) `k`,
an element `ζ` of `O` with `ζ ^ (ℓ ^ f - 1) = 1`, a predicate `T` and a sign `s` on `ℂ_ℓ` with the
following properties, the clauses of `LettersReadThick`. The degree `k.e * k.f` is `[G_ℓ : Γ]` and
`k.e ≤ h₂ = D.halfGap`. Write `g ζ` for `coefficientEmbedding O g ζ` and
`σ = complexEmbeddingOf e g`. The place of `σ` lies in the set `D.bPlaces` of places of weight
`D.natB` if and only if `T (g ζ)`, and the sign `cmSign σ` of `σ` for the CM type is `s (g ζ)`; this
holds for every `g` if `Q < ℓ`, and otherwise for the `g` at b-places. The chart is unramified with
`7 ≤ ℓ`, or else `ℓ ≤ Q` and `s` is constant. For `ℓ ≤ Q` no three values with `T` follow one
another at distances `≤ log_ℓ h₂³` along `z ↦ z ^ ℓ`. -/
lemma New.Selmer.eventually_exists_lettersReadThick {P : Parameters} {D : Data P} {ℓ : ℕ}
    [hp : ThePrime ℓ] [PadicIso ℓ] {Γ : Type} [Group Γ] [𝒥 : OverGp Γ ℓ] [TopologicalSpace Γ]
    {e : D.E →+* PadicAlgCl ℓ} (h_group : IsCompletionGroup e 𝒥.toGp) :
    ∀ᶠ O : CoeffRing ℓ in Filter.atTop,
      ∃ (k : KummerChart ⟨Γ⟩) (ζ : k.LetterRoot (Γ := ⟨Γ⟩) O) (T : ℂ_[ℓ] → Prop) (s : ℂ_[ℓ] → ℤˣ),
        LettersReadThick k (fun g : Gp ℓ ↦ coefficientEmbedding O g ζ)
          (fun g : Gp ℓ ↦ InfinitePlace.mk (complexEmbeddingOf e g) ∈ D.bPlaces)
          (fun g : Gp ℓ ↦ cmSign (complexEmbeddingOf e g)) (D.k * D.t) D.halfGap T s := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:210-293 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=66 body_sha256=4e6c8a49fda42ce9f890fa48809c59625841f75eba7af57833ae1da7da466f42]

lemma New.Selmer.mem_range_of_modEq_one — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L295-L305)

lean
/-- Let `j : Γ → Gp ℓ` identify `Γ` with the completion group of an embedding `e` of `D.E`
(`IsCompletionGroup e j`). If `ℓ ≡ 1` modulo `D.cyclotomicConductor`, then all of `Gp ℓ` fixes the
image of `E`, so `j` is onto. -/
lemma New.Selmer.mem_range_of_modEq_one {P : Parameters} {D : Data P} {ℓ : ℕ} [ThePrime ℓ]
    {Γ : Type} [Group Γ] [TopologicalSpace Γ] {e : D.E →+* PadicAlgCl ℓ} {j : Γ →* Gp ℓ}
    (hj : IsCompletionGroup e j) (hℓ : ℓ ≡ 1 [MOD D.cyclotomicConductor]) (g : Gp ℓ) :
    g ∈ j.range := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:295-305 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=991189308e9ff3a1eb8e0561b724fafc8420c4757607b2e289be943768580a96]

lemma New.Selmer.IsMainSummandWeights.le_two_mul_natAbs — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L307-L321)

lean
/-- Every jump `u` of a main summand, that is every member of a multiset `J σ` that satisfies
`New.Selmer.IsMainSummandWeights`, has `|u| ≥ h₂ / 2` with `h₂ = D.halfGap`: either it is low, so
that `|u| ≥ Δ / 4` with `Δ = D.gap = 2 h₂`, or it lies within `D.t` of the weight `∓ w_i` of the
data, signed by the CM type (`cmSign`), and `w_i ≥ h₂ ≥ 3 D.t`. -/
lemma New.Selmer.IsMainSummandWeights.le_two_mul_natAbs {P : Parameters} {D : Data P} {r t : ℕ}
    {J : (D.E →+* ℂ) → Multiset ℤ} (hJ : IsMainSummandWeights D r t J) {σ : D.E →+* ℂ} {u : ℤ}
    (hu : u ∈ J σ) : D.halfGap ≤ 2 * u.natAbs := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:307-321 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=9 body_sha256=a388996b0fab109e80fdda7ae8a574c7bbaf6f789b71637db6b51fa79d7fff4e]

lemma New.Selmer.two_mul_tame_exponent_le_defectBound — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L323-L346)

lean
/-- Let `ℓ = D.levelPrime n` be one of the two level primes of the data `D`, let `r = D.r` be the
rank, `t = D.t = 5 r` and `0 < x ≤ t`. The number `3 r² ((r + t) r + 1)² + 150 (h₂² + 4 t + 2)` is
the exponent of `ℓ` that `New.Lift.hasCupExponent_of_isTameType` gives at the sizes of the data.
Twice this number is at most `defectBound D ℓ / x`, with
`defectBound D ℓ = 10⁶ (m / k) (b v_ℓ(M) + λ)` in the nonnegative reals, where `m = D.m`,
`k = D.k = D.r + 1 - m`, `b = D.natB` is the weight at the b-places, `M = D.M` is the product of the
two level primes, and `λ = crystallineLoss h₂ b ℓ` is the `ℓ`-adic valuation of
`(2 b)! (∏ a) ^ h₂³`, with `a` over the positive integers in `(b - 30 h₂³, b + 30 h₂³]` and
`h₂ = D.halfGap = D.r ^ 8`. The term `10⁶ (m / k) b v_ℓ(M) / x` suffices. -/
lemma New.Selmer.two_mul_tame_exponent_le_defectBound {P : Parameters} (D : Data P) (n : Fin 2)
    {x : ℕ} (hx_pos : 0 < x) (hx_le : x ≤ D.t) :
    2 * ((3 * (D.r ^ 2 * ((D.r + D.t) * D.r + 1) ^ 2) +
      150 * (D.halfGap ^ 2 + 1 + 4 * D.t + 1) : ℕ) : NNReal) ≤
      defectBound D (D.levelPrime n) / x := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:323-346 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=11 body_sha256=6aa725e3750674a07d75ade95dfceaa2ec17b79b2c820dea288389e38315c0ee]

lemma New.Selmer.crystalline_bound_le_defectBound — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L348-L381)

lean
/-- Let `t = D.t = 5 D.r` and `0 < x ≤ t`. Then
`10⁵ (ρ ⌊2 λ / (k t)⌋ m + ⌊ρ m / (k x)⌋ λ) ≤ ρ · defectBound D ℓ / x`, with
`defectBound D ℓ = 10⁶ (m / k) (b v_ℓ(M) + λ)` in the nonnegative reals, where `m = D.m`,
`k = D.k = D.r + 1 - m`, `b = D.natB` is the weight at the b-places, `M = D.M` is the product of the
two level primes, and `λ = crystallineLoss h₂ b ℓ` is the `ℓ`-adic valuation of
`(2 b)! (∏ a) ^ h₂³`, with `a` over the positive integers in `(b - 30 h₂³, b + 30 h₂³]` and
`h₂ = D.halfGap = D.r ^ 8`. The left side is the bound of
`New.Selmer.normLength_dualDefect_le_of_crystallineSizes` for a lattice of rank `ρ`, with `Q = k t`
and `μ = ⌊ρ m / (k x)⌋`. -/
lemma New.Selmer.crystalline_bound_le_defectBound {P : Parameters} (D : Data P) (ℓ ρ : ℕ) {x : ℕ}
    (hx_pos : 0 < x) (hx_le : x ≤ D.t) :
    ((10 ^ 5 * (ρ * (2 * crystallineLoss D.halfGap D.natB ℓ / (D.k * D.t) * D.m) +
      ρ * D.m / (D.k * x) * crystallineLoss D.halfGap D.natB ℓ) : ℕ) : NNReal) ≤
      ρ * (defectBound D ℓ / x) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:348-381 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=21 body_sha256=e20f51b06cc98468b609820b2ec0fa963392f9b3386ec14078ea3a4b0b571a42]

structure New.Selmer.IsSummandClass — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L383-L406)

lean
/-- The lattices `L i` are the summands at a place above `ℓ`, and `F`, `K`, `U` are the data of a
class `New.Lift.InClass F K U` adapted to them. The summand `L none` is the main summand, of rank
`r` and with jumps `J g` at `coefficientEmbedding O g`; the summand `L (some c)` has the single jump
`c < t`. -/
structure New.Selmer.IsSummandClass {P : Parameters} (D : Data P) {ℓ : ℕ} [ThePrime ℓ] {Γ : Type}
    [Group Γ] [𝒥 : OverGp Γ ℓ] {O : CoeffRing ℓ} (r : ℕ) (J : Gp ℓ → Multiset ℤ) {t : ℕ}
    (L : Option (Fin t) → GalLattice O Γ) (F : Filter Γ) (K : Γ → Polynomial O → Prop)
    (U : (O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) → Finset ℤ) : Prop where
  /-- The class is tame, with `ℓ` one of the primes `D.levelPrime n`, or crystalline with no
  condition on inertia. -/
  tame_or_crystalline :
    (∃ n : Fin 2, ℓ = D.levelPrime n ∧
      ∀ s : Γ, IsWeilPair (𝒥.toGp s) 0 → IsTameType ℓ D.r ((D.r + D.t) * D.r) (K s)) ∨
    (F = ⊤ ∧ K = ⊥)
  /-- Every jump allowed by `U` is a jump of one of the summands. -/
  exists_jump_ne_zero (γ : O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) (u : ℤ) (hu : u ∈ U γ) :
    ∃ i : Option (Fin t), jump (L i).ρ γ u ≠ 0
  /-- The main summand has the jumps `J`. -/
  hasJumps_none (g : Gp ℓ) : HasJumps (L none).ρ (coefficientEmbedding O g) (J g)
  /-- The summand `L (some c)` has the single jump `c`. -/
  hasJumps_some (c : Fin t) (g : Gp ℓ) : HasJumps (L (some c)).ρ (coefficientEmbedding O g)
    {(c : ℤ)}
  /-- The main summand has rank `r`. -/
  finrank_none : finrank O (L none) = r

lemma New.Selmer.crystallineSizes_data — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L408-L418)

lean
/-- The data satisfy the size conditions `CrystallineSizes` with `Q = D.k * D.t`, `m = D.m`,
`h = D.halfGap`, `G = D.offWeight`, `b = D.natB`, `η = h² + 1`, `W = 4 D.t` and the shift
`δ = i D.gap + h - 2 D.t`, for `i ≤ D.m`; each condition is a comparison of logarithmic scales. -/
lemma New.Selmer.crystallineSizes_data {P : Parameters} (D : Data P) {i : ℕ} (hi : i ≤ D.m) :
    CrystallineSizes (D.k * D.t) D.m D.halfGap D.offWeight D.natB
      (i * D.gap + D.halfGap - 2 * D.t) (D.halfGap ^ 2 + 1) (4 * D.t) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:408-418 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=6 body_sha256=afde2dc5937156067382f4d658cebde5480efd2e7db5217c0791e87a681ee68e]

lemma New.Selmer.hasFewLowJumps_tateDual_of_isMainSummandWeights — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L420-L452)

lean
/-- Put `h₂ = D.halfGap`, `m = D.m` and `k = D.k = D.r + 1 - m`. Let the multisets `J σ`, for the
complex embeddings `σ` of `D.E`, be the weights of a main summand. Let `L` be a potentially
crystalline lattice over the ring of integers `O` of a finite Galois extension of `ℚ_ℓ`, with an
action of `Γ → G_ℓ`, whose Hodge–Tate jumps at each embedding `γ` of `O`, with multiplicity
`jump L.ρ γ u`, are `J (σ γ)`. Let `U γ` consist of members of `J (σ γ)` and integers in `[0, t)`,
and `U' γ` of jumps of the Tate dual of `L`. Then the dual has few low jumps (`HasFewLowJumps`): the
negative members of `U γ` and `U' γ` are at most `-h₂ / 2`, and at most `⌊r m / k⌋` of its jumps at
`γ` lie in `[-h₂² - 1, h₂² + 1]`. -/
lemma New.Selmer.hasFewLowJumps_tateDual_of_isMainSummandWeights {P : Parameters} {D : Data P}
    {ℓ : ℕ} [ThePrime ℓ] {Γ : Type} [Group Γ] [OverGp Γ ℓ] {O : CoeffRing ℓ}
    {L : GalLattice O Γ} (hL : IsPotentiallyCrystalline L.ρ) {r t : ℕ}
    {J : (D.E →+* ℂ) → Multiset ℤ}
    (hJ : IsMainSummandWeights D r t J) {σ : (O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) → D.E →+* ℂ}
    (h_jumps : ∀ (γ : O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) (u : ℤ), jump L.ρ γ u = Multiset.count u (J (σ γ)))
    {U U' : (O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) → Finset ℤ}
    (hU : ∀ γ : O →ₐ[ℤ_[ℓ]] ℂ_[ℓ], ∀ u ∈ U γ, u ∈ J (σ γ) ∨ ∃ c < t, u = (c : ℕ))
    (hU' : ∀ γ : O →ₐ[ℤ_[ℓ]] ℂ_[ℓ], ∀ u ∈ U' γ, jump L.tateDual.ρ γ u ≠ 0) :
    HasFewLowJumps L.tateDual D.halfGap (r * D.m / D.k) (D.halfGap ^ 2 + 1) U U' := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:420-452 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=16 body_sha256=df248ac5f823ce0d6306adc38b32c3fb282199ff9d480b730df17c74d02c8c95]

lemma New.Selmer.subset_Icc_of_jump_eq_single — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L454-L465)

lean
/-- If the lattice `L` is potentially crystalline with the single Hodge–Tate jump `c < D.t`, then
every jump of its Tate dual, which is `-c - 1`, lies in `[-h₂² - 1, 0]`, where `h₂ = D.halfGap`. -/
lemma New.Selmer.subset_Icc_of_jump_eq_single {P : Parameters} {D : Data P} {ℓ : ℕ} [ThePrime ℓ]
    {Γ : Type} [Group Γ] [OverGp Γ ℓ] {O : CoeffRing ℓ} {L : GalLattice O Γ}
    (hL : IsPotentiallyCrystalline L.ρ) {c : ℕ} (hc : c < D.t)
    (h_jumps : ∀ (γ : O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) (u : ℤ), jump L.ρ γ u = Multiset.count u {(c : ℤ)})
    {γ : O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]} {U : Finset ℤ} (hU : ∀ u ∈ U, jump L.tateDual.ρ γ u ≠ 0) :
    U ⊆ Finset.Icc (-(D.halfGap ^ 2 + 1 : ℕ) : ℤ) 0 := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:454-465 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=5 body_sha256=f26d1f39910d48f7a4fd4cbe1e74be6b4eb653a60da75b7873b431020980354c]

lemma New.Selmer.normLength_dualDefect_le_defectBound_of_isTameType — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L467-L517)

lean
/-- The tame case, at one of the two level primes `ℓ = D.levelPrime n` of the data `D`. Here `D.r`
is the rank parameter of the data and `D.t = 5 D.r`; the rank of the lattice `L` is arbitrary.
Let `𝒥.toGp : Γ → G_ℓ` be an open embedding onto the elements of
`G_ℓ = Gal(ℚ̄_ℓ / ℚ_ℓ)` that fix `e E`, where `E = D.E`. A lattice lies in `InClass F K U` if its
crystalline periods fixed on a neighbourhood of `1` that belongs to the filter `F` span, its
Hodge–Tate jumps at each embedding `γ` of `O` lie in `U γ`, and each polynomial allowed by `K s`
kills `s` on its periods, for `s` in inertia. Assume:
* `hL`: `L` lies in the class for `F`, `s ↦ K s⁻¹` and `U'`;
* `h_tame`: for each `s` in inertia (`IsWeilPair (𝒥.toGp s) 0`) the condition `K s` on polynomials
  holds for `X ^ e' - 1`, with `e'` the least common multiple of the `ℓ ^ a - 1` for `1 ≤ a ≤ D.r`,
  and for a monic polynomial over `ℤ_ℓ` of degree at most `(D.r + D.t) D.r` (`IsTameType`);
* `hU`, `hU'`: with `η = h₂² + 1`, the sign `ε = cmSign σ` of a complex embedding `σ` for the CM
  type, and `S = farWindowStart D i σ` (the `i`-th lift weight at `σ` minus `2 D.t`, `i ≤ D.m`),
  each `U γ` lies in `[-η, η] ∪ -ε · [S, S + 4 D.t]` and each `U' γ` in
  `[-η, η] ∪ ε · [S, S + 4 D.t]`.

Then the defect of `L` for the class `InClass F K U`, the length of the crystalline cocycles modulo
those orthogonal, under cup products, to the crystalline cocycles of the lattices in the class,
normalised so that `O / ℓ` has length `1`, is at most `[G_ℓ : Γ] · rank L · defectBound D ℓ / x` for
`0 < x ≤ D.t`. Here `defectBound D ℓ = 10⁶ (m / k) (b v_ℓ(M) + λ)` in the nonnegative reals, where
`m = D.m`, `k = D.k = D.r + 1 - m`, `b = D.natB` is the weight at the b-places, `M = D.M` is the
product of the two level primes, and `λ = crystallineLoss h₂ b ℓ` is the `ℓ`-adic valuation of
`(2 b)! (∏ a) ^ h₂³`, with `a` over the positive integers in `(b - 30 h₂³, b + 30 h₂³]` and
`h₂ = D.halfGap = D.r ^ 8`. -/
lemma New.Selmer.normLength_dualDefect_le_defectBound_of_isTameType {P : Parameters} {D : Data P}
    {n : Fin 2} [ThePrime (D.levelPrime n)] {Γ : Type} [Group Γ]
    [𝒥 : OverGp Γ (D.levelPrime n)] [TopologicalSpace Γ]
    {e : D.E →+* PadicAlgCl (D.levelPrime n)} (h_group : IsCompletionGroup e 𝒥.toGp)
    {O : CoeffRing (D.levelPrime n)} {L : GalLattice O Γ} {F : Filter Γ}
    {K : Γ → Polynomial O → Prop} {U U' : (O →ₐ[ℤ_[D.levelPrime n]] ℂ_[D.levelPrime n]) → Finset ℤ}
    (hL : InClass F (fun s : Γ ↦ K s⁻¹) U' L)
    (h_tame : ∀ s : Γ, IsWeilPair (𝒥.toGp s) 0 →
      IsTameType (D.levelPrime n) D.r ((D.r + D.t) * D.r) (K s))
    {i : ℕ} (hi : i ≤ D.m) {σ : D.E →+* ℂ}
    (hU : ∀ γ : O →ₐ[ℤ_[D.levelPrime n]] ℂ_[D.levelPrime n],
      FitsWindows (D.halfGap ^ 2 + 1) (-cmSign σ) (farWindowStart D i σ) (4 * D.t) (U γ))
    (hU' : ∀ γ : O →ₐ[ℤ_[D.levelPrime n]] ℂ_[D.levelPrime n],
      FitsWindows (D.halfGap ^ 2 + 1) (cmSign σ) (farWindowStart D i σ) (4 * D.t) (U' γ))
    {x : ℕ} (hx_pos : 0 < x) (hx_le : x ≤ D.t) :
    O.normLength (dualDefect (InClass F K U) L) ≤
      𝒥.toGp.range.index * ↑(finrank O L * (defectBound D (D.levelPrime n) / x)) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:467-517 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=11 body_sha256=f2941fb62cb0aea96e66dc7361de55845df05f07e9c170b6786247b84bc33778]

lemma New.Selmer.normLength_dualDefect_le_of_isSummandClass — Upstream source (src/New/Congruences/LocalLoss/CrystallineDefect.lean L519-L624)

lean
/-- The defect bound at one place above `ℓ`. Let `𝒥.toGp : Γ → G_ℓ` be an open embedding onto the
elements of `G_ℓ = Gal(ℚ̄_ℓ / ℚ_ℓ)` that fix `e E`, where `E = D.E`; each `g` in `G_ℓ` gives a
complex embedding `complexEmbeddingOf e g` of `E`. Let the multisets `J σ` be the weights of a main
summand (`IsMainSummandWeights`): `1 ≤ r ≤ D.r`, `t ≤ D.t = 5 D.r`, each member `u` of `J σ` has
`h₂ / 2 ≤ |u| ≤ 4 m h₂` or lies within `D.t` of `∓ w_i(σ)` for one lift weight
`w_i = D.liftWeight i` with `i ≤ m`, at most `r m / k` members have `|u| ≤ 2 h₂²`, and at most `r`
members of `J σ` and `J σ̄` together are negative. Here `O` runs over the rings of integers of
finite Galois extensions of `ℚ_ℓ`, and large means containing a given one. Let `O` be large. A
lattice lies in `InClass F K U` if its crystalline periods fixed on a neighbourhood of `1` that
belongs to the filter `F` span, its Hodge–Tate jumps at each embedding `γ` of `O` lie in `U γ`, and
each polynomial allowed by `K s` kills `s` on its periods, for `s` in inertia. Let the class be
adapted to the lattices `L c` (`IsSummandClass`): it is tame with `ℓ` a level prime of `D`, or
crystalline (`F = ⊤`, `K = ⊥`); each member of `U γ` is a jump of some `L c`; the main summand
`L none` has rank `r` and jumps `J (complexEmbeddingOf e g)` at the embedding `a ↦ g a` of `O`; and
`L (some c)` has the single jump `c`. If `L c` lies in the class, then the defect of its Tate dual,
the length of the crystalline cocycles modulo those orthogonal, under cup products, to the
crystalline cocycles of the lattices in the class, normalised so that `O / ℓ` has length `1`, is at
most `[G_ℓ : Γ] · rank (L c) · defectBound D ℓ / x`, where `x = 1` for the main summand and
`x = D.t` otherwise. Here `defectBound D ℓ = 10⁶ (m / k) (b v_ℓ(M) + λ)` in the nonnegative reals,
where `m = D.m`, `k = D.k = D.r + 1 - m`, `b = D.natB` is the weight at the b-places, `M = D.M` is
the product of the two level primes, and `λ = crystallineLoss h₂ b ℓ` is the `ℓ`-adic valuation of
`(2 b)! (∏ a) ^ h₂³`, with `a` over the positive integers in `(b - 30 h₂³, b + 30 h₂³]` and
`h₂ = D.halfGap = D.r ^ 8`; the division by `x` is exact. -/
lemma New.Selmer.normLength_dualDefect_le_of_isSummandClass {P : Parameters} {ℓ : ℕ} {Γ : Type}
    {D : Data P} [hp : ThePrime ℓ] [PadicIso ℓ] [Group Γ] [𝒥 : OverGp Γ ℓ] [TopologicalSpace Γ]
    {e : D.E →+* PadicAlgCl ℓ} {r t : ℕ} {J : (D.E →+* ℂ) → Multiset ℤ}
    (hJ : IsMainSummandWeights D r t J) (h_group : IsCompletionGroup e 𝒥.toGp) :
    ∀ᶠ O : CoeffRing ℓ in Filter.atTop,
      ∀ {L : Option (Fin t) → GalLattice O Γ} {F : Filter Γ} {K : Γ → Polynomial O → Prop}
        {U : (O →ₐ[ℤ_[ℓ]] ℂ_[ℓ]) → Finset ℤ},
      IsSummandClass D r (fun g : Gp ℓ ↦ J (complexEmbeddingOf e g)) L F K U →
      ∀ c : Option (Fin t), InClass F K U (L c) →
        O.normLength (dualDefect (InClass F K U) (L c).tateDual) ≤
          𝒥.toGp.range.index *
            ↑(finrank O (L c) * (defectBound D ℓ / (if c = none then 1 else D.t : ℕ))) := by
  sorry -- [EXTRACTED_STUB upstream=src/New/Congruences/LocalLoss/CrystallineDefect.lean:519-624 commit=41c2716658c42ba08eb0648994a2efe83082a95c body_lines=72 body_sha256=406297681ac7e996abc84debcab42d1048870a6840f29c347cda7d967421ee4d]

Page Glossary ​

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.
Galois main summand
The fixed, twist-independent rank-r (or rank-1) l-adic Galois representation R extracted from a Hecke eigensystem whose trace, after twisting by theta^(-1) and adding the inverse-cyclotomic string sum_{e < t} chi_cyc^(-e), matches every twisted theta lift.
crystalline dual defect
The normalized length of crystalline cocycles of a summand's Tate dual modulo those cup-orthogonal to congruent lattices, uniformly bounded at every prime l by [G_l : Gamma] * rank(L_c) * defectBound(D, l) / x and summing across all primes well inside D.denominatorBudget.
Kummer chart cup orthogonality
Bounding the power p^e that pushes crystalline cocycles of a p-adic Galois lattice L into the cup-product annihilator of congruent dual lattices across four weight/prime regimes using Kisin-module Frobenius-orbit walks on a Kummer chart.
Frobenius cycle
A cyclic ring of $N$ Frobenius-twisted embeddings $W \to O$ alternating between standard and contragredient actions of $\mathrm{GL}_k(W)$, whose Stepanov zero counts and Levi-invariant averaging yield low-dimension edge conditions modulo $w^c$.
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).
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.