Equivalence between fin (length l) and elements of a list #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Given a list l,
-
if
lhas no duplicates, thenlist.nodup.nth_le_equivis 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
lhas no duplicates and contains every element of a typeα, thenlist.nodup.nth_le_equiv_of_forall_mem_listdefines 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
lis sorted w.r.t.(<), thenlist.sorted.nth_le_isois 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.