Theorem: Equiv.Perm.toList_formPerm_nontrivial
File: Mathlib/GroupTheory/Perm/Cycle/Concrete.lean

tactic: have hc : l.formPerm.IsCycle := List.isCycle_formPerm hn hl
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
⊢ l.formPerm.toList (l.get ⟨0, ⋯⟩) = l
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
⊢ l.formPerm.toList (l.get ⟨0, ⋯⟩) = l

tactic: have hs : l.formPerm.support = l.toFinset := by
  refine support_formPerm_of_nodup _ hn ?_
  rintro _ rfl
  simp [Nat.succ_le_succ_iff] at hl
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
⊢ l.formPerm.toList (l.get ⟨0, ⋯⟩) = l
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ l.formPerm.toList (l.get ⟨0, ⋯⟩) = l

tactic: rw [toList, hc.cycleOf_eq (mem_support.mp _), hs, card_toFinset, dedup_eq_self.mpr hn]
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ l.formPerm.toList (l.get ⟨0, ⋯⟩) = l
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length) = l

α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ l.get ⟨0, ⋯⟩ ∈ l.formPerm.support

tactic: refine support_formPerm_of_nodup _ hn ?_
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
⊢ l.formPerm.support = l.toFinset
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
⊢ ∀ (x : α), l ≠ [x]

tactic: rintro _ rfl
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
⊢ ∀ (x : α), l ≠ [x]
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x x✝ : α
hl : 2 ≤ [x✝].length
hn : [x✝].Nodup
hc : [x✝].formPerm.IsCycle
⊢ False

tactic: simp [Nat.succ_le_succ_iff] at hl
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x x✝ : α
hl : 2 ≤ [x✝].length
hn : [x✝].Nodup
hc : [x✝].formPerm.IsCycle
⊢ False
state_after: no goals

tactic: refine ext_getElem (by simp) fun k hk hk' => ?_
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length) = l
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
k : ℕ
hk : k < (map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length)).length
hk' : k < l.length
⊢ (map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length))[k] = l[k]

tactic: simp only [get_eq_getElem, formPerm_pow_apply_getElem _ hn, zero_add, getElem_map,
  getElem_range, Nat.mod_eq_of_lt hk']
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
k : ℕ
hk : k < (map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length)).length
hk' : k < l.length
⊢ (map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length))[k] = l[k]
state_after: no goals

tactic: simp
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ (map (fun k => (l.formPerm ^ k) (l.get ⟨0, ⋯⟩)) (range l.length)).length = l.length
state_after: no goals

tactic: simpa [hs] using get_mem _ _ _
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p : Perm α
x : α
l : List α
hl : 2 ≤ l.length
hn : l.Nodup
hc : l.formPerm.IsCycle
hs : l.formPerm.support = l.toFinset
⊢ l.get ⟨0, ⋯⟩ ∈ l.formPerm.support
state_after: no goals