# HG changeset patch # User immler # Date 1499157385 -3600 # Node ID b73f94b366b7c4e79fce5abd441aaa214fed3ec5 # Parent cd935b7cb3fb2eea6bb1005f54e8629cb9c95a58 some generalizations complex=>real_normed_field diff -r cd935b7cb3fb -r b73f94b366b7 src/HOL/Analysis/Complex_Analysis_Basics.thy --- a/src/HOL/Analysis/Complex_Analysis_Basics.thy Sun Jul 02 20:13:38 2017 +0200 +++ b/src/HOL/Analysis/Complex_Analysis_Basics.thy Tue Jul 04 09:36:25 2017 +0100 @@ -23,10 +23,11 @@ "(f has_derivative f') F \ ((\x. of_real (f x)) has_derivative (\x. of_real (f' x))) F" using bounded_linear.has_derivative[OF bounded_linear_of_real] . -lemma has_vector_derivative_real_complex: +lemma has_vector_derivative_real_field: "DERIV f (of_real a) :> f' \ ((\x. f (of_real x)) has_vector_derivative f') (at a within s)" using has_derivative_compose[of of_real of_real a _ f "op * f'"] by (simp add: scaleR_conv_of_real ac_simps has_vector_derivative_def has_field_derivative_def) +lemmas has_vector_derivative_real_complex = has_vector_derivative_real_field lemma fact_cancel: fixes c :: "'a::real_field" @@ -124,15 +125,9 @@ using has_derivative_zero_connected_constant [OF assms(1-4)] assms by (metis DERIV_const has_derivative_const Diff_iff at_within_open frechet_derivative_at has_field_derivative_def) -lemma DERIV_zero_constant: - fixes f :: "'a::{real_normed_field, real_inner} \ 'a" - shows "\convex s; - \x. x\s \ (f has_field_derivative 0) (at x within s)\ - \ \c. \x \ s. f(x) = c" - by (auto simp: has_field_derivative_def lambda_zero intro: has_derivative_zero_constant) +lemmas DERIV_zero_constant = has_field_derivative_zero_constant lemma DERIV_zero_unique: - fixes f :: "'a::{real_normed_field, real_inner} \ 'a" assumes "convex s" and d0: "\x. x\s \ (f has_field_derivative 0) (at x within s)" and "a \ s" @@ -142,7 +137,6 @@ (metis d0 has_field_derivative_imp_has_derivative lambda_zero) lemma DERIV_zero_connected_unique: - fixes f :: "'a::{real_normed_field, real_inner} \ 'a" assumes "connected s" and "open s" and d0: "\x. x\s \ DERIV f x :> 0" @@ -177,9 +171,8 @@ (*generalising DERIV_isconst_all, which requires type real (using the ordering)*) lemma DERIV_zero_UNIV_unique: - fixes f :: "'a::{real_normed_field, real_inner} \ 'a" - shows "(\x. DERIV f x :> 0) \ f x = f a" -by (metis DERIV_zero_unique UNIV_I convex_UNIV) + "(\x. DERIV f x :> 0) \ f x = f a" + by (metis DERIV_zero_unique UNIV_I convex_UNIV) subsection \Some limit theorems about real part of real series etc.\ @@ -854,7 +847,7 @@ lemma field_differentiable_series: - fixes f :: "nat \ complex \ complex" + fixes f :: "nat \ 'a::{real_normed_field,banach} \ 'a" 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 complex \ complex" + fixes f :: "nat \ 'a::{real_normed_field,banach} \ 'a" 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. \iBound theorem\ lemma field_differentiable_bound: - fixes s :: "complex set" + fixes s :: "'a::real_normed_field set" assumes cvs: "convex s" and df: "\z. z \ s \ (f has_field_derivative f' z) (at z within s)" and dn: "\z. z \ s \ norm (f' z) \ B" @@ -905,8 +898,7 @@ subsection\Inverse function theorem for complex derivatives\ -lemma has_complex_derivative_inverse_basic: - fixes f :: "complex \ complex" +lemma has_field_derivative_inverse_basic: shows "DERIV f (g y) :> f' \ f' \ 0 \ continuous (at y) g \ @@ -919,8 +911,10 @@ apply (auto simp: bounded_linear_mult_right) done -lemma has_complex_derivative_inverse_strong: - fixes f :: "complex \ complex" +lemmas has_complex_derivative_inverse_basic = has_field_derivative_inverse_basic + +lemma has_field_derivative_inverse_strong: + fixes f :: "'a::{euclidean_space,real_normed_field} \ 'a" shows "DERIV f x :> f' \ f' \ 0 \ open s \ @@ -931,9 +925,10 @@ unfolding has_field_derivative_def apply (rule has_derivative_inverse_strong [of s x f g ]) by auto +lemmas has_complex_derivative_inverse_strong = has_field_derivative_inverse_strong -lemma has_complex_derivative_inverse_strong_x: - fixes f :: "complex \ complex" +lemma has_field_derivative_inverse_strong_x: + fixes f :: "'a::{euclidean_space,real_normed_field} \ 'a" shows "DERIV f (g y) :> f' \ f' \ 0 \ open s \ @@ -944,6 +939,7 @@ unfolding has_field_derivative_def apply (rule has_derivative_inverse_strong_x [of s g y f]) by auto +lemmas has_complex_derivative_inverse_strong_x = has_field_derivative_inverse_strong_x subsection \Taylor on Complex Numbers\ @@ -952,14 +948,14 @@ shows "sum f {0..n} = f 0 - f (Suc n) + sum (\i. f (Suc i)) {0..n}" by (induct n) auto -lemma complex_taylor: +lemma field_taylor: assumes s: "convex s" and f: "\i x. x \ s \ i \ n \ (f i has_field_derivative f (Suc i) x) (at x within s)" - and B: "\x. x \ s \ cmod (f (Suc n) x) \ B" + and B: "\x. x \ s \ norm (f (Suc n) x) \ B" and w: "w \ s" and z: "z \ s" - shows "cmod(f 0 z - (\i\n. f i w * (z-w) ^ i / (fact i))) - \ B * cmod(z - w)^(Suc n) / fact n" + shows "norm(f 0 z - (\i\n. f i w * (z-w) ^ i / (fact i))) + \ B * norm(z - w)^(Suc n) / fact n" proof - have wzs: "closed_segment w z \ s" using assms by (metis convex_contains_segment) @@ -1018,34 +1014,45 @@ assume u: "u \ closed_segment w z" then have us: "u \ s" by (metis wzs subsetD) - have "cmod (f (Suc n) u) * cmod (z - u) ^ n \ cmod (f (Suc n) u) * cmod (u - z) ^ n" + have "norm (f (Suc n) u) * norm (z - u) ^ n \ norm (f (Suc n) u) * norm (u - z) ^ n" by (metis norm_minus_commute order_refl) - also have "... \ cmod (f (Suc n) u) * cmod (z - w) ^ n" + also have "... \ norm (f (Suc n) u) * norm (z - w) ^ n" by (metis mult_left_mono norm_ge_zero power_mono segment_bound [OF u]) - also have "... \ B * cmod (z - w) ^ n" + also have "... \ B * norm (z - w) ^ n" by (metis norm_ge_zero zero_le_power mult_right_mono B [OF us]) - finally have "cmod (f (Suc n) u) * cmod (z - u) ^ n \ B * cmod (z - w) ^ n" . + finally have "norm (f (Suc n) u) * norm (z - u) ^ n \ B * norm (z - w) ^ n" . } note cmod_bound = this have "(\i\n. f i z * (z - z) ^ i / (fact i)) = (\i\n. (f i z / (fact i)) * 0 ^ i)" by simp also have "\ = f 0 z / (fact 0)" by (subst sum_zero_power) simp - finally have "cmod (f 0 z - (\i\n. f i w * (z - w) ^ i / (fact i))) - \ cmod ((\i\n. f i w * (z - w) ^ i / (fact i)) - + finally have "norm (f 0 z - (\i\n. f i w * (z - w) ^ i / (fact i))) + \ norm ((\i\n. f i w * (z - w) ^ i / (fact i)) - (\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)" + also have "... \ B * norm (z - w) ^ n / (fact n) * norm (w - z)" 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] norm_divide norm_mult norm_power divide_le_cancel cmod_bound) done - also have "... \ B * cmod (z - w) ^ Suc n / (fact n)" + also have "... \ B * norm (z - w) ^ Suc n / (fact n)" by (simp add: algebra_simps norm_minus_commute) finally show ?thesis . qed +lemma complex_taylor: + assumes s: "convex s" + and f: "\i x. x \ s \ i \ n \ (f i has_field_derivative f (Suc i) x) (at x within s)" + and B: "\x. x \ s \ cmod (f (Suc n) x) \ B" + and w: "w \ s" + and z: "z \ s" + shows "cmod(f 0 z - (\i\n. f i w * (z-w) ^ i / (fact i))) + \ B * cmod(z - w)^(Suc n) / fact n" + using assms by (rule field_taylor) + + text\Something more like the traditional MVT for real components\ lemma complex_mvt_line: diff -r cd935b7cb3fb -r b73f94b366b7 src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Sun Jul 02 20:13:38 2017 +0200 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Tue Jul 04 09:36:25 2017 +0100 @@ -582,6 +582,35 @@ declare power_Suc [simp del] +lemma Taylor_exp_field: + fixes z::"'a::{banach,real_normed_field}" + shows "norm (exp z - (\i\n. z ^ i / fact i)) \ exp (norm z) * (norm z ^ Suc n) / fact n" +proof (rule field_taylor[of _ n "\k. exp" "exp (norm z)" 0 z, simplified]) + show "convex (closed_segment 0 z)" + by (rule convex_closed_segment [of 0 z]) +next + fix k x + assume "x \ closed_segment 0 z" "k \ n" + show "(exp has_field_derivative exp x) (at x within closed_segment 0 z)" + using DERIV_exp DERIV_subset by blast +next + fix x + assume x: "x \ closed_segment 0 z" + have "norm (exp x) \ exp (norm x)" + by (rule norm_exp) + also have "norm x \ norm z" + using x by (auto simp: closed_segment_def intro!: mult_left_le_one_le) + finally show "norm (exp x) \ exp (norm z)" + by simp +next + show "0 \ closed_segment 0 z" + by (auto simp: closed_segment_def) +next + show "z \ closed_segment 0 z" + apply (simp add: closed_segment_def scaleR_conv_of_real) + using of_real_1 zero_le_one by blast +qed + lemma Taylor_exp: "norm(exp z - (\k\n. z ^ k / (fact k))) \ exp\Re z\ * (norm z) ^ (Suc n) / (fact n)" proof (rule complex_taylor [of _ n "\k. exp" "exp\Re z\" 0 z, simplified])