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: Type2 ≝
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 lemma hint: OA → objs2 OA.
32 record continuous_relation (S,T: basic_topology) : Type2 ≝
33 { cont_rel:> arrows2 OA S T;
34 (* reduces uses eq1, saturated uses eq!!! *)
35 reduced: ∀U. U = J ? U → cont_rel U = J ? (cont_rel U);
36 saturated: ∀U. U = A ? U → cont_rel⎻* U = A ? (cont_rel⎻* U)
39 definition continuous_relation_setoid: basic_topology → basic_topology → setoid2.
40 intros (S T); constructor 1;
41 [ apply (continuous_relation S T)
43 [ (*apply (λr,s:continuous_relation S T.∀b. eq1 (oa_P (carrbt S)) (A ? (r⎻ b)) (A ? (s⎻ b)));*)
44 apply (λr,s:continuous_relation S T.r⎻* ∘ (A S) = s⎻* ∘ (A ?));
45 | simplify; intros; apply refl2;
46 | simplify; intros; apply sym2; apply e
47 | simplify; intros; apply trans2; [2: apply e |3: apply e1; |1: skip]]]
50 definition cont_rel': ∀S,T: basic_topology. continuous_relation_setoid S T → arrows2 ? S T ≝ cont_rel.
54 definition cont_rel'':
56 carr2 (continuous_relation_setoid S T) → ORelation_setoid (carrbt S) (carrbt T).
57 intros; apply rule cont_rel; apply c;
63 theorem continuous_relation_eq':
64 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
65 a = a' → ∀X.a⎻* (A o1 X) = a'⎻* (A o1 X).
66 intros; apply oa_leq_antisym; intro; unfold minus_star_image; simplify; intros;
67 [ cut (ext ?? a a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
68 lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
69 cut (A ? (ext ?? a' a1) ⊆ A ? X); [2: apply (. (H ?)‡#); assumption]
70 lapply (fi ?? (A_is_saturation ???) Hcut);
71 apply (Hletin1 x); change with (x ∈ ext ?? a' a1); split; simplify;
72 [ apply I | assumption ]
73 | cut (ext ?? a' a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
74 lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
75 cut (A ? (ext ?? a a1) ⊆ A ? X); [2: apply (. (H ?)\sup -1‡#); assumption]
76 lapply (fi ?? (A_is_saturation ???) Hcut);
77 apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify;
78 [ apply I | assumption ]]
81 theorem continuous_relation_eq_inv':
82 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
83 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) → a=a'.
85 cut (∀a,a': continuous_relation_setoid o1 o2.
86 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) →
87 ∀V:(oa_P (carrbt o2)). A o1 (a'⎻ V) ≤ A o1 (a⎻ V));
88 [2: clear b H a' a; intros;
89 lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip]
90 (* fundamental adjunction here! to be taken out *)
91 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V)));
92 [2: intro; intros 2; unfold minus_star_image; simplify; intros;
93 apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]]
95 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
96 [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
97 (* second half of the fundamental adjunction here! to be taken out too *)
98 intro; lapply (Hcut1 (singleton ? V)); clear Hcut1;
99 unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin;
100 whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin;
101 apply (if ?? (A_is_saturation ???));
102 intros 2 (x H); lapply (Hletin V ? x ?);
103 [ apply refl | cases H; assumption; ]
104 change with (x ∈ A ? (ext ?? a V));
105 apply (. #‡(†(extS_singleton ????)));
107 split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
112 definition continuous_relation_comp:
114 continuous_relation_setoid o1 o2 →
115 continuous_relation_setoid o2 o3 →
116 continuous_relation_setoid o1 o3.
117 intros (o1 o2 o3 r s); constructor 1;
121 change in match ((s ∘ r) U) with (s (r U));
122 (*<BAD>*) unfold FunClass_1_OF_Type_OF_setoid2;
123 unfold objs2_OF_basic_topology1; unfold hint;
124 letin reduced := reduced; clearbody reduced;
125 unfold uncurry_arrows in reduced ⊢ %; (*</BAD>*)
126 apply (.= (reduced : ?)\sup -1);
127 [ (*BAD*) change with (eq1 ? (r U) (J ? (r U)));
128 (* BAD U *) apply (.= (reduced ??? U ?)); [ assumption | apply refl1 ]
132 change in match ((s ∘ r)⎻* U) with (s⎻* (r⎻* U));
133 apply (.= (saturated : ?)\sup -1);
134 [ apply (.= (saturated : ?)); [ assumption | apply refl1 ]
138 definition BTop: category2.
140 [ apply basic_topology
141 | apply continuous_relation_setoid
142 | intro; constructor 1;
146 | intros; constructor 1;
147 [ apply continuous_relation_comp;
149 change with ((b⎻* ∘ a⎻* ) ∘ A o1 = ((b'⎻* ∘ a'⎻* ) ∘ A o1));
150 change with (b⎻* ∘ (a⎻* ∘ A o1) = b'⎻* ∘ (a'⎻* ∘ A o1));
151 change in e with (a⎻* ∘ A o1 = a'⎻* ∘ A o1);
152 change in e1 with (b⎻* ∘ A o2 = b'⎻* ∘ A o2);
155 change with (b⎻* (a'⎻* (A o1 x)) = b'⎻*(a'⎻* (A o1 x)));
156 alias symbol "trans" = "trans1".
157 alias symbol "prop1" = "prop11".
158 alias symbol "invert" = "setoid1 symmetry".
159 lapply (.= †(saturated o1 o2 a' (A o1 x) : ?));
160 [3: apply (b⎻* ); | 5: apply Hletin; |1,2: skip;
161 |apply ((saturation_idempotent ?? (A_is_saturation o1) x)^-1); ]
162 change in e1 with (∀x.b⎻* (A o2 x) = b'⎻* (A o2 x));
163 apply (.= (e1 (a'⎻* (A o1 x))));
164 alias symbol "invert" = "setoid1 symmetry".
165 lapply (†((saturated ?? a' (A o1 x) : ?) ^ -1));
166 [2: apply (b'⎻* ); |4: apply Hletin; | skip;
167 |apply ((saturation_idempotent ?? (A_is_saturation o1) x)^-1);]]
169 change with (((a34⎻* ∘ a23⎻* ) ∘ a12⎻* ) ∘ A o1 = ((a34⎻* ∘ (a23⎻* ∘ a12⎻* )) ∘ A o1));
170 apply rule (#‡ASSOC1\sup -1);
172 change with ((a⎻* ∘ (id2 ? o1)⎻* ) ∘ A o1 = a⎻* ∘ A o1);
173 apply (#‡(id_neutral_right2 : ?));
175 change with (((id2 ? o2)⎻* ∘ a⎻* ) ∘ A o1 = a⎻* ∘ A o1);
176 apply (#‡(id_neutral_left2 : ?));]
179 definition btop_carr: BTop → Type1 ≝ λo:BTop. carr1 (oa_P (carrbt o)).
184 (* this proof is more logic-oriented than set/lattice oriented *)
185 theorem continuous_relation_eqS:
186 ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
187 a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
189 cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
190 [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
191 try assumption; split; assumption]
192 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));
193 [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
195 apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
196 assumption;] clear Hcut;
197 split; apply (if ?? (A_is_saturation ???)); intros 2;
198 [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
199 cases Hletin; clear Hletin; cases x; clear x;
200 cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
201 [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
202 exists [1,3: apply w] split; assumption;]
203 cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
204 [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
205 apply Hcut2; assumption.