Short lists over a list #
List.listsUpTo l r lists the lists of length at most r whose entries come from l
(List.mem_listsUpTo). There are at most (l.length + 1) ^ r of them
(List.length_listsUpTo_le), and fewer than l.length ^ (r + 1) when 2 ≤ l.length
(List.length_listsUpTo_lt_pow), so for a fixed r the listing has polynomial length.
Main definitions #
List.listsUpTo: the lists of length at mostrwith entries froml.
Main results #
List.mem_listsUpTo: membership inList.listsUpTo l r.List.length_listsUpTo_le: there are at most(l.length + 1) ^ rsuch lists.List.length_listsUpTo_lt_pow: fewer thanl.length ^ (r + 1)such lists when2 ≤ l.length.List.nodup_listsUpTo: over a list without duplicates, the listing has no duplicates.
With at least two entries to choose from, there are fewer than l.length ^ (r + 1) lists of
length at most r (List.length_listsUpTo_le gives (l.length + 1) ^ r for every l).