]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/formal_topology/concrete_spaces.ma
Setoids are now more pervasive.
[helm.git] / helm / software / matita / library / formal_topology / concrete_spaces.ma
index ec32fca817fcc6723f51fc777d9c13a04b6b815b..89665e5f9de8ec6d93649bd43fc4506748609bb9 100644 (file)
 
 include "formal_topology/basic_pairs.ma".
 
-interpretation "REL carrier" 'card c = (carrier c).
-
-definition comprehension: ∀b:REL. (b → CProp) → Ω \sup |b| ≝
- λb:REL.λP.{x | ∃p: x ∈ b. P (mk_ssigma ?? x p)}.
+definition comprehension: ∀b:REL. (b ⇒ CPROP) → Ω \sup b.
+ apply (λb:REL. λP: b ⇒ CPROP. {x | x ∈ b ∧ P x});
+ intros; simplify; apply (.= (H‡#)‡(†H)); apply refl1.
+qed.
 
 interpretation "subset comprehension" 'comprehension s p =
- (comprehension s p).
+ (comprehension s (mk_unary_morphism __ p _)).
+
+definition ext: ∀X,S:REL. ∀r: arrows1 ? X S. S ⇒ Ω \sup X.
+ apply (λX,S,r.mk_unary_morphism ?? (λf.{x ∈ X | x ♮r f}) ?);
+  [ intros; simplify; apply (.= (H‡#)); apply refl1
+  | intros; simplify; split; intros; simplify; intros;
+     [ apply (. #‡(#‡H)); assumption
+     | apply (. #‡(#‡H\sup -1)); assumption]]
+qed.
 
-definition ext: ∀o: basic_pair. form o → Ω \sup |(concr o)| ≝
- λo,f.{x ∈ (concr o) | x ♮(rel o) f}.
+definition extS: ∀X,S:REL. ∀r: arrows1 ? X S. Ω \sup S ⇒ Ω \sup 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
+       |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;
+     [1,3: assumption
+     |2,4: exists; [1,3: apply w]
+      [ apply (. (#‡H)‡#); assumption
+      | apply (. (#‡H\sup -1)‡#); assumption]]]
+qed.
 
-definition fintersects ≝
- λo: basic_pair.λa,b: form o.
-  {c | ext ? c ⊆ ext ? a ∩ ext ? b }.
+definition fintersects: ∀o: basic_pair. form o → form o → Ω \sup (form o).
+ apply
+  (λo: basic_pair.λa,b: form o.
+    {c | ext ?? (rel o) c ⊆ ext ?? (rel o) a ∩ ext ?? (rel o) b });
+ intros; simplify; apply (.= (†H)‡#); apply refl1.
+qed.
 
 interpretation "fintersects" 'fintersects U V = (fintersects _ U V).
+(*
+definition fintersectsS ≝
+ λo: basic_pair.λa,b: Ω \sup (form o).
+  {c | ext ?? (rel o) c ⊆ extS ?? (rel o) a ∩ extS ?? (rel o) b }.
+
+interpretation "fintersectsS" 'fintersects U V = (fintersectsS _ U V).
 
 definition relS: ∀o: basic_pair. concr o → Ω \sup (form o) → CProp ≝
- λo,x,S. ∃y. y ∈ S ∧ x ⊩ y.
+ λo,x,S. ∃y.y ∈ S ∧ x ⊩ y.
 
 interpretation "basic pair relation for subsets" 'Vdash2 x y = (relS _ x y).
 interpretation "basic pair relation for subsets (non applied)" 'Vdash = (relS _).
 
-definition convergence ≝
- λo: basic_pair.∀a: concr o.∀U,V: form o. a ⊩ U → a ⊩ V → a ⊩ (U ↓ V). 
\ No newline at end of file
+record concrete_space : Type ≝
+ { bp:> basic_pair;
+   converges: ∀a: concr bp.∀U,V: form bp. a ⊩ U → a ⊩ V → a ⊩ (U ↓ V);
+   all_covered: ∀x: concr bp. x ⊩ form bp
+ }.
+
+record convergent_relation_pair (CS1,CS2: concrete_space) : Type ≝
+ { rp:> relation_pair CS1 CS2;
+   respects_converges:
+    ∀b,c.
+     extS ?? rp \sub\c (extS ?? (rel CS2) (b ↓ c)) =
+     extS ?? (rel CS1) ((extS ?? rp \sub\f b) ↓ (extS ?? rp \sub\f c));
+   respects_all_covered:
+    extS ?? rp\sub\c (extS ?? (rel CS2) (form CS2)) =
+    extS ?? (rel CS1) (form CS1)
+ }.
+
+definition convergent_relation_space_setoid: concrete_space → concrete_space → setoid.
+ intros;
+ constructor 1;
+  [ apply (convergent_relation_pair c c1)
+  | constructor 1;
+     [ intros;
+       apply (relation_pair_equality c c1 c2 c3);
+     | intros 1; apply refl;
+     | intros 2; apply sym; 
+     | intros 3; apply trans]]
+qed.
+
+lemma equalset_extS_id_X_X: ∀o:REL.∀X.extS ?? (id ? o) X = X.
+ intros;
+ unfold extS;
+ split;
+  [ intros 2;
+    cases m; clear m;
+    cases H; clear H;
+    cases H1; clear H1;
+    whd in H;
+    apply (eq_elim_r'' ????? H);
+    assumption
+  | intros 2;
+    constructor 1;
+     [ whd; exact I 
+     | exists; [ apply a ]
+       split;
+        [ assumption
+        | whd; constructor 1]]]
+qed.
+
+definition CSPA: category.
+ constructor 1;
+  [ apply concrete_space
+  | apply convergent_relation_space_setoid
+  | intro; constructor 1;
+     [ apply id
+     | intros;
+       unfold id; simplify;
+       apply (.= (equalset_extS_id_X_X ??));
+
+     |
+     ]
+  |*)
\ No newline at end of file