group_theory.nilpotentMathlib.GroupTheory.Nilpotent

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -271,13 +271,13 @@ theorem is_decending_rev_series_of_is_ascending {H : ℕ → Subgroup G} {n : 
   by
   cases' hasc with h0 hH
   refine' ⟨hn, fun x m hx g => _⟩
-  dsimp at hx 
+  dsimp at hx
   by_cases hm : n ≤ m
-  · rw [tsub_eq_zero_of_le hm, h0, Subgroup.mem_bot] at hx 
+  · rw [tsub_eq_zero_of_le hm, h0, Subgroup.mem_bot] at hx
     subst hx
     convert Subgroup.one_mem _
     group
-  · push_neg at hm 
+  · push_neg at hm
     apply hH
     convert hx
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
@@ -295,7 +295,7 @@ theorem is_ascending_rev_series_of_is_descending {H : ℕ → Subgroup G} {n : 
   · have hnm : n - m = 0 := tsub_eq_zero_iff_le.mpr hm
     rw [hnm, h0]
     exact mem_top _
-  · push_neg at hm 
+  · push_neg at hm
     convert hH x _ hx g
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
 #align is_ascending_rev_series_of_is_descending is_ascending_rev_series_of_is_descending
@@ -373,7 +373,7 @@ theorem lowerCentralSeries_antitone : Antitone (lowerCentralSeries G) :=
   by
   refine' antitone_nat_of_succ_le fun n x hx => _
   simp only [mem_lowerCentralSeries_succ_iff, exists_prop, mem_top, exists_true_left,
-    true_and_iff] at hx 
+    true_and_iff] at hx
   refine'
     closure_induction hx _ (Subgroup.one_mem _) (@Subgroup.mul_mem _ _ _) (@Subgroup.inv_mem _ _ _)
   rintro y ⟨z, hz, a, ha⟩
@@ -553,7 +553,7 @@ instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpoten
   rcases hG with ⟨n, hG⟩
   use n
   have := lowerCentralSeries_map_subtype_le H n
-  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this 
+  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.is_nilpotent Subgroup.isNilpotent
 -/
@@ -567,7 +567,7 @@ theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
   apply Nat.find_mono
   intro n hG
   have := lowerCentralSeries_map_subtype_le H n
-  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this 
+  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.nilpotency_class_le Subgroup.nilpotencyClass_le
 -/
@@ -769,7 +769,7 @@ theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontri
   rw [nilpotencyClass_quotient_center]
   rcases h : Group.nilpotencyClass G with ⟨⟩
   · exfalso
-    rw [nilpotencyClass_zero_iff_subsingleton] at h ; skip
+    rw [nilpotencyClass_zero_iff_subsingleton] at h; skip
     apply false_of_nontrivial_of_subsingleton G
   · simp
 #align nilpotency_class_eq_quotient_center_plus_one nilpotencyClass_eq_quotient_center_plus_one
Diff
@@ -189,7 +189,7 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
 -/
 
 #print Group.IsNilpotent /-
-/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:400:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
Diff
@@ -1022,6 +1022,18 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
     IsNilpotent G := by
   cases nonempty_fintype G
   classical
+  revert hG
+  induction' val using Fintype.induction_subsingleton_or_nontrivial with G hG hS G hG hN ih
+  · infer_instance
+  · intro; intro h
+    have hcq : Fintype.card (G ⧸ center G) < Fintype.card G :=
+      by
+      rw [card_eq_card_quotient_mul_card_subgroup (center G)]
+      apply lt_mul_of_one_lt_right
+      exact fintype.card_pos_iff.mpr One.nonempty
+      exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
+    have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
+    exact of_quotient_center_nilpotent hnq
 #align is_p_group.is_nilpotent IsPGroup.isNilpotent
 -/
 
@@ -1031,7 +1043,15 @@ variable [Fintype G]
 /-- If a finite group is the direct product of its Sylow groups, it is nilpotent -/
 theorem isNilpotent_of_product_of_sylow_group
     (e : (∀ p : (Fintype.card G).factorization.support, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
-    IsNilpotent G := by classical
+    IsNilpotent G := by
+  classical
+  let ps := (Fintype.card G).factorization.support
+  have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) :=
+    by
+    intro p P
+    haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_primeFactors (Finset.coe_mem p))
+    exact P.is_p_group'.is_nilpotent
+  exact nilpotent_of_mulEquiv e
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
 -/
 
Diff
@@ -1022,18 +1022,6 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
     IsNilpotent G := by
   cases nonempty_fintype G
   classical
-  revert hG
-  induction' val using Fintype.induction_subsingleton_or_nontrivial with G hG hS G hG hN ih
-  · infer_instance
-  · intro; intro h
-    have hcq : Fintype.card (G ⧸ center G) < Fintype.card G :=
-      by
-      rw [card_eq_card_quotient_mul_card_subgroup (center G)]
-      apply lt_mul_of_one_lt_right
-      exact fintype.card_pos_iff.mpr One.nonempty
-      exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
-    have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
-    exact of_quotient_center_nilpotent hnq
 #align is_p_group.is_nilpotent IsPGroup.isNilpotent
 -/
 
@@ -1043,15 +1031,7 @@ variable [Fintype G]
 /-- If a finite group is the direct product of its Sylow groups, it is nilpotent -/
 theorem isNilpotent_of_product_of_sylow_group
     (e : (∀ p : (Fintype.card G).factorization.support, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
-    IsNilpotent G := by
-  classical
-  let ps := (Fintype.card G).factorization.support
-  have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) :=
-    by
-    intro p P
-    haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_primeFactors (Finset.coe_mem p))
-    exact P.is_p_group'.is_nilpotent
-  exact nilpotent_of_mulEquiv e
+    IsNilpotent G := by classical
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
 -/
 
Diff
@@ -189,7 +189,7 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
 -/
 
 #print Group.IsNilpotent /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:404:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
Diff
@@ -1049,7 +1049,7 @@ theorem isNilpotent_of_product_of_sylow_group
   have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) :=
     by
     intro p P
-    haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_factorization (Finset.coe_mem p))
+    haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_primeFactors (Finset.coe_mem p))
     exact P.is_p_group'.is_nilpotent
   exact nilpotent_of_mulEquiv e
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
Diff
@@ -3,12 +3,12 @@ Copyright (c) 2021 Kevin Buzzard. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, Ines Wright, Joachim Breitner
 -/
-import Mathbin.GroupTheory.QuotientGroup
-import Mathbin.GroupTheory.Solvable
-import Mathbin.GroupTheory.PGroup
-import Mathbin.GroupTheory.Sylow
-import Mathbin.Data.Nat.Factorization.Basic
-import Mathbin.Tactic.Tfae
+import GroupTheory.QuotientGroup
+import GroupTheory.Solvable
+import GroupTheory.PGroup
+import GroupTheory.Sylow
+import Data.Nat.Factorization.Basic
+import Tactic.Tfae
 
 #align_import group_theory.nilpotent from "leanprover-community/mathlib"@"599fffe78f0e11eb6a034e834ec51882167b9688"
 
@@ -189,7 +189,7 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
 -/
 
 #print Group.IsNilpotent /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
Diff
@@ -97,7 +97,7 @@ def upperCentralSeriesStep : Subgroup G
     where
   carrier := {x : G | ∀ y : G, x * y * x⁻¹ * y⁻¹ ∈ H}
   one_mem' y := by simp [Subgroup.one_mem]
-  mul_mem' a b ha hb y :=
+  hMul_mem' a b ha hb y :=
     by
     convert Subgroup.mul_mem _ (ha (b * y * b⁻¹)) (hb y) using 1
     group
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Kevin Buzzard. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, Ines Wright, Joachim Breitner
-
-! This file was ported from Lean 3 source module group_theory.nilpotent
-! leanprover-community/mathlib commit 599fffe78f0e11eb6a034e834ec51882167b9688
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.GroupTheory.QuotientGroup
 import Mathbin.GroupTheory.Solvable
@@ -15,6 +10,8 @@ import Mathbin.GroupTheory.Sylow
 import Mathbin.Data.Nat.Factorization.Basic
 import Mathbin.Tactic.Tfae
 
+#align_import group_theory.nilpotent from "leanprover-community/mathlib"@"599fffe78f0e11eb6a034e834ec51882167b9688"
+
 /-!
 
 # Nilpotent groups
Diff
@@ -111,10 +111,12 @@ def upperCentralSeriesStep : Subgroup G
 #align upper_central_series_step upperCentralSeriesStep
 -/
 
+#print mem_upperCentralSeriesStep /-
 theorem mem_upperCentralSeriesStep (x : G) :
     x ∈ upperCentralSeriesStep H ↔ ∀ y, x * y * x⁻¹ * y⁻¹ ∈ H :=
   Iff.rfl
 #align mem_upper_central_series_step mem_upperCentralSeriesStep
+-/
 
 open QuotientGroup
 
@@ -162,10 +164,12 @@ def upperCentralSeries (n : ℕ) : Subgroup G :=
 instance (n : ℕ) : Normal (upperCentralSeries G n) :=
   (upperCentralSeriesAux G n).2
 
+#print upperCentralSeries_zero /-
 @[simp]
 theorem upperCentralSeries_zero : upperCentralSeries G 0 = ⊥ :=
   rfl
 #align upper_central_series_zero upperCentralSeries_zero
+-/
 
 #print upperCentralSeries_one /-
 @[simp]
@@ -178,15 +182,17 @@ theorem upperCentralSeries_one : upperCentralSeries G 1 = center G :=
 #align upper_central_series_one upperCentralSeries_one
 -/
 
+#print mem_upperCentralSeries_succ_iff /-
 /-- The `n+1`st term of the upper central series `H i` has underlying set equal to the `x` such
 that `⁅x,G⁆ ⊆ H n`-/
 theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
     x ∈ upperCentralSeries G (n + 1) ↔ ∀ y : G, x * y * x⁻¹ * y⁻¹ ∈ upperCentralSeries G n :=
   Iff.rfl
 #align mem_upper_central_series_succ_iff mem_upperCentralSeries_succ_iff
+-/
 
 #print Group.IsNilpotent /-
-/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
@@ -214,6 +220,7 @@ def IsDescendingCentralSeries (H : ℕ → Subgroup G) :=
 #align is_descending_central_series IsDescendingCentralSeries
 -/
 
+#print ascending_central_series_le_upper /-
 /-- Any ascending central series for a group is bounded above by the upper central series. -/
 theorem ascending_central_series_le_upper (H : ℕ → Subgroup G) (hH : IsAscendingCentralSeries H) :
     ∀ n : ℕ, H n ≤ upperCentralSeries G n
@@ -223,6 +230,7 @@ theorem ascending_central_series_le_upper (H : ℕ → Subgroup G) (hH : IsAscen
     rw [mem_upperCentralSeries_succ_iff]
     exact fun y => ascending_central_series_le_upper n (hH.2 x n hx y)
 #align ascending_central_series_le_upper ascending_central_series_le_upper
+-/
 
 variable (G)
 
@@ -234,6 +242,7 @@ theorem upperCentralSeries_isAscendingCentralSeries :
 #align upper_central_series_is_ascending_central_series upperCentralSeries_isAscendingCentralSeries
 -/
 
+#print upperCentralSeries_mono /-
 theorem upperCentralSeries_mono : Monotone (upperCentralSeries G) :=
   by
   refine' monotone_nat_of_le_succ _
@@ -241,7 +250,9 @@ theorem upperCentralSeries_mono : Monotone (upperCentralSeries G) :=
   rw [mul_assoc, mul_assoc, ← mul_assoc y x⁻¹ y⁻¹]
   exact mul_mem hx (normal.conj_mem (upperCentralSeries.Subgroup.normal G n) x⁻¹ (inv_mem hx) y)
 #align upper_central_series_mono upperCentralSeries_mono
+-/
 
+#print nilpotent_iff_finite_ascending_central_series /-
 /-- A group `G` is nilpotent iff there exists an ascending central series which reaches `G` in
   finitely many steps. -/
 theorem nilpotent_iff_finite_ascending_central_series :
@@ -255,7 +266,9 @@ theorem nilpotent_iff_finite_ascending_central_series :
     rw [eq_top_iff, ← hn]
     exact ascending_central_series_le_upper H hH n
 #align nilpotent_iff_finite_ascending_central_series nilpotent_iff_finite_ascending_central_series
+-/
 
+#print is_decending_rev_series_of_is_ascending /-
 theorem is_decending_rev_series_of_is_ascending {H : ℕ → Subgroup G} {n : ℕ} (hn : H n = ⊤)
     (hasc : IsAscendingCentralSeries H) : IsDescendingCentralSeries fun m : ℕ => H (n - m) :=
   by
@@ -272,7 +285,9 @@ theorem is_decending_rev_series_of_is_ascending {H : ℕ → Subgroup G} {n : 
     convert hx
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
 #align is_decending_rev_series_of_is_ascending is_decending_rev_series_of_is_ascending
+-/
 
+#print is_ascending_rev_series_of_is_descending /-
 theorem is_ascending_rev_series_of_is_descending {H : ℕ → Subgroup G} {n : ℕ} (hn : H n = ⊥)
     (hdesc : IsDescendingCentralSeries H) : IsAscendingCentralSeries fun m : ℕ => H (n - m) :=
   by
@@ -287,7 +302,9 @@ theorem is_ascending_rev_series_of_is_descending {H : ℕ → Subgroup G} {n : 
     convert hH x _ hx g
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
 #align is_ascending_rev_series_of_is_descending is_ascending_rev_series_of_is_descending
+-/
 
+#print nilpotent_iff_finite_descending_central_series /-
 /-- A group `G` is nilpotent iff there exists a descending central series which reaches the
   trivial group in a finite time. -/
 theorem nilpotent_iff_finite_descending_central_series :
@@ -304,6 +321,7 @@ theorem nilpotent_iff_finite_descending_central_series :
     rw [tsub_self]
     exact hH.1
 #align nilpotent_iff_finite_descending_central_series nilpotent_iff_finite_descending_central_series
+-/
 
 #print lowerCentralSeries /-
 /-- The lower central series of a group `G` is a sequence `H n` of subgroups of `G`, defined
@@ -316,10 +334,12 @@ def lowerCentralSeries (G : Type _) [Group G] : ℕ → Subgroup G
 
 variable {G}
 
+#print lowerCentralSeries_zero /-
 @[simp]
 theorem lowerCentralSeries_zero : lowerCentralSeries G 0 = ⊤ :=
   rfl
 #align lower_central_series_zero lowerCentralSeries_zero
+-/
 
 #print lowerCentralSeries_one /-
 @[simp]
@@ -328,18 +348,22 @@ theorem lowerCentralSeries_one : lowerCentralSeries G 1 = commutator G :=
 #align lower_central_series_one lowerCentralSeries_one
 -/
 
+#print mem_lowerCentralSeries_succ_iff /-
 theorem mem_lowerCentralSeries_succ_iff (n : ℕ) (q : G) :
     q ∈ lowerCentralSeries G (n + 1) ↔
       q ∈
         closure {x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x} :=
   Iff.rfl
 #align mem_lower_central_series_succ_iff mem_lowerCentralSeries_succ_iff
+-/
 
+#print lowerCentralSeries_succ /-
 theorem lowerCentralSeries_succ (n : ℕ) :
     lowerCentralSeries G (n + 1) =
       closure {x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x} :=
   rfl
 #align lower_central_series_succ lowerCentralSeries_succ
+-/
 
 instance (n : ℕ) : Normal (lowerCentralSeries G n) :=
   by
@@ -347,6 +371,7 @@ instance (n : ℕ) : Normal (lowerCentralSeries G n) :=
   · exact (⊤ : Subgroup G).normal_of_characteristic
   · exact Subgroup.commutator_normal (lowerCentralSeries G d) ⊤
 
+#print lowerCentralSeries_antitone /-
 theorem lowerCentralSeries_antitone : Antitone (lowerCentralSeries G) :=
   by
   refine' antitone_nat_of_succ_le fun n x hx => _
@@ -358,6 +383,7 @@ theorem lowerCentralSeries_antitone : Antitone (lowerCentralSeries G) :=
   rw [← ha, mul_assoc, mul_assoc, ← mul_assoc a z⁻¹ a⁻¹]
   exact mul_mem hz (normal.conj_mem (lowerCentralSeries.Subgroup.normal n) z⁻¹ (inv_mem hz) a)
 #align lower_central_series_antitone lowerCentralSeries_antitone
+-/
 
 #print lowerCentralSeries_isDescendingCentralSeries /-
 /-- The lower central series of a group is a descending central series. -/
@@ -370,13 +396,16 @@ theorem lowerCentralSeries_isDescendingCentralSeries :
 #align lower_central_series_is_descending_central_series lowerCentralSeries_isDescendingCentralSeries
 -/
 
+#print descending_central_series_ge_lower /-
 /-- Any descending central series for a group is bounded below by the lower central series. -/
 theorem descending_central_series_ge_lower (H : ℕ → Subgroup G) (hH : IsDescendingCentralSeries H) :
     ∀ n : ℕ, lowerCentralSeries G n ≤ H n
   | 0 => hH.1.symm ▸ le_refl ⊤
   | n + 1 => commutator_le.mpr fun x hx q _ => hH.2 x n (descending_central_series_ge_lower n hx) q
 #align descending_central_series_ge_lower descending_central_series_ge_lower
+-/
 
+#print nilpotent_iff_lowerCentralSeries /-
 /-- A group is nilpotent if and only if its lower central series eventually reaches
   the trivial subgroup. -/
 theorem nilpotent_iff_lowerCentralSeries : IsNilpotent G ↔ ∃ n, lowerCentralSeries G n = ⊥ :=
@@ -390,6 +419,7 @@ theorem nilpotent_iff_lowerCentralSeries : IsNilpotent G ↔ ∃ n, lowerCentral
   · rintro ⟨n, hn⟩
     exact ⟨n, lowerCentralSeries G, lowerCentralSeries_isDescendingCentralSeries, hn⟩
 #align nilpotent_iff_lower_central_series nilpotent_iff_lowerCentralSeries
+-/
 
 section Classical
 
@@ -397,8 +427,6 @@ open scoped Classical
 
 variable [hG : IsNilpotent G]
 
-include hG
-
 variable (G)
 
 #print Group.nilpotencyClass /-
@@ -411,11 +439,14 @@ noncomputable def Group.nilpotencyClass : ℕ :=
 
 variable {G}
 
+#print upperCentralSeries_nilpotencyClass /-
 @[simp]
 theorem upperCentralSeries_nilpotencyClass : upperCentralSeries G (Group.nilpotencyClass G) = ⊤ :=
   Nat.find_spec (IsNilpotent.nilpotent G)
 #align upper_central_series_nilpotency_class upperCentralSeries_nilpotencyClass
+-/
 
+#print upperCentralSeries_eq_top_iff_nilpotencyClass_le /-
 theorem upperCentralSeries_eq_top_iff_nilpotencyClass_le {n : ℕ} :
     upperCentralSeries G n = ⊤ ↔ Group.nilpotencyClass G ≤ n :=
   by
@@ -427,7 +458,9 @@ theorem upperCentralSeries_eq_top_iff_nilpotencyClass_le {n : ℕ} :
     rw [← upperCentralSeries_nilpotencyClass]
     exact upperCentralSeries_mono _ h
 #align upper_central_series_eq_top_iff_nilpotency_class_le upperCentralSeries_eq_top_iff_nilpotencyClass_le
+-/
 
+#print least_ascending_central_series_length_eq_nilpotencyClass /-
 /-- The nilpotency class of a nilpotent `G` is equal to the smallest `n` for which an ascending
 central series reaches `G` in its `n`'th term. -/
 theorem least_ascending_central_series_length_eq_nilpotencyClass :
@@ -440,7 +473,9 @@ theorem least_ascending_central_series_length_eq_nilpotencyClass :
     rw [← top_le_iff, ← hn]
     exact ascending_central_series_le_upper H hH n
 #align least_ascending_central_series_length_eq_nilpotency_class least_ascending_central_series_length_eq_nilpotencyClass
+-/
 
+#print least_descending_central_series_length_eq_nilpotencyClass /-
 /-- The nilpotency class of a nilpotent `G` is equal to the smallest `n` for which the descending
 central series reaches `⊥` in its `n`'th term. -/
 theorem least_descending_central_series_length_eq_nilpotencyClass :
@@ -457,7 +492,9 @@ theorem least_descending_central_series_length_eq_nilpotencyClass :
     rw [tsub_self]
     exact hH.1
 #align least_descending_central_series_length_eq_nilpotency_class least_descending_central_series_length_eq_nilpotencyClass
+-/
 
+#print lowerCentralSeries_length_eq_nilpotencyClass /-
 /-- The nilpotency class of a nilpotent `G` is equal to the length of the lower central series. -/
 theorem lowerCentralSeries_length_eq_nilpotencyClass :
     Nat.find (nilpotent_iff_lowerCentralSeries.mp hG) = @Group.nilpotencyClass G _ _ :=
@@ -470,14 +507,18 @@ theorem lowerCentralSeries_length_eq_nilpotencyClass :
   · rintro n h
     exact ⟨lowerCentralSeries G, ⟨lowerCentralSeries_isDescendingCentralSeries, h⟩⟩
 #align lower_central_series_length_eq_nilpotency_class lowerCentralSeries_length_eq_nilpotencyClass
+-/
 
+#print lowerCentralSeries_nilpotencyClass /-
 @[simp]
 theorem lowerCentralSeries_nilpotencyClass : lowerCentralSeries G (Group.nilpotencyClass G) = ⊥ :=
   by
   rw [← lowerCentralSeries_length_eq_nilpotencyClass]
   exact Nat.find_spec (nilpotent_iff_lower_central_series.mp _)
 #align lower_central_series_nilpotency_class lowerCentralSeries_nilpotencyClass
+-/
 
+#print lowerCentralSeries_eq_bot_iff_nilpotencyClass_le /-
 theorem lowerCentralSeries_eq_bot_iff_nilpotencyClass_le {n : ℕ} :
     lowerCentralSeries G n = ⊥ ↔ Group.nilpotencyClass G ≤ n :=
   by
@@ -490,9 +531,11 @@ theorem lowerCentralSeries_eq_bot_iff_nilpotencyClass_le {n : ℕ} :
     rw [← lowerCentralSeries_nilpotencyClass]
     exact lowerCentralSeries_antitone h
 #align lower_central_series_eq_bot_iff_nilpotency_class_le lowerCentralSeries_eq_bot_iff_nilpotencyClass_le
+-/
 
 end Classical
 
+#print lowerCentralSeries_map_subtype_le /-
 theorem lowerCentralSeries_map_subtype_le (H : Subgroup G) (n : ℕ) :
     (lowerCentralSeries H n).map H.Subtype ≤ lowerCentralSeries G n :=
   by
@@ -503,7 +546,9 @@ theorem lowerCentralSeries_map_subtype_le (H : Subgroup G) (n : ℕ) :
     rintro x1 ⟨x2, ⟨x3, hx3, x4, hx4, rfl⟩, rfl⟩
     exact ⟨x3, hd (mem_map.mpr ⟨x3, hx3, rfl⟩), x4, by simp⟩
 #align lower_central_series_map_subtype_le lowerCentralSeries_map_subtype_le
+-/
 
+#print Subgroup.isNilpotent /-
 /-- A subgroup of a nilpotent group is nilpotent -/
 instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpotent H :=
   by
@@ -514,7 +559,9 @@ instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpoten
   simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this 
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.is_nilpotent Subgroup.isNilpotent
+-/
 
+#print Subgroup.nilpotencyClass_le /-
 /-- A the nilpotency class of a subgroup is less or equal the the nilpotency class of the group -/
 theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
     Group.nilpotencyClass H ≤ Group.nilpotencyClass G :=
@@ -526,6 +573,7 @@ theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
   simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this 
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.nilpotency_class_le Subgroup.nilpotencyClass_le
+-/
 
 #print isNilpotent_of_subsingleton /-
 instance (priority := 100) isNilpotent_of_subsingleton [Subsingleton G] : IsNilpotent G :=
@@ -533,6 +581,7 @@ instance (priority := 100) isNilpotent_of_subsingleton [Subsingleton G] : IsNilp
 #align is_nilpotent_of_subsingleton isNilpotent_of_subsingleton
 -/
 
+#print upperCentralSeries.map /-
 theorem upperCentralSeries.map {H : Type _} [Group H] {f : G →* H} (h : Function.Surjective f)
     (n : ℕ) : Subgroup.map f (upperCentralSeries G n) ≤ upperCentralSeries H n :=
   by
@@ -542,7 +591,9 @@ theorem upperCentralSeries.map {H : Type _} [Group H] {f : G →* H} (h : Functi
     rcases h y' with ⟨y, rfl⟩
     simpa using hd (mem_map_of_mem f (hx y))
 #align upper_central_series.map upperCentralSeries.map
+-/
 
+#print lowerCentralSeries.map /-
 theorem lowerCentralSeries.map {H : Type _} [Group H] (f : G →* H) (n : ℕ) :
     Subgroup.map f (lowerCentralSeries G n) ≤ lowerCentralSeries H n :=
   by
@@ -557,7 +608,9 @@ theorem lowerCentralSeries.map {H : Type _} [Group H] (f : G →* H) (n : ℕ) :
     apply mem_closure.mpr
     exact fun K hK => hK ⟨f y, hd (mem_map_of_mem f hy), by simp [commutatorElement_def]⟩
 #align lower_central_series.map lowerCentralSeries.map
+-/
 
+#print lowerCentralSeries_succ_eq_bot /-
 theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤ center G) :
     lowerCentralSeries G (n + 1) = ⊥ :=
   by
@@ -566,7 +619,9 @@ theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤
   rw [mul_assoc, ← mul_inv_rev, mul_inv_eq_one, eq_comm]
   exact mem_center_iff.mp (h hy1) z
 #align lower_central_series_succ_eq_bot lowerCentralSeries_succ_eq_bot
+-/
 
+#print isNilpotent_of_ker_le_center /-
 /-- The preimage of a nilpotent group is nilpotent if the kernel of the homomorphism is contained
 in the center -/
 theorem isNilpotent_of_ker_le_center {H : Type _} [Group H] (f : G →* H) (hf1 : f.ker ≤ center G)
@@ -578,7 +633,9 @@ theorem isNilpotent_of_ker_le_center {H : Type _} [Group H] (f : G →* H) (hf1
   refine' lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp _) hf1)
   exact eq_bot_iff.mpr (hn ▸ lowerCentralSeries.map f n)
 #align is_nilpotent_of_ker_le_center isNilpotent_of_ker_le_center
+-/
 
+#print nilpotencyClass_le_of_ker_le_center /-
 theorem nilpotencyClass_le_of_ker_le_center {H : Type _} [Group H] (f : G →* H)
     (hf1 : f.ker ≤ center G) (hH : IsNilpotent H) :
     @Group.nilpotencyClass G _ (isNilpotent_of_ker_le_center f hf1 hH) ≤
@@ -591,7 +648,9 @@ theorem nilpotencyClass_le_of_ker_le_center {H : Type _} [Group H] (f : G →* H
   apply le_trans (lowerCentralSeries.map f _)
   simp only [lowerCentralSeries_nilpotencyClass, le_bot_iff]
 #align nilpotency_class_le_of_ker_le_center nilpotencyClass_le_of_ker_le_center
+-/
 
+#print nilpotent_of_surjective /-
 /-- The range of a surjective homomorphism from a nilpotent group is nilpotent -/
 theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f : G →* G')
     (hf : Function.Surjective f) : IsNilpotent G' :=
@@ -605,7 +664,9 @@ theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
 #align nilpotent_of_surjective nilpotent_of_surjective
+-/
 
+#print nilpotencyClass_le_of_surjective /-
 /-- The nilpotency class of the range of a surejctive homomorphism from a
 nilpotent group is less or equal the nilpotency class of the domain -/
 theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G')
@@ -621,12 +682,15 @@ theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G'
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
 #align nilpotency_class_le_of_surjective nilpotencyClass_le_of_surjective
+-/
 
+#print nilpotent_of_mulEquiv /-
 /-- Nilpotency respects isomorphisms -/
 theorem nilpotent_of_mulEquiv {G' : Type _} [Group G'] [h : IsNilpotent G] (f : G ≃* G') :
     IsNilpotent G' :=
   nilpotent_of_surjective f.toMonoidHom (MulEquiv.surjective f)
 #align nilpotent_of_mul_equiv nilpotent_of_mulEquiv
+-/
 
 #print nilpotent_quotient_of_nilpotent /-
 /-- A quotient of a nilpotent group is nilpotent -/
@@ -743,9 +807,11 @@ theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G], ∀ [IsNilpotent G
 #align nilpotent_center_quotient_ind nilpotent_center_quotient_ind
 -/
 
+#print derived_le_lower_central /-
 theorem derived_le_lower_central (n : ℕ) : derivedSeries G n ≤ lowerCentralSeries G n := by
   induction' n with i ih; · simp; · apply commutator_mono ih; simp
 #align derived_le_lower_central derived_le_lower_central
+-/
 
 #print CommGroup.isNilpotent /-
 /-- Abelian groups are nilpotent -/
@@ -780,6 +846,7 @@ section Prod
 
 variable {G₁ G₂ : Type _} [Group G₁] [Group G₂]
 
+#print lowerCentralSeries_prod /-
 theorem lowerCentralSeries_prod (n : ℕ) :
     lowerCentralSeries (G₁ × G₂) n = (lowerCentralSeries G₁ n).Prod (lowerCentralSeries G₂ n) :=
   by
@@ -795,7 +862,9 @@ theorem lowerCentralSeries_prod (n : ℕ) :
         (commutator_prod_prod _ _ _ _)
       _ = (lowerCentralSeries G₁ n.succ).Prod (lowerCentralSeries G₂ n.succ) := rfl
 #align lower_central_series_prod lowerCentralSeries_prod
+-/
 
+#print isNilpotent_prod /-
 /-- Products of nilpotent groups are nilpotent -/
 instance isNilpotent_prod [IsNilpotent G₁] [IsNilpotent G₂] : IsNilpotent (G₁ × G₂) :=
   by
@@ -805,7 +874,9 @@ instance isNilpotent_prod [IsNilpotent G₁] [IsNilpotent G₂] : IsNilpotent (G
     lower_central_series_eq_bot_iff_nilpotency_class_le.mpr (le_max_left _ _),
     lower_central_series_eq_bot_iff_nilpotency_class_le.mpr (le_max_right _ _), bot_prod_bot]
 #align is_nilpotent_prod isNilpotent_prod
+-/
 
+#print nilpotencyClass_prod /-
 /-- The nilpotency class of a product is the max of the nilpotency classes of the factors -/
 theorem nilpotencyClass_prod [IsNilpotent G₁] [IsNilpotent G₂] :
     Group.nilpotencyClass (G₁ × G₂) = max (Group.nilpotencyClass G₁) (Group.nilpotencyClass G₂) :=
@@ -814,6 +885,7 @@ theorem nilpotencyClass_prod [IsNilpotent G₁] [IsNilpotent G₂] :
   simp only [max_le_iff, ← lowerCentralSeries_eq_bot_iff_nilpotencyClass_le,
     lowerCentralSeries_prod, prod_eq_bot_iff]
 #align nilpotency_class_prod nilpotencyClass_prod
+-/
 
 end Prod
 
@@ -822,6 +894,7 @@ section BoundedPi
 -- First the case of infinite products with bounded nilpotency class
 variable {η : Type _} {Gs : η → Type _} [∀ i, Group (Gs i)]
 
+#print lowerCentralSeries_pi_le /-
 theorem lowerCentralSeries_pi_le (n : ℕ) :
     lowerCentralSeries (∀ i, Gs i) n ≤ Subgroup.pi Set.univ fun i => lowerCentralSeries (Gs i) n :=
   by
@@ -836,6 +909,7 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
       _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_le _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
 #align lower_central_series_pi_le lowerCentralSeries_pi_le
+-/
 
 #print isNilpotent_pi_of_bounded_class /-
 /-- products of nilpotent groups are nilpotent if their nipotency class is bounded -/
@@ -859,6 +933,7 @@ section FinitePi
 -- Now for finite products
 variable {η : Type _} {Gs : η → Type _} [∀ i, Group (Gs i)]
 
+#print lowerCentralSeries_pi_of_finite /-
 theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
     lowerCentralSeries (∀ i, Gs i) n = Subgroup.pi Set.univ fun i => lowerCentralSeries (Gs i) n :=
   by
@@ -873,6 +948,7 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
       _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_of_finite _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
 #align lower_central_series_pi_of_finite lowerCentralSeries_pi_of_finite
+-/
 
 #print isNilpotent_pi /-
 /-- n-ary products of nilpotent groups are nilpotent -/
@@ -889,6 +965,7 @@ instance isNilpotent_pi [Finite η] [∀ i, IsNilpotent (Gs i)] : IsNilpotent (
 #align is_nilpotent_pi isNilpotent_pi
 -/
 
+#print nilpotencyClass_pi /-
 /-- The nilpotency class of an n-ary product is the sup of the nilpotency classes of the factors -/
 theorem nilpotencyClass_pi [Fintype η] [∀ i, IsNilpotent (Gs i)] :
     Group.nilpotencyClass (∀ i, Gs i) = Finset.univ.sup fun i => Group.nilpotencyClass (Gs i) :=
@@ -898,6 +975,7 @@ theorem nilpotencyClass_pi [Fintype η] [∀ i, IsNilpotent (Gs i)] :
   simp only [Finset.sup_le_iff, ← lowerCentralSeries_eq_bot_iff_nilpotencyClass_le,
     lowerCentralSeries_pi_of_finite, pi_eq_bot_iff, Finset.mem_univ, true_imp_iff]
 #align nilpotency_class_pi nilpotencyClass_pi
+-/
 
 end FinitePi
 
@@ -941,8 +1019,6 @@ open Group Fintype
 
 variable {G : Type _} [hG : Group G]
 
-include hG
-
 #print IsPGroup.isNilpotent /-
 /-- A p-group is nilpotent -/
 theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
@@ -966,6 +1042,7 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
 
 variable [Fintype G]
 
+#print isNilpotent_of_product_of_sylow_group /-
 /-- If a finite group is the direct product of its Sylow groups, it is nilpotent -/
 theorem isNilpotent_of_product_of_sylow_group
     (e : (∀ p : (Fintype.card G).factorization.support, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
@@ -979,7 +1056,9 @@ theorem isNilpotent_of_product_of_sylow_group
     exact P.is_p_group'.is_nilpotent
   exact nilpotent_of_mulEquiv e
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
+-/
 
+#print isNilpotent_of_finite_tFAE /-
 /-- A finite group is nilpotent iff the normalizer condition holds, and iff all maximal groups are
 normal and iff all sylow groups are normal and iff the group is the direct product of its sylow
 groups. -/
@@ -997,6 +1076,7 @@ theorem isNilpotent_of_finite_tFAE :
   tfae_have 5 → 1; · rintro ⟨e⟩; exact isNilpotent_of_product_of_sylow_group e
   tfae_finish
 #align is_nilpotent_of_finite_tfae isNilpotent_of_finite_tFAE
+-/
 
 end WithFiniteGroup
 
Diff
@@ -604,7 +604,6 @@ theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f
     _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
-    
 #align nilpotent_of_surjective nilpotent_of_surjective
 
 /-- The nilpotency class of the range of a surejctive homomorphism from a
@@ -621,7 +620,6 @@ theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G'
     _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
-    
 #align nilpotency_class_le_of_surjective nilpotencyClass_le_of_surjective
 
 /-- Nilpotency respects isomorphisms -/
@@ -667,7 +665,6 @@ theorem comap_upperCentralSeries_quotient_center (n : ℕ) :
         (comap_center_subst ih)
       _ = upperCentralSeriesStep (upperCentralSeries G n.succ) :=
         symm (upperCentralSeriesStep_eq_comap_center _)
-      
 #align comap_upper_central_series_quotient_center comap_upperCentralSeries_quotient_center
 -/
 
@@ -700,7 +697,6 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
         _ = Group.nilpotencyClass G := (symm hn)
         _ ≤ Group.nilpotencyClass (G ⧸ center G) + 1 :=
           nilpotencyClass_le_of_ker_le_center _ (le_of_eq (ker_mk _)) _
-        
 #align nilpotency_class_quotient_center nilpotencyClass_quotient_center
 -/
 
@@ -798,7 +794,6 @@ theorem lowerCentralSeries_prod (n : ℕ) :
       _ = ⁅lowerCentralSeries G₁ n, (⊤ : Subgroup G₁)⁆.Prod ⁅lowerCentralSeries G₂ n, ⊤⁆ :=
         (commutator_prod_prod _ _ _ _)
       _ = (lowerCentralSeries G₁ n.succ).Prod (lowerCentralSeries G₂ n.succ) := rfl
-      
 #align lower_central_series_prod lowerCentralSeries_prod
 
 /-- Products of nilpotent groups are nilpotent -/
@@ -840,7 +835,6 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
       _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_le _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
-      
 #align lower_central_series_pi_le lowerCentralSeries_pi_le
 
 #print isNilpotent_pi_of_bounded_class /-
@@ -878,7 +872,6 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
       _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_of_finite _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
-      
 #align lower_central_series_pi_of_finite lowerCentralSeries_pi_of_finite
 
 #print isNilpotent_pi /-
Diff
@@ -98,7 +98,7 @@ quotient group `G/H`.)
 -/
 def upperCentralSeriesStep : Subgroup G
     where
-  carrier := { x : G | ∀ y : G, x * y * x⁻¹ * y⁻¹ ∈ H }
+  carrier := {x : G | ∀ y : G, x * y * x⁻¹ * y⁻¹ ∈ H}
   one_mem' y := by simp [Subgroup.one_mem]
   mul_mem' a b ha hb y :=
     by
@@ -186,7 +186,7 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
 #align mem_upper_central_series_succ_iff mem_upperCentralSeries_succ_iff
 
 #print Group.IsNilpotent /-
-/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:394:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
@@ -267,7 +267,7 @@ theorem is_decending_rev_series_of_is_ascending {H : ℕ → Subgroup G} {n : 
     subst hx
     convert Subgroup.one_mem _
     group
-  · push_neg  at hm 
+  · push_neg at hm 
     apply hH
     convert hx
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
@@ -283,7 +283,7 @@ theorem is_ascending_rev_series_of_is_descending {H : ℕ → Subgroup G} {n : 
   · have hnm : n - m = 0 := tsub_eq_zero_iff_le.mpr hm
     rw [hnm, h0]
     exact mem_top _
-  · push_neg  at hm 
+  · push_neg at hm 
     convert hH x _ hx g
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
 #align is_ascending_rev_series_of_is_descending is_ascending_rev_series_of_is_descending
@@ -331,14 +331,13 @@ theorem lowerCentralSeries_one : lowerCentralSeries G 1 = commutator G :=
 theorem mem_lowerCentralSeries_succ_iff (n : ℕ) (q : G) :
     q ∈ lowerCentralSeries G (n + 1) ↔
       q ∈
-        closure
-          { x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x } :=
+        closure {x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x} :=
   Iff.rfl
 #align mem_lower_central_series_succ_iff mem_lowerCentralSeries_succ_iff
 
 theorem lowerCentralSeries_succ (n : ℕ) :
     lowerCentralSeries G (n + 1) =
-      closure { x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x } :=
+      closure {x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x} :=
   rfl
 #align lower_central_series_succ lowerCentralSeries_succ
 
@@ -957,18 +956,18 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
     IsNilpotent G := by
   cases nonempty_fintype G
   classical
-    revert hG
-    induction' val using Fintype.induction_subsingleton_or_nontrivial with G hG hS G hG hN ih
-    · infer_instance
-    · intro; intro h
-      have hcq : Fintype.card (G ⧸ center G) < Fintype.card G :=
-        by
-        rw [card_eq_card_quotient_mul_card_subgroup (center G)]
-        apply lt_mul_of_one_lt_right
-        exact fintype.card_pos_iff.mpr One.nonempty
-        exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
-      have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
-      exact of_quotient_center_nilpotent hnq
+  revert hG
+  induction' val using Fintype.induction_subsingleton_or_nontrivial with G hG hS G hG hN ih
+  · infer_instance
+  · intro; intro h
+    have hcq : Fintype.card (G ⧸ center G) < Fintype.card G :=
+      by
+      rw [card_eq_card_quotient_mul_card_subgroup (center G)]
+      apply lt_mul_of_one_lt_right
+      exact fintype.card_pos_iff.mpr One.nonempty
+      exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
+    have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
+    exact of_quotient_center_nilpotent hnq
 #align is_p_group.is_nilpotent IsPGroup.isNilpotent
 -/
 
@@ -979,13 +978,13 @@ theorem isNilpotent_of_product_of_sylow_group
     (e : (∀ p : (Fintype.card G).factorization.support, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
     IsNilpotent G := by
   classical
-    let ps := (Fintype.card G).factorization.support
-    have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) :=
-      by
-      intro p P
-      haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_factorization (Finset.coe_mem p))
-      exact P.is_p_group'.is_nilpotent
-    exact nilpotent_of_mulEquiv e
+  let ps := (Fintype.card G).factorization.support
+  have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) :=
+    by
+    intro p P
+    haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_factorization (Finset.coe_mem p))
+    exact P.is_p_group'.is_nilpotent
+  exact nilpotent_of_mulEquiv e
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
 
 /-- A finite group is nilpotent iff the normalizer condition holds, and iff all maximal groups are
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, Ines Wright, Joachim Breitner
 
 ! This file was ported from Lean 3 source module group_theory.nilpotent
-! leanprover-community/mathlib commit 2bbc7e3884ba234309d2a43b19144105a753292e
+! leanprover-community/mathlib commit 599fffe78f0e11eb6a034e834ec51882167b9688
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,6 +19,9 @@ import Mathbin.Tactic.Tfae
 
 # Nilpotent groups
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 An API for nilpotent groups, that is, groups for which the upper central series
 reaches `⊤`.
 
Diff
@@ -103,7 +103,7 @@ def upperCentralSeriesStep : Subgroup G
     group
   inv_mem' x hx y := by
     specialize hx y⁻¹
-    rw [mul_assoc, inv_inv] at hx⊢
+    rw [mul_assoc, inv_inv] at hx ⊢
     exact Subgroup.Normal.mem_comm inferInstance hx
 #align upper_central_series_step upperCentralSeriesStep
 -/
@@ -140,7 +140,7 @@ variable (G)
 #print upperCentralSeriesAux /-
 /-- An auxiliary type-theoretic definition defining both the upper central series of
 a group, and a proof that it is normal, all in one go. -/
-def upperCentralSeriesAux : ℕ → Σ'H : Subgroup G, Normal H
+def upperCentralSeriesAux : ℕ → Σ' H : Subgroup G, Normal H
   | 0 => ⟨⊥, inferInstance⟩
   | n + 1 =>
     let un := upperCentralSeriesAux n
@@ -258,13 +258,13 @@ theorem is_decending_rev_series_of_is_ascending {H : ℕ → Subgroup G} {n : 
   by
   cases' hasc with h0 hH
   refine' ⟨hn, fun x m hx g => _⟩
-  dsimp at hx
+  dsimp at hx 
   by_cases hm : n ≤ m
-  · rw [tsub_eq_zero_of_le hm, h0, Subgroup.mem_bot] at hx
+  · rw [tsub_eq_zero_of_le hm, h0, Subgroup.mem_bot] at hx 
     subst hx
     convert Subgroup.one_mem _
     group
-  · push_neg  at hm
+  · push_neg  at hm 
     apply hH
     convert hx
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
@@ -275,12 +275,12 @@ theorem is_ascending_rev_series_of_is_descending {H : ℕ → Subgroup G} {n : 
   by
   cases' hdesc with h0 hH
   refine' ⟨hn, fun x m hx g => _⟩
-  dsimp only at hx⊢
+  dsimp only at hx ⊢
   by_cases hm : n ≤ m
   · have hnm : n - m = 0 := tsub_eq_zero_iff_le.mpr hm
     rw [hnm, h0]
     exact mem_top _
-  · push_neg  at hm
+  · push_neg  at hm 
     convert hH x _ hx g
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
 #align is_ascending_rev_series_of_is_descending is_ascending_rev_series_of_is_descending
@@ -349,7 +349,7 @@ theorem lowerCentralSeries_antitone : Antitone (lowerCentralSeries G) :=
   by
   refine' antitone_nat_of_succ_le fun n x hx => _
   simp only [mem_lowerCentralSeries_succ_iff, exists_prop, mem_top, exists_true_left,
-    true_and_iff] at hx
+    true_and_iff] at hx 
   refine'
     closure_induction hx _ (Subgroup.one_mem _) (@Subgroup.mul_mem _ _ _) (@Subgroup.inv_mem _ _ _)
   rintro y ⟨z, hz, a, ha⟩
@@ -509,7 +509,7 @@ instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpoten
   rcases hG with ⟨n, hG⟩
   use n
   have := lowerCentralSeries_map_subtype_le H n
-  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this
+  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this 
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.is_nilpotent Subgroup.isNilpotent
 
@@ -521,7 +521,7 @@ theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
   apply Nat.find_mono
   intro n hG
   have := lowerCentralSeries_map_subtype_le H n
-  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this
+  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this 
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.nilpotency_class_le Subgroup.nilpotencyClass_le
 
@@ -710,7 +710,7 @@ theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontri
   rw [nilpotencyClass_quotient_center]
   rcases h : Group.nilpotencyClass G with ⟨⟩
   · exfalso
-    rw [nilpotencyClass_zero_iff_subsingleton] at h; skip
+    rw [nilpotencyClass_zero_iff_subsingleton] at h ; skip
     apply false_of_nontrivial_of_subsingleton G
   · simp
 #align nilpotency_class_eq_quotient_center_plus_one nilpotencyClass_eq_quotient_center_plus_one
@@ -957,7 +957,7 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
     revert hG
     induction' val using Fintype.induction_subsingleton_or_nontrivial with G hG hS G hG hN ih
     · infer_instance
-    · intro ; intro h
+    · intro; intro h
       have hcq : Fintype.card (G ⧸ center G) < Fintype.card G :=
         by
         rw [card_eq_card_quotient_mul_card_subgroup (center G)]
Diff
@@ -88,6 +88,7 @@ section WithGroup
 
 variable {G : Type _} [Group G] (H : Subgroup G) [Normal H]
 
+#print upperCentralSeriesStep /-
 /-- If `H` is a normal subgroup of `G`, then the set `{x : G | ∀ y : G, x*y*x⁻¹*y⁻¹ ∈ H}`
 is a subgroup of `G` (because it is the preimage in `G` of the centre of the
 quotient group `G/H`.)
@@ -105,6 +106,7 @@ def upperCentralSeriesStep : Subgroup G
     rw [mul_assoc, inv_inv] at hx⊢
     exact Subgroup.Normal.mem_comm inferInstance hx
 #align upper_central_series_step upperCentralSeriesStep
+-/
 
 theorem mem_upperCentralSeriesStep (x : G) :
     x ∈ upperCentralSeriesStep H ↔ ∀ y, x * y * x⁻¹ * y⁻¹ ∈ H :=
@@ -113,6 +115,7 @@ theorem mem_upperCentralSeriesStep (x : G) :
 
 open QuotientGroup
 
+#print upperCentralSeriesStep_eq_comap_center /-
 /-- The proof that `upper_central_series_step H` is the preimage of the centre of `G/H` under
 the canonical surjection. -/
 theorem upperCentralSeriesStep_eq_comap_center :
@@ -125,6 +128,7 @@ theorem upperCentralSeriesStep_eq_comap_center :
   rw [coe_mk', ← QuotientGroup.mk_mul, ← QuotientGroup.mk_mul, eq_comm, eq_iff_div_mem,
     div_eq_mul_inv, mul_inv_rev, mul_assoc]
 #align upper_central_series_step_eq_comap_center upperCentralSeriesStep_eq_comap_center
+-/
 
 instance : Normal (upperCentralSeriesStep H) :=
   by
@@ -133,6 +137,7 @@ instance : Normal (upperCentralSeriesStep H) :=
 
 variable (G)
 
+#print upperCentralSeriesAux /-
 /-- An auxiliary type-theoretic definition defining both the upper central series of
 a group, and a proof that it is normal, all in one go. -/
 def upperCentralSeriesAux : ℕ → Σ'H : Subgroup G, Normal H
@@ -142,11 +147,14 @@ def upperCentralSeriesAux : ℕ → Σ'H : Subgroup G, Normal H
     let un_normal := un.2
     ⟨upperCentralSeriesStep un.1, inferInstance⟩
 #align upper_central_series_aux upperCentralSeriesAux
+-/
 
+#print upperCentralSeries /-
 /-- `upper_central_series G n` is the `n`th term in the upper central series of `G`. -/
 def upperCentralSeries (n : ℕ) : Subgroup G :=
   (upperCentralSeriesAux G n).1
 #align upper_central_series upperCentralSeries
+-/
 
 instance (n : ℕ) : Normal (upperCentralSeries G n) :=
   (upperCentralSeriesAux G n).2
@@ -156,6 +164,7 @@ theorem upperCentralSeries_zero : upperCentralSeries G 0 = ⊥ :=
   rfl
 #align upper_central_series_zero upperCentralSeries_zero
 
+#print upperCentralSeries_one /-
 @[simp]
 theorem upperCentralSeries_one : upperCentralSeries G 1 = center G :=
   by
@@ -164,6 +173,7 @@ theorem upperCentralSeries_one : upperCentralSeries G 1 = center G :=
     mem_mk, mem_bot, Set.mem_setOf_eq]
   exact forall_congr' fun y => by rw [mul_inv_eq_one, mul_inv_eq_iff_eq_mul, eq_comm]
 #align upper_central_series_one upperCentralSeries_one
+-/
 
 /-- The `n+1`st term of the upper central series `H i` has underlying set equal to the `x` such
 that `⁅x,G⁆ ⊆ H n`-/
@@ -172,28 +182,34 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
   Iff.rfl
 #align mem_upper_central_series_succ_iff mem_upperCentralSeries_succ_iff
 
+#print Group.IsNilpotent /-
 /- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
   nilpotent : ∃ n : ℕ, upperCentralSeries G n = ⊤
 #align group.is_nilpotent Group.IsNilpotent
+-/
 
 open Group
 
 variable {G}
 
+#print IsAscendingCentralSeries /-
 /-- A sequence of subgroups of `G` is an ascending central series if `H 0` is trivial and
   `⁅H (n + 1), G⁆ ⊆ H n` for all `n`. Note that we do not require that `H n = G` for some `n`. -/
 def IsAscendingCentralSeries (H : ℕ → Subgroup G) : Prop :=
   H 0 = ⊥ ∧ ∀ (x : G) (n : ℕ), x ∈ H (n + 1) → ∀ g, x * g * x⁻¹ * g⁻¹ ∈ H n
 #align is_ascending_central_series IsAscendingCentralSeries
+-/
 
+#print IsDescendingCentralSeries /-
 /-- A sequence of subgroups of `G` is a descending central series if `H 0` is `G` and
   `⁅H n, G⁆ ⊆ H (n + 1)` for all `n`. Note that we do not requre that `H n = {1}` for some `n`. -/
 def IsDescendingCentralSeries (H : ℕ → Subgroup G) :=
   H 0 = ⊤ ∧ ∀ (x : G) (n : ℕ), x ∈ H n → ∀ g, x * g * x⁻¹ * g⁻¹ ∈ H (n + 1)
 #align is_descending_central_series IsDescendingCentralSeries
+-/
 
 /-- Any ascending central series for a group is bounded above by the upper central series. -/
 theorem ascending_central_series_le_upper (H : ℕ → Subgroup G) (hH : IsAscendingCentralSeries H) :
@@ -207,11 +223,13 @@ theorem ascending_central_series_le_upper (H : ℕ → Subgroup G) (hH : IsAscen
 
 variable (G)
 
+#print upperCentralSeries_isAscendingCentralSeries /-
 /-- The upper central series of a group is an ascending central series. -/
 theorem upperCentralSeries_isAscendingCentralSeries :
     IsAscendingCentralSeries (upperCentralSeries G) :=
   ⟨rfl, fun x n h => h⟩
 #align upper_central_series_is_ascending_central_series upperCentralSeries_isAscendingCentralSeries
+-/
 
 theorem upperCentralSeries_mono : Monotone (upperCentralSeries G) :=
   by
@@ -284,12 +302,14 @@ theorem nilpotent_iff_finite_descending_central_series :
     exact hH.1
 #align nilpotent_iff_finite_descending_central_series nilpotent_iff_finite_descending_central_series
 
+#print lowerCentralSeries /-
 /-- The lower central series of a group `G` is a sequence `H n` of subgroups of `G`, defined
   by `H 0` is all of `G` and for `n≥1`, `H (n + 1) = ⁅H n, G⁆` -/
 def lowerCentralSeries (G : Type _) [Group G] : ℕ → Subgroup G
   | 0 => ⊤
   | n + 1 => ⁅lowerCentralSeries n, ⊤⁆
 #align lower_central_series lowerCentralSeries
+-/
 
 variable {G}
 
@@ -298,10 +318,12 @@ theorem lowerCentralSeries_zero : lowerCentralSeries G 0 = ⊤ :=
   rfl
 #align lower_central_series_zero lowerCentralSeries_zero
 
+#print lowerCentralSeries_one /-
 @[simp]
 theorem lowerCentralSeries_one : lowerCentralSeries G 1 = commutator G :=
   rfl
 #align lower_central_series_one lowerCentralSeries_one
+-/
 
 theorem mem_lowerCentralSeries_succ_iff (n : ℕ) (q : G) :
     q ∈ lowerCentralSeries G (n + 1) ↔
@@ -335,6 +357,7 @@ theorem lowerCentralSeries_antitone : Antitone (lowerCentralSeries G) :=
   exact mul_mem hz (normal.conj_mem (lowerCentralSeries.Subgroup.normal n) z⁻¹ (inv_mem hz) a)
 #align lower_central_series_antitone lowerCentralSeries_antitone
 
+#print lowerCentralSeries_isDescendingCentralSeries /-
 /-- The lower central series of a group is a descending central series. -/
 theorem lowerCentralSeries_isDescendingCentralSeries :
     IsDescendingCentralSeries (lowerCentralSeries G) :=
@@ -343,6 +366,7 @@ theorem lowerCentralSeries_isDescendingCentralSeries :
   intro x n hxn g
   exact commutator_mem_commutator hxn (mem_top g)
 #align lower_central_series_is_descending_central_series lowerCentralSeries_isDescendingCentralSeries
+-/
 
 /-- Any descending central series for a group is bounded below by the lower central series. -/
 theorem descending_central_series_ge_lower (H : ℕ → Subgroup G) (hH : IsDescendingCentralSeries H) :
@@ -375,11 +399,13 @@ include hG
 
 variable (G)
 
+#print Group.nilpotencyClass /-
 /-- The nilpotency class of a nilpotent group is the smallest natural `n` such that
 the `n`'th term of the upper central series is `G`. -/
 noncomputable def Group.nilpotencyClass : ℕ :=
   Nat.find (IsNilpotent.nilpotent G)
 #align group.nilpotency_class Group.nilpotencyClass
+-/
 
 variable {G}
 
@@ -499,9 +525,11 @@ theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x hx)
 #align subgroup.nilpotency_class_le Subgroup.nilpotencyClass_le
 
+#print isNilpotent_of_subsingleton /-
 instance (priority := 100) isNilpotent_of_subsingleton [Subsingleton G] : IsNilpotent G :=
   nilpotent_iff_lowerCentralSeries.2 ⟨0, Subsingleton.elim ⊤ ⊥⟩
 #align is_nilpotent_of_subsingleton isNilpotent_of_subsingleton
+-/
 
 theorem upperCentralSeries.map {H : Type _} [Group H] {f : G →* H} (h : Function.Surjective f)
     (n : ℕ) : Subgroup.map f (upperCentralSeries G n) ≤ upperCentralSeries H n :=
@@ -600,22 +628,27 @@ theorem nilpotent_of_mulEquiv {G' : Type _} [Group G'] [h : IsNilpotent G] (f :
   nilpotent_of_surjective f.toMonoidHom (MulEquiv.surjective f)
 #align nilpotent_of_mul_equiv nilpotent_of_mulEquiv
 
+#print nilpotent_quotient_of_nilpotent /-
 /-- A quotient of a nilpotent group is nilpotent -/
 instance nilpotent_quotient_of_nilpotent (H : Subgroup G) [H.Normal] [h : IsNilpotent G] :
     IsNilpotent (G ⧸ H) :=
   nilpotent_of_surjective _ (show Function.Surjective (QuotientGroup.mk' H) by tidy)
 #align nilpotent_quotient_of_nilpotent nilpotent_quotient_of_nilpotent
+-/
 
+#print nilpotencyClass_quotient_le /-
 /-- The nilpotency class of a quotient of `G` is less or equal the nilpotency class of `G` -/
 theorem nilpotencyClass_quotient_le (H : Subgroup G) [H.Normal] [h : IsNilpotent G] :
     Group.nilpotencyClass (G ⧸ H) ≤ Group.nilpotencyClass G :=
   nilpotencyClass_le_of_surjective _ _
 #align nilpotency_class_quotient_le nilpotencyClass_quotient_le
+-/
 
 -- This technical lemma helps with rewriting the subgroup, which occurs in indices
 private theorem comap_center_subst {H₁ H₂ : Subgroup G} [Normal H₁] [Normal H₂] (h : H₁ = H₂) :
     comap (mk' H₁) (center (G ⧸ H₁)) = comap (mk' H₂) (center (G ⧸ H₂)) := by subst h
 
+#print comap_upperCentralSeries_quotient_center /-
 theorem comap_upperCentralSeries_quotient_center (n : ℕ) :
     comap (mk' (center G)) (upperCentralSeries (G ⧸ center G) n) = upperCentralSeries G n.succ :=
   by
@@ -634,12 +667,16 @@ theorem comap_upperCentralSeries_quotient_center (n : ℕ) :
         symm (upperCentralSeriesStep_eq_comap_center _)
       
 #align comap_upper_central_series_quotient_center comap_upperCentralSeries_quotient_center
+-/
 
+#print nilpotencyClass_zero_iff_subsingleton /-
 theorem nilpotencyClass_zero_iff_subsingleton [IsNilpotent G] :
     Group.nilpotencyClass G = 0 ↔ Subsingleton G := by
   simp [Group.nilpotencyClass, Nat.find_eq_zero, subsingleton_iff_bot_eq_top]
 #align nilpotency_class_zero_iff_subsingleton nilpotencyClass_zero_iff_subsingleton
+-/
 
+#print nilpotencyClass_quotient_center /-
 /-- Quotienting the `center G` reduces the nilpotency class by 1 -/
 theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
     Group.nilpotencyClass (G ⧸ center G) = Group.nilpotencyClass G - 1 :=
@@ -663,7 +700,9 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
           nilpotencyClass_le_of_ker_le_center _ (le_of_eq (ker_mk _)) _
         
 #align nilpotency_class_quotient_center nilpotencyClass_quotient_center
+-/
 
+#print nilpotencyClass_eq_quotient_center_plus_one /-
 /-- The nilpotency class of a non-trivial group is one more than its quotient by the center -/
 theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontrivial G] :
     Group.nilpotencyClass G = Group.nilpotencyClass (G ⧸ center G) + 1 :=
@@ -675,7 +714,9 @@ theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontri
     apply false_of_nontrivial_of_subsingleton G
   · simp
 #align nilpotency_class_eq_quotient_center_plus_one nilpotencyClass_eq_quotient_center_plus_one
+-/
 
+#print of_quotient_center_nilpotent /-
 /-- If the quotient by `center G` is nilpotent, then so is G. -/
 theorem of_quotient_center_nilpotent (h : IsNilpotent (G ⧸ center G)) : IsNilpotent G :=
   by
@@ -683,7 +724,9 @@ theorem of_quotient_center_nilpotent (h : IsNilpotent (G ⧸ center G)) : IsNilp
   use n.succ
   simp [← comap_upperCentralSeries_quotient_center, hn]
 #align of_quotient_center_nilpotent of_quotient_center_nilpotent
+-/
 
+#print nilpotent_center_quotient_ind /-
 /-- A custom induction principle for nilpotent groups. The base case is a trivial group
 (`subsingleton G`), and in the induction step, one can assume the hypothesis for
 the group quotiented by its center. -/
@@ -700,11 +743,13 @@ theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G], ∀ [IsNilpotent G
       simp [nilpotencyClass_quotient_center, h]
     exact hstep _ (ih _ hn)
 #align nilpotent_center_quotient_ind nilpotent_center_quotient_ind
+-/
 
 theorem derived_le_lower_central (n : ℕ) : derivedSeries G n ≤ lowerCentralSeries G n := by
   induction' n with i ih; · simp; · apply commutator_mono ih; simp
 #align derived_le_lower_central derived_le_lower_central
 
+#print CommGroup.isNilpotent /-
 /-- Abelian groups are nilpotent -/
 instance (priority := 100) CommGroup.isNilpotent {G : Type _} [CommGroup G] : IsNilpotent G :=
   by
@@ -712,7 +757,9 @@ instance (priority := 100) CommGroup.isNilpotent {G : Type _} [CommGroup G] : Is
   rw [upperCentralSeries_one]
   apply CommGroup.center_eq_top
 #align comm_group.is_nilpotent CommGroup.isNilpotent
+-/
 
+#print CommGroup.nilpotencyClass_le_one /-
 /-- Abelian groups have nilpotency class at most one -/
 theorem CommGroup.nilpotencyClass_le_one {G : Type _} [CommGroup G] : Group.nilpotencyClass G ≤ 1 :=
   by
@@ -720,13 +767,16 @@ theorem CommGroup.nilpotencyClass_le_one {G : Type _} [CommGroup G] : Group.nilp
   rw [upperCentralSeries_one]
   apply CommGroup.center_eq_top
 #align comm_group.nilpotency_class_le_one CommGroup.nilpotencyClass_le_one
+-/
 
+#print commGroupOfNilpotencyClass /-
 /-- Groups with nilpotency class at most one are abelian -/
 def commGroupOfNilpotencyClass [IsNilpotent G] (h : Group.nilpotencyClass G ≤ 1) : CommGroup G :=
   Group.commGroupOfCenterEqTop <| by
     rw [← upperCentralSeries_one]
     exact upper_central_series_eq_top_iff_nilpotency_class_le.mpr h
 #align comm_group_of_nilpotency_class commGroupOfNilpotencyClass
+-/
 
 section Prod
 
@@ -791,6 +841,7 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
       
 #align lower_central_series_pi_le lowerCentralSeries_pi_le
 
+#print isNilpotent_pi_of_bounded_class /-
 /-- products of nilpotent groups are nilpotent if their nipotency class is bounded -/
 theorem isNilpotent_pi_of_bounded_class [∀ i, IsNilpotent (Gs i)] (n : ℕ)
     (h : ∀ i, Group.nilpotencyClass (Gs i) ≤ n) : IsNilpotent (∀ i, Gs i) :=
@@ -803,6 +854,7 @@ theorem isNilpotent_pi_of_bounded_class [∀ i, IsNilpotent (Gs i)] (n : ℕ)
   intro i
   apply lower_central_series_eq_bot_iff_nilpotency_class_le.mpr (h i)
 #align is_nilpotent_pi_of_bounded_class isNilpotent_pi_of_bounded_class
+-/
 
 end BoundedPi
 
@@ -827,6 +879,7 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
       
 #align lower_central_series_pi_of_finite lowerCentralSeries_pi_of_finite
 
+#print isNilpotent_pi /-
 /-- n-ary products of nilpotent groups are nilpotent -/
 instance isNilpotent_pi [Finite η] [∀ i, IsNilpotent (Gs i)] : IsNilpotent (∀ i, Gs i) :=
   by
@@ -839,6 +892,7 @@ instance isNilpotent_pi [Finite η] [∀ i, IsNilpotent (Gs i)] : IsNilpotent (
   exact
     @Finset.le_sup _ _ _ _ Finset.univ (fun i => Group.nilpotencyClass (Gs i)) _ (Finset.mem_univ i)
 #align is_nilpotent_pi isNilpotent_pi
+-/
 
 /-- The nilpotency class of an n-ary product is the sup of the nilpotency classes of the factors -/
 theorem nilpotencyClass_pi [Fintype η] [∀ i, IsNilpotent (Gs i)] :
@@ -852,6 +906,7 @@ theorem nilpotencyClass_pi [Fintype η] [∀ i, IsNilpotent (Gs i)] :
 
 end FinitePi
 
+#print IsNilpotent.to_isSolvable /-
 /-- A nilpotent subgroup is solvable -/
 instance (priority := 100) IsNilpotent.to_isSolvable [h : IsNilpotent G] : IsSolvable G :=
   by
@@ -860,7 +915,9 @@ instance (priority := 100) IsNilpotent.to_isSolvable [h : IsNilpotent G] : IsSol
   rw [eq_bot_iff, ← hn]
   exact derived_le_lower_central n
 #align is_nilpotent.to_is_solvable IsNilpotent.to_isSolvable
+-/
 
+#print normalizerCondition_of_isNilpotent /-
 theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G :=
   by
   -- roughly based on https://groupprops.subwiki.org/wiki/Nilpotent_implies_normalizer_condition
@@ -879,6 +936,7 @@ theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondi
     apply map_injective_of_ker_le (mk' (center G)) hkh le_top
     exact (ih H' hH').trans (symm (map_top_of_surjective _ hsur))
 #align normalizer_condition_of_is_nilpotent normalizerCondition_of_isNilpotent
+-/
 
 end WithGroup
 
@@ -890,6 +948,7 @@ variable {G : Type _} [hG : Group G]
 
 include hG
 
+#print IsPGroup.isNilpotent /-
 /-- A p-group is nilpotent -/
 theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
     IsNilpotent G := by
@@ -908,6 +967,7 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
       have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
       exact of_quotient_center_nilpotent hnq
 #align is_p_group.is_nilpotent IsPGroup.isNilpotent
+-/
 
 variable [Fintype G]
 
Diff
@@ -367,7 +367,7 @@ theorem nilpotent_iff_lowerCentralSeries : IsNilpotent G ↔ ∃ n, lowerCentral
 
 section Classical
 
-open Classical
+open scoped Classical
 
 variable [hG : IsNilpotent G]
 
Diff
@@ -671,8 +671,7 @@ theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontri
   rw [nilpotencyClass_quotient_center]
   rcases h : Group.nilpotencyClass G with ⟨⟩
   · exfalso
-    rw [nilpotencyClass_zero_iff_subsingleton] at h
-    skip
+    rw [nilpotencyClass_zero_iff_subsingleton] at h; skip
     apply false_of_nontrivial_of_subsingleton G
   · simp
 #align nilpotency_class_eq_quotient_center_plus_one nilpotencyClass_eq_quotient_center_plus_one
@@ -702,12 +701,8 @@ theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G], ∀ [IsNilpotent G
     exact hstep _ (ih _ hn)
 #align nilpotent_center_quotient_ind nilpotent_center_quotient_ind
 
-theorem derived_le_lower_central (n : ℕ) : derivedSeries G n ≤ lowerCentralSeries G n :=
-  by
-  induction' n with i ih
-  · simp
-  · apply commutator_mono ih
-    simp
+theorem derived_le_lower_central (n : ℕ) : derivedSeries G n ≤ lowerCentralSeries G n := by
+  induction' n with i ih; · simp; · apply commutator_mono ih; simp
 #align derived_le_lower_central derived_le_lower_central
 
 /-- Abelian groups are nilpotent -/
@@ -871,8 +866,7 @@ theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondi
   -- roughly based on https://groupprops.subwiki.org/wiki/Nilpotent_implies_normalizer_condition
   rw [normalizerCondition_iff_only_full_group_self_normalizing]
   apply nilpotent_center_quotient_ind G <;> clear! G
-  · intro G _ _ H _
-    apply Subsingleton.elim
+  · intro G _ _ H _; apply Subsingleton.elim
   · intro G _ _ ih H hH
     have hch : center G ≤ H := subgroup.center_le_normalizer.trans (le_of_eq hH)
     have hkh : (mk' (center G)).ker ≤ H := by simpa using hch
@@ -904,8 +898,7 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
     revert hG
     induction' val using Fintype.induction_subsingleton_or_nontrivial with G hG hS G hG hN ih
     · infer_instance
-    · intro
-      intro h
+    · intro ; intro h
       have hcq : Fintype.card (G ⧸ center G) < Fintype.card G :=
         by
         rw [card_eq_card_quotient_mul_card_subgroup (center G)]
@@ -944,13 +937,9 @@ theorem isNilpotent_of_finite_tFAE :
   by
   tfae_have 1 → 2; · exact @normalizerCondition_of_isNilpotent _ _
   tfae_have 2 → 3; · exact fun h H => normalizer_condition.normal_of_coatom H h
-  tfae_have 3 → 4;
-  · intro h p _ P
-    exact Sylow.normal_of_all_max_subgroups_normal h _
+  tfae_have 3 → 4; · intro h p _ P; exact Sylow.normal_of_all_max_subgroups_normal h _
   tfae_have 4 → 5; · exact fun h => Nonempty.intro (Sylow.directProductOfNormal h)
-  tfae_have 5 → 1;
-  · rintro ⟨e⟩
-    exact isNilpotent_of_product_of_sylow_group e
+  tfae_have 5 → 1; · rintro ⟨e⟩; exact isNilpotent_of_product_of_sylow_group e
   tfae_finish
 #align is_nilpotent_of_finite_tfae isNilpotent_of_finite_tFAE
 
Diff
@@ -615,7 +615,6 @@ theorem nilpotencyClass_quotient_le (H : Subgroup G) [H.Normal] [h : IsNilpotent
 -- This technical lemma helps with rewriting the subgroup, which occurs in indices
 private theorem comap_center_subst {H₁ H₂ : Subgroup G} [Normal H₁] [Normal H₂] (h : H₁ = H₂) :
     comap (mk' H₁) (center (G ⧸ H₁)) = comap (mk' H₂) (center (G ⧸ H₂)) := by subst h
-#align comap_center_subst comap_center_subst
 
 theorem comap_upperCentralSeries_quotient_center (n : ℕ) :
     comap (mk' (center G)) (upperCentralSeries (G ⧸ center G) n) = upperCentralSeries G n.succ :=
Diff
@@ -172,7 +172,7 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
   Iff.rfl
 #align mem_upper_central_series_succ_iff mem_upperCentralSeries_succ_iff
 
-/- ./././Mathport/Syntax/Translate/Command.lean:388:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
+/- ./././Mathport/Syntax/Translate/Command.lean:393:30: infer kinds are unsupported in Lean 4: #[`nilpotent] [] -/
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
 class Group.IsNilpotent (G : Type _) [Group G] : Prop where
Diff
@@ -571,7 +571,7 @@ theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f
   apply eq_top_iff.mpr
   calc
     ⊤ = f.range := symm (f.range_top_of_surjective hf)
-    _ = Subgroup.map f ⊤ := MonoidHom.range_eq_map _
+    _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
     
@@ -588,7 +588,7 @@ theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G'
   apply eq_top_iff.mpr
   calc
     ⊤ = f.range := symm (f.range_top_of_surjective hf)
-    _ = Subgroup.map f ⊤ := MonoidHom.range_eq_map _
+    _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
     
@@ -630,7 +630,7 @@ theorem comap_upperCentralSeries_quotient_center (n : ℕ) :
       _ = comap (mk' (comap (mk' (center G)) Hn)) (center (G ⧸ comap (mk' (center G)) Hn)) :=
         QuotientGroup.comap_comap_center
       _ = comap (mk' (upperCentralSeries G n.succ)) (center (G ⧸ upperCentralSeries G n.succ)) :=
-        comap_center_subst ih
+        (comap_center_subst ih)
       _ = upperCentralSeriesStep (upperCentralSeries G n.succ) :=
         symm (upperCentralSeriesStep_eq_comap_center _)
       
@@ -659,7 +659,7 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
     · apply le_of_add_le_add_right
       calc
         n + 1 = n.succ := rfl
-        _ = Group.nilpotencyClass G := symm hn
+        _ = Group.nilpotencyClass G := (symm hn)
         _ ≤ Group.nilpotencyClass (G ⧸ center G) + 1 :=
           nilpotencyClass_le_of_ker_le_center _ (le_of_eq (ker_mk _)) _
         
@@ -750,7 +750,7 @@ theorem lowerCentralSeries_prod (n : ℕ) :
       _ = ⁅(lowerCentralSeries G₁ n).Prod (lowerCentralSeries G₂ n), (⊤ : Subgroup G₁).Prod ⊤⁆ := by
         simp
       _ = ⁅lowerCentralSeries G₁ n, (⊤ : Subgroup G₁)⁆.Prod ⁅lowerCentralSeries G₂ n, ⊤⁆ :=
-        commutator_prod_prod _ _ _ _
+        (commutator_prod_prod _ _ _ _)
       _ = (lowerCentralSeries G₁ n.succ).Prod (lowerCentralSeries G₂ n.succ) := rfl
       
 #align lower_central_series_prod lowerCentralSeries_prod
@@ -790,9 +790,9 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
   ·
     calc
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
-      _ ≤ ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := commutator_mono ih (le_refl _)
+      _ ≤ ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_mono ih (le_refl _))
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
-      _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := commutator_pi_pi_le _ _
+      _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_le _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
       
 #align lower_central_series_pi_le lowerCentralSeries_pi_le
@@ -828,7 +828,7 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := by rw [ih]
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
-      _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := commutator_pi_pi_of_finite _ _
+      _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_of_finite _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
       
 #align lower_central_series_pi_of_finite lowerCentralSeries_pi_of_finite

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -541,7 +541,7 @@ theorem nilpotent_of_surjective {G' : Type*} [Group G'] [h : IsNilpotent G] (f :
   apply eq_top_iff.mpr
   calc
     ⊤ = f.range := symm (f.range_top_of_surjective hf)
-    _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
+    _ = Subgroup.map f ⊤ := MonoidHom.range_eq_map _
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
 
@@ -558,7 +558,7 @@ theorem nilpotencyClass_le_of_surjective {G' : Type*} [Group G'] (f : G →* G')
   rw [eq_top_iff]
   calc
     ⊤ = f.range := symm (f.range_top_of_surjective hf)
-    _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
+    _ = Subgroup.map f ⊤ := MonoidHom.range_eq_map _
     _ = Subgroup.map f (upperCentralSeries G n) := by rw [hn]
     _ ≤ upperCentralSeries G' n := upperCentralSeries.map hf n
 
@@ -628,7 +628,7 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
     · apply le_of_add_le_add_right
       calc
         n + 1 = n.succ := rfl
-        _ = Group.nilpotencyClass G := (symm hn)
+        _ = Group.nilpotencyClass G := symm hn
         _ ≤ Group.nilpotencyClass (G ⧸ center G) + 1 :=
           nilpotencyClass_le_of_ker_le_center _ (le_of_eq (ker_mk' _)) _
 
@@ -749,9 +749,9 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
   · simp [pi_top]
   · calc
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
-      _ ≤ ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_mono ih (le_refl _))
+      _ ≤ ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := commutator_mono ih (le_refl _)
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
-      _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_le _ _)
+      _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := commutator_pi_pi_le _ _
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
 
 #align lower_central_series_pi_le lowerCentralSeries_pi_le
@@ -785,7 +785,7 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := by rw [ih]
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
-      _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_of_finite _ _)
+      _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := commutator_pi_pi_of_finite _ _
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
 
 #align lower_central_series_pi_of_finite lowerCentralSeries_pi_of_finite
chore(GroupTheory/Nilpotent): slight golfs and clean-up (#11516)
  • replace apply foo.mpr by rw [foo], golfing into the next line
  • replace a few [@foo](https://github.com/foo) _ _ _ by named arguments
Diff
@@ -374,8 +374,7 @@ theorem upperCentralSeries_eq_top_iff_nilpotencyClass_le {n : ℕ} :
   · intro h
     exact Nat.find_le h
   · intro h
-    apply eq_top_iff.mpr
-    rw [← upperCentralSeries_nilpotencyClass]
+    rw [eq_top_iff, ← upperCentralSeries_nilpotencyClass]
     exact upperCentralSeries_mono _ h
 #align upper_central_series_eq_top_iff_nilpotency_class_le upperCentralSeries_eq_top_iff_nilpotencyClass_le
 
@@ -413,7 +412,7 @@ theorem least_descending_central_series_length_eq_nilpotencyClass :
 
 /-- The nilpotency class of a nilpotent `G` is equal to the length of the lower central series. -/
 theorem lowerCentralSeries_length_eq_nilpotencyClass :
-    Nat.find (nilpotent_iff_lowerCentralSeries.mp hG) = @Group.nilpotencyClass G _ _ := by
+    Nat.find (nilpotent_iff_lowerCentralSeries.mp hG) = Group.nilpotencyClass (G := G) := by
   rw [← least_descending_central_series_length_eq_nilpotencyClass]
   refine' le_antisymm (Nat.find_mono _) (Nat.find_mono _)
   · rintro n ⟨H, ⟨hH, hn⟩⟩
@@ -437,8 +436,7 @@ theorem lowerCentralSeries_eq_bot_iff_nilpotencyClass_le {n : ℕ} :
     rw [← lowerCentralSeries_length_eq_nilpotencyClass]
     exact Nat.find_le h
   · intro h
-    apply eq_bot_iff.mpr
-    rw [← lowerCentralSeries_nilpotencyClass]
+    rw [eq_bot_iff, ← lowerCentralSeries_nilpotencyClass]
     exact lowerCentralSeries_antitone h
 #align lower_central_series_eq_bot_iff_nilpotency_class_le lowerCentralSeries_eq_bot_iff_nilpotencyClass_le
 
@@ -523,14 +521,14 @@ theorem isNilpotent_of_ker_le_center {H : Type*} [Group H] (f : G →* H) (hf1 :
 
 theorem nilpotencyClass_le_of_ker_le_center {H : Type*} [Group H] (f : G →* H)
     (hf1 : f.ker ≤ center G) (hH : IsNilpotent H) :
-    @Group.nilpotencyClass G _ (isNilpotent_of_ker_le_center f hf1 hH) ≤
+    Group.nilpotencyClass (hG := isNilpotent_of_ker_le_center f hf1 hH) ≤
       Group.nilpotencyClass H + 1 := by
   haveI : IsNilpotent G := isNilpotent_of_ker_le_center f hf1 hH
   rw [← lowerCentralSeries_length_eq_nilpotencyClass]
   -- Porting note: Lean needs to be told that predicates are decidable
   refine @Nat.find_min' _ (Classical.decPred _) _ _ ?_
   refine lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp ?_) hf1)
-  apply eq_bot_iff.mpr
+  rw [eq_bot_iff]
   apply le_trans (lowerCentralSeries.map f _)
   simp only [lowerCentralSeries_nilpotencyClass, le_bot_iff]
 #align nilpotency_class_le_of_ker_le_center nilpotencyClass_le_of_ker_le_center
@@ -553,11 +551,11 @@ theorem nilpotent_of_surjective {G' : Type*} [Group G'] [h : IsNilpotent G] (f :
 nilpotent group is less or equal the nilpotency class of the domain -/
 theorem nilpotencyClass_le_of_surjective {G' : Type*} [Group G'] (f : G →* G')
     (hf : Function.Surjective f) [h : IsNilpotent G] :
-    @Group.nilpotencyClass G' _ (nilpotent_of_surjective _ hf) ≤ Group.nilpotencyClass G := by
+    Group.nilpotencyClass (hG := nilpotent_of_surjective _ hf) ≤ Group.nilpotencyClass G := by
   -- Porting note: Lean needs to be told that predicates are decidable
   refine @Nat.find_mono _ _ (Classical.decPred _) (Classical.decPred _) ?_ _ _
   intro n hn
-  apply eq_top_iff.mpr
+  rw [eq_top_iff]
   calc
     ⊤ = f.range := symm (f.range_top_of_surjective hf)
     _ = Subgroup.map f ⊤ := (MonoidHom.range_eq_map _)
@@ -624,7 +622,7 @@ theorem nilpotencyClass_quotient_center [hH : IsNilpotent G] :
   · suffices Group.nilpotencyClass (G ⧸ center G) = n by simpa
     apply le_antisymm
     · apply upperCentralSeries_eq_top_iff_nilpotencyClass_le.mp
-      apply @comap_injective G _ _ _ (mk' (center G)) (surjective_quot_mk _)
+      apply comap_injective (f := (mk' (center G))) (surjective_quot_mk _)
       rw [comap_upperCentralSeries_quotient_center, comap_top, ← hn]
       exact upperCentralSeries_nilpotencyClass
     · apply le_of_add_le_add_right
@@ -688,8 +686,7 @@ instance (priority := 100) CommGroup.isNilpotent {G : Type*} [CommGroup G] : IsN
 /-- Abelian groups have nilpotency class at most one -/
 theorem CommGroup.nilpotencyClass_le_one {G : Type*} [CommGroup G] :
     Group.nilpotencyClass G ≤ 1 := by
-  apply upperCentralSeries_eq_top_iff_nilpotencyClass_le.mp
-  rw [upperCentralSeries_one]
+  rw [← upperCentralSeries_eq_top_iff_nilpotencyClass_le, upperCentralSeries_one]
   apply CommGroup.center_eq_top
 #align comm_group.nilpotency_class_le_one CommGroup.nilpotencyClass_le_one
 
@@ -800,9 +797,8 @@ instance isNilpotent_pi [Finite η] [∀ i, IsNilpotent (Gs i)] : IsNilpotent (
   refine' ⟨Finset.univ.sup fun i => Group.nilpotencyClass (Gs i), _⟩
   rw [lowerCentralSeries_pi_of_finite, pi_eq_bot_iff]
   intro i
-  apply lowerCentralSeries_eq_bot_iff_nilpotencyClass_le.mpr
-  exact
-    @Finset.le_sup _ _ _ _ Finset.univ (fun i => Group.nilpotencyClass (Gs i)) _ (Finset.mem_univ i)
+  rw [lowerCentralSeries_eq_bot_iff_nilpotencyClass_le]
+  exact Finset.le_sup (f := fun i => Group.nilpotencyClass (Gs i)) (Finset.mem_univ i)
 #align is_nilpotent_pi isNilpotent_pi
 
 /-- The nilpotency class of an n-ary product is the sup of the nilpotency classes of the factors -/
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -354,7 +354,6 @@ section Classical
 open scoped Classical
 
 variable [hG : IsNilpotent G]
-
 variable (G)
 
 /-- The nilpotency class of a nilpotent group is the smallest natural `n` such that
chore: remove tactics (#11365)

More tactics that are not used, found using the linter at #11308.

The PR consists of tactic removals, whitespace changes and replacing a porting note by an explanation.

Diff
@@ -643,7 +643,7 @@ theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontri
   rw [nilpotencyClass_quotient_center]
   rcases h : Group.nilpotencyClass G with ⟨⟩
   · exfalso
-    rw [nilpotencyClass_zero_iff_subsingleton] at h; skip
+    rw [nilpotencyClass_zero_iff_subsingleton] at h
     apply false_of_nontrivial_of_subsingleton G
   · simp
 #align nilpotency_class_eq_quotient_center_plus_one nilpotencyClass_eq_quotient_center_plus_one
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -754,7 +754,7 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
   · calc
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
       _ ≤ ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_mono ih (le_refl _))
-      _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi_top]
+      _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
       _ ≤ pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_le _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
 
@@ -788,7 +788,7 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
   · calc
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := by rw [ih]
-      _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi_top]
+      _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi, pi_top]
       _ = pi fun i => ⁅lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_pi_pi_of_finite _ _)
       _ = pi fun i => lowerCentralSeries (Gs i) n.succ := rfl
 
style: reduce spacing variation in "porting note" comments (#10886)

In this pull request, I have systematically eliminated the leading whitespace preceding the colon (:) within all unlabelled or unclassified porting notes. This adjustment facilitates a more efficient review process for the remaining notes by ensuring no entries are overlooked due to formatting inconsistencies.

Diff
@@ -469,7 +469,7 @@ instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpoten
 theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
     Group.nilpotencyClass H ≤ Group.nilpotencyClass G := by
   repeat rw [← lowerCentralSeries_length_eq_nilpotencyClass]
-  --- Porting note : Lean needs to be told that predicates are decidable
+  --- Porting note: Lean needs to be told that predicates are decidable
   refine @Nat.find_mono _ _ (Classical.decPred _) (Classical.decPred _) ?_ _ _
   intro n hG
   have := lowerCentralSeries_map_subtype_le H n
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -220,7 +220,7 @@ theorem nilpotent_iff_finite_ascending_central_series :
     IsNilpotent G ↔ ∃ n : ℕ, ∃ H : ℕ → Subgroup G, IsAscendingCentralSeries H ∧ H n = ⊤ := by
   constructor
   · rintro ⟨n, nH⟩
-    refine' ⟨_, _, upperCentralSeries_isAscendingCentralSeries G, nH⟩
+    exact ⟨_, _, upperCentralSeries_isAscendingCentralSeries G, nH⟩
   · rintro ⟨n, H, hH, hn⟩
     use n
     rw [eq_top_iff, ← hn]
chore: tidy various files (#10007)
Diff
@@ -865,8 +865,8 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
       have hcq : Fintype.card (G ⧸ center G) < Fintype.card G := by
         rw [card_eq_card_quotient_mul_card_subgroup (center G)]
         apply lt_mul_of_one_lt_right
-        exact Fintype.card_pos_iff.mpr One.instNonempty
-        exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
+        · exact Fintype.card_pos_iff.mpr One.instNonempty
+        · exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
       have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
       exact of_quotient_center_nilpotent hnq
 #align is_p_group.is_nilpotent IsPGroup.isNilpotent
doc: fix typos (#10171)

Fix minor typos in the following files:

  • GroupTheory/Nilpotent.lean
  • GroupTheory/PushoutI.lean
  • SetTheory/Cardinal/ENat.lean
  • SetTheory/Cardinal/Subfield.lean
  • RepresentationTheory/Action/Basic.lean
  • RepresentationTheory/Action/Limits.lean
  • Logic/Function/OfArity.lean
Diff
@@ -53,7 +53,7 @@ subgroup `G` of `G`, and `⊥` denotes the trivial subgroup `{1}`.
 * `nilpotent_iff_finite_descending_central_series` : `G` is nilpotent iff some descending central
     series reaches `⊥`.
 * `nilpotent_iff_lower` : `G` is nilpotent iff the lower central series reaches `⊥`.
-* The `nilpotency_class` can likeways be obtained from these equivalent
+* The `nilpotency_class` can likewise be obtained from these equivalent
   definitions, see `least_ascending_central_series_length_eq_nilpotencyClass`,
   `least_descending_central_series_length_eq_nilpotencyClass` and
   `lowerCentralSeries_length_eq_nilpotencyClass`.
@@ -887,7 +887,7 @@ theorem isNilpotent_of_product_of_sylow_group
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
 
 /-- A finite group is nilpotent iff the normalizer condition holds, and iff all maximal groups are
-normal and iff all sylow groups are normal and iff the group is the direct product of its sylow
+normal and iff all Sylow groups are normal and iff the group is the direct product of its Sylow
 groups. -/
 theorem isNilpotent_of_finite_tFAE :
     List.TFAE
feat: define semisimple linear endomorphisms (#9825)
Diff
@@ -477,7 +477,7 @@ theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x ⟨hx, rfl⟩)
 #align subgroup.nilpotency_class_le Subgroup.nilpotencyClass_le
 
-instance (priority := 100) isNilpotent_of_subsingleton [Subsingleton G] : IsNilpotent G :=
+instance (priority := 100) Group.isNilpotent_of_subsingleton [Subsingleton G] : IsNilpotent G :=
   nilpotent_iff_lowerCentralSeries.2 ⟨0, Subsingleton.elim ⊤ ⊥⟩
 #align is_nilpotent_of_subsingleton isNilpotent_of_subsingleton
 
chore: tidy various files (#9903)
Diff
@@ -865,7 +865,7 @@ theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h :
       have hcq : Fintype.card (G ⧸ center G) < Fintype.card G := by
         rw [card_eq_card_quotient_mul_card_subgroup (center G)]
         apply lt_mul_of_one_lt_right
-        exact Fintype.card_pos_iff.mpr One.nonempty
+        exact Fintype.card_pos_iff.mpr One.instNonempty
         exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
       have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
       exact of_quotient_center_nilpotent hnq
chore(*): use α → β instead of ∀ _ : α, β (#9529)
Diff
@@ -662,7 +662,7 @@ the group quotiented by its center. -/
 theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G] [IsNilpotent G], Prop}
     (G : Type*) [Group G] [IsNilpotent G]
     (hbase : ∀ (G) [Group G] [Subsingleton G], P G)
-    (hstep : ∀ (G) [Group G] [IsNilpotent G], ∀ _ih : P (G ⧸ center G), P G) : P G := by
+    (hstep : ∀ (G) [Group G] [IsNilpotent G], P (G ⧸ center G) → P G) : P G := by
   obtain ⟨n, h⟩ : ∃ n, Group.nilpotencyClass G = n := ⟨_, rfl⟩
   induction' n with n ih generalizing G
   · haveI := nilpotencyClass_zero_iff_subsingleton.mp h
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -881,7 +881,7 @@ theorem isNilpotent_of_product_of_sylow_group
     let ps := (Fintype.card G).primeFactors
     have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) := by
       intro p P
-      haveI : Fact (Nat.Prime ↑p) := Fact.mk $ Nat.prime_of_mem_primeFactors p.2
+      haveI : Fact (Nat.Prime ↑p) := Fact.mk <| Nat.prime_of_mem_primeFactors p.2
       exact P.isPGroup'.isNilpotent
     exact nilpotent_of_mulEquiv e
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
refactor(Algebra): Define the center appropriately for non-associative algebras (#6996)

For a sensible theory, we require that the centre of an algebra is closed under multiplication. The definition currently in Mathlib works for associative algebras, but not non-associative algebras. This PR uses the definition from Cabrera García and Rodríguez Palacios, which works for any multiplication (addition) and which coincides with the current definition in the associative case.

I did consider whether the centralizer should also be re-defined in terms of operator commutation, but this still results in a centralizer which is not closed under multiplication in the non-associative case. I have therefore retained the current definition, but changed centralizer_eq_top_iff_subset and centralizer_univ to only work in the associative case.

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Christopher Hoskin <mans0954@users.noreply.github.com> Co-authored-by: Christopher Hoskin <christopher.hoskin@overleaf.com>

Diff
@@ -150,8 +150,8 @@ theorem upperCentralSeries_zero : upperCentralSeries G 0 = ⊥ := rfl
 @[simp]
 theorem upperCentralSeries_one : upperCentralSeries G 1 = center G := by
   ext
-  simp only [upperCentralSeries, upperCentralSeriesAux, upperCentralSeriesStep, center, Set.center,
-    mem_mk, mem_bot, Set.mem_setOf_eq]
+  simp only [upperCentralSeries, upperCentralSeriesAux, upperCentralSeriesStep,
+    Subgroup.mem_center_iff, mem_mk, mem_bot, Set.mem_setOf_eq]
   exact forall_congr' fun y => by rw [mul_inv_eq_one, mul_inv_eq_iff_eq_mul, eq_comm]
 #align upper_central_series_one upperCentralSeries_one
 
refactor: Unify spelling of "prime factors" (#8164)

mathlib can't make up its mind on whether to spell "the prime factors of n" as n.factors.toFinset or n.factorization.support, even though those two are defeq. This PR proposes to unify everything to a new definition Nat.primeFactors, and streamline the existing scattered API about n.factors.toFinset and n.factorization.support to Nat.primeFactors. We also get to write a bit more API that didn't make sense before, eg primeFactors_mono.

Diff
@@ -875,13 +875,13 @@ variable [Fintype G]
 
 /-- If a finite group is the direct product of its Sylow groups, it is nilpotent -/
 theorem isNilpotent_of_product_of_sylow_group
-    (e : (∀ p : (Fintype.card G).factorization.support, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
+    (e : (∀ p : (Fintype.card G).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
     IsNilpotent G := by
   classical
-    let ps := (Fintype.card G).factorization.support
+    let ps := (Fintype.card G).primeFactors
     have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) := by
       intro p P
-      haveI : Fact (Nat.Prime ↑p) := Fact.mk (Nat.prime_of_mem_factorization (Finset.coe_mem p))
+      haveI : Fact (Nat.Prime ↑p) := Fact.mk $ Nat.prime_of_mem_primeFactors p.2
       exact P.isPGroup'.isNilpotent
     exact nilpotent_of_mulEquiv e
 #align is_nilpotent_of_product_of_sylow_group isNilpotent_of_product_of_sylow_group
@@ -894,7 +894,7 @@ theorem isNilpotent_of_finite_tFAE :
       [IsNilpotent G, NormalizerCondition G, ∀ H : Subgroup G, IsCoatom H → H.Normal,
         ∀ (p : ℕ) (_hp : Fact p.Prime) (P : Sylow p G), (↑P : Subgroup G).Normal,
         Nonempty
-          ((∀ p : (card G).factorization.support, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G)] := by
+          ((∀ p : (card G).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G)] := by
   tfae_have 1 → 2
   · exact @normalizerCondition_of_isNilpotent _ _
   tfae_have 2 → 3
style: a linter for colons (#6761)

A linter that throws on seeing a colon at the start of a line, according to the style guideline that says these operators should go before linebreaks.

Diff
@@ -294,8 +294,8 @@ theorem lowerCentralSeries_one : lowerCentralSeries G 1 = commutator G := rfl
 
 theorem mem_lowerCentralSeries_succ_iff (n : ℕ) (q : G) :
     q ∈ lowerCentralSeries G (n + 1) ↔
-    q ∈ closure { x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x }
-  := Iff.rfl
+    q ∈ closure { x | ∃ p ∈ lowerCentralSeries G n,
+                        ∃ q ∈ (⊤ : Subgroup G), p * q * p⁻¹ * q⁻¹ = x } := Iff.rfl
 #align mem_lower_central_series_succ_iff mem_lowerCentralSeries_succ_iff
 
 theorem lowerCentralSeries_succ (n : ℕ) :
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -83,7 +83,7 @@ open Subgroup
 
 section WithGroup
 
-variable {G : Type _} [Group G] (H : Subgroup G) [Normal H]
+variable {G : Type*} [Group G] (H : Subgroup G) [Normal H]
 
 /-- If `H` is a normal subgroup of `G`, then the set `{x : G | ∀ y : G, x*y*x⁻¹*y⁻¹ ∈ H}`
 is a subgroup of `G` (because it is the preimage in `G` of the centre of the
@@ -165,12 +165,12 @@ theorem mem_upperCentralSeries_succ_iff (n : ℕ) (x : G) :
 
 -- is_nilpotent is already defined in the root namespace (for elements of rings).
 /-- A group `G` is nilpotent if its upper central series is eventually `G`. -/
-class Group.IsNilpotent (G : Type _) [Group G] : Prop where
+class Group.IsNilpotent (G : Type*) [Group G] : Prop where
   nilpotent' : ∃ n : ℕ, upperCentralSeries G n = ⊤
 #align group.is_nilpotent Group.IsNilpotent
 
 -- Porting note: add lemma since infer kinds are unsupported in the definition of `IsNilpotent`
-lemma Group.IsNilpotent.nilpotent (G : Type _) [Group G] [IsNilpotent G] :
+lemma Group.IsNilpotent.nilpotent (G : Type*) [Group G] [IsNilpotent G] :
     ∃ n : ℕ, upperCentralSeries G n = ⊤ := Group.IsNilpotent.nilpotent'
 
 open Group
@@ -277,7 +277,7 @@ theorem nilpotent_iff_finite_descending_central_series :
 
 /-- The lower central series of a group `G` is a sequence `H n` of subgroups of `G`, defined
   by `H 0` is all of `G` and for `n≥1`, `H (n + 1) = ⁅H n, G⁆` -/
-def lowerCentralSeries (G : Type _) [Group G] : ℕ → Subgroup G
+def lowerCentralSeries (G : Type*) [Group G] : ℕ → Subgroup G
   | 0 => ⊤
   | n + 1 => ⁅lowerCentralSeries G n, ⊤⁆
 #align lower_central_series lowerCentralSeries
@@ -481,7 +481,7 @@ instance (priority := 100) isNilpotent_of_subsingleton [Subsingleton G] : IsNilp
   nilpotent_iff_lowerCentralSeries.2 ⟨0, Subsingleton.elim ⊤ ⊥⟩
 #align is_nilpotent_of_subsingleton isNilpotent_of_subsingleton
 
-theorem upperCentralSeries.map {H : Type _} [Group H] {f : G →* H} (h : Function.Surjective f)
+theorem upperCentralSeries.map {H : Type*} [Group H] {f : G →* H} (h : Function.Surjective f)
     (n : ℕ) : Subgroup.map f (upperCentralSeries G n) ≤ upperCentralSeries H n := by
   induction' n with d hd
   · simp
@@ -490,7 +490,7 @@ theorem upperCentralSeries.map {H : Type _} [Group H] {f : G →* H} (h : Functi
     simpa using hd (mem_map_of_mem f (hx y))
 #align upper_central_series.map upperCentralSeries.map
 
-theorem lowerCentralSeries.map {H : Type _} [Group H] (f : G →* H) (n : ℕ) :
+theorem lowerCentralSeries.map {H : Type*} [Group H] (f : G →* H) (n : ℕ) :
     Subgroup.map f (lowerCentralSeries G n) ≤ lowerCentralSeries H n := by
   induction' n with d hd
   · simp [Nat.zero_eq]
@@ -513,7 +513,7 @@ theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤
 
 /-- The preimage of a nilpotent group is nilpotent if the kernel of the homomorphism is contained
 in the center -/
-theorem isNilpotent_of_ker_le_center {H : Type _} [Group H] (f : G →* H) (hf1 : f.ker ≤ center G)
+theorem isNilpotent_of_ker_le_center {H : Type*} [Group H] (f : G →* H) (hf1 : f.ker ≤ center G)
     (hH : IsNilpotent H) : IsNilpotent G := by
   rw [nilpotent_iff_lowerCentralSeries] at *
   rcases hH with ⟨n, hn⟩
@@ -522,7 +522,7 @@ theorem isNilpotent_of_ker_le_center {H : Type _} [Group H] (f : G →* H) (hf1
   exact eq_bot_iff.mpr (hn ▸ lowerCentralSeries.map f n)
 #align is_nilpotent_of_ker_le_center isNilpotent_of_ker_le_center
 
-theorem nilpotencyClass_le_of_ker_le_center {H : Type _} [Group H] (f : G →* H)
+theorem nilpotencyClass_le_of_ker_le_center {H : Type*} [Group H] (f : G →* H)
     (hf1 : f.ker ≤ center G) (hH : IsNilpotent H) :
     @Group.nilpotencyClass G _ (isNilpotent_of_ker_le_center f hf1 hH) ≤
       Group.nilpotencyClass H + 1 := by
@@ -537,7 +537,7 @@ theorem nilpotencyClass_le_of_ker_le_center {H : Type _} [Group H] (f : G →* H
 #align nilpotency_class_le_of_ker_le_center nilpotencyClass_le_of_ker_le_center
 
 /-- The range of a surjective homomorphism from a nilpotent group is nilpotent -/
-theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f : G →* G')
+theorem nilpotent_of_surjective {G' : Type*} [Group G'] [h : IsNilpotent G] (f : G →* G')
     (hf : Function.Surjective f) : IsNilpotent G' := by
   rcases h with ⟨n, hn⟩
   use n
@@ -552,7 +552,7 @@ theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f
 
 /-- The nilpotency class of the range of a surjective homomorphism from a
 nilpotent group is less or equal the nilpotency class of the domain -/
-theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G')
+theorem nilpotencyClass_le_of_surjective {G' : Type*} [Group G'] (f : G →* G')
     (hf : Function.Surjective f) [h : IsNilpotent G] :
     @Group.nilpotencyClass G' _ (nilpotent_of_surjective _ hf) ≤ Group.nilpotencyClass G := by
   -- Porting note: Lean needs to be told that predicates are decidable
@@ -568,7 +568,7 @@ theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G'
 #align nilpotency_class_le_of_surjective nilpotencyClass_le_of_surjective
 
 /-- Nilpotency respects isomorphisms -/
-theorem nilpotent_of_mulEquiv {G' : Type _} [Group G'] [_h : IsNilpotent G] (f : G ≃* G') :
+theorem nilpotent_of_mulEquiv {G' : Type*} [Group G'] [_h : IsNilpotent G] (f : G ≃* G') :
     IsNilpotent G' :=
   nilpotent_of_surjective f.toMonoidHom (MulEquiv.surjective f)
 #align nilpotent_of_mul_equiv nilpotent_of_mulEquiv
@@ -660,7 +660,7 @@ theorem of_quotient_center_nilpotent (h : IsNilpotent (G ⧸ center G)) : IsNilp
 the group quotiented by its center. -/
 @[elab_as_elim]
 theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G] [IsNilpotent G], Prop}
-    (G : Type _) [Group G] [IsNilpotent G]
+    (G : Type*) [Group G] [IsNilpotent G]
     (hbase : ∀ (G) [Group G] [Subsingleton G], P G)
     (hstep : ∀ (G) [Group G] [IsNilpotent G], ∀ _ih : P (G ⧸ center G), P G) : P G := by
   obtain ⟨n, h⟩ : ∃ n, Group.nilpotencyClass G = n := ⟨_, rfl⟩
@@ -680,14 +680,14 @@ theorem derived_le_lower_central (n : ℕ) : derivedSeries G n ≤ lowerCentralS
 #align derived_le_lower_central derived_le_lower_central
 
 /-- Abelian groups are nilpotent -/
-instance (priority := 100) CommGroup.isNilpotent {G : Type _} [CommGroup G] : IsNilpotent G := by
+instance (priority := 100) CommGroup.isNilpotent {G : Type*} [CommGroup G] : IsNilpotent G := by
   use 1
   rw [upperCentralSeries_one]
   apply CommGroup.center_eq_top
 #align comm_group.is_nilpotent CommGroup.isNilpotent
 
 /-- Abelian groups have nilpotency class at most one -/
-theorem CommGroup.nilpotencyClass_le_one {G : Type _} [CommGroup G] :
+theorem CommGroup.nilpotencyClass_le_one {G : Type*} [CommGroup G] :
     Group.nilpotencyClass G ≤ 1 := by
   apply upperCentralSeries_eq_top_iff_nilpotencyClass_le.mp
   rw [upperCentralSeries_one]
@@ -703,7 +703,7 @@ def commGroupOfNilpotencyClass [IsNilpotent G] (h : Group.nilpotencyClass G ≤
 
 section Prod
 
-variable {G₁ G₂ : Type _} [Group G₁] [Group G₂]
+variable {G₁ G₂ : Type*} [Group G₁] [Group G₂]
 
 theorem lowerCentralSeries_prod (n : ℕ) :
     lowerCentralSeries (G₁ × G₂) n = (lowerCentralSeries G₁ n).prod (lowerCentralSeries G₂ n) := by
@@ -743,7 +743,7 @@ end Prod
 section BoundedPi
 
 -- First the case of infinite products with bounded nilpotency class
-variable {η : Type _} {Gs : η → Type _} [∀ i, Group (Gs i)]
+variable {η : Type*} {Gs : η → Type*} [∀ i, Group (Gs i)]
 
 theorem lowerCentralSeries_pi_le (n : ℕ) :
     lowerCentralSeries (∀ i, Gs i) n ≤ Subgroup.pi Set.univ
@@ -777,7 +777,7 @@ end BoundedPi
 section FinitePi
 
 -- Now for finite products
-variable {η : Type _} {Gs : η → Type _} [∀ i, Group (Gs i)]
+variable {η : Type*} {Gs : η → Type*} [∀ i, Group (Gs i)]
 
 theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
     lowerCentralSeries (∀ i, Gs i) n = Subgroup.pi Set.univ
@@ -850,7 +850,7 @@ section WithFiniteGroup
 
 open Group Fintype
 
-variable {G : Type _} [hG : Group G]
+variable {G : Type*} [hG : Group G]
 
 /-- A p-group is nilpotent -/
 theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
chore: fix grammar mistakes (#6121)
Diff
@@ -465,7 +465,7 @@ instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpoten
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x ⟨hx, rfl⟩)
 #align subgroup.is_nilpotent Subgroup.isNilpotent
 
-/-- A the nilpotency class of a subgroup is less or equal to the nilpotency class of the group -/
+/-- The nilpotency class of a subgroup is less or equal to the nilpotency class of the group -/
 theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
     Group.nilpotencyClass H ≤ Group.nilpotencyClass G := by
   repeat rw [← lowerCentralSeries_length_eq_nilpotencyClass]
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Kevin Buzzard. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, Ines Wright, Joachim Breitner
-
-! This file was ported from Lean 3 source module group_theory.nilpotent
-! leanprover-community/mathlib commit 2bbc7e3884ba234309d2a43b19144105a753292e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.GroupTheory.QuotientGroup
 import Mathlib.GroupTheory.Solvable
@@ -15,6 +10,8 @@ import Mathlib.GroupTheory.Sylow
 import Mathlib.Data.Nat.Factorization.Basic
 import Mathlib.Tactic.TFAE
 
+#align_import group_theory.nilpotent from "leanprover-community/mathlib"@"2bbc7e3884ba234309d2a43b19144105a753292e"
+
 /-!
 
 # Nilpotent groups
chore: fix focusing dots (#5708)

This PR is the result of running

find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;

which firstly replaces . focusing dots with · and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.

Diff
@@ -712,8 +712,7 @@ theorem lowerCentralSeries_prod (n : ℕ) :
     lowerCentralSeries (G₁ × G₂) n = (lowerCentralSeries G₁ n).prod (lowerCentralSeries G₂ n) := by
   induction' n with n ih
   · simp
-  ·
-    calc
+  · calc
       lowerCentralSeries (G₁ × G₂) n.succ = ⁅lowerCentralSeries (G₁ × G₂) n, ⊤⁆ := rfl
       _ = ⁅(lowerCentralSeries G₁ n).prod (lowerCentralSeries G₂ n), ⊤⁆ := by rw [ih]
       _ = ⁅(lowerCentralSeries G₁ n).prod (lowerCentralSeries G₂ n), (⊤ : Subgroup G₁).prod ⊤⁆ :=
@@ -755,8 +754,7 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
   let pi := fun f : ∀ i, Subgroup (Gs i) => Subgroup.pi Set.univ f
   induction' n with n ih
   · simp [pi_top]
-  ·
-    calc
+  · calc
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
       _ ≤ ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := (commutator_mono ih (le_refl _))
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi_top]
@@ -790,8 +788,7 @@ theorem lowerCentralSeries_pi_of_finite [Finite η] (n : ℕ) :
   let pi := fun f : ∀ i, Subgroup (Gs i) => Subgroup.pi Set.univ f
   induction' n with n ih
   · simp [pi_top]
-  ·
-    calc
+  · calc
       lowerCentralSeries (∀ i, Gs i) n.succ = ⁅lowerCentralSeries (∀ i, Gs i) n, ⊤⁆ := rfl
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, ⊤⁆ := by rw [ih]
       _ = ⁅pi fun i => lowerCentralSeries (Gs i) n, pi fun i => ⊤⁆ := by simp [pi_top]
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊢ -> some_tactic at h ⊢
  • some_tactic at h -> some_tactic at h
Diff
@@ -100,7 +100,7 @@ def upperCentralSeriesStep : Subgroup G where
     group
   inv_mem' {x hx y} := by
     specialize hx y⁻¹
-    rw [mul_assoc, inv_inv] at hx⊢
+    rw [mul_assoc, inv_inv] at hx ⊢
     exact Subgroup.Normal.mem_comm inferInstance hx
 #align upper_central_series_step upperCentralSeriesStep
 
@@ -250,12 +250,12 @@ theorem is_ascending_rev_series_of_is_descending {H : ℕ → Subgroup G} {n : 
     (hdesc : IsDescendingCentralSeries H) : IsAscendingCentralSeries fun m : ℕ => H (n - m) := by
   cases' hdesc with h0 hH
   refine' ⟨hn, fun x m hx g => _⟩
-  dsimp only at hx⊢
+  dsimp only at hx ⊢
   by_cases hm : n ≤ m
   · have hnm : n - m = 0 := tsub_eq_zero_iff_le.mpr hm
     rw [hnm, h0]
     exact mem_top _
-  · push_neg  at hm
+  · push_neg at hm
     convert hH x _ hx g using 1
     rw [tsub_add_eq_add_tsub (Nat.succ_le_of_lt hm), Nat.succ_sub_succ]
 #align is_ascending_rev_series_of_is_descending is_ascending_rev_series_of_is_descending
chore: fix many typos (#4983)

These are all doc fixes

Diff
@@ -468,7 +468,7 @@ instance Subgroup.isNilpotent (H : Subgroup G) [hG : IsNilpotent G] : IsNilpoten
   exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x ⟨hx, rfl⟩)
 #align subgroup.is_nilpotent Subgroup.isNilpotent
 
-/-- A the nilpotency class of a subgroup is less or equal the the nilpotency class of the group -/
+/-- A the nilpotency class of a subgroup is less or equal to the nilpotency class of the group -/
 theorem Subgroup.nilpotencyClass_le (H : Subgroup G) [hG : IsNilpotent G] :
     Group.nilpotencyClass H ≤ Group.nilpotencyClass G := by
   repeat rw [← lowerCentralSeries_length_eq_nilpotencyClass]
chore: fix many typos (#4967)

These are all doc fixes

Diff
@@ -553,7 +553,7 @@ theorem nilpotent_of_surjective {G' : Type _} [Group G'] [h : IsNilpotent G] (f
 
 #align nilpotent_of_surjective nilpotent_of_surjective
 
-/-- The nilpotency class of the range of a surejctive homomorphism from a
+/-- The nilpotency class of the range of a surjective homomorphism from a
 nilpotent group is less or equal the nilpotency class of the domain -/
 theorem nilpotencyClass_le_of_surjective {G' : Type _} [Group G'] (f : G →* G')
     (hf : Function.Surjective f) [h : IsNilpotent G] :
@@ -765,7 +765,7 @@ theorem lowerCentralSeries_pi_le (n : ℕ) :
 
 #align lower_central_series_pi_le lowerCentralSeries_pi_le
 
-/-- products of nilpotent groups are nilpotent if their nipotency class is bounded -/
+/-- products of nilpotent groups are nilpotent if their nilpotency class is bounded -/
 theorem isNilpotent_pi_of_bounded_class [∀ i, IsNilpotent (Gs i)] (n : ℕ)
     (h : ∀ i, Group.nilpotencyClass (Gs i) ≤ n) : IsNilpotent (∀ i, Gs i) := by
   rw [nilpotent_iff_lowerCentralSeries]
chore: fix many typos (#4535)

Run codespell Mathlib and keep some suggestions.

Diff
@@ -187,7 +187,7 @@ def IsAscendingCentralSeries (H : ℕ → Subgroup G) : Prop :=
 #align is_ascending_central_series IsAscendingCentralSeries
 
 /-- A sequence of subgroups of `G` is a descending central series if `H 0` is `G` and
-  `⁅H n, G⁆ ⊆ H (n + 1)` for all `n`. Note that we do not requre that `H n = {1}` for some `n`. -/
+  `⁅H n, G⁆ ⊆ H (n + 1)` for all `n`. Note that we do not require that `H n = {1}` for some `n`. -/
 def IsDescendingCentralSeries (H : ℕ → Subgroup G) :=
   H 0 = ⊤ ∧ ∀ (x : G) (n : ℕ), x ∈ H n → ∀ g, x * g * x⁻¹ * g⁻¹ ∈ H (n + 1)
 #align is_descending_central_series IsDescendingCentralSeries
feat: port GroupTheory.Nilpotent (#4472)

Dependencies 8 + 542

543 files ported (98.5%)
222297 lines ported (98.6%)
Show graph

The unported dependencies are