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(Lib/GaloisRep/WeightCongruence): remove two seals by erasing map_inv from two simp calls

roy777a00207a11c
diff --git a/src/Lib/GaloisRep/WeightCongruence.lean b/src/Lib/GaloisRep/WeightCongruence.lean
index 0eeef038a5c..ce206daa805 100644
--- a/src/Lib/GaloisRep/WeightCongruence.lean
+++ b/src/Lib/GaloisRep/WeightCongruence.lean
@@ -412,8 +412,6 @@ lemma InducesPlacePair.atPlace_eq_one {v : InfinitePlace E} {g : Gf E (Fin N)}
· rwa [h_eq, Gf.atPlace_star_eq_one_iff] at h_at
· rwa [h_eq] at h_at
--- Keeps definitional checks from unfolding the finite sums.
-seal Finset.univ in
/-- For a place `w` distinct from its conjugate and an index `j` there are a scalar `a ≠ 0`, with
(a) `a = -1` when `w` does not contain `l`, and a linear operator `T` on `l`-adic functions such
that: (b) `T` does not increase sup norms; (c) `T F = (a * ιℓ (P.coeff j)) • F` for the model
@@ -477,8 +475,10 @@ lemma GaloisRep.exists_padicModel_hecke_contraction (j : ℕ) :
(z : Gf E (Fin N) × WeylIndex (Fin N) κ.1) :
∑ b, Y (some (U, z.2, b)) * F (z.1 * γ U, b) =
padicModel κ κ' M (rightRegular ℂ _ _ (γ U) f) z := by
- -- elaborator: the two sides match only up to unfolding after `simp`, hence `using!`
- simpa [F, padicModel, ← mulVec_mulVec] using! congrFun (congrArg (· *ᵥ _) (hM _)) _
+ -- elaborator: the two sides match only up to unfolding after `simp`, hence `using!`.
+ -- `map_inv` cannot rewrite `weylRep _ _ (padicComponents _)⁻¹`: matrices are not a
+ -- `DivisionMonoid`.
+ simpa [F, padicModel, ← mulVec_mulVec, -map_inv] using! congrFun (congrArg (· *ᵥ _) (hM _)) _
-- `heckeGL_eq_sum` writes the Hecke operator applied to `f` as the sum of these translates.
have h_hecke : T₀ F = ιℓ (t (N - j)) • F := funext fun z ↦ by
simpa [T₀, h_term, heckeSplit, heckeGL_eq_sum ((mem_sphericalAt_iff _).mp h_sph)] using
@@ -550,8 +550,6 @@ private lemma padicComponents_apply_mem_iSup_adjoin (T : Set (InfinitePlace E))
(exists_placeOfEmb_extension (weightEmbedding ιℓ.toRingHom τ.val)).choose_spec
exact mem_of_le_of_mem (le_iSup _ τ) (h_image _)
--- Keeps definitional checks from unfolding the finite sums.
-seal Finset.univ in
/-- Let `K` be an open subgroup of `New.stdLevel`, `θ` a character of `K` trivial near `1`, `T` a
set of infinite places and `f` a form of weight `κ` fixed by every `d ∈ K` whose components
(`New.padicComponents`) over `T` are `1`, with `θ d = 1` for these `d`. Suppose the span of `D`
@@ -657,12 +655,14 @@ lemma padicModel_mem_uniformClosure {K : Subgroup (Gf E (Fin N))} (hK : IsLevel
-- Both sides are sums over `s c g` (the model of `φ` by the definition of `deltaForm`); compare
-- term by term.
ext
- refine (map_sum (.proj _ ∘ₛₗ padicModel _ ν M ∘ₛₗ .const ∘ₛₗ .applyₗ _) ..).trans
- ((sum_coe_sort ..).symm.trans (Finset.sum_congr rfl fun γ _ ↦ ?_))
+ refine (map_sum (.proj _ ∘ₛₗ padicModel _ ν M ∘ₛₗ .const ∘ₛₗ .applyₗ _) ..).trans ?_
+ refine (sum_coe_sort ..).symm.trans (Finset.sum_congr rfl fun γ _ ↦ ?_)
rw [dite_eq_left (q _ _ γ).property]
-- First move the action of `γ` into `weylRep`, then multiply out the Kronecker products.
+ -- `map_inv` cannot rewrite `weylRep _ _ (padicComponents _)⁻¹`: matrices are not a
+ -- `DivisionMonoid`.
simp [padicModel, Function.comp_def _ (_ ∘ _), comp_weightRep_eq_weylRep_mulVec ν, ← map_mul,
- -mulVec_single, ← (weylRep _ _ _).mul_assoc, M.mul_assoc]
+ -mulVec_single, ← (weylRep _ _ _).mul_assoc, M.mul_assoc, -map_inv]
simp [M, ν, e, z, *, ← Pi.one_def, -mulVec_mulVec, mul_assoc, q, R, vecMulVec_mulVec,
← replicateCol_mulVec, ← mul_kronecker_mul, Matrix.one_apply]
split <;> ring