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.instTransListMemInstMembershipListSubsetInstHasSubsetList = { trans := ⋯ }
Equations
- List.instTransListSubsetInstHasSubsetList = { trans := ⋯ }
replicate #
getLast #
sublists #
Equations
- List.instTransListSublist = { trans := ⋯ }
Equations
- List.instTransListSublistSubsetInstHasSubsetList = { trans := ⋯ }
Equations
- List.instTransListSubsetSublistInstHasSubsetList = { trans := ⋯ }
Equations
- List.instTransListMemInstMembershipListSublist = { trans := ⋯ }
Equations
- List.instDecidableSublist l₁ l₂ = decidable_of_iff (List.isSublist l₁ 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₂
.
The i
-th element of a list coincides with the i
-th element of any of its prefixes of
length > i
. Version designed to rewrite from the big list to the small list.
The i
-th element of a list coincides with the i
-th element of any of its prefixes of
length > i
. Version designed to rewrite from the small list to the big list.
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.
The i + j
-th element of a list coincides with the j
-th element of the list obtained by
dropping the first i
elements. Version designed to rewrite from the big list to the small list.
The i + j
-th element of a list coincides with the j
-th element of the list obtained by
dropping the first i
elements. Version designed to rewrite from the small list to the big list.
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