Skip to content

Commit 8205572

Browse files
committed
refactor(NumberTheory): golf Mathlib/NumberTheory/ModularForms/CongruenceSubgroups (#39373)
- simplifies `Gamma_mem` to a single `simp` proof via `Gamma_mem'` and `SpecialLinearGroup.ext_iff` - shortens `ModularGroup_T_pow_mem_Gamma` and the `Gamma0` closure proofs with direct `simp`/`simpa` arguments Extracted from #38144 [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
1 parent 55a83a2 commit 8205572

1 file changed

Lines changed: 6 additions & 26 deletions

File tree

Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,7 @@ theorem Gamma_mem' {N} {γ : SL(2, ℤ)} : γ ∈ Gamma N ↔ SLMOD(N) γ = 1 :=
4949
@[simp]
5050
theorem Gamma_mem {N} {γ : SL(2, ℤ)} : γ ∈ Gamma N ↔ (γ 0 0 : ZMod N) = 1
5151
0 1 : ZMod N) = 0 ∧ (γ 1 0 : ZMod N) = 0 ∧ (γ 1 1 : ZMod N) = 1 := by
52-
rw [Gamma_mem']
53-
constructor
54-
· intro h
55-
simp [← SL_reduction_mod_hom_val N γ, h]
56-
· intro h
57-
ext i j
58-
rw [SL_reduction_mod_hom_val N γ]
59-
fin_cases i <;> fin_cases j <;> simp only
60-
exacts [h.1, h.2.1, h.2.2.1, h.2.2.2]
52+
simp [Gamma_mem', SpecialLinearGroup.ext_iff, and_assoc]
6153

6254
theorem Gamma_normal : Subgroup.Normal (Gamma N) :=
6355
SLMOD(N).normal_ker
@@ -77,11 +69,7 @@ theorem Gamma_zero_bot : Gamma 0 = ⊥ := rfl
7769

7870
lemma ModularGroup_T_pow_mem_Gamma (N M : ℤ) (hNM : N ∣ M) :
7971
(ModularGroup.T ^ M) ∈ Gamma (Int.natAbs N) := by
80-
simp only [Gamma_mem, Fin.isValue, ModularGroup.coe_T_zpow, of_apply, cons_val', cons_val_zero,
81-
empty_val', cons_val_fin_one, Int.cast_one, cons_val_one,
82-
Int.cast_zero, and_self, and_true, true_and]
83-
refine Iff.mpr (ZMod.intCast_zmod_eq_zero_iff_dvd M (Int.natAbs N)) ?_
84-
simp only [Int.natCast_natAbs, abs_dvd, hNM]
72+
simp [ModularGroup.coe_T_zpow, hNM, ZMod.intCast_zmod_eq_zero_iff_dvd]
8573

8674
instance instFiniteIndexGamma [NeZero N] : (Gamma N).FiniteIndex := Subgroup.finiteIndex_ker _
8775

@@ -90,20 +78,12 @@ modulo `N`. -/
9078
def Gamma0 : Subgroup SL(2, ℤ) where
9179
carrier := { g | (g 1 0 : ZMod N) = 0 }
9280
one_mem' := by simp
93-
mul_mem' := by
94-
intro a b ha hb
95-
simp only [Set.mem_setOf_eq]
81+
mul_mem' {a} {b} ha hb := by
9682
have h := (Matrix.two_mul_expl a.1 b.1).2.2.1
9783
simp only [coe_mul, Set.mem_setOf_eq] at *
98-
rw [h]
99-
simp [ha, hb]
100-
inv_mem' := by
101-
intro a ha
102-
simp only [Set.mem_setOf_eq]
103-
rw [SL2_inv_expl a]
104-
simp only [cons_val_zero, cons_val_one,
105-
Int.cast_neg, neg_eq_zero, Set.mem_setOf_eq] at *
106-
exact ha
84+
simp [h, ha, hb]
85+
inv_mem' {a} ha := by
86+
simpa [SL2_inv_expl a] using ha
10787

10888
@[simp]
10989
theorem Gamma0_mem {N} {A : SL(2, ℤ)} : A ∈ Gamma0 N ↔ (A 1 0 : ZMod N) = 0 :=

0 commit comments

Comments
 (0)