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

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

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

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

case cons
α : Type u
β : Type v
γ : Type w
l₂ : List α
head✝ : α
tail✝ : List α
tail_ih✝ :
  foldr (fun a r => List.bind r fun l => [l, a :: l]) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂)
      tail✝ =
    do
    let x ← foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] tail✝)
⊢ foldr (fun a r => List.bind r fun l => [l, a :: l]) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂)
      (head✝ :: tail✝) =
    do
    let x ← foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] (head✝ :: tail✝))

tactic: . case cons a l₁ ih =>
    rw [foldr_cons, ih]
    simp [List.bind, join_join, Function.comp]
state_before: case cons
α : Type u
β : Type v
γ : Type w
l₂ : List α
head✝ : α
tail✝ : List α
tail_ih✝ :
  foldr (fun a r => List.bind r fun l => [l, a :: l]) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂)
      tail✝ =
    do
    let x ← foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] tail✝)
⊢ foldr (fun a r => List.bind r fun l => [l, a :: l]) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂)
      (head✝ :: tail✝) =
    do
    let x ← foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] (head✝ :: tail✝))

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

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

tactic: case cons a l₁ ih =>
  rw [foldr_cons, ih]
  simp [List.bind, join_join, Function.comp]
state_before: case cons
α : Type u
β : Type v
γ : Type w
l₂ : List α
head✝ : α
tail✝ : List α
tail_ih✝ :
  foldr (fun a r => List.bind r fun l => [l, a :: l]) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂)
      tail✝ =
    do
    let x ← foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] tail✝)
⊢ foldr (fun a r => List.bind r fun l => [l, a :: l]) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂)
      (head✝ :: tail✝) =
    do
    let x ← foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] l₂
    map (fun x_1 => x_1 ++ x) (foldr (fun a r => List.bind r fun l => [l, a :: l]) [[]] (head✝ :: tail✝))

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

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