Module docstring
{"# Types with a unique term
In this file we define a typeclass Unique,
which expresses that a type has a unique term.
In other words, a type that is Inhabited and a Subsingleton.
Main declaration
Unique: a typeclass that expresses that a type has a unique term.
Main statements
Unique.mk': an inhabited subsingleton type isUnique. This can not be an instance because it would lead to loops in typeclass inference.Function.Surjective.unique: if the domain of a surjective function isUnique, then its codomain isUniqueas well.Function.Injective.subsingleton: if the codomain of an injective function isSubsingleton, then its domain isSubsingletonas well.Function.Injective.unique: if the codomain of an injective function isSubsingletonand its domain isInhabited, then its domain isUnique.
Implementation details
The typeclass Unique α is implemented as a type,
rather than a Prop-valued predicate,
for good definitional properties of the default term.
"}