]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/sets/setoids2.ma
Preparing for 0.5.9 release.
[helm.git] / helm / software / matita / nlibrary / sets / setoids2.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "properties/relations2.ma".
16 include "sets/setoids1.ma".
17
18 nrecord setoid2: Type[3] ≝
19  { carr2:> Type[2];
20    eq2: equivalence_relation2 carr2
21  }.
22
23 ndefinition setoid2_of_setoid1: setoid1 → setoid2.
24  #s; @ (carr1 s); @ (carr1 s) (eq1 ?)
25   [ napply refl1
26   | napply sym1
27   | napply trans1]
28 nqed.
29
30 (*ncoercion setoid1_of_setoid : ∀s:setoid. setoid1 ≝ setoid1_of_setoid
31  on _s: setoid to setoid1.*)
32 (*prefer coercion Type_OF_setoid.*)
33
34 interpretation "setoid2 eq" 'eq t x y = (eq_rel2 ? (eq2 t) x y).
35 interpretation "setoid1 eq" 'eq t x y = (eq_rel1 ? (eq1 t) x y).
36 interpretation "setoid eq" 'eq t x y = (eq_rel ? (eq t) x y).
37
38 (*
39 notation > "hvbox(a break =_12 b)" non associative with precedence 45
40 for @{ eq_rel2 (carr2 (setoid2_of_setoid1 ?)) (eq2 (setoid2_of_setoid1 ?)) $a $b }.
41 *)
42 notation > "hvbox(a break =_0 b)" non associative with precedence 45
43 for @{ eq_rel ? (eq0 ?) $a $b }.
44 notation > "hvbox(a break =_1 b)" non associative with precedence 45
45 for @{ eq_rel1 ? (eq1 ?) $a $b }.
46 notation > "hvbox(a break =_2 b)" non associative with precedence 45
47 for @{ eq_rel2 ? (eq2 ?) $a $b }.
48
49 interpretation "setoid2 symmetry" 'invert r = (sym2 ???? r).
50 interpretation "setoid1 symmetry" 'invert r = (sym1 ???? r).
51 interpretation "setoid symmetry" 'invert r = (sym ???? r).
52 notation ".= r" with precedence 50 for @{'trans $r}.
53 interpretation "trans2" 'trans r = (trans2 ????? r).
54 interpretation "trans1" 'trans r = (trans1 ????? r).
55 interpretation "trans" 'trans r = (trans ????? r).
56
57 nrecord unary_morphism2 (A,B: setoid2) : Type[2] ≝
58  { fun12:1> A → B;
59    prop12: ∀a,a'. eq2 ? a a' → eq2 ? (fun12 a) (fun12 a')
60  }.
61
62 nrecord binary_morphism2 (A,B,C:setoid2) : Type[2] ≝
63  { fun22:2> A → B → C;
64    prop22: ∀a,a',b,b'. eq2 ? a a' → eq2 ? b b' → eq2 ? (fun22 a b) (fun22 a' b')
65  }.
66
67 interpretation "prop12" 'prop1 c = (prop12 ????? c).
68 interpretation "prop22" 'prop2 l r = (prop22 ???????? l r).
69 interpretation "refl2" 'refl = (refl2 ???).