Theorem: List.eraseP_eq_erasePTR
File: .lake/packages/batteries/Batteries/Data/List/Basic.lean

tactic: funext α p l
state_before: ⊢ @eraseP = @erasePTR
state_after: case h.h.h
α : Type u_1
p : α → Bool
l : List α
⊢ eraseP p l = erasePTR p l

tactic: simp [erasePTR]
state_before: case h.h.h
α : Type u_1
p : α → Bool
l : List α
⊢ eraseP p l = erasePTR p l
state_after: case h.h.h
α : Type u_1
p : α → Bool
l : List α
⊢ eraseP p l = erasePTR.go p l l #[]

tactic: exact (go #[] _ rfl).symm
state_before: case h.h.h
α : Type u_1
p : α → Bool
l : List α
⊢ eraseP p l = erasePTR.go p l l #[]
state_after: no goals

tactic: simp [erasePTR.go, eraseP, h]
state_before: α : Type u_1
p : α → Bool
l : List α
acc : Array α
h : l = acc.data ++ []
⊢ erasePTR.go p l [] acc = acc.data ++ eraseP p []
state_after: no goals

tactic: simp [erasePTR.go, eraseP]
state_before: α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
⊢ l = acc.data ++ x :: xs → erasePTR.go p l (x :: xs) acc = acc.data ++ eraseP p (x :: xs)
state_after: α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
⊢ l = acc.data ++ x :: xs →
    (bif p x then acc.data ++ xs else erasePTR.go p l xs (acc.push x)) =
      acc.data ++ bif p x then xs else x :: eraseP p xs

tactic: cases p x <;> simp
state_before: α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
⊢ l = acc.data ++ x :: xs →
    (bif p x then acc.data ++ xs else erasePTR.go p l xs (acc.push x)) =
      acc.data ++ bif p x then xs else x :: eraseP p xs
state_after: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
⊢ l = acc.data ++ x :: xs → erasePTR.go p l xs (acc.push x) = acc.data ++ x :: eraseP p xs

tactic: intro h
state_before: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
⊢ l = acc.data ++ x :: xs → erasePTR.go p l xs (acc.push x) = acc.data ++ x :: eraseP p xs
state_after: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ erasePTR.go p l xs (acc.push x) = acc.data ++ x :: eraseP p xs

tactic: rw [go _ xs]
state_before: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ erasePTR.go p l xs (acc.push x) = acc.data ++ x :: eraseP p xs
state_after: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ (acc.push x).data ++ eraseP p xs = acc.data ++ x :: eraseP p xs

case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ l = (acc.push x).data ++ xs

tactic: {simp}
state_before: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ (acc.push x).data ++ eraseP p xs = acc.data ++ x :: eraseP p xs

case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ l = (acc.push x).data ++ xs
state_after: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ l = (acc.push x).data ++ xs

tactic: simp [h]
state_before: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ l = (acc.push x).data ++ xs
state_after: no goals

tactic: simp
state_before: case false
α : Type u_1
p : α → Bool
l : List α
acc : Array α
x : α
xs : List α
h : l = acc.data ++ x :: xs
⊢ (acc.push x).data ++ eraseP p xs = acc.data ++ x :: eraseP p xs
state_after: no goals