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_iff.
set-theoretic notation of lists #
Equations
- List.instInsertOfDecidableEq_mathlib = { insert := List.insert }
bounded quantifiers over lists #
list subset #
append #
replicate #
pure #
bind #
concat #
reverse #
getLast #
getLast? #
head(!?) and tail #
sublists #
indexOf #
Alias of List.idxOf_of_notMem.
Alias of List.idxOf_append_of_notMem.
nth element #
map #
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₂).
Alias of List.append_cons_inj_of_notMem.
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 #
eraseP #
erase #
diff #
Alias of List.Sublist.erase_diff_erase_sublist.
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