include "sets/setoids.ma".
include "hints_declaration.ma".
-nrecord setoid1: Type[2] ≝ {
+record setoid1: Type[2] ≝ {
carr1:> Type[1];
eq1: equivalence_relation1 carr1
}.
interpretation "mk_setoid1" 'mk_setoid1 x = (mk_setoid1 x ?).
(* da capire se mettere come coercion *)
-ndefinition setoid1_of_setoid: setoid → setoid1.
- #s; @ (carr s); @ (eq0…) (refl…) (sym…) (trans…);
-nqed.
+definition setoid1_of_setoid: setoid → setoid1.
+ #s % [@(carr s)] % [@(eq0…)|@(refl…)|@(sym…)|@(trans…)]
+qed.
alias symbol "hint_decl" = "hint_decl_CProp2".
alias symbol "hint_decl" (instance 1) = "hint_decl_Type2".
interpretation "trans" 'trans r = (trans ????? r).
interpretation "trans1_x1" 'trans_x1 r = (trans1 ????? r).
-nrecord unary_morphism1 (A,B: setoid1) : Type[1] ≝ {
+record unary_morphism1 (A,B: setoid1) : Type[1] ≝ {
fun11:1> A → B;
prop11: ∀a,a'. eq1 ? a a' → eq1 ? (fun11 a) (fun11 a')
}.
interpretation "prop11_x1" 'prop1_x1 c = (prop11 ????? c).
interpretation "refl1" 'refl = (refl1 ???).
-ndefinition unary_morphism1_setoid1: setoid1 → setoid1 → setoid1.
- #s; #s1; @ (s ⇒_1 s1); @
- [ #f; #g; napply (∀a,a':s. a=a' → f a = g a')
- | #x; #a; #a'; #Ha; napply (.= †Ha); napply refl1
- | #x; #y; #H; #a; #a'; #Ha; napply (.= †Ha); napply sym1; /2/
- | #x; #y; #z; #H1; #H2; #a; #a'; #Ha; napply (.= †Ha); napply trans1; ##[##2: napply H1 | ##skip | napply H2]//;##]
-nqed.
+definition unary_morphism1_setoid1: setoid1 → setoid1 → setoid1.
+ #s #s1 % [@(s ⇒_1 s1)] %
+ [ #f #g @(∀a,a':s. a=a' → f a = g a')
+ | #x #a #a' #Ha @(.= †Ha) @refl1
+ | #x #y #H #a #a' #Ha @(.= †Ha) @sym1 /2/
+ | #x #y #z #H1 #H2 #a #a' #Ha @(.= †Ha) @trans1
+ [2: @H1 | skip | @H2] // ]
+qed.
unification hint 0 ≔ S, T ;
R ≟ (unary_morphism1_setoid1 S T)
interpretation "prop21" 'prop2 l r = (prop11 ? (unary_morphism1_setoid1 ??) ? ?? l ?? r).
interpretation "prop21_x1" 'prop2_x1 l r = (prop11 ? (unary_morphism1_setoid1 ??) ? ?? l ?? r).
-nlemma unary_morph1_eq1: ∀A,B.∀f,g: A ⇒_1 B. (∀x. f x = g x) → f = g.
-/3/. nqed.
+lemma unary_morph1_eq1: ∀A,B.∀f,g: A ⇒_1 B. (∀x. f x = g x) → f = g.
+/3/
+qed.
-nlemma mk_binary_morphism1:
+(* DISAMBIGUATION XXX: this takes some time to disambiguate *)
+lemma mk_binary_morphism1:
∀A,B,C: setoid1. ∀f: A → B → C. (∀a,a',b,b'. a=a' → b=b' → f a b = f a' b') →
A ⇒_1 (unary_morphism1_setoid1 B C).
- #A; #B; #C; #f; #H; @ [ #x; @ (f x) ] #a; #a'; #Ha [##2: napply unary_morph1_eq1; #y]
- /2/.
-nqed.
+ #A #B #C #f #H % [ #x % [@(f x)]] #a #a' #Ha [2: @unary_morph1_eq1 #y]
+ /2/
+qed.
-ndefinition composition1 ≝
+definition composition1 ≝
λo1,o2,o3:Type[1].λf:o2 → o3.λg: o1 → o2.λx.f (g x).
interpretation "function composition" 'compose f g = (composition ??? f g).
interpretation "function composition1" 'compose f g = (composition1 ??? f g).
-ndefinition comp1_unary_morphisms:
+definition comp1_unary_morphisms:
∀o1,o2,o3:setoid1.o2 ⇒_1 o3 → o1 ⇒_1 o2 → o1 ⇒_1 o3.
-#o1; #o2; #o3; #f; #g; @ (f ∘ g);
- #a; #a'; #e; nnormalize; napply (.= †(†e)); napply #.
-nqed.
+#o1 #o2 #o3 #f #g % [@ (f ∘ g)]
+ #a #a' #e normalize @(.= †(†e)) @#
+qed.
unification hint 0 ≔ o1,o2,o3:setoid1,f:o2 ⇒_1 o3,g:o1 ⇒_1 o2;
R ≟ (mk_unary_morphism1 ?? (composition1 ??? (fun11 ?? f) (fun11 ?? g))
(* -------------------------------------------------------------------- *) ⊢
fun11 o1 o3 R ≡ composition1 ??? (fun11 ?? f) (fun11 ?? g).
-ndefinition comp1_binary_morphisms:
+definition comp1_binary_morphisms:
∀o1,o2,o3. (o2 ⇒_1 o3) ⇒_1 ((o1 ⇒_1 o2) ⇒_1 (o1 ⇒_1 o3)).
-#o1; #o2; #o3; napply mk_binary_morphism1
- [ #f; #g; napply (comp1_unary_morphisms … f g)
- | #a; #a'; #b; #b'; #ea; #eb; #x; #x'; #Hx; nnormalize; /3/ ]
-nqed.
+#o1 #o2 #o3 @mk_binary_morphism1
+ [ #f #g @(comp1_unary_morphisms … f g)
+ | #a #a' #b #b' #ea #eb #x #x' #Hx normalize /3/ ]
+qed.