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