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

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

tactic: 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
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
⊢ ∀ (C : Computation α),
    a ∈ C →
      ∀ (l : List (Computation α)) (S : WSeq (Computation α)),
        corec parallel.aux1 (l, S) = C → ∃ c, (c ∈ l ∨ c ∈ S) ∧ a ∈ c

tactic: intro C aC
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: apply memRecOn aC <;> [skip; intro C' IH] <;> intro l S e <;> have e' := congr_arg destruct e <;>
  have := lem1 l <;> simp only [parallel.aux1, corec_eq, destruct_pure, destruct_think] at e' <;>
  revert this e' <;> cases' parallel.aux2 l with a' l' <;> intro this e' <;>
  [injection e' with h'; injection e'; injection e'; injection e' with h']
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

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

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

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

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

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

tactic: intro l
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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)

tactic: induction' l with c l IH <;> simp only [parallel.aux2, List.foldr]
state_before: α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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)

tactic: intro a h
state_before: case nil
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rcases h with ⟨c, hn, _⟩
state_before: case nil
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact False.elim <| List.not_mem_nil _ hn
state_before: case nil.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: simp only [parallel.aux2] at IH
state_before: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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))

tactic: revert IH
state_before: case cons
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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))

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

tactic: rcases IH with ⟨c', cl, ac⟩
state_before: case cons.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: refine' ⟨c', List.Mem.tail _ cl, ac⟩
state_before: case cons.inl.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: induction' h : destruct c with a c' <;> simp only [rmap]
state_before: case cons.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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))

tactic: refine' ⟨c, List.mem_cons_self _ _, _⟩
state_before: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝¹ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [destruct_eq_pure h]
state_before: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝¹ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: apply ret_mem
state_before: case cons.inr.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a✝ : α
h✝¹ : a✝ ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: intro a' h
state_before: case cons.inr.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rcases h with ⟨d, dm, ad⟩
state_before: case cons.inr.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝² : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: simp at dm
state_before: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: cases' dm with e dl
state_before: case cons.inr.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [e] at ad
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: refine' ⟨c, List.mem_cons_self _ _, _⟩
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [destruct_eq_think h]
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact think_mem ad
state_before: case cons.inr.inr.intro.intro.inl
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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'

tactic: cases' IH a' ⟨d, dl, ad⟩ with d dm
state_before: case cons.inr.inr.intro.intro.inr
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: cases' dm with dm ad
state_before: case cons.inr.inr.intro.intro.inr.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact ⟨d, List.Mem.tail _ dm, ad⟩
state_before: case cons.inr.inr.intro.intro.inr.intro.intro
α : Type u
β : Type v
S : WSeq (Computation α)
a : α
h✝¹ : a ∈ parallel S
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [h'] at this
state_before: case h1.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rcases this with ⟨c, cl, ac⟩
state_before: case h1.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact ⟨c, Or.inl cl, ac⟩
state_before: case h1.inl.intro.intro
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: induction' e : Seq.destruct S with a <;> rw [e] at h'
state_before: case h2.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact
  let ⟨d, o, ad⟩ := IH _ _ h'
  let ⟨c, cl, ac⟩ := this a ⟨d, o.resolve_right (WSeq.not_mem_nil _), ad⟩
  ⟨c, Or.inl cl, ac⟩
state_before: case h2.inr.none
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: cases' a with o S'
state_before: case h2.inr.some
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a✝ : α
h : a✝ ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: cases' o with c <;> simp [parallel.aux1] at h' <;> rcases IH _ _ h' with ⟨d, dl | dS', ad⟩
state_before: case h2.inr.some.mk
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact
  let ⟨c, cl, ac⟩ := this a ⟨d, dl, ad⟩
  ⟨c, Or.inl cl, ac⟩
state_before: case h2.inr.some.mk.none.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: refine' ⟨d, Or.inr _, ad⟩
state_before: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [Seq.destruct_eq_cons e]
state_before: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact Seq.mem_cons_of_mem _ dS'
state_before: case h2.inr.some.mk.none.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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'

tactic: simp at dl
state_before: case h2.inr.some.mk.some.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: cases' dl with dc dl
state_before: case h2.inr.some.mk.some.intro.intro.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [dc] at ad
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: refine' ⟨c, Or.inr _, ad⟩
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [Seq.destruct_eq_cons e]
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: apply Seq.mem_cons
state_before: case h2.inr.some.mk.some.intro.intro.inl.inl
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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'

tactic: exact
  let ⟨c, cl, ac⟩ := this a ⟨d, dl, ad⟩
  ⟨c, Or.inl cl, ac⟩
state_before: case h2.inr.some.mk.some.intro.intro.inl.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: refine' ⟨d, Or.inr _, ad⟩
state_before: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: rw [Seq.destruct_eq_cons e]
state_before: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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

tactic: exact Seq.mem_cons_of_mem _ dS'
state_before: case h2.inr.some.mk.some.intro.intro.inr
α : Type u
β : Type v
S✝ : WSeq (Computation α)
a : α
h : a ∈ parallel S✝
F : List (Computation α) → α ⊕ List (Computation α) → Prop :=
  fun l a =>
    Sum.casesOn (motive := fun t => a = t → Prop) a (fun a_1 h => (_ : 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'