]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/formal_topology/overlap/o-concrete_spaces.ma
80ee4649fee1f149370a456e5c81d28f9375d26e
[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 interpretation "concrete_space binary ↓" 'fintersects a b = (fun1 _ _ _ (binary_downarrow _) a b).
89
90 record convergent_relation_pair (CS1,CS2: concrete_space) : Type ≝
91  { rp:> arrows1 ? CS1 CS2;
92    respects_converges:
93     ∀b,c. eq1 ? (rp\sub\c⎻ (Ext⎽CS2 (b ↓ c))) (Ext⎽CS1 (rp\sub\f⎻ b ↓ rp\sub\f⎻ c));
94    respects_all_covered:
95      eq1 ? (rp\sub\c⎻ (Ext⎽CS2 (oa_one (form CS2))))
96            (Ext⎽CS1 (oa_one (form CS1)))
97  }.
98
99 definition rp' : ∀CS1,CS2. convergent_relation_pair CS1 CS2 → relation_pair CS1 CS2 ≝
100  λCS1,CS2,c. rp CS1 CS2 c.
101  
102 coercion rp'.
103
104 definition convergent_relation_space_setoid: concrete_space → concrete_space → setoid1.
105  intros;
106  constructor 1;
107   [ apply (convergent_relation_pair c c1)
108   | constructor 1;
109      [ intros;
110        apply (relation_pair_equality c c1 c2 c3);
111      | intros 1; apply refl1;
112      | intros 2; apply sym1; 
113      | intros 3; apply trans1]]
114 qed.
115
116 definition rp'': ∀CS1,CS2.convergent_relation_space_setoid CS1 CS2 → arrows1 BP CS1 CS2 ≝
117  λCS1,CS2,c.rp ?? c.
118
119 coercion rp''.
120
121 definition prop_1_SET : 
122  ∀A,B:SET.∀w:arrows1 SET A B.∀a,b:A.eq1 ? a b→eq1 ? (w a) (w b).
123 intros; apply (prop_1 A B w a b H);
124 qed.
125
126 interpretation "SET dagger" 'prop1 h = (prop_1_SET _ _ _ _ _ h).
127
128 definition convergent_relation_space_composition:
129  ∀o1,o2,o3: concrete_space.
130   binary_morphism1
131    (convergent_relation_space_setoid o1 o2)
132    (convergentin ⊢ (? (? ? ? (? ? ? (? ? ? ? ? (? ? ? (? ? ? (% ? ?))) ?)) ?) ? ? ?)_relation_space_setoid o2 o3)
133    (convergent_relation_space_setoid o1 o3).
134  intros; constructor 1;
135      [ intros; whd in c c1 ⊢ %;
136        constructor 1;
137         [ apply (c1 ∘ c);
138         | intros;  
139           change in ⊢ (? ? ? % ?) with (c\sub\c⎻ (c1\sub\c⎻ (Ext⎽o3 (b↓c2))));
140           alias symbol "trans" = "trans1".
141           apply (.= († (respects_converges : ?)));
142           apply (.= (respects_converges : ?));
143           apply refl1;
144         | change in ⊢ (? ? ? % ?) with (c\sub\c⎻ (c1\sub\c⎻ (Ext⎽o3 (oa_one (form o3)))));
145           apply (.= (†(respects_all_covered :?)));
146           apply (.= (respects_all_covered :?));
147           apply refl1]
148      | intros;
149        change with (b ∘ a = b' ∘ a'); 
150        change in H with (rp'' ?? a = rp'' ?? a');
151        change in H1 with (rp'' ?? b = rp ?? b');
152        apply ( (H‡H1));]
153 qed.
154
155 definition CSPA: category1.
156  constructor 1;
157   [ apply concrete_space
158   | apply convergent_relation_space_setoid
159   | intro; constructor 1;
160      [ apply id1
161      | intros; apply refl1;
162      | apply refl1]
163   | apply convergent_relation_space_composition
164   | intros; simplify;
165     change with (a34 ∘ (a23 ∘ a12) = (a34 ∘ a23) ∘ a12);
166     apply ASSOC1;
167   | intros; simplify;
168     change with (a ∘ id1 ? o1 = a);
169     apply (id_neutral_right1 : ?);
170   | intros; simplify;
171     change with (id1 ? o2 ∘ a = a);
172     apply (id_neutral_left1 : ?);]
173 qed.