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