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.PlausibleIterStep.yield (array.iterFromIdx (pos + 1)) array[pos] ⋯
else Std.PlausibleIterStep.done ⋯
theorem Array.step_iter {β : Type w} {array : Array β} :
array.iter.step = if h : 0 < array.size then Std.PlausibleIterStep.yield (array.iterFromIdx 1) array[0] ⋯
else Std.PlausibleIterStep.done ⋯
@[simp]
@[simp]
@[simp]
theorem Array.iterFromIdx_equiv_iter_drop_toList {α : Type w} {array : Array α} {pos : Nat} :
(array.iterFromIdx pos).Equiv (List.drop pos array.toList).iter