Theorem: Stream'.WSeq.mem_of_mem_tail
File: Mathlib/Data/Seq/WSeq.lean

tactic: intro h
state_before: α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
⊢ a ∈ s.tail → a ∈ s
state_after: α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h : a ∈ s.tail
⊢ a ∈ s

tactic: have := h
state_before: α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h : a ∈ s.tail
⊢ a ∈ s
state_after: α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h this : a ∈ s.tail
⊢ a ∈ s

tactic: cases' h with n e
state_before: α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
h this : a ∈ s.tail
⊢ a ∈ s
state_after: case intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
this : a ∈ s.tail
n : ℕ
e : (fun b => some (some a) = b) ((↑s.tail).get n)
⊢ a ∈ s

tactic: revert s
state_before: case intro
α : Type u
β : Type v
γ : Type w
s : WSeq α
a : α
this : a ∈ s.tail
n : ℕ
e : (fun b => some (some a) = b) ((↑s.tail).get n)
⊢ a ∈ s
state_after: case intro
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, a ∈ s.tail → (fun b => some (some a) = b) ((↑s.tail).get n) → a ∈ s

tactic: simp only [Stream'.get]
state_before: case intro
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, a ∈ s.tail → (fun b => some (some a) = b) ((↑s.tail).get n) → a ∈ s
state_after: case intro
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s

tactic: induction' n with n IH <;> intro s <;> induction' s using WSeq.recOn with x s s <;>
  simp <;> intro m e <;>
  injections
state_before: case intro
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
⊢ ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
state_after: 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

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

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

tactic: exact Or.inr m
state_before: 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
state_after: no goals

tactic: exact Or.inr m
state_before: case intro.succ.h2
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
x : α
s : WSeq α
m : a ∈ s
e : some (some a) = ↑s (n + 1)
⊢ a = x ∨ a ∈ s
state_after: no goals

tactic: apply IH m
state_before: case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
⊢ a ∈ s
state_after: case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
⊢ some (some a) = ↑s.tail n

tactic: rw [e]
state_before: case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
⊢ some (some a) = ↑s.tail n
state_after: case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
⊢ ↑s.tail.think (n + 1) = ↑s.tail n

tactic: cases tail s
state_before: case intro.succ.h3
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
⊢ ↑s.tail.think (n + 1) = ↑s.tail n
state_after: case intro.succ.h3.mk
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
val✝ : Stream' (Option (Option α))
property✝ : val✝.IsSeq
⊢ ↑(think ⟨val✝, property✝⟩) (n + 1) = ↑⟨val✝, property✝⟩ n

tactic: rfl
state_before: case intro.succ.h3.mk
α : Type u
β : Type v
γ : Type w
a : α
n : ℕ
IH : ∀ {s : WSeq α}, a ∈ s.tail → some (some a) = ↑s.tail n → a ∈ s
s : WSeq α
m : a ∈ s.tail
e : some (some a) = ↑s.tail.think (n + 1)
val✝ : Stream' (Option (Option α))
property✝ : val✝.IsSeq
⊢ ↑(think ⟨val✝, property✝⟩) (n + 1) = ↑⟨val✝, property✝⟩ n
state_after: no goals