l3lab/ntp-mathlib huggingface dataset:
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step2 (K : Subgroup G) [K.Normal] (hK : K ≤ N) : K = ⊥ ∨ K = N := by
  have : Function.Surjective (QuotientGroup.mk' K) := Quotient.surjective_Quotient_mk''
  have h4 := step1 h1 h2 h3
  contrapose! h4
  have h5 : Fintype.card (G ⧸ K) < Fintype.card G := by
    rw [← index_eq_card, ← K.index_mul_card]
    refine'
      lt_mul_of_one_lt_right (Nat.pos_of_ne_zero index_ne_zero_of_finite)
        (K.one_lt_card_iff_ne_bot.mpr h4.1)
  have h6 :
    (Fintype.card (N.map (QuotientGroup.mk' K))).Coprime (N.map (QuotientGroup.mk' K)).index := by
    have index_map := N.index_map_eq this (by rwa [QuotientGroup.ker_mk'])
    have index_pos : 0 < N.index := Nat.pos_of_ne_zero index_ne_zero_of_finite
    rw [index_map]
    refine' h1.coprime_dvd_left _
    rw [← Nat.mul_dvd_mul_iff_left index_pos, index_mul_card, ← index_map, index_mul_card]
    exact K.card_quotient_dvd_card
  obtain ⟨H, hH⟩ := h2 (G ⧸ K) h5 h6
  refine' ⟨H.comap (QuotientGroup.mk' K), _, _⟩
  · have key : (N.map (QuotientGroup.mk' K)).comap (QuotientGroup.mk' K) = N := by
      refine' comap_map_eq_self _
      rwa [QuotientGroup.ker_mk']
    rwa [← key, comap_sup_eq, hH.symm.sup_eq_top, comap_top]
  · 

Proof state:
case intro.refine'_2
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup G
inst✝ : Normal K
hK : K ≤ N
this : Function.Surjective ⇑(QuotientGroup.mk' K)
h4 : K ≠ ⊥ ∧ K ≠ N
h5 : Fintype.card (G ⧸ K) < Fintype.card G
h6 : Nat.Coprime (Fintype.card ↥(map (QuotientGroup.mk' K) N)) (index (map (QuotientGroup.mk' K) N))
H : Subgroup (G ⧸ K)
hH : IsComplement' (map (QuotientGroup.mk' K) N) H
⊢ comap (QuotientGroup.mk' K) H ≠ ⊤

Next tactic:
rw [← comap_top (QuotientGroup.mk' K)]
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step2 (K : Subgroup G) [K.Normal] (hK : K ≤ N) : K = ⊥ ∨ K = N := by
  have : Function.Surjective (QuotientGroup.mk' K) := Quotient.surjective_Quotient_mk''
  have h4 := step1 h1 h2 h3
  contrapose! h4
  have h5 : Fintype.card (G ⧸ K) < Fintype.card G := by
    rw [← index_eq_card, ← K.index_mul_card]
    refine'
      lt_mul_of_one_lt_right (Nat.pos_of_ne_zero index_ne_zero_of_finite)
        (K.one_lt_card_iff_ne_bot.mpr h4.1)
  have h6 :
    (Fintype.card (N.map (QuotientGroup.mk' K))).Coprime (N.map (QuotientGroup.mk' K)).index := by
    have index_map := N.index_map_eq this (by rwa [QuotientGroup.ker_mk'])
    have index_pos : 0 < N.index := Nat.pos_of_ne_zero index_ne_zero_of_finite
    rw [index_map]
    refine' h1.coprime_dvd_left _
    rw [← Nat.mul_dvd_mul_iff_left index_pos, index_mul_card, ← index_map, index_mul_card]
    exact K.card_quotient_dvd_card
  obtain ⟨H, hH⟩ := h2 (G ⧸ K) h5 h6
  refine' ⟨H.comap (QuotientGroup.mk' K), _, _⟩
  · have key : (N.map (QuotientGroup.mk' K)).comap (QuotientGroup.mk' K) = N := by
      refine' comap_map_eq_self _
      rwa [QuotientGroup.ker_mk']
    rwa [← key, comap_sup_eq, hH.symm.sup_eq_top, comap_top]
  · rw [← comap_top (QuotientGroup.mk' K)]
    

Proof state:
case intro.refine'_2
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup G
inst✝ : Normal K
hK : K ≤ N
this : Function.Surjective ⇑(QuotientGroup.mk' K)
h4 : K ≠ ⊥ ∧ K ≠ N
h5 : Fintype.card (G ⧸ K) < Fintype.card G
h6 : Nat.Coprime (Fintype.card ↥(map (QuotientGroup.mk' K) N)) (index (map (QuotientGroup.mk' K) N))
H : Subgroup (G ⧸ K)
hH : IsComplement' (map (QuotientGroup.mk' K) N) H
⊢ comap (QuotientGroup.mk' K) H ≠ comap (QuotientGroup.mk' K) ⊤

Next tactic:
intro hH'
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step2 (K : Subgroup G) [K.Normal] (hK : K ≤ N) : K = ⊥ ∨ K = N := by
  have : Function.Surjective (QuotientGroup.mk' K) := Quotient.surjective_Quotient_mk''
  have h4 := step1 h1 h2 h3
  contrapose! h4
  have h5 : Fintype.card (G ⧸ K) < Fintype.card G := by
    rw [← index_eq_card, ← K.index_mul_card]
    refine'
      lt_mul_of_one_lt_right (Nat.pos_of_ne_zero index_ne_zero_of_finite)
        (K.one_lt_card_iff_ne_bot.mpr h4.1)
  have h6 :
    (Fintype.card (N.map (QuotientGroup.mk' K))).Coprime (N.map (QuotientGroup.mk' K)).index := by
    have index_map := N.index_map_eq this (by rwa [QuotientGroup.ker_mk'])
    have index_pos : 0 < N.index := Nat.pos_of_ne_zero index_ne_zero_of_finite
    rw [index_map]
    refine' h1.coprime_dvd_left _
    rw [← Nat.mul_dvd_mul_iff_left index_pos, index_mul_card, ← index_map, index_mul_card]
    exact K.card_quotient_dvd_card
  obtain ⟨H, hH⟩ := h2 (G ⧸ K) h5 h6
  refine' ⟨H.comap (QuotientGroup.mk' K), _, _⟩
  · have key : (N.map (QuotientGroup.mk' K)).comap (QuotientGroup.mk' K) = N := by
      refine' comap_map_eq_self _
      rwa [QuotientGroup.ker_mk']
    rwa [← key, comap_sup_eq, hH.symm.sup_eq_top, comap_top]
  · rw [← comap_top (QuotientGroup.mk' K)]
    intro hH'
    

Proof state:
case intro.refine'_2
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup G
inst✝ : Normal K
hK : K ≤ N
this : Function.Surjective ⇑(QuotientGroup.mk' K)
h4 : K ≠ ⊥ ∧ K ≠ N
h5 : Fintype.card (G ⧸ K) < Fintype.card G
h6 : Nat.Coprime (Fintype.card ↥(map (QuotientGroup.mk' K) N)) (index (map (QuotientGroup.mk' K) N))
H : Subgroup (G ⧸ K)
hH : IsComplement' (map (QuotientGroup.mk' K) N) H
hH' : comap (QuotientGroup.mk' K) H = comap (QuotientGroup.mk' K) ⊤
⊢ False

Next tactic:
rw [comap_injective this hH', isComplement'_top_right, map_eq_bot_iff,
      QuotientGroup.ker_mk'] at hH
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step2 (K : Subgroup G) [K.Normal] (hK : K ≤ N) : K = ⊥ ∨ K = N := by
  have : Function.Surjective (QuotientGroup.mk' K) := Quotient.surjective_Quotient_mk''
  have h4 := step1 h1 h2 h3
  contrapose! h4
  have h5 : Fintype.card (G ⧸ K) < Fintype.card G := by
    rw [← index_eq_card, ← K.index_mul_card]
    refine'
      lt_mul_of_one_lt_right (Nat.pos_of_ne_zero index_ne_zero_of_finite)
        (K.one_lt_card_iff_ne_bot.mpr h4.1)
  have h6 :
    (Fintype.card (N.map (QuotientGroup.mk' K))).Coprime (N.map (QuotientGroup.mk' K)).index := by
    have index_map := N.index_map_eq this (by rwa [QuotientGroup.ker_mk'])
    have index_pos : 0 < N.index := Nat.pos_of_ne_zero index_ne_zero_of_finite
    rw [index_map]
    refine' h1.coprime_dvd_left _
    rw [← Nat.mul_dvd_mul_iff_left index_pos, index_mul_card, ← index_map, index_mul_card]
    exact K.card_quotient_dvd_card
  obtain ⟨H, hH⟩ := h2 (G ⧸ K) h5 h6
  refine' ⟨H.comap (QuotientGroup.mk' K), _, _⟩
  · have key : (N.map (QuotientGroup.mk' K)).comap (QuotientGroup.mk' K) = N := by
      refine' comap_map_eq_self _
      rwa [QuotientGroup.ker_mk']
    rwa [← key, comap_sup_eq, hH.symm.sup_eq_top, comap_top]
  · rw [← comap_top (QuotientGroup.mk' K)]
    intro hH'
    rw [comap_injective this hH', isComplement'_top_right, map_eq_bot_iff,
      QuotientGroup.ker_mk'] at hH
    · 

Proof state:
case intro.refine'_2
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup G
inst✝ : Normal K
hK : K ≤ N
this : Function.Surjective ⇑(QuotientGroup.mk' K)
h4 : K ≠ ⊥ ∧ K ≠ N
h5 : Fintype.card (G ⧸ K) < Fintype.card G
h6 : Nat.Coprime (Fintype.card ↥(map (QuotientGroup.mk' K) N)) (index (map (QuotientGroup.mk' K) N))
H : Subgroup (G ⧸ K)
hH : N ≤ K
hH' : comap (QuotientGroup.mk' K) H = comap (QuotientGroup.mk' K) ⊤
⊢ False

Next tactic:
exact h4.2 (le_antisymm hK hH)
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
⊢ K = ⊥ ∨ K = ⊤

Next tactic:
have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = ⊥ ∨ map (Subgroup.subtype N) K = N
⊢ K = ⊥ ∨ K = ⊤

Next tactic:
rw [← map_bot N.subtype] at key
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N
⊢ K = ⊥ ∨ K = ⊤

Next tactic:
conv at key =>
    rhs
    rhs
    rw [← N.subtype_range, N.subtype.range_eq_map]
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  conv at key =>
    

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N
| map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N

Next tactic:
rhs
    rhs
    rw [← N.subtype_range, N.subtype.range_eq_map]
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  conv at key =>
    

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N
| map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N

Next tactic:
rhs
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  conv at key =>
    rhs
    

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N
| map (Subgroup.subtype N) K = N

Next tactic:
rhs
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  conv at key =>
    rhs
    rhs
    

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = N
| N

Next tactic:
rw [← N.subtype_range, N.subtype.range_eq_map]
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  conv at key =>
    rhs
    rhs
    rw [← N.subtype_range, N.subtype.range_eq_map]
  

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊤
⊢ K = ⊥ ∨ K = ⊤

Next tactic:
have inj := map_injective N.subtype_injective
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤ := by
  have key := step2 h1 h2 h3 (K.map N.subtype) (map_subtype_le K)
  rw [← map_bot N.subtype] at key
  conv at key =>
    rhs
    rhs
    rw [← N.subtype_range, N.subtype.range_eq_map]
  have inj := map_injective N.subtype_injective
  

Proof state:
G : Type u
inst✝³ : Group G
inst✝² : Fintype G
N : Subgroup G
inst✝¹ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
K : Subgroup ↥N
inst✝ : Normal (map (Subgroup.subtype N) K)
key : map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊥ ∨ map (Subgroup.subtype N) K = map (Subgroup.subtype N) ⊤
inj : Function.Injective (map (Subgroup.subtype N))
⊢ K = ⊥ ∨ K = ⊤

Next tactic:
rwa [inj.eq_iff, inj.eq_iff] at key
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step6 : IsPGroup (Fintype.card N).minFac N := by
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
⊢ IsPGroup (Nat.minFac (Fintype.card ↥N)) ↥N

Next tactic:
haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step6 : IsPGroup (Fintype.card N).minFac N := by
  haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
this : Fact (Nat.Prime (Nat.minFac (Fintype.card ↥N)))
⊢ IsPGroup (Nat.minFac (Fintype.card ↥N)) ↥N

Next tactic:
refine' Sylow.nonempty.elim fun P => P.2.of_surjective P.1.subtype _
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step6 : IsPGroup (Fintype.card N).minFac N := by
  haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
  refine' Sylow.nonempty.elim fun P => P.2.of_surjective P.1.subtype _
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
this : Fact (Nat.Prime (Nat.minFac (Fintype.card ↥N)))
P : Sylow (Nat.minFac (Fintype.card ↥N)) ↥N
⊢ Function.Surjective ⇑(Subgroup.subtype ↑P)

Next tactic:
rw [← MonoidHom.range_top_iff_surjective, subtype_range]
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step6 : IsPGroup (Fintype.card N).minFac N := by
  haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
  refine' Sylow.nonempty.elim fun P => P.2.of_surjective P.1.subtype _
  rw [← MonoidHom.range_top_iff_surjective, subtype_range]
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
this : Fact (Nat.Prime (Nat.minFac (Fintype.card ↥N)))
P : Sylow (Nat.minFac (Fintype.card ↥N)) ↥N
⊢ ↑P = ⊤

Next tactic:
haveI : (P.1.map N.subtype).Normal :=
    normalizer_eq_top.mp (step1 h1 h2 h3 (P.1.map N.subtype).normalizer P.normalizer_sup_eq_top)
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step6 : IsPGroup (Fintype.card N).minFac N := by
  haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
  refine' Sylow.nonempty.elim fun P => P.2.of_surjective P.1.subtype _
  rw [← MonoidHom.range_top_iff_surjective, subtype_range]
  haveI : (P.1.map N.subtype).Normal :=
    normalizer_eq_top.mp (step1 h1 h2 h3 (P.1.map N.subtype).normalizer P.normalizer_sup_eq_top)
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
this✝ : Fact (Nat.Prime (Nat.minFac (Fintype.card ↥N)))
P : Sylow (Nat.minFac (Fintype.card ↥N)) ↥N
this : Normal (map (Subgroup.subtype N) ↑P)
⊢ ↑P = ⊤

Next tactic:
exact (step3 h1 h2 h3 P.1).resolve_left (step5 h1 h3)
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
theorem step7 : IsCommutative N := by
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
⊢ IsCommutative N

Next tactic:
haveI := N.bot_or_nontrivial.resolve_left (step0 h1 h3)
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
theorem step7 : IsCommutative N := by
  haveI := N.bot_or_nontrivial.resolve_left (step0 h1 h3)
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
this : Nontrivial ↥N
⊢ IsCommutative N

Next tactic:
haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
theorem step7 : IsCommutative N := by
  haveI := N.bot_or_nontrivial.resolve_left (step0 h1 h3)
  haveI : Fact (Fintype.card N).minFac.Prime := ⟨step4 h1 h3⟩
  

Proof state:
G : Type u
inst✝² : Group G
inst✝¹ : Fintype G
N : Subgroup G
inst✝ : Normal N
h1 : Nat.Coprime (Fintype.card ↥N) (index N)
h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Fintype G'],
    Fintype.card G' < Fintype.card G →
      ∀ {N' : Subgroup G'} [inst_2 : Normal N'], Nat.Coprime (Fintype.card ↥N') (index N') → ∃ H', IsComplement' N' H'
h3 : ∀ (H : Subgroup G), ¬IsComplement' N H
this✝ : Nontrivial ↥N
this : Fact (Nat.Prime (Nat.minFac (Fintype.card ↥N)))
⊢ IsCommutative N

Next tactic:
exact
    ⟨⟨fun g h => ((eq_top_iff.mp ((step3 h1 h2 h3 (center N)).resolve_left
      (step6 h1 h2 h3).bot_lt_center.ne') (mem_top h)).comm g).symm⟩⟩