]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/formal_topology/overlap/o-concrete_spaces.ma
one line
[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 = (fun_1 _ _ (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 = (fun_1 _ _ (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 = (fun_1 _ _ (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 = (fun_1 _ _ (or_f_minus _ _) (rel x)).
33
34 lemma hint : ∀p,q.arrows1 OA p q → ORelation_setoid p q.
35 intros; assumption;
36 qed.
37
38 coercion hint nocomposites.
39
40 definition A : ∀b:BP. unary_morphism (oa_P (form b)) (oa_P (form b)).
41 intros; constructor 1;
42  [ apply (λx.□_b (Ext⎽b x));
43  | do 2 unfold uncurry_arrows; intros; apply  (†(†H));]
44 qed.
45
46 lemma xxx : ∀x.carr x → carr1 (setoid1_of_setoid x). intros; assumption; qed.
47 coercion xxx nocomposites.
48
49 lemma down_p : ∀S,I:SET.∀u:S⇒S.∀c:arrows1 SET I S.∀a:I.∀a':I.a=a'→u (c a)=u (c a').
50 intros; unfold uncurry_arrows; apply (†(†H));
51 qed.
52
53 alias symbol "eq" = "setoid eq".
54 alias symbol "and" = "o-algebra binary meet".
55 record concrete_space : Type ≝
56  { bp:> BP;
57    (*distr : is_distributive (form bp);*)
58    downarrow: unary_morphism (oa_P (form bp)) (oa_P (form bp));
59    downarrow_is_sat: is_saturation ? downarrow;
60    converges: ∀q1,q2.
61      (Ext⎽bp q1 ∧ (Ext⎽bp q2)) = (Ext⎽bp ((downarrow q1) ∧ (downarrow q2)));
62    all_covered: Ext⎽bp (oa_one (form bp)) = oa_one (concr bp);
63    il2: ∀I:SET.∀p:arrows1 SET I (oa_P (form bp)).
64      downarrow (∨ { x ∈ I | downarrow (p x) | down_p ???? }) =
65      ∨ { x ∈ I | downarrow (p x) | down_p ???? };
66    il1: ∀q.downarrow (A ? q) = A ? q
67  }.
68
69 interpretation "o-concrete space downarrow" 'downarrow x = 
70   (fun_1 __ (downarrow _) x).
71
72 definition bp': concrete_space → basic_pair ≝ λc.bp c.
73 coercion bp'.
74
75 lemma setoid_OF_OA : OA → setoid.
76 intros; apply (oa_P o);
77 qed.
78
79 coercion setoid_OF_OA.
80
81 definition binary_downarrow : 
82   ∀C:concrete_space.binary_morphism1 (form C) (form C) (form C).
83 intros; constructor 1;
84 [ intros; apply (↓ c ∧ ↓ c1);
85 | intros; apply ((†H)‡(†H1));]
86 qed.
87
88 record convergent_relation_pair (CS1,CS2: concrete_space) : Type ≝
89  { rp:> arrows1 ? CS1 CS2;
90    respects_converges:
91     ∀b,c. (rp\sub\c)⎻ (Ext⎽CS2 (b ↓ c)) = ?(*  
92      extS ?? rp \sub\c (BPextS CS2 (b ↓ c)) =
93      BPextS CS1 ((extS ?? rp \sub\f b) ↓ (extS ?? rp \sub\f c));
94    respects_all_covered:
95     extS ?? rp\sub\c (BPextS CS2 (form CS2)) = BPextS CS1 (form CS1)*)
96  }.
97
98 definition rp' : ∀CS1,CS2. convergent_relation_pair CS1 CS2 → relation_pair CS1 CS2 ≝
99  λCS1,CS2,c. rp CS1 CS2 c.
100  
101 coercion rp'.
102
103 definition convergent_relation_space_setoid: concrete_space → concrete_space → setoid1.
104  intros;
105  constructor 1;
106   [ apply (convergent_relation_pair c c1)
107   | constructor 1;
108      [ intros;
109        apply (relation_pair_equality c c1 c2 c3);
110      | intros 1; apply refl1;
111      | intros 2; apply sym1; 
112      | intros 3; apply trans1]]
113 qed.
114
115 definition rp'': ∀CS1,CS2.convergent_relation_space_setoid CS1 CS2 → arrows1 BP CS1 CS2 ≝
116  λCS1,CS2,c.rp ?? c.
117
118 coercion rp''.
119
120 definition convergent_relation_space_composition:
121  ∀o1,o2,o3: concrete_space.
122   binary_morphism1
123    (convergent_relation_space_setoid o1 o2)
124    (convergent_relation_space_setoid o2 o3)
125    (convergent_relation_space_setoid o1 o3).
126  intros; constructor 1;
127      [ intros; whd in c c1 ⊢ %;
128        constructor 1;
129         [ apply (fun1 ??? (comp1 BP ???)); [apply (bp o2) |*: apply rp; assumption]
130         | intros;
131           change in ⊢ (? ? ? (? ? ? (? ? ? %) ?) ?) with (c1 \sub \c ∘ c \sub \c);
132           change in ⊢ (? ? ? ? (? ? ? ? (? ? ? ? ? (? ? ? (? ? ? %) ?) ?)))
133             with (c1 \sub \f ∘ c \sub \f);
134           change in ⊢ (? ? ? ? (? ? ? ? (? ? ? ? ? ? (? ? ? (? ? ? %) ?))))
135             with (c1 \sub \f ∘ c \sub \f);
136           apply (.= (extS_com ??????));
137           apply (.= (†(respects_converges ?????)));
138           apply (.= (respects_converges ?????));
139           apply (.= (†(((extS_com ??????) \sup -1)‡(extS_com ??????)\sup -1)));
140           apply refl1;
141         | change in ⊢ (? ? ? (? ? ? (? ? ? %) ?) ?) with (c1 \sub \c ∘ c \sub \c);
142           apply (.= (extS_com ??????));
143           apply (.= (†(respects_all_covered ???)));
144           apply (.= respects_all_covered ???);
145           apply refl1]
146      | intros;
147        change with (b ∘ a = b' ∘ a');
148        change in H with (rp'' ?? a = rp'' ?? a');
149        change in H1 with (rp'' ?? b = rp ?? b');
150        apply (.= (H‡H1));
151        apply refl1]
152 qed.
153
154 definition CSPA: category1.
155  constructor 1;
156   [ apply concrete_space
157   | apply convergent_relation_space_setoid
158   | intro; constructor 1;
159      [ apply id1
160      | intros;
161        unfold id; simplify;
162        apply (.= (equalset_extS_id_X_X ??));
163        apply (.= (†((equalset_extS_id_X_X ??)\sup -1‡
164                     (equalset_extS_id_X_X ??)\sup -1)));
165        apply refl1;
166      | apply (.= (equalset_extS_id_X_X ??));
167        apply refl1]
168   | apply convergent_relation_space_composition
169   | intros; simplify;
170     change with (a34 ∘ (a23 ∘ a12) = (a34 ∘ a23) ∘ a12);
171     apply (.= ASSOC1);
172     apply refl1
173   | intros; simplify;
174     change with (a ∘ id1 ? o1 = a);
175     apply (.= id_neutral_right1 ????);
176     apply refl1
177   | intros; simplify;
178     change with (id1 ? o2 ∘ a = a);
179     apply (.= id_neutral_left1 ????);
180     apply refl1]
181 qed.