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