α : 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
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
⊢ ∃ c, c ∈ S ∧ a ∈ c
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⟩
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
⊢ ∀ (C : Computation α),
    a ∈ C →
      ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
        corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
α : 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
let F : List (Computation α) → Sum α (List (Computation α)) → Prop := by
  intro l a
  cases' a with a l'
  exact ∃ c ∈ l, a ∈ c
  exact ∀ a', (∃ c ∈ l', a' ∈ c) → ∃ c ∈ l, a' ∈ c
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
intro C aC
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
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
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
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']
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
l : List (Computation α)
a : α ⊕ List (Computation α)
⊢ Prop
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
⊢ List (Computation α) → α ⊕ List (Computation α) → Prop
intro l a
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
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
l : List (Computation α)
a : α ⊕ List (Computation α)
⊢ Prop
cases' a with a l'
case inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
l l' : List (Computation α)
⊢ Prop
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
exact ∃ c ∈ l, a ∈ c
no goals
case inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
l l' : List (Computation α)
⊢ Prop
exact ∀ a', (∃ c ∈ l', a' ∈ c) → ∃ c ∈ l, a' ∈ c
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
l : List (Computation α)
⊢ F l (parallel.aux2 l)
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
⊢ ∀ (l : List (Computation α)), F l (parallel.aux2 l)
intro l
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
⊢ ∀ (a' : α), (∃ c, c ∈ [] ∧ a' ∈ c) → ∃ c, c ∈ [] ∧ a' ∈ c

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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
IH : F l (parallel.aux2 l)
⊢ Sum.rec (motive := fun t =>
    (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        t →
      Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
    (fun val h =>
      (_ :
          Sum.inr val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
    (match
      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 []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
    (_ :
      (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
α : 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
l : List (Computation α)
⊢ F l (parallel.aux2 l)
induction' l with c l IH <;> simp only [parallel.aux2, List.foldr]
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
a : α
h : ∃ c, c ∈ [] ∧ a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
⊢ ∀ (a' : α), (∃ c, c ∈ [] ∧ a' ∈ c) → ∃ c, c ∈ [] ∧ a' ∈ c
intro a h
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
a : α
c : Computation α
hn : c ∈ []
right✝ : a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
a : α
h : ∃ c, c ∈ [] ∧ a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c
rcases h with ⟨c, hn, _⟩
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
a : α
c : Computation α
hn : c ∈ []
right✝ : a ∈ c
⊢ ∃ c, c ∈ [] ∧ a ∈ c
exact False.elim <| List.not_mem_nil _ hn
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
IH :
  Sum.rec (motive := fun t =>
    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 []) l =
        t →
      Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            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 []) l) ▸
        ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h =>
      (_ :
          Sum.inr val =
            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 []) l) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (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 []) l)
    (_ :
      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 []) l =
        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 []) l)
⊢ Sum.rec (motive := fun t =>
    (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        t →
      Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
    (fun val h =>
      (_ :
          Sum.inr val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
    (match
      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 []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
    (_ :
      (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
IH : F l (parallel.aux2 l)
⊢ Sum.rec (motive := fun t =>
    (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        t →
      Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
    (fun val h =>
      (_ :
          Sum.inr val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
    (match
      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 []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
    (_ :
      (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
simp only [parallel.aux2] at IH
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
⊢ Sum.rec (motive := fun t =>
      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 []) l =
          t →
        Prop)
      (fun val h =>
        (_ :
            Sum.inl val =
              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 []) l) ▸
          ∃ c, c ∈ l ∧ val ∈ c)
      (fun val h =>
        (_ :
            Sum.inr val =
              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 []) l) ▸
          ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
      (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 []) l)
      (_ :
        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 []) l =
          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 []) l) →
    Sum.rec (motive := fun t =>
      (match
            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 []) l with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
          t →
        Prop)
      (fun val h =>
        (_ :
            Sum.inl val =
              match
                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 []) l with
              | Sum.inl a => Sum.inl a
              | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
          ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
      (fun val h =>
        (_ :
            Sum.inr val =
              match
                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 []) l with
              | Sum.inl a => Sum.inl a
              | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
          ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
      (match
        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 []) l with
      | Sum.inl a => Sum.inl a
      | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
      (_ :
        (match
            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 []) l with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
          match
            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 []) l with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
IH :
  Sum.rec (motive := fun t =>
    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 []) l =
        t →
      Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            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 []) l) ▸
        ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h =>
      (_ :
          Sum.inr val =
            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 []) l) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (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 []) l)
    (_ :
      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 []) l =
        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 []) l)
⊢ Sum.rec (motive := fun t =>
    (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        t →
      Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
    (fun val h =>
      (_ :
          Sum.inr val =
            match
              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 []) l with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
    (match
      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 []) l with
    | Sum.inl a => Sum.inl a
    | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
    (_ :
      (match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        match
          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 []) l with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
revert IH
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
a : α
IH :
  Sum.rec (motive := fun t => Sum.inl a = t → Prop) (fun val h => (_ : Sum.inl val = Sum.inl a) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inl a) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (Sum.inl a)
    (_ : Sum.inl a = Sum.inl a)
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a ∈ c_1

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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
⊢ Sum.rec (motive := fun t => rmap (fun c' => c' :: ls) (destruct c) = t → Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            match Sum.inr ls with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
    (fun val h =>
      (_ :
          Sum.inr val =
            match Sum.inr ls with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
    (rmap (fun c' => c' :: ls) (destruct c))
    (_ :
      (match Sum.inr ls with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        match Sum.inr ls with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
⊢ Sum.rec (motive := fun t =>
      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 []) l =
          t →
        Prop)
      (fun val h =>
        (_ :
            Sum.inl val =
              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 []) l) ▸
          ∃ c, c ∈ l ∧ val ∈ c)
      (fun val h =>
        (_ :
            Sum.inr val =
              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 []) l) ▸
          ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
      (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 []) l)
      (_ :
        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 []) l =
          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 []) l) →
    Sum.rec (motive := fun t =>
      (match
            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 []) l with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
          t →
        Prop)
      (fun val h =>
        (_ :
            Sum.inl val =
              match
                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 []) l with
              | Sum.inl a => Sum.inl a
              | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
          ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
      (fun val h =>
        (_ :
            Sum.inr val =
              match
                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 []) l with
              | Sum.inl a => Sum.inl a
              | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
          ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
      (match
        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 []) l with
      | Sum.inl a => Sum.inl a
      | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
      (_ :
        (match
            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 []) l with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
          match
            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 []) l with
          | Sum.inl a => Sum.inl a
          | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
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]
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
a : α
c' : Computation α
cl : c' ∈ l
ac : a ∈ c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
a : α
IH :
  Sum.rec (motive := fun t => Sum.inl a = t → Prop) (fun val h => (_ : Sum.inl val = Sum.inl a) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inl a) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (Sum.inl a)
    (_ : Sum.inl a = Sum.inl a)
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a ∈ c_1
rcases IH with ⟨c', cl, ac⟩
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l : List (Computation α)
a : α
c' : Computation α
cl : c' ∈ l
ac : a ∈ c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a ∈ c_1
refine' ⟨c', List.Mem.tail _ cl, ac⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
a : α
h : destruct c = Sum.inl a
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a ∈ c_1

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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
⊢ ∀ (a' : α), (∃ c, c ∈ c' :: ls ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
⊢ Sum.rec (motive := fun t => rmap (fun c' => c' :: ls) (destruct c) = t → Prop)
    (fun val h =>
      (_ :
          Sum.inl val =
            match Sum.inr ls with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∃ c_1, c_1 ∈ c :: l ∧ val ∈ c_1)
    (fun val h =>
      (_ :
          Sum.inr val =
            match Sum.inr ls with
            | Sum.inl a => Sum.inl a
            | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) ▸
        ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1)
    (rmap (fun c' => c' :: ls) (destruct c))
    (_ :
      (match Sum.inr ls with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c)) =
        match Sum.inr ls with
        | Sum.inl a => Sum.inl a
        | Sum.inr ls => rmap (fun c' => c' :: ls) (destruct c))
induction' h : destruct c with a c' <;> simp only [rmap]
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
a : α
h : destruct c = Sum.inl a
⊢ a ∈ c
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
a : α
h : destruct c = Sum.inl a
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a ∈ c_1
refine' ⟨c, List.mem_cons_self _ _, _⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
a : α
h : destruct c = Sum.inl a
⊢ a ∈ pure a
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
a : α
h : destruct c = Sum.inl a
⊢ a ∈ c
rw [destruct_eq_pure h]
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
a : α
h : destruct c = Sum.inl a
⊢ a ∈ pure a
apply ret_mem
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝¹ : destruct c = x✝
c' : Computation α
h✝ : destruct c = Sum.inr c'
a' : α
h : ∃ c, c ∈ c' :: ls ∧ a' ∈ c
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
⊢ ∀ (a' : α), (∃ c, c ∈ c' :: ls ∧ a' ∈ c) → ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
intro a' h
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
dm : d ∈ c' :: ls
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝¹ : destruct c = x✝
c' : Computation α
h✝ : destruct c = Sum.inr c'
a' : α
h : ∃ c, c ∈ c' :: ls ∧ a' ∈ c
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
rcases h with ⟨d, dm, ad⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dm : d = c' ∨ d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
dm : d ∈ c' :: ls
ad : a' ∈ d
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
simp at dm
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dl : d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dm : d = c' ∨ d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
cases' dm with e dl
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
rw [e] at ad
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ c
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
refine' ⟨c, List.mem_cons_self _ _, _⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ think c'
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ c
rw [destruct_eq_think h]
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ c'
e : d = c'
⊢ a' ∈ think c'
exact think_mem ad
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = 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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = Sum.inr c'
a' : α
d : Computation α
ad : a' ∈ d
dl : d ∈ ls
⊢ ∃ c_1, c_1 ∈ c :: l ∧ a' ∈ c_1
cases' IH a' ⟨d, dl, ad⟩ with d dm
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = 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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = 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
cases' dm with dm ad
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
c : Computation α
l ls : List (Computation α)
IH :
  Sum.rec (motive := fun t => Sum.inr ls = t → Prop)
    (fun val h => (_ : Sum.inl val = Sum.inr ls) ▸ ∃ c, c ∈ l ∧ val ∈ c)
    (fun val h => (_ : Sum.inr val = Sum.inr ls) ▸ ∀ (a' : α), (∃ c, c ∈ val ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c)
    (Sum.inr ls) (_ : Sum.inr ls = Sum.inr ls)
x✝ : α ⊕ Computation α
h✝ : destruct c = x✝
c' : Computation α
h : destruct c = 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
exact ⟨d, List.Mem.tail _ dm, ad⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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 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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
rw [h'] at this
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
rcases this with ⟨c, cl, ac⟩
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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
exact ⟨c, Or.inl cl, ac⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
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'
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
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
induction' e : Seq.destruct S with a <;> rw [e] at h'
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
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'
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
e : Seq.destruct S = none
⊢ ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c
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⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
cases' a with o S'
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
cases' o with c <;> simp [parallel.aux1] at h' <;> rcases IH _ _ h' with ⟨d, dl | dS', ad⟩
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
exact
  let ⟨c, cl, ac⟩ := this a ⟨d, dl, ad⟩
  ⟨c, Or.inl cl, ac⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
refine' ⟨d, Or.inr _, ad⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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'
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
rw [Seq.destruct_eq_cons e]
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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'
exact Seq.mem_cons_of_mem _ dS'
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
simp at dl
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
cases' dl with dc dl
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
rw [dc] at ad
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
refine' ⟨c, Or.inr _, ad⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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'
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
rw [Seq.destruct_eq_cons e]
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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'
apply Seq.mem_cons
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
exact
  let ⟨c, cl, ac⟩ := this a ⟨d, dl, ad⟩
  ⟨c, Or.inl cl, ac⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
refine' ⟨d, Or.inr _, ad⟩
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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'
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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
rw [Seq.destruct_eq_cons e]
no goals
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 => (_ : Sum.inl a_1 = a) ▸ ∃ c, c ∈ l ∧ a_1 ∈ c)
      (fun l' h => (_ : Sum.inr l' = a) ▸ ∀ (a' : α), (∃ c, c ∈ l' ∧ a' ∈ c) → ∃ c, c ∈ l ∧ a' ∈ c) (_ : a = a)
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) = think C'
l' : List (Computation α)
this : F l (Sum.inr l')
x✝ : Option (Seq1 (Option (Computation α)))
e✝ : Seq.destruct S = x✝
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'
exact Seq.mem_cons_of_mem _ dS'