Skip to content

Commit 1d47ab6

Browse files
SnirBroshiBergschaf
authored andcommitted
chore(GroupTheory/SpecificGroups/Cyclic): use IsMulCommutative in commutative_of_cyclic_center_quotient (leanprover-community#39861)
and specialize to `IsCyclic (G ⧸ Subgroup.center G)` as the name suggests.
1 parent 355581f commit 1d47ab6

2 files changed

Lines changed: 35 additions & 10 deletions

File tree

Mathlib/GroupTheory/PGroup.lean

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,22 @@ theorem cyclic_center_quotient_of_card_eq_prime_sq (hG : Nat.card G = p ^ 2) :
364364
rw [hk]
365365
exact dvd_pow_self p hk0.ne'
366366

367+
/-- A group of order `p ^ 2` is commutative. See also `IsPGroup.commGroupOfCardEqPrimeSq`
368+
for the `CommGroup` instance. -/
369+
theorem isMulCommutative_of_card_eq_prime_sq (hG : Nat.card G = p ^ 2) : IsMulCommutative G :=
370+
let := cyclic_center_quotient_of_card_eq_prime_sq hG
371+
isMulCommutative_of_isCyclic_quotient_center_self G
372+
367373
/-- A group of order `p ^ 2` is commutative. See also `IsPGroup.commutative_of_card_eq_prime_sq`
368374
for just the proof that `∀ a b, a * b = b * a` -/
369375
@[implicit_reducible]
370376
def commGroupOfCardEqPrimeSq (hG : Nat.card G = p ^ 2) : CommGroup G :=
371-
@commGroupOfCyclicCenterQuotient _ _ _ _ (cyclic_center_quotient_of_card_eq_prime_sq hG) _
372-
(QuotientGroup.ker_mk' (center G)).le
377+
let := cyclic_center_quotient_of_card_eq_prime_sq hG
378+
commGroupOfCyclicCenterQuotient _ (QuotientGroup.ker_mk' <| center G).le
373379

374-
/-- A group of order `p ^ 2` is commutative. See also `IsPGroup.commGroupOfCardEqPrimeSq`
375-
for the `CommGroup` instance. -/
380+
@[deprecated isMulCommutative_of_card_eq_prime_sq (since := "2026-05-26")]
376381
theorem commutative_of_card_eq_prime_sq (hG : Nat.card G = p ^ 2) : ∀ a b : G, a * b = b * a :=
377-
(commGroupOfCardEqPrimeSq hG).mul_comm
382+
isMulCommutative_of_card_eq_prime_sq hG |>.is_comm.comm
378383

379384
end P2comm
380385

Mathlib/GroupTheory/SpecificGroups/Cyclic.lean

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ variable [Group G] [Group G']
175175
/-- A group is commutative if the quotient by the center is cyclic.
176176
Also see `commGroupOfCyclicCenterQuotient` for the `CommGroup` instance. -/
177177
@[to_additive
178-
/-- A group is commutative if the quotient by the center is cyclic.
179-
Also see `addCommGroupOfCyclicCenterQuotient` for the `AddCommGroup` instance. -/]
180-
theorem commutative_of_cyclic_center_quotient [IsCyclic G'] (f : G →* G') (hf : f.ker ≤ center G)
181-
(a b : G) : a * b = b * a :=
178+
/-- A group is commutative if the quotient by the center is cyclic.
179+
Also see `addCommGroupOfCyclicCenterQuotient` for the `AddCommGroup` instance. -/]
180+
theorem MonoidHom.isMulCommutative_of_isCyclic_of_ker_le_center [IsCyclic G'] (f : G →* G')
181+
(hf : f.ker ≤ center G) : IsMulCommutative G := by
182+
refine ⟨⟨fun a b ↦ ?_⟩⟩
182183
let ⟨⟨x, y, (hxy : f y = x)⟩, (hx : ∀ a : f.range, a ∈ zpowers _)⟩ :=
183184
IsCyclic.exists_generator (α := f.range)
184185
let ⟨m, hm⟩ := hx ⟨f a, a, rfl⟩
@@ -196,12 +197,31 @@ theorem commutative_of_cyclic_center_quotient [IsCyclic G'] (f : G →* G') (hf
196197
_ = y ^ m * y ^ n * y ^ (-m) * (y ^ (-n) * b * a) := by rw [mem_center_iff.1 hb]
197198
_ = b * a := by group
198199

200+
@[deprecated AddMonoidHom.isAddCommutative_of_isAddCyclic_of_ker_le_center (since := "2026-05-26")]
201+
theorem commutative_of_addCyclic_center_quotient {G G' : Type*} [AddGroup G] [AddGroup G']
202+
[IsAddCyclic G'] (f : G →+ G') (hf : f.ker ≤ .center G) (a b : G) : a + b = b + a :=
203+
f.isAddCommutative_of_isAddCyclic_of_ker_le_center hf |>.is_comm.comm a b
204+
205+
@[to_additive existing (attr := deprecated MonoidHom.isMulCommutative_of_isCyclic_of_ker_le_center
206+
(since := "2026-05-26"))]
207+
theorem commutative_of_cyclic_center_quotient [IsCyclic G'] (f : G →* G') (hf : f.ker ≤ center G)
208+
(a b : G) : a * b = b * a :=
209+
f.isMulCommutative_of_isCyclic_of_ker_le_center hf |>.is_comm.comm a b
210+
199211
/-- A group is commutative if the quotient by the center is cyclic. -/
200212
@[to_additive (attr := implicit_reducible)
201213
/-- A group is commutative if the quotient by the center is cyclic. -/]
202214
def commGroupOfCyclicCenterQuotient [IsCyclic G'] (f : G →* G') (hf : f.ker ≤ center G) :
203215
CommGroup G where
204-
mul_comm := commutative_of_cyclic_center_quotient f hf
216+
mul_comm := f.isMulCommutative_of_isCyclic_of_ker_le_center hf |>.is_comm.comm
217+
218+
variable (G) in
219+
/-- If the quotient by the center of a group is cyclic, then the group is commutative. -/
220+
@[to_additive
221+
/-- If the quotient by the center of a group is cyclic, then the group is commutative. -/]
222+
theorem isMulCommutative_of_isCyclic_quotient_center_self [IsCyclic (G ⧸ Subgroup.center G)] :
223+
IsMulCommutative G := by
224+
simp [(QuotientGroup.mk' <| .center G).isMulCommutative_of_isCyclic_of_ker_le_center]
205225

206226
end QuotientCenter
207227

0 commit comments

Comments
 (0)