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): add HasPrimitiveRoot5040 binder and refine docstring

Rohan Arun90683660e67d
diff --git a/src/New/Spanning/Unfolding/MomentBounds.lean b/src/New/Spanning/Unfolding/MomentBounds.lean
index 511ca8887f3..85083733999 100644
--- a/src/New/Spanning/Unfolding/MomentBounds.lean
+++ b/src/New/Spanning/Unfolding/MomentBounds.lean
@@ -205,32 +205,37 @@ 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]
+/-- Bound `secondMoment` over a subset `Ω` of `S.ResidueGL` disjoint from scalar cosets
+and `reducedImage besselS` by twice `(b^(2f) / p₀^f)^k · 𝒟_main` plus `b^(-30)` times the
+identity contribution. -/
+private lemma secondMoment_non_coset_le [HasPrimitiveRoot5040 E] [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) :
+ (S.levelPrime 0 ^ Core.numInfPlaces E : ℕ) ≤ S.meetNorm 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 hb_pos : 0 < S.b := zero_lt_one.trans_le hb
have h_id_nonneg : 0 ≤ S.identitySecondMoment := identitySecondMoment_nonneg
+ have h_main_nonneg : 0 ≤ S.mainSecondMoment := mainSecondMoment_nonneg
let linkBound : ℝ := (S.b ^ (2 * Core.numInfPlaces E) /
(S.levelPrime 0 ^ Core.numInfPlaces E : ℕ)) ^ 𝔰.k * S.mainSecondMoment
+ have h_link_nonneg : 0 ≤ linkBound := by
+ dsimp [linkBound]
+ positivity
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)
+ exact sqrt_secondMoment_compl_besselS_le h_avoid h_link_nonneg
(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]
+ grw [add_sq_le, mul_pow, Real.sq_sqrt h_link_nonneg, 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