(** * Results about commutation diagrams *)
Require Export Relations.
Set Implicit Arguments.
(** Definitions *)
Section Def1.
Variables X X' Y Y': Type.
Variable RX: relation2 X X'.
Variable R:  relation2 X Y.
Variable RY: relation2 Y Y'.
Variable R': relation2 X' Y'.
Definition diagram := forall x x' y, RX x x' -> R x y -> exists2 y', RY y y' & R' x' y'.
End Def1.
Section Def2.
Variable X: Type.
Variables R S: relation X.
Definition strong_commute := diagram R S R S.
Definition local_commute  := diagram R S (star R) (star S).
Definition semi_commute   := diagram R S (star R) S.
Definition commute        := diagram (star R) (star S) (star R) (star S).
Definition confluent      := diagram (star R) (star R) (star R) (star R).
End Def2.
(** Variance w.r.t inclusion *)
Section Incl.
Variables X X' Y Y': Type.
Variable RX: relation2 X X'.
Variable R R':  relation2 X Y.
Variable RY: relation2 Y Y'.
Variables S S': relation2 X' Y'.
Hypothesis H: diagram RX R RY S.
Hypothesis HR: forall x y, R' x y -> R x y.
Hypothesis HS: forall x y, S x y -> S' x y.

Theorem diagram_incl: diagram RX R' RY S'.
End Incl.