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 "formal_topology/o-algebra.ma".
16 include "formal_topology/o-saturations.ma".
18 record Obasic_topology: Type2 ≝ {
20 oA: Ocarrbt ⇒_2 Ocarrbt; oJ: Ocarrbt ⇒_2 Ocarrbt;
21 oA_is_saturation: is_o_saturation ? oA; oJ_is_reduction: is_o_reduction ? oJ;
22 Ocompatibility: ∀U,V. (oA U >< oJ V) =_1 (U >< oJ V)
25 record Ocontinuous_relation (S,T: Obasic_topology) : Type2 ≝ {
26 Ocont_rel:> arrows2 OA S T;
27 Oreduced: ∀U:S. U = oJ ? U → Ocont_rel U =_1 oJ ? (Ocont_rel U);
28 Osaturated: ∀U:S. U = oA ? U → Ocont_rel⎻* U =_1 oA ? (Ocont_rel⎻* U)
31 definition Ocontinuous_relation_setoid: Obasic_topology → Obasic_topology → setoid2.
32 intros (S T); constructor 1;
33 [ apply (Ocontinuous_relation S T)
35 [ alias symbol "eq" = "setoid2 eq".
36 alias symbol "compose" = "category2 composition".
37 apply (λr,s:Ocontinuous_relation S T. (r⎻* ) ∘ (oA S) = (s⎻* ∘ (oA ?)));
38 | simplify; intros; apply refl2;
39 | simplify; intros; apply sym2; apply e
40 | simplify; intros; apply trans2; [2: apply e |3: apply e1; |1: skip]]]
43 definition Ocontinuous_relation_of_Ocontinuous_relation_setoid:
44 ∀P,Q. Ocontinuous_relation_setoid P Q → Ocontinuous_relation P Q ≝ λP,Q,c.c.
45 coercion Ocontinuous_relation_of_Ocontinuous_relation_setoid.
48 theorem continuous_relation_eq':
49 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
50 a = a' → ∀X.a⎻* (A o1 X) = a'⎻* (A o1 X).
51 intros; apply oa_leq_antisym; 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 ]]
66 theorem 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'.
70 cut (∀a,a': continuous_relation_setoid o1 o2.
71 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) →
72 ∀V:(oa_P (carrbt o2)). A o1 (a'⎻ V) ≤ A o1 (a⎻ V));
73 [2: clear b H 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:Ω \sup o2.V ⊆ minus_star_image ?? 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]]
80 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
81 [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
82 (* second half of the fundamental adjunction here! to be taken out too *)
83 intro; lapply (Hcut1 (singleton ? 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 | cases H; assumption; ]
89 change with (x ∈ A ? (ext ?? a V));
90 apply (. #‡(†(extS_singleton ????)));
92 split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
96 definition Ocontinuous_relation_comp:
98 Ocontinuous_relation_setoid o1 o2 →
99 Ocontinuous_relation_setoid o2 o3 →
100 Ocontinuous_relation_setoid o1 o3.
101 intros (o1 o2 o3 r s); constructor 1;
105 change in match ((s ∘ r) U) with (s (r U));
106 apply (.= (Oreduced : ?)^-1);
107 [ apply (.= (Oreduced :?)); [ assumption | apply refl1 ]
111 change in match ((s ∘ r)⎻* U) with (s⎻* (r⎻* U));
112 apply (.= (Osaturated : ?)^-1);
113 [ apply (.= (Osaturated : ?)); [ assumption | apply refl1 ]
117 definition OBTop: category2.
119 [ apply Obasic_topology
120 | apply Ocontinuous_relation_setoid
121 | intro; constructor 1;
125 | intros; constructor 1;
126 [ apply Ocontinuous_relation_comp;
128 change with ((b⎻* ∘ a⎻* ) ∘ oA o1 = ((b'⎻* ∘ a'⎻* ) ∘ oA o1));
129 change with (b⎻* ∘ (a⎻* ∘ oA o1) = b'⎻* ∘ (a'⎻* ∘ oA o1));
130 change in e with (a⎻* ∘ oA o1 = a'⎻* ∘ oA o1);
131 change in e1 with (b⎻* ∘ oA o2 = b'⎻* ∘ oA o2);
134 change with (b⎻* (a'⎻* (oA o1 x)) =_1 b'⎻*(a'⎻* (oA o1 x)));
135 apply (.= †(Osaturated o1 o2 a' (oA o1 x) ?)); [
136 apply ((o_saturation_idempotent ?? (oA_is_saturation o1) x)^-1);]
137 apply (.= (e1 (a'⎻* (oA o1 x))));
138 change with (b'⎻* (oA o2 (a'⎻* (oA o1 x))) =_1 b'⎻*(a'⎻* (oA o1 x)));
139 apply (.= †(Osaturated o1 o2 a' (oA o1 x):?)^-1); [
140 apply ((o_saturation_idempotent ?? (oA_is_saturation o1) x)^-1);]
143 change with (((a34⎻* ∘ a23⎻* ) ∘ a12⎻* ) ∘ oA o1 = ((a34⎻* ∘ (a23⎻* ∘ a12⎻* )) ∘ oA o1));
144 apply rule (#‡ASSOC ^ -1);
146 change with ((a⎻* ∘ (id2 ? o1)⎻* ) ∘ oA o1 = a⎻* ∘ oA o1);
147 apply (#‡(id_neutral_right2 : ?));
149 change with (((id2 ? o2)⎻* ∘ a⎻* ) ∘ oA o1 = a⎻* ∘ oA o1);
150 apply (#‡(id_neutral_left2 : ?));]
153 definition Obasic_topology_of_OBTop: objs2 OBTop → Obasic_topology ≝ λx.x.
154 coercion Obasic_topology_of_OBTop.
156 definition Ocontinuous_relation_setoid_of_arrows2_OBTop :
157 ∀P,Q. arrows2 OBTop P Q → Ocontinuous_relation_setoid P Q ≝ λP,Q,x.x.
158 coercion Ocontinuous_relation_setoid_of_arrows2_OBTop.
160 notation > "B ⇒_\obt2 C" right associative with precedence 72 for @{'arrows2_OBT $B $C}.
161 notation "B ⇒\sub (\obt 2) C" right associative with precedence 72 for @{'arrows2_OBT $B $C}.
162 interpretation "'arrows2_OBT" 'arrows2_OBT A B = (arrows2 OBTop A B).
167 (* this proof is more logic-oriented than set/lattice oriented *)
168 theorem continuous_relation_eqS:
169 ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
170 a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
172 cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
173 [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
174 try assumption; split; assumption]
175 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));
176 [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
178 apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
179 assumption;] clear Hcut;
180 split; apply (if ?? (A_is_saturation ???)); intros 2;
181 [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
182 cases Hletin; clear Hletin; cases x; clear x;
183 cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
184 [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
185 exists [1,3: apply w] split; assumption;]
186 cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
187 [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
188 apply Hcut2; assumption.