(* Morphism property for unary and binary functions *)
Definition morphism_1 aF rF := forall x, f (aF x) = rF (f x).Definition morphism_2 aOp rOp := forall x y, f (aOp x y) = rOp (f x) (f y).(* Homomorphism property for unary and binary relations *)
Definition homomorphism_1 (aP rP : _ -> Prop) := forall x, aP x -> rP (f x).Definition homomorphism_2 (aR rR : _ -> _ -> Prop) :=
  forall x y, aR x y -> rR (f x) (f y).(* Stability property for unary and binary relations *)
Definition monomorphism_1 (aP rP : _ -> sT) := forall x, rP (f x) = aP x.Definition monomorphism_2 (aR rR : _ -> _ -> sT) :=
  forall x y, rR (f x) (f y) = aR x y.Notation "{ 'mono' f : x y /~ a }" :=
  (monomorphism_2 f (fun y x => a) (fun x y => a))
  (at level 0, f at level 99, x ident, y ident,
   format "{ 'mono'  f  :  x  y  /~  a }") : type_scope.Definition injective := forall x1 x2, f x1 = f x2 -> x1 = x2.Definition cancel g := forall x, g (f x) = x.Definition pcancel g := forall x, g (f x) = Some x.Definition ocancel (g : aT -> option rT) h := forall x, oapp h x (g x) = x.

Lemma eq_can f' g' : cancel f f' -> f =1 g -> f' =1 g' -> cancel g g'.