# HG changeset patch # User paulson # Date 1483970413 0 # Node ID e5d4bc2016a6078a8f052e8b438af9f3e6e05f52 # Parent bb70dc05cd3855a62118edcf3d846a2b4e2e1f39 Advanced topology diff -r bb70dc05cd38 -r e5d4bc2016a6 src/HOL/Analysis/Function_Topology.thy --- a/src/HOL/Analysis/Function_Topology.thy Mon Jan 09 00:08:18 2017 +0100 +++ b/src/HOL/Analysis/Function_Topology.thy Mon Jan 09 14:00:13 2017 +0000 @@ -294,27 +294,6 @@ unfolding topspace_pullback_topology by blast qed -subsubsection {*Miscellaneous*} - -text {*The following could belong to \verb+Topology_Euclidean_Spaces.thy+, and will be needed -below.*} -lemma openin_INT [intro]: - assumes "finite I" - "\i. i \ I \ openin T (U i)" - shows "openin T ((\i \ I. U i) \ topspace T)" -using assms by (induct, auto simp add: inf_sup_aci(2) openin_Int) - -lemma openin_INT2 [intro]: - assumes "finite I" "I \ {}" - "\i. i \ I \ openin T (U i)" - shows "openin T (\i \ I. U i)" -proof - - have "(\i \ I. U i) \ topspace T" - using `I \ {}` openin_subset[OF assms(3)] by auto - then show ?thesis - using openin_INT[of _ _ U, OF assms(1) assms(3)] by (simp add: inf.absorb2 inf_commute) -qed - subsection {*The product topology*} diff -r bb70dc05cd38 -r e5d4bc2016a6 src/HOL/Analysis/Further_Topology.thy --- a/src/HOL/Analysis/Further_Topology.thy Mon Jan 09 00:08:18 2017 +0100 +++ b/src/HOL/Analysis/Further_Topology.thy Mon Jan 09 14:00:13 2017 +0000 @@ -3460,4 +3460,1119 @@ qed qed + +subsection\Hence the Borsukian results about mappings into circles\ + +lemma inessential_eq_continuous_logarithm: + fixes f :: "'a::real_normed_vector \ complex" + shows "(\a. homotopic_with (\h. True) S (-{0}) f (\t. a)) \ + (\g. continuous_on S g \ (\x \ S. f x = exp(g x)))" + (is "?lhs \ ?rhs") +proof + assume ?lhs thus ?rhs + by (metis covering_space_lift_inessential_function covering_space_exp_punctured_plane) +next + assume ?rhs + then obtain g where contg: "continuous_on S g" and f: "\x. x \ S \ f x = exp(g x)" + by metis + obtain a where "homotopic_with (\h. True) S (- {of_real 0}) (exp \ g) (\x. a)" + proof (rule nullhomotopic_through_contractible [OF contg subset_UNIV _ _ contractible_UNIV]) + show "continuous_on (UNIV::complex set) exp" + by (intro continuous_intros) + show "range exp \ - {0}" + by auto + qed force + thus ?lhs + apply (rule_tac x=a in exI) + by (simp add: f homotopic_with_eq) +qed + +corollary inessential_imp_continuous_logarithm_circle: + fixes f :: "'a::real_normed_vector \ complex" + assumes "homotopic_with (\h. True) S (sphere 0 1) f (\t. a)" + obtains g where "continuous_on S g" and "\x. x \ S \ f x = exp(g x)" +proof - + have "homotopic_with (\h. True) S (- {0}) f (\t. a)" + using assms homotopic_with_subset_right by fastforce + then show ?thesis + by (metis inessential_eq_continuous_logarithm that) +qed + + +lemma inessential_eq_continuous_logarithm_circle: + fixes f :: "'a::real_normed_vector \ complex" + shows "(\a. homotopic_with (\h. True) S (sphere 0 1) f (\t. a)) \ + (\g. continuous_on S g \ (\x \ S. f x = exp(ii* of_real(g x))))" + (is "?lhs \ ?rhs") +proof + assume L: ?lhs + then obtain g where contg: "continuous_on S g" and g: "\x. x \ S \ f x = exp(g x)" + using inessential_imp_continuous_logarithm_circle by blast + have "f ` S \ sphere 0 1" + by (metis L homotopic_with_imp_subset1) + then have "\x. x \ S \ Re (g x) = 0" + using g by auto + then show ?rhs + apply (rule_tac x="Im \ g" in exI) + apply (intro conjI contg continuous_intros) + apply (auto simp: Euler g) + done +next + assume ?rhs + then obtain g where contg: "continuous_on S g" and g: "\x. x \ S \ f x = exp(ii* of_real(g x))" + by metis + obtain a where "homotopic_with (\h. True) S (sphere 0 1) ((exp \ (\z. ii*z)) \ (of_real \ g)) (\x. a)" + proof (rule nullhomotopic_through_contractible) + show "continuous_on S (complex_of_real \ g)" + by (intro conjI contg continuous_intros) + show "(complex_of_real \ g) ` S \ \" + by auto + show "continuous_on \ (exp \ op*\)" + by (intro continuous_intros) + show "(exp \ op*\) ` \ \ sphere 0 1" + by (auto simp: complex_is_Real_iff) + qed (auto simp: convex_Reals convex_imp_contractible) + moreover have "\x. x \ S \ (exp \ op*\ \ (complex_of_real \ g)) x = f x" + by (simp add: g) + ultimately show ?lhs + apply (rule_tac x=a in exI) + by (simp add: homotopic_with_eq) +qed + +lemma homotopic_with_sphere_times: + fixes f :: "'a::real_normed_vector \ complex" + assumes hom: "homotopic_with (\x. True) S (sphere 0 1) f g" and conth: "continuous_on S h" + and hin: "\x. x \ S \ h x \ sphere 0 1" + shows "homotopic_with (\x. True) S (sphere 0 1) (\x. f x*h x) (\x. g x*h x)" +proof - + obtain k where contk: "continuous_on ({0..1::real} \ S) k" + and kim: "k ` ({0..1} \ S) \ sphere 0 1" + and k0: "\x. k(0, x) = f x" + and k1: "\x. k(1, x) = g x" + using hom by (auto simp: homotopic_with_def) + show ?thesis + apply (simp add: homotopic_with) + apply (rule_tac x="\z. k z*(h \ snd)z" in exI) + apply (intro conjI contk continuous_intros) + apply (simp add: conth) + using kim hin apply (force simp: norm_mult k0 k1)+ + done +qed + + +lemma homotopic_circlemaps_divide: + fixes f :: "'a::real_normed_vector \ complex" + shows "homotopic_with (\x. True) S (sphere 0 1) f g \ + continuous_on S f \ f ` S \ sphere 0 1 \ + continuous_on S g \ g ` S \ sphere 0 1 \ + (\c. homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. c))" +proof - + have "homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" + if "homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. c)" for c + proof - + have "S = {} \ path_component (sphere 0 1) 1 c" + using homotopic_with_imp_subset2 [OF that] path_connected_sphere [of "0::complex" 1] + by (auto simp: path_connected_component) + then have "homotopic_with (\x. True) S (sphere 0 1) (\x. 1) (\x. c)" + by (metis homotopic_constant_maps) + then show ?thesis + using homotopic_with_symD homotopic_with_trans that by blast + qed + then have *: "(\c. homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. c)) \ + homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" + by auto + have "homotopic_with (\x. True) S (sphere 0 1) f g \ + continuous_on S f \ f ` S \ sphere 0 1 \ + continuous_on S g \ g ` S \ sphere 0 1 \ + homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" + (is "?lhs \ ?rhs") + proof + assume L: ?lhs + have geq1 [simp]: "\x. x \ S \ cmod (g x) = 1" + using homotopic_with_imp_subset2 [OF L] + by (simp add: image_subset_iff) + have cont: "continuous_on S (inverse \ g)" + apply (rule continuous_intros) + using homotopic_with_imp_continuous [OF L] apply blast + apply (rule continuous_on_subset [of "sphere 0 1", OF continuous_on_inverse]) + apply (auto simp: continuous_on_id) + done + have "homotopic_with (\x. True) S (sphere 0 1) (\x. f x / g x) (\x. 1)" + using homotopic_with_sphere_times [OF L cont] + apply (rule homotopic_with_eq) + apply (auto simp: division_ring_class.divide_inverse norm_inverse) + by (metis geq1 norm_zero right_inverse zero_neq_one) + with L show ?rhs + by (auto simp: homotopic_with_imp_continuous dest: homotopic_with_imp_subset1 homotopic_with_imp_subset2) + next + assume ?rhs then show ?lhs + by (force simp: elim: homotopic_with_eq dest: homotopic_with_sphere_times [where h=g])+ + qed + then show ?thesis + by (simp add: *) +qed + +subsection\Upper and lower hemicontinuous functions\ + +text\And relation in the case of preimage map to open and closed maps, and fact that upper and lower +hemicontinuity together imply continuity in the sense of the Hausdorff metric (at points where the +function gives a bounded and nonempty set).\ + + +text\Many similar proofs below.\ +lemma upper_hemicontinuous: + assumes "\x. x \ S \ f x \ T" + shows "((\U. openin (subtopology euclidean T) U + \ openin (subtopology euclidean S) {x \ S. f x \ U}) \ + (\U. closedin (subtopology euclidean T) U + \ closedin (subtopology euclidean S) {x \ S. f x \ U \ {}}))" + (is "?lhs = ?rhs") +proof (intro iffI allI impI) + fix U + assume * [rule_format]: ?lhs and "closedin (subtopology euclidean T) U" + then have "openin (subtopology euclidean T) (T - U)" + by (simp add: openin_diff) + then have "openin (subtopology euclidean S) {x \ S. f x \ T - U}" + using * [of "T-U"] by blast + moreover have "S - {x \ S. f x \ T - U} = {x \ S. f x \ U \ {}}" + using assms by blast + ultimately show "closedin (subtopology euclidean S) {x \ S. f x \ U \ {}}" + by (simp add: openin_closedin_eq) +next + fix U + assume * [rule_format]: ?rhs and "openin (subtopology euclidean T) U" + then have "closedin (subtopology euclidean T) (T - U)" + by (simp add: closedin_diff) + then have "closedin (subtopology euclidean S) {x \ S. f x \ (T - U) \ {}}" + using * [of "T-U"] by blast + moreover have "{x \ S. f x \ (T - U) \ {}} = S - {x \ S. f x \ U}" + using assms by auto + ultimately show "openin (subtopology euclidean S) {x \ S. f x \ U}" + by (simp add: openin_closedin_eq) +qed + +lemma lower_hemicontinuous: + assumes "\x. x \ S \ f x \ T" + shows "((\U. closedin (subtopology euclidean T) U + \ closedin (subtopology euclidean S) {x \ S. f x \ U}) \ + (\U. openin (subtopology euclidean T) U + \ openin (subtopology euclidean S) {x \ S. f x \ U \ {}}))" + (is "?lhs = ?rhs") +proof (intro iffI allI impI) + fix U + assume * [rule_format]: ?lhs and "openin (subtopology euclidean T) U" + then have "closedin (subtopology euclidean T) (T - U)" + by (simp add: closedin_diff) + then have "closedin (subtopology euclidean S) {x \ S. f x \ T-U}" + using * [of "T-U"] by blast + moreover have "{x \ S. f x \ T-U} = S - {x \ S. f x \ U \ {}}" + using assms by auto + ultimately show "openin (subtopology euclidean S) {x \ S. f x \ U \ {}}" + by (simp add: openin_closedin_eq) +next + fix U + assume * [rule_format]: ?rhs and "closedin (subtopology euclidean T) U" + then have "openin (subtopology euclidean T) (T - U)" + by (simp add: openin_diff) + then have "openin (subtopology euclidean S) {x \ S. f x \ (T - U) \ {}}" + using * [of "T-U"] by blast + moreover have "S - {x \ S. f x \ (T - U) \ {}} = {x \ S. f x \ U}" + using assms by blast + ultimately show "closedin (subtopology euclidean S) {x \ S. f x \ U}" + by (simp add: openin_closedin_eq) +qed + +lemma open_map_iff_lower_hemicontinuous_preimage: + assumes "f ` S \ T" + shows "((\U. openin (subtopology euclidean S) U + \ openin (subtopology euclidean T) (f ` U)) \ + (\U. closedin (subtopology euclidean S) U + \ closedin (subtopology euclidean T) {y \ T. {x. x \ S \ f x = y} \ U}))" + (is "?lhs = ?rhs") +proof (intro iffI allI impI) + fix U + assume * [rule_format]: ?lhs and "closedin (subtopology euclidean S) U" + then have "openin (subtopology euclidean S) (S - U)" + by (simp add: openin_diff) + then have "openin (subtopology euclidean T) (f ` (S - U))" + using * [of "S-U"] by blast + moreover have "T - (f ` (S - U)) = {y \ T. {x \ S. f x = y} \ U}" + using assms by blast + ultimately show "closedin (subtopology euclidean T) {y \ T. {x \ S. f x = y} \ U}" + by (simp add: openin_closedin_eq) +next + fix U + assume * [rule_format]: ?rhs and opeSU: "openin (subtopology euclidean S) U" + then have "closedin (subtopology euclidean S) (S - U)" + by (simp add: closedin_diff) + then have "closedin (subtopology euclidean T) {y \ T. {x \ S. f x = y} \ S - U}" + using * [of "S-U"] by blast + moreover have "{y \ T. {x \ S. f x = y} \ S - U} = T - (f ` U)" + using assms openin_imp_subset [OF opeSU] by auto + ultimately show "openin (subtopology euclidean T) (f ` U)" + using assms openin_imp_subset [OF opeSU] by (force simp: openin_closedin_eq) +qed + +lemma closed_map_iff_upper_hemicontinuous_preimage: + assumes "f ` S \ T" + shows "((\U. closedin (subtopology euclidean S) U + \ closedin (subtopology euclidean T) (f ` U)) \ + (\U. openin (subtopology euclidean S) U + \ openin (subtopology euclidean T) {y \ T. {x. x \ S \ f x = y} \ U}))" + (is "?lhs = ?rhs") +proof (intro iffI allI impI) + fix U + assume * [rule_format]: ?lhs and opeSU: "openin (subtopology euclidean S) U" + then have "closedin (subtopology euclidean S) (S - U)" + by (simp add: closedin_diff) + then have "closedin (subtopology euclidean T) (f ` (S - U))" + using * [of "S-U"] by blast + moreover have "f ` (S - U) = T - {y \ T. {x. x \ S \ f x = y} \ U}" + using assms openin_imp_subset [OF opeSU] by auto + ultimately show "openin (subtopology euclidean T) {y \ T. {x. x \ S \ f x = y} \ U}" + using assms openin_imp_subset [OF opeSU] by (force simp: openin_closedin_eq) +next + fix U + assume * [rule_format]: ?rhs and cloSU: "closedin (subtopology euclidean S) U" + then have "openin (subtopology euclidean S) (S - U)" + by (simp add: openin_diff) + then have "openin (subtopology euclidean T) {y \ T. {x \ S. f x = y} \ S - U}" + using * [of "S-U"] by blast + moreover have "(f ` U) = T - {y \ T. {x \ S. f x = y} \ S - U}" + using assms closedin_imp_subset [OF cloSU] by auto + ultimately show "closedin (subtopology euclidean T) (f ` U)" + by (simp add: openin_closedin_eq) +qed + +proposition upper_lower_hemicontinuous_explicit: + fixes T :: "('b::{real_normed_vector,heine_borel}) set" + assumes fST: "\x. x \ S \ f x \ T" + and ope: "\U. openin (subtopology euclidean T) U + \ openin (subtopology euclidean S) {x \ S. f x \ U}" + and clo: "\U. closedin (subtopology euclidean T) U + \ closedin (subtopology euclidean S) {x \ S. f x \ U}" + and "x \ S" "0 < e" and bofx: "bounded(f x)" and fx_ne: "f x \ {}" + obtains d where "0 < d" + "\x'. \x' \ S; dist x x' < d\ + \ (\y \ f x. \y'. y' \ f x' \ dist y y' < e) \ + (\y' \ f x'. \y. y \ f x \ dist y' y < e)" +proof - + have "openin (subtopology euclidean T) (T \ (\a\f x. \b\ball 0 e. {a + b}))" + by (auto simp: open_sums openin_open_Int) + with ope have "openin (subtopology euclidean S) + {u \ S. f u \ T \ (\a\f x. \b\ball 0 e. {a + b})}" by blast + with \0 < e\ \x \ S\ obtain d1 where "d1 > 0" and + d1: "\x'. \x' \ S; dist x' x < d1\ \ f x' \ T \ f x' \ (\a \ f x. \b \ ball 0 e. {a + b})" + by (force simp: openin_euclidean_subtopology_iff dest: fST) + have oo: "\U. openin (subtopology euclidean T) U \ + openin (subtopology euclidean S) {x \ S. f x \ U \ {}}" + apply (rule lower_hemicontinuous [THEN iffD1, rule_format]) + using fST clo by auto + have "compact (closure(f x))" + by (simp add: bofx) + moreover have "closure(f x) \ (\a \ f x. ball a (e/2))" + using \0 < e\ by (force simp: closure_approachable simp del: divide_const_simps) + ultimately obtain C where "C \ f x" "finite C" "closure(f x) \ (\a \ C. ball a (e/2))" + apply (rule compactE, force) + by (metis finite_subset_image) + then have fx_cover: "f x \ (\a \ C. ball a (e/2))" + by (meson closure_subset order_trans) + with fx_ne have "C \ {}" + by blast + have xin: "x \ (\a \ C. {x \ S. f x \ T \ ball a (e/2) \ {}})" + using \x \ S\ \0 < e\ fST \C \ f x\ by force + have "openin (subtopology euclidean S) {x \ S. f x \ (T \ ball a (e/2)) \ {}}" for a + by (simp add: openin_open_Int oo) + then have "openin (subtopology euclidean S) (\a \ C. {x \ S. f x \ T \ ball a (e/2) \ {}})" + by (simp add: Int_assoc openin_INT2 [OF \finite C\ \C \ {}\]) + with xin obtain d2 where "d2>0" + and d2: "\u v. \u \ S; dist u x < d2; v \ C\ \ f u \ T \ ball v (e/2) \ {}" + by (force simp: openin_euclidean_subtopology_iff) + show ?thesis + proof (intro that conjI ballI) + show "0 < min d1 d2" + using \0 < d1\ \0 < d2\ by linarith + next + fix x' y + assume "x' \ S" "dist x x' < min d1 d2" "y \ f x" + then have dd2: "dist x' x < d2" + by (auto simp: dist_commute) + obtain a where "a \ C" "y \ ball a (e/2)" + using fx_cover \y \ f x\ by auto + then show "\y'. y' \ f x' \ dist y y' < e" + using d2 [OF \x' \ S\ dd2] dist_triangle_half_r by fastforce + next + fix x' y' + assume "x' \ S" "dist x x' < min d1 d2" "y' \ f x'" + then have "dist x' x < d1" + by (auto simp: dist_commute) + then have "y' \ (\a\f x. \b\ball 0 e. {a + b})" + using d1 [OF \x' \ S\] \y' \ f x'\ by force + then show "\y. y \ f x \ dist y' y < e" + apply auto + by (metis add_diff_cancel_left' dist_norm) + qed +qed + + +subsection\complex logs exist on various "well-behaved" sets\ + +lemma continuous_logarithm_on_contractible: + fixes f :: "'a::real_normed_vector \ complex" + assumes "continuous_on S f" "contractible S" "\z. z \ S \ f z \ 0" + obtains g where "continuous_on S g" "\x. x \ S \ f x = exp(g x)" +proof - + obtain c where hom: "homotopic_with (\h. True) S (-{0}) f (\x. c)" + using nullhomotopic_from_contractible assms + by (metis imageE subset_Compl_singleton) + then show ?thesis + by (metis inessential_eq_continuous_logarithm of_real_0 that) +qed + +lemma continuous_logarithm_on_simply_connected: + fixes f :: "'a::real_normed_vector \ complex" + assumes contf: "continuous_on S f" and S: "simply_connected S" "locally path_connected S" + and f: "\z. z \ S \ f z \ 0" + obtains g where "continuous_on S g" "\x. x \ S \ f x = exp(g x)" + using covering_space_lift [OF covering_space_exp_punctured_plane S contf] + by (metis (full_types) f imageE subset_Compl_singleton) + +lemma continuous_logarithm_on_cball: + fixes f :: "'a::real_normed_vector \ complex" + assumes "continuous_on (cball a r) f" and "\z. z \ cball a r \ f z \ 0" + obtains h where "continuous_on (cball a r) h" "\z. z \ cball a r \ f z = exp(h z)" + using assms continuous_logarithm_on_contractible convex_imp_contractible by blast + +lemma continuous_logarithm_on_ball: + fixes f :: "'a::real_normed_vector \ complex" + assumes "continuous_on (ball a r) f" and "\z. z \ ball a r \ f z \ 0" + obtains h where "continuous_on (ball a r) h" "\z. z \ ball a r \ f z = exp(h z)" + using assms continuous_logarithm_on_contractible convex_imp_contractible by blast + +lemma continuous_sqrt_on_contractible: + fixes f :: "'a::real_normed_vector \ complex" + assumes "continuous_on S f" "contractible S" + and "\z. z \ S \ f z \ 0" + obtains g where "continuous_on S g" "\x. x \ S \ f x = (g x) ^ 2" +proof - + obtain g where contg: "continuous_on S g" and feq: "\x. x \ S \ f x = exp(g x)" + using continuous_logarithm_on_contractible [OF assms] by blast + show ?thesis + proof + show "continuous_on S (\z. exp (g z / 2))" + by (rule continuous_on_compose2 [of UNIV exp]; intro continuous_intros contg subset_UNIV) auto + show "\x. x \ S \ f x = (exp (g x / 2))\<^sup>2" + by (metis exp_double feq nonzero_mult_div_cancel_left times_divide_eq_right zero_neq_numeral) + qed +qed + +lemma continuous_sqrt_on_simply_connected: + fixes f :: "'a::real_normed_vector \ complex" + assumes contf: "continuous_on S f" and S: "simply_connected S" "locally path_connected S" + and f: "\z. z \ S \ f z \ 0" + obtains g where "continuous_on S g" "\x. x \ S \ f x = (g x) ^ 2" +proof - + obtain g where contg: "continuous_on S g" and feq: "\x. x \ S \ f x = exp(g x)" + using continuous_logarithm_on_simply_connected [OF assms] by blast + show ?thesis + proof + show "continuous_on S (\z. exp (g z / 2))" + by (rule continuous_on_compose2 [of UNIV exp]; intro continuous_intros contg subset_UNIV) auto + show "\x. x \ S \ f x = (exp (g x / 2))\<^sup>2" + by (metis exp_double feq nonzero_mult_div_cancel_left times_divide_eq_right zero_neq_numeral) + qed +qed + + +subsection\Holomorphic logarithms and square roots.\ + +lemma contractible_imp_holomorphic_log: + assumes holf: "f holomorphic_on S" + and S: "contractible S" + and fnz: "\z. z \ S \ f z \ 0" + obtains g where "g holomorphic_on S" "\z. z \ S \ f z = exp(g z)" +proof - + have contf: "continuous_on S f" + by (simp add: holf holomorphic_on_imp_continuous_on) + obtain g where contg: "continuous_on S g" and feq: "\x. x \ S \ f x = exp (g x)" + by (metis continuous_logarithm_on_contractible [OF contf S fnz]) + have "g field_differentiable at z within S" if "f field_differentiable at z within S" "z \ S" for z + proof - + obtain f' where f': "((\y. (f y - f z) / (y - z)) \ f') (at z within S)" + using \f field_differentiable at z within S\ by (auto simp: field_differentiable_def DERIV_iff2) + then have ee: "((\x. (exp(g x) - exp(g z)) / (x - z)) \ f') (at z within S)" + by (simp add: feq \z \ S\ Lim_transform_within [OF _ zero_less_one]) + have "(((\y. if y = g z then exp (g z) else (exp y - exp (g z)) / (y - g z)) \ g) \ exp (g z)) + (at z within S)" + proof (rule tendsto_compose_at) + show "(g \ g z) (at z within S)" + using contg continuous_on \z \ S\ by blast + show "(\y. if y = g z then exp (g z) else (exp y - exp (g z)) / (y - g z)) \g z\ exp (g z)" + apply (subst Lim_at_zero) + apply (simp add: DERIV_D cong: if_cong Lim_cong_within) + done + qed auto + then have dd: "((\x. if g x = g z then exp(g z) else (exp(g x) - exp(g z)) / (g x - g z)) \ exp(g z)) (at z within S)" + by (simp add: o_def) + have "continuous (at z within S) g" + using contg continuous_on_eq_continuous_within \z \ S\ by blast + then have "(\\<^sub>F x in at z within S. dist (g x) (g z) < 2*pi)" + by (simp add: continuous_within tendsto_iff) + then have "\\<^sub>F x in at z within S. exp (g x) = exp (g z) \ g x \ g z \ x = z" + apply (rule eventually_mono) + apply (auto simp: exp_eq dist_norm norm_mult) + done + then have "((\y. (g y - g z) / (y - z)) \ f' / exp (g z)) (at z within S)" + by (auto intro!: Lim_transform_eventually [OF _ tendsto_divide [OF ee dd]]) + then show ?thesis + by (auto simp: field_differentiable_def DERIV_iff2) + qed + then have "g holomorphic_on S" + using holf holomorphic_on_def by auto + then show ?thesis + using feq that by auto +qed + +(*Identical proofs*) +lemma simply_connected_imp_holomorphic_log: + assumes holf: "f holomorphic_on S" + and S: "simply_connected S" "locally path_connected S" + and fnz: "\z. z \ S \ f z \ 0" + obtains g where "g holomorphic_on S" "\z. z \ S \ f z = exp(g z)" +proof - + have contf: "continuous_on S f" + by (simp add: holf holomorphic_on_imp_continuous_on) + obtain g where contg: "continuous_on S g" and feq: "\x. x \ S \ f x = exp (g x)" + by (metis continuous_logarithm_on_simply_connected [OF contf S fnz]) + have "g field_differentiable at z within S" if "f field_differentiable at z within S" "z \ S" for z + proof - + obtain f' where f': "((\y. (f y - f z) / (y - z)) \ f') (at z within S)" + using \f field_differentiable at z within S\ by (auto simp: field_differentiable_def DERIV_iff2) + then have ee: "((\x. (exp(g x) - exp(g z)) / (x - z)) \ f') (at z within S)" + by (simp add: feq \z \ S\ Lim_transform_within [OF _ zero_less_one]) + have "(((\y. if y = g z then exp (g z) else (exp y - exp (g z)) / (y - g z)) \ g) \ exp (g z)) + (at z within S)" + proof (rule tendsto_compose_at) + show "(g \ g z) (at z within S)" + using contg continuous_on \z \ S\ by blast + show "(\y. if y = g z then exp (g z) else (exp y - exp (g z)) / (y - g z)) \g z\ exp (g z)" + apply (subst Lim_at_zero) + apply (simp add: DERIV_D cong: if_cong Lim_cong_within) + done + qed auto + then have dd: "((\x. if g x = g z then exp(g z) else (exp(g x) - exp(g z)) / (g x - g z)) \ exp(g z)) (at z within S)" + by (simp add: o_def) + have "continuous (at z within S) g" + using contg continuous_on_eq_continuous_within \z \ S\ by blast + then have "(\\<^sub>F x in at z within S. dist (g x) (g z) < 2*pi)" + by (simp add: continuous_within tendsto_iff) + then have "\\<^sub>F x in at z within S. exp (g x) = exp (g z) \ g x \ g z \ x = z" + apply (rule eventually_mono) + apply (auto simp: exp_eq dist_norm norm_mult) + done + then have "((\y. (g y - g z) / (y - z)) \ f' / exp (g z)) (at z within S)" + by (auto intro!: Lim_transform_eventually [OF _ tendsto_divide [OF ee dd]]) + then show ?thesis + by (auto simp: field_differentiable_def DERIV_iff2) + qed + then have "g holomorphic_on S" + using holf holomorphic_on_def by auto + then show ?thesis + using feq that by auto +qed + + +lemma contractible_imp_holomorphic_sqrt: + assumes holf: "f holomorphic_on S" + and S: "contractible S" + and fnz: "\z. z \ S \ f z \ 0" + obtains g where "g holomorphic_on S" "\z. z \ S \ f z = g z ^ 2" +proof - + obtain g where holg: "g holomorphic_on S" and feq: "\z. z \ S \ f z = exp(g z)" + using contractible_imp_holomorphic_log [OF assms] by blast + show ?thesis + proof + show "exp \ (\z. z / 2) \ g holomorphic_on S" + by (intro holomorphic_on_compose holg holomorphic_intros) auto + show "\z. z \ S \ f z = ((exp \ (\z. z / 2) \ g) z)\<^sup>2" + apply (auto simp: feq) + by (metis eq_divide_eq_numeral1(1) exp_double mult.commute zero_neq_numeral) + qed +qed + +lemma simply_connected_imp_holomorphic_sqrt: + assumes holf: "f holomorphic_on S" + and S: "simply_connected S" "locally path_connected S" + and fnz: "\z. z \ S \ f z \ 0" + obtains g where "g holomorphic_on S" "\z. z \ S \ f z = g z ^ 2" +proof - + obtain g where holg: "g holomorphic_on S" and feq: "\z. z \ S \ f z = exp(g z)" + using simply_connected_imp_holomorphic_log [OF assms] by blast + show ?thesis + proof + show "exp \ (\z. z / 2) \ g holomorphic_on S" + by (intro holomorphic_on_compose holg holomorphic_intros) auto + show "\z. z \ S \ f z = ((exp \ (\z. z / 2) \ g) z)\<^sup>2" + apply (auto simp: feq) + by (metis eq_divide_eq_numeral1(1) exp_double mult.commute zero_neq_numeral) + qed +qed + +text\ Related theorems about holomorphic inverse cosines.\ + +lemma contractible_imp_holomorphic_arccos: + assumes holf: "f holomorphic_on S" and S: "contractible S" + and non1: "\z. z \ S \ f z \ 1 \ f z \ -1" + obtains g where "g holomorphic_on S" "\z. z \ S \ f z = cos(g z)" +proof - + have hol1f: "(\z. 1 - f z ^ 2) holomorphic_on S" + by (intro holomorphic_intros holf) + obtain g where holg: "g holomorphic_on S" and eq: "\z. z \ S \ 1 - (f z)\<^sup>2 = (g z)\<^sup>2" + using contractible_imp_holomorphic_sqrt [OF hol1f S] + by (metis eq_iff_diff_eq_0 non1 power2_eq_1_iff) + have holfg: "(\z. f z + ii*g z) holomorphic_on S" + by (intro holf holg holomorphic_intros) + have "\z. z \ S \ f z + \*g z \ 0" + by (metis Arccos_body_lemma eq add.commute add.inverse_unique complex_i_mult_minus power2_csqrt power2_eq_iff) + then obtain h where holh: "h holomorphic_on S" and fgeq: "\z. z \ S \ f z + \*g z = exp (h z)" + using contractible_imp_holomorphic_log [OF holfg S] by metis + show ?thesis + proof + show "(\z. -ii*h z) holomorphic_on S" + by (intro holh holomorphic_intros) + show "f z = cos (- \*h z)" if "z \ S" for z + proof - + have "(f z + ii*g z)*(f z - ii*g z) = 1" + using that eq by (auto simp: algebra_simps power2_eq_square) + then have "f z - ii*g z = inverse (f z + ii*g z)" + using inverse_unique by force + also have "... = exp (- h z)" + by (simp add: exp_minus fgeq that) + finally have "f z = exp (- h z) + \*g z" + by (simp add: diff_eq_eq) + then show ?thesis + apply (simp add: cos_exp_eq) + by (metis fgeq add.assoc mult_2_right that) + qed + qed +qed + + +lemma contractible_imp_holomorphic_arccos_bounded: + assumes holf: "f holomorphic_on S" and S: "contractible S" and "a \ S" + and non1: "\z. z \ S \ f z \ 1 \ f z \ -1" + obtains g where "g holomorphic_on S" "norm(g a) \ pi + norm(f a)" "\z. z \ S \ f z = cos(g z)" +proof - + obtain g where holg: "g holomorphic_on S" and feq: "\z. z \ S \ f z = cos (g z)" + using contractible_imp_holomorphic_arccos [OF holf S non1] by blast + obtain b where "cos b = f a" "norm b \ pi + norm (f a)" + using cos_Arccos norm_Arccos_bounded by blast + then have "cos b = cos (g a)" + by (simp add: \a \ S\ feq) + then consider n where "n \ \" "b = g a + of_real(2*n*pi)" | n where "n \ \" "b = -g a + of_real(2*n*pi)" + by (auto simp: complex_cos_eq) + then show ?thesis + proof cases + case 1 + show ?thesis + proof + show "(\z. g z + of_real(2*n*pi)) holomorphic_on S" + by (intro holomorphic_intros holg) + show "cmod (g a + of_real(2*n*pi)) \ pi + cmod (f a)" + using "1" \cmod b \ pi + cmod (f a)\ by blast + show "\z. z \ S \ f z = cos (g z + complex_of_real (2*n*pi))" + by (metis \n \ \\ complex_cos_eq feq) + qed + next + case 2 + show ?thesis + proof + show "(\z. -g z + of_real(2*n*pi)) holomorphic_on S" + by (intro holomorphic_intros holg) + show "cmod (-g a + of_real(2*n*pi)) \ pi + cmod (f a)" + using "2" \cmod b \ pi + cmod (f a)\ by blast + show "\z. z \ S \ f z = cos (-g z + complex_of_real (2*n*pi))" + by (metis \n \ \\ complex_cos_eq feq) + qed + qed +qed + + +subsection\The "Borsukian" property of sets\ + +text\This doesn't have a standard name. Kuratowski uses "contractible with respect to [S^1]" + while Whyburn uses "property b". It's closely related to unicoherence.\ + +definition Borsukian where + "Borsukian S \ + \f. continuous_on S f \ f ` S \ (- {0::complex}) + \ (\a. homotopic_with (\h. True) S (- {0}) f (\x. a))" + +lemma Borsukian_retraction_gen: + assumes "Borsukian S" "continuous_on S h" "h ` S = T" + "continuous_on T k" "k ` T \ S" "\y. y \ T \ h(k y) = y" + shows "Borsukian T" +proof - + interpret R: Retracts S h T k + using assms by (simp add: Retracts.intro) + show ?thesis + using assms + apply (simp add: Borsukian_def, clarify) + apply (rule R.cohomotopically_trivial_retraction_null_gen [OF TrueI TrueI refl, of "-{0}"], auto) + done +qed + +lemma retract_of_Borsukian: "\Borsukian T; S retract_of T\ \ Borsukian S" + apply (auto simp: retract_of_def retraction_def) + apply (erule (1) Borsukian_retraction_gen) + apply (meson retraction retraction_def) + apply (auto simp: continuous_on_id) + done + +lemma homeomorphic_Borsukian: "\Borsukian S; S homeomorphic T\ \ Borsukian T" + using Borsukian_retraction_gen order_refl + by (fastforce simp add: homeomorphism_def homeomorphic_def) + +lemma homeomorphic_Borsukian_eq: + "S homeomorphic T \ Borsukian S \ Borsukian T" + by (meson homeomorphic_Borsukian homeomorphic_sym) + +lemma Borsukian_translation: + fixes S :: "'a::real_normed_vector set" + shows "Borsukian (image (\x. a + x) S) \ Borsukian S" + apply (rule homeomorphic_Borsukian_eq) + using homeomorphic_translation homeomorphic_sym by blast + +lemma Borsukian_injective_linear_image: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "linear f" "inj f" + shows "Borsukian(f ` S) \ Borsukian S" + apply (rule homeomorphic_Borsukian_eq) + using assms homeomorphic_sym linear_homeomorphic_image by blast + +lemma homotopy_eqv_Borsukianness: + fixes S :: "'a::real_normed_vector set" + and T :: "'b::real_normed_vector set" + assumes "S homotopy_eqv T" + shows "(Borsukian S \ Borsukian T)" + by (meson Borsukian_def assms homotopy_eqv_cohomotopic_triviality_null) + +lemma Borsukian_alt: + fixes S :: "'a::real_normed_vector set" + shows + "Borsukian S \ + (\f g. continuous_on S f \ f ` S \ -{0} \ + continuous_on S g \ g ` S \ -{0} + \ homotopic_with (\h. True) S (- {0::complex}) f g)" + unfolding Borsukian_def homotopic_triviality + by (simp add: path_connected_punctured_universe) + +lemma Borsukian_continuous_logarithm: + fixes S :: "'a::real_normed_vector set" + shows "Borsukian S \ + (\f. continuous_on S f \ f ` S \ (- {0::complex}) + \ (\g. continuous_on S g \ (\x \ S. f x = exp(g x))))" + by (simp add: Borsukian_def inessential_eq_continuous_logarithm) + +lemma Borsukian_continuous_logarithm_circle: + fixes S :: "'a::real_normed_vector set" + shows "Borsukian S \ + (\f. continuous_on S f \ f ` S \ sphere (0::complex) 1 + \ (\g. continuous_on S g \ (\x \ S. f x = exp(g x))))" + (is "?lhs = ?rhs") +proof + assume ?lhs then show ?rhs + by (force simp: Borsukian_continuous_logarithm) +next + assume RHS [rule_format]: ?rhs + show ?lhs + proof (clarsimp simp: Borsukian_continuous_logarithm) + fix f :: "'a \ complex" + assume contf: "continuous_on S f" and 0: "0 \ f ` S" + then have "continuous_on S (\x. f x / complex_of_real (cmod (f x)))" + by (intro continuous_intros) auto + moreover have "(\x. f x / complex_of_real (cmod (f x))) ` S \ sphere 0 1" + using 0 by (auto simp: norm_divide) + ultimately obtain g where contg: "continuous_on S g" + and fg: "\x \ S. f x / complex_of_real (cmod (f x)) = exp(g x)" + using RHS [of "\x. f x / of_real(norm(f x))"] by auto + show "\g. continuous_on S g \ (\x\S. f x = exp (g x))" + proof (intro exI ballI conjI) + show "continuous_on S (\x. (Ln \ of_real \ norm \ f)x + g x)" + by (intro continuous_intros contf contg conjI) (use "0" in auto) + show "f x = exp ((Ln \ complex_of_real \ cmod \ f) x + g x)" if "x \ S" for x + using 0 that + apply (clarsimp simp: exp_add) + apply (subst exp_Ln, force) + by (metis eq_divide_eq exp_not_eq_zero fg mult.commute) + qed + qed +qed + + +lemma Borsukian_continuous_logarithm_circle_real: + fixes S :: "'a::real_normed_vector set" + shows "Borsukian S \ + (\f. continuous_on S f \ f ` S \ sphere (0::complex) 1 + \ (\g. continuous_on S (complex_of_real \ g) \ (\x \ S. f x = exp(ii * of_real(g x)))))" + (is "?lhs = ?rhs") +proof + assume LHS: ?lhs + show ?rhs + proof (clarify) + fix f :: "'a \ complex" + assume "continuous_on S f" and f01: "f ` S \ sphere 0 1" + then obtain g where contg: "continuous_on S g" and "\x. x \ S \ f x = exp(g x)" + using LHS by (auto simp: Borsukian_continuous_logarithm_circle) + then have "\x\S. f x = exp (\ * complex_of_real ((Im \ g) x))" + using f01 apply (simp add: image_iff subset_iff) + by (metis cis_conv_exp exp_eq_polar mult.left_neutral norm_exp_eq_Re of_real_1) + then show "\g. continuous_on S (complex_of_real \ g) \ (\x\S. f x = exp (\ * complex_of_real (g x)))" + by (rule_tac x="Im \ g" in exI) (force intro: continuous_intros contg) + qed +next + assume RHS [rule_format]: ?rhs + show ?lhs + proof (clarsimp simp: Borsukian_continuous_logarithm_circle) + fix f :: "'a \ complex" + assume "continuous_on S f" and f01: "f ` S \ sphere 0 1" + then obtain g where contg: "continuous_on S (complex_of_real \ g)" and "\x. x \ S \ f x = exp(ii * of_real(g x))" + by (metis RHS) + then show "\g. continuous_on S g \ (\x\S. f x = exp (g x))" + by (rule_tac x="\x. ii* of_real(g x)" in exI) (auto simp: continuous_intros contg) + qed +qed + +lemma Borsukian_circle: + fixes S :: "'a::real_normed_vector set" + shows "Borsukian S \ + (\f. continuous_on S f \ f ` S \ sphere (0::complex) 1 + \ (\a. homotopic_with (\h. True) S (sphere (0::complex) 1) f (\x. a)))" +by (simp add: inessential_eq_continuous_logarithm_circle Borsukian_continuous_logarithm_circle_real) + +lemma contractible_imp_Borsukian: "contractible S \ Borsukian S" + by (meson Borsukian_def nullhomotopic_from_contractible) + +lemma simply_connected_imp_Borsukian: + fixes S :: "'a::real_normed_vector set" + shows "\simply_connected S; locally path_connected S\ \ Borsukian S" + apply (simp add: Borsukian_continuous_logarithm) + by (metis (no_types, lifting) continuous_logarithm_on_simply_connected image_iff) + +lemma starlike_imp_Borsukian: + fixes S :: "'a::real_normed_vector set" + shows "starlike S \ Borsukian S" + by (simp add: contractible_imp_Borsukian starlike_imp_contractible) + +lemma Borsukian_empty: "Borsukian {}" + by (auto simp: contractible_imp_Borsukian) + +lemma Borsukian_UNIV: "Borsukian (UNIV :: 'a::real_normed_vector set)" + by (auto simp: contractible_imp_Borsukian) + +lemma convex_imp_Borsukian: + fixes S :: "'a::real_normed_vector set" + shows "convex S \ Borsukian S" + by (meson Borsukian_def convex_imp_contractible nullhomotopic_from_contractible) + +lemma Borsukian_sphere: + fixes a :: "'a::euclidean_space" + shows "3 \ DIM('a) \ Borsukian (sphere a r)" + apply (rule simply_connected_imp_Borsukian) + using simply_connected_sphere apply blast + using ENR_imp_locally_path_connected ENR_sphere by blast + +lemma Borsukian_open_Un: + fixes S :: "'a::real_normed_vector set" + assumes opeS: "openin (subtopology euclidean (S \ T)) S" + and opeT: "openin (subtopology euclidean (S \ T)) T" + and BS: "Borsukian S" and BT: "Borsukian T" and ST: "connected(S \ T)" + shows "Borsukian(S \ T)" +proof (clarsimp simp add: Borsukian_continuous_logarithm) + fix f :: "'a \ complex" + assume contf: "continuous_on (S \ T) f" and 0: "0 \ f ` (S \ T)" + then have contfS: "continuous_on S f" and contfT: "continuous_on T f" + using continuous_on_subset by auto + have "\continuous_on S f; f ` S \ -{0}\ \ \g. continuous_on S g \ (\x \ S. f x = exp(g x))" + using BS by (auto simp: Borsukian_continuous_logarithm) + then obtain g where contg: "continuous_on S g" and fg: "\x. x \ S \ f x = exp(g x)" + using "0" contfS by blast + have "\continuous_on T f; f ` T \ -{0}\ \ \g. continuous_on T g \ (\x \ T. f x = exp(g x))" + using BT by (auto simp: Borsukian_continuous_logarithm) + then obtain h where conth: "continuous_on T h" and fh: "\x. x \ T \ f x = exp(h x)" + using "0" contfT by blast + show "\g. continuous_on (S \ T) g \ (\x\S \ T. f x = exp (g x))" + proof (cases "S \ T = {}") + case True + show ?thesis + proof (intro exI conjI) + show "continuous_on (S \ T) (\x. if x \ S then g x else h x)" + apply (rule continuous_on_cases_local_open [OF opeS opeT contg conth]) + using True by blast + show "\x\S \ T. f x = exp (if x \ S then g x else h x)" + using fg fh by auto + qed + next + case False + have "\a. \x\S \ T. g x - h x = a" + proof (rule continuous_discrete_range_constant [OF ST]) + show "continuous_on (S \ T) (\x. g x - h x)" + apply (intro continuous_intros) + apply (meson contg continuous_on_subset inf_le1) + by (meson conth continuous_on_subset inf_sup_ord(2)) + show "\e>0. \y. y \ S \ T \ g y - h y \ g x - h x \ e \ cmod (g y - h y - (g x - h x))" + if "x \ S \ T" for x + proof - + have "g y - g x = h y - h x" + if "y \ S" "y \ T" "cmod (g y - g x - (h y - h x)) < 2 * pi" for y + proof (rule exp_complex_eqI) + have "\Im (g y - g x) - Im (h y - h x)\ \ cmod (g y - g x - (h y - h x))" + by (metis abs_Im_le_cmod minus_complex.simps(2)) + then show "\Im (g y - g x) - Im (h y - h x)\ < 2 * pi" + using that by linarith + have "exp (g x) = exp (h x)" "exp (g y) = exp (h y)" + using fg fh that \x \ S \ T\ by fastforce+ + then show "exp (g y - g x) = exp (h y - h x)" + by (simp add: exp_diff) + qed + then show ?thesis + by (rule_tac x="2*pi" in exI) (fastforce simp add: algebra_simps) + qed + qed + then obtain a where a: "\x. x \ S \ T \ g x - h x = a" by blast + with False have "exp a = 1" + by (metis IntI disjoint_iff_not_equal divide_self_if exp_diff exp_not_eq_zero fg fh) + with a show ?thesis + apply (rule_tac x="\x. if x \ S then g x else a + h x" in exI) + apply (intro continuous_on_cases_local_open opeS opeT contg conth continuous_intros conjI) + apply (auto simp: algebra_simps fg fh exp_add) + done + qed +qed + +text\The proof is a duplicate of that of @{text Borsukian_open_Un}.\ +lemma Borsukian_closed_Un: + fixes S :: "'a::real_normed_vector set" + assumes cloS: "closedin (subtopology euclidean (S \ T)) S" + and cloT: "closedin (subtopology euclidean (S \ T)) T" + and BS: "Borsukian S" and BT: "Borsukian T" and ST: "connected(S \ T)" + shows "Borsukian(S \ T)" +proof (clarsimp simp add: Borsukian_continuous_logarithm) + fix f :: "'a \ complex" + assume contf: "continuous_on (S \ T) f" and 0: "0 \ f ` (S \ T)" + then have contfS: "continuous_on S f" and contfT: "continuous_on T f" + using continuous_on_subset by auto + have "\continuous_on S f; f ` S \ -{0}\ \ \g. continuous_on S g \ (\x \ S. f x = exp(g x))" + using BS by (auto simp: Borsukian_continuous_logarithm) + then obtain g where contg: "continuous_on S g" and fg: "\x. x \ S \ f x = exp(g x)" + using "0" contfS by blast + have "\continuous_on T f; f ` T \ -{0}\ \ \g. continuous_on T g \ (\x \ T. f x = exp(g x))" + using BT by (auto simp: Borsukian_continuous_logarithm) + then obtain h where conth: "continuous_on T h" and fh: "\x. x \ T \ f x = exp(h x)" + using "0" contfT by blast + show "\g. continuous_on (S \ T) g \ (\x\S \ T. f x = exp (g x))" + proof (cases "S \ T = {}") + case True + show ?thesis + proof (intro exI conjI) + show "continuous_on (S \ T) (\x. if x \ S then g x else h x)" + apply (rule continuous_on_cases_local [OF cloS cloT contg conth]) + using True by blast + show "\x\S \ T. f x = exp (if x \ S then g x else h x)" + using fg fh by auto + qed + next + case False + have "\a. \x\S \ T. g x - h x = a" + proof (rule continuous_discrete_range_constant [OF ST]) + show "continuous_on (S \ T) (\x. g x - h x)" + apply (intro continuous_intros) + apply (meson contg continuous_on_subset inf_le1) + by (meson conth continuous_on_subset inf_sup_ord(2)) + show "\e>0. \y. y \ S \ T \ g y - h y \ g x - h x \ e \ cmod (g y - h y - (g x - h x))" + if "x \ S \ T" for x + proof - + have "g y - g x = h y - h x" + if "y \ S" "y \ T" "cmod (g y - g x - (h y - h x)) < 2 * pi" for y + proof (rule exp_complex_eqI) + have "\Im (g y - g x) - Im (h y - h x)\ \ cmod (g y - g x - (h y - h x))" + by (metis abs_Im_le_cmod minus_complex.simps(2)) + then show "\Im (g y - g x) - Im (h y - h x)\ < 2 * pi" + using that by linarith + have "exp (g x) = exp (h x)" "exp (g y) = exp (h y)" + using fg fh that \x \ S \ T\ by fastforce+ + then show "exp (g y - g x) = exp (h y - h x)" + by (simp add: exp_diff) + qed + then show ?thesis + by (rule_tac x="2*pi" in exI) (fastforce simp add: algebra_simps) + qed + qed + then obtain a where a: "\x. x \ S \ T \ g x - h x = a" by blast + with False have "exp a = 1" + by (metis IntI disjoint_iff_not_equal divide_self_if exp_diff exp_not_eq_zero fg fh) + with a show ?thesis + apply (rule_tac x="\x. if x \ S then g x else a + h x" in exI) + apply (intro continuous_on_cases_local cloS cloT contg conth continuous_intros conjI) + apply (auto simp: algebra_simps fg fh exp_add) + done + qed +qed + +lemma Borsukian_separation_compact: + fixes S :: "complex set" + assumes "compact S" + shows "Borsukian S \ connected(- S)" + by (simp add: Borsuk_separation_theorem Borsukian_circle assms) + +lemma Borsukian_monotone_image_compact: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "Borsukian S" and contf: "continuous_on S f" and fim: "f ` S = T" + and "compact S" and conn: "\y. y \ T \ connected {x. x \ S \ f x = y}" + shows "Borsukian T" +proof (clarsimp simp add: Borsukian_continuous_logarithm) + fix g :: "'b \ complex" + assume contg: "continuous_on T g" and 0: "0 \ g ` T" + have "continuous_on S (g \ f)" + using contf contg continuous_on_compose fim by blast + moreover have "(g \ f) ` S \ -{0}" + using fim 0 by auto + ultimately obtain h where conth: "continuous_on S h" and gfh: "\x. x \ S \ (g \ f) x = exp(h x)" + using \Borsukian S\ by (auto simp: Borsukian_continuous_logarithm) + have "\y. \x. y \ T \ x \ S \ f x = y" + using fim by auto + then obtain f' where f': "\y. y \ T \ f' y \ S \ f (f' y) = y" + by metis + have *: "\a. \x \ {x. x \ S \ f x = y}. h x - h(f' y) = a" if "y \ T" for y + proof (rule continuous_discrete_range_constant, simp_all add: algebra_simps) + show "\e>0. \u. u \ S \ f u = y \ h u \ h x \ e \ cmod (h u - h x)" + if x: "x \ S \ f x = y" for x + proof - + have "h u = h x" if "u \ S" "f u = y" "cmod (h u - h x) < 2 * pi" for u + proof (rule exp_complex_eqI) + have "\Im (h u) - Im (h x)\ \ cmod (h u - h x)" + by (metis abs_Im_le_cmod minus_complex.simps(2)) + then show "\Im (h u) - Im (h x)\ < 2 * pi" + using that by linarith + show "exp (h u) = exp (h x)" + by (simp add: gfh [symmetric] x that) + qed + then show ?thesis + by (rule_tac x="2*pi" in exI) (fastforce simp add: algebra_simps) + qed + show "continuous_on {x \ S. f x = y} (\x. h x - h (f' y))" + by (intro continuous_intros continuous_on_subset [OF conth]) auto + qed (simp add: conn that) + have "h x = h (f' (f x))" if "x \ S" for x + using * [of "f x"] fim that apply clarsimp + by (metis f' imageI right_minus_eq) + moreover have "\x. x \ T \ \u. u \ S \ x = f u \ h (f' x) = h u" + using f' by fastforce + ultimately + have eq: "((\x. (x, (h \ f') x)) ` T) = + {p. \x. x \ S \ (x, p) \ {z \ S \ UNIV. snd z - ((f \ fst) z, (h \ fst) z) \ {0}}}" + using fim by (auto simp: image_iff) + show "\h. continuous_on T h \ (\x\T. g x = exp (h x))" + proof (intro exI conjI) + show "continuous_on T (h \ f')" + proof (rule continuous_from_closed_graph [of "h ` S"]) + show "compact (h ` S)" + by (simp add: \compact S\ compact_continuous_image conth) + show "(h \ f') ` T \ h ` S" + by (auto simp: f') + show "closed ((\x. (x, (h \ f') x)) ` T)" + apply (subst eq) + apply (intro closed_compact_projection [OF \compact S\] continuous_closed_preimage + continuous_intros continuous_on_subset [OF contf] continuous_on_subset [OF conth]) + apply (auto simp: \compact S\ closed_Times compact_imp_closed) + done + qed + qed (use f' gfh in fastforce) +qed + + +lemma Borsukian_open_map_image_compact: + fixes f :: "'a::euclidean_space \ 'b::euclidean_space" + assumes "Borsukian S" and contf: "continuous_on S f" and fim: "f ` S = T" and "compact S" + and ope: "\U. openin (subtopology euclidean S) U + \ openin (subtopology euclidean T) (f ` U)" + shows "Borsukian T" +proof (clarsimp simp add: Borsukian_continuous_logarithm_circle_real) + fix g :: "'b \ complex" + assume contg: "continuous_on T g" and gim: "g ` T \ sphere 0 1" + have "continuous_on S (g \ f)" + using contf contg continuous_on_compose fim by blast + moreover have "(g \ f) ` S \ sphere 0 1" + using fim gim by auto + ultimately obtain h where cont_cxh: "continuous_on S (complex_of_real \ h)" + and gfh: "\x. x \ S \ (g \ f) x = exp(ii * of_real(h x))" + using \Borsukian S\ Borsukian_continuous_logarithm_circle_real by metis + then have conth: "continuous_on S h" + by simp + have "\x. x \ S \ f x = y \ (\x' \ S. f x' = y \ h x \ h x')" if "y \ T" for y + proof - + have 1: "compact (h ` {x \ S. f x = y})" + proof (rule compact_continuous_image) + show "continuous_on {x \ S. f x = y} h" + by (rule continuous_on_subset [OF conth]) auto + have "compact {x \ S. f x \ {y}}" + by (rule proper_map_from_compact [OF contf _ \compact S\, of T]) (simp_all add: fim that) + then show "compact {x \ S. f x = y}" by simp + qed + have 2: "h ` {x \ S. f x = y} \ {}" + using fim that by auto + have "\s \ h ` {x \ S. f x = y}. \t \ h ` {x \ S. f x = y}. s \ t" + using compact_attains_inf [OF 1 2] by blast + then show ?thesis by auto + qed + then obtain k where kTS: "\y. y \ T \ k y \ S" + and fk: "\y. y \ T \ f (k y) = y " + and hle: "\x' y. \y \ T; x' \ S; f x' = y\ \ h (k y) \ h x'" + by metis + have "continuous_on T (h \ k)" + proof (clarsimp simp add: continuous_on_iff) + fix y and e::real + assume "y \ T" "0 < e" + moreover have "uniformly_continuous_on S (complex_of_real \ h)" + using \compact S\ cont_cxh compact_uniformly_continuous by blast + ultimately obtain d where "0 < d" + and d: "\x x'. \x\S; x'\S; dist x' x < d\ \ dist (h x') (h x) < e" + by (force simp: uniformly_continuous_on_def) + obtain \ where "0 < \" and \: + "\x'. \x' \ T; dist y x' < \\ + \ (\v \ {z \ S. f z = y}. \v'. v' \ {z \ S. f z = x'} \ dist v v' < d) \ + (\v' \ {z \ S. f z = x'}. \v. v \ {z \ S. f z = y} \ dist v' v < d)" + proof (rule upper_lower_hemicontinuous_explicit [of T "\y. {z \ S. f z = y}" S]) + show "\U. openin (subtopology euclidean S) U + \ openin (subtopology euclidean T) {x \ T. {z \ S. f z = x} \ U}" + using continuous_imp_closed_map closed_map_iff_upper_hemicontinuous_preimage [OF fim [THEN equalityD1]] + by (simp add: continuous_imp_closed_map \compact S\ contf fim) + show "\U. closedin (subtopology euclidean S) U \ + closedin (subtopology euclidean T) {x \ T. {z \ S. f z = x} \ U}" + using ope open_map_iff_lower_hemicontinuous_preimage [OF fim [THEN equalityD1]] + by meson + show "bounded {z \ S. f z = y}" + by (metis (no_types, lifting) compact_imp_bounded [OF \compact S\] bounded_subset mem_Collect_eq subsetI) + qed (use \y \ T\ \0 < d\ fk kTS in \force+\) + have "dist (h (k y')) (h (k y)) < e" if "y' \ T" "dist y y' < \" for y' + proof - + have k1: "k y \ S" "f (k y) = y" and k2: "k y' \ S" "f (k y') = y'" + by (auto simp: \y \ T\ \y' \ T\ kTS fk) + have 1: "\v. \v \ S; f v = y\ \ \v'. v' \ {z \ S. f z = y'} \ dist v v' < d" + and 2: "\v'. \v' \ S; f v' = y'\ \ \v. v \ {z \ S. f z = y} \ dist v' v < d" + using \ [OF that] by auto + then obtain w' w where "w' \ S" "f w' = y'" "dist (k y) w' < d" + and "w \ S" "f w = y" "dist (k y') w < d" + using 1 [OF k1] 2 [OF k2] by auto + then show ?thesis + using d [of w "k y'"] d [of w' "k y"] k1 k2 \y' \ T\ \y \ T\ hle + by (fastforce simp: dist_norm abs_diff_less_iff algebra_simps) + qed + then show "\d>0. \x'\T. dist x' y < d \ dist (h (k x')) (h (k y)) < e" + using \0 < \\ by (auto simp: dist_commute) + qed + then show "\h. continuous_on T h \ (\x\T. g x = exp (\ * complex_of_real (h x)))" + using fk gfh kTS by force +qed + end diff -r bb70dc05cd38 -r e5d4bc2016a6 src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Jan 09 00:08:18 2017 +0100 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Mon Jan 09 14:00:13 2017 +0000 @@ -98,6 +98,39 @@ continuous_on (s \ t) (\x. if P x then f x else g x)" by (rule continuous_on_If) auto +lemma open_sums: + fixes T :: "('b::real_normed_vector) set" + assumes "open S \ open T" + shows "open (\x\ S. \y \ T. {x + y})" + using assms +proof + assume S: "open S" + show ?thesis + proof (clarsimp simp: open_dist) + fix x y + assume "x \ S" "y \ T" + with S obtain e where "e > 0" and e: "\x'. dist x' x < e \ x' \ S" + by (auto simp: open_dist) + then have "\z. dist z (x + y) < e \ \x\S. \y\T. z = x + y" + by (metis \y \ T\ diff_add_cancel dist_add_cancel2) + then show "\e>0. \z. dist z (x + y) < e \ (\x\S. \y\T. z = x + y)" + using \0 < e\ \x \ S\ by blast + qed +next + assume T: "open T" + show ?thesis + proof (clarsimp simp: open_dist) + fix x y + assume "x \ S" "y \ T" + with T obtain e where "e > 0" and e: "\x'. dist x' y < e \ x' \ T" + by (auto simp: open_dist) + then have "\z. dist z (x + y) < e \ \x\S. \y\T. z = x + y" + by (metis \x \ S\ add_diff_cancel_left' add_diff_eq diff_diff_add dist_norm) + then show "\e>0. \z. dist z (x + y) < e \ (\x\S. \y\T. z = x + y)" + using \0 < e\ \y \ T\ by blast + qed +qed + subsection \Topological Basis\ @@ -635,6 +668,23 @@ finally show "openin U S" . qed +lemma openin_INT [intro]: + assumes "finite I" + "\i. i \ I \ openin T (U i)" + shows "openin T ((\i \ I. U i) \ topspace T)" +using assms by (induct, auto simp add: inf_sup_aci(2) openin_Int) + +lemma openin_INT2 [intro]: + assumes "finite I" "I \ {}" + "\i. i \ I \ openin T (U i)" + shows "openin T (\i \ I. U i)" +proof - + have "(\i \ I. U i) \ topspace T" + using `I \ {}` openin_subset[OF assms(3)] by auto + then show ?thesis + using openin_INT[of _ _ U, OF assms(1) assms(3)] by (simp add: inf.absorb2 inf_commute) +qed + subsubsection \Closed sets\ @@ -2123,6 +2173,9 @@ lemma interior_complement: "interior (- S) = - closure S" by (simp add: closure_interior) + +lemma interior_diff: "interior(S - T) = interior S - closure T" + by (simp add: Diff_eq interior_complement) lemma closure_Times: "closure (A \ B) = closure A \ closure B" proof (rule closure_unique) diff -r bb70dc05cd38 -r e5d4bc2016a6 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Mon Jan 09 00:08:18 2017 +0100 +++ b/src/HOL/Topological_Spaces.thy Mon Jan 09 14:00:13 2017 +0000 @@ -2102,32 +2102,35 @@ by (meson assms compact_eq_heine_borel) lemma compactE_image: - assumes "compact s" - and "\t\C. open (f t)" - and "s \ (\c\C. f c)" - obtains C' where "C' \ C" and "finite C'" and "s \ (\c\C'. f c)" + assumes "compact S" + and "\T\C. open (f T)" + and "S \ (\c\C. f c)" + obtains C' where "C' \ C" and "finite C'" and "S \ (\c\C'. f c)" using assms unfolding ball_simps [symmetric] - by (metis (lifting) finite_subset_image compact_eq_heine_borel[of s]) + by (metis (lifting) finite_subset_image compact_eq_heine_borel[of S]) lemma compact_Int_closed [intro]: - assumes "compact s" - and "closed t" - shows "compact (s \ t)" + assumes "compact S" + and "closed T" + shows "compact (S \ T)" proof (rule compactI) fix C assume C: "\c\C. open c" - assume cover: "s \ t \ \C" - from C \closed t\ have "\c\C \ {- t}. open c" + assume cover: "S \ T \ \C" + from C \closed T\ have "\c\C \ {- T}. open c" by auto - moreover from cover have "s \ \(C \ {- t})" + moreover from cover have "S \ \(C \ {- T})" by auto - ultimately have "\D\C \ {- t}. finite D \ s \ \D" - using \compact s\ unfolding compact_eq_heine_borel by auto - then obtain D where "D \ C \ {- t} \ finite D \ s \ \D" .. - then show "\D\C. finite D \ s \ t \ \D" - by (intro exI[of _ "D - {-t}"]) auto + ultimately have "\D\C \ {- T}. finite D \ S \ \D" + using \compact S\ unfolding compact_eq_heine_borel by auto + then obtain D where "D \ C \ {- T} \ finite D \ S \ \D" .. + then show "\D\C. finite D \ S \ T \ \D" + by (intro exI[of _ "D - {-T}"]) auto qed +lemma compact_diff: "\compact S; open T\ \ compact(S - T)" + by (simp add: Diff_eq compact_Int_closed open_closed) + lemma inj_setminus: "inj_on uminus (A::'a set set)" by (auto simp: inj_on_def)