Class Irreflexive (R : relation A) :=
    irreflexivity : Reflexive (complement R).Class Irreflexive (R : relation A) :=
    irreflexivity : Reflexive (complement R).Class Symmetric (R : relation A) :=
    symmetry : forall {x y}, R x y -> R y x.Class Symmetric (R : relation A) :=
    symmetry : forall {x y}, R x y -> R y x.Class Asymmetric (R : relation A) :=
    asymmetry : forall {x y}, R x y -> R y x -> False.Class Asymmetric (R : relation A) :=
    asymmetry : forall {x y}, R x y -> R y x -> False.Class Transitive (R : relation A) :=
    transitivity : forall {x y z}, R x y -> R y z -> R x z.Class Transitive (R : relation 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 : relation A) : Prop := {
    #[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 : relation A) : Prop := {
    #[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 : relation A) : Prop := {
    #[global] PreOrder_Reflexive :: Reflexive R | 2 ;
    #[global] PreOrder_Transitive :: Transitive R | 2 }.(** A [StrictOrder] is both Irreflexive and Transitive. *)

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

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

  Class StrictOrder (R : relation A) : Prop := {
    #[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 relation is Symmetric and Transitive. *)
  
  Class PER (R : relation A) : Prop := {
    #[global] PER_Symmetric :: Symmetric R | 3 ;
    #[global] PER_Transitive :: Transitive R | 3 }.(** A partial equivalence relation is Symmetric and Transitive. *)
  
  Class PER (R : relation A) : Prop := {
    #[global] PER_Symmetric :: Symmetric R | 3 ;
    #[global] PER_Transitive :: Transitive R | 3 }.(** A partial equivalence relation is Symmetric and Transitive. *)
  
  Class PER (R : relation A) : Prop := {
    #[global] PER_Symmetric :: Symmetric R | 3 ;
    #[global] PER_Transitive :: Transitive R | 3 }.(** Equivalence relations. *)

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

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

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

  Class Equivalence (R : relation A) : Prop := {
    #[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} `(E:Equivalence R) : PER R | 10 :=
    { }.(** An Equivalence is a PreOrder plus symmetry. *)

  Global Instance Equivalence_PreOrder {R} `(E:Equivalence R) : PreOrder R | 10 :=
    { }.(** We can now define antisymmetry w.r.t. an equivalence relation on the carrier. *)
  
  Class Antisymmetric eqA `{equ : Equivalence eqA} (R : relation A) :=
    antisymmetry : forall {x y}, R x y -> R y x -> eqA x y.(** We can now define antisymmetry w.r.t. an equivalence relation on the carrier. *)
  
  Class Antisymmetric eqA `{equ : Equivalence eqA} (R : relation A) :=
    antisymmetry : forall {x y}, R x y -> R y x -> eqA x y.Class subrelation (R R' : relation A) : Prop :=
    is_subrelation : forall {x y}, R x y -> R' x y.Class subrelation (R R' : relation A) : Prop :=
    is_subrelation : forall {x y}, R x y -> R' x y.

Lemma subrelation_symmetric R `(Symmetric R) : subrelation (flip R) R.