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

tactic: funext α L
state_before: ⊢ @sections = @sectionsTR
state_after: case h.h
α : Type u_1
L : List (List α)
⊢ L.sections = L.sectionsTR

tactic: simp [sectionsTR]
state_before: case h.h
α : Type u_1
L : List (List α)
⊢ L.sections = L.sectionsTR
state_after: case h.h
α : Type u_1
L : List (List α)
⊢ L.sections = bif L.any isEmpty then [] else (foldr sectionsTR.go #[[]] L).data

tactic: cases e : L.any isEmpty <;> simp [sections_eq_nil_of_isEmpty, *]
state_before: case h.h
α : Type u_1
L : List (List α)
⊢ L.sections = bif L.any isEmpty then [] else (foldr sectionsTR.go #[[]] L).data
state_after: case h.h.false
α : Type u_1
L : List (List α)
e : L.any isEmpty = false
⊢ L.sections = (foldr sectionsTR.go #[[]] L).data

tactic: clear e
state_before: case h.h.false
α : Type u_1
L : List (List α)
e : L.any isEmpty = false
⊢ L.sections = (foldr sectionsTR.go #[[]] L).data
state_after: case h.h.false
α : Type u_1
L : List (List α)
⊢ L.sections = (foldr sectionsTR.go #[[]] L).data

tactic: induction L with | nil => rfl | cons l L IH => ?_
state_before: case h.h.false
α : Type u_1
L : List (List α)
⊢ L.sections = (foldr sectionsTR.go #[[]] L).data
state_after: case h.h.false.cons
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ (l :: L).sections = (foldr sectionsTR.go #[[]] (l :: L)).data

tactic: simp [IH, sectionsTR.go]
state_before: case h.h.false.cons
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ (l :: L).sections = (foldr sectionsTR.go #[[]] (l :: L)).data
state_after: case h.h.false.cons
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ((foldr sectionsTR.go #[[]] L).data.bind fun s => map (fun a => a :: s) l) =
    (Array.foldl (fun acc' l' => foldl (fun acc' a => acc'.push (a :: l')) acc' l) #[] (foldr sectionsTR.go #[[]] L)
        0).data

tactic: rw [Array.foldl_eq_foldl_data, Array.foldl_data_eq_bind]
state_before: case h.h.false.cons
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ((foldr sectionsTR.go #[[]] L).data.bind fun s => map (fun a => a :: s) l) =
    (Array.foldl (fun acc' l' => foldl (fun acc' a => acc'.push (a :: l')) acc' l) #[] (foldr sectionsTR.go #[[]] L)
        0).data
state_after: case h.h.false.cons
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ((foldr sectionsTR.go #[[]] L).data.bind fun s => map (fun a => a :: s) l) =
    #[].data ++ (foldr sectionsTR.go #[[]] L).data.bind ?h.h.false.cons.G

case h.h.false.cons.G
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ List α → List (List α)

case h.h.false.cons.H
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ∀ (acc : Array (List α)) (a : List α),
    (foldl (fun acc' a_1 => acc'.push (a_1 :: a)) acc l).data = acc.data ++ ?h.h.false.cons.G a

tactic: rfl
state_before: case h.h.false.cons
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ((foldr sectionsTR.go #[[]] L).data.bind fun s => map (fun a => a :: s) l) =
    #[].data ++ (foldr sectionsTR.go #[[]] L).data.bind ?h.h.false.cons.G

case h.h.false.cons.G
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ List α → List (List α)

case h.h.false.cons.H
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ∀ (acc : Array (List α)) (a : List α),
    (foldl (fun acc' a_1 => acc'.push (a_1 :: a)) acc l).data = acc.data ++ ?h.h.false.cons.G a
state_after: case h.h.false.cons.H
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ∀ (acc : Array (List α)) (a : List α),
    (foldl (fun acc' a_1 => acc'.push (a_1 :: a)) acc l).data = acc.data ++ map (fun a_1 => a_1 :: a) l

tactic: intros
state_before: case h.h.false.cons.H
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
⊢ ∀ (acc : Array (List α)) (a : List α),
    (foldl (fun acc' a_1 => acc'.push (a_1 :: a)) acc l).data = acc.data ++ map (fun a_1 => a_1 :: a) l
state_after: case h.h.false.cons.H
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
acc✝ : Array (List α)
a✝ : List α
⊢ (foldl (fun acc' a => acc'.push (a :: a✝)) acc✝ l).data = acc✝.data ++ map (fun a => a :: a✝) l

tactic: apply Array.foldl_data_eq_map
state_before: case h.h.false.cons.H
α : Type u_1
l : List α
L : List (List α)
IH : L.sections = (foldr sectionsTR.go #[[]] L).data
acc✝ : Array (List α)
a✝ : List α
⊢ (foldl (fun acc' a => acc'.push (a :: a✝)) acc✝ l).data = acc✝.data ++ map (fun a => a :: a✝) l
state_after: no goals

tactic: rfl
state_before: case h.h.false.nil
α : Type u_1
⊢ [].sections = (foldr sectionsTR.go #[[]] []).data
state_after: no goals