Lists from functions #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
Theorems and lemmas for dealing with list.of_fn, which converts a function on fin n to a list
of length n.
Main Statements #
The main statements pertain to lists generated using of_fn
list.length_of_fn, which tells us the length of such a listlist.nth_of_fn, which tells us the nth element of such a listlist.array_eq_of_fn, which interprets the list form of an array as such a list.list.equiv_sigma_tuple, which is anequivbetween lists and the functions that generate them vialist.of_fn.
The length of a list converted from a function is the size of the domain.
The nth element of a list
Arrays converted to lists are the same as of_fn on the indexing function of the array.
of_fn on an empty domain is the empty list.
Note this matches the convention of list.of_fn_succ', putting the fin m elements first.
This breaks a list of m*n items into m groups each containing n elements.
This breaks a list of m*n items into n groups each containing m elements.
Lists are equivalent to the sigma type of tuples of a given length.
A recursor for lists that expands a list into a function mapping to its elements.
This can be used with induction l using list.of_fn_rec.
fin.sigma_eq_iff_eq_comp_cast may be useful to work with the RHS of this expression.
Note we can only state this when the two functions are indexed by defeq n.
A special case of list.of_fn_inj' for when the two functions are indexed by defeq n.