Basic properties of Lists #
length #
mem #
drop #
isEmpty #
append #
concat #
map #
zipWith #
zip #
join #
bind #
set-theoretic notation of Lists #
bounded quantifiers over Lists #
List subset #
Equations
- List.instTransMemSubset_std = { trans := ⋯ }
Equations
- List.instTransSubset_std = { trans := ⋯ }
replicate #
getLast #
sublists #
Equations
- List.instTransSublist = { trans := ⋯ }
Equations
- List.instTransSublistSubset = { trans := ⋯ }
Equations
- List.instTransSubsetSublist = { trans := ⋯ }
Equations
- List.instTransMemSublist = { trans := ⋯ }
Equations
- l₁.instDecidableSublistOfDecidableEq l₂ = decidable_of_iff (l₁.isSublist l₂ = true) ⋯
head #
tail #
next? #
getLast #
dropLast #
NB: dropLast is the specification for Array.pop, so theorems about List.dropLast
are often used for theorems about Array.pop.
nth element #
If one has get l i hi in a formula and h : l = l', one can not rw h in the formula as
hi gives i < l.length and not i < l'.length. The theorem get_of_eq can be used to make
such a rewrite, with rw (get_of_eq h).
take #
Taking the first n elements in l₁ ++ l₂ is the same as appending the first n elements
of l₁ to the first n - l₁.length elements of l₂.
drop #
Dropping the elements up to n in l₁ ++ l₂ is the same as dropping the elements up to n
in l₁, dropping the elements up to n - l₁.length in l₂, and appending them.
modify nth #
set #
remove nth #
tail #
all / any #
reverse #
insert #
eraseP #
erase #
Alias of List.Sublist.erase.
filter and partition #
filterMap #
find? #
findSome? #
findIdx #
findIdx? #
pairwise #
replaceF #
disjoint #
foldl / foldr #
union #
inter #
product #
leftpad #
The length of the List returned by List.leftpad n a l is equal
to the larger of n and l.length