src/HOL/Analysis/Cauchy_Integral_Theorem.thy
changeset 65587 16a8991ab398
parent 65578 e4997c181cce
child 66112 0e640e04fc56
equal deleted inserted replaced
65586:91e451bc0f1f 65587:16a8991ab398
   829   show ?thesis using assms
   829   show ?thesis using assms
   830     apply (auto simp: has_contour_integral_def)
   830     apply (auto simp: has_contour_integral_def)
   831     apply (drule has_integral_affinity01 [where m= "-1" and c=1])
   831     apply (drule has_integral_affinity01 [where m= "-1" and c=1])
   832     apply (auto simp: reversepath_def valid_path_def piecewise_C1_differentiable_on_def)
   832     apply (auto simp: reversepath_def valid_path_def piecewise_C1_differentiable_on_def)
   833     apply (drule has_integral_neg)
   833     apply (drule has_integral_neg)
   834     apply (rule_tac s = "(\<lambda>x. 1 - x) ` s" in has_integral_spike_finite)
   834     apply (rule_tac S = "(\<lambda>x. 1 - x) ` s" in has_integral_spike_finite)
   835     apply (auto simp: *)
   835     apply (auto simp: *)
   836     done
   836     done
   837 qed
   837 qed
   838 
   838 
   839 lemma contour_integrable_reversepath:
   839 lemma contour_integrable_reversepath:
  1112     apply (rule integrable_subinterval_real)
  1112     apply (rule integrable_subinterval_real)
  1113     using * a by auto
  1113     using * a by auto
  1114   have "((\<lambda>x. f (shiftpath a g x) * vector_derivative (shiftpath a g) (at x))
  1114   have "((\<lambda>x. f (shiftpath a g x) * vector_derivative (shiftpath a g) (at x))
  1115         has_integral  integral {a..1} (\<lambda>x. f (g x) * vector_derivative g (at x)))  {0..1 - a}"
  1115         has_integral  integral {a..1} (\<lambda>x. f (g x) * vector_derivative g (at x)))  {0..1 - a}"
  1116     apply (rule has_integral_spike_finite
  1116     apply (rule has_integral_spike_finite
  1117              [where s = "{1-a} \<union> (\<lambda>x. x-a) ` s" and f = "\<lambda>x. f(g(a+x)) * vector_derivative g (at(a+x))"])
  1117              [where S = "{1-a} \<union> (\<lambda>x. x-a) ` s" and f = "\<lambda>x. f(g(a+x)) * vector_derivative g (at(a+x))"])
  1118       using s apply blast
  1118       using s apply blast
  1119      using a apply (auto simp: algebra_simps vd1)
  1119      using a apply (auto simp: algebra_simps vd1)
  1120      apply (force simp: shiftpath_def add.commute)
  1120      apply (force simp: shiftpath_def add.commute)
  1121     using has_integral_affinity [where m=1 and c=a, simplified, OF integrable_integral [OF va1]]
  1121     using has_integral_affinity [where m=1 and c=a, simplified, OF integrable_integral [OF va1]]
  1122     apply (simp add: image_affinity_atLeastAtMost_diff [where m=1 and c=a, simplified] add.commute)
  1122     apply (simp add: image_affinity_atLeastAtMost_diff [where m=1 and c=a, simplified] add.commute)
  1123     done
  1123     done
  1124   moreover
  1124   moreover
  1125   have "((\<lambda>x. f (shiftpath a g x) * vector_derivative (shiftpath a g) (at x))
  1125   have "((\<lambda>x. f (shiftpath a g x) * vector_derivative (shiftpath a g) (at x))
  1126         has_integral  integral {0..a} (\<lambda>x. f (g x) * vector_derivative g (at x)))  {1 - a..1}"
  1126         has_integral  integral {0..a} (\<lambda>x. f (g x) * vector_derivative g (at x)))  {1 - a..1}"
  1127     apply (rule has_integral_spike_finite
  1127     apply (rule has_integral_spike_finite
  1128              [where s = "{1-a} \<union> (\<lambda>x. x-a+1) ` s" and f = "\<lambda>x. f(g(a+x-1)) * vector_derivative g (at(a+x-1))"])
  1128              [where S = "{1-a} \<union> (\<lambda>x. x-a+1) ` s" and f = "\<lambda>x. f(g(a+x-1)) * vector_derivative g (at(a+x-1))"])
  1129       using s apply blast
  1129       using s apply blast
  1130      using a apply (auto simp: algebra_simps vd2)
  1130      using a apply (auto simp: algebra_simps vd2)
  1131      apply (force simp: shiftpath_def add.commute)
  1131      apply (force simp: shiftpath_def add.commute)
  1132     using has_integral_affinity [where m=1 and c="a-1", simplified, OF integrable_integral [OF v0a]]
  1132     using has_integral_affinity [where m=1 and c="a-1", simplified, OF integrable_integral [OF v0a]]
  1133     apply (simp add: image_affinity_atLeastAtMost [where m=1 and c="1-a", simplified])
  1133     apply (simp add: image_affinity_atLeastAtMost [where m=1 and c="1-a", simplified])
  1322   } note vd = this
  1322   } note vd = this
  1323   show ?thesis
  1323   show ?thesis
  1324     apply (cut_tac has_integral_cmul [OF *, where c = "v-u"])
  1324     apply (cut_tac has_integral_cmul [OF *, where c = "v-u"])
  1325     using fs assms
  1325     using fs assms
  1326     apply (simp add: False subpath_def has_contour_integral)
  1326     apply (simp add: False subpath_def has_contour_integral)
  1327     apply (rule_tac s = "(\<lambda>t. ((v-u) *\<^sub>R t + u)) -` s" in has_integral_spike_finite)
  1327     apply (rule_tac S = "(\<lambda>t. ((v-u) *\<^sub>R t + u)) -` s" in has_integral_spike_finite)
  1328     apply (auto simp: inj_on_def False finite_vimageI vd scaleR_conv_of_real)
  1328     apply (auto simp: inj_on_def False finite_vimageI vd scaleR_conv_of_real)
  1329     done
  1329     done
  1330 qed
  1330 qed
  1331 
  1331 
  1332 lemma contour_integrable_subpath:
  1332 lemma contour_integrable_subpath:
  3541   apply (rule_tac x="\<lambda>t. g t + z" in exI)
  3541   apply (rule_tac x="\<lambda>t. g t + z" in exI)
  3542   apply (simp add: piecewise_C1_differentiable_add vector_derivative_def has_vector_derivative_add_const C1_differentiable_imp_piecewise)
  3542   apply (simp add: piecewise_C1_differentiable_add vector_derivative_def has_vector_derivative_add_const C1_differentiable_imp_piecewise)
  3543   apply (force simp: algebra_simps)
  3543   apply (force simp: algebra_simps)
  3544   done
  3544   done
  3545 
  3545 
       
  3546 subsubsection\<open>Some lemmas about negating a path.\<close>
       
  3547 
       
  3548 lemma valid_path_negatepath: "valid_path \<gamma> \<Longrightarrow> valid_path (uminus \<circ> \<gamma>)"
       
  3549    unfolding o_def using piecewise_C1_differentiable_neg valid_path_def by blast
       
  3550 
       
  3551 lemma has_contour_integral_negatepath:
       
  3552   assumes \<gamma>: "valid_path \<gamma>" and cint: "((\<lambda>z. f (- z)) has_contour_integral - i) \<gamma>"
       
  3553   shows "(f has_contour_integral i) (uminus \<circ> \<gamma>)"
       
  3554 proof -
       
  3555   obtain S where cont: "continuous_on {0..1} \<gamma>" and "finite S" and diff: "\<gamma> C1_differentiable_on {0..1} - S"
       
  3556     using \<gamma> by (auto simp: valid_path_def piecewise_C1_differentiable_on_def)
       
  3557   have "((\<lambda>x. - (f (- \<gamma> x) * vector_derivative \<gamma> (at x within {0..1}))) has_integral i) {0..1}"
       
  3558     using cint by (auto simp: has_contour_integral_def dest: has_integral_neg)
       
  3559   then
       
  3560   have "((\<lambda>x. f (- \<gamma> x) * vector_derivative (uminus \<circ> \<gamma>) (at x within {0..1})) has_integral i) {0..1}"
       
  3561   proof (rule rev_iffD1 [OF _ has_integral_spike_eq])
       
  3562     show "negligible S"
       
  3563       by (simp add: \<open>finite S\<close> negligible_finite)
       
  3564     show "f (- \<gamma> x) * vector_derivative (uminus \<circ> \<gamma>) (at x within {0..1}) =
       
  3565          - (f (- \<gamma> x) * vector_derivative \<gamma> (at x within {0..1}))"
       
  3566       if "x \<in> {0..1} - S" for x
       
  3567     proof -
       
  3568       have "vector_derivative (uminus \<circ> \<gamma>) (at x within cbox 0 1) = - vector_derivative \<gamma> (at x within cbox 0 1)"
       
  3569         apply (rule vector_derivative_within_closed_interval)
       
  3570         using that
       
  3571           apply (auto simp: o_def)
       
  3572         apply (rule has_vector_derivative_minus)
       
  3573         by (metis C1_differentiable_on_def diff has_vector_derivative_at_within that vector_derivative_at_within_ivl zero_less_one)
       
  3574       then show ?thesis
       
  3575         by simp
       
  3576     qed
       
  3577   qed
       
  3578   then show ?thesis by (simp add: has_contour_integral_def)
       
  3579 qed
       
  3580 
       
  3581 lemma winding_number_negatepath:
       
  3582   assumes \<gamma>: "valid_path \<gamma>" and 0: "0 \<notin> path_image \<gamma>"
       
  3583   shows "winding_number(uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0"
       
  3584 proof -
       
  3585   have "op / 1 contour_integrable_on \<gamma>"
       
  3586     using "0" \<gamma> contour_integrable_inversediff by fastforce
       
  3587   then have "((\<lambda>z. 1/z) has_contour_integral contour_integral \<gamma> (op / 1)) \<gamma>"
       
  3588     by (rule has_contour_integral_integral)
       
  3589   then have "((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> (op / 1)) \<gamma>"
       
  3590     using has_contour_integral_neg by auto
       
  3591   then show ?thesis
       
  3592     using assms
       
  3593     apply (simp add: winding_number_valid_path valid_path_negatepath image_def path_defs)
       
  3594     apply (simp add: contour_integral_unique has_contour_integral_negatepath)
       
  3595     done
       
  3596 qed
       
  3597 
       
  3598 lemma contour_integrable_negatepath:
       
  3599   assumes \<gamma>: "valid_path \<gamma>" and pi: "(\<lambda>z. f (- z)) contour_integrable_on \<gamma>"
       
  3600   shows "f contour_integrable_on (uminus \<circ> \<gamma>)"
       
  3601   by (metis \<gamma> add.inverse_inverse contour_integrable_on_def has_contour_integral_negatepath pi)
       
  3602 
  3546 (* A combined theorem deducing several things piecewise.*)
  3603 (* A combined theorem deducing several things piecewise.*)
  3547 lemma winding_number_join_pos_combined:
  3604 lemma winding_number_join_pos_combined:
  3548      "\<lbrakk>valid_path \<gamma>1; z \<notin> path_image \<gamma>1; 0 < Re(winding_number \<gamma>1 z);
  3605      "\<lbrakk>valid_path \<gamma>1; z \<notin> path_image \<gamma>1; 0 < Re(winding_number \<gamma>1 z);
  3549        valid_path \<gamma>2; z \<notin> path_image \<gamma>2; 0 < Re(winding_number \<gamma>2 z); pathfinish \<gamma>1 = pathstart \<gamma>2\<rbrakk>
  3606        valid_path \<gamma>2; z \<notin> path_image \<gamma>2; 0 < Re(winding_number \<gamma>2 z); pathfinish \<gamma>1 = pathstart \<gamma>2\<rbrakk>
  3550       \<Longrightarrow> valid_path(\<gamma>1 +++ \<gamma>2) \<and> z \<notin> path_image(\<gamma>1 +++ \<gamma>2) \<and> 0 < Re(winding_number(\<gamma>1 +++ \<gamma>2) z)"
  3607       \<Longrightarrow> valid_path(\<gamma>1 +++ \<gamma>2) \<and> z \<notin> path_image(\<gamma>1 +++ \<gamma>2) \<and> 0 < Re(winding_number(\<gamma>1 +++ \<gamma>2) z)"
  3551   by (simp add: valid_path_join path_image_join winding_number_join valid_path_imp_path)
  3608   by (simp add: valid_path_join path_image_join winding_number_join valid_path_imp_path)
  3552 
  3609 
  3553 
  3610 
  3554 (* Useful sufficient conditions for the winding number to be positive etc.*)
  3611 subsubsection\<open>Useful sufficient conditions for the winding number to be positive\<close>
  3555 
  3612 
  3556 lemma Re_winding_number:
  3613 lemma Re_winding_number:
  3557     "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>\<rbrakk>
  3614     "\<lbrakk>valid_path \<gamma>; z \<notin> path_image \<gamma>\<rbrakk>
  3558      \<Longrightarrow> Re(winding_number \<gamma> z) = Im(contour_integral \<gamma> (\<lambda>w. 1/(w - z))) / (2*pi)"
  3615      \<Longrightarrow> Re(winding_number \<gamma> z) = Im(contour_integral \<gamma> (\<lambda>w. 1/(w - z))) / (2*pi)"
  3559 by (simp add: winding_number_valid_path field_simps Re_divide power2_eq_square)
  3616 by (simp add: winding_number_valid_path field_simps Re_divide power2_eq_square)
  5587 
  5644 
  5588 lemma holomorphic_deriv [holomorphic_intros]:
  5645 lemma holomorphic_deriv [holomorphic_intros]:
  5589     "\<lbrakk>f holomorphic_on s; open s\<rbrakk> \<Longrightarrow> (deriv f) holomorphic_on s"
  5646     "\<lbrakk>f holomorphic_on s; open s\<rbrakk> \<Longrightarrow> (deriv f) holomorphic_on s"
  5590 by (metis DERIV_deriv_iff_field_differentiable at_within_open derivative_is_holomorphic holomorphic_on_def)
  5647 by (metis DERIV_deriv_iff_field_differentiable at_within_open derivative_is_holomorphic holomorphic_on_def)
  5591 
  5648 
  5592 lemma analytic_deriv: "f analytic_on s \<Longrightarrow> (deriv f) analytic_on s"
  5649 lemma analytic_deriv [analytic_intros]: "f analytic_on s \<Longrightarrow> (deriv f) analytic_on s"
  5593   using analytic_on_holomorphic holomorphic_deriv by auto
  5650   using analytic_on_holomorphic holomorphic_deriv by auto
  5594 
  5651 
  5595 lemma holomorphic_higher_deriv [holomorphic_intros]: "\<lbrakk>f holomorphic_on s; open s\<rbrakk> \<Longrightarrow> (deriv ^^ n) f holomorphic_on s"
  5652 lemma holomorphic_higher_deriv [holomorphic_intros]: "\<lbrakk>f holomorphic_on s; open s\<rbrakk> \<Longrightarrow> (deriv ^^ n) f holomorphic_on s"
  5596   by (induction n) (auto simp: holomorphic_deriv)
  5653   by (induction n) (auto simp: holomorphic_deriv)
  5597 
  5654 
  5598 lemma analytic_higher_deriv: "f analytic_on s \<Longrightarrow> (deriv ^^ n) f analytic_on s"
  5655 lemma analytic_higher_deriv [analytic_intros]: "f analytic_on s \<Longrightarrow> (deriv ^^ n) f analytic_on s"
  5599   unfolding analytic_on_def using holomorphic_higher_deriv by blast
  5656   unfolding analytic_on_def using holomorphic_higher_deriv by blast
  5600 
  5657 
  5601 lemma has_field_derivative_higher_deriv:
  5658 lemma has_field_derivative_higher_deriv:
  5602      "\<lbrakk>f holomorphic_on s; open s; x \<in> s\<rbrakk>
  5659      "\<lbrakk>f holomorphic_on s; open s; x \<in> s\<rbrakk>
  5603       \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)"
  5660       \<Longrightarrow> ((deriv ^^ n) f has_field_derivative (deriv ^^ (Suc n)) f x) (at x)"