src/HOL/Multivariate_Analysis/Complex_Analysis_Basics.thy
changeset 56381 0556204bc230
parent 56371 fb9ae0727548
child 56409 36489d77c484
equal deleted inserted replaced
56380:9bb2856cc845 56381:0556204bc230
    13 lemma has_derivative_mult_right:
    13 lemma has_derivative_mult_right:
    14   fixes c:: "'a :: real_normed_algebra"
    14   fixes c:: "'a :: real_normed_algebra"
    15   shows "((op * c) has_derivative (op * c)) F"
    15   shows "((op * c) has_derivative (op * c)) F"
    16 by (rule has_derivative_mult_right [OF has_derivative_id])
    16 by (rule has_derivative_mult_right [OF has_derivative_id])
    17 
    17 
    18 lemma has_derivative_of_real[has_derivative_intros, simp]: 
    18 lemma has_derivative_of_real[derivative_intros, simp]: 
    19   "(f has_derivative f') F \<Longrightarrow> ((\<lambda>x. of_real (f x)) has_derivative (\<lambda>x. of_real (f' x))) F"
    19   "(f has_derivative f') F \<Longrightarrow> ((\<lambda>x. of_real (f x)) has_derivative (\<lambda>x. of_real (f' x))) F"
    20   using bounded_linear.has_derivative[OF bounded_linear_of_real] .
    20   using bounded_linear.has_derivative[OF bounded_linear_of_real] .
    21 
    21 
    22 lemma has_vector_derivative_real_complex:
    22 lemma has_vector_derivative_real_complex:
    23   "DERIV f (of_real a) :> f' \<Longrightarrow> ((\<lambda>x. f (of_real x)) has_vector_derivative f') (at a)"
    23   "DERIV f (of_real a) :> f' \<Longrightarrow> ((\<lambda>x. f (of_real x)) has_vector_derivative f') (at a)"
   197   assumes "DERIV f a :> f'"
   197   assumes "DERIV f a :> f'"
   198       and "0 < d"
   198       and "0 < d"
   199       and "\<And>x. dist x a < d \<Longrightarrow> f x = g x"
   199       and "\<And>x. dist x a < d \<Longrightarrow> f x = g x"
   200     shows "DERIV g a :> f'"
   200     shows "DERIV g a :> f'"
   201   by (blast intro: assms DERIV_transform_within)
   201   by (blast intro: assms DERIV_transform_within)
   202 
       
   203 subsection{*Further useful properties of complex conjugation*}
       
   204 
       
   205 lemma continuous_within_cnj: "continuous (at z within s) cnj"
       
   206 by (metis bounded_linear_cnj linear_continuous_within)
       
   207 
       
   208 lemma continuous_on_cnj: "continuous_on s cnj"
       
   209 by (metis bounded_linear_cnj linear_continuous_on)
       
   210 
   202 
   211 subsection {*Some limit theorems about real part of real series etc.*}
   203 subsection {*Some limit theorems about real part of real series etc.*}
   212 
   204 
   213 (*MOVE? But not to Finite_Cartesian_Product*)
   205 (*MOVE? But not to Finite_Cartesian_Product*)
   214 lemma sums_vec_nth :
   206 lemma sums_vec_nth :
   519 
   511 
   520 lemma complex_derivative_add:
   512 lemma complex_derivative_add:
   521   "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
   513   "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
   522    \<Longrightarrow> deriv (\<lambda>w. f w + g w) z = deriv f z + deriv g z"
   514    \<Longrightarrow> deriv (\<lambda>w. f w + g w) z = deriv f z + deriv g z"
   523   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   515   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   524   by (auto intro!: DERIV_imp_deriv DERIV_intros)
   516   by (auto intro!: DERIV_imp_deriv derivative_intros)
   525 
   517 
   526 lemma complex_derivative_diff:
   518 lemma complex_derivative_diff:
   527   "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
   519   "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
   528    \<Longrightarrow> deriv (\<lambda>w. f w - g w) z = deriv f z - deriv g z"
   520    \<Longrightarrow> deriv (\<lambda>w. f w - g w) z = deriv f z - deriv g z"
   529   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   521   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   530   by (auto intro!: DERIV_imp_deriv DERIV_intros)
   522   by (auto intro!: DERIV_imp_deriv derivative_intros)
   531 
   523 
   532 lemma complex_derivative_mult:
   524 lemma complex_derivative_mult:
   533   "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
   525   "\<lbrakk>f complex_differentiable at z; g complex_differentiable at z\<rbrakk>  
   534    \<Longrightarrow> deriv (\<lambda>w. f w * g w) z = f z * deriv g z + deriv f z * g z"
   526    \<Longrightarrow> deriv (\<lambda>w. f w * g w) z = f z * deriv g z + deriv f z * g z"
   535   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   527   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   536   by (auto intro!: DERIV_imp_deriv DERIV_intros)
   528   by (auto intro!: DERIV_imp_deriv derivative_eq_intros)
   537 
   529 
   538 lemma complex_derivative_cmult:
   530 lemma complex_derivative_cmult:
   539   "f complex_differentiable at z \<Longrightarrow> deriv (\<lambda>w. c * f w) z = c * deriv f z"
   531   "f complex_differentiable at z \<Longrightarrow> deriv (\<lambda>w. c * f w) z = c * deriv f z"
   540   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   532   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   541   by (auto intro!: DERIV_imp_deriv DERIV_intros)
   533   by (auto intro!: DERIV_imp_deriv derivative_eq_intros)
   542 
   534 
   543 lemma complex_derivative_cmult_right:
   535 lemma complex_derivative_cmult_right:
   544   "f complex_differentiable at z \<Longrightarrow> deriv (\<lambda>w. f w * c) z = deriv f z * c"
   536   "f complex_differentiable at z \<Longrightarrow> deriv (\<lambda>w. f w * c) z = deriv f z * c"
   545   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   537   unfolding DERIV_deriv_iff_complex_differentiable[symmetric]
   546   by (auto intro!: DERIV_imp_deriv DERIV_intros)
   538   by (auto intro!: DERIV_imp_deriv derivative_eq_intros)
   547 
   539 
   548 lemma complex_derivative_transform_within_open:
   540 lemma complex_derivative_transform_within_open:
   549   "\<lbrakk>f holomorphic_on s; g holomorphic_on s; open s; z \<in> s; \<And>w. w \<in> s \<Longrightarrow> f w = g w\<rbrakk> 
   541   "\<lbrakk>f holomorphic_on s; g holomorphic_on s; open s; z \<in> s; \<And>w. w \<in> s \<Longrightarrow> f w = g w\<rbrakk> 
   550    \<Longrightarrow> deriv f z = deriv g z"
   542    \<Longrightarrow> deriv f z = deriv g z"
   551   unfolding holomorphic_on_def
   543   unfolding holomorphic_on_def
  1035       finally show ?case .
  1027       finally show ?case .
  1036     qed
  1028     qed
  1037     then have "((\<lambda>v. (\<Sum>i\<le>n. f i v * (z - v)^i / of_nat (fact i))) 
  1029     then have "((\<lambda>v. (\<Sum>i\<le>n. f i v * (z - v)^i / of_nat (fact i))) 
  1038                 has_field_derivative f (Suc n) u * (z-u) ^ n / of_nat (fact n))
  1030                 has_field_derivative f (Suc n) u * (z-u) ^ n / of_nat (fact n))
  1039                (at u within s)"
  1031                (at u within s)"
  1040       apply (intro DERIV_intros DERIV_power[THEN DERIV_cong])
  1032       apply (intro derivative_eq_intros)
  1041       apply (blast intro: assms `u \<in> s`)
  1033       apply (blast intro: assms `u \<in> s`)
  1042       apply (rule refl)+
  1034       apply (rule refl)+
  1043       apply (auto simp: field_simps)
  1035       apply (auto simp: field_simps)
  1044       done
  1036       done
  1045   } note sum_deriv = this
  1037   } note sum_deriv = this
  1081   assumes "\<And>u. u \<in> closed_segment w z \<Longrightarrow> (f has_field_derivative f'(u)) (at u)"
  1073   assumes "\<And>u. u \<in> closed_segment w z \<Longrightarrow> (f has_field_derivative f'(u)) (at u)"
  1082     shows "\<exists>u. u \<in> open_segment w z \<and> Re(f z) - Re(f w) = Re(f'(u) * (z - w))"
  1074     shows "\<exists>u. u \<in> open_segment w z \<and> Re(f z) - Re(f w) = Re(f'(u) * (z - w))"
  1083 proof -
  1075 proof -
  1084   have twz: "\<And>t. (1 - t) *\<^sub>R w + t *\<^sub>R z = w + t *\<^sub>R (z - w)"
  1076   have twz: "\<And>t. (1 - t) *\<^sub>R w + t *\<^sub>R z = w + t *\<^sub>R (z - w)"
  1085     by (simp add: real_vector.scale_left_diff_distrib real_vector.scale_right_diff_distrib)
  1077     by (simp add: real_vector.scale_left_diff_distrib real_vector.scale_right_diff_distrib)
  1086   note assms[unfolded has_field_derivative_def, has_derivative_intros]
  1078   note assms[unfolded has_field_derivative_def, derivative_intros]
  1087   show ?thesis
  1079   show ?thesis
  1088     apply (cut_tac mvt_simple
  1080     apply (cut_tac mvt_simple
  1089                      [of 0 1 "Re o f o (\<lambda>t. (1 - t) *\<^sub>R w +  t *\<^sub>R z)"
  1081                      [of 0 1 "Re o f o (\<lambda>t. (1 - t) *\<^sub>R w +  t *\<^sub>R z)"
  1090                       "\<lambda>u. Re o (\<lambda>h. f'((1 - u) *\<^sub>R w + u *\<^sub>R z) * h) o (\<lambda>t. t *\<^sub>R (z - w))"])
  1082                       "\<lambda>u. Re o (\<lambda>h. f'((1 - u) *\<^sub>R w + u *\<^sub>R z) * h) o (\<lambda>t. t *\<^sub>R (z - w))"])
  1091     apply auto
  1083     apply auto
  1092     apply (rule_tac x="(1 - x) *\<^sub>R w + x *\<^sub>R z" in exI)
  1084     apply (rule_tac x="(1 - x) *\<^sub>R w + x *\<^sub>R z" in exI)
  1093     apply (auto simp add: open_segment_def twz) []
  1085     apply (auto simp add: open_segment_def twz) []
  1094     apply (intro has_derivative_eq_intros has_derivative_at_within)
  1086     apply (intro derivative_eq_intros has_derivative_at_within)
  1095     apply simp_all
  1087     apply simp_all
  1096     apply (simp add: fun_eq_iff real_vector.scale_right_diff_distrib)
  1088     apply (simp add: fun_eq_iff real_vector.scale_right_diff_distrib)
  1097     apply (force simp add: twz closed_segment_def)
  1089     apply (force simp add: twz closed_segment_def)
  1098     done
  1090     done
  1099 qed
  1091 qed
  1134     finally have "(\<Sum>i = 0..n. (f (Suc i) u * (z - u) ^ i 
  1126     finally have "(\<Sum>i = 0..n. (f (Suc i) u * (z - u) ^ i 
  1135                              - of_nat i * (f i u * (z-u) ^ (i - Suc 0))) / of_nat (fact i)) =
  1127                              - of_nat i * (f i u * (z-u) ^ (i - Suc 0))) / of_nat (fact i)) =
  1136                   f (Suc n) u * (z - u) ^ n / of_nat (fact n)" .
  1128                   f (Suc n) u * (z - u) ^ n / of_nat (fact n)" .
  1137     then have "((\<lambda>u. \<Sum>i = 0..n. f i u * (z - u) ^ i / of_nat (fact i)) has_field_derivative
  1129     then have "((\<lambda>u. \<Sum>i = 0..n. f i u * (z - u) ^ i / of_nat (fact i)) has_field_derivative
  1138                 f (Suc n) u * (z - u) ^ n / of_nat (fact n))  (at u)"
  1130                 f (Suc n) u * (z - u) ^ n / of_nat (fact n))  (at u)"
  1139       apply (intro DERIV_intros)+
  1131       apply (intro derivative_eq_intros)+
  1140       apply (force intro: u assms)
  1132       apply (force intro: u assms)
  1141       apply (rule refl)+
  1133       apply (rule refl)+
  1142       apply (auto simp: mult_ac)
  1134       apply (auto simp: mult_ac)
  1143       done
  1135       done
  1144   }
  1136   }