# HG changeset patch # User paulson # Date 1553695706 0 # Node ID cf7150ab107561a6931ed813c8c892c114d56d16 # Parent 3fd083253a1cc5bcb560a1d79fc717dcc8b6da9e more stuff from HOL Light: Euclidean spaces and n-spheres, Hausdorff spaces, etc. diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Analysis/Abstract_Euclidean_Space.thy --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/HOL/Analysis/Abstract_Euclidean_Space.thy Wed Mar 27 14:08:26 2019 +0000 @@ -0,0 +1,345 @@ +(* Author: LCP, ported from HOL Light +*) + +section\Euclidean space and n-spheres, as subtopologies of n-dimensional space\ + +theory Abstract_Euclidean_Space +imports Homotopy Locally T1_Spaces +begin + +subsection \Euclidean spaces as abstract topologies\ + +definition Euclidean_space :: "nat \ (nat \ real) topology" + where "Euclidean_space n \ subtopology (powertop_real UNIV) {x. \i\n. x i = 0}" + +lemma topspace_Euclidean_space: + "topspace(Euclidean_space n) = {x. \i\n. x i = 0}" + by (simp add: Euclidean_space_def) + +lemma nonempty_Euclidean_space: "topspace(Euclidean_space n) \ {}" + by (force simp: topspace_Euclidean_space) + +lemma subset_Euclidean_space [simp]: + "topspace(Euclidean_space m) \ topspace(Euclidean_space n) \ m \ n" + apply (simp add: topspace_Euclidean_space subset_iff, safe) + apply (drule_tac x="(\i. if i < m then 1 else 0)" in spec) + apply auto + using not_less by fastforce + +lemma topspace_Euclidean_space_alt: + "topspace(Euclidean_space n) = (\i \ {n..}. {x. x \ topspace(powertop_real UNIV) \ x i \ {0}})" + by (auto simp: topspace_Euclidean_space) + +lemma closedin_Euclidean_space: + "closedin (powertop_real UNIV) (topspace(Euclidean_space n))" +proof - + have "closedin (powertop_real UNIV) {x. x i = 0}" if "n \ i" for i + proof - + have "closedin (powertop_real UNIV) {x \ topspace (powertop_real UNIV). x i \ {0}}" + proof (rule closedin_continuous_map_preimage) + show "continuous_map (powertop_real UNIV) euclideanreal (\x. x i)" + by (metis UNIV_I continuous_map_product_coordinates) + show "closedin euclideanreal {0}" + by simp + qed + then show ?thesis + by auto + qed + then show ?thesis + unfolding topspace_Euclidean_space_alt + by force +qed + +lemma closedin_Euclidean_imp_closed: "closedin (Euclidean_space m) S \ closed S" + by (metis Euclidean_space_def closed_closedin closedin_Euclidean_space closedin_closed_subtopology euclidean_product_topology topspace_Euclidean_space) + +lemma closedin_Euclidean_space_iff: + "closedin (Euclidean_space m) S \ closed S \ S \ topspace (Euclidean_space m)" + (is "?lhs \ ?rhs") +proof + show "?lhs \ ?rhs" + using closedin_closed_subtopology topspace_Euclidean_space + by (fastforce simp: topspace_Euclidean_space_alt closedin_Euclidean_imp_closed) + show "?rhs \ ?lhs" + apply (simp add: closedin_subtopology Euclidean_space_def) + by (metis (no_types) closed_closedin euclidean_product_topology inf.orderE) +qed + +lemma continuous_map_componentwise_Euclidean_space: + "continuous_map X (Euclidean_space n) (\x i. if i < n then f x i else 0) \ + (\i < n. continuous_map X euclideanreal (\x. f x i))" +proof - + have *: "continuous_map X euclideanreal (\x. if k < n then f x k else 0)" + if "\i. i continuous_map X euclideanreal (\x. f x i)" for k + by (intro continuous_intros that) + show ?thesis + unfolding Euclidean_space_def continuous_map_in_subtopology + by (fastforce simp: continuous_map_componentwise_UNIV * elim: continuous_map_eq) +qed + +lemma continuous_map_Euclidean_space_add [continuous_intros]: + "\continuous_map X (Euclidean_space n) f; continuous_map X (Euclidean_space n) g\ + \ continuous_map X (Euclidean_space n) (\x i. f x i + g x i)" + unfolding Euclidean_space_def continuous_map_in_subtopology + by (fastforce simp add: continuous_map_componentwise_UNIV continuous_map_real_add) + +lemma continuous_map_Euclidean_space_diff [continuous_intros]: + "\continuous_map X (Euclidean_space n) f; continuous_map X (Euclidean_space n) g\ + \ continuous_map X (Euclidean_space n) (\x i. f x i - g x i)" + unfolding Euclidean_space_def continuous_map_in_subtopology + by (fastforce simp add: continuous_map_componentwise_UNIV continuous_map_real_diff) + +lemma homeomorphic_Euclidean_space_product_topology: + "Euclidean_space n homeomorphic_space product_topology (\i. euclideanreal) {..i. euclideanreal) {..x. if k < n then x k else 0)" for k + by (auto intro: continuous_map_if continuous_map_product_projection) + show ?thesis + unfolding homeomorphic_space_def homeomorphic_maps_def + apply (rule_tac x="\f. restrict f {.. n = 0" + by (auto simp: homeomorphic_compact_space [OF homeomorphic_Euclidean_space_product_topology] compact_space_product_topology) + +subsection\n-dimensional spheres\ + +definition nsphere where + "nsphere n \ subtopology (Euclidean_space (Suc n)) { x. (\i\n. x i ^ 2) = 1 }" + +lemma nsphere: + "nsphere n = subtopology (powertop_real UNIV) + {x. (\i\n. x i ^ 2) = 1 \ (\i>n. x i = 0)}" + by (simp add: nsphere_def Euclidean_space_def subtopology_subtopology Suc_le_eq Collect_conj_eq Int_commute) + +lemma continuous_map_nsphere_projection: "continuous_map (nsphere n) euclideanreal (\x. x k)" + unfolding nsphere + by (blast intro: continuous_map_from_subtopology [OF continuous_map_product_projection]) + +lemma in_topspace_nsphere: "(\n. if n = 0 then 1 else 0) \ topspace (nsphere n)" + by (simp add: nsphere_def topspace_Euclidean_space power2_eq_square if_distrib [where f = "\x. x * _"] cong: if_cong) + +lemma nonempty_nsphere [simp]: "~ (topspace(nsphere n) = {})" + using in_topspace_nsphere by auto + +lemma subtopology_nsphere_equator: + "subtopology (nsphere (Suc n)) {x. x(Suc n) = 0} = nsphere n" +proof - + have "({x. (\i\n. (x i)\<^sup>2) + (x (Suc n))\<^sup>2 = 1 \ (\i>Suc n. x i = 0)} \ {x. x (Suc n) = 0}) + = {x. (\i\n. (x i)\<^sup>2) = 1 \ (\i>n. x i = (0::real))}" + using Suc_lessI [of n] by (fastforce simp: set_eq_iff) + then show ?thesis + by (simp add: nsphere subtopology_subtopology) +qed + +lemma continuous_map_nsphere_reflection: + "continuous_map (nsphere n) (nsphere n) (\x i. if i = k then -x i else x i)" +proof - + have cm: "continuous_map (powertop_real UNIV) + euclideanreal (\x. if j = k then - x j else x j)" for j + proof (cases "j=k") + case True + then show ?thesis + by simp (metis UNIV_I continuous_map_product_projection continuous_map_real_minus) + next + case False + then show ?thesis + by (auto intro: continuous_map_product_projection) + qed + have eq: "(if i = k then x k * x k else x i * x i) = x i * x i" for i and x :: "nat \ real" + by simp + show ?thesis + apply (simp add: nsphere continuous_map_in_subtopology continuous_map_componentwise_UNIV + continuous_map_from_subtopology cm topspace_subtopology) + apply (intro conjI allI impI continuous_intros continuous_map_from_subtopology continuous_map_product_projection) + apply (auto simp: power2_eq_square if_distrib [where f = "\x. x * _"] eq cong: if_cong) + done +qed + + +proposition contractible_space_upper_hemisphere: + assumes "k \ n" + shows "contractible_space(subtopology (nsphere n) {x. x k \ 0})" +proof - + define p:: "nat \ real" where "p \ \i. if i = k then 1 else 0" + have "p \ topspace(nsphere n)" + using assms + by (simp add: nsphere topspace_subtopology p_def power2_eq_square if_distrib [where f = "\x. x * _"] cong: if_cong) + let ?g = "\x i. x i / sqrt(\j\n. x j ^ 2)" + let ?h = "\(t,q) i. (1 - t) * q i + t * p i" + let ?Y = "subtopology (Euclidean_space (Suc n)) {x. 0 \ x k \ (\i\n. x i \ 0)}" + have "continuous_map (prod_topology (top_of_set {0..1}) (subtopology (nsphere n) {x. 0 \ x k})) + (subtopology (nsphere n) {x. 0 \ x k}) (?g \ ?h)" + proof (rule continuous_map_compose) + have *: "\0 \ b k; (\i\n. (b i)\<^sup>2) = 1; \i>n. b i = 0; 0 \ a; a \ 1\ + \ \i. (i = k \ (1 - a) * b k + a \ 0) \ + (i \ k \ i \ n \ a \ 1 \ b i \ 0)" for a::real and b + apply (cases "a \ 1 \ b k = 0"; simp) + apply (metis (no_types, lifting) atMost_iff sum.neutral zero_power2) + by (metis add.commute add_le_same_cancel2 diff_ge_0_iff_ge diff_zero less_eq_real_def mult_eq_0_iff mult_nonneg_nonneg not_le numeral_One zero_neq_numeral) + show "continuous_map (prod_topology (top_of_set {0..1}) (subtopology (nsphere n) {x. 0 \ x k})) ?Y ?h" + using assms + apply (auto simp: * nsphere topspace_subtopology continuous_map_componentwise_UNIV + prod_topology_subtopology subtopology_subtopology case_prod_unfold + continuous_map_in_subtopology Euclidean_space_def p_def if_distrib [where f = "\x. _ * x"] cong: if_cong) + apply (intro continuous_map_prod_snd continuous_intros continuous_map_from_subtopology) + apply auto + done + next + have 1: "\x i. \ i \ n; x i \ 0\ \ (\i\n. (x i / sqrt (\j\n. (x j)\<^sup>2))\<^sup>2) = 1" + by (force simp: sum_nonneg sum_nonneg_eq_0_iff divide_simps simp flip: sum_divide_distrib) + have cm: "continuous_map ?Y (nsphere n) (\x i. x i / sqrt (\j\n. (x j)\<^sup>2))" + unfolding Euclidean_space_def nsphere subtopology_subtopology continuous_map_in_subtopology + proof (intro continuous_intros conjI) + show "continuous_map + (subtopology (powertop_real UNIV) ({x. \i\Suc n. x i = 0} \ {x. 0 \ x k \ (\i\n. x i \ 0)})) + (powertop_real UNIV) (\x i. x i / sqrt (\j\n. (x j)\<^sup>2))" + unfolding continuous_map_componentwise + by (intro continuous_intros conjI ballI) (auto simp: sum_nonneg_eq_0_iff) + qed (auto simp: 1) + show "continuous_map ?Y (subtopology (nsphere n) {x. 0 \ x k}) (\x i. x i / sqrt (\j\n. (x j)\<^sup>2))" + by (force simp: cm sum_nonneg continuous_map_in_subtopology if_distrib [where f = "\x. _ * x"] cong: if_cong) + qed + moreover have "(?g \ ?h) (0, x) = x" + if "x \ topspace (subtopology (nsphere n) {x. 0 \ x k})" for x + using that + by (simp add: assms topspace_subtopology nsphere) + moreover + have "(?g \ ?h) (1, x) = p" + if "x \ topspace (subtopology (nsphere n) {x. 0 \ x k})" for x + by (force simp: assms p_def power2_eq_square if_distrib [where f = "\x. x * _"] cong: if_cong) + ultimately + show ?thesis + apply (simp add: contractible_space_def homotopic_with) + apply (rule_tac x=p in exI) + apply (rule_tac x="?g \ ?h" in exI, force) + done +qed + + +corollary contractible_space_lower_hemisphere: + assumes "k \ n" + shows "contractible_space(subtopology (nsphere n) {x. x k \ 0})" +proof - + have "contractible_space (subtopology (nsphere n) {x. 0 \ x k}) = ?thesis" + proof (rule homeomorphic_space_contractibility) + show "subtopology (nsphere n) {x. 0 \ x k} homeomorphic_space subtopology (nsphere n) {x. x k \ 0}" + unfolding homeomorphic_space_def homeomorphic_maps_def + apply (rule_tac x="\x i. if i = k then -(x i) else x i" in exI)+ + apply (auto simp: continuous_map_in_subtopology continuous_map_from_subtopology + continuous_map_nsphere_reflection) + done + qed + then show ?thesis + using contractible_space_upper_hemisphere [OF assms] by metis +qed + + +proposition nullhomotopic_nonsurjective_sphere_map: + assumes f: "continuous_map (nsphere p) (nsphere p) f" + and fim: "f ` (topspace(nsphere p)) \ topspace(nsphere p)" + obtains a where "homotopic_with (\x. True) (nsphere p) (nsphere p) f (\x. a)" +proof - + obtain a where a: "a \ topspace(nsphere p)" "a \ f ` (topspace(nsphere p))" + using fim continuous_map_image_subset_topspace f by blast + then have a1: "(\i\p. (a i)\<^sup>2) = 1" and a0: "\i. i > p \ a i = 0" + by (simp_all add: nsphere) + have f1: "(\j\p. (f x j)\<^sup>2) = 1" if "x \ topspace (nsphere p)" for x + proof - + have "f x \ topspace (nsphere p)" + using continuous_map_image_subset_topspace f that by blast + then show ?thesis + by (simp add: nsphere) + qed + show thesis + proof + let ?g = "\x i. x i / sqrt(\j\p. x j ^ 2)" + let ?h = "\(t,x) i. (1 - t) * f x i - t * a i" + let ?Y = "subtopology (Euclidean_space(Suc p)) (- {\i. 0})" + let ?T01 = "top_of_set {0..1::real}" + have 1: "continuous_map (prod_topology ?T01 (nsphere p)) (nsphere p) (?g \ ?h)" + proof (rule continuous_map_compose) + have "continuous_map (prod_topology ?T01 (nsphere p)) euclideanreal ((\x. f x k) \ snd)" for k + unfolding nsphere + apply (simp add: continuous_map_of_snd) + apply (rule continuous_map_compose [of _ "nsphere p" f, unfolded o_def]) + using f apply (simp add: nsphere) + by (simp add: continuous_map_nsphere_projection) + then have "continuous_map (prod_topology ?T01 (nsphere p)) euclideanreal (\r. ?h r k)" + for k + unfolding case_prod_unfold o_def + by (intro continuous_map_into_fulltopology [OF continuous_map_fst] continuous_intros) auto + moreover have "?h ` ({0..1} \ topspace (nsphere p)) \ {x. \i\Suc p. x i = 0}" + using continuous_map_image_subset_topspace [OF f] + by (auto simp: nsphere image_subset_iff a0) + moreover have "(\i. 0) \ ?h ` ({0..1} \ topspace (nsphere p))" + proof clarify + fix t b + assume eq: "(\i. 0) = (\i. (1 - t) * f b i - t * a i)" and "t \ {0..1}" and b: "b \ topspace (nsphere p)" + have "(1 - t)\<^sup>2 = (\i\p. ((1 - t) * f b i)^2)" + using f1 [OF b] by (simp add: power_mult_distrib flip: sum_distrib_left) + also have "\ = (\i\p. (t * a i)^2)" + using eq by (simp add: fun_eq_iff) + also have "\ = t\<^sup>2" + using a1 by (simp add: power_mult_distrib flip: sum_distrib_left) + finally have "1 - t = t" + by (simp add: power2_eq_iff) + then have *: "t = 1/2" + by simp + have fba: "f b \ a" + using a(2) b by blast + then show False + using eq unfolding * by (simp add: fun_eq_iff) + qed + ultimately show "continuous_map (prod_topology ?T01 (nsphere p)) ?Y ?h" + by (simp add: Euclidean_space_def continuous_map_in_subtopology continuous_map_componentwise_UNIV) + next + have *: "\\i\Suc p. x i = 0; x \ (\i. 0)\ \ (\j\p. (x j)\<^sup>2) \ 0" for x :: "nat \ real" + by (force simp: fun_eq_iff not_less_eq_eq sum_nonneg_eq_0_iff) + show "continuous_map ?Y (nsphere p) ?g" + apply (simp add: Euclidean_space_def continuous_map_in_subtopology continuous_map_componentwise_UNIV + nsphere continuous_map_componentwise subtopology_subtopology) + apply (intro conjI allI continuous_intros continuous_map_from_subtopology [OF continuous_map_product_projection]) + apply (simp_all add: *) + apply (force simp: sum_nonneg fun_eq_iff not_less_eq_eq sum_nonneg_eq_0_iff power_divide simp flip: sum_divide_distrib) + done + qed + have 2: "(?g \ ?h) (0, x) = f x" if "x \ topspace (nsphere p)" for x + using that f1 by simp + have 3: "(?g \ ?h) (1, x) = (\i. - a i)" for x + using a by (force simp: divide_simps nsphere) + then show "homotopic_with (\x. True) (nsphere p) (nsphere p) f (\x. (\i. - a i))" + by (force simp: homotopic_with intro: 1 2 3) + qed +qed + +lemma Hausdorff_Euclidean_space: + "Hausdorff_space (Euclidean_space n)" + unfolding Euclidean_space_def + by (rule Hausdorff_space_subtopology) (metis Hausdorff_space_euclidean euclidean_product_topology) + +end + diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Analysis/Abstract_Topology.thy --- a/src/HOL/Analysis/Abstract_Topology.thy Tue Mar 26 22:18:30 2019 +0100 +++ b/src/HOL/Analysis/Abstract_Topology.thy Wed Mar 27 14:08:26 2019 +0000 @@ -161,6 +161,12 @@ apply (metis openin_subset subset_eq) done +lemma topology_finer_closedin: + "topspace X = topspace Y \ (\S. openin Y S \ openin X S) \ (\S. closedin Y S \ closedin X S)" + apply safe + apply (simp add: closedin_def) + by (simp add: openin_closedin_eq) + lemma openin_closedin: "S \ topspace U \ (openin U S \ closedin U (topspace U - S))" by (simp add: openin_closedin_eq) @@ -1611,7 +1617,7 @@ declare continuous_map_const [THEN iffD2, continuous_intros] -lemma continuous_map_compose: +lemma continuous_map_compose [continuous_intros]: assumes f: "continuous_map X X' f" and g: "continuous_map X' X'' g" shows "continuous_map X X'' (g \ f)" unfolding continuous_map_def @@ -1711,10 +1717,10 @@ "continuous_map X euclideanreal f \ continuous_map X euclideanreal (\x. sqrt(f x))" by (meson continuous_map_compose continuous_map_eq continuous_map_square_root o_apply) -lemma continuous_map_id [simp]: "continuous_map X X id" +lemma continuous_map_id [simp, continuous_intros]: "continuous_map X X id" unfolding continuous_map_def using openin_subopen topspace_def by fastforce -declare continuous_map_id [unfolded id_def, simp] +declare continuous_map_id [unfolded id_def, simp, continuous_intros] lemma continuous_map_id_subt [simp]: "continuous_map (subtopology X S) X id" by (simp add: continuous_map_from_subtopology) diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Analysis/Analysis.thy --- a/src/HOL/Analysis/Analysis.thy Tue Mar 26 22:18:30 2019 +0100 +++ b/src/HOL/Analysis/Analysis.thy Wed Mar 27 14:08:26 2019 +0000 @@ -6,7 +6,7 @@ (* Topology *) Connected Abstract_Limits - Locally + Abstract_Euclidean_Space (* Functional Analysis *) Elementary_Normed_Spaces Norm_Arith diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Analysis/Function_Topology.thy --- a/src/HOL/Analysis/Function_Topology.thy Tue Mar 26 22:18:30 2019 +0100 +++ b/src/HOL/Analysis/Function_Topology.thy Wed Mar 27 14:08:26 2019 +0000 @@ -78,6 +78,9 @@ where "product_topology T I = topology_generated_by {(\\<^sub>E i\I. X i) |X. (\i. openin (T i) (X i)) \ finite {i. X i \ topspace (T i)}}" +abbreviation powertop_real :: "'a set \ ('a \ real) topology" + where "powertop_real \ product_topology (\i. euclideanreal)" + text \The total set of the product topology is the product of the total sets along each coordinate.\ @@ -1994,5 +1997,55 @@ PiE I S = {} \ (\i \ I. path_connectedin (X i) (S i))" by (fastforce simp add: path_connectedin_def subtopology_PiE path_connected_space_product_topology subset_PiE PiE_eq_empty_iff topspace_subtopology_subset) +subsection \Projections from a function topology to a component\ + +lemma quotient_map_product_projection: + assumes "i \ I" + shows "quotient_map(product_topology X I) (X i) (\x. x i) \ + (topspace(product_topology X I) = {} \ topspace(X i) = {})" + (is "?lhs = ?rhs") +proof + assume ?lhs with assms show ?rhs + by (auto simp: continuous_open_quotient_map open_map_product_projection) +next + assume ?rhs with assms show ?lhs + by (auto simp: Abstract_Topology.retraction_imp_quotient_map retraction_map_product_projection) +qed + +lemma product_topology_homeomorphic_component: + assumes "i \ I" "\j. \j \ I; j \ i\ \ \a. topspace(X j) = {a}" + shows "product_topology X I homeomorphic_space (X i)" +proof - + have "quotient_map (product_topology X I) (X i) (\x. x i)" + using assms by (force simp add: quotient_map_product_projection PiE_eq_empty_iff) + moreover + have "inj_on (\x. x i) (\\<^sub>E i\I. topspace (X i))" + using assms by (auto simp: inj_on_def PiE_iff) (metis extensionalityI singletonD) + ultimately show ?thesis + unfolding homeomorphic_space_def + by (rule_tac x="\x. x i" in exI) (simp add: homeomorphic_map_def flip: homeomorphic_map_maps) +qed + +lemma topological_property_of_product_component: + assumes major: "P (product_topology X I)" + and minor: "\z i. \z \ (\\<^sub>E i\I. topspace(X i)); P(product_topology X I); i \ I\ + \ P(subtopology (product_topology X I) (PiE I (\j. if j = i then topspace(X i) else {z j})))" + (is "\z i. \_; _; _\ \ P (?SX z i)") + and PQ: "\X X'. X homeomorphic_space X' \ (P X \ Q X')" + shows "(\\<^sub>E i\I. topspace(X i)) = {} \ (\i \ I. Q(X i))" +proof - + have "Q(X i)" if "(\\<^sub>E i\I. topspace(X i)) \ {}" "i \ I" for i + proof - + from that obtain f where f: "f \ (\\<^sub>E i\I. topspace (X i))" + by force + have "?SX f i homeomorphic_space X i" + apply (simp add: subtopology_PiE ) + using product_topology_homeomorphic_component [OF \i \ I\, of "\j. subtopology (X j) (if j = i then topspace (X i) else {f j})"] + using f by fastforce + then show ?thesis + using minor [OF f major \i \ I\] PQ by auto + qed + then show ?thesis by metis +qed end diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Analysis/Product_Topology.thy --- a/src/HOL/Analysis/Product_Topology.thy Tue Mar 26 22:18:30 2019 +0100 +++ b/src/HOL/Analysis/Product_Topology.thy Wed Mar 27 14:08:26 2019 +0000 @@ -214,6 +214,14 @@ lemma continuous_map_snd_of [continuous_intros]: "continuous_map Z (prod_topology X Y) f \ continuous_map Z Y (snd \ f)" by (simp add: continuous_map_pairwise) + +lemma continuous_map_prod_fst: + "i \ I \ continuous_map (prod_topology (product_topology (\i. Y) I) X) Y (\x. fst x i)" + using continuous_map_componentwise_UNIV continuous_map_fst by fastforce + +lemma continuous_map_prod_snd: + "i \ I \ continuous_map (prod_topology X (product_topology (\i. Y) I)) Y (\x. snd x i)" + using continuous_map_componentwise_UNIV continuous_map_snd by fastforce lemma continuous_map_if_iff [simp]: "continuous_map X Y (\x. if P then f x else g x) \ continuous_map X Y (if P then f else g)" by simp diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Analysis/T1_Spaces.thy --- a/src/HOL/Analysis/T1_Spaces.thy Tue Mar 26 22:18:30 2019 +0100 +++ b/src/HOL/Analysis/T1_Spaces.thy Wed Mar 27 14:08:26 2019 +0000 @@ -1,9 +1,11 @@ -section\T1 spaces with equivalences to many naturally "nice" properties. \ +section\T1 and Hausdorff spaces\ theory T1_Spaces imports Product_Topology begin +section\T1 spaces with equivalences to many naturally "nice" properties. \ + definition t1_space where "t1_space X \ \x \ topspace X. \y \ topspace X. x\y \ (\U. openin X U \ x \ U \ y \ U)" @@ -214,4 +216,442 @@ by simp qed +subsection\Hausdorff Spaces\ + +definition Hausdorff_space + where + "Hausdorff_space X \ + \x y. x \ topspace X \ y \ topspace X \ (x \ y) + \ (\U V. openin X U \ openin X V \ x \ U \ y \ V \ disjnt U V)" + +lemma Hausdorff_space_expansive: + "\Hausdorff_space X; topspace X = topspace Y; \U. openin X U \ openin Y U\ \ Hausdorff_space Y" + by (metis Hausdorff_space_def) + +lemma Hausdorff_space_topspace_empty: + "topspace X = {} \ Hausdorff_space X" + by (simp add: Hausdorff_space_def) + +lemma Hausdorff_imp_t1_space: + "Hausdorff_space X \ t1_space X" + by (metis Hausdorff_space_def disjnt_iff t1_space_def) + +lemma closedin_derived_set_of: + "Hausdorff_space X \ closedin X (X derived_set_of S)" + by (simp add: Hausdorff_imp_t1_space closedin_derived_set_of_gen) + +lemma t1_or_Hausdorff_space: + "t1_space X \ Hausdorff_space X \ t1_space X" + using Hausdorff_imp_t1_space by blast + +lemma Hausdorff_space_sing_Inter_opens: + "\Hausdorff_space X; a \ topspace X\ \ \{u. openin X u \ a \ u} = {a}" + using Hausdorff_imp_t1_space t1_space_singleton_Inter_open by force + +lemma Hausdorff_space_subtopology: + assumes "Hausdorff_space X" shows "Hausdorff_space(subtopology X S)" +proof - + have *: "disjnt U V \ disjnt (S \ U) (S \ V)" for U V + by (simp add: disjnt_iff) + from assms show ?thesis + apply (simp add: Hausdorff_space_def openin_subtopology_alt) + apply (fast intro: * elim!: all_forward) + done +qed + +lemma Hausdorff_space_compact_separation: + assumes X: "Hausdorff_space X" and S: "compactin X S" and T: "compactin X T" and "disjnt S T" + obtains U V where "openin X U" "openin X V" "S \ U" "T \ V" "disjnt U V" +proof (cases "S = {}") + case True + then show thesis + by (metis \compactin X T\ compactin_subset_topspace disjnt_empty1 empty_subsetI openin_empty openin_topspace that) +next + case False + have "\x \ S. \U V. openin X U \ openin X V \ x \ U \ T \ V \ disjnt U V" + proof + fix a + assume "a \ S" + then have "a \ T" + by (meson assms(4) disjnt_iff) + have a: "a \ topspace X" + using S \a \ S\ compactin_subset_topspace by blast + show "\U V. openin X U \ openin X V \ a \ U \ T \ V \ disjnt U V" + proof (cases "T = {}") + case True + then show ?thesis + using a disjnt_empty2 openin_empty by blast + next + case False + have "\x \ topspace X - {a}. \U V. openin X U \ openin X V \ x \ U \ a \ V \ disjnt U V" + using X a by (simp add: Hausdorff_space_def) + then obtain U V where UV: "\x \ topspace X - {a}. openin X (U x) \ openin X (V x) \ x \ U x \ a \ V x \ disjnt (U x) (V x)" + by metis + with \a \ T\ compactin_subset_topspace [OF T] + have Topen: "\W \ U ` T. openin X W" and Tsub: "T \ \ (U ` T)" + by (auto simp: ) + then obtain \ where \: "finite \" "\ \ U ` T" and "T \ \\" + using T unfolding compactin_def by meson + then obtain F where F: "finite F" "F \ T" "\ = U ` F" and SUF: "T \ \(U ` F)" and "a \ F" + using finite_subset_image [OF \] \a \ T\ by (metis subsetD) + have U: "\x. \x \ topspace X; x \ a\ \ openin X (U x)" + and V: "\x. \x \ topspace X; x \ a\ \ openin X (V x)" + and disj: "\x. \x \ topspace X; x \ a\ \ disjnt (U x) (V x)" + using UV by blast+ + show ?thesis + proof (intro exI conjI) + have "F \ {}" + using False SUF by blast + with \a \ F\ show "openin X (\(V ` F))" + using F compactin_subset_topspace [OF T] by (force intro: V) + show "openin X (\(U ` F))" + using F Topen Tsub by (force intro: U) + show "disjnt (\(V ` F)) (\(U ` F))" + using disj + apply (auto simp: disjnt_def) + using \F \ T\ \a \ F\ compactin_subset_topspace [OF T] by blast + show "a \ (\(V ` F))" + using \F \ T\ T UV \a \ T\ compactin_subset_topspace by blast + qed (auto simp: SUF) + qed + qed + then obtain U V where UV: "\x \ S. openin X (U x) \ openin X (V x) \ x \ U x \ T \ V x \ disjnt (U x) (V x)" + by metis + then have "S \ \ (U ` S)" + by auto + moreover have "\W \ U ` S. openin X W" + using UV by blast + ultimately obtain I where I: "S \ \ (U ` I)" "I \ S" "finite I" + by (metis S compactin_def finite_subset_image) + show thesis + proof + show "openin X (\(U ` I))" + using \I \ S\ UV by blast + show "openin X (\ (V ` I))" + using False UV \I \ S\ \S \ \ (U ` I)\ \finite I\ by blast + show "disjnt (\(U ` I)) (\ (V ` I))" + by simp (meson UV \I \ S\ disjnt_subset2 in_mono le_INF_iff order_refl) + qed (use UV I in auto) +qed + + +lemma Hausdorff_space_compact_sets: + "Hausdorff_space X \ + (\S T. compactin X S \ compactin X T \ disjnt S T + \ (\U V. openin X U \ openin X V \ S \ U \ T \ V \ disjnt U V))" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + by (meson Hausdorff_space_compact_separation) +next + assume R [rule_format]: ?rhs + show ?lhs + proof (clarsimp simp add: Hausdorff_space_def) + fix x y + assume "x \ topspace X" "y \ topspace X" "x \ y" + then show "\U. openin X U \ (\V. openin X V \ x \ U \ y \ V \ disjnt U V)" + using R [of "{x}" "{y}"] by auto + qed +qed + +lemma compactin_imp_closedin: + assumes X: "Hausdorff_space X" and S: "compactin X S" shows "closedin X S" +proof - + have "S \ topspace X" + by (simp add: assms compactin_subset_topspace) + moreover + have "\T. openin X T \ x \ T \ T \ topspace X - S" if "x \ topspace X" "x \ S" for x + using Hausdorff_space_compact_separation [OF X _ S, of "{x}"] that + apply (simp add: disjnt_def) + by (metis Diff_mono Diff_triv openin_subset) + ultimately show ?thesis + using closedin_def openin_subopen by force +qed + +lemma closedin_Hausdorff_singleton: + "\Hausdorff_space X; x \ topspace X\ \ closedin X {x}" + by (simp add: Hausdorff_imp_t1_space closedin_t1_singleton) + +lemma closedin_Hausdorff_sing_eq: + "Hausdorff_space X \ closedin X {x} \ x \ topspace X" + by (meson closedin_Hausdorff_singleton closedin_subset insert_subset) + +lemma Hausdorff_space_discrete_topology [simp]: + "Hausdorff_space (discrete_topology U)" + unfolding Hausdorff_space_def + apply safe + by (metis discrete_topology_unique_alt disjnt_empty2 disjnt_insert2 insert_iff mk_disjoint_insert topspace_discrete_topology) + +lemma compactin_Int: + "\Hausdorff_space X; compactin X S; compactin X T\ \ compactin X (S \ T)" + by (simp add: closed_Int_compactin compactin_imp_closedin) + +lemma finite_topspace_imp_discrete_topology: + "\topspace X = U; finite U; Hausdorff_space X\ \ X = discrete_topology U" + using Hausdorff_imp_t1_space finite_t1_space_imp_discrete_topology by blast + +lemma derived_set_of_finite: + "\Hausdorff_space X; finite S\ \ X derived_set_of S = {}" + using Hausdorff_imp_t1_space t1_space_derived_set_of_finite by auto + +lemma derived_set_of_singleton: + "Hausdorff_space X \ X derived_set_of {x} = {}" + by (simp add: derived_set_of_finite) + +lemma closedin_Hausdorff_finite: + "\Hausdorff_space X; S \ topspace X; finite S\ \ closedin X S" + by (simp add: compactin_imp_closedin finite_imp_compactin_eq) + +lemma open_in_Hausdorff_delete: + "\Hausdorff_space X; openin X S\ \ openin X (S - {x})" + using Hausdorff_imp_t1_space t1_space_openin_delete_alt by auto + +lemma closedin_Hausdorff_finite_eq: + "\Hausdorff_space X; finite S\ \ closedin X S \ S \ topspace X" + by (meson closedin_Hausdorff_finite closedin_def) + +lemma derived_set_of_infinite_open_in: + "Hausdorff_space X + \ X derived_set_of S = + {x \ topspace X. \U. x \ U \ openin X U \ infinite(S \ U)}" + using Hausdorff_imp_t1_space t1_space_derived_set_of_infinite_openin by fastforce + +lemma Hausdorff_space_discrete_compactin: + "Hausdorff_space X + \ S \ X derived_set_of S = {} \ compactin X S \ S \ topspace X \ finite S" + using derived_set_of_finite discrete_compactin_eq_finite by fastforce + +lemma Hausdorff_space_finite_topspace: + "Hausdorff_space X \ X derived_set_of (topspace X) = {} \ compact_space X \ finite(topspace X)" + using derived_set_of_finite discrete_compact_space_eq_finite by auto + +lemma derived_set_of_derived_set_subset: + "Hausdorff_space X \ X derived_set_of (X derived_set_of S) \ X derived_set_of S" + by (simp add: Hausdorff_imp_t1_space derived_set_of_derived_set_subset_gen) + + +lemma Hausdorff_space_injective_preimage: + assumes "Hausdorff_space Y" and cmf: "continuous_map X Y f" and "inj_on f (topspace X)" + shows "Hausdorff_space X" + unfolding Hausdorff_space_def +proof clarify + fix x y + assume x: "x \ topspace X" and y: "y \ topspace X" and "x \ y" + then obtain U V where "openin Y U" "openin Y V" "f x \ U" "f y \ V" "disjnt U V" + using assms unfolding Hausdorff_space_def continuous_map_def by (meson inj_onD) + show "\U V. openin X U \ openin X V \ x \ U \ y \ V \ disjnt U V" + proof (intro exI conjI) + show "openin X {x \ topspace X. f x \ U}" + using \openin Y U\ cmf continuous_map by fastforce + show "openin X {x \ topspace X. f x \ V}" + using \openin Y V\ cmf openin_continuous_map_preimage by blast + show "disjnt {x \ topspace X. f x \ U} {x \ topspace X. f x \ V}" + using \disjnt U V\ by (auto simp add: disjnt_def) + qed (use x \f x \ U\ y \f y \ V\ in auto) +qed + +lemma homeomorphic_Hausdorff_space: + "X homeomorphic_space Y \ Hausdorff_space X \ Hausdorff_space Y" + unfolding homeomorphic_space_def homeomorphic_maps_map + by (auto simp: homeomorphic_eq_everything_map Hausdorff_space_injective_preimage) + +lemma Hausdorff_space_retraction_map_image: + "\retraction_map X Y r; Hausdorff_space X\ \ Hausdorff_space Y" + unfolding retraction_map_def + using Hausdorff_space_subtopology homeomorphic_Hausdorff_space retraction_maps_section_image2 by blast + +lemma compact_Hausdorff_space_optimal: + assumes eq: "topspace Y = topspace X" and XY: "\U. openin X U \ openin Y U" + and "Hausdorff_space X" "compact_space Y" + shows "Y = X" +proof - + have "\U. closedin X U \ closedin Y U" + using XY using topology_finer_closedin [OF eq] + by metis + have "openin Y S = openin X S" for S + by (metis XY assms(3) assms(4) closedin_compact_space compactin_contractive compactin_imp_closedin eq openin_closedin_eq) + then show ?thesis + by (simp add: topology_eq) +qed + +lemma continuous_imp_closed_map: + "\compact_space X; Hausdorff_space Y; continuous_map X Y f\ \ closed_map X Y f" + by (meson closed_map_def closedin_compact_space compactin_imp_closedin image_compactin) + +lemma continuous_imp_quotient_map: + "\compact_space X; Hausdorff_space Y; continuous_map X Y f; f ` (topspace X) = topspace Y\ + \ quotient_map X Y f" + by (simp add: continuous_imp_closed_map continuous_closed_imp_quotient_map) + +lemma continuous_imp_homeomorphic_map: + "\compact_space X; Hausdorff_space Y; continuous_map X Y f; + f ` (topspace X) = topspace Y; inj_on f (topspace X)\ + \ homeomorphic_map X Y f" + by (simp add: continuous_imp_closed_map bijective_closed_imp_homeomorphic_map) + +lemma continuous_imp_embedding_map: + "\compact_space X; Hausdorff_space Y; continuous_map X Y f; inj_on f (topspace X)\ + \ embedding_map X Y f" + by (simp add: continuous_imp_closed_map injective_closed_imp_embedding_map) + +lemma continuous_inverse_map: + assumes "compact_space X" "Hausdorff_space Y" + and cmf: "continuous_map X Y f" and gf: "\x. x \ topspace X \ g(f x) = x" + and Sf: "S \ f ` (topspace X)" + shows "continuous_map (subtopology Y S) X g" +proof (rule continuous_map_from_subtopology_mono [OF _ \S \ f ` (topspace X)\]) + show "continuous_map (subtopology Y (f ` (topspace X))) X g" + unfolding continuous_map_closedin + proof (intro conjI ballI allI impI) + fix x + assume "x \ topspace (subtopology Y (f ` topspace X))" + then show "g x \ topspace X" + by (auto simp: gf) + next + fix C + assume C: "closedin X C" + show "closedin (subtopology Y (f ` topspace X)) + {x \ topspace (subtopology Y (f ` topspace X)). g x \ C}" + proof (rule compactin_imp_closedin) + show "Hausdorff_space (subtopology Y (f ` topspace X))" + using Hausdorff_space_subtopology [OF \Hausdorff_space Y\] by blast + have "compactin Y (f ` C)" + using C cmf image_compactin closedin_compact_space [OF \compact_space X\] by blast + moreover have "{x \ topspace Y. x \ f ` topspace X \ g x \ C} = f ` C" + using closedin_subset [OF C] cmf by (auto simp: gf continuous_map_def) + ultimately have "compactin Y {x \ topspace Y. x \ f ` topspace X \ g x \ C}" + by simp + then show "compactin (subtopology Y (f ` topspace X)) + {x \ topspace (subtopology Y (f ` topspace X)). g x \ C}" + by (auto simp add: compactin_subtopology) + qed + qed +qed + + +lemma Hausdorff_space_euclidean: "Hausdorff_space (euclidean :: 'a::metric_space topology)" +proof - + have "\U V. open U \ open V \ x \ U \ y \ V \ disjnt U V" + if "x \ y" + for x y :: 'a + proof (intro exI conjI) + let ?r = "dist x y / 2" + have [simp]: "?r > 0" + by (simp add: that) + show "open (ball x ?r)" "open (ball y ?r)" "x \ (ball x ?r)" "y \ (ball y ?r)" + by (auto simp add: that) + show "disjnt (ball x ?r) (ball y ?r)" + unfolding disjnt_def by (simp add: disjoint_ballI) + qed + then show ?thesis + by (simp add: Hausdorff_space_def) +qed + +lemma Hausdorff_space_prod_topology: + "Hausdorff_space(prod_topology X Y) \ topspace(prod_topology X Y) = {} \ Hausdorff_space X \ Hausdorff_space Y" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + by (rule topological_property_of_prod_component) (auto simp: Hausdorff_space_subtopology homeomorphic_Hausdorff_space) +next + assume R: ?rhs + show ?lhs + proof (cases "(topspace X \ topspace Y) = {}") + case False + with R have ne: "topspace X \ {}" "topspace Y \ {}" and X: "Hausdorff_space X" and Y: "Hausdorff_space Y" + by auto + show ?thesis + unfolding Hausdorff_space_def + proof clarify + fix x y x' y' + assume xy: "(x, y) \ topspace (prod_topology X Y)" + and xy': "(x',y') \ topspace (prod_topology X Y)" + and *: "\U V. openin (prod_topology X Y) U \ openin (prod_topology X Y) V + \ (x, y) \ U \ (x', y') \ V \ disjnt U V" + have False if "x \ x' \ y \ y'" + using that + proof + assume "x \ x'" + then obtain U V where "openin X U" "openin X V" "x \ U" "x' \ V" "disjnt U V" + by (metis Hausdorff_space_def X mem_Sigma_iff topspace_prod_topology xy xy') + let ?U = "U \ topspace Y" + let ?V = "V \ topspace Y" + have "openin (prod_topology X Y) ?U" "openin (prod_topology X Y) ?V" + by (simp_all add: openin_prod_Times_iff \openin X U\ \openin X V\) + moreover have "disjnt ?U ?V" + by (simp add: \disjnt U V\) + ultimately show False + using * \x \ U\ \x' \ V\ xy xy' by (metis SigmaD2 SigmaI topspace_prod_topology) + next + assume "y \ y'" + then obtain U V where "openin Y U" "openin Y V" "y \ U" "y' \ V" "disjnt U V" + by (metis Hausdorff_space_def Y mem_Sigma_iff topspace_prod_topology xy xy') + let ?U = "topspace X \ U" + let ?V = "topspace X \ V" + have "openin (prod_topology X Y) ?U" "openin (prod_topology X Y) ?V" + by (simp_all add: openin_prod_Times_iff \openin Y U\ \openin Y V\) + moreover have "disjnt ?U ?V" + by (simp add: \disjnt U V\) + ultimately show False + using "*" \y \ U\ \y' \ V\ xy xy' by (metis SigmaD1 SigmaI topspace_prod_topology) + qed + then show "x = x' \ y = y'" + by blast + qed + qed (simp add: Hausdorff_space_topspace_empty) +qed + + +lemma Hausdorff_space_product_topology: + "Hausdorff_space (product_topology X I) \ (\\<^sub>E i\I. topspace(X i)) = {} \ (\i \ I. Hausdorff_space (X i))" + (is "?lhs = ?rhs") +proof + assume ?lhs + then show ?rhs + apply (rule topological_property_of_product_component) + apply (blast dest: Hausdorff_space_subtopology homeomorphic_Hausdorff_space)+ + done +next + assume R: ?rhs + show ?lhs + proof (cases "(\\<^sub>E i\I. topspace(X i)) = {}") + case True + then show ?thesis + by (simp add: Hausdorff_space_topspace_empty) + next + case False + have "\U V. openin (product_topology X I) U \ openin (product_topology X I) V \ f \ U \ g \ V \ disjnt U V" + if f: "f \ (\\<^sub>E i\I. topspace (X i))" and g: "g \ (\\<^sub>E i\I. topspace (X i))" and "f \ g" + for f g :: "'a \ 'b" + proof - + obtain m where "f m \ g m" + using \f \ g\ by blast + then have "m \ I" + using f g by fastforce + then have "Hausdorff_space (X m)" + using False that R by blast + then obtain U V where U: "openin (X m) U" and V: "openin (X m) V" and "f m \ U" "g m \ V" "disjnt U V" + by (metis Hausdorff_space_def PiE_mem \f m \ g m\ \m \ I\ f g) + show ?thesis + proof (intro exI conjI) + let ?U = "(\\<^sub>E i\I. topspace(X i)) \ {x. x m \ U}" + let ?V = "(\\<^sub>E i\I. topspace(X i)) \ {x. x m \ V}" + show "openin (product_topology X I) ?U" "openin (product_topology X I) ?V" + using \m \ I\ U V + by (force simp add: openin_product_topology intro: arbitrary_union_of_inc relative_to_inc finite_intersection_of_inc)+ + show "f \ ?U" + using \f m \ U\ f by blast + show "g \ ?V" + using \g m \ V\ g by blast + show "disjnt ?U ?V" + using \disjnt U V\ by (auto simp: PiE_def Pi_def disjnt_def) + qed + qed + then show ?thesis + by (simp add: Hausdorff_space_def) + qed +qed + end diff -r 3fd083253a1c -r cf7150ab1075 src/HOL/Product_Type.thy --- a/src/HOL/Product_Type.thy Tue Mar 26 22:18:30 2019 +0100 +++ b/src/HOL/Product_Type.thy Wed Mar 27 14:08:26 2019 +0000 @@ -1272,6 +1272,17 @@ proc = K Set_Comprehension_Pointfree.code_simproc}]) \ +subsection \Lemmas about disjointness\ + +lemma disjnt_Times1_iff [simp]: "disjnt (C \ A) (C \ B) \ C = {} \ disjnt A B" + by (auto simp: disjnt_def) + +lemma disjnt_Times2_iff [simp]: "disjnt (A \ C) (B \ C) \ C = {} \ disjnt A B" + by (auto simp: disjnt_def) + +lemma disjnt_Sigma_iff: "disjnt (Sigma A C) (Sigma B C) \ (\i \ A\B. C i = {}) \ disjnt A B" + by (auto simp: disjnt_def) + subsection \Inductively defined sets\