X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fcontribs%2Fformal_topology%2Foverlap%2Fbasic_pairs.ma;h=c5546477b938831b5cd22363de05a5997b10686e;hb=23043db144b24b8cd2072800b61137bb396f891e;hp=071892f6bd3b7605f1892f450bd684915507e333;hpb=fdc6fe20875e45ea7446516af8904e2fb9b15388;p=helm.git diff --git a/helm/software/matita/contribs/formal_topology/overlap/basic_pairs.ma b/helm/software/matita/contribs/formal_topology/overlap/basic_pairs.ma index 071892f6b..c5546477b 100644 --- a/helm/software/matita/contribs/formal_topology/overlap/basic_pairs.ma +++ b/helm/software/matita/contribs/formal_topology/overlap/basic_pairs.ma @@ -13,6 +13,7 @@ (**************************************************************************) include "relations.ma". +include "notation.ma". record basic_pair: Type1 ≝ { concr: REL; @@ -20,11 +21,8 @@ record basic_pair: Type1 ≝ rel: arrows1 ? concr form }. -notation "x ⊩ y" with precedence 45 for @{'Vdash2 $x $y}. -notation "⊩" with precedence 60 for @{'Vdash}. - -interpretation "basic pair relation" 'Vdash2 x y = (rel _ x y). -interpretation "basic pair relation (non applied)" 'Vdash = (rel _). +interpretation "basic pair relation" 'Vdash2 x y c = (fun21 ___ (rel c) x y). +interpretation "basic pair relation (non applied)" 'Vdash c = (rel c). alias symbol "eq" = "setoid1 eq". alias symbol "compose" = "category1 composition". @@ -34,8 +32,6 @@ record relation_pair (BP1,BP2: basic_pair): Type1 ≝ commute: ⊩ ∘ concr_rel = form_rel ∘ ⊩ }. -notation "hvbox (r \sub \c)" with precedence 90 for @{'concr_rel $r}. -notation "hvbox (r \sub \f)" with precedence 90 for @{'form_rel $r}. interpretation "concrete relation" 'concr_rel r = (concr_rel __ r). interpretation "formal relation" 'form_rel r = (form_rel __ r). @@ -65,7 +61,12 @@ definition relation_pair_setoid: basic_pair → basic_pair → setoid1. ] qed. -lemma eq_to_eq': ∀o1,o2.∀r,r': relation_pair_setoid o1 o2. r=r' → r \sub\f ∘ ⊩ = r'\sub\f ∘ ⊩. +definition relation_pair_of_relation_pair_setoid : + ∀P,Q. relation_pair_setoid P Q → relation_pair P Q ≝ λP,Q,x.x. +coercion relation_pair_of_relation_pair_setoid. + +lemma eq_to_eq': + ∀o1,o2.∀r,r':relation_pair_setoid o1 o2. r=r' → r \sub\f ∘ ⊩ = r'\sub\f ∘ ⊩. intros 7 (o1 o2 r r' H c1 f2); split; intro H1; [ lapply (fi ?? (commute ?? r c1 f2) H1) as H2; @@ -87,11 +88,11 @@ definition id_relation_pair: ∀o:basic_pair. relation_pair o o. apply (H1 \sup -1);] qed. -definition relation_pair_composition: - ∀o1,o2,o3. binary_morphism1 (relation_pair_setoid o1 o2) (relation_pair_setoid o2 o3) (relation_pair_setoid o1 o3). - intros; - constructor 1; - [ intros (r r1); +lemma relation_pair_composition: + ∀o1,o2,o3: basic_pair. + relation_pair_setoid o1 o2 → relation_pair_setoid o2 o3 → relation_pair_setoid o1 o3. +intros 3 (o1 o2 o3); + intros (r r1); constructor 1; [ apply (r1 \sub\c ∘ r \sub\c) | apply (r1 \sub\f ∘ r \sub\f) @@ -105,7 +106,17 @@ definition relation_pair_composition: apply (.= ASSOC ^ -1); apply (.= H‡#); apply ASSOC] - | intros; +qed. + +lemma relation_pair_composition_is_morphism: + ∀o1,o2,o3: basic_pair. + ∀a,a':relation_pair_setoid o1 o2. + ∀b,b':relation_pair_setoid o2 o3. + a=a' → b=b' → + relation_pair_composition o1 o2 o3 a b + = relation_pair_composition o1 o2 o3 a' b'. +intros 3 (o1 o2 o3); + intros; change with (⊩ ∘ (b\sub\c ∘ a\sub\c) = ⊩ ∘ (b'\sub\c ∘ a'\sub\c)); change in e with (⊩ ∘ a \sub\c = ⊩ ∘ a' \sub\c); change in e1 with (⊩ ∘ b \sub\c = ⊩ ∘ b' \sub\c); @@ -116,93 +127,115 @@ definition relation_pair_composition: apply (.= e‡#); apply (.= ASSOC); apply (.= #‡(commute ?? b')\sup -1); - apply (ASSOC ^ -1)] + apply (ASSOC ^ -1); qed. - -definition BP: category1. + +definition relation_pair_composition_morphism: + ∀o1,o2,o3. binary_morphism1 (relation_pair_setoid o1 o2) (relation_pair_setoid o2 o3) (relation_pair_setoid o1 o3). + intros; constructor 1; - [ apply basic_pair - | apply relation_pair_setoid - | apply id_relation_pair - | apply relation_pair_composition - | intros; + [ apply relation_pair_composition; + | apply relation_pair_composition_is_morphism;] +qed. + +lemma relation_pair_composition_morphism_assoc: +Πo1:basic_pair +.Πo2:basic_pair + .Πo3:basic_pair + .Πo4:basic_pair + .Πa12:relation_pair_setoid o1 o2 + .Πa23:relation_pair_setoid o2 o3 + .Πa34:relation_pair_setoid o3 o4 + .relation_pair_composition_morphism o1 o3 o4 + (relation_pair_composition_morphism o1 o2 o3 a12 a23) a34 + =relation_pair_composition_morphism o1 o2 o4 a12 + (relation_pair_composition_morphism o2 o3 o4 a23 a34). + intros; change with (⊩ ∘ (a34\sub\c ∘ (a23\sub\c ∘ a12\sub\c)) = ⊩ ∘ ((a34\sub\c ∘ a23\sub\c) ∘ a12\sub\c)); alias symbol "refl" = "refl1". alias symbol "prop2" = "prop21". apply (ASSOC‡#); - | intros; +qed. + +lemma relation_pair_composition_morphism_respects_id: + ∀o1,o2:basic_pair.∀a:relation_pair_setoid o1 o2. + relation_pair_composition_morphism o1 o1 o2 (id_relation_pair o1) a=a. + intros; change with (⊩ ∘ (a\sub\c ∘ (id_relation_pair o1)\sub\c) = ⊩ ∘ a\sub\c); - apply ((id_neutral_right1 ????)‡#); - | intros; + apply ((id_neutral_right1 ????)‡#); +qed. + +lemma relation_pair_composition_morphism_respects_id_r: + ∀o1,o2:basic_pair.∀a:relation_pair_setoid o1 o2. + relation_pair_composition_morphism o1 o2 o2 a (id_relation_pair o2)=a. + intros; change with (⊩ ∘ ((id_relation_pair o2)\sub\c ∘ a\sub\c) = ⊩ ∘ a\sub\c); - apply ((id_neutral_left1 ????)‡#);] + apply ((id_neutral_left1 ????)‡#); qed. -(* +definition BP: category1. + constructor 1; + [ apply basic_pair + | apply relation_pair_setoid + | apply id_relation_pair + | apply relation_pair_composition_morphism + | apply relation_pair_composition_morphism_assoc; + | apply relation_pair_composition_morphism_respects_id; + | apply relation_pair_composition_morphism_respects_id_r;] +qed. + +definition basic_pair_of_BP : objs1 BP → basic_pair ≝ λx.x. +coercion basic_pair_of_BP. + +definition relation_pair_setoid_of_arrows1_BP : + ∀P,Q. arrows1 BP P Q → relation_pair_setoid P Q ≝ λP,Q,x.x. +coercion relation_pair_setoid_of_arrows1_BP. + definition BPext: ∀o: BP. form o ⇒ Ω \sup (concr o). intros; constructor 1; [ apply (ext ? ? (rel o)); | intros; - apply (.= #‡H); + apply (.= #‡e); apply refl1] qed. -definition BPextS: ∀o: BP. Ω \sup (form o) ⇒ Ω \sup (concr o) ≝ - λo.extS ?? (rel o). +definition BPextS: ∀o: BP. Ω \sup (form o) ⇒ Ω \sup (concr o). + intros; constructor 1; + [ apply (minus_image ?? (rel o)); + | intros; apply (#‡e); ] +qed. definition fintersects: ∀o: BP. binary_morphism1 (form o) (form o) (Ω \sup (form o)). intros (o); constructor 1; [ apply (λa,b: form o.{c | BPext o c ⊆ BPext o a ∩ BPext o b }); - intros; simplify; apply (.= (†H)‡#); apply refl1 + intros; simplify; apply (.= (†e)‡#); apply refl1 | intros; split; simplify; intros; - [ apply (. #‡((†H)‡(†H1))); assumption - | apply (. #‡((†H\sup -1)‡(†H1\sup -1))); assumption]] + [ apply (. #‡((†e^-1)‡(†e1^-1))); assumption + | apply (. #‡((†e)‡(†e1))); assumption]] qed. -interpretation "fintersects" 'fintersects U V = (fun1 ___ (fintersects _) U V). +interpretation "fintersects" 'fintersects U V = (fun21 ___ (fintersects _) U V). definition fintersectsS: ∀o:BP. binary_morphism1 (Ω \sup (form o)) (Ω \sup (form o)) (Ω \sup (form o)). intros (o); constructor 1; [ apply (λo: basic_pair.λa,b: Ω \sup (form o).{c | BPext o c ⊆ BPextS o a ∩ BPextS o b }); - intros; simplify; apply (.= (†H)‡#); apply refl1 + intros; simplify; apply (.= (†e)‡#); apply refl1 | intros; split; simplify; intros; - [ apply (. #‡((†H)‡(†H1))); assumption - | apply (. #‡((†H\sup -1)‡(†H1\sup -1))); assumption]] + [ apply (. #‡((†e^-1)‡(†e1^-1))); assumption + | apply (. #‡((†e)‡(†e1))); assumption]] qed. -interpretation "fintersectsS" 'fintersects U V = (fun1 ___ (fintersectsS _) U V). +interpretation "fintersectsS" 'fintersects U V = (fun21 ___ (fintersectsS _) U V). definition relS: ∀o: BP. binary_morphism1 (concr o) (Ω \sup (form o)) CPROP. intros (o); constructor 1; - [ apply (λx:concr o.λS: Ω \sup (form o).∃y: form o.y ∈ S ∧ x ⊩ y); - | intros; split; intros; cases H2; exists [1,3: apply w] - [ apply (. (#‡H1)‡(H‡#)); assumption - | apply (. (#‡H1 \sup -1)‡(H \sup -1‡#)); assumption]] -qed. - -interpretation "basic pair relation for subsets" 'Vdash2 x y = (fun1 (concr _) __ (relS _) x y). -interpretation "basic pair relation for subsets (non applied)" 'Vdash = (fun1 ___ (relS _)). -*) - -include "o-basic_pairs.ma". -(* Qui, per fare le cose per bene, ci serve la nozione di funtore categorico *) -definition o_basic_pair_of_basic_pair: cic:/matita/formal_topology/basic_pairs/basic_pair.ind#xpointer(1/1) → basic_pair. - intro; - constructor 1; - [ apply (SUBSETS (concr b)); - | apply (SUBSETS (form b)); - | apply (orelation_of_relation ?? (rel b)); ] + [ apply (λx:concr o.λS: Ω \sup (form o).∃y:form o.y ∈ S ∧ x ⊩_o y); + | intros; split; intros; cases e2; exists [1,3: apply w] + [ apply (. (#‡e1^-1)‡(e^-1‡#)); assumption + | apply (. (#‡e1)‡(e‡#)); assumption]] qed. -definition o_relation_pair_of_relation_pair: - ∀BP1,BP2.cic:/matita/formal_topology/basic_pairs/relation_pair.ind#xpointer(1/1) BP1 BP2 → - relation_pair (o_basic_pair_of_basic_pair BP1) (o_basic_pair_of_basic_pair BP2). - intros; - constructor 1; - [ apply (orelation_of_relation ?? (r \sub \c)); - | apply (orelation_of_relation ?? (r \sub \f)); - | - ] -qed. \ No newline at end of file +interpretation "basic pair relation for subsets" 'Vdash2 x y c = (fun21 (concr _) __ (relS c) x y). +interpretation "basic pair relation for subsets (non applied)" 'Vdash c = (fun21 ___ (relS c)).