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

tactic: apply flatten_congr
state_before: α : Type u
β : Type v
γ : Type w
s t : WSeq α
h : s ~ʷ t
⊢ tail s ~ʷ tail t

tactic: rw [← Computation.bind_pure, ← Computation.bind_pure]
state_before: case a
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h : s ~ʷ t
⊢ Computation.LiftRel Equiv (Computation.map (fun o => Option.rec nil Prod.snd o) (destruct s))
    (Computation.map (fun o => Option.rec nil Prod.snd o) (destruct t))

tactic: apply liftRel_bind _ _ (destruct_congr h)
state_before: case a
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h : s ~ʷ t
⊢ Computation.LiftRel Equiv (Computation.bind (destruct s) (Computation.pure ∘ fun o => Option.rec nil Prod.snd o))
    (Computation.bind (destruct t) (Computation.pure ∘ fun o => Option.rec nil Prod.snd o))

tactic: intro a b h
state_before: case a
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h : s ~ʷ t
⊢ ∀ {a b : Option (α × WSeq α)},
    BisimO (fun x x_1 => x ~ʷ x_1) a b →
      Computation.LiftRel Equiv ((Computation.pure ∘ fun o => Option.rec nil Prod.snd o) a)
        ((Computation.pure ∘ fun o => Option.rec nil Prod.snd o) b)

tactic: simp [-liftRel_pure_left, -liftRel_pure_right]
state_before: case a
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
a b : Option (α × WSeq α)
h : BisimO (fun x x_1 => x ~ʷ x_1) a b
⊢ Computation.LiftRel Equiv ((Computation.pure ∘ fun o => Option.rec nil Prod.snd o) a)
    ((Computation.pure ∘ fun o => Option.rec nil Prod.snd o) b)

tactic: cases' a with a <;> cases' b with b
state_before: case a
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
a b : Option (α × WSeq α)
h : BisimO (fun x x_1 => x ~ʷ x_1) a b
⊢ Option.rec nil Prod.snd a ~ʷ Option.rec nil Prod.snd b

tactic: trivial
state_before: case a.none.none
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
h : BisimO (fun x x_1 => x ~ʷ x_1) none none
⊢ Option.rec nil Prod.snd none ~ʷ Option.rec nil Prod.snd none

tactic: cases h
state_before: case a.none.some
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
b : α × WSeq α
h : BisimO (fun x x_1 => x ~ʷ x_1) none (some b)
⊢ Option.rec nil Prod.snd none ~ʷ Option.rec nil Prod.snd (some b)

tactic: cases a
state_before: case a.some.none
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
a : α × WSeq α
h : BisimO (fun x x_1 => x ~ʷ x_1) (some a) none
⊢ Option.rec nil Prod.snd (some a) ~ʷ Option.rec nil Prod.snd none

tactic: cases h
state_before: case a.some.none.mk
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
fst✝ : α
snd✝ : WSeq α
h : BisimO (fun x x_1 => x ~ʷ x_1) (some (fst✝, snd✝)) none
⊢ Option.rec nil Prod.snd (some (fst✝, snd✝)) ~ʷ Option.rec nil Prod.snd none

tactic: cases' a with a s'
state_before: case a.some.some
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
a b : α × WSeq α
h : BisimO (fun x x_1 => x ~ʷ x_1) (some a) (some b)
⊢ Option.rec nil Prod.snd (some a) ~ʷ Option.rec nil Prod.snd (some b)

tactic: cases' b with b t'
state_before: case a.some.some.mk
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
b : α × WSeq α
a : α
s' : WSeq α
h : BisimO (fun x x_1 => x ~ʷ x_1) (some (a, s')) (some b)
⊢ Option.rec nil Prod.snd (some (a, s')) ~ʷ Option.rec nil Prod.snd (some b)

tactic: exact h.right
state_before: case a.some.some.mk.mk
α : Type u
β : Type v
γ : Type w
s t : WSeq α
h✝ : s ~ʷ t
a : α
s' : WSeq α
b : α
t' : WSeq α
h : BisimO (fun x x_1 => x ~ʷ x_1) (some (a, s')) (some (b, t'))
⊢ Option.rec nil Prod.snd (some (a, s')) ~ʷ Option.rec nil Prod.snd (some (b, t'))