(* *)
(* construire un ope'rateur de composition a` partir d'une fonction de composition *)
Section composition_to_operator.
Variables (A : Type) (H : A -> A -> Setoid)
(Cfun : forall a b c : A, H a b -> H b c -> H a c).
Definition Congl_law :=
forall (a b c : A) (f g : H b c) (h : H a b),
f =_S g -> Cfun h f =_S Cfun h g.
Definition Congr_law :=
forall (a b c : A) (f g : H a b) (h : H b c),
f =_S g -> Cfun f h =_S Cfun g h.
Definition Cong_law :=
forall (a b c : A) (f f' : H a b) (g g' : H b c),
f =_S f' -> g =_S g' -> Cfun f g =_S Cfun f' g'.
Hypothesis pcgl : Congl_law.
Hypothesis pcgr : Congr_law.
Variable a b c : A.
Definition Build_Comp :=
Build_Map2 (pcgl (a:=a) (b:=b) (c:=c)) (pcgr (a:=a) (b:=b) (c:=c)).
End composition_to_operator.
(*** rewrite rules ***)
Section cat_cong.
Variable C : Category.

Lemma Comp_r :
forall (a b c : C) (f g : a --> b) (h : b --> c), f =_S g -> f o h =_S g o h.