# HG changeset patch # User paulson # Date 1457366222 0 # Node ID 6855b348e828081db1614200ea3f9c418cc904f6 # Parent bc25f3916a99c0369ace28fb12e4987487d83884 complex_differentiable -> field_differentiable, etc. (making these theorems also available for type real) diff -r bc25f3916a99 -r 6855b348e828 src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy --- a/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Mon Mar 07 14:34:45 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Cauchy_Integral_Thm.thy Mon Mar 07 15:57:02 2016 +0000 @@ -208,7 +208,7 @@ the Riemann or Lebesgue theory (but in common with a simple notion based on antiderivatives), this can integrate all derivatives.'' -"Formalizing basic complex analysis." From Insight to Proof: Festschrift in Honour of Andrzej Trybulec. +"Formalizing basic complex analysis." From Insight to Proof: Festschrift in Honour of Andrzej Trybulec. Studies in Logic, Grammar and Rhetoric 10.23 (2007): 151-165. And indeed he does not assume that his derivatives are continuous, but the penalty is unreasonably @@ -645,7 +645,7 @@ where "contour_integral g f \ @i. (f has_contour_integral i) g \ ~ f contour_integrable_on g \ i=0" lemma not_integrable_contour_integral: "~ f contour_integrable_on g \ contour_integral g f = 0" - unfolding contour_integrable_on_def contour_integral_def by blast + unfolding contour_integrable_on_def contour_integral_def by blast lemma contour_integral_unique: "(f has_contour_integral i) g \ contour_integral g f = i" apply (simp add: contour_integral_def has_contour_integral_def contour_integrable_on_def) @@ -1113,7 +1113,7 @@ lemma contour_integral_shiftpath: assumes "valid_path g" "pathfinish g = pathstart g" "a \ {0..1}" shows "contour_integral (shiftpath a g) f = contour_integral g f" - using assms + using assms by (simp add: contour_integral_def contour_integrable_on_def has_contour_integral_shiftpath_eq) @@ -1398,7 +1398,7 @@ have cfg: "continuous_on {a..b} (\x. f (g x))" apply (rule continuous_on_compose [OF cg, unfolded o_def]) using assms - apply (metis complex_differentiable_def complex_differentiable_imp_continuous_at continuous_on_eq_continuous_within continuous_on_subset image_subset_iff) + apply (metis field_differentiable_def field_differentiable_imp_continuous_at continuous_on_eq_continuous_within continuous_on_subset image_subset_iff) done { fix x::real assume a: "a < x" and b: "x < b" and xk: "x \ k" @@ -2034,7 +2034,7 @@ lemma holomorphic_point_small_triangle: assumes x: "x \ s" and f: "continuous_on s f" - and cd: "f complex_differentiable (at x within s)" + and cd: "f field_differentiable (at x within s)" and e: "0 < e" shows "\k>0. \a b c. dist a b \ k \ dist b c \ k \ dist c a \ k \ x \ convex hull {a,b,c} \ convex hull {a,b,c} \ s @@ -2089,7 +2089,7 @@ } note * = this show ?thesis using cd e - apply (simp add: complex_differentiable_def has_field_derivative_def has_derivative_within_alt approachable_lt_le2 Ball_def) + apply (simp add: field_differentiable_def has_field_derivative_def has_derivative_within_alt approachable_lt_le2 Ball_def) apply (clarify dest!: spec mp) using * apply (simp add: dist_norm, blast) @@ -2204,7 +2204,7 @@ then obtain x where x: "\n. x \ convex hull {fa n, fb n, fc n}" by auto then have xin: "x \ convex hull {a,b,c}" using assms f0 by blast - then have fx: "f complex_differentiable at x within (convex hull {a,b,c})" + then have fx: "f field_differentiable at x within (convex hull {a,b,c})" using assms holomorphic_on_def by blast { fix k n assume k: "0 < k" @@ -2506,7 +2506,7 @@ lemma Cauchy_theorem_triangle_cofinite: assumes "continuous_on (convex hull {a,b,c}) f" and "finite s" - and "(\x. x \ interior(convex hull {a,b,c}) - s \ f complex_differentiable (at x))" + and "(\x. x \ interior(convex hull {a,b,c}) - s \ f field_differentiable (at x))" shows "(f has_contour_integral 0) (linepath a b +++ linepath b c +++ linepath c a)" using assms proof (induction "card s" arbitrary: a b c s rule: less_induct) @@ -2514,7 +2514,7 @@ show ?case proof (cases "s={}") case True with less show ?thesis - by (fastforce simp: holomorphic_on_def complex_differentiable_at_within + by (fastforce simp: holomorphic_on_def field_differentiable_at_within Cauchy_theorem_triangle_interior) next case False @@ -2682,7 +2682,7 @@ assumes contf: "continuous_on s f" and s: "starlike s" and os: "open s" and k: "finite k" - and fcd: "\x. x \ s - k \ f complex_differentiable at x" + and fcd: "\x. x \ s - k \ f field_differentiable at x" shows "\g. \x \ s. (g has_field_derivative f x) (at x)" proof - obtain a where a: "a\s" and a_cs: "\x. x\s \ closed_segment a x \ s" @@ -2709,7 +2709,7 @@ lemma Cauchy_theorem_starlike: "\open s; starlike s; finite k; continuous_on s f; - \x. x \ s - k \ f complex_differentiable at x; + \x. x \ s - k \ f field_differentiable at x; valid_path g; path_image g \ s; pathfinish g = pathstart g\ \ (f has_contour_integral 0) g" by (metis holomorphic_starlike_primitive Cauchy_theorem_primitive at_within_open) @@ -2800,7 +2800,7 @@ fixes f :: "complex \ complex" shows "\convex s; finite k; continuous_on s f; - \x. x \ interior s - k \ f complex_differentiable at x\ + \x. x \ interior s - k \ f field_differentiable at x\ \ \g. \x \ s. (g has_field_derivative f x) (at x within s)" apply (rule contour_integral_convex_primitive [OF _ _ Cauchy_theorem_triangle_cofinite]) prefer 3 @@ -2810,7 +2810,7 @@ lemma Cauchy_theorem_convex: "\continuous_on s f; convex s; finite k; - \x. x \ interior s - k \ f complex_differentiable at x; + \x. x \ interior s - k \ f field_differentiable at x; valid_path g; path_image g \ s; pathfinish g = pathstart g\ \ (f has_contour_integral 0) g" by (metis holomorphic_convex_primitive Cauchy_theorem_primitive) @@ -2828,7 +2828,7 @@ text\In particular for a disc\ lemma Cauchy_theorem_disc: "\finite k; continuous_on (cball a e) f; - \x. x \ ball a e - k \ f complex_differentiable at x; + \x. x \ ball a e - k \ f field_differentiable at x; valid_path g; path_image g \ cball a e; pathfinish g = pathstart g\ \ (f has_contour_integral 0) g" apply (rule Cauchy_theorem_convex) @@ -2914,7 +2914,7 @@ and os: "open s" and k: "finite k" and g: "valid_path g" "path_image g \ s" - and fcd: "\x. x \ s - k \ f complex_differentiable at x" + and fcd: "\x. x \ s - k \ f field_differentiable at x" shows "f contour_integrable_on g" proof - { fix z @@ -2944,7 +2944,7 @@ shows "f contour_integrable_on g" apply (rule contour_integrable_holomorphic [OF _ os Finite_Set.finite.emptyI g]) apply (simp add: fh holomorphic_on_imp_continuous_on) - using fh by (simp add: complex_differentiable_def holomorphic_on_open os) + using fh by (simp add: field_differentiable_def holomorphic_on_open os) lemma continuous_on_inversediff: fixes z:: "'a::real_normed_field" shows "z \ s \ continuous_on s (\w. 1 / (w - z))" @@ -3819,7 +3819,7 @@ by (auto simp: intro!: derivative_eq_intros) ultimately have "\h. \y. norm(y - w) < norm(w - z) \ (h has_field_derivative 1/(y - z)) (at y)" using holomorphic_convex_primitive [of "ball w (norm(w - z))" "{}" "\w. 1/(w - z)"] - by (simp add: complex_differentiable_def Ball_def dist_norm at_within_open_NO_MATCH norm_minus_commute) + by (simp add: field_differentiable_def Ball_def dist_norm at_within_open_NO_MATCH norm_minus_commute) } then obtain h where h: "\w y. w \ z \ norm(y - w) < norm(w - z) \ (h w has_field_derivative 1/(y - z)) (at y)" by meson @@ -3840,8 +3840,8 @@ assume t: "t \ {a..b}" have cball: "continuous_on (ball (\ t) (dist (\ t) z)) (\x. inverse (x - z))" using z by (auto intro!: continuous_intros simp: dist_norm) - have icd: "\x. cmod (\ t - x) < cmod (\ t - z) \ (\w. inverse (w - z)) complex_differentiable at x" - unfolding complex_differentiable_def by (force simp: intro!: derivative_eq_intros) + have icd: "\x. cmod (\ t - x) < cmod (\ t - z) \ (\w. inverse (w - z)) field_differentiable at x" + unfolding field_differentiable_def by (force simp: intro!: derivative_eq_intros) obtain h where h: "\x. cmod (\ t - x) < cmod (\ t - z) \ (h has_field_derivative inverse (x - z)) (at x within {y. cmod (\ t - y) < cmod (\ t - z)})" using holomorphic_convex_primitive [where f = "\w. inverse(w - z)", OF convex_ball finite.emptyI cball icd] @@ -4492,13 +4492,13 @@ lemma Cauchy_integral_formula_weak: assumes s: "convex s" and "finite k" and conf: "continuous_on s f" - and fcd: "(\x. x \ interior s - k \ f complex_differentiable at x)" + and fcd: "(\x. x \ interior s - k \ f field_differentiable at x)" and z: "z \ interior s - k" and vpg: "valid_path \" and pasz: "path_image \ \ s - {z}" and loop: "pathfinish \ = pathstart \" shows "((\w. f w / (w - z)) has_contour_integral (2*pi * ii * winding_number \ z * f z)) \" proof - obtain f' where f': "(f has_field_derivative f') (at z)" - using fcd [OF z] by (auto simp: complex_differentiable_def) + using fcd [OF z] by (auto simp: field_differentiable_def) have pas: "path_image \ \ s" and znotin: "z \ path_image \" using pasz by blast+ have c: "continuous (at x within s) (\w. if w = z then f' else (f w - f z) / (w - z))" if "x \ s" for x proof (cases "x = z") @@ -4525,7 +4525,7 @@ apply (rule Cauchy_theorem_convex [OF _ s fink' _ vpg pas loop]) using c apply (force simp: continuous_on_eq_continuous_within) apply (rename_tac w) - apply (rule_tac d="dist w z" and f = "\w. (f w - f z)/(w - z)" in complex_differentiable_transform_within) + apply (rule_tac d="dist w z" and f = "\w. (f w - f z)/(w - z)" in field_differentiable_transform_within) apply (simp_all add: dist_pos_lt dist_commute) apply (metis less_irrefl) apply (rule derivative_intros fcd | simp)+ @@ -5675,7 +5675,7 @@ using open_contains_cball \z \ s\ \open s\ by blast then have holf_cball: "f holomorphic_on cball z r" apply (simp add: holomorphic_on_def) - using complex_differentiable_at_within complex_differentiable_def fder by blast + using field_differentiable_at_within field_differentiable_def fder by blast then have "continuous_on (path_image (circlepath z r)) f" using \r > 0\ by (force elim: holomorphic_on_subset [THEN holomorphic_on_imp_continuous_on]) then have contfpi: "continuous_on (path_image (circlepath z r)) (\x. 1/(2 * of_real pi*ii) * f x)" @@ -5715,7 +5715,7 @@ lemma holomorphic_deriv [holomorphic_intros]: "\f holomorphic_on s; open s\ \ (deriv f) holomorphic_on s" -by (metis DERIV_deriv_iff_complex_differentiable at_within_open derivative_is_holomorphic holomorphic_on_def) +by (metis DERIV_deriv_iff_field_differentiable at_within_open derivative_is_holomorphic holomorphic_on_def) lemma analytic_deriv: "f analytic_on s \ (deriv f) analytic_on s" using analytic_on_holomorphic holomorphic_deriv by auto @@ -5729,7 +5729,7 @@ lemma has_field_derivative_higher_deriv: "\f holomorphic_on s; open s; x \ s\ \ ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)" -by (metis (no_types, hide_lams) DERIV_deriv_iff_complex_differentiable at_within_open comp_apply +by (metis (no_types, hide_lams) DERIV_deriv_iff_field_differentiable at_within_open comp_apply funpow.simps(2) holomorphic_higher_deriv holomorphic_on_def) @@ -5968,7 +5968,7 @@ apply (simp add: Suc.IH) done also have "... = u^n * deriv (\z. (deriv ^^ n) f (u * z)) z" - apply (rule complex_derivative_cmult) + apply (rule deriv_cmult) apply (rule analytic_on_imp_differentiable_at [OF _ Suc.prems]) apply (rule analytic_on_compose_gen [where g="(deriv ^^ n) f" and t=t, unfolded o_def]) apply (simp add: analytic_on_linear) @@ -5978,7 +5978,7 @@ also have "... = u * u ^ n * deriv ((deriv ^^ n) f) (u * z)" apply (subst complex_derivative_chain [where g = "(deriv ^^ n) f" and f = "op*u", unfolded o_def]) apply (rule derivative_intros) - using Suc.prems complex_differentiable_def f fg has_field_derivative_higher_deriv t apply blast + using Suc.prems field_differentiable_def f fg has_field_derivative_higher_deriv t apply blast apply (simp add: deriv_linear) done finally show ?case @@ -6030,8 +6030,8 @@ shows "f holomorphic_on s" proof - { fix z - assume "z \ s" and cdf: "\x. x\s - k \ f complex_differentiable at x" - have "f complex_differentiable at z" + assume "z \ s" and cdf: "\x. x\s - k \ f field_differentiable at x" + have "f field_differentiable at z" proof (cases "z \ k") case False then show ?thesis by (blast intro: cdf \z \ s\) next @@ -6059,19 +6059,19 @@ qed } with holf s k show ?thesis - by (simp add: holomorphic_on_open open_Diff finite_imp_closed complex_differentiable_def [symmetric]) + by (simp add: holomorphic_on_open open_Diff finite_imp_closed field_differentiable_def [symmetric]) qed proposition Cauchy_integral_formula_convex: assumes s: "convex s" and k: "finite k" and contf: "continuous_on s f" - and fcd: "(\x. x \ interior s - k \ f complex_differentiable at x)" + and fcd: "(\x. x \ interior s - k \ f field_differentiable at x)" and z: "z \ interior s" and vpg: "valid_path \" and pasz: "path_image \ \ s - {z}" and loop: "pathfinish \ = pathstart \" shows "((\w. f w / (w - z)) has_contour_integral (2*pi * ii * winding_number \ z * f z)) \" apply (rule Cauchy_integral_formula_weak [OF s finite.emptyI contf]) - apply (simp add: holomorphic_on_open [symmetric] complex_differentiable_def) + apply (simp add: holomorphic_on_open [symmetric] field_differentiable_def) using no_isolated_singularity [where s = "interior s"] - apply (metis k contf fcd holomorphic_on_open complex_differentiable_def continuous_on_subset + apply (metis k contf fcd holomorphic_on_open field_differentiable_def continuous_on_subset has_field_derivative_at_within holomorphic_on_def interior_subset open_interior) using assms apply auto @@ -6103,8 +6103,8 @@ by (rule contour_integral_unique) have "\n. ((deriv ^^ n) f has_field_derivative deriv ((deriv ^^ n) f) w) (at w)" using Suc.prems assms has_field_derivative_higher_deriv by auto - then have dnf_diff: "\n. (deriv ^^ n) f complex_differentiable (at w)" - by (force simp add: complex_differentiable_def) + then have dnf_diff: "\n. (deriv ^^ n) f field_differentiable (at w)" + by (force simp add: field_differentiable_def) have "deriv (\w. complex_of_real (2 * pi) * \ / (fact k) * (deriv ^^ k) f w) w = of_nat (Suc k) * contour_integral (circlepath z r) (\u. f u / (u - w) ^ Suc (Suc k))" by (force intro!: DERIV_imp_deriv Cauchy_next_derivative_circlepath [OF f Suc.IH _ Suc.prems]) @@ -6112,7 +6112,7 @@ by (simp only: con) finally have "deriv (\w. ((2 * pi) * \ / (fact k)) * (deriv ^^ k) f w) w = of_nat (Suc k) * X" . then have "((2 * pi) * \ / (fact k)) * deriv (\w. (deriv ^^ k) f w) w = of_nat (Suc k) * X" - by (metis complex_derivative_cmult dnf_diff) + by (metis deriv_cmult dnf_diff) then have "deriv (\w. (deriv ^^ k) f w) w = of_nat (Suc k) * X / ((2 * pi) * \ / (fact k))" by (simp add: field_simps) then show ?case @@ -6432,7 +6432,7 @@ let ?conint = "contour_integral (circlepath z r)" have g: "continuous_on (cball z r) g" "g holomorphic_on ball z r" by (rule holomorphic_uniform_limit [OF eventually_mono [OF cont] lim F]; - auto simp: holomorphic_on_open complex_differentiable_def)+ + auto simp: holomorphic_on_open field_differentiable_def)+ then obtain g' where g': "\x. x \ ball z r \ (g has_field_derivative g' x) (at x)" using DERIV_deriv_iff_has_field_derivative by (fastforce simp add: holomorphic_on_open) @@ -6845,54 +6845,54 @@ shows "(\z. if z = a then deriv f a else (f z - f a) / (z - a)) holomorphic_on s" (is "?F holomorphic_on s") proof - - have F1: "?F complex_differentiable (at u within s)" if "u \ s" "u \ a" for u + have F1: "?F field_differentiable (at u within s)" if "u \ s" "u \ a" for u proof - - have fcd: "f complex_differentiable at u within s" + have fcd: "f field_differentiable at u within s" using holf holomorphic_on_def by (simp add: \u \ s\) - have cd: "(\z. (f z - f a) / (z - a)) complex_differentiable at u within s" + have cd: "(\z. (f z - f a) / (z - a)) field_differentiable at u within s" by (rule fcd derivative_intros | simp add: that)+ have "0 < dist a u" using that dist_nz by blast then show ?thesis - by (rule complex_differentiable_transform_within [OF _ _ _ cd]) (auto simp: \u \ s\) + by (rule field_differentiable_transform_within [OF _ _ _ cd]) (auto simp: \u \ s\) qed - have F2: "?F complex_differentiable at a" if "0 < e" "ball a e \ s" for e + have F2: "?F field_differentiable at a" if "0 < e" "ball a e \ s" for e proof - have holfb: "f holomorphic_on ball a e" by (rule holomorphic_on_subset [OF holf \ball a e \ s\]) have 2: "?F holomorphic_on ball a e - {a}" apply (rule holomorphic_on_subset [where s = "s - {a}"]) - apply (simp add: holomorphic_on_def complex_differentiable_def [symmetric]) + apply (simp add: holomorphic_on_def field_differentiable_def [symmetric]) using mem_ball that - apply (auto intro: F1 complex_differentiable_within_subset) + apply (auto intro: F1 field_differentiable_within_subset) done have "isCont (\z. if z = a then deriv f a else (f z - f a) / (z - a)) x" if "dist a x < e" for x proof (cases "x=a") case True then show ?thesis using holfb \0 < e\ - apply (simp add: holomorphic_on_open complex_differentiable_def [symmetric]) + apply (simp add: holomorphic_on_open field_differentiable_def [symmetric]) apply (drule_tac x=a in bspec) - apply (auto simp: DERIV_deriv_iff_complex_differentiable [symmetric] continuous_at DERIV_iff2 + apply (auto simp: DERIV_deriv_iff_field_differentiable [symmetric] continuous_at DERIV_iff2 elim: rev_iffD1 [OF _ LIM_equal]) done next case False with 2 that show ?thesis - by (force simp: holomorphic_on_open open_Diff complex_differentiable_def [symmetric] complex_differentiable_imp_continuous_at) + by (force simp: holomorphic_on_open open_Diff field_differentiable_def [symmetric] field_differentiable_imp_continuous_at) qed then have 1: "continuous_on (ball a e) ?F" by (clarsimp simp: continuous_on_eq_continuous_at) have "?F holomorphic_on ball a e" by (auto intro: no_isolated_singularity [OF 1 2]) with that show ?thesis - by (simp add: holomorphic_on_open complex_differentiable_def [symmetric] - complex_differentiable_at_within) + by (simp add: holomorphic_on_open field_differentiable_def [symmetric] + field_differentiable_at_within) qed show ?thesis proof - fix x assume "x \ s" show "?F complex_differentiable at x within s" + fix x assume "x \ s" show "?F field_differentiable at x within s" proof (cases "x=a") case True then show ?thesis - using a by (auto simp: mem_interior intro: complex_differentiable_at_within F2) + using a by (auto simp: mem_interior intro: field_differentiable_at_within F2) next case False with F1 \x \ s\ show ?thesis by blast @@ -6916,8 +6916,8 @@ show ?thesis by fastforce next case False with assms show ?thesis - apply (simp add: holomorphic_on_def complex_differentiable_def [symmetric], clarify) - apply (rule complex_differentiable_transform_within [where f = "\z. (f z - f a)/(z - a)" and d = 1]) + apply (simp add: holomorphic_on_def field_differentiable_def [symmetric], clarify) + apply (rule field_differentiable_transform_within [where f = "\z. (f z - f a)/(z - a)" and d = 1]) apply (rule derivative_intros | force)+ done qed @@ -7082,16 +7082,16 @@ have *: "(\c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on u" by (simp add: holf pole_lemma_open u) then have "isCont (\x. if x = y then deriv f y else (f x - f y) / (x - y)) y" - using at_within_open complex_differentiable_imp_continuous_at holomorphic_on_def that u by fastforce + using at_within_open field_differentiable_imp_continuous_at holomorphic_on_def that u by fastforce then have "continuous_on u (d y)" apply (simp add: d_def continuous_on_eq_continuous_at u, clarify) using * holomorphic_on_def - by (meson complex_differentiable_within_open complex_differentiable_imp_continuous_at u) + by (meson field_differentiable_within_open field_differentiable_imp_continuous_at u) moreover have "d y holomorphic_on u - {y}" - apply (simp add: d_def holomorphic_on_open u open_delete complex_differentiable_def [symmetric]) + apply (simp add: d_def holomorphic_on_open u open_delete field_differentiable_def [symmetric]) apply (intro ballI) apply (rename_tac w) - apply (rule_tac d="dist w y" and f = "\w. (f w - f y)/(w - y)" in complex_differentiable_transform_within) + apply (rule_tac d="dist w y" and f = "\w. (f w - f y)/(w - y)" in field_differentiable_transform_within) apply (auto simp: dist_pos_lt dist_commute intro!: derivative_intros) using analytic_on_imp_differentiable_at analytic_on_open holf u apply blast done @@ -7262,7 +7262,7 @@ have derf_le: "w \ closed_segment x' z' \ z' \ x' \ cmod (deriv f w - deriv f x) \ e" for w by (blast intro: cs_less less_k1 k1 [unfolded divide_const_simps dist_norm] less_imp_le le_less_trans) have f_has_der: "\x. x \ u \ (f has_field_derivative deriv f x) (at x within u)" - by (metis DERIV_deriv_iff_complex_differentiable at_within_open holf holomorphic_on_def u) + by (metis DERIV_deriv_iff_field_differentiable at_within_open holf holomorphic_on_def u) have "closed_segment x' z' \ u" by (rule order_trans [OF _ k2]) (simp add: cs_less le_less_trans [OF _ less_k2] dist_complex_def norm_minus_commute subset_iff) then have cint_derf: "(deriv f has_contour_integral f z' - f x') (linepath x' z')" @@ -7306,14 +7306,14 @@ by (rule continuous_on_compose continuous_intros continuous_on_subset [OF cond_uu] | force intro: that)+ then have *: "continuous_on u (\z. if w = z then deriv f z else (f w - f z) / (w - z))" by (rule rev_iffD1 [OF _ continuous_on_cong [OF refl]]) (simp add: d_def field_simps) - have **: "\x. \x \ u; x \ w\ \ (\z. if w = z then deriv f z else (f w - f z) / (w - z)) complex_differentiable at x" - apply (rule_tac f = "\x. (f w - f x)/(w - x)" and d = "dist x w" in complex_differentiable_transform_within) + have **: "\x. \x \ u; x \ w\ \ (\z. if w = z then deriv f z else (f w - f z) / (w - z)) field_differentiable at x" + apply (rule_tac f = "\x. (f w - f x)/(w - x)" and d = "dist x w" in field_differentiable_transform_within) apply (rule u derivative_intros holomorphic_on_imp_differentiable_at [OF holf] | force simp add: dist_commute)+ done show ?thesis unfolding d_def apply (rule no_isolated_singularity [OF * _ u, where k = "{w}"]) - apply (auto simp: complex_differentiable_def [symmetric] holomorphic_on_open open_Diff u **) + apply (auto simp: field_differentiable_def [symmetric] holomorphic_on_open open_Diff u **) done qed { fix a b @@ -7388,14 +7388,14 @@ by (simp add: h_def x au o_def) qed show ?thesis - proof (simp add: holomorphic_on_open complex_differentiable_def [symmetric], clarify) + proof (simp add: holomorphic_on_open field_differentiable_def [symmetric], clarify) fix z0 consider "z0 \ v" | "z0 \ u" using uv_Un by blast - then show "h complex_differentiable at z0" + then show "h field_differentiable at z0" proof cases assume "z0 \ v" then show ?thesis using Cauchy_next_derivative [OF con_pa_f le_B f_has_cint _ ov] V f_has_cint \valid_path \\ - by (auto simp: complex_differentiable_def v_def) + by (auto simp: field_differentiable_def v_def) next assume "z0 \ u" then obtain e where "e>0" and e: "ball z0 e \ u" by (blast intro: openE [OF u]) diff -r bc25f3916a99 -r 6855b348e828 src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy --- a/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy Mon Mar 07 14:34:45 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy Mon Mar 07 15:57:02 2016 +0000 @@ -277,159 +277,159 @@ subsection\Holomorphic functions\ -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" +definition field_differentiable :: "['a \ 'a::real_normed_field, 'a filter] \ bool" + (infixr "(field'_differentiable)" 50) + where "f field_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 field_differentiable_derivI: + "f field_differentiable (at x) \ (f has_field_derivative deriv f x) (at x)" +by (simp add: field_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) +lemma field_differentiable_imp_continuous_at: + "f field_differentiable (at x within s) \ continuous (at x within s) f" + by (metis DERIV_continuous field_differentiable_def) -lemma complex_differentiable_within_subset: - "\f complex_differentiable (at x within s); t \ s\ - \ f complex_differentiable (at x within t)" - by (metis DERIV_subset complex_differentiable_def) +lemma field_differentiable_within_subset: + "\f field_differentiable (at x within s); t \ s\ + \ f field_differentiable (at x within t)" + by (metis DERIV_subset field_differentiable_def) -lemma complex_differentiable_at_within: - "\f complex_differentiable (at x)\ - \ f complex_differentiable (at x within s)" - unfolding complex_differentiable_def +lemma field_differentiable_at_within: + "\f field_differentiable (at x)\ + \ f field_differentiable (at x within s)" + unfolding field_differentiable_def by (metis DERIV_subset top_greatest) -lemma complex_differentiable_linear [simp,derivative_intros]: "(op * c) complex_differentiable F" +lemma field_differentiable_linear [simp,derivative_intros]: "(op * c) field_differentiable F" proof - show ?thesis - unfolding complex_differentiable_def has_field_derivative_def mult_commute_abs + unfolding field_differentiable_def has_field_derivative_def mult_commute_abs by (force intro: has_derivative_mult_right) qed -lemma complex_differentiable_const [simp,derivative_intros]: "(\z. c) complex_differentiable F" - unfolding complex_differentiable_def has_field_derivative_def +lemma field_differentiable_const [simp,derivative_intros]: "(\z. c) field_differentiable F" + unfolding field_differentiable_def has_field_derivative_def by (rule exI [where x=0]) (metis has_derivative_const lambda_zero) -lemma complex_differentiable_ident [simp,derivative_intros]: "(\z. z) complex_differentiable F" - unfolding complex_differentiable_def has_field_derivative_def +lemma field_differentiable_ident [simp,derivative_intros]: "(\z. z) field_differentiable F" + unfolding field_differentiable_def has_field_derivative_def by (rule exI [where x=1]) (simp add: lambda_one [symmetric]) -lemma complex_differentiable_id [simp,derivative_intros]: "id complex_differentiable F" - unfolding id_def by (rule complex_differentiable_ident) +lemma field_differentiable_id [simp,derivative_intros]: "id field_differentiable F" + unfolding id_def by (rule field_differentiable_ident) -lemma complex_differentiable_minus [derivative_intros]: - "f complex_differentiable F \ (\z. - (f z)) complex_differentiable F" - using assms unfolding complex_differentiable_def +lemma field_differentiable_minus [derivative_intros]: + "f field_differentiable F \ (\z. - (f z)) field_differentiable F" + using assms unfolding field_differentiable_def by (metis field_differentiable_minus) -lemma complex_differentiable_add [derivative_intros]: - assumes "f complex_differentiable F" "g complex_differentiable F" - shows "(\z. f z + g z) complex_differentiable F" - using assms unfolding complex_differentiable_def +lemma field_differentiable_add [derivative_intros]: + assumes "f field_differentiable F" "g field_differentiable F" + shows "(\z. f z + g z) field_differentiable F" + using assms unfolding field_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 field_differentiable_add_const [simp,derivative_intros]: + "op + c field_differentiable F" + by (simp add: field_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" +lemma field_differentiable_setsum [derivative_intros]: + "(\i. i \ I \ (f i) field_differentiable F) \ (\z. \i\I. f i z) field_differentiable F" by (induct I rule: infinite_finite_induct) - (auto intro: complex_differentiable_add complex_differentiable_const) + (auto intro: field_differentiable_add field_differentiable_const) -lemma complex_differentiable_diff [derivative_intros]: - assumes "f complex_differentiable F" "g complex_differentiable F" - shows "(\z. f z - g z) complex_differentiable F" - using assms unfolding complex_differentiable_def +lemma field_differentiable_diff [derivative_intros]: + assumes "f field_differentiable F" "g field_differentiable F" + shows "(\z. f z - g z) field_differentiable F" + using assms unfolding field_differentiable_def by (metis field_differentiable_diff) -lemma complex_differentiable_inverse [derivative_intros]: - assumes "f complex_differentiable (at a within s)" "f a \ 0" - shows "(\z. inverse (f z)) complex_differentiable (at a within s)" - using assms unfolding complex_differentiable_def +lemma field_differentiable_inverse [derivative_intros]: + assumes "f field_differentiable (at a within s)" "f a \ 0" + shows "(\z. inverse (f z)) field_differentiable (at a within s)" + using assms unfolding field_differentiable_def by (metis DERIV_inverse_fun) -lemma complex_differentiable_mult [derivative_intros]: - assumes "f complex_differentiable (at a within s)" - "g complex_differentiable (at a within s)" - shows "(\z. f z * g z) complex_differentiable (at a within s)" - using assms unfolding complex_differentiable_def +lemma field_differentiable_mult [derivative_intros]: + assumes "f field_differentiable (at a within s)" + "g field_differentiable (at a within s)" + shows "(\z. f z * g z) field_differentiable (at a within s)" + using assms unfolding field_differentiable_def by (metis DERIV_mult [of f _ a s g]) -lemma complex_differentiable_divide [derivative_intros]: - assumes "f complex_differentiable (at a within s)" - "g complex_differentiable (at a within s)" +lemma field_differentiable_divide [derivative_intros]: + assumes "f field_differentiable (at a within s)" + "g field_differentiable (at a within s)" "g a \ 0" - shows "(\z. f z / g z) complex_differentiable (at a within s)" - using assms unfolding complex_differentiable_def + shows "(\z. f z / g z) field_differentiable (at a within s)" + using assms unfolding field_differentiable_def by (metis DERIV_divide [of f _ a s g]) -lemma complex_differentiable_power [derivative_intros]: - assumes "f complex_differentiable (at a within s)" - shows "(\z. f z ^ n) complex_differentiable (at a within s)" - using assms unfolding complex_differentiable_def +lemma field_differentiable_power [derivative_intros]: + assumes "f field_differentiable (at a within s)" + shows "(\z. f z ^ n) field_differentiable (at a within s)" + using assms unfolding field_differentiable_def by (metis DERIV_power) -lemma complex_differentiable_transform_within: +lemma field_differentiable_transform_within: "0 < d \ x \ s \ (\x'. x' \ s \ dist x' x < d \ f x' = g x') \ - f complex_differentiable (at x within s) - \ g complex_differentiable (at x within s)" - unfolding complex_differentiable_def has_field_derivative_def + f field_differentiable (at x within s) + \ g field_differentiable (at x within s)" + unfolding field_differentiable_def has_field_derivative_def by (blast intro: has_derivative_transform_within) -lemma complex_differentiable_compose_within: - assumes "f complex_differentiable (at a within s)" - "g complex_differentiable (at (f a) within f`s)" - shows "(g o f) complex_differentiable (at a within s)" - using assms unfolding complex_differentiable_def +lemma field_differentiable_compose_within: + assumes "f field_differentiable (at a within s)" + "g field_differentiable (at (f a) within f`s)" + shows "(g o f) field_differentiable (at a within s)" + using assms unfolding field_differentiable_def by (metis DERIV_image_chain) -lemma complex_differentiable_compose: - "f complex_differentiable at z \ g complex_differentiable at (f z) - \ (g o f) complex_differentiable at z" -by (metis complex_differentiable_at_within complex_differentiable_compose_within) +lemma field_differentiable_compose: + "f field_differentiable at z \ g field_differentiable at (f z) + \ (g o f) field_differentiable at z" +by (metis field_differentiable_at_within field_differentiable_compose_within) -lemma complex_differentiable_within_open: - "\a \ s; open s\ \ f complex_differentiable at a within s \ - f complex_differentiable at a" - unfolding complex_differentiable_def +lemma field_differentiable_within_open: + "\a \ s; open s\ \ f field_differentiable at a within s \ + f field_differentiable at a" + unfolding field_differentiable_def by (metis at_within_open) subsection\Caratheodory characterization\ -lemma complex_differentiable_caratheodory_at: - "f complex_differentiable (at z) \ +lemma field_differentiable_caratheodory_at: + "f field_differentiable (at z) \ (\g. (\w. f(w) - f(z) = g(w) * (w - z)) \ continuous (at z) g)" using CARAT_DERIV [of f] - by (simp add: complex_differentiable_def has_field_derivative_def) + by (simp add: field_differentiable_def has_field_derivative_def) -lemma complex_differentiable_caratheodory_within: - "f complex_differentiable (at z within s) \ +lemma field_differentiable_caratheodory_within: + "f field_differentiable (at z within s) \ (\g. (\w. f(w) - f(z) = g(w) * (w - z)) \ continuous (at z within s) g)" using DERIV_caratheodory_within [of f] - by (simp add: complex_differentiable_def has_field_derivative_def) + by (simp add: field_differentiable_def has_field_derivative_def) subsection\Holomorphic\ definition holomorphic_on :: "[complex \ complex, complex set] \ bool" (infixl "(holomorphic'_on)" 50) - where "f holomorphic_on s \ \x\s. f complex_differentiable (at x within s)" + where "f holomorphic_on s \ \x\s. f field_differentiable (at x within s)" named_theorems holomorphic_intros "structural introduction rules for holomorphic_on" -lemma holomorphic_onI [intro?]: "(\x. x \ s \ f complex_differentiable (at x within s)) \ f holomorphic_on s" +lemma holomorphic_onI [intro?]: "(\x. x \ s \ f field_differentiable (at x within s)) \ f holomorphic_on s" by (simp add: holomorphic_on_def) -lemma holomorphic_onD [dest?]: "\f holomorphic_on s; x \ s\ \ f complex_differentiable (at x within s)" +lemma holomorphic_onD [dest?]: "\f holomorphic_on s; x \ s\ \ f field_differentiable (at x within s)" by (simp add: holomorphic_on_def) lemma holomorphic_on_imp_differentiable_at: - "\f holomorphic_on s; open s; x \ s\ \ f complex_differentiable (at x)" + "\f holomorphic_on s; open s; x \ s\ \ f field_differentiable (at x)" using at_within_open holomorphic_on_def by fastforce lemma holomorphic_on_empty [holomorphic_intros]: "f holomorphic_on {}" @@ -437,38 +437,38 @@ lemma holomorphic_on_open: "open s \ f holomorphic_on s \ (\x \ s. \f'. DERIV f x :> f')" - by (auto simp: holomorphic_on_def complex_differentiable_def has_field_derivative_def at_within_open [of _ s]) + by (auto simp: holomorphic_on_def field_differentiable_def has_field_derivative_def at_within_open [of _ s]) lemma holomorphic_on_imp_continuous_on: "f holomorphic_on s \ continuous_on s f" - by (metis complex_differentiable_imp_continuous_at continuous_on_eq_continuous_within holomorphic_on_def) + by (metis field_differentiable_imp_continuous_at continuous_on_eq_continuous_within holomorphic_on_def) lemma holomorphic_on_subset: "f holomorphic_on s \ t \ s \ f holomorphic_on t" unfolding holomorphic_on_def - by (metis complex_differentiable_within_subset subsetD) + by (metis field_differentiable_within_subset subsetD) lemma holomorphic_transform: "\f holomorphic_on s; \x. x \ s \ f x = g x\ \ g holomorphic_on s" - by (metis complex_differentiable_transform_within linordered_field_no_ub holomorphic_on_def) + by (metis field_differentiable_transform_within linordered_field_no_ub holomorphic_on_def) lemma holomorphic_cong: "s = t ==> (\x. x \ s \ f x = g x) \ f holomorphic_on s \ g holomorphic_on t" by (metis holomorphic_transform) lemma holomorphic_on_linear [simp, holomorphic_intros]: "(op * c) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_linear) + unfolding holomorphic_on_def by (metis field_differentiable_linear) lemma holomorphic_on_const [simp, holomorphic_intros]: "(\z. c) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_const) + unfolding holomorphic_on_def by (metis field_differentiable_const) lemma holomorphic_on_ident [simp, holomorphic_intros]: "(\x. x) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_ident) + unfolding holomorphic_on_def by (metis field_differentiable_ident) lemma holomorphic_on_id [simp, holomorphic_intros]: "id holomorphic_on s" unfolding id_def by (rule holomorphic_on_ident) lemma holomorphic_on_compose: "f holomorphic_on s \ g holomorphic_on (f ` s) \ (g o f) holomorphic_on s" - using complex_differentiable_compose_within[of f _ s g] + using field_differentiable_compose_within[of f _ s g] by (auto simp: holomorphic_on_def) lemma holomorphic_on_compose_gen: @@ -476,49 +476,49 @@ by (metis holomorphic_on_compose holomorphic_on_subset) lemma holomorphic_on_minus [holomorphic_intros]: "f holomorphic_on s \ (\z. -(f z)) holomorphic_on s" - by (metis complex_differentiable_minus holomorphic_on_def) + by (metis field_differentiable_minus holomorphic_on_def) lemma holomorphic_on_add [holomorphic_intros]: "\f holomorphic_on s; g holomorphic_on s\ \ (\z. f z + g z) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_add) + unfolding holomorphic_on_def by (metis field_differentiable_add) lemma holomorphic_on_diff [holomorphic_intros]: "\f holomorphic_on s; g holomorphic_on s\ \ (\z. f z - g z) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_diff) + unfolding holomorphic_on_def by (metis field_differentiable_diff) lemma holomorphic_on_mult [holomorphic_intros]: "\f holomorphic_on s; g holomorphic_on s\ \ (\z. f z * g z) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_mult) + unfolding holomorphic_on_def by (metis field_differentiable_mult) lemma holomorphic_on_inverse [holomorphic_intros]: "\f holomorphic_on s; \z. z \ s \ f z \ 0\ \ (\z. inverse (f z)) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_inverse) + unfolding holomorphic_on_def by (metis field_differentiable_inverse) lemma holomorphic_on_divide [holomorphic_intros]: "\f holomorphic_on s; g holomorphic_on s; \z. z \ s \ g z \ 0\ \ (\z. f z / g z) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_divide) + unfolding holomorphic_on_def by (metis field_differentiable_divide) lemma holomorphic_on_power [holomorphic_intros]: "f holomorphic_on s \ (\z. (f z)^n) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_power) + unfolding holomorphic_on_def by (metis field_differentiable_power) lemma holomorphic_on_setsum [holomorphic_intros]: "(\i. i \ I \ (f i) holomorphic_on s) \ (\x. setsum (\i. f i x) I) holomorphic_on s" - unfolding holomorphic_on_def by (metis complex_differentiable_setsum) + unfolding holomorphic_on_def by (metis field_differentiable_setsum) -lemma DERIV_deriv_iff_complex_differentiable: - "DERIV f x :> deriv f x \ f complex_differentiable at x" - unfolding complex_differentiable_def by (metis DERIV_imp_deriv) +lemma DERIV_deriv_iff_field_differentiable: + "DERIV f x :> deriv f x \ f field_differentiable at x" + unfolding field_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) +by (metis DERIV_deriv_iff_field_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) + "f field_differentiable at x \ g field_differentiable at (f x) \ deriv (g o f) x = deriv g (f x) * deriv f x" - by (metis DERIV_deriv_iff_complex_differentiable DERIV_chain DERIV_imp_deriv) + by (metis DERIV_deriv_iff_field_differentiable DERIV_chain DERIV_imp_deriv) lemma deriv_linear [simp]: "deriv (\w. c * w) = (\z. c)" by (metis DERIV_imp_deriv DERIV_cmult_Id) @@ -532,50 +532,50 @@ lemma deriv_const [simp]: "deriv (\w. c) = (\z. 0)" by (metis DERIV_imp_deriv DERIV_const) -lemma complex_derivative_add [simp]: - "\f complex_differentiable at z; g complex_differentiable at z\ +lemma deriv_add [simp]: + "\f field_differentiable at z; g field_differentiable at z\ \ deriv (\w. f w + g w) z = deriv f z + deriv g z" - unfolding DERIV_deriv_iff_complex_differentiable[symmetric] + unfolding DERIV_deriv_iff_field_differentiable[symmetric] by (auto intro!: DERIV_imp_deriv derivative_intros) -lemma complex_derivative_diff [simp]: - "\f complex_differentiable at z; g complex_differentiable at z\ +lemma deriv_diff [simp]: + "\f field_differentiable at z; g field_differentiable at z\ \ deriv (\w. f w - g w) z = deriv f z - deriv g z" - unfolding DERIV_deriv_iff_complex_differentiable[symmetric] + unfolding DERIV_deriv_iff_field_differentiable[symmetric] by (auto intro!: DERIV_imp_deriv derivative_intros) -lemma complex_derivative_mult [simp]: - "\f complex_differentiable at z; g complex_differentiable at z\ +lemma deriv_mult [simp]: + "\f field_differentiable at z; g field_differentiable at z\ \ deriv (\w. f w * g w) z = f z * deriv g z + deriv f z * g z" - unfolding DERIV_deriv_iff_complex_differentiable[symmetric] + unfolding DERIV_deriv_iff_field_differentiable[symmetric] by (auto intro!: DERIV_imp_deriv derivative_eq_intros) -lemma complex_derivative_cmult [simp]: - "f complex_differentiable at z \ deriv (\w. c * f w) z = c * deriv f z" - unfolding DERIV_deriv_iff_complex_differentiable[symmetric] +lemma deriv_cmult [simp]: + "f field_differentiable at z \ deriv (\w. c * f w) z = c * deriv f z" + unfolding DERIV_deriv_iff_field_differentiable[symmetric] by (auto intro!: DERIV_imp_deriv derivative_eq_intros) -lemma complex_derivative_cmult_right [simp]: - "f complex_differentiable at z \ deriv (\w. f w * c) z = deriv f z * c" - unfolding DERIV_deriv_iff_complex_differentiable[symmetric] +lemma deriv_cmult_right [simp]: + "f field_differentiable at z \ deriv (\w. f w * c) z = deriv f z * c" + unfolding DERIV_deriv_iff_field_differentiable[symmetric] by (auto intro!: DERIV_imp_deriv derivative_eq_intros) -lemma complex_derivative_cdivide_right [simp]: - "f complex_differentiable at z \ deriv (\w. f w / c) z = deriv f z / c" +lemma deriv_cdivide_right [simp]: + "f field_differentiable at z \ deriv (\w. f w / c) z = deriv f z / c" unfolding Fields.field_class.field_divide_inverse - by (blast intro: complex_derivative_cmult_right) + by (blast intro: deriv_cmult_right) lemma complex_derivative_transform_within_open: "\f holomorphic_on s; g holomorphic_on s; open s; z \ s; \w. w \ s \ f w = g w\ \ deriv f z = deriv g z" unfolding holomorphic_on_def by (rule DERIV_imp_deriv) - (metis DERIV_deriv_iff_complex_differentiable DERIV_transform_within_open at_within_open) + (metis DERIV_deriv_iff_field_differentiable DERIV_transform_within_open at_within_open) -lemma complex_derivative_compose_linear: - "f complex_differentiable at (c * z) \ deriv (\w. f (c * w)) z = c * deriv f (c * z)" +lemma deriv_compose_linear: + "f field_differentiable at (c * z) \ deriv (\w. f (c * w)) z = c * deriv f (c * z)" apply (rule DERIV_imp_deriv) -apply (simp add: DERIV_deriv_iff_complex_differentiable [symmetric]) +apply (simp add: DERIV_deriv_iff_field_differentiable [symmetric]) apply (drule DERIV_chain' [of "times c" c z UNIV f "deriv f (c * z)", OF DERIV_cmult_Id]) apply (simp add: algebra_simps) done @@ -602,7 +602,7 @@ lemma analytic_imp_holomorphic: "f analytic_on s \ f holomorphic_on s" by (simp add: at_within_open [OF _ open_ball] analytic_on_def holomorphic_on_def) - (metis centre_in_ball complex_differentiable_at_within) + (metis centre_in_ball field_differentiable_at_within) lemma analytic_on_open: "open s \ f analytic_on s \ f holomorphic_on s" apply (auto simp: analytic_imp_holomorphic) @@ -610,9 +610,9 @@ by (metis holomorphic_on_def holomorphic_on_subset open_contains_ball) lemma analytic_on_imp_differentiable_at: - "f analytic_on s \ x \ s \ f complex_differentiable (at x)" + "f analytic_on s \ x \ s \ f field_differentiable (at x)" apply (auto simp: analytic_on_def holomorphic_on_def) -by (metis Topology_Euclidean_Space.open_ball centre_in_ball complex_differentiable_within_open) +by (metis Topology_Euclidean_Space.open_ball centre_in_ball field_differentiable_within_open) lemma analytic_on_subset: "f analytic_on s \ t \ s \ f analytic_on t" by (auto simp: analytic_on_def) @@ -674,7 +674,7 @@ obtain e' where e': "0 < e'" and gh: "g holomorphic_on ball (f x) e'" using g by (metis analytic_on_def g image_eqI x) have "isCont f x" - by (metis analytic_on_imp_differentiable_at complex_differentiable_imp_continuous_at f x) + by (metis analytic_on_imp_differentiable_at field_differentiable_imp_continuous_at f x) with e' obtain d where d: "0 < d" and fd: "f ` ball x d \ ball (f x) e'" by (auto simp: continuous_at_ball) have "g \ f holomorphic_on ball x (min d e)" @@ -864,25 +864,25 @@ show "deriv (\w. f w + g w) z = deriv f z + deriv g z" apply (rule DERIV_imp_deriv [OF DERIV_add]) using s - apply (auto simp: holomorphic_on_open complex_differentiable_def DERIV_deriv_iff_complex_differentiable) + apply (auto simp: holomorphic_on_open field_differentiable_def DERIV_deriv_iff_field_differentiable) done show "deriv (\w. f w - g w) z = deriv f z - deriv g z" apply (rule DERIV_imp_deriv [OF DERIV_diff]) using s - apply (auto simp: holomorphic_on_open complex_differentiable_def DERIV_deriv_iff_complex_differentiable) + apply (auto simp: holomorphic_on_open field_differentiable_def DERIV_deriv_iff_field_differentiable) done show "deriv (\w. f w * g w) z = f z * deriv g z + deriv f z * g z" apply (rule DERIV_imp_deriv [OF DERIV_mult']) using s - apply (auto simp: holomorphic_on_open complex_differentiable_def DERIV_deriv_iff_complex_differentiable) + apply (auto simp: holomorphic_on_open field_differentiable_def DERIV_deriv_iff_field_differentiable) done qed -lemma complex_derivative_cmult_at: +lemma deriv_cmult_at: "f analytic_on {z} \ deriv (\w. c * f w) z = c * deriv f z" by (auto simp: complex_derivative_mult_at deriv_const analytic_on_const) -lemma complex_derivative_cmult_right_at: +lemma deriv_cmult_right_at: "f analytic_on {z} \ deriv (\w. f w * c) z = deriv f z * c" by (auto simp: complex_derivative_mult_at deriv_const analytic_on_const) @@ -927,7 +927,6 @@ qed qed - lemma has_complex_derivative_series: fixes s :: "complex set" assumes cvs: "convex s" @@ -970,13 +969,13 @@ qed -lemma complex_differentiable_series: +lemma field_differentiable_series: fixes f :: "nat \ complex \ complex" assumes "convex s" "open s" assumes "\n x. x \ s \ (f n has_field_derivative f' n x) (at x)" assumes "uniformly_convergent_on s (\n x. \i s" "summable (\n. f n x0)" and x: "x \ s" - shows "summable (\n. f n x)" and "(\x. \n. f n x) complex_differentiable (at x)" + shows "summable (\n. f n x)" and "(\x. \n. f n x) field_differentiable (at x)" proof - from assms(4) obtain g' where A: "uniform_limit s (\n x. \ix. \n. f n x) has_derivative op * (g' x)) (at x)" by (rule has_derivative_transform_within_open[OF g' \open s\ x]) (insert g, auto simp: sums_iff) - thus "(\x. \n. f n x) complex_differentiable (at x)" unfolding differentiable_def - by (auto simp: summable_def complex_differentiable_def has_field_derivative_def) + thus "(\x. \n. f n x) field_differentiable (at x)" unfolding differentiable_def + by (auto simp: summable_def field_differentiable_def has_field_derivative_def) qed -lemma complex_differentiable_series': +lemma field_differentiable_series': fixes f :: "nat \ complex \ complex" assumes "convex s" "open s" assumes "\n x. x \ s \ (f n has_field_derivative f' n x) (at x)" assumes "uniformly_convergent_on s (\n x. \i s" "summable (\n. f n x0)" - shows "(\x. \n. f n x) complex_differentiable (at x0)" - using complex_differentiable_series[OF assms, of x0] \x0 \ s\ by blast+ + shows "(\x. \n. f n x) field_differentiable (at x0)" + using field_differentiable_series[OF assms, of x0] \x0 \ s\ by blast+ subsection\Bound theorem\ -lemma complex_differentiable_bound: +lemma field_differentiable_bound: fixes s :: "complex set" assumes cvs: "convex s" and df: "\z. z \ s \ (f has_field_derivative f' z) (at z within s)" @@ -1155,7 +1154,7 @@ (\i\n. f i z * (z - z) ^ i / (fact i)))" by (simp add: norm_minus_commute) also have "... \ B * cmod (z - w) ^ n / (fact n) * cmod (w - z)" - apply (rule complex_differentiable_bound + apply (rule field_differentiable_bound [where f' = "\w. f (Suc n) w * (z - w)^n / (fact n)" and s = "closed_segment w z", OF convex_closed_segment]) apply (auto simp: ends_in_segment DERIV_subset [OF sum_deriv wzs] diff -r bc25f3916a99 -r 6855b348e828 src/HOL/Multivariate_Analysis/Complex_Transcendental.thy --- a/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy Mon Mar 07 14:34:45 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Complex_Transcendental.thy Mon Mar 07 15:57:02 2016 +0000 @@ -3,7 +3,7 @@ text\By John Harrison et al. Ported from HOL Light by L C Paulson (2015)\ theory Complex_Transcendental -imports +imports Complex_Analysis_Basics Summation begin @@ -11,7 +11,7 @@ (* TODO: Figure out what to do with Möbius transformations *) definition "moebius a b c d = (\z. (a*z+b) / (c*z+d :: 'a :: field))" -lemma moebius_inverse: +lemma moebius_inverse: assumes "a * d \ b * c" "c * z + d \ 0" shows "moebius d (-b) (-c) a (moebius a b c d z) = z" proof - @@ -21,7 +21,7 @@ unfolding moebius_def by (simp add: moebius_def divide_simps) (simp add: algebra_simps)? qed -lemma moebius_inverse': +lemma moebius_inverse': assumes "a * d \ b * c" "c * z - a \ 0" shows "moebius a b c d (moebius d (-b) (-c) a z) = z" using assms moebius_inverse[of d a "-b" "-c" z] @@ -61,21 +61,16 @@ subsection\The Exponential Function is Differentiable and Continuous\ -lemma complex_differentiable_within_exp: "exp complex_differentiable (at z within s)" - using DERIV_exp complex_differentiable_at_within complex_differentiable_def by blast +lemma field_differentiable_within_exp: "exp field_differentiable (at z within s)" + using DERIV_exp field_differentiable_at_within field_differentiable_def by blast lemma continuous_within_exp: fixes z::"'a::{real_normed_field,banach}" shows "continuous (at z within s) exp" by (simp add: continuous_at_imp_continuous_within) -lemma continuous_on_exp: - fixes s::"'a::{real_normed_field,banach} set" - shows "continuous_on s exp" -by (simp add: continuous_on_exp continuous_on_id) - lemma holomorphic_on_exp [holomorphic_intros]: "exp holomorphic_on s" - by (simp add: complex_differentiable_within_exp holomorphic_on_def) + by (simp add: field_differentiable_within_exp holomorphic_on_def) subsection\Euler and de Moivre formulas.\ @@ -158,23 +153,23 @@ lemma cnj_cos: "cnj(cos z) = cos(cnj z)" by (simp add: cos_exp_eq exp_cnj field_simps) -lemma complex_differentiable_at_sin: "sin complex_differentiable at z" - using DERIV_sin complex_differentiable_def by blast - -lemma complex_differentiable_within_sin: "sin complex_differentiable (at z within s)" - by (simp add: complex_differentiable_at_sin complex_differentiable_at_within) - -lemma complex_differentiable_at_cos: "cos complex_differentiable at z" - using DERIV_cos complex_differentiable_def by blast - -lemma complex_differentiable_within_cos: "cos complex_differentiable (at z within s)" - by (simp add: complex_differentiable_at_cos complex_differentiable_at_within) +lemma field_differentiable_at_sin: "sin field_differentiable at z" + using DERIV_sin field_differentiable_def by blast + +lemma field_differentiable_within_sin: "sin field_differentiable (at z within s)" + by (simp add: field_differentiable_at_sin field_differentiable_at_within) + +lemma field_differentiable_at_cos: "cos field_differentiable at z" + using DERIV_cos field_differentiable_def by blast + +lemma field_differentiable_within_cos: "cos field_differentiable (at z within s)" + by (simp add: field_differentiable_at_cos field_differentiable_at_within) lemma holomorphic_on_sin: "sin holomorphic_on s" - by (simp add: complex_differentiable_within_sin holomorphic_on_def) + by (simp add: field_differentiable_within_sin holomorphic_on_def) lemma holomorphic_on_cos: "cos holomorphic_on s" - by (simp add: complex_differentiable_within_cos holomorphic_on_def) + by (simp add: field_differentiable_within_cos holomorphic_on_def) subsection\Get a nice real/imaginary separation in Euler's formula.\ @@ -887,13 +882,13 @@ lemma cnj_tan: "cnj(tan z) = tan(cnj z)" by (simp add: cnj_cos cnj_sin tan_def) -lemma complex_differentiable_at_tan: "~(cos z = 0) \ tan complex_differentiable at z" - unfolding complex_differentiable_def +lemma field_differentiable_at_tan: "~(cos z = 0) \ tan field_differentiable at z" + unfolding field_differentiable_def using DERIV_tan by blast -lemma complex_differentiable_within_tan: "~(cos z = 0) - \ tan complex_differentiable (at z within s)" - using complex_differentiable_at_tan complex_differentiable_at_within by blast +lemma field_differentiable_within_tan: "~(cos z = 0) + \ tan field_differentiable (at z within s)" + using field_differentiable_at_tan field_differentiable_at_within by blast lemma continuous_within_tan: "~(cos z = 0) \ continuous (at z within s) tan" using continuous_at_imp_continuous_within isCont_tan by blast @@ -902,7 +897,7 @@ by (simp add: continuous_at_imp_continuous_on) lemma holomorphic_on_tan: "(\z. z \ s \ ~(cos z = 0)) \ tan holomorphic_on s" - by (simp add: complex_differentiable_within_tan holomorphic_on_def) + by (simp add: field_differentiable_within_tan holomorphic_on_def) subsection\Complex logarithms (the conventional principal value)\ @@ -1033,28 +1028,28 @@ by (metis (no_types) Im_exp Ln_in_Reals assms complex_nonpos_Reals_iff complex_is_Real_iff exp_Ln mult_zero_right not_less pi_neq_zero sin_pi znz) then show *: "Im (Ln z) < pi" using assms Im_Ln_le_pi by (simp add: le_neq_trans znz) - show "(Ln has_field_derivative inverse(z)) (at z)" + have "(exp has_field_derivative z) (at (Ln z))" + by (metis znz DERIV_exp exp_Ln) + then show "(Ln has_field_derivative inverse(z)) (at z)" apply (rule has_complex_derivative_inverse_strong_x - [where f = exp and s = "{w. -pi < Im(w) & Im(w) < pi}"]) + [where s = "{w. -pi < Im(w) \ Im(w) < pi}"]) using znz * - apply (auto simp: continuous_on_exp open_Collect_conj open_halfspace_Im_gt open_halfspace_Im_lt) - apply (metis DERIV_exp exp_Ln) - apply (metis mpi_less_Im_Ln) + apply (auto simp: Transcendental.continuous_on_exp [OF continuous_on_id] open_Collect_conj open_halfspace_Im_gt open_halfspace_Im_lt mpi_less_Im_Ln) done qed declare has_field_derivative_Ln [derivative_intros] declare has_field_derivative_Ln [THEN DERIV_chain2, derivative_intros] -lemma complex_differentiable_at_Ln: "z \ \\<^sub>\\<^sub>0 \ Ln complex_differentiable at z" - using complex_differentiable_def has_field_derivative_Ln by blast - -lemma complex_differentiable_within_Ln: "z \ \\<^sub>\\<^sub>0 - \ Ln complex_differentiable (at z within s)" - using complex_differentiable_at_Ln complex_differentiable_within_subset by blast +lemma field_differentiable_at_Ln: "z \ \\<^sub>\\<^sub>0 \ Ln field_differentiable at z" + using field_differentiable_def has_field_derivative_Ln by blast + +lemma field_differentiable_within_Ln: "z \ \\<^sub>\\<^sub>0 + \ Ln field_differentiable (at z within s)" + using field_differentiable_at_Ln field_differentiable_within_subset by blast lemma continuous_at_Ln: "z \ \\<^sub>\\<^sub>0 \ continuous (at z) Ln" - by (simp add: complex_differentiable_imp_continuous_at complex_differentiable_within_Ln) + by (simp add: field_differentiable_imp_continuous_at field_differentiable_within_Ln) lemma isCont_Ln' [simp]: "\isCont f z; f z \ \\<^sub>\\<^sub>0\ \ isCont (\x. Ln (f x)) z" @@ -1067,7 +1062,7 @@ by (simp add: continuous_at_imp_continuous_on continuous_within_Ln) lemma holomorphic_on_Ln: "(\z. z \ s \ z \ \\<^sub>\\<^sub>0) \ Ln holomorphic_on s" - by (simp add: complex_differentiable_within_Ln holomorphic_on_def) + by (simp add: field_differentiable_within_Ln holomorphic_on_def) subsection\Quadrant-type results for Ln\ @@ -1163,11 +1158,11 @@ text\A reference to the set of positive real numbers\ lemma Im_Ln_eq_0: "z \ 0 \ (Im(Ln z) = 0 \ 0 < Re(z) \ Im(z) = 0)" -by (metis Im_complex_of_real Im_exp Ln_in_Reals Re_Ln_pos_lt Re_Ln_pos_lt_imp +by (metis Im_complex_of_real Im_exp Ln_in_Reals Re_Ln_pos_lt Re_Ln_pos_lt_imp Re_complex_of_real complex_is_Real_iff exp_Ln exp_of_real pi_gt_zero) lemma Im_Ln_eq_pi: "z \ 0 \ (Im(Ln z) = pi \ Re(z) < 0 \ Im(z) = 0)" -by (metis Im_Ln_eq_0 Im_Ln_pos_le Im_Ln_pos_lt add.left_neutral complex_eq less_eq_real_def +by (metis Im_Ln_eq_0 Im_Ln_pos_le Im_Ln_pos_lt add.left_neutral complex_eq less_eq_real_def mult_zero_right not_less_iff_gr_or_eq pi_ge_zero pi_neq_zero rcis_zero_arg rcis_zero_mod) @@ -1178,7 +1173,7 @@ apply (rule exp_complex_eqI) apply (auto simp: abs_if split: if_split_asm) using Im_Ln_less_pi Im_Ln_le_pi apply force - apply (metis complex_cnj_zero_iff diff_minus_eq_add diff_strict_mono minus_less_iff + apply (metis complex_cnj_zero_iff diff_minus_eq_add diff_strict_mono minus_less_iff mpi_less_Im_Ln mult.commute mult_2_right) by (metis exp_Ln exp_cnj) @@ -1267,7 +1262,7 @@ done also have "... = - Ln (- z) + \ * complex_of_real pi" apply (subst Ln_inverse) - using z by (auto simp add: complex_nonneg_Reals_iff) + using z by (auto simp add: complex_nonneg_Reals_iff) also have "... = - (Ln z) + \ * 2 * complex_of_real pi" apply (subst Ln_minus [OF assms]) using assms z @@ -1340,7 +1335,7 @@ have [simp]: "\x. \Im x \ 0\ \ Im (Ln (- x)) + pi = Arg x" using Arg_Ln Arg_gt_0 complex_is_Real_iff by auto consider "Re z < 0" | "Im z \ 0" using assms - using complex_nonneg_Reals_iff not_le by blast + using complex_nonneg_Reals_iff not_le by blast then have [simp]: "(\z. Im (Ln (- z)) + pi) \z\ Arg z" using "*" by (simp add: isCont_def) (metis Arg_Ln Arg_gt_0 complex_is_Real_iff) show ?thesis @@ -1375,7 +1370,7 @@ by (auto intro!: derivative_eq_intros simp: complex_nonpos_Reals_iff) moreover have "(?F has_field_derivative ?F' z) (at z)" using t r by (intro termdiffs_strong[of _ t] summable_in_conv_radius) simp_all - ultimately have "((\z. ln (1 + z) - ?F z) has_field_derivative (inverse (1 + z) - ?F' z)) + ultimately have "((\z. ln (1 + z) - ?F z) has_field_derivative (inverse (1 + z) - ?F' z)) (at z within ball 0 1)" by (intro derivative_intros) (simp_all add: at_within_open[OF z']) also have "(\n. of_nat n * ?f n * z ^ (n - Suc 0)) sums ?F' z" using t r @@ -1412,13 +1407,13 @@ also have A: "summable (\n. norm z^2 * (inverse (real_of_nat (Suc (Suc n))) * cmod z ^ n))" by (rule summable_mult, rule summable_comparison_test_ev[OF _ summable_geometric[of "norm z"]]) (auto simp: assms field_simps intro!: always_eventually) - hence "norm (\i. (-(z^2)) * inverse (of_nat (i+2)) * (-z)^i) \ + hence "norm (\i. (-(z^2)) * inverse (of_nat (i+2)) * (-z)^i) \ (\i. norm (-(z^2) * inverse (of_nat (i+2)) * (-z)^i))" by (intro summable_norm) (auto simp: norm_power norm_inverse norm_mult mult_ac simp del: of_nat_add of_nat_Suc) also have "norm ((-z)^2 * (-z)^i) * inverse (of_nat (i+2)) \ norm ((-z)^2 * (-z)^i) * 1" for i by (intro mult_left_mono) (simp_all add: divide_simps) - hence "(\i. norm (-(z^2) * inverse (of_nat (i+2)) * (-z)^i)) \ + hence "(\i. norm (-(z^2) * inverse (of_nat (i+2)) * (-z)^i)) \ (\i. norm (-(z^2) * (-z)^i))" using A assms apply (simp_all only: norm_power norm_inverse norm_divide norm_mult) apply (intro suminf_le summable_mult summable_geometric) @@ -1632,16 +1627,16 @@ apply (intro derivative_eq_intros | simp add: assms)+ done -lemma complex_differentiable_powr_right: +lemma field_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 + "w \ 0 \ (\z. w powr z) field_differentiable (at z)" +using field_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 complex_differentiable_def -by (metis (full_types) DERIV_chain' has_field_derivative_powr_right) + unfolding holomorphic_on_def field_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" @@ -1814,7 +1809,7 @@ proof (cases "z=0", simp) assume "z \ 0" then show ?thesis - by (simp add: assms cnj_Ln csqrt_exp_Ln exp_cnj) + by (simp add: assms cnj_Ln csqrt_exp_Ln exp_cnj) qed lemma has_field_derivative_csqrt: @@ -1839,17 +1834,17 @@ done qed -lemma complex_differentiable_at_csqrt: - "z \ \\<^sub>\\<^sub>0 \ csqrt complex_differentiable at z" - using complex_differentiable_def has_field_derivative_csqrt by blast - -lemma complex_differentiable_within_csqrt: - "z \ \\<^sub>\\<^sub>0 \ csqrt complex_differentiable (at z within s)" - using complex_differentiable_at_csqrt complex_differentiable_within_subset by blast +lemma field_differentiable_at_csqrt: + "z \ \\<^sub>\\<^sub>0 \ csqrt field_differentiable at z" + using field_differentiable_def has_field_derivative_csqrt by blast + +lemma field_differentiable_within_csqrt: + "z \ \\<^sub>\\<^sub>0 \ csqrt field_differentiable (at z within s)" + using field_differentiable_at_csqrt field_differentiable_within_subset by blast lemma continuous_at_csqrt: "z \ \\<^sub>\\<^sub>0 \ continuous (at z) csqrt" - by (simp add: complex_differentiable_within_csqrt complex_differentiable_imp_continuous_at) + by (simp add: field_differentiable_within_csqrt field_differentiable_imp_continuous_at) corollary isCont_csqrt' [simp]: "\isCont f z; f z \ \\<^sub>\\<^sub>0\ \ isCont (\x. csqrt (f x)) z" @@ -1857,7 +1852,7 @@ lemma continuous_within_csqrt: "z \ \\<^sub>\\<^sub>0 \ continuous (at z within s) csqrt" - by (simp add: complex_differentiable_imp_continuous_at complex_differentiable_within_csqrt) + by (simp add: field_differentiable_imp_continuous_at field_differentiable_within_csqrt) lemma continuous_on_csqrt [continuous_intros]: "(\z. z \ s \ z \ \\<^sub>\\<^sub>0) \ continuous_on s csqrt" @@ -1865,7 +1860,7 @@ lemma holomorphic_on_csqrt: "(\z. z \ s \ z \ \\<^sub>\\<^sub>0) \ csqrt holomorphic_on s" - by (simp add: complex_differentiable_within_csqrt holomorphic_on_def) + by (simp add: field_differentiable_within_csqrt holomorphic_on_def) lemma continuous_within_closed_nontrivial: "closed s \ a \ s ==> continuous (at a within s) f" @@ -1875,7 +1870,7 @@ lemma continuous_within_csqrt_posreal: "continuous (at z within (\ \ {w. 0 \ Re(w)})) csqrt" proof (cases "z \ \\<^sub>\\<^sub>0") - case True + case True then have "Im z = 0" "Re z < 0 \ z = 0" using cnj.code complex_cnj_zero_iff by (auto simp: complex_nonpos_Reals_iff) fastforce then show ?thesis @@ -2013,20 +2008,20 @@ done qed -lemma complex_differentiable_at_Arctan: "(Re z = 0 \ \Im z\ < 1) \ Arctan complex_differentiable at z" +lemma field_differentiable_at_Arctan: "(Re z = 0 \ \Im z\ < 1) \ Arctan field_differentiable at z" using has_field_derivative_Arctan - by (auto simp: complex_differentiable_def) - -lemma complex_differentiable_within_Arctan: - "(Re z = 0 \ \Im z\ < 1) \ Arctan complex_differentiable (at z within s)" - using complex_differentiable_at_Arctan complex_differentiable_at_within by blast + by (auto simp: field_differentiable_def) + +lemma field_differentiable_within_Arctan: + "(Re z = 0 \ \Im z\ < 1) \ Arctan field_differentiable (at z within s)" + using field_differentiable_at_Arctan field_differentiable_at_within by blast declare has_field_derivative_Arctan [derivative_intros] declare has_field_derivative_Arctan [THEN DERIV_chain2, derivative_intros] lemma continuous_at_Arctan: "(Re z = 0 \ \Im z\ < 1) \ continuous (at z) Arctan" - by (simp add: complex_differentiable_imp_continuous_at complex_differentiable_within_Arctan) + by (simp add: field_differentiable_imp_continuous_at field_differentiable_within_Arctan) lemma continuous_within_Arctan: "(Re z = 0 \ \Im z\ < 1) \ continuous (at z within s) Arctan" @@ -2038,7 +2033,7 @@ lemma holomorphic_on_Arctan: "(\z. z \ s \ Re z = 0 \ \Im z\ < 1) \ Arctan holomorphic_on s" - by (simp add: complex_differentiable_within_Arctan holomorphic_on_def) + by (simp add: field_differentiable_within_Arctan holomorphic_on_def) lemma Arctan_series: assumes z: "norm (z :: complex) < 1" @@ -2051,20 +2046,20 @@ have summable: "summable (\n. g n * u^n)" if "norm u < 1" for u proof (cases "u = 0") assume u: "u \ 0" - have "(\n. ereal (norm (h u n) / norm (h u (Suc n)))) = (\n. ereal (inverse (norm u)^2) * + have "(\n. ereal (norm (h u n) / norm (h u (Suc n)))) = (\n. ereal (inverse (norm u)^2) * ereal ((2 + inverse (real (Suc n))) / (2 - inverse (real (Suc n)))))" proof fix n - have "ereal (norm (h u n) / norm (h u (Suc n))) = - ereal (inverse (norm u)^2) * ereal ((of_nat (2*Suc n+1) / of_nat (Suc n)) / + have "ereal (norm (h u n) / norm (h u (Suc n))) = + ereal (inverse (norm u)^2) * ereal ((of_nat (2*Suc n+1) / of_nat (Suc n)) / (of_nat (2*Suc n-1) / of_nat (Suc n)))" - by (simp add: h_def norm_mult norm_power norm_divide divide_simps + by (simp add: h_def norm_mult norm_power norm_divide divide_simps power2_eq_square eval_nat_numeral del: of_nat_add of_nat_Suc) also have "of_nat (2*Suc n+1) / of_nat (Suc n) = (2::real) + inverse (real (Suc n))" by (auto simp: divide_simps simp del: of_nat_Suc) simp_all? also have "of_nat (2*Suc n-1) / of_nat (Suc n) = (2::real) - inverse (real (Suc n))" - by (auto simp: divide_simps simp del: of_nat_Suc) simp_all? - finally show "ereal (norm (h u n) / norm (h u (Suc n))) = ereal (inverse (norm u)^2) * + by (auto simp: divide_simps simp del: of_nat_Suc) simp_all? + finally show "ereal (norm (h u n) / norm (h u (Suc n))) = ereal (inverse (norm u)^2) * ereal ((2 + inverse (real (Suc n))) / (2 - inverse (real (Suc n))))" . qed also have "\ \ ereal (inverse (norm u)^2) * ereal ((2 + 0) / (2 - 0))" @@ -2076,7 +2071,7 @@ ultimately have A: "liminf (\n. ereal (cmod (h u n) / cmod (h u (Suc n)))) > 1" by simp from u have "summable (h u)" by (intro summable_norm_cancel[OF ratio_test_convergence[OF _ A]]) - (auto simp: h_def norm_divide norm_mult norm_power simp del: of_nat_Suc + (auto simp: h_def norm_divide norm_mult norm_power simp del: of_nat_Suc intro!: mult_pos_pos divide_pos_pos always_eventually) thus "summable (\n. g n * u^n)" by (subst summable_mono_reindex[of "\n. 2*n+1", symmetric]) @@ -2095,10 +2090,10 @@ also have "(\n. diffs g n * u^n) = (\n. if even n then (\*u)^n else 0)" by (intro ext) (simp_all del: of_nat_Suc add: g_def diffs_def power_mult_distrib) also have "suminf \ = (\n. (-(u^2))^n)" - by (subst suminf_mono_reindex[of "\n. 2*n", symmetric]) + by (subst suminf_mono_reindex[of "\n. 2*n", symmetric]) (auto elim!: evenE simp: subseq_def power_mult power_mult_distrib) also from u have "norm u^2 < 1^2" by (intro power_strict_mono) simp_all - hence "(\n. (-(u^2))^n) = inverse (1 + u^2)" + hence "(\n. (-(u^2))^n) = inverse (1 + u^2)" by (subst suminf_geometric) (simp_all add: norm_power inverse_eq_divide) finally have "(G has_field_derivative inverse (1 + u\<^sup>2)) (at u)" . from DERIV_diff[OF has_field_derivative_Arctan this] Im_u u @@ -2126,12 +2121,12 @@ hence "norm (\ * y) < 1" unfolding y_def by (subst norm_mult) simp hence "(\n. (-2*\) * ((-1)^n / of_nat (2*n+1) * (\*y)^(2*n+1))) sums ((-2*\) * Arctan (\*y))" by (intro Arctan_series sums_mult) simp_all - also have "(\n. (-2*\) * ((-1)^n / of_nat (2*n+1) * (\*y)^(2*n+1))) = + also have "(\n. (-2*\) * ((-1)^n / of_nat (2*n+1) * (\*y)^(2*n+1))) = (\n. (-2*\) * ((-1)^n * (\*y*(-y\<^sup>2)^n)/of_nat (2*n+1)))" by (intro ext) (simp_all add: power_mult power_mult_distrib) also have "\ = (\n. 2*y* ((-1) * (-y\<^sup>2))^n/of_nat (2*n+1))" by (intro ext, subst power_mult_distrib) (simp add: algebra_simps power_mult) - also have "\ = (\n. 2*y^(2*n+1) / of_nat (2*n+1))" + also have "\ = (\n. 2*y^(2*n+1) / of_nat (2*n+1))" by (subst power_add, subst power_mult) (simp add: mult_ac) also have "\ = (\n. of_real (2*((x-1)/(x+1))^(2*n+1) / of_nat (2*n+1)))" by (intro ext) (simp add: y_def) @@ -2261,7 +2256,7 @@ { fix w::complex and z::complex assume *: "w \ \" "z \ \" have "cmod (Arctan w - Arctan z) \ 1 * cmod (w-z)" - apply (rule complex_differentiable_bound [OF convex_Reals, of Arctan _ 1]) + apply (rule field_differentiable_bound [OF convex_Reals, of Arctan _ 1]) apply (rule has_field_derivative_at_within [OF has_field_derivative_Arctan]) apply (force simp add: Reals_def) apply (simp add: norm_divide divide_simps in_Reals_norm complex_is_Real_iff power2_eq_square) @@ -2303,7 +2298,7 @@ lemma one_minus_z2_notin_nonpos_Reals: assumes "(Im z = 0 \ \Re z\ < 1)" shows "1 - z\<^sup>2 \ \\<^sub>\\<^sub>0" - using assms + using assms apply (auto simp: complex_nonpos_Reals_iff Re_power2 Im_power2) using power2_less_0 [of "Im z"] apply force using abs_square_less_1 not_le by blast @@ -2441,13 +2436,13 @@ declare has_field_derivative_Arcsin [derivative_intros] declare has_field_derivative_Arcsin [THEN DERIV_chain2, derivative_intros] -lemma complex_differentiable_at_Arcsin: - "(Im z = 0 \ \Re z\ < 1) \ Arcsin complex_differentiable at z" - using complex_differentiable_def has_field_derivative_Arcsin by blast - -lemma complex_differentiable_within_Arcsin: - "(Im z = 0 \ \Re z\ < 1) \ Arcsin complex_differentiable (at z within s)" - using complex_differentiable_at_Arcsin complex_differentiable_within_subset by blast +lemma field_differentiable_at_Arcsin: + "(Im z = 0 \ \Re z\ < 1) \ Arcsin field_differentiable at z" + using field_differentiable_def has_field_derivative_Arcsin by blast + +lemma field_differentiable_within_Arcsin: + "(Im z = 0 \ \Re z\ < 1) \ Arcsin field_differentiable (at z within s)" + using field_differentiable_at_Arcsin field_differentiable_within_subset by blast lemma continuous_within_Arcsin: "(Im z = 0 \ \Re z\ < 1) \ continuous (at z within s) Arcsin" @@ -2458,7 +2453,7 @@ by (simp add: continuous_at_imp_continuous_on) lemma holomorphic_on_Arcsin: "(\z. z \ s \ Im z = 0 \ \Re z\ < 1) \ Arcsin holomorphic_on s" - by (simp add: complex_differentiable_within_Arcsin holomorphic_on_def) + by (simp add: field_differentiable_within_Arcsin holomorphic_on_def) subsection\Inverse Cosine\ @@ -2483,7 +2478,7 @@ text\A very tricky argument to find!\ lemma isCont_Arccos_lemma: - assumes eq0: "Im (z + \ * csqrt (1 - z\<^sup>2)) = 0" and "(Im z = 0 \ \Re z\ < 1)" + assumes eq0: "Im (z + \ * csqrt (1 - z\<^sup>2)) = 0" and "(Im z = 0 \ \Re z\ < 1)" shows False proof (cases "Im z = 0") case True @@ -2608,13 +2603,13 @@ declare has_field_derivative_Arcsin [derivative_intros] declare has_field_derivative_Arcsin [THEN DERIV_chain2, derivative_intros] -lemma complex_differentiable_at_Arccos: - "(Im z = 0 \ \Re z\ < 1) \ Arccos complex_differentiable at z" - using complex_differentiable_def has_field_derivative_Arccos by blast - -lemma complex_differentiable_within_Arccos: - "(Im z = 0 \ \Re z\ < 1) \ Arccos complex_differentiable (at z within s)" - using complex_differentiable_at_Arccos complex_differentiable_within_subset by blast +lemma field_differentiable_at_Arccos: + "(Im z = 0 \ \Re z\ < 1) \ Arccos field_differentiable at z" + using field_differentiable_def has_field_derivative_Arccos by blast + +lemma field_differentiable_within_Arccos: + "(Im z = 0 \ \Re z\ < 1) \ Arccos field_differentiable (at z within s)" + using field_differentiable_at_Arccos field_differentiable_within_subset by blast lemma continuous_within_Arccos: "(Im z = 0 \ \Re z\ < 1) \ continuous (at z within s) Arccos" @@ -2625,7 +2620,7 @@ by (simp add: continuous_at_imp_continuous_on) lemma holomorphic_on_Arccos: "(\z. z \ s \ Im z = 0 \ \Re z\ < 1) \ Arccos holomorphic_on s" - by (simp add: complex_differentiable_within_Arccos holomorphic_on_def) + by (simp add: field_differentiable_within_Arccos holomorphic_on_def) subsection\Upper and Lower Bounds for Inverse Sine and Cosine\ diff -r bc25f3916a99 -r 6855b348e828 src/HOL/Multivariate_Analysis/Conformal_Mappings.thy --- a/src/HOL/Multivariate_Analysis/Conformal_Mappings.thy Mon Mar 07 14:34:45 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Conformal_Mappings.thy Mon Mar 07 15:57:02 2016 +0000 @@ -671,7 +671,7 @@ by (auto intro: holomorphic_factor_order_of_zero [OF assms]) have con: "continuous_on (ball \ r) (\z. deriv g z / g z)" by (rule continuous_intros) (auto simp: gne holg holomorphic_deriv holomorphic_on_imp_continuous_on) - have cd: "\x. dist \ x < r \ (\z. deriv g z / g z) complex_differentiable at x" + have cd: "\x. dist \ x < r \ (\z. deriv g z / g z) field_differentiable at x" apply (rule derivative_intros)+ using holg mem_ball apply (blast intro: holomorphic_deriv holomorphic_on_imp_differentiable_at) apply (metis Topology_Euclidean_Space.open_ball at_within_open holg holomorphic_on_def mem_ball) @@ -687,7 +687,7 @@ by (auto intro!: continuous_intros simp add: holg holomorphic_on_imp_continuous_on gne) have 0: "dist \ x < r \ ((\x. exp (h x) / g x) has_field_derivative 0) (at x)" for x apply (rule h derivative_eq_intros | simp)+ - apply (rule DERIV_deriv_iff_complex_differentiable [THEN iffD2]) + apply (rule DERIV_deriv_iff_field_differentiable [THEN iffD2]) using holg apply (auto simp: holomorphic_on_imp_differentiable_at gne h) done obtain c where c: "\x. x \ ball \ r \ exp (h x) / g x = c" @@ -852,15 +852,15 @@ have holh: "h holomorphic_on S" proof (simp add: holomorphic_on_def, clarify) fix z assume "z \ S" - show "h complex_differentiable at z within S" + show "h field_differentiable at z within S" proof (cases "z = \") case True then show ?thesis - using complex_differentiable_at_within complex_differentiable_def h0 by blast + using field_differentiable_at_within field_differentiable_def h0 by blast next case False - then have "f complex_differentiable at z within S" + then have "f field_differentiable at z within S" using holomorphic_onD [OF holf, of z] \z \ S\ - unfolding complex_differentiable_def DERIV_within_iff + unfolding field_differentiable_def DERIV_within_iff by (force intro: exI [where x="dist \ z"] elim: Lim_transform_within_set [unfolded eventually_at]) then show ?thesis by (simp add: h_def power2_eq_square derivative_intros) @@ -1131,7 +1131,7 @@ apply (rule has_derivative_locally_injective [OF S, where f=f and f' = "\z h. deriv f z * h" and g' = g']) using g' * apply (simp_all add: linear_conv_bounded_linear that) - using DERIV_deriv_iff_complex_differentiable has_field_derivative_imp_has_derivative holf + using DERIV_deriv_iff_field_differentiable has_field_derivative_imp_has_derivative holf holomorphic_on_imp_differentiable_at \open S\ apply blast done qed @@ -1204,7 +1204,7 @@ using holg by (simp add: holomorphic_on_subset subset_ball) have gd: "\w. dist \ w < \ \ (g has_field_derivative deriv g w) (at w)" using holg - by (simp add: DERIV_deriv_iff_complex_differentiable holomorphic_on_def at_within_open_NO_MATCH) + by (simp add: DERIV_deriv_iff_field_differentiable holomorphic_on_def at_within_open_NO_MATCH) have *: "\w. w \ ball \ (min r \) \ ((\w. (w - \) * g w) has_field_derivative ((w - \) * deriv g w + g w)) (at w)" @@ -1266,7 +1266,7 @@ have *: "(the_inv_into S f has_field_derivative inverse (deriv f z)) (at (f z))" if "z \ S" for z proof - have 1: "(f has_field_derivative deriv f z) (at z)" - using DERIV_deriv_iff_complex_differentiable \z \ S\ \open S\ holf holomorphic_on_imp_differentiable_at + using DERIV_deriv_iff_field_differentiable \z \ S\ \open S\ holf holomorphic_on_imp_differentiable_at by blast have 2: "deriv f z \ 0" using \z \ S\ \open S\ holf holomorphic_injective_imp_regular injf by blast @@ -1524,7 +1524,7 @@ have 3: "contour_integral (reversepath (linepath b' a')) f = - contour_integral (linepath b' a') f" by (rule contour_integral_reversepath [OF valid_path_linepath]) - have fcd_le: "f complex_differentiable at x" + have fcd_le: "f field_differentiable at x" if "x \ interior S \ x \ interior {x. d \ x \ k}" for x proof - have "f holomorphic_on S \ {c. d \ c < k}" @@ -1532,7 +1532,7 @@ then have "\C D. x \ interior C \ interior D \ f holomorphic_on interior C \ interior D" using that by (metis Collect_mem_eq Int_Collect \d \ 0\ interior_halfspace_le interior_open \open S\) - then show "f complex_differentiable at x" + then show "f field_differentiable at x" by (metis at_within_interior holomorphic_on_def interior_Int interior_interior) qed have ab_le: "\x. x \ closed_segment a b \ d \ x \ k" @@ -1557,7 +1557,7 @@ contour_integral (linepath a' b') f + contour_integral (linepath b' a) f = 0" by (rule has_chain_integral_chain_integral4) - have fcd_ge: "f complex_differentiable at x" + have fcd_ge: "f field_differentiable at x" if "x \ interior S \ x \ interior {x. k \ d \ x}" for x proof - have f2: "f holomorphic_on S \ {c. k < d \ c}" @@ -1566,7 +1566,7 @@ by (simp add: interior_open \open S\) then have "x \ S \ interior {c. k \ d \ c}" using that by simp - then show "f complex_differentiable at x" + then show "f field_differentiable at x" using f3 f2 unfolding holomorphic_on_def by (metis (no_types) \d \ 0\ at_within_interior interior_Int interior_halfspace_ge interior_interior) qed @@ -1688,10 +1688,10 @@ apply (intro continuous_intros continuous_on_compose continuous_on_subset [OF contf]) using cnjs apply auto done - have "cnj \ f \ cnj complex_differentiable at x within S \ {z. Im z < 0}" - if "x \ S" "Im x < 0" "f complex_differentiable at (cnj x) within S \ {z. 0 < Im z}" for x + have "cnj \ f \ cnj field_differentiable at x within S \ {z. Im z < 0}" + if "x \ S" "Im x < 0" "f field_differentiable at (cnj x) within S \ {z. 0 < Im z}" for x using that - apply (simp add: complex_differentiable_def Derivative.DERIV_within_iff Lim_within dist_norm, clarify) + apply (simp add: field_differentiable_def Derivative.DERIV_within_iff Lim_within dist_norm, clarify) apply (rule_tac x="cnj f'" in exI) apply (elim all_forward ex_forward conj_forward imp_forward asm_rl, clarify) apply (drule_tac x="cnj xa" in bspec) @@ -1902,11 +1902,11 @@ 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" + then have [simp]: "\x. norm x < r \ (\z. f (a + z)) field_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)" + have [simp]: "\z. norm z < r \ f field_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" + then have [simp]: "f field_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) @@ -1920,7 +1920,7 @@ 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)+ + apply (force simp: fz \0 < r\ dist_norm complex_derivative_chain field_differentiable_compose)+ done qed @@ -2026,7 +2026,7 @@ 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" + have dfa: "f field_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))" @@ -2045,7 +2045,7 @@ 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 DERIV_chain [OF field_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)+ @@ -2055,10 +2055,10 @@ 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 (subst deriv_cdivide_right) + apply (simp add: field_differentiable_def fo) apply (rule exI) - apply (rule DERIV_chain [OF complex_differentiable_derivI]) + apply (rule DERIV_chain [OF field_differentiable_derivI]) apply (simp add: dfa) apply (rule derivative_eq_intros | simp add: C_def False fo)+ using \0 < r\ diff -r bc25f3916a99 -r 6855b348e828 src/HOL/Multivariate_Analysis/Gamma.thy --- a/src/HOL/Multivariate_Analysis/Gamma.thy Mon Mar 07 14:34:45 2016 +0000 +++ b/src/HOL/Multivariate_Analysis/Gamma.thy Mon Mar 07 15:57:02 2016 +0000 @@ -1355,21 +1355,21 @@ "z \ \ \ Gamma z \ (\ :: complex set)" and rGamma_complex_real: "z \ \ \ rGamma z \ \" by (simp_all add: Reals_cnj_iff cnj_Gamma cnj_rGamma) -lemma complex_differentiable_rGamma: "rGamma complex_differentiable (at z within A)" - using has_field_derivative_rGamma[of z] unfolding complex_differentiable_def by blast +lemma field_differentiable_rGamma: "rGamma field_differentiable (at z within A)" + using has_field_derivative_rGamma[of z] unfolding field_differentiable_def by blast lemma holomorphic_on_rGamma: "rGamma holomorphic_on A" - unfolding holomorphic_on_def by (auto intro!: complex_differentiable_rGamma) + unfolding holomorphic_on_def by (auto intro!: field_differentiable_rGamma) lemma analytic_on_rGamma: "rGamma analytic_on A" unfolding analytic_on_def by (auto intro!: exI[of _ 1] holomorphic_on_rGamma) -lemma complex_differentiable_Gamma: "z \ \\<^sub>\\<^sub>0 \ Gamma complex_differentiable (at z within A)" - using has_field_derivative_Gamma[of z] unfolding complex_differentiable_def by auto +lemma field_differentiable_Gamma: "z \ \\<^sub>\\<^sub>0 \ Gamma field_differentiable (at z within A)" + using has_field_derivative_Gamma[of z] unfolding field_differentiable_def by auto lemma holomorphic_on_Gamma: "A \ \\<^sub>\\<^sub>0 = {} \ Gamma holomorphic_on A" - unfolding holomorphic_on_def by (auto intro!: complex_differentiable_Gamma) + unfolding holomorphic_on_def by (auto intro!: field_differentiable_Gamma) lemma analytic_on_Gamma: "A \ \\<^sub>\\<^sub>0 = {} \ Gamma analytic_on A" by (rule analytic_on_subset[of _ "UNIV - \\<^sub>\\<^sub>0"], subst analytic_on_open) @@ -1383,14 +1383,14 @@ declare has_field_derivative_rGamma_complex'[THEN DERIV_chain2, derivative_intros] -lemma complex_differentiable_Polygamma: +lemma field_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 + "z \ \\<^sub>\\<^sub>0 \ Polygamma n field_differentiable (at z within A)" + using has_field_derivative_Polygamma[of z n] unfolding field_differentiable_def by auto lemma holomorphic_on_Polygamma: "A \ \\<^sub>\\<^sub>0 = {} \ Polygamma n holomorphic_on A" - unfolding holomorphic_on_def by (auto intro!: complex_differentiable_Polygamma) + unfolding holomorphic_on_def by (auto intro!: field_differentiable_Polygamma) lemma analytic_on_Polygamma: "A \ \\<^sub>\\<^sub>0 = {} \ Polygamma n analytic_on A" by (rule analytic_on_subset[of _ "UNIV - \\<^sub>\\<^sub>0"], subst analytic_on_open)