Theorem: Stream'.WSeq.destruct_map
File: Mathlib/Data/Seq/WSeq.lean

tactic: apply
  Computation.eq_of_bisim fun c1 c2 =>
    ∃ s,
      c1 = destruct (map f s) ∧
        c2 = Computation.map (Option.map (Prod.map f (map f))) (destruct s)
state_before: α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
⊢ (map f s).destruct = Computation.map (Option.map (Prod.map f (map f))) s.destruct
state_after: case bisim
α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
⊢ Computation.IsBisimulation fun c1 c2 =>
    ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct

case r
α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
⊢ ∃ s_1,
    (map f s).destruct = (map f s_1).destruct ∧
      Computation.map (Option.map (Prod.map f (map f))) s.destruct =
        Computation.map (Option.map (Prod.map f (map f))) s_1.destruct

tactic: intro c1 c2 h
state_before: case bisim
α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
⊢ Computation.IsBisimulation fun c1 c2 =>
    ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
state_after: case bisim
α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
h : ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
⊢ Computation.BisimO
    (fun c1 c2 => ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct)
    c1.destruct c2.destruct

tactic: cases' h with s h
state_before: case bisim
α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
h : ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
⊢ Computation.BisimO
    (fun c1 c2 => ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct)
    c1.destruct c2.destruct
state_after: case bisim.intro
α : Type u
β : Type v
γ : Type w
f : α → β
s✝ : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
s : WSeq α
h : c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
⊢ Computation.BisimO
    (fun c1 c2 => ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct)
    c1.destruct c2.destruct

tactic: rw [h.left, h.right]
state_before: case bisim.intro
α : Type u
β : Type v
γ : Type w
f : α → β
s✝ : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
s : WSeq α
h : c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
⊢ Computation.BisimO
    (fun c1 c2 => ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct)
    c1.destruct c2.destruct
state_after: case bisim.intro
α : Type u
β : Type v
γ : Type w
f : α → β
s✝ : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
s : WSeq α
h : c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
⊢ Computation.BisimO
    (fun c1 c2 => ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct)
    (map f s).destruct.destruct (Computation.map (Option.map (Prod.map f (map f))) s.destruct).destruct

tactic: induction' s using WSeq.recOn with a s s <;> simp
state_before: case bisim.intro
α : Type u
β : Type v
γ : Type w
f : α → β
s✝ : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
s : WSeq α
h : c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct
⊢ Computation.BisimO
    (fun c1 c2 => ∃ s, c1 = (map f s).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.destruct)
    (map f s).destruct.destruct (Computation.map (Option.map (Prod.map f (map f))) s.destruct).destruct
state_after: case bisim.intro.h3
α : Type u
β : Type v
γ : Type w
f : α → β
s✝ : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
s : WSeq α
h : c1 = (map f s.think).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.think.destruct
⊢ ∃ s_1,
    (map f s).destruct = (map f s_1).destruct ∧
      Computation.map (Option.map (Prod.map f (map f))) s.destruct =
        Computation.map (Option.map (Prod.map f (map f))) s_1.destruct

tactic: exact ⟨s, rfl, rfl⟩
state_before: case bisim.intro.h3
α : Type u
β : Type v
γ : Type w
f : α → β
s✝ : WSeq α
c1 c2 : Computation (Option (β × WSeq β))
s : WSeq α
h : c1 = (map f s.think).destruct ∧ c2 = Computation.map (Option.map (Prod.map f (map f))) s.think.destruct
⊢ ∃ s_1,
    (map f s).destruct = (map f s_1).destruct ∧
      Computation.map (Option.map (Prod.map f (map f))) s.destruct =
        Computation.map (Option.map (Prod.map f (map f))) s_1.destruct
state_after: no goals

tactic: exact ⟨s, rfl, rfl⟩
state_before: case r
α : Type u
β : Type v
γ : Type w
f : α → β
s : WSeq α
⊢ ∃ s_1,
    (map f s).destruct = (map f s_1).destruct ∧
      Computation.map (Option.map (Prod.map f (map f))) s.destruct =
        Computation.map (Option.map (Prod.map f (map f))) s_1.destruct
state_after: no goals