Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
refactor(Lib/Weil/Periods/LatticeBounds): extract modular lattice recovery helper
Rohan Arund1cd42cf57f6
diff --git a/src/Lib/Weil/Periods/LatticeBounds.lean b/src/Lib/Weil/Periods/LatticeBounds.leanindex d2f54093fc5..b3b44afc423 100644--- a/src/Lib/Weil/Periods/LatticeBounds.lean+++ b/src/Lib/Weil/Periods/LatticeBounds.lean@@ -115,6 +115,21 @@ namespace Gradingvariable {Y : Grading V N X s}variable (Y) in+/-- For `x` satisfying `Y.HasLatticeBounds q.val k x` with `q` invertible, intersecting+the preimage of `(Y.latticeMinus x).map U.mkQ` under `U.mkQ` with `Y.stringProj.range`+recovers `Y.latticeMinus x` by the modular law. -/+private lemma latticeMinus_recover_of_hasLatticeBounds+ (q : (𝔸f E)ˣ) (k : ℕ)+ (U : Submodule (Ô E) (ι → 𝔸f E))+ (h_inter : U ⊓ (Y.stringProj.range.restrictScalars (Ô E)) ≤+ star q.val ^ k • Y.latticeMinus 1)+ {x : Gf E ι} (hx : Y.HasLatticeBounds q.val k x) :+ ((Y.latticeMinus x).map U.mkQ).comap U.mkQ ⊓+ (Y.stringProj.range.restrictScalars (Ô E)) = Y.latticeMinus x := by+ have h_le : Y.latticeMinus x ≤ Y.stringProj.range.restrictScalars (Ô E) := inf_le_right+ rw [Submodule.comap_map_mkQ, sup_comm, sup_inf_assoc_of_le U h_le,+ sup_eq_left.2 (h_inter.trans hx.lower)]+/-- For an invertible finite adele `q`, the points `x` of the finite adelic unitary group with thebounds `q̄ ^ k Λ⁻ ⊆ Λ'⁻`, `q ^ k Λ'⁻ ⊆ Λ⁻` give only finitely many intersections `Λ'⁻` of theirlattice with `X^⊥`. Here `Λ⁻` is the intersection for `x = 1`. -/@@ -133,12 +148,9 @@ lemma finite_image_latticeMinus (q : (𝔸f E)ˣ) (k : ℕ) :rintro _ ⟨⟨u, hu, rfl⟩, z, hz : Y.stringProj z = star q.val ^ k • u⟩exact Submodule.smul_mem_pointwise_smul u _ _ (mem_latticeMinus.2 ⟨hu,(q.isUnit.star.pow k).smul_left_cancel.1 <| by rw [← map_smul, ← hz, stringProj_stringProj]⟩)- -- By the modular law `(Λ'⁻ + U) ∩ X^⊥ = Λ'⁻ + (U ∩ X^⊥) = Λ'⁻`.have h_recover {x : Gf E ι} (hx : Y.HasLatticeBounds q.val k x) :- ((Y.latticeMinus x).map U.mkQ).comap U.mkQ ⊓ P = Y.latticeMinus x := by- have h_le : Y.latticeMinus x ≤ P := inf_le_right- rw [Submodule.comap_map_mkQ, sup_comm, sup_inf_assoc_of_le U h_le,- sup_eq_left.2 (h_inter.trans hx.lower)]+ ((Y.latticeMinus x).map U.mkQ).comap U.mkQ ⊓ P = Y.latticeMinus x :=+ Y.latticeMinus_recover_of_hasLatticeBounds q k U h_inter hxrefine Set.Finite.of_injOn (f := fun L : Submodule (Ô E) (ι → 𝔸f E) ↦ U.mkQ '' L) ?_ ?_h_finite.finite_subsets· rintro _ ⟨x, hx : Y.HasLatticeBounds q.val k x, rfl⟩