l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem mem_think (s : WSeq α) (a) : a ∈ think s ↔ a ∈ s := by
  cases' s with f al
  change (some (some a) ∈ some none::f) ↔ some (some a) ∈ f
  constructor <;> intro h
  · apply (Stream'.eq_or_mem_of_mem_cons h).resolve_left
    intro
    

Proof state:
case mk.mp
α : Type u
β : Type v
γ : Type w
a : α
f : Stream' (Option (Option α))
al : IsSeq f
h : some (some a) ∈ some none :: f
a✝ : some (some a) = some none
⊢ False

Next tactic:
injections
@[simp]
theorem mem_think (s : WSeq α) (a) : a ∈ think s ↔ a ∈ s := by
  cases' s with f al
  change (some (some a) ∈ some none::f) ↔ some (some a) ∈ f
  constructor <;> intro h
  · apply (Stream'.eq_or_mem_of_mem_cons h).resolve_left
    intro
    injections
  · 

Proof state:
case mk.mpr
α : Type u
β : Type v
γ : Type w
a : α
f : Stream' (Option (Option α))
al : IsSeq f
h : some (some a) ∈ f
⊢ some (some a) ∈ some none :: f

Next tactic:
apply Stream'.mem_cons_of_mem _ h
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a a' : α
s' : WSeq α
⊢ some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
generalize e : destruct s = c
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; 

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
e : destruct s = c
⊢ some (a', s') ∈ c → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro h
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
e : destruct s = c
h : some (a', s') ∈ c
⊢ a ∈ s ↔ a = a' ∨ a ∈ s'

Next tactic:
revert s
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  

Proof state:
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
⊢ ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
apply Computation.memRecOn h <;> [skip; intro c IH]
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  

Proof state:
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
⊢ ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
apply Computation.memRecOn h
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [

Proof state:
case h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
⊢ ∀ {s : WSeq α}, destruct s = Computation.pure (some (a', s')) → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
skip
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; 

Proof state:
case h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
⊢ ∀ (s : Computation (Option (α × WSeq α))),
    (∀ {s_1 : WSeq α}, destruct s_1 = s → (a ∈ s_1 ↔ a = a' ∨ a ∈ s')) →
      ∀ {s_1 : WSeq α}, destruct s_1 = Computation.think s → (a ∈ s_1 ↔ a = a' ∨ a ∈ s')

Next tactic:
intro c IH
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> 

Proof state:
case h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
⊢ ∀ {s : WSeq α}, destruct s = Computation.pure (some (a', s')) → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro s
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> 

Proof state:
case h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
⊢ ∀ {s : WSeq α}, destruct s = Computation.think c → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro s
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    

Proof state:
case h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
s : WSeq α
⊢ destruct s = Computation.pure (some (a', s')) → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
induction' s using WSeq.recOn with x s s
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    

Proof state:
case h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
s : WSeq α
⊢ destruct s = Computation.think c → (a ∈ s ↔ a = a' ∨ a ∈ s')

Next tactic:
induction' s using WSeq.recOn with x s s
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case h1.h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
⊢ destruct nil = Computation.pure (some (a', s')) → (a ∈ nil ↔ a = a' ∨ a ∈ s')

Next tactic:
intro m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case h1.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
x : α
s : WSeq α
⊢ destruct (cons x s) = Computation.pure (some (a', s')) → (a ∈ cons x s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case h1.h3
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
s : WSeq α
⊢ destruct (think s) = Computation.pure (some (a', s')) → (a ∈ think s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case h2.h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
⊢ destruct nil = Computation.think c → (a ∈ nil ↔ a = a' ∨ a ∈ s')

Next tactic:
intro m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case h2.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
x : α
s : WSeq α
⊢ destruct (cons x s) = Computation.think c → (a ∈ cons x s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case h2.h3
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
s : WSeq α
⊢ destruct (think s) = Computation.think c → (a ∈ think s ↔ a = a' ∨ a ∈ s')

Next tactic:
intro m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    

Proof state:
case h1.h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
m : destruct nil = Computation.pure (some (a', s'))
⊢ a ∈ nil ↔ a = a' ∨ a ∈ s'

Next tactic:
have := congr_arg Computation.destruct m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    

Proof state:
case h1.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
x : α
s : WSeq α
m : destruct (cons x s) = Computation.pure (some (a', s'))
⊢ a ∈ cons x s ↔ a = a' ∨ a ∈ s'

Next tactic:
have := congr_arg Computation.destruct m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    

Proof state:
case h1.h3
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
s : WSeq α
m : destruct (think s) = Computation.pure (some (a', s'))
⊢ a ∈ think s ↔ a = a' ∨ a ∈ s'

Next tactic:
have := congr_arg Computation.destruct m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    

Proof state:
case h2.h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
m : destruct nil = Computation.think c
⊢ a ∈ nil ↔ a = a' ∨ a ∈ s'

Next tactic:
have := congr_arg Computation.destruct m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    

Proof state:
case h2.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
x : α
s : WSeq α
m : destruct (cons x s) = Computation.think c
⊢ a ∈ cons x s ↔ a = a' ∨ a ∈ s'

Next tactic:
have := congr_arg Computation.destruct m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    

Proof state:
case h2.h3
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
s : WSeq α
m : destruct (think s) = Computation.think c
⊢ a ∈ think s ↔ a = a' ∨ a ∈ s'

Next tactic:
have := congr_arg Computation.destruct m
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    

Proof state:
case h1.h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
m : destruct nil = Computation.pure (some (a', s'))
this : Computation.destruct (destruct nil) = Computation.destruct (Computation.pure (some (a', s')))
⊢ a ∈ nil ↔ a = a' ∨ a ∈ s'

Next tactic:
simp at this
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    

Proof state:
case h1.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
x : α
s : WSeq α
m : destruct (cons x s) = Computation.pure (some (a', s'))
this : Computation.destruct (destruct (cons x s)) = Computation.destruct (Computation.pure (some (a', s')))
⊢ a ∈ cons x s ↔ a = a' ∨ a ∈ s'

Next tactic:
simp at this
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    

Proof state:
case h1.h3
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
s : WSeq α
m : destruct (think s) = Computation.pure (some (a', s'))
this : Computation.destruct (destruct (think s)) = Computation.destruct (Computation.pure (some (a', s')))
⊢ a ∈ think s ↔ a = a' ∨ a ∈ s'

Next tactic:
simp at this
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    

Proof state:
case h2.h1
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
m : destruct nil = Computation.think c
this : Computation.destruct (destruct nil) = Computation.destruct (Computation.think c)
⊢ a ∈ nil ↔ a = a' ∨ a ∈ s'

Next tactic:
simp at this
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    

Proof state:
case h2.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
x : α
s : WSeq α
m : destruct (cons x s) = Computation.think c
this : Computation.destruct (destruct (cons x s)) = Computation.destruct (Computation.think c)
⊢ a ∈ cons x s ↔ a = a' ∨ a ∈ s'

Next tactic:
simp at this
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    

Proof state:
case h2.h3
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c✝ : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c✝
c : Computation (Option (α × WSeq α))
IH : ∀ {s : WSeq α}, destruct s = c → (a ∈ s ↔ a = a' ∨ a ∈ s')
s : WSeq α
m : destruct (think s) = Computation.think c
this : Computation.destruct (destruct (think s)) = Computation.destruct (Computation.think c)
⊢ a ∈ think s ↔ a = a' ∨ a ∈ s'

Next tactic:
simp at this
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · 

Proof state:
case h1.h2
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
x : α
s : WSeq α
m : destruct (cons x s) = Computation.pure (some (a', s'))
this : x = a' ∧ s = s'
⊢ a ∈ cons x s ↔ a = a' ∨ a ∈ s'

Next tactic:
cases' this with i1 i2
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · cases' this with i1 i2
    

Proof state:
case h1.h2.intro
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
x : α
s : WSeq α
m : destruct (cons x s) = Computation.pure (some (a', s'))
i1 : x = a'
i2 : s = s'
⊢ a ∈ cons x s ↔ a = a' ∨ a ∈ s'

Next tactic:
rw [i1, i2]
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · cases' this with i1 i2
    rw [i1, i2]
    

Proof state:
case h1.h2.intro
α : Type u
β : Type v
γ : Type w
a a' : α
s' : WSeq α
c : Computation (Option (α × WSeq α))
h : some (a', s') ∈ c
x : α
s : WSeq α
m : destruct (cons x s) = Computation.pure (some (a', s'))
i1 : x = a'
i2 : s = s'
⊢ a ∈ cons a' s' ↔ a = a' ∨ a ∈ s'

Next tactic:
cases' s' with f al
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · cases' this with i1 i2
    rw [i1, i2]
    cases' s' with f al
    

Proof state:
case h1.h2.intro.mk
α : Type u
β : Type v
γ : Type w
a a' : α
c : Computation (Option (α × WSeq α))
x : α
s : WSeq α
i1 : x = a'
f : Stream' (Option (Option α))
al : IsSeq f
h : some (a', { val := f, property := al }) ∈ c
m : destruct (cons x s) = Computation.pure (some (a', { val := f, property := al }))
i2 : s = { val := f, property := al }
⊢ a ∈ cons a' { val := f, property := al } ↔ a = a' ∨ a ∈ { val := f, property := al }

Next tactic:
dsimp only [cons, (· ∈ ·), WSeq.Mem, Seq.Mem, Seq.cons]
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · cases' this with i1 i2
    rw [i1, i2]
    cases' s' with f al
    dsimp only [cons, (· ∈ ·), WSeq.Mem, Seq.Mem, Seq.cons]
    

Proof state:
case h1.h2.intro.mk
α : Type u
β : Type v
γ : Type w
a a' : α
c : Computation (Option (α × WSeq α))
x : α
s : WSeq α
i1 : x = a'
f : Stream' (Option (Option α))
al : IsSeq f
h : some (a', { val := f, property := al }) ∈ c
m : destruct (cons x s) = Computation.pure (some (a', { val := f, property := al }))
i2 : s = { val := f, property := al }
⊢ Any (fun b => some (some a) = b) (some (some a') :: f) ↔ a = a' ∨ Any (fun b => some (some a) = b) f

Next tactic:
have h_a_eq_a' : a = a' ↔ some (some a) = some (some a') := by simp
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · cases' this with i1 i2
    rw [i1, i2]
    cases' s' with f al
    dsimp only [cons, (· ∈ ·), WSeq.Mem, Seq.Mem, Seq.cons]
    have h_a_eq_a' : a = a' ↔ some (some a) = some (some a') := by 

Proof state:
α : Type u
β : Type v
γ : Type w
a a' : α
c : Computation (Option (α × WSeq α))
x : α
s : WSeq α
i1 : x = a'
f : Stream' (Option (Option α))
al : IsSeq f
h : some (a', { val := f, property := al }) ∈ c
m : destruct (cons x s) = Computation.pure (some (a', { val := f, property := al }))
i2 : s = { val := f, property := al }
⊢ a = a' ↔ some (some a) = some (some a')

Next tactic:
simp
theorem eq_or_mem_iff_mem {s : WSeq α} {a a' s'} :
    some (a', s') ∈ destruct s → (a ∈ s ↔ a = a' ∨ a ∈ s') := by
  generalize e : destruct s = c; intro h
  revert s
  apply Computation.memRecOn h <;> [skip; intro c IH] <;> intro s <;>
    induction' s using WSeq.recOn with x s s <;>
    intro m <;>
    have := congr_arg Computation.destruct m <;>
    simp at this
  · cases' this with i1 i2
    rw [i1, i2]
    cases' s' with f al
    dsimp only [cons, (· ∈ ·), WSeq.Mem, Seq.Mem, Seq.cons]
    have h_a_eq_a' : a = a' ↔ some (some a) = some (some a') := by simp
    

Proof state:
case h1.h2.intro.mk
α : Type u
β : Type v
γ : Type w
a a' : α
c : Computation (Option (α × WSeq α))
x : α
s : WSeq α
i1 : x = a'
f : Stream' (Option (Option α))
al : IsSeq f
h : some (a', { val := f, property := al }) ∈ c
m : destruct (cons x s) = Computation.pure (some (a', { val := f, property := al }))
i2 : s = { val := f, property := al }
h_a_eq_a' : a = a' ↔ some (some a) = some (some a')
⊢ Any (fun b => some (some a) = b) (some (some a') :: f) ↔ a = a' ∨ Any (fun b => some (some a) = b) f

Next tactic:
rw [h_a_eq_a']