1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "formal_topology/basic_pairs.ma".
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.
22 interpretation "subset comprehension" 'comprehension s p =
23 (comprehension s (mk_unary_morphism __ p _)).
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]]
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;
46 |2,4: exists; [1,3: apply w]
47 [ apply (. (#‡H)‡#); assumption
48 | apply (. (#‡H\sup -1)‡#); assumption]]]
51 definition fintersects: ∀o: basic_pair. form o → form o → Ω \sup (form o).
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.
58 interpretation "fintersects" 'fintersects U V = (fintersects _ U V).
60 definition fintersectsS:
61 ∀o:basic_pair. Ω \sup (form o) → Ω \sup (form o) → Ω \sup (form o).
62 apply (λo: basic_pair.λa,b: Ω \sup (form o).
63 {c | ext ?? (rel o) c ⊆ extS ?? (rel o) a ∩ extS ?? (rel o) b });
64 intros; simplify; apply (.= (†H)‡#); apply refl1.
67 interpretation "fintersectsS" 'fintersects U V = (fintersectsS _ U V).
70 definition relS: ∀o: basic_pair. concr o → Ω \sup (form o) → CProp.
73 apply (λo:basic_pair.λx:concr o.λS: Ω \sup (form o).∃y: form o.y ∈ S ∧
74 (* OK: FunClass_2_OF_binary_relation (concr o) (form o) (rel o) x y *)
76 change in x with (carr1 (setoid1_of_setoid (concr o)));
77 apply (FunClass_2_OF_binary_relation ?? (rel ?) x y);
80 rel (concr o) o -> binary_relation ...
81 rel ? = seotid1_OF_setoid ?
82 carr rel ? = Type_OF_objs1 (concr o) ->
83 carr (setoid1_of_REL (concr o))
85 interpretation "basic pair relation for subsets" 'Vdash2 x y = (relS _ x y).
86 interpretation "basic pair relation for subsets (non applied)" 'Vdash = (relS _).
88 record concrete_space : Type ≝
90 converges: ∀a: concr bp.∀U,V: form bp. a ⊩ U → a ⊩ V → a ⊩ (U ↓ V);
91 all_covered: ∀x: concr bp. x ⊩ form bp
94 record convergent_relation_pair (CS1,CS2: concrete_space) : Type ≝
95 { rp:> relation_pair CS1 CS2;
98 extS ?? rp \sub\c (extS ?? (rel CS2) (b ↓ c)) =
99 extS ?? (rel CS1) ((extS ?? rp \sub\f b) ↓ (extS ?? rp \sub\f c));
100 respects_all_covered:
101 extS ?? rp\sub\c (extS ?? (rel CS2) (form CS2)) =
102 extS ?? (rel CS1) (form CS1)
105 definition convergent_relation_space_setoid: concrete_space → concrete_space → setoid.
108 [ apply (convergent_relation_pair c c1)
111 apply (relation_pair_equality c c1 c2 c3);
112 | intros 1; apply refl;
113 | intros 2; apply sym;
114 | intros 3; apply trans]]
117 lemma equalset_extS_id_X_X: ∀o:REL.∀X.extS ?? (id ? o) X = X.
126 apply (eq_elim_r'' ????? H);
131 | exists; [ apply a ]
134 | whd; constructor 1]]]
137 definition CSPA: category.
139 [ apply concrete_space
140 | apply convergent_relation_space_setoid
141 | intro; constructor 1;
145 apply (.= (equalset_extS_id_X_X ??));