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

tactic: simp only [sublists, foldr_append]
state_before: α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ (l₁ ++ l₂).sublists = do
    let x ← l₂.sublists
    map (fun x_1 => x_1 ++ x) l₁.sublists
state_after: α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂) l₁ =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)

tactic: induction l₁ with
| nil => simp
| cons a l₁ ih =>
  rw [foldr_cons, ih]
  simp [List.bind, join_join, Function.comp]
state_before: α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂) l₁ =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)
state_after: no goals

tactic: simp
state_before: case nil
α : Type u
β : Type v
γ : Type w
l₂ : List α
⊢ foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂) [] =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] [])
state_after: no goals

tactic: rw [foldr_cons, ih]
state_before: case cons
α : Type u
β : Type v
γ : Type w
l₂ : List α
a : α
l₁ : List α
ih :
  foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂) l₁ =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)
⊢ foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂)
      (a :: l₁) =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] (a :: l₁))
state_after: case cons
α : Type u
β : Type v
γ : Type w
l₂ : List α
a : α
l₁ : List α
ih :
  foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂) l₁ =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)
⊢ ((do
          let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
          map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)).bind
      fun x => [x, a :: x]) =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] (a :: l₁))

tactic: simp [List.bind, join_join, Function.comp]
state_before: case cons
α : Type u
β : Type v
γ : Type w
l₂ : List α
a : α
l₁ : List α
ih :
  foldr (fun a acc => acc.bind fun x => [x, a :: x]) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂) l₁ =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)
⊢ ((do
          let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
          map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₁)).bind
      fun x => [x, a :: x]) =
    do
    let x ← foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a acc => acc.bind fun x => [x, a :: x]) [[]] (a :: l₁))
state_after: no goals