# HG changeset patch # User paulson # Date 1683037059 -3600 # Node ID 7f240b0dabd9666cd69e44400bc97775c83bd803 # Parent 01c88cf514fcfc704246cb164d27c62a551a5dc1 More new theorems, and a necessary correction diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Analysis/Abstract_Topology.thy --- a/src/HOL/Analysis/Abstract_Topology.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Analysis/Abstract_Topology.thy Tue May 02 15:17:39 2023 +0100 @@ -297,6 +297,10 @@ unfolding closedin_def topspace_subtopology by (auto simp: openin_subtopology) +lemma closedin_relative_to: + "(closedin X relative_to S) = closedin (subtopology X S)" + by (force simp: relative_to_def closedin_subtopology) + lemma openin_subtopology_refl: "openin (subtopology U V) V \ V \ topspace U" unfolding openin_subtopology by auto (metis IntD1 in_mono openin_subset) @@ -1879,6 +1883,250 @@ by (metis \closedin X T\ closed_map_def closedin_subtopology f) qed +lemma closed_map_closure_of_image: + "closed_map X Y f \ + f ` topspace X \ topspace Y \ + (\S. S \ topspace X \ Y closure_of (f ` S) \ image f (X closure_of S))" (is "?lhs=?rhs") +proof + assume ?lhs + then show ?rhs + by (simp add: closed_map_def closed_map_imp_subset_topspace closure_of_minimal closure_of_subset image_mono) +next + assume ?rhs + then show ?lhs + by (metis closed_map_def closed_map_into_discrete_topology closure_of_eq + closure_of_subset_eq topspace_discrete_topology) +qed + +lemma open_map_interior_of_image_subset: + "open_map X Y f \ (\S. image f (X interior_of S) \ Y interior_of (f ` S))" + by (metis image_mono interior_of_eq interior_of_maximal interior_of_subset open_map_def openin_interior_of subset_antisym) + +lemma open_map_interior_of_image_subset_alt: + "open_map X Y f \ (\S\topspace X. f ` (X interior_of S) \ Y interior_of f ` S)" + by (metis interior_of_eq open_map_def open_map_interior_of_image_subset openin_subset subset_interior_of_eq) + +lemma open_map_interior_of_image_subset_gen: + "open_map X Y f \ + (f ` topspace X \ topspace Y \ (\S. f ` (X interior_of S) \ Y interior_of f ` S))" + by (meson open_map_imp_subset_topspace open_map_interior_of_image_subset) + +lemma open_map_preimage_neighbourhood: + "open_map X Y f \ + (f ` topspace X \ topspace Y \ + (\U T. closedin X U \ T \ topspace Y \ + {x \ topspace X. f x \ T} \ U \ + (\V. closedin Y V \ T \ V \ {x \ topspace X. f x \ V} \ U)))" (is "?lhs=?rhs") +proof + assume L: ?lhs + show ?rhs + proof (intro conjI strip) + show "f ` topspace X \ topspace Y" + by (simp add: \open_map X Y f\ open_map_imp_subset_topspace) + next + fix U T + assume UT: "closedin X U \ T \ topspace Y \ {x \ topspace X. f x \ T} \ U" + have "closedin Y (topspace Y - f ` (topspace X - U))" + by (meson UT L open_map_def openin_closedin_eq openin_diff openin_topspace) + with UT + show "\V. closedin Y V \ T \ V \ {x \ topspace X. f x \ V} \ U" + using image_iff by auto + qed +next + assume R: ?rhs + show ?lhs + unfolding open_map_def + proof (intro strip) + fix U assume "openin X U" + have "{x \ topspace X. f x \ topspace Y - f ` U} \ topspace X - U" + by blast + then obtain V where V: "closedin Y V" + and sub: "topspace Y - f ` U \ V" "{x \ topspace X. f x \ V} \ topspace X - U" + using R \openin X U\ by (meson Diff_subset openin_closedin_eq) + then have "f ` U \ topspace Y - V" + using R \openin X U\ openin_subset by fastforce + with sub have "f ` U = topspace Y - V" + by auto + then show "openin Y (f ` U)" + using V(1) by auto + qed +qed + + +lemma closed_map_preimage_neighbourhood: + "closed_map X Y f \ + image f (topspace X) \ topspace Y \ + (\U T. openin X U \ T \ topspace Y \ + {x \ topspace X. f x \ T} \ U + \ (\V. openin Y V \ T \ V \ + {x \ topspace X. f x \ V} \ U))" (is "?lhs=?rhs") +proof + assume L: ?lhs + show ?rhs + proof (intro conjI strip) + show "f ` topspace X \ topspace Y" + by (simp add: L closed_map_imp_subset_topspace) + next + fix U T + assume UT: "openin X U \ T \ topspace Y \ {x \ topspace X. f x \ T} \ U" + then have "openin Y (topspace Y - f ` (topspace X - U))" + by (meson L closed_map_def closedin_def closedin_diff closedin_topspace) + then show "\V. openin Y V \ T \ V \ {x \ topspace X. f x \ V} \ U" + using UT image_iff by auto + qed +next + assume R: ?rhs + show ?lhs + unfolding closed_map_def + proof (intro strip) + fix U assume "closedin X U" + have "{x \ topspace X. f x \ topspace Y - f ` U} \ topspace X - U" + by blast + then obtain V where V: "openin Y V" + and sub: "topspace Y - f ` U \ V" "{x \ topspace X. f x \ V} \ topspace X - U" + using R Diff_subset \closedin X U\ unfolding closedin_def + by (smt (verit, ccfv_threshold) Collect_mem_eq Collect_mono_iff) + then have "f ` U \ topspace Y - V" + using R \closedin X U\ closedin_subset by fastforce + with sub have "f ` U = topspace Y - V" + by auto + with V show "closedin Y (f ` U)" + by auto + qed +qed + +lemma closed_map_fibre_neighbourhood: + "closed_map X Y f \ + f ` (topspace X) \ topspace Y \ + (\U y. openin X U \ y \ topspace Y \ {x \ topspace X. f x = y} \ U + \ (\V. openin Y V \ y \ V \ {x \ topspace X. f x \ V} \ U))" + unfolding closed_map_preimage_neighbourhood +proof (intro conj_cong refl all_cong1) + fix U + assume "f ` topspace X \ topspace Y" + show "(\T. openin X U \ T \ topspace Y \ {x \ topspace X. f x \ T} \ U + \ (\V. openin Y V \ T \ V \ {x \ topspace X. f x \ V} \ U)) + = (\y. openin X U \ y \ topspace Y \ {x \ topspace X. f x = y} \ U + \ (\V. openin Y V \ y \ V \ {x \ topspace X. f x \ V} \ U))" + (is "(\T. ?P T) \ (\y. ?Q y)") + proof + assume L [rule_format]: "\T. ?P T" + show "\y. ?Q y" + proof + fix y show "?Q y" + using L [of "{y}"] by blast + qed + next + assume R: "\y. ?Q y" + show "\T. ?P T" + proof (cases "openin X U") + case True + note [[unify_search_bound=3]] + obtain V where V: "\y. \y \ topspace Y; {x \ topspace X. f x = y} \ U\ \ + openin Y (V y) \ y \ V y \ {x \ topspace X. f x \ V y} \ U" + using R by (simp add: True) meson + show ?thesis + proof clarify + fix T + assume "openin X U" and "T \ topspace Y" and "{x \ topspace X. f x \ T} \ U" + with V show "\V. openin Y V \ T \ V \ {x \ topspace X. f x \ V} \ U" + by (rule_tac x="\y\T. V y" in exI) fastforce + qed + qed auto + qed +qed + +lemma open_map_in_subtopology: + "openin Y S + \ (open_map X (subtopology Y S) f \ open_map X Y f \ f ` (topspace X) \ S)" + by (metis le_inf_iff open_map_def open_map_imp_subset_topspace open_map_into_subtopology openin_trans_full topspace_subtopology) + +lemma open_map_from_open_subtopology: + "\openin Y S; open_map X (subtopology Y S) f\ \ open_map X Y f" + using open_map_in_subtopology by blast + +lemma closed_map_in_subtopology: + "closedin Y S + \ closed_map X (subtopology Y S) f \ (closed_map X Y f \ f ` topspace X \ S)" + by (metis closed_map_def closed_map_imp_subset_topspace closed_map_into_subtopology + closedin_closed_subtopology closedin_subset topspace_subtopology_subset) + +lemma closed_map_from_closed_subtopology: + "\closedin Y S; closed_map X (subtopology Y S) f\ \ closed_map X Y f" + using closed_map_in_subtopology by blast + +lemma closed_map_from_composition_left: + assumes cmf: "closed_map X Z (g \ f)" and contf: "continuous_map X Y f" and fim: "f ` topspace X = topspace Y" + shows "closed_map Y Z g" + unfolding closed_map_def +proof (intro strip) + fix U assume "closedin Y U" + then have "closedin X {x \ topspace X. f x \ U}" + using contf closedin_continuous_map_preimage by blast + then have "closedin Z ((g \ f) ` {x \ topspace X. f x \ U})" + using cmf closed_map_def by blast + moreover + have "\y. y \ U \ \x \ topspace X. f x \ U \ g y = g (f x)" + by (smt (verit, ccfv_SIG) \closedin Y U\ closedin_subset fim image_iff subsetD) + then have "(g \ f) ` {x \ topspace X. f x \ U} = g`U" by auto + ultimately show "closedin Z (g ` U)" + by metis +qed + +text \identical proof as the above\ +lemma open_map_from_composition_left: + assumes cmf: "open_map X Z (g \ f)" and contf: "continuous_map X Y f" and fim: "f ` topspace X = topspace Y" + shows "open_map Y Z g" + unfolding open_map_def +proof (intro strip) + fix U assume "openin Y U" + then have "openin X {x \ topspace X. f x \ U}" + using contf openin_continuous_map_preimage by blast + then have "openin Z ((g \ f) ` {x \ topspace X. f x \ U})" + using cmf open_map_def by blast + moreover + have "\y. y \ U \ \x \ topspace X. f x \ U \ g y = g (f x)" + by (smt (verit, ccfv_SIG) \openin Y U\ openin_subset fim image_iff subsetD) + then have "(g \ f) ` {x \ topspace X. f x \ U} = g`U" by auto + ultimately show "openin Z (g ` U)" + by metis +qed + +lemma closed_map_from_composition_right: + assumes cmf: "closed_map X Z (g \ f)" "f ` topspace X \ topspace Y" "continuous_map Y Z g" "inj_on g (topspace Y)" + shows "closed_map X Y f" + unfolding closed_map_def +proof (intro strip) + fix C assume "closedin X C" + have "\y c. \y \ topspace Y; g y = g (f c); c \ C\ \ y \ f ` C" + using \closedin X C\ assms closedin_subset inj_onD by fastforce + then + have "f ` C = {x \ topspace Y. g x \ (g \ f) ` C}" + using \closedin X C\ assms(2) closedin_subset by fastforce + moreover have "closedin Z ((g \ f) ` C)" + using \closedin X C\ cmf closed_map_def by blast + ultimately show "closedin Y (f ` C)" + using assms(3) closedin_continuous_map_preimage by fastforce +qed + +text \identical proof as the above\ +lemma open_map_from_composition_right: + assumes "open_map X Z (g \ f)" "f ` topspace X \ topspace Y" "continuous_map Y Z g" "inj_on g (topspace Y)" + shows "open_map X Y f" + unfolding open_map_def +proof (intro strip) + fix C assume "openin X C" + have "\y c. \y \ topspace Y; g y = g (f c); c \ C\ \ y \ f ` C" + using \openin X C\ assms openin_subset inj_onD by fastforce + then + have "f ` C = {x \ topspace Y. g x \ (g \ f) ` C}" + using \openin X C\ assms(2) openin_subset by fastforce + moreover have "openin Z ((g \ f) ` C)" + using \openin X C\ assms(1) open_map_def by blast + ultimately show "openin Y (f ` C)" + using assms(3) openin_continuous_map_preimage by fastforce +qed + subsection\Quotient maps\ definition quotient_map where @@ -2163,6 +2411,84 @@ qed qed +lemma quotient_map_saturated_closed: + "quotient_map X Y f \ + continuous_map X Y f \ f ` (topspace X) = topspace Y \ + (\U. closedin X U \ {x \ topspace X. f x \ f ` U} \ U \ closedin Y (f ` U))" + (is "?lhs = ?rhs") +proof + assume L: ?lhs + then obtain fim: "f ` topspace X = topspace Y" + and Y: "\U. U \ topspace Y \ closedin Y U = closedin X {x \ topspace X. f x \ U}" + by (simp add: quotient_map_closedin) + show ?rhs + proof (intro conjI allI impI) + show "continuous_map X Y f" + by (simp add: L quotient_imp_continuous_map) + show "f ` topspace X = topspace Y" + by (simp add: fim) + next + fix U :: "'a set" + assume U: "closedin X U \ {x \ topspace X. f x \ f ` U} \ U" + then have sub: "f ` U \ topspace Y" and eq: "{x \ topspace X. f x \ f ` U} = U" + using fim closedin_subset by fastforce+ + show "closedin Y (f ` U)" + by (simp add: sub Y eq U) + qed +next + assume ?rhs + then obtain YX: "\U. closedin Y U \ closedin X {x \ topspace X. f x \ U}" + and fim: "f ` topspace X = topspace Y" + and XY: "\U. \closedin X U; {x \ topspace X. f x \ f ` U} \ U\ \ closedin Y (f ` U)" + by (simp add: continuous_map_closedin) + show ?lhs + proof (simp add: quotient_map_closedin fim, intro allI impI iffI) + fix U :: "'b set" + assume "U \ topspace Y" and X: "closedin X {x \ topspace X. f x \ U}" + have feq: "f ` {x \ topspace X. f x \ U} = U" + using \U \ topspace Y\ fim by auto + show "closedin Y U" + using XY [OF X] by (simp add: feq) + next + fix U :: "'b set" + assume "U \ topspace Y" and Y: "closedin Y U" + show "closedin X {x \ topspace X. f x \ U}" + by (metis YX [OF Y]) + qed +qed + +lemma quotient_map_onto_image: + assumes "f ` topspace X \ topspace Y" and U: "\U. U \ topspace Y \ openin X {x \ topspace X. f x \ U} = openin Y U" + shows "quotient_map X (subtopology Y (f ` topspace X)) f" + unfolding quotient_map_def topspace_subtopology +proof (intro conjI strip) + fix U + assume "U \ topspace Y \ f ` topspace X" + with U have "openin X {x \ topspace X. f x \ U} \ \x. openin Y x \ U = f ` topspace X \ x" + by fastforce + moreover have "\x. openin Y x \ U = f ` topspace X \ x \ openin X {x \ topspace X. f x \ U}" + by (metis (mono_tags, lifting) Collect_cong IntE IntI U image_eqI openin_subset) + ultimately show "openin X {x \ topspace X. f x \ U} = openin (subtopology Y (f ` topspace X)) U" + by (force simp: openin_subtopology_alt image_iff) +qed (use assms in auto) + +lemma quotient_map_lift_exists: + assumes f: "quotient_map X Y f" and h: "continuous_map X Z h" + and "\x y. \x \ topspace X; y \ topspace X; f x = f y\ \ h x = h y" + obtains g where "continuous_map Y Z g" "g ` topspace Y = h ` topspace X" + "\x. x \ topspace X \ g(f x) = h x" +proof - + obtain g where g: "\x. x \ topspace X \ h x = g(f x)" + using function_factors_left_gen[of "\x. x \ topspace X" f h] assms by blast + show ?thesis + proof + show "g ` topspace Y = h ` topspace X" + using f g by (force dest!: quotient_imp_surjective_map) + show "continuous_map Y Z g" + by (smt (verit) f g h continuous_compose_quotient_map_eq continuous_map_eq o_def) + qed (simp add: g) +qed + subsection\ Separated Sets\ definition separatedin :: "'a topology \ 'a set \ 'a set \ bool" @@ -2257,6 +2583,11 @@ unfolding openin_closedin_eq topspace_subtopology separation_closedin_Un_gen disjnt_def by (auto simp: Diff_triv Int_commute Un_Diff inf_absorb1 topspace_def) +lemma separatedin_full: + "S \ T = topspace X + \ separatedin X S T \ disjnt S T \ closedin X S \ openin X S \ closedin X T \ openin X T" + by (metis separatedin_open_sets separation_closedin_Un_gen separation_openin_Un_gen subtopology_topspace) + subsection\Homeomorphisms\ text\(1-way and 2-way versions may be useful in places)\ @@ -2778,6 +3109,10 @@ by (intro conj_cong arg_cong [where f=Not] ex_cong1; blast dest!: openin_subset) qed +lemma connectedinD: + "\connectedin X S; openin X E1; openin X E2; S \ E1 \ E2; E1 \ E2 \ S = {}; E1 \ S \ {}; E2 \ S \ {}\ \ False" + by (meson connectedin) + lemma connectedin_iff_connected [simp]: "connectedin euclidean S \ connected S" by (simp add: connected_def connectedin) @@ -3080,7 +3415,7 @@ moreover have "connectedin (discrete_topology U) S \ (\a. S = {a})" proof show "connectedin (discrete_topology U) S \ \a. S = {a}" - using False connectedin_inter_frontier_of insert_Diff by fastforce + using False connectedin_Int_frontier_of insert_Diff by fastforce qed (use True in auto) ultimately show ?thesis by auto @@ -3568,6 +3903,10 @@ unfolding closed_map_def by (auto simp: closedin_closed_subtopology embedding_map_def homeomorphic_map_closedness_eq) +lemma embedding_imp_closed_map_eq: + "embedding_map X Y f \ (closed_map X Y f \ closedin Y (f ` topspace X))" + using closed_map_def embedding_imp_closed_map by blast + subsection\Retraction and section maps\ diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Tue May 02 15:17:39 2023 +0100 @@ -1716,6 +1716,11 @@ shows "connected S \ convex S" by (metis is_interval_convex convex_connected is_interval_connected_1) +lemma connected_space_iff_is_interval_1 [iff]: + fixes S :: "real set" + shows "connected_space (top_of_set S) \ is_interval S" + using connectedin_topspace is_interval_connected_1 by force + lemma connected_convex_1_gen: fixes S :: "'a :: euclidean_space set" assumes "DIM('a) = 1" diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Analysis/Further_Topology.thy --- a/src/HOL/Analysis/Further_Topology.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Analysis/Further_Topology.thy Tue May 02 15:17:39 2023 +0100 @@ -969,9 +969,6 @@ subsection\ Special cases and corollaries involving spheres\ -lemma disjnt_Diff1: "X \ Y' \ disjnt (X - Y) (X' - Y')" - by (auto simp: disjnt_def) - proposition extend_map_affine_to_sphere_cofinite_simple: fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes "compact S" "convex U" "bounded U" diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Analysis/Ordered_Euclidean_Space.thy --- a/src/HOL/Analysis/Ordered_Euclidean_Space.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Analysis/Ordered_Euclidean_Space.thy Tue May 02 15:17:39 2023 +0100 @@ -2,7 +2,7 @@ theory Ordered_Euclidean_Space imports - Convex_Euclidean_Space + Convex_Euclidean_Space Abstract_Limits "HOL-Library.Product_Order" begin @@ -157,6 +157,32 @@ shows "((\i. inf (X i) (Y i)) \ inf x y) net" unfolding inf_min eucl_inf by (intro assms tendsto_intros) +lemma tendsto_Inf: + fixes f :: "'a \ 'b \ 'c::ordered_euclidean_space" + assumes "finite K" "\i. i \ K \ ((\x. f x i) \ l i) F" + shows "((\x. Inf (f x ` K)) \ Inf (l ` K)) F" + using assms + by (induction K rule: finite_induct) (auto simp: cInf_insert_If tendsto_inf) + +lemma tendsto_Sup: + fixes f :: "'a \ 'b \ 'c::ordered_euclidean_space" + assumes "finite K" "\i. i \ K \ ((\x. f x i) \ l i) F" + shows "((\x. Sup (f x ` K)) \ Sup (l ` K)) F" + using assms + by (induction K rule: finite_induct) (auto simp: cSup_insert_If tendsto_sup) + +lemma continuous_map_Inf: + fixes f :: "'a \ 'b \ 'c::ordered_euclidean_space" + assumes "finite K" "\i. i \ K \ continuous_map X euclidean (\x. f x i)" + shows "continuous_map X euclidean (\x. INF i\K. f x i)" + using assms by (simp add: continuous_map_atin tendsto_Inf) + +lemma continuous_map_Sup: + fixes f :: "'a \ 'b \ 'c::ordered_euclidean_space" + assumes "finite K" "\i. i \ K \ continuous_map X euclidean (\x. f x i)" + shows "continuous_map X euclidean (\x. SUP i\K. f x i)" + using assms by (simp add: continuous_map_atin tendsto_Sup) + lemma tendsto_componentwise_max: assumes f: "(f \ l) F" and g: "(g \ m) F" shows "((\x. (\i\Basis. max (f x \ i) (g x \ i) *\<^sub>R i)) \ (\i\Basis. max (l \ i) (m \ i) *\<^sub>R i)) F" @@ -167,10 +193,6 @@ shows "((\x. (\i\Basis. min (f x \ i) (g x \ i) *\<^sub>R i)) \ (\i\Basis. min (l \ i) (m \ i) *\<^sub>R i)) F" by (intro tendsto_intros assms) -lemma (in order) atLeastatMost_empty'[simp]: - "(\ a \ b) \ {a..b} = {}" - by (auto) - instance real :: ordered_euclidean_space by standard auto diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Analysis/Product_Topology.thy --- a/src/HOL/Analysis/Product_Topology.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Analysis/Product_Topology.thy Tue May 02 15:17:39 2023 +0100 @@ -464,6 +464,10 @@ "homeomorphic_map (prod_topology X Y) (prod_topology Y X) (\(x,y). (y,x))" using homeomorphic_map_maps homeomorphic_maps_swap by metis +lemma homeomorphic_space_prod_topology_swap: + "(prod_topology X Y) homeomorphic_space (prod_topology Y X)" + using homeomorphic_map_swap homeomorphic_space by blast + lemma embedding_map_graph: "embedding_map X (prod_topology X Y) (\x. (x, f x)) \ continuous_map X Y f" (is "?lhs = ?rhs") @@ -472,8 +476,7 @@ have "snd \ (\x. (x, f x)) = f" by force moreover have "continuous_map X Y (snd \ (\x. (x, f x)))" - using L - unfolding embedding_map_def + using L unfolding embedding_map_def by (meson continuous_map_in_subtopology continuous_map_snd_of homeomorphic_imp_continuous_map) ultimately show ?rhs by simp diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Analysis/T1_Spaces.thy --- a/src/HOL/Analysis/T1_Spaces.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Analysis/T1_Spaces.thy Tue May 02 15:17:39 2023 +0100 @@ -380,8 +380,7 @@ 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) + by (metis Hausdorff_space_compact_sets Hausdorff_space_def compactin_discrete_topology equalityE openin_discrete_topology) lemma compactin_Int: "\Hausdorff_space X; compactin X S; compactin X T\ \ compactin X (S \ T)" @@ -395,6 +394,10 @@ "\Hausdorff_space X; finite S\ \ X derived_set_of S = {}" using Hausdorff_imp_t1_space t1_space_derived_set_of_finite by auto +lemma infinite_perfect_set: + "\Hausdorff_space X; S \ X derived_set_of S; S \ {}\ \ infinite S" + using derived_set_of_finite by blast + lemma derived_set_of_singleton: "Hausdorff_space X \ X derived_set_of {x} = {}" by (simp add: derived_set_of_finite) @@ -698,4 +701,47 @@ qed qed +lemma Hausdorff_space_closed_neighbourhood: + "Hausdorff_space X \ + (\x \ topspace X. \U C. openin X U \ closedin X C \ + Hausdorff_space(subtopology X C) \ x \ U \ U \ C)" (is "_ = ?rhs") +proof + assume R: ?rhs + show "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" + obtain T C where *: "openin X T" "closedin X C" "x \ T" "T \ C" + and C: "Hausdorff_space (subtopology X C)" + by (meson R \x \ topspace X\) + show "\U V. openin X U \ openin X V \ x \ U \ y \ V \ disjnt U V" + proof (cases "y \ C") + case True + with * C obtain U V where U: "openin (subtopology X C) U" + and V: "openin (subtopology X C) V" + and "x \ U" "y \ V" "disjnt U V" + unfolding Hausdorff_space_def + by (smt (verit, best) \x \ y\ closedin_subset subsetD topspace_subtopology_subset) + then obtain U' V' where UV': "U = U' \ C" "openin X U'" "V = V' \ C" "openin X V'" + by (meson openin_subtopology) + have "disjnt (T \ U') V'" + using \disjnt U V\ UV' \T \ C\ by (force simp: disjnt_iff) + with \T \ C\ have "disjnt (T \ U') (V' \ (topspace X - C))" + unfolding disjnt_def by blast + moreover + have "openin X (T \ U')" + by (simp add: \openin X T\ \openin X U'\ openin_Int) + moreover have "openin X (V' \ (topspace X - C))" + using \closedin X C\ \openin X V'\ by auto + ultimately show ?thesis + using UV' \x \ T\ \x \ U\ \y \ V\ by blast + next + case False + with * y show ?thesis + by (force simp: closedin_def disjnt_def) + qed + qed +qed fastforce + end diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Library/Set_Idioms.thy --- a/src/HOL/Library/Set_Idioms.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Library/Set_Idioms.thy Tue May 02 15:17:39 2023 +0100 @@ -557,4 +557,162 @@ by blast qed +lemma countable_union_of_empty [simp]: "(countable union_of P) {}" + by (simp add: union_of_empty) + +lemma countable_intersection_of_empty [simp]: "(countable intersection_of P) UNIV" + by (simp add: intersection_of_empty) + +lemma countable_union_of_inc: "P S \ (countable union_of P) S" + by (simp add: union_of_inc) + +lemma countable_intersection_of_inc: "P S \ (countable intersection_of P) S" + by (simp add: intersection_of_inc) + +lemma countable_union_of_complement: + "(countable union_of P) S \ (countable intersection_of (\S. P(-S))) (-S)" + (is "?lhs=?rhs") +proof + assume ?lhs + then obtain \ where "countable \" and \: "\ \ Collect P" "\\ = S" + by (metis union_of_def) + define \' where "\' \ (\C. -C) ` \" + have "\' \ {S. P (- S)}" "\\' = -S" + using \'_def \ by auto + then show ?rhs + unfolding intersection_of_def by (metis \'_def \countable \\ countable_image) +next + assume ?rhs + then obtain \ where "countable \" and \: "\ \ {S. P (- S)}" "\\ = -S" + by (metis intersection_of_def) + define \' where "\' \ (\C. -C) ` \" + have "\' \ Collect P" "\ \' = S" + using \'_def \ by auto + then show ?lhs + unfolding union_of_def + by (metis \'_def \countable \\ countable_image) +qed + +lemma countable_intersection_of_complement: + "(countable intersection_of P) S \ (countable union_of (\S. P(- S))) (- S)" + by (simp add: countable_union_of_complement) + +lemma countable_union_of_explicit: + assumes "P {}" + shows "(countable union_of P) S \ + (\T. (\n::nat. P(T n)) \ \(range T) = S)" (is "?lhs=?rhs") +proof + assume ?lhs + then obtain \ where "countable \" and \: "\ \ Collect P" "\\ = S" + by (metis union_of_def) + then show ?rhs + by (metis SUP_bot Sup_empty assms from_nat_into mem_Collect_eq range_from_nat_into subsetD) +next + assume ?rhs + then show ?lhs + by (metis countableI_type countable_image image_subset_iff mem_Collect_eq union_of_def) +qed + +lemma countable_union_of_ascending: + assumes empty: "P {}" and Un: "\T U. \P T; P U\ \ P(T \ U)" + shows "(countable union_of P) S \ + (\T. (\n. P(T n)) \ (\n. T n \ T(Suc n)) \ \(range T) = S)" (is "?lhs=?rhs") +proof + assume ?lhs + then obtain T where T: "\n::nat. P(T n)" "\(range T) = S" + by (meson empty countable_union_of_explicit) + have "P (\ (T ` {..n}))" for n + by (induction n) (auto simp: atMost_Suc Un T) + with T show ?rhs + by (rule_tac x="\n. \k\n. T k" in exI) force +next + assume ?rhs + then show ?lhs + using empty countable_union_of_explicit by auto +qed + +lemma countable_union_of_idem [simp]: + "countable union_of countable union_of P = countable union_of P" (is "?lhs=?rhs") +proof + fix S + show "(countable union_of countable union_of P) S = (countable union_of P) S" + proof + assume L: "?lhs S" + then obtain \ where "countable \" and \: "\ \ Collect (countable union_of P)" "\\ = S" + by (metis union_of_def) + then have "\U \ \. \\. countable \ \ \ \ Collect P \ U = \\" + by (metis Ball_Collect union_of_def) + then obtain \ where \: "\U \ \. countable (\ U) \ \ U \ Collect P \ U = \(\ U)" + by metis + have "countable (\ (\ ` \))" + using \ \countable \\ by blast + moreover have "\ (\ ` \) \ Collect P" + by (simp add: Sup_le_iff \) + moreover have "\ (\ (\ ` \)) = S" + by auto (metis Union_iff \ \(2))+ + ultimately show "?rhs S" + by (meson union_of_def) + qed (simp add: countable_union_of_inc) +qed + +lemma countable_intersection_of_idem [simp]: + "countable intersection_of countable intersection_of P = + countable intersection_of P" + by (force simp: countable_intersection_of_complement) + +lemma countable_union_of_Union: + "\countable \; \S. S \ \ \ (countable union_of P) S\ + \ (countable union_of P) (\ \)" + by (metis Ball_Collect countable_union_of_idem union_of_def) + +lemma countable_union_of_UN: + "\countable I; \i. i \ I \ (countable union_of P) (U i)\ + \ (countable union_of P) (\i\I. U i)" + by (metis (mono_tags, lifting) countable_image countable_union_of_Union imageE) + +lemma countable_union_of_Un: + "\(countable union_of P) S; (countable union_of P) T\ + \ (countable union_of P) (S \ T)" + by (smt (verit) Union_Un_distrib countable_Un le_sup_iff union_of_def) + +lemma countable_intersection_of_Inter: + "\countable \; \S. S \ \ \ (countable intersection_of P) S\ + \ (countable intersection_of P) (\ \)" + by (metis countable_intersection_of_idem intersection_of_def mem_Collect_eq subsetI) + +lemma countable_intersection_of_INT: + "\countable I; \i. i \ I \ (countable intersection_of P) (U i)\ + \ (countable intersection_of P) (\i\I. U i)" + by (metis (mono_tags, lifting) countable_image countable_intersection_of_Inter imageE) + +lemma countable_intersection_of_inter: + "\(countable intersection_of P) S; (countable intersection_of P) T\ + \ (countable intersection_of P) (S \ T)" + by (simp add: countable_intersection_of_complement countable_union_of_Un) + +lemma countable_union_of_Int: + assumes S: "(countable union_of P) S" and T: "(countable union_of P) T" + and Int: "\S T. P S \ P T \ P(S \ T)" + shows "(countable union_of P) (S \ T)" +proof - + obtain \ where "countable \" and \: "\ \ Collect P" "\\ = S" + using S by (metis union_of_def) + obtain \ where "countable \" and \: "\ \ Collect P" "\\ = T" + using T by (metis union_of_def) + have "\U V. \U \ \; V \ \\ \ (countable union_of P) (U \ V)" + using \ \ by (metis Ball_Collect countable_union_of_inc local.Int) + then have "(countable union_of P) (\U\\. \V\\. U \ V)" + by (meson \countable \\ \countable \\ countable_union_of_UN) + moreover have "S \ T = (\U\\. \V\\. U \ V)" + by (simp add: \ \) + ultimately show ?thesis + by presburger +qed + +lemma countable_intersection_of_union: + assumes S: "(countable intersection_of P) S" and T: "(countable intersection_of P) T" + and Un: "\S T. P S \ P T \ P(S \ T)" + shows "(countable intersection_of P) (S \ T)" + by (metis (mono_tags, lifting) Compl_Int S T Un compl_sup countable_intersection_of_complement countable_union_of_Int) + end diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Set.thy --- a/src/HOL/Set.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Set.thy Tue May 02 15:17:39 2023 +0100 @@ -1946,6 +1946,9 @@ lemma disjnt_Un2 [simp]: "disjnt C (A \ B) \ disjnt C A \ disjnt C B" by (auto simp: disjnt_def) +lemma disjnt_Diff1: "disjnt (X-Y) (U-V)" and disjnt_Diff2: "disjnt (U-V) (X-Y)" if "X \ V" + using that by (auto simp: disjnt_def) + lemma disjoint_image_subset: "\pairwise disjnt \; \X. X \ \ \ f X \ X\ \ pairwise disjnt (f `\)" unfolding disjnt_def pairwise_def by fast diff -r 01c88cf514fc -r 7f240b0dabd9 src/HOL/Set_Interval.thy --- a/src/HOL/Set_Interval.thy Tue May 02 12:51:05 2023 +0100 +++ b/src/HOL/Set_Interval.thy Tue May 02 15:17:39 2023 +0100 @@ -280,8 +280,8 @@ context order begin -lemma atLeastatMost_empty[simp]: - "b < a \ {a..b} = {}" +lemma atLeastatMost_empty[simp]: "b < a \ {a..b} = {}" + and atLeastatMost_empty'[simp]: "\ a \ b \ {a..b} = {}" by(auto simp: atLeastAtMost_def atLeast_def atMost_def) lemma atLeastLessThan_empty[simp]: