Skip to content

Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.

Python

refactor(New/Spanning/Unfolding/MomentBounds): extract non-coset second moment bound

Rohan Arun5e05e1a214f3
diff --git a/src/New/Spanning/Unfolding/MomentBounds.lean b/src/New/Spanning/Unfolding/MomentBounds.lean
index b14134b03c5..511ca8887f3 100644
--- a/src/New/Spanning/Unfolding/MomentBounds.lean
+++ b/src/New/Spanning/Unfolding/MomentBounds.lean
@@ -205,6 +205,33 @@ lemma div_levelPrime_pow_mul_mainSecondMoment_le :
field
_ ≤ _ := by grw [← div_eq_inv_mul, h_eight]
+/-- Bound the sum of `secondMoment` over a subset `Ω` of `S.ResidueGL` disjoint from scalar
+cosets and `reducedImage besselS` by `linkBound` plus the identity contribution. -/
+private lemma secondMoment_non_coset_le [S.IsAdmissible]
+ {Ω : Set S.ResidueGL}
+ (h_avoid : S.AvoidsScalarCosets Ω)
+ (h_off : ∀ s ∈ Ω, s ∉ S.reducedImage besselS)
+ (h_meet : ∀ s ∈ Ω,
+ (S.levelPrime 0 ^ Core.numInfPlaces E : ℕ) ≤
+ S.meetNorm (S.amplitudeSum .full Set.univ) s) :
+ secondMoment (S.amplitudeSum .full Set.univ) Ω ≤
+ 2 * ((S.b ^ (2 * Core.numInfPlaces E) /
+ (S.levelPrime 0 ^ Core.numInfPlaces E : ℕ)) ^ 𝔰.k * S.mainSecondMoment +
+ (S.b ^ 15)⁻¹ ^ 2 * S.identitySecondMoment) := by
+ have hb : 1 ≤ S.b := S.one_le_b
+ have h_id_nonneg : 0 ≤ S.identitySecondMoment := identitySecondMoment_nonneg
+ let linkBound : ℝ := (S.b ^ (2 * Core.numInfPlaces E) /
+ (S.levelPrime 0 ^ Core.numInfPlaces E : ℕ)) ^ 𝔰.k * S.mainSecondMoment
+ calc _ = secondMoment (S.amplitudeSum .full (S.ratMiddle E).besselSᶜ) Ω :=
+ secondMoment_univ_eq_secondMoment_compl_besselS h_off
+ _ ≤ (√linkBound + (S.b ^ 15)⁻¹ * √S.identitySecondMoment) ^ 2 := by
+ rw [← Real.sqrt_le_left (by positivity)]
+ exact sqrt_secondMoment_compl_besselS_le h_avoid (by positivity)
+ (linkSecondMoment_le_of_le_meetNorm
+ (pow_ne_zero _ (S.levelPrime_prime_and_ne 0).1.ne_zero) h_meet)
+ _ ≤ 2 * (linkBound + (S.b ^ 15)⁻¹ ^ 2 * S.identitySecondMoment) := by
+ grw [add_sq_le, mul_pow, Real.sq_sqrt (by positivity), Real.sq_sqrt h_id_nonneg]
+
/-- Let `E` contain a primitive `5040`-th root of unity and let the filling `S` be admissible
(`IsAdmissible`). Let `D_X = sourceDim` be the number of pairs of a class and a coordinate, and
suppose `‖P_s‖² ≤ 2 D_X` for all `s`. At each of the `f` chosen places `w` above `p₀`, `vectors w`
@@ -243,17 +270,13 @@ lemma secondMoment_fixer_univ_le [HasPrimitiveRoot5040 E] [S.IsAdmissible]
have h_avoid : S.AvoidsScalarCosets Ω := fun ζ h_int _ _ s hs h ↦ hs.2 ⟨⟨ζ, h_int⟩, h⟩
have h_off : ∀ s ∈ Ω, s ∉ S.reducedImage besselS :=
fun s hs h ↦ hs.2 ⟨1, inScalarCoset_one h⟩
- calc _ = secondMoment (S.amplitudeSum .full (S.ratMiddle E).besselSᶜ) Ω := by
- rw [← secondMoment_eq_sum_secondMoment_singleton,
- secondMoment_univ_eq_secondMoment_compl_besselS h_off]
- _ ≤ (√linkBound + (S.b ^ 15)⁻¹ * √S.identitySecondMoment) ^ 2 := by
- rw [← Real.sqrt_le_left (by positivity)]
- exact sqrt_secondMoment_compl_besselS_le h_avoid (by positivity)
- (linkSecondMoment_le_of_le_meetNorm
- (pow_ne_zero _ (S.levelPrime_prime_and_ne 0).1.ne_zero)
- fun s hs ↦ levelPrime_pow_le_meetNorm_of_mem_fixer hs.1)
- _ ≤ 2 * (linkBound + (S.b ^ 15)⁻¹ ^ 2 * S.identitySecondMoment) := by
- grw [add_sq_le, mul_pow, Real.sq_sqrt (by positivity), Real.sq_sqrt h_id_nonneg]
+ have h_non_coset : secondMoment (S.amplitudeSum .full Set.univ) Ω ≤
+ 2 * (linkBound + (S.b ^ 15)⁻¹ ^ 2 * S.identitySecondMoment) :=
+ S.secondMoment_non_coset_le h_avoid h_off
+ fun s hs ↦ levelPrime_pow_le_meetNorm_of_mem_fixer hs.1
+ calc _ = secondMoment (S.amplitudeSum .full Set.univ) Ω :=
+ (secondMoment_eq_sum_secondMoment_singleton _ Ω).symm
+ _ ≤ 2 * (linkBound + (S.b ^ 15)⁻¹ ^ 2 * S.identitySecondMoment) := h_non_coset
_ ≤ target / 2 := by linarith [h_links, h_id]
calc _ = ∑ s : S.ResidueGL with s ∈ S.fixer univ vectors ∧ ∃ ζ : Ô E, S.InScalarCoset ζ s, β s +
∑ s : S.ResidueGL with s ∈ Ω, β s := by