]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/library/formal_topology/concrete_spaces.ma
89665e5f9de8ec6d93649bd43fc4506748609bb9
[helm.git] / helm / software / matita / library / formal_topology / concrete_spaces.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 "formal_topology/basic_pairs.ma".
16
17 definition comprehension: ∀b:REL. (b ⇒ CPROP) → Ω \sup b.
18  apply (λb:REL. λP: b ⇒ CPROP. {x | x ∈ b ∧ P x});
19  intros; simplify; apply (.= (H‡#)‡(†H)); apply refl1.
20 qed.
21
22 interpretation "subset comprehension" 'comprehension s p =
23  (comprehension s (mk_unary_morphism __ p _)).
24
25 definition ext: ∀X,S:REL. ∀r: arrows1 ? X S. S ⇒ Ω \sup X.
26  apply (λX,S,r.mk_unary_morphism ?? (λf.{x ∈ X | x ♮r f}) ?);
27   [ intros; simplify; apply (.= (H‡#)); apply refl1
28   | intros; simplify; split; intros; simplify; intros;
29      [ apply (. #‡(#‡H)); assumption
30      | apply (. #‡(#‡H\sup -1)); assumption]]
31 qed.
32
33 definition extS: ∀X,S:REL. ∀r: arrows1 ? X S. Ω \sup S ⇒ Ω \sup X.
34  (* ∃ is not yet a morphism apply (λX,S,r,F.{x ∈ X | ∃a. a ∈ F ∧ x ♮r a});*)
35  intros (X S r); constructor 1;
36   [ intro F; constructor 1; constructor 1;
37     [ apply (λx. x ∈ X ∧ ∃a:S. a ∈ F ∧ x ♮r a);
38     | intros; split; intro; cases f (H1 H2); clear f; split;
39        [ apply (. (H‡#)); assumption
40        |3: apply (. (H\sup -1‡#)); assumption
41        |2,4: cases H2 (w H3); exists; [1,3: apply w]
42          [ apply (. (#‡(H‡#))); assumption
43          | apply (. (#‡(H \sup -1‡#))); assumption]]]
44   | intros; split; simplify; intros; cases f; cases H1; split;
45      [1,3: assumption
46      |2,4: exists; [1,3: apply w]
47       [ apply (. (#‡H)‡#); assumption
48       | apply (. (#‡H\sup -1)‡#); assumption]]]
49 qed.
50
51 definition fintersects: ∀o: basic_pair. form o → form o → Ω \sup (form o).
52  apply
53   (λo: basic_pair.λa,b: form o.
54     {c | ext ?? (rel o) c ⊆ ext ?? (rel o) a ∩ ext ?? (rel o) b });
55  intros; simplify; apply (.= (†H)‡#); apply refl1.
56 qed.
57
58 interpretation "fintersects" 'fintersects U V = (fintersects _ U V).
59 (*
60 definition fintersectsS ≝
61  λo: basic_pair.λa,b: Ω \sup (form o).
62   {c | ext ?? (rel o) c ⊆ extS ?? (rel o) a ∩ extS ?? (rel o) b }.
63
64 interpretation "fintersectsS" 'fintersects U V = (fintersectsS _ U V).
65
66 definition relS: ∀o: basic_pair. concr o → Ω \sup (form o) → CProp ≝
67  λo,x,S. ∃y.y ∈ S ∧ x ⊩ y.
68
69 interpretation "basic pair relation for subsets" 'Vdash2 x y = (relS _ x y).
70 interpretation "basic pair relation for subsets (non applied)" 'Vdash = (relS _).
71
72 record concrete_space : Type ≝
73  { bp:> basic_pair;
74    converges: ∀a: concr bp.∀U,V: form bp. a ⊩ U → a ⊩ V → a ⊩ (U ↓ V);
75    all_covered: ∀x: concr bp. x ⊩ form bp
76  }.
77
78 record convergent_relation_pair (CS1,CS2: concrete_space) : Type ≝
79  { rp:> relation_pair CS1 CS2;
80    respects_converges:
81     ∀b,c.
82      extS ?? rp \sub\c (extS ?? (rel CS2) (b ↓ c)) =
83      extS ?? (rel CS1) ((extS ?? rp \sub\f b) ↓ (extS ?? rp \sub\f c));
84    respects_all_covered:
85     extS ?? rp\sub\c (extS ?? (rel CS2) (form CS2)) =
86     extS ?? (rel CS1) (form CS1)
87  }.
88
89 definition convergent_relation_space_setoid: concrete_space → concrete_space → setoid.
90  intros;
91  constructor 1;
92   [ apply (convergent_relation_pair c c1)
93   | constructor 1;
94      [ intros;
95        apply (relation_pair_equality c c1 c2 c3);
96      | intros 1; apply refl;
97      | intros 2; apply sym; 
98      | intros 3; apply trans]]
99 qed.
100
101 lemma equalset_extS_id_X_X: ∀o:REL.∀X.extS ?? (id ? o) X = X.
102  intros;
103  unfold extS;
104  split;
105   [ intros 2;
106     cases m; clear m;
107     cases H; clear H;
108     cases H1; clear H1;
109     whd in H;
110     apply (eq_elim_r'' ????? H);
111     assumption
112   | intros 2;
113     constructor 1;
114      [ whd; exact I 
115      | exists; [ apply a ]
116        split;
117         [ assumption
118         | whd; constructor 1]]]
119 qed.
120
121 definition CSPA: category.
122  constructor 1;
123   [ apply concrete_space
124   | apply convergent_relation_space_setoid
125   | intro; constructor 1;
126      [ apply id
127      | intros;
128        unfold id; simplify;
129        apply (.= (equalset_extS_id_X_X ??));
130
131      |
132      ]
133   |*)