Theorem: List.splitOnP.go_acc
File: Mathlib/Data/List/Basic.lean

tactic: simp only [go, modifyHead, splitOnP_nil, append_nil]
state_before: case nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
acc : List α
⊢ go p [] acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p [])
state_after: no goals

tactic: simp only [splitOnP, go]
state_before: case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
⊢ go p (hd :: tl) acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p (hd :: tl))
state_after: case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
⊢ (if p hd = true then acc.reverse :: go p tl [] else go p tl (hd :: acc)) =
    modifyHead (fun x => acc.reverse ++ x) (if p hd = true then [].reverse :: go p tl [] else go p tl [hd])

tactic: split
state_before: case cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
⊢ (if p hd = true then acc.reverse :: go p tl [] else go p tl (hd :: acc)) =
    modifyHead (fun x => acc.reverse ++ x) (if p hd = true then [].reverse :: go p tl [] else go p tl [hd])
state_after: case cons.isTrue
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : p hd = true
⊢ acc.reverse :: go p tl [] = modifyHead (fun x => acc.reverse ++ x) ([].reverse :: go p tl [])

case cons.isFalse
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
⊢ go p tl (hd :: acc) = modifyHead (fun x => acc.reverse ++ x) (go p tl [hd])

tactic: simp only [modifyHead, reverse_nil, append_nil]
state_before: case cons.isTrue
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : p hd = true
⊢ acc.reverse :: go p tl [] = modifyHead (fun x => acc.reverse ++ x) ([].reverse :: go p tl [])
state_after: no goals

tactic: rw [ih [hd], modifyHead_modifyHead, ih]
state_before: case cons.isFalse
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
⊢ go p tl (hd :: acc) = modifyHead (fun x => acc.reverse ++ x) (go p tl [hd])
state_after: case cons.isFalse
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
⊢ modifyHead (fun x => (hd :: acc).reverse ++ x) (splitOnP p tl) =
    modifyHead ((fun x => acc.reverse ++ x) ∘ fun x => [hd].reverse ++ x) (splitOnP p tl)

tactic: congr
state_before: case cons.isFalse
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
⊢ modifyHead (fun x => (hd :: acc).reverse ++ x) (splitOnP p tl) =
    modifyHead ((fun x => acc.reverse ++ x) ∘ fun x => [hd].reverse ++ x) (splitOnP p tl)
state_after: case cons.isFalse.e_f
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
⊢ (fun x => (hd :: acc).reverse ++ x) = (fun x => acc.reverse ++ x) ∘ fun x => [hd].reverse ++ x

tactic: funext x
state_before: case cons.isFalse.e_f
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
⊢ (fun x => (hd :: acc).reverse ++ x) = (fun x => acc.reverse ++ x) ∘ fun x => [hd].reverse ++ x
state_after: case cons.isFalse.e_f.h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
x : List α
⊢ (hd :: acc).reverse ++ x = ((fun x => acc.reverse ++ x) ∘ fun x => [hd].reverse ++ x) x

tactic: simp only [reverse_cons, append_assoc]
state_before: case cons.isFalse.e_f.h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
x : List α
⊢ (hd :: acc).reverse ++ x = ((fun x => acc.reverse ++ x) ∘ fun x => [hd].reverse ++ x) x
state_after: case cons.isFalse.e_f.h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
x : List α
⊢ acc.reverse ++ ([hd] ++ x) = ((fun x => acc.reverse ++ x) ∘ fun x => [].reverse ++ ([hd] ++ x)) x

tactic: rfl
state_before: case cons.isFalse.e_f.h
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
p : α → Bool
xs ys : List α
ls : List (List α)
f : List α → List α
hd : α
tl : List α
ih : ∀ (acc : List α), go p tl acc = modifyHead (fun x => acc.reverse ++ x) (splitOnP p tl)
acc : List α
h✝ : ¬p hd = true
x : List α
⊢ acc.reverse ++ ([hd] ++ x) = ((fun x => acc.reverse ++ x) ∘ fun x => [].reverse ++ ([hd] ++ x)) x
state_after: no goals