Commit 8389dcbf authored by Johannes Kloos's avatar Johannes Kloos
Browse files

Provide a type class for infinite types.

Infinity is described by having an injection from nat.
parent 88c82d21
......@@ -1125,6 +1125,13 @@ Class FreshSpec A C `{ElemOf A C,
is_fresh (X : C) : fresh X X
(** The class [Infinite] axiomatizes types with infinitely many elements
by giving an injection from the natural numbers into the type. It is mostly
used to provide a generic [fresh] algorithm. *)
Class Infinite A :=
{ inject: nat A;
inject_injective:> Inj (=) (=) inject }.
(** * Miscellaneous *)
Class Half A := half: A A.
Hint Mode Half ! : typeclass_instances.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment