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 (* reduces uses eq1, saturated uses eq!!! *)
30 reduced: ∀U. U = J ? U → cont_rel U = J ? (cont_rel U);
31 saturated: ∀U. U = A ? U → cont_rel⎻* U = A ? (cont_rel⎻* U)
34 definition continuous_relation_setoid: basic_topology → basic_topology → setoid1.
35 intros (S T); constructor 1;
36 [ apply (continuous_relation S T)
38 [ (*apply (λr,s:continuous_relation S T.∀b. eq1 (oa_P (carrbt S)) (A ? (r⎻ b)) (A ? (s⎻ b)));*)
39 apply (λr,s:continuous_relation S T.r⎻* ∘ (A S) = s⎻* ∘ (A ?));
40 | simplify; intros; apply refl1;
41 | simplify; intros; apply sym1; apply H
42 | simplify; intros; apply trans1; [2: apply H |3: apply H1; |1: skip]]]
45 definition cont_rel': ∀S,T: basic_topology. continuous_relation_setoid S T → arrows1 ? S T ≝ cont_rel.
49 definition cont_rel'':
51 continuous_relation_setoid S T → unary_morphism (oa_P (carrbt S)) (oa_P (carrbt T)).
52 intros; apply rule cont_rel; apply c;
57 theorem continuous_relation_eq':
58 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
59 a = a' → ∀X.a⎻* (A o1 X) = a'⎻* (A o1 X).
60 intros; apply oa_leq_antisym; intro; unfold minus_star_image; simplify; intros;
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 ?)‡#); assumption]
64 lapply (fi ?? (A_is_saturation ???) Hcut);
65 apply (Hletin1 x); change with (x ∈ ext ?? a' a1); split; simplify;
66 [ apply I | assumption ]
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 ?)\sup -1‡#); assumption]
70 lapply (fi ?? (A_is_saturation ???) Hcut);
71 apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify;
72 [ apply I | assumption ]]
75 theorem continuous_relation_eq_inv':
76 ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
77 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) → a=a'.
79 cut (∀a,a': continuous_relation_setoid o1 o2.
80 (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) →
81 ∀V:(oa_P (carrbt o2)). A o1 (a'⎻ V) ≤ A o1 (a⎻ V));
82 [2: clear b H a' a; intros;
83 lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip]
84 (* fundamental adjunction here! to be taken out *)
85 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V)));
86 [2: intro; intros 2; unfold minus_star_image; simplify; intros;
87 apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]]
89 cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
90 [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
91 (* second half of the fundamental adjunction here! to be taken out too *)
92 intro; lapply (Hcut1 (singleton ? V)); clear Hcut1;
93 unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin;
94 whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin;
95 apply (if ?? (A_is_saturation ???));
96 intros 2 (x H); lapply (Hletin V ? x ?);
97 [ apply refl | cases H; assumption; ]
98 change with (x ∈ A ? (ext ?? a V));
99 apply (. #‡(†(extS_singleton ????)));
101 split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
104 definition continuous_relation_comp:
106 continuous_relation_setoid o1 o2 →
107 continuous_relation_setoid o2 o3 →
108 continuous_relation_setoid o1 o3.
109 intros (o1 o2 o3 r s); constructor 1;
113 change in match ((s ∘ r) U) with (s (r U));
114 (*BAD*) unfold FunClass_1_OF_carr1;
115 apply (.= ((reduced : ?)\sup -1));
116 [ (*BAD*) change with (eq1 ? (r U) (J ? (r U)));
117 (* BAD U *) apply (.= (reduced ??? U ?)); [ assumption | apply refl1 ]
121 change in match ((s ∘ r)⎻* U) with (s⎻* (r⎻* U));
122 apply (.= (saturated : ?)\sup -1);
123 [ apply (.= (saturated : ?)); [ assumption | apply refl ]
127 definition BTop: category1.
129 [ apply basic_topology
130 | apply continuous_relation_setoid
131 | intro; constructor 1;
135 | intros; constructor 1;
136 [ apply continuous_relation_comp;
137 | intros; simplify; (*intro x; simplify;*)
138 change with (b⎻* ∘ (a⎻* ∘ A o1) = b'⎻* ∘ (a'⎻* ∘ A o1));
139 change in H with (a⎻* ∘ A o1 = a'⎻* ∘ A o1);
140 change in H1 with (b⎻* ∘ A o2 = b'⎻* ∘ A o2);
144 change with (eq1 (oa_P (carrbt o3)) (b⎻* (a'⎻* (A o1 x))) (b'⎻*(a'⎻* (A o1 x))));
145 lapply (saturated o1 o2 a' (A o1 x):?) as X;
146 [ apply ((saturation_idempotent ?? (A_is_saturation o1) x)^-1) ]
147 change in X with (eq1 (oa_P (carrbt o2)) (a'⎻* (A o1 x)) (A o2 (a'⎻* (A o1 x))));
148 unfold uncurry_arrows;
149 apply (.= †X); whd in H1;
150 lapply (H1 (a'⎻* (A o1 x))) as X1;
151 change in X1 with (eq1 (oa_P (carrbt o3)) (b⎻* (A o2 (a'⎻* (A o1 x)))) (b'⎻* (A o2 (a' \sup ⎻* (A o1 x)))));
153 unfold uncurry_arrows;
154 apply (†(X\sup -1));]
156 change with (((a34⎻* ∘ a23⎻* ) ∘ a12⎻* ) ∘ A o1 = ((a34⎻* ∘ (a23⎻* ∘ a12⎻* )) ∘ A o1));
157 apply rule (#‡ASSOC1\sup -1);
159 change with ((a⎻* ∘ (id1 ? o1)⎻* ) ∘ A o1 = a⎻* ∘ A o1);
160 apply rule (†((id_neutral_right1 ????)‡#));
162 | intros; simplify; intro; simplify;
163 apply (.= †((id_neutral_left1 ????)‡#));
169 (* this proof is more logic-oriented than set/lattice oriented *)
170 theorem continuous_relation_eqS:
171 ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
172 a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
174 cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
175 [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
176 try assumption; split; assumption]
177 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));
178 [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
180 apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
181 assumption;] clear Hcut;
182 split; apply (if ?? (A_is_saturation ???)); intros 2;
183 [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
184 cases Hletin; clear Hletin; cases x; clear x;
185 cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
186 [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
187 exists [1,3: apply w] split; assumption;]
188 cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
189 [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
190 apply Hcut2; assumption.