File: Mathlib/Data/Stream/Init.lean

full_name: Stream'.instInhabited
code: instance [Inhabited α] : Inhabited (Stream' α) 
goal: Inhabited (Stream' α)

full_name: Stream'.eta
code: protected theorem eta (s : Stream' α) : (head s::tail s) = s 
goal: Stream'.cons s.head s.tail = s

full_name: Stream'.ext
code: @[ext]
protected theorem ext {s₁ s₂ : Stream' α} : (∀ n, get s₁ n = get s₂ n) → s₁ = s₂ 
goal: (∀ (n : ℕ), s₁.get n = s₂.get n) → s₁ = s₂

full_name: Stream'.get_zero_cons
code: @[simp]
theorem get_zero_cons (a : α) (s : Stream' α) : get (a::s) 0 = a 
goal: (Stream'.cons a s).get 0 = a

full_name: Stream'.head_cons
code: @[simp]
theorem head_cons (a : α) (s : Stream' α) : head (a::s) = a 
goal: (Stream'.cons a s).head = a

full_name: Stream'.tail_cons
code: @[simp]
theorem tail_cons (a : α) (s : Stream' α) : tail (a::s) = s 
goal: (Stream'.cons a s).tail = s

full_name: Stream'.get_drop
code: @[simp]
theorem get_drop (n m : ℕ) (s : Stream' α) : get (drop m s) n = get s (n + m) 
goal: (Stream'.drop m s).get n = s.get (n + m)

full_name: Stream'.tail_eq_drop
code: theorem tail_eq_drop (s : Stream' α) : tail s = drop 1 s 
goal: s.tail = Stream'.drop 1 s

full_name: Stream'.drop_drop
code: @[simp]
theorem drop_drop (n m : ℕ) (s : Stream' α) : drop n (drop m s) = drop (n + m) s 
goal: Stream'.drop n (Stream'.drop m s) = Stream'.drop (n + m) s

full_name: Stream'.get_tail
code: @[simp] theorem get_tail {n : ℕ} {s : Stream' α} : s.tail.get n = s.get (n + 1) 
goal: s.tail.get n = s.get (n + 1)

full_name: Stream'.tail_drop'
code: @[simp] theorem tail_drop' {i : ℕ} {s : Stream' α} : tail (drop i s) = s.drop (i+1) 
goal: (Stream'.drop i s).tail = Stream'.drop (i + 1) s

full_name: Stream'.drop_tail'
code: @[simp] theorem drop_tail' {i : ℕ} {s : Stream' α} : drop i (tail s) = s.drop (i+1) 
goal: Stream'.drop i s.tail = Stream'.drop (i + 1) s

full_name: Stream'.tail_drop
code: theorem tail_drop (n : ℕ) (s : Stream' α) : tail (drop n s) = drop n (tail s) 
goal: (Stream'.drop n s).tail = Stream'.drop n s.tail

full_name: Stream'.get_succ
code: theorem get_succ (n : ℕ) (s : Stream' α) : get s (succ n) = get (tail s) n 
goal: s.get n.succ = s.tail.get n

full_name: Stream'.get_succ_cons
code: @[simp]
theorem get_succ_cons (n : ℕ) (s : Stream' α) (x : α) : get (x::s) n.succ = get s n 
goal: (Stream'.cons x s).get n.succ = s.get n

full_name: Stream'.drop_zero
code: @[simp] theorem drop_zero {s : Stream' α} : s.drop 0 = s 
goal: Stream'.drop 0 s = s

full_name: Stream'.drop_succ
code: theorem drop_succ (n : ℕ) (s : Stream' α) : drop (succ n) s = drop n (tail s) 
goal: Stream'.drop n.succ s = Stream'.drop n s.tail

full_name: Stream'.head_drop
code: theorem head_drop (a : Stream' α) (n : ℕ) : (a.drop n).head = a.get n 
goal: (Stream'.drop n a).head = a.get n

full_name: Stream'.cons_injective2
code: theorem cons_injective2 : Function.Injective2 (cons : α → Stream' α → Stream' α) 
goal: Function.Injective2 Stream'.cons

full_name: Stream'.cons_injective_left
code: theorem cons_injective_left (s : Stream' α) : Function.Injective fun x => cons x s 
goal: Function.Injective fun x => Stream'.cons x s

full_name: Stream'.cons_injective_right
code: theorem cons_injective_right (x : α) : Function.Injective (cons x) 
goal: Function.Injective (Stream'.cons x)

full_name: Stream'.all_def
code: theorem all_def (p : α → Prop) (s : Stream' α) : All p s = ∀ n, p (get s n) 
goal: Stream'.All p s = ∀ (n : ℕ), p (s.get n)

full_name: Stream'.any_def
code: theorem any_def (p : α → Prop) (s : Stream' α) : Any p s = ∃ n, p (get s n) 
goal: Stream'.Any p s = ∃ n, p (s.get n)

full_name: Stream'.mem_cons
code: @[simp]
theorem mem_cons (a : α) (s : Stream' α) : a ∈ a::s 
goal: a ∈ Stream'.cons a s

full_name: Stream'.mem_cons_of_mem
code: theorem mem_cons_of_mem {a : α} {s : Stream' α} (b : α) : a ∈ s → a ∈ b::s 
goal: a ∈ s → a ∈ Stream'.cons b s

full_name: Stream'.eq_or_mem_of_mem_cons
code: theorem eq_or_mem_of_mem_cons {a b : α} {s : Stream' α} : (a ∈ b::s) → a = b ∨ a ∈ s 
goal: a ∈ Stream'.cons b s → a = b ∨ a ∈ s

full_name: Stream'.mem_of_get_eq
code: theorem mem_of_get_eq {n : ℕ} {s : Stream' α} {a : α} : a = get s n → a ∈ s 
goal: a = s.get n → a ∈ s

full_name: Stream'.drop_map
code: theorem drop_map (n : ℕ) (s : Stream' α) : drop n (map f s) = map f (drop n s) 
goal: Stream'.drop n (Stream'.map f s) = Stream'.map f (Stream'.drop n s)

full_name: Stream'.get_map
code: @[simp]
theorem get_map (n : ℕ) (s : Stream' α) : get (map f s) n = f (get s n) 
goal: (Stream'.map f s).get n = f (s.get n)

full_name: Stream'.tail_map
code: theorem tail_map (s : Stream' α) : tail (map f s) = map f (tail s) 
goal: (Stream'.map f s).tail = Stream'.map f s.tail

full_name: Stream'.head_map
code: @[simp]
theorem head_map (s : Stream' α) : head (map f s) = f (head s) 
goal: (Stream'.map f s).head = f s.head

full_name: Stream'.map_eq
code: theorem map_eq (s : Stream' α) : map f s = f (head s)::map f (tail s) 
goal: Stream'.map f s = Stream'.cons (f s.head) (Stream'.map f s.tail)

full_name: Stream'.map_cons
code: theorem map_cons (a : α) (s : Stream' α) : map f (a::s) = f a::map f s 
goal: Stream'.map f (Stream'.cons a s) = Stream'.cons (f a) (Stream'.map f s)

full_name: Stream'.map_id
code: @[simp]
theorem map_id (s : Stream' α) : map id s = s 
goal: Stream'.map id s = s

full_name: Stream'.map_map
code: @[simp]
theorem map_map (g : β → δ) (f : α → β) (s : Stream' α) : map g (map f s) = map (g ∘ f) s 
goal: Stream'.map g (Stream'.map f s) = Stream'.map (g ∘ f) s

full_name: Stream'.map_tail
code: @[simp]
theorem map_tail (s : Stream' α) : map f (tail s) = tail (map f s) 
goal: Stream'.map f s.tail = (Stream'.map f s).tail

full_name: Stream'.mem_map
code: theorem mem_map {a : α} {s : Stream' α} : a ∈ s → f a ∈ map f s 
goal: a ∈ s → f a ∈ Stream'.map f s

full_name: Stream'.exists_of_mem_map
code: theorem exists_of_mem_map {f} {b : β} {s : Stream' α} : b ∈ map f s → ∃ a, a ∈ s ∧ f a = b 
goal: b ∈ Stream'.map f s → ∃ a, a ∈ s ∧ f a = b

full_name: Stream'.drop_zip
code: theorem drop_zip (n : ℕ) (s₁ : Stream' α) (s₂ : Stream' β) :
    drop n (zip f s₁ s₂) = zip f (drop n s₁) (drop n s₂) 
goal: Stream'.drop n (Stream'.zip f s₁ s₂) = Stream'.zip f (Stream'.drop n s₁) (Stream'.drop n s₂)

full_name: Stream'.get_zip
code: @[simp]
theorem get_zip (n : ℕ) (s₁ : Stream' α) (s₂ : Stream' β) :
    get (zip f s₁ s₂) n = f (get s₁ n) (get s₂ n) 
goal: (Stream'.zip f s₁ s₂).get n = f (s₁.get n) (s₂.get n)

full_name: Stream'.head_zip
code: theorem head_zip (s₁ : Stream' α) (s₂ : Stream' β) : head (zip f s₁ s₂) = f (head s₁) (head s₂) 
goal: (Stream'.zip f s₁ s₂).head = f s₁.head s₂.head

full_name: Stream'.tail_zip
code: theorem tail_zip (s₁ : Stream' α) (s₂ : Stream' β) :
    tail (zip f s₁ s₂) = zip f (tail s₁) (tail s₂) 
goal: (Stream'.zip f s₁ s₂).tail = Stream'.zip f s₁.tail s₂.tail

full_name: Stream'.zip_eq
code: theorem zip_eq (s₁ : Stream' α) (s₂ : Stream' β) :
    zip f s₁ s₂ = f (head s₁) (head s₂)::zip f (tail s₁) (tail s₂) 
goal: Stream'.zip f s₁ s₂ = Stream'.cons (f s₁.head s₂.head) (Stream'.zip f s₁.tail s₂.tail)

full_name: Stream'.get_enum
code: @[simp]
theorem get_enum (s : Stream' α) (n : ℕ) : get (enum s) n = (n, s.get n) 
goal: s.enum.get n = (n, s.get n)

full_name: Stream'.enum_eq_zip
code: theorem enum_eq_zip (s : Stream' α) : enum s = zip Prod.mk nats s 
goal: s.enum = Stream'.zip Prod.mk Stream'.nats s

full_name: Stream'.mem_const
code: @[simp]
theorem mem_const (a : α) : a ∈ const a 
goal: a ∈ Stream'.const a

full_name: Stream'.const_eq
code: theorem const_eq (a : α) : const a = a::const a 
goal: Stream'.const a = Stream'.cons a (Stream'.const a)

full_name: Stream'.tail_const
code: @[simp]
theorem tail_const (a : α) : tail (const a) = const a 
goal: (Stream'.const a).tail = Stream'.const a

full_name: Stream'.map_const
code: @[simp]
theorem map_const (f : α → β) (a : α) : map f (const a) = const (f a) 
goal: Stream'.map f (Stream'.const a) = Stream'.const (f a)

full_name: Stream'.get_const
code: @[simp]
theorem get_const (n : ℕ) (a : α) : get (const a) n = a 
goal: (Stream'.const a).get n = a

full_name: Stream'.drop_const
code: @[simp]
theorem drop_const (n : ℕ) (a : α) : drop n (const a) = const a 
goal: Stream'.drop n (Stream'.const a) = Stream'.const a

full_name: Stream'.head_iterate
code: @[simp]
theorem head_iterate (f : α → α) (a : α) : head (iterate f a) = a 
goal: (Stream'.iterate f a).head = a

full_name: Stream'.get_succ_iterate'
code: theorem get_succ_iterate' (n : ℕ) (f : α → α) (a : α) :
    get (iterate f a) (succ n) = f (get (iterate f a) n) 
goal: (Stream'.iterate f a).get n.succ = f ((Stream'.iterate f a).get n)

full_name: Stream'.tail_iterate
code: theorem tail_iterate (f : α → α) (a : α) : tail (iterate f a) = iterate f (f a) 
goal: (Stream'.iterate f a).tail = Stream'.iterate f (f a)

full_name: Stream'.iterate_eq
code: theorem iterate_eq (f : α → α) (a : α) : iterate f a = a::iterate f (f a) 
goal: Stream'.iterate f a = Stream'.cons a (Stream'.iterate f (f a))

full_name: Stream'.get_zero_iterate
code: @[simp]
theorem get_zero_iterate (f : α → α) (a : α) : get (iterate f a) 0 = a 
goal: (Stream'.iterate f a).get 0 = a

full_name: Stream'.get_succ_iterate
code: theorem get_succ_iterate (n : ℕ) (f : α → α) (a : α) :
    get (iterate f a) (succ n) = get (iterate f (f a)) n 
goal: (Stream'.iterate f a).get n.succ = (Stream'.iterate f (f a)).get n

full_name: Stream'.«_aux_Mathlib_Data_Stream_Init___macroRules_Stream'_term_~__1»
code: /-- equivalence relation -/
local infixl:50 " ~ " => R
goal: Lean.Macro

full_name: Stream'.IsBisimulation
code: /-- Streams `s₁` and `s₂` are defined to be bisimulations if
their heads are equal and tails are bisimulations. -/
def IsBisimulation 
goal: Prop

full_name: Stream'.get_of_bisim
code: theorem get_of_bisim (bisim : IsBisimulation R) :
    ∀ {s₁ s₂} (n), s₁ ~ s₂ → get s₁ n = get s₂ n ∧ drop (n + 1) s₁ ~ drop (n + 1) s₂
  
goal: R s₁ s₂ → s₁.get n = s₂.get n ∧ R (Stream'.drop (n + 1) s₁) (Stream'.drop (n + 1) s₂)

full_name: Stream'.eq_of_bisim
code: theorem eq_of_bisim (bisim : IsBisimulation R) : ∀ {s₁ s₂}, s₁ ~ s₂ → s₁ = s₂ 
goal: R s₁ s₂ → s₁ = s₂

full_name: Stream'.bisim_simple
code: theorem bisim_simple (s₁ s₂ : Stream' α) :
    head s₁ = head s₂ → s₁ = tail s₁ → s₂ = tail s₂ → s₁ = s₂ 
goal: s₁.head = s₂.head → s₁ = s₁.tail → s₂ = s₂.tail → s₁ = s₂

full_name: Stream'.coinduction
code: theorem coinduction {s₁ s₂ : Stream' α} :
    head s₁ = head s₂ →
      (∀ (β : Type u) (fr : Stream' α → β),
      fr s₁ = fr s₂ → fr (tail s₁) = fr (tail s₂)) → s₁ = s₂ 
goal: s₁.head = s₂.head → (∀ (β : Type u) (fr : Stream' α → β), fr s₁ = fr s₂ → fr s₁.tail = fr s₂.tail) → s₁ = s₂

full_name: Stream'.iterate_id
code: @[simp]
theorem iterate_id (a : α) : iterate id a = const a 
goal: Stream'.iterate id a = Stream'.const a

full_name: Stream'.map_iterate
code: theorem map_iterate (f : α → α) (a : α) : iterate f (f a) = map f (iterate f a) 
goal: Stream'.iterate f (f a) = Stream'.map f (Stream'.iterate f a)

full_name: Stream'.corec_def
code: theorem corec_def (f : α → β) (g : α → α) (a : α) : corec f g a = map f (iterate g a) 
goal: Stream'.corec f g a = Stream'.map f (Stream'.iterate g a)

full_name: Stream'.corec_eq
code: theorem corec_eq (f : α → β) (g : α → α) (a : α) : corec f g a = f a::corec f g (g a) 
goal: Stream'.corec f g a = Stream'.cons (f a) (Stream'.corec f g (g a))

full_name: Stream'.corec_id_id_eq_const
code: theorem corec_id_id_eq_const (a : α) : corec id id a = const a 
goal: Stream'.corec id id a = Stream'.const a

full_name: Stream'.corec_id_f_eq_iterate
code: theorem corec_id_f_eq_iterate (f : α → α) (a : α) : corec id f a = iterate f a 
goal: Stream'.corec id f a = Stream'.iterate f a

full_name: Stream'.corec'_eq
code: theorem corec'_eq (f : α → β × α) (a : α) : corec' f a = (f a).1::corec' f (f a).2 
goal: Stream'.corec' f a = Stream'.cons (f a).1 (Stream'.corec' f (f a).2)

full_name: Stream'.unfolds_eq
code: theorem unfolds_eq (g : α → β) (f : α → α) (a : α) : unfolds g f a = g a::unfolds g f (f a) 
goal: Stream'.unfolds g f a = Stream'.cons (g a) (Stream'.unfolds g f (f a))

full_name: Stream'.get_unfolds_head_tail
code: theorem get_unfolds_head_tail : ∀ (n : ℕ) (s : Stream' α),
    get (unfolds head tail s) n = get s n 
goal: (Stream'.unfolds Stream'.head Stream'.tail s).get n = s.get n

full_name: Stream'.unfolds_head_eq
code: theorem unfolds_head_eq : ∀ s : Stream' α, unfolds head tail s = s 
goal: Stream'.unfolds Stream'.head Stream'.tail s = s

full_name: Stream'.interleave_eq
code: theorem interleave_eq (s₁ s₂ : Stream' α) : s₁ ⋈ s₂ = head s₁::head s₂::(tail s₁ ⋈ tail s₂) 
goal: s₁ ⋈ s₂ = Stream'.cons s₁.head (Stream'.cons s₂.head (s₁.tail ⋈ s₂.tail))

full_name: Stream'.tail_interleave
code: theorem tail_interleave (s₁ s₂ : Stream' α) : tail (s₁ ⋈ s₂) = s₂ ⋈ tail s₁ 
goal: (s₁ ⋈ s₂).tail = s₂ ⋈ s₁.tail

full_name: Stream'.interleave_tail_tail
code: theorem interleave_tail_tail (s₁ s₂ : Stream' α) : tail s₁ ⋈ tail s₂ = tail (tail (s₁ ⋈ s₂)) 
goal: s₁.tail ⋈ s₂.tail = (s₁ ⋈ s₂).tail.tail

full_name: Stream'.get_interleave_left
code: theorem get_interleave_left : ∀ (n : ℕ) (s₁ s₂ : Stream' α),
    get (s₁ ⋈ s₂) (2 * n) = get s₁ n
  
goal: (s₁ ⋈ s₂).get (2 * n) = s₁.get n

full_name: Stream'.get_interleave_right
code: theorem get_interleave_right : ∀ (n : ℕ) (s₁ s₂ : Stream' α),
    get (s₁ ⋈ s₂) (2 * n + 1) = get s₂ n
  
goal: (s₁ ⋈ s₂).get (2 * n + 1) = s₂.get n

full_name: Stream'.mem_interleave_left
code: theorem mem_interleave_left {a : α} {s₁ : Stream' α} (s₂ : Stream' α) : a ∈ s₁ → a ∈ s₁ ⋈ s₂ 
goal: a ∈ s₁ → a ∈ s₁ ⋈ s₂

full_name: Stream'.mem_interleave_right
code: theorem mem_interleave_right {a : α} {s₁ : Stream' α} (s₂ : Stream' α) : a ∈ s₂ → a ∈ s₁ ⋈ s₂ 
goal: a ∈ s₂ → a ∈ s₁ ⋈ s₂

full_name: Stream'.odd_eq
code: theorem odd_eq (s : Stream' α) : odd s = even (tail s) 
goal: s.odd = s.tail.even

full_name: Stream'.head_even
code: @[simp]
theorem head_even (s : Stream' α) : head (even s) = head s 
goal: s.even.head = s.head

full_name: Stream'.tail_even
code: theorem tail_even (s : Stream' α) : tail (even s) = even (tail (tail s)) 
goal: s.even.tail = s.tail.tail.even

full_name: Stream'.even_cons_cons
code: theorem even_cons_cons (a₁ a₂ : α) (s : Stream' α) : even (a₁::a₂::s) = a₁::even s 
goal: (Stream'.cons a₁ (Stream'.cons a₂ s)).even = Stream'.cons a₁ s.even

full_name: Stream'.even_tail
code: theorem even_tail (s : Stream' α) : even (tail s) = odd s 
goal: s.tail.even = s.odd

full_name: Stream'.even_interleave
code: theorem even_interleave (s₁ s₂ : Stream' α) : even (s₁ ⋈ s₂) = s₁ 
goal: (s₁ ⋈ s₂).even = s₁

full_name: Stream'.interleave_even_odd
code: theorem interleave_even_odd (s₁ : Stream' α) : even s₁ ⋈ odd s₁ = s₁ 
goal: s₁.even ⋈ s₁.odd = s₁

full_name: Stream'.get_even
code: theorem get_even : ∀ (n : ℕ) (s : Stream' α), get (even s) n = get s (2 * n)
  
goal: s.even.get n = s.get (2 * n)

full_name: Stream'.get_odd
code: theorem get_odd : ∀ (n : ℕ) (s : Stream' α), get (odd s) n = get s (2 * n + 1) 
goal: s.odd.get n = s.get (2 * n + 1)

full_name: Stream'.mem_of_mem_even
code: theorem mem_of_mem_even (a : α) (s : Stream' α) : a ∈ even s → a ∈ s 
goal: a ∈ s.even → a ∈ s

full_name: Stream'.mem_of_mem_odd
code: theorem mem_of_mem_odd (a : α) (s : Stream' α) : a ∈ odd s → a ∈ s 
goal: a ∈ s.odd → a ∈ s

full_name: Stream'.nil_append_stream
code: theorem nil_append_stream (s : Stream' α) : appendStream' [] s = s 
goal: [] ++ₛ s = s

full_name: Stream'.cons_append_stream
code: theorem cons_append_stream (a : α) (l : List α) (s : Stream' α) :
    appendStream' (a::l) s = a::appendStream' l s 
goal: a :: l ++ₛ s = Stream'.cons a (l ++ₛ s)

full_name: Stream'.append_append_stream
code: theorem append_append_stream : ∀ (l₁ l₂ : List α) (s : Stream' α),
    l₁ ++ l₂ ++ₛ s = l₁ ++ₛ (l₂ ++ₛ s)
  
goal: l₁ ++ l₂ ++ₛ s = l₁ ++ₛ (l₂ ++ₛ s)

full_name: Stream'.map_append_stream
code: theorem map_append_stream (f : α → β) :
    ∀ (l : List α) (s : Stream' α), map f (l ++ₛ s) = List.map f l ++ₛ map f s
  
goal: Stream'.map f (l ++ₛ s) = List.map f l ++ₛ Stream'.map f s

full_name: Stream'.drop_append_stream
code: theorem drop_append_stream : ∀ (l : List α) (s : Stream' α), drop l.length (l ++ₛ s) = s
  
goal: Stream'.drop l.length (l ++ₛ s) = s

full_name: Stream'.append_stream_head_tail
code: theorem append_stream_head_tail (s : Stream' α) : [head s] ++ₛ tail s = s 
goal: [s.head] ++ₛ s.tail = s

full_name: Stream'.mem_append_stream_right
code: theorem mem_append_stream_right : ∀ {a : α} (l : List α) {s : Stream' α}, a ∈ s → a ∈ l ++ₛ s
  
goal: a ∈ s → a ∈ l ++ₛ s

full_name: Stream'.mem_append_stream_left
code: theorem mem_append_stream_left : ∀ {a : α} {l : List α} (s : Stream' α), a ∈ l → a ∈ l ++ₛ s
  
goal: a ∈ l → a ∈ l ++ₛ s

full_name: Stream'.take_zero
code: @[simp]
theorem take_zero (s : Stream' α) : take 0 s = [] 
goal: Stream'.take 0 s = []

full_name: Stream'.take_succ
code: theorem take_succ (n : ℕ) (s : Stream' α) : take (succ n) s = head s::take n (tail s) 
goal: Stream'.take n.succ s = s.head :: Stream'.take n s.tail

full_name: Stream'.take_succ_cons
code: @[simp] theorem take_succ_cons {a : α} (n : ℕ) (s : Stream' α) :
    take (n+1) (a::s) = a :: take n s 
goal: Stream'.take (n + 1) (Stream'.cons a s) = a :: Stream'.take n s

full_name: Stream'.take_succ'
code: theorem take_succ' {s : Stream' α} : ∀ n, s.take (n+1) = s.take n ++ [s.get n]
  
goal: Stream'.take (n + 1) s = Stream'.take n s ++ [s.get n]

full_name: Stream'.length_take
code: @[simp]
theorem length_take (n : ℕ) (s : Stream' α) : (take n s).length = n 
goal: (Stream'.take n s).length = n

full_name: Stream'.take_take
code: @[simp]
theorem take_take {s : Stream' α} : ∀ {m n}, (s.take n).take m = s.take (min n m)
  
goal: List.take m (Stream'.take n s) = Stream'.take (min n m) s

full_name: Stream'.concat_take_get
code: @[simp] theorem concat_take_get {n : ℕ} {s : Stream' α} : s.take n ++ [s.get n] = s.take (n+1) 
goal: Stream'.take n s ++ [s.get n] = Stream'.take (n + 1) s

full_name: Stream'.get?_take
code: theorem get?_take {s : Stream' α} : ∀ {k n}, k < n → (s.take n).get? k = s.get k
  
goal: k < n → (Stream'.take n s).get? k = some (s.get k)

full_name: Stream'.get?_take_succ
code: theorem get?_take_succ (n : ℕ) (s : Stream' α) :
    List.get? (take (succ n) s) n = some (get s n) 
goal: (Stream'.take n.succ s).get? n = some (s.get n)

full_name: Stream'.dropLast_take
code: @[simp] theorem dropLast_take {n : ℕ} {xs : Stream' α} :
    (Stream'.take n xs).dropLast = Stream'.take (n-1) xs 
goal: (Stream'.take n xs).dropLast = Stream'.take (n - 1) xs

full_name: Stream'.append_take_drop
code: @[simp]
theorem append_take_drop : ∀ (n : ℕ) (s : Stream' α),
    appendStream' (take n s) (drop n s) = s 
goal: Stream'.take n s ++ₛ Stream'.drop n s = s

full_name: Stream'.take_theorem
code: theorem take_theorem (s₁ s₂ : Stream' α) : (∀ n : ℕ, take n s₁ = take n s₂) → s₁ = s₂ 
goal: (∀ (n : ℕ), Stream'.take n s₁ = Stream'.take n s₂) → s₁ = s₂

full_name: Stream'.cycle_g_cons
code: protected theorem cycle_g_cons (a : α) (a₁ : α) (l₁ : List α) (a₀ : α) (l₀ : List α) :
    Stream'.cycleG (a, a₁::l₁, a₀, l₀) = (a₁, l₁, a₀, l₀) 
goal: Stream'.cycleG (a, a₁ :: l₁, a₀, l₀) = (a₁, l₁, a₀, l₀)

full_name: Stream'.cycle_eq
code: theorem cycle_eq : ∀ (l : List α) (h : l ≠ []), cycle l h = l ++ₛ cycle l h
  
goal: Stream'.cycle l h = l ++ₛ Stream'.cycle l h

full_name: Stream'.mem_cycle
code: theorem mem_cycle {a : α} {l : List α} : ∀ h : l ≠ [], a ∈ l → a ∈ cycle l h 
goal: a ∈ l → a ∈ Stream'.cycle l h

full_name: Stream'.cycle_singleton
code: @[simp]
theorem cycle_singleton (a : α) : cycle [a] (by simp) = const a 
goal: Stream'.cycle [a] ⋯ = Stream'.const a

full_name: Stream'.tails_eq
code: theorem tails_eq (s : Stream' α) : tails s = tail s::tails (tail s) 
goal: s.tails = Stream'.cons s.tail s.tail.tails

full_name: Stream'.get_tails
code: @[simp]
theorem get_tails : ∀ (n : ℕ) (s : Stream' α), get (tails s) n = drop n (tail s) 
goal: s.tails.get n = Stream'.drop n s.tail

full_name: Stream'.tails_eq_iterate
code: theorem tails_eq_iterate (s : Stream' α) : tails s = iterate tail (tail s) 
goal: s.tails = Stream'.iterate Stream'.tail s.tail

full_name: Stream'.inits_core_eq
code: theorem inits_core_eq (l : List α) (s : Stream' α) :
    initsCore l s = l::initsCore (l ++ [head s]) (tail s) 
goal: Stream'.initsCore l s = Stream'.cons l (Stream'.initsCore (l ++ [s.head]) s.tail)

full_name: Stream'.tail_inits
code: theorem tail_inits (s : Stream' α) :
    tail (inits s) = initsCore [head s, head (tail s)] (tail (tail s)) 
goal: s.inits.tail = Stream'.initsCore [s.head, s.tail.head] s.tail.tail

full_name: Stream'.inits_tail
code: theorem inits_tail (s : Stream' α) : inits (tail s) = initsCore [head (tail s)] (tail (tail s)) 
goal: s.tail.inits = Stream'.initsCore [s.tail.head] s.tail.tail

full_name: Stream'.cons_get_inits_core
code: theorem cons_get_inits_core :
    ∀ (a : α) (n : ℕ) (l : List α) (s : Stream' α),
      (a::get (initsCore l s) n) = get (initsCore (a::l) s) n 
goal: a :: (Stream'.initsCore l s).get n = (Stream'.initsCore (a :: l) s).get n

full_name: Stream'.get_inits
code: @[simp]
theorem get_inits : ∀ (n : ℕ) (s : Stream' α), get (inits s) n = take (succ n) s 
goal: s.inits.get n = Stream'.take n.succ s

full_name: Stream'.inits_eq
code: theorem inits_eq (s : Stream' α) :
    inits s = [head s]::map (List.cons (head s)) (inits (tail s)) 
goal: s.inits = Stream'.cons [s.head] (Stream'.map (List.cons s.head) s.tail.inits)

full_name: Stream'.zip_inits_tails
code: theorem zip_inits_tails (s : Stream' α) : zip appendStream' (inits s) (tails s) = const s 
goal: Stream'.zip Stream'.appendStream' s.inits s.tails = Stream'.const s

full_name: Stream'.identity
code: theorem identity (s : Stream' α) : pure id ⊛ s = s 
goal: Stream'.pure id ⊛ s = s

full_name: Stream'.composition
code: theorem composition (g : Stream' (β → δ)) (f : Stream' (α → β)) (s : Stream' α) :
    pure comp ⊛ g ⊛ f ⊛ s = g ⊛ (f ⊛ s) 
goal: Stream'.pure Function.comp ⊛ g ⊛ f ⊛ s = g ⊛ (f ⊛ s)

full_name: Stream'.homomorphism
code: theorem homomorphism (f : α → β) (a : α) : pure f ⊛ pure a = pure (f a) 
goal: Stream'.pure f ⊛ Stream'.pure a = Stream'.pure (f a)

full_name: Stream'.interchange
code: theorem interchange (fs : Stream' (α → β)) (a : α) :
    fs ⊛ pure a = (pure fun f : α → β => f a) ⊛ fs 
goal: fs ⊛ Stream'.pure a = (Stream'.pure fun f => f a) ⊛ fs

full_name: Stream'.map_eq_apply
code: theorem map_eq_apply (f : α → β) (s : Stream' α) : map f s = pure f ⊛ s 
goal: Stream'.map f s = Stream'.pure f ⊛ s

full_name: Stream'.get_nats
code: theorem get_nats (n : ℕ) : get nats n = n 
goal: Stream'.nats.get n = n

full_name: Stream'.nats_eq
code: theorem nats_eq : nats = cons 0 (map succ nats) 
goal: Stream'.nats = Stream'.cons 0 (Stream'.map Nat.succ Stream'.nats)