]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/formal_topology/overlap/categories.ma
some notation for map_arrows2
[helm.git] / helm / software / matita / contribs / formal_topology / overlap / categories.ma
index af58968fc14043110c6d220d3858fe2effc0e435..65320ae53efe492e1a29e9202076d1d1b6eb7c4e 100644 (file)
 
 include "cprop_connectives.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).
+
 record equivalence_relation (A:Type0) : Type1 ≝
  { eq_rel:2> A → A → CProp0;
    refl: reflexive ? eq_rel;
@@ -80,7 +88,7 @@ qed.
 coercion setoid2_of_setoid1.
 prefer coercion Type_OF_setoid2. 
 prefer coercion Type_OF_setoid. 
-prefer coercion Type_OF_setoid1. 
+prefer coercion Type_OF_setoid1.
 (* we prefer 0 < 1 < 2 *)
 
 record equivalence_relation3 (A:Type3) : Type4 ≝
@@ -95,20 +103,31 @@ record setoid3: Type4 ≝
    eq3: equivalence_relation3 carr3
  }.
 
-
-interpretation "setoid3 eq" 'eq x y = (eq_rel3 _ (eq3 _) x y).
-interpretation "setoid2 eq" 'eq x y = (eq_rel2 _ (eq2 _) x y).
-interpretation "setoid1 eq" 'eq x y = (eq_rel1 _ (eq1 _) x y).
-interpretation "setoid eq" 'eq x y = (eq_rel _ (eq _) x y).
-interpretation "setoid3 symmetry" 'invert r = (sym3 ____ r).
-interpretation "setoid2 symmetry" 'invert r = (sym2 ____ r).
-interpretation "setoid1 symmetry" 'invert r = (sym1 ____ r).
-interpretation "setoid symmetry" 'invert r = (sym ____ r).
+interpretation "setoid3 eq" 'eq t x y = (eq_rel3 ? (eq3 t) x y).
+interpretation "setoid2 eq" 'eq t x y = (eq_rel2 ? (eq2 t) x y).
+interpretation "setoid1 eq" 'eq t x y = (eq_rel1 ? (eq1 t) x y).
+interpretation "setoid eq" 'eq t x y = (eq_rel ? (eq t) x y).
+
+notation > "hvbox(a break =_12 b)" non associative with precedence 45
+for @{ eq_rel2 (carr2 (setoid2_of_setoid1 ?)) (eq2 (setoid2_of_setoid1 ?)) $a $b }.
+notation > "hvbox(a break =_0 b)" non associative with precedence 45
+for @{ eq_rel ? (eq ?) $a $b }.
+notation > "hvbox(a break =_1 b)" non associative with precedence 45
+for @{ eq_rel1 ? (eq1 ?) $a $b }.
+notation > "hvbox(a break =_2 b)" non associative with precedence 45
+for @{ eq_rel2 ? (eq2 ?) $a $b }.
+notation > "hvbox(a break =_3 b)" non associative with precedence 45
+for @{ eq_rel3 ? (eq3 ?) $a $b }.
+
+interpretation "setoid3 symmetry" 'invert r = (sym3 ???? r).
+interpretation "setoid2 symmetry" 'invert r = (sym2 ???? r).
+interpretation "setoid1 symmetry" 'invert r = (sym1 ???? r).
+interpretation "setoid symmetry" 'invert r = (sym ???? r).
 notation ".= r" with precedence 50 for @{'trans $r}.
-interpretation "trans3" 'trans r = (trans3 _____ r).
-interpretation "trans2" 'trans r = (trans2 _____ r).
-interpretation "trans1" 'trans r = (trans1 _____ r).
-interpretation "trans" 'trans r = (trans _____ r).
+interpretation "trans3" 'trans r = (trans3 ????? r).
+interpretation "trans2" 'trans r = (trans2 ????? r).
+interpretation "trans1" 'trans r = (trans1 ????? r).
+interpretation "trans" 'trans r = (trans ????? r).
 
 record unary_morphism (A,B: setoid) : Type0 ≝
  { fun1:1> A → B;
@@ -153,20 +172,49 @@ record binary_morphism3 (A,B,C:setoid3) : Type3 ≝
 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 "prop11" 'prop1 c = (prop11 _____ c).
-interpretation "prop12" 'prop1 c = (prop12 _____ c).
-interpretation "prop13" 'prop1 c = (prop13 _____ c).
-interpretation "prop2" 'prop2 l r = (prop2 ________ l r).
-interpretation "prop21" 'prop2 l r = (prop21 ________ l r).
-interpretation "prop22" 'prop2 l r = (prop22 ________ l r).
-interpretation "prop23" 'prop2 l r = (prop23 ________ l r).
-interpretation "refl" 'refl = (refl ___).
-interpretation "refl1" 'refl = (refl1 ___).
-interpretation "refl2" 'refl = (refl2 ___).
-interpretation "refl3" 'refl = (refl3 ___).
-
-definition unary_morphism2_of_unary_morphism1: ∀S,T.unary_morphism1 S T → unary_morphism2 S T.
+interpretation "prop1" 'prop1 c  = (prop1 ????? c).
+interpretation "prop11" 'prop1 c = (prop11 ????? c).
+interpretation "prop12" 'prop1 c = (prop12 ????? c).
+interpretation "prop13" 'prop1 c = (prop13 ????? c).
+interpretation "prop2" 'prop2 l r = (prop2 ???????? l r).
+interpretation "prop21" 'prop2 l r = (prop21 ???????? l r).
+interpretation "prop22" 'prop2 l r = (prop22 ???????? l r).
+interpretation "prop23" 'prop2 l r = (prop23 ???????? l r).
+interpretation "refl" 'refl = (refl ???).
+interpretation "refl1" 'refl = (refl1 ???).
+interpretation "refl2" 'refl = (refl2 ???).
+interpretation "refl3" 'refl = (refl3 ???).
+
+notation > "A × term 74 B ⇒ term 19 C" non associative with precedence 72 for @{'binary_morphism0 $A $B $C}.
+notation > "A × term 74 B ⇒_1 term 19 C" non associative with precedence 72 for @{'binary_morphism1 $A $B $C}.
+notation > "A × term 74 B ⇒_2 term 19 C" non associative with precedence 72 for @{'binary_morphism2 $A $B $C}.
+notation > "A × term 74 B ⇒_3 term 19 C" non associative with precedence 72 for @{'binary_morphism3 $A $B $C}.
+notation > "B ⇒_1 C" right associative with precedence 72 for @{'arrows1_SET $B $C}.
+notation > "B ⇒_1. C" right associative with precedence 72 for @{'arrows1_SETlow $B $C}.
+notation > "B ⇒_2 C" right associative with precedence 72 for @{'arrows2_SET1 $B $C}.
+notation > "B ⇒_2. C" right associative with precedence 72 for @{'arrows2_SET1low $B $C}.
+
+notation "A × term 74 B ⇒ term 19 C" non associative with precedence 72 for @{'binary_morphism0 $A $B $C}.
+notation "A × term 74 B ⇒\sub 1 term 19 C" non associative with precedence 72 for @{'binary_morphism1 $A $B $C}.
+notation "A × term 74 B ⇒\sub 2 term 19 C" non associative with precedence 72 for @{'binary_morphism2 $A $B $C}.
+notation "A × term 74 B ⇒\sub 3 term 19 C" non associative with precedence 72 for @{'binary_morphism3 $A $B $C}.
+notation "B ⇒\sub 1 C" right associative with precedence 72 for @{'arrows1_SET $B $C}.
+notation "B ⇒\sub 2 C" right associative with precedence 72 for @{'arrows2_SET1 $B $C}.
+notation "B ⇒\sub 1. C" right associative with precedence 72 for @{'arrows1_SETlow $B $C}.
+notation "B ⇒\sub 2. C" right associative with precedence 72 for @{'arrows2_SET1low $B $C}.
+
+interpretation "'binary_morphism0" 'binary_morphism0 A B C = (binary_morphism A B C).
+interpretation "'arrows2_SET1 low" 'arrows2_SET1 A B = (unary_morphism2 A B).
+interpretation "'arrows2_SET1low" 'arrows2_SET1low A B = (unary_morphism2 A B).
+interpretation "'binary_morphism1" 'binary_morphism1 A B C = (binary_morphism1 A B C).
+interpretation "'binary_morphism2" 'binary_morphism2 A B C = (binary_morphism2 A B C).
+interpretation "'binary_morphism3" 'binary_morphism3 A B C = (binary_morphism3 A B C).
+interpretation "'arrows1_SET low" 'arrows1_SET A B = (unary_morphism1 A B).
+interpretation "'arrows1_SETlow" 'arrows1_SETlow A B = (unary_morphism1 A B).
+
+
+definition unary_morphism2_of_unary_morphism1: 
+  ∀S,T:setoid1.unary_morphism1 S T → unary_morphism2 (setoid2_of_setoid1 S) T.
  intros;
  constructor 1;
   [ apply (fun11 ?? u);
@@ -193,7 +241,7 @@ definition fi': ∀A,B:CPROP. A = B → B → A.
 qed.
 
 notation ". r" with precedence 50 for @{'fi $r}.
-interpretation "fi" 'fi r = (fi' __ r).
+interpretation "fi" 'fi r = (fi' ?? r).
 
 definition and_morphism: binary_morphism1 CPROP CPROP CPROP.
  constructor 1;
@@ -205,7 +253,7 @@ definition and_morphism: binary_morphism1 CPROP CPROP CPROP.
      | apply (fi ?? e1 b1)]]
 qed.
 
-interpretation "and_morphism" 'and a b = (fun21 ___ and_morphism a b).
+interpretation "and_morphism" 'and a b = (fun21 ??? and_morphism a b).
 
 definition or_morphism: binary_morphism1 CPROP CPROP CPROP.
  constructor 1;
@@ -217,7 +265,7 @@ definition or_morphism: binary_morphism1 CPROP CPROP CPROP.
      | apply (fi ?? e1 b1)]]
 qed.
 
-interpretation "or_morphism" 'or a b = (fun21 ___ or_morphism a b).
+interpretation "or_morphism" 'or a b = (fun21 ??? or_morphism a b).
 
 definition if_morphism: binary_morphism1 CPROP CPROP CPROP.
  constructor 1;
@@ -227,17 +275,18 @@ definition if_morphism: binary_morphism1 CPROP CPROP CPROP.
      | apply (fi ?? e1); apply f; apply (if ?? e); assumption]]
 qed.
 
-
-record category : Type1 ≝
{ objs:> Type0;
+notation > "hvbox(a break ∘ b)" left associative with precedence 55 for @{ comp ??? $a $b }.
+record category : Type1 ≝ { 
  objs:> Type0;
    arrows: objs → objs → setoid;
    id: ∀o:objs. arrows o o;
-   comp: ∀o1,o2,o3. binary_morphism (arrows o1 o2) (arrows o2 o3) (arrows o1 o3);
-   comp_assoc: ∀o1,o2,o3,o4. ∀a12,a23,a34.
-    comp o1 o3 o4 (comp o1 o2 o3 a12 a23) a34 = comp o1 o2 o4 a12 (comp o2 o3 o4 a23 a34);
-   id_neutral_left: ∀o1,o2. ∀a: arrows o1 o2. comp ??? (id o1) a = a;
-   id_neutral_right: ∀o1,o2. ∀a: arrows o1 o2. comp ??? a (id o2) = a
- }.
+   comp: ∀o1,o2,o3. (arrows o1 o2) × (arrows o2 o3) ⇒ (arrows o1 o3);
+   comp_assoc: ∀o1,o2,o3,o4.∀a12:arrows o1 ?.∀a23:arrows o2 ?.∀a34:arrows o3 o4.
+     (a12 ∘ a23) ∘ a34 =_0 a12 ∘ (a23 ∘ a34);
+   id_neutral_left : ∀o1,o2. ∀a: arrows o1 o2. (id o1) ∘ a =_0 a;
+   id_neutral_right: ∀o1,o2. ∀a: arrows o1 o2. a ∘ (id o2) =_0 a
+}.
+notation "hvbox(a break ∘ b)" left associative with precedence 55 for @{ 'compose $a $b }.
 
 record category1 : Type2 ≝
  { objs1:> Type1;
@@ -245,9 +294,9 @@ record category1 : Type2 ≝
    id1: ∀o:objs1. arrows1 o o;
    comp1: ∀o1,o2,o3. binary_morphism1 (arrows1 o1 o2) (arrows1 o2 o3) (arrows1 o1 o3);
    comp_assoc1: ∀o1,o2,o3,o4. ∀a12,a23,a34.
-    comp1 o1 o3 o4 (comp1 o1 o2 o3 a12 a23) a34 = comp1 o1 o2 o4 a12 (comp1 o2 o3 o4 a23 a34);
-   id_neutral_right1: ∀o1,o2. ∀a: arrows1 o1 o2. comp1 ??? (id1 o1) a = a;
-   id_neutral_left1: ∀o1,o2. ∀a: arrows1 o1 o2. comp1 ??? a (id1 o2) = a
+    comp1 o1 o3 o4 (comp1 o1 o2 o3 a12 a23) a34 =_1 comp1 o1 o2 o4 a12 (comp1 o2 o3 o4 a23 a34);
+   id_neutral_right1: ∀o1,o2. ∀a: arrows1 o1 o2. comp1 ??? (id1 o1) a =_1 a;
+   id_neutral_left1: ∀o1,o2. ∀a: arrows1 o1 o2. comp1 ??? a (id1 o2) =_1 a
  }.
 
 record category2 : Type3 ≝
@@ -256,9 +305,9 @@ record category2 : Type3 ≝
    id2: ∀o:objs2. arrows2 o o;
    comp2: ∀o1,o2,o3. binary_morphism2 (arrows2 o1 o2) (arrows2 o2 o3) (arrows2 o1 o3);
    comp_assoc2: ∀o1,o2,o3,o4. ∀a12,a23,a34.
-    comp2 o1 o3 o4 (comp2 o1 o2 o3 a12 a23) a34 = comp2 o1 o2 o4 a12 (comp2 o2 o3 o4 a23 a34);
-   id_neutral_right2: ∀o1,o2. ∀a: arrows2 o1 o2. comp2 ??? (id2 o1) a = a;
-   id_neutral_left2: ∀o1,o2. ∀a: arrows2 o1 o2. comp2 ??? a (id2 o2) = a
+    comp2 o1 o3 o4 (comp2 o1 o2 o3 a12 a23) a34 =_2 comp2 o1 o2 o4 a12 (comp2 o2 o3 o4 a23 a34);
+   id_neutral_right2: ∀o1,o2. ∀a: arrows2 o1 o2. comp2 ??? (id2 o1) a =_2 a;
+   id_neutral_left2: ∀o1,o2. ∀a: arrows2 o1 o2. comp2 ??? a (id2 o2) =_2 a
  }.
 
 record category3 : Type4 ≝
@@ -267,19 +316,19 @@ record category3 : Type4 ≝
    id3: ∀o:objs3. arrows3 o o;
    comp3: ∀o1,o2,o3. binary_morphism3 (arrows3 o1 o2) (arrows3 o2 o3) (arrows3 o1 o3);
    comp_assoc3: ∀o1,o2,o3,o4. ∀a12,a23,a34.
-    comp3 o1 o3 o4 (comp3 o1 o2 o3 a12 a23) a34 = comp3 o1 o2 o4 a12 (comp3 o2 o3 o4 a23 a34);
-   id_neutral_right3: ∀o1,o2. ∀a: arrows3 o1 o2. comp3 ??? (id3 o1) a = a;
-   id_neutral_left3: ∀o1,o2. ∀a: arrows3 o1 o2. comp3 ??? a (id3 o2) = a
+    comp3 o1 o3 o4 (comp3 o1 o2 o3 a12 a23) a34 =_3 comp3 o1 o2 o4 a12 (comp3 o2 o3 o4 a23 a34);
+   id_neutral_right3: ∀o1,o2. ∀a: arrows3 o1 o2. comp3 ??? (id3 o1) a =_3 a;
+   id_neutral_left3: ∀o1,o2. ∀a: arrows3 o1 o2. comp3 ??? a (id3 o2) =_3 a
  }.
 
 notation "'ASSOC'" with precedence 90 for @{'assoc}.
 
-interpretation "category2 composition" 'compose x y = (fun22 ___ (comp2 ____) y x).
-interpretation "category2 assoc" 'assoc = (comp_assoc2 ________).
-interpretation "category1 composition" 'compose x y = (fun21 ___ (comp1 ____) y x).
-interpretation "category1 assoc" 'assoc = (comp_assoc1 ________).
-interpretation "category composition" 'compose x y = (fun2 ___ (comp ____) y x).
-interpretation "category assoc" 'assoc = (comp_assoc ________).
+interpretation "category2 composition" 'compose x y = (fun22 ??? (comp2 ????) y x).
+interpretation "category2 assoc" 'assoc = (comp_assoc2 ????????).
+interpretation "category1 composition" 'compose x y = (fun21 ??? (comp1 ????) y x).
+interpretation "category1 assoc" 'assoc = (comp_assoc1 ????????).
+interpretation "category composition" 'compose x y = (fun2 ??? (comp ????) y x).
+interpretation "category assoc" 'assoc = (comp_assoc ????????).
 
 definition category2_of_category1: category1 → category2.
  intro;
@@ -290,7 +339,8 @@ definition category2_of_category1: category1 → category2.
   | intros;
     constructor 1;
      [ intros; apply (comp1 c o1 o2 o3 c1 c2);
-     | intros; whd in e e1 a a' b b'; change with (eq1 ? (b∘a) (b'∘a')); apply (e‡e1); ]
+     | intros; unfold setoid2_of_setoid1 in e e1 a a' b b'; simplify in e e1 a a' b b'; 
+       change with ((b∘a) =_1 (b'∘a')); apply (e‡e1); ]
   | intros; simplify; whd in a12 a23 a34; whd; apply rule (ASSOC);
   | intros; simplify; whd in a; whd; apply id_neutral_right1;
   | intros; simplify; whd in a; whd; apply id_neutral_left1; ]
@@ -305,6 +355,10 @@ record functor2 (C1: category2) (C2: category2) : Type3 ≝
      ∀o1,o2,o3.∀f1:arrows2 ? o1 o2.∀f2:arrows2 ? o2 o3.
      map_arrows2 ?? (f2 ∘ f1) = map_arrows2 ?? f2 ∘ map_arrows2 ?? f1}.
 
+notation > "F⎽⇒ x" left associative with precedence 60 for @{'map_arrows2 $F $x}.
+notation "F\sub⇒ x" left associative with precedence 60 for @{'map_arrows2 $F $x}.
+interpretation "map_arrows2" 'map_arrows2 F x = (fun12 ?? (map_arrows2 ?? F ??) x).
+
 definition functor2_setoid: category2 → category2 → setoid3.
  intros (C1 C2);
  constructor 1;
@@ -393,8 +447,7 @@ definition unary_morphism_setoid_of_arrows1_SET:
   ∀P,Q.arrows1 SET P Q → unary_morphism_setoid P Q  ≝ λP,Q,x.x.
 coercion unary_morphism_setoid_of_arrows1_SET.
 
-notation "hbox(a break ⇒ b)" right associative with precedence 20 for @{ 'Imply $a $b }.
-interpretation "unary morphism" 'Imply a b = (arrows1 SET a b).
+interpretation "'arrows1_SET" 'arrows1_SET A B = (arrows1 SET A B).
 
 definition unary_morphism1_setoid1: setoid1 → setoid1 → setoid1.
  intros;
@@ -429,6 +482,8 @@ definition SET1: objs3 CAT2.
   ]
 qed.
 
+interpretation "'arrows2_SET1" 'arrows2_SET1 A B = (arrows2 SET1 A B).
+
 definition setoid1_of_SET1: objs2 SET1 → setoid1 ≝ λx.x.
 coercion setoid1_of_SET1.
 
@@ -441,5 +496,3 @@ coercion objs2_of_category1.
 
 prefer coercion Type_OF_setoid. (* we prefer the lower carrier projection *)
 prefer coercion Type_OF_objs1.
-
-interpretation "unary morphism1" 'Imply a b = (arrows2 SET1 a b).
\ No newline at end of file