Theorem: Stream'.take_theorem
File: Mathlib/Data/Stream/Init.lean

tactic: intro h
state_before: α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
⊢ (∀ (n : ℕ), take n s₁ = take n s₂) → s₁ = s₂
state_after: α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
⊢ s₁ = s₂

tactic: apply Stream'.ext
state_before: α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
⊢ s₁ = s₂
state_after: case a
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
⊢ ∀ (n : ℕ), s₁.get n = s₂.get n

tactic: intro n
state_before: case a
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
⊢ ∀ (n : ℕ), s₁.get n = s₂.get n
state_after: case a
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
⊢ s₁.get n = s₂.get n

tactic: induction' n with n _
state_before: case a
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
⊢ s₁.get n = s₂.get n
state_after: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
⊢ s₁.get 0 = s₂.get 0

case a.succ
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
a✝ : s₁.get n = s₂.get n
⊢ s₁.get (n + 1) = s₂.get (n + 1)

tactic: have aux := h 1
state_before: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
⊢ s₁.get 0 = s₂.get 0
state_after: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
aux : take 1 s₁ = take 1 s₂
⊢ s₁.get 0 = s₂.get 0

tactic: simp? [take] at aux says
  simp only [take, List.cons.injEq, and_true] at aux
state_before: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
aux : take 1 s₁ = take 1 s₂
⊢ s₁.get 0 = s₂.get 0
state_after: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
aux : s₁.head = s₂.head
⊢ s₁.get 0 = s₂.get 0

tactic: exact aux
state_before: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
aux : s₁.head = s₂.head
⊢ s₁.get 0 = s₂.get 0
state_after: no goals

tactic: simp only [take, List.cons.injEq, and_true] at aux
state_before: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
aux : take 1 s₁ = take 1 s₂
⊢ s₁.get 0 = s₂.get 0
state_after: case a.zero
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
aux : s₁.head = s₂.head
⊢ s₁.get 0 = s₂.get 0

tactic: have h₁ : some (get s₁ (succ n)) = some (get s₂ (succ n)) := by
  rw [← get?_take_succ, ← get?_take_succ, h (succ (succ n))]
state_before: case a.succ
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
a✝ : s₁.get n = s₂.get n
⊢ s₁.get (n + 1) = s₂.get (n + 1)
state_after: case a.succ
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
a✝ : s₁.get n = s₂.get n
h₁ : some (s₁.get n.succ) = some (s₂.get n.succ)
⊢ s₁.get (n + 1) = s₂.get (n + 1)

tactic: injection h₁
state_before: case a.succ
α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
a✝ : s₁.get n = s₂.get n
h₁ : some (s₁.get n.succ) = some (s₂.get n.succ)
⊢ s₁.get (n + 1) = s₂.get (n + 1)
state_after: no goals

tactic: rw [← get?_take_succ, ← get?_take_succ, h (succ (succ n))]
state_before: α : Type u
β : Type v
δ : Type w
s₁ s₂ : Stream' α
h : ∀ (n : ℕ), take n s₁ = take n s₂
n : ℕ
a✝ : s₁.get n = s₂.get n
⊢ some (s₁.get n.succ) = some (s₂.get n.succ)
state_after: no goals