(* A homotopy proposition is a type that has at most one element.
   Its unique inhabitant, when it exists, is to be interpreted as the
   proof of the homotopy proposition.
   Homotopy propositions are therefore an alternative to the sort Prop,
   to select which types represent mathematical propositions. *)
Definition IsHProp (P : Type) : Prop
  := forall p q : P, p = q.(* A homotopy set is a type such as each equality type x = y is a
   homotopy proposition. For example, any type which equality is
   decidable in sort Prop is a homotopy set, as shown in file
   Stdlib.Logic.Eqdep_dec.v. *)
Definition IsHSet (X : Type) : Prop
  := forall (x y : X) (p q : x = y), p = q.Definition IsHOneType (X : Type) : Prop
  := forall (x y : X) (p q : x = y) (r s : p = q), r = s.

(* Specifications: *)
Lemma forall_hprop : forall (A : Type) (P : A -> Prop), (forall x:A, IsHProp (P x)) -> IsHProp (forall x:A, P x).
Lemma and_hprop : forall P Q : Prop, IsHProp P -> IsHProp Q -> IsHProp (P /\ Q).
Lemma impl_hprop : forall P Q : Prop, IsHProp Q -> IsHProp (P -> Q).
Lemma false_hprop : IsHProp False.
Lemma true_hprop : IsHProp True.
Lemma not_hprop : forall P : Type, IsHProp (P -> False).
Lemma hset_hprop : forall X : Type, IsHProp X -> IsHSet X.
Lemma eq_trans_cancel : forall {X : Type} {x y z : X} (p : x = y) (q r : y = z), (eq_trans p q = eq_trans p r) -> q = r.
Lemma hset_hOneType : forall X : Type, IsHSet X -> IsHOneType X.
Lemma hprop_hprop : forall X : Type, IsHProp (IsHProp X).
Lemma hprop_hset : forall X : Type, IsHProp (IsHSet X).