(** ** The bottom and top relations *)

Definition rel_bot {A B}: rel A B :=
  fun x y => False.Notation "⊥" := rel_bot : rel_scope.Definition rel_top {A B}: rel A B :=
  fun x y => True.Notation "⊤" := rel_top : rel_scope.(** ** Relation equivalence *)

Definition eqrel {A B}: rel (rel A B) (rel A B) :=
  (subrel /\ flip subrel)%rel.Global Instance eqrel_equivalence A B:
  Equivalence (@eqrel A B).Global Instance eqrel_subrel A B:
  Related (@eqrel A B) (@subrel A B) subrel.(** ** Relation composition *)

Definition rel_compose {A B C} (RAB: rel A B) (RBC: rel B C): rel A C :=
  fun x z => exists y, RAB x y /\ RBC y z.Global Instance rel_compose_params:
  Params (@rel_compose) 4.

Lemma rel_compose_id_right {A B} (R: rel A B): eqrel (rel_compose eq R) R.