Lemmas about array iterators #
This module provides lemmas about the interactions of Array.iter
with Iter.step
and various
collectors.
theorem
Array.step_iterFromIdx
{β : Type w}
{array : Array β}
{pos : Nat}
:
(array.iterFromIdx pos).step = if h : pos < array.size then Std.Iterators.PlausibleIterStep.yield (array.iterFromIdx (pos + 1)) array[pos] ⋯
else Std.Iterators.PlausibleIterStep.done ⋯
theorem
Array.step_iter
{β : Type w}
{array : Array β}
:
array.iter.step = if h : 0 < array.size then Std.Iterators.PlausibleIterStep.yield (array.iterFromIdx 1) array[0] ⋯
else Std.Iterators.PlausibleIterStep.done ⋯
@[simp]
@[simp]