]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/formal_topology/basic_topologies.ma
big mess of notation
[helm.git] / helm / software / matita / library / formal_topology / basic_topologies.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 "formal_topology/relations.ma".
16 include "formal_topology/saturations.ma".
17
18 record basic_topology: Type1 ≝
19  { carrbt:> REL;
20    A: Ω^carrbt ⇒_1 Ω^carrbt;
21    J: Ω^carrbt ⇒_1 Ω^carrbt;
22    A_is_saturation: is_saturation ? A;
23    J_is_reduction: is_reduction ? J;
24    compatibility: ∀U,V. (A U ≬ J V) =_1 (U ≬ J V)
25  }.
26
27 definition foo : ∀o1,o2:REL.carr1 (o1 ⇒_\r1 o2) → carr2 (setoid2_of_setoid1 (o1 ⇒_\r1 o2)) ≝ λo1,o2,x.x.
28
29 record continuous_relation (S,T: basic_topology) : Type1 ≝
30  { cont_rel:> S ⇒_\r1 T;
31    reduced: ∀U. U =_1 J ? U → image_coercion ?? cont_rel U =_1 J ? (image_coercion ?? cont_rel U);
32    saturated: ∀U. U =_1 A ? U → (foo ?? cont_rel)⎻* U = _1A ? ((foo ?? cont_rel)⎻* U)
33  }. 
34
35 definition continuous_relation_setoid: basic_topology → basic_topology → setoid1.
36  intros (S T); constructor 1;
37   [ apply (continuous_relation S T)
38   | constructor 1;
39      [ apply (λr,s:continuous_relation S T.∀b. A ? (ext ?? r b) = A ? (ext ?? s b));
40      | simplify; intros; apply refl1;
41      | simplify; intros (x y H); apply sym1; apply H
42      | simplify; intros; apply trans1; [2: apply f |3: apply f1; |1: skip]]]
43 qed.
44
45 definition continuos_relation_of_continuous_relation_setoid :
46  ∀P,Q. continuous_relation_setoid P Q → continuous_relation P Q ≝ λP,Q,x.x.
47 coercion continuos_relation_of_continuous_relation_setoid.
48
49 axiom continuous_relation_eq':
50  ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
51   a = a' → ∀X.(foo ?? a)⎻* (A o1 X) = (foo ?? a')⎻* (A o1 X).
52 (*
53  intros; split; intro; unfold minus_star_image; simplify; intros;
54   [ cut (ext ?? a a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
55     lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
56     cut (A ? (ext ?? a' a1) ⊆ A ? X); [2: apply (. (H ?)‡#); assumption]
57     lapply (fi ?? (A_is_saturation ???) Hcut);
58     apply (Hletin1 x); change with (x ∈ ext ?? a' a1); split; simplify;
59      [ apply I | assumption ]
60   | cut (ext ?? a' a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
61     lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
62     cut (A ? (ext ?? a a1) ⊆ A ? X); [2: apply (. (H ?)\sup -1‡#); assumption]
63     lapply (fi ?? (A_is_saturation ???) Hcut);
64     apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify;
65      [ apply I | assumption ]]
66 qed.*)
67
68 axiom continuous_relation_eq_inv':
69  ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
70   (∀X.(foo ?? a)⎻* (A o1 X) = (foo ?? a')⎻* (A o1 X)) → a=a'.
71 (* intros 6;
72  cut (∀a,a': continuous_relation_setoid o1 o2.
73   (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → 
74    ∀V:o2. A ? (ext ?? a' V) ⊆ A ? (ext ?? a V));
75   [2: clear b H a' a; intros;
76       lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip]
77        (* fundamental adjunction here! to be taken out *)
78        cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V)));
79         [2: intro; intros 2; unfold minus_star_image; simplify; intros;
80             apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]]
81        clear Hletin;
82        cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
83         [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
84        (* second half of the fundamental adjunction here! to be taken out too *)
85       intro; lapply (Hcut1 (singleton ? V)); clear Hcut1;
86       unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin;
87       whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin;
88       apply (if ?? (A_is_saturation ???));
89       intros 2 (x H); lapply (Hletin V ? x ?);
90        [ apply refl | cases H; assumption; ]
91       change with (x ∈ A ? (ext ?? a V));
92       apply (. #‡(†(extS_singleton ????)));
93       assumption;]
94  split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
95 qed.
96 *)
97
98 definition continuous_relation_comp:
99  ∀o1,o2,o3.
100   continuous_relation_setoid o1 o2 →
101    continuous_relation_setoid o2 o3 →
102     continuous_relation_setoid o1 o3.
103  intros (o1 o2 o3 r s); constructor 1;
104   [ alias symbol "compose" (instance 1) = "category1 composition".
105 apply (s ∘ r)
106   | intros;
107     apply sym1;  
108     (*change in ⊢ (? ? ? (? ? ? ? %) ?) with (image_coercion ?? (s ∘ r) U);*)
109     apply (.= †(image_comp ??????));
110     apply (.= (reduced ?? s (image_coercion ?? r U) ?)^-1); 
111      [ apply (.= (reduced ?????)); [ assumption | apply refl1 ]
112      | change in ⊢ (? ? ? % ?) with ((image_coercion ?? s ∘ image_coercion ?? r) U);
113        apply (.= (image_comp ??????)^-1);
114        apply refl1]
115      | intros;
116        apply sym1; unfold foo;
117        apply (.= †(minus_star_image_comp ??????));
118        apply (.= (saturated ?? s ((foo ?? r)⎻* U) ?)^-1);
119         [ apply (.= (saturated ?????)); [ assumption | apply refl1 ]
120         | change in ⊢ (? ? ? % ?) with (((foo ?? s)⎻* ∘ (foo ?? r)⎻* ) U);
121           apply (.= (minus_star_image_comp ??????)^-1);
122           apply refl1]]
123 qed.
124
125 definition BTop: category1.
126  constructor 1;
127   [ apply basic_topology
128   | apply continuous_relation_setoid
129   | intro; constructor 1;
130      [ apply id1
131      | intros;
132        apply (.= (image_id ??));
133        apply sym1;
134        apply (.= †(image_id ??));
135        apply sym1;
136        assumption
137      | intros;
138        apply (.= (minus_star_image_id ??));
139        apply sym1;
140        apply (.= †(minus_star_image_id ??));
141        apply sym1;
142        assumption]
143   | intros; constructor 1;
144      [ apply continuous_relation_comp;
145      | intros; simplify; intro x; simplify;
146        lapply depth=0 (continuous_relation_eq' ???? e) as H';
147        lapply depth=0 (continuous_relation_eq' ???? e1) as H1';
148        letin K ≝ (λX.H1' (minus_star_image ?? (foo ?? a) (A ? X))); clearbody K;
149        cut (∀X:Ω \sup o1.
150               minus_star_image o2 o3 (foo ?? b) (A o2 (minus_star_image o1 o2 (foo ?? a) (A o1 X)))
151             =_1 minus_star_image o2 o3 (foo ?? b') (A o2 (minus_star_image o1 o2 (foo ?? a') (A o1 X))));
152         [2: intro; apply sym1; 
153             apply (.= (†(†((H' X)^-1)))); apply sym1; apply (K X);]
154        clear K H' H1';
155 alias symbol "compose" (instance 1) = "category1 composition".
156 alias symbol "compose" (instance 1) = "category1 composition".
157 alias symbol "compose" (instance 1) = "category1 composition".
158 cut (∀X:Ω^o1.
159               minus_star_image ?? (foo ?? (b ∘ a)) (A o1 X) =_1 minus_star_image ?? (foo ?? (b'∘a')) (A o1 X));
160         [2: intro; unfold foo;
161             apply (.= (minus_star_image_comp ??????));
162             change in ⊢ (? ? ? % ?) with ((foo ?? b)⎻* ((foo ?? a)⎻* (A o1 X)));
163             apply (.= †(saturated ?????));
164              [ apply ((saturation_idempotent ????)^-1); apply A_is_saturation ]
165             apply sym1; 
166             apply (.= (minus_star_image_comp ??????));
167             change in ⊢ (? ? ? % ?) with ((foo ?? b')⎻* ((foo ?? a')⎻* (A o1 X)));
168             apply (.= †(saturated ?????));
169              [ apply ((saturation_idempotent ????)^-1); apply A_is_saturation ]
170            apply ((Hcut X)^-1)]
171        clear Hcut; generalize in match x; clear x;
172        apply (continuous_relation_eq_inv');
173        apply Hcut1;]
174   | intros; simplify; intro; do 2 (unfold continuous_relation_comp); simplify;
175     alias symbol "trans" (instance 1) = "trans1".
176 alias symbol "refl" (instance 5) = "refl1".
177 alias symbol "prop2" (instance 3) = "prop21".
178 alias symbol "prop1" (instance 2) = "prop11".
179 alias symbol "assoc" (instance 4) = "category1 assoc".
180 apply (.= †(ASSOC‡#));
181     apply refl1
182   | intros; simplify; intro; unfold continuous_relation_comp; simplify;
183     apply (.= †((id_neutral_right1 ????)‡#));
184     apply refl1
185   | intros; simplify; intro; simplify;
186     apply (.= †((id_neutral_left1 ????)‡#));
187     apply refl1]
188 qed.
189
190 (*
191 (*CSC: unused! *)
192 (* this proof is more logic-oriented than set/lattice oriented *)
193 theorem continuous_relation_eqS:
194  ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
195   a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
196  intros;
197  cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
198   [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
199       try assumption; split; assumption]
200  cut (∀a,a':continuous_relation_setoid o1 o2.eq1 ? a a' → ∀x. x ∈ extS ?? a X → ∃y:o2. y ∈ X ∧ x ∈ A ? (ext ?? a' y));
201   [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
202       apply (. #‡(H1 ?));
203       apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
204       assumption;] clear Hcut;
205  split; apply (if ?? (A_is_saturation ???)); intros 2;
206   [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
207   cases Hletin; clear Hletin; cases x; clear x;
208  cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
209   [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
210       exists [1,3: apply w] split; assumption;]
211  cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
212   [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
213  apply Hcut2; assumption.
214 qed.
215 *)