# HG changeset patch # User wenzelm # Date 1689019602 -7200 # Node ID 7729a1ad6b588683b00665193ca28cd8ba03f6c9 # Parent b86be4a9f532a46ee5f3d3605f5de5963320f448# Parent f10aee81ab93f35dbc375ababdb862e7104c73cb merged; diff -r b86be4a9f532 -r 7729a1ad6b58 NEWS --- a/NEWS Mon Jul 10 22:06:31 2023 +0200 +++ b/NEWS Mon Jul 10 22:06:42 2023 +0200 @@ -322,7 +322,7 @@ * Session "HOL-Analysis": - Imported the HOL Light abstract metric space library and numerous - associated topological developments. + results in abstract topology (1200+ lemmas). - New material on infinite sums and integration, due to Manuel Eberl and Wenda Li. diff -r b86be4a9f532 -r 7729a1ad6b58 src/HOL/Analysis/Abstract_Topological_Spaces.thy --- a/src/HOL/Analysis/Abstract_Topological_Spaces.thy Mon Jul 10 22:06:31 2023 +0200 +++ b/src/HOL/Analysis/Abstract_Topological_Spaces.thy Mon Jul 10 22:06:42 2023 +0200 @@ -3401,7 +3401,7 @@ strict_mono_iff_mono top_greatest topspace_euclidean topspace_euclidean_subtopology) -subsection\Normal spaces including Urysohn's lemma and the Tietze extension theorem\ +subsection\Normal spaces\ definition normal_space where "normal_space X \ diff -r b86be4a9f532 -r 7729a1ad6b58 src/HOL/Analysis/Continuous_Extension.thy --- a/src/HOL/Analysis/Continuous_Extension.thy Mon Jul 10 22:06:31 2023 +0200 +++ b/src/HOL/Analysis/Continuous_Extension.thy Mon Jul 10 22:06:42 2023 +0200 @@ -5,7 +5,7 @@ section \Continuous Extensions of Functions\ theory Continuous_Extension -imports Starlike +imports Starlike begin subsection\Partitions of unity subordinate to locally finite open coverings\ @@ -152,9 +152,7 @@ proof - have "f x = b \ (setdist {x} S / (setdist {x} S + setdist {x} T)) = 1" unfolding f_def - apply (rule iffI) - apply (metis \a \ b\ add_diff_cancel_left' eq_iff_diff_eq_0 pth_1 real_vector.scale_right_imp_eq, force) - done + by (metis add_diff_cancel_left' \a \ b\ diff_add_cancel eq_iff_diff_eq_0 scaleR_cancel_right scaleR_one) also have "... \ setdist {x} T = 0 \ setdist {x} S \ 0" using sdpos that by (simp add: field_split_simps) linarith @@ -166,6 +164,47 @@ qed qed +lemma Urysohn_local_strong_aux: + assumes US: "closedin (top_of_set U) S" + and UT: "closedin (top_of_set U) T" + and "S \ T = {}" "a \ b" "S \ {}" + obtains f :: "'a::euclidean_space \ 'b::euclidean_space" + where "continuous_on U f" + "\x. x \ U \ f x \ closed_segment a b" + "\x. x \ U \ (f x = a \ x \ S)" + "\x. x \ U \ (f x = b \ x \ T)" +proof (cases "T = {}") + case True show ?thesis + proof (cases "S = U") + case True with \T = {}\ \a \ b\ show ?thesis + by (rule_tac f = "\x. a" in that) (auto) + next + case False + with US closedin_subset obtain c where c: "c \ U" "c \ S" + by fastforce + obtain f where f: "continuous_on U f" + "\x. x \ U \ f x \ closed_segment a (midpoint a b)" + "\x. x \ U \ (f x = midpoint a b \ x = c)" + "\x. x \ U \ (f x = a \ x \ S)" + apply (rule Urysohn_both_ne [of U S "{c}" a "midpoint a b"]) + using c \S \ {}\ assms apply simp_all + apply (metis midpoint_eq_endpoint) + done + show ?thesis + apply (rule_tac f=f in that) + using \S \ {}\ \T = {}\ f \a \ b\ + apply simp_all + apply (metis (no_types) closed_segment_commute csegment_midpoint_subset midpoint_sym subset_iff) + apply (metis closed_segment_commute midpoint_sym notin_segment_midpoint) + done + qed +next + case False + show ?thesis + using Urysohn_both_ne [OF US UT \S \ T = {}\ \S \ {}\ \T \ {}\ \a \ b\] that + by blast +qed + proposition Urysohn_local_strong: assumes US: "closedin (top_of_set U) S" and UT: "closedin (top_of_set U) T" @@ -191,62 +230,13 @@ qed next case False - show ?thesis - proof (cases "T = U") - case True with \S = {}\ \a \ b\ show ?thesis - by (rule_tac f = "\x. b" in that) (auto) - next - case False - with UT closedin_subset obtain c where c: "c \ U" "c \ T" - by fastforce - obtain f where f: "continuous_on U f" - "\x. x \ U \ f x \ closed_segment (midpoint a b) b" - "\x. x \ U \ (f x = midpoint a b \ x = c)" - "\x. x \ U \ (f x = b \ x \ T)" - apply (rule Urysohn_both_ne [of U "{c}" T "midpoint a b" "b"]) - using c \T \ {}\ assms apply simp_all - done - show ?thesis - apply (rule_tac f=f in that) - using \S = {}\ \T \ {}\ f csegment_midpoint_subset notin_segment_midpoint [OF \a \ b\] - apply force+ - done - qed + with Urysohn_local_strong_aux [OF UT US] assms show ?thesis + by (smt (verit) True closed_segment_commute inf_bot_right that) qed next case False - show ?thesis - proof (cases "T = {}") - case True show ?thesis - proof (cases "S = U") - case True with \T = {}\ \a \ b\ show ?thesis - by (rule_tac f = "\x. a" in that) (auto) - next - case False - with US closedin_subset obtain c where c: "c \ U" "c \ S" - by fastforce - obtain f where f: "continuous_on U f" - "\x. x \ U \ f x \ closed_segment a (midpoint a b)" - "\x. x \ U \ (f x = midpoint a b \ x = c)" - "\x. x \ U \ (f x = a \ x \ S)" - apply (rule Urysohn_both_ne [of U S "{c}" a "midpoint a b"]) - using c \S \ {}\ assms apply simp_all - apply (metis midpoint_eq_endpoint) - done - show ?thesis - apply (rule_tac f=f in that) - using \S \ {}\ \T = {}\ f \a \ b\ - apply simp_all - apply (metis (no_types) closed_segment_commute csegment_midpoint_subset midpoint_sym subset_iff) - apply (metis closed_segment_commute midpoint_sym notin_segment_midpoint) - done - qed - next - case False - show ?thesis - using Urysohn_both_ne [OF US UT \S \ T = {}\ \S \ {}\ \T \ {}\ \a \ b\] that - by blast - qed + with Urysohn_local_strong_aux [OF assms] show ?thesis + using that by blast qed lemma Urysohn_local: @@ -263,12 +253,8 @@ by (rule_tac f = "\x. b" in that) (auto) next case False - then show ?thesis - apply (rule Urysohn_local_strong [OF assms]) - apply (erule that, assumption) - apply (meson US closedin_singleton closedin_trans) - apply (meson UT closedin_singleton closedin_trans) - done + with Urysohn_local_strong [OF assms] show ?thesis + by (smt (verit) US UT closedin_imp_subset subset_eq that) qed lemma Urysohn_strong: @@ -298,20 +284,6 @@ text \See \<^cite>\"dugundji"\.\ -lemma convex_supp_sum: - assumes "convex S" and 1: "supp_sum u I = 1" - and "\i. i \ I \ 0 \ u i \ (u i = 0 \ f i \ S)" - shows "supp_sum (\i. u i *\<^sub>R f i) I \ S" -proof - - have fin: "finite {i \ I. u i \ 0}" - using 1 sum.infinite by (force simp: supp_sum_def support_on_def) - then have "supp_sum (\i. u i *\<^sub>R f i) I = sum (\i. u i *\<^sub>R f i) {i \ I. u i \ 0}" - by (force intro: sum.mono_neutral_left simp: supp_sum_def support_on_def) - also have "... \ S" - using 1 assms by (force simp: supp_sum_def support_on_def intro: convex_sum [OF fin \convex S\]) - finally show ?thesis . -qed - theorem Dugundji: fixes f :: "'a::{metric_space,second_countable_topology} \ 'b::real_inner" assumes "convex C" "C \ {}" @@ -320,11 +292,13 @@ obtains g where "continuous_on U g" "g ` U \ C" "\x. x \ S \ g x = f x" proof (cases "S = {}") - case True then show thesis - apply (rule_tac g="\x. SOME y. y \ C" in that) - apply (rule continuous_intros) - apply (meson all_not_in_conv \C \ {}\ image_subsetI someI_ex, simp) - done + case True show thesis + proof + show "continuous_on U (\x. SOME y. y \ C)" + by (rule continuous_intros) + show "(\x. SOME y. y \ C) ` U \ C" + by (simp add: \C \ {}\ image_subsetI some_in_eq) + qed (use True in auto) next case False then have sd_pos: "\x. \x \ U; x \ S\ \ 0 < setdist {x} S" @@ -348,9 +322,7 @@ using setdist_ltE [of "{v}" S "2 * setdist {v} S"] using False sd_pos by force with v show ?thesis - apply (rule_tac x=v in exI) - apply (rule_tac x=a in exI, auto) - done + by force qed then obtain \ \ where VA: "\T. T \ \ \ \ T \ U \ \ T \ S \ \ T \ S \ diff -r b86be4a9f532 -r 7729a1ad6b58 src/HOL/Analysis/Urysohn.thy --- a/src/HOL/Analysis/Urysohn.thy Mon Jul 10 22:06:31 2023 +0200 +++ b/src/HOL/Analysis/Urysohn.thy Mon Jul 10 22:06:42 2023 +0200 @@ -10,7 +10,7 @@ subsection \Urysohn lemma and Tietze's theorem\ -lemma Urysohn_lemma: +proposition Urysohn_lemma: fixes a b :: real assumes "normal_space X" "closedin X S" "closedin X T" "disjnt S T" "a \ b" obtains f where "continuous_map X (top_of_set {a..b}) f" "f ` S \ {a}" "f ` T \ {b}" @@ -333,7 +333,7 @@ qed qed -lemma Tietze_extension_closed_real_interval: +theorem Tietze_extension_closed_real_interval: assumes "normal_space X" and "closedin X S" and contf: "continuous_map (subtopology X S) euclideanreal f" and fim: "f ` S \ {a..b}" and "a \ b" @@ -498,7 +498,7 @@ qed -lemma Tietze_extension_realinterval: +theorem Tietze_extension_realinterval: assumes XS: "normal_space X" "closedin X S" and T: "is_interval T" "T \ {}" and contf: "continuous_map (subtopology X S) euclideanreal f" and "f ` S \ T" @@ -665,8 +665,7 @@ qed qed -subsection \random metric space stuff\ - +subsection \Random metric space stuff\ lemma metrizable_imp_k_space: assumes "metrizable_space X" @@ -1085,7 +1084,7 @@ qed -lemma locally_compact_regular_imp_completely_regular_space: +proposition locally_compact_regular_imp_completely_regular_space: assumes "locally_compact_space X" "Hausdorff_space X \ regular_space X" shows "completely_regular_space X" unfolding completely_regular_space_def @@ -1205,7 +1204,7 @@ qed -lemma completely_regular_space_product_topology: +proposition completely_regular_space_product_topology: "completely_regular_space (product_topology X I) \ (\\<^sub>E i\I. topspace(X i)) = {} \ (\i \ I. completely_regular_space (X i))" (is "?lhs \ ?rhs") @@ -1492,7 +1491,7 @@ "\compact_space X; \ compactin X (topspace X - {a})\ \ X interior_of {a} = {}" by (simp add: interior_of_eq_empty_complement one_point_compactification_dense) -lemma kc_space_one_point_compactification_gen: +proposition kc_space_one_point_compactification_gen: assumes "compact_space X" shows "kc_space X \ openin X (topspace X - {a}) \ (\K. compactin X K \ a\K \ closedin X K) \ @@ -1624,7 +1623,7 @@ unfolding eq using Alexandroff_open.base by blast qed -lemma istopology_Alexandroff_open: "istopology (Alexandroff_open X)" +proposition istopology_Alexandroff_open: "istopology (Alexandroff_open X)" unfolding istopology_def proof (intro conjI strip) fix S T @@ -1930,7 +1929,7 @@ qed -lemma regular_space_one_point_compactification: +proposition regular_space_one_point_compactification: assumes "compact_space X" and ope: "openin X (topspace X - {a})" and \
: "\K. \compactin (subtopology X (topspace X - {a})) K; closedin (subtopology X (topspace X - {a})) K\ \ closedin X K" shows "regular_space X \ @@ -2036,7 +2035,7 @@ by (metis regular_space_Alexandroff_compactification completely_regular_eq_regular_space compact_imp_locally_compact_space compact_space_Alexandroff_compactification) -lemma Hausdorff_space_one_point_compactification_asymmetric_prod: +proposition Hausdorff_space_one_point_compactification_asymmetric_prod: assumes "compact_space X" shows "Hausdorff_space X \ kc_space (prod_topology X (subtopology X (topspace X - {a}))) \ @@ -5182,4 +5181,766 @@ \ gdelta_in X S \ S \ topspace X \ completely_metrizable_space (subtopology X S)" by (metis completely_metrizable_space_eq_gdelta_in gdelta_in_alt) +subsection\ Theorems from Kuratowski\ + +text\Kuratowski, Remark on an Invariance Theorem, \emph{Fundamenta Mathematicae} \textbf{37} (1950), pp. 251-252. + The idea is that in suitable spaces, to show "number of components of the complement" (without + distinguishing orders of infinity) is a homeomorphic invariant, it + suffices to show it for closed subsets. Kuratowski states the main result + for a "locally connected continuum", and seems clearly to be implicitly + assuming that means metrizable. We call out the general topological + hypotheses more explicitly, which do not however include connectedness. \ + +lemma separation_by_closed_intermediates_count: + assumes X: "hereditarily normal_space X" + and "finite \" + and pwU: "pairwise (separatedin X) \" + and nonempty: "{} \ \" + and UU: "\\ = topspace X - S" + obtains C where "closedin X C" "C \ S" + "\D. \closedin X D; C \ D; D \ S\ + \ \\. \ \ \ \ pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - D" +proof - + obtain F where F: "\S. S \ \ \ openin X (F S) \ S \ F S" + and pwF: "pairwise (\S T. disjnt (F S) (F T)) \" + using assms by (smt (verit, best) Diff_subset Sup_le_iff hereditarily_normal_separation_pairwise) + show thesis + proof + show "closedin X (topspace X - \(F ` \))" + using F by blast + show "topspace X - \(F ` \) \ S" + using UU F by auto + show "\\. \ \ \ \ pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - C" + if "closedin X C" "C \ S" and C: "topspace X - \(F ` \) \ C" for C + proof (intro exI conjI strip) + have "inj_on (\S. F S - C) \" + using pwF F + unfolding inj_on_def pairwise_def disjnt_iff + by (metis Diff_iff UU UnionI nonempty subset_empty subset_eq \C \ S\) + then show "(\S. F S - C) ` \ \ \" + by simp + show "pairwise (separatedin X) ((\S. F S - C) ` \)" + using \closedin X C\ F pwF by (force simp: pairwise_def openin_diff separatedin_open_sets disjnt_iff) + show "{} \ (\S. F S - C) ` \" + using nonempty UU \C \ S\ F + by clarify (metis DiffD2 Diff_eq_empty_iff F UnionI subset_empty subset_eq) + show "(\S\\. F S - C) = topspace X - C" + using UU F C openin_subset by fastforce + qed + qed +qed + +lemma separation_by_closed_intermediates_gen: + assumes X: "hereditarily normal_space X" + and discon: "\ connectedin X (topspace X - S)" + obtains C where "closedin X C" "C \ S" + "\D. \closedin X D; C \ D; D \ S\ \ \ connectedin X (topspace X - D)" +proof - + obtain C1 C2 where Ueq: "C1 \ C2 = topspace X - S" and "C1 \ {}" "C2 \ {}" + and sep: "separatedin X C1 C2" and "C1 \ C2" + by (metis Diff_subset connectedin_eq_not_separated discon separatedin_refl) + then obtain C where "closedin X C" "C \ S" + and C: "\D. \closedin X D; C \ D; D \ S\ + \ \\. \ \ {C1,C2} \ pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - D" + using separation_by_closed_intermediates_count [of X "{C1,C2}" S] X + apply (simp add: pairwise_insert separatedin_sym) + by metis + have "\ connectedin X (topspace X - D)" + if D: "closedin X D" "C \ D" "D \ S" for D + proof - + obtain V1 V2 where *: "pairwise (separatedin X) {V1,V2}" "{} \ {V1,V2}" + "\{V1,V2} = topspace X - D" "V1\V2" + by (metis C [OF D] \C1 \ C2\ eqpoll_doubleton_iff) + then have "disjnt V1 V2" + by (metis pairwise_insert separatedin_imp_disjoint singleton_iff) + with * show ?thesis + by (auto simp add: connectedin_eq_not_separated pairwise_insert) + qed + then show thesis + using \C \ S\ \closedin X C\ that by auto +qed + +lemma separation_by_closed_intermediates_eq_count: + fixes n::nat + assumes lcX: "locally_connected_space X" and hnX: "hereditarily normal_space X" + shows "(\\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - S) \ + (\C. closedin X C \ C \ S \ + (\D. closedin X D \ C \ D \ D \ S + \ (\\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - D)))" + (is "?lhs = ?rhs") +proof + assume ?lhs then show ?rhs + by (smt (verit, best) hnX separation_by_closed_intermediates_count eqpoll_iff_finite_card eqpoll_trans) +next + assume R: ?rhs + show ?lhs + proof (cases "n=0") + case True + with R show ?thesis + by fastforce + next + case False + obtain C where "closedin X C" "C \ S" + and C: "\D. \closedin X D; C \ D; D \ S\ + \ \\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - D" + using R by force + then have "C \ topspace X" + by (simp add: closedin_subset) + define \ where "\ \ {D \ connected_components_of (subtopology X (topspace X - C)). D-S \ {}}" + have ope\: "openin X U" if "U \ \" for U + using that \closedin X C\ lcX locally_connected_space_open_connected_components + by (fastforce simp add: closedin_def \_def) + have "{} \ \" + by (auto simp: \_def) + have "pairwise disjnt \" + using connected_components_of_disjoint by (fastforce simp add: pairwise_def \_def) + show ?lhs + proof (rule ccontr) + assume con: "\\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - S" + have card\: "finite \ \ card \ < n" + proof (rule ccontr) + assume "\ (finite \ \ card \ < n)" + then obtain \ where "\ \ \" "finite \" "card \ = n" + by (metis infinite_arbitrarily_large linorder_not_less obtain_subset_with_card_n) + then obtain T where "T \ \" + using False by force + define \ where "\ \ insert (topspace X - S - \(\ - {T})) ((\D. D - S) ` (\ - {T}))" + have "\\ = topspace X - S" + using \\U. U \ \ \ openin X U\ \\ \ \\ topspace_def by (fastforce simp: \_def) + moreover have "{} \ \" + proof - + obtain a where "a \ T" "a \ S" + using \_def \T \ \\ \\ \ \\ by blast + then have "a \ topspace X" + using \T \ \\ ope\ \\ \ \\ openin_subset by blast + moreover have "a \ \(\ - {T})" + using diff_Union_pairwise_disjoint [of \ "{T}"] \disjoint \\ pairwise_subset \T \ \\ \\ \ \\ \a \ T\ + by auto + ultimately have "topspace X - S - \(\ - {T}) \ {}" + using \a \ S\ by blast + moreover have "\V. V \ \ - {T} \ V - S \ {}" + using \_def \\ \ \\ by blast + ultimately show ?thesis + by (metis (no_types, lifting) \_def image_iff insert_iff) + qed + moreover have "disjoint \" + using \\ \ \\ \disjoint \\ pairwise_subset by blast + then have inj: "inj_on (\D. D - S) (\ - {T})" + unfolding inj_on_def using \\ \ \\ disjointD \_def inf_commute by blast + have "finite \" "card \ = n" + using \{} \ \\ \n \ 0\ \T \ \\ + by (auto simp add: \_def \finite \\ card_insert_if card_image inj \card \ = n\) + moreover have "pairwise (separatedin X) \" + proof - + have "disjoint \" + using \disjoint \\ by (auto simp: \_def pairwise_def disjnt_iff) + have "pairwise (separatedin (subtopology X (topspace X - S))) \" + proof (intro pairwiseI) + fix A B + assume \
: "A \ \" "B \ \" "A \ B" + then have "disjnt A B" + by (meson \disjoint \\ pairwiseD) + have "closedin (subtopology X (topspace X - C)) (\(\ - {T}))" + using \_def \\ \ \\ closedin_connected_components_of \finite \\ + by (force simp add: intro!: closedin_Union) + with \C \ S\ have "openin (subtopology X (topspace X - S)) (topspace X - S - \(\ - {T}))" + by (fastforce simp add: openin_closedin_eq closedin_subtopology Int_absorb1) + moreover have "\V. V \ \ \ V\T \ openin (subtopology X (topspace X - S)) (V - S)" + using \\ \ \\ ope\ + by (metis IntD2 Int_Diff inf.orderE openin_subset openin_subtopology) + ultimately have "openin (subtopology X (topspace X - S)) A" "openin (subtopology X (topspace X - S)) B" + using \
\_def by blast+ + with \disjnt A B\ show "separatedin (subtopology X (topspace X - S)) A B" + using separatedin_open_sets by blast + qed + then show ?thesis + by (simp add: pairwise_def separatedin_subtopology) + qed + ultimately show False + by (metis con eqpoll_iff_finite_card) + qed + obtain \ where "\ \ {.. \" + and pw\: "pairwise (separatedin X) \" and UV: "\\ = topspace X - (topspace X - \\)" + proof - + have "closedin X (topspace X - \\)" + using ope\ by blast + moreover have "C \ topspace X - \\" + using \C \ topspace X\ connected_components_of_subset by (fastforce simp: \_def) + moreover have "topspace X - \\ \ S" + using Union_connected_components_of [of "subtopology X (topspace X - C)"] \C \ S\ + by (auto simp: \_def) + ultimately show thesis + by (metis C that) + qed + have "\ \ \" + proof (rule lepoll_relational_full) + have "\\ = \\" + by (simp add: Sup_le_iff UV double_diff ope\ openin_subset) + then show "\U. U \ \ \ \ disjnt U V" if "V \ \" for V + using that + by (metis \{} \ \\ disjnt_Union1 disjnt_self_iff_empty) + show "C1 = C2" + if "T \ \" and "C1 \ \" and "C2 \ \" and "\ disjnt T C1" and "\ disjnt T C2" for T C1 C2 + proof (cases "C1=C2") + case False + then have "connectedin X T" + using \_def connectedin_connected_components_of connectedin_subtopology \T \ \\ by blast + have "T \ C1 \ \(\ - {C1})" + using \\\ = \\\ \T \ \\ by auto + with \connectedin X T\ + have "\ separatedin X C1 (\(\ - {C1}))" + unfolding connectedin_eq_not_separated_subset + by (smt (verit) that False disjnt_def UnionI disjnt_iff insertE insert_Diff) + with that show ?thesis + by (metis (no_types, lifting) \\ \ {.. eqpoll_iff_finite_card finite_Diff pairwiseD pairwise_alt pw\ separatedin_Union(1) separatedin_def) + qed auto + qed + then show False + by (metis \\ \ {.. card\ eqpoll_iff_finite_card leD lepoll_iff_card_le) + qed + qed +qed + +lemma separation_by_closed_intermediates_eq_gen: + assumes "locally_connected_space X" "hereditarily normal_space X" + shows "\ connectedin X (topspace X - S) \ + (\C. closedin X C \ C \ S \ + (\D. closedin X D \ C \ D \ D \ S \ \ connectedin X (topspace X - D)))" + (is "?lhs = ?rhs") +proof - + have *: "(\\::'a set set. \ \ {.. P \) \ (\A B. A\B \ P{A,B})" for P + by (metis One_nat_def eqpoll_doubleton_iff lessThan_Suc lessThan_empty_iff zero_neq_one) + have *: "(\C1 C2. separatedin X C1 C2 \ C1\C2 \ C1\{} \ C2\{} \ C1 \ C2 = topspace X - S) \ + (\C. closedin X C \ C \ S \ + (\D. closedin X D \ C \ D \ D \ S + \ (\C1 C2. separatedin X C1 C2 \ C1\C2 \ C1\{} \ C2\{} \ C1 \ C2 = topspace X - D)))" + using separation_by_closed_intermediates_eq_count [OF assms, of "Suc(Suc 0)" S] + apply (simp add: * pairwise_insert separatedin_sym cong: conj_cong) + apply (simp add: eq_sym_conv conj_ac) + done + with separatedin_refl + show ?thesis + apply (simp add: connectedin_eq_not_separated) + by (smt (verit, best) separatedin_refl) +qed + + + +lemma lepoll_connnected_components_connectedin: + assumes "\C. C \ \ \ connectedin X C" "\\ = topspace X" + shows "connected_components_of X \ \" +proof - + have "connected_components_of X \ \ - {{}}" + proof (rule lepoll_relational_full) + show "\U. U \ \ - {{}} \ U \ V" + if "V \ connected_components_of X" for V + using that unfolding connected_components_of_def image_iff + by (metis Union_iff assms connected_component_of_maximal empty_iff insert_Diff_single insert_iff) + show "V = V'" + if "U \ \ - {{}}" "V \ connected_components_of X" "V' \ connected_components_of X" "U \ V" "U \ V'" + for U V V' + by (metis DiffD2 disjointD insertCI le_inf_iff pairwise_disjoint_connected_components_of subset_empty that) + qed + also have "\ \ \" + by (simp add: subset_imp_lepoll) + finally show ?thesis . +qed + +lemma lepoll_connected_components_alt: + "{.. connected_components_of X \ + n = 0 \ (\\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X)" + (is "?lhs \ ?rhs") +proof (cases "n=0") +next + case False + show ?thesis + proof + assume L: ?lhs + with False show ?rhs + proof (induction n rule: less_induct) + case (less n) + show ?case + proof (cases "n\1") + case True + with less.prems connected_components_of_empty_space show ?thesis + by (force simp add: le_Suc_eq eqpoll_iff_finite_card card_Suc_eq simp flip: ex_simps) + next + case False + then have "n-1 \ 0" + by linarith + have n1_lesspoll: "{.. {.. \ connected_components_of X" + using less by blast + finally have "{.. connected_components_of X" + using lesspoll_imp_lepoll by blast + then obtain \ where Ueq: "\ \ {.. \" + and pwU: "pairwise (separatedin X) \" and UU: "\\ = topspace X" + by (meson \n - 1 \ 0\ diff_less gr0I less zero_less_one) + show ?thesis + proof (cases "\C \ \. connectedin X C") + case True + then show ?thesis + using lepoll_connnected_components_connectedin [of \ X] less.prems + by (metis UU Ueq lepoll_antisym lepoll_trans lepoll_trans2 lesspoll_def n1_lesspoll) + next + case False + with UU obtain C A B where ABC: "C \ \" "A \ B = C" "A \ {}" "B \ {}" and sep: "separatedin X A B" + by (fastforce simp add: connectedin_eq_not_separated) + define \ where "\ \ insert A (insert B (\ - {C}))" + have "\ \ {.. B" + using \B \ {}\ sep by auto + moreover obtain "A \ \" "B \ \" + using pwU unfolding pairwise_def + by (metis ABC sep separatedin_Un(1) separatedin_refl separatedin_sym) + moreover have "card \ = n-1" "finite \" + using Ueq eqpoll_iff_finite_card by blast+ + ultimately + have "card (insert A (insert B (\ - {C}))) = n" + using \C \ \\ by (auto simp add: card_insert_if) + then show ?thesis + using \_def \finite \\ eqpoll_iff_finite_card by blast + qed + moreover have "{} \ \" + using ABC \_def \{} \ \\ by blast + moreover have "\\ = topspace X" + using ABC UU \_def by auto + moreover have "pairwise (separatedin X) \" + using pwU sep ABC unfolding \_def + apply (simp add: separatedin_sym pairwise_def) + by (metis member_remove remove_def separatedin_Un(1)) + ultimately show ?thesis + by blast + qed + qed + qed + next + assume ?rhs + then obtain \ where "\ \ {.. \" and pwU: "pairwise (separatedin X) \" and UU: "\\ = topspace X" + using False by force + have "card (connected_components_of X) \ n" if "finite (connected_components_of X)" + proof - + have "\ \ connected_components_of X" + proof (rule lepoll_relational_full) + show "\T. T \ connected_components_of X \ \ disjnt T C" if "C \ \" for C + by (metis that UU Union_connected_components_of Union_iff \{} \ \\ disjnt_iff equals0I) + show "(C1::'a set) = C2" + if "T \ connected_components_of X" and "C1 \ \" "C2 \ \" "\ disjnt T C1" "\ disjnt T C2" for T C1 C2 + proof (rule ccontr) + assume "C1 \ C2" + then have "connectedin X T" + by (simp add: connectedin_connected_components_of that(1)) + moreover have "\ separatedin X C1 (\(\ - {C1}))" + using \connectedin X T\ pwU unfolding pairwise_def + by (smt (verit) Sup_upper UU Union_connected_components_of \C1 \ C2\ complete_lattice_class.Sup_insert connectedin_subset_separated_union disjnt_subset2 disjnt_sym insert_Diff separatedin_imp_disjoint that) + ultimately show False + using \\ \ {.. + apply (simp add: connectedin_eq_not_separated_subset eqpoll_iff_finite_card) + by (metis Sup_upper UU finite_Diff pairwise_alt pwU separatedin_Union(1) that(2)) + qed + qed + then show ?thesis + by (metis \\ \ {.. eqpoll_iff_finite_card lepoll_iff_card_le that) + qed + then show ?lhs + by (metis card_lessThan finite_lepoll_infinite finite_lessThan lepoll_iff_card_le) + qed +qed auto + + +subsection\A perfect set in common cases must have at least the cardinality of the continuum\ + +lemma (in Metric_space) lepoll_perfect_set: + assumes "mcomplete" + and "mtopology derived_set_of S = S" "S \ {}" + shows "(UNIV::real set) \ S" +proof - + have "S \ M" + using assms(2) derived_set_of_infinite_mball by blast + have "(UNIV::real set) \ (UNIV::nat set set)" + using eqpoll_imp_lepoll eqpoll_sym nat_sets_eqpoll_reals by blast + also have "\ \ S" + proof - + have "\y z \. y \ S \ z \ S \ 0 < \ \ \ < \/2 \ + mcball y \ \ mcball x \ \ mcball z \ \ mcball x \ \ disjnt (mcball y \) (mcball z \)" + if "x \ S" "0 < \" for x \ + proof - + define S' where "S' \ S \ mball x (\/4)" + have "infinite S'" + using derived_set_of_infinite_mball [of S] assms that S'_def + by (smt (verit, ccfv_SIG) mem_Collect_eq zero_less_divide_iff) + then have "\x y z. \ (S' \ {x,y,z})" + using finite_subset by auto + then obtain l r where lr: "l \ S'" "r \ S'" "l\r" "l\x" "r\x" + by (metis insert_iff subsetI) + show ?thesis + proof (intro exI conjI) + show "l \ S" "r \ S" "d l r / 3 > 0" + using lr by (auto simp: S'_def) + show "d l r / 3 < \/2" "mcball l (d l r / 3) \ mcball x \" "mcball r (d l r / 3) \ mcball x \" + using lr by (clarsimp simp: S'_def, smt (verit) commute triangle'')+ + show "disjnt (mcball l (d l r / 3)) (mcball r (d l r / 3))" + using lr by (simp add: S'_def disjnt_iff) (smt (verit, best) mdist_pos_less triangle') + qed + qed + then obtain l r \ + where lrS: "\x \. \x \ S; 0 < \\ \ l x \ \ S \ r x \ \ S" + and \: "\x \. \x \ S; 0 < \\ \ 0 < \ x \ \ \ x \ < \/2" + and "\x \. \x \ S; 0 < \\ \ mcball (l x \) (\ x \) \ mcball x \ \ mcball (r x \) (\ x \) \ mcball x \ \ + disjnt (mcball (l x \) (\ x \)) (mcball (r x \) (\ x \))" + by metis + then have lr_mcball: "\x \. \x \ S; 0 < \\ \ mcball (l x \) (\ x \) \ mcball x \ \ mcball (r x \) (\ x \) \ mcball x \ " + and lr_disjnt: "\x \. \x \ S; 0 < \\ \ disjnt (mcball (l x \) (\ x \)) (mcball (r x \) (\ x \))" + by metis+ + obtain a where "a \ S" + using \S \ {}\ by blast + define xe where "xe \ + \B. rec_nat (a,1) (\n (x,\). ((if n\B then r else l) x \, \ x \))" + have [simp]: "xe b 0 = (a,1)" for b + by (simp add: xe_def) + have "xe B (Suc n) = (let (x,\) = xe B n in ((if n\B then r else l) x \, \ x \))" for B n + by (simp add: xe_def) + define x where "x \ \B n. fst (xe B n)" + define \ where "\ \ \B n. snd (xe B n)" + have [simp]: "x B 0 = a" "\ B 0 = 1" for B + by (simp_all add: x_def \_def xe_def) + have x_Suc[simp]: "x B (Suc n) = ((if n\B then r else l) (x B n) (\ B n))" + and \_Suc[simp]: "\ B (Suc n) = \ (x B n) (\ B n)" for B n + by (simp_all add: x_def \_def xe_def split: prod.split) + interpret Submetric M d S + proof qed (use \S \ M\ in metis) + have "closedin mtopology S" + by (metis assms(2) closure_of closure_of_eq inf.absorb_iff2 subset subset_Un_eq subset_refl topspace_mtopology) + with \mcomplete\ + have "sub.mcomplete" + by (metis closedin_mcomplete_imp_mcomplete) + have *: "x B n \ S \ \ B n > 0" for B n + by (induction n) (auto simp: \a \ S\ lrS \) + with subset have E: "x B n \ M" for B n + by blast + have \_le: "\ B n \ (1/2)^n" for B n + proof(induction n) + case 0 then show ?case by auto + next + case (Suc n) + then show ?case + by simp (smt (verit) "*" \ field_sum_of_halves) + qed + { fix B + have "\n. sub.mcball (x B (Suc n)) (\ B (Suc n)) \ sub.mcball (x B n) (\ B n)" + by (smt (verit, best) "*" Int_iff \_Suc x_Suc in_mono lr_mcball mcball_submetric_eq subsetI) + then have mon: "monotone (\) (\x y. y \ x) (\n. sub.mcball (x B n) (\ B n))" + by (simp add: decseq_SucI) + have "\n a. sub.mcball (x B n) (\ B n) \ sub.mcball a \" if "\>0" for \ + proof - + obtain n where "(1/2)^n < \" + using \0 < \\ real_arch_pow_inv by force + with \_le have \: "\ B n \ \" + by (smt (verit)) + show ?thesis + proof (intro exI) + show "sub.mcball (x B n) (\ B n) \ sub.mcball (x B n) \" + by (simp add: \ sub.mcball_subset_concentric) + qed + qed + then have "\l. l \ S \ (\n. sub.mcball (x B n) (\ B n)) = {l}" + using \sub.mcomplete\ mon + unfolding sub.mcomplete_nest_sing + apply (drule_tac x="\n. sub.mcball (x B n) (\ B n)" in spec) + by (meson * order.asym sub.closedin_mcball sub.mcball_eq_empty) + } + then obtain z where z: "\B. z B \ S \ (\n. sub.mcball (x B n) (\ B n)) = {z B}" + by metis + show ?thesis + unfolding lepoll_def + proof (intro exI conjI) + show "inj z" + proof (rule inj_onCI) + fix B C + assume eq: "z B = z C" and "B \ C" + then have ne: "sym_diff B C \ {}" + by blast + define n where "n \ LEAST k. k \ (sym_diff B C)" + with ne have n: "n \ sym_diff B C" + by (metis Inf_nat_def1 LeastI) + then have non: "n \ B \ n \ C" + by blast + have H: "z C \ sub.mcball (x B (Suc n)) (\ B (Suc n)) \ z C \ sub.mcball (x C (Suc n)) (\ C (Suc n))" + using z [of B] z [of C] apply (simp add: lrS set_eq_iff non *) + by (smt (verit, best) \_Suc eq non x_Suc) + have "k \ B \ k \ C" if "km. m < p \ (m \ B \ m \ C)) \ x B p = x C p \ \ B p = \ C p" for p + by (induction p) auto + ultimately have "x B n = x C n" "\ B n = \ C n" + by blast+ + then show False + using lr_disjnt * H non + by (smt (verit) IntD2 \_Suc disjnt_iff mcball_submetric_eq x_Suc) + qed + show "range z \ S" + using z by blast + qed + qed + finally show ?thesis . +qed + +lemma lepoll_perfect_set_aux: + assumes lcX: "locally_compact_space X" and hsX: "Hausdorff_space X" + and eq: "X derived_set_of topspace X = topspace X" and "topspace X \ {}" + shows "(UNIV::real set) \ topspace X" +proof - + have "(UNIV::real set) \ (UNIV::nat set set)" + using eqpoll_imp_lepoll eqpoll_sym nat_sets_eqpoll_reals by blast + also have "\ \ topspace X" + proof - + obtain z where z: "z \ topspace X" + using assms by blast + then obtain U K where "openin X U" "compactin X K" "U \ {}" "U \ K" + by (metis emptyE lcX locally_compact_space_def) + then have "closedin X K" + by (simp add: compactin_imp_closedin hsX) + have intK_ne: "X interior_of K \ {}" + using \U \ {}\ \U \ K\ \openin X U\ interior_of_eq_empty by blast + have "\D E. closedin X D \ D \ K \ X interior_of D \ {} \ + closedin X E \ E \ K \ X interior_of E \ {} \ + disjnt D E \ D \ C \ E \ C" + if "closedin X C" "C \ K" and C: "X interior_of C \ {}" for C + proof - + obtain z where z: "z \ X interior_of C" "z \ topspace X" + using C interior_of_subset_topspace by fastforce + obtain x y where "x \ X interior_of C" "y \ X interior_of C" "x\y" + by (metis z eq in_derived_set_of openin_interior_of) + then have "x \ topspace X" "y \ topspace X" + using interior_of_subset_topspace by force+ + with hsX obtain V W where "openin X V" "openin X W" "x \ V" "y \ W" "disjnt V W" + by (metis Hausdorff_space_def \x \ y\) + have *: "\W x. openin X W \ x \ W + \ \U V. openin X U \ closedin X V \ x \ U \ U \ V \ V \ W" + using lcX hsX locally_compact_Hausdorff_imp_regular_space neighbourhood_base_of_closedin neighbourhood_base_of + by metis + obtain M D where MD: "openin X M" "closedin X D" "y \ M" "M \ D" "D \ X interior_of C \ W" + using * [of "X interior_of C \ W" y] + using \openin X W\ \y \ W\ \y \ X interior_of C\ by fastforce + obtain N E where NE: "openin X N" "closedin X E" "x \ N" "N \ E" "E \ X interior_of C \ V" + using * [of "X interior_of C \ V" x] + using \openin X V\ \x \ V\ \x \ X interior_of C\ by fastforce + show ?thesis + proof (intro exI conjI) + show "X interior_of D \ {}" "X interior_of E \ {}" + using MD NE by (fastforce simp: interior_of_def)+ + show "disjnt D E" + by (meson MD(5) NE(5) \disjnt V W\ disjnt_subset1 disjnt_sym le_inf_iff) + qed (use MD NE \C \ K\ interior_of_subset in force)+ + qed + then obtain L R where + LR: "\C. \closedin X C; C \ K; X interior_of C \ {}\ + \ closedin X (L C) \ (L C) \ K \ X interior_of (L C) \ {} \ + closedin X (R C) \ (R C) \ K \ X interior_of (R C) \ {}" + and disjLR: "\C. \closedin X C; C \ K; X interior_of C \ {}\ + \ disjnt (L C) (R C) \ (L C) \ C \ (R C) \ C" + by metis + define d where "d \ \B. rec_nat K (\n. if n \ B then R else L)" + have d0[simp]: "d B 0 = K" for B + by (simp add: d_def) + have [simp]: "d B (Suc n) = (if n \ B then R else L) (d B n)" for B n + by (simp add: d_def) + have d_correct: "closedin X (d B n) \ d B n \ K \ X interior_of (d B n) \ {}" for B n + proof (induction n) + case 0 + then show ?case by (auto simp: \closedin X K\ intK_ne) + next + case (Suc n) with LR show ?case by auto + qed + have "(\n. d B n) \ {}" for B + proof (rule compact_space_imp_nest) + show "compact_space (subtopology X K)" + by (simp add: \compactin X K\ compact_space_subtopology) + show "closedin (subtopology X K) (d B n)" for n :: nat + by (simp add: closedin_subset_topspace d_correct) + show "d B n \ {}" for n :: nat + by (metis d_correct interior_of_empty) + show "antimono (d B)" + proof (rule antimonoI [OF transitive_stepwise_le]) + fix n + show "d B (Suc n) \ d B n" + by (simp add: d_correct disjLR) + qed auto + qed + then obtain x where x: "\B. x B \ (\n. d B n)" + unfolding set_eq_iff by (metis empty_iff) + show ?thesis + unfolding lepoll_def + proof (intro exI conjI) + show "inj x" + proof (rule inj_onCI) + fix B C + assume eq: "x B = x C" and "B\C" + then have ne: "sym_diff B C \ {}" + by blast + define n where "n \ LEAST k. k \ (sym_diff B C)" + with ne have n: "n \ sym_diff B C" + by (metis Inf_nat_def1 LeastI) + then have non: "n \ B \ n \ C" + by blast + have "k \ B \ k \ C" if "km. m < p \ (m \ B \ m \ C)) \ d B p = d C p" for p + by (induction p) auto + ultimately have "d B n = d C n" + by blast + then have "disjnt (d B (Suc n)) (d C (Suc n))" + by (simp add: d_correct disjLR disjnt_sym non) + then show False + by (metis InterE disjnt_iff eq rangeI x) + qed + show "range x \ topspace X" + using x d0 \compactin X K\ compactin_subset_topspace d_correct by fastforce + qed + qed + finally show ?thesis . +qed + +lemma lepoll_perfect_set: + assumes X: "completely_metrizable_space X \ locally_compact_space X \ Hausdorff_space X" + and S: "X derived_set_of S = S" "S \ {}" + shows "(UNIV::real set) \ S" + using X +proof + assume "completely_metrizable_space X" + with assms show "(UNIV::real set) \ S" + by (metis Metric_space.lepoll_perfect_set completely_metrizable_space_def) +next + assume "locally_compact_space X \ Hausdorff_space X" + then show "(UNIV::real set) \ S" + using lepoll_perfect_set_aux [of "subtopology X S"] + by (metis Hausdorff_space_subtopology S closedin_derived_set_of closedin_subset derived_set_of_subtopology + locally_compact_space_closed_subset subtopology_topspace topspace_subtopology topspace_subtopology_subset) +qed + + + + +lemma Kuratowski_aux1: + assumes "\S T. R S T \ R T S" + shows "(\S T n. R S T \ (f S \ {.. f T \ {.. + (\n S T. R S T \ {.. f S \ {.. f T)" + (is "?lhs = ?rhs") +proof + assume ?lhs then show ?rhs + by (meson eqpoll_iff_finite_card eqpoll_sym finite_lepoll_infinite finite_lessThan lepoll_trans2) +next + assume ?rhs then show ?lhs + by (smt (verit, best) lepoll_iff_finite_card assms eqpoll_iff_finite_card finite_lepoll_infinite + finite_lessThan le_Suc_eq lepoll_antisym lepoll_iff_card_le not_less_eq_eq) +qed + +lemma Kuratowski_aux2: + "pairwise (separatedin (subtopology X (topspace X - S))) \ \ {} \ \ \ + \\ = topspace(subtopology X (topspace X - S)) \ + pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - S" + by (auto simp: pairwise_def separatedin_subtopology) + +proposition Kuratowski_component_number_invariance_aux: + assumes "compact_space X" and HsX: "Hausdorff_space X" + and lcX: "locally_connected_space X" and hnX: "hereditarily normal_space X" + and hom: "(subtopology X S) homeomorphic_space (subtopology X T)" + and leXS: "{.. connected_components_of (subtopology X (topspace X - S))" + assumes \
: "\S T. + \closedin X S; closedin X T; (subtopology X S) homeomorphic_space (subtopology X T); + {.. connected_components_of (subtopology X (topspace X - S))\ + \ {.. connected_components_of (subtopology X (topspace X - T))" + shows "{.. connected_components_of (subtopology X (topspace X - T))" +proof (cases "n=0") + case False + obtain f g where homf: "homeomorphic_map (subtopology X S) (subtopology X T) f" + and homg: "homeomorphic_map (subtopology X T) (subtopology X S) g" + and gf: "\x. x \ topspace (subtopology X S) \ g(f x) = x" + and fg: "\y. y \ topspace (subtopology X T) \ f(g y) = y" + and f: "f \ topspace (subtopology X S) \ topspace (subtopology X T)" + and g: "g \ topspace (subtopology X T) \ topspace (subtopology X S)" + using homeomorphic_space_unfold hom by metis + obtain C where "closedin X C" "C \ S" + and C: "\D. \closedin X D; C \ D; D \ S\ + \ \\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \\ = topspace X - D" + using separation_by_closed_intermediates_eq_count [of X n S] assms + by (smt (verit, ccfv_threshold) False Kuratowski_aux2 lepoll_connected_components_alt) + have "\C. closedin X C \ C \ T \ + (\D. closedin X D \ C \ D \ D \ T + \ (\\. \ \ {.. pairwise (separatedin X) \ \ + {} \ \ \ \\ = topspace X - D))" + proof (intro exI, intro conjI strip) + have "compactin X (f ` C)" + by (meson \C \ S\ \closedin X C\ assms(1) closedin_compact_space compactin_subtopology homeomorphic_map_compactness_eq homf) + then show "closedin X (f ` C)" + using \Hausdorff_space X\ compactin_imp_closedin by blast + show "f ` C \ T" + by (meson \C \ S\ \closedin X C\ closedin_imp_subset closedin_subset_topspace homeomorphic_map_closedness_eq homf) + fix D' + assume D': "closedin X D' \ f ` C \ D' \ D' \ T" + define D where "D \ g ` D'" + have "compactin X D" + unfolding D_def + by (meson D' \compact_space X\ closedin_compact_space compactin_subtopology homeomorphic_map_compactness_eq homg) + then have "closedin X D" + by (simp add: assms(2) compactin_imp_closedin) + moreover have "C \ D" + using D' D_def \C \ S\ \closedin X C\ closedin_subset gf image_iff by fastforce + moreover have "D \ S" + by (metis D' D_def assms(1) closedin_compact_space compactin_subtopology homeomorphic_map_compactness_eq homg) + ultimately obtain \ where "\ \ {.." "{} \ \" "\\ = topspace X - D" + using C by meson + moreover have "(subtopology X D) homeomorphic_space (subtopology X D')" + unfolding homeomorphic_space_def + proof (intro exI) + have "subtopology X D = subtopology (subtopology X S) D" + by (simp add: \D \ S\ inf.absorb2 subtopology_subtopology) + moreover have "subtopology X D' = subtopology (subtopology X T) D'" + by (simp add: D' inf.absorb2 subtopology_subtopology) + moreover have "homeomorphic_maps (subtopology X T) (subtopology X S) g f" + by (simp add: fg gf homeomorphic_maps_map homf homg) + ultimately + have "homeomorphic_maps (subtopology X D') (subtopology X D) g f" + by (metis D' D_def \closedin X D\ closedin_subset homeomorphic_maps_subtopologies topspace_subtopology Int_absorb1) + then show "homeomorphic_maps (subtopology X D) (subtopology X D') f g" + using homeomorphic_maps_sym by blast + qed + ultimately show "\\. \ \ {.. pairwise (separatedin X) \ \ {} \ \ \ \ \ = topspace X - D'" + by (smt (verit, ccfv_SIG) \
D' False \closedin X D\ Kuratowski_aux2 lepoll_connected_components_alt) + qed + then have "\\. \ \ {.. + pairwise (separatedin (subtopology X (topspace X - T))) \ \ {} \ \ \ \\ = topspace X - T" + using separation_by_closed_intermediates_eq_count [of X n T] Kuratowski_aux2 lcX hnX by auto + with False show ?thesis + using lepoll_connected_components_alt by fastforce +qed auto + + +theorem Kuratowski_component_number_invariance: + assumes "compact_space X" "Hausdorff_space X" "locally_connected_space X" "hereditarily normal_space X" + shows "((\S T n. + closedin X S \ closedin X T \ + (subtopology X S) homeomorphic_space (subtopology X T) + \ (connected_components_of + (subtopology X (topspace X - S)) \ {.. + connected_components_of + (subtopology X (topspace X - T)) \ {.. + (\S T n. + (subtopology X S) homeomorphic_space (subtopology X T) + \ (connected_components_of + (subtopology X (topspace X - S)) \ {.. + connected_components_of + (subtopology X (topspace X - T)) \ {.. 'b set \ bool" (infixl \\\ 50) where "A \ B == A \ B \ ~(A \ B)" +lemma lepoll_def': "lepoll A B \ \f. inj_on f A \ f \ A \ B" + by (simp add: Pi_iff image_subset_iff lepoll_def) + +lemma eqpoll_empty_iff_empty [simp]: "A \ {} \ A={}" + by (simp add: bij_betw_iff_bijections eqpoll_def) + lemma lepoll_empty_iff_empty [simp]: "A \ {} \ A = {}" by (auto simp: lepoll_def) +lemma not_lesspoll_empty: "\ A \ {}" + by (simp add: lesspoll_def) + (*The HOL Light CARD_LE_RELATIONAL_FULL*) lemma lepoll_relational_full: assumes "\y. y \ B \ \x. x \ A \ R x y" @@ -46,16 +55,36 @@ shows "A \ B \ card A = card B" using assms by (auto simp: bij_betw_iff_card eqpoll_def) +lemma eqpoll_singleton_iff: "A \ {x} \ (\u. A = {u})" + by (metis card.infinite card_1_singleton_iff eqpoll_finite_iff eqpoll_iff_card not_less_eq_eq) + +lemma eqpoll_doubleton_iff: "A \ {x,y} \ (\u v. A = {u,v} \ (u=v \ x=y))" +proof (cases "x=y") + case True + then show ?thesis + by (simp add: eqpoll_singleton_iff) +next + case False + then show ?thesis + by (smt (verit, ccfv_threshold) card_1_singleton_iff card_Suc_eq_finite eqpoll_finite_iff + eqpoll_iff_card finite.insertI singleton_iff) +qed + lemma lepoll_antisym: assumes "A \ B" "B \ A" shows "A \ B" using assms unfolding eqpoll_def lepoll_def by (metis Schroeder_Bernstein) -lemma lepoll_trans [trans]: "\A \ B; B \ C\ \ A \ C" - apply (clarsimp simp: lepoll_def) - apply (rename_tac f g) - apply (rule_tac x="g \ f" in exI) - apply (auto simp: image_subset_iff inj_on_def) - done +lemma lepoll_trans [trans]: + assumes "A \ B" " B \ C" shows "A \ C" +proof - + obtain f g where fg: "inj_on f A" "inj_on g B" and "f : A \ B" "g \ B \ C" + by (metis assms lepoll_def') + then have "g \ f \ A \ C" + by auto + with fg show ?thesis + unfolding lepoll_def + by (metis \f \ A \ B\ comp_inj_on image_subset_iff_funcset inj_on_subset) +qed lemma lepoll_trans1 [trans]: "\A \ B; B \ C\ \ A \ C" by (meson card_of_ordLeq eqpoll_iff_card_of_ordIso lepoll_def lepoll_trans ordIso_iff_ordLeq) @@ -716,8 +745,7 @@ corollary finite_funcset_iff: "finite(I \\<^sub>E S) \ (\a. S \ {a}) \ I = {} \ finite I \ finite S" - apply (auto simp: finite_PiE_iff PiE_eq_empty_iff dest: not_finite_existsD) - using finite.simps by auto + by (fastforce simp: finite_PiE_iff PiE_eq_empty_iff dest: subset_singletonD) lemma lists_lepoll_mono: assumes "A \ B" shows "lists A \ lists B" diff -r b86be4a9f532 -r 7729a1ad6b58 src/HOL/Transcendental.thy --- a/src/HOL/Transcendental.thy Mon Jul 10 22:06:31 2023 +0200 +++ b/src/HOL/Transcendental.thy Mon Jul 10 22:06:42 2023 +0200 @@ -2716,9 +2716,6 @@ lemma floor_log_eq_powr_iff: "x > 0 \ b > 1 \ \log b x\ = k \ b powr k \ x \ x < b powr (k + 1)" by (auto simp: floor_eq_iff powr_le_iff less_powr_iff) -lemma power_of_nat_log_ge: "b > 1 \ b ^ nat \log b x\ \ x" - by (smt (verit) less_log_of_power of_nat_ceiling) - lemma floor_log_nat_eq_powr_iff: fixes b n k :: nat shows "\ b \ 2; k > 0 \ \ floor (log b (real k)) = n \ b^n \ k \ k < b^(n+1)" @@ -2806,6 +2803,19 @@ shows "x powr i = (if i \ 0 then x ^ nat i else 1 / x ^ nat (-i))" by (simp add: assms inverse_eq_divide powr_real_of_int) +lemma power_of_nat_log_ge: "b > 1 \ b ^ nat \log b x\ \ x" + by (smt (verit) less_log_of_power of_nat_ceiling) + +lemma power_of_nat_log_le: + assumes "b > 1" "x\1" + shows "b ^ nat \log b x\ \ x" +proof - + have "\log b x\ \ 0" + using assms by auto + then show ?thesis + by (smt (verit) assms le_log_iff of_int_floor_le powr_int) +qed + definition powr_real :: "real \ real \ real" where [code_abbrev, simp]: "powr_real = Transcendental.powr"