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 Obasic_topology: Type2 ≝
20 oA: Ocarrbt ⇒ Ocarrbt;
21 oJ: Ocarrbt ⇒ Ocarrbt;
22 oA_is_saturation: is_o_saturation ? oA;
23 oJ_is_reduction: is_o_reduction ? oJ;
24 Ocompatibility: ∀U,V. (oA U >< oJ V) = (U >< oJ V)
27 record Ocontinuous_relation (S,T: Obasic_topology) : Type2 ≝
28 { Ocont_rel:> arrows2 OA S T;
29 (* reduces uses eq1, saturated uses eq!!! *)
30 Oreduced: ∀U. U = oJ ? U → Ocont_rel U = oJ ? (Ocont_rel U);
31 Osaturated: ∀U. U = oA ? U → Ocont_rel⎻* U = oA ? (Ocont_rel⎻* U)
34 definition Ocontinuous_relation_setoid: Obasic_topology → Obasic_topology → setoid2.
35 intros (S T); constructor 1;
36 [ apply (Ocontinuous_relation S T)
38 [ alias symbol "eq" = "setoid2 eq".
39 alias symbol "compose" = "category2 composition".
40 apply (λr,s:Ocontinuous_relation S T. (r⎻* ) ∘ (oA S) = (s⎻* ∘ (oA ?)));
41 | simplify; intros; apply refl2;
42 | simplify; intros; apply sym2; apply e
43 | simplify; intros; apply trans2; [2: apply e |3: apply e1; |1: skip]]]
46 definition Ocontinuous_relation_of_Ocontinuous_relation_setoid:
47 ∀P,Q. Ocontinuous_relation_setoid P Q → Ocontinuous_relation P Q ≝ λP,Q,c.c.
48 coercion Ocontinuous_relation_of_Ocontinuous_relation_setoid.
51 theorem continuous_relation_eq':
52 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
53 a = a' → ∀X.a⎻* (A o1 X) = a'⎻* (A o1 X).
54 intros; apply oa_leq_antisym; intro; unfold minus_star_image; simplify; intros;
55 [ cut (ext ?? a a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
56 lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
57 cut (A ? (ext ?? a' a1) ⊆ A ? X); [2: apply (. (H ?)‡#); assumption]
58 lapply (fi ?? (A_is_saturation ???) Hcut);
59 apply (Hletin1 x); change with (x ∈ ext ?? a' a1); split; simplify;
60 [ apply I | assumption ]
61 | cut (ext ?? a' a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
62 lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
63 cut (A ? (ext ?? a a1) ⊆ A ? X); [2: apply (. (H ?)\sup -1‡#); assumption]
64 lapply (fi ?? (A_is_saturation ???) Hcut);
65 apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify;
66 [ apply I | assumption ]]
69 theorem continuous_relation_eq_inv':
70 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
71 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) → a=a'.
73 cut (∀a,a': continuous_relation_setoid o1 o2.
74 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) →
75 ∀V:(oa_P (carrbt o2)). A o1 (a'⎻ V) ≤ A o1 (a⎻ V));
76 [2: clear b H a' a; intros;
77 lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip]
78 (* fundamental adjunction here! to be taken out *)
79 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V)));
80 [2: intro; intros 2; unfold minus_star_image; simplify; intros;
81 apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]]
83 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
84 [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
85 (* second half of the fundamental adjunction here! to be taken out too *)
86 intro; lapply (Hcut1 (singleton ? V)); clear Hcut1;
87 unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin;
88 whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin;
89 apply (if ?? (A_is_saturation ???));
90 intros 2 (x H); lapply (Hletin V ? x ?);
91 [ apply refl | cases H; assumption; ]
92 change with (x ∈ A ? (ext ?? a V));
93 apply (. #‡(†(extS_singleton ????)));
95 split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
99 definition Ocontinuous_relation_comp:
101 Ocontinuous_relation_setoid o1 o2 →
102 Ocontinuous_relation_setoid o2 o3 →
103 Ocontinuous_relation_setoid o1 o3.
104 intros (o1 o2 o3 r s); constructor 1;
108 change in match ((s ∘ r) U) with (s (r U));
109 apply (.= (Oreduced : ?)\sup -1);
110 [ apply (.= (Oreduced :?)); [ assumption | apply refl1 ]
114 change in match ((s ∘ r)⎻* U) with (s⎻* (r⎻* U));
115 apply (.= (Osaturated : ?)\sup -1);
116 [ apply (.= (Osaturated : ?)); [ assumption | apply refl1 ]
120 definition OBTop: category2.
122 [ apply Obasic_topology
123 | apply Ocontinuous_relation_setoid
124 | intro; constructor 1;
128 | intros; constructor 1;
129 [ apply Ocontinuous_relation_comp;
131 change with ((b⎻* ∘ a⎻* ) ∘ oA o1 = ((b'⎻* ∘ a'⎻* ) ∘ oA o1));
132 change with (b⎻* ∘ (a⎻* ∘ oA o1) = b'⎻* ∘ (a'⎻* ∘ oA o1));
133 change in e with (a⎻* ∘ oA o1 = a'⎻* ∘ oA o1);
134 change in e1 with (b⎻* ∘ oA o2 = b'⎻* ∘ oA o2);
137 change with (eq1 ? (b⎻* (a'⎻* (oA o1 x))) (b'⎻*(a'⎻* (oA o1 x))));
138 apply (.= †(Osaturated o1 o2 a' (oA o1 x) ?)); [
139 apply ((o_saturation_idempotent ?? (oA_is_saturation o1) x)^-1);]
140 apply (.= (e1 (a'⎻* (oA o1 x))));
141 change with (eq1 ? (b'⎻* (oA o2 (a'⎻* (oA o1 x)))) (b'⎻*(a'⎻* (oA o1 x))));
142 apply (.= †(Osaturated o1 o2 a' (oA o1 x):?)^-1); [
143 apply ((o_saturation_idempotent ?? (oA_is_saturation o1) x)^-1);]
146 change with (((a34⎻* ∘ a23⎻* ) ∘ a12⎻* ) ∘ oA o1 = ((a34⎻* ∘ (a23⎻* ∘ a12⎻* )) ∘ oA o1));
147 apply rule (#‡ASSOC ^ -1);
149 change with ((a⎻* ∘ (id2 ? o1)⎻* ) ∘ oA o1 = a⎻* ∘ oA o1);
150 apply (#‡(id_neutral_right2 : ?));
152 change with (((id2 ? o2)⎻* ∘ a⎻* ) ∘ oA o1 = a⎻* ∘ oA o1);
153 apply (#‡(id_neutral_left2 : ?));]
156 definition Obasic_topology_of_OBTop: objs2 OBTop → Obasic_topology ≝ λx.x.
157 coercion Obasic_topology_of_OBTop.
159 definition Ocontinuous_relation_setoid_of_arrows2_OBTop :
160 ∀P,Q. arrows2 OBTop P Q → Ocontinuous_relation_setoid P Q ≝ λP,Q,x.x.
161 coercion Ocontinuous_relation_setoid_of_arrows2_OBTop.
165 (* this proof is more logic-oriented than set/lattice oriented *)
166 theorem continuous_relation_eqS:
167 ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
168 a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
170 cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
171 [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
172 try assumption; split; assumption]
173 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));
174 [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
176 apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
177 assumption;] clear Hcut;
178 split; apply (if ?? (A_is_saturation ???)); intros 2;
179 [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
180 cases Hletin; clear Hletin; cases x; clear x;
181 cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
182 [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
183 exists [1,3: apply w] split; assumption;]
184 cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
185 [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
186 apply Hcut2; assumption.