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
Equations
Instances For
create an exhaustive list of the values of a given type
Equations
Instances For
create a FinEnum instance using a surjection
Equations
Instances For
create a FinEnum instance using an injection
Equations
Instances For
Equations
Equations
Equations
Equations
enumerate all finite sets of a given type
Equations
Instances For
Equations
Equations
Equations
Equations
Equations
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.
Any enumeration of a type with unique inhabitant has length 1.
Equations
An empty type has a trivial enumeration. Not registered as an instance, to make sure that there aren't two definitionally differing instances around.
Equations
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.