3908 ultimately have " c* (\<Sum>p\<in>zeros_fg. w p * (zorder fg p)) = c* (\<Sum>p\<in>zeros_f. w p * (zorder f p))" |
3923 ultimately have " c* (\<Sum>p\<in>zeros_fg. w p * (zorder fg p)) = c* (\<Sum>p\<in>zeros_f. w p * (zorder f p))" |
3909 by auto |
3924 by auto |
3910 then show ?thesis unfolding c_def using w_def by auto |
3925 then show ?thesis unfolding c_def using w_def by auto |
3911 qed |
3926 qed |
3912 |
3927 |
|
3928 |
|
3929 subsection \<open>More facts about poles and residues\<close> |
|
3930 |
|
3931 lemma lhopital_complex_simple: |
|
3932 assumes "(f has_field_derivative f') (at z)" |
|
3933 assumes "(g has_field_derivative g') (at z)" |
|
3934 assumes "f z = 0" "g z = 0" "g' \<noteq> 0" "f' / g' = c" |
|
3935 shows "((\<lambda>w. f w / g w) \<longlongrightarrow> c) (at z)" |
|
3936 proof - |
|
3937 have "eventually (\<lambda>w. w \<noteq> z) (at z)" |
|
3938 by (auto simp: eventually_at_filter) |
|
3939 hence "eventually (\<lambda>w. ((f w - f z) / (w - z)) / ((g w - g z) / (w - z)) = f w / g w) (at z)" |
|
3940 by eventually_elim (simp add: assms divide_simps) |
|
3941 moreover have "((\<lambda>w. ((f w - f z) / (w - z)) / ((g w - g z) / (w - z))) \<longlongrightarrow> f' / g') (at z)" |
|
3942 by (intro tendsto_divide has_field_derivativeD assms) |
|
3943 ultimately have "((\<lambda>w. f w / g w) \<longlongrightarrow> f' / g') (at z)" |
|
3944 by (rule Lim_transform_eventually) |
|
3945 with assms show ?thesis by simp |
|
3946 qed |
|
3947 |
|
3948 lemma porder_eqI: |
|
3949 assumes "open s" "z \<in> s" "g holomorphic_on s" "g z \<noteq> 0" "n > 0" |
|
3950 assumes "\<And>w. w \<in> s - {z} \<Longrightarrow> f w = g w / (w - z) ^ n" |
|
3951 shows "porder f z = n" |
|
3952 proof - |
|
3953 define f' where "f' = (\<lambda>x. if x = z then 0 else inverse (f x))" |
|
3954 define g' where "g' = (\<lambda>x. inverse (g x))" |
|
3955 define s' where "s' = (g -` (-{0}) \<inter> s)" |
|
3956 have "continuous_on s g" |
|
3957 by (intro holomorphic_on_imp_continuous_on) fact |
|
3958 hence "open s'" |
|
3959 unfolding s'_def using assms by (subst (asm) continuous_on_open_vimage) blast+ |
|
3960 have s': "z \<in> s'" "g' holomorphic_on s'" "g' z \<noteq> 0" using assms |
|
3961 by (auto simp: s'_def g'_def intro!: holomorphic_intros) |
|
3962 have f'_g': "f' w = g' w * (w - z) ^ n" if "w \<in> s'" for w |
|
3963 unfolding f'_def g'_def using that \<open>n > 0\<close> |
|
3964 by (auto simp: assms(6) field_simps s'_def) |
|
3965 have "porder f z = zorder f' z" |
|
3966 by (simp add: porder_def f'_def) |
|
3967 also have "\<dots> = n" using assms f'_g' |
|
3968 by (intro zorder_eqI[OF \<open>open s'\<close> s']) (auto simp: f'_def g'_def field_simps s'_def) |
|
3969 finally show ?thesis . |
|
3970 qed |
|
3971 |
|
3972 lemma simple_poleI': |
|
3973 assumes "open s" "connected s" "z \<in> s" |
|
3974 assumes "\<And>w. w \<in> s - {z} \<Longrightarrow> |
|
3975 ((\<lambda>w. inverse (f w)) has_field_derivative f' w) (at w)" |
|
3976 assumes "f holomorphic_on s - {z}" "f' holomorphic_on s" "is_pole f z" "f' z \<noteq> 0" |
|
3977 shows "porder f z = 1" |
|
3978 proof - |
|
3979 define g where "g = (\<lambda>w. if w = z then 0 else inverse (f w))" |
|
3980 from \<open>is_pole f z\<close> have "eventually (\<lambda>w. f w \<noteq> 0) (at z)" |
|
3981 unfolding is_pole_def using filterlim_at_infinity_imp_eventually_ne by blast |
|
3982 then obtain s'' where s'': "open s''" "z \<in> s''" "\<forall>w\<in>s''-{z}. f w \<noteq> 0" |
|
3983 by (auto simp: eventually_at_topological) |
|
3984 from assms(1) and s''(1) have "open (s \<inter> s'')" by auto |
|
3985 then obtain r where r: "r > 0" "ball z r \<subseteq> s \<inter> s''" |
|
3986 using assms(3) s''(2) by (subst (asm) open_contains_ball) blast |
|
3987 define s' where "s' = ball z r" |
|
3988 hence s': "open s'" "connected s'" "z \<in> s'" "s' \<subseteq> s" "\<forall>w\<in>s'-{z}. f w \<noteq> 0" |
|
3989 using r s'' by (auto simp: s'_def) |
|
3990 have s'_ne: "s' - {z} \<noteq> {}" |
|
3991 using r unfolding s'_def by (intro ball_minus_countable_nonempty) auto |
|
3992 |
|
3993 have "porder f z = zorder g z" |
|
3994 by (simp add: porder_def g_def) |
|
3995 also have "\<dots> = 1" |
|
3996 proof (rule simple_zeroI') |
|
3997 fix w assume w: "w \<in> s'" |
|
3998 have [holomorphic_intros]: "g holomorphic_on s'" unfolding g_def using assms s' |
|
3999 by (intro is_pole_inverse_holomorphic holomorphic_on_subset[OF assms(5)]) auto |
|
4000 hence "(g has_field_derivative deriv g w) (at w)" |
|
4001 using w s' by (intro holomorphic_derivI) |
|
4002 also have deriv_g: "deriv g w = f' w" if "w \<in> s' - {z}" for w |
|
4003 proof - |
|
4004 from that have ne: "eventually (\<lambda>w. w \<noteq> z) (nhds w)" |
|
4005 by (intro t1_space_nhds) auto |
|
4006 have "deriv g w = deriv (\<lambda>w. inverse (f w)) w" |
|
4007 by (intro deriv_cong_ev refl eventually_mono [OF ne]) (auto simp: g_def) |
|
4008 also from assms(4)[of w] that s' have "\<dots> = f' w" |
|
4009 by (auto dest: DERIV_imp_deriv) |
|
4010 finally show ?thesis . |
|
4011 qed |
|
4012 have "deriv g w = f' w" |
|
4013 by (rule analytic_continuation_open[of "s' - {z}" s' "deriv g" f']) |
|
4014 (insert s' assms s'_ne deriv_g w, |
|
4015 auto intro!: holomorphic_intros holomorphic_on_subset[OF assms(6)]) |
|
4016 finally show "(g has_field_derivative f' w) (at w)" . |
|
4017 qed (insert assms s', auto simp: g_def) |
|
4018 finally show ?thesis . |
|
4019 qed |
|
4020 |
|
4021 lemma residue_holomorphic_over_power: |
|
4022 assumes "open A" "z0 \<in> A" "f holomorphic_on A" |
|
4023 shows "residue (\<lambda>z. f z / (z - z0) ^ Suc n) z0 = (deriv ^^ n) f z0 / fact n" |
|
4024 proof - |
|
4025 let ?f = "\<lambda>z. f z / (z - z0) ^ Suc n" |
|
4026 from assms(1,2) obtain r where r: "r > 0" "cball z0 r \<subseteq> A" |
|
4027 by (auto simp: open_contains_cball) |
|
4028 have "(?f has_contour_integral 2 * pi * \<i> * residue ?f z0) (circlepath z0 r)" |
|
4029 using r assms by (intro base_residue[of A]) (auto intro!: holomorphic_intros) |
|
4030 moreover have "(?f has_contour_integral 2 * pi * \<i> / fact n * (deriv ^^ n) f z0) (circlepath z0 r)" |
|
4031 using assms r |
|
4032 by (intro Cauchy_has_contour_integral_higher_derivative_circlepath) |
|
4033 (auto intro!: holomorphic_on_subset[OF assms(3)] holomorphic_on_imp_continuous_on) |
|
4034 ultimately have "2 * pi * \<i> * residue ?f z0 = 2 * pi * \<i> / fact n * (deriv ^^ n) f z0" |
|
4035 by (rule has_contour_integral_unique) |
|
4036 thus ?thesis by (simp add: field_simps) |
|
4037 qed |
|
4038 |
|
4039 lemma residue_holomorphic_over_power': |
|
4040 assumes "open A" "0 \<in> A" "f holomorphic_on A" |
|
4041 shows "residue (\<lambda>z. f z / z ^ Suc n) 0 = (deriv ^^ n) f 0 / fact n" |
|
4042 using residue_holomorphic_over_power[OF assms] by simp |
|
4043 |
|
4044 lemma zer_poly_eqI: |
|
4045 fixes f :: "complex \<Rightarrow> complex" and z0 :: complex |
|
4046 defines "n \<equiv> zorder f z0" |
|
4047 assumes "open A" "connected A" "z0 \<in> A" "f holomorphic_on A" "f z0 = 0" "\<exists>z\<in>A. f z \<noteq> 0" |
|
4048 assumes lim: "((\<lambda>x. f (g x) / (g x - z0) ^ n) \<longlongrightarrow> c) F" |
|
4049 assumes g: "filterlim g (at z0) F" and "F \<noteq> bot" |
|
4050 shows "zer_poly f z0 z0 = c" |
|
4051 proof - |
|
4052 from zorder_exist[OF assms(2-7)] obtain r where |
|
4053 r: "r > 0" "cball z0 r \<subseteq> A" "zer_poly f z0 holomorphic_on cball z0 r" |
|
4054 "\<And>w. w \<in> cball z0 r \<Longrightarrow> f w = zer_poly f z0 w * (w - z0) ^ n" |
|
4055 unfolding n_def by blast |
|
4056 from r(1) have "eventually (\<lambda>w. w \<in> ball z0 r \<and> w \<noteq> z0) (at z0)" |
|
4057 using eventually_at_ball'[of r z0 UNIV] by auto |
|
4058 hence "eventually (\<lambda>w. zer_poly f z0 w = f w / (w - z0) ^ n) (at z0)" |
|
4059 by eventually_elim (insert r, auto simp: field_simps) |
|
4060 moreover have "continuous_on (ball z0 r) (zer_poly f z0)" |
|
4061 using r by (intro holomorphic_on_imp_continuous_on) auto |
|
4062 with r(1,2) have "isCont (zer_poly f z0) z0" |
|
4063 by (auto simp: continuous_on_eq_continuous_at) |
|
4064 hence "(zer_poly f z0 \<longlongrightarrow> zer_poly f z0 z0) (at z0)" |
|
4065 unfolding isCont_def . |
|
4066 ultimately have "((\<lambda>w. f w / (w - z0) ^ n) \<longlongrightarrow> zer_poly f z0 z0) (at z0)" |
|
4067 by (rule Lim_transform_eventually) |
|
4068 hence "((\<lambda>x. f (g x) / (g x - z0) ^ n) \<longlongrightarrow> zer_poly f z0 z0) F" |
|
4069 by (rule filterlim_compose[OF _ g]) |
|
4070 from tendsto_unique[OF \<open>F \<noteq> bot\<close> this lim] show ?thesis . |
|
4071 qed |
|
4072 |
|
4073 lemma pol_poly_eqI: |
|
4074 fixes f :: "complex \<Rightarrow> complex" and z0 :: complex |
|
4075 defines "n \<equiv> porder f z0" |
|
4076 assumes "open A" "z0 \<in> A" "f holomorphic_on A-{z0}" "is_pole f z0" |
|
4077 assumes lim: "((\<lambda>x. f (g x) * (g x - z0) ^ n) \<longlongrightarrow> c) F" |
|
4078 assumes g: "filterlim g (at z0) F" and "F \<noteq> bot" |
|
4079 shows "pol_poly f z0 z0 = c" |
|
4080 proof - |
|
4081 from porder_exist[OF assms(2-5)] obtain r where |
|
4082 r: "r > 0" "cball z0 r \<subseteq> A" "pol_poly f z0 holomorphic_on cball z0 r" |
|
4083 "\<And>w. w \<in> cball z0 r - {z0} \<Longrightarrow> f w = pol_poly f z0 w / (w - z0) ^ n" |
|
4084 unfolding n_def by blast |
|
4085 from r(1) have "eventually (\<lambda>w. w \<in> ball z0 r \<and> w \<noteq> z0) (at z0)" |
|
4086 using eventually_at_ball'[of r z0 UNIV] by auto |
|
4087 hence "eventually (\<lambda>w. pol_poly f z0 w = f w * (w - z0) ^ n) (at z0)" |
|
4088 by eventually_elim (insert r, auto simp: field_simps) |
|
4089 moreover have "continuous_on (ball z0 r) (pol_poly f z0)" |
|
4090 using r by (intro holomorphic_on_imp_continuous_on) auto |
|
4091 with r(1,2) have "isCont (pol_poly f z0) z0" |
|
4092 by (auto simp: continuous_on_eq_continuous_at) |
|
4093 hence "(pol_poly f z0 \<longlongrightarrow> pol_poly f z0 z0) (at z0)" |
|
4094 unfolding isCont_def . |
|
4095 ultimately have "((\<lambda>w. f w * (w - z0) ^ n) \<longlongrightarrow> pol_poly f z0 z0) (at z0)" |
|
4096 by (rule Lim_transform_eventually) |
|
4097 hence "((\<lambda>x. f (g x) * (g x - z0) ^ n) \<longlongrightarrow> pol_poly f z0 z0) F" |
|
4098 by (rule filterlim_compose[OF _ g]) |
|
4099 from tendsto_unique[OF \<open>F \<noteq> bot\<close> this lim] show ?thesis . |
|
4100 qed |
|
4101 |
|
4102 lemma residue_simple_pole: |
|
4103 assumes "open A" "z0 \<in> A" "f holomorphic_on A - {z0}" |
|
4104 assumes "is_pole f z0" "porder f z0 = 1" |
|
4105 shows "residue f z0 = pol_poly f z0 z0" |
|
4106 using assms by (subst residue_porder[of A]) simp_all |
|
4107 |
|
4108 lemma residue_simple_pole_limit: |
|
4109 assumes "open A" "z0 \<in> A" "f holomorphic_on A - {z0}" |
|
4110 assumes "is_pole f z0" "porder f z0 = 1" |
|
4111 assumes "((\<lambda>x. f (g x) * (g x - z0)) \<longlongrightarrow> c) F" |
|
4112 assumes "filterlim g (at z0) F" "F \<noteq> bot" |
|
4113 shows "residue f z0 = c" |
|
4114 proof - |
|
4115 have "residue f z0 = pol_poly f z0 z0" |
|
4116 by (rule residue_simple_pole assms)+ |
|
4117 also have "\<dots> = c" |
|
4118 using assms by (intro pol_poly_eqI[of A z0 f g c F]) auto |
|
4119 finally show ?thesis . |
|
4120 qed |
|
4121 |
|
4122 (* TODO: This is a mess and could be done much more easily if we had |
|
4123 a nice compositional theory of poles and zeros *) |
|
4124 lemma |
|
4125 assumes "open s" "connected s" "z \<in> s" "f holomorphic_on s" "g holomorphic_on s" |
|
4126 assumes "(g has_field_derivative g') (at z)" |
|
4127 assumes "f z \<noteq> 0" "g z = 0" "g' \<noteq> 0" |
|
4128 shows porder_simple_pole_deriv: "porder (\<lambda>w. f w / g w) z = 1" |
|
4129 and residue_simple_pole_deriv: "residue (\<lambda>w. f w / g w) z = f z / g'" |
|
4130 proof - |
|
4131 have "\<exists>w\<in>s. g w \<noteq> 0" |
|
4132 proof (rule ccontr) |
|
4133 assume *: "\<not>(\<exists>w\<in>s. g w \<noteq> 0)" |
|
4134 have **: "eventually (\<lambda>w. w \<in> s) (nhds z)" |
|
4135 by (intro eventually_nhds_in_open assms) |
|
4136 from * have "deriv g z = deriv (\<lambda>_. 0) z" |
|
4137 by (intro deriv_cong_ev eventually_mono [OF **]) auto |
|
4138 also have "\<dots> = 0" by simp |
|
4139 also from assms have "deriv g z = g'" by (auto dest: DERIV_imp_deriv) |
|
4140 finally show False using \<open>g' \<noteq> 0\<close> by contradiction |
|
4141 qed |
|
4142 then obtain w where w: "w \<in> s" "g w \<noteq> 0" by blast |
|
4143 from isolated_zeros[OF assms(5) assms(1-3,8) w] |
|
4144 obtain r where r: "r > 0" "ball z r \<subseteq> s" "\<And>w. w \<in> ball z r - {z} \<Longrightarrow> g w \<noteq> 0" |
|
4145 by blast |
|
4146 from assms r have holo: "(\<lambda>w. f w / g w) holomorphic_on ball z r - {z}" |
|
4147 by (auto intro!: holomorphic_intros) |
|
4148 |
|
4149 have "eventually (\<lambda>w. w \<in> ball z r - {z}) (at z)" |
|
4150 using eventually_at_ball'[OF r(1), of z UNIV] by auto |
|
4151 hence "eventually (\<lambda>w. g w \<noteq> 0) (at z)" |
|
4152 by eventually_elim (use r in auto) |
|
4153 moreover have "continuous_on s g" |
|
4154 by (intro holomorphic_on_imp_continuous_on) fact |
|
4155 with assms have "isCont g z" |
|
4156 by (auto simp: continuous_on_eq_continuous_at) |
|
4157 ultimately have "filterlim g (at 0) (at z)" |
|
4158 using \<open>g z = 0\<close> by (auto simp: filterlim_at isCont_def) |
|
4159 moreover have "continuous_on s f" by (intro holomorphic_on_imp_continuous_on) fact |
|
4160 with assms have "isCont f z" |
|
4161 by (auto simp: continuous_on_eq_continuous_at) |
|
4162 ultimately have pole: "is_pole (\<lambda>w. f w / g w) z" |
|
4163 unfolding is_pole_def using \<open>f z \<noteq> 0\<close> |
|
4164 by (intro filterlim_divide_at_infinity[of _ "f z"]) (auto simp: isCont_def) |
|
4165 |
|
4166 have "continuous_on s f" by (intro holomorphic_on_imp_continuous_on) fact |
|
4167 moreover have "open (-{0::complex})" by auto |
|
4168 ultimately have "open (f -` (-{0}) \<inter> s)" using \<open>open s\<close> |
|
4169 by (subst (asm) continuous_on_open_vimage) blast+ |
|
4170 moreover have "z \<in> f -` (-{0}) \<inter> s" using assms by auto |
|
4171 ultimately obtain r' where r': "r' > 0" "ball z r' \<subseteq> f -` (-{0}) \<inter> s" |
|
4172 unfolding open_contains_ball by blast |
|
4173 |
|
4174 let ?D = "\<lambda>w. (f w * deriv g w - g w * deriv f w) / f w ^ 2" |
|
4175 show "porder (\<lambda>w. f w / g w) z = 1" |
|
4176 proof (rule simple_poleI') |
|
4177 show "open (ball z (min r r'))" "connected (ball z (min r r'))" "z \<in> ball z (min r r')" |
|
4178 using r'(1) r(1) by auto |
|
4179 next |
|
4180 fix w assume "w \<in> ball z (min r r') - {z}" |
|
4181 with r' have "w \<in> s" "f w \<noteq> 0" by auto |
|
4182 have "((\<lambda>w. g w / f w) has_field_derivative ?D w) (at w)" |
|
4183 by (rule derivative_eq_intros holomorphic_derivI[OF assms(4)] |
|
4184 holomorphic_derivI[OF assms(5)] | fact)+ |
|
4185 (simp_all add: algebra_simps power2_eq_square) |
|
4186 thus "((\<lambda>w. inverse (f w / g w)) has_field_derivative ?D w) (at w)" |
|
4187 by (simp add: divide_simps) |
|
4188 next |
|
4189 from r' show "?D holomorphic_on ball z (min r r')" |
|
4190 by (intro holomorphic_intros holomorphic_on_subset[OF assms(4)] |
|
4191 holomorphic_on_subset[OF assms(5)]) auto |
|
4192 next |
|
4193 from assms have "deriv g z = g'" |
|
4194 by (auto dest: DERIV_imp_deriv) |
|
4195 with assms r' show "(f z * deriv g z - g z * deriv f z) / (f z)\<^sup>2 \<noteq> 0" |
|
4196 by simp |
|
4197 qed (insert pole holo, auto) |
|
4198 |
|
4199 show "residue (\<lambda>w. f w / g w) z = f z / g'" |
|
4200 proof (rule residue_simple_pole_limit) |
|
4201 show "porder (\<lambda>w. f w / g w) z = 1" by fact |
|
4202 from r show "open (ball z r)" "z \<in> ball z r" by auto |
|
4203 |
|
4204 have "((\<lambda>w. (f w * (w - z)) / g w) \<longlongrightarrow> f z / g') (at z)" |
|
4205 proof (rule lhopital_complex_simple) |
|
4206 show "((\<lambda>w. f w * (w - z)) has_field_derivative f z) (at z)" |
|
4207 using assms by (auto intro!: derivative_eq_intros holomorphic_derivI[OF assms(4)]) |
|
4208 show "(g has_field_derivative g') (at z)" by fact |
|
4209 qed (insert assms, auto) |
|
4210 thus "((\<lambda>w. (f w / g w) * (w - z)) \<longlongrightarrow> f z / g') (at z)" |
|
4211 by (simp add: divide_simps) |
|
4212 qed (insert holo pole, auto simp: filterlim_ident) |
|
4213 qed |
|
4214 |
3913 end |
4215 end |