]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/formal_topology/relations.ma
update in groud_2 and models
[helm.git] / helm / software / matita / library / formal_topology / relations.ma
index 4b6c636354f3c615808d37028957ebfe9ca16774..789f312cf0260da24d333203d898af38a3abca3f 100644 (file)
@@ -140,25 +140,24 @@ definition ext: ∀X,S:REL. (X ⇒_\r1 S) × S ⇒_1 (Ω^X).
        apply (. (#‡e1)); whd in e; apply (fi ?? (e ??));assumption]]
 qed.
 
-(*
-definition extS: ∀X,S:REL. ∀r: arrows1 ? X S. Ω \sup S ⇒ Ω \sup X.
+definition extS: ∀X,S:REL. ∀r:X ⇒_\r1 S. Ω^S ⇒_1 Ω^X.
  (* ∃ is not yet a morphism apply (λX,S,r,F.{x ∈ X | ∃a. a ∈ F ∧ x ♮r a});*)
  intros (X S r); constructor 1;
   [ intro F; constructor 1; constructor 1;
     [ apply (λx. x ∈ X ∧ ∃a:S. a ∈ F ∧ x ♮r a);
     | intros; split; intro; cases f (H1 H2); clear f; split;
-       [ apply (. (H‡#)); assumption
-       |3: apply (. (H\sup -1‡#)); assumption
+       [ apply (. (e^-1‡#)); assumption
+       |3: apply (. (e‡#)); assumption
        |2,4: cases H2 (w H3); exists; [1,3: apply w]
-         [ apply (. (#‡(H‡#))); assumption
-         | apply (. (#‡(H \sup -1‡#))); assumption]]]
-  | intros; split; simplify; intros; cases f; cases H1; split;
+         [ apply (. (#‡(e^-1‡#))); assumption
+         | apply (. (#‡(e‡#))); assumption]]]
+  | intros; split; simplify; intros; cases f; cases e1; split;
      [1,3: assumption
      |2,4: exists; [1,3: apply w]
-      [ apply (. (#‡H)‡#); assumption
-      | apply (. (#‡H\sup -1)‡#); assumption]]]
+      [ apply (. (#‡e^-1)‡#); assumption
+      | apply (. (#‡e)‡#); assumption]]]
 qed.
-
+(*
 lemma equalset_extS_id_X_X: ∀o:REL.∀X.extS ?? (id1 ? o) X = X.
  intros;
  unfold extS; simplify;
@@ -193,88 +192,113 @@ qed.
 *)
 
 (* the same as ⋄ for a basic pair *)
-definition image: ∀U,V:REL. (U ⇒_\r1 V) × Ω^U ⇒_1 Ω^V.
+definition image: ∀U,V:REL. (U ⇒_\r1 V) ⇒_2 (Ω^U ⇒_2 Ω^V).
  intros; constructor 1;
-  [ apply (λr:U ⇒_\r1 V.λS: Ω \sup U. {y | ∃x:U. x ♮r y ∧ x ∈ S });
-    intros; simplify; split; intro; cases e1; exists [1,3: apply w]
+ [ intro r; constructor 1;
+   [ apply (λS: Ω^U. {y | ∃x:U. x ♮r y ∧ x ∈ S });
+     intros; simplify; split; intro; cases e1; exists [1,3: apply w]
      [ apply (. (#‡e^-1)‡#); assumption
      | apply (. (#‡e)‡#); assumption]
-  | intros; split; simplify; intros; cases e2; exists [1,3: apply w]
-     [ apply (. #‡(#‡e1^-1)); cases x; split; try assumption;
-       apply (if ?? (e ??)); assumption
-     | apply (. #‡(#‡e1)); cases x; split; try assumption;
-       apply (if ?? (e ^ -1 ??)); assumption]]
+   | intros; split; 
+     [ intro y; simplify; intro yA; cases yA; exists; [ apply w ];
+       apply (. #‡(#‡e^-1)); assumption;
+     | intro y; simplify; intro yA; cases yA; exists; [ apply w ];
+       apply (. #‡(#‡e)); assumption;]]
+ | simplify; intros; intro y; simplify; split; simplify; intros (b H); cases H;
+   exists; [1,3: apply w]; cases x; split; try assumption;
+   [ apply (if ?? (e ??)); | apply (fi ?? (e ??)); ] assumption;]
 qed.
 
 (* the same as □ for a basic pair *)
-definition minus_star_image: ∀U,V:REL. (U ⇒_\r1 V) × Ω^U ⇒_1 Ω^V.
- intros; constructor 1;
-  [ apply (λr:U ⇒_\r1 V.λS: Ω \sup U. {y | ∀x:U. x ♮r y → x ∈ S});
-    intros; simplify; split; intros; apply f;
-     [ apply (. #‡e); assumption
-     | apply (. #‡e ^ -1); assumption]
-  | intros; split; simplify; intros; [ apply (. #‡e1^ -1); | apply (. #‡e1 )]
-    apply f; [ apply (if ?? (e ^ -1 ??)); | apply (if ?? (e ??)) ] assumption]
+definition minus_star_image: ∀U,V:REL. (U ⇒_\r1 V) ⇒_2 (Ω^U ⇒_2 Ω^V).
+ intros; constructor 1; intros;
+  [ constructor 1;
+    [ apply (λS: Ω^U. {y | ∀x:U. x ♮c y → x ∈ S});
+      intros; simplify; split; intros; apply f;
+      [ apply (. #‡e); | apply (. #‡e ^ -1)] assumption;
+    | intros; split; intro; simplify; intros;
+      [ apply (. #‡e^-1);| apply (. #‡e); ] apply f; assumption;]
+  | intros; intro; simplify; split; simplify; intros; apply f;
+    [ apply (. (e x a2)); assumption | apply (. (e^-1 x a2)); assumption]]
 qed.
 
 (* the same as Rest for a basic pair *)
-definition star_image: ∀U,V:REL. (U ⇒_\r1 V) × Ω^V ⇒_1 Ω^U.
+definition star_image: ∀U,V:REL. (U ⇒_\r1 V) ⇒_2 (Ω^V ⇒_2 Ω^U).
  intros; constructor 1;
-  [ apply (λr:U ⇒_\r1 V.λS: Ω \sup V. {x | ∀y:V. x ♮r y → y ∈ S});
-    intros; simplify; split; intros; apply f;
-     [ apply (. e ‡#); assumption
-     | apply (. e^ -1‡#); assumption]
-  | intros; split; simplify; intros; [ apply (. #‡e1 ^ -1); | apply (. #‡e1)]
-    apply f; [ apply (if ?? (e ^ -1 ??)); | apply (if ?? (e ??)) ] assumption]
+  [ intro r; constructor 1; 
+    [ apply (λS: Ω \sup V. {x | ∀y:V. x ♮r y → y ∈ S});
+      intros; simplify; split; intros; apply f;
+      [ apply (. e ‡#);| apply (. e^ -1‡#);] assumption;
+    | intros; split; simplify; intros;
+      [ apply (. #‡e^-1);| apply (. #‡e); ] apply f; assumption;]
+  | intros; intro; simplify; split; simplify; intros; apply f; 
+    [ apply (. e a2 y); | apply (. e^-1 a2 y)] assumption;]
 qed.
 
 (* the same as Ext for a basic pair *)
-definition minus_image: ∀U,V:REL. (U ⇒_\r1 V) × Ω^V ⇒_1 Ω^U.
+definition minus_image: ∀U,V:REL. (U ⇒_\r1 V) ⇒_2 (Ω^V ⇒_2 Ω^U).
  intros; constructor 1;
-  [ apply (λr:U ⇒_\r1 V.λS: Ω \sup V. {x | (*∃x:U. x ♮r y ∧ x ∈ S*)
-      exT ? (λy:V.x ♮r y ∧ y ∈ S) });
-    intros; simplify; split; intro; cases e1; exists [1,3: apply w]
-     [ apply (. (e ^ -1‡#)‡#); assumption
-     | apply (. (e‡#)‡#); assumption]
-  | intros; split; simplify; intros; cases e2; exists [1,3: apply w]
-     [ apply (. #‡(#‡e1 ^ -1)); cases x; split; try assumption;
-       apply (if ?? (e ??)); assumption
-     | apply (. #‡(#‡e1)); cases x; split; try assumption;
-       apply (if ?? (e ^ -1 ??)); assumption]]
+  [ intro r; constructor 1; 
+    [ apply (λS: Ω^V. {x | ∃y:V. x ♮r y ∧ y ∈ S }).
+      intros; simplify; split; intros; cases e1; cases x; exists; [1,3: apply w]
+      split; try assumption; [ apply (. (e^-1‡#)); | apply (. (e‡#));] assumption;
+    | intros; simplify; split; simplify; intros; cases e1; cases x; 
+      exists [1,3: apply w] split; try assumption;
+      [ apply (. (#‡e^-1)); | apply (. (#‡e));] assumption]
+  | intros; intro; simplify; split; simplify; intros; cases e1; exists [1,3: apply w]
+    cases x; split; try assumption;
+    [ apply (. e^-1 a2 w); | apply (. e a2 w)] assumption;]
 qed.
 
+definition foo : ∀o1,o2:REL.carr1 (o1 ⇒_\r1 o2) → carr2 (setoid2_of_setoid1 (o1 ⇒_\r1 o2)) ≝ λo1,o2,x.x.
+
+interpretation "relation f⎻*" 'OR_f_minus_star r = (fun12 ?? (minus_star_image ? ?) (foo ?? r)).
+interpretation "relation f⎻" 'OR_f_minus r = (fun12 ?? (minus_image ? ?) (foo ?? r)).
+interpretation "relation f*" 'OR_f_star r = (fun12 ?? (star_image ? ?) (foo ?? r)).
+
+definition image_coercion: ∀U,V:REL. (U ⇒_\r1 V) → Ω^U ⇒_2 Ω^V.
+intros (U V r Us); apply (image U V r); qed.
+coercion image_coercion.
+
 (* minus_image is the same as ext *)
 
-theorem image_id: ∀o,U. image o o (id1 REL o) U = U.
- intros; unfold image; simplify; split; simplify; intros;
+theorem image_id: ∀o. (id1 REL o : carr2 (Ω^o ⇒_2 Ω^o)) =_1 (id2 SET1 Ω^o).
+ intros; unfold image_coercion; unfold image; simplify;
+ whd in match (?:carr2 ?);
+  intro U; simplify; split; simplify; intros;
   [ change with (a ∈ U);
-    cases e; cases x; change in f with (eq1 ? w a); apply (. f^-1‡#); assumption
+    cases e; cases x; change in e1 with (w =_1 a); apply (. e1^-1‡#); assumption
   | change in f with (a ∈ U);
     exists; [apply a] split; [ change with (a = a); apply refl1 | assumption]]
 qed.
 
-theorem minus_star_image_id: ∀o,U. minus_star_image o o (id1 REL o) U = U.
- intros; unfold minus_star_image; simplify; split; simplify; intros;
+theorem minus_star_image_id: ∀o:REL. 
+  ((id1 REL o)⎻* : carr2 (Ω^o ⇒_2 Ω^o)) =_1 (id2 SET1 Ω^o).
+ intros; unfold minus_star_image; simplify; intro U; simplify; 
+ split; simplify; intros;
   [ change with (a ∈ U); apply f; change with (a=a); apply refl1
   | change in f1 with (eq1 ? x a); apply (. f1‡#); apply f]
 qed.
 
-alias symbol "compose" (instance 2) = "category1 composition".
-theorem image_comp: ∀A,B,C,r,s,X. image A C (r ∘ s) X = image B C r (image A B s X).
- intros; unfold image; simplify; split; simplify; intros; cases e; clear e; cases x;
- clear x; [ cases f; clear f; | cases f1; clear f1 ]
- exists; try assumption; cases x; clear x; split; try assumption;
- exists; try assumption; split; assumption.
+alias symbol "compose" (instance 5) = "category2 composition".
+alias symbol "compose" (instance 4) = "category1 composition".
+theorem image_comp: ∀A,B,C.∀r:B ⇒_\r1 C.∀s:A ⇒_\r1 B. 
+  ((r ∘ s) : carr2 (Ω^A ⇒_2 Ω^C)) =_1 r ∘ s.
+ intros; intro U; split; intro x; (unfold image; unfold SET1; simplify);
+ intro H; cases H; 
+ cases x1; [cases f|cases f1]; exists; [1,3: apply w1] cases x2; split; try assumption;
+   exists; try assumption; split; assumption;
 qed.
 
 theorem minus_star_image_comp:
- ∀A,B,C,r,s,X.
-  minus_star_image A C (r ∘ s) X = minus_star_image B C r (minus_star_image A B s X).
- intros; unfold minus_star_image; simplify; split; simplify; intros; whd; intros;
-  [ apply f; exists; try assumption; split; assumption
 | change with (x ∈ X); cases f1; cases x1; apply f; assumption]
+ ∀A,B,C.∀r:B ⇒_\r1 C.∀s:A ⇒_\r1 B.
+  minus_star_image A C (r ∘ s) =_1 minus_star_image B C r ∘ (minus_star_image A B s).
+ intros; unfold minus_star_image; intro X; simplify; split; simplify; intros;
+ [ whd; intros; simplify; whd; intros; apply f; exists; try assumption; split; assumption;
| cases f1; cases x1; apply f; assumption]
 qed.
 
+
 (*
 (*CSC: unused! *)
 theorem ext_comp:
@@ -290,13 +314,13 @@ theorem ext_comp:
   | cases H; clear H; cases x1; clear x1; exists [apply w]; split;
      [2: cases f] assumption]
 qed.
+*)
+
+axiom daemon : False.
 
 theorem extS_singleton:
- ∀o1,o2.∀a:arrows1 ? o1 o2.∀x.extS o1 o2 a (singleton o2 x) = ext o1 o2 a x.
+ ∀o1,o2.∀a.∀x.extS o1 o2 a {(x)} = ext o1 o2 a x. 
  intros; unfold extS; unfold ext; unfold singleton; simplify;
- split; intros 2; simplify; cases f; split; try assumption;
-  [ cases H; cases x1; change in f2 with (eq1 ? x w); apply (. #‡f2 \sup -1);
-    assumption
-  | exists; try assumption; split; try assumption; change with (x = x); apply refl]
-qed.
-*)
+ split; intros 2; simplify; simplify in f; 
+ [ cases f; cases e; cases x1; change in f2 with (x =_1 w); apply (. #‡f2); assumption;
+ | split; try apply I; exists [apply x] split; try assumption; change with (x = x); apply rule #;] qed.
\ No newline at end of file