]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/nlibrary/sets/setoids1.ma
Release 0.5.9.
[helm.git] / helm / software / matita / nlibrary / sets / setoids1.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/relations1.ma".
16 include "sets/setoids.ma".
17
18 nrecord setoid1: Type[2] ≝
19  { carr1:> Type[1];
20    eq1: equivalence_relation1 carr1
21  }.
22
23 ndefinition setoid1_of_setoid: setoid → setoid1.
24  #s; napply mk_setoid1
25   [ napply (carr s)
26   | napply (mk_equivalence_relation1 s)
27     [ napply eq
28     | napply refl
29     | napply sym
30     | napply trans]##]
31 nqed.
32
33 (*ncoercion setoid1_of_setoid : ∀s:setoid. setoid1 ≝ setoid1_of_setoid
34  on _s: setoid to setoid1.*)
35 (*prefer coercion Type_OF_setoid.*)
36
37 interpretation "setoid1 eq" 'eq t x y = (eq_rel1 ? (eq1 t) x y).
38 interpretation "setoid eq" 'eq t x y = (eq_rel ? (eq t) x y).
39
40 notation > "hvbox(a break =_12 b)" non associative with precedence 45
41 for @{ eq_rel2 (carr2 (setoid2_of_setoid1 ?)) (eq2 (setoid2_of_setoid1 ?)) $a $b }.
42 notation > "hvbox(a break =_0 b)" non associative with precedence 45
43 for @{ eq_rel ? (eq ?) $a $b }.
44 notation > "hvbox(a break =_1 b)" non associative with precedence 45
45 for @{ eq_rel1 ? (eq1 ?) $a $b }.
46
47 interpretation "setoid1 symmetry" 'invert r = (sym1 ???? r).
48 interpretation "setoid symmetry" 'invert r = (sym ???? r).
49 notation ".= r" with precedence 50 for @{'trans $r}.
50 interpretation "trans1" 'trans r = (trans1 ????? r).
51 interpretation "trans" 'trans r = (trans ????? r).
52
53 nrecord unary_morphism1 (A,B: setoid1) : Type[1] ≝
54  { fun11:1> A → B;
55    prop11: ∀a,a'. eq1 ? a a' → eq1 ? (fun11 a) (fun11 a')
56  }.
57
58 nrecord binary_morphism1 (A,B,C:setoid1) : Type[1] ≝
59  { fun21:2> A → B → C;
60    prop21: ∀a,a',b,b'. eq1 ? a a' → eq1 ? b b' → eq1 ? (fun21 a b) (fun21 a' b')
61  }.
62
63 interpretation "prop11" 'prop1 c = (prop11 ????? c).
64 interpretation "prop21" 'prop2 l r = (prop21 ???????? l r).
65 interpretation "refl1" 'refl = (refl1 ???).