Basic properties of lists #
There is only one list of an empty type
Equations
- List.uniqueOfIsEmpty = { toInhabited := instInhabitedList, uniq := ⋯ }
mem #
length #
Alias of the reverse direction of List.length_pos
.
set-theoretic notation of lists #
Equations
- List.instSingletonList = { singleton := fun (x : α) => [x] }
Equations
- List.instInsertOfDecidableEq_mathlib = { insert := List.insert }
bounded quantifiers over lists #
list subset #
append #
replicate #
pure #
bind #
Alias of List.bind_eq_flatMap
.
concat #
reverse #
getLast #
getLast? #
head(!?) and tail #
sublists #
indexOf #
Alias of List.idxOf_cons_eq
.
Alias of List.idxOf_cons_ne
.
Alias of List.idxOf_of_not_mem
.
Alias of List.idxOf_le_length
.
Alias of List.idxOf_lt_length_iff
.
Alias of List.idxOf_append_of_mem
.
Alias of List.idxOf_append_of_not_mem
.
nth element #
Alias of List.getElem_idxOf
.
Alias of List.idxOf_get
.
Alias of List.getElem?_idxOf
.
Alias of List.getElem?_idxOf
.
Alias of List.getElem?_idxOf
.
Alias of List.idxOf_inj
.
Alias of List.modifyTailIdx_modifyTailIdx_le
.
Alias of List.modifyTailIdx_modifyTailIdx_self
.
map #
Alias of List.infix_flatMap_of_mem
.
A single List.map
of a composition of functions is equal to
composing a List.map
with another List.map
, fully applied.
This is the reverse direction of List.map_map
.
foldl, foldr #
Consider two lists l₁
and l₂
with designated elements a₁
and a₂
somewhere in them:
l₁ = x₁ ++ [a₁] ++ z₁
and l₂ = x₂ ++ [a₂] ++ z₂
.
Assume the designated element a₂
is present in neither x₁
nor z₁
.
We conclude that the lists are equal (l₁ = l₂
) if and only if their respective parts are equal
(x₁ = x₂ ∧ a₁ = a₂ ∧ z₁ = z₂
).
foldlM, foldrM, mapM #
intersperse #
Alias of List.intersperse_single
.
Alias of List.intersperse_cons₂
.
map for partial functions #
filter #
filterMap #
filter #
Alias of List.filter_subset
.
Alias of List.map_filter
.
eraseP #
erase #
diff #
Forall #
Equations
- List.instDecidablePredForall p x✝ = decidable_of_iff' (∀ (x : α), x ∈ x✝ → p x) ⋯
Miscellaneous lemmas #
The images of disjoint lists under a partially defined map are disjoint
The images of disjoint lists under an injective map are disjoint
Alias of List.disjoint_map
.
The images of disjoint lists under an injective map are disjoint