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