l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · 

Proof state:
case hind.zero
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
l : List (Perm α)
hl : ∀ g ∈ l, IsSwap g
hn : List.length l = 2 * Nat.zero
⊢ List.prod l ∈ closure {σ | IsThreeCycle σ}

Next tactic:
simp [List.length_eq_zero.1 hn, one_mem]
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    

Proof state:
case hind.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
l : List (Perm α)
hl : ∀ g ∈ l, IsSwap g
hn : List.length l = 2 * Nat.succ n
⊢ List.prod l ∈ closure {σ | IsThreeCycle σ}

Next tactic:
rw [Nat.mul_succ] at hn
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    rw [Nat.mul_succ] at hn
    

Proof state:
case hind.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
l : List (Perm α)
hl : ∀ g ∈ l, IsSwap g
hn : List.length l = 2 * n + 2
⊢ List.prod l ∈ closure {σ | IsThreeCycle σ}

Next tactic:
obtain ⟨a, l, rfl⟩ := l.exists_of_length_succ hn
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    rw [Nat.mul_succ] at hn
    obtain ⟨a, l, rfl⟩ := l.exists_of_length_succ hn
    

Proof state:
case hind.succ.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
a : Perm α
l : List (Perm α)
hl : ∀ g ∈ a :: l, IsSwap g
hn : List.length (a :: l) = 2 * n + 2
⊢ List.prod (a :: l) ∈ closure {σ | IsThreeCycle σ}

Next tactic:
rw [List.length_cons, Nat.succ_inj'] at hn
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    rw [Nat.mul_succ] at hn
    obtain ⟨a, l, rfl⟩ := l.exists_of_length_succ hn
    rw [List.length_cons, Nat.succ_inj'] at hn
    

Proof state:
case hind.succ.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
a : Perm α
l : List (Perm α)
hl : ∀ g ∈ a :: l, IsSwap g
hn : List.length l = 2 * n + 1
⊢ List.prod (a :: l) ∈ closure {σ | IsThreeCycle σ}

Next tactic:
obtain ⟨b, l, rfl⟩ := l.exists_of_length_succ hn
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    rw [Nat.mul_succ] at hn
    obtain ⟨a, l, rfl⟩ := l.exists_of_length_succ hn
    rw [List.length_cons, Nat.succ_inj'] at hn
    obtain ⟨b, l, rfl⟩ := l.exists_of_length_succ hn
    

Proof state:
case hind.succ.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
a b : Perm α
l : List (Perm α)
hl : ∀ g ∈ a :: b :: l, IsSwap g
hn : List.length (b :: l) = 2 * n + 1
⊢ List.prod (a :: b :: l) ∈ closure {σ | IsThreeCycle σ}

Next tactic:
rw [List.prod_cons, List.prod_cons, ← mul_assoc]
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    rw [Nat.mul_succ] at hn
    obtain ⟨a, l, rfl⟩ := l.exists_of_length_succ hn
    rw [List.length_cons, Nat.succ_inj'] at hn
    obtain ⟨b, l, rfl⟩ := l.exists_of_length_succ hn
    rw [List.prod_cons, List.prod_cons, ← mul_assoc]
    

Proof state:
case hind.succ.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
a b : Perm α
l : List (Perm α)
hl : ∀ g ∈ a :: b :: l, IsSwap g
hn : List.length (b :: l) = 2 * n + 1
⊢ a * b * List.prod l ∈ closure {σ | IsThreeCycle σ}

Next tactic:
rw [List.length_cons, Nat.succ_inj'] at hn
@[simp]
theorem closure_three_cycles_eq_alternating :
    closure { σ : Perm α | IsThreeCycle σ } = alternatingGroup α :=
  closure_eq_of_le _ (fun σ hσ => mem_alternatingGroup.2 hσ.sign) fun σ hσ => by
    suffices hind :
      ∀ (n : ℕ) (l : List (Perm α)) (_ : ∀ g, g ∈ l → IsSwap g) (_ : l.length = 2 * n),
        l.prod ∈ closure { σ : Perm α | IsThreeCycle σ }
    · obtain ⟨l, rfl, hl⟩ := truncSwapFactors σ
      obtain ⟨n, hn⟩ := (prod_list_swap_mem_alternatingGroup_iff_even_length hl).1 hσ
      rw [← two_mul] at hn
      exact hind n l hl hn
    intro n
    induction' n with n ih <;> intro l hl hn
    · simp [List.length_eq_zero.1 hn, one_mem]
    rw [Nat.mul_succ] at hn
    obtain ⟨a, l, rfl⟩ := l.exists_of_length_succ hn
    rw [List.length_cons, Nat.succ_inj'] at hn
    obtain ⟨b, l, rfl⟩ := l.exists_of_length_succ hn
    rw [List.prod_cons, List.prod_cons, ← mul_assoc]
    rw [List.length_cons, Nat.succ_inj'] at hn
    

Proof state:
case hind.succ.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ : Perm α
hσ : σ ∈ alternatingGroup α
n : ℕ
ih : ∀ (l : List (Perm α)), (∀ g ∈ l, IsSwap g) → List.length l = 2 * n → List.prod l ∈ closure {σ | IsThreeCycle σ}
a b : Perm α
l : List (Perm α)
hl : ∀ g ∈ a :: b :: l, IsSwap g
hn : List.length l = 2 * n
⊢ a * b * List.prod l ∈ closure {σ | IsThreeCycle σ}

Next tactic:
exact
      mul_mem
        (IsSwap.mul_mem_closure_three_cycles (hl a (List.mem_cons_self a _))
          (hl b (List.mem_cons_of_mem a (l.mem_cons_self b))))
        (ih _ (fun g hg => hl g (List.mem_cons_of_mem _ (List.mem_cons_of_mem _ hg))) hn)
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
⊢ ⊤ ≤ normalClosure {{ val := f, property := (_ : f ∈ alternatingGroup α) }}

Next tactic:
have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
⊢ ⊤ ≤ normalClosure {{ val := f, property := (_ : f ∈ alternatingGroup α) }}

Next tactic:
refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
⊢ map (Subgroup.subtype (alternatingGroup α)) ⊤ ≤
    map (Subgroup.subtype (alternatingGroup α)) (normalClosure {{ val := f, property := (_ : f ∈ alternatingGroup α) }})

Next tactic:
rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
⊢ alternatingGroup α ≤
    closure
      (⇑(Subgroup.subtype (alternatingGroup α)) ''
        Group.conjugatesOfSet {{ val := f, property := (_ : f ∈ alternatingGroup α) }})

Next tactic:
refine' (le_of_eq closure_three_cycles_eq_alternating.symm).trans (closure_mono _)
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
      refine' (le_of_eq closure_three_cycles_eq_alternating.symm).trans (closure_mono _)
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
⊢ {σ | IsThreeCycle σ} ⊆
    ⇑(Subgroup.subtype (alternatingGroup α)) ''
      Group.conjugatesOfSet {{ val := f, property := (_ : f ∈ alternatingGroup α) }}

Next tactic:
intro g h
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
      refine' (le_of_eq closure_three_cycles_eq_alternating.symm).trans (closure_mono _)
      intro g h
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
g : Perm α
h : g ∈ {σ | IsThreeCycle σ}
⊢ g ∈
    ⇑(Subgroup.subtype (alternatingGroup α)) ''
      Group.conjugatesOfSet {{ val := f, property := (_ : f ∈ alternatingGroup α) }}

Next tactic:
obtain ⟨c, rfl⟩ := isConj_iff.1 (isConj_iff_cycleType_eq.2 (hf.trans h.symm))
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
      refine' (le_of_eq closure_three_cycles_eq_alternating.symm).trans (closure_mono _)
      intro g h
      obtain ⟨c, rfl⟩ := isConj_iff.1 (isConj_iff_cycleType_eq.2 (hf.trans h.symm))
      

Proof state:
case intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
c : Perm α
h : c * f * c⁻¹ ∈ {σ | IsThreeCycle σ}
⊢ c * f * c⁻¹ ∈
    ⇑(Subgroup.subtype (alternatingGroup α)) ''
      Group.conjugatesOfSet {{ val := f, property := (_ : f ∈ alternatingGroup α) }}

Next tactic:
refine' ⟨⟨c * f * c⁻¹, h.mem_alternatingGroup⟩, _, rfl⟩
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
      refine' (le_of_eq closure_three_cycles_eq_alternating.symm).trans (closure_mono _)
      intro g h
      obtain ⟨c, rfl⟩ := isConj_iff.1 (isConj_iff_cycleType_eq.2 (hf.trans h.symm))
      refine' ⟨⟨c * f * c⁻¹, h.mem_alternatingGroup⟩, _, rfl⟩
      

Proof state:
case intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
c : Perm α
h : c * f * c⁻¹ ∈ {σ | IsThreeCycle σ}
⊢ { val := c * f * c⁻¹, property := (_ : c * f * c⁻¹ ∈ alternatingGroup α) } ∈
    Group.conjugatesOfSet {{ val := f, property := (_ : f ∈ alternatingGroup α) }}

Next tactic:
rw [Group.mem_conjugatesOfSet_iff]
/-- A key lemma to prove $A_5$ is simple. Shows that any normal subgroup of an alternating group on
  at least 5 elements is the entire alternating group if it contains a 3-cycle. -/
theorem IsThreeCycle.alternating_normalClosure (h5 : 5 ≤ Fintype.card α) {f : Perm α}
    (hf : IsThreeCycle f) :
    normalClosure ({⟨f, hf.mem_alternatingGroup⟩} : Set (alternatingGroup α)) = ⊤ :=
  eq_top_iff.2
    (by
      have hi : Function.Injective (alternatingGroup α).subtype := Subtype.coe_injective
      refine' eq_top_iff.1 (map_injective hi (le_antisymm (map_mono le_top) _))
      rw [← MonoidHom.range_eq_map, subtype_range, normalClosure, MonoidHom.map_closure]
      refine' (le_of_eq closure_three_cycles_eq_alternating.symm).trans (closure_mono _)
      intro g h
      obtain ⟨c, rfl⟩ := isConj_iff.1 (isConj_iff_cycleType_eq.2 (hf.trans h.symm))
      refine' ⟨⟨c * f * c⁻¹, h.mem_alternatingGroup⟩, _, rfl⟩
      rw [Group.mem_conjugatesOfSet_iff]
      

Proof state:
case intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
h5 : 5 ≤ card α
f : Perm α
hf : IsThreeCycle f
hi : Function.Injective ⇑(Subgroup.subtype (alternatingGroup α))
c : Perm α
h : c * f * c⁻¹ ∈ {σ | IsThreeCycle σ}
⊢ ∃ a ∈ {{ val := f, property := (_ : f ∈ alternatingGroup α) }},
    IsConj a { val := c * f * c⁻¹, property := (_ : c * f * c⁻¹ ∈ alternatingGroup α) }

Next tactic:
exact ⟨⟨f, hf.mem_alternatingGroup⟩, Set.mem_singleton _, isThreeCycle_isConj h5 hf h⟩
/-- Part of proving $A_5$ is simple. Shows that the square of any element of $A_5$ with a 3-cycle in
  its cycle decomposition is a 3-cycle, so the normal closure of the original element must be
  $A_5$. -/
theorem isThreeCycle_sq_of_three_mem_cycleType_five {g : Perm (Fin 5)} (h : 3 ∈ cycleType g) :
    IsThreeCycle (g * g) := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
g : Perm (Fin 5)
h : 3 ∈ cycleType g
⊢ IsThreeCycle (g * g)

Next tactic:
obtain ⟨c, g', rfl, hd, _, h3⟩ := mem_cycleType_iff.1 h
/-- Part of proving $A_5$ is simple. Shows that the square of any element of $A_5$ with a 3-cycle in
  its cycle decomposition is a 3-cycle, so the normal closure of the original element must be
  $A_5$. -/
theorem isThreeCycle_sq_of_three_mem_cycleType_five {g : Perm (Fin 5)} (h : 3 ∈ cycleType g) :
    IsThreeCycle (g * g) := by
  obtain ⟨c, g', rfl, hd, _, h3⟩ := mem_cycleType_iff.1 h
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
c g' : Perm (Fin 5)
h : 3 ∈ cycleType (c * g')
hd : Disjoint c g'
left✝ : IsCycle c
h3 : Finset.card (support c) = 3
⊢ IsThreeCycle (c * g' * (c * g'))

Next tactic:
simp only [mul_assoc]
/-- Part of proving $A_5$ is simple. Shows that the square of any element of $A_5$ with a 3-cycle in
  its cycle decomposition is a 3-cycle, so the normal closure of the original element must be
  $A_5$. -/
theorem isThreeCycle_sq_of_three_mem_cycleType_five {g : Perm (Fin 5)} (h : 3 ∈ cycleType g) :
    IsThreeCycle (g * g) := by
  obtain ⟨c, g', rfl, hd, _, h3⟩ := mem_cycleType_iff.1 h
  simp only [mul_assoc]
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
c g' : Perm (Fin 5)
h : 3 ∈ cycleType (c * g')
hd : Disjoint c g'
left✝ : IsCycle c
h3 : Finset.card (support c) = 3
⊢ IsThreeCycle (c * (g' * (c * g')))

Next tactic:
rw [hd.commute.eq, ← mul_assoc g']
/-- Part of proving $A_5$ is simple. Shows that the square of any element of $A_5$ with a 3-cycle in
  its cycle decomposition is a 3-cycle, so the normal closure of the original element must be
  $A_5$. -/
theorem isThreeCycle_sq_of_three_mem_cycleType_five {g : Perm (Fin 5)} (h : 3 ∈ cycleType g) :
    IsThreeCycle (g * g) := by
  obtain ⟨c, g', rfl, hd, _, h3⟩ := mem_cycleType_iff.1 h
  simp only [mul_assoc]
  rw [hd.commute.eq, ← mul_assoc g']
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
c g' : Perm (Fin 5)
h : 3 ∈ cycleType (c * g')
hd : Disjoint c g'
left✝ : IsCycle c
h3 : Finset.card (support c) = 3
⊢ IsThreeCycle (c * (g' * g' * c))

Next tactic:
suffices hg' : orderOf g' ∣ 2
/-- Part of proving $A_5$ is simple. Shows that the square of any element of $A_5$ with a 3-cycle in
  its cycle decomposition is a 3-cycle, so the normal closure of the original element must be
  $A_5$. -/
theorem isThreeCycle_sq_of_three_mem_cycleType_five {g : Perm (Fin 5)} (h : 3 ∈ cycleType g) :
    IsThreeCycle (g * g) := by
  obtain ⟨c, g', rfl, hd, _, h3⟩ := mem_cycleType_iff.1 h
  simp only [mul_assoc]
  rw [hd.commute.eq, ← mul_assoc g']
  suffices hg' : orderOf g' ∣ 2
  · 

Proof state:
case intro.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
c g' : Perm (Fin 5)
h : 3 ∈ cycleType (c * g')
hd : Disjoint c g'
left✝ : IsCycle c
h3 : Finset.card (support c) = 3
hg' : orderOf g' ∣ 2
⊢ IsThreeCycle (c * (g' * g' * c))

Next tactic:
rw [← pow_two, orderOf_dvd_iff_pow_eq_one.1 hg', one_mul]