diff -r d0f12783cd80 -r 04678058308f src/HOL/Analysis/Further_Topology.thy --- a/src/HOL/Analysis/Further_Topology.thy Sun Oct 29 19:39:03 2017 +0100 +++ b/src/HOL/Analysis/Further_Topology.thy Mon Oct 30 16:02:59 2017 +0000 @@ -4589,4 +4589,788 @@ using fk gfh kTS by force qed + +text\If two points are separated by a closed set, there's a minimal one.\ +proposition closed_irreducible_separator: + fixes a :: "'a::real_normed_vector" + assumes "closed S" and ab: "\ connected_component (- S) a b" + obtains T where "T \ S" "closed T" "T \ {}" "\ connected_component (- T) a b" + "\U. U \ T \ connected_component (- U) a b" +proof (cases "a \ S \ b \ S") + case True + then show ?thesis + proof + assume *: "a \ S" + show ?thesis + proof + show "{a} \ S" + using * by blast + show "\ connected_component (- {a}) a b" + using connected_component_in by auto + show "\U. U \ {a} \ connected_component (- U) a b" + by (metis connected_component_UNIV UNIV_I compl_bot_eq connected_component_eq_eq less_le_not_le subset_singletonD) + qed auto + next + assume *: "b \ S" + show ?thesis + proof + show "{b} \ S" + using * by blast + show "\ connected_component (- {b}) a b" + using connected_component_in by auto + show "\U. U \ {b} \ connected_component (- U) a b" + by (metis connected_component_UNIV UNIV_I compl_bot_eq connected_component_eq_eq less_le_not_le subset_singletonD) + qed auto + qed +next + case False + define A where "A \ connected_component_set (- S) a" + define B where "B \ connected_component_set (- (closure A)) b" + have "a \ A" + using False A_def by auto + have "b \ B" + unfolding A_def B_def closure_Un_frontier + using ab False \closed S\ frontier_complement frontier_of_connected_component_subset frontier_subset_closed by force + have "frontier B \ frontier (connected_component_set (- closure A) b)" + using B_def by blast + also have frsub: "... \ frontier A" + proof - + have "\A. closure (- closure (- A)) \ closure A" + by (metis (no_types) closure_mono closure_subset compl_le_compl_iff double_compl) + then show ?thesis + by (metis (no_types) closure_closure double_compl frontier_closures frontier_of_connected_component_subset le_inf_iff subset_trans) + qed + finally have frBA: "frontier B \ frontier A" . + show ?thesis + proof + show "frontier B \ S" + proof - + have "frontier S \ S" + by (simp add: \closed S\ frontier_subset_closed) + then show ?thesis + using frsub frontier_complement frontier_of_connected_component_subset + unfolding A_def B_def by blast + qed + show "closed (frontier B)" + by simp + show "\ connected_component (- frontier B) a b" + unfolding connected_component_def + proof clarify + fix T + assume "connected T" and TB: "T \ - frontier B" and "a \ T" and "b \ T" + have "a \ B" + by (metis A_def B_def ComplD \a \ A\ assms(1) closed_open connected_component_subset in_closure_connected_component set_mp) + have "T \ B \ {}" + using \b \ B\ \b \ T\ by blast + moreover have "T - B \ {}" + using \a \ B\ \a \ T\ by blast + ultimately show "False" + using connected_Int_frontier [of T B] TB \connected T\ by blast + qed + moreover have "connected_component (- frontier B) a b" if "frontier B = {}" + apply (simp add: that) + using connected_component_eq_UNIV by blast + ultimately show "frontier B \ {}" + by blast + show "connected_component (- U) a b" if "U \ frontier B" for U + proof - + obtain p where Usub: "U \ frontier B" and p: "p \ frontier B" "p \ U" + using \U \ frontier B\ by blast + show ?thesis + unfolding connected_component_def + proof (intro exI conjI) + have "connected ((insert p A) \ (insert p B))" + proof (rule connected_Un) + show "connected (insert p A)" + by (metis A_def IntD1 frBA \p \ frontier B\ closure_insert closure_subset connected_connected_component connected_intermediate_closure frontier_closures insert_absorb subsetCE subset_insertI) + show "connected (insert p B)" + by (metis B_def IntD1 \p \ frontier B\ closure_insert closure_subset connected_connected_component connected_intermediate_closure frontier_closures insert_absorb subset_insertI) + qed blast + then show "connected (insert p (B \ A))" + by (simp add: sup.commute) + have "A \ - U" + using A_def Usub \frontier B \ S\ connected_component_subset by fastforce + moreover have "B \ - U" + using B_def Usub connected_component_subset frBA frontier_closures by fastforce + ultimately show "insert p (B \ A) \ - U" + using p by auto + qed (auto simp: \a \ A\ \b \ B\) + qed + qed +qed + +lemma frontier_minimal_separating_closed_pointwise: + fixes S :: "'a::real_normed_vector set" + assumes S: "closed S" "a \ S" and nconn: "\ connected_component (- S) a b" + and conn: "\T. \closed T; T \ S\ \ connected_component (- T) a b" + shows "frontier(connected_component_set (- S) a) = S" (is "?F = S") +proof - + have "?F \ S" + by (simp add: S componentsI frontier_of_components_closed_complement) + moreover have False if "?F \ S" + proof - + have "connected_component (- ?F) a b" + by (simp add: conn that) + then obtain T where "connected T" "T \ -?F" "a \ T" "b \ T" + by (auto simp: connected_component_def) + moreover have "T \ ?F \ {}" + proof (rule connected_Int_frontier [OF \connected T\]) + show "T \ connected_component_set (- S) a \ {}" + using \a \ S\ \a \ T\ by fastforce + show "T - connected_component_set (- S) a \ {}" + using \b \ T\ nconn by blast + qed + ultimately show ?thesis + by blast + qed + ultimately show ?thesis + by blast +qed + + +subsection\Unicoherence (closed)\ + +definition unicoherent where + "unicoherent U \ + \S T. connected S \ connected T \ S \ T = U \ + closedin (subtopology euclidean U) S \ closedin (subtopology euclidean U) T + \ connected (S \ T)" + +lemma unicoherentI [intro?]: + assumes "\S T. \connected S; connected T; U = S \ T; closedin (subtopology euclidean U) S; closedin (subtopology euclidean U) T\ + \ connected (S \ T)" + shows "unicoherent U" + using assms unfolding unicoherent_def by blast + +lemma unicoherentD: + assumes "unicoherent U" "connected S" "connected T" "U = S \ T" "closedin (subtopology euclidean U) S" "closedin (subtopology euclidean U) T" + shows "connected (S \ T)" + using assms unfolding unicoherent_def by blast + +lemma homeomorphic_unicoherent: + assumes ST: "S homeomorphic T" and S: "unicoherent S" + shows "unicoherent T" +proof - + obtain f g where gf: "\x. x \ S \ g (f x) = x" and fim: "T = f ` S" and gfim: "g ` f ` S = S" + and contf: "continuous_on S f" and contg: "continuous_on (f ` S) g" + using ST by (auto simp: homeomorphic_def homeomorphism_def) + show ?thesis + proof + fix U V + assume "connected U" "connected V" and T: "T = U \ V" + and cloU: "closedin (subtopology euclidean T) U" + and cloV: "closedin (subtopology euclidean T) V" + have "f ` (g ` U \ g ` V) \ U" "f ` (g ` U \ g ` V) \ V" + using gf fim T by auto (metis UnCI image_iff)+ + moreover have "U \ V \ f ` (g ` U \ g ` V)" + using gf fim by (force simp: image_iff T) + ultimately have "U \ V = f ` (g ` U \ g ` V)" by blast + moreover have "connected (f ` (g ` U \ g ` V))" + proof (rule connected_continuous_image) + show "continuous_on (g ` U \ g ` V) f" + apply (rule continuous_on_subset [OF contf]) + using T fim gfim by blast + show "connected (g ` U \ g ` V)" + proof (intro conjI unicoherentD [OF S]) + show "connected (g ` U)" "connected (g ` V)" + using \connected U\ cloU \connected V\ cloV + by (metis Topological_Spaces.connected_continuous_image closedin_imp_subset contg continuous_on_subset fim)+ + show "S = g ` U \ g ` V" + using T fim gfim by auto + have hom: "homeomorphism T S g f" + by (simp add: contf contg fim gf gfim homeomorphism_def) + have "closedin (subtopology euclidean T) U" "closedin (subtopology euclidean T) V" + by (simp_all add: cloU cloV) + then show "closedin (subtopology euclidean S) (g ` U)" + "closedin (subtopology euclidean S) (g ` V)" + by (blast intro: homeomorphism_imp_closed_map [OF hom])+ + qed + qed + ultimately show "connected (U \ V)" by metis + qed +qed + + +lemma homeomorphic_unicoherent_eq: + "S homeomorphic T \ (unicoherent S \ unicoherent T)" + by (meson homeomorphic_sym homeomorphic_unicoherent) + +lemma unicoherent_translation: + fixes S :: "'a::real_normed_vector set" + shows + "unicoherent (image (\x. a + x) S) \ unicoherent S" + using homeomorphic_translation homeomorphic_unicoherent_eq by blast + +lemma unicoherent_injective_linear_image: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "linear f" "inj f" + shows "(unicoherent(f ` S) \ unicoherent S)" + using assms homeomorphic_unicoherent_eq linear_homeomorphic_image by blast + + +lemma Borsukian_imp_unicoherent: + fixes U :: "'a::euclidean_space set" + assumes "Borsukian U" shows "unicoherent U" + unfolding unicoherent_def +proof clarify + fix S T + assume "connected S" "connected T" "U = S \ T" + and cloS: "closedin (subtopology euclidean (S \ T)) S" + and cloT: "closedin (subtopology euclidean (S \ T)) T" + show "connected (S \ T)" + unfolding connected_closedin_eq + proof clarify + fix V W + assume "closedin (subtopology euclidean (S \ T)) V" + and "closedin (subtopology euclidean (S \ T)) W" + and VW: "V \ W = S \ T" "V \ W = {}" and "V \ {}" "W \ {}" + then have cloV: "closedin (subtopology euclidean U) V" and cloW: "closedin (subtopology euclidean U) W" + using \U = S \ T\ cloS cloT closedin_trans by blast+ + obtain q where contq: "continuous_on U q" + and q01: "\x. x \ U \ q x \ {0..1::real}" + and qV: "\x. x \ V \ q x = 0" and qW: "\x. x \ W \ q x = 1" + by (rule Urysohn_local [OF cloV cloW \V \ W = {}\, of 0 1]) + (fastforce simp: closed_segment_eq_real_ivl) + let ?h = "\x. if x \ S then exp(pi * \ * q x) else 1 / exp(pi * \ * q x)" + have eqST: "exp(pi * \ * q x) = 1 / exp(pi * \ * q x)" if "x \ S \ T" for x + proof - + have "x \ V \ W" + using that \V \ W = S \ T\ by blast + with qV qW show ?thesis by force + qed + obtain g where contg: "continuous_on U g" + and circle: "g ` U \ sphere 0 1" + and S: "\x. x \ S \ g x = exp(pi * \ * q x)" + and T: "\x. x \ T \ g x = 1 / exp(pi * \ * q x)" + proof + show "continuous_on U ?h" + unfolding \U = S \ T\ + proof (rule continuous_on_cases_local [OF cloS cloT]) + show "continuous_on S (\x. exp (pi * \ * q x))" + apply (intro continuous_intros) + using \U = S \ T\ continuous_on_subset contq by blast + show "continuous_on T (\x. 1 / exp (pi * \ * q x))" + apply (intro continuous_intros) + using \U = S \ T\ continuous_on_subset contq by auto + qed (use eqST in auto) + qed (use eqST in \auto simp: norm_divide\) + then obtain h where conth: "continuous_on U h" and heq: "\x. x \ U \ g x = exp (h x)" + by (metis Borsukian_continuous_logarithm_circle assms) + obtain v w where "v \ V" "w \ W" + using \V \ {}\ \W \ {}\ by blast + then have vw: "v \ S \ T" "w \ S \ T" + using VW by auto + have iff: "2 * pi \ cmod (2 * of_int m * of_real pi * \ - 2 * of_int n * of_real pi * \) + \ 1 \ abs (m - n)" for m n + proof - + have "2 * pi \ cmod (2 * of_int m * of_real pi * \ - 2 * of_int n * of_real pi * \) + \ 2 * pi \ cmod ((2 * pi * \) * (of_int m - of_int n))" + by (simp add: algebra_simps) + also have "... \ 2 * pi \ 2 * pi * cmod (of_int m - of_int n)" + by (simp add: norm_mult) + also have "... \ 1 \ abs (m - n)" + by simp (metis norm_of_int of_int_1_le_iff of_int_abs of_int_diff) + finally show ?thesis . + qed + have *: "\n::int. h x - (pi * \ * q x) = (of_int(2*n) * pi) * \" if "x \ S" for x + using that S \U = S \ T\ heq exp_eq [symmetric] by (simp add: algebra_simps) + moreover have "(\x. h x - (pi * \ * q x)) constant_on S" + proof (rule continuous_discrete_range_constant [OF \connected S\]) + have "continuous_on S h" "continuous_on S q" + using \U = S \ T\ continuous_on_subset conth contq by blast+ + then show "continuous_on S (\x. h x - (pi * \ * q x))" + by (intro continuous_intros) + have "2*pi \ cmod (h y - (pi * \ * q y) - (h x - (pi * \ * q x)))" + if "x \ S" "y \ S" and ne: "h y - (pi * \ * q y) \ h x - (pi * \ * q x)" for x y + using * [OF \x \ S\] * [OF \y \ S\] ne by (auto simp: iff) + then show "\x. x \ S \ + \e>0. \y. y \ S \ h y - (pi * \ * q y) \ h x - (pi * \ * q x) \ + e \ cmod (h y - (pi * \ * q y) - (h x - (pi * \ * q x)))" + by (rule_tac x="2*pi" in exI) auto + qed + ultimately + obtain m where m: "\x. x \ S \ h x - (pi * \ * q x) = (of_int(2*m) * pi) * \" + using vw by (force simp: constant_on_def) + have *: "\n::int. h x = - (pi * \ * q x) + (of_int(2*n) * pi) * \" if "x \ T" for x + unfolding exp_eq [symmetric] + using that T \U = S \ T\ by (simp add: exp_minus field_simps heq [symmetric]) + moreover have "(\x. h x + (pi * \ * q x)) constant_on T" + proof (rule continuous_discrete_range_constant [OF \connected T\]) + have "continuous_on T h" "continuous_on T q" + using \U = S \ T\ continuous_on_subset conth contq by blast+ + then show "continuous_on T (\x. h x + (pi * \ * q x))" + by (intro continuous_intros) + have "2*pi \ cmod (h y + (pi * \ * q y) - (h x + (pi * \ * q x)))" + if "x \ T" "y \ T" and ne: "h y + (pi * \ * q y) \ h x + (pi * \ * q x)" for x y + using * [OF \x \ T\] * [OF \y \ T\] ne by (auto simp: iff) + then show "\x. x \ T \ + \e>0. \y. y \ T \ h y + (pi * \ * q y) \ h x + (pi * \ * q x) \ + e \ cmod (h y + (pi * \ * q y) - (h x + (pi * \ * q x)))" + by (rule_tac x="2*pi" in exI) auto + qed + ultimately + obtain n where n: "\x. x \ T \ h x + (pi * \ * q x) = (of_int(2*n) * pi) * \" + using vw by (force simp: constant_on_def) + show "False" + using m [of v] m [of w] n [of v] n [of w] vw + by (auto simp: algebra_simps \v \ V\ \w \ W\ qV qW) + qed +qed + + +corollary contractible_imp_unicoherent: + fixes U :: "'a::euclidean_space set" + assumes "contractible U" shows "unicoherent U" + by (simp add: Borsukian_imp_unicoherent assms contractible_imp_Borsukian) + +corollary convex_imp_unicoherent: + fixes U :: "'a::euclidean_space set" + assumes "convex U" shows "unicoherent U" + by (simp add: Borsukian_imp_unicoherent assms convex_imp_Borsukian) + +text\If the type class constraint can be relaxed, I don't know how!\ +corollary unicoherent_UNIV: "unicoherent (UNIV :: 'a :: euclidean_space set)" + by (simp add: convex_imp_unicoherent) + + +lemma unicoherent_monotone_image_compact: + fixes T :: "'b :: t2_space set" + assumes S: "unicoherent S" "compact S" and contf: "continuous_on S f" and fim: "f ` S = T" + and conn: "\y. y \ T \ connected (S \ f -` {y})" + shows "unicoherent T" +proof + fix U V + assume UV: "connected U" "connected V" "T = U \ V" + and cloU: "closedin (subtopology euclidean T) U" + and cloV: "closedin (subtopology euclidean T) V" + moreover have "compact T" + using \compact S\ compact_continuous_image contf fim by blast + ultimately have "closed U" "closed V" + by (auto simp: closedin_closed_eq compact_imp_closed) + let ?SUV = "(S \ f -` U) \ (S \ f -` V)" + have UV_eq: "f ` ?SUV = U \ V" + using \T = U \ V\ fim by force+ + have "connected (f ` ?SUV)" + proof (rule connected_continuous_image) + show "continuous_on ?SUV f" + by (meson contf continuous_on_subset inf_le1) + show "connected ?SUV" + proof (rule unicoherentD [OF \unicoherent S\, of "S \ f -` U" "S \ f -` V"]) + have "\C. closedin (subtopology euclidean S) C \ closedin (subtopology euclidean T) (f ` C)" + by (metis \compact S\ closed_subset closedin_compact closedin_imp_subset compact_continuous_image compact_imp_closed contf continuous_on_subset fim image_mono) + then show "connected (S \ f -` U)" "connected (S \ f -` V)" + using UV by (auto simp: conn intro: connected_closed_monotone_preimage [OF contf fim]) + show "S = (S \ f -` U) \ (S \ f -` V)" + using UV fim by blast + show "closedin (subtopology euclidean S) (S \ f -` U)" + "closedin (subtopology euclidean S) (S \ f -` V)" + by (auto simp: continuous_on_imp_closedin cloU cloV contf fim) + qed + qed + with UV_eq show "connected (U \ V)" + by simp +qed + + + +subsection\Several common variants of unicoherence\ + +lemma connected_frontier_simple: + fixes S :: "'a :: euclidean_space set" + assumes "connected S" "connected(- S)" shows "connected(frontier S)" + unfolding frontier_closures + apply (rule unicoherentD [OF unicoherent_UNIV]) + apply (simp_all add: assms connected_imp_connected_closure) + by (simp add: closure_def) + +lemma connected_frontier_component_complement: + fixes S :: "'a :: euclidean_space set" + assumes "connected S" and C: "C \ components(- S)" shows "connected(frontier C)" + apply (rule connected_frontier_simple) + using C in_components_connected apply blast + by (metis Compl_eq_Diff_UNIV connected_UNIV assms top_greatest component_complement_connected) + +lemma connected_frontier_disjoint: + fixes S :: "'a :: euclidean_space set" + assumes "connected S" "connected T" "disjnt S T" and ST: "frontier S \ frontier T" + shows "connected(frontier S)" +proof (cases "S = UNIV") + case True then show ?thesis + by simp +next + case False + then have "-S \ {}" + by blast + then obtain C where C: "C \ components(- S)" and "T \ C" + by (metis ComplI disjnt_iff subsetI exists_component_superset \disjnt S T\ \connected T\) + moreover have "frontier S = frontier C" + proof - + have "frontier C \ frontier S" + using C frontier_complement frontier_of_components_subset by blast + moreover have "x \ frontier C" if "x \ frontier S" for x + proof - + have "x \ closure C" + using that unfolding frontier_def + by (metis (no_types) Diff_eq ST \T \ C\ closure_mono contra_subsetD frontier_def le_inf_iff that) + moreover have "x \ interior C" + using that unfolding frontier_def + by (metis C Compl_eq_Diff_UNIV Diff_iff subsetD in_components_subset interior_diff interior_mono) + ultimately show ?thesis + by (auto simp: frontier_def) + qed + ultimately show ?thesis + by blast + qed + ultimately show ?thesis + using \connected S\ connected_frontier_component_complement by auto +qed + +lemma separation_by_component_closed_pointwise: + fixes S :: "'a :: euclidean_space set" + assumes "closed S" "\ connected_component (- S) a b" + obtains C where "C \ components S" "\ connected_component(- C) a b" +proof (cases "a \ S \ b \ S") + case True + then show ?thesis + using connected_component_in componentsI that by fastforce +next + case False + obtain T where "T \ S" "closed T" "T \ {}" + and nab: "\ connected_component (- T) a b" + and conn: "\U. U \ T \ connected_component (- U) a b" + using closed_irreducible_separator [OF assms] by metis + moreover have "connected T" + proof - + have ab: "frontier(connected_component_set (- T) a) = T" "frontier(connected_component_set (- T) b) = T" + using frontier_minimal_separating_closed_pointwise + by (metis False \T \ S\ \closed T\ connected_component_sym conn connected_component_eq_empty connected_component_intermediate_subset empty_subsetI nab)+ + have "connected (frontier (connected_component_set (- T) a))" + proof (rule connected_frontier_disjoint) + show "disjnt (connected_component_set (- T) a) (connected_component_set (- T) b)" + unfolding disjnt_iff + by (metis connected_component_eq connected_component_eq_empty connected_component_idemp mem_Collect_eq nab) + show "frontier (connected_component_set (- T) a) \ frontier (connected_component_set (- T) b)" + by (simp add: ab) + qed auto + with ab \closed T\ show ?thesis + by simp + qed + ultimately obtain C where "C \ components S" "T \ C" + using exists_component_superset [of T S] by blast + then show ?thesis + by (meson Compl_anti_mono connected_component_of_subset nab that) +qed + + +lemma separation_by_component_closed: + fixes S :: "'a :: euclidean_space set" + assumes "closed S" "\ connected(- S)" + obtains C where "C \ components S" "\ connected(- C)" +proof - + obtain x y where "closed S" "x \ S" "y \ S" and "\ connected_component (- S) x y" + using assms by (auto simp: connected_iff_connected_component) + then obtain C where "C \ components S" "\ connected_component(- C) x y" + using separation_by_component_closed_pointwise by metis + then show "thesis" + apply (clarify elim!: componentsE) + by (metis Compl_iff \C \ components S\ \x \ S\ \y \ S\ connected_component_eq connected_component_eq_eq connected_iff_connected_component that) +qed + +lemma separation_by_Un_closed_pointwise: + fixes S :: "'a :: euclidean_space set" + assumes ST: "closed S" "closed T" "S \ T = {}" + and conS: "connected_component (- S) a b" and conT: "connected_component (- T) a b" + shows "connected_component (- (S \ T)) a b" +proof (rule ccontr) + have "a \ S" "b \ S" "a \ T" "b \ T" + using conS conT connected_component_in by auto + assume "\ connected_component (- (S \ T)) a b" + then obtain C where "C \ components (S \ T)" and C: "\ connected_component(- C) a b" + using separation_by_component_closed_pointwise assms by blast + then have "C \ S \ C \ T" + proof - + have "connected C" "C \ S \ T" + using \C \ components (S \ T)\ in_components_subset by (blast elim: componentsE)+ + moreover then have "C \ T = {} \ C \ S = {}" + by (metis Int_empty_right ST inf.commute connected_closed) + ultimately show ?thesis + by blast + qed + then show False + by (meson Compl_anti_mono C conS conT connected_component_of_subset) +qed + +lemma separation_by_Un_closed: + fixes S :: "'a :: euclidean_space set" + assumes ST: "closed S" "closed T" "S \ T = {}" and conS: "connected(- S)" and conT: "connected(- T)" + shows "connected(- (S \ T))" + using assms separation_by_Un_closed_pointwise + by (fastforce simp add: connected_iff_connected_component) + +lemma open_unicoherent_UNIV: + fixes S :: "'a :: euclidean_space set" + assumes "open S" "open T" "connected S" "connected T" "S \ T = UNIV" + shows "connected(S \ T)" +proof - + have "connected(- (-S \ -T))" + by (metis closed_Compl compl_sup compl_top_eq double_compl separation_by_Un_closed assms) + then show ?thesis + by simp +qed + +lemma separation_by_component_open_aux: + fixes S :: "'a :: euclidean_space set" + assumes ST: "closed S" "closed T" "S \ T = {}" + and "S \ {}" "T \ {}" + obtains C where "C \ components(-(S \ T))" "C \ {}" "frontier C \ S \ {}" "frontier C \ T \ {}" +proof (rule ccontr) + let ?S = "S \ \{C \ components(- (S \ T)). frontier C \ S}" + let ?T = "T \ \{C \ components(- (S \ T)). frontier C \ T}" + assume "~ thesis" + with that have *: "frontier C \ S = {} \ frontier C \ T = {}" + if C: "C \ components (- (S \ T))" "C \ {}" for C + using C by blast + have "\A B::'a set. closed A \ closed B \ UNIV \ A \ B \ A \ B = {} \ A \ {} \ B \ {}" + proof (intro exI conjI) + have "frontier (\{C \ components (- S \ - T). frontier C \ S}) \ S" + apply (rule subset_trans [OF frontier_Union_subset_closure]) + by (metis (no_types, lifting) SUP_least \closed S\ closure_minimal mem_Collect_eq) + then have "frontier ?S \ S" + by (simp add: frontier_subset_eq assms subset_trans [OF frontier_Un_subset]) + then show "closed ?S" + using frontier_subset_eq by fastforce + have "frontier (\{C \ components (- S \ - T). frontier C \ T}) \ T" + apply (rule subset_trans [OF frontier_Union_subset_closure]) + by (metis (no_types, lifting) SUP_least \closed T\ closure_minimal mem_Collect_eq) + then have "frontier ?T \ T" + by (simp add: frontier_subset_eq assms subset_trans [OF frontier_Un_subset]) + then show "closed ?T" + using frontier_subset_eq by fastforce + have "UNIV \ (S \ T) \ \(components(- (S \ T)))" + using Union_components by blast + also have "... \ ?S \ ?T" + proof - + have "C \ components (-(S \ T)) \ frontier C \ S \ + C \ components (-(S \ T)) \ frontier C \ T" + if "C \ components (- (S \ T))" "C \ {}" for C + using * [OF that] that + by clarify (metis (no_types, lifting) UnE \closed S\ \closed T\ closed_Un disjoint_iff_not_equal frontier_of_components_closed_complement subsetCE) + then show ?thesis + by blast + qed + finally show "UNIV \ ?S \ ?T" . + have "\{C \ components (- (S \ T)). frontier C \ S} \ + \{C \ components (- (S \ T)). frontier C \ T} \ - (S \ T)" + using in_components_subset by fastforce + moreover have "\{C \ components (- (S \ T)). frontier C \ S} \ + \{C \ components (- (S \ T)). frontier C \ T} = {}" + proof - + have "C \ C' = {}" if "C \ components (- (S \ T))" "frontier C \ S" + "C' \ components (- (S \ T))" "frontier C' \ T" for C C' + proof - + have NUN: "- S \ - T \ UNIV" + using \T \ {}\ by blast + have "C \ C'" + proof + assume "C = C'" + with that have "frontier C' \ S \ T" + by simp + also have "... = {}" + using \S \ T = {}\ by blast + finally have "C' = {} \ C' = UNIV" + using frontier_eq_empty by auto + then show False + using \C = C'\ NUN that by (force simp: dest: in_components_nonempty in_components_subset) + qed + with that show ?thesis + by (simp add: components_nonoverlap [of _ "-(S \ T)"]) + qed + then show ?thesis + by blast + qed + ultimately show "?S \ ?T = {}" + using ST by blast + show "?S \ {}" "?T \ {}" + using \S \ {}\ \T \ {}\ by blast+ + qed + then show False + by (metis Compl_disjoint Convex_Euclidean_Space.connected_UNIV compl_bot_eq compl_unique connected_closedD inf_sup_absorb sup_compl_top_left1 top.extremum_uniqueI) +qed + + +lemma separation_by_component_open: + fixes S :: "'a :: euclidean_space set" + assumes "open S" and non: "\ connected(- S)" + obtains C where "C \ components S" "\ connected(- C)" +proof - + obtain T U + where "closed T" "closed U" and TU: "T \ U = - S" "T \ U = {}" "T \ {}" "U \ {}" + using assms by (auto simp: connected_closed_set closed_def) + then obtain C where C: "C \ components(-(T \ U))" "C \ {}" + and "frontier C \ T \ {}" "frontier C \ U \ {}" + using separation_by_component_open_aux [OF \closed T\ \closed U\ \T \ U = {}\] by force + show "thesis" + proof + show "C \ components S" + using C(1) TU(1) by auto + show "\ connected (- C)" + proof + assume "connected (- C)" + then have "connected (frontier C)" + using connected_frontier_simple [of C] \C \ components S\ in_components_connected by blast + then show False + unfolding connected_closed + by (metis C(1) TU(2) \closed T\ \closed U\ \frontier C \ T \ {}\ \frontier C \ U \ {}\ closed_Un frontier_of_components_closed_complement inf_bot_right inf_commute) + qed + qed +qed + +lemma separation_by_Un_open: + fixes S :: "'a :: euclidean_space set" + assumes "open S" "open T" "S \ T = {}" and cS: "connected(-S)" and cT: "connected(-T)" + shows "connected(- (S \ T))" + using assms unicoherent_UNIV unfolding unicoherent_def by force + + +lemma nonseparation_by_component_eq: + fixes S :: "'a :: euclidean_space set" + assumes "open S \ closed S" + shows "((\C \ components S. connected(-C)) \ connected(- S))" (is "?lhs = ?rhs") +proof + assume ?lhs with assms show ?rhs + by (meson separation_by_component_closed separation_by_component_open) +next + assume ?rhs with assms show ?lhs + using component_complement_connected by force +qed + + +text\Another interesting equivalent of an inessential mapping into C-{0}\ +proposition inessential_eq_extensible: + fixes f :: "'a::euclidean_space \ complex" + assumes "closed S" + shows "(\a. homotopic_with (\h. True) S (-{0}) f (\t. a)) \ + (\g. continuous_on UNIV g \ (\x \ S. g x = f x) \ (\x. g x \ 0))" + (is "?lhs = ?rhs") +proof + assume ?lhs + then obtain a where a: "homotopic_with (\h. True) S (-{0}) f (\t. a)" .. + show ?rhs + proof (cases "S = {}") + case True + with a show ?thesis + using continuous_on_const by force + next + case False + have anr: "ANR (-{0::complex})" + by (simp add: ANR_delete open_Compl open_imp_ANR) + obtain g where contg: "continuous_on UNIV g" and gim: "g ` UNIV \ -{0}" + and gf: "\x. x \ S \ g x = f x" + proof (rule Borsuk_homotopy_extension_homotopic [OF _ _ continuous_on_const _ homotopic_with_symD [OF a]]) + show "closedin (subtopology euclidean UNIV) S" + using assms by auto + show "range (\t. a) \ - {0}" + using a homotopic_with_imp_subset2 False by blast + qed (use anr that in \force+\) + then show ?thesis + by force + qed +next + assume ?rhs + then obtain g where contg: "continuous_on UNIV g" + and gf: "\x. x \ S \ g x = f x" and non0: "\x. g x \ 0" + by metis + obtain h k::"'a\'a" where hk: "homeomorphism (ball 0 1) UNIV h k" + using homeomorphic_ball01_UNIV homeomorphic_def by blast + then have "continuous_on (ball 0 1) (g \ h)" + by (meson contg continuous_on_compose continuous_on_subset homeomorphism_cont1 top_greatest) + then obtain j where contj: "continuous_on (ball 0 1) j" + and j: "\z. z \ ball 0 1 \ exp(j z) = (g \ h) z" + by (metis (mono_tags, hide_lams) continuous_logarithm_on_ball comp_apply non0) + have [simp]: "\x. x \ S \ h (k x) = x" + using hk homeomorphism_apply2 by blast + have "\\. continuous_on S \\ (\x\S. f x = exp (\ x))" + proof (intro exI conjI ballI) + show "continuous_on S (j \ k)" + proof (rule continuous_on_compose) + show "continuous_on S k" + by (meson continuous_on_subset hk homeomorphism_cont2 top_greatest) + show "continuous_on (k ` S) j" + apply (rule continuous_on_subset [OF contj]) + using homeomorphism_image2 [OF hk] continuous_on_subset [OF contj] by blast + qed + show "f x = exp ((j \ k) x)" if "x \ S" for x + proof - + have "f x = (g \ h) (k x)" + by (simp add: gf that) + also have "... = exp (j (k x))" + by (metis rangeI homeomorphism_image2 [OF hk] j) + finally show ?thesis by simp + qed + qed + then show ?lhs + by (simp add: inessential_eq_continuous_logarithm) +qed + +lemma inessential_on_clopen_Union: + fixes \ :: "'a::euclidean_space set set" + assumes T: "path_connected T" + and "\S. S \ \ \ closedin (subtopology euclidean (\\)) S" + and "\S. S \ \ \ openin (subtopology euclidean (\\)) S" + and hom: "\S. S \ \ \ \a. homotopic_with (\x. True) S T f (\x. a)" + obtains a where "homotopic_with (\x. True) (\\) T f (\x. a)" +proof (cases "\\ = {}") + case True + with that show ?thesis + by force +next + case False + then obtain C where "C \ \" "C \ {}" + by blast + then obtain a where clo: "closedin (subtopology euclidean (\\)) C" + and ope: "openin (subtopology euclidean (\\)) C" + and "homotopic_with (\x. True) C T f (\x. a)" + using assms by blast + with \C \ {}\ have "f ` C \ T" "a \ T" + using homotopic_with_imp_subset1 homotopic_with_imp_subset2 by blast+ + have "homotopic_with (\x. True) (\\) T f (\x. a)" + proof (rule homotopic_on_clopen_Union) + show "\S. S \ \ \ closedin (subtopology euclidean (\\)) S" + "\S. S \ \ \ openin (subtopology euclidean (\\)) S" + by (simp_all add: assms) + show "homotopic_with (\x. True) S T f (\x. a)" if "S \ \" for S + proof (cases "S = {}") + case True + then show ?thesis + by auto + next + case False + then obtain b where "b \ S" + by blast + obtain c where c: "homotopic_with (\x. True) S T f (\x. c)" + using \S \ \\ hom by blast + then have "c \ T" + using \b \ S\ homotopic_with_imp_subset2 by blast + then have "homotopic_with (\x. True) S T (\x. a) (\x. c)" + using T \a \ T\ homotopic_constant_maps path_connected_component by blast + then show ?thesis + using c homotopic_with_symD homotopic_with_trans by blast + qed + qed + then show ?thesis .. +qed + +lemma Janiszewski_dual: + fixes S :: "complex set" + assumes + "compact S" "compact T" "connected S" "connected T" "connected(- (S \ T))" + shows "connected(S \ T)" +proof - + have ST: "compact (S \ T)" + by (simp add: assms compact_Un) + with Borsukian_imp_unicoherent [of "S \ T"] ST assms + show ?thesis + by (auto simp: closed_subset compact_imp_closed Borsukian_separation_compact unicoherent_def) +qed + end