theorem
Std.Iterators.Iter.toArray_eq_match_step
{α β : Type u_1}
[Iterator α Id β]
[Finite α Id]
[IteratorCollect α Id Id]
[LawfulIteratorCollect α Id Id]
{it : Iter β}
:
it.toArray = match it.step.val with
| IterStep.yield it' out => #[out] ++ it'.toArray
| IterStep.skip it' => it'.toArray
| IterStep.done => #[]
theorem
Std.Iterators.Iter.toList_eq_match_step
{α β : Type u_1}
[Iterator α Id β]
[Finite α Id]
[IteratorCollect α Id Id]
[LawfulIteratorCollect α Id Id]
{it : Iter β}
:
it.toList = match it.step.val with
| IterStep.yield it' out => out :: it'.toList
| IterStep.skip it' => it'.toList
| IterStep.done => []
theorem
Std.Iterators.Iter.toList_eq_of_atIdxSlow?_eq
{α₁ α₂ β : Type u_1}
[Iterator α₁ Id β]
[Finite α₁ Id]
[IteratorCollect α₁ Id Id]
[LawfulIteratorCollect α₁ Id Id]
[Iterator α₂ Id β]
[Finite α₂ Id]
[IteratorCollect α₂ Id Id]
[LawfulIteratorCollect α₂ Id Id]
{it₁ : Iter β}
{it₂ : Iter β}
(h : ∀ (k : Nat), atIdxSlow? k it₁ = atIdxSlow? k it₂)
:
theorem
Std.Iterators.Iter.isPlausibleIndirectOutput_of_mem_toList
{α β : Type u_1}
[Iterator α Id β]
[Finite α Id]
[IteratorCollect α Id Id]
[LawfulIteratorCollect α Id Id]
{it : Iter β}
{b : β}
:
b ∈ it.toList → it.IsPlausibleIndirectOutput b
theorem
Std.Iterators.Iter.isPlausibleIndirectOutput_of_mem_toListRev
{α β : Type u_1}
[Iterator α Id β]
[Finite α Id]
[IteratorCollect α Id Id]
[LawfulIteratorCollect α Id Id]
{it : Iter β}
{b : β}
:
b ∈ it.toListRev → it.IsPlausibleIndirectOutput b