]> matita.cs.unibo.it Git - helm.git/blob - matitaB/matita/nlibrary/sets/setoids2.ma
Keeping track of locations of disambiguated ids and symbols.
[helm.git] / matitaB / 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 record setoid2: Type[3] ≝
19  { carr2:> Type[2];
20    eq2: equivalence_relation2 carr2
21  }.
22
23 definition setoid2_of_setoid1: setoid1 → setoid2.
24  #s @(mk_setoid2 … (carr1 s)) 
25  @(mk_equivalence_relation2 … (carr1 s) (eq1 ?))
26  /2/
27 qed.
28
29 (*ncoercion setoid1_of_setoid : ∀s:setoid. setoid1 ≝ setoid1_of_setoid
30  on _s: setoid to setoid1.*)
31 (*prefer coercion Type_OF_setoid.*)
32
33 interpretation "setoid2 eq" 'eq t x y = (eq_rel2 ? (eq2 t) x y).
34 interpretation "setoid1 eq" 'eq t x y = (eq_rel1 ? (eq1 t) x y).
35 interpretation "setoid eq" 'eq t x y = (eq_rel ? (eq0 t) x y).
36
37 (*
38 notation > "hvbox(a break =_12 b)" non associative with precedence 45
39 for @{ eq_rel2 (carr2 (setoid2_of_setoid1 ?)) (eq2 (setoid2_of_setoid1 ?)) $a $b }.
40 *)
41 notation > "hvbox(a break =_0 b)" non associative with precedence 45
42 for @{ eq_rel ? (eq0 ?) $a $b }.
43 notation > "hvbox(a break =_1 b)" non associative with precedence 45
44 for @{ eq_rel1 ? (eq1 ?) $a $b }.
45 notation > "hvbox(a break =_2 b)" non associative with precedence 45
46 for @{ eq_rel2 ? (eq2 ?) $a $b }.
47
48 interpretation "setoid2 symmetry" 'invert r = (sym2 ???? r).
49 interpretation "setoid1 symmetry" 'invert r = (sym1 ???? r).
50 interpretation "setoid symmetry" 'invert r = (sym ???? r).
51 notation ".= r" with precedence 50 for @{'trans $r}.
52 interpretation "trans2" 'trans r = (trans2 ????? r).
53 interpretation "trans1" 'trans r = (trans1 ????? r).
54 interpretation "trans" 'trans r = (trans ????? r).
55
56 record unary_morphism2 (A,B: setoid2) : Type[2] ≝
57  { fun12:1> A → B;
58    prop12: ∀a,a'. eq2 ? a a' → eq2 ? (fun12 a) (fun12 a')
59  }.
60
61 record binary_morphism2 (A,B,C:setoid2) : Type[2] ≝
62  { fun22:2> A → B → C;
63    prop22: ∀a,a',b,b'. eq2 ? a a' → eq2 ? b b' → eq2 ? (fun22 a b) (fun22 a' b')
64  }.
65
66 interpretation "prop12" 'prop1 c = (prop12 ????? c).
67 interpretation "prop22" 'prop2 l r = (prop22 ???????? l r).
68 interpretation "refl2" 'refl = (refl2 ???).