+notation "┼_0 c" with precedence 89 for @{'prop1_x0 $c }.
+notation "l ╪_0 r" with precedence 89 for @{'prop2_x0 $l $r }.
+interpretation "prop1_x0" 'prop1_x0 c = (prop1 ????? c).
+
+ndefinition unary_morph_setoid : setoid → setoid → setoid.
+#S1; #S2; @ (S1 ⇒_0 S2); @;
+##[ #f; #g; napply (∀x,x'. x=x' → f x = g x');
+##| #f; #x; #x'; #Hx; napply (.= †Hx); napply #;
+##| #f; #g; #H; #x; #x'; #Hx; napply ((H … Hx^-1)^-1);
+##| #f; #g; #h; #H1; #H2; #x; #x'; #Hx; napply (trans … (H1 …) (H2 …)); //; ##]
+nqed.
+
+alias symbol "hint_decl" (instance 1) = "hint_decl_Type1".
+unification hint 0 ≔ o1,o2 ;
+ X ≟ unary_morph_setoid o1 o2
+ (* ----------------------------- *) ⊢
+ carr X ≡ o1 ⇒_0 o2.
+
+interpretation "prop2" 'prop2 l r = (prop1 ? (unary_morph_setoid ??) ? ?? l ?? r).
+interpretation "prop2_x0" 'prop2_x0 l r = (prop1 ? (unary_morph_setoid ??) ? ?? l ?? r).
+
+nlemma unary_morph_eq: ∀A,B.∀f,g:A ⇒_0 B. (∀x. f x = g x) → f = g.
+#A B f g H x1 x2 E; napply (.= †E); napply H; nqed.
+
+nlemma mk_binary_morphism:
+ ∀A,B,C: setoid. ∀f: A → B → C. (∀a,a',b,b'. a=a' → b=b' → f a b = f a' b') →
+ A ⇒_0 (unary_morph_setoid B C).
+ #A; #B; #C; #f; #H; @; ##[ #x; @ (f x) ] #a; #a'; #Ha [##2: napply unary_morph_eq; #y]
+ /2/.
+nqed.
+
+ndefinition composition ≝
+ λo1,o2,o3:Type[0].λf:o2 → o3.λg: o1 → o2.λx.f (g x).
+
+interpretation "function composition" 'compose f g = (composition ??? f g).
+
+ndefinition comp_unary_morphisms:
+ ∀o1,o2,o3:setoid.o2 ⇒_0 o3 → o1 ⇒_0 o2 → o1 ⇒_0 o3.
+#o1; #o2; #o3; #f; #g; @ (f ∘ g);
+ #a; #a'; #e; nnormalize; napply (.= †(†e)); napply #.
+nqed.
+
+unification hint 0 ≔ o1,o2,o3:setoid,f:o2 ⇒_0 o3,g:o1 ⇒_0 o2;
+ R ≟ mk_unary_morphism ?? (composition ??? f g)
+ (prop1 ?? (comp_unary_morphisms o1 o2 o3 f g))
+ (* -------------------------------------------------------------------- *) ⊢
+ fun1 ?? R ≡ (composition ??? f g).
+
+ndefinition comp_binary_morphisms:
+ ∀o1,o2,o3.(o2 ⇒_0 o3) ⇒_0 ((o1 ⇒_0 o2) ⇒_0 (o1 ⇒_0 o3)).
+#o1; #o2; #o3; napply mk_binary_morphism
+ [ #f; #g; napply (comp_unary_morphisms ??? f g)
+ (* CSC: why not ∘?
+ GARES: because the coercion to FunClass is not triggered if there
+ are no "extra" arguments. We could fix that in the refiner
+ *)
+ | #a; #a'; #b; #b'; #ea; #eb; #x; #x'; #Hx; nnormalize; /3/ ]
+nqed.