# HG changeset patch # User paulson # Date 1509379379 0 # Node ID 04678058308f78f52d8a8994cf954327efc9c55b # Parent d0f12783cd80b3e63a5b1bc7e06b45e0ec0df6f5 New results in topology, mostly from HOL Light's moretop.ml diff -r d0f12783cd80 -r 04678058308f src/HOL/Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Analysis/Brouwer_Fixpoint.thy Sun Oct 29 19:39:03 2017 +0100 +++ b/src/HOL/Analysis/Brouwer_Fixpoint.thy Mon Oct 30 16:02:59 2017 +0000 @@ -4446,6 +4446,46 @@ by (simp add: ENR_imp_ANR ENR_sphere) +subsection\Spheres are connected, etc.\ + +lemma locally_path_connected_sphere_gen: + fixes S :: "'a::euclidean_space set" + assumes "bounded S" and "convex S" + shows "locally path_connected (rel_frontier S)" +proof (cases "rel_interior S = {}") + case True + with assms show ?thesis + by (simp add: rel_interior_eq_empty) +next + case False + then obtain a where a: "a \ rel_interior S" + by blast + show ?thesis + proof (rule retract_of_locally_path_connected) + show "locally path_connected (affine hull S - {a})" + by (meson convex_affine_hull convex_imp_locally_path_connected locally_open_subset openin_delete openin_subtopology_self) + show "rel_frontier S retract_of affine hull S - {a}" + using a assms rel_frontier_retract_of_punctured_affine_hull by blast + qed +qed + +lemma locally_connected_sphere_gen: + fixes S :: "'a::euclidean_space set" + assumes "bounded S" and "convex S" + shows "locally connected (rel_frontier S)" + by (simp add: ANR_imp_locally_connected ANR_rel_frontier_convex assms) + +lemma locally_path_connected_sphere: + fixes a :: "'a::euclidean_space" + shows "locally path_connected (sphere a r)" + using ENR_imp_locally_path_connected ENR_sphere by blast + +lemma locally_connected_sphere: + fixes a :: "'a::euclidean_space" + shows "locally connected(sphere a r)" + using ANR_imp_locally_connected ANR_sphere by blast + + subsection\Borsuk homotopy extension theorem\ text\It's only this late so we can use the concept of retraction, @@ -4794,6 +4834,386 @@ qed +subsection\More extension theorems\ + +lemma extension_from_clopen: + assumes ope: "openin (subtopology euclidean S) T" + and clo: "closedin (subtopology euclidean S) T" + and contf: "continuous_on T f" and fim: "f ` T \ U" and null: "U = {} \ S = {}" + obtains g where "continuous_on S g" "g ` S \ U" "\x. x \ T \ g x = f x" +proof (cases "U = {}") + case True + then show ?thesis + by (simp add: null that) +next + case False + then obtain a where "a \ U" + by auto + let ?g = "\x. if x \ T then f x else a" + have Seq: "S = T \ (S - T)" + using clo closedin_imp_subset by fastforce + show ?thesis + proof + have "continuous_on (T \ (S - T)) ?g" + apply (rule continuous_on_cases_local) + using Seq clo ope by (auto simp: contf continuous_on_const intro: continuous_on_cases_local) + with Seq show "continuous_on S ?g" + by metis + show "?g ` S \ U" + using \a \ U\ fim by auto + show "\x. x \ T \ ?g x = f x" + by auto + qed +qed + + +lemma extension_from_component: + fixes f :: "'a :: euclidean_space \ 'b :: euclidean_space" + assumes S: "locally connected S \ compact S" and "ANR U" + and C: "C \ components S" and contf: "continuous_on C f" and fim: "f ` C \ U" + obtains g where "continuous_on S g" "g ` S \ U" "\x. x \ C \ g x = f x" +proof - + obtain T g where ope: "openin (subtopology euclidean S) T" + and clo: "closedin (subtopology euclidean S) T" + and "C \ T" and contg: "continuous_on T g" and gim: "g ` T \ U" + and gf: "\x. x \ C \ g x = f x" + using S + proof + assume "locally connected S" + show ?thesis + by (metis C \locally connected S\ openin_components_locally_connected closedin_component contf fim order_refl that) + next + assume "compact S" + then obtain W g where "C \ W" and opeW: "openin (subtopology euclidean S) W" + and contg: "continuous_on W g" + and gim: "g ` W \ U" and gf: "\x. x \ C \ g x = f x" + using ANR_imp_absolute_neighbourhood_extensor [of U C f S] C \ANR U\ closedin_component contf fim by blast + then obtain V where "open V" and V: "W = S \ V" + by (auto simp: openin_open) + moreover have "locally compact S" + by (simp add: \compact S\ closed_imp_locally_compact compact_imp_closed) + ultimately obtain K where opeK: "openin (subtopology euclidean S) K" and "compact K" "C \ K" "K \ V" + by (metis C Int_subset_iff \C \ W\ \compact S\ compact_components Sura_Bura_clopen_subset) + show ?thesis + proof + show "closedin (subtopology euclidean S) K" + by (meson \compact K\ \compact S\ closedin_compact_eq opeK openin_imp_subset) + show "continuous_on K g" + by (metis Int_subset_iff V \K \ V\ contg continuous_on_subset opeK openin_subtopology subset_eq) + show "g ` K \ U" + using V \K \ V\ gim opeK openin_imp_subset by fastforce + qed (use opeK gf \C \ K\ in auto) + qed + obtain h where "continuous_on S h" "h ` S \ U" "\x. x \ T \ h x = g x" + using extension_from_clopen + by (metis C bot.extremum_uniqueI clo contg gim fim image_is_empty in_components_nonempty ope) + then show ?thesis + by (metis \C \ T\ gf subset_eq that) +qed + + +lemma tube_lemma: + fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" + assumes "compact S" and S: "S \ {}" "(\x. (x,a)) ` S \ U" + and ope: "openin (subtopology euclidean (S \ T)) U" + obtains V where "openin (subtopology euclidean T) V" "a \ V" "S \ V \ U" +proof - + let ?W = "{y. \x. x \ S \ (x, y) \ (S \ T - U)}" + have "U \ S \ T" "closedin (subtopology euclidean (S \ T)) (S \ T - U)" + using ope by (auto simp: openin_closedin_eq) + then have "closedin (subtopology euclidean T) ?W" + using \compact S\ closedin_compact_projection by blast + moreover have "a \ T - ?W" + using \U \ S \ T\ S by auto + moreover have "S \ (T - ?W) \ U" + by auto + ultimately show ?thesis + by (metis (no_types, lifting) Sigma_cong closedin_def that topspace_euclidean_subtopology) +qed + +lemma tube_lemma_gen: + fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set" + assumes "compact S" "S \ {}" "T \ T'" "S \ T \ U" + and ope: "openin (subtopology euclidean (S \ T')) U" + obtains V where "openin (subtopology euclidean T') V" "T \ V" "S \ V \ U" +proof - + have "\x. x \ T \ \V. openin (subtopology euclidean T') V \ x \ V \ S \ V \ U" + using assms by (auto intro: tube_lemma [OF \compact S\]) + then obtain F where F: "\x. x \ T \ openin (subtopology euclidean T') (F x) \ x \ F x \ S \ F x \ U" + by metis + show ?thesis + proof + show "openin (subtopology euclidean T') (UNION T F)" + using F by blast + show "T \ UNION T F" + using F by blast + show "S \ UNION T F \ U" + using F by auto + qed +qed + +proposition homotopic_neighbourhood_extension: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes contf: "continuous_on S f" and fim: "f ` S \ U" + and contg: "continuous_on S g" and gim: "g ` S \ U" + and clo: "closedin (subtopology euclidean S) T" + and "ANR U" and hom: "homotopic_with (\x. True) T U f g" + obtains V where "T \ V" "openin (subtopology euclidean S) V" + "homotopic_with (\x. True) V U f g" +proof - + have "T \ S" + using clo closedin_imp_subset by blast + obtain h where conth: "continuous_on ({0..1::real} \ T) h" + and him: "h ` ({0..1} \ T) \ U" + and h0: "\x. h(0, x) = f x" and h1: "\x. h(1, x) = g x" + using hom by (auto simp: homotopic_with_def) + define h' where "h' \ \z. if fst z \ {0} then f(snd z) + else if fst z \ {1} then g(snd z) + else h z" + let ?S0 = "{0::real} \ S" and ?S1 = "{1::real} \ S" + have "continuous_on(?S0 \ (?S1 \ {0..1} \ T)) h'" + unfolding h'_def + proof (intro continuous_on_cases_local) + show "closedin (subtopology euclidean (?S0 \ (?S1 \ {0..1} \ T))) ?S0" + "closedin (subtopology euclidean (?S1 \ {0..1} \ T)) ?S1" + using \T \ S\ by (force intro: closedin_Times closedin_subset_trans [of "{0..1} \ S"])+ + show "closedin (subtopology euclidean (?S0 \ (?S1 \ {0..1} \ T))) (?S1 \ {0..1} \ T)" + "closedin (subtopology euclidean (?S1 \ {0..1} \ T)) ({0..1} \ T)" + using \T \ S\ by (force intro: clo closedin_Times closedin_subset_trans [of "{0..1} \ S"])+ + show "continuous_on (?S0) (\x. f (snd x))" + by (intro continuous_intros continuous_on_compose2 [OF contf]) auto + show "continuous_on (?S1) (\x. g (snd x))" + by (intro continuous_intros continuous_on_compose2 [OF contg]) auto + qed (use h0 h1 conth in auto) + then have "continuous_on ({0,1} \ S \ ({0..1} \ T)) h'" + by (metis Sigma_Un_distrib1 Un_assoc insert_is_Un) + moreover have "h' ` ({0,1} \ S \ {0..1} \ T) \ U" + using fim gim him \T \ S\ unfolding h'_def by force + moreover have "closedin (subtopology euclidean ({0..1::real} \ S)) ({0,1} \ S \ {0..1::real} \ T)" + by (intro closedin_Times closedin_Un clo) (simp_all add: closed_subset) + ultimately + obtain W k where W: "({0,1} \ S) \ ({0..1} \ T) \ W" + and opeW: "openin (subtopology euclidean ({0..1} \ S)) W" + and contk: "continuous_on W k" + and kim: "k ` W \ U" + and kh': "\x. x \ ({0,1} \ S) \ ({0..1} \ T) \ k x = h' x" + by (metis ANR_imp_absolute_neighbourhood_extensor [OF \ANR U\, of "({0,1} \ S) \ ({0..1} \ T)" h' "{0..1} \ S"]) + obtain T' where opeT': "openin (subtopology euclidean S) T'" + and "T \ T'" and TW: "{0..1} \ T' \ W" + using tube_lemma_gen [of "{0..1::real}" T S W] W \T \ S\ opeW by auto + moreover have "homotopic_with (\x. True) T' U f g" + proof (simp add: homotopic_with, intro exI conjI) + show "continuous_on ({0..1} \ T') k" + using TW continuous_on_subset contk by auto + show "k ` ({0..1} \ T') \ U" + using TW kim by fastforce + have "T' \ S" + by (meson opeT' subsetD openin_imp_subset) + then show "\x\T'. k (0, x) = f x" "\x\T'. k (1, x) = g x" + by (auto simp: kh' h'_def) + qed + ultimately show ?thesis + by (blast intro: that) +qed + +text\ Homotopy on a union of closed-open sets.\ +proposition homotopic_on_clopen_Union: + fixes \ :: "'a::euclidean_space set set" + assumes "\S. S \ \ \ closedin (subtopology euclidean (\\)) S" + and "\S. S \ \ \ openin (subtopology euclidean (\\)) S" + and "\S. S \ \ \ homotopic_with (\x. True) S T f g" + shows "homotopic_with (\x. True) (\\) T f g" +proof - + obtain \ where "\ \ \" "countable \" and eqU: "\\ = \\" + using Lindelof_openin assms by blast + show ?thesis + proof (cases "\ = {}") + case True + then show ?thesis + by (metis Union_empty eqU homotopic_on_empty) + next + case False + then obtain V :: "nat \ 'a set" where V: "range V = \" + using range_from_nat_into \countable \\ by metis + with \\ \ \\ have clo: "\n. closedin (subtopology euclidean (\\)) (V n)" + and ope: "\n. openin (subtopology euclidean (\\)) (V n)" + and hom: "\n. homotopic_with (\x. True) (V n) T f g" + using assms by auto + then obtain h where conth: "\n. continuous_on ({0..1::real} \ V n) (h n)" + and him: "\n. h n ` ({0..1} \ V n) \ T" + and h0: "\n. \x. x \ V n \ h n (0, x) = f x" + and h1: "\n. \x. x \ V n \ h n (1, x) = g x" + by (simp add: homotopic_with) metis + have wop: "b \ V x \ \k. b \ V k \ (\j V j)" for b x + using nat_less_induct [where P = "\i. b \ V i"] by meson + obtain \ where cont: "continuous_on ({0..1} \ UNION UNIV V) \" + and eq: "\x i. \x \ {0..1} \ UNION UNIV V \ + {0..1} \ (V i - (\m \ \ x = h i x" + proof (rule pasting_lemma_exists) + show "{0..1} \ UNION UNIV V \ (\i. {0..1::real} \ (V i - (\m UNION UNIV V)) + ({0..1::real} \ (V i - (\mm (V i - (\mi j x. x \ {0..1} \ UNION UNIV V \ + {0..1} \ (V i - (\m {0..1} \ (V j - (\m h i x = h j x" + by clarsimp (metis lessThan_iff linorder_neqE_nat) + qed auto + show ?thesis + proof (simp add: homotopic_with eqU [symmetric], intro exI conjI ballI) + show "continuous_on ({0..1} \ \\) \" + using V eqU by (blast intro!: continuous_on_subset [OF cont]) + show "\` ({0..1} \ \\) \ T" + proof clarsimp + fix t :: real and y :: "'a" and X :: "'a set" + assume "y \ X" "X \ \" and t: "0 \ t" "t \ 1" + then obtain k where "y \ V k" and j: "\j V j" + by (metis image_iff V wop) + with him t show "\(t, y) \ T" + by (subst eq) (force simp:)+ + qed + fix X y + assume "X \ \" "y \ X" + then obtain k where "y \ V k" and j: "\j V j" + by (metis image_iff V wop) + then show "\(0, y) = f y" and "\(1, y) = g y" + by (subst eq [where i=k]; force simp: h0 h1)+ + qed + qed +qed + +proposition homotopic_on_components_eq: + fixes S :: "'a :: euclidean_space set" and T :: "'b :: euclidean_space set" + assumes S: "locally connected S \ compact S" and "ANR T" + shows "homotopic_with (\x. True) S T f g \ + (continuous_on S f \ f ` S \ T \ continuous_on S g \ g ` S \ T) \ + (\C \ components S. homotopic_with (\x. True) C T f g)" + (is "?lhs \ ?C \ ?rhs") +proof - + have "continuous_on S f" "f ` S \ T" "continuous_on S g" "g ` S \ T" if ?lhs + using homotopic_with_imp_continuous homotopic_with_imp_subset1 homotopic_with_imp_subset2 that by blast+ + moreover have "?lhs \ ?rhs" + if contf: "continuous_on S f" and fim: "f ` S \ T" and contg: "continuous_on S g" and gim: "g ` S \ T" + proof + assume ?lhs + with that show ?rhs + by (simp add: homotopic_with_subset_left in_components_subset) + next + assume R: ?rhs + have "\U. C \ U \ closedin (subtopology euclidean S) U \ + openin (subtopology euclidean S) U \ + homotopic_with (\x. True) U T f g" if C: "C \ components S" for C + proof - + have "C \ S" + by (simp add: in_components_subset that) + show ?thesis + using S + proof + assume "locally connected S" + show ?thesis + proof (intro exI conjI) + show "closedin (subtopology euclidean S) C" + by (simp add: closedin_component that) + show "openin (subtopology euclidean S) C" + by (simp add: \locally connected S\ openin_components_locally_connected that) + show "homotopic_with (\x. True) C T f g" + by (simp add: R that) + qed auto + next + assume "compact S" + have hom: "homotopic_with (\x. True) C T f g" + using R that by blast + obtain U where "C \ U" and opeU: "openin (subtopology euclidean S) U" + and hom: "homotopic_with (\x. True) U T f g" + using homotopic_neighbourhood_extension [OF contf fim contg gim _ \ANR T\ hom] + \C \ components S\ closedin_component by blast + then obtain V where "open V" and V: "U = S \ V" + by (auto simp: openin_open) + moreover have "locally compact S" + by (simp add: \compact S\ closed_imp_locally_compact compact_imp_closed) + ultimately obtain K where opeK: "openin (subtopology euclidean S) K" and "compact K" "C \ K" "K \ V" + by (metis C Int_subset_iff Sura_Bura_clopen_subset \C \ U\ \compact S\ compact_components) + show ?thesis + proof (intro exI conjI) + show "closedin (subtopology euclidean S) K" + by (meson \compact K\ \compact S\ closedin_compact_eq opeK openin_imp_subset) + show "homotopic_with (\x. True) K T f g" + using V \K \ V\ hom homotopic_with_subset_left opeK openin_imp_subset by fastforce + qed (use opeK \C \ K\ in auto) + qed + qed + then obtain \ where \: "\C. C \ components S \ C \ \ C" + and clo\: "\C. C \ components S \ closedin (subtopology euclidean S) (\ C)" + and ope\: "\C. C \ components S \ openin (subtopology euclidean S) (\ C)" + and hom\: "\C. C \ components S \ homotopic_with (\x. True) (\ C) T f g" + by metis + have Seq: "S = UNION (components S) \" + proof + show "S \ UNION (components S) \" + by (metis Sup_mono Union_components \ imageI) + show "UNION (components S) \ \ S" + using ope\ openin_imp_subset by fastforce + qed + show ?lhs + apply (subst Seq) + apply (rule homotopic_on_clopen_Union) + using Seq clo\ ope\ hom\ by auto + qed + ultimately show ?thesis by blast +qed + + +lemma cohomotopically_trivial_on_components: + fixes S :: "'a :: euclidean_space set" and T :: "'b :: euclidean_space set" + assumes S: "locally connected S \ compact S" and "ANR T" + shows + "(\f g. continuous_on S f \ f ` S \ T \ continuous_on S g \ g ` S \ T \ + homotopic_with (\x. True) S T f g) + \ + (\C\components S. + \f g. continuous_on C f \ f ` C \ T \ continuous_on C g \ g ` C \ T \ + homotopic_with (\x. True) C T f g)" + (is "?lhs = ?rhs") +proof + assume L[rule_format]: ?lhs + show ?rhs + proof clarify + fix C f g + assume contf: "continuous_on C f" and fim: "f ` C \ T" + and contg: "continuous_on C g" and gim: "g ` C \ T" and C: "C \ components S" + obtain f' where contf': "continuous_on S f'" and f'im: "f' ` S \ T" and f'f: "\x. x \ C \ f' x = f x" + using extension_from_component [OF S \ANR T\ C contf fim] by metis + obtain g' where contg': "continuous_on S g'" and g'im: "g' ` S \ T" and g'g: "\x. x \ C \ g' x = g x" + using extension_from_component [OF S \ANR T\ C contg gim] by metis + have "homotopic_with (\x. True) C T f' g'" + using L [OF contf' f'im contg' g'im] homotopic_with_subset_left C in_components_subset by fastforce + then show "homotopic_with (\x. True) C T f g" + using f'f g'g homotopic_with_eq by force + qed +next + assume R [rule_format]: ?rhs + show ?lhs + proof clarify + fix f g + assume contf: "continuous_on S f" and fim: "f ` S \ T" + and contg: "continuous_on S g" and gim: "g ` S \ T" + moreover have "homotopic_with (\x. True) C T f g" if "C \ components S" for C + using R [OF that] + by (meson contf contg continuous_on_subset fim gim image_mono in_components_subset order.trans that) + ultimately show "homotopic_with (\x. True) S T f g" + by (subst homotopic_on_components_eq [OF S \ANR T\]) auto + qed +qed + + subsection\The complement of a set and path-connectedness\ text\Complement in dimension N > 1 of set homeomorphic to any interval in diff -r d0f12783cd80 -r 04678058308f src/HOL/Analysis/Connected.thy --- a/src/HOL/Analysis/Connected.thy Sun Oct 29 19:39:03 2017 +0100 +++ b/src/HOL/Analysis/Connected.thy Mon Oct 30 16:02:59 2017 +0000 @@ -810,6 +810,10 @@ by (auto simp: closedin_closed) qed +lemma closedin_component: + "C \ components s \ closedin (subtopology euclidean s) C" + using closedin_connected_component componentsE by blast + subsection \Intersecting chains of compact sets and the Baire property\ @@ -3235,39 +3239,29 @@ using assms by (auto simp: continuous_on_id intro: continuous_on_cases_le [where h = id, simplified]) -text\Some more convenient intermediate-value theorem formulations.\ +subsubsection\Some more convenient intermediate-value theorem formulations.\ lemma connected_ivt_hyperplane: - assumes "connected s" - and "x \ s" - and "y \ s" - and "inner a x \ b" - and "b \ inner a y" - shows "\z \ s. inner a z = b" + assumes "connected S" and xy: "x \ S" "y \ S" and b: "inner a x \ b" "b \ inner a y" + shows "\z \ S. inner a z = b" proof (rule ccontr) - assume as:"\ (\z\s. inner a z = b)" + assume as:"\ (\z\S. inner a z = b)" let ?A = "{x. inner a x < b}" let ?B = "{x. inner a x > b}" have "open ?A" "open ?B" using open_halfspace_lt and open_halfspace_gt by auto - moreover - have "?A \ ?B = {}" by auto - moreover - have "s \ ?A \ ?B" using as by auto - ultimately - show False - using assms(1)[unfolded connected_def not_ex, + moreover have "?A \ ?B = {}" by auto + moreover have "S \ ?A \ ?B" using as by auto + ultimately show False + using \connected S\[unfolded connected_def not_ex, THEN spec[where x="?A"], THEN spec[where x="?B"]] - using assms(2-5) - by auto + using xy b by auto qed lemma connected_ivt_component: fixes x::"'a::euclidean_space" - shows "connected s \ - x \ s \ y \ s \ - x\k \ a \ a \ y\k \ (\z\s. z\k = a)" - using connected_ivt_hyperplane[of s x y "k::'a" a] + shows "connected S \ x \ S \ y \ S \ x\k \ a \ a \ y\k \ (\z\S. z\k = a)" + using connected_ivt_hyperplane[of S x y "k::'a" a] by (auto simp: inner_commute) lemma image_affinity_cbox: fixes m::real @@ -4942,7 +4936,7 @@ qed -proposition component_complement_connected: +proposition component_diff_connected: fixes S :: "'a::metric_space set" assumes "connected S" "connected U" "S \ U" and C: "C \ components (U - S)" shows "connected(U - C)" diff -r d0f12783cd80 -r 04678058308f src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Sun Oct 29 19:39:03 2017 +0100 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Mon Oct 30 16:02:59 2017 +0000 @@ -2373,7 +2373,14 @@ qed corollary connected_UNIV[intro]: "connected (UNIV :: 'a::real_normed_vector set)" - by(simp add: convex_connected) + by (simp add: convex_connected) + +corollary component_complement_connected: + fixes S :: "'a::real_normed_vector set" + assumes "connected S" "C \ components (-S)" + shows "connected(-C)" + using component_diff_connected [of S UNIV] assms + by (auto simp: Compl_eq_Diff_UNIV) proposition clopen: fixes S :: "'a :: real_normed_vector set" 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 diff -r d0f12783cd80 -r 04678058308f src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Sun Oct 29 19:39:03 2017 +0100 +++ b/src/HOL/Analysis/Path_Connected.thy Mon Oct 30 16:02:59 2017 +0000 @@ -6969,7 +6969,7 @@ shows "S homotopy_eqv ({}::'b::real_normed_vector set) \ S = {}" apply (rule iffI) using homotopy_eqv_def apply fastforce -by (simp add: homotopy_eqv_contractible_sets contractible_empty) +by (simp add: homotopy_eqv_contractible_sets) lemma homotopy_eqv_empty2 [simp]: fixes S :: "'a::real_normed_vector set" diff -r d0f12783cd80 -r 04678058308f src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Sun Oct 29 19:39:03 2017 +0100 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Oct 30 16:02:59 2017 +0000 @@ -2501,6 +2501,29 @@ lemma frontier_closures: "frontier S = closure S \ closure (- S)" by (auto simp: frontier_def interior_closure) +lemma frontier_Int: "frontier(S \ T) = closure(S \ T) \ (frontier S \ frontier T)" +proof - + have "closure (S \ T) \ closure S" "closure (S \ T) \ closure T" + by (simp_all add: closure_mono) + then show ?thesis + by (auto simp: frontier_closures) +qed + +lemma frontier_Int_subset: "frontier(S \ T) \ frontier S \ frontier T" + by (auto simp: frontier_Int) + +lemma frontier_Int_closed: + assumes "closed S" "closed T" + shows "frontier(S \ T) = (frontier S \ T) \ (S \ frontier T)" +proof - + have "closure (S \ T) = T \ S" + using assms by (simp add: Int_commute closed_Int) + moreover have "T \ (closure S \ closure (- S)) = frontier S \ T" + by (simp add: Int_commute frontier_closures) + ultimately show ?thesis + by (simp add: Int_Un_distrib Int_assoc Int_left_commute assms frontier_closures) +qed + lemma frontier_straddle: fixes a :: "'a::metric_space" shows "a \ frontier S \ (\e>0. (\x\S. dist a x < e) \ (\x. x \ S \ dist a x < e))" @@ -2528,6 +2551,9 @@ lemma frontier_complement [simp]: "frontier (- S) = frontier S" by (auto simp: frontier_def closure_complement interior_complement) +lemma frontier_Un_subset: "frontier(S \ T) \ frontier S \ frontier T" + by (metis compl_sup frontier_Int_subset frontier_complement) + lemma frontier_disjoint_eq: "frontier S \ S = {} \ open S" using frontier_complement frontier_subset_eq[of "- S"] unfolding open_closed by auto