Equivalence between fin (length l)
and elements of a list #
Given a list l
,
-
if
l
has no duplicates, thenlist.nodup.nth_le_equiv
is the equivalence betweenfin (length l)
and{x // x ∈ l}
sending⟨i, hi⟩
to⟨nth_le l i hi, _⟩
with the inverse sending⟨x, hx⟩
to⟨index_of x l, _⟩
; -
if
l
has no duplicates and contains every element of a typeα
, thenlist.nodup.nth_le_equiv_of_forall_mem_list
defines an equivalence betweenfin (length l)
andα
; ifα
does not have decidable equality, then there is a bijectionlist.nodup.nth_le_bijection_of_forall_mem_list
; -
if
l
is sorted w.r.t.(<)
, thenlist.sorted.nth_le_iso
is the same bijection reinterpreted as anorder_iso
.
If l
lists all the elements of α
without duplicates, then list.nth_le
defines
a bijection fin l.length → α
. See list.nodup.nth_le_equiv_of_forall_mem_list
for a version giving an equivalence when there is decidable equality.
If l
has no duplicates, then list.nth_le
defines an equivalence between fin (length l)
and
the set of elements of l
.
If l
lists all the elements of α
without duplicates, then list.nth_le
defines
an equivalence between fin l.length
and α
.
See list.nodup.nth_le_bijection_of_forall_mem_list
for a version without
decidable equality.
If l
is a list sorted w.r.t. (<)
, then list.nth_le
defines an order isomorphism between
fin (length l)
and the set of elements of l
.
Equations
- list.sorted.nth_le_iso l H = {to_equiv := list.nodup.nth_le_equiv l _, map_rel_iff' := _}
If there is f
, an order-preserving embedding of ℕ
into ℕ
such that
any element of l
found at index ix
can be found at index f ix
in l'
,
then sublist l l'
.
A l : list α
is sublist l l'
for l' : list α
iff
there is f
, an order-preserving embedding of ℕ
into ℕ
such that
any element of l
found at index ix
can be found at index f ix
in l'
.
An element x : α
of l : list α
is a duplicate iff it can be found
at two distinct indices n m : ℕ
inside the list l
.