Theorem: List.get_insertNth_of_lt
File: Mathlib/Data/List/Basic.lean

tactic: induction' n with n IH generalizing k l
state_before: ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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 }

tactic: simp at hn
state_before: case zero
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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✝))
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 }

tactic: cases' l with hd tl
state_before: case succ
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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✝))
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 }

tactic: simp
state_before: case succ.nil
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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))
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 }

tactic: cases k
state_before: case succ.cons
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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))
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 }

tactic: simp [get]
state_before: case succ.cons.zero
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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))
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 }

tactic: rw [Nat.succ_lt_succ_iff] at hn
state_before: case succ.cons.succ
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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))
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 }

tactic: simpa using IH _ _ hn _
state_before: case succ.cons.succ
ι : Type ?u.124628
α : Type u
β : Type v
γ : Type w
δ : Type x
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))
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 }