# HG changeset patch # User paulson # Date 1684406682 -3600 # Node ID 2c1b0156316380307b467e44783426064ac2923c # Parent 37894dff0111101415bedcc88781707580944b06 New material from the HOL Light metric space library, mostly about quasi components diff -r 37894dff0111 -r 2c1b01563163 src/HOL/Analysis/Abstract_Topological_Spaces.thy --- a/src/HOL/Analysis/Abstract_Topological_Spaces.thy Mon May 15 17:12:18 2023 +0100 +++ b/src/HOL/Analysis/Abstract_Topological_Spaces.thy Thu May 18 11:44:42 2023 +0100 @@ -3464,5 +3464,974 @@ by force qed +subsection\Quasi-components\ + +definition quasi_component_of :: "'a topology \ 'a \ 'a \ bool" + where + "quasi_component_of X x y \ + x \ topspace X \ y \ topspace X \ + (\T. closedin X T \ openin X T \ (x \ T \ y \ T))" + +abbreviation "quasi_component_of_set S x \ Collect (quasi_component_of S x)" + +definition quasi_components_of :: "'a topology \ ('a set) set" + where + "quasi_components_of X = quasi_component_of_set X ` topspace X" + +lemma quasi_component_in_topspace: + "quasi_component_of X x y \ x \ topspace X \ y \ topspace X" + by (simp add: quasi_component_of_def) + +lemma quasi_component_of_refl [simp]: + "quasi_component_of X x x \ x \ topspace X" + by (simp add: quasi_component_of_def) + +lemma quasi_component_of_sym: + "quasi_component_of X x y \ quasi_component_of X y x" + by (meson quasi_component_of_def) + +lemma quasi_component_of_trans: + "\quasi_component_of X x y; quasi_component_of X y z\ \ quasi_component_of X x z" + by (simp add: quasi_component_of_def) + +lemma quasi_component_of_subset_topspace: + "quasi_component_of_set X x \ topspace X" + using quasi_component_of_def by fastforce + +lemma quasi_component_of_eq_empty: + "quasi_component_of_set X x = {} \ (x \ topspace X)" + using quasi_component_of_def by fastforce + +lemma quasi_component_of: + "quasi_component_of X x y \ + x \ topspace X \ y \ topspace X \ (\T. x \ T \ closedin X T \ openin X T \ y \ T)" + unfolding quasi_component_of_def by blast + +lemma quasi_component_of_alt: + "quasi_component_of X x y \ + x \ topspace X \ y \ topspace X \ + \ (\U V. openin X U \ openin X V \ U \ V = topspace X \ disjnt U V \ x \ U \ y \ V)" + (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + unfolding quasi_component_of_def + by (metis disjnt_iff separatedin_full separatedin_open_sets) + show "?rhs \ ?lhs" + unfolding quasi_component_of_def + by (metis Diff_disjoint Diff_iff Un_Diff_cancel closedin_def disjnt_def inf_commute sup.orderE sup_commute) +qed + +lemma quasi_component_of_separated: + "quasi_component_of X x y \ + x \ topspace X \ y \ topspace X \ + \ (\U V. separatedin X U V \ U \ V = topspace X \ x \ U \ y \ V)" + by (meson quasi_component_of_alt separatedin_full separatedin_open_sets) + +lemma quasi_component_of_subtopology: + "quasi_component_of (subtopology X s) x y \ quasi_component_of X x y" + unfolding quasi_component_of_def + by (simp add: closedin_subtopology) (metis Int_iff inf_commute openin_subtopology_Int2) + +lemma quasi_component_of_mono: + "quasi_component_of (subtopology X S) x y \ S \ T + \ quasi_component_of (subtopology X T) x y" + by (metis inf.absorb_iff2 quasi_component_of_subtopology subtopology_subtopology) + +lemma quasi_component_of_equiv: + "quasi_component_of X x y \ + x \ topspace X \ y \ topspace X \ quasi_component_of X x = quasi_component_of X y" + using quasi_component_of_def by fastforce + +lemma quasi_component_of_disjoint [simp]: + "disjnt (quasi_component_of_set X x) (quasi_component_of_set X y) \ \ (quasi_component_of X x y)" + by (metis disjnt_iff quasi_component_of_equiv mem_Collect_eq) + +lemma quasi_component_of_eq: + "quasi_component_of X x = quasi_component_of X y \ + (x \ topspace X \ y \ topspace X) + \ x \ topspace X \ y \ topspace X \ quasi_component_of X x y" + by (metis Collect_empty_eq_bot quasi_component_of_eq_empty quasi_component_of_equiv) + +lemma topspace_imp_quasi_components_of: + assumes "x \ topspace X" + obtains C where "C \ quasi_components_of X" "x \ C" + by (metis assms imageI mem_Collect_eq quasi_component_of_refl quasi_components_of_def) + +lemma Union_quasi_components_of: "\ (quasi_components_of X) = topspace X" + by (auto simp: quasi_components_of_def quasi_component_of_def) + +lemma pairwise_disjoint_quasi_components_of: + "pairwise disjnt (quasi_components_of X)" + by (auto simp: quasi_components_of_def quasi_component_of_def disjoint_def) + +lemma complement_quasi_components_of_Union: + assumes "C \ quasi_components_of X" + shows "topspace X - C = \ (quasi_components_of X - {C})" (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + using Union_quasi_components_of by fastforce + show "?rhs \ ?lhs" + using assms + using quasi_component_of_equiv by (fastforce simp add: quasi_components_of_def image_iff subset_iff) +qed + +lemma nonempty_quasi_components_of: + "C \ quasi_components_of X \ C \ {}" + by (metis imageE quasi_component_of_eq_empty quasi_components_of_def) + +lemma quasi_components_of_subset: + "C \ quasi_components_of X \ C \ topspace X" + using Union_quasi_components_of by force + +lemma quasi_component_in_quasi_components_of: + "quasi_component_of_set X a \ quasi_components_of X \ a \ topspace X" + by (metis (no_types, lifting) image_iff quasi_component_of_eq_empty quasi_components_of_def) + +lemma quasi_components_of_eq_empty [simp]: + "quasi_components_of X = {} \ topspace X = {}" + by (simp add: quasi_components_of_def) + +lemma quasi_components_of_empty_space: + "topspace X = {} \ quasi_components_of X = {}" + by simp + +lemma quasi_component_of_set: + "quasi_component_of_set X x = + (if x \ topspace X + then \ {t. closedin X t \ openin X t \ x \ t} + else {})" + by (auto simp: quasi_component_of) + +lemma closedin_quasi_component_of: "closedin X (quasi_component_of_set X x)" + by (auto simp: quasi_component_of_set) + +lemma closedin_quasi_components_of: + "C \ quasi_components_of X \ closedin X C" + by (auto simp: quasi_components_of_def closedin_quasi_component_of) + +lemma openin_finite_quasi_components: + "\finite(quasi_components_of X); C \ quasi_components_of X\ \ openin X C" + apply (simp add:openin_closedin_eq quasi_components_of_subset complement_quasi_components_of_Union) + by (meson DiffD1 closedin_Union closedin_quasi_components_of finite_Diff) + +lemma quasi_component_of_eq_overlap: + "quasi_component_of X x = quasi_component_of X y \ + (x \ topspace X \ y \ topspace X) \ + \ (quasi_component_of_set X x \ quasi_component_of_set X y = {})" + using quasi_component_of_equiv by fastforce + +lemma quasi_component_of_nonoverlap: + "quasi_component_of_set X x \ quasi_component_of_set X y = {} \ + (x \ topspace X) \ (y \ topspace X) \ + \ (quasi_component_of X x = quasi_component_of X y)" + by (metis inf.idem quasi_component_of_eq_empty quasi_component_of_eq_overlap) + +lemma quasi_component_of_overlap: + "\ (quasi_component_of_set X x \ quasi_component_of_set X y = {}) \ + x \ topspace X \ y \ topspace X \ quasi_component_of X x = quasi_component_of X y" + by (meson quasi_component_of_nonoverlap) + +lemma quasi_components_of_disjoint: + "\C \ quasi_components_of X; D \ quasi_components_of X\ \ disjnt C D \ C \ D" + by (metis disjnt_self_iff_empty nonempty_quasi_components_of pairwiseD pairwise_disjoint_quasi_components_of) + +lemma quasi_components_of_overlap: + "\C \ quasi_components_of X; D \ quasi_components_of X\ \ \ (C \ D = {}) \ C = D" + by (metis disjnt_def quasi_components_of_disjoint) + +lemma pairwise_separated_quasi_components_of: + "pairwise (separatedin X) (quasi_components_of X)" + by (metis closedin_quasi_components_of pairwise_def pairwise_disjoint_quasi_components_of separatedin_closed_sets) + +lemma finite_quasi_components_of_finite: + "finite(topspace X) \ finite(quasi_components_of X)" + by (simp add: Union_quasi_components_of finite_UnionD) + +lemma connected_imp_quasi_component_of: + assumes "connected_component_of X x y" + shows "quasi_component_of X x y" +proof - + have "x \ topspace X" "y \ topspace X" + by (meson assms connected_component_of_equiv)+ + with assms show ?thesis + apply (clarsimp simp add: quasi_component_of connected_component_of_def) + by (meson connectedin_clopen_cases disjnt_iff subsetD) +qed + +lemma connected_component_subset_quasi_component_of: + "connected_component_of_set X x \ quasi_component_of_set X x" + using connected_imp_quasi_component_of by force + +lemma quasi_component_as_connected_component_Union: + "quasi_component_of_set X x = + \ (connected_component_of_set X ` quasi_component_of_set X x)" + (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + using connected_component_of_refl quasi_component_of by fastforce + show "?rhs \ ?lhs" + apply (rule SUP_least) + by (simp add: connected_component_subset_quasi_component_of quasi_component_of_equiv) +qed + +lemma quasi_components_as_connected_components_Union: + assumes "C \ quasi_components_of X" + obtains \ where "\ \ connected_components_of X" "\\ = C" +proof - + obtain x where "x \ topspace X" and Ceq: "C = quasi_component_of_set X x" + by (metis assms imageE quasi_components_of_def) + define \ where "\ \ connected_component_of_set X ` quasi_component_of_set X x" + show thesis + proof + show "\ \ connected_components_of X" + by (simp add: \_def connected_components_of_def image_mono quasi_component_of_subset_topspace) + show "\\ = C" + by (metis \_def Ceq quasi_component_as_connected_component_Union) + qed +qed + +lemma path_imp_quasi_component_of: + "path_component_of X x y \ quasi_component_of X x y" + by (simp add: connected_imp_quasi_component_of path_imp_connected_component_of) + +lemma path_component_subset_quasi_component_of: + "path_component_of_set X x \ quasi_component_of_set X x" + by (simp add: Collect_mono path_imp_quasi_component_of) + +lemma connected_space_iff_quasi_component: + "connected_space X \ (\x \ topspace X. \y \ topspace X. quasi_component_of X x y)" + unfolding connected_space_clopen_in closedin_def quasi_component_of + by blast + +lemma connected_space_imp_quasi_component_of: + " \connected_space X; a \ topspace X; b \ topspace X\ \ quasi_component_of X a b" + by (simp add: connected_space_iff_quasi_component) + +lemma connected_space_quasi_component_set: + "connected_space X \ (\x \ topspace X. quasi_component_of_set X x = topspace X)" + by (metis Ball_Collect connected_space_iff_quasi_component quasi_component_of_subset_topspace subset_antisym) + +lemma connected_space_iff_quasi_components_eq: + "connected_space X \ + (\C \ quasi_components_of X. \D \ quasi_components_of X. C = D)" + apply (simp add: quasi_components_of_def) + by (metis connected_space_iff_quasi_component mem_Collect_eq quasi_component_of_equiv) + +lemma quasi_components_of_subset_sing: + "quasi_components_of X \ {S} \ connected_space X \ (topspace X = {} \ topspace X = S)" +proof (cases "quasi_components_of X = {}") + case True + then show ?thesis + by (simp add: connected_space_topspace_empty subset_singleton_iff) +next + case False + then show ?thesis + apply (simp add: connected_space_iff_quasi_components_eq subset_iff Ball_def) + by (metis quasi_components_of_subset subsetI subset_antisym subset_empty topspace_imp_quasi_components_of) +qed + +lemma connected_space_iff_quasi_components_subset_sing: + "connected_space X \ (\a. quasi_components_of X \ {a})" + by (simp add: quasi_components_of_subset_sing) + +lemma quasi_components_of_eq_singleton: + "quasi_components_of X = {S} \ + connected_space X \ \ (topspace X = {}) \ S = topspace X" + by (metis ccpo_Sup_singleton insert_not_empty quasi_components_of_subset_sing subset_singleton_iff) + +lemma quasi_components_of_connected_space: + "connected_space X + \ quasi_components_of X = (if topspace X = {} then {} else {topspace X})" + by (simp add: quasi_components_of_eq_singleton) + +lemma separated_between_singletons: + "separated_between X {x} {y} \ + x \ topspace X \ y \ topspace X \ \ (quasi_component_of X x y)" +proof (cases "x \ topspace X \ y \ topspace X") + case True + then show ?thesis + by (auto simp add: separated_between_def quasi_component_of_alt) +qed (use separated_between_imp_subset in blast) + +lemma quasi_component_nonseparated: + "quasi_component_of X x y \ x \ topspace X \ y \ topspace X \ \ (separated_between X {x} {y})" + by (metis quasi_component_of_equiv separated_between_singletons) + +lemma separated_between_quasi_component_pointwise_left: + assumes "C \ quasi_components_of X" + shows "separated_between X C S \ (\x \ C. separated_between X {x} S)" (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + using assms quasi_components_of_disjoint separated_between_mono by fastforce +next + assume ?rhs + then obtain y where "separated_between X {y} S" and "y \ C" + by metis + with assms show ?lhs + by (force simp add: separated_between quasi_components_of_def quasi_component_of_def) +qed + +lemma separated_between_quasi_component_pointwise_right: + "C \ quasi_components_of X \ separated_between X S C \ (\x \ C. separated_between X S {x})" + by (simp add: separated_between_quasi_component_pointwise_left separated_between_sym) + +lemma separated_between_quasi_component_point: + assumes "C \ quasi_components_of X" + shows "separated_between X C {x} \ x \ topspace X - C" (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + by (meson DiffI disjnt_insert2 insert_subset separated_between_imp_disjoint separated_between_imp_subset) +next + assume ?rhs + with assms show ?lhs + unfolding quasi_components_of_def image_iff Diff_iff separated_between_quasi_component_pointwise_left [OF assms] + by (metis mem_Collect_eq quasi_component_of_refl separated_between_singletons) +qed + +lemma separated_between_point_quasi_component: + "C \ quasi_components_of X \ separated_between X {x} C \ x \ topspace X - C" + by (simp add: separated_between_quasi_component_point separated_between_sym) + +lemma separated_between_quasi_component_compact: + "\C \ quasi_components_of X; compactin X K\ \ (separated_between X C K \ disjnt C K)" + unfolding disjnt_iff + using compactin_subset_topspace quasi_components_of_subset separated_between_pointwise_right separated_between_quasi_component_point by fastforce + +lemma separated_between_compact_quasi_component: + "\compactin X K; C \ quasi_components_of X\ \ separated_between X K C \ disjnt K C" + using disjnt_sym separated_between_quasi_component_compact separated_between_sym by blast + +lemma separated_between_quasi_components: + assumes C: "C \ quasi_components_of X" and D: "D \ quasi_components_of X" + shows "separated_between X C D \ disjnt C D" (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + by (simp add: separated_between_imp_disjoint) +next + assume ?rhs + obtain x y where x: "C = quasi_component_of_set X x" and "x \ C" + and y: "D = quasi_component_of_set X y" and "y \ D" + using assms by (auto simp: quasi_components_of_def) + then have "separated_between X {x} {y}" + using \disjnt C D\ separated_between_singletons by fastforce + with \x \ C\ \y \ D\ show ?lhs + by (auto simp: assms separated_between_quasi_component_pointwise_left separated_between_quasi_component_pointwise_right) +qed + +lemma quasi_eq_connected_component_of_eq: + "quasi_component_of X x = connected_component_of X x \ + connectedin X (quasi_component_of_set X x)" (is "?lhs = ?rhs") +proof (cases "x \ topspace X") + case True + show ?thesis + proof + show "?lhs \ ?rhs" + by (simp add: connectedin_connected_component_of) + next + assume ?rhs + then have "\y. quasi_component_of X x y = connected_component_of X x y" + by (metis connected_component_of_def connected_imp_quasi_component_of mem_Collect_eq quasi_component_of_equiv) + then show ?lhs + by force + qed +next + case False + then show ?thesis + by (metis Collect_empty_eq_bot connected_component_of_eq_empty connectedin_empty quasi_component_of_eq_empty) +qed + +lemma connected_quasi_component_of: + assumes "C \ quasi_components_of X" + shows "C \ connected_components_of X \ connectedin X C" (is "?lhs = ?rhs") +proof + show "?lhs \ ?rhs" + using assms + by (simp add: connectedin_connected_components_of) +next + assume ?rhs + with assms show ?lhs + unfolding quasi_components_of_def connected_components_of_def image_iff + by (metis quasi_eq_connected_component_of_eq) +qed + +lemma quasi_component_of_clopen_cases: + "\C \ quasi_components_of X; closedin X T; openin X T\ \ C \ T \ disjnt C T" + by (smt (verit) disjnt_iff image_iff mem_Collect_eq quasi_component_of_def quasi_components_of_def subset_iff) + +lemma quasi_components_of_set: + assumes "C \ quasi_components_of X" + shows "\ {T. closedin X T \ openin X T \ C \ T} = C" (is "?lhs = ?rhs") +proof + have "x \ C" if "x \ \ {T. closedin X T \ openin X T \ C \ T}" for x + proof (rule ccontr) + assume "x \ C" + have "x \ topspace X" + using assms quasi_components_of_subset that by force + then have "separated_between X C {x}" + by (simp add: \x \ C\ assms separated_between_quasi_component_point) + with that show False + by (auto simp: separated_between) + qed + then show "?lhs \ ?rhs" + by auto +qed blast + +lemma open_quasi_eq_connected_components_of: + assumes "openin X C" + shows "C \ quasi_components_of X \ C \ connected_components_of X" (is "?lhs = ?rhs") +proof (cases "closedin X C") + case True + show ?thesis + proof + assume L: ?lhs + have "T = {} \ T = topspace X \ C" + if "openin (subtopology X C) T" "closedin (subtopology X C) T" for T + proof - + have "C \ T \ disjnt C T" + by (meson L True assms closedin_trans_full openin_trans_full quasi_component_of_clopen_cases that) + with that show ?thesis + by (metis Int_absorb2 True closedin_imp_subset closure_of_subset_eq disjnt_def inf_absorb2) + qed + with L assms show "?rhs" + by (simp add: connected_quasi_component_of connected_space_clopen_in connectedin_def openin_subset) + next + assume ?rhs + then obtain x where "x \ topspace X" and x: "C = connected_component_of_set X x" + by (metis connected_components_of_def imageE) + have "C = quasi_component_of_set X x" + using True assms connected_component_of_refl connected_imp_quasi_component_of quasi_component_of_def x by fastforce + then show ?lhs + using \x \ topspace X\ quasi_components_of_def by fastforce + qed +next + case False + then show ?thesis + using closedin_connected_components_of closedin_quasi_components_of by blast +qed + +lemma quasi_component_of_continuous_image: + assumes f: "continuous_map X Y f" and qc: "quasi_component_of X x y" + shows "quasi_component_of Y (f x) (f y)" + unfolding quasi_component_of_def +proof (intro strip conjI) + show "f x \ topspace Y" "f y \ topspace Y" + using assms by (simp_all add: continuous_map_def quasi_component_of_def) + fix T + assume "closedin Y T \ openin Y T" + with assms show "(f x \ T) = (f y \ T)" + by (smt (verit) continuous_map_closedin continuous_map_def mem_Collect_eq quasi_component_of_def) +qed + +lemma quasi_component_of_discrete_topology: + "quasi_component_of_set (discrete_topology U) x = (if x \ U then {x} else {})" +proof - + have "quasi_component_of_set (discrete_topology U) y = {y}" if "y \ U" for y + using that + apply (simp add: set_eq_iff quasi_component_of_def) + by (metis Set.set_insert insertE subset_insertI) + then show ?thesis + by (simp add: quasi_component_of) +qed + +lemma quasi_components_of_discrete_topology: + "quasi_components_of (discrete_topology U) = (\x. {x}) ` U" + by (auto simp add: quasi_components_of_def quasi_component_of_discrete_topology) + +lemma homeomorphic_map_quasi_component_of: + assumes hmf: "homeomorphic_map X Y f" and "x \ topspace X" + shows "quasi_component_of_set Y (f x) = f ` (quasi_component_of_set X x)" +proof - + obtain g where hmg: "homeomorphic_map Y X g" + and contf: "continuous_map X Y f" and contg: "continuous_map Y X g" + and fg: "(\x \ topspace X. g(f x) = x) \ (\y \ topspace Y. f(g y) = y)" + by (smt (verit, best) hmf homeomorphic_map_maps homeomorphic_maps_def) + show ?thesis + proof + show "quasi_component_of_set Y (f x) \ f ` quasi_component_of_set X x" + using quasi_component_of_continuous_image [OF contg] + \x \ topspace X\ fg image_iff quasi_component_of_subset_topspace by fastforce + show "f ` quasi_component_of_set X x \ quasi_component_of_set Y (f x)" + using quasi_component_of_continuous_image [OF contf] by blast + qed +qed + + +lemma homeomorphic_map_quasi_components_of: + assumes "homeomorphic_map X Y f" + shows "quasi_components_of Y = image (image f) (quasi_components_of X)" + using assms +proof - + have "\x\topspace X. quasi_component_of_set Y y = f ` quasi_component_of_set X x" + if "y \ topspace Y" for y + by (metis that assms homeomorphic_imp_surjective_map homeomorphic_map_quasi_component_of image_iff) + moreover have "\x\topspace Y. f ` quasi_component_of_set X u = quasi_component_of_set Y x" + if "u \ topspace X" for u + by (metis that assms homeomorphic_imp_surjective_map homeomorphic_map_quasi_component_of imageI) + ultimately show ?thesis + by (auto simp: quasi_components_of_def image_iff) +qed + +lemma openin_quasi_component_of_locally_connected_space: + assumes "locally_connected_space X" + shows "openin X (quasi_component_of_set X x)" +proof - + have *: "openin X (connected_component_of_set X x)" + by (simp add: assms openin_connected_component_of_locally_connected_space) + moreover have "connected_component_of_set X x = quasi_component_of_set X x" + using * closedin_connected_component_of connected_component_of_refl connected_imp_quasi_component_of + quasi_component_of_def by fastforce + ultimately show ?thesis + by simp +qed + +lemma openin_quasi_components_of_locally_connected_space: + "locally_connected_space X \ c \ quasi_components_of X + \ openin X c" + by (smt (verit, best) image_iff openin_quasi_component_of_locally_connected_space quasi_components_of_def) + +lemma quasi_eq_connected_components_of_alt: + "quasi_components_of X = connected_components_of X \ (\C \ quasi_components_of X. connectedin X C)" + (is "?lhs = ?rhs") +proof + assume R: ?rhs + moreover have "connected_components_of X \ quasi_components_of X" + using R unfolding quasi_components_of_def connected_components_of_def + by (force simp flip: quasi_eq_connected_component_of_eq) + ultimately show ?lhs + using connected_quasi_component_of by blast +qed (use connected_quasi_component_of in blast) + +lemma connected_subset_quasi_components_of_pointwise: + "connected_components_of X \ quasi_components_of X \ + (\x \ topspace X. quasi_component_of X x = connected_component_of X x)" + (is "?lhs = ?rhs") +proof + assume L: ?lhs + have "connectedin X (quasi_component_of_set X x)" if "x \ topspace X" for x + proof - + have "\y\topspace X. connected_component_of_set X x = quasi_component_of_set X y" + using L that by (force simp: quasi_components_of_def connected_components_of_def image_subset_iff) + then show ?thesis + by (metis connected_component_of_equiv connectedin_connected_component_of mem_Collect_eq quasi_component_of_eq) + qed + then show ?rhs + by (simp add: quasi_eq_connected_component_of_eq) +qed (simp add: connected_components_of_def quasi_components_of_def) + +lemma quasi_subset_connected_components_of_pointwise: + "quasi_components_of X \ connected_components_of X \ + (\x \ topspace X. quasi_component_of X x = connected_component_of X x)" + by (simp add: connected_quasi_component_of image_subset_iff quasi_components_of_def quasi_eq_connected_component_of_eq) + +lemma quasi_eq_connected_components_of_pointwise: + "quasi_components_of X = connected_components_of X \ + (\x \ topspace X. quasi_component_of X x = connected_component_of X x)" + using connected_subset_quasi_components_of_pointwise quasi_subset_connected_components_of_pointwise by fastforce + +lemma quasi_eq_connected_components_of_pointwise_alt: + "quasi_components_of X = connected_components_of X \ + (\x. quasi_component_of X x = connected_component_of X x)" + unfolding quasi_eq_connected_components_of_pointwise + by (metis connectedin_empty quasi_component_of_eq_empty quasi_eq_connected_component_of_eq) + +lemma quasi_eq_connected_components_of_inclusion: + "quasi_components_of X = connected_components_of X \ + connected_components_of X \ quasi_components_of X \ + quasi_components_of X \ connected_components_of X" + by (simp add: connected_subset_quasi_components_of_pointwise dual_order.eq_iff quasi_subset_connected_components_of_pointwise) + + +lemma quasi_eq_connected_components_of: + "finite(connected_components_of X) \ + finite(quasi_components_of X) \ + locally_connected_space X \ + compact_space X \ (Hausdorff_space X \ regular_space X \ normal_space X) + \ quasi_components_of X = connected_components_of X" +proof (elim disjE) + show "quasi_components_of X = connected_components_of X" + if "finite (connected_components_of X)" + unfolding quasi_eq_connected_components_of_inclusion + using that open_in_finite_connected_components open_quasi_eq_connected_components_of by blast + show "quasi_components_of X = connected_components_of X" + if "finite (quasi_components_of X)" + unfolding quasi_eq_connected_components_of_inclusion + using that open_quasi_eq_connected_components_of openin_finite_quasi_components by blast + show "quasi_components_of X = connected_components_of X" + if "locally_connected_space X" + unfolding quasi_eq_connected_components_of_inclusion + using that open_quasi_eq_connected_components_of openin_quasi_components_of_locally_connected_space by auto + show "quasi_components_of X = connected_components_of X" + if "compact_space X \ (Hausdorff_space X \ regular_space X \ normal_space X)" + proof - + show ?thesis + unfolding quasi_eq_connected_components_of_alt + proof (intro strip) + fix C + assume C: "C \ quasi_components_of X" + then have cloC: "closedin X C" + by (simp add: closedin_quasi_components_of) + have "normal_space X" + using that compact_Hausdorff_or_regular_imp_normal_space by blast + show "connectedin X C" + proof (clarsimp simp add: connectedin_def connected_space_closedin_eq closedin_closed_subtopology cloC closedin_subset [OF cloC]) + fix S T + assume "S \ C" and "closedin X S" and "S \ T = {}" and SUT: "S \ T = topspace X \ C" + and T: "T \ C" "T \ {}" and "closedin X T" + with \normal_space X\ obtain U V where UV: "openin X U" "openin X V" "S \ U" "T \ V" "disjnt U V" + by (meson disjnt_def normal_space_def) + moreover have "compactin X (topspace X - (U \ V))" + using UV that by (intro closedin_compact_space closedin_diff openin_Un) auto + ultimately have "separated_between X C (topspace X - (U \ V)) \ disjnt C (topspace X - (U \ V))" + by (simp add: \C \ quasi_components_of X\ separated_between_quasi_component_compact) + moreover have "disjnt C (topspace X - (U \ V))" + using UV SUT disjnt_def by fastforce + ultimately have "separated_between X C (topspace X - (U \ V))" + by simp + then obtain A B where "openin X A" "openin X B" "A \ B = topspace X" "disjnt A B" "C \ A" + and subB: "topspace X - (U \ V) \ B" + by (meson separated_between_def) + have "B \ U = topspace X - (A \ V)" + proof + show "B \ U \ topspace X - A \ V" + using \openin X U\ \disjnt U V\ \disjnt A B\ \openin X B\ disjnt_iff openin_closedin_eq by fastforce + show "topspace X - A \ V \ B \ U" + using \A \ B = topspace X\ subB by fastforce + qed + then have "closedin X (B \ U)" + using \openin X V\ \openin X A\ by auto + then have "C \ B \ U \ disjnt C (B \ U)" + using quasi_component_of_clopen_cases [OF C] \openin X U\ \openin X B\ by blast + with UV show "S = {}" + by (metis UnE \C \ A\ \S \ C\ T \disjnt A B\ all_not_in_conv disjnt_Un2 disjnt_iff subset_eq) + qed + qed + qed +qed + + +lemma quasi_eq_connected_component_of: + "finite(connected_components_of X) \ + finite(quasi_components_of X) \ + locally_connected_space X \ + compact_space X \ (Hausdorff_space X \ regular_space X \ normal_space X) + \ quasi_component_of X x = connected_component_of X x" + by (metis quasi_eq_connected_components_of quasi_eq_connected_components_of_pointwise_alt) + + +subsection\Additional quasicomponent and continuum properties like Boundary Bumping\ + +lemma cut_wire_fence_theorem_gen: + assumes "compact_space X" and X: "Hausdorff_space X \ regular_space X \ normal_space X" + and S: "compactin X S" and T: "closedin X T" + and dis: "\C. connectedin X C \ disjnt C S \ disjnt C T" + shows "separated_between X S T" + proof - + have "x \ topspace X" if "x \ S" and "T = {}" for x + using that S compactin_subset_topspace by auto + moreover have "separated_between X {x} {y}" if "x \ S" and "y \ T" for x y + proof (cases "x \ topspace X \ y \ topspace X") + case True + then have "\ connected_component_of X x y" + by (meson dis connected_component_of_def disjnt_iff that) + with True X \compact_space X\ show ?thesis + by (metis quasi_component_nonseparated quasi_eq_connected_component_of) + next + case False + then show ?thesis + using S T compactin_subset_topspace closedin_subset that by blast + qed + ultimately show ?thesis + using assms + by (simp add: separated_between_pointwise_left separated_between_pointwise_right + closedin_compact_space closedin_subset) +qed + +lemma cut_wire_fence_theorem: + "\compact_space X; Hausdorff_space X; closedin X S; closedin X T; + \C. connectedin X C \ disjnt C S \ disjnt C T\ + \ separated_between X S T" + by (simp add: closedin_compact_space cut_wire_fence_theorem_gen) + +lemma separated_between_from_closed_subtopology: + assumes XC: "separated_between (subtopology X C) S (X frontier_of C)" + and ST: "separated_between (subtopology X C) S T" + shows "separated_between X S T" +proof - + obtain U where clo: "closedin (subtopology X C) U" and ope: "openin (subtopology X C) U" + and "S \ U" and sub: "X frontier_of C \ T \ topspace (subtopology X C) - U" + by (meson assms separated_between separated_between_Un) + then have "X frontier_of C \ T \ topspace X \ C - U" + by auto + have "closedin X (topspace X \ C)" + by (metis XC frontier_of_restrict frontier_of_subset_eq inf_le1 separated_between_imp_subset topspace_subtopology) + then have "closedin X U" + by (metis clo closedin_closed_subtopology subtopology_restrict) + moreover have "openin (subtopology X C) U \ openin X U \ U \ C" + using disjnt_iff sub by (force intro!: openin_subset_topspace_eq) + with ope have "openin X U" + by blast + moreover have "T \ topspace X - U" + using ope openin_closedin_eq sub by auto + ultimately show ?thesis + using \S \ U\ separated_between by blast +qed + +lemma separated_between_from_closed_subtopology_frontier: + "separated_between (subtopology X T) S (X frontier_of T) + \ separated_between X S (X frontier_of T)" + using separated_between_from_closed_subtopology by blast + +lemma separated_between_from_frontier_of_closed_subtopology: + assumes "separated_between (subtopology X T) S (X frontier_of T)" + shows "separated_between X S (topspace X - T)" +proof - + have "disjnt S (topspace X - T)" + using assms disjnt_iff separated_between_imp_subset by fastforce + then show ?thesis + by (metis Diff_subset assms frontier_of_complement separated_between_from_closed_subtopology separated_between_frontier_of_eq') +qed + +lemma separated_between_compact_connected_component: + assumes "locally_compact_space X" "Hausdorff_space X" + and C: "C \ connected_components_of X" + and "compactin X C" "closedin X T" "disjnt C T" + shows "separated_between X C T" +proof - + have Csub: "C \ topspace X" + by (simp add: assms(4) compactin_subset_topspace) + have "Hausdorff_space (subtopology X (topspace X - T))" + using Hausdorff_space_subtopology assms(2) by blast + moreover have "compactin (subtopology X (topspace X - T)) C" + using assms Csub by (metis Diff_Int_distrib Diff_empty compact_imp_compactin_subtopology disjnt_def le_iff_inf) + moreover have "locally_compact_space (subtopology X (topspace X - T))" + by (meson assms closedin_def locally_compact_Hausdorff_imp_regular_space locally_compact_space_open_subset) + ultimately + obtain N L where "openin X N" "compactin X L" "closedin X L" "C \ N" "N \ L" + and Lsub: "L \ topspace X - T" + using \Hausdorff_space X\ \closedin X T\ + apply (simp add: locally_compact_space_compact_closed_compact compactin_subtopology) + by (meson closedin_def compactin_imp_closedin openin_trans_full) + then have disC: "disjnt C (topspace X - L)" + by (meson DiffD2 disjnt_iff subset_iff) + have "separated_between (subtopology X L) C (X frontier_of L)" + proof (rule cut_wire_fence_theorem) + show "compact_space (subtopology X L)" + by (simp add: \compactin X L\ compact_space_subtopology) + show "Hausdorff_space (subtopology X L)" + by (simp add: Hausdorff_space_subtopology \Hausdorff_space X\) + show "closedin (subtopology X L) C" + by (meson \C \ N\ \N \ L\ \Hausdorff_space X\ \compactin X C\ closedin_subset_topspace compactin_imp_closedin subset_trans) + show "closedin (subtopology X L) (X frontier_of L)" + by (simp add: \closedin X L\ closedin_frontier_of closedin_subset_topspace frontier_of_subset_closedin) + show "disjnt D C \ disjnt D (X frontier_of L)" + if "connectedin (subtopology X L) D" for D + proof (rule ccontr) + assume "\ (disjnt D C \ disjnt D (X frontier_of L))" + moreover have "connectedin X D" + using connectedin_subtopology that by blast + ultimately show False + using that connected_components_of_maximal [of C X D] C + apply (simp add: disjnt_iff) + by (metis Diff_eq_empty_iff \C \ N\ \N \ L\ \openin X N\ disjoint_iff frontier_of_openin_straddle_Int(2) subsetD) + qed + qed + then have "separated_between X (X frontier_of C) (topspace X - L)" + using separated_between_from_frontier_of_closed_subtopology separated_between_frontier_of_eq by blast + with \closedin X T\ + separated_between_frontier_of [OF Csub disC] + show ?thesis + unfolding separated_between by (smt (verit) Diff_iff Lsub closedin_subset subset_iff) +qed + +lemma wilder_locally_compact_component_thm: + assumes "locally_compact_space X" "Hausdorff_space X" + and "C \ connected_components_of X" "compactin X C" "openin X W" "C \ W" + obtains U V where "openin X U" "openin X V" "disjnt U V" "U \ V = topspace X" "C \ U" "U \ W" +proof - + have "closedin X (topspace X - W)" + using \openin X W\ by blast + moreover have "disjnt C (topspace X - W)" + using \C \ W\ disjnt_def by fastforce + ultimately have "separated_between X C (topspace X - W)" + using separated_between_compact_connected_component assms by blast + then show thesis + by (smt (verit, del_insts) DiffI disjnt_iff openin_subset separated_between_def subset_iff that) +qed + +lemma compact_quasi_eq_connected_components_of: + assumes "locally_compact_space X" "Hausdorff_space X" "compactin X C" + shows "C \ quasi_components_of X \ C \ connected_components_of X" +proof - + have "compactin X (connected_component_of_set X x)" + if "x \ topspace X" "compactin X (quasi_component_of_set X x)" for x + proof (rule closed_compactin) + show "compactin X (quasi_component_of_set X x)" + by (simp add: that) + show "connected_component_of_set X x \ quasi_component_of_set X x" + by (simp add: connected_component_subset_quasi_component_of) + show "closedin X (connected_component_of_set X x)" + by (simp add: closedin_connected_component_of) + qed + moreover have "connected_component_of X x = quasi_component_of X x" + if \
: "x \ topspace X" "compactin X (connected_component_of_set X x)" for x + proof - + have "\y. connected_component_of X x y \ quasi_component_of X x y" + by (simp add: connected_imp_quasi_component_of) + moreover have False if non: "\ connected_component_of X x y" and quasi: "quasi_component_of X x y" for y + proof - + have "y \ topspace X" + by (meson quasi_component_of_equiv that) + then have "closedin X {y}" + by (simp add: \Hausdorff_space X\ compactin_imp_closedin) + moreover have "disjnt (connected_component_of_set X x) {y}" + by (simp add: non) + moreover have "\ separated_between X (connected_component_of_set X x) {y}" + using \
quasi separated_between_pointwise_left + by (fastforce simp: quasi_component_nonseparated connected_component_of_refl) + ultimately show False + using assms by (metis \
connected_component_in_connected_components_of separated_between_compact_connected_component) + qed + ultimately show ?thesis + by blast + qed + ultimately show ?thesis + using \compactin X C\ unfolding connected_components_of_def image_iff quasi_components_of_def by metis +qed + + +lemma boundary_bumping_theorem_closed_gen: + assumes "connected_space X" "locally_compact_space X" "Hausdorff_space X" "closedin X S" + "S \ topspace X" and C: "compactin X C" "C \ connected_components_of (subtopology X S)" + shows "C \ X frontier_of S \ {}" +proof + assume \
: "C \ X frontier_of S = {}" + consider "C \ {}" "X frontier_of S \ topspace X" | "C \ topspace X" "S = {}" + using C by (metis frontier_of_subset_topspace nonempty_connected_components_of) + then show False + proof cases + case 1 + have "separated_between (subtopology X S) C (X frontier_of S)" + proof (rule separated_between_compact_connected_component) + show "compactin (subtopology X S) C" + using C compact_imp_compactin_subtopology connected_components_of_subset by fastforce + show "closedin (subtopology X S) (X frontier_of S)" + by (simp add: \closedin X S\ closedin_frontier_of closedin_subset_topspace frontier_of_subset_closedin) + show "disjnt C (X frontier_of S)" + using \
by (simp add: disjnt_def) + qed (use assms Hausdorff_space_subtopology locally_compact_space_closed_subset in auto) + then have "separated_between X C (X frontier_of S)" + using separated_between_from_closed_subtopology by auto + then have "X frontier_of S = {}" + using \C \ {}\ \connected_space X\ connected_space_separated_between by blast + moreover have "C \ S" + using C connected_components_of_subset by fastforce + ultimately show False + using 1 assms by (metis closedin_subset connected_space_eq_frontier_eq_empty subset_empty) + next + case 2 + then show False + using C connected_components_of_eq_empty by fastforce + qed +qed + +lemma boundary_bumping_theorem_closed: + assumes "connected_space X" "compact_space X" "Hausdorff_space X" "closedin X S" + "S \ topspace X" "C \ connected_components_of(subtopology X S)" + shows "C \ X frontier_of S \ {}" + by (meson assms boundary_bumping_theorem_closed_gen closedin_compact_space closedin_connected_components_of + closedin_trans_full compact_imp_locally_compact_space) + + +lemma intermediate_continuum_exists: + assumes "connected_space X" "locally_compact_space X" "Hausdorff_space X" + and C: "compactin X C" "connectedin X C" "C \ {}" "C \ topspace X" + and U: "openin X U" "C \ U" + obtains D where "compactin X D" "connectedin X D" "C \ D" "D \ U" +proof - + have "C \ topspace X" + by (simp add: C compactin_subset_topspace) + with C obtain a where a: "a \ topspace X" "a \ C" + by blast + moreover have "compactin (subtopology X (U - {a})) C" + by (simp add: C U a compact_imp_compactin_subtopology subset_Diff_insert) + moreover have "Hausdorff_space (subtopology X (U - {a}))" + using Hausdorff_space_subtopology assms(3) by blast + moreover + have "locally_compact_space (subtopology X (U - {a}))" + by (rule locally_compact_space_open_subset) + (auto simp: locally_compact_Hausdorff_imp_regular_space open_in_Hausdorff_delete assms) + ultimately obtain V K where V: "openin X V" "a \ V" "V \ U" and K: "compactin X K" "a \ K" "K \ U" + and cloK: "closedin (subtopology X (U - {a})) K" and "C \ V" "V \ K" + using locally_compact_space_compact_closed_compact [of "subtopology X (U - {a})"] assms + by (smt (verit, del_insts) Diff_empty compactin_subtopology open_in_Hausdorff_delete openin_open_subtopology subset_Diff_insert) + then obtain D where D: "D \ connected_components_of (subtopology X K)" and "C \ D" + using C by (metis bot.extremum_unique connectedin_subtopology order.trans exists_connected_component_of_superset subtopology_topspace) + show thesis + proof + have cloD: "closedin (subtopology X K) D" + by (simp add: D closedin_connected_components_of) + then have XKD: "compactin (subtopology X K) D" + by (simp add: K closedin_compact_space compact_space_subtopology) + then show "compactin X D" + using compactin_subtopology_imp_compact by blast + show "connectedin X D" + using D connectedin_connected_components_of connectedin_subtopology by blast + have "K \ topspace X" + using K a by blast + moreover have "V \ X interior_of K" + by (simp add: \openin X V\ \V \ K\ interior_of_maximal) + ultimately have "C \ D" + using boundary_bumping_theorem_closed_gen [of X K C] D \C \ V\ + by (auto simp add: assms K compactin_imp_closedin frontier_of_def) + then show "C \ D" + using \C \ D\ by blast + have "D \ U" + using K(3) \closedin (subtopology X K) D\ closedin_imp_subset by blast + moreover have "D \ U" + using K XKD \C \ D\ assms + by (metis \K \ topspace X\ cloD closedin_imp_subset compactin_imp_closedin connected_space_clopen_in + inf_bot_left inf_le2 subset_antisym) + ultimately + show "D \ U" by blast + qed +qed + +lemma boundary_bumping_theorem_gen: + assumes X: "connected_space X" "locally_compact_space X" "Hausdorff_space X" + and "S \ topspace X" and C: "C \ connected_components_of(subtopology X S)" + and compC: "compactin X (X closure_of C)" + shows "X frontier_of C \ X frontier_of S \ {}" +proof - + have Csub: "C \ topspace X" "C \ S" and "connectedin X C" + using C connectedin_connected_components_of connectedin_subset_topspace connectedin_subtopology + by fastforce+ + have "C \ {}" + using C nonempty_connected_components_of by blast + obtain "X interior_of C \ X interior_of S" "X closure_of C \ X closure_of S" + by (simp add: Csub closure_of_mono interior_of_mono) + moreover have False if "X closure_of C \ X interior_of S" + proof - + have "X closure_of C = C" + by (meson C closedin_connected_component_of_subtopology closure_of_eq interior_of_subset order_trans that) + with that have "C \ X interior_of S" + by simp + then obtain D where "compactin X D" and "connectedin X D" and "C \ D" and "D \ X interior_of S" + using intermediate_continuum_exists assms \X closure_of C = C\ compC Csub + by (metis \C \ {}\ \connectedin X C\ openin_interior_of psubsetE) + then have "D \ C" + by (metis C \C \ {}\ connected_components_of_maximal connectedin_subtopology disjnt_def inf.orderE interior_of_subset order_trans psubsetE) + then show False + using \C \ D\ by blast + qed + ultimately show ?thesis + by (smt (verit, ccfv_SIG) DiffI disjoint_iff_not_equal frontier_of_def subset_eq) +qed + +lemma boundary_bumping_theorem: + "\connected_space X; compact_space X; Hausdorff_space X; S \ topspace X; + C \ connected_components_of(subtopology X S)\ + \ X frontier_of C \ X frontier_of S \ {}" + by (simp add: boundary_bumping_theorem_gen closedin_compact_space compact_imp_locally_compact_space) + end diff -r 37894dff0111 -r 2c1b01563163 src/HOL/Analysis/Abstract_Topology.thy --- a/src/HOL/Analysis/Abstract_Topology.thy Mon May 15 17:12:18 2023 +0100 +++ b/src/HOL/Analysis/Abstract_Topology.thy Thu May 18 11:44:42 2023 +0100 @@ -1098,7 +1098,6 @@ "X frontier_of S = X closure_of S \ X closure_of (topspace X - S)" by (metis Diff_Diff_Int closure_of_complement closure_of_subset_topspace double_diff frontier_of_def interior_of_subset_closure_of) - lemma interior_of_union_frontier_of [simp]: "X interior_of S \ X frontier_of S = X closure_of S" by (simp add: frontier_of_def interior_of_subset_closure_of subset_antisym) @@ -1265,6 +1264,37 @@ "(discrete_topology U) frontier_of S = {}" by (simp add: Diff_eq discrete_topology_closure_of frontier_of_closures) +lemma openin_subset_topspace_eq: + assumes "disjnt S (X frontier_of U)" + shows "openin (subtopology X U) S \ openin X S \ S \ U" +proof + assume S: "openin (subtopology X U) S" + show "openin X S \ S \ U" + proof + show "S \ U" + using S openin_imp_subset by blast + have "disjnt S (X frontier_of (topspace X \ U))" + by (metis assms frontier_of_restrict) + moreover + have "openin (subtopology X (topspace X \ U)) S" + by (simp add: S subtopology_restrict) + moreover + have "openin X S" + if dis: "disjnt S (X frontier_of U)" and ope: "openin (subtopology X U) S" and "U \ topspace X" + for S U + proof - + obtain T where T: "openin X T" "S = T \ U" + using ope by (auto simp: openin_subtopology) + have "T \ U = T \ X interior_of U" + using that T interior_of_subset in_closure_of by (fastforce simp: disjnt_iff frontier_of_def) + then show ?thesis + using \S = T \ U\ \openin X T\ by auto + qed + ultimately show "openin X S" + by blast + qed +qed (metis inf.absorb_iff1 openin_subtopology_Int) + subsection\Locally finite collections\