Theorem: List.sublists_eq_sublistsFast
File: Mathlib/Data/List/Sublists.lean

tactic: ext α l : 2
state_before: α : Type u
β : Type v
γ : Type w
⊢ @sublists = @sublistsFast
state_after: case h.h
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ l.sublists = l.sublistsFast

tactic: trans l.foldr sublistsAux [[]]
state_before: case h.h
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ l.sublists = l.sublistsFast
state_after: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ l.sublists = foldr sublistsAux [[]] l

α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ foldr sublistsAux [[]] l = l.sublistsFast

tactic: rw [sublistsAux_eq_bind, sublists]
state_before: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ l.sublists = foldr sublistsAux [[]] l
state_after: no goals

tactic: simp only [sublistsFast, sublistsAux_eq_array_foldl, Array.foldr_eq_foldr_data]
state_before: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ foldr sublistsAux [[]] l = l.sublistsFast
state_after: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ foldr (fun a r => (Array.foldl (fun r l => (r.push l).push (a :: l)) #[] (toArray r) 0).toList) [[]] l =
    (foldr (fun a arr => Array.foldl (fun r l => (r.push l).push (a :: l)) (Array.mkEmpty (arr.size * 2)) arr 0) #[[]]
        l).toList

tactic: rw [← foldr_hom Array.toList]
state_before: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ foldr (fun a r => (Array.foldl (fun r l => (r.push l).push (a :: l)) #[] (toArray r) 0).toList) [[]] l =
    (foldr (fun a arr => Array.foldl (fun r l => (r.push l).push (a :: l)) (Array.mkEmpty (arr.size * 2)) arr 0) #[[]]
        l).toList
state_after: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ foldr (fun a r => (Array.foldl (fun r l => (r.push l).push (a :: l)) #[] (toArray r) 0).toList) [[]] l =
    foldr ?g₂ #[[]].toList l

case g₂
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ α → List (List α) → List (List α)

case H
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ ∀ (x : α) (y : Array (List α)),
    ?g₂ x y.toList = (Array.foldl (fun r l => (r.push l).push (x :: l)) (Array.mkEmpty (y.size * 2)) y 0).toList

tactic: rfl
state_before: α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ foldr (fun a r => (Array.foldl (fun r l => (r.push l).push (a :: l)) #[] (toArray r) 0).toList) [[]] l =
    foldr ?g₂ #[[]].toList l
state_after: no goals

tactic: intros _ _
state_before: case H
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
⊢ ∀ (x : α) (y : Array (List α)),
    (Array.foldl (fun r l => (r.push l).push (x :: l)) #[] (toArray y.toList) 0).toList =
      (Array.foldl (fun r l => (r.push l).push (x :: l)) (Array.mkEmpty (y.size * 2)) y 0).toList
state_after: case H
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
x✝ : α
y✝ : Array (List α)
⊢ (Array.foldl (fun r l => (r.push l).push (x✝ :: l)) #[] (toArray y✝.toList) 0).toList =
    (Array.foldl (fun r l => (r.push l).push (x✝ :: l)) (Array.mkEmpty (y✝.size * 2)) y✝ 0).toList

tactic: congr <;> simp
state_before: case H
α✝ : Type u
β : Type v
γ : Type w
α : Type u_1
l : List α
x✝ : α
y✝ : Array (List α)
⊢ (Array.foldl (fun r l => (r.push l).push (x✝ :: l)) #[] (toArray y✝.toList) 0).toList =
    (Array.foldl (fun r l => (r.push l).push (x✝ :: l)) (Array.mkEmpty (y✝.size * 2)) y✝ 0).toList
state_after: no goals