Theorem: Lean.Data.AC.Context.evalList_append
File: src/lean/Init/Data/AC.lean

tactic: induction l using List.two_step_induction with
| empty => simp_all
| single x =>
  cases r
  . simp at h₂
  . simp [List.append, evalList, EvalInformation.evalOp]
| step x y ys ih => simp [List.append, evalList, EvalInformation.evalOp] at *; rw [ih]; simp [ctx.assoc.1]
state_before: α : Sort u_1
ctx : Context α
l r : List Nat
h₁ : l ≠ []
h₂ : r ≠ []
⊢ evalList α ctx (List.append l r) = op ctx (evalList α ctx l) (evalList α ctx r)

tactic: simp_all
state_before: case empty
α : Sort u_1
ctx : Context α
r : List Nat
h₂ : r ≠ []
h₁ : [] ≠ []
⊢ evalList α ctx (List.append [] r) = op ctx (evalList α ctx []) (evalList α ctx r)

tactic: cases r
state_before: case single
α : Sort u_1
ctx : Context α
r : List Nat
h₂ : r ≠ []
x : Nat
h₁ : [x] ≠ []
⊢ evalList α ctx (List.append [x] r) = op ctx (evalList α ctx [x]) (evalList α ctx r)

tactic: . simp at h₂
state_before: case single.nil
α : Sort u_1
ctx : Context α
x : Nat
h₁ : [x] ≠ []
h₂ : [] ≠ []
⊢ evalList α ctx (List.append [x] []) = op ctx (evalList α ctx [x]) (evalList α ctx [])

case single.cons
α : Sort u_1
ctx : Context α
x : Nat
h₁ : [x] ≠ []
head✝ : Nat
tail✝ : List Nat
h₂ : head✝ :: tail✝ ≠ []
⊢ evalList α ctx (List.append [x] (head✝ :: tail✝)) = op ctx (evalList α ctx [x]) (evalList α ctx (head✝ :: tail✝))

tactic: . simp [List.append, evalList, EvalInformation.evalOp]
state_before: case single.cons
α : Sort u_1
ctx : Context α
x : Nat
h₁ : [x] ≠ []
head✝ : Nat
tail✝ : List Nat
h₂ : head✝ :: tail✝ ≠ []
⊢ evalList α ctx (List.append [x] (head✝ :: tail✝)) = op ctx (evalList α ctx [x]) (evalList α ctx (head✝ :: tail✝))

tactic: simp at h₂
state_before: case single.nil
α : Sort u_1
ctx : Context α
x : Nat
h₁ : [x] ≠ []
h₂ : [] ≠ []
⊢ evalList α ctx (List.append [x] []) = op ctx (evalList α ctx [x]) (evalList α ctx [])

tactic: simp [List.append, evalList, EvalInformation.evalOp]
state_before: case single.cons
α : Sort u_1
ctx : Context α
x : Nat
h₁ : [x] ≠ []
head✝ : Nat
tail✝ : List Nat
h₂ : head✝ :: tail✝ ≠ []
⊢ evalList α ctx (List.append [x] (head✝ :: tail✝)) = op ctx (evalList α ctx [x]) (evalList α ctx (head✝ :: tail✝))

tactic: simp [List.append, evalList, EvalInformation.evalOp] at *
state_before: case step
α : Sort u_1
ctx : Context α
r : List Nat
h₂ : r ≠ []
x y : Nat
ys : List Nat
ih : y :: ys ≠ [] → evalList α ctx (List.append (y :: ys) r) = op ctx (evalList α ctx (y :: ys)) (evalList α ctx r)
h₁ : x :: y :: ys ≠ []
⊢ evalList α ctx (List.append (x :: y :: ys) r) = op ctx (evalList α ctx (x :: y :: ys)) (evalList α ctx r)

tactic: rw [ih]
state_before: case step
α : Sort u_1
ctx : Context α
r : List Nat
h₂ : ¬r = []
x y : Nat
ys : List Nat
ih : evalList α ctx (y :: (ys ++ r)) = op ctx (evalList α ctx (y :: ys)) (evalList α ctx r)
h₁ : True
⊢ op ctx (EvalInformation.evalVar ctx x) (evalList α ctx (y :: (ys ++ r))) =
    op ctx (op ctx (EvalInformation.evalVar ctx x) (evalList α ctx (y :: ys))) (evalList α ctx r)

tactic: simp [ctx.assoc.1]
state_before: case step
α : Sort u_1
ctx : Context α
r : List Nat
h₂ : ¬r = []
x y : Nat
ys : List Nat
ih : evalList α ctx (y :: (ys ++ r)) = op ctx (evalList α ctx (y :: ys)) (evalList α ctx r)
h₁ : True
⊢ op ctx (EvalInformation.evalVar ctx x) (op ctx (evalList α ctx (y :: ys)) (evalList α ctx r)) =
    op ctx (op ctx (EvalInformation.evalVar ctx x) (evalList α ctx (y :: ys))) (evalList α ctx r)