Class Irreflexive (R : crelation A) :=
    irreflexivity : Reflexive (complement R).Class Irreflexive (R : crelation A) :=
    irreflexivity : Reflexive (complement R).Class Symmetric (R : crelation A) :=
    symmetry : forall {x y}, R x y -> R y x.Class Symmetric (R : crelation A) :=
    symmetry : forall {x y}, R x y -> R y x.Class Asymmetric (R : crelation A) :=
    asymmetry : forall {x y}, R x y -> (complement R y x : Type).Class Asymmetric (R : crelation A) :=
    asymmetry : forall {x y}, R x y -> (complement R y x : Type).Class Transitive (R : crelation A) :=
    transitivity : forall {x y z}, R x y -> R y z -> R x z.Class Transitive (R : crelation A) :=
    transitivity : forall {x y z}, R x y -> R y z -> R x z.(** Various combinations of reflexivity, symmetry and transitivity. *)
  
  (** A [PreOrder] is both Reflexive and Transitive. *)

  Class PreOrder (R : crelation A)  := {
    #[global] PreOrder_Reflexive :: Reflexive R | 2 ;
    #[global] PreOrder_Transitive :: Transitive R | 2 }.(** Various combinations of reflexivity, symmetry and transitivity. *)
  
  (** A [PreOrder] is both Reflexive and Transitive. *)

  Class PreOrder (R : crelation A)  := {
    #[global] PreOrder_Reflexive :: Reflexive R | 2 ;
    #[global] PreOrder_Transitive :: Transitive R | 2 }.(** Various combinations of reflexivity, symmetry and transitivity. *)
  
  (** A [PreOrder] is both Reflexive and Transitive. *)

  Class PreOrder (R : crelation A)  := {
    #[global] PreOrder_Reflexive :: Reflexive R | 2 ;
    #[global] PreOrder_Transitive :: Transitive R | 2 }.(** A [StrictOrder] is both Irreflexive and Transitive. *)

  Class StrictOrder (R : crelation A)  := {
    #[global] StrictOrder_Irreflexive :: Irreflexive R ;
    #[global] StrictOrder_Transitive :: Transitive R }.(** A [StrictOrder] is both Irreflexive and Transitive. *)

  Class StrictOrder (R : crelation A)  := {
    #[global] StrictOrder_Irreflexive :: Irreflexive R ;
    #[global] StrictOrder_Transitive :: Transitive R }.(** A [StrictOrder] is both Irreflexive and Transitive. *)

  Class StrictOrder (R : crelation A)  := {
    #[global] StrictOrder_Irreflexive :: Irreflexive R ;
    #[global] StrictOrder_Transitive :: Transitive R }.(** By definition, a strict order is also asymmetric *)
  Global Instance StrictOrder_Asymmetric `(StrictOrder R) : Asymmetric R.(** A partial equivalence crelation is Symmetric and Transitive. *)
  
  Class PER (R : crelation A)  := {
    #[global] PER_Symmetric :: Symmetric R | 3 ;
    #[global] PER_Transitive :: Transitive R | 3 }.(** A partial equivalence crelation is Symmetric and Transitive. *)
  
  Class PER (R : crelation A)  := {
    #[global] PER_Symmetric :: Symmetric R | 3 ;
    #[global] PER_Transitive :: Transitive R | 3 }.(** A partial equivalence crelation is Symmetric and Transitive. *)
  
  Class PER (R : crelation A)  := {
    #[global] PER_Symmetric :: Symmetric R | 3 ;
    #[global] PER_Transitive :: Transitive R | 3 }.(** Equivalence crelations. *)

  Class Equivalence (R : crelation A)  := {
    #[global] Equivalence_Reflexive :: Reflexive R ;
    #[global] Equivalence_Symmetric :: Symmetric R ;
    #[global] Equivalence_Transitive :: Transitive R }.(** Equivalence crelations. *)

  Class Equivalence (R : crelation A)  := {
    #[global] Equivalence_Reflexive :: Reflexive R ;
    #[global] Equivalence_Symmetric :: Symmetric R ;
    #[global] Equivalence_Transitive :: Transitive R }.(** Equivalence crelations. *)

  Class Equivalence (R : crelation A)  := {
    #[global] Equivalence_Reflexive :: Reflexive R ;
    #[global] Equivalence_Symmetric :: Symmetric R ;
    #[global] Equivalence_Transitive :: Transitive R }.(** Equivalence crelations. *)

  Class Equivalence (R : crelation A)  := {
    #[global] Equivalence_Reflexive :: Reflexive R ;
    #[global] Equivalence_Symmetric :: Symmetric R ;
    #[global] Equivalence_Transitive :: Transitive R }.(** An Equivalence is a PER plus reflexivity. *)
  
  Global Instance Equivalence_PER {R} `(Equivalence R) : PER R | 10 :=
    { PER_Symmetric := Equivalence_Symmetric ;
      PER_Transitive := Equivalence_Transitive }.(** We can now define antisymmetry w.r.t. an equivalence crelation on the carrier. *)
  
  Class Antisymmetric eqA `{equ : Equivalence eqA} (R : crelation A) :=
    antisymmetry : forall {x y}, R x y -> R y x -> eqA x y.(** We can now define antisymmetry w.r.t. an equivalence crelation on the carrier. *)
  
  Class Antisymmetric eqA `{equ : Equivalence eqA} (R : crelation A) :=
    antisymmetry : forall {x y}, R x y -> R y x -> eqA x y.Class subrelation (R R' : crelation A) :=
    is_subrelation : forall {x y}, R x y -> R' x y.Class subrelation (R R' : crelation A) :=
    is_subrelation : forall {x y}, R x y -> R' x y.

(* Specifications: *)
Lemma subrelation_symmetric R `(Symmetric R) : subrelation (flip R) R.
Lemma flip_Reflexive `{Reflexive R} : Reflexive (flip R).