Lemmas about UInt16Array #
Lemmas about arrays and slices, stated in terms of the model Array UInt16 and
List UInt16.
Arrays #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.foldl_eq_foldl_toArray {β : Type v} (f : β → UInt16 → β) (init : β) (a : UInt16Array) :
theorem ScalarArray.UInt16Array.foldr_eq_foldr_toArray {β : Type v} (f : UInt16 → β → β) (init : β) (a : UInt16Array) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.toArray_copySlice (src : UInt16Array) (srcOff : Nat) (dest : UInt16Array) (destOff len : Nat) (exact : Bool) :
theorem ScalarArray.UInt16Array.copySlice_eq_append (src : UInt16Array) (srcOff : Nat) (dest : UInt16Array) (destOff len : Nat) (exact : Bool) :
Lists #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.toList_copySlice (src : UInt16Array) (srcOff : Nat) (dest : UInt16Array) (destOff len : Nat) (exact : Bool) :
Accessors #
@[simp]
@[simp]
@[simp]
Last element #
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.back_push (a : UInt16Array) (v : UInt16) (h : 0 < (a.push v).size) :
Writes #
theorem ScalarArray.UInt16Array.getElem_copySlice (src : UInt16Array) (srcOff : Nat) (dest : UInt16Array) (destOff len : Nat) (exact : Bool) (i : Nat) (h : i < (src.copySlice srcOff dest destOff len exact).size) :
Machine-word indices #
usize is the size when the size fits in a USize, which holds for every array in memory. Loops
over USize indices take this as a hypothesis, since the model Array has no bound on its size.
theorem ScalarArray.UInt16Array.lt_usize_iff (a : UInt16Array) (h : a.size < USize.size) {i : USize} :
The guard i < a.usize of a loop over USize indices bounds the index.
Folds and queries #
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.foldl_toList {β : Type v} (f : β → UInt16 → β) (init : β) (a : UInt16Array) :
@[simp]
theorem ScalarArray.UInt16Array.foldr_toList {β : Type v} (f : UInt16 → β → β) (init : β) (a : UInt16Array) :
@[simp]
theorem ScalarArray.UInt16Array.forIn_toList {β : Type v} {m : Type v → Type w} [Monad m] [LawfulMonad m] (a : UInt16Array) (init : β) (f : UInt16 → β → m (ForInStep β)) :
theorem ScalarArray.UInt16Array.findIdx?_eq (a : UInt16Array) (p : UInt16 → Bool) (start : Nat) :
a.findIdx? p start = Option.map (fun (x : Nat) => x + start) (List.findIdx? p (List.drop start a.toList))
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.map_val_findFinIdx? (a : UInt16Array) (p : UInt16 → Bool) (start : Nat) :
@[simp]
theorem ScalarArray.UInt16Array.foldlM_toList {β : Type v} {m : Type v → Type w} [Monad m] (f : β → UInt16 → m β) (init : β) (a : UInt16Array) :
@[simp]
theorem ScalarArray.UInt16Array.foldrM_toList {β : Type v} {m : Type v → Type w} [Monad m] (f : UInt16 → β → m β) (init : β) (a : UInt16Array) :
Membership #
@[simp]
@[simp]
@[simp]
@[simp]
Collecting iterators #
@[simp]
theorem Std.Iter.toList_toUInt16Array {α : Type} [Iterator α Id UInt16] [Iterators.Finite α Id] [IteratorLoop α Id Id] [LawfulIteratorLoop α Id Id] (it : Iter UInt16) :
Slices #
@[simp]
@[simp]
Copying the slice from start to stop is the same as extracting those elements.
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.getElem_toSlice (a : UInt16Array) (start stop i : Nat) (h : i < Std.Slice.size (a.toSlice start stop)) :
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.Slice.getElem_slice (s : UInt16Array.Slice) (start stop i : Nat) (h : i < Std.Slice.size (s.slice start stop)) :
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.Slice.getElem_popFront (s : UInt16Array.Slice) (i : Nat) (h : i < Std.Slice.size s.popFront) :
theorem ScalarArray.UInt16Array.Slice.foldr_eq_foldr_toList_copy {β : Type v} (f : UInt16 → β → β) (init : β) (s : UInt16Array.Slice) :
Folding over a slice is folding over the list of its elements.
Slices as copies #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.Slice.foldl_eq_foldl_copy {β : Type v} (f : β → UInt16 → β) (init : β) (s : UInt16Array.Slice) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.foldlM_eq_foldlM_copy {β : Type v} {m : Type v → Type w} [Monad m] [LawfulMonad m] (f : β → UInt16 → m β) (init : β) (s : UInt16Array.Slice) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.forIn_eq_forIn_copy {β : Type v} {m : Type v → Type w} [Monad m] [LawfulMonad m] (s : UInt16Array.Slice) (init : β) (f : UInt16 → β → m (ForInStep β)) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.forM_eq_forM_copy {m : Type v → Type w} [Monad m] [LawfulMonad m] (s : UInt16Array.Slice) (f : UInt16 → m PUnit) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.foldr_eq_foldr_copy {β : Type v} (f : UInt16 → β → β) (init : β) (s : UInt16Array.Slice) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.foldrM_eq_foldrM_copy {β : Type v} {m : Type v → Type w} [Monad m] [LawfulMonad m] (f : UInt16 → β → m β) (init : β) (s : UInt16Array.Slice) :
@[simp]
@[simp]
@[simp]
theorem ScalarArray.UInt16Array.Slice.contains_eq_contains_copy (s : UInt16Array.Slice) (v : UInt16) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.find?_eq_find?_toList_copy (s : UInt16Array.Slice) (p : UInt16 → Bool) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.count_eq_countP_toList_copy (s : UInt16Array.Slice) (p : UInt16 → Bool) :
@[simp]
theorem ScalarArray.UInt16Array.Slice.findRev?_eq_find?_reverse_toList_copy (s : UInt16Array.Slice) (p : UInt16 → Bool) :
Membership in slices #
@[simp]
theorem ScalarArray.UInt16Array.Slice.getElem_mem {s : UInt16Array.Slice} {i : Nat} (h : i < Std.Slice.size s) :
Slice equality #
@[simp]