# HG changeset patch # User paulson # Date 1457361285 0 # Node ID bc25f3916a99c0369ace28fb12e4987487d83884 # Parent edee1966fddf525fdc4a01c7e8c29f4196abddb8 new material to Blochj's theorem, as well as supporting lemmas diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Mon Mar 07 14:34:45 2016 +0000 @@ -2678,6 +2678,7 @@ (** Existence of a primitive.*) lemma holomorphic_starlike_primitive: + fixes f :: "complex \ complex" assumes contf: "continuous_on s f" and s: "starlike s" and os: "open s" and k: "finite k" @@ -2796,6 +2797,8 @@ done lemma holomorphic_convex_primitive: + fixes f :: "complex \ complex" + shows "\convex s; finite k; continuous_on s f; \x. x \ interior s - k \ f complex_differentiable at x\ \ \g. \x \ s. (g has_field_derivative f x) (at x within s)" diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy --- a/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy Mon Mar 07 14:34:45 2016 +0000 @@ -277,11 +277,14 @@ subsection\Holomorphic functions\ -text\Could be generalized to real normed fields, but in practice that would only include the reals\ -definition complex_differentiable :: "[complex \ complex, complex filter] \ bool" +definition complex_differentiable :: "['a \ 'a::real_normed_field, 'a filter] \ bool" (infixr "(complex'_differentiable)" 50) where "f complex_differentiable F \ \f'. (f has_field_derivative f') F" +lemma complex_differentiable_derivI: + "f complex_differentiable (at x) \ (f has_field_derivative deriv f x) (at x)" +by (simp add: complex_differentiable_def DERIV_deriv_iff_has_field_derivative) + lemma complex_differentiable_imp_continuous_at: "f complex_differentiable (at x within s) \ continuous (at x within s) f" by (metis DERIV_continuous complex_differentiable_def) @@ -297,24 +300,24 @@ unfolding complex_differentiable_def by (metis DERIV_subset top_greatest) -lemma complex_differentiable_linear [derivative_intros]: "(op * c) complex_differentiable F" +lemma complex_differentiable_linear [simp,derivative_intros]: "(op * c) complex_differentiable F" proof - show ?thesis unfolding complex_differentiable_def has_field_derivative_def mult_commute_abs by (force intro: has_derivative_mult_right) qed -lemma complex_differentiable_const [derivative_intros]: "(\z. c) complex_differentiable F" +lemma complex_differentiable_const [simp,derivative_intros]: "(\z. c) complex_differentiable F" unfolding complex_differentiable_def has_field_derivative_def by (rule exI [where x=0]) (metis has_derivative_const lambda_zero) -lemma complex_differentiable_ident [derivative_intros]: "(\z. z) complex_differentiable F" +lemma complex_differentiable_ident [simp,derivative_intros]: "(\z. z) complex_differentiable F" unfolding complex_differentiable_def has_field_derivative_def by (rule exI [where x=1]) (simp add: lambda_one [symmetric]) -lemma complex_differentiable_id [derivative_intros]: "id complex_differentiable F" +lemma complex_differentiable_id [simp,derivative_intros]: "id complex_differentiable F" unfolding id_def by (rule complex_differentiable_ident) lemma complex_differentiable_minus [derivative_intros]: @@ -328,6 +331,10 @@ using assms unfolding complex_differentiable_def by (metis field_differentiable_add) +lemma complex_differentiable_add_const [simp,derivative_intros]: + "op + c complex_differentiable F" + by (simp add: complex_differentiable_add) + lemma complex_differentiable_setsum [derivative_intros]: "(\i. i \ I \ (f i) complex_differentiable F) \ (\z. \i\I. f i z) complex_differentiable F" by (induct I rule: infinite_finite_induct) @@ -503,6 +510,11 @@ "DERIV f x :> deriv f x \ f complex_differentiable at x" unfolding complex_differentiable_def by (metis DERIV_imp_deriv) +lemma holomorphic_derivI: + "\f holomorphic_on S; open S; x \ S\ + \ (f has_field_derivative deriv f x) (at x within T)" +by (metis DERIV_deriv_iff_complex_differentiable at_within_open holomorphic_on_def has_field_derivative_at_within) + lemma complex_derivative_chain: "f complex_differentiable at x \ g complex_differentiable at (f x) \ deriv (g o f) x = deriv g (f x) * deriv f x" @@ -568,6 +580,20 @@ apply (simp add: algebra_simps) done +lemma nonzero_deriv_nonconstant: + assumes df: "DERIV f \ :> df" and S: "open S" "\ \ S" and "df \ 0" + shows "\ f constant_on S" +unfolding constant_on_def +by (metis \df \ 0\ DERIV_transform_within_open [OF df S] DERIV_const DERIV_unique) + +lemma holomorphic_nonconstant: + assumes holf: "f holomorphic_on S" and "open S" "\ \ S" "deriv f \ \ 0" + shows "\ f constant_on S" + apply (rule nonzero_deriv_nonconstant [of f "deriv f \" \ S]) + using assms + apply (auto simp: holomorphic_derivI) + done + subsection\Analyticity on a set\ definition analytic_on (infixl "(analytic'_on)" 50) diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Complex_Transcendental.thy --- a/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy Mon Mar 07 14:34:45 2016 +0000 @@ -1633,13 +1633,15 @@ done lemma complex_differentiable_powr_right: + fixes w::complex + shows "w \ 0 \ (\z. w powr z) complex_differentiable (at z)" using complex_differentiable_def has_field_derivative_powr_right by blast lemma holomorphic_on_powr_right: "f holomorphic_on s \ w \ 0 \ (\z. w powr (f z)) holomorphic_on s" - unfolding holomorphic_on_def - using DERIV_chain' complex_differentiable_def has_field_derivative_powr_right by fastforce + unfolding holomorphic_on_def complex_differentiable_def +by (metis (full_types) DERIV_chain' has_field_derivative_powr_right) lemma norm_powr_real_powr: "w \ \ \ 0 < Re w \ norm(w powr z) = Re w powr Re z" diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Conformal_Mappings.thy --- a/src/HOL/Multivariate_Analysis/Conformal_Mappings.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Conformal_Mappings.thy Mon Mar 07 14:34:45 2016 +0000 @@ -1722,4 +1722,412 @@ done qed +subsection\Bloch's theorem\ + +lemma Bloch_lemma_0: + assumes holf: "f holomorphic_on cball 0 r" and "0 < r" + and [simp]: "f 0 = 0" + and le: "\z. norm z < r \ norm(deriv f z) \ 2 * norm(deriv f 0)" + shows "ball 0 ((3 - 2 * sqrt 2) * r * norm(deriv f 0)) \ f ` ball 0 r" +proof - + have "sqrt 2 < 3/2" + by (rule real_less_lsqrt) (auto simp: power2_eq_square) + then have sq3: "0 < 3 - 2 * sqrt 2" by simp + show ?thesis + proof (cases "deriv f 0 = 0") + case True then show ?thesis by simp + next + case False + def C \ "2 * norm(deriv f 0)" + have "0 < C" using False by (simp add: C_def) + have holf': "f holomorphic_on ball 0 r" using holf + using ball_subset_cball holomorphic_on_subset by blast + then have holdf': "deriv f holomorphic_on ball 0 r" + by (rule holomorphic_deriv [OF _ open_ball]) + have "Le1": "norm(deriv f z - deriv f 0) \ norm z / (r - norm z) * C" + if "norm z < r" for z + proof - + have T1: "norm(deriv f z - deriv f 0) \ norm z / (R - norm z) * C" + if R: "norm z < R" "R < r" for R + proof - + have "0 < R" using R + by (metis less_trans norm_zero zero_less_norm_iff) + have df_le: "\x. norm x < r \ norm (deriv f x) \ C" + using le by (simp add: C_def) + have hol_df: "deriv f holomorphic_on cball 0 R" + apply (rule holomorphic_on_subset) using R holdf' by auto + have *: "((\w. deriv f w / (w - z)) has_contour_integral 2 * pi * \ * deriv f z) (circlepath 0 R)" + if "norm z < R" for z + using \0 < R\ that Cauchy_integral_formula_convex_simple [OF convex_cball hol_df, of _ "circlepath 0 R"] + by (force simp: winding_number_circlepath) + have **: "((\x. deriv f x / (x - z) - deriv f x / x) has_contour_integral + of_real (2 * pi) * \ * (deriv f z - deriv f 0)) + (circlepath 0 R)" + using has_contour_integral_diff [OF * [of z] * [of 0]] \0 < R\ that + by (simp add: algebra_simps) + have [simp]: "\x. norm x = R \ x \ z" using that(1) by blast + have "norm (deriv f x / (x - z) - deriv f x / x) + \ C * norm z / (R * (R - norm z))" + if "norm x = R" for x + proof - + have [simp]: "norm (deriv f x * x - deriv f x * (x - z)) = + norm (deriv f x) * norm z" + by (simp add: norm_mult right_diff_distrib') + show ?thesis + using \0 < R\ \0 < C\ R that + apply (simp add: norm_mult norm_divide divide_simps) + using df_le norm_triangle_ineq2 \0 < C\ apply (auto intro!: mult_mono) + done + qed + then show ?thesis + using has_contour_integral_bound_circlepath + [OF **, of "C * norm z/(R*(R - norm z))"] + \0 < R\ \0 < C\ R + apply (simp add: norm_mult norm_divide) + apply (simp add: divide_simps mult.commute) + done + qed + obtain r' where r': "norm z < r'" "r' < r" + using Rats_dense_in_real [of "norm z" r] \norm z < r\ by blast + then have [simp]: "closure {r'<.. norm(f z)" + if r: "norm z < r" for z + proof - + have 1: "\x. x \ ball 0 r \ + ((\z. f z - deriv f 0 * z) has_field_derivative deriv f x - deriv f 0) + (at x within ball 0 r)" + by (rule derivative_eq_intros holomorphic_derivI holf' | simp)+ + have 2: "closed_segment 0 z \ ball 0 r" + by (metis \0 < r\ convex_ball convex_contains_segment dist_self mem_ball mem_ball_0 that) + have 3: "(\t. (norm z)\<^sup>2 * t / (r - norm z) * C) integrable_on {0..1}" + apply (rule integrable_on_cmult_right [where 'b=real, simplified]) + apply (rule integrable_on_cdivide [where 'b=real, simplified]) + apply (rule integrable_on_cmult_left [where 'b=real, simplified]) + apply (rule ident_integrable_on) + done + have 4: "norm (deriv f (x *\<^sub>R z) - deriv f 0) * norm z \ norm z * norm z * x * C / (r - norm z)" + if x: "0 \ x" "x \ 1" for x + proof - + have [simp]: "x * norm z < r" + using r x by (meson le_less_trans mult_le_cancel_right2 norm_not_less_zero) + have "norm (deriv f (x *\<^sub>R z) - deriv f 0) \ norm (x *\<^sub>R z) / (r - norm (x *\<^sub>R z)) * C" + apply (rule Le1) using r x \0 < r\ by simp + also have "... \ norm (x *\<^sub>R z) / (r - norm z) * C" + using r x \0 < r\ + apply (simp add: divide_simps) + by (simp add: \0 < C\ mult.assoc mult_left_le_one_le ordered_comm_semiring_class.comm_mult_left_mono) + finally have "norm (deriv f (x *\<^sub>R z) - deriv f 0) * norm z \ norm (x *\<^sub>R z) / (r - norm z) * C * norm z" + by (rule mult_right_mono) simp + with x show ?thesis by (simp add: algebra_simps) + qed + have le_norm: "abc \ norm d - e \ norm(f - d) \ e \ abc \ norm f" for abc d e and f::complex + by (metis add_diff_cancel_left' add_diff_eq diff_left_mono norm_diff_ineq order_trans) + have "norm (integral {0..1} (\x. (deriv f (x *\<^sub>R z) - deriv f 0) * z)) + \ integral {0..1} (\t. (norm z)\<^sup>2 * t / (r - norm z) * C)" + apply (rule integral_norm_bound_integral) + using contour_integral_primitive [OF 1, of "linepath 0 z"] 2 + apply (simp add: has_contour_integral_linepath has_integral_integrable_integral) + apply (rule 3) + apply (simp add: norm_mult power2_eq_square 4) + done + then have int_le: "norm (f z - deriv f 0 * z) \ (norm z)\<^sup>2 * norm(deriv f 0) / ((r - norm z))" + using contour_integral_primitive [OF 1, of "linepath 0 z"] 2 + apply (simp add: has_contour_integral_linepath has_integral_integrable_integral C_def) + done + show ?thesis + apply (rule le_norm [OF _ int_le]) + using \norm z < r\ + apply (simp add: power2_eq_square divide_simps C_def norm_mult) + proof - + have "norm z * (norm (deriv f 0) * (r - norm z - norm z)) \ norm z * (norm (deriv f 0) * (r - norm z) - norm (deriv f 0) * norm z)" + by (simp add: linordered_field_class.sign_simps(38)) + then show "(norm z * (r - norm z) - norm z * norm z) * norm (deriv f 0) \ norm (deriv f 0) * norm z * (r - norm z) - norm z * norm z * norm (deriv f 0)" + by (simp add: linordered_field_class.sign_simps(38) mult.commute mult.left_commute) + qed + qed + have sq201 [simp]: "0 < (1 - sqrt 2 / 2)" "(1 - sqrt 2 / 2) < 1" + by (auto simp: sqrt2_less_2) + have 1: "continuous_on (closure (ball 0 ((1 - sqrt 2 / 2) * r))) f" + apply (rule continuous_on_subset [OF holomorphic_on_imp_continuous_on [OF holf]]) + apply (subst closure_ball) + using \0 < r\ mult_pos_pos sq201 + apply (auto simp: cball_subset_cball_iff) + done + have 2: "open (f ` interior (ball 0 ((1 - sqrt 2 / 2) * r)))" + apply (rule open_mapping_thm [OF holf' open_ball connected_ball], force) + using \0 < r\ mult_pos_pos sq201 apply (simp add: ball_subset_ball_iff) + using False \0 < r\ centre_in_ball holf' holomorphic_nonconstant by blast + have "ball 0 ((3 - 2 * sqrt 2) * r * norm (deriv f 0)) = + ball (f 0) ((3 - 2 * sqrt 2) * r * norm (deriv f 0))" + by simp + also have "... \ f ` ball 0 ((1 - sqrt 2 / 2) * r)" + proof - + have 3: "(3 - 2 * sqrt 2) * r * norm (deriv f 0) \ norm (f z)" + if "norm z = (1 - sqrt 2 / 2) * r" for z + apply (rule order_trans [OF _ *]) + using \0 < r\ + apply (simp_all add: field_simps power2_eq_square that) + apply (simp add: mult.assoc [symmetric]) + done + show ?thesis + apply (rule ball_subset_open_map_image [OF 1 2 _ bounded_ball]) + using \0 < r\ sq201 3 apply simp_all + using C_def \0 < C\ sq3 apply force + done + qed + also have "... \ f ` ball 0 r" + apply (rule image_subsetI [OF imageI], simp) + apply (erule less_le_trans) + using \0 < r\ apply (auto simp: field_simps) + done + finally show ?thesis . + qed +qed + +lemma Bloch_lemma: + assumes holf: "f holomorphic_on cball a r" and "0 < r" + and le: "\z. z \ ball a r \ norm(deriv f z) \ 2 * norm(deriv f a)" + shows "ball (f a) ((3 - 2 * sqrt 2) * r * norm(deriv f a)) \ f ` ball a r" +proof - + have fz: "(\z. f (a + z)) = f o (\z. (a + z))" + by (simp add: o_def) + have hol0: "(\z. f (a + z)) holomorphic_on cball 0 r" + unfolding fz by (intro holomorphic_intros holf holomorphic_on_compose | simp)+ + then have [simp]: "\x. norm x < r \ (\z. f (a + z)) complex_differentiable at x" + by (metis Topology_Euclidean_Space.open_ball at_within_open ball_subset_cball diff_0 dist_norm holomorphic_on_def holomorphic_on_subset mem_ball norm_minus_cancel) + have [simp]: "\z. norm z < r \ f complex_differentiable at (a + z)" + by (metis holf open_ball add_diff_cancel_left' dist_complex_def holomorphic_on_imp_differentiable_at holomorphic_on_subset interior_cball interior_subset mem_ball norm_minus_commute) + then have [simp]: "f complex_differentiable at a" + by (metis add.comm_neutral \0 < r\ norm_eq_zero) + have hol1: "(\z. f (a + z) - f a) holomorphic_on cball 0 r" + by (intro holomorphic_intros hol0) + then have "ball 0 ((3 - 2 * sqrt 2) * r * norm (deriv (\z. f (a + z) - f a) 0)) + \ (\z. f (a + z) - f a) ` ball 0 r" + apply (rule Bloch_lemma_0) + apply (simp_all add: \0 < r\) + apply (simp add: fz complex_derivative_chain) + apply (simp add: dist_norm le) + done + then show ?thesis + apply clarify + apply (drule_tac c="x - f a" in subsetD) + apply (force simp: fz \0 < r\ dist_norm complex_derivative_chain complex_differentiable_compose)+ + done +qed + +proposition Bloch_unit: + assumes holf: "f holomorphic_on ball a 1" and [simp]: "deriv f a = 1" + obtains b r where "1/12 < r" "ball b r \ f ` (ball a 1)" +proof - + def r \ "249/256::real" + have "0 < r" "r < 1" by (auto simp: r_def) + def g \ "\z. deriv f z * of_real(r - norm(z - a))" + have "deriv f holomorphic_on ball a 1" + by (rule holomorphic_deriv [OF holf open_ball]) + then have "continuous_on (ball a 1) (deriv f)" + using holomorphic_on_imp_continuous_on by blast + then have "continuous_on (cball a r) (deriv f)" + by (rule continuous_on_subset) (simp add: cball_subset_ball_iff \r < 1\) + then have "continuous_on (cball a r) g" + by (simp add: g_def continuous_intros) + then have 1: "compact (g ` cball a r)" + by (rule compact_continuous_image [OF _ compact_cball]) + have 2: "g ` cball a r \ {}" + using \r > 0\ by auto + obtain p where pr: "p \ cball a r" + and pge: "\y. y \ cball a r \ norm (g y) \ norm (g p)" + using distance_attains_sup [OF 1 2, of 0] by force + def t \ "(r - norm(p - a)) / 2" + have "norm (p - a) \ r" + using pge [of a] \r > 0\ by (auto simp: g_def norm_mult) + then have "norm (p - a) < r" using pr + by (simp add: norm_minus_commute dist_norm) + then have "0 < t" + by (simp add: t_def) + have cpt: "cball p t \ ball a r" + using \0 < t\ by (simp add: cball_subset_ball_iff dist_norm t_def field_simps) + have gen_le_dfp: "norm (deriv f y) * (r - norm (y - a)) / (r - norm (p - a)) \ norm (deriv f p)" + if "y \ cball a r" for y + proof - + have [simp]: "norm (y - a) \ r" + using that by (simp add: dist_norm norm_minus_commute) + have "norm (g y) \ norm (g p)" + using pge [OF that] by simp + then have "norm (deriv f y) * abs (r - norm (y - a)) \ norm (deriv f p) * abs (r - norm (p - a))" + by (simp only: dist_norm g_def norm_mult norm_of_real) + with that \norm (p - a) < r\ show ?thesis + by (simp add: dist_norm divide_simps) + qed + have le_norm_dfp: "r / (r - norm (p - a)) \ norm (deriv f p)" + using gen_le_dfp [of a] \r > 0\ by auto + have 1: "f holomorphic_on cball p t" + apply (rule holomorphic_on_subset [OF holf]) + using cpt \r < 1\ order_subst1 subset_ball by auto + have 2: "norm (deriv f z) \ 2 * norm (deriv f p)" if "z \ ball p t" for z + proof - + have z: "z \ cball a r" + by (meson ball_subset_cball subsetD cpt that) + then have "norm(z - a) < r" + by (metis ball_subset_cball contra_subsetD cpt dist_norm mem_ball norm_minus_commute that) + have "norm (deriv f z) * (r - norm (z - a)) / (r - norm (p - a)) \ norm (deriv f p)" + using gen_le_dfp [OF z] by simp + with \norm (z - a) < r\ \norm (p - a) < r\ + have "norm (deriv f z) \ (r - norm (p - a)) / (r - norm (z - a)) * norm (deriv f p)" + by (simp add: field_simps) + also have "... \ 2 * norm (deriv f p)" + apply (rule mult_right_mono) + using that \norm (p - a) < r\ \norm(z - a) < r\ + apply (simp_all add: field_simps t_def dist_norm [symmetric]) + using dist_triangle3 [of z a p] by linarith + finally show ?thesis . + qed + have sqrt2: "sqrt 2 < 2113/1494" + by (rule real_less_lsqrt) (auto simp: power2_eq_square) + then have sq3: "0 < 3 - 2 * sqrt 2" by simp + have "1 / 12 / ((3 - 2 * sqrt 2) / 2) < r" + using sq3 sqrt2 by (auto simp: field_simps r_def) + also have "... \ cmod (deriv f p) * (r - cmod (p - a))" + using \norm (p - a) < r\ le_norm_dfp by (simp add: pos_divide_le_eq) + finally have "1 / 12 < cmod (deriv f p) * (r - cmod (p - a)) * ((3 - 2 * sqrt 2) / 2)" + using pos_divide_less_eq half_gt_zero_iff sq3 by blast + then have **: "1 / 12 < (3 - 2 * sqrt 2) * t * norm (deriv f p)" + using sq3 by (simp add: mult.commute t_def) + have "ball (f p) ((3 - 2 * sqrt 2) * t * norm (deriv f p)) \ f ` ball p t" + by (rule Bloch_lemma [OF 1 \0 < t\ 2]) + also have "... \ f ` ball a 1" + apply (rule image_mono) + apply (rule order_trans [OF ball_subset_cball]) + apply (rule order_trans [OF cpt]) + using \0 < t\ \r < 1\ apply (simp add: ball_subset_ball_iff dist_norm) + done + finally have "ball (f p) ((3 - 2 * sqrt 2) * t * norm (deriv f p)) \ f ` ball a 1" . + with ** show ?thesis + by (rule that) +qed + + +theorem Bloch: + assumes holf: "f holomorphic_on ball a r" and "0 < r" + and r': "r' \ r * norm (deriv f a) / 12" + obtains b where "ball b r' \ f ` (ball a r)" +proof (cases "deriv f a = 0") + case True with r' show ?thesis + using ball_eq_empty that by fastforce +next + case False + def C \ "deriv f a" + have "0 < norm C" using False by (simp add: C_def) + have dfa: "f complex_differentiable at a" + apply (rule holomorphic_on_imp_differentiable_at [OF holf]) + using \0 < r\ by auto + have fo: "(\z. f (a + of_real r * z)) = f o (\z. (a + of_real r * z))" + by (simp add: o_def) + have holf': "f holomorphic_on (\z. a + complex_of_real r * z) ` ball 0 1" + apply (rule holomorphic_on_subset [OF holf]) + using \0 < r\ apply (force simp: dist_norm norm_mult) + done + have 1: "(\z. f (a + r * z) / (C * r)) holomorphic_on ball 0 1" + apply (rule holomorphic_intros holomorphic_on_compose holf' | simp add: fo)+ + using \0 < r\ by (simp add: C_def False) + have "((\z. f (a + of_real r * z) / (C * of_real r)) has_field_derivative + (deriv f (a + of_real r * z) / C)) (at z)" + if "norm z < 1" for z + proof - + have *: "((\x. f (a + of_real r * x)) has_field_derivative + (deriv f (a + of_real r * z) * of_real r)) (at z)" + apply (simp add: fo) + apply (rule DERIV_chain [OF complex_differentiable_derivI]) + apply (rule holomorphic_on_imp_differentiable_at [OF holf], simp) + using \0 < r\ apply (simp add: dist_norm norm_mult that) + apply (rule derivative_eq_intros | simp)+ + done + show ?thesis + apply (rule derivative_eq_intros * | simp)+ + using \0 < r\ by (auto simp: C_def False) + qed + have 2: "deriv (\z. f (a + of_real r * z) / (C * of_real r)) 0 = 1" + apply (subst complex_derivative_cdivide_right) + apply (simp add: complex_differentiable_def fo) + apply (rule exI) + apply (rule DERIV_chain [OF complex_differentiable_derivI]) + apply (simp add: dfa) + apply (rule derivative_eq_intros | simp add: C_def False fo)+ + using \0 < r\ + apply (simp add: C_def False fo) + apply (simp add: derivative_intros dfa complex_derivative_chain) + done + have sb1: "op * (C * r) ` (\z. f (a + of_real r * z) / (C * r)) ` ball 0 1 + \ f ` ball a r" + using \0 < r\ by (auto simp: dist_norm norm_mult C_def False) + have sb2: "ball (C * r * b) r' \ op * (C * r) ` ball b t" + if "1 / 12 < t" for b t + proof - + have *: "r * cmod (deriv f a) / 12 \ r * (t * cmod (deriv f a))" + using that \0 < r\ less_eq_real_def mult.commute mult.right_neutral mult_left_mono norm_ge_zero times_divide_eq_right + by auto + show ?thesis + apply clarify + apply (rule_tac x="x / (C * r)" in image_eqI) + using \0 < r\ + apply (simp_all add: dist_norm norm_mult norm_divide C_def False field_simps) + apply (erule less_le_trans) + apply (rule order_trans [OF r' *]) + done + qed + show ?thesis + apply (rule Bloch_unit [OF 1 2]) + apply (rename_tac t) + apply (rule_tac b="(C * of_real r) * b" in that) + apply (drule image_mono [where f = "\z. (C * of_real r) * z"]) + using sb1 sb2 + apply force + done +qed + +corollary Bloch_general: + assumes holf: "f holomorphic_on s" and "a \ s" + and tle: "\z. z \ frontier s \ t \ dist a z" + and rle: "r \ t * norm(deriv f a) / 12" + obtains b where "ball b r \ f ` s" +proof - + consider "r \ 0" | "0 < t * norm(deriv f a) / 12" using rle by force + then show ?thesis + proof cases + case 1 then show ?thesis + by (simp add: Topology_Euclidean_Space.ball_empty that) + next + case 2 + show ?thesis + proof (cases "deriv f a = 0") + case True then show ?thesis + using rle by (simp add: Topology_Euclidean_Space.ball_empty that) + next + case False + then have "t > 0" + using 2 by (force simp: zero_less_mult_iff) + have "~ ball a t \ s \ ball a t \ frontier s \ {}" + apply (rule connected_Int_frontier [of "ball a t" s], simp_all) + using \0 < t\ \a \ s\ centre_in_ball apply blast + done + with tle have *: "ball a t \ s" by fastforce + then have 1: "f holomorphic_on ball a t" + using holf using holomorphic_on_subset by blast + show ?thesis + apply (rule Bloch [OF 1 \t > 0\ rle]) + apply (rule_tac b=b in that) + using * apply force + done + qed + qed +qed + end diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Convex_Euclidean_Space.thy Mon Mar 07 14:34:45 2016 +0000 @@ -5277,7 +5277,7 @@ proof - assume "v < 1" then show False - using v(3)[THEN spec[where x=1]] using x and fs by auto + using v(3)[THEN spec[where x=1]] using x fs by (simp add: pth_1 subset_iff) next assume "v > 1" then show False @@ -5294,8 +5294,7 @@ apply (cases "u = 1") using assms(3)[THEN bspec[where x=x], THEN spec[where x=u]] using \0\u\ and x and fs - apply auto - done + by auto qed auto qed @@ -9866,7 +9865,7 @@ apply (rule le_setdistI, blast) using False apply (fastforce intro: le_setdistI) apply (simp add: algebra_simps) - apply (metis dist_commute dist_triangle_alt order_trans [OF setdist_le_dist]) + apply (metis dist_commute dist_triangle3 order_trans [OF setdist_le_dist]) done then have "setdist s t - setdist {a} t \ setdist s {a}" using False by (fastforce intro: le_setdistI) diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Derivative.thy --- a/src/HOL/Multivariate_Analysis/Derivative.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Derivative.thy Mon Mar 07 14:34:45 2016 +0000 @@ -194,6 +194,9 @@ unfolding differentiable_def by auto +lemma differentiable_onD: "\f differentiable_on S; x \ S\ \ f differentiable (at x within S)" + using differentiable_on_def by blast + lemma differentiable_at_withinI: "f differentiable (at x) \ f differentiable (at x within s)" unfolding differentiable_def using has_derivative_at_within diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Gamma.thy --- a/src/HOL/Multivariate_Analysis/Gamma.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Gamma.thy Mon Mar 07 14:34:45 2016 +0000 @@ -1384,6 +1384,8 @@ lemma complex_differentiable_Polygamma: + fixes z::complex + shows "z \ \\<^sub>\\<^sub>0 \ Polygamma n complex_differentiable (at z within A)" using has_field_derivative_Polygamma[of z n] unfolding complex_differentiable_def by auto diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Integration.thy --- a/src/HOL/Multivariate_Analysis/Integration.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Integration.thy Mon Mar 07 14:34:45 2016 +0000 @@ -2501,6 +2501,12 @@ shows "integral s (\x. c * f x) = c * integral s f" by (simp add: mult.commute [of c]) +corollary integral_divide [simp]: + fixes z :: "'a::real_normed_field" + shows "integral S (\x. f x / z) = integral S (\x. f x) / z" +using integral_mult_left [of S f "inverse z"] + by (simp add: divide_inverse_commute) + lemma has_integral_mult_right: fixes c :: "'a :: real_normed_algebra" shows "(f has_integral y) i \ ((\x. c * f x) has_integral (c * y)) i" @@ -2681,6 +2687,12 @@ using integrable_cmul[of "\x. c * f x" s "1 / c"] integrable_cmul[of f s c] \c \ 0\ by auto +lemma integrable_on_cmult_left: + assumes "f integrable_on s" + shows "(\x. of_real c * f x) integrable_on s" + using integrable_cmul[of f s "of_real c"] assms + by (simp add: scaleR_conv_of_real) + lemma integrable_neg: "f integrable_on s \ (\x. -f(x)) integrable_on s" unfolding integrable_on_def by(auto intro: has_integral_neg) @@ -2756,6 +2768,45 @@ unfolding integral_def by (metis (full_types, hide_lams) assms has_integral_cong integrable_eq) +lemma integrable_on_cmult_left_iff [simp]: + assumes "c \ 0" + shows "(\x. of_real c * f x) integrable_on s \ f integrable_on s" + (is "?lhs = ?rhs") +proof + assume ?lhs + then have "(\x. of_real (1 / c) * (of_real c * f x)) integrable_on s" + using integrable_cmul[of "\x. of_real c * f x" s "1 / of_real c"] + by (simp add: scaleR_conv_of_real) + then have "(\x. (of_real (1 / c) * of_real c * f x)) integrable_on s" + by (simp add: algebra_simps) + with \c \ 0\ show ?rhs + by (metis (no_types, lifting) integrable_eq mult.left_neutral nonzero_divide_eq_eq of_real_1 of_real_mult) +qed (blast intro: integrable_on_cmult_left) + +lemma integrable_on_cmult_right: + fixes f :: "_ \ 'b :: {comm_ring,real_algebra_1,real_normed_vector}" + assumes "f integrable_on s" + shows "(\x. f x * of_real c) integrable_on s" +using integrable_on_cmult_left [OF assms] by (simp add: mult.commute) + +lemma integrable_on_cmult_right_iff [simp]: + fixes f :: "_ \ 'b :: {comm_ring,real_algebra_1,real_normed_vector}" + assumes "c \ 0" + shows "(\x. f x * of_real c) integrable_on s \ f integrable_on s" +using integrable_on_cmult_left_iff [OF assms] by (simp add: mult.commute) + +lemma integrable_on_cdivide: + fixes f :: "_ \ 'b :: real_normed_field" + assumes "f integrable_on s" + shows "(\x. f x / of_real c) integrable_on s" +by (simp add: integrable_on_cmult_right divide_inverse assms of_real_inverse [symmetric] del: of_real_inverse) + +lemma integrable_on_cdivide_iff [simp]: + fixes f :: "_ \ 'b :: real_normed_field" + assumes "c \ 0" + shows "(\x. f x / of_real c) integrable_on s \ f integrable_on s" +by (simp add: divide_inverse assms of_real_inverse [symmetric] del: of_real_inverse) + lemma has_integral_null [intro]: assumes "content(cbox a b) = 0" shows "(f has_integral 0) (cbox a b)" @@ -6065,6 +6116,30 @@ qed qed +lemma ident_has_integral: + fixes a::real + assumes "a \ b" + shows "((\x. x) has_integral (b\<^sup>2 - a\<^sup>2) / 2) {a..b}" +proof - + have "((\x. x) has_integral inverse 2 * b\<^sup>2 - inverse 2 * a\<^sup>2) {a..b}" + apply (rule fundamental_theorem_of_calculus [OF assms], clarify) + unfolding power2_eq_square + by (rule derivative_eq_intros | simp)+ + then show ?thesis + by (simp add: field_simps) +qed + +lemma integral_ident [simp]: + fixes a::real + assumes "a \ b" + shows "integral {a..b} (\x. x) = (if a \ b then (b\<^sup>2 - a\<^sup>2) / 2 else 0)" +using ident_has_integral integral_unique by fastforce + +lemma ident_integrable_on: + fixes a::real + shows "(\x. x) integrable_on {a..b}" +by (metis atLeastatMost_empty_iff integrable_on_def has_integral_empty ident_has_integral) + subsection \Taylor series expansion\ @@ -6737,27 +6812,18 @@ lemma content_image_affinity_cbox: "content((\x::'a::euclidean_space. m *\<^sub>R x + c) ` cbox a b) = \m\ ^ DIM('a) * content (cbox a b)" (is "?l = ?r") -proof - - { - presume *: "cbox a b \ {} \ ?thesis" - show ?thesis - apply cases - apply (rule *) - apply assumption - unfolding not_not - using content_empty - apply auto - done - } - assume as: "cbox a b \ {}" +proof (cases "cbox a b = {}") + case True then show ?thesis by simp +next + case False show ?thesis proof (cases "m \ 0") case True - with as have "cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) \ {}" + with \cbox a b \ {}\ have "cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) \ {}" unfolding box_ne_empty apply (intro ballI) apply (erule_tac x=i in ballE) - apply (auto simp: inner_simps intro!: mult_left_mono) + apply (auto simp: inner_simps mult_left_mono) done moreover from True have *: "\i. (m *\<^sub>R b + c) \ i - (m *\<^sub>R a + c) \ i = m *\<^sub>R (b - a) \ i" by (simp add: inner_simps field_simps) @@ -6766,11 +6832,11 @@ setprod.distrib setprod_constant inner_diff_left) next case False - with as have "cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c) \ {}" + with \cbox a b \ {}\ have "cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c) \ {}" unfolding box_ne_empty apply (intro ballI) apply (erule_tac x=i in ballE) - apply (auto simp: inner_simps intro!: mult_left_mono) + apply (auto simp: inner_simps mult_left_mono) done moreover from False have *: "\i. (m *\<^sub>R a + c) \ i - (m *\<^sub>R b + c) \ i = (-m) *\<^sub>R (b - a) \ i" by (simp add: inner_simps field_simps) diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Path_Connected.thy --- a/src/HOL/Multivariate_Analysis/Path_Connected.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Path_Connected.thy Mon Mar 07 14:34:45 2016 +0000 @@ -556,6 +556,190 @@ by (rule ext) (auto simp: mult.commute) +subsection\Some reversed and "if and only if" versions of joining theorems\ + +lemma path_join_path_ends: + fixes g1 :: "real \ 'a::metric_space" + assumes "path(g1 +++ g2)" "path g2" + shows "pathfinish g1 = pathstart g2" +proof (rule ccontr) + def e \ "dist (g1 1) (g2 0)" + assume Neg: "pathfinish g1 \ pathstart g2" + then have "0 < dist (pathfinish g1) (pathstart g2)" + by auto + then have "e > 0" + by (metis e_def pathfinish_def pathstart_def) + then obtain d1 where "d1 > 0" + and d1: "\x'. \x'\{0..1}; norm x' < d1\ \ dist (g2 x') (g2 0) < e/2" + using assms(2) unfolding path_def continuous_on_iff + apply (drule_tac x=0 in bspec, simp) + by (metis half_gt_zero_iff norm_conv_dist) + obtain d2 where "d2 > 0" + and d2: "\x'. \x'\{0..1}; dist x' (1/2) < d2\ + \ dist ((g1 +++ g2) x') (g1 1) < e/2" + using assms(1) \e > 0\ unfolding path_def continuous_on_iff + apply (drule_tac x="1/2" in bspec, simp) + apply (drule_tac x="e/2" in spec) + apply (force simp: joinpaths_def) + done + have int01_1: "min (1/2) (min d1 d2) / 2 \ {0..1}" + using \d1 > 0\ \d2 > 0\ by (simp add: min_def) + have dist1: "norm (min (1 / 2) (min d1 d2) / 2) < d1" + using \d1 > 0\ \d2 > 0\ by (simp add: min_def dist_norm) + have int01_2: "1/2 + min (1/2) (min d1 d2) / 4 \ {0..1}" + using \d1 > 0\ \d2 > 0\ by (simp add: min_def) + have dist2: "dist (1 / 2 + min (1 / 2) (min d1 d2) / 4) (1 / 2) < d2" + using \d1 > 0\ \d2 > 0\ by (simp add: min_def dist_norm) + have [simp]: "~ min (1 / 2) (min d1 d2) \ 0" + using \d1 > 0\ \d2 > 0\ by (simp add: min_def) + have "dist (g2 (min (1 / 2) (min d1 d2) / 2)) (g1 1) < e/2" + "dist (g2 (min (1 / 2) (min d1 d2) / 2)) (g2 0) < e/2" + using d1 [OF int01_1 dist1] d2 [OF int01_2 dist2] by (simp_all add: joinpaths_def) + then have "dist (g1 1) (g2 0) < e/2 + e/2" + using dist_triangle_half_r e_def by blast + then show False + by (simp add: e_def [symmetric]) +qed + +lemma path_join_eq [simp]: + fixes g1 :: "real \ 'a::metric_space" + assumes "path g1" "path g2" + shows "path(g1 +++ g2) \ pathfinish g1 = pathstart g2" + using assms by (metis path_join_path_ends path_join_imp) + +lemma simple_path_joinE: + assumes "simple_path(g1 +++ g2)" and "pathfinish g1 = pathstart g2" + obtains "arc g1" "arc g2" + "path_image g1 \ path_image g2 \ {pathstart g1, pathstart g2}" +proof - + have *: "\x y. \0 \ x; x \ 1; 0 \ y; y \ 1; (g1 +++ g2) x = (g1 +++ g2) y\ + \ x = y \ x = 0 \ y = 1 \ x = 1 \ y = 0" + using assms by (simp add: simple_path_def) + have "path g1" + using assms path_join simple_path_imp_path by blast + moreover have "inj_on g1 {0..1}" + proof (clarsimp simp: inj_on_def) + fix x y + assume "g1 x = g1 y" "0 \ x" "x \ 1" "0 \ y" "y \ 1" + then show "x = y" + using * [of "x/2" "y/2"] by (simp add: joinpaths_def split_ifs) + qed + ultimately have "arc g1" + using assms by (simp add: arc_def) + have [simp]: "g2 0 = g1 1" + using assms by (metis pathfinish_def pathstart_def) + have "path g2" + using assms path_join simple_path_imp_path by blast + moreover have "inj_on g2 {0..1}" + proof (clarsimp simp: inj_on_def) + fix x y + assume "g2 x = g2 y" "0 \ x" "x \ 1" "0 \ y" "y \ 1" + then show "x = y" + using * [of "(x + 1) / 2" "(y + 1) / 2"] + by (force simp: joinpaths_def split_ifs divide_simps) + qed + ultimately have "arc g2" + using assms by (simp add: arc_def) + have "g2 y = g1 0 \ g2 y = g1 1" + if "g1 x = g2 y" "0 \ x" "x \ 1" "0 \ y" "y \ 1" for x y + using * [of "x / 2" "(y + 1) / 2"] that + by (auto simp: joinpaths_def split_ifs divide_simps) + then have "path_image g1 \ path_image g2 \ {pathstart g1, pathstart g2}" + by (fastforce simp: pathstart_def pathfinish_def path_image_def) + with \arc g1\ \arc g2\ show ?thesis using that by blast +qed + +lemma simple_path_join_loop_eq: + assumes "pathfinish g2 = pathstart g1" "pathfinish g1 = pathstart g2" + shows "simple_path(g1 +++ g2) \ + arc g1 \ arc g2 \ path_image g1 \ path_image g2 \ {pathstart g1, pathstart g2}" +by (metis assms simple_path_joinE simple_path_join_loop) + +lemma arc_join_eq: + assumes "pathfinish g1 = pathstart g2" + shows "arc(g1 +++ g2) \ + arc g1 \ arc g2 \ path_image g1 \ path_image g2 \ {pathstart g2}" + (is "?lhs = ?rhs") +proof + assume ?lhs + then have "simple_path(g1 +++ g2)" by (rule arc_imp_simple_path) + then have *: "\x y. \0 \ x; x \ 1; 0 \ y; y \ 1; (g1 +++ g2) x = (g1 +++ g2) y\ + \ x = y \ x = 0 \ y = 1 \ x = 1 \ y = 0" + using assms by (simp add: simple_path_def) + have False if "g1 0 = g2 u" "0 \ u" "u \ 1" for u + using * [of 0 "(u + 1) / 2"] that assms arc_distinct_ends [OF \?lhs\] + by (auto simp: joinpaths_def pathstart_def pathfinish_def split_ifs divide_simps) + then have n1: "~ (pathstart g1 \ path_image g2)" + unfolding pathstart_def path_image_def + using atLeastAtMost_iff by blast + show ?rhs using \?lhs\ + apply (rule simple_path_joinE [OF arc_imp_simple_path assms]) + using n1 by force +next + assume ?rhs then show ?lhs + using assms + by (fastforce simp: pathfinish_def pathstart_def intro!: arc_join) +qed + +lemma arc_join_eq_alt: + "pathfinish g1 = pathstart g2 + \ (arc(g1 +++ g2) \ + arc g1 \ arc g2 \ + path_image g1 \ path_image g2 = {pathstart g2})" +using pathfinish_in_path_image by (fastforce simp: arc_join_eq) + + +subsection\The joining of paths is associative\ + +lemma path_assoc: + "\pathfinish p = pathstart q; pathfinish q = pathstart r\ + \ path(p +++ (q +++ r)) \ path((p +++ q) +++ r)" +by simp + +lemma simple_path_assoc: + assumes "pathfinish p = pathstart q" "pathfinish q = pathstart r" + shows "simple_path (p +++ (q +++ r)) \ simple_path ((p +++ q) +++ r)" +proof (cases "pathstart p = pathfinish r") + case True show ?thesis + proof + assume "simple_path (p +++ q +++ r)" + with assms True show "simple_path ((p +++ q) +++ r)" + by (fastforce simp add: simple_path_join_loop_eq arc_join_eq path_image_join + dest: arc_distinct_ends [of r]) + next + assume 0: "simple_path ((p +++ q) +++ r)" + with assms True have q: "pathfinish r \ path_image q" + using arc_distinct_ends + by (fastforce simp add: simple_path_join_loop_eq arc_join_eq path_image_join) + have "pathstart r \ path_image p" + using assms + by (metis 0 IntI arc_distinct_ends arc_join_eq_alt empty_iff insert_iff + pathfinish_in_path_image pathfinish_join simple_path_joinE) + with assms 0 q True show "simple_path (p +++ q +++ r)" + by (auto simp: simple_path_join_loop_eq arc_join_eq path_image_join + dest!: subsetD [OF _ IntI]) + qed +next + case False + { fix x :: 'a + assume a: "path_image p \ path_image q \ {pathstart q}" + "(path_image p \ path_image q) \ path_image r \ {pathstart r}" + "x \ path_image p" "x \ path_image r" + have "pathstart r \ path_image q" + by (metis assms(2) pathfinish_in_path_image) + with a have "x = pathstart q" + by blast + } + with False assms show ?thesis + by (auto simp: simple_path_eq_arc simple_path_join_loop_eq arc_join_eq path_image_join) +qed + +lemma arc_assoc: + "\pathfinish p = pathstart q; pathfinish q = pathstart r\ + \ arc(p +++ (q +++ r)) \ arc((p +++ q) +++ r)" +by (simp add: arc_simple_path simple_path_assoc) + + section\Choosing a subpath of an existing path\ definition subpath :: "real \ real \ (real \ 'a) \ real \ 'a::real_normed_vector" @@ -2526,6 +2710,58 @@ apply (metis cobounded_unique_unbounded_components connected_outside double_compl outside_bounded_nonempty outside_in_components unbounded_outside) by (simp add: connected_outside outside_bounded_nonempty outside_in_components unbounded_outside) +subsection\Condition for an open map's image to contain a ball\ + +lemma ball_subset_open_map_image: + fixes f :: "'a::heine_borel \ 'b :: {real_normed_vector,heine_borel}" + assumes contf: "continuous_on (closure S) f" + and oint: "open (f ` interior S)" + and le_no: "\z. z \ frontier S \ r \ norm(f z - f a)" + and "bounded S" "a \ S" "0 < r" + shows "ball (f a) r \ f ` S" +proof (cases "f ` S = UNIV") + case True then show ?thesis by simp +next + case False + obtain w where w: "w \ frontier (f ` S)" + and dw_le: "\y. y \ frontier (f ` S) \ norm (f a - w) \ norm (f a - y)" + apply (rule distance_attains_inf [of "frontier(f ` S)" "f a"]) + using \a \ S\ by (auto simp: frontier_eq_empty dist_norm False) + then obtain \ where \: "\n. \ n \ f ` S" and tendsw: "\ \ w" + by (metis Diff_iff frontier_def closure_sequential) + then have "\n. \x \ S. \ n = f x" by force + then obtain z where zs: "\n. z n \ S" and fz: "\n. \ n = f (z n)" + by metis + then obtain y K where y: "y \ closure S" and "subseq K" and Klim: "(z \ K) \ y" + using \bounded S\ + apply (simp add: compact_closure [symmetric] compact_def) + apply (drule_tac x=z in spec) + using closure_subset apply force + done + then have ftendsw: "((\n. f (z n)) \ K) \ w" + by (metis LIMSEQ_subseq_LIMSEQ fun.map_cong0 fz tendsw) + have zKs: "\n. (z o K) n \ S" by (simp add: zs) + have "f \ z = \" "(\n. f (z n)) = \" + using fz by auto + moreover then have "(\ \ K) \ f y" + by (metis (no_types) Klim zKs y contf comp_assoc continuous_on_closure_sequentially) + ultimately have wy: "w = f y" using fz LIMSEQ_unique ftendsw by auto + have rle: "r \ norm (f y - f a)" + apply (rule le_no) + using w wy oint + by (force simp: imageI image_mono interiorI interior_subset frontier_def y) + have **: "(~(b \ (- S) = {}) \ ~(b - (- S) = {}) \ (b \ f \ {})) + \ (b \ S \ {}) \ b \ f = {} \ + b \ S" for b f and S :: "'b set" + by blast + show ?thesis + apply (rule **) (*such a horrible mess*) + apply (rule connected_Int_frontier [where t = "f`S", OF connected_ball]) + using \a \ S\ \0 < r\ + apply (auto simp: disjoint_iff_not_equal dist_norm) + by (metis dw_le norm_minus_commute not_less order_trans rle wy) +qed + section\ Homotopy of maps p,q : X=>Y with property P of all intermediate maps.\ text\ We often just want to require that it fixes some subset, but to take in diff -r edee1966fddf -r bc25f3916a99 src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy --- a/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Multivariate_Analysis/Topology_Euclidean_Space.thy Mon Mar 07 14:34:45 2016 +0000 @@ -859,6 +859,24 @@ lemma cball_diff_eq_sphere: "cball a r - ball a r = {x. dist x a = r}" by (auto simp: cball_def ball_def dist_commute) +lemma image_add_ball [simp]: + fixes a :: "'a::real_normed_vector" + shows "op + b ` ball a r = ball (a+b) r" +apply (intro equalityI subsetI) +apply (force simp: dist_norm) +apply (rule_tac x="x-b" in image_eqI) +apply (auto simp: dist_norm algebra_simps) +done + +lemma image_add_cball [simp]: + fixes a :: "'a::real_normed_vector" + shows "op + b ` cball a r = cball (a+b) r" +apply (intro equalityI subsetI) +apply (force simp: dist_norm) +apply (rule_tac x="x-b" in image_eqI) +apply (auto simp: dist_norm algebra_simps) +done + lemma open_ball [intro, simp]: "open (ball x e)" proof - have "open (dist x -` {.. (closure(- S))" @@ -2202,11 +2220,11 @@ shows "a \ frontier S \ (\e>0. (\x\S. dist a x < e) \ (\x. x \ S \ dist a x < e))" unfolding frontier_def closure_interior by (auto simp add: mem_interior subset_eq ball_def) - + lemma frontier_subset_closed: "closed S \ frontier S \ S" by (metis frontier_def closure_closed Diff_subset) -lemma frontier_empty[simp]: "frontier {} = {}" +lemma frontier_empty [simp]: "frontier {} = {}" by (simp add: frontier_def) lemma frontier_subset_eq: "frontier S \ S \ closed S" @@ -2221,7 +2239,7 @@ then show ?thesis using frontier_subset_closed[of S] .. qed -lemma frontier_complement [simp]: "frontier (- S) = frontier S" +lemma frontier_complement [simp]: "frontier (- S) = frontier S" by (auto simp add: frontier_def closure_complement interior_complement) lemma frontier_disjoint_eq: "frontier S \ S = {} \ open S" @@ -4465,6 +4483,11 @@ by auto qed +lemma compact_closure [simp]: + fixes S :: "'a::heine_borel set" + shows "compact(closure S) \ bounded S" +by (meson bounded_closure bounded_subset closed_closure closure_subset compact_eq_bounded_closed) + lemma compact_components: fixes s :: "'a::heine_borel set" shows "\compact s; c \ components s\ \ compact c" @@ -5541,10 +5564,6 @@ subsubsection \Structural rules for pointwise continuity\ -lemmas continuous_within_id = continuous_ident - -lemmas continuous_at_id = continuous_ident - lemma continuous_infdist[continuous_intros]: assumes "continuous F f" shows "continuous F (\x. infdist (f x) A)" @@ -5890,6 +5909,111 @@ qed qed +subsection\ Theorems relating continuity and uniform continuity to closures\ + +lemma continuous_on_closure: + "continuous_on (closure S) f \ + (\x e. x \ closure S \ 0 < e + \ (\d. 0 < d \ (\y. y \ S \ dist y x < d \ dist (f y) (f x) < e)))" + (is "?lhs = ?rhs") +proof + assume ?lhs then show ?rhs + unfolding continuous_on_iff by (metis Un_iff closure_def) +next + assume R [rule_format]: ?rhs + show ?lhs + proof + fix x and e::real + assume "0 < e" and x: "x \ closure S" + obtain \::real where "\ > 0" + and \: "\y. \y \ S; dist y x < \\ \ dist (f y) (f x) < e/2" + using R [of x "e/2"] \0 < e\ x by auto + have "dist (f y) (f x) \ e" if y: "y \ closure S" and dyx: "dist y x < \/2" for y + proof - + obtain \'::real where "\' > 0" + and \': "\z. \z \ S; dist z y < \'\ \ dist (f z) (f y) < e/2" + using R [of y "e/2"] \0 < e\ y by auto + obtain z where "z \ S" and z: "dist z y < min \' \ / 2" + using closure_approachable y + by (metis \0 < \'\ \0 < \\ divide_pos_pos min_less_iff_conj zero_less_numeral) + have "dist (f z) (f y) < e/2" + apply (rule \' [OF \z \ S\]) + using z \0 < \'\ by linarith + moreover have "dist (f z) (f x) < e/2" + apply (rule \ [OF \z \ S\]) + using z \0 < \\ dist_commute[of y z] dist_triangle_half_r [of y] dyx by auto + ultimately show ?thesis + by (metis dist_commute dist_triangle_half_l less_imp_le) + qed + then show "\d>0. \x'\closure S. dist x' x < d \ dist (f x') (f x) \ e" + by (rule_tac x="\/2" in exI) (simp add: \\ > 0\) + qed +qed + +lemma continuous_on_closure_sequentially: + fixes f :: "'a::metric_space \ 'b :: metric_space" + shows + "continuous_on (closure S) f \ + (\x a. a \ closure S \ (\n. x n \ S) \ x \ a \ (f \ x) \ f a)" + (is "?lhs = ?rhs") +proof - + have "continuous_on (closure S) f \ + (\x \ closure S. continuous (at x within S) f)" + by (force simp: continuous_on_closure Topology_Euclidean_Space.continuous_within_eps_delta) + also have "... = ?rhs" + by (force simp: continuous_within_sequentially) + finally show ?thesis . +qed + +lemma uniformly_continuous_on_closure: + fixes f :: "'a::metric_space \ 'b::metric_space" + assumes ucont: "uniformly_continuous_on S f" + and cont: "continuous_on (closure S) f" + shows "uniformly_continuous_on (closure S) f" +unfolding uniformly_continuous_on_def +proof (intro allI impI) + fix e::real + assume "0 < e" + then obtain d::real + where "d>0" + and d: "\x x'. \x\S; x'\S; dist x' x < d\ \ dist (f x') (f x) < e/3" + using ucont [unfolded uniformly_continuous_on_def, rule_format, of "e/3"] by auto + show "\d>0. \x\closure S. \x'\closure S. dist x' x < d \ dist (f x') (f x) < e" + proof (rule exI [where x="d/3"], clarsimp simp: \d > 0\) + fix x y + assume x: "x \ closure S" and y: "y \ closure S" and dyx: "dist y x * 3 < d" + obtain d1::real where "d1 > 0" + and d1: "\w. \w \ closure S; dist w x < d1\ \ dist (f w) (f x) < e/3" + using cont [unfolded continuous_on_iff, rule_format, of "x" "e/3"] \0 < e\ x by auto + obtain x' where "x' \ S" and x': "dist x' x < min d1 (d / 3)" + using closure_approachable [of x S] + by (metis \0 < d1\ \0 < d\ divide_pos_pos min_less_iff_conj x zero_less_numeral) + obtain d2::real where "d2 > 0" + and d2: "\w \ closure S. dist w y < d2 \ dist (f w) (f y) < e/3" + using cont [unfolded continuous_on_iff, rule_format, of "y" "e/3"] \0 < e\ y by auto + obtain y' where "y' \ S" and y': "dist y' y < min d2 (d / 3)" + using closure_approachable [of y S] + by (metis \0 < d2\ \0 < d\ divide_pos_pos min_less_iff_conj y zero_less_numeral) + have "dist x' x < d/3" using x' by auto + moreover have "dist x y < d/3" + by (metis dist_commute dyx less_divide_eq_numeral1(1)) + moreover have "dist y y' < d/3" + by (metis (no_types) dist_commute min_less_iff_conj y') + ultimately have "dist x' y' < d/3 + d/3 + d/3" + by (meson dist_commute_lessI dist_triangle_lt add_strict_mono) + then have "dist x' y' < d" by simp + then have "dist (f x') (f y') < e/3" + by (rule d [OF \y' \ S\ \x' \ S\]) + moreover have "dist (f x') (f x) < e/3" using \x' \ S\ closure_subset x' d1 + by (simp add: closure_def) + moreover have "dist (f y') (f y) < e/3" using \y' \ S\ closure_subset y' d2 + by (simp add: closure_def) + ultimately have "dist (f y) (f x) < e/3 + e/3 + e/3" + by (meson dist_commute_lessI dist_triangle_lt add_strict_mono) + then show "dist (f y) (f x) < e" by simp + qed +qed + subsection \A function constant on a set\ definition constant_on (infixl "(constant'_on)" 50) @@ -6047,7 +6171,7 @@ { fix x have "continuous (at x) (\x. x - a)" - by (intro continuous_diff continuous_at_id continuous_const) + by (intro continuous_diff continuous_ident continuous_const) } moreover have "{x. x - a \ s} = op + a ` s" by force @@ -6385,7 +6509,7 @@ have "?B \ {}" using \b \ s\ by (auto simp: dist_commute) moreover have "continuous_on ?B (dist a)" - by (auto intro!: continuous_at_imp_continuous_on continuous_dist continuous_at_id continuous_const) + by (auto intro!: continuous_at_imp_continuous_on continuous_dist continuous_ident continuous_const) moreover have "compact ?B" by (intro closed_inter_compact \closed s\ compact_cball) ultimately obtain x where "x \ ?B" "\y\?B. dist a x \ dist a y" @@ -6828,7 +6952,7 @@ then have "s \ {}" "t \ {}" by auto let ?inf = "\x. infdist x t" have "continuous_on s ?inf" - by (auto intro!: continuous_at_imp_continuous_on continuous_infdist continuous_at_id) + by (auto intro!: continuous_at_imp_continuous_on continuous_infdist continuous_ident) then obtain x where x: "x \ s" "\y\s. ?inf x \ ?inf y" using continuous_attains_inf[OF \compact s\ \s \ {}\] by auto then have "0 < ?inf x" @@ -7134,7 +7258,7 @@ lemma open_box[intro]: "open (box a b)" proof - have "open (\i\Basis. (op \ i) -` {a \ i <..< b \ i})" - by (auto intro!: continuous_open_vimage continuous_inner continuous_at_id continuous_const) + by (auto intro!: continuous_open_vimage continuous_inner continuous_ident continuous_const) also have "(\i\Basis. (op \ i) -` {a \ i <..< b \ i}) = box a b" by (auto simp add: box_def inner_commute) finally show ?thesis . @@ -8344,7 +8468,7 @@ let ?D = "(\x. (x, x)) ` s" have D: "compact ?D" "?D \ {}" by (rule compact_continuous_image) - (auto intro!: s continuous_Pair continuous_within_id simp: continuous_on_eq_continuous_within) + (auto intro!: s continuous_Pair continuous_ident simp: continuous_on_eq_continuous_within) have "\x y e. x \ s \ y \ s \ 0 < e \ dist y x < e \ dist (g y) (g x) < e" using dist by fastforce @@ -8353,7 +8477,7 @@ then have cont: "continuous_on ?D (\x. dist ((g \ fst) x) (snd x))" unfolding continuous_on_eq_continuous_within by (intro continuous_dist ballI continuous_within_compose) - (auto intro!: continuous_fst continuous_snd continuous_within_id simp: image_image) + (auto intro!: continuous_fst continuous_snd continuous_ident simp: image_image) obtain a where "a \ s" and le: "\x. x \ s \ dist (g a) a \ dist (g x) x" using continuous_attains_inf[OF D cont] by auto @@ -8408,7 +8532,7 @@ next assume ?rhs then show ?lhs apply (auto simp: ball_def dist_norm) - apply (metis add.commute add_le_cancel_right dist_norm dist_triangle_alt order_trans) + apply (metis add.commute add_le_cancel_right dist_norm dist_triangle3 order_trans) done qed @@ -8448,7 +8572,7 @@ next assume ?rhs then show ?lhs apply (auto simp: ball_def dist_norm ) - apply (metis add.commute add_le_cancel_right dist_norm dist_triangle_alt le_less_trans) + apply (metis add.commute add_le_cancel_right dist_norm dist_triangle3 le_less_trans) done qed diff -r edee1966fddf -r bc25f3916a99 src/HOL/Probability/Regularity.thy --- a/src/HOL/Probability/Regularity.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Probability/Regularity.thy Mon Mar 07 14:34:45 2016 +0000 @@ -249,7 +249,7 @@ fix d have "?G d = (\x. infdist x A) -` {.." - by (intro continuous_open_vimage) (auto intro!: continuous_infdist continuous_at_id) + by (intro continuous_open_vimage) (auto intro!: continuous_infdist continuous_ident) finally have "open (?G d)" . } note open_G = this from in_closed_iff_infdist_zero[OF \closed A\ \A \ {}\] diff -r edee1966fddf -r bc25f3916a99 src/HOL/Real_Vector_Spaces.thy --- a/src/HOL/Real_Vector_Spaces.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Real_Vector_Spaces.thy Mon Mar 07 14:34:45 2016 +0000 @@ -1050,15 +1050,14 @@ using dist_triangle2 [of y x y] by simp qed +lemma dist_commute_lessI: "dist y x < e \ dist x y < e" + by (simp add: dist_commute) + lemma dist_triangle: "dist x z \ dist x y + dist y z" -using dist_triangle2 [of x z y] by (simp add: dist_commute) + using dist_triangle2 [of x z y] by (simp add: dist_commute) lemma dist_triangle3: "dist x y \ dist a x + dist a y" -using dist_triangle2 [of x y a] by (simp add: dist_commute) - -lemma dist_triangle_alt: - shows "dist y z <= dist x y + dist x z" -by (rule dist_triangle3) + using dist_triangle2 [of x y a] by (simp add: dist_commute) lemma dist_pos_lt: shows "x \ y ==> 0 < dist x y" @@ -1337,6 +1336,11 @@ assumes "linear D" obtains d where "D = (\x. x *\<^sub>R d)" by (metis assms linear.scaleR mult.commute mult.left_neutral real_scaleR_def) +corollary real_linearD: + fixes f :: "real \ real" + assumes "linear f" obtains c where "f = op* c" +by (rule linear_imp_scaleR [OF assms]) (force simp: scaleR_conv_of_real) + lemma linearI: assumes "\x y. f (x + y) = f x + f y" assumes "\c x. f (c *\<^sub>R x) = c *\<^sub>R f x" diff -r edee1966fddf -r bc25f3916a99 src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Mon Mar 07 08:14:18 2016 +0100 +++ b/src/HOL/Topological_Spaces.thy Mon Mar 07 14:34:45 2016 +0000 @@ -399,7 +399,7 @@ definition (in topological_space) nhds :: "'a \ 'a filter" where "nhds a = (INF S:{S. open S \ a \ S}. principal S)" -definition (in topological_space) at_within :: "'a \ 'a set \ 'a filter" ("at (_) within (_)" [1000, 60] 60) +definition (in topological_space) at_within :: "'a \ 'a set \ 'a filter" ("at (_)/ within (_)" [1000, 60] 60) where "at a within s = inf (nhds a) (principal (s - {a}))" abbreviation (in topological_space) at :: "'a \ 'a filter" ("at") where