src/HOL/Complex_Analysis/Cauchy_Integral_Formula.thy
changeset 78517 28c1f4f5335f
parent 77690 71d075d18b6e
child 78700 4de5b127c124
equal deleted inserted replaced
78516:56a408fa2440 78517:28c1f4f5335f
   314     by (rule continuous_on_subset [OF contf]) (force simp: cball_def sphere_def)
   314     by (rule continuous_on_subset [OF contf]) (force simp: cball_def sphere_def)
   315   have int: "\<And>w. dist z w < r \<Longrightarrow>
   315   have int: "\<And>w. dist z w < r \<Longrightarrow>
   316                  ((\<lambda>u. f u / (u - w)) has_contour_integral (\<lambda>x. 2 * of_real pi * \<i> * f x) w) (circlepath z r)"
   316                  ((\<lambda>u. f u / (u - w)) has_contour_integral (\<lambda>x. 2 * of_real pi * \<i> * f x) w) (circlepath z r)"
   317     by (rule Cauchy_integral_circlepath [OF contf holf]) (simp add: dist_norm norm_minus_commute)
   317     by (rule Cauchy_integral_circlepath [OF contf holf]) (simp add: dist_norm norm_minus_commute)
   318   show ?thes1
   318   show ?thes1
   319     apply (simp add: power2_eq_square)
   319     unfolding power2_eq_square
   320     apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1, simplified])
   320     using int Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1]
   321     apply (blast intro: int)
   321     by fastforce
   322     done
       
   323   have "((\<lambda>x. 2 * of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2)) (at w)"
   322   have "((\<lambda>x. 2 * of_real pi * \<i> * f x) has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2)) (at w)"
   324     apply (simp add: power2_eq_square)
   323     unfolding power2_eq_square
   325     apply (rule Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1 and g = "\<lambda>x. 2 * of_real pi * \<i> * f x", simplified])
   324     using int Cauchy_next_derivative_circlepath [OF f _ _ w, where k=1 and g = "\<lambda>x. 2 * of_real pi * \<i> * f x"]
   326     apply (blast intro: int)
   325     by fastforce
   327     done
       
   328   then have fder: "(f has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2) / (2 * of_real pi * \<i>)) (at w)"
   326   then have fder: "(f has_field_derivative contour_integral (circlepath z r) (\<lambda>u. f u / (u - w)^2) / (2 * of_real pi * \<i>)) (at w)"
   329     by (rule DERIV_cdivide [where f = "\<lambda>x. 2 * of_real pi * \<i> * f x" and c = "2 * of_real pi * \<i>", simplified])
   327     by (rule DERIV_cdivide [where f = "\<lambda>x. 2 * of_real pi * \<i> * f x" and c = "2 * of_real pi * \<i>", simplified])
   330   show ?thes2
   328   show ?thes2
   331     by simp (rule fder)
   329     by simp (rule fder)
   332 qed
   330 qed
   394   unfolding analytic_on_def using holomorphic_higher_deriv by blast
   392   unfolding analytic_on_def using holomorphic_higher_deriv by blast
   395 
   393 
   396 lemma has_field_derivative_higher_deriv:
   394 lemma has_field_derivative_higher_deriv:
   397      "\<lbrakk>f holomorphic_on S; open S; x \<in> S\<rbrakk>
   395      "\<lbrakk>f holomorphic_on S; open S; x \<in> S\<rbrakk>
   398       \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)"
   396       \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)"
   399 by (metis (no_types, opaque_lifting) DERIV_deriv_iff_field_differentiable at_within_open comp_apply
   397   using holomorphic_derivI holomorphic_higher_deriv by fastforce
   400          funpow.simps(2) holomorphic_higher_deriv holomorphic_on_def)
       
   401   
   398   
   402 lemma higher_deriv_cmult:
   399 lemma higher_deriv_cmult:
   403   assumes "f holomorphic_on A" "x \<in> A" "open A"
   400   assumes "f holomorphic_on A" "x \<in> A" "open A"
   404   shows   "(deriv ^^ j) (\<lambda>x. c * f x) x = c * (deriv ^^ j) f x"
   401   shows   "(deriv ^^ j) (\<lambda>x. c * f x) x = c * (deriv ^^ j) f x"
   405   using assms
   402   using assms
   642     by (meson fg f holomorphic_on_subset image_subset_iff)
   639     by (meson fg f holomorphic_on_subset image_subset_iff)
   643   have holo2: "(deriv ^^ n) f holomorphic_on (*) u ` S"
   640   have holo2: "(deriv ^^ n) f holomorphic_on (*) u ` S"
   644     by (meson f fg holomorphic_higher_deriv holomorphic_on_subset image_subset_iff T)
   641     by (meson f fg holomorphic_higher_deriv holomorphic_on_subset image_subset_iff T)
   645   have holo3: "(\<lambda>z. u ^ n * (deriv ^^ n) f (u * z)) holomorphic_on S"
   642   have holo3: "(\<lambda>z. u ^ n * (deriv ^^ n) f (u * z)) holomorphic_on S"
   646     by (intro holo2 holomorphic_on_compose [where g="(deriv ^^ n) f", unfolded o_def] holomorphic_intros)
   643     by (intro holo2 holomorphic_on_compose [where g="(deriv ^^ n) f", unfolded o_def] holomorphic_intros)
   647   have "(*) u holomorphic_on S" "f holomorphic_on (*) u ` S"
   644   have u: "(*) u holomorphic_on S" "f holomorphic_on (*) u ` S"
   648     by (rule holo0 holomorphic_intros)+
   645     by (rule holo0 holomorphic_intros)+
   649   then have holo1: "(\<lambda>w. f (u * w)) holomorphic_on S"
   646   then have holo1: "(\<lambda>w. f (u * w)) holomorphic_on S"
   650     by (rule holomorphic_on_compose [where g=f, unfolded o_def])
   647     by (rule holomorphic_on_compose [where g=f, unfolded o_def])
   651   have "deriv ((deriv ^^ n) (\<lambda>w. f (u * w))) z = deriv (\<lambda>z. u^n * (deriv ^^ n) f (u*z)) z"
   648   have "deriv ((deriv ^^ n) (\<lambda>w. f (u * w))) z = deriv (\<lambda>z. u^n * (deriv ^^ n) f (u*z)) z"
   652   proof (rule complex_derivative_transform_within_open [OF _ holo3 S Suc.prems])
   649   proof (rule complex_derivative_transform_within_open [OF _ holo3 S Suc.prems])
   656   also have "\<dots> = u^n * deriv (\<lambda>z. (deriv ^^ n) f (u * z)) z"
   653   also have "\<dots> = u^n * deriv (\<lambda>z. (deriv ^^ n) f (u * z)) z"
   657   proof -
   654   proof -
   658     have "(deriv ^^ n) f analytic_on T"
   655     have "(deriv ^^ n) f analytic_on T"
   659       by (simp add: analytic_on_open f holomorphic_higher_deriv T)
   656       by (simp add: analytic_on_open f holomorphic_higher_deriv T)
   660     then have "(\<lambda>w. (deriv ^^ n) f (u * w)) analytic_on S"
   657     then have "(\<lambda>w. (deriv ^^ n) f (u * w)) analytic_on S"
   661     proof -
   658       by (meson S u analytic_on_open holo2 holomorphic_on_compose holomorphic_transform o_def)
   662       have "(deriv ^^ n) f \<circ> (*) u holomorphic_on S"
       
   663         by (simp add: holo2 holomorphic_on_compose)
       
   664       then show ?thesis
       
   665         by (simp add: S analytic_on_open o_def)
       
   666     qed
       
   667     then show ?thesis
   659     then show ?thesis
   668       by (intro deriv_cmult analytic_on_imp_differentiable_at [OF _ Suc.prems])
   660       by (intro deriv_cmult analytic_on_imp_differentiable_at [OF _ Suc.prems])
   669   qed
   661   qed
   670   also have "\<dots> = u * u ^ n * deriv ((deriv ^^ n) f) (u * z)"
   662   also have "\<dots> = u * u ^ n * deriv ((deriv ^^ n) f) (u * z)"
   671   proof -
   663   proof -
  1296 text\<open>Sometimes convenient to compare with a complex series of positive reals. (?)\<close>
  1288 text\<open>Sometimes convenient to compare with a complex series of positive reals. (?)\<close>
  1297 
  1289 
  1298 lemma series_and_derivative_comparison_complex:
  1290 lemma series_and_derivative_comparison_complex:
  1299   fixes S :: "complex set"
  1291   fixes S :: "complex set"
  1300   assumes S: "open S"
  1292   assumes S: "open S"
  1301       and hfd: "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)"
  1293     and hfd: "\<And>n x. x \<in> S \<Longrightarrow> (f n has_field_derivative f' n x) (at x)"
  1302       and to_g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>d h. 0 < d \<and> summable h \<and> range h \<subseteq> \<real>\<^sub>\<ge>\<^sub>0 \<and> (\<forall>\<^sub>F n in sequentially. \<forall>y\<in>ball x d \<inter> S. cmod(f n y) \<le> cmod (h n))"
  1294     and to_g: "\<And>x. x \<in> S \<Longrightarrow> \<exists>d h. 0 < d \<and> summable h \<and> range h \<subseteq> \<real>\<^sub>\<ge>\<^sub>0 \<and> (\<forall>\<^sub>F n in sequentially. \<forall>y\<in>ball x d \<inter> S. cmod(f n y) \<le> cmod (h n))"
  1303   shows "\<exists>g g'. \<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> ((\<lambda>n. f' n x) sums g' x) \<and> (g has_field_derivative g' x) (at x)"
  1295   shows "\<exists>g g'. \<forall>x \<in> S. ((\<lambda>n. f n x) sums g x) \<and> ((\<lambda>n. f' n x) sums g' x) \<and> (g has_field_derivative g' x) (at x)"
  1304 apply (rule series_and_derivative_comparison_local [OF S hfd], assumption)
  1296   apply (rule series_and_derivative_comparison_local [OF S hfd], assumption)
  1305 apply (rule ex_forward [OF to_g], assumption)
  1297   apply (rule ex_forward [OF to_g], assumption)
  1306 apply (erule exE)
  1298   apply (erule exE)
  1307 apply (rule_tac x="Re \<circ> h" in exI)
  1299   apply (rule_tac x="Re \<circ> h" in exI)
  1308 apply (force simp: summable_Re o_def nonneg_Reals_cmod_eq_Re image_subset_iff)
  1300   apply (force simp: summable_Re o_def nonneg_Reals_cmod_eq_Re image_subset_iff)
  1309 done
  1301   done
  1310 
  1302 
  1311 text\<open>Sometimes convenient to compare with a complex series of positive reals. (?)\<close>
  1303 text\<open>Sometimes convenient to compare with a complex series of positive reals. (?)\<close>
  1312 lemma series_differentiable_comparison_complex:
  1304 lemma series_differentiable_comparison_complex:
  1313   fixes S :: "complex set"
  1305   fixes S :: "complex set"
  1314   assumes S: "open S"
  1306   assumes S: "open S"
  1408 qed
  1400 qed
  1409 
  1401 
  1410 corollary holomorphic_iff_power_series:
  1402 corollary holomorphic_iff_power_series:
  1411      "f holomorphic_on ball z r \<longleftrightarrow>
  1403      "f holomorphic_on ball z r \<longleftrightarrow>
  1412       (\<forall>w \<in> ball z r. (\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n) sums f w)"
  1404       (\<forall>w \<in> ball z r. (\<lambda>n. (deriv ^^ n) f z / (fact n) * (w - z)^n) sums f w)"
  1413   apply (intro iffI ballI holomorphic_power_series, assumption+)
  1405   using power_series_holomorphic [where a = "\<lambda>n. (deriv ^^ n) f z / (fact n)"] holomorphic_power_series
  1414   apply (force intro: power_series_holomorphic [where a = "\<lambda>n. (deriv ^^ n) f z / (fact n)"])
  1406   by blast
  1415   done
       
  1416 
  1407 
  1417 lemma power_series_analytic:
  1408 lemma power_series_analytic:
  1418      "(\<And>w. w \<in> ball z r \<Longrightarrow> (\<lambda>n. a n*(w - z)^n) sums f w) \<Longrightarrow> f analytic_on ball z r"
  1409      "(\<And>w. w \<in> ball z r \<Longrightarrow> (\<lambda>n. a n*(w - z)^n) sums f w) \<Longrightarrow> f analytic_on ball z r"
  1419   by (force simp: analytic_on_open intro!: power_series_holomorphic)
  1410   by (force simp: analytic_on_open intro!: power_series_holomorphic)
  1420 
  1411 
  1668           if "w \<in> U" "0 < \<epsilon>" "a \<noteq> b" for w \<epsilon>
  1659           if "w \<in> U" "0 < \<epsilon>" "a \<noteq> b" for w \<epsilon>
  1669   proof -
  1660   proof -
  1670     obtain \<delta> where "\<delta>>0" and \<delta>: "cball w \<delta> \<subseteq> U" using open_contains_cball \<open>open U\<close> \<open>w \<in> U\<close> by force
  1661     obtain \<delta> where "\<delta>>0" and \<delta>: "cball w \<delta> \<subseteq> U" using open_contains_cball \<open>open U\<close> \<open>w \<in> U\<close> by force
  1671     let ?TZ = "cball w \<delta>  \<times> closed_segment a b"
  1662     let ?TZ = "cball w \<delta>  \<times> closed_segment a b"
  1672     have "uniformly_continuous_on ?TZ (\<lambda>(x,y). F x y)"
  1663     have "uniformly_continuous_on ?TZ (\<lambda>(x,y). F x y)"
  1673     proof (rule compact_uniformly_continuous)
  1664       by (metis Sigma_mono \<delta> abu compact_Times compact_cball compact_segment compact_uniformly_continuous 
  1674       show "continuous_on ?TZ (\<lambda>(x,y). F x y)"
  1665           cond_uu continuous_on_subset)
  1675         by (rule continuous_on_subset[OF cond_uu]) (use SigmaE \<delta> abu in blast)
       
  1676       show "compact ?TZ"
       
  1677         by (simp add: compact_Times)
       
  1678     qed
       
  1679     then obtain \<eta> where "\<eta>>0"
  1666     then obtain \<eta> where "\<eta>>0"
  1680         and \<eta>: "\<And>x x'. \<lbrakk>x\<in>?TZ; x'\<in>?TZ; dist x' x < \<eta>\<rbrakk> \<Longrightarrow>
  1667         and \<eta>: "\<And>x x'. \<lbrakk>x\<in>?TZ; x'\<in>?TZ; dist x' x < \<eta>\<rbrakk> \<Longrightarrow>
  1681                          dist ((\<lambda>(x,y). F x y) x') ((\<lambda>(x,y). F x y) x) < \<epsilon>/norm(b - a)"
  1668                          dist ((\<lambda>(x,y). F x y) x') ((\<lambda>(x,y). F x y) x) < \<epsilon>/norm(b - a)"
  1682       using \<open>0 < \<epsilon>\<close> \<open>a \<noteq> b\<close>
  1669       using \<open>0 < \<epsilon>\<close> \<open>a \<noteq> b\<close>
  1683       by (auto elim: uniformly_continuous_onE [where e = "\<epsilon>/norm(b - a)"])
  1670       by (auto elim: uniformly_continuous_onE [where e = "\<epsilon>/norm(b - a)"])
  1990           by (metis abu hol_dw continuous_on_subset contour_integrable_continuous_linepath holomorphic_on_imp_continuous_on)
  1977           by (metis abu hol_dw continuous_on_subset contour_integrable_continuous_linepath holomorphic_on_imp_continuous_on)
  1991         show "continuous_on (U \<times> U) (\<lambda>(x, y). d y x)"
  1978         show "continuous_on (U \<times> U) (\<lambda>(x, y). d y x)"
  1992           by (auto intro: continuous_on_swap_args cond_uu)
  1979           by (auto intro: continuous_on_swap_args cond_uu)
  1993       qed
  1980       qed
  1994       have cont_cint_d\<gamma>: "continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) \<circ> \<gamma>)"
  1981       have cont_cint_d\<gamma>: "continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) \<circ> \<gamma>)"
  1995       proof (rule continuous_on_compose)
  1982         by (metis Diff_subset \<open>path \<gamma>\<close> cont_cint_d continuous_on_compose continuous_on_subset pasz path_def path_image_def)
  1996         show "continuous_on {0..1} \<gamma>"
       
  1997           using \<open>path \<gamma>\<close> path_def by blast
       
  1998         show "continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))"
       
  1999           using pasz unfolding path_image_def
       
  2000           by (auto intro!: continuous_on_subset [OF cont_cint_d])
       
  2001       qed
       
  2002       have "continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))"
  1983       have "continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))"
  2003         using pf\<gamma>' by (simp add: continuous_on_polymonial_function vector_derivative_at [OF \<gamma>'])
  1984         using pf\<gamma>' by (simp add: continuous_on_polymonial_function vector_derivative_at [OF \<gamma>'])
  2004       then      have cint_cint: "(\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>"
  1985       then have cint_cint: "(\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>"
  2005         apply (simp add: contour_integrable_on)
  1986         apply (simp add: contour_integrable_on)
  2006         apply (rule integrable_continuous_real)
  1987         apply (rule integrable_continuous_real)
  2007         by (rule continuous_on_mult [OF cont_cint_d\<gamma> [unfolded o_def]])
  1988         by (rule continuous_on_mult [OF cont_cint_d\<gamma> [unfolded o_def]])
  2008       have "contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))"
  1989       have "contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))"
  2009         using abu  by (force simp: h_def intro: contour_integral_eq)
  1990         using abu  by (force simp: h_def intro: contour_integral_eq)
  2630   have [simp]: "fps_nth f' 0 = fps_nth f (subdegree g)"
  2611   have [simp]: "fps_nth f' 0 = fps_nth f (subdegree g)"
  2631                "fps_nth g' 0 = fps_nth g (subdegree g)" by (simp_all add: f'_def g'_def)
  2612                "fps_nth g' 0 = fps_nth g (subdegree g)" by (simp_all add: f'_def g'_def)
  2632   have g_nz: "g \<noteq> 0"
  2613   have g_nz: "g \<noteq> 0"
  2633   proof -
  2614   proof -
  2634     define z :: complex where "z = (if r = \<infinity> then 1 else of_real (real_of_ereal r / 2))"
  2615     define z :: complex where "z = (if r = \<infinity> then 1 else of_real (real_of_ereal r / 2))"
  2635     from \<open>r > 0\<close> have "z \<in> eball 0 r"
  2616     have "z \<in> eball 0 r"
  2636       by (cases r) (auto simp: z_def eball_def)
  2617       using \<open>r > 0\<close> ereal_less_real_iff z_def by fastforce
  2637     moreover have "z \<noteq> 0" using \<open>r > 0\<close> 
  2618     moreover have "z \<noteq> 0" using \<open>r > 0\<close> 
  2638       by (cases r) (auto simp: z_def)
  2619       by (cases r) (auto simp: z_def)
  2639     ultimately have "eval_fps g z \<noteq> 0" by (rule assms(6))
  2620     ultimately have "eval_fps g z \<noteq> 0" by (rule assms(6))
  2640     thus "g \<noteq> 0" by auto
  2621     thus "g \<noteq> 0" by auto
  2641   qed
  2622   qed