l3lab/ntp-mathlib huggingface dataset:
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    

Proof state:
case induction_disjoint.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : σ' ∈ (cycleFactorsFinset τ).val
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
⊢ IsConj (σ * π) (σ' * (τ * σ'⁻¹))

Next tactic:
have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]; rfl
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : σ' ∈ (cycleFactorsFinset τ).val
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
⊢ cycleType σ = cycleType σ'

Next tactic:
rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : IsCycle σ' ∧ ∀ a ∈ support σ', σ' a = τ a
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
⊢ cycleType σ = cycleType σ'

Next tactic:
rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]; 

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : IsCycle σ' ∧ ∀ a ∈ support σ', σ' a = τ a
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
⊢ ↑[(Finset.card ∘ support) σ'] = ↑[Finset.card (support σ')]

Next tactic:
rfl
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]; rfl
    

Proof state:
case induction_disjoint.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : σ' ∈ (cycleFactorsFinset τ).val
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
hs : cycleType σ = cycleType σ'
⊢ IsConj (σ * π) (σ' * (τ * σ'⁻¹))

Next tactic:
refine' hd.isConj_mul (hσ hs) (hπ _) _
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]; rfl
    refine' hd.isConj_mul (hσ hs) (hπ _) _
    · 

Proof state:
case induction_disjoint.intro.intro.refine'_1
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : σ' ∈ (cycleFactorsFinset τ).val
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
hs : cycleType σ = cycleType σ'
⊢ cycleType π = cycleType (τ * σ'⁻¹)

Next tactic:
rw [cycleType_mul_inv_mem_cycleFactorsFinset_eq_sub, ← h, add_comm, hs,
        add_tsub_cancel_right]
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]; rfl
    refine' hd.isConj_mul (hσ hs) (hπ _) _
    · rw [cycleType_mul_inv_mem_cycleFactorsFinset_eq_sub, ← h, add_comm, hs,
        add_tsub_cancel_right]
      

Proof state:
case induction_disjoint.intro.intro.refine'_1
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : σ' ∈ (cycleFactorsFinset τ).val
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
hs : cycleType σ = cycleType σ'
⊢ σ' ∈ cycleFactorsFinset τ

Next tactic:
rwa [Finset.mem_def]
theorem isConj_of_cycleType_eq {σ τ : Perm α} (h : cycleType σ = cycleType τ) : IsConj σ τ := by
  induction σ using cycle_induction_on generalizing τ with
  | base_one =>
    rw [cycleType_one, eq_comm, cycleType_eq_zero] at h
    rw [h]
  | base_cycles σ hσ =>
    have hτ := card_cycleType_eq_one.2 hσ
    rw [h, card_cycleType_eq_one] at hτ
    apply hσ.isConj hτ
    rw [hσ.cycleType, hτ.cycleType, coe_eq_coe, List.singleton_perm] at h
    exact List.singleton_injective h
  | induction_disjoint σ π hd hc hσ hπ =>
    rw [hd.cycleType] at h
    have h' : σ.support.card ∈ τ.cycleType := by
      simp [← h, hc.cycleType]
    obtain ⟨σ', hσ'l, hσ'⟩ := Multiset.mem_map.mp h'
    have key : IsConj (σ' * τ * σ'⁻¹) τ := (isConj_iff.2 ⟨σ', rfl⟩).symm
    refine' IsConj.trans _ key
    rw [mul_assoc]
    have hs : σ.cycleType = σ'.cycleType := by
      rw [← Finset.mem_def, mem_cycleFactorsFinset_iff] at hσ'l
      rw [hc.cycleType, ← hσ', hσ'l.left.cycleType]; rfl
    refine' hd.isConj_mul (hσ hs) (hπ _) _
    · rw [cycleType_mul_inv_mem_cycleFactorsFinset_eq_sub, ← h, add_comm, hs,
        add_tsub_cancel_right]
      rwa [Finset.mem_def]
    · 

Proof state:
case induction_disjoint.intro.intro.refine'_2
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
hd : Disjoint σ π
hc : IsCycle σ
hσ : ∀ {τ : Perm α}, cycleType σ = cycleType τ → IsConj σ τ
hπ : ∀ {τ : Perm α}, cycleType π = cycleType τ → IsConj π τ
τ : Perm α
h : cycleType σ + cycleType π = cycleType τ
h' : Finset.card (support σ) ∈ cycleType τ
σ' : Perm α
hσ'l : σ' ∈ (cycleFactorsFinset τ).val
hσ' : (Finset.card ∘ support) σ' = Finset.card (support σ)
key : IsConj (σ' * τ * σ'⁻¹) τ
hs : cycleType σ = cycleType σ'
⊢ Disjoint σ' (τ * σ'⁻¹)

Next tactic:
exact (disjoint_mul_inv_of_mem_cycleFactorsFinset hσ'l).symm
theorem isConj_iff_cycleType_eq {σ τ : Perm α} : IsConj σ τ ↔ σ.cycleType = τ.cycleType :=
  ⟨fun h => by
    

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ τ : Perm α
h : IsConj σ τ
⊢ cycleType σ = cycleType τ

Next tactic:
obtain ⟨π, rfl⟩ := isConj_iff.1 h
theorem isConj_iff_cycleType_eq {σ τ : Perm α} : IsConj σ τ ↔ σ.cycleType = τ.cycleType :=
  ⟨fun h => by
    obtain ⟨π, rfl⟩ := isConj_iff.1 h
    

Proof state:
case intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
σ π : Perm α
h : IsConj σ (π * σ * π⁻¹)
⊢ cycleType σ = cycleType (π * σ * π⁻¹)

Next tactic:
rw [cycleType_conj]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  

Proof state:
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
g : Perm α
⊢ cycleType (extendDomain g f) = cycleType g

Next tactic:
induction g using cycle_induction_on with
  | base_one => rw [extendDomain_one, cycleType_one, cycleType_one]
  | base_cycles σ hσ =>
    rw [(hσ.extendDomain f).cycleType, hσ.cycleType, card_support_extend_domain]
  | induction_disjoint σ τ hd _ hσ hτ =>
    rw [hd.cycleType, ← extendDomain_mul, (hd.extendDomain f).cycleType, hσ, hτ]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  induction g using cycle_induction_on with
  

Proof state:
case base_one
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
⊢ cycleType (extendDomain 1 f) = cycleType 1

Next tactic:
| base_one => rw [extendDomain_one, cycleType_one, cycleType_one]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  induction g using cycle_induction_on with
  | base_one => 

Proof state:
case base_one
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
⊢ cycleType (extendDomain 1 f) = cycleType 1

Next tactic:
rw [extendDomain_one, cycleType_one, cycleType_one]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  induction g using cycle_induction_on with
  | base_one => rw [extendDomain_one, cycleType_one, cycleType_one]
  

Proof state:
case base_cycles
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
σ : Perm α
hσ : IsCycle σ
⊢ cycleType (extendDomain σ f) = cycleType σ

Next tactic:
| base_cycles σ hσ =>
    rw [(hσ.extendDomain f).cycleType, hσ.cycleType, card_support_extend_domain]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  induction g using cycle_induction_on with
  | base_one => rw [extendDomain_one, cycleType_one, cycleType_one]
  | base_cycles σ hσ =>
    

Proof state:
case base_cycles
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
σ : Perm α
hσ : IsCycle σ
⊢ cycleType (extendDomain σ f) = cycleType σ

Next tactic:
rw [(hσ.extendDomain f).cycleType, hσ.cycleType, card_support_extend_domain]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  induction g using cycle_induction_on with
  | base_one => rw [extendDomain_one, cycleType_one, cycleType_one]
  | base_cycles σ hσ =>
    rw [(hσ.extendDomain f).cycleType, hσ.cycleType, card_support_extend_domain]
  

Proof state:
case induction_disjoint
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
σ τ : Perm α
hd : Disjoint σ τ
a✝ : IsCycle σ
hσ : cycleType (extendDomain σ f) = cycleType σ
hτ : cycleType (extendDomain τ f) = cycleType τ
⊢ cycleType (extendDomain (σ * τ) f) = cycleType (σ * τ)

Next tactic:
| induction_disjoint σ τ hd _ hσ hτ =>
    rw [hd.cycleType, ← extendDomain_mul, (hd.extendDomain f).cycleType, hσ, hτ]
@[simp]
theorem cycleType_extendDomain {β : Type*} [Fintype β] [DecidableEq β] {p : β → Prop}
    [DecidablePred p] (f : α ≃ Subtype p) {g : Perm α} :
    cycleType (g.extendDomain f) = cycleType g := by
  induction g using cycle_induction_on with
  | base_one => rw [extendDomain_one, cycleType_one, cycleType_one]
  | base_cycles σ hσ =>
    rw [(hσ.extendDomain f).cycleType, hσ.cycleType, card_support_extend_domain]
  | induction_disjoint σ τ hd _ hσ hτ =>
    

Proof state:
case induction_disjoint
α : Type u_1
inst✝⁴ : Fintype α
inst✝³ : DecidableEq α
β : Type u_2
inst✝² : Fintype β
inst✝¹ : DecidableEq β
p : β → Prop
inst✝ : DecidablePred p
f : α ≃ Subtype p
σ τ : Perm α
hd : Disjoint σ τ
a✝ : IsCycle σ
hσ : cycleType (extendDomain σ f) = cycleType σ
hτ : cycleType (extendDomain τ f) = cycleType τ
⊢ cycleType (extendDomain (σ * τ) f) = cycleType (σ * τ)

Next tactic:
rw [hd.cycleType, ← extendDomain_mul, (hd.extendDomain f).cycleType, hσ, hτ]
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  

Proof state:
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
n : ℕ
σ : Perm α
⊢ n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ Finset.card (support c) = n

Next tactic:
constructor
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · 

Proof state:
case mp
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
n : ℕ
σ : Perm α
⊢ n ∈ cycleType σ → ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ Finset.card (support c) = n

Next tactic:
intro h
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · intro h
    

Proof state:
case mp
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
n : ℕ
σ : Perm α
h : n ∈ cycleType σ
⊢ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ Finset.card (support c) = n

Next tactic:
obtain ⟨l, rfl, hlc, hld⟩ := truncCycleFactors σ
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · intro h
    obtain ⟨l, rfl, hlc, hld⟩ := truncCycleFactors σ
    

Proof state:
case mp.mk.mk.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
n : ℕ
l : List (Perm α)
h : n ∈ cycleType (List.prod l)
x✝ : Trunc { l_1 // List.prod l_1 = List.prod l ∧ (∀ g ∈ l_1, IsCycle g) ∧ List.Pairwise Disjoint l_1 }
hlc : ∀ g ∈ l, IsCycle g
hld : List.Pairwise Disjoint l
⊢ ∃ c τ, List.prod l = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ Finset.card (support c) = n

Next tactic:
rw [cycleType_eq _ rfl hlc hld, Multiset.mem_coe, List.mem_map] at h
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · intro h
    obtain ⟨l, rfl, hlc, hld⟩ := truncCycleFactors σ
    rw [cycleType_eq _ rfl hlc hld, Multiset.mem_coe, List.mem_map] at h
    

Proof state:
case mp.mk.mk.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
n : ℕ
l : List (Perm α)
h : ∃ a ∈ l, (Finset.card ∘ support) a = n
x✝ : Trunc { l_1 // List.prod l_1 = List.prod l ∧ (∀ g ∈ l_1, IsCycle g) ∧ List.Pairwise Disjoint l_1 }
hlc : ∀ g ∈ l, IsCycle g
hld : List.Pairwise Disjoint l
⊢ ∃ c τ, List.prod l = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ Finset.card (support c) = n

Next tactic:
obtain ⟨c, cl, rfl⟩ := h
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · intro h
    obtain ⟨l, rfl, hlc, hld⟩ := truncCycleFactors σ
    rw [cycleType_eq _ rfl hlc hld, Multiset.mem_coe, List.mem_map] at h
    obtain ⟨c, cl, rfl⟩ := h
    

Proof state:
case mp.mk.mk.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
l : List (Perm α)
x✝ : Trunc { l_1 // List.prod l_1 = List.prod l ∧ (∀ g ∈ l_1, IsCycle g) ∧ List.Pairwise Disjoint l_1 }
hlc : ∀ g ∈ l, IsCycle g
hld : List.Pairwise Disjoint l
c : Perm α
cl : c ∈ l
⊢ ∃ c_1 τ, List.prod l = c_1 * τ ∧ Disjoint c_1 τ ∧ IsCycle c_1 ∧ Finset.card (support c_1) = (Finset.card ∘ support) c

Next tactic:
rw [(List.perm_cons_erase cl).pairwise_iff @(Disjoint.symmetric)] at hld
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · intro h
    obtain ⟨l, rfl, hlc, hld⟩ := truncCycleFactors σ
    rw [cycleType_eq _ rfl hlc hld, Multiset.mem_coe, List.mem_map] at h
    obtain ⟨c, cl, rfl⟩ := h
    rw [(List.perm_cons_erase cl).pairwise_iff @(Disjoint.symmetric)] at hld
    

Proof state:
case mp.mk.mk.intro.intro.intro.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
l : List (Perm α)
x✝ : Trunc { l_1 // List.prod l_1 = List.prod l ∧ (∀ g ∈ l_1, IsCycle g) ∧ List.Pairwise Disjoint l_1 }
hlc : ∀ g ∈ l, IsCycle g
c : Perm α
hld : List.Pairwise (fun x y => Disjoint x y) (c :: List.erase l c)
cl : c ∈ l
⊢ ∃ c_1 τ, List.prod l = c_1 * τ ∧ Disjoint c_1 τ ∧ IsCycle c_1 ∧ Finset.card (support c_1) = (Finset.card ∘ support) c

Next tactic:
refine' ⟨c, (l.erase c).prod, _, _, hlc _ cl, rfl⟩
theorem mem_cycleType_iff {n : ℕ} {σ : Perm α} :
    n ∈ cycleType σ ↔ ∃ c τ, σ = c * τ ∧ Disjoint c τ ∧ IsCycle c ∧ c.support.card = n := by
  constructor
  · intro h
    obtain ⟨l, rfl, hlc, hld⟩ := truncCycleFactors σ
    rw [cycleType_eq _ rfl hlc hld, Multiset.mem_coe, List.mem_map] at h
    obtain ⟨c, cl, rfl⟩ := h
    rw [(List.perm_cons_erase cl).pairwise_iff @(Disjoint.symmetric)] at hld
    refine' ⟨c, (l.erase c).prod, _, _, hlc _ cl, rfl⟩
    · 

Proof state:
case mp.mk.mk.intro.intro.intro.intro.refine'_1
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
l : List (Perm α)
x✝ : Trunc { l_1 // List.prod l_1 = List.prod l ∧ (∀ g ∈ l_1, IsCycle g) ∧ List.Pairwise Disjoint l_1 }
hlc : ∀ g ∈ l, IsCycle g
c : Perm α
hld : List.Pairwise (fun x y => Disjoint x y) (c :: List.erase l c)
cl : c ∈ l
⊢ List.prod l = c * List.prod (List.erase l c)

Next tactic:
rw [← List.prod_cons, (List.perm_cons_erase cl).symm.prod_eq' (hld.imp Disjoint.commute)]