Definition diagram := forall x x' y, RX x x' -> R x y -> exists2 y', RY y y' & R' x' y'.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).

(* Specifications: *)
Theorem diagram_incl: diagram RX R' RY S'.
Theorem diagram_reverse: diagram R RX R' RY.
Theorem diagram_comp: diagram RX (comp R1 R2) RZ (comp S1 S2).
Theorem diagram_union: diagram RX (union R) RY S.
Theorem diagram_star: diagram RX (star R) RX (star S).
Theorem diagram_plus: diagram RX (plus R) RX (plus S).
Lemma diagram_plus_wf: diagram (star TX) (plus S) (star TX) (plus S).
Lemma diagram_plus_wf_1: strong_commute (comp (star TX) TX') (plus S).
Theorem diagram_plus_wf_2: diagram (comp (star TX) TX') (comp (star S) R) (comp (star TY) TY') (comp (star S) R').
Lemma diagram_star_wf_1: diagram (star TX) SR (star TY) SR.
Theorem diagram_star_wf_2: diagram TAX SR TAY SR'.
Lemma diagram_star_wf: commute TX S.