l3lab/ntp-mathlib huggingface dataset:
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · intro G _ _ ih H hH
    have hch : center G ≤ H := Subgroup.center_le_normalizer.trans (le_of_eq hH)
    

Proof state:
case hstep
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
⊢ H = ⊤

Next tactic:
have hkh : (mk' (center G)).ker ≤ H := by simpa using hch
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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 

Proof state:
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
⊢ MonoidHom.ker (mk' (center G)) ≤ H

Next tactic:
simpa using hch
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    

Proof state:
case hstep
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
⊢ H = ⊤

Next tactic:
have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    

Proof state:
case hstep
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
⊢ H = ⊤

Next tactic:
let H' := H.map (mk' (center G))
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    let H' := H.map (mk' (center G))
    

Proof state:
case hstep
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
H' : Subgroup (G ⧸ center G) := Subgroup.map (mk' (center G)) H
⊢ H = ⊤

Next tactic:
have hH' : H'.normalizer = H' := by
      apply comap_injective hsur
      rw [comap_normalizer_eq_of_surjective _ hsur, comap_map_eq_self hkh]
      exact hH
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    let H' := H.map (mk' (center G))
    have hH' : H'.normalizer = H' := by
      

Proof state:
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
H' : Subgroup (G ⧸ center G) := Subgroup.map (mk' (center G)) H
⊢ normalizer H' = H'

Next tactic:
apply comap_injective hsur
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    let H' := H.map (mk' (center G))
    have hH' : H'.normalizer = H' := by
      apply comap_injective hsur
      

Proof state:
case a
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
H' : Subgroup (G ⧸ center G) := Subgroup.map (mk' (center G)) H
⊢ comap (mk' (center G)) (normalizer H') = comap (mk' (center G)) H'

Next tactic:
rw [comap_normalizer_eq_of_surjective _ hsur, comap_map_eq_self hkh]
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    let H' := H.map (mk' (center G))
    have hH' : H'.normalizer = H' := by
      apply comap_injective hsur
      rw [comap_normalizer_eq_of_surjective _ hsur, comap_map_eq_self hkh]
      

Proof state:
case a
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
H' : Subgroup (G ⧸ center G) := Subgroup.map (mk' (center G)) H
⊢ normalizer H = H

Next tactic:
exact hH
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    let H' := H.map (mk' (center G))
    have hH' : H'.normalizer = H' := by
      apply comap_injective hsur
      rw [comap_normalizer_eq_of_surjective _ hsur, comap_map_eq_self hkh]
      exact hH
    

Proof state:
case hstep
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
H' : Subgroup (G ⧸ center G) := Subgroup.map (mk' (center G)) H
hH' : normalizer H' = H'
⊢ H = ⊤

Next tactic:
apply map_injective_of_ker_le (mk' (center G)) hkh le_top
theorem normalizerCondition_of_isNilpotent [h : IsNilpotent G] : NormalizerCondition G := by
  -- 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 _
    exact @Subsingleton.elim _ Unique.instSubsingleton _ _
  · 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
    have hsur : Function.Surjective (mk' (center G)) := surjective_quot_mk _
    let H' := H.map (mk' (center G))
    have hH' : H'.normalizer = H' := by
      apply comap_injective hsur
      rw [comap_normalizer_eq_of_surjective _ hsur, comap_map_eq_self hkh]
      exact hH
    apply map_injective_of_ker_le (mk' (center G)) hkh le_top
    

Proof state:
case hstep
G : Type u_1
inst✝¹ : Group G
inst✝ : Group.IsNilpotent G
ih : ∀ (H : Subgroup (G ⧸ center G)), normalizer H = H → H = ⊤
H : Subgroup G
hH : normalizer H = H
hch : center G ≤ H
hkh : MonoidHom.ker (mk' (center G)) ≤ H
hsur : Function.Surjective ⇑(mk' (center G))
H' : Subgroup (G ⧸ center G) := Subgroup.map (mk' (center G)) H
hH' : normalizer H' = H'
⊢ Subgroup.map (mk' (center G)) H = Subgroup.map (mk' (center G)) ⊤

Next tactic:
exact (ih H' hH').trans (symm (map_top_of_surjective _ hsur))
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  

Proof state:
G : Type u_1
hG : Group G
inst✝ : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
h : IsPGroup p G
⊢ Group.IsNilpotent G

Next tactic:
cases' nonempty_fintype G
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  

Proof state:
case intro
G : Type u_1
hG : Group G
inst✝ : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
h : IsPGroup p G
val✝ : Fintype G
⊢ Group.IsNilpotent G

Next tactic:
classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ 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
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    

Proof state:
case intro
G : Type u_1
hG : Group G
inst✝ : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
h : IsPGroup p G
val✝ : Fintype G
⊢ Group.IsNilpotent G

Next tactic:
revert hG
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    

Proof state:
case intro
G : Type u_1
inst✝ : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G
⊢ ∀ [hG : Group G], IsPGroup p G → Group.IsNilpotent G

Next tactic:
apply @Fintype.induction_subsingleton_or_nontrivial _ G _
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · 

Proof state:
case intro.hbase
G : Type u_1
inst✝ : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G
⊢ ∀ (α : Type u_1) [inst : Fintype α] [inst : Subsingleton α] [hG : Group α], IsPGroup p α → Group.IsNilpotent α

Next tactic:
intro _ _ _ _
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      

Proof state:
case intro.hbase
G : Type u_1
inst✝² : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G
α✝ : Type u_1
inst✝¹ : Fintype α✝
inst✝ : Subsingleton α✝
hG✝ : Group α✝
⊢ IsPGroup p α✝ → Group.IsNilpotent α✝

Next tactic:
infer_instance
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · 

Proof state:
case intro.hstep
G : Type u_1
inst✝ : Finite G
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G
⊢ ∀ (α : Type u_1) [inst : Fintype α] [inst_1 : Nontrivial α],
    (∀ (β : Type u_1) [inst_2 : Fintype β], card β < card α → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β) →
      ∀ [hG : Group α], IsPGroup p α → Group.IsNilpotent α

Next tactic:
intro G _ _ ih _ h
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ h
      

Proof state:
case intro.hstep
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
⊢ Group.IsNilpotent G

Next tactic:
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)
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ h
      have hcq : Fintype.card (G ⧸ center G) < Fintype.card G := by
        

Proof state:
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
⊢ card (G ⧸ center G) < card G

Next tactic:
rw [card_eq_card_quotient_mul_card_subgroup (center G)]
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ h
      have hcq : Fintype.card (G ⧸ center G) < Fintype.card G := by
        rw [card_eq_card_quotient_mul_card_subgroup (center G)]
        

Proof state:
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
⊢ card (G ⧸ center G) < card (G ⧸ center G) * card ↥(center G)

Next tactic:
apply lt_mul_of_one_lt_right
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ 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
        

Proof state:
case ha
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
⊢ 0 < card (G ⧸ center G)
case h
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
⊢ 1 < card ↥(center G)

Next tactic:
exact Fintype.card_pos_iff.mpr One.nonempty
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ 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
        

Proof state:
case h
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
⊢ 1 < card ↥(center G)

Next tactic:
exact (Subgroup.one_lt_card_iff_ne_bot _).mpr (ne_of_gt h.bot_lt_center)
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ 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)
      

Proof state:
case intro.hstep
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
hcq : card (G ⧸ center G) < card G
⊢ Group.IsNilpotent G

Next tactic:
have hnq : IsNilpotent (G ⧸ center G) := ih _ hcq (h.to_quotient (center G))
/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G := by
  cases' nonempty_fintype G
  classical
    revert hG
    apply @Fintype.induction_subsingleton_or_nontrivial _ G _
    · intro _ _ _ _
      infer_instance
    · intro G _ _ ih _ 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))
      

Proof state:
case intro.hstep
G✝ : Type u_1
inst✝² : Finite G✝
p : ℕ
hp : Fact (Nat.Prime p)
val✝ : Fintype G✝
G : Type u_1
inst✝¹ : Fintype G
inst✝ : Nontrivial G
ih : ∀ (β : Type u_1) [inst : Fintype β], card β < card G → ∀ [hG : Group β], IsPGroup p β → Group.IsNilpotent β
hG✝ : Group G
h : IsPGroup p G
hcq : card (G ⧸ center G) < card G
hnq : Group.IsNilpotent (G ⧸ center G)
⊢ Group.IsNilpotent G

Next tactic:
exact of_quotient_center_nilpotent hnq
/-- 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).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
    IsNilpotent G := by
  

Proof state:
G : Type u_1
hG : Group G
inst✝ : Fintype G
e : ((p : { x // x ∈ (card G).primeFactors }) → (P : Sylow (↑p) G) → ↥↑P) ≃* G
⊢ Group.IsNilpotent G

Next tactic:
classical
    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
      exact P.isPGroup'.isNilpotent
    exact nilpotent_of_mulEquiv e
/-- 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).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
    IsNilpotent G := by
  classical
    

Proof state:
G : Type u_1
hG : Group G
inst✝ : Fintype G
e : ((p : { x // x ∈ (card G).primeFactors }) → (P : Sylow (↑p) G) → ↥↑P) ≃* G
⊢ Group.IsNilpotent G

Next tactic:
let ps := (Fintype.card G).primeFactors
/-- 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).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
    IsNilpotent G := by
  classical
    let ps := (Fintype.card G).primeFactors
    

Proof state:
G : Type u_1
hG : Group G
inst✝ : Fintype G
e : ((p : { x // x ∈ (card G).primeFactors }) → (P : Sylow (↑p) G) → ↥↑P) ≃* G
ps : Finset ℕ := (card G).primeFactors
⊢ Group.IsNilpotent G

Next tactic:
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
      exact P.isPGroup'.isNilpotent
/-- 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).primeFactors, ∀ P : Sylow p G, (↑P : Subgroup G)) ≃* G) :
    IsNilpotent G := by
  classical
    let ps := (Fintype.card G).primeFactors
    have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) := by
      

Proof state:
G : Type u_1
hG : Group G
inst✝ : Fintype G
e : ((p : { x // x ∈ (card G).primeFactors }) → (P : Sylow (↑p) G) → ↥↑P) ≃* G
ps : Finset ℕ := (card G).primeFactors
⊢ ∀ (p : { x // x ∈ ps }) (P : Sylow (↑p) G), Group.IsNilpotent ↥↑P

Next tactic:
intro p P