# HG changeset patch # User paulson # Date 1508429773 -3600 # Node ID d3d508b23d1d06da2d7c87724a98d8523b992c3e # Parent ee874941dfb830f7cee386bf9560e2994c97003a# Parent c2128ab11f6171220bbae0d52ee0f3bca4ed5497 merged diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Brouwer_Fixpoint.thy --- a/src/HOL/Analysis/Brouwer_Fixpoint.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Brouwer_Fixpoint.thy Thu Oct 19 17:16:13 2017 +0100 @@ -2279,7 +2279,7 @@ lemma retraction_imp_quotient_map: "retraction s t r \ u \ t - \ (openin (subtopology euclidean s) {x. x \ s \ r x \ u} \ + \ (openin (subtopology euclidean s) (s \ r -` u) \ openin (subtopology euclidean t) u)" apply (clarsimp simp add: retraction) apply (rule continuous_right_inverse_imp_quotient_map [where g=r]) @@ -2941,21 +2941,21 @@ and eq: "\x. x \ T \ f' x = (g \ f) x" by (metis Dugundji [OF C cloUT contgf gfTC]) show ?thesis - proof (rule_tac V = "{x \ U. f' x \ D}" and g = "h o r o f'" in that) - show "T \ {x \ U. f' x \ D}" + proof (rule_tac V = "U \ f' -` D" and g = "h o r o f'" in that) + show "T \ U \ f' -` D" using cloUT closedin_imp_subset \S' \ D\ \f ` T \ S\ eq homeomorphism_image1 homgh by fastforce - show ope: "openin (subtopology euclidean U) {x \ U. f' x \ D}" + show ope: "openin (subtopology euclidean U) (U \ f' -` D)" using \f' ` U \ C\ by (auto simp: opD contf' continuous_openin_preimage) - have conth: "continuous_on (r ` f' ` {x \ U. f' x \ D}) h" + have conth: "continuous_on (r ` f' ` (U \ f' -` D)) h" apply (rule continuous_on_subset [of S']) using homeomorphism_def homgh apply blast using \r ` D \ S'\ by blast - show "continuous_on {x \ U. f' x \ D} (h \ r \ f')" + show "continuous_on (U \ f' -` D) (h \ r \ f')" apply (intro continuous_on_compose conth continuous_on_subset [OF contr] continuous_on_subset [OF contf'], auto) done - show "(h \ r \ f') ` {x \ U. f' x \ D} \ S" + show "(h \ r \ f') ` (U \ f' -` D) \ S" using \homeomorphism S S' g h\ \f' ` U \ C\ \r ` D \ S'\ by (auto simp: homeomorphism_def) show "\x. x \ T \ (h \ r \ f') x = f x" @@ -3150,36 +3150,36 @@ have "S' \ W" using WS' closedin_closed by auto have him: "\x. x \ S' \ h x \ X" by (metis (no_types) \S retract_of X\ hg hom homeomorphism_def image_insert insert_absorb insert_iff retract_of_imp_subset subset_eq) - have "S' retract_of {x \ W. h x \ X}" + have "S' retract_of (W \ h -` X)" proof (simp add: retraction_def retract_of_def, intro exI conjI) - show "S' \ {x \ W. h x \ X}" - using him WS' closedin_imp_subset by blast - show "continuous_on {x \ W. h x \ X} (f o r o h)" + show "S' \ W" "S' \ h -` X" + using him WS' closedin_imp_subset by blast+ + show "continuous_on (W \ h -` X) (f o r o h)" proof (intro continuous_on_compose) - show "continuous_on {x \ W. h x \ X} h" - by (metis (no_types) Collect_restrict conth continuous_on_subset) - show "continuous_on (h ` {x \ W. h x \ X}) r" + show "continuous_on (W \ h -` X) h" + by (meson conth continuous_on_subset inf_le1) + show "continuous_on (h ` (W \ h -` X)) r" proof - - have "h ` {b \ W. h b \ X} \ X" + have "h ` (W \ h -` X) \ X" by blast - then show "continuous_on (h ` {b \ W. h b \ X}) r" + then show "continuous_on (h ` (W \ h -` X)) r" by (meson \retraction X S r\ continuous_on_subset retraction) qed - show "continuous_on (r ` h ` {x \ W. h x \ X}) f" + show "continuous_on (r ` h ` (W \ h -` X)) f" apply (rule continuous_on_subset [of S]) using hom homeomorphism_def apply blast apply clarify apply (meson \retraction X S r\ subsetD imageI retraction_def) done qed - show "(f \ r \ h) ` {x \ W. h x \ X} \ S'" + show "(f \ r \ h) ` (W \ h -` X) \ S'" using \retraction X S r\ hom by (auto simp: retraction_def homeomorphism_def) show "\x\S'. (f \ r \ h) x = x" using \retraction X S r\ hom by (auto simp: retraction_def homeomorphism_def hg) qed then show ?thesis - apply (rule_tac V = "{x. x \ W \ h x \ X}" in that) + apply (rule_tac V = "W \ h -` X" in that) apply (rule openin_trans [OF _ UW]) using \continuous_on W h\ \open X\ continuous_openin_preimage_eq apply blast+ done @@ -3248,8 +3248,7 @@ using \ANR S\ apply (simp add: ANR_def) apply (drule_tac x=UNIV in spec) - apply (drule_tac x=T in spec) - apply (auto simp: closed_closedin) + apply (drule_tac x=T in spec, clarsimp) apply (meson ENR_def ENR_homeomorphic_ENR open_openin) done qed @@ -3455,10 +3454,10 @@ define W where "W \ {x \ U. setdist {x} S = setdist {x} T}" have US': "closedin (subtopology euclidean U) S'" using continuous_closedin_preimage [of U "\x. setdist {x} S - setdist {x} T" "{..0}"] - by (simp add: S'_def continuous_intros) + by (simp add: S'_def vimage_def Collect_conj_eq continuous_on_diff continuous_on_setdist) have UT': "closedin (subtopology euclidean U) T'" using continuous_closedin_preimage [of U "\x. setdist {x} T - setdist {x} S" "{..0}"] - by (simp add: T'_def continuous_intros) + by (simp add: T'_def vimage_def Collect_conj_eq continuous_on_diff continuous_on_setdist) have "S \ S'" using S'_def \S \ U\ setdist_sing_in_set by fastforce have "T \ T'" @@ -3543,19 +3542,19 @@ proof - obtain f g where hom: "homeomorphism (S \ T) C f g" using hom by (force simp: homeomorphic_def) - have US: "closedin (subtopology euclidean U) {x \ C. g x \ S}" + have US: "closedin (subtopology euclidean U) (C \ g -` S)" apply (rule closedin_trans [OF _ UC]) apply (rule continuous_closedin_preimage_gen [OF _ _ STS]) using hom homeomorphism_def apply blast apply (metis hom homeomorphism_def set_eq_subset) done - have UT: "closedin (subtopology euclidean U) {x \ C. g x \ T}" + have UT: "closedin (subtopology euclidean U) (C \ g -` T)" apply (rule closedin_trans [OF _ UC]) apply (rule continuous_closedin_preimage_gen [OF _ _ STT]) using hom homeomorphism_def apply blast apply (metis hom homeomorphism_def set_eq_subset) done - have ARS: "AR {x \ C. g x \ S}" + have ARS: "AR (C \ g -` S)" apply (rule AR_homeomorphic_AR [OF \AR S\]) apply (simp add: homeomorphic_def) apply (rule_tac x=g in exI) @@ -3563,7 +3562,7 @@ using hom apply (auto simp: homeomorphism_def elim!: continuous_on_subset) apply (rule_tac x="f x" in image_eqI, auto) done - have ART: "AR {x \ C. g x \ T}" + have ART: "AR (C \ g -` T)" apply (rule AR_homeomorphic_AR [OF \AR T\]) apply (simp add: homeomorphic_def) apply (rule_tac x=g in exI) @@ -3571,7 +3570,7 @@ using hom apply (auto simp: homeomorphism_def elim!: continuous_on_subset) apply (rule_tac x="f x" in image_eqI, auto) done - have ARI: "AR ({x \ C. g x \ S} \ {x \ C. g x \ T})" + have ARI: "AR ((C \ g -` S) \ (C \ g -` T))" apply (rule AR_homeomorphic_AR [OF \AR (S \ T)\]) apply (simp add: homeomorphic_def) apply (rule_tac x=g in exI) @@ -3580,7 +3579,7 @@ apply (auto simp: homeomorphism_def elim!: continuous_on_subset) apply (rule_tac x="f x" in image_eqI, auto) done - have "C = {x \ C. g x \ S} \ {x \ C. g x \ T}" + have "C = (C \ g -` S) \ (C \ g -` T)" using hom by (auto simp: homeomorphism_def) then show ?thesis by (metis AR_closed_Un_local_aux [OF US UT ARS ART ARI]) @@ -3615,10 +3614,10 @@ define W where "W \ {x \ U. setdist {x} S = setdist {x} T}" have cloUS': "closedin (subtopology euclidean U) S'" using continuous_closedin_preimage [of U "\x. setdist {x} S - setdist {x} T" "{..0}"] - by (simp add: S'_def continuous_intros) + by (simp add: S'_def vimage_def Collect_conj_eq continuous_on_diff continuous_on_setdist) have cloUT': "closedin (subtopology euclidean U) T'" using continuous_closedin_preimage [of U "\x. setdist {x} T - setdist {x} S" "{..0}"] - by (simp add: T'_def continuous_intros) + by (simp add: T'_def vimage_def Collect_conj_eq continuous_on_diff continuous_on_setdist) have "S \ S'" using S'_def \S \ U\ setdist_sing_in_set by fastforce have "T \ T'" @@ -3752,19 +3751,19 @@ proof - obtain f g where hom: "homeomorphism (S \ T) C f g" using hom by (force simp: homeomorphic_def) - have US: "closedin (subtopology euclidean U) {x \ C. g x \ S}" + have US: "closedin (subtopology euclidean U) (C \ g -` S)" apply (rule closedin_trans [OF _ UC]) apply (rule continuous_closedin_preimage_gen [OF _ _ STS]) using hom [unfolded homeomorphism_def] apply blast apply (metis hom homeomorphism_def set_eq_subset) done - have UT: "closedin (subtopology euclidean U) {x \ C. g x \ T}" + have UT: "closedin (subtopology euclidean U) (C \ g -` T)" apply (rule closedin_trans [OF _ UC]) apply (rule continuous_closedin_preimage_gen [OF _ _ STT]) using hom [unfolded homeomorphism_def] apply blast apply (metis hom homeomorphism_def set_eq_subset) done - have ANRS: "ANR {x \ C. g x \ S}" + have ANRS: "ANR (C \ g -` S)" apply (rule ANR_homeomorphic_ANR [OF \ANR S\]) apply (simp add: homeomorphic_def) apply (rule_tac x=g in exI) @@ -3772,7 +3771,7 @@ using hom apply (auto simp: homeomorphism_def elim!: continuous_on_subset) apply (rule_tac x="f x" in image_eqI, auto) done - have ANRT: "ANR {x \ C. g x \ T}" + have ANRT: "ANR (C \ g -` T)" apply (rule ANR_homeomorphic_ANR [OF \ANR T\]) apply (simp add: homeomorphic_def) apply (rule_tac x=g in exI) @@ -3780,7 +3779,7 @@ using hom apply (auto simp: homeomorphism_def elim!: continuous_on_subset) apply (rule_tac x="f x" in image_eqI, auto) done - have ANRI: "ANR ({x \ C. g x \ S} \ {x \ C. g x \ T})" + have ANRI: "ANR ((C \ g -` S) \ (C \ g -` T))" apply (rule ANR_homeomorphic_ANR [OF \ANR (S \ T)\]) apply (simp add: homeomorphic_def) apply (rule_tac x=g in exI) @@ -3789,8 +3788,8 @@ apply (auto simp: homeomorphism_def elim!: continuous_on_subset) apply (rule_tac x="f x" in image_eqI, auto) done - have "C = {x. x \ C \ g x \ S} \ {x. x \ C \ g x \ T}" - by auto (metis Un_iff hom homeomorphism_def imageI) + have "C = (C \ g -` S) \ (C \ g -` T)" + using hom by (auto simp: homeomorphism_def) then show ?thesis by (metis ANR_closed_Un_local_aux [OF US UT ANRS ANRT ANRI]) qed @@ -3822,13 +3821,13 @@ using fim by auto show "\V g. C \ V \ openin (subtopology euclidean U) V \ continuous_on V g \ g ` V \ S \ (\x\C. g x = f x)" proof (intro exI conjI) - show "C \ {x \ W. g x \ S}" + show "C \ W \ g -` S" using \C \ W\ fim geq by blast - show "openin (subtopology euclidean U) {x \ W. g x \ S}" + show "openin (subtopology euclidean U) (W \ g -` S)" by (metis (mono_tags, lifting) UW contg continuous_openin_preimage gim opeTS openin_trans) - show "continuous_on {x \ W. g x \ S} g" + show "continuous_on (W \ g -` S) g" by (blast intro: continuous_on_subset [OF contg]) - show "g ` {x \ W. g x \ S} \ S" + show "g ` (W \ g -` S) \ S" using gim by blast show "\x\C. g x = f x" using geq by blast @@ -4074,15 +4073,14 @@ apply (auto simp add: False closest_point_self affine_imp_convex closest_point_in_set continuous_on_closest_point) done finally have "rel_frontier S retract_of {x. closest_point (affine hull S) x \ a}" . - moreover have "openin (subtopology euclidean UNIV) {x \ UNIV. closest_point (affine hull S) x \ - {a}}" + moreover have "openin (subtopology euclidean UNIV) (UNIV \ closest_point (affine hull S) -` (- {a}))" apply (rule continuous_openin_preimage_gen) apply (auto simp add: False affine_imp_convex continuous_on_closest_point) done ultimately show ?thesis - apply (simp add: ENR_def) - apply (rule_tac x = "{x. x \ UNIV \ - closest_point (affine hull S) x \ (- {a})}" in exI) - apply simp + unfolding ENR_def + apply (rule_tac x = "closest_point (affine hull S) -` (- {a})" in exI) + apply (simp add: vimage_def) done qed @@ -4881,5 +4879,4 @@ using connected_complement_homeomorphic_convex_compact [OF assms] using \compact T\ compact_eq_bounded_closed connected_open_path_connected hom homeomorphic_compactness by blast - end diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Cauchy_Integral_Theorem.thy --- a/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Cauchy_Integral_Theorem.thy Thu Oct 19 17:16:13 2017 +0100 @@ -4111,30 +4111,29 @@ subsection\The winding number is constant on a connected region\ lemma winding_number_constant: - assumes \: "path \" and loop: "pathfinish \ = pathstart \" and cs: "connected s" and sg: "s \ path_image \ = {}" - obtains k where "\z. z \ s \ winding_number \ z = k" + assumes \: "path \" and loop: "pathfinish \ = pathstart \" and cs: "connected S" and sg: "S \ path_image \ = {}" + shows "winding_number \ constant_on S" proof - have *: "1 \ cmod (winding_number \ y - winding_number \ z)" - if ne: "winding_number \ y \ winding_number \ z" and "y \ s" "z \ s" for y z + if ne: "winding_number \ y \ winding_number \ z" and "y \ S" "z \ S" for y z proof - have "winding_number \ y \ \" "winding_number \ z \ \" - using that integer_winding_number [OF \ loop] sg \y \ s\ by auto + using that integer_winding_number [OF \ loop] sg \y \ S\ by auto with ne show ?thesis by (auto simp: Ints_def of_int_diff [symmetric] simp del: of_int_diff) qed - have cont: "continuous_on s (\w. winding_number \ w)" + have cont: "continuous_on S (\w. winding_number \ w)" using continuous_on_winding_number [OF \] sg by (meson continuous_on_subset disjoint_eq_subset_Compl) show ?thesis - apply (rule continuous_discrete_range_constant [OF cs cont]) - using "*" zero_less_one apply blast - by (simp add: that) + using "*" zero_less_one + by (blast intro: continuous_discrete_range_constant [OF cs cont]) qed lemma winding_number_eq: - "\path \; pathfinish \ = pathstart \; w \ s; z \ s; connected s; s \ path_image \ = {}\ + "\path \; pathfinish \ = pathstart \; w \ S; z \ S; connected S; S \ path_image \ = {}\ \ winding_number \ w = winding_number \ z" - using winding_number_constant by blast + using winding_number_constant by (metis constant_on_def) lemma open_winding_number_levelsets: assumes \: "path \" and loop: "pathfinish \ = pathstart \" @@ -4149,7 +4148,7 @@ have "\e>0. \y. dist y z < e \ y \ path_image \ \ winding_number \ y = winding_number \ z" apply (rule_tac x=e in exI) using e apply (simp add: dist_norm ball_def norm_minus_commute) - apply (auto simp: dist_norm norm_minus_commute intro!: winding_number_eq [OF assms, where s = "ball z e"]) + apply (auto simp: dist_norm norm_minus_commute intro!: winding_number_eq [OF assms, where S = "ball z e"]) done } then show ?thesis @@ -4171,11 +4170,11 @@ using B subset_ball by auto then have wout: "w \ outside (path_image \)" using w by blast - moreover obtain k where "\z. z \ outside (path_image \) \ winding_number \ z = k" + moreover have "winding_number \ constant_on outside (path_image \)" using winding_number_constant [OF \ loop, of "outside(path_image \)"] connected_outside by (metis DIM_complex bounded_path_image dual_order.refl \ outside_no_overlap) ultimately have "winding_number \ z = winding_number \ w" - using z by blast + by (metis (no_types, hide_lams) constant_on_def z) also have "... = 0" proof - have wnot: "w \ path_image \" using wout by (simp add: outside_def) diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Conformal_Mappings.thy --- a/src/HOL/Analysis/Conformal_Mappings.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Conformal_Mappings.thy Thu Oct 19 17:16:13 2017 +0100 @@ -127,7 +127,7 @@ apply (rule Cauchy_inequality) using holf holomorphic_on_subset apply force using holf holomorphic_on_imp_continuous_on holomorphic_on_subset apply blast - using \w \ 0\ apply (simp add:) + using \w \ 0\ apply simp by (metis nof wgeA dist_0_norm dist_norm) also have "... = fact k * (B * 1 / cmod w ^ (k-n))" apply (simp only: mult_cancel_left times_divide_eq_right [symmetric]) @@ -327,7 +327,7 @@ ultimately obtain w where w: "w \ frontier(cball \ r)" and now: "\x. x \ frontier(cball \ r) \ norm (f w) \ norm (f x)" apply (rule bexE [OF continuous_attains_inf [OF compact_frontier [OF compact_cball]]]) - apply (simp add:) + apply simp done then have fw: "0 < norm (f w)" by (simp add: fnz') @@ -336,7 +336,7 @@ then obtain v where v: "v \ frontier(cball \ r)" and nov: "\x. x \ frontier(cball \ r) \ norm (g v) \ norm (g x)" apply (rule bexE [OF continuous_attains_sup [OF compact_frontier [OF compact_cball] froc]]) - apply (simp add:) + apply simp done then have fv: "0 < norm (f v)" by (simp add: fnz') @@ -628,7 +628,7 @@ unfolding powf_def by (rule holomorphic_power_series [OF holfb w]) moreover have "(\i" apply (subst Groups_Big.comm_monoid_add_class.sum.setdiff_irrelevant [symmetric]) - apply (simp add:) + apply simp apply (simp only: dfz sing) apply (simp add: powf_def) done @@ -640,7 +640,7 @@ have "summable (\i. (deriv ^^ (i + n)) f \ * (w - \) ^ i / fact (i + n))" proof (cases "w=\") case False then show ?thesis - using summable_mult [OF *, of "1 / (w - \) ^ n"] by (simp add:) + using summable_mult [OF *, of "1 / (w - \) ^ n"] by simp next case True then show ?thesis by (auto simp: Power.semiring_1_class.power_0_left intro!: summable_finite [of "{0}"] @@ -716,7 +716,7 @@ apply (rule holomorphic_intros)+ using h holomorphic_on_open apply blast apply (rule holomorphic_intros)+ - using \0 < n\ apply (simp add:) + using \0 < n\ apply simp apply (rule holomorphic_intros)+ done show ?thesis @@ -924,7 +924,7 @@ using \0 < r\ by simp have "\B. 0 eventually (\z. cmod ((inverse \ f \ inverse) z) \ B) (at 0)" apply (rule exI [where x=1]) - apply (simp add:) + apply simp using tendstoD [OF lim [unfolded lim_at_infinity_0] zero_less_one] apply (rule eventually_mono) apply (simp add: dist_norm) @@ -969,8 +969,7 @@ qed then show ?thesis apply (rule_tac a = "\k. (deriv ^^ k) f 0 / (fact k)" and n=n in that) - apply (rule_tac A = "2/e" and B = "1/B" in Liouville_polynomial [OF holf]) - apply (simp add:) + apply (rule_tac A = "2/e" and B = "1/B" in Liouville_polynomial [OF holf], simp) done next case False @@ -1041,11 +1040,12 @@ have "bounded {z. (\i\n. c i * z ^ i) \ K}" using polyfun_extremal [where c=c and B="B+1", OF c] by (auto simp: bounded_pos eventually_at_infinity_pos *) - moreover have "closed {z. (\i\n. c i * z ^ i) \ K}" - apply (intro allI continuous_closed_preimage_univ continuous_intros) + moreover have "closed ((\z. (\i\n. c i * z ^ i)) -` K)" + apply (intro allI continuous_closed_vimage continuous_intros) using \compact K\ compact_eq_bounded_closed by blast ultimately show ?thesis - using closed_Int_compact [OF \closed S\] compact_eq_bounded_closed by blast + using closed_Int_compact [OF \closed S\] compact_eq_bounded_closed + by (auto simp add: vimage_def) qed corollary proper_map_polyfun_univ: @@ -1095,7 +1095,7 @@ fix e::real assume "0 < e" with compf [of "cball 0 (inverse e)"] show "\B. \x. B \ cmod x \ dist ((inverse \ f) x) 0 \ e" - apply (simp add:) + apply simp apply (clarsimp simp add: compact_eq_bounded_closed bounded_pos norm_inverse) apply (rule_tac x="b+1" in exI) apply (metis inverse_inverse_eq less_add_same_cancel2 less_imp_inverse_less add.commute not_le not_less_iff_gr_or_eq order_trans zero_less_one) @@ -1134,7 +1134,7 @@ with \\>0\ have "\\>0. \x. dist \ x < \ \ onorm (\v. deriv f x * v - deriv f \ * v) \ e/2" apply (rule_tac x="min \ \" in exI) apply (intro conjI allI impI Operator_Norm.onorm_le) - apply (simp add:) + apply simp apply (simp only: Rings.ring_class.left_diff_distrib [symmetric] norm_mult) apply (rule mult_right_mono [OF \]) apply (auto simp: dist_commute Rings.ordered_semiring_class.mult_right_mono \) diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Connected.thy --- a/src/HOL/Analysis/Connected.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Connected.thy Thu Oct 19 17:16:13 2017 +0100 @@ -395,29 +395,6 @@ by (simp add: th0 th1) qed -lemma connected_continuous_image: - assumes "continuous_on s f" - and "connected s" - shows "connected(f ` s)" -proof - - { - fix T - assume as: - "T \ {}" - "T \ f ` s" - "openin (subtopology euclidean (f ` s)) T" - "closedin (subtopology euclidean (f ` s)) T" - have "{x \ s. f x \ T} = {} \ {x \ s. f x \ T} = s" - using assms(1)[unfolded continuous_on_open, THEN spec[where x=T]] - using assms(1)[unfolded continuous_on_closed, THEN spec[where x=T]] - using assms(2)[unfolded connected_clopen, THEN spec[where x="{x \ s. f x \ T}"]] as(3,4) by auto - then have False using as(1,2) - using as(4)[unfolded closedin_def topspace_euclidean_subtopology] by auto - } - then show ?thesis - unfolding connected_clopen by auto -qed - lemma connected_linear_image: fixes f :: "'a::euclidean_space \ 'b::real_normed_vector" assumes "linear f" and "connected s" @@ -1442,13 +1419,13 @@ lemma continuous_closedin_preimage_constant: fixes f :: "_ \ 'b::t1_space" - shows "continuous_on s f \ closedin (subtopology euclidean s) {x \ s. f x = a}" - using continuous_closedin_preimage[of s f "{a}"] by auto + shows "continuous_on S f \ closedin (subtopology euclidean S) {x \ S. f x = a}" + using continuous_closedin_preimage[of S f "{a}"] by (simp add: vimage_def Collect_conj_eq) lemma continuous_closed_preimage_constant: fixes f :: "_ \ 'b::t1_space" - shows "continuous_on s f \ closed s \ closed {x \ s. f x = a}" - using continuous_closed_preimage[of s f "{a}"] by auto + shows "continuous_on S f \ closed S \ closed {x \ S. f x = a}" + using continuous_closed_preimage[of S f "{a}"] by (simp add: vimage_def Collect_conj_eq) lemma continuous_constant_on_closure: fixes f :: "_ \ 'b::t1_space" @@ -1462,17 +1439,17 @@ by auto lemma image_closure_subset: - assumes "continuous_on (closure s) f" - and "closed t" - and "(f ` s) \ t" - shows "f ` (closure s) \ t" + assumes contf: "continuous_on (closure S) f" + and "closed T" + and "(f ` S) \ T" + shows "f ` (closure S) \ T" proof - - have "s \ {x \ closure s. f x \ t}" + have "S \ {x \ closure S. f x \ T}" using assms(3) closure_subset by auto - moreover have "closed {x \ closure s. f x \ t}" - using continuous_closed_preimage[OF assms(1)] and assms(2) by auto - ultimately have "closure s = {x \ closure s . f x \ t}" - using closure_minimal[of s "{x \ closure s. f x \ t}"] by auto + moreover have "closed (closure S \ f -` T)" + using continuous_closed_preimage[OF contf] \closed T\ by auto + ultimately have "closure S = (closure S \ f -` T)" + using closure_minimal[of S "(closure S \ f -` T)"] by auto then show ?thesis by auto qed @@ -1967,7 +1944,7 @@ lemma bounded_uniformly_continuous_image: fixes f :: "'a :: heine_borel \ 'b :: heine_borel" assumes "uniformly_continuous_on S f" "bounded S" - shows "bounded(image f S)" + shows "bounded(f ` S)" by (metis (no_types, lifting) assms bounded_closure_image compact_closure compact_continuous_image compact_eq_bounded_closed image_cong uniformly_continuous_imp_continuous uniformly_continuous_on_extension_on_closure) subsection \Making a continuous function avoid some value in a neighbourhood.\ @@ -2023,61 +2000,61 @@ subsection\Quotient maps\ lemma quotient_map_imp_continuous_open: - assumes t: "f ` s \ t" - and ope: "\u. u \ t - \ (openin (subtopology euclidean s) {x. x \ s \ f x \ u} \ - openin (subtopology euclidean t) u)" - shows "continuous_on s f" + assumes T: "f ` S \ T" + and ope: "\U. U \ T + \ (openin (subtopology euclidean S) (S \ f -` U) \ + openin (subtopology euclidean T) U)" + shows "continuous_on S f" proof - - have [simp]: "{x \ s. f x \ f ` s} = s" by auto + have [simp]: "S \ f -` f ` S = S" by auto show ?thesis - using ope [OF t] + using ope [OF T] apply (simp add: continuous_on_open) - by (metis (no_types, lifting) "ope" openin_imp_subset openin_trans) + by (meson ope openin_imp_subset openin_trans) qed lemma quotient_map_imp_continuous_closed: - assumes t: "f ` s \ t" - and ope: "\u. u \ t - \ (closedin (subtopology euclidean s) {x. x \ s \ f x \ u} \ - closedin (subtopology euclidean t) u)" - shows "continuous_on s f" + assumes T: "f ` S \ T" + and ope: "\U. U \ T + \ (closedin (subtopology euclidean S) (S \ f -` U) \ + closedin (subtopology euclidean T) U)" + shows "continuous_on S f" proof - - have [simp]: "{x \ s. f x \ f ` s} = s" by auto + have [simp]: "S \ f -` f ` S = S" by auto show ?thesis - using ope [OF t] + using ope [OF T] apply (simp add: continuous_on_closed) - by (metis (no_types, lifting) "ope" closedin_imp_subset closedin_subtopology_refl closedin_trans openin_subtopology_refl openin_subtopology_self) + by (metis (no_types, lifting) ope closedin_imp_subset closedin_trans) qed lemma open_map_imp_quotient_map: - assumes contf: "continuous_on s f" - and t: "t \ f ` s" - and ope: "\t. openin (subtopology euclidean s) t - \ openin (subtopology euclidean (f ` s)) (f ` t)" - shows "openin (subtopology euclidean s) {x \ s. f x \ t} = - openin (subtopology euclidean (f ` s)) t" + assumes contf: "continuous_on S f" + and T: "T \ f ` S" + and ope: "\T. openin (subtopology euclidean S) T + \ openin (subtopology euclidean (f ` S)) (f ` T)" + shows "openin (subtopology euclidean S) (S \ f -` T) = + openin (subtopology euclidean (f ` S)) T" proof - - have "t = image f {x. x \ s \ f x \ t}" - using t by blast + have "T = f ` (S \ f -` T)" + using T by blast then show ?thesis - using "ope" contf continuous_on_open by fastforce + using "ope" contf continuous_on_open by metis qed lemma closed_map_imp_quotient_map: - assumes contf: "continuous_on s f" - and t: "t \ f ` s" - and ope: "\t. closedin (subtopology euclidean s) t - \ closedin (subtopology euclidean (f ` s)) (f ` t)" - shows "openin (subtopology euclidean s) {x \ s. f x \ t} \ - openin (subtopology euclidean (f ` s)) t" + assumes contf: "continuous_on S f" + and T: "T \ f ` S" + and ope: "\T. closedin (subtopology euclidean S) T + \ closedin (subtopology euclidean (f ` S)) (f ` T)" + shows "openin (subtopology euclidean S) (S \ f -` T) \ + openin (subtopology euclidean (f ` S)) T" (is "?lhs = ?rhs") proof assume ?lhs - then have *: "closedin (subtopology euclidean s) (s - {x \ s. f x \ t})" + then have *: "closedin (subtopology euclidean S) (S - (S \ f -` T))" using closedin_diff by fastforce - have [simp]: "(f ` s - f ` (s - {x \ s. f x \ t})) = t" - using t by blast + have [simp]: "(f ` S - f ` (S - (S \ f -` T))) = T" + using T by blast show ?rhs using ope [OF *, unfolded closedin_def] by auto next @@ -2087,51 +2064,50 @@ qed lemma continuous_right_inverse_imp_quotient_map: - assumes contf: "continuous_on s f" and imf: "f ` s \ t" - and contg: "continuous_on t g" and img: "g ` t \ s" - and fg [simp]: "\y. y \ t \ f(g y) = y" - and u: "u \ t" - shows "openin (subtopology euclidean s) {x. x \ s \ f x \ u} \ - openin (subtopology euclidean t) u" + assumes contf: "continuous_on S f" and imf: "f ` S \ T" + and contg: "continuous_on T g" and img: "g ` T \ S" + and fg [simp]: "\y. y \ T \ f(g y) = y" + and U: "U \ T" + shows "openin (subtopology euclidean S) (S \ f -` U) \ + openin (subtopology euclidean T) U" (is "?lhs = ?rhs") proof - - have f: "\z. openin (subtopology euclidean (f ` s)) z \ - openin (subtopology euclidean s) {x \ s. f x \ z}" - and g: "\z. openin (subtopology euclidean (g ` t)) z \ - openin (subtopology euclidean t) {x \ t. g x \ z}" + have f: "\Z. openin (subtopology euclidean (f ` S)) Z \ + openin (subtopology euclidean S) (S \ f -` Z)" + and g: "\Z. openin (subtopology euclidean (g ` T)) Z \ + openin (subtopology euclidean T) (T \ g -` Z)" using contf contg by (auto simp: continuous_on_open) show ?thesis proof - have "{x \ t. g x \ g ` t \ g x \ s \ f (g x) \ u} = {x \ t. f (g x) \ u}" + have "T \ g -` (g ` T \ (S \ f -` U)) = {x \ T. f (g x) \ U}" using imf img by blast - also have "... = u" - using u by auto - finally have [simp]: "{x \ t. g x \ g ` t \ g x \ s \ f (g x) \ u} = u" . + also have "... = U" + using U by auto + finally have eq: "T \ g -` (g ` T \ (S \ f -` U)) = U" . assume ?lhs - then have *: "openin (subtopology euclidean (g ` t)) (g ` t \ {x \ s. f x \ u})" + then have *: "openin (subtopology euclidean (g ` T)) (g ` T \ (S \ f -` U))" by (meson img openin_Int openin_subtopology_Int_subset openin_subtopology_self) show ?rhs - using g [OF *] by simp + using g [OF *] eq by auto next assume rhs: ?rhs show ?lhs - apply (rule f) - by (metis fg image_eqI image_subset_iff imf img openin_subopen openin_subtopology_self openin_trans rhs) + by (metis f fg image_eqI image_subset_iff imf img openin_subopen openin_subtopology_self openin_trans rhs) qed qed lemma continuous_left_inverse_imp_quotient_map: - assumes "continuous_on s f" - and "continuous_on (f ` s) g" - and "\x. x \ s \ g(f x) = x" - and "u \ f ` s" - shows "openin (subtopology euclidean s) {x. x \ s \ f x \ u} \ - openin (subtopology euclidean (f ` s)) u" + assumes "continuous_on S f" + and "continuous_on (f ` S) g" + and "\x. x \ S \ g(f x) = x" + and "U \ f ` S" + shows "openin (subtopology euclidean S) (S \ f -` U) \ + openin (subtopology euclidean (f ` S)) U" apply (rule continuous_right_inverse_imp_quotient_map) -using assms -apply force+ +using assms apply force+ done + text \Proving a function is constant by proving that a level set is open\ lemma continuous_levelset_openin_cases: @@ -3234,17 +3210,19 @@ and "\t. \t \ s; h t = a\ \ f t = g t" shows "continuous_on s (\t. if h t \ a then f(t) else g(t))" proof - - have s: "s = {t \ s. h t \ atMost a} \ {t \ s. h t \ atLeast a}" + have s: "s = (s \ h -` atMost a) \ (s \ h -` atLeast a)" by force - have 1: "closedin (subtopology euclidean s) {t \ s. h t \ atMost a}" + have 1: "closedin (subtopology euclidean s) (s \ h -` atMost a)" by (rule continuous_closedin_preimage [OF h closed_atMost]) - have 2: "closedin (subtopology euclidean s) {t \ s. h t \ atLeast a}" + have 2: "closedin (subtopology euclidean s) (s \ h -` atLeast a)" by (rule continuous_closedin_preimage [OF h closed_atLeast]) + have eq: "s \ h -` {..a} = {t \ s. h t \ a}" "s \ h -` {a..} = {t \ s. a \ h t}" + by auto show ?thesis apply (rule continuous_on_subset [of s, OF _ order_refl]) apply (subst s) apply (rule continuous_on_cases_local) - using 1 2 s assms apply auto + using 1 2 s assms apply (auto simp: eq) done qed @@ -3761,7 +3739,7 @@ proof - from imf injf have gTS: "g ` T = S" by force - from imf injf have fU: "U \ S \ (f ` U) = {x \ T. g x \ U}" for U + from imf injf have fU: "U \ S \ (f ` U) = T \ g -` U" for U by force show ?thesis by (simp add: continuous_on_open [of T g] gTS) (metis openin_imp_subset fU oo) @@ -3776,7 +3754,7 @@ proof - from imf injf have gTS: "g ` T = S" by force - from imf injf have fU: "U \ S \ (f ` U) = {x \ T. g x \ U}" for U + from imf injf have fU: "U \ S \ (f ` U) = T \ g -` U" for U by force show ?thesis by (simp add: continuous_on_closed [of T g] gTS) (metis closedin_imp_subset fU oo) @@ -3813,7 +3791,7 @@ and oo: "openin (subtopology euclidean S) U" shows "openin (subtopology euclidean T) (f ` U)" proof - - from hom oo have [simp]: "f ` U = {y. y \ T \ g y \ U}" + from hom oo have [simp]: "f ` U = T \ g -` U" using openin_subset by (fastforce simp: homeomorphism_def rev_image_eqI) from hom have "continuous_on T g" unfolding homeomorphism_def by blast @@ -3828,7 +3806,7 @@ and oo: "closedin (subtopology euclidean S) U" shows "closedin (subtopology euclidean T) (f ` U)" proof - - from hom oo have [simp]: "f ` U = {y. y \ T \ g y \ U}" + from hom oo have [simp]: "f ` U = T \ g -` U" using closedin_subset by (fastforce simp: homeomorphism_def rev_image_eqI) from hom have "continuous_on T g" unfolding homeomorphism_def by blast @@ -4750,17 +4728,263 @@ lemma continuous_imp_closed_map: fixes f :: "'a::metric_space \ 'b::metric_space" assumes "closedin (subtopology euclidean S) U" - "continuous_on S f" "image f S = T" "compact S" - shows "closedin (subtopology euclidean T) (image f U)" + "continuous_on S f" "f ` S = T" "compact S" + shows "closedin (subtopology euclidean T) (f ` U)" by (metis assms closedin_compact_eq compact_continuous_image continuous_on_subset subset_image_iff) lemma continuous_imp_quotient_map: fixes f :: "'a::metric_space \ 'b::metric_space" - assumes "continuous_on S f" "image f S = T" "compact S" "U \ T" - shows "openin (subtopology euclidean S) {x. x \ S \ f x \ U} \ + assumes "continuous_on S f" "f ` S = T" "compact S" "U \ T" + shows "openin (subtopology euclidean S) (S \ f -` U) \ openin (subtopology euclidean T) U" - by (metis (no_types, lifting) Collect_cong assms closed_map_imp_quotient_map continuous_imp_closed_map) - + by (metis (no_types, lifting) assms closed_map_imp_quotient_map continuous_imp_closed_map) + + +lemma open_map_restrict: + assumes opeU: "openin (subtopology euclidean (S \ f -` T')) U" + and oo: "\U. openin (subtopology euclidean S) U \ openin (subtopology euclidean T) (f ` U)" + and "T' \ T" + shows "openin (subtopology euclidean T') (f ` U)" +proof - + obtain V where "open V" "U = S \ f -` T' \ V" + using opeU by (auto simp: openin_open) + with oo [of "S \ V"] \T' \ T\ show ?thesis + by (fastforce simp add: openin_open) +qed + +lemma closed_map_restrict: + assumes cloU: "closedin (subtopology euclidean (S \ f -` T')) U" + and cc: "\U. closedin (subtopology euclidean S) U \ closedin (subtopology euclidean T) (f ` U)" + and "T' \ T" + shows "closedin (subtopology euclidean T') (f ` U)" +proof - + obtain V where "closed V" "U = S \ f -` T' \ V" + using cloU by (auto simp: closedin_closed) + with cc [of "S \ V"] \T' \ T\ show ?thesis + by (fastforce simp add: closedin_closed) +qed + +lemma connected_monotone_quotient_preimage: + assumes "connected T" + and contf: "continuous_on S f" and fim: "f ` S = T" + and opT: "\U. U \ T + \ openin (subtopology euclidean S) (S \ f -` U) \ + openin (subtopology euclidean T) U" + and connT: "\y. y \ T \ connected (S \ f -` {y})" + shows "connected S" +proof (rule connectedI) + fix U V + assume "open U" and "open V" and "U \ S \ {}" and "V \ S \ {}" + and "U \ V \ S = {}" and "S \ U \ V" + moreover + have disjoint: "f ` (S \ U) \ f ` (S \ V) = {}" + proof - + have False if "y \ f ` (S \ U) \ f ` (S \ V)" for y + proof - + have "y \ T" + using fim that by blast + show ?thesis + using connectedD [OF connT [OF \y \ T\] \open U\ \open V\] + \S \ U \ V\ \U \ V \ S = {}\ that by fastforce + qed + then show ?thesis by blast + qed + ultimately have UU: "(S \ f -` f ` (S \ U)) = S \ U" and VV: "(S \ f -` f ` (S \ V)) = S \ V" + by auto + have opeU: "openin (subtopology euclidean T) (f ` (S \ U))" + by (metis UU \open U\ fim image_Int_subset le_inf_iff opT openin_open_Int) + have opeV: "openin (subtopology euclidean T) (f ` (S \ V))" + by (metis opT fim VV \open V\ openin_open_Int image_Int_subset inf.bounded_iff) + have "T \ f ` (S \ U) \ f ` (S \ V)" + using \S \ U \ V\ fim by auto + then show False + using \connected T\ disjoint opeU opeV \U \ S \ {}\ \V \ S \ {}\ + by (auto simp: connected_openin) +qed + +lemma connected_open_monotone_preimage: + assumes contf: "continuous_on S f" and fim: "f ` S = T" + and ST: "\C. openin (subtopology euclidean S) C \ openin (subtopology euclidean T) (f ` C)" + and connT: "\y. y \ T \ connected (S \ f -` {y})" + and "connected C" "C \ T" + shows "connected (S \ f -` C)" +proof - + have contf': "continuous_on (S \ f -` C) f" + by (meson contf continuous_on_subset inf_le1) + have eqC: "f ` (S \ f -` C) = C" + using \C \ T\ fim by blast + show ?thesis + proof (rule connected_monotone_quotient_preimage [OF \connected C\ contf' eqC]) + show "connected (S \ f -` C \ f -` {y})" if "y \ C" for y + proof - + have "S \ f -` C \ f -` {y} = S \ f -` {y}" + using that by blast + moreover have "connected (S \ f -` {y})" + using \C \ T\ connT that by blast + ultimately show ?thesis + by metis + qed + have "\U. openin (subtopology euclidean (S \ f -` C)) U + \ openin (subtopology euclidean C) (f ` U)" + using open_map_restrict [OF _ ST \C \ T\] by metis + then show "\D. D \ C + \ openin (subtopology euclidean (S \ f -` C)) (S \ f -` C \ f -` D) = + openin (subtopology euclidean C) D" + using open_map_imp_quotient_map [of "(S \ f -` C)" f] contf' by (simp add: eqC) + qed +qed + + +lemma connected_closed_monotone_preimage: + assumes contf: "continuous_on S f" and fim: "f ` S = T" + and ST: "\C. closedin (subtopology euclidean S) C \ closedin (subtopology euclidean T) (f ` C)" + and connT: "\y. y \ T \ connected (S \ f -` {y})" + and "connected C" "C \ T" + shows "connected (S \ f -` C)" +proof - + have contf': "continuous_on (S \ f -` C) f" + by (meson contf continuous_on_subset inf_le1) + have eqC: "f ` (S \ f -` C) = C" + using \C \ T\ fim by blast + show ?thesis + proof (rule connected_monotone_quotient_preimage [OF \connected C\ contf' eqC]) + show "connected (S \ f -` C \ f -` {y})" if "y \ C" for y + proof - + have "S \ f -` C \ f -` {y} = S \ f -` {y}" + using that by blast + moreover have "connected (S \ f -` {y})" + using \C \ T\ connT that by blast + ultimately show ?thesis + by metis + qed + have "\U. closedin (subtopology euclidean (S \ f -` C)) U + \ closedin (subtopology euclidean C) (f ` U)" + using closed_map_restrict [OF _ ST \C \ T\] by metis + then show "\D. D \ C + \ openin (subtopology euclidean (S \ f -` C)) (S \ f -` C \ f -` D) = + openin (subtopology euclidean C) D" + using closed_map_imp_quotient_map [of "(S \ f -` C)" f] contf' by (simp add: eqC) + qed +qed + + + +subsection\A couple of lemmas about components (see Newman IV, 3.3 and 3.4).\ + + +lemma connected_Un_clopen_in_complement: + fixes S U :: "'a::metric_space set" + assumes "connected S" "connected U" "S \ U" + and opeT: "openin (subtopology euclidean (U - S)) T" + and cloT: "closedin (subtopology euclidean (U - S)) T" + shows "connected (S \ T)" +proof - + have *: "\\x y. P x y \ P y x; \x y. P x y \ S \ x \ S \ y; + \x y. \P x y; S \ x\ \ False\ \ ~(\x y. (P x y))" for P + by metis + show ?thesis + unfolding connected_closedin_eq + proof (rule *) + fix H1 H2 + assume H: "closedin (subtopology euclidean (S \ T)) H1 \ + closedin (subtopology euclidean (S \ T)) H2 \ + H1 \ H2 = S \ T \ H1 \ H2 = {} \ H1 \ {} \ H2 \ {}" + then have clo: "closedin (subtopology euclidean S) (S \ H1)" + "closedin (subtopology euclidean S) (S \ H2)" + by (metis Un_upper1 closedin_closed_subset inf_commute)+ + have Seq: "S \ (H1 \ H2) = S" + by (simp add: H) + have "S \ ((S \ T) \ H1) \ S \ ((S \ T) \ H2) = S" + using Seq by auto + moreover have "H1 \ (S \ ((S \ T) \ H2)) = {}" + using H by blast + ultimately have "S \ H1 = {} \ S \ H2 = {}" + by (metis (no_types) H Int_assoc \S \ (H1 \ H2) = S\ \connected S\ + clo Seq connected_closedin inf_bot_right inf_le1) + then show "S \ H1 \ S \ H2" + using H \connected S\ unfolding connected_closedin by blast + next + fix H1 H2 + assume H: "closedin (subtopology euclidean (S \ T)) H1 \ + closedin (subtopology euclidean (S \ T)) H2 \ + H1 \ H2 = S \ T \ H1 \ H2 = {} \ H1 \ {} \ H2 \ {}" + and "S \ H1" + then have H2T: "H2 \ T" + by auto + have "T \ U" + using Diff_iff opeT openin_imp_subset by auto + with \S \ U\ have Ueq: "U = (U - S) \ (S \ T)" + by auto + have "openin (subtopology euclidean ((U - S) \ (S \ T))) H2" + proof (rule openin_subtopology_Un) + show "openin (subtopology euclidean (S \ T)) H2" + using \H2 \ T\ apply (auto simp: openin_closedin_eq) + by (metis Diff_Diff_Int Diff_disjoint Diff_partition Diff_subset H Int_absorb1 Un_Diff) + then show "openin (subtopology euclidean (U - S)) H2" + by (meson H2T Un_upper2 opeT openin_subset_trans openin_trans) + qed + moreover have "closedin (subtopology euclidean ((U - S) \ (S \ T))) H2" + proof (rule closedin_subtopology_Un) + show "closedin (subtopology euclidean (U - S)) H2" + using H H2T cloT closedin_subset_trans + by (blast intro: closedin_subtopology_Un closedin_trans) + qed (simp add: H) + ultimately + have H2: "H2 = {} \ H2 = U" + using Ueq \connected U\ unfolding connected_clopen by metis + then have "H2 \ S" + by (metis Diff_partition H Un_Diff_cancel Un_subset_iff \H2 \ T\ assms(3) inf.orderE opeT openin_imp_subset) + moreover have "T \ H2 - S" + by (metis (no_types) H2 H opeT openin_closedin_eq topspace_euclidean_subtopology) + ultimately show False + using H \S \ H1\ by blast + qed blast +qed + + +proposition component_complement_connected: + fixes S :: "'a::metric_space set" + assumes "connected S" "connected U" "S \ U" and C: "C \ components (U - S)" + shows "connected(U - C)" + using \connected S\ unfolding connected_closedin_eq not_ex de_Morgan_conj +proof clarify + fix H3 H4 + assume clo3: "closedin (subtopology euclidean (U - C)) H3" + and clo4: "closedin (subtopology euclidean (U - C)) H4" + and "H3 \ H4 = U - C" and "H3 \ H4 = {}" and "H3 \ {}" and "H4 \ {}" + and * [rule_format]: + "\H1 H2. \ closedin (subtopology euclidean S) H1 \ + \ closedin (subtopology euclidean S) H2 \ + H1 \ H2 \ S \ H1 \ H2 \ {} \ \ H1 \ {} \ \ H2 \ {}" + then have "H3 \ U-C" and ope3: "openin (subtopology euclidean (U - C)) (U - C - H3)" + and "H4 \ U-C" and ope4: "openin (subtopology euclidean (U - C)) (U - C - H4)" + by (auto simp: closedin_def) + have "C \ {}" "C \ U-S" "connected C" + using C in_components_nonempty in_components_subset in_components_maximal by blast+ + have cCH3: "connected (C \ H3)" + proof (rule connected_Un_clopen_in_complement [OF \connected C\ \connected U\ _ _ clo3]) + show "openin (subtopology euclidean (U - C)) H3" + apply (simp add: openin_closedin_eq \H3 \ U - C\) + apply (simp add: closedin_subtopology) + by (metis Diff_cancel Diff_triv Un_Diff clo4 \H3 \ H4 = {}\ \H3 \ H4 = U - C\ closedin_closed inf_commute sup_bot.left_neutral) + qed (use clo3 \C \ U - S\ in auto) + have cCH4: "connected (C \ H4)" + proof (rule connected_Un_clopen_in_complement [OF \connected C\ \connected U\ _ _ clo4]) + show "openin (subtopology euclidean (U - C)) H4" + apply (simp add: openin_closedin_eq \H4 \ U - C\) + apply (simp add: closedin_subtopology) + by (metis Diff_cancel Int_commute Un_Diff Un_Diff_Int \H3 \ H4 = {}\ \H3 \ H4 = U - C\ clo3 closedin_closed) + qed (use clo4 \C \ U - S\ in auto) + have "closedin (subtopology euclidean S) (S \ H3)" "closedin (subtopology euclidean S) (S \ H4)" + using clo3 clo4 \S \ U\ \C \ U - S\ by (auto simp: closedin_closed) + moreover have "S \ H3 \ {}" + using components_maximal [OF C cCH3] \C \ {}\ \C \ U - S\ \H3 \ {}\ \H3 \ U - C\ by auto + moreover have "S \ H4 \ {}" + using components_maximal [OF C cCH4] \C \ {}\ \C \ U - S\ \H4 \ {}\ \H4 \ U - C\ by auto + ultimately show False + using * [of "S \ H3" "S \ H4"] \H3 \ H4 = {}\ \C \ U - S\ \H3 \ H4 = U - C\ \S \ U\ + by auto +qed subsection\ Finite intersection property\ @@ -4952,15 +5176,12 @@ assume "open U" have S: "\i. i \ I \ (T i) \ S" using clo openin_imp_subset by blast - have *: "{x \ S. g x \ U} = \{{x. x \ (T i) \ (f i x) \ U} |i. i \ I}" - apply (auto simp: dest: S) - apply (metis (no_types, lifting) g mem_Collect_eq) - using clo f g openin_imp_subset by fastforce - show "openin (subtopology euclidean S) {x \ S. g x \ U}" + have *: "(S \ g -` U) = (\i \ I. T i \ f i -` U)" + using S f g by fastforce + show "openin (subtopology euclidean S) (S \ g -` U)" apply (subst *) apply (rule openin_Union, clarify) - apply (metis (full_types) \open U\ cont clo openin_trans continuous_openin_preimage_gen) - done + using \open U\ clo cont continuous_openin_preimage_gen openin_trans by blast qed lemma pasting_lemma_exists: @@ -4996,13 +5217,11 @@ proof (clarsimp simp: continuous_closedin_preimage_eq) fix U :: "'b set" assume "closed U" - have *: "{x \ S. g x \ U} = \{{x. x \ (T i) \ (f i x) \ U} |i. i \ I}" - apply auto - apply (metis (no_types, lifting) g mem_Collect_eq) - using clo closedin_closed apply blast - apply (metis Int_iff f g clo closedin_limpt inf.absorb_iff2) - done - show "closedin (subtopology euclidean S) {x \ S. g x \ U}" + have S: "\i. i \ I \ (T i) \ S" + using clo closedin_imp_subset by blast + have *: "(S \ g -` U) = (\i \ I. T i \ f i -` U)" + using S f g by fastforce + show "closedin (subtopology euclidean S) (S \ g -` U)" apply (subst *) apply (rule closedin_Union) using \finite I\ apply simp @@ -5119,9 +5338,10 @@ and conf: "continuous_on S f" and fim: "f ` S \ t" and cct: "\y. y \ t \ connected_component_set t y = {y}" - shows "\a. \x \ S. f x = a" + shows "f constant_on S" proof (cases "S = {}") - case True then show ?thesis by force + case True then show ?thesis + by (simp add: constant_on_def) next case False { fix x assume "x \ S" @@ -5129,7 +5349,7 @@ by (metis connected_continuous_image conf connected_component_maximal fim image_subset_iff rev_image_eqI S cct) } with False show ?thesis - by blast + unfolding constant_on_def by blast qed lemma discrete_subset_disconnected: @@ -5195,7 +5415,7 @@ text\This proof requires the existence of two separate values of the range type.\ lemma finite_range_constant_imp_connected: assumes "\f::'a::topological_space \ 'b::real_normed_algebra_1. - \continuous_on S f; finite(f ` S)\ \ \a. \x \ S. f x = a" + \continuous_on S f; finite(f ` S)\ \ f constant_on S" shows "connected S" proof - { fix t u @@ -5212,7 +5432,7 @@ by (rule finite_subset [of _ "{0,1}"]) auto have "t = {} \ u = {}" using assms [OF conif fi] tus [symmetric] - by (auto simp: Ball_def) (metis IntI empty_iff one_neq_zero tue) + by (auto simp: Ball_def constant_on_def) (metis IntI empty_iff one_neq_zero tue) } then show ?thesis by (simp add: connected_closedin_eq) @@ -5222,18 +5442,18 @@ "(connected S \ (\f::'a::topological_space \ 'b::real_normed_algebra_1. \t. continuous_on S f \ f ` S \ t \ (\y \ t. connected_component_set t y = {y}) - \ (\a::'b. \x \ S. f x = a)))" (is ?thesis1) + \ f constant_on S))" (is ?thesis1) and continuous_discrete_range_constant_eq: "(connected S \ (\f::'a::topological_space \ 'b::real_normed_algebra_1. continuous_on S f \ (\x \ S. \e. 0 < e \ (\y. y \ S \ (f y \ f x) \ e \ norm(f y - f x))) - \ (\a::'b. \x \ S. f x = a)))" (is ?thesis2) + \ f constant_on S))" (is ?thesis2) and continuous_finite_range_constant_eq: "(connected S \ (\f::'a::topological_space \ 'b::real_normed_algebra_1. continuous_on S f \ finite (f ` S) - \ (\a::'b. \x \ S. f x = a)))" (is ?thesis3) + \ f constant_on S))" (is ?thesis3) proof - have *: "\s t u v. \s \ t; t \ u; u \ v; v \ s\ \ (s \ t) \ (s \ u) \ (s \ v)" @@ -5255,18 +5475,16 @@ assumes S: "connected S" and "continuous_on S f" and "\x. x \ S \ \e>0. \y. y \ S \ f y \ f x \ e \ norm (f y - f x)" - obtains a where "\x. x \ S \ f x = a" - using continuous_discrete_range_constant_eq [THEN iffD1, OF S] assms - by blast + shows "f constant_on S" + using continuous_discrete_range_constant_eq [THEN iffD1, OF S] assms by blast lemma continuous_finite_range_constant: fixes f :: "'a::topological_space \ 'b::real_normed_algebra_1" assumes "connected S" and "continuous_on S f" and "finite (f ` S)" - obtains a where "\x. x \ S \ f x = a" - using assms continuous_finite_range_constant_eq - by blast + shows "f constant_on S" + using assms continuous_finite_range_constant_eq by blast diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Continuous_Extension.thy --- a/src/HOL/Analysis/Continuous_Extension.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Continuous_Extension.thy Thu Oct 19 17:16:13 2017 +0100 @@ -281,10 +281,7 @@ "\x. f x \ closed_segment a b" "\x. f x = a \ x \ S" "\x. f x = b \ x \ T" -apply (rule Urysohn_local_strong [of UNIV S T]) -using assms -apply (auto simp: closed_closedin) -done +using assms by (auto intro: Urysohn_local_strong [of UNIV S T]) proposition Urysohn: assumes US: "closed S" @@ -295,10 +292,7 @@ "\x. f x \ closed_segment a b" "\x. x \ S \ f x = a" "\x. x \ T \ f x = b" -apply (rule Urysohn_local [of UNIV S T a b]) -using assms -apply (auto simp: closed_closedin) -done +using assms by (auto intro: Urysohn_local [of UNIV S T a b]) subsection\ The Dugundji extension theorem, and Tietze variants as corollaries.\ diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Analysis/Convex_Euclidean_Space.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Convex_Euclidean_Space.thy Thu Oct 19 17:16:13 2017 +0100 @@ -1271,15 +1271,17 @@ using g by (simp add: image_comp) have cgf: "closed (g ` f ` S)" by (simp add: \g \ f = id\ S image_comp) - have [simp]: "{x \ range f. g x \ S} = f ` S" - using g by (simp add: o_def id_def image_def) metis + have [simp]: "(range f \ g -` S) = f ` S" + using g unfolding o_def id_def image_def by auto metis+ show ?thesis - apply (rule closedin_closed_trans [of "range f"]) - apply (rule continuous_closedin_preimage [OF confg cgf, simplified]) - apply (rule closed_injective_image_subspace) - using f - apply (auto simp: linear_linear linear_injective_0) - done + proof (rule closedin_closed_trans [of "range f"]) + show "closedin (subtopology euclidean (range f)) (f ` S)" + using continuous_closedin_preimage [OF confg cgf] by simp + show "closed (range f)" + apply (rule closed_injective_image_subspace) + using f apply (auto simp: linear_linear linear_injective_0) + done + qed qed lemma closed_injective_linear_image_eq: @@ -2374,16 +2376,13 @@ by(simp add: convex_connected) proposition clopen: - fixes s :: "'a :: real_normed_vector set" - shows "closed s \ open s \ s = {} \ s = UNIV" -apply (rule iffI) - apply (rule connected_UNIV [unfolded connected_clopen, rule_format]) - apply (force simp add: closed_closedin, force) -done + fixes S :: "'a :: real_normed_vector set" + shows "closed S \ open S \ S = {} \ S = UNIV" + by (force intro!: connected_UNIV [unfolded connected_clopen, rule_format]) corollary compact_open: - fixes s :: "'a :: euclidean_space set" - shows "compact s \ open s \ s = {}" + fixes S :: "'a :: euclidean_space set" + shows "compact S \ open S \ S = {}" by (auto simp: compact_eq_bounded_closed clopen) corollary finite_imp_not_open: diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Further_Topology.thy --- a/src/HOL/Analysis/Further_Topology.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Further_Topology.thy Thu Oct 19 17:16:13 2017 +0100 @@ -2318,9 +2318,9 @@ proof (clarsimp simp add: continuous_openin_preimage_eq) fix T :: "'a set" assume "open T" - have eq: "{x. x \ f ` S \ g x \ T} = f ` (S \ T)" + have eq: "f ` S \ g -` T = f ` (S \ T)" by (auto simp: gf) - show "openin (subtopology euclidean (f ` S)) {x \ f ` S. g x \ T}" + show "openin (subtopology euclidean (f ` S)) (f ` S \ g -` T)" apply (subst eq) apply (rule open_openin_trans) apply (rule invariance_of_domain_gen) @@ -3173,7 +3173,7 @@ have zn2: "(\z::complex. z^n) ` (- {0}) = - {0}" using assms by (auto simp: image_def elim: exists_complex_root_nonzero [where n = n]) have zn3: "\T. z^n \ T \ open T \ 0 \ T \ - (\v. \v = {x. x \ 0 \ x^n \ T} \ + (\v. \v = -{0} \ (\z. z ^ n) -` T \ (\u\v. open u \ 0 \ u) \ pairwise disjnt v \ (\u\v. Ex (homeomorphism u T (\z. z^n))))" @@ -3216,8 +3216,6 @@ by (intro continuous_intros) have noncon: "\ (\w::complex. w^n) constant_on UNIV" by (metis UNIV_I assms constant_on_def power_one zero_neq_one zero_power) - have open_imball: "open ((\w. w^n) ` ball z d)" - by (rule invariance_of_domain [OF cont open_ball inj]) have im_eq: "(\w. w^n) ` ball z' d = (\w. w^n) ` ball z d" if z': "z'^n = z^n" for z' proof - @@ -3262,6 +3260,7 @@ qed then show ?thesis by blast qed + have ex_ball: "\B. (\z'. B = ball z' d \ z'^n = z^n) \ x \ B" if "x \ 0" and eq: "x^n = w^n" and dzw: "dist z w < d" for x w proof - @@ -3286,50 +3285,63 @@ apply (simp add: dist_norm) done qed - have ball1: "\{ball z' d |z'. z'^n = z^n} = {x. x \ 0 \ x^n \ (\w. w^n) ` ball z d}" - apply (rule equalityI) - prefer 2 apply (force simp: ex_ball, clarsimp) - apply (subst im_eq [symmetric], assumption) - using assms - apply (force simp: dist_norm d_def min_mult_distrib_right dest: power_eq_imp_eq_norm) - done - have ball2: "pairwise disjnt {ball z' d |z'. z'^n = z^n}" - proof (clarsimp simp add: pairwise_def disjnt_iff) - fix \ \ x - assume "\^n = z^n" "\^n = z^n" "ball \ d \ ball \ d" - and "dist \ x < d" "dist \ x < d" - then have "dist \ \ < d+d" - using dist_triangle_less_add by blast - then have "cmod (\ - \) < 2*d" - by (simp add: dist_norm) - also have "... \ e * cmod z" - using mult_right_mono \0 < e\ that by (auto simp: d_def) - finally have "cmod (\ - \) < e * cmod z" . - with e have "\ = \" - by (metis \\^n = z^n\ \\^n = z^n\ assms power_eq_imp_eq_norm) - then show "False" - using \ball \ d \ ball \ d\ by blast + + show ?thesis + proof (rule exI, intro conjI) + show "z ^ n \ (\w. w ^ n) ` ball z d" + using \d > 0\ by simp + show "open ((\w. w ^ n) ` ball z d)" + by (rule invariance_of_domain [OF cont open_ball inj]) + show "0 \ (\w. w ^ n) ` ball z d" + using \z \ 0\ assms by (force simp: d_def) + show "\v. \v = - {0} \ (\z. z ^ n) -` (\w. w ^ n) ` ball z d \ + (\u\v. open u \ 0 \ u) \ + disjoint v \ + (\u\v. Ex (homeomorphism u ((\w. w ^ n) ` ball z d) (\z. z ^ n)))" + proof (rule exI, intro ballI conjI) + show "\{ball z' d |z'. z'^n = z^n} = - {0} \ (\z. z ^ n) -` (\w. w ^ n) ` ball z d" (is "?l = ?r") + proof + show "?l \ ?r" + apply auto + apply (simp add: assms d_def power_eq_imp_eq_norm that) + by (metis im_eq image_eqI mem_ball) + show "?r \ ?l" + by auto (meson ex_ball) + qed + show "\u. u \ {ball z' d |z'. z' ^ n = z ^ n} \ 0 \ u" + by (force simp add: assms d_def power_eq_imp_eq_norm that) + + show "disjoint {ball z' d |z'. z' ^ n = z ^ n}" + proof (clarsimp simp add: pairwise_def disjnt_iff) + fix \ \ x + assume "\^n = z^n" "\^n = z^n" "ball \ d \ ball \ d" + and "dist \ x < d" "dist \ x < d" + then have "dist \ \ < d+d" + using dist_triangle_less_add by blast + then have "cmod (\ - \) < 2*d" + by (simp add: dist_norm) + also have "... \ e * cmod z" + using mult_right_mono \0 < e\ that by (auto simp: d_def) + finally have "cmod (\ - \) < e * cmod z" . + with e have "\ = \" + by (metis \\^n = z^n\ \\^n = z^n\ assms power_eq_imp_eq_norm) + then show "False" + using \ball \ d \ ball \ d\ by blast + qed + show "Ex (homeomorphism u ((\w. w ^ n) ` ball z d) (\z. z ^ n))" + if "u \ {ball z' d |z'. z' ^ n = z ^ n}" for u + proof (rule invariance_of_domain_homeomorphism [of "u" "\z. z^n"]) + show "open u" + using that by auto + show "continuous_on u (\z. z ^ n)" + by (intro continuous_intros) + show "inj_on (\z. z ^ n) u" + using that by (auto simp: iff_x_eq_y inj_on_def) + show "\g. homeomorphism u ((\z. z ^ n) ` u) (\z. z ^ n) g \ Ex (homeomorphism u ((\w. w ^ n) ` ball z d) (\z. z ^ n))" + using im_eq that by clarify metis + qed auto + qed auto qed - have ball3: "Ex (homeomorphism (ball z' d) ((\w. w^n) ` ball z d) (\z. z^n))" - if zeq: "z'^n = z^n" for z' - proof - - have inj: "inj_on (\z. z ^ n) (ball z' d)" - by (meson iff_x_eq_y inj_onI zeq) - show ?thesis - apply (rule invariance_of_domain_homeomorphism [of "ball z' d" "\z. z^n"]) - apply (rule open_ball continuous_intros order_refl inj)+ - apply (force simp: im_eq [OF zeq]) - done - qed - show ?thesis - apply (rule_tac x = "(\w. w^n) ` (ball z d)" in exI) - apply (intro conjI open_imball) - using \d > 0\ apply simp - using \z \ 0\ assms apply (force simp: d_def) - apply (rule_tac x="{ ball z' d |z'. z'^n = z^n}" in exI) - apply (intro conjI ball1 ball2) - apply (force simp: assms d_def power_eq_imp_eq_norm that, clarify) - by (metis ball3) qed show ?thesis using assms @@ -3353,7 +3365,7 @@ show "range exp = - {0::complex}" by auto (metis exp_Ln range_eqI) show "\T. z \ T \ openin (subtopology euclidean (- {0})) T \ - (\v. \v = {z. exp z \ T} \ (\u\v. open u) \ disjoint v \ + (\v. \v = exp -` T \ (\u\v. open u) \ disjoint v \ (\u\v. \q. homeomorphism u T exp q))" if "z \ - {0::complex}" for z proof - @@ -3374,8 +3386,8 @@ using pi_ge_two by (simp add: ball_subset_ball_iff) ultimately show "openin (subtopology euclidean (- {0})) (exp ` ball (Ln z) 1)" by (auto simp: openin_open_eq invariance_of_domain continuous_on_exp [OF continuous_on_id]) - show "\\ = {w. exp w \ exp ` ball (Ln z) 1}" - by (auto simp: \_def Complex_Transcendental.exp_eq image_iff) + show "\\ = exp -` exp ` ball (Ln z) 1" + by (force simp: \_def Complex_Transcendental.exp_eq image_iff) show "\V\\. open V" by (auto simp: \_def inj_on_def continuous_intros invariance_of_domain) have xy: "2 \ cmod (2 * of_int x * of_real pi * \ - 2 * of_int y * of_real pi * \)" @@ -4314,7 +4326,7 @@ qed next case False - obtain a where a: "\x. x \ S \ T \ g x - h x = a" + have "(\x. g x - h x) constant_on S \ T" proof (rule continuous_discrete_range_constant [OF ST]) show "continuous_on (S \ T) (\x. g x - h x)" apply (intro continuous_intros) @@ -4338,7 +4350,9 @@ then show ?thesis by (rule_tac x="2*pi" in exI) (fastforce simp add: algebra_simps) qed - qed blast + qed + then obtain a where a: "\x. x \ S \ T \ g x - h x = a" + by (auto simp: constant_on_def) 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 @@ -4382,7 +4396,7 @@ qed next case False - obtain a where a: "\x. x \ S \ T \ g x - h x = a" + have "(\x. g x - h x) constant_on S \ T" proof (rule continuous_discrete_range_constant [OF ST]) show "continuous_on (S \ T) (\x. g x - h x)" apply (intro continuous_intros) @@ -4406,7 +4420,9 @@ then show ?thesis by (rule_tac x="2*pi" in exI) (fastforce simp add: algebra_simps) qed - qed blast + qed + then obtain a where a: "\x. x \ S \ T \ g x - h x = a" + by (auto simp: constant_on_def) 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 @@ -4441,7 +4457,7 @@ 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 + have *: "(\x. h x - h(f' y)) constant_on {x. x \ S \ f x = y}" if "y \ T" for y proof (rule continuous_discrete_range_constant [OF conn [OF that], of "\x. h x - h (f' y)"], simp_all add: algebra_simps) show "continuous_on {x \ S. f x = y} (\x. h x - h (f' y))" by (intro continuous_intros continuous_on_subset [OF conth]) auto @@ -4462,13 +4478,12 @@ qed qed 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) + using * [of "f x"] fim that unfolding constant_on_def by clarsimp (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}}}" + {p. \x. x \ S \ (x, p) \ (S \ UNIV) \ ((\z. 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) @@ -4513,9 +4528,10 @@ 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}}" + have "compact (S \ f -` {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 + then show "compact {x \ S. f x = y}" + by (auto simp: vimage_def Int_def) qed have 2: "h ` {x \ S. f x = y} \ {}" using fim that by auto diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Henstock_Kurzweil_Integration.thy --- a/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Henstock_Kurzweil_Integration.thy Thu Oct 19 17:16:13 2017 +0100 @@ -3187,17 +3187,15 @@ proof - have "e * r > 0" using that \0 < r\ by simp with intfi[unfolded has_integral] - obtain d where d: "gauge d" - "\p. p tagged_division_of cbox a b \ d fine p + obtain d where "gauge d" + and d: "\p. p tagged_division_of cbox a b \ d fine p \ norm ((\(x, k)\p. content k *\<^sub>R f x) - i) < e * r" by metis - define d' where "d' x = {y. g y \ d (g x)}" for x - have d': "\x. d' x = {y. g y \ (d (g x))}" - unfolding d'_def .. + define d' where "d' x = g -` d (g x)" for x show ?thesis proof (rule_tac x=d' in exI, safe) show "gauge d'" - using d(1) continuous_open_preimage_univ[OF _ contg] by (auto simp: gauge_def d') + using \gauge d\ continuous_open_vimage[OF _ contg] by (auto simp: gauge_def d'_def) next fix p assume ptag: "p tagged_division_of h ` cbox a b" and finep: "d' fine p" @@ -3211,7 +3209,7 @@ show "finite ((\(x, k). (g x, g ` k)) ` p)" using ptag by auto show "d fine (\(x, k). (g x, g ` k)) ` p" - using finep unfolding fine_def d' by auto + using finep unfolding fine_def d'_def by auto next fix x k assume xk: "(x, k) \ p" @@ -3259,7 +3257,7 @@ using \0 < r\ by (auto simp: scaleR_diff_right) finally have eq: "?l = ?r" . show "norm ((\(x,K)\p. content K *\<^sub>R f (g x)) - (1 / r) *\<^sub>R i) < e" - using d(2)[OF gimp] \0 < r\ by (auto simp add: eq) + using d[OF gimp] \0 < r\ by (auto simp add: eq) qed qed then show ?thesis @@ -4229,7 +4227,7 @@ and "x \ S" shows "f x = y" proof - - have xx: "\e>0. ball x e \ {xa \ S. f xa \ {f x}}" if "x \ S" for x + have "\e>0. ball x e \ (S \ f -` {f x})" if "x \ S" for x proof - obtain e where "0 < e" and e: "ball x e \ S" using \x \ S\ \open S\ open_contains_ball by blast @@ -4248,15 +4246,15 @@ by (metis Diff_iff contra_subsetD derf e has_derivative_within_subset that) qed (use y e \0 < e\ in auto) qed - then show "\e>0. ball x e \ {xa \ S. f xa \ {f x}}" + then show "\e>0. ball x e \ (S \ f -` {f x})" using \0 < e\ by blast qed - then have "openin (subtopology euclidean S) {x \ S. f x \ {y}}" + then have "openin (subtopology euclidean S) (S \ f -` {y})" by (auto intro!: open_openin_trans[OF \open S\] simp: open_contains_ball) - moreover have "closedin (subtopology euclidean S) {x \ S. f x \ {y}}" + moreover have "closedin (subtopology euclidean S) (S \ f -` {y})" by (force intro!: continuous_closedin_preimage [OF contf]) - ultimately have "{x \ S. f x \ {y}} = {} \ {x \ S. f x \ {y}} = S" - using \connected S\ connected_clopen by blast + ultimately have "(S \ f -` {y}) = {} \ (S \ f -` {y}) = S" + using \connected S\ by (simp add: connected_clopen) then show ?thesis using \x \ S\ \f c = y\ \c \ S\ by auto qed diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Homeomorphism.thy --- a/src/HOL/Analysis/Homeomorphism.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Homeomorphism.thy Thu Oct 19 17:16:13 2017 +0100 @@ -1089,14 +1089,14 @@ by force have *: "r *\<^sub>R b = One \ b = (1 / r) *\<^sub>R One" for r and b::'b by (metis One_non_0 nonzero_divide_eq_eq real_vector.scale_eq_0_iff real_vector.scale_scale scaleR_one) - have "f ` U = {z. (setdist {fst z} (- U) *\<^sub>R snd z) \ {One}}" + have "f ` U = (\z. (setdist {fst z} (- U) *\<^sub>R snd z)) -` {One}" apply (auto simp: f_def setdist_eq_0_sing_1 field_simps Ucomp) apply (rule_tac x=a in image_eqI) apply (auto simp: * setdist_eq_0_sing_1 dest: setdist1D) done then have clfU: "closed (f ` U)" apply (rule ssubst) - apply (rule continuous_closed_preimage_univ) + apply (rule continuous_closed_vimage) apply (auto intro: continuous_intros cont [unfolded o_def]) done have "closed (f ` S)" @@ -1278,7 +1278,7 @@ "covering_space c p S \ continuous_on c p \ p ` c = S \ (\x \ S. \T. x \ T \ openin (subtopology euclidean S) T \ - (\v. \v = {x. x \ c \ p x \ T} \ + (\v. \v = c \ p -` T \ (\u \ v. openin (subtopology euclidean c) u) \ pairwise disjnt v \ (\u \ v. \q. homeomorphism u T p q)))" @@ -1302,16 +1302,16 @@ "homeomorphism T u p q" using assms apply (simp add: covering_space_def, clarify) -apply (drule_tac x="p x" in bspec, force) -by (metis (no_types, lifting) Union_iff mem_Collect_eq) + apply (drule_tac x="p x" in bspec, force) + by (metis IntI UnionE vimage_eq) lemma covering_space_local_homeomorphism_alt: assumes p: "covering_space c p S" and "y \ S" - obtains x T u q where "p x = y" + obtains x T U q where "p x = y" "x \ T" "openin (subtopology euclidean c) T" - "y \ u" "openin (subtopology euclidean S) u" - "homeomorphism T u p q" + "y \ U" "openin (subtopology euclidean S) U" + "homeomorphism T U p q" proof - obtain x where "p x = y" "x \ c" using assms covering_space_imp_surjective by blast @@ -1329,7 +1329,7 @@ and covs: "\x. x \ S \ \X VS. x \ X \ openin (subtopology euclidean S) X \ - \VS = {x. x \ c \ p x \ X} \ + \VS = c \ p -` X \ (\u \ VS. openin (subtopology euclidean c) u) \ pairwise disjnt VS \ (\u \ VS. \q. homeomorphism u X p q)" @@ -1340,7 +1340,7 @@ proof - have "y \ S" using \T \ c\ pce that by blast obtain U VS where "y \ U" and U: "openin (subtopology euclidean S) U" - and VS: "\VS = {x. x \ c \ p x \ U}" + and VS: "\VS = c \ p -` U" and openVS: "\V \ VS. openin (subtopology euclidean c) V" and homVS: "\V. V \ VS \ \q. homeomorphism V U p q" using covs [OF \y \ S\] by auto @@ -1349,16 +1349,16 @@ using T [unfolded openin_euclidean_subtopology_iff] \y \ U\ \y \ p ` T\ by blast with VS obtain V where "x \ V" "V \ VS" by auto then obtain q where q: "homeomorphism V U p q" using homVS by blast - then have ptV: "p ` (T \ V) = U \ {z. q z \ (T \ V)}" + then have ptV: "p ` (T \ V) = U \ q -` (T \ V)" using VS \V \ VS\ by (auto simp: homeomorphism_def) have ocv: "openin (subtopology euclidean c) V" by (simp add: \V \ VS\ openVS) - have "openin (subtopology euclidean U) {z \ U. q z \ T \ V}" + have "openin (subtopology euclidean U) (U \ q -` (T \ V))" apply (rule continuous_on_open [THEN iffD1, rule_format]) using homeomorphism_def q apply blast using openin_subtopology_Int_subset [of c] q T unfolding homeomorphism_def by (metis inf.absorb_iff2 Int_commute ocv openin_euclidean_subtopology_iff) - then have os: "openin (subtopology euclidean S) (U \ {z. q z \ T \ V})" + then have os: "openin (subtopology euclidean S) (U \ q -` (T \ V))" using openin_trans [of U] by (simp add: Collect_conj_eq U) show ?thesis apply (rule_tac x = "p ` (T \ V)" in exI) @@ -1400,20 +1400,19 @@ using \U \ T\ \z \ U\ g1(2) apply blast+ done have "g2 z \ v" using \g1 z \ v\ z by auto - have gg: "{x \ U. g x \ v} = {x \ U. g x \ (v \ g ` U)}" for g + have gg: "U \ g -` v = U \ g -` (v \ g ` U)" for g by auto have "openin (subtopology euclidean (g1 ` U)) (v \ g1 ` U)" using ocv \U \ T\ g1 by (fastforce simp add: openin_open) - then have 1: "openin (subtopology euclidean U) {x \ U. g1 x \ v}" + then have 1: "openin (subtopology euclidean U) (U \ g1 -` v)" unfolding gg by (blast intro: contu continuous_on_open [THEN iffD1, rule_format]) have "openin (subtopology euclidean (g2 ` U)) (v \ g2 ` U)" using ocv \U \ T\ g2 by (fastforce simp add: openin_open) - then have 2: "openin (subtopology euclidean U) {x \ U. g2 x \ v}" + then have 2: "openin (subtopology euclidean U) (U \ g2 -` v)" unfolding gg by (blast intro: contu continuous_on_open [THEN iffD1, rule_format]) - show "\T. openin (subtopology euclidean U) T \ - z \ T \ T \ {z \ U. g1 z - g2 z = 0}" + show "\T. openin (subtopology euclidean U) T \ z \ T \ T \ {z \ U. g1 z - g2 z = 0}" using z - apply (rule_tac x = "{x. x \ U \ g1 x \ v} \ {x. x \ U \ g2 x \ v}" in exI) + apply (rule_tac x = "(U \ g1 -` v) \ (U \ g2 -` v)" in exI) apply (intro conjI) apply (rule openin_Int [OF 1 2]) using \g1 z \ v\ \g2 z \ v\ apply (force simp:, clarify) @@ -1475,7 +1474,7 @@ by (metis IntE V \x \ V\ imageI openin_open) then obtain T \ where "p x \ T" and opeT: "openin (subtopology euclidean S) T" - and veq: "\\ = {x \ C. p x \ T}" + and veq: "\\ = C \ p -` T" and ope: "\U\\. openin (subtopology euclidean C) U" and hom: "\U\\. \q. homeomorphism U T p q" using cov unfolding covering_space_def by (blast intro: that) @@ -1583,7 +1582,7 @@ if "y \ U" for y proof - obtain UU where UU: "\s. s \ S \ s \ (UU s) \ openin (subtopology euclidean S) (UU s) \ - (\\. \\ = {x. x \ C \ p x \ (UU s)} \ + (\\. \\ = C \ p -` UU s \ (\U \ \. openin (subtopology euclidean C) U) \ pairwise disjnt \ \ (\U \ \. \q. homeomorphism U (UU s) p q))" @@ -1595,13 +1594,13 @@ proof - have hinS: "h (t, y) \ S" using \y \ U\ him that by blast - then have "(t,y) \ {z \ {0..1} \ U. h z \ UU (h (t, y))}" + then have "(t,y) \ ({0..1} \ U) \ h -` UU(h(t, y))" using \y \ U\ \t \ {0..1}\ by (auto simp: ope) - moreover have ope_01U: "openin (subtopology euclidean ({0..1} \ U)) {z. z \ ({0..1} \ U) \ h z \ UU(h(t, y))}" + moreover have ope_01U: "openin (subtopology euclidean ({0..1} \ U)) (({0..1} \ U) \ h -` UU(h(t, y)))" using hinS ope continuous_on_open_gen [OF him] conth by blast ultimately obtain V W where opeV: "open V" and "t \ {0..1} \ V" "t \ {0..1} \ V" and opeW: "open W" and "y \ U" "y \ W" - and VW: "({0..1} \ V) \ (U \ W) \ {z. z \ ({0..1} \ U) \ h z \ UU(h(t, y))}" + and VW: "({0..1} \ V) \ (U \ W) \ (({0..1} \ U) \ h -` UU(h(t, y)))" by (rule Times_in_interior_subtopology) (auto simp: openin_open) then show ?thesis using hinS by blast @@ -1677,7 +1676,7 @@ qed blast have t01: "t \ {0..1}" using \t \ tk\ \tk \ {0..1}\ by blast - obtain \ where "\\ = {x. x \ C \ p x \ (UU (X t))}" + obtain \ where \: "\\ = C \ p -` UU (X t)" and opeC: "\U. U \ \ \ openin (subtopology euclidean C) U" and "pairwise disjnt \" and homuu: "\U. U \ \ \ \q. homeomorphism U (UU (X t)) p q" @@ -1686,7 +1685,7 @@ using N by (auto simp: divide_simps algebra_simps) with t have nN_in_kkt: "real n / real N \ K t" by blast - have "k (real n / real N, y) \ {x. x \ C \ p x \ (UU (X t))}" + have "k (real n / real N, y) \ C \ p -` UU (X t)" proof (simp, rule conjI) show "k (real n / real N, y) \ C" using \y \ V\ kim keq by force @@ -1701,8 +1700,8 @@ using him t01 by blast finally show "p (k (real n / real N, y)) \ UU (X t)" . qed - then have "k (real n / real N, y) \ \\" - using \\\ = {x \ C. p x \ UU (X t)}\ by blast + with \ have "k (real n / real N, y) \ \\" + by blast then obtain W where W: "k (real n / real N, y) \ W" and "W \ \" by blast then obtain p' where opeC': "openin (subtopology euclidean C) W" @@ -1711,14 +1710,14 @@ then have "W \ C" using openin_imp_subset by blast define W' where "W' = UU(X t)" - have opeVW: "openin (subtopology euclidean V) {z \ V. (k \ Pair (real n / real N)) z \ W}" + have opeVW: "openin (subtopology euclidean V) (V \ (k \ Pair (n / N)) -` W)" apply (rule continuous_openin_preimage [OF _ _ opeC']) apply (intro continuous_intros continuous_on_subset [OF contk]) using kim apply (auto simp: \y \ V\ W) done obtain N' where opeUN': "openin (subtopology euclidean U) N'" and "y \ N'" and kimw: "k ` ({(real n / real N)} \ N') \ W" - apply (rule_tac N' = "{z \ V. (k \ Pair ((real n / real N))) z \ W}" in that) + apply (rule_tac N' = "(V \ (k \ Pair (n / N)) -` W)" in that) apply (fastforce simp: \y \ V\ W intro!: openin_trans [OF opeVW opeUV])+ done obtain Q Q' where opeUQ: "openin (subtopology euclidean U) Q" @@ -2283,7 +2282,7 @@ using l [of "linepath z z" z "linepath a a"] by (auto simp: assms) show LC: "l ` U \ C" by (clarify dest!: *) (metis (full_types) l pathfinish_in_path_image subsetCE) - have "\T. openin (subtopology euclidean U) T \ y \ T \ T \ {x \ U. l x \ X}" + have "\T. openin (subtopology euclidean U) T \ y \ T \ T \ U \ l -` X" if X: "openin (subtopology euclidean C) X" and "y \ U" "l y \ X" for X y proof - have "X \ C" @@ -2292,7 +2291,7 @@ using fim \y \ U\ by blast then obtain W \ where WV: "f y \ W \ openin (subtopology euclidean S) W \ - (\\ = {x. x \ C \ p x \ W} \ + (\\ = C \ p -` W \ (\U \ \. openin (subtopology euclidean C) U) \ pairwise disjnt \ \ (\U \ \. \q. homeomorphism U W p q))" @@ -2309,12 +2308,12 @@ obtain V where "y \ V" "y \ U" and fimW: "f ` V \ W" "V \ U" and "path_connected V" and opeUV: "openin (subtopology euclidean U) V" proof - - have "openin (subtopology euclidean U) {c \ U. f c \ W}" + have "openin (subtopology euclidean U) (U \ f -` W)" using WV contf continuous_on_open_gen fim by auto then show ?thesis using U WV apply (auto simp: locally_path_connected) - apply (drule_tac x="{x. x \ U \ f x \ W}" in spec) + apply (drule_tac x="U \ f -` W" in spec) apply (drule_tac x=y in spec) apply (auto simp: \y \ U\ intro: that) done @@ -2325,23 +2324,23 @@ using homUW' homeomorphism_image2 by fastforce show ?thesis proof (intro exI conjI) - have "openin (subtopology euclidean S) {x \ W. p' x \ W' \ X}" + have "openin (subtopology euclidean S) (W \ p' -` (W' \ X))" proof (rule openin_trans) - show "openin (subtopology euclidean W) {x \ W. p' x \ W' \ X}" + show "openin (subtopology euclidean W) (W \ p' -` (W' \ X))" apply (rule continuous_openin_preimage [OF contp' p'im]) using X \W' \ C\ apply (auto simp: openin_open) done show "openin (subtopology euclidean S) W" using WV by blast qed - then show "openin (subtopology euclidean U) (V \ {x. x \ U \ f x \ {x. x \ W \ p' x \ W' \ X}})" - by (intro openin_Int opeUV continuous_openin_preimage [OF contf fim]) - have "p' (f y) \ X" + then show "openin (subtopology euclidean U) (V \ (U \ (f -` (W \ (p' -` (W' \ X))))))" + by (blast intro: opeUV openin_subtopology_self continuous_openin_preimage [OF contf fim]) + have "p' (f y) \ X" using \l y \ W'\ homeomorphism_apply1 [OF homUW'] pleq \y \ U\ \l y \ X\ by fastforce - then show "y \ V \ {x \ U. f x \ {x \ W. p' x \ W' \ X}}" + then show "y \ V \ (U \ f -` (W \ p' -` (W' \ X)))" using \y \ U\ \y \ V\ WV p'im by auto - show "V \ {x \ U. f x \ {x \ W. p' x \ W' \ X}} \ {x \ U. l x \ X}" - proof clarsimp + show "V \ (U \ f -` (W \ p' -` (W' \ X))) \ U \ l -` X" + proof (intro subsetI IntI; clarify) fix y' assume y': "y' \ V" "y' \ U" "f y' \ W" "p' (f y') \ W'" "p' (f y') \ X" then obtain \ where "path \" "path_image \ \ V" "pathstart \ = y" "pathfinish \ = y'" @@ -2354,7 +2353,7 @@ have finW: "\x. \0 \ x; x \ 1\ \ f (\ x) \ W" using \path_image \ \ V\ by (auto simp: image_subset_iff path_image_def fimW [THEN subsetD]) have "pathfinish (qq +++ (p' \ f \ \)) = l y'" - proof (rule l [of "pp +++ \" y' "qq +++ (p' \ f \ \)" ]) + proof (rule l [of "pp +++ \" y' "qq +++ (p' \ f \ \)"]) show "path (pp +++ \)" by (simp add: \path \\ \path pp\ \pathfinish pp = y\ \pathstart \ = y\) show "path_image (pp +++ \) \ U" @@ -2395,14 +2394,13 @@ using that \ by auto qed qed - with \pathfinish \ = y'\ \p' (f y') \ X\ show "l y' \ X" + with \pathfinish \ = y'\ \p' (f y') \ X\ show "y' \ l -` X" unfolding pathfinish_join by (simp add: pathfinish_def) qed qed qed then show "continuous_on U l" - using openin_subopen continuous_on_open_gen [OF LC] - by (metis (no_types, lifting) mem_Collect_eq) + by (metis IntD1 IntD2 vimage_eq openin_subopen continuous_on_open_gen [OF LC]) qed qed diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Jordan_Curve.thy --- a/src/HOL/Analysis/Jordan_Curve.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Jordan_Curve.thy Thu Oct 19 17:16:13 2017 +0100 @@ -88,8 +88,10 @@ then show ?thesis by (rule_tac x="2*pi" in exI) auto qed - ultimately obtain z where z: "\x. x \ S \ T \ g x - h x = z" + ultimately have "(\x. g x - h x) constant_on S \ T" using continuous_discrete_range_constant [OF conST contgh] by blast + then obtain z where z: "\x. x \ S \ T \ g x - h x = z" + by (auto simp: constant_on_def) obtain w where "exp(\ * of_real(h w)) = exp (\ * of_real(z + h w))" using disc z False by auto (metis diff_add_cancel g h of_real_add) diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Path_Connected.thy --- a/src/HOL/Analysis/Path_Connected.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Path_Connected.thy Thu Oct 19 17:16:13 2017 +0100 @@ -1546,7 +1546,7 @@ by (simp add: ex_in_conv [symmetric], metis zero_le_one order_refl) ultimately show False using *[unfolded connected_local not_ex, rule_format, - of "{x\{0..1}. g x \ e1}" "{x\{0..1}. g x \ e2}"] + of "{0..1} \ g -` e1" "{0..1} \ g -` e2"] using continuous_openin_preimage_gen[OF g(1)[unfolded path_def] as(1)] using continuous_openin_preimage_gen[OF g(1)[unfolded path_def] as(2)] by auto @@ -4946,58 +4946,57 @@ proposition homeomorphism_locally_imp: fixes S :: "'a::metric_space set" and t :: "'b::t2_space set" assumes S: "locally P S" and hom: "homeomorphism S t f g" - and Q: "\S t. \P S; homeomorphism S t f g\ \ Q t" + and Q: "\S S'. \P S; homeomorphism S S' f g\ \ Q S'" shows "locally Q t" proof (clarsimp simp: locally_def) - fix w y - assume "y \ w" and "openin (subtopology euclidean t) w" - then obtain T where T: "open T" "w = t \ T" + fix W y + assume "y \ W" and "openin (subtopology euclidean t) W" + then obtain T where T: "open T" "W = t \ T" by (force simp: openin_open) - then have "w \ t" by auto + then have "W \ t" by auto have f: "\x. x \ S \ g(f x) = x" "f ` S = t" "continuous_on S f" and g: "\y. y \ t \ f(g y) = y" "g ` t = S" "continuous_on t g" using hom by (auto simp: homeomorphism_def) - have gw: "g ` w = S \ {x. f x \ w}" - using \w \ t\ + have gw: "g ` W = S \ f -` W" + using \W \ t\ apply auto - using \g ` t = S\ \w \ t\ apply blast - using g \w \ t\ apply auto[1] + using \g ` t = S\ \W \ t\ apply blast + using g \W \ t\ apply auto[1] by (simp add: f rev_image_eqI) - have o: "openin (subtopology euclidean S) (g ` w)" + have o: "openin (subtopology euclidean S) (g ` W)" proof - have "continuous_on S f" using f(3) by blast - then show "openin (subtopology euclidean S) (g ` w)" - by (simp add: gw Collect_conj_eq \openin (subtopology euclidean t) w\ continuous_on_open f(2)) + then show "openin (subtopology euclidean S) (g ` W)" + by (simp add: gw Collect_conj_eq \openin (subtopology euclidean t) W\ continuous_on_open f(2)) qed then obtain u v - where osu: "openin (subtopology euclidean S) u" and uv: "P v" "g y \ u" "u \ v" "v \ g ` w" - using S [unfolded locally_def, rule_format, of "g ` w" "g y"] \y \ w\ by force + where osu: "openin (subtopology euclidean S) u" and uv: "P v" "g y \ u" "u \ v" "v \ g ` W" + using S [unfolded locally_def, rule_format, of "g ` W" "g y"] \y \ W\ by force have "v \ S" using uv by (simp add: gw) have fv: "f ` v = t \ {x. g x \ v}" using \f ` S = t\ f \v \ S\ by auto - have "f ` v \ w" + have "f ` v \ W" using uv using Int_lower2 gw image_subsetI mem_Collect_eq subset_iff by auto have contvf: "continuous_on v f" using \v \ S\ continuous_on_subset f(3) by blast have contvg: "continuous_on (f ` v) g" - using \f ` v \ w\ \w \ t\ continuous_on_subset g(3) by blast + using \f ` v \ W\ \W \ t\ continuous_on_subset g(3) by blast have homv: "homeomorphism v (f ` v) f g" - using \v \ S\ \w \ t\ f + using \v \ S\ \W \ t\ f apply (simp add: homeomorphism_def contvf contvg, auto) by (metis f(1) rev_image_eqI rev_subsetD) - have 1: "openin (subtopology euclidean t) {x \ t. g x \ u}" + have 1: "openin (subtopology euclidean t) (t \ g -` u)" apply (rule continuous_on_open [THEN iffD1, rule_format]) apply (rule \continuous_on t g\) using \g ` t = S\ apply (simp add: osu) done - have 2: "\v. Q v \ y \ {x \ t. g x \ u} \ {x \ t. g x \ u} \ v \ v \ w" + have 2: "\V. Q V \ y \ (t \ g -` u) \ (t \ g -` u) \ V \ V \ W" apply (rule_tac x="f ` v" in exI) apply (intro conjI Q [OF \P v\ homv]) - using \w \ t\ \y \ w\ \f ` v \ w\ uv apply (auto simp: fv) + using \W \ t\ \y \ W\ \f ` v \ W\ uv apply (auto simp: fv) done - show "\u. openin (subtopology euclidean t) u \ - (\v. Q v \ y \ u \ u \ v \ v \ w)" + show "\U. openin (subtopology euclidean t) U \ (\v. Q v \ y \ U \ U \ v \ v \ W)" by (meson 1 2) qed @@ -5057,22 +5056,21 @@ and Q: "\t. \t \ S; P t\ \ Q(f ` t)" shows "locally Q (f ` S)" proof (clarsimp simp add: locally_def) - fix w y - assume oiw: "openin (subtopology euclidean (f ` S)) w" and "y \ w" - then have "w \ f ` S" by (simp add: openin_euclidean_subtopology_iff) - have oivf: "openin (subtopology euclidean S) {x \ S. f x \ w}" + fix W y + assume oiw: "openin (subtopology euclidean (f ` S)) W" and "y \ W" + then have "W \ f ` S" by (simp add: openin_euclidean_subtopology_iff) + have oivf: "openin (subtopology euclidean S) (S \ f -` W)" by (rule continuous_on_open [THEN iffD1, rule_format, OF f oiw]) then obtain x where "x \ S" "f x = y" - using \w \ f ` S\ \y \ w\ by blast - then obtain u v - where "openin (subtopology euclidean S) u" "P v" "x \ u" "u \ v" "v \ {x \ S. f x \ w}" - using P [unfolded locally_def, rule_format, of "{x. x \ S \ f x \ w}" x] oivf \y \ w\ + using \W \ f ` S\ \y \ W\ by blast + then obtain U V + where "openin (subtopology euclidean S) U" "P V" "x \ U" "U \ V" "V \ S \ f -` W" + using P [unfolded locally_def, rule_format, of "(S \ f -` W)" x] oivf \y \ W\ by auto - then show "\u. openin (subtopology euclidean (f ` S)) u \ - (\v. Q v \ y \ u \ u \ v \ v \ w)" - apply (rule_tac x="f ` u" in exI) + then show "\X. openin (subtopology euclidean (f ` S)) X \ (\Y. Q Y \ y \ X \ X \ Y \ Y \ W)" + apply (rule_tac x="f ` U" in exI) apply (rule conjI, blast intro!: oo) - apply (rule_tac x="f ` v" in exI) + apply (rule_tac x="f ` V" in exI) apply (force simp: \f x = y\ rev_image_eqI intro: Q) done qed @@ -6087,7 +6085,7 @@ proposition locally_connected_quotient_image: assumes lcS: "locally connected S" and oo: "\T. T \ f ` S - \ openin (subtopology euclidean S) {x. x \ S \ f x \ T} \ + \ openin (subtopology euclidean S) (S \ f -` T) \ openin (subtopology euclidean (f ` S)) T" shows "locally connected (f ` S)" proof (clarsimp simp: locally_connected_open_component) @@ -6096,53 +6094,53 @@ then have "C \ U" "U \ f ` S" by (meson in_components_subset openin_imp_subset)+ then have "openin (subtopology euclidean (f ` S)) C \ - openin (subtopology euclidean S) {x \ S. f x \ C}" + openin (subtopology euclidean S) (S \ f -` C)" by (auto simp: oo) - moreover have "openin (subtopology euclidean S) {x \ S. f x \ C}" + moreover have "openin (subtopology euclidean S) (S \ f -` C)" proof (subst openin_subopen, clarify) fix x assume "x \ S" "f x \ C" - show "\T. openin (subtopology euclidean S) T \ x \ T \ T \ {x \ S. f x \ C}" + show "\T. openin (subtopology euclidean S) T \ x \ T \ T \ (S \ f -` C)" proof (intro conjI exI) - show "openin (subtopology euclidean S) (connected_component_set {w \ S. f w \ U} x)" + show "openin (subtopology euclidean S) (connected_component_set (S \ f -` U) x)" proof (rule ccontr) - assume **: "\ openin (subtopology euclidean S) (connected_component_set {a \ S. f a \ U} x)" - then have "x \ {a \ S. f a \ U}" + assume **: "\ openin (subtopology euclidean S) (connected_component_set (S \ f -` U) x)" + then have "x \ (S \ f -` U)" using \U \ f ` S\ opefSU lcS locally_connected_2 oo by blast with ** show False by (metis (no_types) connected_component_eq_empty empty_iff openin_subopen) qed next - show "x \ connected_component_set {w \ S. f w \ U} x" + show "x \ connected_component_set (S \ f -` U) x" using \C \ U\ \f x \ C\ \x \ S\ by auto next have contf: "continuous_on S f" by (simp add: continuous_on_open oo openin_imp_subset) - then have "continuous_on (connected_component_set {w \ S. f w \ U} x) f" + then have "continuous_on (connected_component_set (S \ f -` U) x) f" apply (rule continuous_on_subset) using connected_component_subset apply blast done - then have "connected (f ` connected_component_set {w \ S. f w \ U} x)" + then have "connected (f ` connected_component_set (S \ f -` U) x)" by (rule connected_continuous_image [OF _ connected_connected_component]) - moreover have "f ` connected_component_set {w \ S. f w \ U} x \ U" + moreover have "f ` connected_component_set (S \ f -` U) x \ U" using connected_component_in by blast - moreover have "C \ f ` connected_component_set {w \ S. f w \ U} x \ {}" + moreover have "C \ f ` connected_component_set (S \ f -` U) x \ {}" using \C \ U\ \f x \ C\ \x \ S\ by fastforce - ultimately have fC: "f ` (connected_component_set {w \ S. f w \ U} x) \ C" + ultimately have fC: "f ` (connected_component_set (S \ f -` U) x) \ C" by (rule components_maximal [OF \C \ components U\]) - have cUC: "connected_component_set {a \ S. f a \ U} x \ {a \ S. f a \ C}" + have cUC: "connected_component_set (S \ f -` U) x \ (S \ f -` C)" using connected_component_subset fC by blast - have "connected_component_set {w \ S. f w \ U} x \ connected_component_set {w \ S. f w \ C} x" + have "connected_component_set (S \ f -` U) x \ connected_component_set (S \ f -` C) x" proof - - { assume "x \ connected_component_set {a \ S. f a \ U} x" + { assume "x \ connected_component_set (S \ f -` U) x" then have ?thesis - by (simp add: cUC connected_component_maximal) } + using cUC connected_component_idemp connected_component_mono by blast } then show ?thesis using connected_component_eq_empty by auto qed - also have "... \ {w \ S. f w \ C}" + also have "... \ (S \ f -` C)" by (rule connected_component_subset) - finally show "connected_component_set {w \ S. f w \ U} x \ {x \ S. f x \ C}" . + finally show "connected_component_set (S \ f -` U) x \ (S \ f -` C)" . qed qed ultimately show "openin (subtopology euclidean (f ` S)) C" @@ -6153,8 +6151,7 @@ proposition locally_path_connected_quotient_image: assumes lcS: "locally path_connected S" and oo: "\T. T \ f ` S - \ openin (subtopology euclidean S) {x. x \ S \ f x \ T} \ - openin (subtopology euclidean (f ` S)) T" + \ openin (subtopology euclidean S) (S \ f -` T) \ openin (subtopology euclidean (f ` S)) T" shows "locally path_connected (f ` S)" proof (clarsimp simp: locally_path_connected_open_path_component) fix U y @@ -6162,62 +6159,62 @@ then have "path_component_set U y \ U" "U \ f ` S" by (meson path_component_subset openin_imp_subset)+ then have "openin (subtopology euclidean (f ` S)) (path_component_set U y) \ - openin (subtopology euclidean S) {x \ S. f x \ path_component_set U y}" + openin (subtopology euclidean S) (S \ f -` path_component_set U y)" proof - have "path_component_set U y \ f ` S" using \U \ f ` S\ \path_component_set U y \ U\ by blast then show ?thesis using oo by blast qed - moreover have "openin (subtopology euclidean S) {x \ S. f x \ path_component_set U y}" + moreover have "openin (subtopology euclidean S) (S \ f -` path_component_set U y)" proof (subst openin_subopen, clarify) fix x assume "x \ S" and Uyfx: "path_component U y (f x)" then have "f x \ U" using path_component_mem by blast - show "\T. openin (subtopology euclidean S) T \ x \ T \ T \ {x \ S. f x \ path_component_set U y}" + show "\T. openin (subtopology euclidean S) T \ x \ T \ T \ (S \ f -` path_component_set U y)" proof (intro conjI exI) - show "openin (subtopology euclidean S) (path_component_set {w \ S. f w \ U} x)" + show "openin (subtopology euclidean S) (path_component_set (S \ f -` U) x)" proof (rule ccontr) - assume **: "\ openin (subtopology euclidean S) (path_component_set {a \ S. f a \ U} x)" - then have "x \ {a \ S. f a \ U}" + assume **: "\ openin (subtopology euclidean S) (path_component_set (S \ f -` U) x)" + then have "x \ (S \ f -` U)" by (metis (no_types, lifting) \U \ f ` S\ opefSU lcS oo locally_path_connected_open_path_component) then show False using ** \path_component_set U y \ U\ \x \ S\ \path_component U y (f x)\ by blast qed next - show "x \ path_component_set {w \ S. f w \ U} x" - by (metis (no_types, lifting) \x \ S\ IntD2 Int_Collect \path_component U y (f x)\ path_component_mem(2) path_component_refl) + show "x \ path_component_set (S \ f -` U) x" + by (simp add: \f x \ U\ \x \ S\ path_component_refl) next have contf: "continuous_on S f" by (simp add: continuous_on_open oo openin_imp_subset) - then have "continuous_on (path_component_set {w \ S. f w \ U} x) f" + then have "continuous_on (path_component_set (S \ f -` U) x) f" apply (rule continuous_on_subset) using path_component_subset apply blast done - then have "path_connected (f ` path_component_set {w \ S. f w \ U} x)" - by (simp add: path_connected_continuous_image path_connected_path_component) - moreover have "f ` path_component_set {w \ S. f w \ U} x \ U" + then have "path_connected (f ` path_component_set (S \ f -` U) x)" + by (simp add: path_connected_continuous_image) + moreover have "f ` path_component_set (S \ f -` U) x \ U" using path_component_mem by fastforce - moreover have "f x \ f ` path_component_set {w \ S. f w \ U} x" + moreover have "f x \ f ` path_component_set (S \ f -` U) x" by (force simp: \x \ S\ \f x \ U\ path_component_refl_eq) - ultimately have "f ` (path_component_set {w \ S. f w \ U} x) \ path_component_set U (f x)" + ultimately have "f ` (path_component_set (S \ f -` U) x) \ path_component_set U (f x)" by (meson path_component_maximal) also have "... \ path_component_set U y" - by (simp add: Uyfx path_component_maximal path_component_subset path_component_sym path_connected_path_component) - finally have fC: "f ` (path_component_set {w \ S. f w \ U} x) \ path_component_set U y" . - have cUC: "path_component_set {a \ S. f a \ U} x \ {a \ S. f a \ path_component_set U y}" + by (simp add: Uyfx path_component_maximal path_component_subset path_component_sym) + finally have fC: "f ` (path_component_set (S \ f -` U) x) \ path_component_set U y" . + have cUC: "path_component_set (S \ f -` U) x \ (S \ f -` path_component_set U y)" using path_component_subset fC by blast - have "path_component_set {w \ S. f w \ U} x \ path_component_set {w \ S. f w \ path_component_set U y} x" + have "path_component_set (S \ f -` U) x \ path_component_set (S \ f -` path_component_set U y) x" proof - - have "\a. path_component_set (path_component_set {a \ S. f a \ U} x) a \ path_component_set {a \ S. f a \ path_component_set U y} a" + have "\a. path_component_set (path_component_set (S \ f -` U) x) a \ path_component_set (S \ f -` path_component_set U y) a" using cUC path_component_mono by blast then show ?thesis using path_component_path_component by blast qed - also have "... \ {w \ S. f w \ path_component_set U y}" + also have "... \ (S \ f -` path_component_set U y)" by (rule path_component_subset) - finally show "path_component_set {w \ S. f w \ U} x \ {x \ S. f x \ path_component_set U y}" . + finally show "path_component_set (S \ f -` U) x \ (S \ f -` path_component_set U y)" . qed qed ultimately show "openin (subtopology euclidean (f ` S)) (path_component_set U y)" @@ -6234,13 +6231,10 @@ proof (clarsimp simp: continuous_openin_preimage_eq) fix t :: "'b set" assume "open t" - have "{x. x \ S \ f x \ t} = \{{x. x \ c \ f x \ t} |c. c \ components S}" - apply auto - apply (metis (lifting) components_iff connected_component_refl_eq mem_Collect_eq) - using Union_components by blast - then show "openin (subtopology euclidean S) {x \ S. f x \ t}" - using \open t\ assms - by (fastforce intro: openin_trans continuous_openin_preimage_gen) + have *: "S \ f -` t = (\c \ components S. c \ f -` t)" + by auto + show "openin (subtopology euclidean S) (S \ f -` t)" + unfolding * using \open t\ assms continuous_openin_preimage_gen openin_trans openin_Union by blast qed lemma continuous_on_components: @@ -6308,11 +6302,9 @@ proof - have "closedin (subtopology euclidean UNIV) (S \ \c)" apply (rule closedin_union_complement_components [OF locally_connected_UNIV]) - using S apply (simp add: closed_closedin) - using c apply (simp add: Compl_eq_Diff_UNIV) + using S c apply (simp_all add: Compl_eq_Diff_UNIV) done - then show ?thesis - by (simp add: closed_closedin) + then show ?thesis by simp qed lemma closedin_Un_complement_component: diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Starlike.thy --- a/src/HOL/Analysis/Starlike.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Starlike.thy Thu Oct 19 17:16:13 2017 +0100 @@ -4973,10 +4973,16 @@ lemma setdist_eq_0_closedin: fixes S :: "'a::euclidean_space set" - shows "\closedin (subtopology euclidean u) S; x \ u\ + shows "\closedin (subtopology euclidean U) S; x \ U\ \ (setdist {x} S = 0 \ S = {} \ x \ S)" by (auto simp: closedin_limpt setdist_eq_0_sing_1 closure_def) +lemma setdist_gt_0_closedin: + fixes S :: "'a::euclidean_space set" + shows "\closedin (subtopology euclidean U) S; x \ U; S \ {}; x \ S\ + \ setdist {x} S > 0" + using less_eq_real_def setdist_eq_0_closedin by fastforce + subsection\Basic lemmas about hyperplanes and halfspaces\ lemma hyperplane_eq_Ex: @@ -5089,25 +5095,19 @@ have contf: "continuous_on U f" unfolding f_def by (intro continuous_intros) show ?thesis - proof (rule_tac S' = "{x\U. f x > 0}" and T' = "{x\U. f x < 0}" in that) - show "{x \ U. 0 < f x} \ {x \ U. f x < 0} = {}" + proof (rule_tac S' = "(U \ f -` {0<..})" and T' = "(U \ f -` {..<0})" in that) + show "(U \ f -` {0<..}) \ (U \ f -` {..<0}) = {}" by auto - have "openin (subtopology euclidean U) {x \ U. f x \ {0<..}}" - by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf) - then show "openin (subtopology euclidean U) {x \ U. 0 < f x}" by simp - next - have "openin (subtopology euclidean U) {x \ U. f x \ {..<0}}" + show "openin (subtopology euclidean U) (U \ f -` {0<..})" by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf) - then show "openin (subtopology euclidean U) {x \ U. f x < 0}" by simp + next + show "openin (subtopology euclidean U) (U \ f -` {..<0})" + by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf) next - show "S \ {x \ U. 0 < f x}" - apply (clarsimp simp add: f_def setdist_sing_in_set) - using assms - by (metis False Int_insert_right closedin_imp_subset empty_not_insert insert_absorb insert_subset linorder_neqE_linordered_idom not_le setdist_eq_0_closedin setdist_pos_le) - show "T \ {x \ U. f x < 0}" - apply (clarsimp simp add: f_def setdist_sing_in_set) - using assms - by (metis False closedin_subset disjoint_iff_not_equal insert_absorb insert_subset linorder_neqE_linordered_idom not_less setdist_eq_0_closedin setdist_pos_le topspace_euclidean_subtopology) + have "S \ U" "T \ U" + using closedin_imp_subset assms by blast+ + then show "S \ U \ f -` {0<..}" "T \ U \ f -` {..<0}" + using assms False by (force simp add: f_def setdist_sing_in_set intro!: setdist_gt_0_closedin)+ qed qed @@ -5282,7 +5282,7 @@ proposition proper_map: fixes f :: "'a::heine_borel \ 'b::heine_borel" assumes "closedin (subtopology euclidean S) K" - and com: "\U. \U \ T; compact U\ \ compact {x \ S. f x \ U}" + and com: "\U. \U \ T; compact U\ \ compact (S \ f -` U)" and "f ` S \ T" shows "closedin (subtopology euclidean T) (f ` K)" proof - @@ -5298,7 +5298,7 @@ by metis then have fX: "\n. f (X n) = h n" by metis - have "compact (C \ {a \ S. f a \ insert y (range (\i. f(X(n + i))))})" for n + have "compact (C \ (S \ f -` insert y (range (\i. f(X(n + i))))))" for n apply (rule closed_Int_compact [OF \closed C\]) apply (rule com) using X \K \ S\ \f ` S \ T\ \y \ T\ apply blast @@ -5350,16 +5350,16 @@ assume RHS: ?rhs obtain g where gf: "\x. x \ S \ g (f x) = x" by (metis inv_into_f_f f) - then have *: "{x \ S. f x \ U} = g ` U" if "U \ f ` S" for U + then have *: "(S \ f -` U) = g ` U" if "U \ f ` S" for U using that by fastforce have gfim: "g ` f ` S \ S" using gf by auto - have **: "compact {x \ f ` S. g x \ C}" if C: "C \ S" "compact C" for C + have **: "compact (f ` S \ g -` C)" if C: "C \ S" "compact C" for C proof - - obtain h :: "'a set \ 'a" where "h C \ C \ h C \ S \ compact (f ` C)" + obtain h where "h C \ C \ h C \ S \ compact (f ` C)" by (force simp: C RHS) - moreover have "f ` C = {b \ f ` S. g b \ C}" + moreover have "f ` C = (f ` S \ g -` C)" using C gf by auto - ultimately show "compact {b \ f ` S. g b \ C}" + ultimately show ?thesis using C by auto qed show ?lhs @@ -5510,14 +5510,14 @@ fixes f :: "'a::euclidean_space \ 'b::euclidean_space" assumes contf: "continuous_on S f" and imf: "f ` S \ T" and "compact S" "closedin (subtopology euclidean T) K" - shows "compact {x. x \ S \ f x \ K}" + shows "compact (S \ f -` K)" by (rule closedin_compact [OF \compact S\] continuous_closedin_preimage_gen assms)+ lemma proper_map_fst: assumes "compact T" "K \ S" "compact K" - shows "compact {z \ S \ T. fst z \ K}" -proof - - have "{z \ S \ T. fst z \ K} = K \ T" + shows "compact (S \ T \ fst -` K)" +proof - + have "(S \ T \ fst -` K) = K \ T" using assms by auto then show ?thesis by (simp add: assms compact_Times) qed @@ -5535,9 +5535,9 @@ lemma proper_map_snd: assumes "compact S" "K \ T" "compact K" - shows "compact {z \ S \ T. snd z \ K}" -proof - - have "{z \ S \ T. snd z \ K} = S \ K" + shows "compact (S \ T \ snd -` K)" +proof - + have "(S \ T \ snd -` K) = S \ K" using assms by auto then show ?thesis by (simp add: assms compact_Times) qed @@ -7872,8 +7872,7 @@ and "\U. U \ \' \ open U \ (\T. T \ \ \ U \ T)" and "\x. \V. open V \ x \ V \ finite {U. U \ \' \ (U \ V \ {})}" -using paracompact_closedin [of UNIV S \] assms -by (auto simp: open_openin [symmetric] closed_closedin [symmetric]) +using paracompact_closedin [of UNIV S \] assms by auto subsection\Closed-graph characterization of continuity\ @@ -7883,7 +7882,7 @@ assumes contf: "continuous_on S f" and fim: "f ` S \ T" shows "closedin (subtopology euclidean (S \ T)) ((\x. Pair x (f x)) ` S)" proof - - have eq: "((\x. Pair x (f x)) ` S) = {z. z \ S \ T \ (f \ fst)z - snd z \ {0}}" + have eq: "((\x. Pair x (f x)) ` S) =(S \ T \ (\z. (f \ fst)z - snd z) -` {0})" using fim by auto show ?thesis apply (subst eq) @@ -7902,9 +7901,9 @@ proof (clarsimp simp add: continuous_on_closed_gen [OF fim]) fix U assume U: "closedin (subtopology euclidean T) U" - have eq: "{x. x \ S \ f x \ U} = fst ` (((\x. Pair x (f x)) ` S) \ (S \ U))" + have eq: "(S \ f -` U) = fst ` (((\x. Pair x (f x)) ` S) \ (S \ U))" by (force simp: image_iff) - show "closedin (subtopology euclidean S) {x \ S. f x \ U}" + show "closedin (subtopology euclidean S) (S \ f -` U)" by (simp add: U closedin_Int closedin_Times closed_map_fst [OF \compact T\] that eq) qed with continuous_closed_graph_gen assms show ?thesis by blast diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Tagged_Division.thy --- a/src/HOL/Analysis/Tagged_Division.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Tagged_Division.thy Thu Oct 19 17:16:13 2017 +0100 @@ -66,7 +66,7 @@ shows "interior i \ interior S" proof - have "box a b \ cbox c d = {}" - using inter_interval_mixed_eq_empty[of c d a b] assms + using Int_interval_mixed_eq_empty[of c d a b] assms unfolding interior_cbox by auto moreover have "box a b \ cbox c d \ S" diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Analysis/Topology_Euclidean_Space.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Topology_Euclidean_Space.thy Thu Oct 19 17:16:13 2017 +0100 @@ -858,10 +858,15 @@ by (simp add: closedin_def topspace_subtopology) lemma openin_subtopology_Un: - "openin (subtopology U T) S \ openin (subtopology U u) S - \ openin (subtopology U (T \ u)) S" + "\openin (subtopology X T) S; openin (subtopology X U) S\ + \ openin (subtopology X (T \ U)) S" by (simp add: openin_subtopology) blast +lemma closedin_subtopology_Un: + "\closedin (subtopology X T) S; closedin (subtopology X U) S\ + \ closedin (subtopology X (T \ U)) S" +by (simp add: closedin_subtopology) blast + subsubsection \The standard Euclidean topology\ @@ -886,6 +891,8 @@ lemma closed_closedin: "closed S \ closedin euclidean S" by (simp add: closed_def closedin_def Compl_eq_Diff_UNIV) +declare closed_closedin [symmetric, simp] + lemma open_subopen: "open S \ (\x\S. \T. open T \ x \ T \ T \ S)" using openI by auto @@ -913,7 +920,7 @@ by (auto simp: openin_open) lemma closedin_closed: "closedin (subtopology euclidean U) S \ (\T. closed T \ S = U \ T)" - by (simp add: closedin_subtopology closed_closedin Int_ac) + by (simp add: closedin_subtopology Int_ac) lemma closedin_closed_Int: "closed S \ closedin (subtopology euclidean U) (U \ S)" by (metis closedin_closed) @@ -965,7 +972,7 @@ ~(\e1 e2. openin (subtopology euclidean s) e1 \ openin (subtopology euclidean s) e2 \ s \ e1 \ e2 \ e1 \ e2 = {} \ e1 \ {} \ e2 \ {})" - apply (simp add: connected_def openin_open, safe) + apply (simp add: connected_def openin_open disjoint_iff_not_equal, safe) apply (simp_all, blast+) (* SLOW *) done @@ -1032,7 +1039,7 @@ lemma closedin_trans[trans]: "closedin (subtopology euclidean T) S \ closedin (subtopology euclidean U) T \ closedin (subtopology euclidean U) S" - by (auto simp: closedin_closed closed_closedin closed_Inter Int_assoc) + by (auto simp: closedin_closed closed_Inter Int_assoc) lemma closedin_closed_trans: "closedin (subtopology euclidean T) S \ closed T \ closed S" by (auto simp: closedin_closed intro: closedin_trans) @@ -5304,9 +5311,9 @@ qed lemma continuous_on_open: - "continuous_on s f \ - (\t. openin (subtopology euclidean (f ` s)) t \ - openin (subtopology euclidean s) {x \ s. f x \ t})" + "continuous_on S f \ + (\T. openin (subtopology euclidean (f ` S)) T \ + openin (subtopology euclidean S) (S \ f -` T))" unfolding continuous_on_open_invariant openin_open Int_def vimage_def Int_commute by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong) @@ -5315,37 +5322,42 @@ assumes "f ` S \ T" shows "continuous_on S f \ (\U. openin (subtopology euclidean T) U - \ openin (subtopology euclidean S) {x \ S. f x \ U})" + \ openin (subtopology euclidean S) (S \ f -` U))" (is "?lhs = ?rhs") proof assume ?lhs then show ?rhs - apply (auto simp: openin_euclidean_subtopology_iff continuous_on_iff) + apply (clarsimp simp: openin_euclidean_subtopology_iff continuous_on_iff) by (metis assms image_subset_iff) next have ope: "openin (subtopology euclidean T) (ball y e \ T)" for y e by (simp add: Int_commute openin_open_Int) - assume ?rhs - then show ?lhs - apply (clarsimp simp add: continuous_on_iff) - apply (drule_tac x = "ball (f x) e \ T" in spec) - apply (clarsimp simp add: ope openin_euclidean_subtopology_iff [of S]) - by (metis (no_types, hide_lams) assms dist_commute dist_self image_subset_iff) + assume R [rule_format]: ?rhs + show ?lhs + proof (clarsimp simp add: continuous_on_iff) + fix x and e::real + assume "x \ S" and "0 < e" + then have x: "x \ S \ (f -` ball (f x) e \ f -` T)" + using assms by auto + show "\d>0. \x'\S. dist x' x < d \ dist (f x') (f x) < e" + using R [of "ball (f x) e \ T"] x + by (fastforce simp add: ope openin_euclidean_subtopology_iff [of S] dist_commute) + qed qed lemma continuous_openin_preimage: fixes f :: "'a::metric_space \ 'b::metric_space" shows "\continuous_on S f; f ` S \ T; openin (subtopology euclidean T) U\ - \ openin (subtopology euclidean S) {x \ S. f x \ U}" + \ openin (subtopology euclidean S) (S \ f -` U)" by (simp add: continuous_on_open_gen) text \Similarly in terms of closed sets.\ lemma continuous_on_closed: - "continuous_on s f \ - (\t. closedin (subtopology euclidean (f ` s)) t \ - closedin (subtopology euclidean s) {x \ s. f x \ t})" + "continuous_on S f \ + (\T. closedin (subtopology euclidean (f ` S)) T \ + closedin (subtopology euclidean S) (S \ f -` T))" unfolding continuous_on_closed_invariant closedin_closed Int_def vimage_def Int_commute by (simp add: imp_ex imageI conj_commute eq_commute cong: conj_cong) @@ -5354,61 +5366,73 @@ assumes "f ` S \ T" shows "continuous_on S f \ (\U. closedin (subtopology euclidean T) U - \ closedin (subtopology euclidean S) {x \ S. f x \ U})" + \ closedin (subtopology euclidean S) (S \ f -` U))" + (is "?lhs = ?rhs") proof - - have *: "U \ T \ {x \ S. f x \ T \ f x \ U} = S - {x \ S. f x \ U}" for U + have *: "U \ T \ S \ f -` (T - U) = S - (S \ f -` U)" for U using assms by blast show ?thesis - apply (simp add: continuous_on_open_gen [OF assms], safe) - apply (drule_tac [!] x="T-U" in spec) - apply (force simp: closedin_def *) - apply (force simp: openin_closedin_eq *) - done + proof + assume L: ?lhs + show ?rhs + proof clarify + fix U + assume "closedin (subtopology euclidean T) U" + then show "closedin (subtopology euclidean S) (S \ f -` U)" + using L unfolding continuous_on_open_gen [OF assms] + by (metis * closedin_def inf_le1 topspace_euclidean_subtopology) + qed + next + assume R [rule_format]: ?rhs + show ?lhs + unfolding continuous_on_open_gen [OF assms] + by (metis * R inf_le1 openin_closedin_eq topspace_euclidean_subtopology) + qed qed lemma continuous_closedin_preimage_gen: fixes f :: "'a::metric_space \ 'b::metric_space" assumes "continuous_on S f" "f ` S \ T" "closedin (subtopology euclidean T) U" - shows "closedin (subtopology euclidean S) {x \ S. f x \ U}" + shows "closedin (subtopology euclidean S) (S \ f -` U)" using assms continuous_on_closed_gen by blast lemma continuous_on_imp_closedin: assumes "continuous_on S f" "closedin (subtopology euclidean (f ` S)) T" - shows "closedin (subtopology euclidean S) {x. x \ S \ f x \ T}" + shows "closedin (subtopology euclidean S) (S \ f -` T)" using assms continuous_on_closed by blast subsection \Half-global and completely global cases.\ lemma continuous_openin_preimage_gen: - assumes "continuous_on s f" "open t" - shows "openin (subtopology euclidean s) {x \ s. f x \ t}" + assumes "continuous_on S f" "open T" + shows "openin (subtopology euclidean S) (S \ f -` T)" proof - - have *: "\x. x \ s \ f x \ t \ x \ s \ f x \ (t \ f ` s)" + have *: "(S \ f -` T) = (S \ f -` (T \ f ` S))" by auto - have "openin (subtopology euclidean (f ` s)) (t \ f ` s)" - using openin_open_Int[of t "f ` s", OF assms(2)] unfolding openin_open by auto + have "openin (subtopology euclidean (f ` S)) (T \ f ` S)" + using openin_open_Int[of T "f ` S", OF assms(2)] unfolding openin_open by auto then show ?thesis - using assms(1)[unfolded continuous_on_open, THEN spec[where x="t \ f ` s"]] + using assms(1)[unfolded continuous_on_open, THEN spec[where x="T \ f ` S"]] using * by auto qed lemma continuous_closedin_preimage: - assumes "continuous_on s f" and "closed t" - shows "closedin (subtopology euclidean s) {x \ s. f x \ t}" + assumes "continuous_on S f" and "closed T" + shows "closedin (subtopology euclidean S) (S \ f -` T)" proof - - have *: "\x. x \ s \ f x \ t \ x \ s \ f x \ (t \ f ` s)" + have *: "(S \ f -` T) = (S \ f -` (T \ f ` S))" by auto - have "closedin (subtopology euclidean (f ` s)) (t \ f ` s)" - using closedin_closed_Int[of t "f ` s", OF assms(2)] + have "closedin (subtopology euclidean (f ` S)) (T \ f ` S)" + using closedin_closed_Int[of T "f ` S", OF assms(2)] by (simp add: Int_commute) then show ?thesis - using assms(1)[unfolded continuous_on_closed, THEN spec[where x="t \ f ` s"]] + using assms(1)[unfolded continuous_on_closed, THEN spec[where x="T \ f ` S"]] using * by auto qed lemma continuous_openin_preimage_eq: "continuous_on S f \ - (\t. open t \ openin (subtopology euclidean S) {x. x \ S \ f x \ t})" + (\T. open T \ openin (subtopology euclidean S) (S \ f -` T))" apply safe apply (simp add: continuous_openin_preimage_gen) apply (fastforce simp add: continuous_on_open openin_open) @@ -5416,66 +5440,55 @@ lemma continuous_closedin_preimage_eq: "continuous_on S f \ - (\t. closed t \ closedin (subtopology euclidean S) {x. x \ S \ f x \ t})" + (\T. closed T \ closedin (subtopology euclidean S) (S \ f -` T))" apply safe apply (simp add: continuous_closedin_preimage) apply (fastforce simp add: continuous_on_closed closedin_closed) done lemma continuous_open_preimage: - assumes "continuous_on s f" - and "open s" - and "open t" - shows "open {x \ s. f x \ t}" + assumes contf: "continuous_on S f" and "open S" "open T" + shows "open (S \ f -` T)" proof- - obtain T where T: "open T" "{x \ s. f x \ t} = s \ T" - using continuous_openin_preimage_gen[OF assms(1,3)] unfolding openin_open by auto + obtain U where "open U" "(S \ f -` T) = S \ U" + using continuous_openin_preimage_gen[OF contf \open T\] + unfolding openin_open by auto then show ?thesis - using open_Int[of s T, OF assms(2)] by auto + using open_Int[of S U, OF \open S\] by auto qed lemma continuous_closed_preimage: - assumes "continuous_on s f" - and "closed s" - and "closed t" - shows "closed {x \ s. f x \ t}" + assumes contf: "continuous_on S f" and "closed S" "closed T" + shows "closed (S \ f -` T)" proof- - obtain T where "closed T" "{x \ s. f x \ t} = s \ T" - using continuous_closedin_preimage[OF assms(1,3)] + obtain U where "closed U" "(S \ f -` T) = S \ U" + using continuous_closedin_preimage[OF contf \closed T\] unfolding closedin_closed by auto - then show ?thesis using closed_Int[of s T, OF assms(2)] by auto + then show ?thesis using closed_Int[of S U, OF \closed S\] by auto qed -lemma continuous_open_preimage_univ: - "open s \ (\x. continuous (at x) f) \ open {x. f x \ s}" - using continuous_open_preimage[of UNIV f s] open_UNIV continuous_at_imp_continuous_on by auto - -lemma continuous_closed_preimage_univ: - "closed s \ (\x. continuous (at x) f) \ closed {x. f x \ s}" - using continuous_closed_preimage[of UNIV f s] closed_UNIV continuous_at_imp_continuous_on by auto - -lemma continuous_open_vimage: "open s \ (\x. continuous (at x) f) \ open (f -` s)" - unfolding vimage_def by (rule continuous_open_preimage_univ) - -lemma continuous_closed_vimage: "closed s \ (\x. continuous (at x) f) \ closed (f -` s)" - unfolding vimage_def by (rule continuous_closed_preimage_univ) +lemma continuous_open_vimage: "open S \ (\x. continuous (at x) f) \ open (f -` S)" + by (metis continuous_on_eq_continuous_within open_vimage) + +lemma continuous_closed_vimage: "closed S \ (\x. continuous (at x) f) \ closed (f -` S)" + by (simp add: closed_vimage continuous_on_eq_continuous_within) lemma interior_image_subset: assumes "inj f" "\x. continuous (at x) f" - shows "interior (f ` s) \ f ` (interior s)" + shows "interior (f ` S) \ f ` (interior S)" proof - fix x assume "x \ interior (f ` s)" - then obtain T where as: "open T" "x \ T" "T \ f ` s" .. - then have "x \ f ` s" by auto - then obtain y where y: "y \ s" "x = f y" by auto - have "open (vimage f T)" - using assms \open T\ by (metis continuous_open_vimage) + fix x assume "x \ interior (f ` S)" + then obtain T where as: "open T" "x \ T" "T \ f ` S" .. + then have "x \ f ` S" by auto + then obtain y where y: "y \ S" "x = f y" by auto + have "open (f -` T)" + using assms \open T\ by (simp add: continuous_at_imp_continuous_on open_vimage) moreover have "y \ vimage f T" using \x = f y\ \x \ T\ by simp - moreover have "vimage f T \ s" - using \T \ image f s\ \inj f\ unfolding inj_on_def subset_eq by auto - ultimately have "y \ interior s" .. - with \x = f y\ show "x \ f ` interior s" .. + moreover have "vimage f T \ S" + using \T \ image f S\ \inj f\ unfolding inj_on_def subset_eq by auto + ultimately have "y \ interior S" .. + with \x = f y\ show "x \ f ` interior S" .. qed subsection \Topological properties of linear functions.\ @@ -5853,7 +5866,7 @@ by auto qed -lemma inter_interval_mixed_eq_empty: +lemma Int_interval_mixed_eq_empty: fixes a :: "'a::euclidean_space" assumes "box c d \ {}" shows "box a b \ cbox c d = {} \ box a b \ box c d = {}" diff -r ee874941dfb8 -r d3d508b23d1d src/HOL/Analysis/Winding_Numbers.thy --- a/src/HOL/Analysis/Winding_Numbers.thy Thu Oct 19 00:55:34 2017 +0200 +++ b/src/HOL/Analysis/Winding_Numbers.thy Thu Oct 19 17:16:13 2017 +0100 @@ -740,22 +740,20 @@ case True have "path \" by (simp add: assms simple_path_imp_path) - then obtain k where k: "\z. z \ inside(path_image \) \ winding_number \ z = k" + then have const: "winding_number \ constant_on inside(path_image \)" proof (rule winding_number_constant) show "connected (inside(path_image \))" by (simp add: Jordan_inside_outside True assms) qed (use inside_no_overlap True in auto) obtain z where zin: "z \ inside (path_image \)" and z1: "cmod (winding_number \ z) = 1" using simple_closed_path_wn3 [of \] True assms by blast - with k have "winding_number \ z = k" - by blast have "winding_number \ z \ \" using zin integer_winding_number [OF \path \\ True] inside_def by blast with z1 consider "winding_number \ z = 1" | "winding_number \ z = -1" apply (auto simp: Ints_def abs_if split: if_split_asm) by (metis of_int_1 of_int_eq_iff of_int_minus) - then show ?thesis - using that \winding_number \ z = k\ k by auto + with that const zin show ?thesis + unfolding constant_on_def by metis next case False then show ?thesis