diff -r 88f101c3cfe2 -r 111b1b2a2d13 src/HOL/Complex_Analysis/Meromorphic.thy --- a/src/HOL/Complex_Analysis/Meromorphic.thy Tue Apr 15 23:04:44 2025 +0200 +++ b/src/HOL/Complex_Analysis/Meromorphic.thy Tue Apr 15 15:17:25 2025 +0200 @@ -242,6 +242,94 @@ using False remove_sings_eqI by auto qed simp +lemma remove_sings_analytic_on: + assumes "isolated_singularity_at f z" "f \z\ c" + shows "remove_sings f analytic_on {z}" +proof - + from assms(1) obtain A where A: "open A" "z \ A" "f holomorphic_on (A - {z})" + using analytic_imp_holomorphic isolated_singularity_at_iff_analytic_nhd by auto + have ana: "f analytic_on (A - {z})" + by (subst analytic_on_open) (use A in auto) + + have "remove_sings f holomorphic_on A" + proof (rule no_isolated_singularity) + have "f holomorphic_on (A - {z})" + by fact + moreover have "remove_sings f holomorphic_on (A - {z}) \ f holomorphic_on (A - {z})" + by (intro holomorphic_cong remove_sings_at_analytic) (auto intro!: analytic_on_subset[OF ana]) + ultimately show "remove_sings f holomorphic_on (A - {z})" + by blast + hence "continuous_on (A-{z}) (remove_sings f)" + by (intro holomorphic_on_imp_continuous_on) + moreover have "isCont (remove_sings f) z" + using assms isCont_def remove_sings_eqI tendsto_remove_sings_iff by blast + ultimately show "continuous_on A (remove_sings f)" + by (metis A(1) DiffI closed_singleton continuous_on_eq_continuous_at open_Diff singletonD) + qed (use A(1) in auto) + thus ?thesis + using A(1,2) analytic_at by blast +qed + +lemma residue_remove_sings [simp]: + assumes "isolated_singularity_at f z" + shows "residue (remove_sings f) z = residue f z" +proof - + from assms have "eventually (\w. remove_sings f w = f w) (at z)" + using eventually_remove_sings_eq_at by blast + then obtain A where A: "open A" "z \ A" "\w. w \ A - {z} \ remove_sings f w = f w" + by (subst (asm) eventually_at_topological) blast + from A(1,2) obtain \ where \: "\ > 0" "cball z \ \ A" + using open_contains_cball_eq by blast + hence eq: "remove_sings f w = f w" if "w \ cball z \ - {z}" for w + using that A \ by blast + + define P where "P = (\f c \. (f has_contour_integral of_real (2 * pi) * \ * c) (circlepath z \))" + have "P (remove_sings f) c \ \ P f c \" if "0 < \" "\ < \" for c \ + unfolding P_def using \\ > 0\ that by (intro has_contour_integral_cong) (auto simp: eq) + hence *: "(\\>0. \ < e \ P (remove_sings f) c \) \ (\\>0. \ < e \ P f c \)" if "e \ \" for c e + using that by force + have **: "(\e>0. \\>0. \ < e \ P (remove_sings f) c \) \ (\e>0. \\>0. \ < e \ P f c \)" for c + proof + assume "(\e>0. \\>0. \ < e \ P (remove_sings f) c \)" + then obtain e where "e > 0" "\\>0. \ < e \ P (remove_sings f) c \" + by blast + thus "(\e>0. \\>0. \ < e \ P f c \)" + by (intro exI[of _ "min e \"]) (use *[of "min e \" c] \(1) in auto) + next + assume "(\e>0. \\>0. \ < e \ P f c \)" + then obtain e where "e > 0" "\\>0. \ < e \ P f c \" + by blast + thus "(\e>0. \\>0. \ < e \ P (remove_sings f) c \)" + by (intro exI[of _ "min e \"]) (use *[of "min e \" c] \(1) in auto) + qed + show ?thesis + unfolding residue_def by (intro arg_cong[of _ _ Eps] ext **[unfolded P_def]) +qed + +lemma remove_sings_shift_0: + "remove_sings f z = remove_sings (\w. f (z + w)) 0" +proof (cases "\c. f \z\ c") + case True + then obtain c where c: "f \z\ c" + by blast + from c have "remove_sings f z = c" + by (rule remove_sings_eqI) + moreover have "remove_sings (\w. f (z + w)) 0 = c" + by (rule remove_sings_eqI) (use c in \simp_all add: at_to_0' filterlim_filtermap add_ac\) + ultimately show ?thesis + by simp +next + case False + hence "\(\c. (\w. f (z + w)) \0\ c)" + by (simp add: at_to_0' filterlim_filtermap add_ac) + with False show ?thesis + by (simp add: remove_sings_def) +qed + +lemma remove_sings_shift_0': + "NO_MATCH 0 z \ remove_sings f z = remove_sings (\w. f (z + w)) 0" + by (rule remove_sings_shift_0) + subsection \Meromorphicity\ @@ -735,6 +823,37 @@ using eq[OF w not_pole[OF w]] . qed +lemma nicely_meromorphic_on_unop: + assumes "f nicely_meromorphic_on A" + assumes "f meromorphic_on A \ (\z. h (f z)) meromorphic_on A" + assumes "\z. z \ A \ is_pole f z \ is_pole (\z. h (f z)) z" + assumes "\z. z \ f ` A \ isCont h z" + assumes "h 0 = 0" + shows "(\z. h (f z)) nicely_meromorphic_on A" + unfolding nicely_meromorphic_on_def +proof (intro conjI ballI) + show "(\z. h (f z)) meromorphic_on A" + using assms(1,2) by (auto simp: nicely_meromorphic_on_def) +next + fix z assume z: "z \ A" + hence "is_pole f z \ f z = 0 \ f \z\ f z" + using assms by (auto simp: nicely_meromorphic_on_def) + thus "is_pole (\z. h (f z)) z \ h (f z) = 0 \ (\z. h (f z)) \z\ h (f z)" + proof (rule disj_forward) + assume "is_pole f z \ f z = 0" + thus "is_pole (\z. h (f z)) z \ h (f z) = 0" + using assms z by auto + next + assume *: "f \z\ f z" + from z assms have "isCont h (f z)" + by auto + with * show "(\z. h (f z)) \z\ h (f z)" + using continuous_within continuous_within_compose3 by blast + qed +qed + + + subsection \Closure properties and proofs for individual functions\ lemma meromorphic_on_const [intro, meromorphic_intros]: "(\_. c) meromorphic_on A" @@ -848,6 +967,33 @@ by (rule laurent_expansion_intros exI ballI assms[THEN meromorphic_on_imp_has_laurent_expansion] | assumption)+ +lemma nicely_meromorphic_on_const [intro]: "(\_. c) nicely_meromorphic_on A" + unfolding nicely_meromorphic_on_def by auto + +lemma nicely_meromorphic_on_cmult_left [intro]: + assumes "f nicely_meromorphic_on A" + shows "(\z. c * f z) nicely_meromorphic_on A" +proof (cases "c = 0") + case [simp]: False + show ?thesis + using assms by (rule nicely_meromorphic_on_unop) (auto intro!: meromorphic_intros) +qed (auto intro!: nicely_meromorphic_on_const) + +lemma nicely_meromorphic_on_cmult_right [intro]: + assumes "f nicely_meromorphic_on A" + shows "(\z. f z * c) nicely_meromorphic_on A" + using nicely_meromorphic_on_cmult_left[OF assms, of c] by (simp add: mult.commute) + +lemma nicely_meromorphic_on_scaleR [intro]: + assumes "f nicely_meromorphic_on A" + shows "(\z. c *\<^sub>R f z) nicely_meromorphic_on A" + using assms by (auto simp: scaleR_conv_of_real) + +lemma nicely_meromorphic_on_uminus [intro]: + assumes "f nicely_meromorphic_on A" + shows "(\z. -f z) nicely_meromorphic_on A" + using nicely_meromorphic_on_cmult_left[OF assms, of "-1"] by simp + lemma meromorphic_on_If [meromorphic_intros]: assumes "f meromorphic_on A" "g meromorphic_on B" assumes "\z. z \ A \ z \ B \ f z = g z" "open A" "open B" "C \ A \ B" @@ -954,6 +1100,31 @@ by eventually_elim auto qed +lemma remove_sings_constant_on_open_iff: + assumes "f meromorphic_on A" "open A" + shows "remove_sings f constant_on A \ (\c. \\<^sub>\x\A. f x = c)" +proof + assume "remove_sings f constant_on A" + then obtain c where c: "remove_sings f z = c" if "z \ A" for z + using that by (auto simp: constant_on_def) + have "\\<^sub>\x\A. x \ A" + using \open A\ by (simp add: eventually_in_cosparse) + hence "\\<^sub>\x\A. f x = c" + using eventually_remove_sings_eq[OF assms(1)] by eventually_elim (use c in auto) + thus "\c. \\<^sub>\x\A. f x = c" + by blast +next + assume "\c. \\<^sub>\x\A. f x = c" + then obtain c where c: "\\<^sub>\x\A. f x = c" + by blast + have "\\<^sub>\x\A. remove_sings f x = c" + using eventually_remove_sings_eq[OF assms(1)] c by eventually_elim auto + hence "remove_sings f z = c" if "z \ A" for z using that + by (meson assms(2) c eventually_cosparse_open_eq remove_sings_eqI tendsto_eventually) + thus "remove_sings f constant_on A" + unfolding constant_on_def by blast +qed + text \ A meromorphic function on a connected domain takes any given value either almost everywhere @@ -1274,4 +1445,418 @@ by (auto simp: constant_on_def) qed + +subsection \More on poles and zeros\ + +lemma zorder_prod: + assumes "\x. x \ A \ f x meromorphic_on {z}" + assumes "eventually (\z. (\x\A. f x z) \ 0) (at z)" + shows "zorder (\z. \x\A. f x z) z = (\x\A. zorder (f x) z)" + using assms +proof (induction A rule: infinite_finite_induct) + case (insert a A) + have "zorder (\z. \x\insert a A. f x z) z = zorder (\z. f a z * (\x\A. f x z)) z" + using insert.hyps by simp + also have "\ = zorder (f a) z + zorder (\z. \x\A. f x z) z" + proof (subst zorder_mult) + have "\\<^sub>F z in at z. f a z \ 0" + using insert.prems(2) by eventually_elim (use insert.hyps in auto) + thus "\\<^sub>F z in at z. f a z \ 0" + using eventually_frequently at_neq_bot by blast + next + have "\\<^sub>F z in at z. (\x\A. f x z) \ 0" + using insert.prems(2) by eventually_elim (use insert.hyps in auto) + thus "\\<^sub>F z in at z. (\x\A. f x z) \ 0" + using eventually_frequently at_neq_bot by blast + qed (use insert.prems in \auto intro!: meromorphic_intros\) + also have "zorder (\z. \x\A. f x z) z = (\x\A. zorder (f x) z)" + by (intro insert.IH) (use insert.prems insert.hyps in \auto elim!: eventually_mono\) + also have "zorder (f a) z + \ = (\x\insert a A. zorder (f x) z)" + using insert.hyps by simp + finally show ?case . +qed auto + +lemma zorder_scale: + assumes "f meromorphic_on {a * z}" "a \ 0" + shows "zorder (\w. f (a * w)) z = zorder f (a * z)" +proof (cases "eventually (\z. f z = 0) (at (a * z))") + case True + hence ev: "eventually (\z. f (a * z) = 0) (at z)" + proof (rule eventually_compose_filterlim) + show "filterlim ((*) a) (at (a * z)) (at z)" + proof (rule filterlim_atI) + show "\\<^sub>F x in at z. a * x \ a * z" + using eventually_neq_at_within[of z z] by eventually_elim (use \a \ 0\ in auto) + qed (auto intro!: tendsto_intros) + qed + + have "zorder (\w. f (a * w)) z = zorder (\_. 0) z" + by (rule zorder_cong) (use ev in auto) + also have "\ = zorder (\_. 0) (a * z)" + by (simp add: zorder_shift') + also have "\ = zorder f (a * z)" + by (rule zorder_cong) (use True in auto) + finally show ?thesis . +next + case False + define G where "G = fps_const a * fps_X" + have "zorder (f \ (\z. a * z)) z = zorder f (a * z) * int (subdegree G)" + proof (rule zorder_compose) + show "isolated_singularity_at f (a * z)" "not_essential f (a * z)" + using assms(1) by (auto simp: meromorphic_on_altdef) + next + have "(\x. a * x) has_fps_expansion G" + unfolding G_def by (intro fps_expansion_intros) + thus "(\x. a * (z + x) - a * z) has_fps_expansion G" + by (simp add: algebra_simps) + next + show "\\<^sub>F w in at (a * z). f w \ 0" using False + by (metis assms(1) has_laurent_expansion_isolated has_laurent_expansion_not_essential + meromorphic_on_def non_zero_neighbour not_eventually singletonI) + qed (use \a \ 0\ in \auto simp: G_def\) + also have "subdegree G = 1" + using \a \ 0\ by (simp add: G_def) + finally show ?thesis + by (simp add: o_def) +qed + +lemma zorder_uminus: + assumes "f meromorphic_on {-z}" + shows "zorder (\w. f (-w)) z = zorder f (-z)" + using assms zorder_scale[of f "-1" z] by simp + +lemma is_pole_deriv_iff: + assumes "f meromorphic_on {z}" + shows "is_pole (deriv f) z \ is_pole f z" +proof - + from assms obtain F where F: "(\w. f (z + w)) has_laurent_expansion F" + by (auto simp: meromorphic_on_def) + have "deriv (\w. f (z + w)) has_laurent_expansion fls_deriv F" + using F by (rule has_laurent_expansion_deriv) + also have "deriv (\w. f (z + w)) = (\w. deriv f (z + w))" + by (simp add: deriv_shift_0' add_ac o_def fun_eq_iff) + finally have F': "(\w. deriv f (z + w)) has_laurent_expansion fls_deriv F" . + have "is_pole (deriv f) z \ fls_subdegree (fls_deriv F) < 0" + using is_pole_fls_subdegree_iff[OF F'] by simp + also have "\ \ fls_subdegree F < 0" + using fls_deriv_subdegree0 fls_subdegree_deriv linorder_less_linear by fastforce + also have "\ \ is_pole f z" + using F by (simp add: has_laurent_expansion_imp_is_pole_iff) + finally show ?thesis . +qed + +lemma isolated_zero_remove_sings_iff [simp]: + assumes "isolated_singularity_at f z" + shows "isolated_zero (remove_sings f) z \ isolated_zero f z" +proof - + have *: "(\\<^sub>F x in at z. remove_sings f x \ 0) \ (\\<^sub>F x in at z. f x \ 0)" + proof + assume "(\\<^sub>F x in at z. f x \ 0)" + thus "(\\<^sub>F x in at z. remove_sings f x \ 0)" + using eventually_remove_sings_eq_at[OF assms] + by eventually_elim auto + next + assume "(\\<^sub>F x in at z. remove_sings f x \ 0)" + thus "(\\<^sub>F x in at z. f x \ 0)" + using eventually_remove_sings_eq_at[OF assms] + by eventually_elim auto + qed + show ?thesis + unfolding isolated_zero_def using assms * by simp +qed + +lemma zorder_isolated_zero_pos: + assumes "isolated_zero f z" "f analytic_on {z}" + shows "zorder f z > 0" +proof (subst zorder_pos_iff' [OF assms(2)]) + show "f z = 0" + using assms by (simp add: zero_isolated_zero_analytic) +next + have "\\<^sub>F z in at z. f z \ 0" + using assms by (auto simp: isolated_zero_def) + thus "\\<^sub>F z in at z. f z \ 0" + by (simp add: eventually_frequently) +qed + +lemma zorder_isolated_zero_pos': + assumes "isolated_zero f z" "isolated_singularity_at f z" + shows "zorder f z > 0" +proof - + from assms(1) have "f \z\ 0" + by (simp add: isolated_zero_def) + with assms(2) have "remove_sings f analytic_on {z}" + by (intro remove_sings_analytic_on) + hence "zorder (remove_sings f) z > 0" + using assms by (intro zorder_isolated_zero_pos) auto + thus ?thesis + using assms by simp +qed + +lemma zero_isolated_zero_nicely_meromorphic: + assumes "isolated_zero f z" "f nicely_meromorphic_on {z}" + shows "f z = 0" +proof - + have "\is_pole f z" + using assms pole_is_not_zero by blast + with assms(2) have "f analytic_on {z}" + by (simp add: nicely_meromorphic_on_imp_analytic_at) + with zero_isolated_zero_analytic assms(1) show ?thesis + by blast +qed + +lemma meromorphic_on_imp_not_zero_cosparse: + assumes "f meromorphic_on A" + shows "eventually (\z. \isolated_zero f z) (cosparse A)" +proof - + have "eventually (\z. \is_pole (\z. inverse (f z)) z) (cosparse A)" + by (intro meromorphic_on_imp_not_pole_cosparse meromorphic_intros assms) + thus ?thesis + by (simp add: is_pole_inverse_iff) +qed + +lemma nicely_meromorphic_on_inverse [meromorphic_intros]: + assumes "f nicely_meromorphic_on A" + shows "(\x. inverse (f x)) nicely_meromorphic_on A" + unfolding nicely_meromorphic_on_def +proof (intro conjI ballI) + fix z assume z: "z \ A" + have "is_pole f z \ f z = 0 \ f \z\ f z" + using assms z by (auto simp: nicely_meromorphic_on_def) + thus "is_pole (\x. inverse (f x)) z \ inverse (f z) = 0 \ + (\x. inverse (f x)) \z\ inverse (f z)" + proof + assume "is_pole f z \ f z = 0" + hence "isolated_zero (\z. inverse (f z)) z \ inverse (f z) = 0" + by (auto simp: isolated_zero_inverse_iff) + hence "(\x. inverse (f x)) \z\ inverse (f z)" + by (simp add: isolated_zero_def) + thus ?thesis .. + next + assume lim: "f \z\ f z" + hence ana: "f analytic_on {z}" + using assms is_pole_def nicely_meromorphic_on_imp_analytic_at + not_tendsto_and_filterlim_at_infinity trivial_limit_at z by blast + show ?thesis + proof (cases "isolated_zero f z") + case True + with lim have "f z = 0" + using continuous_within zero_isolated_zero by blast + with True have "is_pole (\z. inverse (f z)) z \ inverse (f z) = 0" + by (auto simp: is_pole_inverse_iff) + thus ?thesis .. + next + case False + hence "f z \ 0 \ (f z = 0 \ eventually (\z. f z = 0) (at z))" + using non_isolated_zero_imp_eventually_zero[OF ana] by blast + thus ?thesis + proof (elim disjE conjE) + assume "f z \ 0" + hence "(\z. inverse (f z)) \z\ inverse (f z)" + by (intro tendsto_intros lim) + thus ?thesis .. + next + assume *: "f z = 0" "eventually (\z. f z = 0) (at z)" + have "eventually (\z. inverse (f z) = 0) (at z)" + using *(2) by eventually_elim auto + hence "(\z. inverse (f z)) \z\ 0" + by (simp add: tendsto_eventually) + with *(1) show ?thesis + by auto + qed + qed + qed +qed (use assms in \auto simp: nicely_meromorphic_on_def intro!: meromorphic_intros\) + +lemma is_pole_zero_at_nicely_mero: + assumes "f nicely_meromorphic_on A" "is_pole f z" "z \ A" + shows "f z = 0" + by (meson assms at_neq_bot + is_pole_def nicely_meromorphic_on_def + not_tendsto_and_filterlim_at_infinity) + +lemma zero_or_pole: + assumes mero: "f nicely_meromorphic_on A" + and "z \ A" "f z = 0" and event: "\\<^sub>F x in at z. f x \ 0" + shows "isolated_zero f z \ is_pole f z" +proof - + from mero \z\A\ + have "(is_pole f z \ f z=0) \ f \z\ f z" + unfolding nicely_meromorphic_on_def by simp + moreover have "isolated_zero f z" if "f \z\ f z" + unfolding isolated_zero_def + using \f z=0\ that event tendsto_nhds_iff by auto + ultimately show ?thesis by auto +qed + +lemma isolated_zero_fls_subdegree_iff: + assumes "(\x. f (z + x)) has_laurent_expansion F" + shows "isolated_zero f z \ fls_subdegree F > 0" + using assms unfolding isolated_zero_def + by (metis Lim_at_zero fls_zero_subdegree has_laurent_expansion_eventually_nonzero_iff not_le + order.refl tendsto_0_subdegree_iff_0) + +lemma zorder_pos_imp_isolated_zero: + assumes "f meromorphic_on {z}" "eventually (\z. f z \ 0) (at z)" "zorder f z > 0" + shows "isolated_zero f z" + using assms isolated_zero_fls_subdegree_iff + by (metis has_laurent_expansion_eventually_nonzero_iff + has_laurent_expansion_zorder insertI1 + meromorphic_on_def) + +lemma zorder_neg_imp_is_pole: + assumes "f meromorphic_on {z}" "eventually (\z. f z \ 0) (at z)" "zorder f z < 0" + shows "is_pole f z" + using assms is_pole_fls_subdegree_iff at_neq_bot eventually_frequently meromorphic_at_iff + neg_zorder_imp_is_pole by blast + +lemma not_pole_not_isolated_zero_imp_zorder_eq_0: + assumes "f meromorphic_on {z}" "\is_pole f z" "\isolated_zero f z" "frequently (\z. f z \ 0) (at z)" + shows "zorder f z = 0" +proof - + have "remove_sings f analytic_on {z}" + using assms meromorphic_at_iff not_essential_def remove_sings_analytic_on by blast + moreover from this and assms have "remove_sings f z \ 0" + using isolated_zero_def meromorphic_at_iff non_zero_neighbour remove_sings_eq_0_iff by blast + moreover have "frequently (\z. remove_sings f z \ 0) (at z)" + using assms analytic_at_neq_imp_eventually_neq calculation(1,2) + eventually_frequently trivial_limit_at by blast + ultimately have "zorder (remove_sings f) z = 0" + using zorder_eq_0_iff by blast + thus ?thesis + using assms(1) meromorphic_at_iff by auto +qed + +lemma not_essential_compose: + assumes "not_essential f (g z)" "g analytic_on {z}" + shows "not_essential (\x. f (g x)) z" +proof (cases "isolated_zero (\w. g w - g z) z") + case False + hence "eventually (\w. g w - g z = 0) (nhds z)" + by (intro non_isolated_zero_imp_eventually_zero' analytic_intros assms) auto + hence "not_essential (\x. f (g x)) z \ not_essential (\_. f (g z)) z" + by (intro not_essential_cong refl) + (auto elim!: eventually_mono simp: eventually_at_filter) + thus ?thesis + by (simp add: not_essential_const) +next + case True + hence ev: "eventually (\w. g w \ g z) (at z)" + by (auto simp: isolated_zero_def) + from assms consider c where "f \g z\ c" | "is_pole f (g z)" + by (auto simp: not_essential_def) + have "isCont g z" + by (rule analytic_at_imp_isCont) fact + hence lim: "g \z\ g z" + using isContD by blast + + from assms(1) consider c where "f \g z\ c" | "is_pole f (g z)" + unfolding not_essential_def by blast + thus ?thesis + proof cases + fix c assume "f \g z\ c" + hence "(\x. f (g x)) \z\ c" + by (rule filterlim_compose) (use lim ev in \auto simp: filterlim_at\) + thus ?thesis + by (auto simp: not_essential_def) + next + assume "is_pole f (g z)" + hence "is_pole (\x. f (g x)) z" + by (rule is_pole_compose) fact+ + thus ?thesis + by (auto simp: not_essential_def) + qed +qed + + +lemma isolated_singularity_at_compose: + assumes "isolated_singularity_at f (g z)" "g analytic_on {z}" + shows "isolated_singularity_at (\x. f (g x)) z" +proof (cases "isolated_zero (\w. g w - g z) z") + case False + hence "eventually (\w. g w - g z = 0) (nhds z)" + by (intro non_isolated_zero_imp_eventually_zero') (use assms in \auto intro!: analytic_intros\) + hence "isolated_singularity_at (\x. f (g x)) z \ isolated_singularity_at (\_. f (g z)) z" + by (intro isolated_singularity_at_cong refl) + (auto elim!: eventually_mono simp: eventually_at_filter) + thus ?thesis + by (simp add: isolated_singularity_at_const) +next + case True + from assms(1) obtain r where r: "r > 0" "f analytic_on ball (g z) r - {g z}" + by (auto simp: isolated_singularity_at_def) + hence holo_f: "f holomorphic_on ball (g z) r - {g z}" + by (subst (asm) analytic_on_open) auto + from assms(2) obtain r' where r': "r' > 0" "g holomorphic_on ball z r'" + by (auto simp: analytic_on_def) + + have "continuous_on (ball z r') g" + using holomorphic_on_imp_continuous_on r' by blast + hence "isCont g z" + using r' by (subst (asm) continuous_on_eq_continuous_at) auto + hence "g \z\ g z" + using isContD by blast + hence "eventually (\w. g w \ ball (g z) r) (at z)" + using \r > 0\ unfolding tendsto_def by force + moreover have "eventually (\w. g w \ g z) (at z)" using True + by (auto simp: isolated_zero_def elim!: eventually_mono) + ultimately have "eventually (\w. g w \ ball (g z) r - {g z}) (at z)" + by eventually_elim auto + then obtain r'' where r'': "r'' > 0" "\w\ball z r''-{z}. g w \ ball (g z) r - {g z}" + unfolding eventually_at_filter eventually_nhds_metric ball_def + by (auto simp: dist_commute) + have "f \ g holomorphic_on ball z (min r' r'') - {z}" + proof (rule holomorphic_on_compose_gen) + show "g holomorphic_on ball z (min r' r'') - {z}" + by (rule holomorphic_on_subset[OF r'(2)]) auto + show "f holomorphic_on ball (g z) r - {g z}" + by fact + show "g ` (ball z (min r' r'') - {z}) \ ball (g z) r - {g z}" + using r'' by force + qed + hence "f \ g analytic_on ball z (min r' r'') - {z}" + by (subst analytic_on_open) auto + thus ?thesis using \r' > 0\ \r'' > 0\ + by (auto simp: isolated_singularity_at_def o_def intro!: exI[of _ "min r' r''"]) +qed + +lemma is_pole_power_int_0: + assumes "f analytic_on {x}" "isolated_zero f x" "n < 0" + shows "is_pole (\x. f x powi n) x" +proof - + have "f \x\ f x" + using assms(1) by (simp add: analytic_at_imp_isCont isContD) + with assms show ?thesis + unfolding is_pole_def + by (intro filterlim_power_int_neg_at_infinity) (auto simp: isolated_zero_def) +qed + +lemma isolated_zero_imp_not_constant_on: + fixes f :: "'a :: perfect_space \ 'b :: real_normed_div_algebra" + assumes "isolated_zero f x" "x \ A" "open A" + shows "\f constant_on A" +proof + assume "f constant_on A" + then obtain c where c: "\x. x \ A \ f x = c" + by (auto simp: constant_on_def) + have "eventually (\z. z \ A - {x}) (at x)" + by (intro eventually_at_in_open assms) + hence "eventually (\z. f z = c) (at x)" + by eventually_elim (use c in auto) + hence "f \x\ c" + using tendsto_eventually by blast + moreover from assms have "f \x\ 0" + by (simp add: isolated_zero_def) + ultimately have [simp]: "c = 0" + using tendsto_unique[of "at x" f c 0] by (simp add: at_neq_bot) + + have "eventually (\x. f x \ 0) (at x)" + using assms by (auto simp: isolated_zero_def) + moreover have "eventually (\x. x \ A) (at x)" + using assms by (intro eventually_at_in_open') auto + ultimately have "eventually (\x. False) (at x)" + by eventually_elim (use c in auto) + thus False + by simp +qed + end