Theorem: List.formPerm_apply_lt_getElem
File: Mathlib/GroupTheory/Perm/List.lean

tactic: induction' n with n IH generalizing xs
state_before: α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h : xs.Nodup
n : ℕ
hn : n + 1 < xs.length
⊢ xs.formPerm xs[n] = xs[n + 1]
state_after: case zero
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h : xs.Nodup
hn : 0 + 1 < xs.length
⊢ xs.formPerm xs[0] = xs[0 + 1]

case succ
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
xs : List α
h : xs.Nodup
hn : n + 1 + 1 < xs.length
⊢ xs.formPerm xs[n + 1] = xs[n + 1 + 1]

tactic: simpa using formPerm_apply_getElem_zero _ h _
state_before: case zero
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h : xs.Nodup
hn : 0 + 1 < xs.length
⊢ xs.formPerm xs[0] = xs[0 + 1]
state_after: no goals

tactic: rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
state_before: case succ
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
xs : List α
h : xs.Nodup
hn : n + 1 + 1 < xs.length
⊢ xs.formPerm xs[n + 1] = xs[n + 1 + 1]
state_after: case succ.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
h : [].Nodup
hn : n + 1 + 1 < [].length
⊢ [].formPerm [][n + 1] = [][n + 1 + 1]

case succ.cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x : α
h : [x].Nodup
hn : n + 1 + 1 < [x].length
⊢ [x].formPerm [x][n + 1] = [x][n + 1 + 1]

case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
⊢ (x :: y :: l).formPerm (x :: y :: l)[n + 1] = (x :: y :: l)[n + 1 + 1]

tactic: simp at hn
state_before: case succ.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
h : [].Nodup
hn : n + 1 + 1 < [].length
⊢ [].formPerm [][n + 1] = [][n + 1 + 1]
state_after: no goals

tactic: rw [formPerm_singleton, getElem_singleton, getElem_singleton]
state_before: case succ.cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x : α
h : [x].Nodup
hn : n + 1 + 1 < [x].length
⊢ [x].formPerm [x][n + 1] = [x][n + 1 + 1]
state_after: case succ.cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x : α
h : [x].Nodup
hn : n + 1 + 1 < [x].length
⊢ 1 x = x

tactic: rfl
state_before: case succ.cons.nil
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x : α
h : [x].Nodup
hn : n + 1 + 1 < [x].length
⊢ 1 x = x
state_after: no goals

tactic: specialize IH (y :: l) h.of_cons _
state_before: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
⊢ (x :: y :: l).formPerm (x :: y :: l)[n + 1] = (x :: y :: l)[n + 1 + 1]
state_after: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
⊢ n + 1 < (y :: l).length

case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = (y :: l)[n + 1]
⊢ (x :: y :: l).formPerm (x :: y :: l)[n + 1] = (x :: y :: l)[n + 1 + 1]

tactic: simp only [swap_apply_eq_iff, coe_mul, formPerm_cons_cons, Function.comp]
state_before: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = (y :: l)[n + 1]
⊢ (x :: y :: l).formPerm (x :: y :: l)[n + 1] = (x :: y :: l)[n + 1 + 1]
state_after: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = (y :: l)[n + 1]
⊢ (y :: l).formPerm (x :: y :: l)[n + 1] = (swap x y) (x :: y :: l)[n + 1 + 1]

tactic: simp only [getElem_cons_succ] at *
state_before: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = (y :: l)[n + 1]
⊢ (y :: l).formPerm (x :: y :: l)[n + 1] = (swap x y) (x :: y :: l)[n + 1 + 1]
state_after: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = l[n]
⊢ (y :: l).formPerm (y :: l)[n] = (swap x y) l[n]

tactic: simpa [Nat.succ_lt_succ_iff] using hn
state_before: case succ.cons.cons
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
⊢ n + 1 < (y :: l).length
state_after: no goals

tactic: intro hx
state_before: case succ.cons.cons.a
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = l[n]
⊢ (y :: l).formPerm (y :: l)[n] ≠ y
state_after: case succ.cons.cons.a
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = l[n]
hx : (y :: l).formPerm (y :: l)[n] = y
⊢ False

tactic: rw [← hx, IH] at h
state_before: case succ.cons.cons.a
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
h : (x :: y :: l).Nodup
hn : n + 1 + 1 < (x :: y :: l).length
IH : (y :: l).formPerm (y :: l)[n] = l[n]
hx : (y :: l).formPerm (y :: l)[n] = y
⊢ False
state_after: case succ.cons.cons.a
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
hn : n + 1 + 1 < (x :: y :: l).length
h : (x :: l[n] :: l).Nodup
IH : (y :: l).formPerm (y :: l)[n] = l[n]
hx : (y :: l).formPerm (y :: l)[n] = y
⊢ False

tactic: simp [getElem_mem] at h
state_before: case succ.cons.cons.a
α : Type u_1
β : Type u_2
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
IH✝ : ∀ (xs : List α), xs.Nodup → ∀ (hn : n + 1 < xs.length), xs.formPerm xs[n] = xs[n + 1]
x y : α
l : List α
hn : n + 1 + 1 < (x :: y :: l).length
h : (x :: l[n] :: l).Nodup
IH : (y :: l).formPerm (y :: l)[n] = l[n]
hx : (y :: l).formPerm (y :: l)[n] = y
⊢ False
state_after: no goals