Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d57133e

Browse files
committed
refactor(subgroup/basic): use subgroup.subgroup_of as the normal form (#17744)
Update or drop lemmas/defs that used `subgroup.comap (subgroup.subtype _) _`. * Golf some proofs. * Drop `inf_relindex_eq_relindex_sup`, `comap_subtype_self_eq_top`, `comap_subtype_inf_left`, `comap_subtype_inf_right`, `subgroup.normal_inf`. * Swap LHS and RHS of `relindex_eq_relindex_sup`, rename to `relindex_sup_right`, add `relindex_sup_left`. * Use `subgroup_of` instead of `comap (subtype _) _` in - `quotient_inf_equiv_prod_normal_quotient`, - `comap_subtype_equiv_of_le`, rename it to `subgroup_of_equiv_of_le` - `normal_in_normalizer` - `le_normalizer_of_normal` - `comap_subtype_normalizer_eq`, rename to `subgroup_of_normalizer_eq` * Simplify `subgroup.comap (subgroup.subtype _) _` to `subgroup.subgroup_of _ _`. * Add `comap_inclusion_subgroup_of`, `subgroup_of_inj`, `inf_subgroup_of_left`, `inf_subgroup_of_right`, `codisjoint_subgroup_of_sup`, `normal.subgroup_of`, `normal_subgroup_of`. * Mark `subgroup_of_map_subtype` as `simp`.
1 parent 2aa04f6 commit d57133e

File tree

6 files changed

+101
-105
lines changed

6 files changed

+101
-105
lines changed

src/group_theory/index.lean

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ begin
105105
end
106106

107107
@[to_additive] lemma inf_relindex_right : (H ⊓ K).relindex K = H.relindex K :=
108-
begin
109-
rw [←subgroup_of_map_subtype, relindex, relindex, subgroup_of, comap_map_eq_self_of_injective],
110-
exact subtype.coe_injective,
111-
end
108+
by rw [relindex, relindex, inf_subgroup_of_right]
112109

113110
@[to_additive] lemma inf_relindex_left : (H ⊓ K).relindex H = K.relindex H :=
114111
by rw [inf_comm, inf_relindex_right]
@@ -118,24 +115,21 @@ lemma relindex_inf_mul_relindex : H.relindex (K ⊓ L) * K.relindex L = (H ⊓ K
118115
by rw [←inf_relindex_right H (K ⊓ L), ←inf_relindex_right K L, ←inf_relindex_right (H ⊓ K) L,
119116
inf_assoc, relindex_mul_relindex (H ⊓ (K ⊓ L)) (K ⊓ L) L inf_le_right inf_le_right]
120117

121-
@[to_additive]
122-
lemma inf_relindex_eq_relindex_sup [K.normal] : (H K).relindex H = K.relindex (H ⊔ K) :=
123-
cardinal.to_nat_congr (quotient_group.quotient_inf_equiv_prod_normal_quotient H K).to_equiv
118+
@[simp, to_additive]
119+
lemma relindex_sup_right [K.normal] : K.relindex (H K) = K.relindex H :=
120+
nat.card_congr (quotient_group.quotient_inf_equiv_prod_normal_quotient H K).to_equiv.symm
124121

125-
@[to_additive] lemma relindex_eq_relindex_sup [K.normal] : K.relindex H = K.relindex (H ⊔ K) :=
126-
by rw [←inf_relindex_left, inf_relindex_eq_relindex_sup]
122+
@[simp, to_additive]
123+
lemma relindex_sup_left [K.normal] : K.relindex (K ⊔ H) = K.relindex H :=
124+
by rw [sup_comm, relindex_sup_right]
127125

128126
@[to_additive] lemma relindex_dvd_index_of_normal [H.normal] : H.relindex K ∣ H.index :=
129-
(relindex_eq_relindex_sup K H).symm ▸ relindex_dvd_index_of_le le_sup_right
127+
relindex_sup_right K H ▸ relindex_dvd_index_of_le le_sup_right
130128

131129
variables {H K}
132130

133131
@[to_additive] lemma relindex_dvd_of_le_left (hHK : H ≤ K) : K.relindex L ∣ H.relindex L :=
134-
begin
135-
apply dvd_of_mul_left_eq ((H ⊓ L).relindex (K ⊓ L)),
136-
rw [←inf_relindex_right H L, ←inf_relindex_right K L],
137-
exact relindex_mul_relindex (H ⊓ L) (K ⊓ L) L (inf_le_inf_right L hHK) inf_le_right,
138-
end
132+
inf_of_le_left hHK ▸ dvd_of_mul_left_eq _ (relindex_inf_mul_relindex _ _ _)
139133

140134
/-- A subgroup has index two if and only if there exists `a` such that for all `b`, exactly one
141135
of `b * a` and `b` belong to `H`. -/

src/group_theory/p_group.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ lemma to_sup_of_normal_left {H K : subgroup G} (hH : is_p_group p H) (hK : is_p_
289289

290290
lemma to_sup_of_normal_right' {H K : subgroup G} (hH : is_p_group p H) (hK : is_p_group p K)
291291
(hHK : H ≤ K.normalizer) : is_p_group p (H ⊔ K : subgroup G) :=
292-
let hHK' := to_sup_of_normal_right (hH.of_equiv (subgroup.comap_subtype_equiv_of_le hHK).symm)
293-
(hK.of_equiv (subgroup.comap_subtype_equiv_of_le subgroup.le_normalizer).symm) in
292+
let hHK' := to_sup_of_normal_right (hH.of_equiv (subgroup.subgroup_of_equiv_of_le hHK).symm)
293+
(hK.of_equiv (subgroup.subgroup_of_equiv_of_le subgroup.le_normalizer).symm) in
294294
((congr_arg (λ H : subgroup K.normalizer, is_p_group p H)
295295
(subgroup.sup_subgroup_of_eq hHK subgroup.le_normalizer)).mp hHK').of_equiv
296-
(subgroup.comap_subtype_equiv_of_le (sup_le hHK subgroup.le_normalizer))
296+
(subgroup.subgroup_of_equiv_of_le (sup_le hHK subgroup.le_normalizer))
297297

298298
lemma to_sup_of_normal_left' {H K : subgroup G} (hH : is_p_group p H) (hK : is_p_group p K)
299299
(hHK : K ≤ H.normalizer) : is_p_group p (H ⊔ K : subgroup G) :=

src/group_theory/quotient_group.lean

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,7 @@ def quotient_map_subgroup_of_of_le {A' A B' B : subgroup G}
370370
[hAN : (A'.subgroup_of A).normal] [hBN : (B'.subgroup_of B).normal]
371371
(h' : A' ≤ B') (h : A ≤ B) :
372372
A ⧸ (A'.subgroup_of A) →* B ⧸ (B'.subgroup_of B) :=
373-
map _ _ (subgroup.inclusion h) $
374-
by simp [subgroup.subgroup_of, subgroup.comap_comap]; exact subgroup.comap_mono h'
373+
map _ _ (subgroup.inclusion h) $ subgroup.comap_mono h'
375374

376375
@[simp, to_additive]
377376
lemma quotient_map_subgroup_of_of_le_coe {A' A B' B : subgroup G}
@@ -465,10 +464,10 @@ open _root_.subgroup
465464
@[to_additive "The second isomorphism theorem: given two subgroups `H` and `N` of a group `G`,
466465
where `N` is normal, defines an isomorphism between `H/(H ∩ N)` and `(H + N)/N`"]
467466
noncomputable def quotient_inf_equiv_prod_normal_quotient (H N : subgroup G) [N.normal] :
468-
H ⧸ ((H ⊓ N).comap H.subtype) ≃* _ ⧸ (N.comap (H ⊔ N).subtype) :=
467+
H ⧸ (N.subgroup_of H) ≃* _ ⧸ (N.subgroup_of (H ⊔ N)) :=
469468
/- φ is the natural homomorphism H →* (HN)/N. -/
470-
let φ : H →* _ ⧸ (N.comap (H ⊔ N).subtype) :=
471-
(mk' $ N.comap (H ⊔ N).subtype).comp (inclusion le_sup_left) in
469+
let φ : H →* _ ⧸ (N.subgroup_of (H ⊔ N)) :=
470+
(mk' $ N.subgroup_of (H ⊔ N)).comp (inclusion le_sup_left) in
472471
have φ_surjective : function.surjective φ := λ x, x.induction_on' $
473472
begin
474473
rintro ⟨y, (hy : y ∈ ↑(H ⊔ N))⟩, rw mul_normal H N at hy,
@@ -479,7 +478,7 @@ have φ_surjective : function.surjective φ := λ x, x.induction_on' $
479478
change h⁻¹ * (h * n) ∈ N,
480479
rwa [←mul_assoc, inv_mul_self, one_mul],
481480
end,
482-
(quotient_mul_equiv_of_eq (by simp [comap_comap, ←comap_ker])).trans
481+
(quotient_mul_equiv_of_eq (by simp [comap_ker])).trans
483482
(quotient_ker_equiv_of_surjective φ φ_surjective)
484483

485484
end snd_isomorphism_thm

src/group_theory/schur_zassenhaus.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ begin
151151
contrapose! h3,
152152
have h4 : (N.comap K.subtype).index = N.index,
153153
{ rw [←N.relindex_top_right, ←hK],
154-
exact relindex_eq_relindex_sup K N },
154+
exact (relindex_sup_right K N).symm },
155155
have h5 : fintype.card K < fintype.card G,
156156
{ rw ← K.index_mul_card,
157157
exact lt_mul_of_one_lt_left fintype.card_pos (one_lt_index_of_ne_top h3) },

src/group_theory/subgroup/basic.lean

Lines changed: 55 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ set.inclusion_injective h
618618
@[simp, to_additive]
619619
lemma subtype_comp_inclusion {H K : subgroup G} (hH : H ≤ K) :
620620
K.subtype.comp (inclusion hH) = H.subtype :=
621-
by { ext, simp }
621+
rfl
622622

623623
/-- The subgroup `G` of the group `G`. -/
624624
@[to_additive "The `add_subgroup G` of the `add_group G`."]
@@ -1192,30 +1192,27 @@ by {rw eq_top_iff, intros x hx, obtain ⟨y, hy⟩ := (h x), exact ⟨y, trivial
11921192
@[simp, to_additive] lemma comap_top (f : G →* N) : (⊤ : subgroup N).comap f = ⊤ :=
11931193
(gc_map_comap f).u_top
11941194

1195-
@[simp, to_additive] lemma comap_subtype_self_eq_top {G : Type*} [group G] {H : subgroup G} :
1196-
comap H.subtype H = ⊤ := by { ext, simp }
1197-
1198-
@[simp, to_additive]
1199-
lemma comap_subtype_inf_left {H K : subgroup G} : comap H.subtype (H ⊓ K) = comap H.subtype K :=
1200-
ext $ λ x, and_iff_right_of_imp (λ _, x.prop)
1201-
1202-
@[simp, to_additive]
1203-
lemma comap_subtype_inf_right {H K : subgroup G} : comap K.subtype (H ⊓ K) = comap K.subtype H :=
1204-
ext $ λ x, and_iff_left_of_imp (λ _, x.prop)
1195+
/-- For any subgroups `H` and `K`, view `H ⊓ K` as a subgroup of `K`. -/
1196+
@[to_additive "For any subgroups `H` and `K`, view `H ⊓ K` as a subgroup of `K`."]
1197+
def subgroup_of (H K : subgroup G) : subgroup K := H.comap K.subtype
12051198

12061199
/-- If `H ≤ K`, then `H` as a subgroup of `K` is isomorphic to `H`. -/
12071200
@[to_additive "If `H ≤ K`, then `H` as a subgroup of `K` is isomorphic to `H`.", simps]
1208-
def comap_subtype_equiv_of_le {G : Type*} [group G] {H K : subgroup G} (h : H ≤ K) :
1209-
H.comap K.subtype ≃* H :=
1201+
def subgroup_of_equiv_of_le {G : Type*} [group G] {H K : subgroup G} (h : H ≤ K) :
1202+
H.subgroup_of K ≃* H :=
12101203
{ to_fun := λ g, ⟨g.1, g.2⟩,
12111204
inv_fun := λ g, ⟨⟨g.1, h g.2⟩, g.2⟩,
12121205
left_inv := λ g, subtype.ext (subtype.ext rfl),
12131206
right_inv := λ g, subtype.ext rfl,
12141207
map_mul' := λ g h, rfl }
12151208

1216-
/-- For any subgroups `H` and `K`, view `H ⊓ K` as a subgroup of `K`. -/
1217-
@[to_additive "For any subgroups `H` and `K`, view `H ⊓ K` as a subgroup of `K`."]
1218-
def subgroup_of (H K : subgroup G) : subgroup K := H.comap K.subtype
1209+
@[simp, to_additive]
1210+
lemma comap_subtype (H K : subgroup G) : H.comap K.subtype = H.subgroup_of K := rfl
1211+
1212+
@[simp, to_additive]
1213+
lemma comap_inclusion_subgroup_of {K₁ K₂ : subgroup G} (h : K₁ ≤ K₂) (H : subgroup G) :
1214+
(H.subgroup_of K₂).comap (inclusion h) = H.subgroup_of K₁ :=
1215+
rfl
12191216

12201217
@[to_additive] lemma coe_subgroup_of (H K : subgroup G) :
12211218
(H.subgroup_of K : set K) = K.subtype ⁻¹' H := rfl
@@ -1224,13 +1221,9 @@ def subgroup_of (H K : subgroup G) : subgroup K := H.comap K.subtype
12241221
h ∈ H.subgroup_of K ↔ (h : G) ∈ H :=
12251222
iff.rfl
12261223

1227-
@[to_additive] lemma subgroup_of_map_subtype (H K : subgroup G) :
1228-
(H.subgroup_of K).map K.subtype = H ⊓ K := set_like.ext'
1229-
begin
1230-
convert set.image_preimage_eq_inter_range,
1231-
simp only [subtype.range_coe_subtype, coe_subtype, coe_inf],
1232-
refl,
1233-
end
1224+
@[simp, to_additive] lemma subgroup_of_map_subtype (H K : subgroup G) :
1225+
(H.subgroup_of K).map K.subtype = H ⊓ K :=
1226+
set_like.ext' $ subtype.image_preimage_coe _ _
12341227

12351228
@[simp, to_additive] lemma bot_subgroup_of : (⊥ : subgroup G).subgroup_of H = ⊥ :=
12361229
eq.symm (subgroup.ext (λ g, subtype.ext_iff))
@@ -1244,8 +1237,26 @@ subsingleton.elim _ _
12441237
@[to_additive] lemma subgroup_of_bot_eq_top : H.subgroup_of ⊥ = ⊤ :=
12451238
subsingleton.elim _ _
12461239

1247-
@[simp, to_additive] lemma subgroup_of_self : H.subgroup_of H = ⊤ :=
1248-
top_le_iff.mp (λ g hg, g.2)
1240+
@[simp, to_additive] lemma subgroup_of_self : H.subgroup_of H = ⊤ := top_unique (λ g hg, g.2)
1241+
1242+
@[simp, to_additive] lemma subgroup_of_inj {H₁ H₂ K : subgroup G} :
1243+
H₁.subgroup_of K = H₂.subgroup_of K ↔ H₁ ⊓ K = H₂ ⊓ K :=
1244+
by simpa only [set_like.ext_iff, mem_inf, mem_subgroup_of, and.congr_left_iff] using subtype.forall
1245+
1246+
@[simp, to_additive] lemma inf_subgroup_of_right (H K : subgroup G) :
1247+
(H ⊓ K).subgroup_of K = H.subgroup_of K :=
1248+
subgroup_of_inj.2 inf_right_idem
1249+
1250+
@[simp, to_additive] lemma inf_subgroup_of_left (H K : subgroup G) :
1251+
(K ⊓ H).subgroup_of K = H.subgroup_of K :=
1252+
by rw [inf_comm, inf_subgroup_of_right]
1253+
1254+
@[simp, to_additive] lemma subgroup_of_eq_bot {H K : subgroup G} :
1255+
H.subgroup_of K = ⊥ ↔ disjoint H K :=
1256+
by rw [disjoint_iff, ← bot_subgroup_of, subgroup_of_inj, bot_inf_eq]
1257+
1258+
@[simp, to_additive] lemma subgroup_of_eq_top {H K : subgroup G} : H.subgroup_of K = ⊤ ↔ K ≤ H :=
1259+
by rw [← top_subgroup_of, subgroup_of_inj, top_inf_eq, inf_eq_right]
12491260

12501261
/-- Given `subgroup`s `H`, `K` of groups `G`, `N` respectively, `H × K` as a subgroup of `G × N`. -/
12511262
@[to_additive prod "Given `add_subgroup`s `H`, `K` of `add_group`s `A`, `B` respectively, `H × K`
@@ -1645,7 +1656,7 @@ by rw [←inv_mem_iff, mem_normalizer_iff, inv_inv]
16451656
λ x xH n, by rw [H.mul_mem_cancel_right (H.inv_mem xH), H.mul_mem_cancel_left xH]
16461657

16471658
@[priority 100, to_additive]
1648-
instance normal_in_normalizer : (H.comap H.normalizer.subtype).normal :=
1659+
instance normal_in_normalizer : (H.subgroup_of H.normalizer).normal :=
16491660
⟨λ x xH g, by simpa using (g.2 x).1 xH⟩
16501661

16511662
@[to_additive] lemma normalizer_eq_top : H.normalizer = ⊤ ↔ H.normal :=
@@ -1658,9 +1669,9 @@ eq_top_iff.trans ⟨λ h, ⟨λ a ha b, (h (mem_top b) a).mp ha⟩, λ h a ha b,
16581669
open_locale classical
16591670

16601671
@[to_additive]
1661-
lemma le_normalizer_of_normal [hK : (H.comap K.subtype).normal] (HK : H ≤ K) : K ≤ H.normalizer :=
1672+
lemma le_normalizer_of_normal [hK : (H.subgroup_of K).normal] (HK : H ≤ K) : K ≤ H.normalizer :=
16621673
λ x hx y, ⟨λ yH, hK.conj_mem ⟨y, HK yH⟩ yH ⟨x, hx⟩,
1663-
λ yH, by simpa [mem_comap, mul_assoc] using
1674+
λ yH, by simpa [mem_subgroup_of, mul_assoc] using
16641675
hK.conj_mem ⟨x * y * x⁻¹, HK yH⟩ yH ⟨x⁻¹, K.inv_mem hx⟩⟩
16651676

16661677
variables {N : Type*} [group N]
@@ -2076,9 +2087,7 @@ such that `f x = 0`"]
20762087
def ker (f : G →* M) : subgroup G :=
20772088
{ inv_mem' := λ x (hx : f x = 1),
20782089
calc f x⁻¹ = f x * f x⁻¹ : by rw [hx, one_mul]
2079-
... = f (x * x⁻¹) : by rw [f.map_mul]
2080-
... = f 1 : by rw [mul_right_inv]
2081-
... = 1 : f.map_one,
2090+
... = 1 : by rw [← map_mul, mul_inv_self, map_one],
20822091
..f.mker }
20832092

20842093
@[to_additive]
@@ -2340,13 +2349,6 @@ begin
23402349
rwa [comap_map_eq, comap_map_eq, sup_of_le_left hH, sup_of_le_left hK] at hf,
23412350
end
23422351

2343-
@[to_additive] lemma subgroup_of_eq_bot {H K : subgroup G} : H.subgroup_of K = ⊥ ↔ disjoint H K :=
2344-
by rw [←(map_injective K.subtype_injective).eq_iff, subgroup_of_map_subtype, map_bot, disjoint_iff]
2345-
2346-
@[to_additive] lemma subgroup_of_eq_top {H K : subgroup G} : H.subgroup_of K = ⊤ ↔ K ≤ H :=
2347-
by rw [←(map_injective K.subtype_injective).eq_iff, subgroup_of_map_subtype,
2348-
←K.subtype.range_eq_map, K.subtype_range, inf_eq_right]
2349-
23502352
@[to_additive] lemma closure_preimage_eq_top (s : set G) :
23512353
closure ((closure s).subtype ⁻¹' s) = ⊤ :=
23522354
begin
@@ -2371,8 +2373,11 @@ comap_sup_eq_of_le_range f (le_top.trans (ge_of_eq (f.range_top_of_surjective hf
23712373

23722374
@[to_additive] lemma sup_subgroup_of_eq {H K L : subgroup G} (hH : H ≤ L) (hK : K ≤ L) :
23732375
H.subgroup_of L ⊔ K.subgroup_of L = (H ⊔ K).subgroup_of L :=
2374-
comap_sup_eq_of_le_range L.subtype (hH.trans (ge_of_eq L.subtype_range))
2375-
(hK.trans (ge_of_eq L.subtype_range))
2376+
comap_sup_eq_of_le_range L.subtype (hH.trans L.subtype_range.ge) (hK.trans L.subtype_range.ge)
2377+
2378+
@[to_additive] lemma codisjoint_subgroup_of_sup (H K : subgroup G) :
2379+
codisjoint (H.subgroup_of (H ⊔ K)) (K.subgroup_of (H ⊔ K)) :=
2380+
by { rw [codisjoint_iff, sup_subgroup_of_eq, subgroup_of_self], exacts [le_sup_left, le_sup_right] }
23762381

23772382
/-- A subgroup is isomorphic to its image under an injective function -/
23782383
@[to_additive "An additive subgroup is isomorphic to its image under an injective function"]
@@ -2415,8 +2420,8 @@ begin
24152420
end
24162421

24172422
@[to_additive]
2418-
lemma comap_subtype_normalizer_eq {H N : subgroup G} (h : H.normalizer ≤ N) :
2419-
comap N.subtype H.normalizer = (comap N.subtype H).normalizer :=
2423+
lemma subgroup_of_normalizer_eq {H N : subgroup G} (h : H.normalizer ≤ N) :
2424+
H.normalizer.subgroup_of N = (H.subgroup_of N).normalizer :=
24202425
begin
24212426
apply comap_normalizer_eq_of_injective_of_le_range,
24222427
exact subtype.coe_injective,
@@ -2569,14 +2574,15 @@ lemma subgroup.normal.comap {H : subgroup N} (hH : H.normal) (f : G →* N) :
25692574
instance subgroup.normal_comap {H : subgroup N}
25702575
[nH : H.normal] (f : G →* N) : (H.comap f).normal := nH.comap _
25712576

2577+
-- Here `H.normal` is an explicit argument so we can use dot notation with `subgroup_of`.
2578+
@[to_additive]
2579+
lemma subgroup.normal.subgroup_of {H : subgroup G} (hH : H.normal) (K : subgroup G) :
2580+
(H.subgroup_of K).normal :=
2581+
hH.comap _
2582+
25722583
@[priority 100, to_additive]
2573-
instance subgroup.normal_inf (H N : subgroup G) [hN : N.normal] :
2574-
((H ⊓ N).comap H.subtype).normal :=
2575-
⟨λ x hx g, begin
2576-
simp only [subgroup.mem_inf, coe_subtype, subgroup.mem_comap] at hx,
2577-
simp only [subgroup.coe_mul, subgroup.mem_inf, coe_subtype, subgroup.coe_inv, subgroup.mem_comap],
2578-
exact ⟨H.mul_mem (H.mul_mem g.2 hx.1) (H.inv_mem g.2), hN.1 x hx.2 g⟩,
2579-
end
2584+
instance subgroup.normal_subgroup_of {H N : subgroup G} [N.normal] : (N.subgroup_of H).normal :=
2585+
subgroup.normal_comap _
25802586

25812587
namespace subgroup
25822588

0 commit comments

Comments
 (0)