]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/contribs/formal_topology/overlap/relations_to_o-algebra.ma
moved formal_topology into library"
[helm.git] / helm / software / matita / contribs / formal_topology / overlap / relations_to_o-algebra.ma
diff --git a/helm/software/matita/contribs/formal_topology/overlap/relations_to_o-algebra.ma b/helm/software/matita/contribs/formal_topology/overlap/relations_to_o-algebra.ma
deleted file mode 100644 (file)
index 8bf57da..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||M||                                                             *)
-(*      ||A||       A project by Andrea Asperti                           *)
-(*      ||T||                                                             *)
-(*      ||I||       Developers:                                           *)
-(*      ||T||         The HELM team.                                      *)
-(*      ||A||         http://helm.cs.unibo.it                             *)
-(*      \   /                                                             *)
-(*       \ /        This file is distributed under the terms of the       *)
-(*        v         GNU General Public License Version 2                  *)
-(*                                                                        *)
-(**************************************************************************)
-
-include "relations.ma".
-include "o-algebra.ma".
-
-definition POW': objs1 SET → OAlgebra.
- intro A; constructor 1;
-  [ apply (Ω^A);
-  | apply subseteq;
-  | apply overlaps;
-  | apply big_intersects;
-  | apply big_union;
-  | apply ({x | True});
-    simplify; intros; apply (refl1 ? (eq1 CPROP));
-  | apply ({x | False});
-    simplify; intros; apply (refl1 ? (eq1 CPROP));
-  | intros; whd; intros; assumption
-  | intros; whd; split; assumption
-  | intros; apply transitive_subseteq_operator; [2: apply f; | skip | assumption]
-  | intros; cases f; exists [apply w] assumption
-  | intros; split; [ intros 4; apply (f ? f1 i); | intros 3; intro; apply (f i ? f1); ]
-  | intros; split;
-     [ intros 4; apply f; exists; [apply i] assumption;
-     | intros 3; intros; cases f1; apply (f w a x); ]
-  | intros 3; cases f;
-  | intros 3; constructor 1;
-  | intros; cases f; exists; [apply w]
-     [ assumption
-     | whd; intros; cases i; simplify; assumption]
-  | intros; split; intro;
-     [ (** screenshot "screen-pow". *) cases f; cases x1; exists [apply w1] exists [apply w] assumption;
-     | cases e; cases x; exists; [apply w1] [ assumption | exists; [apply w] assumption]]
-  | intros; intros 2; cases (f {(a)} ?); 
-     [ exists; [apply a] [assumption | change with (a = a); apply refl1;]
-     | change in x1 with (a = w); change with (mem A a q); apply (. (x1‡#));
-       assumption]]
-qed.
-
-definition powerset_of_POW': ∀A.oa_P (POW' A) → Ω^A ≝ λA,x.x.
-coercion powerset_of_POW'.
-
-definition orelation_of_relation: ∀o1,o2:REL. o1 ⇒_\r1 o2 → (POW' o1) ⇒_\o2 (POW' o2).
- intros;
- constructor 1;
-  [ constructor 1; 
-     [ apply (λU.image ?? c U);
-     | intros; apply (#‡e); ]
-  | constructor 1;
-     [ apply (λU.minus_star_image ?? c U);
-     | intros; apply (#‡e); ]
-  | constructor 1;
-     [ apply (λU.star_image ?? c U);
-     | intros; apply (#‡e); ]
-  | constructor 1;
-     [ apply (λU.minus_image ?? c U);
-     | intros; apply (#‡e); ]
-  | intros; split; intro;
-     [ change in f with (∀a. a ∈ image ?? c p → a ∈ q);
-       change with (∀a:o1. a ∈ p → a ∈ star_image ?? c q);
-       intros 4; apply f; exists; [apply a] split; assumption;
-     | change in f with (∀a:o1. a ∈ p → a ∈ star_image ?? c q);
-       change with (∀a. a ∈ image ?? c p → a ∈ q);
-       intros; cases f1; cases x; clear f1 x; apply (f ? f3); assumption; ]
-  | intros; split; intro;
-     [ change in f with (∀a. a ∈ minus_image ?? c p → a ∈ q);
-       change with (∀a:o2. a ∈ p → a ∈ minus_star_image ?? c q);
-       intros 4; apply f; exists; [apply a] split; assumption;
-     | change in f with (∀a:o2. a ∈ p → a ∈ minus_star_image ?? c q);
-       change with (∀a. a ∈ minus_image ?? c p → a ∈ q);
-       intros; cases f1; cases x; clear f1 x; apply (f ? f3); assumption; ]
-  | intros; split; intro; cases f; clear f;
-     [ cases x; cases x2; clear x x2; exists; [apply w1]
-        [ assumption;
-        | exists; [apply w] split; assumption]
-     | cases x1; cases x2; clear x1 x2; exists; [apply w1]
-        [ exists; [apply w] split; assumption;
-        | assumption; ]]]
-qed.
-
-lemma orelation_of_relation_preserves_equality:
- ∀o1,o2:REL.∀t,t': o1 ⇒_\r1 o2. 
-   t = t' → orelation_of_relation ?? t =_2 orelation_of_relation ?? t'.
- intros; split; unfold orelation_of_relation; simplify; intro; split; intro;
- simplify; whd in o1 o2;
-  [ change with (a1 ∈ minus_star_image ?? t a → a1 ∈ minus_star_image ?? t' a);
-    apply (. #‡(e^-1‡#));
-  | change with (a1 ∈ minus_star_image ?? t' a → a1 ∈ minus_star_image ?? t a);
-    apply (. #‡(e‡#));
-  | change with (a1 ∈ minus_image ?? t a → a1 ∈ minus_image ?? t' a);
-    apply (. #‡(e ^ -1‡#));
-  | change with (a1 ∈ minus_image ?? t' a → a1 ∈ minus_image ?? t a);
-    apply (. #‡(e‡#));
-  | change with (a1 ∈ image ?? t a → a1 ∈ image ?? t' a);
-    apply (. #‡(e ^ -1‡#));
-  | change with (a1 ∈ image ?? t' a → a1 ∈ image ?? t a);
-    apply (. #‡(e‡#));
-  | change with (a1 ∈ star_image ?? t a → a1 ∈ star_image ?? t' a);
-    apply (. #‡(e ^ -1‡#));
-  | change with (a1 ∈ star_image ?? t' a → a1 ∈ star_image ?? t a);
-    apply (. #‡(e‡#)); ]
-qed.
-
-lemma orelation_of_relation_preserves_identity:
- ∀o1:REL. orelation_of_relation ?? (id1 ? o1) =_2 id2 OA (POW' o1).
- intros; split; intro; split; whd; intro; 
-  [ change with ((∀x. x ♮(id1 REL o1) a1→x∈a) → a1 ∈ a); intros;
-    apply (f a1); change with (a1 = a1); apply refl1;
-  | change with (a1 ∈ a → ∀x. x ♮(id1 REL o1) a1→x∈a); intros;
-    change in f1 with (x = a1); apply (. f1‡#); apply f;
-  | alias symbol "and" = "and_morphism".
-    change with ((∃y:o1.a1 ♮(id1 REL o1) y ∧ y∈a) → a1 ∈ a);
-    intro; cases e; clear e; cases x; clear x; change in f with (a1=w);
-    apply (. f‡#); apply f1;
-  | change with (a1 ∈ a → ∃y:o1.a1 ♮(id1 REL o1) y ∧ y∈a);
-    intro; exists; [apply a1]; split; [ change with (a1=a1); apply refl1; | apply f]
-  | change with ((∃x:o1.x ♮(id1 REL o1) a1∧x∈a) → a1 ∈ a);
-    intro; cases e; clear e; cases x; clear x; change in f with (w=a1);
-    apply (. f^-1‡#); apply f1;
-  | change with (a1 ∈ a → ∃x:o1.x ♮(id1 REL o1) a1∧x∈a);
-    intro; exists; [apply a1]; split; [ change with (a1=a1); apply refl1; | apply f]
-  | change with ((∀y.a1 ♮(id1 REL o1) y→y∈a) → a1 ∈ a); intros;
-    apply (f a1); change with (a1 = a1); apply refl1;
-  | change with (a1 ∈ a → ∀y.a1 ♮(id1 REL o1) y→y∈a); intros;
-    change in f1 with (a1 = y); apply (. f1^-1‡#); apply f;]
-qed.
-
-(* CSC: ???? forse un uncertain mancato *)
-alias symbol "eq" = "setoid2 eq".
-alias symbol "compose" = "category1 composition".
-lemma orelation_of_relation_preserves_composition:
- ∀o1,o2,o3:REL.∀F: o1 ⇒_\r1 o2.∀G: o2 ⇒_\r1 o3.
-  orelation_of_relation ?? (G ∘ F) = 
-  comp2 OA ??? (orelation_of_relation ?? F) (orelation_of_relation ?? G).
- intros; split; intro; split; whd; intro; whd in ⊢ (% → %); intros;
-  [ whd; intros; apply f; exists; [ apply x] split; assumption; 
-  | cases f1; clear f1; cases x1; clear x1; apply (f w); assumption;
-  | cases e; cases x; cases f; cases x1; clear e x f x1; exists; [ apply w1 ]
-    split; [ assumption | exists; [apply w] split; assumption ]
-  | cases e; cases x; cases f1; cases x1; clear e x f1 x1; exists; [apply w1 ]
-    split; [ exists; [apply w] split; assumption | assumption ]
-  | unfold arrows1_of_ORelation_setoid; 
-    cases e; cases x; cases f; cases x1; clear e x f x1; exists; [ apply w1 ]
-    split; [ assumption | exists; [apply w] split; assumption ]
-  | unfold arrows1_of_ORelation_setoid in e; 
-    cases e; cases x; cases f1; cases x1; clear e x f1 x1; exists; [apply w1 ]
-    split; [ exists; [apply w] split; assumption | assumption ]
-  | whd; intros; apply f; exists; [ apply y] split; assumption;
-  | cases f1; clear f1; cases x; clear x; apply (f w); assumption;]
-qed.
-
-definition POW: carr3 (arrows3 CAT2 (category2_of_category1 REL) OA).
- constructor 1;
-  [ apply POW';
-  | intros; constructor 1;
-     [ apply (orelation_of_relation S T);
-     | intros; apply (orelation_of_relation_preserves_equality S T a a' e); ]
-  | apply orelation_of_relation_preserves_identity;
-  | apply orelation_of_relation_preserves_composition; ]
-qed.
-
-theorem POW_faithful:
- ∀S,T.∀f,g:arrows2 (category2_of_category1 REL) S T.
-   POW⎽⇒ f =_2 POW⎽⇒ g → f =_2 g.
- intros; unfold POW in e; simplify in e; cases e;
- unfold orelation_of_relation in e3; simplify in e3; clear e e1 e2 e4;
- intros 2; cases (e3 {(x)}); 
- split; intro; [ lapply (s y); | lapply (s1 y); ]
-  [2,4: exists; [1,3:apply x] split; [1,3: assumption |*: change with (x=x); apply rule #]
-  |*: cases Hletin; cases x1; change in f3 with (x =_1 w); apply (. f3‡#); assumption;]
-qed.
-
-
-lemma currify: ∀A,B,C. (A × B ⇒_1 C) → A → (B ⇒_1 C).
-intros; constructor 1; [ apply (b c); | intros; apply (#‡e);]
-qed.
-
-theorem POW_full: ∀S,T.∀f: (POW S) ⇒_\o2 (POW T) . exT22 ? (λg. POW⎽⇒ g = f).
- intros; exists;
-  [ constructor 1; constructor 1;
-     [ apply (λx:carr S.λy:carr T. y ∈ f {(x)});
-     | intros; unfold FunClass_1_OF_carr2; lapply (.= e1‡#);
-        [4: apply mem; |6: apply Hletin;|1,2,3,5: skip]
-       lapply (#‡prop11 ?? f ?? (†e)); [6: apply Hletin; |*:skip ]]  
-     | whd; split; whd; intro; simplify; unfold map_arrows2; simplify; 
-        [ split;
-           [ change with (∀a1.(∀x. a1 ∈ (f {(x):S}) → x ∈ a) → a1 ∈ f⎻* a);
-           | change with (∀a1.a1 ∈ f⎻* a → (∀x.a1 ∈ f {(x):S} → x ∈ a)); ]
-        | split;
-           [ change with (∀a1.(∃y:carr T. y ∈ f {(a1):S} ∧ y ∈ a) → a1 ∈ f⎻ a);
-           | change with (∀a1.a1 ∈ f⎻ a → (∃y:carr T.y ∈ f {(a1):S} ∧ y ∈ a)); ]
-        | split;
-           [ change with (∀a1.(∃x:carr S. a1 ∈ f {(x):S} ∧ x ∈ a) → a1 ∈ f a);
-           | change with (∀a1.a1 ∈. f a → (∃x:carr S. a1 ∈ f {(x):S} ∧ x ∈ a)); ]
-        | split;
-           [ change with (∀a1.(∀y. y ∈ f {(a1):S} → y ∈ a) → a1 ∈ f* a);
-           | change with (∀a1.a1 ∈ f* a → (∀y. y ∈ f {(a1):S} → y ∈ a)); ]]
-        [ intros; apply ((. (or_prop2 ?? f (singleton ? a1) a)^-1) ? a1);
-           [ intros 2; apply (f1 a2); change in f2 with (a2 ∈ f⎻ (singleton ? a1));
-             lapply (. (or_prop3 ?? f (singleton ? a2) (singleton ? a1)));
-              [ cases Hletin; change in x1 with (eq1 ? a1 w);
-                apply (. x1‡#); assumption;
-              | exists; [apply a2] [change with (a2=a2); apply rule #; | assumption]]
-           | change with (a1 = a1); apply rule #; ]
-        | intros; apply ((. (or_prop2 ?? f (singleton ? a1) a)) ? x);
-           [ intros 2; change in f3 with (eq1 ? a1 a2); change with (a2 ∈ f⎻* a); apply (. f3^-1‡#);
-             assumption;
-           | lapply (. (or_prop3 ?? f (singleton ? x) (singleton ? a1))^-1);
-              [ cases Hletin; change in x1 with (eq1 ? x w);
-                change with (x ∈ f⎻ (singleton ? a1)); apply (. x1‡#); assumption;
-              | exists; [apply a1] [assumption | change with (a1=a1); apply rule #; ]]]
-        | intros; cases e; cases x; clear e x;
-          lapply (. (or_prop3 ?? f (singleton ? a1) a)^-1);
-           [ cases Hletin; change in x with (eq1 ? a1 w1); apply (. x‡#); assumption;
-           | exists; [apply w] assumption ]
-        | intros; lapply (. (or_prop3 ?? f (singleton ? a1) a));
-           [ cases Hletin; exists; [apply w] split; assumption;
-           | exists; [apply a1] [change with (a1=a1); apply rule #; | assumption ]] 
-        | intros; cases e; cases x; clear e x;
-          apply (f_image_monotone ?? f (singleton ? w) a ? a1);
-           [ intros 2; change in f3 with (eq1 ? w a2); change with (a2 ∈ a);
-             apply (. f3^-1‡#); assumption;
-           | assumption; ]
-        | intros; lapply (. (or_prop3 ?? f a (singleton ? a1))^-1);
-           [ cases Hletin; exists; [apply w] split;
-              [ lapply (. (or_prop3 ?? f (singleton ? w) (singleton ? a1)));
-                 [ cases Hletin1; change in x3 with (eq1 ? a1 w1); apply (. x3‡#); assumption;
-                 | exists; [apply w] [change with (w=w); apply rule #; | assumption ]]
-              | assumption ]
-           | exists; [apply a1] [ assumption; | change with (a1=a1); apply rule #;]]
-        | intros; apply ((. (or_prop1 ?? f (singleton ? a1) a)^-1) ? a1);
-           [ apply f1; | change with (a1=a1); apply rule #; ]
-        | intros; apply ((. (or_prop1 ?? f (singleton ? a1) a)) ? y);
-           [ intros 2; change in f3 with (eq1 ? a1 a2); change with (a2 ∈ f* a);
-             apply (. f3^-1‡#); assumption;
-           | assumption ]]]
-qed.
\ No newline at end of file