X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fnlibrary%2Fsets%2Fsetoids.ma;h=28761806f0a9bab4d7f4e34eb0f858678d5c3db1;hb=6678a28314d8878bb46d5de7b1060628f4930242;hp=ed2973d87af9170b0a910a747f42f64f343e8ce6;hpb=1dd64d6c49db7dc0dc0ee39c30da4c7a043b8bde;p=helm.git diff --git a/helm/software/matita/nlibrary/sets/setoids.ma b/helm/software/matita/nlibrary/sets/setoids.ma index ed2973d87..28761806f 100644 --- a/helm/software/matita/nlibrary/sets/setoids.ma +++ b/helm/software/matita/nlibrary/sets/setoids.ma @@ -15,63 +15,43 @@ include "logic/connectives.ma". include "properties/relations.ma". +(* +notation "hvbox(a break = \sub \ID b)" non associative with precedence 45 +for @{ 'eqID $a $b }. + +notation > "hvbox(a break =_\ID b)" non associative with precedence 45 +for @{ cic:/matita/logic/equality/eq.ind#xpointer(1/1) ? $a $b }. + +interpretation "ID eq" 'eqID x y = (cic:/matita/logic/equality/eq.ind#xpointer(1/1) ? x y). +*) + nrecord setoid : Type[1] ≝ - { carr:> Type; - eq: carr → carr → CProp; - refl: reflexive ? eq; - sym: symmetric ? eq; - trans: transitive ? eq + { carr:> Type[0]; + eq: equivalence_relation carr }. -ndefinition proofs: CProp → setoid. -#P; napply (mk_setoid ?????); -##[ napply P; -##| #x; #y; napply True; -##|##*: nwhd; nrepeat (#_); napply I; -##] -nqed. +interpretation "setoid eq" 'eq t x y = (eq_rel ? (eq t) x y). -nrecord function_space (A,B: setoid): Type ≝ - { f:1> A → B; - f_ok: ∀a,a':A. proofs (eq ? a a') → proofs (eq ? (f a) (f a')) - }. +notation > "hvbox(a break =_0 b)" non associative with precedence 45 +for @{ eq_rel ? (eq ?) $a $b }. -notation "hbox(a break ⇒ b)" right associative with precedence 20 for @{ 'Imply $a $b }. -(* -ndefinition function_space_setoid: setoid → setoid → setoid. - #A; #B; napply (mk_setoid ?????); -##[ napply (function_space A B); -##| #f; #f1; napply (∀a:A. proofs (eq ? (f a) (f1 a))); -##| nwhd; #x; #a; - napply (f_ok ? ? x ? ? ?); (* QUI!! *) - unfold carr; unfold proofs; simplify; - apply (refl A) - | simplify; - intros; - unfold carr; unfold proofs; simplify; - apply (sym B); - apply (f a) - | simplify; - intros; - unfold carr; unfold proofs; simplify; - apply (trans B ? (y a)); - [ apply (f a) - | apply (f1 a)]] -qed. +interpretation "setoid symmetry" 'invert r = (sym ???? r). +notation ".= r" with precedence 50 for @{'trans $r}. +interpretation "trans" 'trans r = (trans ????? r). -nrecord isomorphism (A,B: setoid): Type ≝ - { map1:> function_space_setoid A B; - map2:> function_space_setoid B A; - inv1: ∀a:A. proofs (eq ? (map2 (map1 a)) a); - inv2: ∀b:B. proofs (eq ? (map1 (map2 b)) b) +nrecord unary_morphism (A,B: setoid) : Type[0] ≝ + { fun1:1> A → B; + prop1: ∀a,a'. eq ? a a' → eq ? (fun1 a) (fun1 a') }. -interpretation "isomorphism" 'iff x y = (isomorphism x y). +nrecord binary_morphism (A,B,C:setoid) : Type[0] ≝ + { fun2:2> A → B → C; + prop2: ∀a,a',b,b'. eq ? a a' → eq ? b b' → eq ? (fun2 a b) (fun2 a' b') + }. -(* -record dependent_product (A:setoid) (B: A ⇒ setoids): Type ≝ - { dp:> ∀a:A.carr (B a); - dp_ok: ∀a,a':A. ∀p:proofs1 (eq1 ? a a'). proofs1 (eq1 ? (dp a) (map2 ?? (f1_ok ?? B ?? p) (dp a'))) - }.*) - - *) \ No newline at end of file +notation "† c" with precedence 90 for @{'prop1 $c }. +notation "l ‡ r" with precedence 90 for @{'prop2 $l $r }. +notation "#" with precedence 90 for @{'refl}. +interpretation "prop1" 'prop1 c = (prop1 ????? c). +interpretation "prop2" 'prop2 l r = (prop2 ???????? l r). +interpretation "refl" 'refl = (refl ???).