Streams a.k.a. infinite lists a.k.a. infinite sequences #
Porting note:
This file used to be in the core library. It was moved to mathlib
and renamed to init
to avoid
name clashes.
Equations
- Stream'.instInhabited = { default := Stream'.const default }
Alias for Stream'.eta
to match List
API.
theorem
Stream'.cons_injective_left
{α : Type u}
(s : Stream' α)
:
Function.Injective fun (x : α) => cons x s
@[simp]
Streams s₁
and s₂
are defined to be bisimulations if
their heads are equal and tails are bisimulations.
Equations
- Stream'.IsBisimulation R = ∀ ⦃s₁ s₂ : Stream' α⦄, R s₁ s₂ → s₁.head = s₂.head ∧ R s₁.tail s₂.tail
Instances For
theorem
Stream'.eq_of_bisim
{α : Type u}
(R : Stream' α → Stream' α → Prop)
(bisim : IsBisimulation R)
{s₁ s₂ : Stream' α}
:
R s₁ s₂ → s₁ = s₂
theorem
Stream'.cycle_g_cons
{α : Type u}
(a a₁ : α)
(l₁ : List α)
(a₀ : α)
(l₀ : List α)
:
Stream'.cycleG (a, a₁ :: l₁, a₀, l₀) = (a₁, l₁, a₀, l₀)
theorem
Stream'.zip_inits_tails
{α : Type u}
(s : Stream' α)
:
zip appendStream' s.inits s.tails = const s