Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
refactor(Lib/Shimura/ThetaNormality/RiemannRelation): extract dual-lattice permutation helper
Rohan Aruna29c496fb27e
diff --git a/src/Lib/Shimura/ThetaNormality/RiemannRelation.lean b/src/Lib/Shimura/ThetaNormality/RiemannRelation.leanindex 39e9db21996..1179bd22069 100644--- a/src/Lib/Shimura/ThetaNormality/RiemannRelation.lean+++ b/src/Lib/Shimura/ThetaNormality/RiemannRelation.lean@@ -274,6 +274,27 @@ private lemma thetaShift_neg_mul_thetaShift_thetaProduct {p : K → 𝓞 E ×simp [ht, ht', field, sub_eq_add_neg, ← smul_neg, periodPoint, canonicalMultiplier, exp_neg,thetaProduct, h_neg_s, h_multiplier_sq]+/-- Adding any dual-lattice element `u` to the torsion lifts `x.torsionLift s` permutes them+modulo `x.latticeOver D.rTorsion` via `Equiv.addLeft`. -/+private lemma torsionLift_permutes_mod_latticeOver [Fintype D.dualTorsion]+ (h_dual :+ (D.paddedNorm • x.automorphyForm).dualLattice (L := x.latticeOver D.rTorsion) =+ x.latticeOver D.dualTorsion)+ (u :+ (D.paddedNorm • x.automorphyForm).dualLattice (L := x.latticeOver D.rTorsion)) :+ ∃ e : D.dualTorsion ≃ D.dualTorsion, ∀ s : D.dualTorsion,+ ↑(u ++ (⟨x.torsionLift s, h_dual.ge (x.torsionLift_mem_latticeOver s)⟩ :+ (D.paddedNorm • x.automorphyForm).dualLattice (L := x.latticeOver D.rTorsion)) -+ (⟨x.torsionLift (e s), h_dual.ge (x.torsionLift_mem_latticeOver (e s))⟩ :+ (D.paddedNorm • x.automorphyForm).dualLattice (L := x.latticeOver D.rTorsion))) ∈+ x.latticeOver D.rTorsion := by+ obtain ⟨y, hy, hyu⟩ := h_dual.le u.property+ use .addLeft ⟨_, hy⟩+ have h_class_zero (a : AdelicTorsion E D.Index) :+ frameTorsionClass g (y + ratLift g a - ratLift g (frameTorsionClass g y + a)) = 0 := by simp+ simp [← hyu, ← map_add, ← map_sub, torsionLift, h_class_zero]+/-- Riemann's theta relation in one variable. Here x is a theta torus on V for the PEL datum `D`.T = `D.dualTorsion` is the finite group of classes pairing trivially with all integral vectors, r =`D.paddedNorm` ≥ 3, and T[r] = `D.rTorsion` is the r-torsion of T. For a tuple p = (a, b) with@@ -309,16 +330,11 @@ lemma riemann_relation {p : K → 𝓞 E × 𝓞 E} (hp : IsRiemannTuple p D)let pt (s : D.dualTorsion) : (D.paddedNorm • x.automorphyForm).dualLattice(L := x.latticeOver D.rTorsion) :=⟨x.torsionLift s, h_dual.ge (x.torsionLift_mem_latticeOver s)⟩- -- Adding `u` permutes the lifts `pt s` modulo `x.latticeOver D.rTorsion`: `u` is the image of a- -- rational vector `y`, and `s` goes to the class of `y` plus `s`.+ -- Adding `u` permutes the lifts `pt s` modulo `x.latticeOver D.rTorsion`.have h_perm (u : (D.paddedNorm • x.automorphyForm).dualLattice (L := x.latticeOver D.rTorsion)) :∃ e : D.dualTorsion ≃ D.dualTorsion, ∀ s : D.dualTorsion,- ↑(u + pt s - pt (e s)) ∈ x.latticeOver D.rTorsion := by- obtain ⟨y, hy, hyu⟩ := h_dual.le u.property- use .addLeft ⟨_, hy⟩- have h_class_zero (a : AdelicTorsion E D.Index) :- frameTorsionClass g (y + ratLift g a - ratLift g (frameTorsionClass g y + a)) = 0 := by simp- simp [pt, ← hyu, ← map_add, ← map_sub, torsionLift, h_class_zero]+ ↑(u + pt s - pt (e s)) ∈ x.latticeOver D.rTorsion :=+ x.torsionLift_permutes_mod_latticeOver h_dual u-- The Appell–Humbert datum of degree `r` for which both products are theta functions.have h_datum : IsAppellHumbert (L := x.latticeOver D.rTorsion) (D.paddedNorm • x.automorphyForm)fun l ↦ (x.multiplier ^ D.paddedNorm) l * x.automorphyForm.riemannPhase l (x.torsionLift t) :=