Type class for finitely enumerable types. The property is stronger
than Fintype in that it assigns each element a rank in a finite
enumeration.
FinEnum α means that α is finite and can be enumerated in some order,
i.e. α has an explicit bijection with Fin n for some n.
- card : ℕ
FinEnum.cardis the cardinality of theFinEnum - decEq : DecidableEq α
Instances
create a FinEnum instance from an exhaustive list without duplicates
Instances For
create a FinEnum instance from an exhaustive list; duplicates are removed
Instances For
create an exhaustive list of the values of a given type
Instances For
enumerate all finite sets of a given type
Instances For
The enumeration merely adds an ordering, leaving the cardinality as is.
Any two enumerations of the same type have the same length.
A type indexable by Fin 0 is empty and vice versa.
Any enumeration of an empty type has length 0.
A type indexable by Fin n with positive n is inhabited and vice versa.
Any non-empty enumeration has more than one element.
No non-empty enumeration has 0 elements.
Any enumeration of a type with unique inhabitant has length 1.
An empty type has a trivial enumeration. Not registered as an instance, to make sure that there aren't two definitionally differing instances around.
Instances For
A type with unique inhabitant has a trivial enumeration. Not registered as an instance, to make sure that there aren't two definitionally differing instances around.
Instances For
enumerate all functions whose domain and range are finitely enumerable