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

tactic: split_ifs with h
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
a : α
n : ℕ
hl : n < (a :: l).length
⊢ (a :: l).nthLe n hl = if hn : n = 0 then a else l.nthLe (n - 1) ⋯
state_after: case pos
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
a : α
n : ℕ
hl : n < (a :: l).length
h : n = 0
⊢ (a :: l).nthLe n hl = a

case neg
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
a : α
n : ℕ
hl : n < (a :: l).length
h : ¬n = 0
⊢ (a :: l).nthLe n hl = l.nthLe (n - 1) ⋯

tactic: cases l
state_before: case neg
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
a : α
n : ℕ
hl : n < (a :: l).length
h : ¬n = 0
⊢ (a :: l).nthLe n hl = l.nthLe (n - 1) ⋯
state_after: case neg.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
h : ¬n = 0
hl : n < [a].length
⊢ [a].nthLe n hl = [].nthLe (n - 1) ⋯

case neg.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
h : ¬n = 0
head✝ : α
tail✝ : List α
hl : n < (a :: head✝ :: tail✝).length
⊢ (a :: head✝ :: tail✝).nthLe n hl = (head✝ :: tail✝).nthLe (n - 1) ⋯

tactic: cases n
state_before: case neg.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
h : ¬n = 0
head✝ : α
tail✝ : List α
hl : n < (a :: head✝ :: tail✝).length
⊢ (a :: head✝ :: tail✝).nthLe n hl = (head✝ :: tail✝).nthLe (n - 1) ⋯
state_after: case neg.cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a head✝ : α
tail✝ : List α
h : ¬0 = 0
hl : 0 < (a :: head✝ :: tail✝).length
⊢ (a :: head✝ :: tail✝).nthLe 0 hl = (head✝ :: tail✝).nthLe (0 - 1) ⋯

case neg.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a head✝ : α
tail✝ : List α
n✝ : ℕ
h : ¬n✝ + 1 = 0
hl : n✝ + 1 < (a :: head✝ :: tail✝).length
⊢ (a :: head✝ :: tail✝).nthLe (n✝ + 1) hl = (head✝ :: tail✝).nthLe (n✝ + 1 - 1) ⋯

tactic: rfl
state_before: case neg.cons.succ
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a head✝ : α
tail✝ : List α
n✝ : ℕ
h : ¬n✝ + 1 = 0
hl : n✝ + 1 < (a :: head✝ :: tail✝).length
⊢ (a :: head✝ :: tail✝).nthLe (n✝ + 1) hl = (head✝ :: tail✝).nthLe (n✝ + 1 - 1) ⋯
state_after: no goals

tactic: simp [nthLe, h]
state_before: case pos
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ l : List α
a : α
n : ℕ
hl : n < (a :: l).length
h : n = 0
⊢ (a :: l).nthLe n hl = a
state_after: no goals

tactic: rw [length_singleton, Nat.lt_succ_iff] at hl
state_before: case neg.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
h : ¬n = 0
hl : n < [a].length
⊢ [a].nthLe n hl = [].nthLe (n - 1) ⋯
state_after: case neg.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
h : ¬n = 0
hl✝ : n < [a].length
hl : n ≤ 0
⊢ [a].nthLe n hl✝ = [].nthLe (n - 1) ⋯

tactic: omega
state_before: case neg.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a : α
n : ℕ
h : ¬n = 0
hl✝ : n < [a].length
hl : n ≤ 0
⊢ [a].nthLe n hl✝ = [].nthLe (n - 1) ⋯
state_after: no goals

tactic: contradiction
state_before: case neg.cons.zero
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
a head✝ : α
tail✝ : List α
h : ¬0 = 0
hl : 0 < (a :: head✝ :: tail✝).length
⊢ (a :: head✝ :: tail✝).nthLe 0 hl = (head✝ :: tail✝).nthLe (0 - 1) ⋯
state_after: no goals