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

tactic: by_cases hx : p x = x
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
⊢ Nodup (toList p x)

tactic: have hc : IsCycle (cycleOf p x) := isCycle_cycleOf p hx
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx : ¬↑p x = x
⊢ Nodup (toList p x)

tactic: rw [nodup_iff_nthLe_inj]
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx : ¬↑p x = x
hc : IsCycle (cycleOf p x)
⊢ Nodup (toList p x)

tactic: rintro n m hn hm
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx : ¬↑p x = x
hc : IsCycle (cycleOf p x)
⊢ ∀ (i j : ℕ) (h₁ : i < length (toList p x)) (h₂ : j < length (toList p x)),
    nthLe (toList p x) i h₁ = nthLe (toList p x) j h₂ → i = j

tactic: rw [length_toList, ← hc.orderOf] at hm hn
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx : ¬↑p x = x
hc : IsCycle (cycleOf p x)
n m : ℕ
hn : n < length (toList p x)
hm : m < length (toList p x)
⊢ nthLe (toList p x) n hn = nthLe (toList p x) m hm → n = m

tactic: rw [← cycleOf_apply_self, ← Ne.def, ← mem_support] at hx
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx : ¬↑p x = x
hc : IsCycle (cycleOf p x)
n m : ℕ
hn✝ : n < length (toList p x)
hn : n < orderOf (cycleOf p x)
hm✝ : m < length (toList p x)
hm : m < orderOf (cycleOf p x)
⊢ nthLe (toList p x) n hn✝ = nthLe (toList p x) m hm✝ → n = m

tactic: rw [nthLe_toList, nthLe_toList, ← cycleOf_pow_apply_self p x n, ←
  cycleOf_pow_apply_self p x m]
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n m : ℕ
hn✝ : n < length (toList p x)
hn : n < orderOf (cycleOf p x)
hm✝ : m < length (toList p x)
hm : m < orderOf (cycleOf p x)
⊢ nthLe (toList p x) n hn✝ = nthLe (toList p x) m hm✝ → n = m

tactic: cases' n with n <;> cases' m with m
state_before: case neg
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n m : ℕ
hn✝ : n < length (toList p x)
hn : n < orderOf (cycleOf p x)
hm✝ : m < length (toList p x)
hm : m < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ n) x = ↑(cycleOf p x ^ m) x → n = m

tactic: intro h
state_before: case neg.succ.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x → Nat.succ n = Nat.succ m

tactic: have hn' : ¬orderOf (p.cycleOf x) ∣ n.succ := Nat.not_dvd_of_pos_of_lt n.zero_lt_succ hn
state_before: case neg.succ.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
⊢ Nat.succ n = Nat.succ m

tactic: have hm' : ¬orderOf (p.cycleOf x) ∣ m.succ := Nat.not_dvd_of_pos_of_lt m.zero_lt_succ hm
state_before: case neg.succ.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : ¬orderOf (cycleOf p x) ∣ Nat.succ n
⊢ Nat.succ n = Nat.succ m

tactic: rw [← hc.support_pow_eq_iff] at hn' hm'
state_before: case neg.succ.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : ¬orderOf (cycleOf p x) ∣ Nat.succ n
hm' : ¬orderOf (cycleOf p x) ∣ Nat.succ m
⊢ Nat.succ n = Nat.succ m

tactic: rw [← Nat.mod_eq_of_lt hn, ← Nat.mod_eq_of_lt hm, ← pow_inj_mod]
state_before: case neg.succ.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
⊢ Nat.succ n = Nat.succ m

tactic: refine' support_congr _ _
state_before: case neg.succ.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
⊢ cycleOf p x ^ Nat.succ n = cycleOf p x ^ Nat.succ m

tactic: rw [← not_mem_support, ← toList_eq_nil_iff] at hx
state_before: case pos
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx : ↑p x = x
⊢ Nodup (toList p x)

tactic: simp [hx]
state_before: case pos
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝ : ↑p x = x
hx : toList p x = []
⊢ Nodup (toList p x)

tactic: simp
state_before: case neg.zero.zero
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
hn✝ : Nat.zero < length (toList p x)
hn : Nat.zero < orderOf (cycleOf p x)
hm✝ : Nat.zero < length (toList p x)
hm : Nat.zero < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.zero) x = ↑(cycleOf p x ^ Nat.zero) x → Nat.zero = Nat.zero

tactic: rw [← hc.support_pow_of_pos_of_lt_orderOf m.zero_lt_succ hm, mem_support,
  cycleOf_pow_apply_self] at hx
state_before: case neg.zero.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
hn✝ : Nat.zero < length (toList p x)
hn : Nat.zero < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.zero) x = ↑(cycleOf p x ^ Nat.succ m) x → Nat.zero = Nat.succ m

tactic: simp [hx.symm]
state_before: case neg.zero.succ
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hc : IsCycle (cycleOf p x)
hn✝ : Nat.zero < length (toList p x)
hn : Nat.zero < orderOf (cycleOf p x)
m : ℕ
hx : ↑(p ^ Nat.succ m) x ≠ x
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.zero) x = ↑(cycleOf p x ^ Nat.succ m) x → Nat.zero = Nat.succ m

tactic: rw [← hc.support_pow_of_pos_of_lt_orderOf n.zero_lt_succ hn, mem_support,
  cycleOf_pow_apply_self] at hx
state_before: case neg.succ.zero
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
hm✝ : Nat.zero < length (toList p x)
hm : Nat.zero < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.zero) x → Nat.succ n = Nat.zero

tactic: simp [hx]
state_before: case neg.succ.zero
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hc : IsCycle (cycleOf p x)
n : ℕ
hx : ↑(p ^ Nat.succ n) x ≠ x
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
hm✝ : Nat.zero < length (toList p x)
hm : Nat.zero < orderOf (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.zero) x → Nat.succ n = Nat.zero

tactic: rw [hm', hn']
state_before: case neg.succ.succ.refine'_1
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
⊢ support (cycleOf p x ^ Nat.succ n) ⊆ support (cycleOf p x ^ Nat.succ m)

tactic: rw [hm']
state_before: case neg.succ.succ.refine'_2
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
⊢ ∀ (x_1 : α),
    x_1 ∈ support (cycleOf p x ^ Nat.succ m) → ↑(cycleOf p x ^ Nat.succ n) x_1 = ↑(cycleOf p x ^ Nat.succ m) x_1

tactic: intro y hy
state_before: case neg.succ.succ.refine'_2
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
⊢ ∀ (x_1 : α), x_1 ∈ support (cycleOf p x) → ↑(cycleOf p x ^ Nat.succ n) x_1 = ↑(cycleOf p x ^ Nat.succ m) x_1

tactic: obtain ⟨k, rfl⟩ := hc.exists_pow_eq (mem_support.mp hx) (mem_support.mp hy)
state_before: case neg.succ.succ.refine'_2
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
y : α
hy : y ∈ support (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.succ n) y = ↑(cycleOf p x ^ Nat.succ m) y

tactic: rw [← mul_apply, (Commute.pow_pow_self _ _ _).eq, mul_apply, h, ← mul_apply, ← mul_apply,
  (Commute.pow_pow_self _ _ _).eq]
state_before: case neg.succ.succ.refine'_2.intro
α : Type u_1
inst✝¹ : Fintype α
inst✝ : DecidableEq α
p✝ : Perm α
x✝ : α
p : Perm α
x : α
hx✝¹ : ¬↑p x = x
hx✝ : ↑(cycleOf p x) x ≠ x
hx : x ∈ support (cycleOf p x)
hc : IsCycle (cycleOf p x)
n : ℕ
hn✝ : Nat.succ n < length (toList p x)
hn : Nat.succ n < orderOf (cycleOf p x)
m : ℕ
hm✝ : Nat.succ m < length (toList p x)
hm : Nat.succ m < orderOf (cycleOf p x)
h : ↑(cycleOf p x ^ Nat.succ n) x = ↑(cycleOf p x ^ Nat.succ m) x
hn' : support (cycleOf p x ^ Nat.succ n) = support (cycleOf p x)
hm' : support (cycleOf p x ^ Nat.succ m) = support (cycleOf p x)
k : ℕ
hy : ↑(cycleOf p x ^ k) x ∈ support (cycleOf p x)
⊢ ↑(cycleOf p x ^ Nat.succ n) (↑(cycleOf p x ^ k) x) = ↑(cycleOf p x ^ Nat.succ m) (↑(cycleOf p x ^ k) x)