(** ** Intersection of relations *)

Definition rel_inter {A B} (R1 R2: rel A B): rel A B :=
  fun x y => R1 x y /\ R2 x y.Infix "/\" := rel_inter : rel_scope.Global Instance rel_inter_params:
  Params (@rel_inter) 4.

(* Specifications: *)
Lemma rel_inter_rexists {A B} (R1 R2: rel A B) x y: RExists (R1 x y /\ R2 x y) (R1 /\ R2) x y.
Lemma rel_inter_subrel_rexists_l {A B} (R1 R2 R: rel A B): RExists (subrel R1 R) subrel (R1 /\ R2)%rel R.
Lemma rel_inter_subrel_rexists_r {A B} (R1 R2 R: rel A B): RExists (subrel R2 R) subrel (R1 /\ R2)%rel R.
Lemma rel_inter_glb {A B} (R R1 R2: rel A B): RIntro (subrel R R1 /\ subrel R R2) subrel R (R1 /\ R2)%rel.
Lemma rel_inter_refl {A} (R1 R2: rel A A): Reflexive R1 -> Reflexive R2 -> Reflexive (R1 /\ R2).
Lemma rel_inter_corefl_l {A} (R1 R2: rel A A): Coreflexive R1 -> Coreflexive (R1 /\ R2).
Lemma rel_inter_corefl_r {A} (R1 R2: rel A A): Coreflexive R2 -> Coreflexive (R1 /\ R2).
Lemma rel_inter_trans {A} (R1 R2: rel A A): Transitive R1 -> Transitive R2 -> Transitive (R1 /\ R2).
Lemma rel_inter_sym {A} (R1 R2: rel A A): Symmetric R1 -> Symmetric R2 -> Symmetric (R1 /\ R2).