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

tactic: induction e using List.two_step_induction with
| empty => rfl
| single =>
  simp [removeNeutrals, removeNeutrals.loop]; split
  case h_1 => rfl
  case h_2 h => split at h <;> simp_all
| step x y ys ih =>
  cases h₁ : ContextInformation.isNeutral ctx x <;> cases h₂ : ContextInformation.isNeutral ctx y <;> cases h₃ : removeNeutrals.loop ctx ys
  <;> simp [removeNeutrals, removeNeutrals.loop, h₁, h₂, h₃, evalList, ←ih]
  <;> (try simp [unwrap_isNeutral h₂ |>.2])
  <;> (try simp [unwrap_isNeutral h₁ |>.1])
state_before: α : Sort u_1
ctx : Context α
e : List Nat
⊢ evalList α ctx (removeNeutrals ctx e) = evalList α ctx e

tactic: rfl
state_before: case empty
α : Sort u_1
ctx : Context α
⊢ evalList α ctx (removeNeutrals ctx []) = evalList α ctx []

tactic: simp [removeNeutrals, removeNeutrals.loop]
state_before: case single
α : Sort u_1
ctx : Context α
a✝ : Nat
⊢ evalList α ctx (removeNeutrals ctx [a✝]) = evalList α ctx [a✝]

tactic: split
state_before: case single
α : Sort u_1
ctx : Context α
a✝ : Nat
⊢ evalList α ctx
      (match
        match ContextInformation.isNeutral ctx a✝ with
        | true => []
        | false => [a✝] with
      | [] => [a✝]
      | ys => ys) =
    evalList α ctx [a✝]

tactic: case h_1 => rfl
state_before: case single.h_1
α : Sort u_1
ctx : Context α
a✝ : Nat
x✝ : List Nat
heq✝ :
  (match ContextInformation.isNeutral ctx a✝ with
    | true => []
    | false => [a✝]) =
    []
⊢ evalList α ctx [a✝] = evalList α ctx [a✝]

case single.h_2
α : Sort u_1
ctx : Context α
a✝ : Nat
x✝¹ : List Nat
x✝ :
  (match ContextInformation.isNeutral ctx a✝ with
      | true => []
      | false => [a✝]) =
      [] →
    False
⊢ evalList α ctx
      (match ContextInformation.isNeutral ctx a✝ with
      | true => []
      | false => [a✝]) =
    evalList α ctx [a✝]

tactic: case h_2 h => split at h <;> simp_all
state_before: case single.h_2
α : Sort u_1
ctx : Context α
a✝ : Nat
x✝¹ : List Nat
x✝ :
  (match ContextInformation.isNeutral ctx a✝ with
      | true => []
      | false => [a✝]) =
      [] →
    False
⊢ evalList α ctx
      (match ContextInformation.isNeutral ctx a✝ with
      | true => []
      | false => [a✝]) =
    evalList α ctx [a✝]

tactic: rfl
state_before: α : Sort u_1
ctx : Context α
a✝ : Nat
x✝ : List Nat
heq✝ :
  (match ContextInformation.isNeutral ctx a✝ with
    | true => []
    | false => [a✝]) =
    []
⊢ evalList α ctx [a✝] = evalList α ctx [a✝]

tactic: split at h <;> simp_all
state_before: α : Sort u_1
ctx : Context α
a✝ : Nat
x✝ : List Nat
h :
  (match ContextInformation.isNeutral ctx a✝ with
      | true => []
      | false => [a✝]) =
      [] →
    False
⊢ evalList α ctx
      (match ContextInformation.isNeutral ctx a✝ with
      | true => []
      | false => [a✝]) =
    evalList α ctx [a✝]

tactic: cases h₁ : ContextInformation.isNeutral ctx x <;> cases h₂ : ContextInformation.isNeutral ctx y <;> cases h₃ : removeNeutrals.loop ctx ys
<;> simp [removeNeutrals, removeNeutrals.loop, h₁, h₂, h₃, evalList, ←ih]
<;> (try simp [unwrap_isNeutral h₂ |>.2])
<;> (try simp [unwrap_isNeutral h₁ |>.1])
state_before: case step
α : Sort u_1
ctx : Context α
x y : Nat
ys : List Nat
ih : evalList α ctx (removeNeutrals ctx (y :: ys)) = evalList α ctx (y :: ys)
⊢ evalList α ctx (removeNeutrals ctx (x :: y :: ys)) = evalList α ctx (x :: y :: ys)

tactic: try simp [unwrap_isNeutral h₂ |>.2]
state_before: case step.true.true.cons
α : Sort u_1
ctx : Context α
x y : Nat
ys : List Nat
ih : evalList α ctx (removeNeutrals ctx (y :: ys)) = evalList α ctx (y :: ys)
h₁ : ContextInformation.isNeutral ctx x = true
h₂ : ContextInformation.isNeutral ctx y = true
head✝ : Nat
tail✝ : List Nat
h₃ : removeNeutrals.loop ctx ys = head✝ :: tail✝
⊢ evalList α ctx (head✝ :: tail✝) =
    EvalInformation.evalOp ctx (EvalInformation.evalVar ctx x) (evalList α ctx (head✝ :: tail✝))

tactic: simp [unwrap_isNeutral h₂ |>.2]
state_before: case step.true.true.cons
α : Sort u_1
ctx : Context α
x y : Nat
ys : List Nat
ih : evalList α ctx (removeNeutrals ctx (y :: ys)) = evalList α ctx (y :: ys)
h₁ : ContextInformation.isNeutral ctx x = true
h₂ : ContextInformation.isNeutral ctx y = true
head✝ : Nat
tail✝ : List Nat
h₃ : removeNeutrals.loop ctx ys = head✝ :: tail✝
⊢ evalList α ctx (head✝ :: tail✝) =
    EvalInformation.evalOp ctx (EvalInformation.evalVar ctx x) (evalList α ctx (head✝ :: tail✝))

tactic: try simp [unwrap_isNeutral h₁ |>.1]
state_before: case step.true.true.cons
α : Sort u_1
ctx : Context α
x y : Nat
ys : List Nat
ih : evalList α ctx (removeNeutrals ctx (y :: ys)) = evalList α ctx (y :: ys)
h₁ : ContextInformation.isNeutral ctx x = true
h₂ : ContextInformation.isNeutral ctx y = true
head✝ : Nat
tail✝ : List Nat
h₃ : removeNeutrals.loop ctx ys = head✝ :: tail✝
⊢ evalList α ctx (head✝ :: tail✝) =
    EvalInformation.evalOp ctx (EvalInformation.evalVar ctx x) (evalList α ctx (head✝ :: tail✝))

tactic: simp [unwrap_isNeutral h₁ |>.1]
state_before: case step.true.true.cons
α : Sort u_1
ctx : Context α
x y : Nat
ys : List Nat
ih : evalList α ctx (removeNeutrals ctx (y :: ys)) = evalList α ctx (y :: ys)
h₁ : ContextInformation.isNeutral ctx x = true
h₂ : ContextInformation.isNeutral ctx y = true
head✝ : Nat
tail✝ : List Nat
h₃ : removeNeutrals.loop ctx ys = head✝ :: tail✝
⊢ evalList α ctx (head✝ :: tail✝) =
    EvalInformation.evalOp ctx (EvalInformation.evalVar ctx x) (evalList α ctx (head✝ :: tail✝))