]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/formal_topology/overlap/basic_topologies.ma
1) Some reorganization.
[helm.git] / helm / software / matita / contribs / formal_topology / overlap / basic_topologies.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "relations.ma".
16 include "saturations.ma".
17
18 record basic_topology: Type1 ≝
19  { carrbt:> REL;
20    A: unary_morphism1 (Ω \sup carrbt) (Ω \sup carrbt);
21    J: unary_morphism1 (Ω \sup carrbt) (Ω \sup 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)
25  }.
26
27 lemma hint: basic_topology → objs1 REL.
28  intro; apply (carrbt b);
29 qed.
30 coercion hint.
31
32 record continuous_relation (S,T: basic_topology) : Type1 ≝
33  { cont_rel:> arrows1 ? S T;
34    reduced: ∀U. U = J ? U → image ?? cont_rel U = J ? (image ?? cont_rel U);
35    saturated: ∀U. U = A ? U → minus_star_image ?? cont_rel U = A ? (minus_star_image ?? cont_rel U)
36  }. 
37 (*
38 definition continuous_relation_setoid: basic_topology → basic_topology → setoid1.
39  intros (S T); constructor 1;
40   [ apply (continuous_relation S T)
41   | constructor 1;
42      [ apply (λr,s:continuous_relation S T.∀b. A ? (ext ?? r b) = A ? (ext ?? s b));
43      | simplify; intros; apply refl1;
44      | simplify; intros; apply sym1; apply H
45      | simplify; intros; apply trans1; [2: apply H |3: apply H1; |1: skip]]]
46 qed.
47
48 definition cont_rel': ∀S,T: basic_topology. continuous_relation_setoid S T → arrows1 ? S T ≝ cont_rel.
49
50 coercion cont_rel'.
51
52 definition cont_rel'': ∀S,T: basic_topology. continuous_relation_setoid S T → binary_relation S T ≝ cont_rel.
53
54 coercion cont_rel''.
55
56 theorem continuous_relation_eq':
57  ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
58   a = a' → ∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X).
59  intros; split; intro; unfold minus_star_image; simplify; intros;
60   [ cut (ext ?? a a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
61     lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
62     cut (A ? (ext ?? a' a1) ⊆ A ? X); [2: apply (. (H ?)‡#); assumption]
63     lapply (fi ?? (A_is_saturation ???) Hcut);
64     apply (Hletin1 x); change with (x ∈ ext ?? a' a1); split; simplify;
65      [ apply I | assumption ]
66   | cut (ext ?? a' a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;]
67     lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut;
68     cut (A ? (ext ?? a a1) ⊆ A ? X); [2: apply (. (H ?)\sup -1‡#); assumption]
69     lapply (fi ?? (A_is_saturation ???) Hcut);
70     apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify;
71      [ apply I | assumption ]]
72 qed.
73
74 theorem continuous_relation_eq_inv':
75  ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
76   (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → a=a'.
77  intros 6;
78  cut (∀a,a': continuous_relation_setoid o1 o2.
79   (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → 
80    ∀V:o2. A ? (ext ?? a' V) ⊆ A ? (ext ?? a V));
81   [2: clear b H a' a; intros;
82       lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip]
83        (* fundamental adjunction here! to be taken out *)
84        cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V)));
85         [2: intro; intros 2; unfold minus_star_image; simplify; intros;
86             apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]]
87        clear Hletin;
88        cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V)));
89         [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut;
90        (* second half of the fundamental adjunction here! to be taken out too *)
91       intro; lapply (Hcut1 (singleton ? V)); clear Hcut1;
92       unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin;
93       whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin;
94       apply (if ?? (A_is_saturation ???));
95       intros 2 (x H); lapply (Hletin V ? x ?);
96        [ apply refl | cases H; assumption; ]
97       change with (x ∈ A ? (ext ?? a V));
98       apply (. #‡(†(extS_singleton ????)));
99       assumption;]
100  split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
101 qed.
102
103 definition continuous_relation_comp:
104  ∀o1,o2,o3.
105   continuous_relation_setoid o1 o2 →
106    continuous_relation_setoid o2 o3 →
107     continuous_relation_setoid o1 o3.
108  intros (o1 o2 o3 r s); constructor 1;
109   [ apply (s ∘ r)
110   | intros;
111     apply sym1;
112     apply (.= †(image_comp ??????));
113     apply (.= (reduced ?????)\sup -1);
114      [ apply (.= (reduced ?????)); [ assumption | apply refl1 ]
115      | apply (.= (image_comp ??????)\sup -1);
116        apply refl1]
117      | intros;
118        apply sym1;
119        apply (.= †(minus_star_image_comp ??????));
120        apply (.= (saturated ?????)\sup -1);
121         [ apply (.= (saturated ?????)); [ assumption | apply refl1 ]
122         | apply (.= (minus_star_image_comp ??????)\sup -1);
123           apply refl1]]
124 qed.
125
126 definition BTop: category1.
127  constructor 1;
128   [ apply basic_topology
129   | apply continuous_relation_setoid
130   | intro; constructor 1;
131      [ apply id1
132      | intros;
133        apply (.= (image_id ??));
134        apply sym1;
135        apply (.= †(image_id ??));
136        apply sym1;
137        assumption
138      | intros;
139        apply (.= (minus_star_image_id ??));
140        apply sym1;
141        apply (.= †(minus_star_image_id ??));
142        apply sym1;
143        assumption]
144   | intros; constructor 1;
145      [ apply continuous_relation_comp;
146      | intros; simplify; intro x; simplify;
147        lapply depth=0 (continuous_relation_eq' ???? H) as H';
148        lapply depth=0 (continuous_relation_eq' ???? H1) as H1';
149        letin K ≝ (λX.H1' (minus_star_image ?? a (A ? X))); clearbody K;
150        cut (∀X:Ω \sup o1.
151               minus_star_image o2 o3 b (A o2 (minus_star_image o1 o2 a (A o1 X)))
152             = minus_star_image o2 o3 b' (A o2 (minus_star_image o1 o2 a' (A o1 X))));
153         [2: intro; apply sym1; apply (.= #‡(†((H' ?)\sup -1))); apply sym1; apply (K X);]
154        clear K H' H1';
155        cut (∀X:Ω \sup o1.
156               minus_star_image o1 o3 (b ∘ a) (A o1 X) = minus_star_image o1 o3 (b'∘a') (A o1 X));
157         [2: intro;
158             apply (.= (minus_star_image_comp ??????));
159             apply (.= #‡(saturated ?????));
160              [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ]
161             apply sym1; 
162             apply (.= (minus_star_image_comp ??????));
163             apply (.= #‡(saturated ?????));
164              [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ]
165            apply ((Hcut X) \sup -1)]
166        clear Hcut; generalize in match x; clear x;
167        apply (continuous_relation_eq_inv');
168        apply Hcut1;]
169   | intros; simplify; intro; do 2 (unfold continuous_relation_comp); simplify;
170     apply (.= †(ASSOC1‡#));
171     apply refl1
172   | intros; simplify; intro; unfold continuous_relation_comp; simplify;
173     apply (.= †((id_neutral_right1 ????)‡#));
174     apply refl1
175   | intros; simplify; intro; simplify;
176     apply (.= †((id_neutral_left1 ????)‡#));
177     apply refl1]
178 qed.
179
180 (*
181 (*CSC: unused! *)
182 (* this proof is more logic-oriented than set/lattice oriented *)
183 theorem continuous_relation_eqS:
184  ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
185   a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
186  intros;
187  cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
188   [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
189       try assumption; split; assumption]
190  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));
191   [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
192       apply (. #‡(H1 ?));
193       apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
194       assumption;] clear Hcut;
195  split; apply (if ?? (A_is_saturation ???)); intros 2;
196   [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
197   cases Hletin; clear Hletin; cases x; clear x;
198  cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
199   [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
200       exists [1,3: apply w] split; assumption;]
201  cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
202   [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
203  apply Hcut2; assumption.
204 qed.
205 *)
206 *)