α : Type u
β : Type v
γ : Type w
s : WSeq α
⊢ ∀ {s t : WSeq α},
    (fun s1 s2 => join (map ret s2) = s1) s t →
      Computation.LiftRel (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1) (destruct s)
        (destruct t)
α : Type u
β : Type v
γ : Type w
s : WSeq α
⊢ join (map ret s) ~ʷ s
refine' ⟨fun s1 s2 => join (map ret s2) = s1, rfl, _⟩
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ Computation.LiftRel (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1) (destruct s') (destruct s)
α : Type u
β : Type v
γ : Type w
s : WSeq α
⊢ ∀ {s t : WSeq α},
    (fun s1 s2 => join (map ret s2) = s1) s t →
      Computation.LiftRel (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1) (destruct s)
        (destruct t)
intro s' s h
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ Computation.LiftRel (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (destruct (join (map ret s))) (destruct s)
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ Computation.LiftRel (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1) (destruct s') (destruct s)
rw [← h]
case H
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ ∀ {ca cb : Computation (Option (α × WSeq α))},
    (∃ s, ca = destruct (join (map ret s)) ∧ cb = destruct s) →
      LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
        (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s) (Computation.destruct ca)
        (Computation.destruct cb)

case Hc
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ ∃ s_1, destruct (join (map ret s)) = destruct (join (map ret s_1)) ∧ destruct s = destruct s_1
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ Computation.LiftRel (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (destruct (join (map ret s))) (destruct s)
apply lift_rel_rec fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s
no goals
case H
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ ∀ {ca cb : Computation (Option (α × WSeq α))},
    (∃ s, ca = destruct (join (map ret s)) ∧ cb = destruct s) →
      LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
        (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s) (Computation.destruct ca)
        (Computation.destruct cb)
exact fun {c1 c2} h =>
  match c1, c2, h with
  | _, _, ⟨s, rfl, rfl⟩ => by
    clear h
    have : ∀ s, ∃ s' : WSeq α,
        (map (fun a => cons a nil) s).join.destruct =
          (map (fun a => cons a nil) s').join.destruct ∧ destruct s = s'.destruct :=
      fun s => ⟨s, rfl, rfl⟩
    induction' s using WSeq.recOn with a s s <;> simp [ret, ret_mem, this, Option.exists]
α : Type u
β : Type v
γ : Type w
s✝¹ s' s✝ : WSeq α
h : join (map ret s✝) = s'
c1 c2 : Computation (Option (α × WSeq α))
s : WSeq α
⊢ LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s)
    (Computation.destruct (destruct (join (map ret s)))) (Computation.destruct (destruct s))
α : Type u
β : Type v
γ : Type w
s✝¹ s' s✝ : WSeq α
h✝ : join (map ret s✝) = s'
c1 c2 : Computation (Option (α × WSeq α))
h : ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s
s : WSeq α
⊢ LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s)
    (Computation.destruct (destruct (join (map ret s)))) (Computation.destruct (destruct s))
clear h
α : Type u
β : Type v
γ : Type w
s✝¹ s' s✝ : WSeq α
h : join (map ret s✝) = s'
c1 c2 : Computation (Option (α × WSeq α))
s : WSeq α
this :
  ∀ (s : WSeq α),
    ∃ s',
      destruct (join (map (fun a => cons a nil) s)) = destruct (join (map (fun a => cons a nil) s')) ∧
        destruct s = destruct s'
⊢ LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s)
    (Computation.destruct (destruct (join (map ret s)))) (Computation.destruct (destruct s))
α : Type u
β : Type v
γ : Type w
s✝¹ s' s✝ : WSeq α
h : join (map ret s✝) = s'
c1 c2 : Computation (Option (α × WSeq α))
s : WSeq α
⊢ LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s)
    (Computation.destruct (destruct (join (map ret s)))) (Computation.destruct (destruct s))
have : ∀ s, ∃ s' : WSeq α,
    (map (fun a => cons a nil) s).join.destruct =
      (map (fun a => cons a nil) s').join.destruct ∧ destruct s = s'.destruct :=
  fun s => ⟨s, rfl, rfl⟩
no goals
α : Type u
β : Type v
γ : Type w
s✝¹ s' s✝ : WSeq α
h : join (map ret s✝) = s'
c1 c2 : Computation (Option (α × WSeq α))
s : WSeq α
this :
  ∀ (s : WSeq α),
    ∃ s',
      destruct (join (map (fun a => cons a nil) s)) = destruct (join (map (fun a => cons a nil) s')) ∧
        destruct s = destruct s'
⊢ LiftRelAux (LiftRelO (fun x x_1 => x = x_1) fun s1 s2 => join (map ret s2) = s1)
    (fun c1 c2 => ∃ s, c1 = destruct (join (map ret s)) ∧ c2 = destruct s)
    (Computation.destruct (destruct (join (map ret s)))) (Computation.destruct (destruct s))
induction' s using WSeq.recOn with a s s <;> simp [ret, ret_mem, this, Option.exists]
no goals
case Hc
α : Type u
β : Type v
γ : Type w
s✝ s' s : WSeq α
h : join (map ret s) = s'
⊢ ∃ s_1, destruct (join (map ret s)) = destruct (join (map ret s_1)) ∧ destruct s = destruct s_1
exact ⟨s, rfl, rfl⟩