]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/formal_topology/overlap/o-concrete_spaces.ma
go notation go!
[helm.git] / helm / software / matita / contribs / formal_topology / overlap / o-concrete_spaces.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 "o-basic_pairs.ma".
16 include "o-saturations.ma".
17
18 notation "□ \sub b" non associative with precedence 90 for @{'box $b}.
19 notation > "□_term 90 b" non associative with precedence 90 for @{'box $b}.
20 interpretation "Universal image ⊩⎻*" 'box x = (or_f_minus_star _ _ (rel x)).
21  
22 notation "◊ \sub b" non associative with precedence 90 for @{'diamond $b}.
23 notation > "◊_term 90 b" non associative with precedence 90 for @{'diamond $b}.
24 interpretation "Existential image ⊩" 'diamond x = (or_f _ _ (rel x)).
25
26 notation "'Rest' \sub b" non associative with precedence 90 for @{'rest $b}.
27 notation > "'Rest'⎽term 90 b" non associative with precedence 90 for @{'rest $b}.
28 interpretation "Universal pre-image ⊩*" 'rest x = (or_f_star _ _ (rel x)).
29
30 notation "'Ext' \sub b" non associative with precedence 90 for @{'ext $b}.
31 notation > "'Ext'⎽term 90 b" non associative with precedence 90 for @{'ext $b}.
32 interpretation "Existential pre-image ⊩⎻" 'ext x = (or_f_minus _ _ (rel x)).
33
34 definition A : ∀b:BP. unary_morphism (oa_P (form b)) (oa_P (form b)).
35 intros; constructor 1; [ apply (λx.□_b (Ext⎽b x)); | intros; apply (†(†H));] qed. 
36
37 lemma xxx : ∀x.carr x → carr1 (setoid1_of_setoid x). intros; assumption; qed.
38 coercion xxx.
39
40 definition d_p_i : 
41   ∀S:setoid.∀I:setoid.∀d:unary_morphism S S.∀p:ums I S.ums I S.
42 intros; constructor 1; [ apply (λi:I. u (c i));| intros; apply (†(†H));].
43 qed. 
44
45 alias symbol "eq" = "setoid eq".
46 alias symbol "and" = "o-algebra binary meet".
47 record concrete_space : Type ≝
48  { bp:> BP;
49    (*distr : is_distributive (form bp);*)
50    downarrow: unary_morphism (oa_P (form bp)) (oa_P (form bp));
51    downarrow_is_sat: is_saturation ? downarrow;
52    converges: ∀q1,q2.
53      (Ext⎽bp q1 ∧ (Ext⎽bp q2)) = (Ext⎽bp ((downarrow q1) ∧ (downarrow q2)));
54    all_covered: Ext⎽bp (oa_one (form bp)) = oa_one (concr bp);
55    il2: ∀I:setoid.∀p:ums I (oa_P (form bp)).
56      downarrow (oa_join ? I (d_p_i ?? downarrow p)) =
57      oa_join ? I (d_p_i ?? downarrow p);
58    il1: ∀q.downarrow (A ? q) = A ? q
59  }.
60
61 interpretation "o-concrete space downarrow" 'downarrow x = (fun_1 __ (downarrow _) x).
62
63 definition bp': concrete_space → basic_pair ≝ λc.bp c.
64 coercion bp'.
65
66 record convergent_relation_pair (CS1,CS2: concrete_space) : Type ≝
67  { rp:> arrows1 ? CS1 CS2;
68    respects_converges:
69     ∀b,c.
70      extS ?? rp \sub\c (BPextS CS2 (b ↓ c)) =
71      BPextS CS1 ((extS ?? rp \sub\f b) ↓ (extS ?? rp \sub\f c));
72    respects_all_covered:
73     extS ?? rp\sub\c (BPextS CS2 (form CS2)) = BPextS CS1 (form CS1)
74  }.
75
76 definition rp' : ∀CS1,CS2. convergent_relation_pair CS1 CS2 → relation_pair CS1 CS2 ≝
77  λCS1,CS2,c. rp CS1 CS2 c.
78  
79 coercion rp'.
80
81 definition convergent_relation_space_setoid: concrete_space → concrete_space → setoid1.
82  intros;
83  constructor 1;
84   [ apply (convergent_relation_pair c c1)
85   | constructor 1;
86      [ intros;
87        apply (relation_pair_equality c c1 c2 c3);
88      | intros 1; apply refl1;
89      | intros 2; apply sym1; 
90      | intros 3; apply trans1]]
91 qed.
92
93 definition rp'': ∀CS1,CS2.convergent_relation_space_setoid CS1 CS2 → arrows1 BP CS1 CS2 ≝
94  λCS1,CS2,c.rp ?? c.
95
96 coercion rp''.
97
98 definition convergent_relation_space_composition:
99  ∀o1,o2,o3: concrete_space.
100   binary_morphism1
101    (convergent_relation_space_setoid o1 o2)
102    (convergent_relation_space_setoid o2 o3)
103    (convergent_relation_space_setoid o1 o3).
104  intros; constructor 1;
105      [ intros; whd in c c1 ⊢ %;
106        constructor 1;
107         [ apply (fun1 ??? (comp1 BP ???)); [apply (bp o2) |*: apply rp; assumption]
108         | intros;
109           change in ⊢ (? ? ? (? ? ? (? ? ? %) ?) ?) with (c1 \sub \c ∘ c \sub \c);
110           change in ⊢ (? ? ? ? (? ? ? ? (? ? ? ? ? (? ? ? (? ? ? %) ?) ?)))
111             with (c1 \sub \f ∘ c \sub \f);
112           change in ⊢ (? ? ? ? (? ? ? ? (? ? ? ? ? ? (? ? ? (? ? ? %) ?))))
113             with (c1 \sub \f ∘ c \sub \f);
114           apply (.= (extS_com ??????));
115           apply (.= (†(respects_converges ?????)));
116           apply (.= (respects_converges ?????));
117           apply (.= (†(((extS_com ??????) \sup -1)‡(extS_com ??????)\sup -1)));
118           apply refl1;
119         | change in ⊢ (? ? ? (? ? ? (? ? ? %) ?) ?) with (c1 \sub \c ∘ c \sub \c);
120           apply (.= (extS_com ??????));
121           apply (.= (†(respects_all_covered ???)));
122           apply (.= respects_all_covered ???);
123           apply refl1]
124      | intros;
125        change with (b ∘ a = b' ∘ a');
126        change in H with (rp'' ?? a = rp'' ?? a');
127        change in H1 with (rp'' ?? b = rp ?? b');
128        apply (.= (H‡H1));
129        apply refl1]
130 qed.
131
132 definition CSPA: category1.
133  constructor 1;
134   [ apply concrete_space
135   | apply convergent_relation_space_setoid
136   | intro; constructor 1;
137      [ apply id1
138      | intros;
139        unfold id; simplify;
140        apply (.= (equalset_extS_id_X_X ??));
141        apply (.= (†((equalset_extS_id_X_X ??)\sup -1‡
142                     (equalset_extS_id_X_X ??)\sup -1)));
143        apply refl1;
144      | apply (.= (equalset_extS_id_X_X ??));
145        apply refl1]
146   | apply convergent_relation_space_composition
147   | intros; simplify;
148     change with (a34 ∘ (a23 ∘ a12) = (a34 ∘ a23) ∘ a12);
149     apply (.= ASSOC1);
150     apply refl1
151   | intros; simplify;
152     change with (a ∘ id1 ? o1 = a);
153     apply (.= id_neutral_right1 ????);
154     apply refl1
155   | intros; simplify;
156     change with (id1 ? o2 ∘ a = a);
157     apply (.= id_neutral_left1 ????);
158     apply refl1]
159 qed.