1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "o-algebra.ma".
16 include "o-saturations.ma".
18 record basic_topology: Type ≝
20 A: arrows1 SET (oa_P carrbt) (oa_P carrbt);
21 J: arrows1 SET (oa_P carrbt) (oa_P carrbt);
22 A_is_saturation: is_saturation ? A;
23 J_is_reduction: is_reduction ? J;
24 compatibility: ∀U,V. (A U >< J V) = (U >< J V)
27 record continuous_relation (S,T: basic_topology) : Type ≝
28 { cont_rel:> arrows1 ? S T;
29 reduced: ∀U. U = J ? U → cont_rel U = J ? (cont_rel U);
30 saturated: ∀U. U = A ? U → cont_rel⎻* U = A ? (cont_rel⎻* U)
33 definition continuous_relation_setoid: basic_topology → basic_topology → setoid1.
34 intros (S T); constructor 1;
35 [ apply (continuous_relation S T)
37 [ apply (λr,s:continuous_relation S T.∀b. eq1 (oa_P (carrbt S)) (A ? (r⎻ b)) (A ? (s⎻ b)));
38 | simplify; intros; apply refl1;
39 | simplify; intros; apply sym1; apply H
40 | simplify; intros; apply trans1; [2: apply H |3: apply H1; |1: skip]]]
43 definition cont_rel': ∀S,T: basic_topology. continuous_relation_setoid S T → arrows1 ? S T ≝ cont_rel.
47 definition cont_rel'':
49 continuous_relation_setoid S T → unary_morphism (oa_P (carrbt S)) (oa_P (carrbt T)).
50 intros; apply rule cont_rel; apply c;
55 theorem continuous_relation_eq':
56 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
57 a = a' → ∀X.a⎻* (A o1 X) = a'⎻* (A o1 X).
59 lapply (prop_1_SET ??? H);
61 split; intro; unfold minus_star_image; simplify; intros;
62 [ cut (ext ?? a a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
63 lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
64 cut (A ? (ext ?? a' a1) ⊆ A ? X); [2: apply (. (H ?)‡#); assumption]
65 lapply (fi ?? (A_is_saturation ???) Hcut);
66 apply (Hletin1 x); change with (x ∈ ext ?? a' a1); split; simplify;
67 [ apply I | assumption ]
68 | cut (ext ?? a' a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
69 lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
70 cut (A ? (ext ?? a a1) ⊆ A ? X); [2: apply (. (H ?)\sup -1‡#); assumption]
71 lapply (fi ?? (A_is_saturation ???) Hcut);
72 apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify;
73 [ apply I | assumption ]]
76 theorem continuous_relation_eq_inv':
77 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
78 (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → a=a'.
80 cut (∀a,a': continuous_relation_setoid o1 o2.
81 (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) →
82 ∀V:o2. A ? (ext ?? a' V) ⊆ A ? (ext ?? a V));
83 [2: clear b H a' a; intros;
84 lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip]
85 (* fundamental adjunction here! to be taken out *)
86 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V)));
87 [2: intro; intros 2; unfold minus_star_image; simplify; intros;
88 apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]]
90 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
91 [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
92 (* second half of the fundamental adjunction here! to be taken out too *)
93 intro; lapply (Hcut1 (singleton ? V)); clear Hcut1;
94 unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin;
95 whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin;
96 apply (if ?? (A_is_saturation ???));
97 intros 2 (x H); lapply (Hletin V ? x ?);
98 [ apply refl | cases H; assumption; ]
99 change with (x ∈ A ? (ext ?? a V));
100 apply (. #‡(†(extS_singleton ????)));
102 split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
105 definition continuous_relation_comp:
107 continuous_relation_setoid o1 o2 →
108 continuous_relation_setoid o2 o3 →
109 continuous_relation_setoid o1 o3.
110 intros (o1 o2 o3 r s); constructor 1;
114 apply (.= †(image_comp ??????));
115 apply (.= (reduced ?????)\sup -1);
116 [ apply (.= (reduced ?????)); [ assumption | apply refl1 ]
117 | apply (.= (image_comp ??????)\sup -1);
121 apply (.= †(minus_star_image_comp ??????));
122 apply (.= (saturated ?????)\sup -1);
123 [ apply (.= (saturated ?????)); [ assumption | apply refl1 ]
124 | apply (.= (minus_star_image_comp ??????)\sup -1);
128 definition BTop: category1.
130 [ apply basic_topology
131 | apply continuous_relation_setoid
132 | intro; constructor 1;
135 apply (.= (image_id ??));
137 apply (.= †(image_id ??));
141 apply (.= (minus_star_image_id ??));
143 apply (.= †(minus_star_image_id ??));
146 | intros; constructor 1;
147 [ apply continuous_relation_comp;
148 | intros; simplify; intro x; simplify;
149 lapply depth=0 (continuous_relation_eq' ???? H) as H';
150 lapply depth=0 (continuous_relation_eq' ???? H1) as H1';
151 letin K ≝ (λX.H1' (minus_star_image ?? a (A ? X))); clearbody K;
153 minus_star_image o2 o3 b (A o2 (minus_star_image o1 o2 a (A o1 X)))
154 = minus_star_image o2 o3 b' (A o2 (minus_star_image o1 o2 a' (A o1 X))));
155 [2: intro; apply sym1; apply (.= #‡(†((H' ?)\sup -1))); apply sym1; apply (K X);]
158 minus_star_image o1 o3 (b ∘ a) (A o1 X) = minus_star_image o1 o3 (b'∘a') (A o1 X));
160 apply (.= (minus_star_image_comp ??????));
161 apply (.= #‡(saturated ?????));
162 [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ]
164 apply (.= (minus_star_image_comp ??????));
165 apply (.= #‡(saturated ?????));
166 [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ]
167 apply ((Hcut X) \sup -1)]
168 clear Hcut; generalize in match x; clear x;
169 apply (continuous_relation_eq_inv');
171 | intros; simplify; intro; do 2 (unfold continuous_relation_comp); simplify;
172 apply (.= †(ASSOC1‡#));
174 | intros; simplify; intro; unfold continuous_relation_comp; simplify;
175 apply (.= †((id_neutral_right1 ????)‡#));
177 | intros; simplify; intro; simplify;
178 apply (.= †((id_neutral_left1 ????)‡#));
183 (* this proof is more logic-oriented than set/lattice oriented *)
184 theorem continuous_relation_eqS:
185 ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
186 a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
188 cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
189 [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
190 try assumption; split; assumption]
191 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));
192 [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
194 apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
195 assumption;] clear Hcut;
196 split; apply (if ?? (A_is_saturation ???)); intros 2;
197 [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
198 cases Hletin; clear Hletin; cases x; clear x;
199 cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
200 [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
201 exists [1,3: apply w] split; assumption;]
202 cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
203 [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
204 apply Hcut2; assumption.