l3lab/ntp-mathlib huggingface dataset:
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    

Proof state:
case intro
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
⊢ σ ∈ l ↔ ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a

Next tactic:
constructor
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · 

Proof state:
case intro.mp
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
⊢ σ ∈ l → ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a

Next tactic:
intro h a ha
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      

Proof state:
case intro.mp
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : σ ∈ l
a : α
ha : σ a ≠ a
⊢ σ a = (List.prod l) a

Next tactic:
exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · 

Proof state:
case intro.mpr
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
⊢ (∀ (a : α), σ a ≠ a → σ a = (List.prod l) a) → σ ∈ l

Next tactic:
intro h
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      

Proof state:
case intro.mpr
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
⊢ σ ∈ l

Next tactic:
have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
⊢ support σ ⊆ support (List.prod l)

Next tactic:
intro x hx
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
x : α
hx : x ∈ support σ
⊢ x ∈ support (List.prod l)

Next tactic:
rw [mem_support] at hx
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
x : α
hx : σ x ≠ x
⊢ x ∈ support (List.prod l)

Next tactic:
rwa [mem_support, ← h _ hx]
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      

Proof state:
case intro.mpr
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
⊢ σ ∈ l

Next tactic:
obtain ⟨a, ha, -⟩ := id h3
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      

Proof state:
case intro.mpr.intro.intro
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : σ a ≠ a
⊢ σ ∈ l

Next tactic:
rw [← mem_support] at ha
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      

Proof state:
case intro.mpr.intro.intro
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
⊢ σ ∈ l

Next tactic:
obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      

Proof state:
case intro.mpr.intro.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
⊢ σ ∈ l

Next tactic:
have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
      

Proof state:
case intro.mpr.intro.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
hτl : ∀ x ∈ support τ, τ x = (List.prod l) x
⊢ σ ∈ l

Next tactic:
have key : ∀ x ∈ σ.support ∩ τ.support, σ x = τ x := by
        intro x hx
        rw [h x (mem_support.mp (mem_of_mem_inter_left hx)), hτl x (mem_of_mem_inter_right hx)]
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
      have key : ∀ x ∈ σ.support ∩ τ.support, σ x = τ x := by
        

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
hτl : ∀ x ∈ support τ, τ x = (List.prod l) x
⊢ ∀ x ∈ support σ ∩ support τ, σ x = τ x

Next tactic:
intro x hx
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
      have key : ∀ x ∈ σ.support ∩ τ.support, σ x = τ x := by
        intro x hx
        

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
hτl : ∀ x ∈ support τ, τ x = (List.prod l) x
x : α
hx : x ∈ support σ ∩ support τ
⊢ σ x = τ x

Next tactic:
rw [h x (mem_support.mp (mem_of_mem_inter_left hx)), hτl x (mem_of_mem_inter_right hx)]
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
      have key : ∀ x ∈ σ.support ∩ τ.support, σ x = τ x := by
        intro x hx
        rw [h x (mem_support.mp (mem_of_mem_inter_left hx)), hτl x (mem_of_mem_inter_right hx)]
      

Proof state:
case intro.mpr.intro.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
hτl : ∀ x ∈ support τ, τ x = (List.prod l) x
key : ∀ x ∈ support σ ∩ support τ, σ x = τ x
⊢ σ ∈ l

Next tactic:
convert hτ
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
      have key : ∀ x ∈ σ.support ∩ τ.support, σ x = τ x := by
        intro x hx
        rw [h x (mem_support.mp (mem_of_mem_inter_left hx)), hτl x (mem_of_mem_inter_right hx)]
      convert hτ
      

Proof state:
case h.e'_4
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
hτl : ∀ x ∈ support τ, τ x = (List.prod l) x
key : ∀ x ∈ support σ ∩ support τ, σ x = τ x
⊢ σ = τ

Next tactic:
refine' h3.eq_on_support_inter_nonempty_congr (h1 _ hτ) key _ ha
theorem mem_list_cycles_iff {α : Type*} [Finite α] {l : List (Perm α)}
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) {σ : Perm α} :
    σ ∈ l ↔ σ.IsCycle ∧ ∀ a, σ a ≠ a → σ a = l.prod a := by
  suffices σ.IsCycle → (σ ∈ l ↔ ∀ a, σ a ≠ a → σ a = l.prod a) by
    exact ⟨fun hσ => ⟨h1 σ hσ, (this (h1 σ hσ)).mp hσ⟩, fun hσ => (this hσ.1).mpr hσ.2⟩
  intro h3
  classical
    cases nonempty_fintype α
    constructor
    · intro h a ha
      exact eq_on_support_mem_disjoint h h2 _ (mem_support.mpr ha)
    · intro h
      have hσl : σ.support ⊆ l.prod.support := by
        intro x hx
        rw [mem_support] at hx
        rwa [mem_support, ← h _ hx]
      obtain ⟨a, ha, -⟩ := id h3
      rw [← mem_support] at ha
      obtain ⟨τ, hτ, hτa⟩ := exists_mem_support_of_mem_support_prod (hσl ha)
      have hτl : ∀ x ∈ τ.support, τ x = l.prod x := eq_on_support_mem_disjoint hτ h2
      have key : ∀ x ∈ σ.support ∩ τ.support, σ x = τ x := by
        intro x hx
        rw [h x (mem_support.mp (mem_of_mem_inter_left hx)), hτl x (mem_of_mem_inter_right hx)]
      convert hτ
      refine' h3.eq_on_support_inter_nonempty_congr (h1 _ hτ) key _ ha
      

Proof state:
case h.e'_4
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l : List (Perm α)
h1 : ∀ σ ∈ l, IsCycle σ
h2 : List.Pairwise Disjoint l
σ : Perm α
h3 : IsCycle σ
val✝ : Fintype α
h : ∀ (a : α), σ a ≠ a → σ a = (List.prod l) a
hσl : support σ ⊆ support (List.prod l)
a : α
ha : a ∈ support σ
τ : Perm α
hτ : τ ∈ l
hτa : a ∈ support τ
hτl : ∀ x ∈ support τ, τ x = (List.prod l) x
key : ∀ x ∈ support σ ∩ support τ, σ x = τ x
⊢ σ a = τ a

Next tactic:
exact key a (mem_inter_of_mem ha hτa)
open scoped List in
theorem list_cycles_perm_list_cycles {α : Type*} [Finite α] {l₁ l₂ : List (Perm α)}
    (h₀ : l₁.prod = l₂.prod) (h₁l₁ : ∀ σ : Perm α, σ ∈ l₁ → σ.IsCycle)
    (h₁l₂ : ∀ σ : Perm α, σ ∈ l₂ → σ.IsCycle) (h₂l₁ : l₁.Pairwise Disjoint)
    (h₂l₂ : l₂.Pairwise Disjoint) : l₁ ~ l₂ := by
  

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l₁ l₂ : List (Perm α)
h₀ : List.prod l₁ = List.prod l₂
h₁l₁ : ∀ σ ∈ l₁, IsCycle σ
h₁l₂ : ∀ σ ∈ l₂, IsCycle σ
h₂l₁ : List.Pairwise Disjoint l₁
h₂l₂ : List.Pairwise Disjoint l₂
⊢ l₁ ~ l₂

Next tactic:
classical
    refine'
      (List.perm_ext_iff_of_nodup (nodup_of_pairwise_disjoint_cycles h₁l₁ h₂l₁)
            (nodup_of_pairwise_disjoint_cycles h₁l₂ h₂l₂)).mpr
        fun σ => _
    by_cases hσ : σ.IsCycle
    · obtain _ := not_forall.mp (mt ext hσ.ne_one)
      rw [mem_list_cycles_iff h₁l₁ h₂l₁, mem_list_cycles_iff h₁l₂ h₂l₂, h₀]
    · exact iff_of_false (mt (h₁l₁ σ) hσ) (mt (h₁l₂ σ) hσ)
open scoped List in
theorem list_cycles_perm_list_cycles {α : Type*} [Finite α] {l₁ l₂ : List (Perm α)}
    (h₀ : l₁.prod = l₂.prod) (h₁l₁ : ∀ σ : Perm α, σ ∈ l₁ → σ.IsCycle)
    (h₁l₂ : ∀ σ : Perm α, σ ∈ l₂ → σ.IsCycle) (h₂l₁ : l₁.Pairwise Disjoint)
    (h₂l₂ : l₂.Pairwise Disjoint) : l₁ ~ l₂ := by
  classical
    

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l₁ l₂ : List (Perm α)
h₀ : List.prod l₁ = List.prod l₂
h₁l₁ : ∀ σ ∈ l₁, IsCycle σ
h₁l₂ : ∀ σ ∈ l₂, IsCycle σ
h₂l₁ : List.Pairwise Disjoint l₁
h₂l₂ : List.Pairwise Disjoint l₂
⊢ l₁ ~ l₂

Next tactic:
refine'
      (List.perm_ext_iff_of_nodup (nodup_of_pairwise_disjoint_cycles h₁l₁ h₂l₁)
            (nodup_of_pairwise_disjoint_cycles h₁l₂ h₂l₂)).mpr
        fun σ => _
open scoped List in
theorem list_cycles_perm_list_cycles {α : Type*} [Finite α] {l₁ l₂ : List (Perm α)}
    (h₀ : l₁.prod = l₂.prod) (h₁l₁ : ∀ σ : Perm α, σ ∈ l₁ → σ.IsCycle)
    (h₁l₂ : ∀ σ : Perm α, σ ∈ l₂ → σ.IsCycle) (h₂l₁ : l₁.Pairwise Disjoint)
    (h₂l₂ : l₂.Pairwise Disjoint) : l₁ ~ l₂ := by
  classical
    refine'
      (List.perm_ext_iff_of_nodup (nodup_of_pairwise_disjoint_cycles h₁l₁ h₂l₁)
            (nodup_of_pairwise_disjoint_cycles h₁l₂ h₂l₂)).mpr
        fun σ => _
    

Proof state:
ι : Type u_1
α✝ : Type u_2
β : Type u_3
inst✝¹ : DecidableEq α✝
α : Type u_4
inst✝ : Finite α
l₁ l₂ : List (Perm α)
h₀ : List.prod l₁ = List.prod l₂
h₁l₁ : ∀ σ ∈ l₁, IsCycle σ
h₁l₂ : ∀ σ ∈ l₂, IsCycle σ
h₂l₁ : List.Pairwise Disjoint l₁
h₂l₂ : List.Pairwise Disjoint l₂
σ : Perm α
⊢ σ ∈ l₁ ↔ σ ∈ l₂

Next tactic:
by_cases hσ : σ.IsCycle