l3lab/ntp-mathlib huggingface dataset:
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
    rw [h_a_eq_a']
    

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) ↔
    some (some a) = some (some a') ∨ Any (fun b => some (some a) = b) f

Next tactic:
refine' ⟨Stream'.eq_or_mem_of_mem_cons, fun o => _⟩
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
    rw [h_a_eq_a']
    refine' ⟨Stream'.eq_or_mem_of_mem_cons, fun o => _⟩
    · 

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')
o : some (some a) = some (some a') ∨ Any (fun b => some (some a) = b) f
⊢ Any (fun b => some (some a) = b) (some (some a') :: f)

Next tactic:
cases' o with e 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 <;>
    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
    rw [h_a_eq_a']
    refine' ⟨Stream'.eq_or_mem_of_mem_cons, fun o => _⟩
    · cases' o with e m
      · 

Proof state:
case h1.h2.intro.mk.inl
α : 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')
e : some (some a) = some (some a')
⊢ Any (fun b => some (some a) = b) (some (some a') :: f)

Next tactic:
rw [e]
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
    rw [h_a_eq_a']
    refine' ⟨Stream'.eq_or_mem_of_mem_cons, fun o => _⟩
    · cases' o with e m
      · rw [e]
        

Proof state:
case h1.h2.intro.mk.inl
α : 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')
e : some (some a) = some (some a')
⊢ Any (fun b => some (some a') = b) (some (some a') :: f)

Next tactic:
apply Stream'.mem_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]
    have h_a_eq_a' : a = a' ↔ some (some a) = some (some a') := by simp
    rw [h_a_eq_a']
    refine' ⟨Stream'.eq_or_mem_of_mem_cons, fun o => _⟩
    · cases' o with e m
      · rw [e]
        apply Stream'.mem_cons
      · 

Proof state:
case h1.h2.intro.mk.inr
α : 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')
m : Any (fun b => some (some a) = b) f
⊢ Any (fun b => some (some a) = b) (some (some a') :: f)

Next tactic:
exact Stream'.mem_cons_of_mem _ 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 <;>
    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
    rw [h_a_eq_a']
    refine' ⟨Stream'.eq_or_mem_of_mem_cons, fun o => _⟩
    · cases' o with e m
      · rw [e]
        apply Stream'.mem_cons
      · exact Stream'.mem_cons_of_mem _ 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 : destruct s = c
⊢ a ∈ think s ↔ a = a' ∨ a ∈ s'

Next tactic:
simp [IH this]
@[simp]
theorem mem_cons_iff (s : WSeq α) (b) {a} : a ∈ cons b s ↔ a = b ∨ a ∈ s :=
  eq_or_mem_iff_mem <| by 

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
b a : α
⊢ some (b, s) ∈ destruct (cons b s)

Next tactic:
simp [ret_mem]
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
⊢ a ∈ tail s → a ∈ s

Next tactic:
intro h
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; 

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h : a ∈ tail s
⊢ a ∈ s

Next tactic:
have := h
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; 

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h this : a ∈ tail s
⊢ a ∈ s

Next tactic:
cases' h with n e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; 

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
this : a ∈ tail s
n : ℕ
e : (fun b => some (some a) = b) (Stream'.get (↑(tail s)) n)
⊢ a ∈ s

Next tactic:
revert s
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; 

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, a ∈ tail s → (fun b => some (some a) = b) (Stream'.get (↑(tail s)) n) → a ∈ s

Next tactic:
simp [Stream'.get]
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s

Next tactic:
induction' n with n IH
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> 

Proof state:
case intro.zero
α : Type u
β : Type v
γ : Type w
a : α
⊢ ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) Nat.zero → a ∈ s

Next tactic:
intro s
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> 

Proof state:
case intro.succ
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
⊢ ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) (Nat.succ n) → a ∈ s

Next tactic:
intro s
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> 

Proof state:
case intro.zero
α : Type u
β : Type v
γ : Type w
a : α
s : WSeq α
⊢ a ∈ tail s → some (some a) = ↑(tail s) Nat.zero → a ∈ s

Next tactic:
induction' s using WSeq.recOn with x s s
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> 

Proof state:
case intro.succ
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
⊢ a ∈ tail s → some (some a) = ↑(tail s) (Nat.succ n) → a ∈ s

Next tactic:
induction' s using WSeq.recOn with x s s
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case intro.zero.h1
α : Type u
β : Type v
γ : Type w
a : α
⊢ a ∈ tail nil → some (some a) = ↑(tail nil) Nat.zero → a ∈ nil

Next tactic:
simp
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case intro.zero.h2
α : Type u
β : Type v
γ : Type w
a x : α
s : WSeq α
⊢ a ∈ tail (cons x s) → some (some a) = ↑(tail (cons x s)) Nat.zero → a ∈ cons x s

Next tactic:
simp
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case intro.zero.h3
α : Type u
β : Type v
γ : Type w
a : α
s : WSeq α
⊢ a ∈ tail (think s) → some (some a) = ↑(tail (think s)) Nat.zero → a ∈ think s

Next tactic:
simp
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case intro.succ.h1
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
⊢ a ∈ tail nil → some (some a) = ↑(tail nil) (Nat.succ n) → a ∈ nil

Next tactic:
simp
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case intro.succ.h2
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
x : α
s : WSeq α
⊢ a ∈ tail (cons x s) → some (some a) = ↑(tail (cons x s)) (Nat.succ n) → a ∈ cons x s

Next tactic:
simp
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    

Proof state:
case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
⊢ a ∈ tail (think s) → some (some a) = ↑(tail (think s)) (Nat.succ n) → a ∈ think s

Next tactic:
simp
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> 

Proof state:
case intro.zero.h1
α : Type u
β : Type v
γ : Type w
a : α
⊢ a ∈ nil → some (some a) = ↑nil 0 → a ∈ nil

Next tactic:
intro m e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> 

Proof state:
case intro.zero.h2
α : Type u
β : Type v
γ : Type w
a x : α
s : WSeq α
⊢ a ∈ s → some (some a) = ↑s 0 → a = x ∨ a ∈ s

Next tactic:
intro m e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> 

Proof state:
case intro.zero.h3
α : Type u
β : Type v
γ : Type w
a : α
s : WSeq α
⊢ a ∈ tail s → some (some a) = ↑(think (tail s)) 0 → a ∈ s

Next tactic:
intro m e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> 

Proof state:
case intro.succ.h1
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
⊢ a ∈ nil → some (some a) = ↑nil (Nat.succ n) → a ∈ nil

Next tactic:
intro m e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> 

Proof state:
case intro.succ.h2
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
x : α
s : WSeq α
⊢ a ∈ s → some (some a) = ↑s (Nat.succ n) → a = x ∨ a ∈ s

Next tactic:
intro m e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> 

Proof state:
case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
⊢ a ∈ tail s → some (some a) = ↑(think (tail s)) (Nat.succ n) → a ∈ s

Next tactic:
intro m e
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    

Proof state:
case intro.zero.h1
α : Type u
β : Type v
γ : Type w
a : α
m : a ∈ nil
e : some (some a) = ↑nil 0
⊢ a ∈ nil

Next tactic:
injections
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    

Proof state:
case intro.zero.h2
α : Type u
β : Type v
γ : Type w
a x : α
s : WSeq α
m : a ∈ s
e : some (some a) = ↑s 0
⊢ a = x ∨ a ∈ s

Next tactic:
injections
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    

Proof state:
case intro.zero.h3
α : Type u
β : Type v
γ : Type w
a : α
s : WSeq α
m : a ∈ tail s
e : some (some a) = ↑(think (tail s)) 0
⊢ a ∈ s

Next tactic:
injections
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    

Proof state:
case intro.succ.h1
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
m : a ∈ nil
e : some (some a) = ↑nil (Nat.succ n)
⊢ a ∈ nil

Next tactic:
injections
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    

Proof state:
case intro.succ.h2
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
x : α
s : WSeq α
m : a ∈ s
e : some (some a) = ↑s (Nat.succ n)
⊢ a = x ∨ a ∈ s

Next tactic:
injections
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    

Proof state:
case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
m : a ∈ tail s
e : some (some a) = ↑(think (tail s)) (Nat.succ n)
⊢ a ∈ s

Next tactic:
injections
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    injections
  · 

Proof state:
case intro.zero.h2
α : Type u
β : Type v
γ : Type w
a x : α
s : WSeq α
m : a ∈ s
e : some (some a) = ↑s 0
⊢ a = x ∨ a ∈ s

Next tactic:
exact Or.inr m
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    injections
  · exact Or.inr m
  · 

Proof state:
case intro.succ.h2
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
x : α
s : WSeq α
m : a ∈ s
e : some (some a) = ↑s (Nat.succ n)
⊢ a = x ∨ a ∈ s

Next tactic:
exact Or.inr m
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    injections
  · exact Or.inr m
  · exact Or.inr m
  · 

Proof state:
case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
m : a ∈ tail s
e : some (some a) = ↑(think (tail s)) (Nat.succ n)
⊢ a ∈ s

Next tactic:
apply IH m
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    injections
  · exact Or.inr m
  · exact Or.inr m
  · apply IH m
    

Proof state:
case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
m : a ∈ tail s
e : some (some a) = ↑(think (tail s)) (Nat.succ n)
⊢ some (some a) = ↑(tail s) n

Next tactic:
rw [e]
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    injections
  · exact Or.inr m
  · exact Or.inr m
  · apply IH m
    rw [e]
    

Proof state:
case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
m : a ∈ tail s
e : some (some a) = ↑(think (tail s)) (Nat.succ n)
⊢ ↑(think (tail s)) (Nat.succ n) = ↑(tail s) n

Next tactic:
cases tail s
theorem mem_of_mem_tail {s : WSeq α} {a} : a ∈ tail s → a ∈ s := by
  intro h; have := h; cases' h with n e; revert s; simp [Stream'.get]
  induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
    simp <;> intro m e <;>
    injections
  · exact Or.inr m
  · exact Or.inr m
  · apply IH m
    rw [e]
    cases tail s
    

Proof state:
case intro.succ.h3.mk
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ tail s → some (some a) = ↑(tail s) n → a ∈ s
s : WSeq α
m : a ∈ tail s
e : some (some a) = ↑(think (tail s)) (Nat.succ n)
val✝ : Stream' (Option (Option α))
property✝ : IsSeq val✝
⊢ ↑(think { val := val✝, property := property✝ }) (Nat.succ n) = ↑{ val := val✝, property := property✝ } n

Next tactic:
rfl
theorem get?_mem {s : WSeq α} {a n} : some a ∈ get? s n → a ∈ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
n : ℕ
⊢ some a ∈ get? s n → a ∈ s

Next tactic:
revert s
theorem get?_mem {s : WSeq α} {a n} : some a ∈ get? s n → a ∈ s := by
  revert s; 

Proof state:
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, some a ∈ get? s n → a ∈ s

Next tactic:
induction' n with n IH
theorem get?_mem {s : WSeq α} {a n} : some a ∈ get? s n → a ∈ s := by
  revert s; induction' n with n IH <;> 

Proof state:
case zero
α : Type u
β : Type v
γ : Type w
a : α
⊢ ∀ {s : WSeq α}, some a ∈ get? s Nat.zero → a ∈ s

Next tactic:
intro s h
theorem get?_mem {s : WSeq α} {a n} : some a ∈ get? s n → a ∈ s := by
  revert s; induction' n with n IH <;> 

Proof state:
case succ
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, some a ∈ get? s n → a ∈ s
⊢ ∀ {s : WSeq α}, some a ∈ get? s (Nat.succ n) → a ∈ s

Next tactic:
intro s h
theorem get?_mem {s : WSeq α} {a n} : some a ∈ get? s n → a ∈ s := by
  revert s; induction' n with n IH <;> intro s h
  · -- Porting note: This line is required to infer metavariables in
    --               `Computation.exists_of_mem_map`.
    

Proof state:
case zero
α : Type u
β : Type v
γ : Type w
a : α
s : WSeq α
h : some a ∈ get? s Nat.zero
⊢ a ∈ s

Next tactic:
dsimp only [get?, head] at h
theorem get?_mem {s : WSeq α} {a n} : some a ∈ get? s n → a ∈ s := by
  revert s; induction' n with n IH <;> intro s h
  · -- Porting note: This line is required to infer metavariables in
    --               `Computation.exists_of_mem_map`.
    dsimp only [get?, head] at h
    

Proof state:
case zero
α : Type u
β : Type v
γ : Type w
a : α
s : WSeq α
h : some a ∈ Computation.map (fun x => Prod.fst <$> x) (destruct (drop s Nat.zero))
⊢ a ∈ s

Next tactic:
rcases Computation.exists_of_mem_map h with ⟨o, h1, h2⟩