Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.
Python
refactor(New/UpperBound/Seesaw/Sandwich): extract idempotent support step
Rohan Arun80af09c959b1
diff --git a/src/New/UpperBound/Seesaw/Sandwich.lean b/src/New/UpperBound/Seesaw/Sandwich.leanindex 238ebfce5bc..cd41d3ca44f 100644--- a/src/New/UpperBound/Seesaw/Sandwich.lean+++ b/src/New/UpperBound/Seesaw/Sandwich.lean@@ -112,6 +112,21 @@ lemma inclXFin_scalarFin_map_evalAt {Y : Grading V N X s} {z : unitary (𝔸f E)simpa [Matrix.mulVec_single_one, Matrix.col, hz, Pi.single_apply, Matrix.one_apply, hij,eq_comm] using h+/-- For a place `w : FinPlace E` with `star w ≠ w` and an integral unitary adele `z`+that is `1` off `w` and `star w`, `z.val - 1` factors through `idem {w} + idem {star w}`. -/+private lemma sub_one_eq_mul_idem_add_star_idem {E : Type} [Field E] [CMType E]+ {w : FinPlace E} (hw : star w ≠ w) {z : unitary (𝔸f E)}+ (hz_off : ∀ u : FinPlace E, u ≠ w → star u ≠ w → z.val u = 1) :+ z.val - 1 = (z.val - 1) * (idem {w} + idem {star w}) := by+ ext u+ by_cases hu : u = w+ · simp [hu, hw.symm]+ by_cases hu' : u = star w+ · simp [hu', hw]+ -- At a place other than `w` and `w̄` both sides are `0`.+ have h_off : z.val u = 1 := hz_off u hu fun h_eq ↦ hu' (eq_star_of_eq_star h_eq.symm)+ simp [h_off]+/-- Let `x` be a point of the finite adelic unitary group `Gf E ι` whose lattice, spanned by thecolumns of `V.xFin * x`, splits along `X` at a place `w ≠ w̄`: there its projection to `X^⊥` lies inthe lattice. Let `z` be an integral unitary adele that is `1` off `w` and `w̄`. Then the conjugate@@ -125,15 +140,8 @@ lemma LatticeSplitsAt.conj_scalarFin_mem {Y : Grading V N X s} {w : FinPlace E}refine ⟨V.conj_mem_stdLevel_of_mapsTo_lattice fun y hy ↦ ?_, mem_supportedOn.2 fun u hu hu' ↦ ?_⟩· -- The conjugate is integral, as the scaling by `z` maps the lattice of `x` into itself.show V.ratCoordMatrixFin (Y.inclXFin (scalarFin X z)) *ᵥ y ∈ V.lattice x- have h_supp : z.val - 1 = (z.val - 1) * (idem {w} + idem {star w}) := by- ext u- by_cases hu : u = w- · simp [hu, hw.symm]- by_cases hu' : u = star w- · simp [hu', hw]- -- At a place other than `w` and `w̄` both sides are `0`.- have h_off : z.val u = 1 := hz_off u hu fun h_eq ↦ hu' (eq_star_of_eq_star h_eq.symm)- simp [h_off]+ have h_supp : z.val - 1 = (z.val - 1) * (idem {w} + idem {star w}) :=+ sub_one_eq_mul_idem_add_star_idem hw hz_offrw [inclXFin_scalarFin_mulVec, h_supp, mul_smul, add_smul]-- The two components of the part of `y` in `X`, at `w` and at `w̄`, lie in the lattice.exact add_mem hy ((V.lattice x).smul_mem ⟨_, sub_mem hz_int (one_mem _)⟩ (add_mem