Theorem: Mathlib.Vector.eraseIdx_insertNth'
File: Mathlib/Data/Vector/Basic.lean

Proof steps:
state_before: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ eraseIdx (⟨j, hj⟩.succAbove ⟨i, hi⟩) (insertNth a ⟨j, hj⟩ v) =
    insertNth a (⟨i, hi⟩.predAbove ⟨j, hj⟩) (eraseIdx ⟨i, hi⟩ v)
state_after: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ ⟨(List.insertNth j a ↑v).eraseIdx ↑(if ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨i, ⋯⟩ else ⟨i + 1, ⋯⟩), ⋯⟩ =
    ⟨List.insertNth (↑(if h : ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨j, hj⟩.pred ⋯ else ⟨j, hj⟩.castPred ⋯)) a
        ↑(match v with
          | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩),
      ⋯⟩
tactic: dsimp [insertNth, eraseIdx, Fin.succAbove, Fin.predAbove]
state_before: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ ⟨(List.insertNth j a ↑v).eraseIdx ↑(if ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨i, ⋯⟩ else ⟨i + 1, ⋯⟩), ⋯⟩ =
    ⟨List.insertNth (↑(if h : ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨j, hj⟩.pred ⋯ else ⟨j, hj⟩.castPred ⋯)) a
        ↑(match v with
          | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩),
      ⋯⟩
state_after: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ (List.insertNth j a ↑v).eraseIdx ↑(if ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨i, ⋯⟩ else ⟨i + 1, ⋯⟩) =
    List.insertNth (↑(if h : ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨j, hj⟩.pred ⋯ else ⟨j, hj⟩.castPred ⋯)) a
      ↑(match v with
        | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩)
tactic: rw [Subtype.mk_eq_mk]
state_before: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ (List.insertNth j a ↑v).eraseIdx ↑(if ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨i, ⋯⟩ else ⟨i + 1, ⋯⟩) =
    List.insertNth (↑(if h : ⟨i, ⋯⟩ < ⟨j, hj⟩ then ⟨j, hj⟩.pred ⋯ else ⟨j, hj⟩.castPred ⋯)) a
      ↑(match v with
        | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩)
state_after: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ (List.insertNth j a ↑v).eraseIdx ↑(if i < j then ⟨i, ⋯⟩ else ⟨i + 1, ⋯⟩) =
    List.insertNth (↑(if h : i < j then ⟨j, hj⟩.pred ⋯ else ⟨j, hj⟩.castPred ⋯)) a
      ↑(match v with
        | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩)
tactic: simp only [Fin.lt_iff_val_lt_val]
state_before: n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
⊢ (List.insertNth j a ↑v).eraseIdx ↑(if i < j then ⟨i, ⋯⟩ else ⟨i + 1, ⋯⟩) =
    List.insertNth (↑(if h : i < j then ⟨j, hj⟩.pred ⋯ else ⟨j, hj⟩.castPred ⋯)) a
      ↑(match v with
        | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩)
state_after: case pos
n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
hij : i < j
⊢ (List.insertNth j a ↑v).eraseIdx ↑⟨i, ⋯⟩ =
    List.insertNth (↑(⟨j, hj⟩.pred ⋯)) a
      ↑(match v with
        | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩)

case neg
n : ℕ
α : Type u_1
β : Type u_2
γ : Type u_3
a : α
v : Vector α (n + 1)
i : ℕ
hi : i < n + 1
j : ℕ
hj : j < n + 2
hij : ¬i < j
⊢ (List.insertNth j a ↑v).eraseIdx ↑⟨i + 1, ⋯⟩ =
    List.insertNth (↑(⟨j, hj⟩.castPred ⋯)) a
      ↑(match v with
        | ⟨l, p⟩ => ⟨l.eraseIdx i, ⋯⟩)
tactic: split_ifs with hij