]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/formal_topology/overlap/basic_topologies.ma
some notation for map_arrows2
[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: Ω^carrbt ⇒_1 Ω^carrbt;
21    J: Ω^carrbt ⇒_1 Ω^carrbt;
22    A_is_saturation: is_saturation ? A;
23    J_is_reduction: is_reduction ? J;
24    compatibility: ∀U,V. (A U ≬ J V) =_1 (U ≬ J V)
25  }.
26
27 record continuous_relation (S,T: basic_topology) : Type1 ≝
28  { cont_rel:> arrows1 ? S T;
29    reduced: ∀U. U = J ? U → image ?? cont_rel U = J ? (image ?? cont_rel U);
30    saturated: ∀U. U = A ? U → minus_star_image ?? cont_rel U = A ? (minus_star_image ?? cont_rel U)
31  }. 
32
33 definition continuous_relation_setoid: basic_topology → basic_topology → setoid1.
34  intros (S T); constructor 1;
35   [ apply (continuous_relation S T)
36   | constructor 1;
37      [ apply (λr,s:continuous_relation S T.∀b. A ? (ext ?? r b) = A ? (ext ?? s b));
38      | simplify; intros; apply refl1;
39      | simplify; intros (x y H); apply sym1; apply H
40      | simplify; intros; apply trans1; [2: apply f |3: apply f1; |1: skip]]]
41 qed.
42
43 definition continuos_relation_of_continuous_relation_setoid :
44  ∀P,Q. continuous_relation_setoid P Q → continuous_relation P Q ≝ λP,Q,x.x.
45 coercion continuos_relation_of_continuous_relation_setoid.
46
47 axiom continuous_relation_eq':
48  ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
49   a = a' → ∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X).
50 (*
51  intros; split; 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 ]]
64 qed.*)
65
66 axiom continuous_relation_eq_inv':
67  ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2.
68   (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → a=a'.
69 (* intros 6;
70  cut (∀a,a': continuous_relation_setoid o1 o2.
71   (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → 
72    ∀V:o2. A ? (ext ?? a' V) ⊆ A ? (ext ?? 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]]
79        clear Hletin;
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 ????)));
91       assumption;]
92  split; apply Hcut; [2: assumption | intro; apply sym1; apply H]
93 qed.
94 *)
95
96 definition continuous_relation_comp:
97  ∀o1,o2,o3.
98   continuous_relation_setoid o1 o2 →
99    continuous_relation_setoid o2 o3 →
100     continuous_relation_setoid o1 o3.
101  intros (o1 o2 o3 r s); constructor 1;
102   [ apply (s ∘ r)
103   | intros;
104     apply sym1;
105     apply (.= †(image_comp ??????));
106     apply (.= (reduced ?????)\sup -1);
107      [ apply (.= (reduced ?????)); [ assumption | apply refl1 ]
108      | apply (.= (image_comp ??????)\sup -1);
109        apply refl1]
110      | intros;
111        apply sym1;
112        apply (.= †(minus_star_image_comp ??????));
113        apply (.= (saturated ?????)\sup -1);
114         [ apply (.= (saturated ?????)); [ assumption | apply refl1 ]
115         | apply (.= (minus_star_image_comp ??????)\sup -1);
116           apply refl1]]
117 qed.
118
119 definition BTop: category1.
120  constructor 1;
121   [ apply basic_topology
122   | apply continuous_relation_setoid
123   | intro; constructor 1;
124      [ apply id1
125      | intros;
126        apply (.= (image_id ??));
127        apply sym1;
128        apply (.= †(image_id ??));
129        apply sym1;
130        assumption
131      | intros;
132        apply (.= (minus_star_image_id ??));
133        apply sym1;
134        apply (.= †(minus_star_image_id ??));
135        apply sym1;
136        assumption]
137   | intros; constructor 1;
138      [ apply continuous_relation_comp;
139      | intros; simplify; intro x; simplify;
140        lapply depth=0 (continuous_relation_eq' ???? e) as H';
141        lapply depth=0 (continuous_relation_eq' ???? e1) as H1';
142        letin K ≝ (λX.H1' (minus_star_image ?? a (A ? X))); clearbody K;
143        cut (∀X:Ω \sup o1.
144               minus_star_image o2 o3 b (A o2 (minus_star_image o1 o2 a (A o1 X)))
145             = minus_star_image o2 o3 b' (A o2 (minus_star_image o1 o2 a' (A o1 X))));
146         [2: intro; apply sym1; apply (.= #‡(†((H' ?)\sup -1))); apply sym1; apply (K X);]
147        clear K H' H1';
148 alias symbol "compose" (instance 1) = "category1 composition".
149 cut (∀X:Ω^o1.
150               minus_star_image ?? (b ∘ a) (A o1 X) =_1 minus_star_image ?? (b'∘a') (A o1 X));
151         [2: intro;
152             apply (.= (minus_star_image_comp ??????));
153             apply (.= #‡(saturated ?????));
154              [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ]
155             apply sym1; 
156             apply (.= (minus_star_image_comp ??????));
157             apply (.= #‡(saturated ?????));
158              [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ]
159            apply ((Hcut X) \sup -1)]
160        clear Hcut; generalize in match x; clear x;
161        apply (continuous_relation_eq_inv');
162        apply Hcut1;]
163   | intros; simplify; intro; do 2 (unfold continuous_relation_comp); simplify;
164     alias symbol "trans" (instance 1) = "trans1".
165 alias symbol "refl" (instance 5) = "refl1".
166 alias symbol "prop2" (instance 3) = "prop21".
167 alias symbol "prop1" (instance 2) = "prop11".
168 alias symbol "assoc" (instance 4) = "category1 assoc".
169 apply (.= †(ASSOC‡#));
170     apply refl1
171   | intros; simplify; intro; unfold continuous_relation_comp; simplify;
172     apply (.= †((id_neutral_right1 ????)‡#));
173     apply refl1
174   | intros; simplify; intro; simplify;
175     apply (.= †((id_neutral_left1 ????)‡#));
176     apply refl1]
177 qed.
178
179 (*
180 (*CSC: unused! *)
181 (* this proof is more logic-oriented than set/lattice oriented *)
182 theorem continuous_relation_eqS:
183  ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2.
184   a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X).
185  intros;
186  cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y);
187   [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split;
188       try assumption; split; assumption]
189  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));
190   [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption;
191       apply (. #‡(H1 ?));
192       apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x);
193       assumption;] clear Hcut;
194  split; apply (if ?? (A_is_saturation ???)); intros 2;
195   [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)]
196   cases Hletin; clear Hletin; cases x; clear x;
197  cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X);
198   [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption;
199       exists [1,3: apply w] split; assumption;]
200  cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X));
201   [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;]
202  apply Hcut2; assumption.
203 qed.
204 *)