X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fformal_topology%2Fbasic_topologies.ma;h=0177afb63e9cea4035b289b1d8024dce1e795c32;hb=070b44c9c2344967ca8c4531909614a0d4da2fbe;hp=92f4cdf4659106db599aa821a93979980d7e9909;hpb=7c9b20db66af78579a5312e4a6a5a42471d6312b;p=helm.git diff --git a/helm/software/matita/library/formal_topology/basic_topologies.ma b/helm/software/matita/library/formal_topology/basic_topologies.ma index 92f4cdf46..0177afb63 100644 --- a/helm/software/matita/library/formal_topology/basic_topologies.ma +++ b/helm/software/matita/library/formal_topology/basic_topologies.ma @@ -13,110 +13,21 @@ (**************************************************************************) include "formal_topology/relations.ma". -include "datatypes/categories.ma". +include "formal_topology/saturations.ma". -definition is_saturation ≝ - λC:REL.λA:unary_morphism (Ω \sup C) (Ω \sup C). - ∀U,V. (U ⊆ A V) = (A U ⊆ A V). - -definition is_reduction ≝ - λC:REL.λJ:unary_morphism (Ω \sup C) (Ω \sup C). - ∀U,V. (J U ⊆ V) = (J U ⊆ J V). - -theorem subseteq_refl: ∀A.∀S:Ω \sup A.S ⊆ S. - intros 4; assumption. -qed. - -theorem subseteq_trans: ∀A.∀S1,S2,S3: Ω \sup A. S1 ⊆ S2 → S2 ⊆ S3 → S1 ⊆ S3. - intros; apply transitive_subseteq_operator; [apply S2] assumption. -qed. - -theorem saturation_expansive: ∀C,A. is_saturation C A → ∀U. U ⊆ A U. - intros; apply (fi ?? (H ??)); apply subseteq_refl. -qed. - -theorem saturation_monotone: - ∀C,A. is_saturation C A → - ∀U,V. U ⊆ V → A U ⊆ A V. - intros; apply (if ?? (H ??)); apply subseteq_trans; [apply V|3: apply saturation_expansive ] - assumption. -qed. - -theorem saturation_idempotent: ∀C,A. is_saturation C A → ∀U. A (A U) = A U. - intros; split; - [ apply (if ?? (H ??)); apply subseteq_refl - | apply saturation_expansive; assumption] -qed. - -record basic_topology: Type ≝ +record basic_topology: Type1 ≝ { carrbt:> REL; - A: unary_morphism (Ω \sup carrbt) (Ω \sup carrbt); - J: unary_morphism (Ω \sup carrbt) (Ω \sup carrbt); + A: Ω^carrbt ⇒_1 Ω^carrbt; + J: Ω^carrbt ⇒_1 Ω^carrbt; A_is_saturation: is_saturation ? A; J_is_reduction: is_reduction ? J; - compatibility: ∀U,V. (A U ≬ J V) = (U ≬ J V) + compatibility: ∀U,V. (A U ≬ J V) =_1 (U ≬ J V) }. -(* the same as ⋄ for a basic pair *) -definition image: ∀U,V:REL. binary_morphism1 (arrows1 ? U V) (Ω \sup U) (Ω \sup V). - intros; constructor 1; - [ apply (λr: arrows1 ? U V.λS: Ω \sup U. {y | ∃x:U. x ♮r y ∧ x ∈ S}); - intros; simplify; split; intro; cases H1; exists [1,3: apply w] - [ apply (. (#‡H)‡#); assumption - | apply (. (#‡H \sup -1)‡#); assumption] - | intros; split; simplify; intros; cases H2; exists [1,3: apply w] - [ apply (. #‡(#‡H1)); cases x; split; try assumption; - apply (if ?? (H ??)); assumption - | apply (. #‡(#‡H1 \sup -1)); cases x; split; try assumption; - apply (if ?? (H \sup -1 ??)); assumption]] -qed. - -(* the same as □ for a basic pair *) -definition minus_star_image: ∀U,V:REL. binary_morphism1 (arrows1 ? U V) (Ω \sup U) (Ω \sup V). - intros; constructor 1; - [ apply (λr: arrows1 ? U V.λS: Ω \sup U. {y | ∀x:U. x ♮r y → x ∈ S}); - intros; simplify; split; intros; apply H1; - [ apply (. #‡H \sup -1); assumption - | apply (. #‡H); assumption] - | intros; split; simplify; intros; [ apply (. #‡H1); | apply (. #‡H1 \sup -1)] - apply H2; [ apply (if ?? (H \sup -1 ??)); | apply (if ?? (H ??)) ] assumption] -qed. - -(* minus_image is the same as ext *) - -theorem image_id: ∀o,U. image o o (id1 REL o) U = U. - intros; unfold image; simplify; split; simplify; intros; - [ change with (a ∈ U); - cases H; cases x; change in f with (eq1 ? w a); apply (. f‡#); assumption - | change in f with (a ∈ U); - exists; [apply a] split; [ change with (a = a); apply refl | assumption]] -qed. - -theorem minus_star_image_id: ∀o,U. minus_star_image o o (id1 REL o) U = U. - intros; unfold minus_star_image; simplify; split; simplify; intros; - [ change with (a ∈ U); apply H; change with (a=a); apply refl - | change in f1 with (eq1 ? x a); apply (. f1 \sup -1‡#); apply f] -qed. - -theorem image_comp: ∀A,B,C,r,s,X. image A C (r ∘ s) X = image B C r (image A B s X). - intros; unfold image; simplify; split; simplify; intros; cases H; clear H; cases x; - clear x; [ cases f; clear f; | cases f1; clear f1 ] - exists; try assumption; cases x; clear x; split; try assumption; - exists; try assumption; split; assumption. -qed. - -theorem minus_star_image_comp: - ∀A,B,C,r,s,X. - minus_star_image A C (r ∘ s) X = minus_star_image B C r (minus_star_image A B s X). - intros; unfold minus_star_image; simplify; split; simplify; intros; whd; intros; - [ apply H; exists; try assumption; split; assumption - | change with (x ∈ X); cases f; cases x1; apply H; assumption] -qed. - -record continuous_relation (S,T: basic_topology) : Type ≝ - { cont_rel:> arrows1 ? S T; - reduced: ∀U. U = J ? U → image ?? cont_rel U = J ? (image ?? cont_rel U); - saturated: ∀U. U = A ? U → minus_star_image ?? cont_rel U = A ? (minus_star_image ?? cont_rel U) +record continuous_relation (S,T: basic_topology) : Type1 ≝ + { cont_rel:> S ⇒_\r1 T; + reduced: ∀U. U =_1 J ? U → image_coercion ?? cont_rel U =_1 J ? (image_coercion ?? cont_rel U); + saturated: ∀U. U =_1 A ? U → (cont_rel)⎻* U = _1A ? ((cont_rel)⎻* U) }. definition continuous_relation_setoid: basic_topology → basic_topology → setoid1. @@ -125,61 +36,18 @@ definition continuous_relation_setoid: basic_topology → basic_topology → set | constructor 1; [ apply (λr,s:continuous_relation S T.∀b. A ? (ext ?? r b) = A ? (ext ?? s b)); | simplify; intros; apply refl1; - | simplify; intros; apply sym1; apply H - | simplify; intros; apply trans1; [2: apply H |3: apply H1; |1: skip]]] + | simplify; intros (x y H); apply sym1; apply H + | simplify; intros; apply trans1; [2: apply f |3: apply f1; |1: skip]]] qed. -definition cont_rel': ∀S,T: basic_topology. continuous_relation_setoid S T → arrows1 ? S T ≝ cont_rel. - -coercion cont_rel'. +definition continuos_relation_of_continuous_relation_setoid : + ∀P,Q. continuous_relation_setoid P Q → continuous_relation P Q ≝ λP,Q,x.x. +coercion continuos_relation_of_continuous_relation_setoid. -definition cont_rel'': ∀S,T: basic_topology. continuous_relation_setoid S T → binary_relation S T ≝ cont_rel. - -coercion cont_rel''. - -theorem ext_comp: - ∀o1,o2,o3: REL. - ∀a: arrows1 ? o1 o2. - ∀b: arrows1 ? o2 o3. - ∀x. ext ?? (b∘a) x = extS ?? a (ext ?? b x). - intros; - unfold ext; unfold extS; simplify; split; intro; simplify; intros; - cases f; clear f; split; try assumption; - [ cases f2; clear f2; cases x1; clear x1; exists; [apply w] split; - [1: split] assumption; - | cases H; clear H; cases x1; clear x1; exists [apply w]; split; - [2: cases f] assumption] -qed. - -(* -(* this proof is more logic-oriented than set/lattice oriented *) -theorem continuous_relation_eqS: - ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2. - a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X). - intros; - cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y); - [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split; - try assumption; split; assumption] - cut (∀a,a':continuous_relation_setoid o1 o2.eq1 ? a a' → ∀x. x ∈ extS ?? a X → ∃y:o2. y ∈ X ∧ x ∈ A ? (ext ?? a' y)); - [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption; - apply (. #‡(H1 ?)); - apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x); - assumption;] clear Hcut; - split; apply (if ?? (A_is_saturation ???)); intros 2; - [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)] - cases Hletin; clear Hletin; cases x; clear x; - cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X); - [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption; - exists [1,3: apply w] split; assumption;] - cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X)); - [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;] - apply Hcut2; assumption. -qed. -*) - -theorem continuous_relation_eq': +axiom continuous_relation_eq': ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2. - a = a' → ∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X). + a = a' → ∀X.a⎻* (A o1 X) = a'⎻* (A o1 X). +(* intros; split; intro; unfold minus_star_image; simplify; intros; [ cut (ext ?? a a1 ⊆ A ? X); [2: intros 2; apply (H1 a2); cases f1; assumption;] lapply (if ?? (A_is_saturation ???) Hcut); clear Hcut; @@ -193,44 +61,35 @@ theorem continuous_relation_eq': lapply (fi ?? (A_is_saturation ???) Hcut); apply (Hletin1 x); change with (x ∈ ext ?? a a1); split; simplify; [ apply I | assumption ]] -qed. +qed.*) -theorem extS_singleton: - ∀o1,o2.∀a:arrows1 ? o1 o2.∀x.extS o1 o2 a (singleton o2 x) = ext o1 o2 a x. - intros; unfold extS; unfold ext; unfold singleton; simplify; - split; intros 2; simplify; cases f; split; try assumption; - [ cases H; cases x1; change in f2 with (eq1 ? x w); apply (. #‡f2 \sup -1); - assumption - | exists; try assumption; split; try assumption; change with (x = x); apply refl] -qed. - -theorem continuous_relation_eq_inv': +lemma continuous_relation_eq_inv': ∀o1,o2.∀a,a': continuous_relation_setoid o1 o2. - (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → a=a'. + (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) → a=a'. intros 6; cut (∀a,a': continuous_relation_setoid o1 o2. - (∀X.minus_star_image ?? a (A o1 X) = minus_star_image ?? a' (A o1 X)) → + (∀X.a⎻* (A o1 X) = a'⎻* (A o1 X)) → ∀V:o2. A ? (ext ?? a' V) ⊆ A ? (ext ?? a V)); - [2: clear b H a' a; intros; + [2: clear b f a' a; intros; lapply depth=0 (λV.saturation_expansive ??? (extS ?? a V)); [2: apply A_is_saturation;|skip] (* fundamental adjunction here! to be taken out *) - cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a (A ? (extS ?? a V))); + cut (∀V:Ω^o2.V ⊆ a⎻* (A ? (extS ?? a V))); [2: intro; intros 2; unfold minus_star_image; simplify; intros; apply (Hletin V1 x); whd; split; [ exact I | exists; [apply a1] split; assumption]] clear Hletin; - cut (∀V:Ω \sup o2.V ⊆ minus_star_image ?? a' (A ? (extS ?? a V))); - [2: intro; apply (. #‡(H ?)); apply Hcut] clear H Hcut; + cut (∀V:Ω^o2.V ⊆ a'⎻* (A ? (extS ?? a V))); + [2: intro; apply (. #‡(f ?)^-1); apply Hcut] clear f Hcut; (* second half of the fundamental adjunction here! to be taken out too *) - intro; lapply (Hcut1 (singleton ? V)); clear Hcut1; + intro; lapply (Hcut1 {(V)}); clear Hcut1; unfold minus_star_image in Hletin; unfold singleton in Hletin; simplify in Hletin; whd in Hletin; whd in Hletin:(?→?→%); simplify in Hletin; apply (if ?? (A_is_saturation ???)); intros 2 (x H); lapply (Hletin V ? x ?); - [ apply refl | cases H; assumption; ] + [ apply refl | unfold foo; apply H; ] change with (x ∈ A ? (ext ?? a V)); - apply (. #‡(†(extS_singleton ????))); + apply (. #‡(†(extS_singleton ????)^-1)); assumption;] - split; apply Hcut; [2: assumption | intro; apply sym1; apply H] + split; apply Hcut; [2: assumption | intro; apply sym1; apply f] qed. definition continuous_relation_comp: @@ -239,20 +98,24 @@ definition continuous_relation_comp: continuous_relation_setoid o2 o3 → continuous_relation_setoid o1 o3. intros (o1 o2 o3 r s); constructor 1; - [ apply (s ∘ r) + [ alias symbol "compose" (instance 1) = "category1 composition". +apply (s ∘ r) | intros; - apply sym1; + apply sym1; + (*change in ⊢ (? ? ? (? ? ? ? %) ?) with (image_coercion ?? (s ∘ r) U);*) apply (.= †(image_comp ??????)); - apply (.= (reduced ?????)\sup -1); + apply (.= (reduced ?? s (image_coercion ?? r U) ?)^-1); [ apply (.= (reduced ?????)); [ assumption | apply refl1 ] - | apply (.= (image_comp ??????)\sup -1); + | change in ⊢ (? ? ? % ?) with ((image_coercion ?? s ∘ image_coercion ?? r) U); + apply (.= (image_comp ??????)^-1); apply refl1] | intros; apply sym1; - apply (.= †(minus_star_image_comp ??????)); - apply (.= (saturated ?????)\sup -1); + apply (.= †(minus_star_image_comp ??? s r ?)); + apply (.= (saturated ?? s ((r)⎻* U) ?)^-1); [ apply (.= (saturated ?????)); [ assumption | apply refl1 ] - | apply (.= (minus_star_image_comp ??????)\sup -1); + | change in ⊢ (? ? ? % ?) with ((s⎻* ∘ r⎻* ) U); + apply (.= (minus_star_image_comp ??????)^-1); apply refl1]] qed. @@ -277,30 +140,40 @@ definition BTop: category1. | intros; constructor 1; [ apply continuous_relation_comp; | intros; simplify; intro x; simplify; - lapply depth=0 (continuous_relation_eq' ???? H) as H'; - lapply depth=0 (continuous_relation_eq' ???? H1) as H1'; - letin K ≝ (λX.H1' (minus_star_image ?? a (A ? X))); clearbody K; + lapply depth=0 (continuous_relation_eq' ???? e) as H'; + lapply depth=0 (continuous_relation_eq' ???? e1) as H1'; + letin K ≝ (λX.H1' ((a)⎻* (A ? X))); clearbody K; cut (∀X:Ω \sup o1. - minus_star_image o2 o3 b (A o2 (minus_star_image o1 o2 a (A o1 X))) - = minus_star_image o2 o3 b' (A o2 (minus_star_image o1 o2 a' (A o1 X)))); - [2: intro; apply sym1; apply (.= #‡(†((H' ?)\sup -1))); apply sym1; apply (K X);] + (b)⎻* (A o2 ((a)⎻* (A o1 X))) + =_1 (b')⎻* (A o2 ((a')⎻* (A o1 X)))); + [2: intro; apply sym1; + apply (.= (†(†((H' X)^-1)))); apply sym1; apply (K X);] clear K H' H1'; - cut (∀X:Ω \sup o1. - minus_star_image o1 o3 (b ∘ a) (A o1 X) = minus_star_image o1 o3 (b'∘a') (A o1 X)); - [2: intro; +alias symbol "powerset" (instance 5) = "powerset low". +alias symbol "compose" (instance 2) = "category1 composition". +cut (∀X:Ω^o1. + ((b ∘ a))⎻* (A o1 X) =_1 ((b'∘a'))⎻* (A o1 X)); + [2: intro; unfold foo; apply (.= (minus_star_image_comp ??????)); - apply (.= #‡(saturated ?????)); - [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ] + change in ⊢ (? ? ? % ?) with ((b)⎻* ((a)⎻* (A o1 X))); + apply (.= †(saturated ?????)); + [ apply ((saturation_idempotent ????)^-1); apply A_is_saturation ] apply sym1; apply (.= (minus_star_image_comp ??????)); - apply (.= #‡(saturated ?????)); - [ apply ((saturation_idempotent ????) \sup -1); apply A_is_saturation ] - apply ((Hcut X) \sup -1)] + change in ⊢ (? ? ? % ?) with ((b')⎻* ((a')⎻* (A o1 X))); + apply (.= †(saturated ?????)); + [ apply ((saturation_idempotent ????)^-1); apply A_is_saturation ] + apply ((Hcut X)^-1)] clear Hcut; generalize in match x; clear x; apply (continuous_relation_eq_inv'); apply Hcut1;] | intros; simplify; intro; do 2 (unfold continuous_relation_comp); simplify; - apply (.= †(ASSOC1‡#)); + alias symbol "trans" (instance 1) = "trans1". +alias symbol "refl" (instance 5) = "refl1". +alias symbol "prop2" (instance 3) = "prop21". +alias symbol "prop1" (instance 2) = "prop11". +alias symbol "assoc" (instance 4) = "category1 assoc". +apply (.= †(ASSOC‡#)); apply refl1 | intros; simplify; intro; unfold continuous_relation_comp; simplify; apply (.= †((id_neutral_right1 ????)‡#)); @@ -308,4 +181,31 @@ definition BTop: category1. | intros; simplify; intro; simplify; apply (.= †((id_neutral_left1 ????)‡#)); apply refl1] -qed. \ No newline at end of file +qed. + +(* +(*CSC: unused! *) +(* this proof is more logic-oriented than set/lattice oriented *) +theorem continuous_relation_eqS: + ∀o1,o2:basic_topology.∀a,a': continuous_relation_setoid o1 o2. + a = a' → ∀X. A ? (extS ?? a X) = A ? (extS ?? a' X). + intros; + cut (∀a: arrows1 ? o1 ?.∀x. x ∈ extS ?? a X → ∃y:o2.y ∈ X ∧ x ∈ ext ?? a y); + [2: intros; cases f; clear f; cases H1; exists [apply w] cases x1; split; + try assumption; split; assumption] + cut (∀a,a':continuous_relation_setoid o1 o2.eq1 ? a a' → ∀x. x ∈ extS ?? a X → ∃y:o2. y ∈ X ∧ x ∈ A ? (ext ?? a' y)); + [2: intros; cases (Hcut ?? f); exists; [apply w] cases x1; split; try assumption; + apply (. #‡(H1 ?)); + apply (saturation_expansive ?? (A_is_saturation o1) (ext ?? a1 w) x); + assumption;] clear Hcut; + split; apply (if ?? (A_is_saturation ???)); intros 2; + [lapply (Hcut1 a a' H a1 f) | lapply (Hcut1 a' a (H \sup -1) a1 f)] + cases Hletin; clear Hletin; cases x; clear x; + cut (∀a: arrows1 ? o1 ?. ext ?? a w ⊆ extS ?? a X); + [2,4: intros 3; cases f3; clear f3; simplify in f5; split; try assumption; + exists [1,3: apply w] split; assumption;] + cut (∀a. A ? (ext o1 o2 a w) ⊆ A ? (extS o1 o2 a X)); + [2,4: intros; apply saturation_monotone; try (apply A_is_saturation); apply Hcut;] + apply Hcut2; assumption. +qed. +*)