Theorem: List.mem_zip_inits_tails
File: Mathlib/Data/List/Zip.lean

tactic: induction' l with hd tl ih generalizing init tail <;> simp_rw [tails, inits, zip_cons_cons]
state_before: α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
l init tail : List α
⊢ (init, tail) ∈ zip (inits l) (tails l) ↔ init ++ tail = l

tactic: simp
state_before: case nil
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init✝ tail✝ init tail : List α
⊢ (init, tail) ∈ ([], []) :: zip [] [] ↔ init ++ tail = []

tactic: constructor <;> rw [mem_cons, zip_map_left, mem_map, Prod.exists]
state_before: case cons
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init✝ tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
init tail : List α
⊢ (init, tail) ∈ ([], hd :: tl) :: zip (map (fun t => hd :: t) (inits tl)) (tails tl) ↔ init ++ tail = hd :: tl

tactic: rintro (⟨rfl, rfl⟩ | ⟨_, _, h, rfl, rfl⟩)
state_before: case cons.mp
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init✝ tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
init tail : List α
⊢ ((init, tail) = ([], hd :: tl) ∨
      ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = (init, tail)) →
    init ++ tail = hd :: tl

tactic: simp
state_before: case cons.mp.inl.refl
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
⊢ [] ++ hd :: tl = hd :: tl

tactic: simp [ih.mp h]
state_before: case cons.mp.inr.intro.intro.intro.refl
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
w✝¹ w✝ : List α
h : (w✝¹, w✝) ∈ zip (inits tl) (tails tl)
⊢ (fun t => hd :: t) w✝¹ ++ id w✝ = hd :: tl

tactic: cases' init with hd' tl'
state_before: case cons.mpr
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init✝ tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
init tail : List α
⊢ init ++ tail = hd :: tl →
    (init, tail) = ([], hd :: tl) ∨
      ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = (init, tail)

tactic: rintro rfl
state_before: case cons.mpr.nil
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
tail : List α
⊢ [] ++ tail = hd :: tl →
    ([], tail) = ([], hd :: tl) ∨
      ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = ([], tail)

tactic: simp
state_before: case cons.mpr.nil
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
⊢ ([], hd :: tl) = ([], hd :: tl) ∨
    ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = ([], hd :: tl)

tactic: intro h
state_before: case cons.mpr.cons
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
tail : List α
hd' : α
tl' : List α
⊢ hd' :: tl' ++ tail = hd :: tl →
    (hd' :: tl', tail) = ([], hd :: tl) ∨
      ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = (hd' :: tl', tail)

tactic: right
state_before: case cons.mpr.cons
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
tail : List α
hd' : α
tl' : List α
h : hd' :: tl' ++ tail = hd :: tl
⊢ (hd' :: tl', tail) = ([], hd :: tl) ∨
    ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = (hd' :: tl', tail)

tactic: use tl', tail
state_before: case cons.mpr.cons.h
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
tail : List α
hd' : α
tl' : List α
h : hd' :: tl' ++ tail = hd :: tl
⊢ ∃ a b, (a, b) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (a, b) = (hd' :: tl', tail)

tactic: simp_all
state_before: case cons.mpr.cons.h
α : Type u
β : Type ?u.161184
γ : Type ?u.161187
δ : Type ?u.161190
ε : Type ?u.161193
init tail✝ : List α
hd : α
tl : List α
ih : ∀ {init tail : List α}, (init, tail) ∈ zip (inits tl) (tails tl) ↔ init ++ tail = tl
tail : List α
hd' : α
tl' : List α
h : hd' :: tl' ++ tail = hd :: tl
⊢ (tl', tail) ∈ zip (inits tl) (tails tl) ∧ Prod.map (fun t => hd :: t) id (tl', tail) = (hd' :: tl', tail)