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

tactic: induction' n with n IH generalizing xs
state_before: α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h : Nodup xs
n : ℕ
hn : n + 1 < length xs
⊢ ↑(formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn

tactic: simpa using formPerm_apply_nthLe_zero _ h _
state_before: case zero
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l : List α
x : α
xs✝ : List α
h✝ : Nodup xs✝
n : ℕ
hn✝ : n + 1 < length xs✝
xs : List α
h : Nodup xs
hn : Nat.zero + 1 < length xs
⊢ ↑(formPerm xs) (nthLe xs Nat.zero (_ : Nat.zero < length xs)) = nthLe xs (Nat.zero + 1) hn

tactic: rcases xs with (_ | ⟨x, _ | ⟨y, l⟩⟩)
state_before: case succ
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l : List α
x : α
xs✝ : List α
h✝ : Nodup xs✝
n✝ : ℕ
hn✝ : n✝ + 1 < length xs✝
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), ↑(formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
xs : List α
h : Nodup xs
hn : Nat.succ n + 1 < length xs
⊢ ↑(formPerm xs) (nthLe xs (Nat.succ n) (_ : Nat.succ n < length xs)) = nthLe xs (Nat.succ n + 1) hn

tactic: simp at hn
state_before: case succ.nil
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l : List α
x : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), ↑(formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
h : Nodup []
hn : Nat.succ n + 1 < length []
⊢ ↑(formPerm []) (nthLe [] (Nat.succ n) (_ : Nat.succ n < length [])) = nthLe [] (Nat.succ n + 1) hn

tactic: simp
state_before: case succ.cons.nil
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l : List α
x✝ : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), ↑(formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x : α
h : Nodup [x]
hn : Nat.succ n + 1 < length [x]
⊢ ↑(formPerm [x]) (nthLe [x] (Nat.succ n) (_ : Nat.succ n < length [x])) = nthLe [x] (Nat.succ n + 1) hn

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

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.750411
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs → ∀ (hn : n + 1 < length xs), ↑(formPerm xs) (nthLe xs n (_ : n < length xs)) = nthLe xs (n + 1) hn
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  ↑(formPerm (y :: l)) (nthLe (y :: l) n (_ : n < length (y :: l))) =
    nthLe (y :: l) (n + 1) (_ : n + 1 < length (y :: l))
⊢ ↑(formPerm (x :: y :: l)) (nthLe (x :: y :: l) (Nat.succ n) (_ : Nat.succ n < length (x :: y :: l))) =
    nthLe (x :: y :: l) (Nat.succ n + 1) hn

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

tactic: rw [← IH, swap_apply_of_ne_of_ne] <;>
. intro hx
  rw [← hx, IH] at h
  simp [get_mem] at h
state_before: case succ.cons.cons
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs →
      ∀ (hn : n + 1 < length xs),
        ↑(formPerm xs) (get xs { val := n, isLt := (_ : n < length xs) }) = get xs { val := n + 1, isLt := hn }
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    get l { val := n, isLt := (_ : n < length l) }
⊢ ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    ↑(swap x y) (get l { val := n, isLt := (_ : n < length l) })

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

tactic: intro hx
state_before: case succ.cons.cons.a
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs →
      ∀ (hn : n + 1 < length xs),
        ↑(formPerm xs) (get xs { val := n, isLt := (_ : n < length xs) }) = get xs { val := n + 1, isLt := hn }
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    get l { val := n, isLt := (_ : n < length l) }
⊢ ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) ≠ y

tactic: rw [← hx, IH] at h
state_before: case succ.cons.cons.a
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs →
      ∀ (hn : n + 1 < length xs),
        ↑(formPerm xs) (get xs { val := n, isLt := (_ : n < length xs) }) = get xs { val := n + 1, isLt := hn }
x y : α
l : List α
h : Nodup (x :: y :: l)
hn : Nat.succ n + 1 < length (x :: y :: l)
IH :
  ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    get l { val := n, isLt := (_ : n < length l) }
hx : ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) = y
⊢ False

tactic: simp [get_mem] at h
state_before: case succ.cons.cons.a
α : Type u_1
β : Type ?u.750411
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
xs : List α
h✝ : Nodup xs
n✝ : ℕ
hn✝ : n✝ + 1 < length xs
n : ℕ
IH✝ :
  ∀ (xs : List α),
    Nodup xs →
      ∀ (hn : n + 1 < length xs),
        ↑(formPerm xs) (get xs { val := n, isLt := (_ : n < length xs) }) = get xs { val := n + 1, isLt := hn }
x y : α
l : List α
hn : Nat.succ n + 1 < length (x :: y :: l)
h : Nodup (x :: get l { val := n, isLt := (_ : n < length l) } :: l)
IH :
  ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) =
    get l { val := n, isLt := (_ : n < length l) }
hx : ↑(formPerm (y :: l)) (get (y :: l) { val := n, isLt := (_ : n < length (y :: l)) }) = y
⊢ False