The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V33. Data structures and computation

Mathlib.Data.Stream.Init

153 declarations. Mathlib docs · Source

theorem Stream'.cons.match_1.congr_eq_1 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ),
  x = 0 →
    (match x with
      | 0 => h_1 ()
      | n.succ => h_2 n) ≍
      h_1 ()

theorem Stream'.take.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} (motive : ℕ → Stream' α → Sort u_2) (x : ℕ) (x_1 : Stream' α) (h_1 : (x : Stream' α) → motive 0 x)
  (h_2 : (n : ℕ) → (s : Stream' α) → motive n.succ s) (n : ℕ) (s : Stream' α),
  x = n.succ →
    x_1 = s →
      (match x, x_1 with
        | 0, x => h_1 x
        | n.succ, s => h_2 n s) ≍
        h_2 n s

theorem Stream'.take.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} (motive : ℕ → Stream' α → Sort u_2) (x : ℕ) (x_1 : Stream' α) (h_1 : (x : Stream' α) → motive 0 x)
  (h_2 : (n : ℕ) → (s : Stream' α) → motive n.succ s) (x_2 : Stream' α),
  x = 0 →
    x_1 = x_2 →
      (match x, x_1 with
        | 0, x => h_1 x
        | n.succ, s => h_2 n s) ≍
        h_1 x_2

theorem Stream'.cons.match_1.congr_eq_2 E1 #

∀ (motive : ℕ → Sort u_1) (x : ℕ) (h_1 : Unit → motive 0) (h_2 : (n : ℕ) → motive n.succ) (n : ℕ),
  x = n.succ →
    (match x with
      | 0 => h_1 ()
      | n.succ => h_2 n) ≍
      h_2 n

instance Stream'.instInhabited E0 #

{α : Type u} → [Inhabited α] → Inhabited (Stream' α)

theorem Stream'.eta E0 #

∀ {α : Type u} (s : Stream' α), Stream'.cons s.head s.tail = s

theorem Stream'.cons_head_tail E1 #

∀ {α : Type u} (s : Stream' α), Stream'.cons s.head s.tail = s

Alias for Stream'.eta to match List API.

theorem Stream'.ext_iff E0 #

∀ {α : Type u} {s₁ s₂ : Stream' α}, s₁ = s₂ ↔ ∀ (n : ℕ), s₁.get n = s₂.get n

theorem Stream'.ext E1 #

∀ {α : Type u} {s₁ s₂ : Stream' α}, (∀ (n : ℕ), s₁.get n = s₂.get n) → s₁ = s₂

theorem Stream'.get_zero_cons E0 #

∀ {α : Type u} (a : α) (s : Stream' α), (Stream'.cons a s).get 0 = a

theorem Stream'.head_cons E0 #

∀ {α : Type u} (a : α) (s : Stream' α), (Stream'.cons a s).head = a

theorem Stream'.tail_cons E0 #

∀ {α : Type u} (a : α) (s : Stream' α), (Stream'.cons a s).tail = s

theorem Stream'.get_drop E0 #

∀ {α : Type u} (n m : ℕ) (s : Stream' α), (Stream'.drop m s).get n = s.get (m + n)

theorem Stream'.tail_eq_drop E1 #

∀ {α : Type u} (s : Stream' α), s.tail = Stream'.drop 1 s

theorem Stream'.drop_drop E0 #

∀ {α : Type u} (n m : ℕ) (s : Stream' α), Stream'.drop n (Stream'.drop m s) = Stream'.drop (m + n) s

theorem Stream'.get_tail E0 #

∀ {α : Type u} {n : ℕ} {s : Stream' α}, s.tail.get n = s.get (n + 1)

theorem Stream'.tail_drop' E0 #

∀ {α : Type u} {i : ℕ} {s : Stream' α}, (Stream'.drop i s).tail = Stream'.drop (i + 1) s

theorem Stream'.drop_tail' E0 #

∀ {α : Type u} {i : ℕ} {s : Stream' α}, Stream'.drop i s.tail = Stream'.drop (i + 1) s

theorem Stream'.tail_drop E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), (Stream'.drop n s).tail = Stream'.drop n s.tail

theorem Stream'.get_succ E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), s.get n.succ = s.tail.get n

theorem Stream'.get_succ_cons E0 #

∀ {α : Type u} (n : ℕ) (s : Stream' α) (x : α), (Stream'.cons x s).get n.succ = s.get n

theorem Stream'.get_cons_append_zero E0 #

∀ {α : Type u} {a : α} {x : List α} {s : Stream' α}, (a :: x ++ₛ s).get 0 = a

theorem Stream'.append_eq_cons E0 #

∀ {α : Type u} {a : α} {as : Stream' α}, [a] ++ₛ as = Stream'.cons a as

theorem Stream'.drop_zero E0 #

∀ {α : Type u} {s : Stream' α}, Stream'.drop 0 s = s

theorem Stream'.drop_succ E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), Stream'.drop n.succ s = Stream'.drop n s.tail

theorem Stream'.head_drop E1 #

∀ {α : Type u} (a : Stream' α) (n : ℕ), (Stream'.drop n a).head = a.get n

theorem Stream'.cons_injective2 E1 #

∀ {α : Type u}, Function.Injective2 Stream'.cons

theorem Stream'.cons_injective_left E1 #

∀ {α : Type u} (s : Stream' α), Function.Injective fun x ↦ Stream'.cons x s

theorem Stream'.cons_injective_right E1 #

∀ {α : Type u} (x : α), Function.Injective (Stream'.cons x)

theorem Stream'.all_def E0 #

∀ {α : Type u} (p : α → Prop) (s : Stream' α), Stream'.All p s = ∀ (n : ℕ), p (s.get n)

theorem Stream'.any_def E0 #

∀ {α : Type u} (p : α → Prop) (s : Stream' α), Stream'.Any p s = ∃ n, p (s.get n)

theorem Stream'.mem_cons E0 #

∀ {α : Type u} (a : α) (s : Stream' α), a ∈ Stream'.cons a s

theorem Stream'.mem_cons_of_mem E0 #

∀ {α : Type u} {a : α} {s : Stream' α} (b : α), a ∈ s → a ∈ Stream'.cons b s

theorem Stream'.mem_of_get_eq E0 #

∀ {α : Type u} {n : ℕ} {s : Stream' α} {a : α}, a = s.get n → a ∈ s

theorem Stream'.mem_iff_exists_get_eq E0 #

∀ {α : Type u} {s : Stream' α} {a : α}, a ∈ s ↔ ∃ n, a = s.get n

theorem Stream'.drop_map E1 #

∀ {α : Type u} {β : Type v} (f : α → β) (n : ℕ) (s : Stream' α),
  Stream'.drop n (Stream'.map f s) = Stream'.map f (Stream'.drop n s)

theorem Stream'.get_map E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (n : ℕ) (s : Stream' α), (Stream'.map f s).get n = f (s.get n)

theorem Stream'.tail_map E1 #

∀ {α : Type u} {β : Type v} (f : α → β) (s : Stream' α), (Stream'.map f s).tail = Stream'.map f s.tail

theorem Stream'.head_map E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (s : Stream' α), (Stream'.map f s).head = f s.head

theorem Stream'.map_eq E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (s : Stream' α),
  Stream'.map f s = Stream'.cons (f s.head) (Stream'.map f s.tail)

theorem Stream'.map_cons E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (a : α) (s : Stream' α),
  Stream'.map f (Stream'.cons a s) = Stream'.cons (f a) (Stream'.map f s)

theorem Stream'.map_id E0 #

∀ {α : Type u} (s : Stream' α), Stream'.map id s = s

theorem Stream'.map_map E0 #

∀ {α : Type u} {β : Type v} {δ : Type w} (g : β → δ) (f : α → β) (s : Stream' α),
  Stream'.map g (Stream'.map f s) = Stream'.map (g ∘ f) s

theorem Stream'.map_tail E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (s : Stream' α), Stream'.map f s.tail = (Stream'.map f s).tail

theorem Stream'.mem_map E0 #

∀ {α : Type u} {β : Type v} (f : α → β) {a : α} {s : Stream' α}, a ∈ s → f a ∈ Stream'.map f s

theorem Stream'.exists_of_mem_map E1 #

∀ {α : Type u} {β : Type v} {f : α → β} {b : β} {s : Stream' α}, b ∈ Stream'.map f s → ∃ a ∈ s, f a = b

theorem Stream'.drop_zip E1 #

∀ {α : Type u} {β : Type v} {δ : Type w} (f : α → β → δ) (n : ℕ) (s₁ : Stream' α) (s₂ : Stream' β),
  Stream'.drop n (Stream'.zip f s₁ s₂) = Stream'.zip f (Stream'.drop n s₁) (Stream'.drop n s₂)

theorem Stream'.get_zip E0 #

∀ {α : Type u} {β : Type v} {δ : Type w} (f : α → β → δ) (n : ℕ) (s₁ : Stream' α) (s₂ : Stream' β),
  (Stream'.zip f s₁ s₂).get n = f (s₁.get n) (s₂.get n)

theorem Stream'.head_zip E1 #

∀ {α : Type u} {β : Type v} {δ : Type w} (f : α → β → δ) (s₁ : Stream' α) (s₂ : Stream' β),
  (Stream'.zip f s₁ s₂).head = f s₁.head s₂.head

theorem Stream'.tail_zip E1 #

∀ {α : Type u} {β : Type v} {δ : Type w} (f : α → β → δ) (s₁ : Stream' α) (s₂ : Stream' β),
  (Stream'.zip f s₁ s₂).tail = Stream'.zip f s₁.tail s₂.tail

theorem Stream'.zip_eq E0 #

∀ {α : Type u} {β : Type v} {δ : Type w} (f : α → β → δ) (s₁ : Stream' α) (s₂ : Stream' β),
  Stream'.zip f s₁ s₂ = Stream'.cons (f s₁.head s₂.head) (Stream'.zip f s₁.tail s₂.tail)

theorem Stream'.get_enum E0 #

∀ {α : Type u} (s : Stream' α) (n : ℕ), s.enum.get n = (n, s.get n)

theorem Stream'.enum_eq_zip E1 #

∀ {α : Type u} (s : Stream' α), s.enum = Stream'.zip Prod.mk Stream'.nats s

theorem Stream'.mem_const E0 #

∀ {α : Type u} (a : α), a ∈ Stream'.const a

theorem Stream'.const_eq E0 #

∀ {α : Type u} (a : α), Stream'.const a = Stream'.cons a (Stream'.const a)

theorem Stream'.tail_const E0 #

∀ {α : Type u} (a : α), (Stream'.const a).tail = Stream'.const a

theorem Stream'.map_const E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (a : α), Stream'.map f (Stream'.const a) = Stream'.const (f a)

theorem Stream'.get_const E0 #

∀ {α : Type u} (n : ℕ) (a : α), (Stream'.const a).get n = a

theorem Stream'.drop_const E0 #

∀ {α : Type u} (n : ℕ) (a : α), Stream'.drop n (Stream'.const a) = Stream'.const a

theorem Stream'.head_iterate E0 #

∀ {α : Type u} (f : α → α) (a : α), (Stream'.iterate f a).head = a

theorem Stream'.get_succ_iterate' E1 #

∀ {α : Type u} (n : ℕ) (f : α → α) (a : α), (Stream'.iterate f a).get n.succ = f ((Stream'.iterate f a).get n)

theorem Stream'.tail_iterate E1 #

∀ {α : Type u} (f : α → α) (a : α), (Stream'.iterate f a).tail = Stream'.iterate f (f a)

theorem Stream'.iterate_eq E0 #

∀ {α : Type u} (f : α → α) (a : α), Stream'.iterate f a = Stream'.cons a (Stream'.iterate f (f a))

theorem Stream'.get_zero_iterate E0 #

∀ {α : Type u} (f : α → α) (a : α), (Stream'.iterate f a).get 0 = a

theorem Stream'.get_succ_iterate E1 #

∀ {α : Type u} (n : ℕ) (f : α → α) (a : α), (Stream'.iterate f a).get n.succ = (Stream'.iterate f (f a)).get n

def Stream'.IsBisimulation E1 #

{α : Type u} → (Stream' α → Stream' α → Prop) → Prop

Streams s₁ and s₂ are defined to be bisimulations if their heads are equal and tails are bisimulations.

theorem Stream'.get_of_bisim E1 #

∀ {α : Type u} (R : Stream' α → Stream' α → Prop),
  Stream'.IsBisimulation R →
    ∀ {s₁ s₂ : Stream' α} (n : ℕ), R s₁ s₂ → s₁.get n = s₂.get n ∧ R (Stream'.drop (n + 1) s₁) (Stream'.drop (n + 1) s₂)

theorem Stream'.bisim_simple E1 #

∀ {α : Type u} (s₁ s₂ : Stream' α), s₁.head = s₂.head → s₁ = s₁.tail → s₂ = s₂.tail → s₁ = s₂

theorem Stream'.coinduction E1 #

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

theorem Stream'.iterate_id E0 #

∀ {α : Type u} (a : α), Stream'.iterate id a = Stream'.const a

theorem Stream'.map_iterate E0 #

∀ {α : Type u} (f : α → α) (a : α), Stream'.iterate f (f a) = Stream'.map f (Stream'.iterate f a)

theorem Stream'.corec_def E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (g : α → α) (a : α), Stream'.corec f g a = Stream'.map f (Stream'.iterate g a)

theorem Stream'.corec_eq E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (g : α → α) (a : α),
  Stream'.corec f g a = Stream'.cons (f a) (Stream'.corec f g (g a))

theorem Stream'.corec_id_id_eq_const E1 #

∀ {α : Type u} (a : α), Stream'.corec id id a = Stream'.const a

theorem Stream'.corec_id_f_eq_iterate E1 #

∀ {α : Type u} (f : α → α) (a : α), Stream'.corec id f a = Stream'.iterate f a

theorem Stream'.corec'_eq E0 #

∀ {α : Type u} {β : Type v} (f : α → β × α) (a : α),
  Stream'.corec' f a = Stream'.cons (f a).1 (Stream'.corec' f (f a).2)

theorem Stream'.unfolds_eq E0 #

∀ {α : Type u} {β : Type v} (g : α → β) (f : α → α) (a : α),
  Stream'.unfolds g f a = Stream'.cons (g a) (Stream'.unfolds g f (f a))

theorem Stream'.get_unfolds_head_tail E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), (Stream'.unfolds Stream'.head Stream'.tail s).get n = s.get n

theorem Stream'.unfolds_head_eq E0 #

∀ {α : Type u} (s : Stream' α), Stream'.unfolds Stream'.head Stream'.tail s = s

theorem Stream'.interleave_eq E0 #

∀ {α : Type u} (s₁ s₂ : Stream' α), s₁ ⋈ s₂ = Stream'.cons s₁.head (Stream'.cons s₂.head (s₁.tail ⋈ s₂.tail))

theorem Stream'.tail_interleave E1 #

∀ {α : Type u} (s₁ s₂ : Stream' α), (s₁ ⋈ s₂).tail = s₂ ⋈ s₁.tail

theorem Stream'.interleave_tail_tail E1 #

∀ {α : Type u} (s₁ s₂ : Stream' α), s₁.tail ⋈ s₂.tail = (s₁ ⋈ s₂).tail.tail

theorem Stream'.get_interleave_left E1 #

∀ {α : Type u} (n : ℕ) (s₁ s₂ : Stream' α), (s₁ ⋈ s₂).get (2 * n) = s₁.get n

theorem Stream'.get_interleave_right E1 #

∀ {α : Type u} (n : ℕ) (s₁ s₂ : Stream' α), (s₁ ⋈ s₂).get (2 * n + 1) = s₂.get n

theorem Stream'.mem_interleave_left E0 #

∀ {α : Type u} {a : α} {s₁ : Stream' α} (s₂ : Stream' α), a ∈ s₁ → a ∈ s₁ ⋈ s₂

theorem Stream'.mem_interleave_right E0 #

∀ {α : Type u} {a : α} {s₁ : Stream' α} (s₂ : Stream' α), a ∈ s₂ → a ∈ s₁ ⋈ s₂

theorem Stream'.odd_eq E0 #

∀ {α : Type u} (s : Stream' α), s.odd = s.tail.even

theorem Stream'.head_even E0 #

∀ {α : Type u} (s : Stream' α), s.even.head = s.head

theorem Stream'.tail_even E1 #

∀ {α : Type u} (s : Stream' α), s.even.tail = s.tail.tail.even

theorem Stream'.even_cons_cons E1 #

∀ {α : Type u} (a₁ a₂ : α) (s : Stream' α), (Stream'.cons a₁ (Stream'.cons a₂ s)).even = Stream'.cons a₁ s.even

theorem Stream'.even_tail E1 #

∀ {α : Type u} (s : Stream' α), s.tail.even = s.odd

theorem Stream'.even_interleave E1 #

∀ {α : Type u} (s₁ s₂ : Stream' α), (s₁ ⋈ s₂).even = s₁

theorem Stream'.interleave_even_odd E1 #

∀ {α : Type u} (s₁ : Stream' α), s₁.even ⋈ s₁.odd = s₁

theorem Stream'.get_even E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), s.even.get n = s.get (2 * n)

theorem Stream'.get_odd E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), s.odd.get n = s.get (2 * n + 1)

theorem Stream'.mem_of_mem_even E0 #

∀ {α : Type u} (a : α) (s : Stream' α), a ∈ s.even → a ∈ s

theorem Stream'.mem_of_mem_odd E0 #

∀ {α : Type u} (a : α) (s : Stream' α), a ∈ s.odd → a ∈ s

theorem Stream'.nil_append_stream E0 #

∀ {α : Type u} (s : Stream' α), [] ++ₛ s = s

theorem Stream'.cons_append_stream E1 #

∀ {α : Type u} (a : α) (l : List α) (s : Stream' α), a :: l ++ₛ s = Stream'.cons a (l ++ₛ s)

theorem Stream'.append_append_stream E0 #

∀ {α : Type u} (l₁ l₂ : List α) (s : Stream' α), l₁ ++ l₂ ++ₛ s = l₁ ++ₛ (l₂ ++ₛ s)

theorem Stream'.get_append_left E1 #

∀ {α : Type u} (n : ℕ) (x : List α) (a : Stream' α) (h : n < x.length), (x ++ₛ a).get n = x[n]

theorem Stream'.get_append_right E0 #

∀ {α : Type u} (n : ℕ) (x : List α) (a : Stream' α), (x ++ₛ a).get (x.length + n) = a.get n

theorem Stream'.get_append_length E0 #

∀ {α : Type u} (x : List α) (a : Stream' α), (x ++ₛ a).get x.length = a.get 0

theorem Stream'.append_right_injective E1 #

∀ {α : Type u} (x : List α) (a b : Stream' α), x ++ₛ a = x ++ₛ b → a = b

theorem Stream'.append_right_inj E0 #

∀ {α : Type u} (x : List α) (a b : Stream' α), x ++ₛ a = x ++ₛ b ↔ a = b

theorem Stream'.append_left_injective E1 #

∀ {α : Type u} (x y : List α) (a b : Stream' α), x ++ₛ a = y ++ₛ b → x.length = y.length → x = y

theorem Stream'.map_append_stream E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (l : List α) (s : Stream' α),
  Stream'.map f (l ++ₛ s) = List.map f l ++ₛ Stream'.map f s

theorem Stream'.drop_append_stream E1 #

∀ {α : Type u} (l : List α) (s : Stream' α), Stream'.drop l.length (l ++ₛ s) = s

theorem Stream'.append_stream_head_tail E1 #

∀ {α : Type u} (s : Stream' α), [s.head] ++ₛ s.tail = s

theorem Stream'.mem_append_stream_right E0 #

∀ {α : Type u} {a : α} (l : List α) {s : Stream' α}, a ∈ s → a ∈ l ++ₛ s

theorem Stream'.mem_append_stream_left E0 #

∀ {α : Type u} {a : α} {l : List α} (s : Stream' α), a ∈ l → a ∈ l ++ₛ s

theorem Stream'.take_zero E0 #

∀ {α : Type u} (s : Stream' α), Stream'.take 0 s = []

theorem Stream'.take_succ E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), Stream'.take n.succ s = s.head :: Stream'.take n s.tail

theorem Stream'.take_succ_cons E0 #

∀ {α : Type u} {a : α} (n : ℕ) (s : Stream' α), Stream'.take (n + 1) (Stream'.cons a s) = a :: Stream'.take n s

theorem Stream'.take_succ' E1 #

∀ {α : Type u} {s : Stream' α} (n : ℕ), Stream'.take (n + 1) s = Stream'.take n s ++ [s.get n]

theorem Stream'.length_take E0 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), (Stream'.take n s).length = n

theorem Stream'.take_take E0 #

∀ {α : Type u} {s : Stream' α} {m n : ℕ}, List.take m (Stream'.take n s) = Stream'.take (min n m) s

theorem Stream'.concat_take_get E0 #

∀ {α : Type u} {n : ℕ} {s : Stream' α}, Stream'.take n s ++ [s.get n] = Stream'.take (n + 1) s

theorem Stream'.getElem?_take E1 #

∀ {α : Type u} {s : Stream' α} {k n : ℕ}, k < n → (Stream'.take n s)[k]? = some (s.get k)

theorem Stream'.getElem?_take_succ E1 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), (Stream'.take n.succ s)[n]? = some (s.get n)

theorem Stream'.dropLast_take E0 #

∀ {α : Type u} {n : ℕ} {xs : Stream' α}, (Stream'.take n xs).dropLast = Stream'.take (n - 1) xs

theorem Stream'.append_take_drop E0 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), Stream'.take n s ++ₛ Stream'.drop n s = s

theorem Stream'.append_take E1 #

∀ {α : Type u} (n : ℕ) (x : List α) (a : Stream' α), x ++ Stream'.take n a = Stream'.take (x.length + n) (x ++ₛ a)

theorem Stream'.take_get E0 #

∀ {α : Type u} (m n : ℕ) (a : Stream' α) (h : m < (Stream'.take n a).length), (Stream'.take n a)[m] = a.get m

theorem Stream'.take_append_of_le_length E1 #

∀ {α : Type u} (n : ℕ) (x : List α) (a : Stream' α), n ≤ x.length → Stream'.take n (x ++ₛ a) = List.take n x

theorem Stream'.take_add E1 #

∀ {α : Type u} (m n : ℕ) (a : Stream' α), Stream'.take (m + n) a = Stream'.take m a ++ Stream'.take n (Stream'.drop m a)

theorem Stream'.take_prefix_take_left E1 #

∀ {α : Type u} (m n : ℕ) (a : Stream' α), m ≤ n → Stream'.take m a <+: Stream'.take n a

theorem Stream'.take_prefix E0 #

∀ {α : Type u} (m n : ℕ) (a : Stream' α), Stream'.take m a <+: Stream'.take n a ↔ m ≤ n

theorem Stream'.map_take E0 #

∀ {α : Type u} {β : Type v} (n : ℕ) (a : Stream' α) (f : α → β),
  List.map f (Stream'.take n a) = Stream'.take n (Stream'.map f a)

theorem Stream'.take_drop E1 #

∀ {α : Type u} (m n : ℕ) (a : Stream' α), Stream'.take n (Stream'.drop m a) = List.drop m (Stream'.take (m + n) a)

theorem Stream'.drop_append_of_le_length E1 #

∀ {α : Type u} (n : ℕ) (x : List α) (a : Stream' α), n ≤ x.length → Stream'.drop n (x ++ₛ a) = List.drop n x ++ₛ a

theorem Stream'.take_theorem E1 #

∀ {α : Type u} (s₁ s₂ : Stream' α), (∀ (n : ℕ), Stream'.take n s₁ = Stream'.take n s₂) → s₁ = s₂

theorem Stream'.cycle_g_cons E1 #

∀ {α : Type u} (a a₁ : α) (l₁ : List α) (a₀ : α) (l₀ : List α), Stream'.cycleG (a, a₁ :: l₁, a₀, l₀) = (a₁, l₁, a₀, l₀)

theorem Stream'.cycle_eq E0 #

∀ {α : Type u} (l : List α) (h : l ≠ []), Stream'.cycle l h = l ++ₛ Stream'.cycle l h

theorem Stream'.mem_cycle E0 #

∀ {α : Type u} {a : α} {l : List α} (h : l ≠ []), a ∈ l → a ∈ Stream'.cycle l h

theorem Stream'.cycle_singleton E0 #

∀ {α : Type u} (a : α), Stream'.cycle [a] ⋯ = Stream'.const a

theorem Stream'.tails_eq E0 #

∀ {α : Type u} (s : Stream' α), s.tails = Stream'.cons s.tail s.tail.tails

theorem Stream'.get_tails E0 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), s.tails.get n = Stream'.drop n s.tail

theorem Stream'.tails_eq_iterate E1 #

∀ {α : Type u} (s : Stream' α), s.tails = Stream'.iterate Stream'.tail s.tail

theorem Stream'.inits_core_eq E0 #

∀ {α : Type u} (l : List α) (s : Stream' α),
  Stream'.initsCore l s = Stream'.cons l (Stream'.initsCore (l ++ [s.head]) s.tail)

theorem Stream'.tail_inits E1 #

∀ {α : Type u} (s : Stream' α), s.inits.tail = Stream'.initsCore [s.head, s.tail.head] s.tail.tail

theorem Stream'.inits_tail E1 #

∀ {α : Type u} (s : Stream' α), s.tail.inits = Stream'.initsCore [s.tail.head] s.tail.tail

theorem Stream'.cons_get_inits_core E1 #

∀ {α : Type u} (a : α) (n : ℕ) (l : List α) (s : Stream' α),
  a :: (Stream'.initsCore l s).get n = (Stream'.initsCore (a :: l) s).get n

theorem Stream'.get_inits E0 #

∀ {α : Type u} (n : ℕ) (s : Stream' α), s.inits.get n = Stream'.take n.succ s

theorem Stream'.inits_eq E0 #

∀ {α : Type u} (s : Stream' α), s.inits = Stream'.cons [s.head] (Stream'.map (List.cons s.head) s.tail.inits)

theorem Stream'.zip_inits_tails E1 #

∀ {α : Type u} (s : Stream' α), Stream'.zip Stream'.appendStream' s.inits s.tails = Stream'.const s

theorem Stream'.identity E1 #

∀ {α : Type u} (s : Stream' α), Stream'.pure id ⊛ s = s

theorem Stream'.composition E1 #

∀ {α : Type u} {β : Type v} {δ : Type w} (g : Stream' (β → δ)) (f : Stream' (α → β)) (s : Stream' α),
  Stream'.pure Function.comp ⊛ g ⊛ f ⊛ s = g ⊛ (f ⊛ s)

theorem Stream'.homomorphism E1 #

∀ {α : Type u} {β : Type v} (f : α → β) (a : α), Stream'.pure f ⊛ Stream'.pure a = Stream'.pure (f a)

theorem Stream'.interchange E1 #

∀ {α : Type u} {β : Type v} (fs : Stream' (α → β)) (a : α), fs ⊛ Stream'.pure a = (Stream'.pure fun f ↦ f a) ⊛ fs

theorem Stream'.map_eq_apply E0 #

∀ {α : Type u} {β : Type v} (f : α → β) (s : Stream' α), Stream'.map f s = Stream'.pure f ⊛ s

theorem Stream'.get_nats E1 #

∀ (n : ℕ), Stream'.nats.get n = n

theorem Stream'.nats_eq E0 #

Stream'.nats = Stream'.cons 0 (Stream'.map Nat.succ Stream'.nats)