Preliminaries about Array
needed for List.toArray
lemmas. #
This section contains only the bare minimum lemmas about Array
that we need to write lemmas about List.toArray
.
Lemmas about List.toArray
. #
We prefer to pull List.toArray
outwards.
Unapplied variant of push_toArray
, useful for monadic reasoning.
Variant of foldrM_toArray
with a side condition for the start
argument.
Variant of foldlM_toArray
with a side condition for the stop
argument.
Variant of foldr_toArray
with a side condition for the start
argument.
Variant of foldl_toArray
with a side condition for the stop
argument.
Preliminaries #
empty #
size #
push #
L[i] and L[i]? #
Equations
Instances For
Equations
Instances For
Variant of foldrM_push
with h : start = arr.size + 1
rather than (arr.push a).size
as the argument.
Variant of foldr_push
with the h : start = arr.size + 1
rather than (arr.push a).size
as the argument.
A more efficient version of arr.toList.reverse
.
Equations
- arr.toListRev = Array.foldl (fun (l : List α) (t : α) => t :: l) [] arr
Instances For
uset #
get #
set #
setIfInBounds #
ofFn #
mkArray #
mem #
get lemmas #
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
BEq #
take #
forIn #
foldl / foldr #
map #
modify #
filter #
filterMap #
empty #
append #
flatten #
extract #
any #
all #
contains #
Equations
- Array.instDecidableMemOfDecidableEq a as = decidable_of_iff (as.contains a = true) ⋯
swap #
eraseIdx #
isPrefixOf #
zipWith #
findSomeM?, findM?, findSome?, find? #
More theorems about List.toArray
, followed by an Array
operation. #
Our goal is to have simp
"pull List.toArray
outwards" as much as possible.
Variant of anyM_toArray
with a side condition on stop
.
Variant of any_toArray
with a side condition on stop
.
Variant of allM_toArray
with a side condition on stop
.
Variant of all_toArray
with a side condition on stop
.
map #
map_id_fun'
differs from map_id_fun
by representing the identity function as a lambda, rather than id
.