l3lab/ntp-mathlib huggingface dataset:
/-- 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]
  --- 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
  simp only [hG, SetLike.le_def, mem_map, forall_apply_eq_imp_iff₂, exists_imp] at this
  

Proof state:
G : Type u_1
inst✝¹ : Group G
H✝ : Subgroup G
inst✝ : Normal H✝
H : Subgroup G
hG✝ : Group.IsNilpotent G
n : ℕ
hG : lowerCentralSeries G n = ⊥
this : ∀ ⦃x : G⦄ (x_1 : ↥H), x_1 ∈ lowerCentralSeries (↥H) n ∧ (Subgroup.subtype H) x_1 = x → x ∈ ⊥
⊢ lowerCentralSeries (↥H) n = ⊥

Next tactic:
exact eq_bot_iff.mpr fun x hx => Subtype.ext (this x ⟨hx, rfl⟩)
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
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
h : Function.Surjective ⇑f
n : ℕ
⊢ Subgroup.map f (upperCentralSeries G n) ≤ upperCentralSeries H n

Next tactic:
induction' n with d hd
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
  · 

Proof state:
case zero
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
h : Function.Surjective ⇑f
⊢ Subgroup.map f (upperCentralSeries G Nat.zero) ≤ upperCentralSeries H Nat.zero

Next tactic:
simp
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
  · 

Proof state:
case succ
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
h : Function.Surjective ⇑f
d : ℕ
hd : Subgroup.map f (upperCentralSeries G d) ≤ upperCentralSeries H d
⊢ Subgroup.map f (upperCentralSeries G (Nat.succ d)) ≤ upperCentralSeries H (Nat.succ d)

Next tactic:
rintro _ ⟨x, hx : x ∈ upperCentralSeries G d.succ, rfl⟩ y'
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
  · rintro _ ⟨x, hx : x ∈ upperCentralSeries G d.succ, rfl⟩ y'
    

Proof state:
case succ.intro.intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
h : Function.Surjective ⇑f
d : ℕ
hd : Subgroup.map f (upperCentralSeries G d) ≤ upperCentralSeries H d
x : G
hx : x ∈ upperCentralSeries G (Nat.succ d)
y' : H
⊢ f x * y' * (f x)⁻¹ * y'⁻¹ ∈ (upperCentralSeriesAux H d).fst

Next tactic:
rcases h y' with ⟨y, rfl⟩
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
  · rintro _ ⟨x, hx : x ∈ upperCentralSeries G d.succ, rfl⟩ y'
    rcases h y' with ⟨y, rfl⟩
    

Proof state:
case succ.intro.intro.intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
h : Function.Surjective ⇑f
d : ℕ
hd : Subgroup.map f (upperCentralSeries G d) ≤ upperCentralSeries H d
x : G
hx : x ∈ upperCentralSeries G (Nat.succ d)
y : G
⊢ f x * f y * (f x)⁻¹ * (f y)⁻¹ ∈ (upperCentralSeriesAux H d).fst

Next tactic:
simpa using hd (mem_map_of_mem f (hx y))
theorem lowerCentralSeries.map {H : Type*} [Group H] (f : G →* H) (n : ℕ) :
    Subgroup.map f (lowerCentralSeries G n) ≤ lowerCentralSeries H n := by
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
n : ℕ
⊢ Subgroup.map f (lowerCentralSeries G n) ≤ lowerCentralSeries H n

Next tactic:
induction' n with d hd
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
  · 

Proof state:
case zero
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
⊢ Subgroup.map f (lowerCentralSeries G Nat.zero) ≤ lowerCentralSeries H Nat.zero

Next tactic:
simp [Nat.zero_eq]
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]
  · 

Proof state:
case succ
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
⊢ Subgroup.map f (lowerCentralSeries G (Nat.succ d)) ≤ lowerCentralSeries H (Nat.succ d)

Next tactic:
rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    

Proof state:
case succ.intro.intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
⊢ f x ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        rw [f.map_inv]; exact Subgroup.inv_mem _ hy)
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by 

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
⊢ f 1 ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
simp [f.map_one, Subgroup.one_mem _]
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by 

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
y z : G
hy : f y ∈ lowerCentralSeries H (Nat.succ d)
hz : f z ∈ lowerCentralSeries H (Nat.succ d)
⊢ f (y * z) ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
y : G
hy : f y ∈ lowerCentralSeries H (Nat.succ d)
⊢ f y⁻¹ ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
rw [f.map_inv]
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        rw [f.map_inv]; 

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
y : G
hy : f y ∈ lowerCentralSeries H (Nat.succ d)
⊢ (f y)⁻¹ ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
exact Subgroup.inv_mem _ hy
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        rw [f.map_inv]; exact Subgroup.inv_mem _ hy)
    

Proof state:
case succ.intro.intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
⊢ ∀ x ∈ {g | ∃ g₁ ∈ lowerCentralSeries G d, ∃ g₂ ∈ ⊤, ⁅g₁, g₂⁆ = g}, f x ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
rintro a ⟨y, hy, z, ⟨-, rfl⟩⟩
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        rw [f.map_inv]; exact Subgroup.inv_mem _ hy)
    rintro a ⟨y, hy, z, ⟨-, rfl⟩⟩
    

Proof state:
case succ.intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
y : G
hy : y ∈ lowerCentralSeries G d
z : G
⊢ f ⁅y, z⁆ ∈ lowerCentralSeries H (Nat.succ d)

Next tactic:
apply mem_closure.mpr
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        rw [f.map_inv]; exact Subgroup.inv_mem _ hy)
    rintro a ⟨y, hy, z, ⟨-, rfl⟩⟩
    apply mem_closure.mpr
    

Proof state:
case succ.intro.intro.intro.intro.intro.intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
y : G
hy : y ∈ lowerCentralSeries G d
z : G
⊢ ∀ (K : Subgroup H), {g | ∃ g₁ ∈ lowerCentralSeries H d, ∃ g₂ ∈ ⊤, ⁅g₁, g₂⁆ = g} ⊆ ↑K → f ⁅y, z⁆ ∈ K

Next tactic:
exact fun K hK => hK ⟨f y, hd (mem_map_of_mem f hy), by simp [commutatorElement_def]⟩
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]
  · rintro a ⟨x, hx : x ∈ lowerCentralSeries G d.succ, rfl⟩
    refine closure_induction hx ?_ (by simp [f.map_one, Subgroup.one_mem _])
      (fun y z hy hz => by simp [MonoidHom.map_mul, Subgroup.mul_mem _ hy hz]) (fun y hy => by
        rw [f.map_inv]; exact Subgroup.inv_mem _ hy)
    rintro a ⟨y, hy, z, ⟨-, rfl⟩⟩
    apply mem_closure.mpr
    exact fun K hK => hK ⟨f y, hd (mem_map_of_mem f hy), by 

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
d : ℕ
hd : Subgroup.map f (lowerCentralSeries G d) ≤ lowerCentralSeries H d
x : G
hx : x ∈ lowerCentralSeries G (Nat.succ d)
y : G
hy : y ∈ lowerCentralSeries G d
z : G
K : Subgroup H
hK : {g | ∃ g₁ ∈ lowerCentralSeries H d, ∃ g₂ ∈ ⊤, ⁅g₁, g₂⁆ = g} ⊆ ↑K
⊢ ∃ g₂ ∈ ⊤, ⁅f y, g₂⁆ = f ⁅y, z⁆

Next tactic:
simp [commutatorElement_def]
theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤ center G) :
    lowerCentralSeries G (n + 1) = ⊥ := by
  

Proof state:
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
n : ℕ
h : lowerCentralSeries G n ≤ center G
⊢ lowerCentralSeries G (n + 1) = ⊥

Next tactic:
rw [lowerCentralSeries_succ, closure_eq_bot_iff, Set.subset_singleton_iff]
theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤ center G) :
    lowerCentralSeries G (n + 1) = ⊥ := by
  rw [lowerCentralSeries_succ, closure_eq_bot_iff, Set.subset_singleton_iff]
  

Proof state:
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
n : ℕ
h : lowerCentralSeries G n ≤ center G
⊢ ∀ y ∈ {x | ∃ p ∈ lowerCentralSeries G n, ∃ q ∈ ⊤, p * q * p⁻¹ * q⁻¹ = x}, y = 1

Next tactic:
rintro x ⟨y, hy1, z, ⟨⟩, rfl⟩
theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤ center G) :
    lowerCentralSeries G (n + 1) = ⊥ := by
  rw [lowerCentralSeries_succ, closure_eq_bot_iff, Set.subset_singleton_iff]
  rintro x ⟨y, hy1, z, ⟨⟩, rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
n : ℕ
h : lowerCentralSeries G n ≤ center G
y : G
hy1 : y ∈ lowerCentralSeries G n
z : G
⊢ y * z * y⁻¹ * z⁻¹ = 1

Next tactic:
rw [mul_assoc, ← mul_inv_rev, mul_inv_eq_one, eq_comm]
theorem lowerCentralSeries_succ_eq_bot {n : ℕ} (h : lowerCentralSeries G n ≤ center G) :
    lowerCentralSeries G (n + 1) = ⊥ := by
  rw [lowerCentralSeries_succ, closure_eq_bot_iff, Set.subset_singleton_iff]
  rintro x ⟨y, hy1, z, ⟨⟩, rfl⟩
  rw [mul_assoc, ← mul_inv_rev, mul_inv_eq_one, eq_comm]
  

Proof state:
case intro.intro.intro.intro.intro
G : Type u_1
inst✝¹ : Group G
H : Subgroup G
inst✝ : Normal H
n : ℕ
h : lowerCentralSeries G n ≤ center G
y : G
hy1 : y ∈ lowerCentralSeries G n
z : G
⊢ z * y = y * z

Next tactic:
exact mem_center_iff.mp (h hy1) z
/-- 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)
    (hH : IsNilpotent H) : IsNilpotent G := by
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
⊢ Group.IsNilpotent G

Next tactic:
rw [nilpotent_iff_lowerCentralSeries] at *
/-- 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)
    (hH : IsNilpotent H) : IsNilpotent G := by
  rw [nilpotent_iff_lowerCentralSeries] at *
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : ∃ n, lowerCentralSeries H n = ⊥
⊢ ∃ n, lowerCentralSeries G n = ⊥

Next tactic:
rcases hH with ⟨n, hn⟩
/-- 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)
    (hH : IsNilpotent H) : IsNilpotent G := by
  rw [nilpotent_iff_lowerCentralSeries] at *
  rcases hH with ⟨n, hn⟩
  

Proof state:
case intro
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
n : ℕ
hn : lowerCentralSeries H n = ⊥
⊢ ∃ n, lowerCentralSeries G n = ⊥

Next tactic:
use n + 1
/-- 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)
    (hH : IsNilpotent H) : IsNilpotent G := by
  rw [nilpotent_iff_lowerCentralSeries] at *
  rcases hH with ⟨n, hn⟩
  use n + 1
  

Proof state:
case h
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
n : ℕ
hn : lowerCentralSeries H n = ⊥
⊢ lowerCentralSeries G (n + 1) = ⊥

Next tactic:
refine' lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp _) hf1)
/-- 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)
    (hH : IsNilpotent H) : IsNilpotent G := by
  rw [nilpotent_iff_lowerCentralSeries] at *
  rcases hH with ⟨n, hn⟩
  use n + 1
  refine' lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp _) hf1)
  

Proof state:
case h
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
n : ℕ
hn : lowerCentralSeries H n = ⊥
⊢ Subgroup.map f (lowerCentralSeries G n) = ⊥

Next tactic:
exact eq_bot_iff.mpr (hn ▸ lowerCentralSeries.map f n)
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
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
⊢ nilpotencyClass G ≤ nilpotencyClass H + 1

Next tactic:
haveI : IsNilpotent G := isNilpotent_of_ker_le_center f hf1 hH
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
  haveI : IsNilpotent G := isNilpotent_of_ker_le_center f hf1 hH
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
this : Group.IsNilpotent G
⊢ nilpotencyClass G ≤ nilpotencyClass H + 1

Next tactic:
rw [← lowerCentralSeries_length_eq_nilpotencyClass]
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
  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
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
this : Group.IsNilpotent G
⊢ Nat.find (_ : ∃ n, lowerCentralSeries G n = ⊥) ≤ nilpotencyClass H + 1

Next tactic:
refine @Nat.find_min' _ (Classical.decPred _) _ _ ?_
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
  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 _) _ _ ?_
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
this : Group.IsNilpotent G
⊢ lowerCentralSeries G (nilpotencyClass H + 1) = ⊥

Next tactic:
refine lowerCentralSeries_succ_eq_bot (le_trans ((Subgroup.map_eq_bot_iff _).mp ?_) 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 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)
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
this : Group.IsNilpotent G
⊢ Subgroup.map f (lowerCentralSeries G (nilpotencyClass H)) = ⊥

Next tactic:
apply eq_bot_iff.mpr
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
  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
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
this : Group.IsNilpotent G
⊢ Subgroup.map f (lowerCentralSeries G (nilpotencyClass H)) ≤ ⊥

Next tactic:
apply le_trans (lowerCentralSeries.map f _)
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
  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
  apply le_trans (lowerCentralSeries.map f _)
  

Proof state:
G : Type u_1
inst✝² : Group G
H✝ : Subgroup G
inst✝¹ : Normal H✝
H : Type u_2
inst✝ : Group H
f : G →* H
hf1 : MonoidHom.ker f ≤ center G
hH : Group.IsNilpotent H
this : Group.IsNilpotent G
⊢ lowerCentralSeries H (nilpotencyClass H) ≤ ⊥

Next tactic:
simp only [lowerCentralSeries_nilpotencyClass, le_bot_iff]
/-- 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' := by
  

Proof state:
G : Type u_1
inst✝² : Group G
H : Subgroup G
inst✝¹ : Normal H
G' : Type u_2
inst✝ : Group G'
h : Group.IsNilpotent G
f : G →* G'
hf : Function.Surjective ⇑f
⊢ Group.IsNilpotent G'

Next tactic:
rcases h with ⟨n, hn⟩