Theorem: Computation.exists_of_mem_parallel
File: Mathlib/Data/Seq/Parallel.lean

tactic: suffices
  ∀ C, a ∈ C → ∀ (l : List (Computation α)) (S),
    corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c from
  let ⟨c, h1, h2⟩ := this _ h [] S rfl
  ⟨c, h1.resolve_left <| List.not_mem_nil _, h2⟩
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
⊢ ∃ c, c ∈ S ∧ a ∈ c
state_after: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
⊢ ∀ (C : Computation α),
    a ∈ C →
      ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
        corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: intro C aC
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
⊢ ∀ (C : Computation α),
    a ∈ C →
      ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
        corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
⊢ ∀ (l : List (Computation α)) (S : WSeq (Computation α)), corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: apply memRecOn aC <;> [skip; intro C' IH] <;> intro l S e <;> have e' := congr_arg destruct e <;>
  have := lem1 l <;> simp only [parallel.aux1, corec_eq, destruct_pure, destruct_think] at e' <;>
  revert this e' <;> cases' parallel.aux2 l with a' l' <;> intro this e' <;>
  [injection e' with h'; injection e'; injection e'; injection e' with h']
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
⊢ ∀ (l : List (Computation α)) (S : WSeq (Computation α)), corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h1.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = pure a
a' : α
this : F l (Sum.inl a')
h' : a' = a
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

case h2.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
h' :
  corec parallel.aux1
      ((fun l' =>
          match Seq.destruct S with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: intro l a
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
⊢ List (Computation α) → α ⊕ List (Computation α) → Prop
state_after: α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
l : List (Computation α)
a : α ⊕ List (Computation α)
⊢ Prop

tactic: cases' a with a l'
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
l : List (Computation α)
a : α ⊕ List (Computation α)
⊢ Prop
state_after: case inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
l : List (Computation α)
a : α
⊢ Prop

case inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
l l' : List (Computation α)
⊢ Prop

tactic: exact ∃ c ∈ l, a ∈ c
state_before: case inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
l : List (Computation α)
a : α
⊢ Prop
state_after: no goals

tactic: exact ∀ a', (∃ c ∈ l', a' ∈ c) → ∃ c ∈ l, a' ∈ c
state_before: case inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
l l' : List (Computation α)
⊢ Prop
state_after: no goals

tactic: intro l
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
⊢ ∀ (l : List (Computation α)), F l (parallel.aux2 l)
state_after: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
l : List (Computation α)
⊢ F l (parallel.aux2 l)

tactic: induction' l with c l IH <;> simp only [parallel.aux2, List.foldr]
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
l : List (Computation α)
⊢ F l (parallel.aux2 l)
state_after: case nil
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
⊢ F [] (Sum.inr [])

case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
IH : F l (parallel.aux2 l)
⊢ F (c :: l)
    (match
      List.foldr
        (fun c o =>
          match o with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
        (Sum.inr []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)

tactic: intro a h
state_before: case nil
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
⊢ F [] (Sum.inr [])
state_after: case nil
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
a : α
h : ∃ c, c ∈ [] ∧ a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c

tactic: rcases h with ⟨c, hn, _⟩
state_before: case nil
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
a : α
h : ∃ c, c ∈ [] ∧ a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c
state_after: case nil.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
a : α
c : Computation α
hn : c ∈ []
right✝ : a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c

tactic: exact False.elim <| List.not_mem_nil _ hn
state_before: case nil.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
a : α
c : Computation α
hn : c ∈ []
right✝ : a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c
state_after: no goals

tactic: simp only [parallel.aux2] at IH
state_before: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
IH : F l (parallel.aux2 l)
⊢ F (c :: l)
    (match
      List.foldr
        (fun c o =>
          match o with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
        (Sum.inr []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
state_after: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
IH :
  F l
    (List.foldr
      (fun c o =>
        match o with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
      (Sum.inr []) l)
⊢ F (c :: l)
    (match
      List.foldr
        (fun c o =>
          match o with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
        (Sum.inr []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)

tactic: revert IH
state_before: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
IH :
  F l
    (List.foldr
      (fun c o =>
        match o with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
      (Sum.inr []) l)
⊢ F (c :: l)
    (match
      List.foldr
        (fun c o =>
          match o with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
        (Sum.inr []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
state_after: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
⊢ F l
      (List.foldr
        (fun c o =>
          match o with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
        (Sum.inr []) l) →
    F (c :: l)
      (match
        List.foldr
          (fun c o =>
            match o with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
          (Sum.inr []) l with
      | Sum.inl a => Sum.inl a
      | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)

tactic: cases' List.foldr (fun c o =>
  match o with
  | Sum.inl a => Sum.inl a
  | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) (Sum.inr List.nil) l with a ls <;>
  intro IH <;>
  simp only [parallel.aux2]
state_before: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
⊢ F l
      (List.foldr
        (fun c o =>
          match o with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
        (Sum.inr []) l) →
    F (c :: l)
      (match
        List.foldr
          (fun c o =>
            match o with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
          (Sum.inr []) l with
      | Sum.inl a => Sum.inl a
      | Sum.inr ls => rmap (fun c' => c' :: ls) c.destruct)
state_after: case cons.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
a : α
IH : F l (Sum.inl a)
⊢ F (c :: l) (Sum.inl a)

case cons.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
⊢ F (c :: l) (rmap (fun c' => c' :: ls) c.destruct)

tactic: rcases IH with ⟨c', cl, ac⟩
state_before: case cons.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
a : α
IH : F l (Sum.inl a)
⊢ F (c :: l) (Sum.inl a)
state_after: case cons.inl.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
a : α
c' : Computation α
cl : c' ∈ l
ac : a ∈ c'
⊢ F (c :: l) (Sum.inl a)

tactic: exact ⟨c', List.Mem.tail _ cl, ac⟩
state_before: case cons.inl.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l : List (Computation α)
a : α
c' : Computation α
cl : c' ∈ l
ac : a ∈ c'
⊢ F (c :: l) (Sum.inl a)
state_after: no goals

tactic: induction' h : destruct c with a c' <;> simp only [rmap]
state_before: case cons.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
⊢ F (c :: l) (rmap (fun c' => c' :: ls) c.destruct)
state_after: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
a : α
h : c.destruct = Sum.inl a
⊢ F (c :: l) (Sum.inl a)

case cons.inr.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
⊢ F (c :: l) (Sum.inr (c' :: ls))

tactic: refine ⟨c, List.mem_cons_self _ _, ?_⟩
state_before: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
a : α
h : c.destruct = Sum.inl a
⊢ F (c :: l) (Sum.inl a)
state_after: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
a : α
h : c.destruct = Sum.inl a
⊢ a ∈ c

tactic: rw [destruct_eq_pure h]
state_before: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
a : α
h : c.destruct = Sum.inl a
⊢ a ∈ c
state_after: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
a : α
h : c.destruct = Sum.inl a
⊢ a ∈ pure a

tactic: apply ret_mem
state_before: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
a : α
h : c.destruct = Sum.inl a
⊢ a ∈ pure a
state_after: no goals

tactic: intro a' h
state_before: case cons.inr.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
⊢ F (c :: l) (Sum.inr (c' :: ls))
state_after: case cons.inr.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h✝ : c.destruct = Sum.inr c'
a' : α
h : ∃ c, c ∈ c' :: ls ∧ a' ∈ c
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: rcases h with ⟨d, dm, ad⟩
state_before: case cons.inr.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h✝ : c.destruct = Sum.inr c'
a' : α
h : ∃ c, c ∈ c' :: ls ∧ a' ∈ c
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
dm : d ∈ c' :: ls
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: simp? at dm says simp only [List.mem_cons] at dm
state_before: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
dm : d ∈ c' :: ls
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dm : d = c' ∨ d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: cases' dm with e dl
state_before: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dm : d = c' ∨ d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

case cons.inr.inr.intro.intro.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dl : d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: simp only [List.mem_cons] at dm
state_before: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
dm : d ∈ c' :: ls
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dm : d = c' ∨ d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: rw [e] at ad
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: refine ⟨c, List.mem_cons_self _ _, ?_⟩
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ c

tactic: rw [destruct_eq_think h]
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ c
state_after: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ c'.think

tactic: exact think_mem ad
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ c'.think
state_after: no goals

tactic: cases' IH a' ⟨d, dl, ad⟩ with d dm
state_before: case cons.inr.inr.intro.intro.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dl : d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro.inr.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d✝ : Computation α
ad : a' ∈ d✝
dl : d✝ ∈ ls
d : Computation α
dm : d ∈ l ∧ a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: cases' dm with dm ad
state_before: case cons.inr.inr.intro.intro.inr.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d✝ : Computation α
ad : a' ∈ d✝
dl : d✝ ∈ ls
d : Computation α
dm : d ∈ l ∧ a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: case cons.inr.inr.intro.intro.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d✝ : Computation α
ad✝ : a' ∈ d✝
dl : d✝ ∈ ls
d : Computation α
dm : d ∈ l
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1

tactic: exact ⟨d, List.Mem.tail _ dm, ad⟩
state_before: case cons.inr.inr.intro.intro.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
c : Computation α
l ls : List (Computation α)
IH : F l (Sum.inr ls)
c' : Computation α
h : c.destruct = Sum.inr c'
a' : α
d✝ : Computation α
ad✝ : a' ∈ d✝
dl : d✝ ∈ ls
d : Computation α
dm : d ∈ l
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
state_after: no goals

tactic: rw [h'] at this
state_before: case h1.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = pure a
a' : α
this : F l (Sum.inl a')
h' : a' = a
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h1.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = pure a
a' : α
this : F l (Sum.inl a)
h' : a' = a
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: rcases this with ⟨c, cl, ac⟩
state_before: case h1.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = pure a
a' : α
this : F l (Sum.inl a)
h' : a' = a
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h1.inl.intro.intro
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = pure a
a' : α
h' : a' = a
c : Computation α
cl : c ∈ l
ac : a ∈ c
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: exact ⟨c, Or.inl cl, ac⟩
state_before: case h1.inl.intro.intro
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = pure a
a' : α
h' : a' = a
c : Computation α
cl : c ∈ l
ac : a ∈ c
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: no goals

tactic: induction' e : Seq.destruct S with a <;> rw [e] at h'
state_before: case h2.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
h' :
  corec parallel.aux1
      ((fun l' =>
          match Seq.destruct S with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.none
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
h' :
  corec parallel.aux1
      ((fun l' =>
          match none with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
e : Seq.destruct S = none
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

case h2.inr.some
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a✝ ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a✝ ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
a : Seq1 (Option (Computation α))
h' :
  corec parallel.aux1
      ((fun l' =>
          match some a with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
e : Seq.destruct S = some a
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a✝ ∈ c

tactic: exact
  let ⟨d, o, ad⟩ := IH _ _ h'
  let ⟨c, cl, ac⟩ := this a ⟨d, o.resolve_right (WSeq.not_mem_nil _), ad⟩
  ⟨c, Or.inl cl, ac⟩
state_before: case h2.inr.none
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
h' :
  corec parallel.aux1
      ((fun l' =>
          match none with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
e : Seq.destruct S = none
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: no goals

tactic: cases' a with o S'
state_before: case h2.inr.some
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a✝ ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a✝ ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
a : Seq1 (Option (Computation α))
h' :
  corec parallel.aux1
      ((fun l' =>
          match some a with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
e : Seq.destruct S = some a
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a✝ ∈ c
state_after: case h2.inr.some.mk
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
o : Option (Computation α)
S' : Stream'.Seq (Option (Computation α))
h' :
  corec parallel.aux1
      ((fun l' =>
          match some (o, S') with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
e : Seq.destruct S = some (o, S')
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: cases' o with c <;> simp [parallel.aux1] at h' <;> rcases IH _ _ h' with ⟨d, dl | dS', ad⟩
state_before: case h2.inr.some.mk
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
o : Option (Computation α)
S' : Stream'.Seq (Option (Computation α))
h' :
  corec parallel.aux1
      ((fun l' =>
          match some (o, S') with
          | none => (l', Seq.nil)
          | some (none, S') => (l', S')
          | some (some c, S') => (c :: l', S'))
        l') =
    C'
e : Seq.destruct S = some (o, S')
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.none.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dl : d ∈ l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

case h2.inr.some.mk.some.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dl : d ∈ c :: l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: exact
  let ⟨c, cl, ac⟩ := this a ⟨d, dl, ad⟩
  ⟨c, Or.inl cl, ac⟩
state_before: case h2.inr.some.mk.none.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dl : d ∈ l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: no goals

tactic: refine ⟨d, Or.inr ?_, ad⟩
state_before: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ S

tactic: rw [Seq.destruct_eq_cons e]
state_before: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ S
state_after: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ Seq.cons none S'

tactic: exact Seq.mem_cons_of_mem _ dS'
state_before: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
h' : corec parallel.aux1 (l', S') = C'
e : Seq.destruct S = some (none, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ Seq.cons none S'
state_after: no goals

tactic: simp at dl
state_before: case h2.inr.some.mk.some.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dl : d ∈ c :: l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.some.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dl : d = c ∨ d ∈ l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: cases' dl with dc dl
state_before: case h2.inr.some.mk.some.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dl : d = c ∨ d ∈ l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dc : d = c
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

case h2.inr.some.mk.some.intro.intro.inl.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dl : d ∈ l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: rw [dc] at ad
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dc : d = c
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ c
dc : d = c
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: refine ⟨c, Or.inr ?_, ad⟩
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ c
dc : d = c
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ c
dc : d = c
⊢ c ∈ S

tactic: rw [Seq.destruct_eq_cons e]
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ c
dc : d = c
⊢ c ∈ S
state_after: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ c
dc : d = c
⊢ c ∈ Seq.cons (some c) S'

tactic: apply Seq.mem_cons
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ c
dc : d = c
⊢ c ∈ Seq.cons (some c) S'
state_after: no goals

tactic: exact
  let ⟨c, cl, ac⟩ := this a ⟨d, dl, ad⟩
  ⟨c, Or.inl cl, ac⟩
state_before: case h2.inr.some.mk.some.intro.intro.inl.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dl : d ∈ l'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: no goals

tactic: refine ⟨d, Or.inr ?_, ad⟩
state_before: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
state_after: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ S

tactic: rw [Seq.destruct_eq_cons e]
state_before: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ S
state_after: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ Seq.cons (some c) S'

tactic: exact Seq.mem_cons_of_mem _ dS'
state_before: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) ⋯
lem1 : ∀ (l : List (Computation α)), F l (parallel.aux2 l)
C : Computation α
aC : a ∈ C
C' : Computation α
IH :
  ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
    corec parallel.aux1 (l, S) = C' → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
l : List (Computation α)
S : WSeq (Computation α)
e✝ : corec parallel.aux1 (l, S) = C'.think
l' : List (Computation α)
this : F l (Sum.inr l')
S' : Stream'.Seq (Option (Computation α))
c : Computation α
h' : corec parallel.aux1 (c :: l', S') = C'
e : Seq.destruct S = some (some c, S')
d : Computation α
ad : a ∈ d
dS' : d ∈ S'
⊢ d ∈ Seq.cons (some c) S'
state_after: no goals