l3lab/ntp-mathlib huggingface dataset:
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n k : ℕ
hn : k < n
hk : k < length l
hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))
⊢ get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }

Next tactic:
induction' n with n IH generalizing k l
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · 

Proof state:
case zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
l : List α
k : ℕ
hn : k < zero
hk : k < length l
hk' : optParam (k < length (insertNth zero x l)) (_ : k < length (insertNth zero x l))
⊢ get (insertNth zero x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }

Next tactic:
simp at hn
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · simp at hn
  · 

Proof state:
case succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH :
  ∀ (l : List α) (k : ℕ),
    k < n →
      ∀ (hk : k < length l) (hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))),
        get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }
l : List α
k : ℕ
hn : k < succ n
hk : k < length l
hk' : optParam (k < length (insertNth (succ n) x l)) (_ : k < length (insertNth (succ n) x l))
⊢ get (insertNth (succ n) x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }

Next tactic:
cases' l with hd tl
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · simp at hn
  · cases' l with hd tl
    · 

Proof state:
case succ.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH :
  ∀ (l : List α) (k : ℕ),
    k < n →
      ∀ (hk : k < length l) (hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))),
        get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }
k : ℕ
hn : k < succ n
hk : k < length []
hk' : optParam (k < length (insertNth (succ n) x [])) (_ : k < length (insertNth (succ n) x []))
⊢ get (insertNth (succ n) x []) { val := k, isLt := hk' } = get [] { val := k, isLt := hk }

Next tactic:
simp
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · simp at hn
  · cases' l with hd tl
    · simp
    · 

Proof state:
case succ.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH :
  ∀ (l : List α) (k : ℕ),
    k < n →
      ∀ (hk : k < length l) (hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))),
        get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }
k : ℕ
hn : k < succ n
hd : α
tl : List α
hk : k < length (hd :: tl)
hk' : optParam (k < length (insertNth (succ n) x (hd :: tl))) (_ : k < length (insertNth (succ n) x (hd :: tl)))
⊢ get (insertNth (succ n) x (hd :: tl)) { val := k, isLt := hk' } = get (hd :: tl) { val := k, isLt := hk }

Next tactic:
cases k
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · simp at hn
  · cases' l with hd tl
    · simp
    · cases k
      · 

Proof state:
case succ.cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH :
  ∀ (l : List α) (k : ℕ),
    k < n →
      ∀ (hk : k < length l) (hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))),
        get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }
hd : α
tl : List α
hn : zero < succ n
hk : zero < length (hd :: tl)
hk' : optParam (zero < length (insertNth (succ n) x (hd :: tl))) (_ : zero < length (insertNth (succ n) x (hd :: tl)))
⊢ get (insertNth (succ n) x (hd :: tl)) { val := zero, isLt := hk' } = get (hd :: tl) { val := zero, isLt := hk }

Next tactic:
simp [get]
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · simp at hn
  · cases' l with hd tl
    · simp
    · cases k
      · simp [get]
      · 

Proof state:
case succ.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH :
  ∀ (l : List α) (k : ℕ),
    k < n →
      ∀ (hk : k < length l) (hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))),
        get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }
hd : α
tl : List α
n✝ : ℕ
hn : succ n✝ < succ n
hk : succ n✝ < length (hd :: tl)
hk' :
  optParam (succ n✝ < length (insertNth (succ n) x (hd :: tl))) (_ : succ n✝ < length (insertNth (succ n) x (hd :: tl)))
⊢ get (insertNth (succ n) x (hd :: tl)) { val := succ n✝, isLt := hk' } = get (hd :: tl) { val := succ n✝, isLt := hk }

Next tactic:
rw [Nat.succ_lt_succ_iff] at hn
theorem get_insertNth_of_lt (l : List α) (x : α) (n k : ℕ) (hn : k < n) (hk : k < l.length)
    (hk' : k < (insertNth n x l).length := hk.trans_le (length_le_length_insertNth _ _ _)) :
    (insertNth n x l).get ⟨k, hk'⟩ = l.get ⟨k, hk⟩ := by
  induction' n with n IH generalizing k l
  · simp at hn
  · cases' l with hd tl
    · simp
    · cases k
      · simp [get]
      · rw [Nat.succ_lt_succ_iff] at hn
        

Proof state:
case succ.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH :
  ∀ (l : List α) (k : ℕ),
    k < n →
      ∀ (hk : k < length l) (hk' : optParam (k < length (insertNth n x l)) (_ : k < length (insertNth n x l))),
        get (insertNth n x l) { val := k, isLt := hk' } = get l { val := k, isLt := hk }
hd : α
tl : List α
n✝ : ℕ
hn : n✝ < n
hk : succ n✝ < length (hd :: tl)
hk' :
  optParam (succ n✝ < length (insertNth (succ n) x (hd :: tl))) (_ : succ n✝ < length (insertNth (succ n) x (hd :: tl)))
⊢ get (insertNth (succ n) x (hd :: tl)) { val := succ n✝, isLt := hk' } = get (hd :: tl) { val := succ n✝, isLt := hk }

Next tactic:
simpa using IH _ _ hn _
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n : ℕ
hn : n ≤ length l
⊢ n < length (insertNth n x l)

Next tactic:
rwa [length_insertNth _ _ hn, Nat.lt_succ_iff]
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n : ℕ
hn : n ≤ length l
hn' : optParam (n < length (insertNth n x l)) (_ : n < length (insertNth n x l))
⊢ get (insertNth n x l) { val := n, isLt := hn' } = x

Next tactic:
induction' l with hd tl IH generalizing n
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · 

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
hn : n ≤ length []
hn' : optParam (n < length (insertNth n x [])) (_ : n < length (insertNth n x []))
⊢ get (insertNth n x []) { val := n, isLt := hn' } = x

Next tactic:
simp only [length, nonpos_iff_eq_zero] at hn
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · simp only [length, nonpos_iff_eq_zero] at hn
    

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
hn✝ : n ≤ length []
hn' : optParam (n < length (insertNth n x [])) (_ : n < length (insertNth n x []))
hn : n = 0
⊢ get (insertNth n x []) { val := n, isLt := hn' } = x

Next tactic:
cases hn
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · simp only [length, nonpos_iff_eq_zero] at hn
    cases hn
    

Proof state:
case nil.refl
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
hn : 0 ≤ length []
hn' : optParam (0 < length (insertNth 0 x [])) (_ : 0 < length (insertNth 0 x []))
⊢ get (insertNth 0 x []) { val := 0, isLt := hn' } = x

Next tactic:
simp only [insertNth_zero, get_singleton]
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · simp only [length, nonpos_iff_eq_zero] at hn
    cases hn
    simp only [insertNth_zero, get_singleton]
  · 

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n : ℕ) (hn : n ≤ length tl) (hn' : optParam (n < length (insertNth n x tl)) (_ : n < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n, isLt := hn' } = x
n : ℕ
hn : n ≤ length (hd :: tl)
hn' : optParam (n < length (insertNth n x (hd :: tl))) (_ : n < length (insertNth n x (hd :: tl)))
⊢ get (insertNth n x (hd :: tl)) { val := n, isLt := hn' } = x

Next tactic:
cases n
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · simp only [length, nonpos_iff_eq_zero] at hn
    cases hn
    simp only [insertNth_zero, get_singleton]
  · cases n
    · 

Proof state:
case cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n : ℕ) (hn : n ≤ length tl) (hn' : optParam (n < length (insertNth n x tl)) (_ : n < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n, isLt := hn' } = x
hn : zero ≤ length (hd :: tl)
hn' : optParam (zero < length (insertNth zero x (hd :: tl))) (_ : zero < length (insertNth zero x (hd :: tl)))
⊢ get (insertNth zero x (hd :: tl)) { val := zero, isLt := hn' } = x

Next tactic:
simp
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · simp only [length, nonpos_iff_eq_zero] at hn
    cases hn
    simp only [insertNth_zero, get_singleton]
  · cases n
    · simp
    · 

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n : ℕ) (hn : n ≤ length tl) (hn' : optParam (n < length (insertNth n x tl)) (_ : n < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n, isLt := hn' } = x
n✝ : ℕ
hn : succ n✝ ≤ length (hd :: tl)
hn' :
  optParam (succ n✝ < length (insertNth (succ n✝) x (hd :: tl)))
    (_ : succ n✝ < length (insertNth (succ n✝) x (hd :: tl)))
⊢ get (insertNth (succ n✝) x (hd :: tl)) { val := succ n✝, isLt := hn' } = x

Next tactic:
simp only [Nat.succ_le_succ_iff, length] at hn
@[simp]
theorem get_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).get ⟨n, hn'⟩ = x := by
  induction' l with hd tl IH generalizing n
  · simp only [length, nonpos_iff_eq_zero] at hn
    cases hn
    simp only [insertNth_zero, get_singleton]
  · cases n
    · simp
    · simp only [Nat.succ_le_succ_iff, length] at hn
      

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n : ℕ) (hn : n ≤ length tl) (hn' : optParam (n < length (insertNth n x tl)) (_ : n < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n, isLt := hn' } = x
n✝ : ℕ
hn✝ : succ n✝ ≤ length (hd :: tl)
hn' :
  optParam (succ n✝ < length (insertNth (succ n✝) x (hd :: tl)))
    (_ : succ n✝ < length (insertNth (succ n✝) x (hd :: tl)))
hn : n✝ ≤ length tl
⊢ get (insertNth (succ n✝) x (hd :: tl)) { val := succ n✝, isLt := hn' } = x

Next tactic:
simpa using IH _ hn
@[simp, deprecated get_insertNth_self]
theorem nthLe_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n : ℕ
hn : n ≤ length l
⊢ n < length (insertNth n x l)

Next tactic:
rwa [length_insertNth _ _ hn, Nat.lt_succ_iff]
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n k : ℕ
hk' : n + k < length l
⊢ n + k + 1 < length (insertNth n x l)

Next tactic:
rw [length_insertNth _ _ (le_self_add.trans hk'.le)]
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n k : ℕ
hk' : n + k < length l
⊢ n + k + 1 < length l + 1

Next tactic:
exact Nat.succ_lt_succ_iff.2 hk'
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; exact Nat.succ_lt_succ_iff.2 hk')) :
    (insertNth n x l).get ⟨n + k + 1, hk⟩ = get l ⟨n + k, hk'⟩ := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n k : ℕ
hk' : n + k < length l
hk : optParam (n + k + 1 < length (insertNth n x l)) (_ : n + k + 1 < length (insertNth n x l))
⊢ get (insertNth n x l) { val := n + k + 1, isLt := hk } = get l { val := n + k, isLt := hk' }

Next tactic:
induction' l with hd tl IH generalizing n k
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; exact Nat.succ_lt_succ_iff.2 hk')) :
    (insertNth n x l).get ⟨n + k + 1, hk⟩ = get l ⟨n + k, hk'⟩ := by
  induction' l with hd tl IH generalizing n k
  · 

Proof state:
case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n k : ℕ
hk' : n + k < length []
hk : optParam (n + k + 1 < length (insertNth n x [])) (_ : n + k + 1 < length (insertNth n x []))
⊢ get (insertNth n x []) { val := n + k + 1, isLt := hk } = get [] { val := n + k, isLt := hk' }

Next tactic:
simp at hk'
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; exact Nat.succ_lt_succ_iff.2 hk')) :
    (insertNth n x l).get ⟨n + k + 1, hk⟩ = get l ⟨n + k, hk'⟩ := by
  induction' l with hd tl IH generalizing n k
  · simp at hk'
  · 

Proof state:
case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n k : ℕ) (hk' : n + k < length tl)
    (hk : optParam (n + k + 1 < length (insertNth n x tl)) (_ : n + k + 1 < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n + k + 1, isLt := hk } = get tl { val := n + k, isLt := hk' }
n k : ℕ
hk' : n + k < length (hd :: tl)
hk : optParam (n + k + 1 < length (insertNth n x (hd :: tl))) (_ : n + k + 1 < length (insertNth n x (hd :: tl)))
⊢ get (insertNth n x (hd :: tl)) { val := n + k + 1, isLt := hk } = get (hd :: tl) { val := n + k, isLt := hk' }

Next tactic:
cases n
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; exact Nat.succ_lt_succ_iff.2 hk')) :
    (insertNth n x l).get ⟨n + k + 1, hk⟩ = get l ⟨n + k, hk'⟩ := by
  induction' l with hd tl IH generalizing n k
  · simp at hk'
  · cases n
    · 

Proof state:
case cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n k : ℕ) (hk' : n + k < length tl)
    (hk : optParam (n + k + 1 < length (insertNth n x tl)) (_ : n + k + 1 < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n + k + 1, isLt := hk } = get tl { val := n + k, isLt := hk' }
k : ℕ
hk' : zero + k < length (hd :: tl)
hk :
  optParam (zero + k + 1 < length (insertNth zero x (hd :: tl)))
    (_ : zero + k + 1 < length (insertNth zero x (hd :: tl)))
⊢ get (insertNth zero x (hd :: tl)) { val := zero + k + 1, isLt := hk } =
    get (hd :: tl) { val := zero + k, isLt := hk' }

Next tactic:
simp
theorem get_insertNth_add_succ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; exact Nat.succ_lt_succ_iff.2 hk')) :
    (insertNth n x l).get ⟨n + k + 1, hk⟩ = get l ⟨n + k, hk'⟩ := by
  induction' l with hd tl IH generalizing n k
  · simp at hk'
  · cases n
    · simp
    · 

Proof state:
case cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x hd : α
tl : List α
IH :
  ∀ (n k : ℕ) (hk' : n + k < length tl)
    (hk : optParam (n + k + 1 < length (insertNth n x tl)) (_ : n + k + 1 < length (insertNth n x tl))),
    get (insertNth n x tl) { val := n + k + 1, isLt := hk } = get tl { val := n + k, isLt := hk' }
k n✝ : ℕ
hk' : succ n✝ + k < length (hd :: tl)
hk :
  optParam (succ n✝ + k + 1 < length (insertNth (succ n✝) x (hd :: tl)))
    (_ : succ n✝ + k + 1 < length (insertNth (succ n✝) x (hd :: tl)))
⊢ get (insertNth (succ n✝) x (hd :: tl)) { val := succ n✝ + k + 1, isLt := hk } =
    get (hd :: tl) { val := succ n✝ + k, isLt := hk' }

Next tactic:
simpa [succ_add] using IH _ _ _
set_option linter.deprecated false in
@[deprecated get_insertNth_add_succ]
theorem nthLe_insertNth_add_succ : ∀ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n k : ℕ
hk' : n + k < length l
⊢ n + k + 1 < length (insertNth n x l)

Next tactic:
rw [length_insertNth _ _ (le_self_add.trans hk'.le)]
set_option linter.deprecated false in
@[deprecated get_insertNth_add_succ]
theorem nthLe_insertNth_add_succ : ∀ (l : List α) (x : α) (n k : ℕ) (hk' : n + k < l.length)
    (hk : n + k + 1 < (insertNth n x l).length := (by
      -- Porting note: the original proof fails
      -- rwa [length_insertNth _ _ (le_self_add.trans hk'.le), Nat.succ_lt_succ_iff]
      rw [length_insertNth _ _ (le_self_add.trans hk'.le)]; 

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
l : List α
x : α
n k : ℕ
hk' : n + k < length l
⊢ n + k + 1 < length l + 1

Next tactic:
exact Nat.succ_lt_succ_iff.2 hk'
set_option linter.unnecessarySimpa false in
theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x) := by
  

Proof state:
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
x : α
⊢ Injective (insertNth n x)

Next tactic:
induction' n with n IH
set_option linter.unnecessarySimpa false in
theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x) := by
  induction' n with n IH
  · 

Proof state:
case zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
⊢ Injective (insertNth zero x)

Next tactic:
have : insertNth 0 x = cons x := funext fun _ => rfl
set_option linter.unnecessarySimpa false in
theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x) := by
  induction' n with n IH
  · have : insertNth 0 x = cons x := funext fun _ => rfl
    

Proof state:
case zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
this : insertNth 0 x = cons x
⊢ Injective (insertNth zero x)

Next tactic:
simp [this]
set_option linter.unnecessarySimpa false in
theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x) := by
  induction' n with n IH
  · have : insertNth 0 x = cons x := funext fun _ => rfl
    simp [this]
  · 

Proof state:
case succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH : Injective (insertNth n x)
⊢ Injective (insertNth (succ n) x)

Next tactic:
rintro (_ | ⟨a, as⟩) (_ | ⟨b, bs⟩) h
set_option linter.unnecessarySimpa false in
theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x) := by
  induction' n with n IH
  · have : insertNth 0 x = cons x := funext fun _ => rfl
    simp [this]
  · rintro (_ | ⟨a, as⟩) (_ | ⟨b, bs⟩) h <;> 

Proof state:
case succ.nil.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH : Injective (insertNth n x)
h : insertNth (succ n) x [] = insertNth (succ n) x []
⊢ [] = []

Next tactic:
simpa [IH.eq_iff] using h
set_option linter.unnecessarySimpa false in
theorem insertNth_injective (n : ℕ) (x : α) : Function.Injective (insertNth n x) := by
  induction' n with n IH
  · have : insertNth 0 x = cons x := funext fun _ => rfl
    simp [this]
  · rintro (_ | ⟨a, as⟩) (_ | ⟨b, bs⟩) h <;> 

Proof state:
case succ.nil.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a x : α
n : ℕ
IH : Injective (insertNth n x)
b : α
bs : List α
h : insertNth (succ n) x [] = insertNth (succ n) x (b :: bs)
⊢ [] = b :: bs

Next tactic:
simpa [IH.eq_iff] using h