# HG changeset patch # User paulson # Date 1675868724 0 # Node ID 607e1e345e8f6dd139f8ad298c50a05177d65b86 # Parent 0c073854e6cea441c3b5c66c28b5d52a4c847ec7 Lots of new material chiefly about complex analysis diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Analysis/Complex_Transcendental.thy --- a/src/HOL/Analysis/Complex_Transcendental.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Analysis/Complex_Transcendental.thy Wed Feb 08 15:05:24 2023 +0000 @@ -2649,7 +2649,7 @@ lemma powr_nat': "(z :: complex) \ 0 \ n \ 0 \ z powr of_nat n = z ^ n" by (cases "z = 0") (auto simp: powr_nat) - + lemma norm_powr_real: "w \ \ \ 0 < Re w \ norm(w powr z) = exp(Re z * ln(Re w))" using Ln_Reals_eq norm_exp_eq_Re by (auto simp: Im_Ln_eq_0 powr_def norm_complex_def) @@ -2694,12 +2694,15 @@ shows "z powr of_int n = (if n\0 then z^nat n else inverse (z^nat (-n)))" by (metis assms not_le of_int_of_nat powr_complexpow powr_minus) +lemma complex_powr_of_int: "z \ 0 \ n \ 0 \ z powr of_int n = (z :: complex) powi n" + by (cases "z = 0 \ n = 0") + (auto simp: power_int_def powr_minus powr_nat powr_of_int power_0_left power_inverse) + lemma powr_Reals_eq: "\x \ \; y \ \; Re x \ 0\ \ x powr y = of_real (Re x powr Re y)" by (metis of_real_Re powr_of_real) lemma norm_powr_real_mono: - "\w \ \; 1 < Re w\ - \ cmod(w powr z1) \ cmod(w powr z2) \ Re z1 \ Re z2" + "\w \ \; 1 < Re w\ \ cmod(w powr z1) \ cmod(w powr z2) \ Re z1 \ Re z2" by (auto simp: powr_def algebra_simps Reals_def Ln_of_real) lemma powr_times_real: diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Analysis/Connected.thy --- a/src/HOL/Analysis/Connected.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Analysis/Connected.thy Wed Feb 08 15:05:24 2023 +0000 @@ -238,10 +238,7 @@ connected_component_set S x \ T \ {}; connected_component_set S y \ T \ {}\ \ connected_component_set S x = connected_component_set S y" -apply (simp add: ex_in_conv [symmetric]) -apply (rule connected_component_eq) -by (metis (no_types, opaque_lifting) connected_component_eq_eq connected_component_in connected_component_maximal subsetD mem_Collect_eq) - + by (metis (full_types) subsetD connected_component_eq connected_component_maximal disjoint_iff_not_equal) lemma Union_connected_component: "\(connected_component_set S ` S) = S" apply (rule subset_antisym) @@ -260,10 +257,36 @@ lemma connected_component_intermediate_subset: "\connected_component_set U a \ T; T \ U\ \ connected_component_set T a = connected_component_set U a" - apply (case_tac "a \ U") - apply (simp add: connected_component_maximal connected_component_mono subset_antisym) - using connected_component_eq_empty by blast + by (metis connected_component_idemp connected_component_mono subset_antisym) + +lemma connected_component_homeomorphismI: + assumes "homeomorphism A B f g" "connected_component A x y" + shows "connected_component B (f x) (f y)" +proof - + from assms obtain T where T: "connected T" "T \ A" "x \ T" "y \ T" + unfolding connected_component_def by blast + have "connected (f ` T)" "f ` T \ B" "f x \ f ` T" "f y \ f ` T" + using assms T continuous_on_subset[of A f T] + by (auto intro!: connected_continuous_image simp: homeomorphism_def) + thus ?thesis + unfolding connected_component_def by blast +qed + +lemma connected_component_homeomorphism_iff: + assumes "homeomorphism A B f g" + shows "connected_component A x y \ x \ A \ y \ A \ connected_component B (f x) (f y)" + by (metis assms connected_component_homeomorphismI connected_component_in homeomorphism_apply1 homeomorphism_sym) + +lemma connected_component_set_homeomorphism: + assumes "homeomorphism A B f g" "x \ A" + shows "connected_component_set B (f x) = f ` connected_component_set A x" (is "?lhs = ?rhs") +proof - + have "y \ ?lhs \ y \ ?rhs" for y + by (smt (verit, best) assms connected_component_homeomorphism_iff homeomorphism_def image_iff mem_Collect_eq) + thus ?thesis + by blast +qed subsection \The set of connected components of a set\ diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Analysis/Elementary_Metric_Spaces.thy --- a/src/HOL/Analysis/Elementary_Metric_Spaces.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Analysis/Elementary_Metric_Spaces.thy Wed Feb 08 15:05:24 2023 +0000 @@ -274,6 +274,48 @@ ultimately show ?thesis by blast qed +lemma frequently_atE: + fixes x :: "'a :: metric_space" + assumes "frequently P (at x within s)" + shows "\f. filterlim f (at x within s) sequentially \ (\n. P (f n))" +proof - + have "\y. y \ s \ (ball x (1 / real (Suc n)) - {x}) \ P y" for n + proof - + have "\z\s. z \ x \ dist z x < (1 / real (Suc n)) \ P z" + by (metis assms divide_pos_pos frequently_at of_nat_0_less_iff zero_less_Suc zero_less_one) + then show ?thesis + by (auto simp: dist_commute conj_commute) + qed + then obtain f where f: "\n. f n \ s \ (ball x (1 / real (Suc n)) - {x}) \ P (f n)" + by metis + have "filterlim f (nhds x) sequentially" + unfolding tendsto_iff + proof clarify + fix e :: real + assume e: "e > 0" + then obtain n where n: "Suc n > 1 / e" + by (meson le_nat_floor lessI not_le) + have "dist (f k) x < e" if "k \ n" for k + proof - + have "dist (f k) x < 1 / real (Suc k)" + using f[of k] by (auto simp: dist_commute) + also have "\ \ 1 / real (Suc n)" + using that by (intro divide_left_mono) auto + also have "\ < e" + using n e by (simp add: field_simps) + finally show ?thesis . + qed + thus "\\<^sub>F k in sequentially. dist (f k) x < e" + unfolding eventually_at_top_linorder by blast + qed + moreover have "f n \ x" for n + using f[of n] by auto + ultimately have "filterlim f (at x within s) sequentially" + using f by (auto simp: filterlim_at) + with f show ?thesis + by blast +qed + subsection \Limit Points\ lemma islimpt_approachable: diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Analysis/Elementary_Normed_Spaces.thy --- a/src/HOL/Analysis/Elementary_Normed_Spaces.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Analysis/Elementary_Normed_Spaces.thy Wed Feb 08 15:05:24 2023 +0000 @@ -659,6 +659,16 @@ lemma bounded_pos_less: "bounded S \ (\b>0. \x\ S. norm x < b)" by (metis bounded_pos le_less_trans less_imp_le linordered_field_no_ub) +lemma bounded_normE: + assumes "bounded A" + obtains B where "B > 0" "\z. z \ A \ norm z \ B" + by (meson assms bounded_pos) + +lemma bounded_normE_less: + assumes "bounded A" + obtains B where "B > 0" "\z. z \ A \ norm z < B" + by (meson assms bounded_pos_less) + lemma Bseq_eq_bounded: fixes f :: "nat \ 'a::real_normed_vector" shows "Bseq f \ bounded (range f)" diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Analysis/Elementary_Topology.thy --- a/src/HOL/Analysis/Elementary_Topology.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Analysis/Elementary_Topology.thy Wed Feb 08 15:05:24 2023 +0000 @@ -758,6 +758,87 @@ by simp qed +(*could prove directly from islimpt_sequential_inj, but only for metric spaces*) +lemma islimpt_sequential: + fixes x :: "'a::first_countable_topology" + shows "x islimpt S \ (\f. (\n::nat. f n \ S - {x}) \ (f \ x) sequentially)" + (is "?lhs = ?rhs") +proof + assume ?lhs + from countable_basis_at_decseq[of x] obtain A where A: + "\i. open (A i)" + "\i. x \ A i" + "\S. open S \ x \ S \ eventually (\i. A i \ S) sequentially" + by blast + define f where "f n = (SOME y. y \ S \ y \ A n \ x \ y)" for n + { + fix n + from \?lhs\ have "\y. y \ S \ y \ A n \ x \ y" + unfolding islimpt_def using A(1,2)[of n] by auto + then have "f n \ S \ f n \ A n \ x \ f n" + unfolding f_def by (rule someI_ex) + then have "f n \ S" "f n \ A n" "x \ f n" by auto + } + then have "\n. f n \ S - {x}" by auto + moreover have "(\n. f n) \ x" + proof (rule topological_tendstoI) + fix S + assume "open S" "x \ S" + from A(3)[OF this] \\n. f n \ A n\ + show "eventually (\x. f x \ S) sequentially" + by (auto elim!: eventually_mono) + qed + ultimately show ?rhs by fast +next + assume ?rhs + then obtain f :: "nat \ 'a" where f: "\n. f n \ S - {x}" and lim: "f \ x" + by auto + show ?lhs + unfolding islimpt_def + proof safe + fix T + assume "open T" "x \ T" + from lim[THEN topological_tendstoD, OF this] f + show "\y\S. y \ T \ y \ x" + unfolding eventually_sequentially by auto + qed +qed + +lemma islimpt_isCont_image: + fixes f :: "'a :: {first_countable_topology, t2_space} \ 'b :: {first_countable_topology, t2_space}" + assumes "x islimpt A" and "isCont f x" and ev: "eventually (\y. f y \ f x) (at x)" + shows "f x islimpt f ` A" +proof - + from assms(1) obtain g where g: "g \ x" "range g \ A - {x}" + unfolding islimpt_sequential by blast + have "filterlim g (at x) sequentially" + using g by (auto simp: filterlim_at intro!: always_eventually) + then obtain N where N: "\n. n \ N \ f (g n) \ f x" + by (metis (mono_tags, lifting) ev eventually_at_top_linorder filterlim_iff) + have "(\x. g (x + N)) \ x" + using g(1) by (rule LIMSEQ_ignore_initial_segment) + hence "(\x. f (g (x + N))) \ f x" + using assms(2) isCont_tendsto_compose by blast + moreover have "range (\x. f (g (x + N))) \ f ` A - {f x}" + using g(2) N by auto + ultimately show ?thesis + unfolding islimpt_sequential by (intro exI[of _ "\x. f (g (x + N))"]) auto +qed + +lemma islimpt_image: + assumes "z islimpt g -` A \ B" "g z \ A" "z \ B" "open B" "continuous_on B g" + shows "g z islimpt A" + unfolding islimpt_def +proof clarify + fix T assume T: "g z \ T" "open T" + have "z \ g -` T \ B" + using T assms by auto + moreover have "open (g -` T \ B)" + using T continuous_on_open_vimage assms by blast + ultimately show "\y\A. y \ T \ y \ g z" + using assms by (metis (mono_tags, lifting) IntD1 islimptE vimageE) +qed + subsection \Interior of a Set\ @@ -845,7 +926,12 @@ lemma islimpt_conv_frequently_at: "x islimpt A \ frequently (\y. y \ A) (at x)" - unfolding islimpt_def eventually_at_filter frequently_def eventually_nhds by blast + by (simp add: frequently_def islimpt_iff_eventually) + +lemma frequently_at_imp_islimpt: + assumes "frequently (\y. y \ A) (at x)" + shows "x islimpt A" + by (simp add: assms islimpt_conv_frequently_at) lemma interior_closed_Un_empty_interior: assumes cS: "closed S" @@ -1350,52 +1436,6 @@ qed qed -(*could prove directly from islimpt_sequential_inj, but only for metric spaces*) -lemma islimpt_sequential: - fixes x :: "'a::first_countable_topology" - shows "x islimpt S \ (\f. (\n::nat. f n \ S - {x}) \ (f \ x) sequentially)" - (is "?lhs = ?rhs") -proof - assume ?lhs - from countable_basis_at_decseq[of x] obtain A where A: - "\i. open (A i)" - "\i. x \ A i" - "\S. open S \ x \ S \ eventually (\i. A i \ S) sequentially" - by blast - define f where "f n = (SOME y. y \ S \ y \ A n \ x \ y)" for n - { - fix n - from \?lhs\ have "\y. y \ S \ y \ A n \ x \ y" - unfolding islimpt_def using A(1,2)[of n] by auto - then have "f n \ S \ f n \ A n \ x \ f n" - unfolding f_def by (rule someI_ex) - then have "f n \ S" "f n \ A n" "x \ f n" by auto - } - then have "\n. f n \ S - {x}" by auto - moreover have "(\n. f n) \ x" - proof (rule topological_tendstoI) - fix S - assume "open S" "x \ S" - from A(3)[OF this] \\n. f n \ A n\ - show "eventually (\x. f x \ S) sequentially" - by (auto elim!: eventually_mono) - qed - ultimately show ?rhs by fast -next - assume ?rhs - then obtain f :: "nat \ 'a" where f: "\n. f n \ S - {x}" and lim: "f \ x" - by auto - show ?lhs - unfolding islimpt_def - proof safe - fix T - assume "open T" "x \ T" - from lim[THEN topological_tendstoD, OF this] f - show "\y\S. y \ T \ y \ x" - unfolding eventually_sequentially by auto - qed -qed - text\These are special for limits out of the same topological space.\ lemma Lim_within_id: "(id \ a) (at a within s)" diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Complex_Analysis/Complex_Singularities.thy --- a/src/HOL/Complex_Analysis/Complex_Singularities.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Complex_Analysis/Complex_Singularities.thy Wed Feb 08 15:05:24 2023 +0000 @@ -26,8 +26,18 @@ lemma is_pole_tendsto: fixes f::"('a::topological_space \ 'b::real_normed_div_algebra)" shows "is_pole f x \ ((inverse o f) \ 0) (at x)" -unfolding is_pole_def -by (auto simp add:filterlim_inverse_at_iff[symmetric] comp_def filterlim_at) + unfolding is_pole_def + by (auto simp add:filterlim_inverse_at_iff[symmetric] comp_def filterlim_at) + +lemma is_pole_shift_0: + fixes f :: "('a::real_normed_vector \ 'b::real_normed_vector)" + shows "is_pole f z \ is_pole (\x. f (z + x)) 0" + unfolding is_pole_def by (subst at_to_0) (auto simp: filterlim_filtermap add_ac) + +lemma is_pole_shift_0': + fixes f :: "('a::real_normed_vector \ 'b::real_normed_vector)" + shows "NO_MATCH 0 z \ is_pole f z \ is_pole (\x. f (z + x)) 0" + by (metis is_pole_shift_0) lemma is_pole_inverse_holomorphic: assumes "open s" @@ -71,6 +81,23 @@ by (intro filterlim_compose[OF filterlim_inverse_at_infinity] tendsto_intros) (auto simp: filterlim_at eventually_at intro!: exI[of _ 1] tendsto_eq_intros) +lemma is_pole_cmult_iff [simp]: + "c \ 0 \ is_pole (\z. c * f z :: 'a :: real_normed_field) z \ is_pole f z" +proof + assume *: "c \ 0" "is_pole (\z. c * f z) z" + have "is_pole (\z. inverse c * (c * f z)) z" unfolding is_pole_def + by (rule tendsto_mult_filterlim_at_infinity tendsto_const)+ (use * in \auto simp: is_pole_def\) + thus "is_pole f z" + using *(1) by (simp add: field_simps) +next + assume *: "c \ 0" "is_pole f z" + show "is_pole (\z. c * f z) z" unfolding is_pole_def + by (rule tendsto_mult_filterlim_at_infinity tendsto_const)+ (use * in \auto simp: is_pole_def\) +qed + +lemma is_pole_uminus_iff [simp]: "is_pole (\z. -f z :: 'a :: real_normed_field) z \ is_pole f z" + using is_pole_cmult_iff[of "-1" f] by (simp del: is_pole_cmult_iff) + lemma is_pole_inverse: "is_pole (\z::complex. 1 / (z - a)) a" using is_pole_inverse_power[of 1 a] by simp @@ -80,7 +107,7 @@ shows "is_pole (\z. f z / g z) z" proof - have "filterlim (\z. f z * inverse (g z)) at_infinity (at z)" - using assms filterlim_compose filterlim_inverse_at_infinity isCont_def + using assms filterlim_compose filterlim_inverse_at_infinity isCont_def tendsto_mult_filterlim_at_infinity by blast thus ?thesis by (simp add: field_split_simps is_pole_def) qed @@ -113,6 +140,62 @@ definition isolated_singularity_at::"[complex \ complex, complex] \ bool" where "isolated_singularity_at f z = (\r>0. f analytic_on ball z r-{z})" +lemma removable_singularity: + assumes "f holomorphic_on A - {x}" "open A" + assumes "f \x\ c" + shows "(\y. if y = x then c else f y) holomorphic_on A" (is "?g holomorphic_on _") +proof - + have "continuous_on A ?g" + unfolding continuous_on_def + proof + fix y assume y: "y \ A" + show "(?g \ ?g y) (at y within A)" + proof (cases "y = x") + case False + have "continuous_on (A - {x}) f" + using assms(1) by (meson holomorphic_on_imp_continuous_on) + hence "(f \ ?g y) (at y within A - {x})" + using False y by (auto simp: continuous_on_def) + also have "?this \ (?g \ ?g y) (at y within A - {x})" + by (intro filterlim_cong refl) (auto simp: eventually_at_filter) + also have "at y within A - {x} = at y within A" + using y assms False + by (intro at_within_nhd[of _ "A - {x}"]) auto + finally show ?thesis . + next + case [simp]: True + have "f \x\ c" + by fact + also have "?this \ (?g \ ?g y) (at y)" + by (intro filterlim_cong) (auto simp: eventually_at_filter) + finally show ?thesis + by (meson Lim_at_imp_Lim_at_within) + qed + qed + moreover { + have "?g holomorphic_on A - {x}" + using assms(1) holomorphic_transform by fastforce + } + ultimately show ?thesis + by (rule no_isolated_singularity) (use assms in auto) +qed + +lemma removable_singularity': + assumes "isolated_singularity_at f z" + assumes "f \z\ c" + shows "(\y. if y = z then c else f y) analytic_on {z}" +proof - + from assms obtain r where r: "r > 0" "f analytic_on ball z r - {z}" + by (auto simp: isolated_singularity_at_def) + have "(\y. if y = z then c else f y) holomorphic_on ball z r" + proof (rule removable_singularity) + show "f holomorphic_on ball z r - {z}" + using r(2) by (subst (asm) analytic_on_open) auto + qed (use assms in auto) + thus ?thesis + using r(1) unfolding analytic_at by (intro exI[of _ "ball z r"]) auto +qed + named_theorems singularity_intros "introduction rules for singularities" lemma holomorphic_factor_unique: @@ -137,7 +220,7 @@ define f' where "f' \ \x. (x - z) powr (n-m)" have "f' z=0" using \n>m\ unfolding f'_def by auto moreover have "continuous F f'" unfolding f'_def F_def continuous_def - using \n>m\ + using \n>m\ by (auto simp add: Lim_ident_at intro!:tendsto_powr_complex_0 tendsto_eq_intros) ultimately have "(f' \ 0) F" unfolding F_def by (simp add: continuous_within) @@ -165,7 +248,7 @@ define f' where "f' \\x. (x - z) powr (m-n)" have "f' z=0" using \m>n\ unfolding f'_def by auto moreover have "continuous F f'" unfolding f'_def F_def continuous_def - using \m>n\ + using \m>n\ by (auto simp: Lim_ident_at intro!:tendsto_powr_complex_0 tendsto_eq_intros) ultimately have "(f' \ 0) F" unfolding F_def by (simp add: continuous_within) @@ -272,7 +355,7 @@ ultimately show ?thesis by auto qed - have ?thesis when "\x. (f \ x) (at z)" + have ?thesis when "\x. (f \ x) (at z)" apply (rule_tac imp_unique[unfolded P_def]) using P_exist[OF that(1) f_iso non_zero] unfolding P_def . moreover have ?thesis when "is_pole f z" @@ -312,7 +395,7 @@ have "P f (-n) (inverse o g) r" proof - have "f w = inverse (g w) * (w - z) powr of_int (- n)" when "w\cball z r - {z}" for w - by (metis g_fac h_def inverse_inverse_eq inverse_mult_distrib of_int_minus + by (metis g_fac h_def inverse_inverse_eq inverse_mult_distrib of_int_minus powr_minus that) then show ?thesis unfolding P_def comp_def @@ -398,7 +481,7 @@ have "(\w. inverse ((f w) ^ (nat (-n)))) \z\?xx" using assms False unfolding filterlim_at by (auto intro!:tendsto_eq_intros) then have "fp \z\ ?xx" - by (smt (verit) LIM_cong fp_def inverse_nonzero_iff_nonzero power_eq_0_iff powr_eq_0_iff + by (smt (verit) LIM_cong fp_def inverse_nonzero_iff_nonzero power_eq_0_iff powr_eq_0_iff powr_of_int that zero_less_nat_eq) then show ?thesis unfolding fp_def not_essential_def by auto qed @@ -520,7 +603,7 @@ using that by (auto intro!:tendsto_eq_intros) then have "fg \z\ 0" using Lim_transform_within[OF _ \r1>0\] - by (smt (verit, ccfv_SIG) DiffI dist_commute dist_nz fg_times mem_ball powr_of_int right_minus_eq + by (smt (verit, ccfv_SIG) DiffI dist_commute dist_nz fg_times mem_ball powr_of_int right_minus_eq singletonD that) then show ?thesis unfolding not_essential_def fg_def by auto qed @@ -629,7 +712,7 @@ using f_iso unfolding isolated_singularity_at_def by auto define d3 where "d3=min d1 d2" have "d3>0" unfolding d3_def using \d1>0\ \d2>0\ by auto - moreover + moreover have "f analytic_on ball z d3 - {z}" by (smt (verit, best) Diff_iff analytic_on_analytic_at d2 d3_def mem_ball) then have "vf analytic_on ball z d3 - {z}" @@ -712,9 +795,114 @@ using assms unfolding isolated_singularity_at_def by (metis analytic_on_holomorphic centre_in_ball insert_Diff openE open_delete subset_insert_iff) +lemma isolated_singularity_at_shift: + assumes "isolated_singularity_at (\x. f (x + w)) z" + shows "isolated_singularity_at f (z + w)" +proof - + from assms obtain r where r: "r > 0" and ana: "(\x. f (x + w)) analytic_on ball z r - {z}" + unfolding isolated_singularity_at_def by blast + have "((\x. f (x + w)) \ (\x. x - w)) analytic_on (ball (z + w) r - {z + w})" + by (rule analytic_on_compose_gen[OF _ ana]) + (auto simp: dist_norm algebra_simps intro!: analytic_intros) + hence "f analytic_on (ball (z + w) r - {z + w})" + by (simp add: o_def) + thus ?thesis using r + unfolding isolated_singularity_at_def by blast +qed + +lemma isolated_singularity_at_shift_iff: + "isolated_singularity_at f (z + w) \ isolated_singularity_at (\x. f (x + w)) z" + using isolated_singularity_at_shift[of f w z] + isolated_singularity_at_shift[of "\x. f (x + w)" "-w" "w + z"] + by (auto simp: algebra_simps) + +lemma isolated_singularity_at_shift_0: + "NO_MATCH 0 z \ isolated_singularity_at f z \ isolated_singularity_at (\x. f (z + x)) 0" + using isolated_singularity_at_shift_iff[of f 0 z] by (simp add: add_ac) + +lemma not_essential_shift: + assumes "not_essential (\x. f (x + w)) z" + shows "not_essential f (z + w)" +proof - + from assms consider c where "(\x. f (x + w)) \z\ c" | "is_pole (\x. f (x + w)) z" + unfolding not_essential_def by blast + thus ?thesis + proof cases + case (1 c) + hence "f \z + w\ c" + by (smt (verit, ccfv_SIG) LIM_cong add.assoc filterlim_at_to_0) + thus ?thesis + by (auto simp: not_essential_def) + next + case 2 + hence "is_pole f (z + w)" + by (subst is_pole_shift_iff [symmetric]) (auto simp: o_def add_ac) + thus ?thesis + by (auto simp: not_essential_def) + qed +qed + +lemma not_essential_shift_iff: "not_essential f (z + w) \ not_essential (\x. f (x + w)) z" + using not_essential_shift[of f w z] + not_essential_shift[of "\x. f (x + w)" "-w" "w + z"] + by (auto simp: algebra_simps) + +lemma not_essential_shift_0: + "NO_MATCH 0 z \ not_essential f z \ not_essential (\x. f (z + x)) 0" + using not_essential_shift_iff[of f 0 z] by (simp add: add_ac) + +lemma not_essential_holomorphic: + assumes "f holomorphic_on A" "x \ A" "open A" + shows "not_essential f x" +proof - + have "continuous_on A f" + using assms holomorphic_on_imp_continuous_on by blast + hence "f \x\ f x" + using assms continuous_on_eq_continuous_at isContD by blast + thus ?thesis + by (auto simp: not_essential_def) +qed + +lemma eventually_not_pole: + assumes "isolated_singularity_at f z" + shows "eventually (\w. \is_pole f w) (at z)" +proof - + from assms obtain r where "r > 0" and r: "f analytic_on ball z r - {z}" + by (auto simp: isolated_singularity_at_def) + then have "eventually (\w. w \ ball z r - {z}) (at z)" + by (intro eventually_at_in_open) auto + thus "eventually (\w. \is_pole f w) (at z)" + proof eventually_elim + case (elim w) + with r show ?case + using analytic_imp_holomorphic not_is_pole_holomorphic open_delete by blast + qed +qed + +lemma not_islimpt_poles: + assumes "isolated_singularity_at f z" + shows "\z islimpt {w. is_pole f w}" + using eventually_not_pole [OF assms] + by (auto simp: islimpt_conv_frequently_at frequently_def) + +lemma analytic_at_imp_no_pole: "f analytic_on {z} \ \is_pole f z" + using analytic_at not_is_pole_holomorphic by blast + +lemma not_essential_const [singularity_intros]: "not_essential (\_. c) z" + unfolding not_essential_def by (rule exI[of _ c]) auto + +lemma not_essential_uminus [singularity_intros]: + assumes f_ness: "not_essential f z" + assumes f_iso:"isolated_singularity_at f z" + shows "not_essential (\w. -f w) z" +proof - + have "not_essential (\w. -1 * f w) z" + by (intro assms singularity_intros) + thus ?thesis by simp +qed + subsubsection \The order of non-essential singularities (i.e. removable singularities or poles)\ - definition\<^marker>\tag important\ zorder :: "(complex \ complex) \ complex \ int" where "zorder f z = (THE n. (\h r. r>0 \ h holomorphic_on cball z r \ h z\0 \ (\w\cball z r - {z}. f w = h w * (w-z) powr (of_int n) @@ -749,6 +937,29 @@ then show ?thesis unfolding P_def by auto qed +lemma zorder_shift: + shows "zorder f z = zorder (\u. f (u + z)) 0" + unfolding zorder_def + apply (rule arg_cong [of concl: The]) + apply (auto simp: fun_eq_iff Ball_def dist_norm) + subgoal for x h r + apply (rule_tac x="h o (+)z" in exI) + apply (rule_tac x="r" in exI) + apply (intro conjI holomorphic_on_compose holomorphic_intros) + apply (simp_all flip: cball_translation) + apply (simp add: add.commute) + done + subgoal for x h r + apply (rule_tac x="h o (\u. u-z)" in exI) + apply (rule_tac x="r" in exI) + apply (intro conjI holomorphic_on_compose holomorphic_intros) + apply (simp_all add: flip: cball_translation_subtract) + by (metis diff_add_cancel eq_iff_diff_eq_0 norm_minus_commute) + done + +lemma zorder_shift': "NO_MATCH 0 z \ zorder f z = zorder (\u. f (u + z)) 0" + by (rule zorder_shift) + lemma fixes f::"complex \ complex" and z::complex assumes f_iso:"isolated_singularity_at f z" @@ -819,6 +1030,99 @@ by (metis DiffI dist_commute mem_ball singletonD) qed +lemma zor_poly_shift: + assumes iso1: "isolated_singularity_at f z" + and ness1: "not_essential f z" + and nzero1: "\\<^sub>F w in at z. f w \ 0" + shows "\\<^sub>F w in nhds z. zor_poly f z w = zor_poly (\u. f (z + u)) 0 (w-z)" +proof - + obtain r1 where "r1>0" "zor_poly f z z \ 0" and + holo1:"zor_poly f z holomorphic_on cball z r1" and + rball1:"\w\cball z r1 - {z}. + f w = zor_poly f z w * (w - z) powr of_int (zorder f z) \ + zor_poly f z w \ 0" + using zorder_exist[OF iso1 ness1 nzero1] by blast + + define ff where "ff=(\u. f (z + u))" + have "isolated_singularity_at ff 0" + unfolding ff_def + using iso1 isolated_singularity_at_shift_iff[of f 0 z] + by (simp add:algebra_simps) + moreover have "not_essential ff 0" + unfolding ff_def + using ness1 not_essential_shift_iff[of f 0 z] + by (simp add:algebra_simps) + moreover have "\\<^sub>F w in at 0. ff w \ 0" + unfolding ff_def using nzero1 + by (smt (verit, ccfv_SIG) add.commute eventually_at_to_0 + eventually_mono not_frequently) + ultimately obtain r2 where "r2>0" "zor_poly ff 0 0 \ 0" and + holo2:"zor_poly ff 0 holomorphic_on cball 0 r2" and + rball2:"\w\cball 0 r2 - {0}. + ff w = zor_poly ff 0 w * w powr of_int (zorder ff 0) \ + zor_poly ff 0 w \ 0" + using zorder_exist[of ff 0] by auto + + define r where "r=min r1 r2" + have "r>0" using \r1>0\ \r2>0\ unfolding r_def by auto + + have "zor_poly f z w = zor_poly ff 0 (w - z)" + if "w\ball z r - {z}" for w + proof - + define n::complex where "n= of_int (zorder f z)" + + have "f w = zor_poly f z w * (w - z) powr n" + proof - + have "w\cball z r1 - {z}" + using r_def that by auto + from rball1[rule_format, OF this] + show ?thesis unfolding n_def by auto + qed + + moreover have "f w = zor_poly ff 0 (w - z) * (w - z) powr n" + proof - + have "w-z\cball 0 r2 - {0}" + using r_def that by (auto simp:dist_complex_def) + from rball2[rule_format, OF this] + have "ff (w - z) = zor_poly ff 0 (w - z) * (w - z) + powr of_int (zorder ff 0)" + by simp + moreover have "of_int (zorder ff 0) = n" + unfolding n_def ff_def by (simp add:zorder_shift' add.commute) + ultimately show ?thesis unfolding ff_def by auto + qed + ultimately have "zor_poly f z w * (w - z) powr n + = zor_poly ff 0 (w - z) * (w - z) powr n" + by auto + moreover have "(w - z) powr n \0" + using that by auto + ultimately show ?thesis + apply (subst (asm) mult_cancel_right) + by (simp add:ff_def) + qed + then have "\\<^sub>F w in at z. zor_poly f z w + = zor_poly ff 0 (w - z)" + unfolding eventually_at + apply (rule_tac x=r in exI) + using \r>0\ by (auto simp:dist_commute) + moreover have "isCont (zor_poly f z) z" + using holo1[THEN holomorphic_on_imp_continuous_on] + apply (elim continuous_on_interior) + using \r1>0\ by auto + moreover have "isCont (\w. zor_poly ff 0 (w - z)) z" + proof - + have "isCont (zor_poly ff 0) 0" + using holo2[THEN holomorphic_on_imp_continuous_on] + apply (elim continuous_on_interior) + using \r2>0\ by auto + then show ?thesis + unfolding isCont_iff by simp + qed + ultimately show "\\<^sub>F w in nhds z. zor_poly f z w + = zor_poly ff 0 (w - z)" + by (elim at_within_isCont_imp_nhds;auto) +qed + lemma fixes f g::"complex \ complex" and z::complex assumes f_iso:"isolated_singularity_at f z" and g_iso:"isolated_singularity_at g z" @@ -979,7 +1283,7 @@ have fz_lim: "f\ z \ f z" by (metis assms(4,6) at_within_open continuous_on holo holomorphic_on_imp_continuous_on) have gz_lim: "g \z\g z" - by (metis r open_ball at_within_open ball_subset_cball centre_in_ball + by (metis r open_ball at_within_open ball_subset_cball centre_in_ball continuous_on_def continuous_on_subset holomorphic_on_imp_continuous_on) have if_0:"if f z=0 then n > 0 else n=0" proof - @@ -1185,7 +1489,7 @@ unfolding z'_def using \d>0\ \r>0\ by (auto simp add:dist_norm) moreover have "f z' \ 0" proof (subst fg_eq[OF _ \z'\z\]) - have "z' \ cball z r" + have "z' \ cball z r" unfolding z'_def using \r>0\ \d>0\ by (auto simp add:dist_norm) then show " z' \ s" using r(2) by blast show "g z' * (z' - z) powr of_int n \ 0" @@ -1493,4 +1797,476 @@ from tendsto_unique[OF \F \ bot\ this lim] show ?thesis . qed -end \ No newline at end of file +lemma + assumes "is_pole f (x :: complex)" "open A" "x \ A" + assumes "\y. y \ A - {x} \ (f has_field_derivative f' y) (at y)" + shows is_pole_deriv': "is_pole f' x" + and zorder_deriv': "zorder f' x = zorder f x - 1" +proof - + have holo: "f holomorphic_on A - {x}" + using assms by (subst holomorphic_on_open) auto + obtain r where r: "r > 0" "ball x r \ A" + using assms(2,3) openE by blast + moreover have "open (ball x r - {x})" + by auto + ultimately have "isolated_singularity_at f x" + by (auto simp: isolated_singularity_at_def analytic_on_open + intro!: exI[of _ r] holomorphic_on_subset[OF holo]) + hence ev: "\\<^sub>F w in at x. zor_poly f x w = f w * (w - x) ^ nat (- zorder f x)" + using \is_pole f x\ zor_poly_pole_eq by blast + + define P where "P = zor_poly f x" + define n where "n = nat (-zorder f x)" + + obtain r where r: "r > 0" "cball x r \ A" "P holomorphic_on cball x r" "zorder f x < 0" "P x \ 0" + "\w\cball x r - {x}. f w = P w / (w - x) ^ n \ P w \ 0" + unfolding P_def n_def using zorder_exist_pole[OF holo assms(2,3,1)] by blast + have n: "n > 0" + using r(4) by (auto simp: n_def) + + have [derivative_intros]: "(P has_field_derivative deriv P w) (at w)" + if "w \ ball x r" for w + using that by (intro holomorphic_derivI[OF holomorphic_on_subset[OF r(3), of "ball x r"]]) auto + + define D where "D = (\w. (deriv P w * (w - x) - of_nat n * P w) / (w - x) ^ (n + 1))" + define n' where "n' = n - 1" + have n': "n = Suc n'" + using n by (simp add: n'_def) + + have "eventually (\w. w \ ball x r) (nhds x)" + using \r > 0\ by (intro eventually_nhds_in_open) auto + hence ev'': "eventually (\w. w \ ball x r - {x}) (at x)" + by (auto simp: eventually_at_filter elim: eventually_mono) + + { + fix w assume w: "w \ ball x r - {x}" + have ev': "eventually (\w. w \ ball x r - {x}) (nhds w)" + using w by (intro eventually_nhds_in_open) auto + + have "((\w. P w / (w - x) ^ n) has_field_derivative D w) (at w)" + apply (rule derivative_eq_intros refl | use w in force)+ + using w + apply (simp add: divide_simps D_def) + apply (simp add: n' algebra_simps) + done + also have "?this \ (f has_field_derivative D w) (at w)" + using r by (intro has_field_derivative_cong_ev refl eventually_mono[OF ev']) auto + finally have "(f has_field_derivative D w) (at w)" . + moreover have "(f has_field_derivative f' w) (at w)" + using w r by (intro assms) auto + ultimately have "D w = f' w" + using DERIV_unique by blast + } note D_eq = this + + have "is_pole D x" + unfolding D_def using n \r > 0\ \P x \ 0\ + by (intro is_pole_basic[where A = "ball x r"] holomorphic_intros holomorphic_on_subset[OF r(3)]) auto + also have "?this \ is_pole f' x" + by (intro is_pole_cong eventually_mono[OF ev''] D_eq) auto + finally show "is_pole f' x" . + + have "zorder f' x = -int (Suc n)" + proof (rule zorder_eqI) + show "open (ball x r)" "x \ ball x r" + using \r > 0\ by auto + show "f' w = (deriv P w * (w - x) - of_nat n * P w) * (w - x) powr of_int (- int (Suc n))" + if "w \ ball x r" "w \ x" for w + using that D_eq[of w] n by (auto simp: D_def powr_diff powr_minus powr_nat' divide_simps) + qed (use r n in \auto intro!: holomorphic_intros\) + thus "zorder f' x = zorder f x - 1" + using n by (simp add: n_def) +qed + +lemma + assumes "is_pole f (x :: complex)" "isolated_singularity_at f x" + shows is_pole_deriv: "is_pole (deriv f) x" + and zorder_deriv: "zorder (deriv f) x = zorder f x - 1" +proof - + from assms(2) obtain r where r: "r > 0" "f analytic_on ball x r - {x}" + by (auto simp: isolated_singularity_at_def) + hence holo: "f holomorphic_on ball x r - {x}" + by (subst (asm) analytic_on_open) auto + have *: "x \ ball x r" "open (ball x r)" "open (ball x r - {x})" + using \r > 0\ by auto + show "is_pole (deriv f) x" "zorder (deriv f) x = zorder f x - 1" + by (rule is_pole_deriv' zorder_deriv', (rule assms * holomorphic_derivI holo | assumption)+)+ +qed + +lemma removable_singularity_deriv': + assumes "f \x\ c" "x \ A" "open (A :: complex set)" + assumes "\y. y \ A - {x} \ (f has_field_derivative f' y) (at y)" + shows "\c. f' \x\ c" +proof - + have holo: "f holomorphic_on A - {x}" + using assms by (subst holomorphic_on_open) auto + + define g where "g = (\y. if y = x then c else f y)" + have deriv_g_eq: "deriv g y = f' y" if "y \ A - {x}" for y + proof - + have ev: "eventually (\y. y \ A - {x}) (nhds y)" + using that assms by (intro eventually_nhds_in_open) auto + have "(f has_field_derivative f' y) (at y)" + using assms that by auto + also have "?this \ (g has_field_derivative f' y) (at y)" + by (intro has_field_derivative_cong_ev refl eventually_mono[OF ev]) (auto simp: g_def) + finally show ?thesis + by (intro DERIV_imp_deriv assms) + qed + + have "g holomorphic_on A" + unfolding g_def using assms assms(1) holo by (intro removable_singularity) auto + hence "deriv g holomorphic_on A" + by (intro holomorphic_deriv assms) + hence "continuous_on A (deriv g)" + by (meson holomorphic_on_imp_continuous_on) + hence "(deriv g \ deriv g x) (at x within A)" + using assms by (auto simp: continuous_on_def) + also have "?this \ (f' \ deriv g x) (at x within A)" + by (intro filterlim_cong refl) (auto simp: eventually_at_filter deriv_g_eq) + finally have "f' \x\ deriv g x" + using \open A\ \x \ A\ by (meson tendsto_within_open) + thus ?thesis + by blast +qed + +lemma removable_singularity_deriv: + assumes "f \x\ c" "isolated_singularity_at f x" + shows "\c. deriv f \x\ c" +proof - + from assms(2) obtain r where r: "r > 0" "f analytic_on ball x r - {x}" + by (auto simp: isolated_singularity_at_def) + hence holo: "f holomorphic_on ball x r - {x}" + using analytic_imp_holomorphic by blast + show ?thesis + using assms(1) + proof (rule removable_singularity_deriv') + show "x \ ball x r" "open (ball x r)" + using \r > 0\ by auto + qed (auto intro!: holomorphic_derivI[OF holo]) +qed + +lemma not_essential_deriv': + assumes "not_essential f x" "x \ A" "open A" + assumes "\y. y \ A - {x} \ (f has_field_derivative f' y) (at y)" + shows "not_essential f' x" +proof - + have holo: "f holomorphic_on A - {x}" + using assms by (subst holomorphic_on_open) auto + from assms consider "is_pole f x" | c where "f \x\ c" + by (auto simp: not_essential_def) + thus ?thesis + proof cases + case 1 + hence "is_pole f' x" + using is_pole_deriv' assms by blast + thus ?thesis by (auto simp: not_essential_def) + next + case (2 c) + from 2 have "\c. f' \x\ c" + by (rule removable_singularity_deriv'[OF _ assms(2-4)]) + thus ?thesis + by (auto simp: not_essential_def) + qed +qed + +lemma not_essential_deriv[singularity_intros]: + assumes "not_essential f x" "isolated_singularity_at f x" + shows "not_essential (deriv f) x" +proof - + from assms(2) obtain r where r: "r > 0" "f analytic_on ball x r - {x}" + by (auto simp: isolated_singularity_at_def) + hence holo: "f holomorphic_on ball x r - {x}" + by (subst (asm) analytic_on_open) auto + show ?thesis + using assms(1) + proof (rule not_essential_deriv') + show "x \ ball x r" "open (ball x r)" + using \r > 0\ by auto + qed (auto intro!: holomorphic_derivI[OF holo]) +qed + +lemma not_essential_frequently_0_imp_tendsto_0: + fixes f :: "complex \ complex" + assumes sing: "isolated_singularity_at f z" "not_essential f z" + assumes freq: "frequently (\z. f z = 0) (at z)" + shows "f \z\ 0" +proof - + from freq obtain g :: "nat \ complex" where g: "filterlim g (at z) at_top" "\n. f (g n) = 0" + using frequently_atE by blast + have "eventually (\x. f (g x) = 0) sequentially" + using g by auto + hence fg: "(\x. f (g x)) \ 0" + by (simp add: tendsto_eventually) + + from assms(2) consider c where "f \z\ c" | "is_pole f z" + unfolding not_essential_def by blast + thus ?thesis + proof cases + case (1 c) + have "(\x. f (g x)) \ c" + by (rule filterlim_compose[OF 1 g(1)]) + with fg have "c = 0" + using LIMSEQ_unique by blast + with 1 show ?thesis by simp + next + case 2 + have "filterlim (\x. f (g x)) at_infinity sequentially" + by (rule filterlim_compose[OF _ g(1)]) (use 2 in \auto simp: is_pole_def\) + with fg have False + by (meson not_tendsto_and_filterlim_at_infinity sequentially_bot) + thus ?thesis .. + qed +qed + +lemma not_essential_frequently_0_imp_eventually_0: + fixes f :: "complex \ complex" + assumes sing: "isolated_singularity_at f z" "not_essential f z" + assumes freq: "frequently (\z. f z = 0) (at z)" + shows "eventually (\z. f z = 0) (at z)" +proof - + from sing obtain r where r: "r > 0" and "f analytic_on ball z r - {z}" + by (auto simp: isolated_singularity_at_def) + hence holo: "f holomorphic_on ball z r - {z}" + by (subst (asm) analytic_on_open) auto + have "eventually (\w. w \ ball z r - {z}) (at z)" + using r by (intro eventually_at_in_open) auto + from freq and this have "frequently (\w. f w = 0 \ w \ ball z r - {z}) (at z)" + using frequently_eventually_frequently by blast + hence "frequently (\w. w \ {w\ball z r - {z}. f w = 0}) (at z)" + by (simp add: conj_commute) + hence limpt: "z islimpt {w\ball z r - {z}. f w = 0}" + using islimpt_conv_frequently_at by blast + + define g where "g = (\w. if w = z then 0 else f w)" + have "f \z\ 0" + by (intro not_essential_frequently_0_imp_tendsto_0 assms) + hence g_holo: "g holomorphic_on ball z r" + unfolding g_def by (intro removable_singularity holo) auto + + have g_eq_0: "g w = 0" if "w \ ball z r" for w + proof (rule analytic_continuation[where f = g]) + show "open (ball z r)" "connected (ball z r)" + using r by auto + show "z islimpt {w\ball z r - {z}. f w = 0}" + by fact + show "g w = 0" if "w \ {w \ ball z r - {z}. f w = 0}" for w + using that by (auto simp: g_def) + qed (use r that g_holo in auto) + + have "eventually (\w. w \ ball z r - {z}) (at z)" + using r by (intro eventually_at_in_open) auto + thus "eventually (\w. f w = 0) (at z)" + proof eventually_elim + case (elim w) + thus ?case using g_eq_0[of w] + by (auto simp: g_def) + qed +qed + +lemma pole_imp_not_constant: + fixes f :: "'a :: {perfect_space} \ _" + assumes "is_pole f x" "open A" "x \ A" "A \ insert x B" + shows "\f constant_on B" +proof + assume *: "f constant_on B" + then obtain c where c: "\x\B. f x = c" + by (auto simp: constant_on_def) + have "eventually (\y. y \ A - {x}) (at x)" + using assms by (intro eventually_at_in_open) auto + hence "eventually (\y. f y = c) (at x)" + by eventually_elim (use c assms in auto) + hence **: "f \x\ c" + by (simp add: tendsto_eventually) + show False + using not_tendsto_and_filterlim_at_infinity[OF _ ** assms(1)[unfolded is_pole_def]] by simp +qed + + +lemma neg_zorder_imp_is_pole: + assumes iso:"isolated_singularity_at f z" and f_ness:"not_essential f z" + and "zorder f z < 0" and fre_nz:"\\<^sub>F w in at z. f w \ 0 " + shows "is_pole f z" +proof - + define P where "P = zor_poly f z" + define n where "n = zorder f z" + have "n<0" unfolding n_def by (simp add: assms(3)) + define nn where "nn = nat (-n)" + + obtain r where "P z \ 0" "r>0" and r_holo:"P holomorphic_on cball z r" and + w_Pn:"(\w\cball z r - {z}. f w = P w * (w - z) powr of_int n \ P w \ 0)" + using zorder_exist[OF iso f_ness fre_nz,folded P_def n_def] by auto + + have "is_pole (\w. P w * (w - z) powr of_int n) z" + unfolding is_pole_def + proof (rule tendsto_mult_filterlim_at_infinity) + show "P \z\ P z" + by (meson open_ball \0 < r\ ball_subset_cball centre_in_ball + continuous_on_eq_continuous_at continuous_on_subset + holomorphic_on_imp_continuous_on isContD r_holo) + show "P z\0" by (simp add: \P z \ 0\) + + have "LIM x at z. inverse ((x - z) ^ nat (-n)) :> at_infinity" + apply (subst filterlim_inverse_at_iff[symmetric]) + using \n<0\ + by (auto intro!:tendsto_eq_intros filterlim_atI + simp add:eventually_at_filter) + then show "LIM x at z. (x - z) powr of_int n :> at_infinity" + proof (elim filterlim_mono_eventually) + have "inverse ((x - z) ^ nat (-n)) = (x - z) powr of_int n" + if "x\z" for x + apply (subst powr_of_int) + using \n<0\ using that by auto + then show "\\<^sub>F x in at z. inverse ((x - z) ^ nat (-n)) + = (x - z) powr of_int n" + by (simp add: eventually_at_filter) + qed auto + qed + moreover have "\\<^sub>F w in at z. f w = P w * (w - z) powr of_int n" + unfolding eventually_at_le + apply (rule exI[where x=r]) + using w_Pn \r>0\ by (simp add: dist_commute) + ultimately show ?thesis using is_pole_cong by fast +qed + +lemma is_pole_divide_zorder: + fixes f g::"complex \ complex" and z::complex + assumes f_iso:"isolated_singularity_at f z" and g_iso:"isolated_singularity_at g z" + and f_ness:"not_essential f z" and g_ness:"not_essential g z" + and fg_nconst: "\\<^sub>Fw in (at z). f w * g w\ 0" + and z_less:"zorder f z < zorder g z" + shows "is_pole (\z. f z / g z) z" +proof - + define fn gn fg where "fn=zorder f z" and "gn=zorder g z" + and "fg=(\w. f w / g w)" + + have "isolated_singularity_at fg z" + unfolding fg_def using f_iso g_iso g_ness + by (auto intro:singularity_intros) + moreover have "not_essential fg z" + unfolding fg_def using f_iso g_iso g_ness f_ness + by (auto intro:singularity_intros) + moreover have "zorder fg z < 0" + proof - + have "zorder fg z = fn - gn" + using zorder_divide[OF f_iso g_iso f_ness g_ness + fg_nconst,folded fn_def gn_def fg_def] . + then show ?thesis + using z_less by (simp add: fn_def gn_def) + qed + moreover have "\\<^sub>F w in at z. fg w \ 0" + using fg_nconst unfolding fg_def by force + ultimately show "is_pole fg z" + using neg_zorder_imp_is_pole by auto +qed + +lemma isolated_pole_imp_nzero_times: + assumes f_iso:"isolated_singularity_at f z" + and "is_pole f z" + shows "\\<^sub>Fw in (at z). deriv f w * f w \ 0" +proof (rule ccontr) + assume "\ (\\<^sub>F w in at z. deriv f w * f w \ 0)" + then have "\\<^sub>F x in at z. deriv f x * f x = 0" + unfolding not_frequently by simp + moreover have "\\<^sub>F w in at z. f w \ 0" + using non_zero_neighbour_pole[OF \is_pole f z\] . + moreover have "\\<^sub>F w in at z. deriv f w \ 0" + using is_pole_deriv[OF \is_pole f z\ f_iso,THEN non_zero_neighbour_pole] + . + ultimately have "\\<^sub>F w in at z. False" + apply eventually_elim + by auto + then show False by auto +qed + +lemma isolated_pole_imp_neg_zorder: + assumes f_iso:"isolated_singularity_at f z" + and "is_pole f z" + shows "zorder f z<0" +proof - + obtain e where [simp]:"e>0" and f_holo:"f holomorphic_on ball z e - {z}" + using f_iso analytic_imp_holomorphic unfolding isolated_singularity_at_def by blast + show ?thesis + using zorder_exist_pole[OF f_holo,simplified,OF \is_pole f z\] + by auto +qed + +lemma isolated_singularity_at_deriv[singularity_intros]: + assumes "isolated_singularity_at f x" + shows "isolated_singularity_at (deriv f) x" +proof - + obtain r where "r>0" "f analytic_on ball x r - {x}" + using assms unfolding isolated_singularity_at_def by auto + from analytic_deriv[OF this(2)] + have "deriv f analytic_on ball x r - {x}" . + with \r>0\ show ?thesis + unfolding isolated_singularity_at_def by auto +qed + +lemma zorder_deriv_minus_1: + fixes f g::"complex \ complex" and z::complex + assumes f_iso:"isolated_singularity_at f z" + and f_ness:"not_essential f z" + and f_nconst:"\\<^sub>F w in at z. f w \ 0" + and f_ord:"zorder f z \0" + shows "zorder (deriv f) z = zorder f z - 1" +proof - + define P where "P = zor_poly f z" + define n where "n = zorder f z" + have "n\0" unfolding n_def using f_ord by auto + + obtain r where "P z \ 0" "r>0" and P_holo:"P holomorphic_on cball z r" + and "(\w\cball z r - {z}. f w + = P w * (w - z) powr of_int n \ P w \ 0)" + using zorder_exist[OF f_iso f_ness f_nconst,folded P_def n_def] by auto + from this(4) + have f_eq:"(\w\cball z r - {z}. f w + = P w * (w - z) powi n \ P w \ 0)" + using complex_powr_of_int f_ord n_def by presburger + + define D where "D = (\w. (deriv P w * (w - z) + of_int n * P w) + * (w - z) powi (n - 1))" + + have deriv_f_eq:"deriv f w = D w" if "w \ ball z r - {z}" for w + proof - + have ev': "eventually (\w. w \ ball z r - {z}) (nhds w)" + using that by (intro eventually_nhds_in_open) auto + + define wz where "wz = w - z" + + have "wz \0" unfolding wz_def using that by auto + moreover have "(P has_field_derivative deriv P w) (at w)" + by (meson DiffD1 Elementary_Metric_Spaces.open_ball P_holo + ball_subset_cball holomorphic_derivI holomorphic_on_subset that) + ultimately have "((\w. P w * (w - z) powi n) has_field_derivative D w) (at w)" + unfolding D_def using that + apply (auto intro!: derivative_eq_intros) + apply (fold wz_def) + by (auto simp:algebra_simps simp flip:power_int_add_1') + also have "?this \ (f has_field_derivative D w) (at w)" + using f_eq + by (intro has_field_derivative_cong_ev refl eventually_mono[OF ev']) auto + ultimately have "(f has_field_derivative D w) (at w)" by simp + moreover have "(f has_field_derivative deriv f w) (at w)" + by (metis DERIV_imp_deriv calculation) + ultimately show ?thesis using DERIV_imp_deriv by blast + qed + + show "zorder (deriv f) z = n - 1" + proof (rule zorder_eqI) + show "open (ball z r)" "z \ ball z r" + using \r > 0\ by auto + define g where "g=(\w. (deriv P w * (w - z) + of_int n * P w))" + show "g holomorphic_on ball z r" + unfolding g_def using P_holo + by (auto intro!:holomorphic_intros) + show "g z \ 0" + unfolding g_def using \P z \ 0\ \n\0\ by auto + show "deriv f w = + (deriv P w * (w - z) + of_int n * P w) * (w - z) powr of_int (n - 1)" + if "w \ ball z r" "w \ z" for w + apply (subst complex_powr_of_int) + using deriv_f_eq that unfolding D_def by auto + qed +qed + +end diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Complex_Analysis/Contour_Integration.thy --- a/src/HOL/Complex_Analysis/Contour_Integration.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Complex_Analysis/Contour_Integration.thy Wed Feb 08 15:05:24 2023 +0000 @@ -94,8 +94,6 @@ subsection\<^marker>\tag unimportant\ \Reversing a path\ - - lemma has_contour_integral_reversepath: assumes "valid_path g" and f: "(f has_contour_integral i) g" shows "(f has_contour_integral (-i)) (reversepath g)" @@ -807,9 +805,8 @@ lemma contour_integral_const_linepath [simp]: "contour_integral (linepath a b) (\x. c) = c*(b - a)" by (rule contour_integral_unique [OF has_contour_integral_const_linepath]) -lemma contour_integral_neg: - "f contour_integrable_on g \ contour_integral g (\x. -(f x)) = -(contour_integral g f)" - by (simp add: contour_integral_unique has_contour_integral_integral has_contour_integral_neg) +lemma contour_integral_neg: "contour_integral g (\z. -f z) = -contour_integral g f" + by (simp add: contour_integral_integral) lemma contour_integral_add: "f1 contour_integrable_on g \ f2 contour_integrable_on g \ contour_integral g (\x. f1 x + f2 x) = @@ -903,6 +900,19 @@ unfolding contour_integrable_on_def by (metis has_contour_integral_sum) +lemma contour_integrable_lmul_iff: + "c \ 0 \ (\x. c * f x) contour_integrable_on g \ f contour_integrable_on g" + using contour_integrable_lmul[of f g c] contour_integrable_lmul[of "\x. c * f x" g "inverse c"] + by (auto simp: field_simps) + +lemma contour_integrable_rmul_iff: + "c \ 0 \ (\x. f x * c) contour_integrable_on g \ f contour_integrable_on g" + using contour_integrable_rmul[of f g c] contour_integrable_rmul[of "\x. c * f x" g "inverse c"] + by (auto simp: field_simps) + +lemma contour_integrable_div_iff: + "c \ 0 \ (\x. f x / c) contour_integrable_on g \ f contour_integrable_on g" + using contour_integrable_rmul_iff[of "inverse c"] by (simp add: field_simps) subsection\<^marker>\tag unimportant\ \Reversing a path integral\ @@ -912,9 +922,9 @@ using has_contour_integral_reversepath valid_path_linepath by fastforce lemma contour_integral_reverse_linepath: - "continuous_on (closed_segment a b) f - \ contour_integral (linepath a b) f = - (contour_integral(linepath b a) f)" - by (metis contour_integrable_continuous_linepath contour_integral_unique has_contour_integral_integral has_contour_integral_reverse_linepath) + "continuous_on (closed_segment a b) f \ contour_integral (linepath a b) f = - (contour_integral(linepath b a) f)" + using contour_integral_reversepath by fastforce + text \Splitting a path integral in a flat way.*)\ diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Complex_Analysis/Residue_Theorem.thy --- a/src/HOL/Complex_Analysis/Residue_Theorem.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Complex_Analysis/Residue_Theorem.thy Wed Feb 08 15:05:24 2023 +0000 @@ -454,9 +454,8 @@ theorem argument_principle: fixes f::"complex \ complex" and poles s:: "complex set" - defines "pz \ {w. f w = 0 \ w \ poles}" \ \\<^term>\pz\ is the set of poles and zeros\ - assumes "open s" and - "connected s" and + defines "pz \ {w\s. f w = 0 \ w \ poles}" \ \\<^term>\pz\ is the set of poles and zeros\ + assumes "open s" "connected s" and f_holo:"f holomorphic_on s-poles" and h_holo:"h holomorphic_on s" and "valid_path g" and @@ -464,7 +463,7 @@ path_img:"path_image g \ s - pz" and homo:"\z. (z \ s) \ winding_number g z = 0" and finite:"finite pz" and - poles:"\p\poles. is_pole f p" + poles:"\p\s\poles. is_pole f p" shows "contour_integral g (\x. deriv f x * h x / f x) = 2 * pi * \ * (\p\pz. winding_number g p * h p * zorder f p)" (is "?L=?R") @@ -505,10 +504,12 @@ case False then have "p\s-poles" using \p\s\ poles unfolding pz_def by auto moreover have "open (s-poles)" - using \open s\ - apply (elim open_Diff) - apply (rule finite_imp_closed) - using finite unfolding pz_def by simp + proof - + have "closed (s \ poles)" + using finite by (simp add: pz_def finite_imp_closed rev_finite_subset subset_eq) + then show ?thesis + by (metis Diff_Compl Diff_Diff_Int Diff_eq \open s\ open_Diff) + qed ultimately have "isCont f p" using holomorphic_on_imp_continuous_on[OF f_holo] continuous_on_eq_continuous_at by auto @@ -518,13 +519,21 @@ proof (rule ccontr) assume "\ (\\<^sub>F w in at p. f w \ 0)" then have "\\<^sub>F w in at p. f w= 0" unfolding frequently_def by auto - then obtain rr where "rr>0" "\w\ball p rr - {p}. f w =0" + then obtain r1 where "r1>0" and r1:"\w\ball p r1 - {p}. f w =0" unfolding eventually_at by (auto simp add:dist_commute) - then have "ball p rr - {p} \ {w\ball p rr-{p}. f w=0}" by blast - moreover have "infinite (ball p rr - {p})" using \rr>0\ using finite_imp_not_open by fastforce - ultimately have "infinite {w\ball p rr-{p}. f w=0}" using infinite_super by blast + obtain r2 where "r2>0" and r2: "ball p r2 \ s" + using \p\s\ \open s\ openE by blast + define rr where "rr=min r1 r2" + + from r1 r2 + have "ball p rr - {p} \ {w\ s \ ball p rr-{p}. f w=0}" + unfolding rr_def by auto + moreover have "infinite (ball p rr - {p})" + using \r1>0\ \r2>0\ finite_imp_not_open + unfolding rr_def by fastforce + ultimately have "infinite {w\s \ ball p rr-{p}. f w=0}" using infinite_super by blast then have "infinite pz" - unfolding pz_def infinite_super by auto + unfolding pz_def by (smt (verit) infinite_super Collect_mono_iff DiffE Int_iff) then show False using \finite pz\ by auto qed ultimately obtain r where "pp p \ 0" and r:"r>0" "pp holomorphic_on cball p r" @@ -795,7 +804,7 @@ theorem Rouche_theorem: fixes f g::"complex \ complex" and s:: "complex set" defines "fg\(\p. f p + g p)" - defines "zeros_fg\{p. fg p = 0}" and "zeros_f\{p. f p = 0}" + defines "zeros_fg\{p\s. fg p = 0}" and "zeros_f\{p\s. f p = 0}" assumes "open s" and "connected s" and "finite zeros_fg" and @@ -844,9 +853,8 @@ proof - have "h p \ ball 1 1" when "p\path_image \" for p proof - - have "cmod (g p/f p) <1" using path_less[rule_format,OF that] - apply (cases "cmod (f p) = 0") - by (auto simp add: norm_divide) + have "cmod (g p/f p) <1" + by (smt (verit) divide_less_eq_1_pos norm_divide norm_ge_zero path_less that) then show ?thesis unfolding h_def by (auto simp add:dist_complex_def) qed then have "path_image (h o \) \ ball 1 1" @@ -935,9 +943,8 @@ assume "\ h p \ 0" then have "g p / f p= -1" unfolding h_def by (simp add: add_eq_0_iff2) then have "cmod (g p/f p) = 1" by auto - moreover have "cmod (g p/f p) <1" using path_less[rule_format,OF that] - apply (cases "cmod (f p) = 0") - by (auto simp add: norm_divide) + moreover have "cmod (g p/f p) <1" + by (simp add: \f p \ 0\ norm_divide path_less that) ultimately show False by auto qed have der_fg:"deriv fg p = deriv f p + deriv g p" unfolding fg_def @@ -963,20 +970,24 @@ ultimately show ?thesis by auto qed moreover have "contour_integral \ (\x. deriv fg x / fg x) = c * (\p\zeros_fg. w p * zorder fg p)" - unfolding c_def zeros_fg_def w_def - proof (rule argument_principle[OF \open s\ \connected s\ _ _ \valid_path \\ loop _ homo - , of _ "{}" "\_. 1",simplified]) - show "fg holomorphic_on s" unfolding fg_def using f_holo g_holo holomorphic_on_add by auto - show "path_image \ \ s - {p. fg p = 0}" using path_fg unfolding zeros_fg_def . - show " finite {p. fg p = 0}" using \finite zeros_fg\ unfolding zeros_fg_def . + proof - + have "fg holomorphic_on s" unfolding fg_def using f_holo g_holo holomorphic_on_add by auto + moreover + have "path_image \ \ s - {p\s. fg p = 0}" using path_fg unfolding zeros_fg_def . + moreover + have " finite {p\s. fg p = 0}" using \finite zeros_fg\ unfolding zeros_fg_def . + ultimately show ?thesis + unfolding c_def zeros_fg_def w_def + using argument_principle[OF \open s\ \connected s\ _ _ \valid_path \\ loop _ homo, of _ "{}" "\_. 1"] + by simp qed moreover have "contour_integral \ (\x. deriv f x / f x) = c * (\p\zeros_f. w p * zorder f p)" unfolding c_def zeros_f_def w_def proof (rule argument_principle[OF \open s\ \connected s\ _ _ \valid_path \\ loop _ homo , of _ "{}" "\_. 1",simplified]) show "f holomorphic_on s" using f_holo g_holo holomorphic_on_add by auto - show "path_image \ \ s - {p. f p = 0}" using path_f unfolding zeros_f_def . - show " finite {p. f p = 0}" using \finite zeros_f\ unfolding zeros_f_def . + show "path_image \ \ s - {p\s. f p = 0}" using path_f unfolding zeros_f_def . + show " finite {p\s. f p = 0}" using \finite zeros_f\ unfolding zeros_f_def . qed ultimately have " c* (\p\zeros_fg. w p * (zorder fg p)) = c* (\p\zeros_f. w p * (zorder f p))" by auto diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Filter.thy --- a/src/HOL/Filter.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Filter.thy Wed Feb 08 15:05:24 2023 +0000 @@ -223,6 +223,16 @@ shows "\\<^sub>Fx in F. Q x \ P x" using assms eventually_elim2 by (force simp add: frequently_def) +lemma frequently_cong: + assumes ev: "eventually P F" and QR: "\x. P x \ Q x \ R x" + shows "frequently Q F \ frequently R F" + unfolding frequently_def + using QR by (auto intro!: eventually_cong [OF ev]) + +lemma frequently_eventually_frequently: + "frequently P F \ eventually Q F \ frequently (\x. P x \ Q x) F" + using frequently_cong [of Q F P "\x. P x \ Q x"] by meson + lemma eventually_frequently_const_simps: "(\\<^sub>Fx in F. P x \ C) \ (\\<^sub>Fx in F. P x) \ C" "(\\<^sub>Fx in F. C \ P x) \ C \ (\\<^sub>Fx in F. P x)" @@ -606,12 +616,6 @@ lemma filtermap_INF: "filtermap f (\b\B. F b) \ (\b\B. filtermap f (F b))" by (rule INF_greatest, rule filtermap_mono, erule INF_lower) -lemma frequently_cong: - assumes ev: "eventually P F" and QR: "\x. P x \ Q x \ R x" - shows "frequently Q F \ frequently R F" - unfolding frequently_def - using QR by (auto intro!: eventually_cong [OF ev]) - lemma frequently_filtermap: "frequently P (filtermap f F) = frequently (\x. P (f x)) F" by (simp add: frequently_def eventually_filtermap) diff -r 0c073854e6ce -r 607e1e345e8f src/HOL/Topological_Spaces.thy --- a/src/HOL/Topological_Spaces.thy Tue Feb 07 14:10:15 2023 +0000 +++ b/src/HOL/Topological_Spaces.thy Wed Feb 08 15:05:24 2023 +0000 @@ -1078,6 +1078,37 @@ lemma Lim_ident_at: "\ trivial_limit (at x within s) \ Lim (at x within s) (\x. x) = x" by (rule tendsto_Lim[OF _ tendsto_ident_at]) auto +lemma Lim_cong: + assumes "eventually (\x. f x = g x) F" "F = G" + shows "Lim F f = Lim G g" +proof (cases "(\c. (f \ c) F) \ F \ bot") + case True + then obtain c where c: "(f \ c) F" + by blast + hence "Lim F f = c" + using True by (intro tendsto_Lim) auto + moreover have "(f \ c) F \ (g \ c) G" + using assms by (intro filterlim_cong) auto + with True c assms have "Lim G g = c" + by (intro tendsto_Lim) auto + ultimately show ?thesis + by simp +next + case False + show ?thesis + proof (cases "F = bot") + case True + thus ?thesis using assms + by (auto simp: Topological_Spaces.Lim_def) + next + case False + have "(f \ c) F \ (g \ c) G" for c + using assms by (intro filterlim_cong) auto + thus ?thesis + by (auto simp: Topological_Spaces.Lim_def) + qed +qed + lemma eventually_Lim_ident_at: "(\\<^sub>F y in at x within X. P (Lim (at x within X) (\x. x)) y) \ (\\<^sub>F y in at x within X. P x y)" for x::"'a::t2_space" @@ -2217,6 +2248,18 @@ "continuous_on A (f :: 'a :: discrete_topology \ _)" by (auto simp: continuous_on_def at_discrete) +lemma continuous_on_of_nat [continuous_intros]: + assumes "continuous_on A f" + shows "continuous_on A (\n. of_nat (f n))" + using continuous_on_compose[OF assms continuous_on_discrete[of _ of_nat]] + by (simp add: o_def) + +lemma continuous_on_of_int [continuous_intros]: + assumes "continuous_on A f" + shows "continuous_on A (\n. of_int (f n))" + using continuous_on_compose[OF assms continuous_on_discrete[of _ of_int]] + by (simp add: o_def) + subsubsection \Continuity at a point\ definition continuous :: "'a::t2_space filter \ ('a \ 'b::topological_space) \ bool" @@ -2330,6 +2373,21 @@ "isCont g (f x) \ continuous (at x within s) f \ continuous (at x within s) (\x. g (f x))" using continuous_at_imp_continuous_at_within continuous_within_compose2 by blast +lemma at_within_isCont_imp_nhds: + fixes f:: "'a:: {t2_space,perfect_space} \ 'b:: t2_space" + assumes "\\<^sub>F w in at z. f w = g w" "isCont f z" "isCont g z" + shows "\\<^sub>F w in nhds z. f w = g w" +proof - + have "g \z\ f z" + using assms isContD tendsto_cong by blast + moreover have "g \z\ g z" using \isCont g z\ using isCont_def by blast + ultimately have "f z=g z" using LIM_unique by auto + moreover have "\\<^sub>F x in nhds z. x \ z \ f x = g x" + using assms unfolding eventually_at_filter by auto + ultimately show ?thesis + by (auto elim:eventually_mono) +qed + lemma filtermap_nhds_open_map': assumes cont: "isCont f a" and "open A" "a \ A" @@ -2933,6 +2991,30 @@ by auto qed +lemma connected_Un_UN: + assumes "connected A" "\X. X \ B \ connected X" "\X. X \ B \ A \ X \ {}" + shows "connected (A \ \B)" +proof (rule connectedI_const) + fix f :: "'a \ bool" + assume f: "continuous_on (A \ \B) f" + have "connected A" "continuous_on A f" + by (auto intro: assms continuous_on_subset[OF f(1)]) + from connectedD_const[OF this] obtain c where c: "\x. x \ A \ f x = c" + by metis + have "f x = c" if "x \ X" "X \ B" for x X + proof - + have "connected X" "continuous_on X f" + using that by (auto intro: assms continuous_on_subset[OF f]) + from connectedD_const[OF this] obtain c' where c': "\x. x \ X \ f x = c'" + by metis + from assms(3) and that obtain y where "y \ A \ X" + by auto + with c[of y] c'[of y] c'[of x] that show ?thesis + by auto + qed + with c show "\c. \x\A \ \ B. f x = c" + by (intro exI[of _ c]) auto +qed section \Linear Continuum Topologies\ @@ -3885,5 +3967,4 @@ then show ?thesis using open_subdiagonal closed_Diff by auto qed - end