[STATEMENT]
theorem fps_nth_conv_deriv:
  fixes f :: "complex fps"
  assumes "fps_conv_radius f > 0"
  shows   "fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius f

goal (1 subgoal):
 1. fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n
[PROOF STEP]
proof (induction n arbitrary: f)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f 0 = (deriv ^^ 0) (eval_fps f) 0 / fact 0
 2. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < fps_conv_radius f

goal (2 subgoals):
 1. \<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f 0 = (deriv ^^ 0) (eval_fps f) 0 / fact 0
 2. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius f

goal (1 subgoal):
 1. fps_nth f 0 = (deriv ^^ 0) (eval_fps f) 0 / fact 0
[PROOF STEP]
by (simp add: eval_fps_def)
[PROOF STATE]
proof (state)
this:
fps_nth f 0 = (deriv ^^ 0) (eval_fps f) 0 / fact 0

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
case (Suc n f)
[PROOF STATE]
proof (state)
this:
0 < fps_conv_radius ?f \<Longrightarrow> fps_nth ?f n = (deriv ^^ n) (eval_fps ?f) 0 / fact n
0 < fps_conv_radius f

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
have "(deriv ^^ Suc n) (eval_fps f) 0 = (deriv ^^ n) (deriv (eval_fps f)) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ Suc n) (eval_fps f) 0 = (deriv ^^ n) (deriv (eval_fps f)) 0
[PROOF STEP]
unfolding funpow_Suc_right o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ n) (deriv (eval_fps f)) 0 = (deriv ^^ n) (deriv (eval_fps f)) 0
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc n) (eval_fps f) 0 = (deriv ^^ n) (deriv (eval_fps f)) 0

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc n) (eval_fps f) 0 = (deriv ^^ n) (deriv (eval_fps f)) 0

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
have "eventually (\<lambda>z::complex. z \<in> eball 0 (fps_conv_radius f)) (nhds 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds 0. z \<in> eball 0 (fps_conv_radius f)
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius f

goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds 0. z \<in> eball 0 (fps_conv_radius f)
[PROOF STEP]
by (intro eventually_nhds_in_open) (auto simp: zero_ereal_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in nhds 0. z \<in> eball 0 (fps_conv_radius f)

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
hence "eventually (\<lambda>z. deriv (eval_fps f) z = eval_fps (fps_deriv f) z) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F z in nhds 0. z \<in> eball 0 (fps_conv_radius f)

goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds 0. deriv (eval_fps f) z = eval_fps (fps_deriv f) z
[PROOF STEP]
by eventually_elim (simp add: eval_fps_deriv)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in nhds 0. deriv (eval_fps f) z = eval_fps (fps_deriv f) z

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
hence "(deriv ^^ n) (deriv (eval_fps f)) 0 = (deriv ^^ n) (eval_fps (fps_deriv f)) 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F z in nhds 0. deriv (eval_fps f) z = eval_fps (fps_deriv f) z

goal (1 subgoal):
 1. (deriv ^^ n) (deriv (eval_fps f)) 0 = (deriv ^^ n) (eval_fps (fps_deriv f)) 0
[PROOF STEP]
by (intro higher_deriv_cong_ev refl)
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (deriv (eval_fps f)) 0 = (deriv ^^ n) (eval_fps (fps_deriv f)) 0

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (deriv (eval_fps f)) 0 = (deriv ^^ n) (eval_fps (fps_deriv f)) 0

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
have "\<dots> / fact n = fps_nth (fps_deriv f) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ n) (eval_fps (fps_deriv f)) 0 / fact n = fps_nth (fps_deriv f) n
[PROOF STEP]
using Suc.prems fps_conv_radius_deriv[of f]
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius f
fps_conv_radius f \<le> fps_conv_radius (fps_deriv f)

goal (1 subgoal):
 1. (deriv ^^ n) (eval_fps (fps_deriv f)) 0 / fact n = fps_nth (fps_deriv f) n
[PROOF STEP]
by (intro Suc.IH [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (eval_fps (fps_deriv f)) 0 / fact n = fps_nth (fps_deriv f) n

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (eval_fps (fps_deriv f)) 0 / fact n = fps_nth (fps_deriv f) n

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
have "\<dots> / of_nat (Suc n) = fps_nth f (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_nth (fps_deriv f) n / of_nat (Suc n) = fps_nth f (Suc n)
[PROOF STEP]
by (simp add: fps_deriv_def del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
fps_nth (fps_deriv f) n / of_nat (Suc n) = fps_nth f (Suc n)

goal (1 subgoal):
 1. \<And>n f. \<lbrakk>\<And>f. 0 < fps_conv_radius f \<Longrightarrow> fps_nth f n = (deriv ^^ n) (eval_fps f) 0 / fact n; 0 < fps_conv_radius f\<rbrakk> \<Longrightarrow> fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(deriv ^^ Suc n) (eval_fps f) 0 / fact n / of_nat (Suc n) = fps_nth f (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(deriv ^^ Suc n) (eval_fps f) 0 / fact n / of_nat (Suc n) = fps_nth f (Suc n)

goal (1 subgoal):
 1. fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
fps_nth f (Suc n) = (deriv ^^ Suc n) (eval_fps f) 0 / fact (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem argument_principle:
  fixes f::"complex \<Rightarrow> complex" and poles s:: "complex set"
  defines "pz \<equiv> {w. f w = 0 \<or> w \<in> poles}" \<comment> \<open>\<^term>\<open>pz\<close> is the set of poles and zeros\<close>
  assumes "open s" and
          "connected s" and
          f_holo:"f holomorphic_on s-poles" and
          h_holo:"h holomorphic_on s" and
          "valid_path g" and
          loop:"pathfinish g = pathstart g" and
          path_img:"path_image g \<subseteq> s - pz" and
          homo:"\<forall>z. (z \<notin> s) \<longrightarrow> winding_number g z = 0" and
          finite:"finite pz" and
          poles:"\<forall>p\<in>poles. is_pole f p"
  shows "contour_integral g (\<lambda>x. deriv f x * h x / f x) = 2 * pi * \<i> *
          (\<Sum>p\<in>pz. winding_number g p * h p * zorder f p)"
    (is "?L=?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
define c where "c \<equiv> 2 * complex_of_real pi * \<i> "
[PROOF STATE]
proof (state)
this:
c \<equiv> 2 * complex_of_real pi * \<i>

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
define ff where "ff \<equiv> (\<lambda>x. deriv f x * h x / f x)"
[PROOF STATE]
proof (state)
this:
ff \<equiv> \<lambda>x. deriv f x * h x / f x

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
define cont where "cont \<equiv> \<lambda>ff p e. (ff has_contour_integral c * zorder f p * h p ) (circlepath p e)"
[PROOF STATE]
proof (state)
this:
cont \<equiv> \<lambda>ff p e. (ff has_contour_integral c * of_int (zorder f p) * h p) (circlepath p e)

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
define avoid where "avoid \<equiv> \<lambda>p e. \<forall>w\<in>cball p e. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)"
[PROOF STATE]
proof (state)
this:
avoid \<equiv> \<lambda>p e. \<forall>w\<in>cball p e. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
have "\<exists>e>0. avoid p e \<and> (p\<in>pz \<longrightarrow> cont ff p e)" when "p\<in>s" for p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
obtain e1 where "e1>0" and e1_avoid:"avoid p e1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e1. \<lbrakk>0 < e1; avoid p e1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_cball_avoid[OF \<open>open s\<close> finite] \<open>p\<in>s\<close>
[PROOF STATE]
proof (prove)
using this:
?p \<in> s \<Longrightarrow> \<exists>e>0. \<forall>w\<in>cball ?p e. w \<in> s \<and> (w \<noteq> ?p \<longrightarrow> w \<notin> pz)
p \<in> s

goal (1 subgoal):
 1. (\<And>e1. \<lbrakk>0 < e1; avoid p e1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding avoid_def
[PROOF STATE]
proof (prove)
using this:
?p \<in> s \<Longrightarrow> \<exists>e>0. \<forall>w\<in>cball ?p e. w \<in> s \<and> (w \<noteq> ?p \<longrightarrow> w \<notin> pz)
p \<in> s

goal (1 subgoal):
 1. (\<And>e1. \<lbrakk>0 < e1; \<forall>w\<in>cball p e1. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e1
avoid p e1

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
have "\<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2" when "p\<in>pz"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define po where "po \<equiv> zorder f p"
[PROOF STATE]
proof (state)
this:
po \<equiv> zorder f p

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define pp where "pp \<equiv> zor_poly f p"
[PROOF STATE]
proof (state)
this:
pp \<equiv> zor_poly f p

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define f' where "f' \<equiv> \<lambda>w. pp w * (w - p) powr po"
[PROOF STATE]
proof (state)
this:
f' \<equiv> \<lambda>w. pp w * (w - p) powr of_int po

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define ff' where "ff' \<equiv> (\<lambda>x. deriv f' x * h x / f' x)"
[PROOF STATE]
proof (state)
this:
ff' \<equiv> \<lambda>x. deriv f' x * h x / f' x

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
obtain r where "pp p\<noteq>0" "r>0" and
          "r<e1" and
          pp_holo:"pp holomorphic_on cball p r" and
          pp_po:"(\<forall>w\<in>cball p r-{p}. f w = pp w * (w - p) powr po \<and> pp w \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "isolated_singularity_at f p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isolated_singularity_at f p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isolated_singularity_at f p
[PROOF STEP]
have "f holomorphic_on ball p e1 - {p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f holomorphic_on ball p e1 - {p}
[PROOF STEP]
apply (intro holomorphic_on_subset[OF f_holo])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
using e1_avoid \<open>p\<in>pz\<close>
[PROOF STATE]
proof (prove)
using this:
avoid p e1
p \<in> pz

goal (1 subgoal):
 1. ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
unfolding avoid_def pz_def
[PROOF STATE]
proof (prove)
using this:
\<forall>w\<in>cball p e1. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> {w. f w = 0 \<or> w \<in> poles})
p \<in> {w. f w = 0 \<or> w \<in> poles}

goal (1 subgoal):
 1. ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
f holomorphic_on ball p e1 - {p}

goal (1 subgoal):
 1. isolated_singularity_at f p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f holomorphic_on ball p e1 - {p}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on ball p e1 - {p}

goal (1 subgoal):
 1. isolated_singularity_at f p
[PROOF STEP]
unfolding isolated_singularity_at_def
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on ball p e1 - {p}

goal (1 subgoal):
 1. \<exists>r>0. f analytic_on ball p r - {p}
[PROOF STEP]
using \<open>e1>0\<close> analytic_on_open open_delete
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on ball p e1 - {p}
0 < e1
open ?S \<Longrightarrow> (?f analytic_on ?S) = (?f holomorphic_on ?S)
open ?s \<Longrightarrow> open (?s - {?x})

goal (1 subgoal):
 1. \<exists>r>0. f analytic_on ball p r - {p}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
isolated_singularity_at f p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
isolated_singularity_at f p

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
isolated_singularity_at f p

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "not_essential f p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not_essential f p
[PROOF STEP]
proof (cases "is_pole f p")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_pole f p \<Longrightarrow> not_essential f p
 2. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
is_pole f p

goal (2 subgoals):
 1. is_pole f p \<Longrightarrow> not_essential f p
 2. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_pole f p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_pole f p

goal (1 subgoal):
 1. not_essential f p
[PROOF STEP]
unfolding not_essential_def
[PROOF STATE]
proof (prove)
using this:
is_pole f p

goal (1 subgoal):
 1. \<exists>x. f \<midarrow>p\<rightarrow> x \<or> is_pole f p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential f p

goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> is_pole f p

goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> is_pole f p
[PROOF STEP]
have "p\<in>s-poles"
[PROOF STATE]
proof (prove)
using this:
\<not> is_pole f p

goal (1 subgoal):
 1. p \<in> s - poles
[PROOF STEP]
using \<open>p\<in>s\<close> poles
[PROOF STATE]
proof (prove)
using this:
\<not> is_pole f p
p \<in> s
\<forall>p\<in>poles. is_pole f p

goal (1 subgoal):
 1. p \<in> s - poles
[PROOF STEP]
unfolding pz_def
[PROOF STATE]
proof (prove)
using this:
\<not> is_pole f p
p \<in> s
\<forall>p\<in>poles. is_pole f p

goal (1 subgoal):
 1. p \<in> s - poles
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<in> s - poles

goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p \<in> s - poles

goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
have "open (s-poles)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (s - poles)
[PROOF STEP]
using \<open>open s\<close>
[PROOF STATE]
proof (prove)
using this:
open s

goal (1 subgoal):
 1. open (s - poles)
[PROOF STEP]
apply (elim open_Diff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed poles
[PROOF STEP]
apply (rule finite_imp_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite poles
[PROOF STEP]
using finite
[PROOF STATE]
proof (prove)
using this:
finite pz

goal (1 subgoal):
 1. finite poles
[PROOF STEP]
unfolding pz_def
[PROOF STATE]
proof (prove)
using this:
finite {w. f w = 0 \<or> w \<in> poles}

goal (1 subgoal):
 1. finite poles
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
open (s - poles)

goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p \<in> s - poles
open (s - poles)
[PROOF STEP]
have "isCont f p"
[PROOF STATE]
proof (prove)
using this:
p \<in> s - poles
open (s - poles)

goal (1 subgoal):
 1. isCont f p
[PROOF STEP]
using holomorphic_on_imp_continuous_on[OF f_holo] continuous_on_eq_continuous_at
[PROOF STATE]
proof (prove)
using this:
p \<in> s - poles
open (s - poles)
continuous_on (s - poles) f
open ?s \<Longrightarrow> continuous_on ?s ?f = (\<forall>x\<in>?s. isCont ?f x)

goal (1 subgoal):
 1. isCont f p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
isCont f p

goal (1 subgoal):
 1. \<not> is_pole f p \<Longrightarrow> not_essential f p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isCont f p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isCont f p

goal (1 subgoal):
 1. not_essential f p
[PROOF STEP]
unfolding isCont_def not_essential_def
[PROOF STATE]
proof (prove)
using this:
f \<midarrow>p\<rightarrow> f p

goal (1 subgoal):
 1. \<exists>x. f \<midarrow>p\<rightarrow> x \<or> is_pole f p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
not_essential f p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
not_essential f p

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
not_essential f p

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>\<^sub>F w in at p. f w \<noteq> 0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<^sub>F w in at p. f w \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0)

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0)
[PROOF STEP]
have "\<forall>\<^sub>F w in at p. f w= 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0)

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at p. f w = 0
[PROOF STEP]
unfolding frequently_def
[PROOF STATE]
proof (prove)
using this:
\<not> \<not> (\<forall>\<^sub>F x in at p. \<not> f x \<noteq> 0)

goal (1 subgoal):
 1. \<forall>\<^sub>F w in at p. f w = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in at p. f w = 0

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F w in at p. f w = 0
[PROOF STEP]
obtain rr where "rr>0" "\<forall>w\<in>ball p rr - {p}. f w =0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in at p. f w = 0

goal (1 subgoal):
 1. (\<And>rr. \<lbrakk>0 < rr; \<forall>w\<in>ball p rr - {p}. f w = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_at
[PROOF STATE]
proof (prove)
using this:
\<exists>d>0. \<forall>x\<in>UNIV. x \<noteq> p \<and> dist x p < d \<longrightarrow> f x = 0

goal (1 subgoal):
 1. (\<And>rr. \<lbrakk>0 < rr; \<forall>w\<in>ball p rr - {p}. f w = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add:dist_commute)
[PROOF STATE]
proof (state)
this:
0 < rr
\<forall>w\<in>ball p rr - {p}. f w = 0

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < rr
\<forall>w\<in>ball p rr - {p}. f w = 0
[PROOF STEP]
have "ball p rr - {p} \<subseteq> {w\<in>ball p rr-{p}. f w=0}"
[PROOF STATE]
proof (prove)
using this:
0 < rr
\<forall>w\<in>ball p rr - {p}. f w = 0

goal (1 subgoal):
 1. ball p rr - {p} \<subseteq> {w \<in> ball p rr - {p}. f w = 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ball p rr - {p} \<subseteq> {w \<in> ball p rr - {p}. f w = 0}

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ball p rr - {p} \<subseteq> {w \<in> ball p rr - {p}. f w = 0}

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "infinite (ball p rr - {p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (ball p rr - {p})
[PROOF STEP]
using \<open>rr>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < rr

goal (1 subgoal):
 1. infinite (ball p rr - {p})
[PROOF STEP]
using finite_imp_not_open
[PROOF STATE]
proof (prove)
using this:
0 < rr
\<lbrakk>finite ?S; open ?S\<rbrakk> \<Longrightarrow> ?S = {}

goal (1 subgoal):
 1. infinite (ball p rr - {p})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
infinite (ball p rr - {p})

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ball p rr - {p} \<subseteq> {w \<in> ball p rr - {p}. f w = 0}
infinite (ball p rr - {p})
[PROOF STEP]
have "infinite {w\<in>ball p rr-{p}. f w=0}"
[PROOF STATE]
proof (prove)
using this:
ball p rr - {p} \<subseteq> {w \<in> ball p rr - {p}. f w = 0}
infinite (ball p rr - {p})

goal (1 subgoal):
 1. infinite {w \<in> ball p rr - {p}. f w = 0}
[PROOF STEP]
using infinite_super
[PROOF STATE]
proof (prove)
using this:
ball p rr - {p} \<subseteq> {w \<in> ball p rr - {p}. f w = 0}
infinite (ball p rr - {p})
\<lbrakk>?S \<subseteq> ?T; infinite ?S\<rbrakk> \<Longrightarrow> infinite ?T

goal (1 subgoal):
 1. infinite {w \<in> ball p rr - {p}. f w = 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
infinite {w \<in> ball p rr - {p}. f w = 0}

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite {w \<in> ball p rr - {p}. f w = 0}
[PROOF STEP]
have "infinite pz"
[PROOF STATE]
proof (prove)
using this:
infinite {w \<in> ball p rr - {p}. f w = 0}

goal (1 subgoal):
 1. infinite pz
[PROOF STEP]
unfolding pz_def infinite_super
[PROOF STATE]
proof (prove)
using this:
infinite {w \<in> ball p rr - {p}. f w = 0}

goal (1 subgoal):
 1. infinite {w. f w = 0 \<or> w \<in> poles}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infinite pz

goal (1 subgoal):
 1. \<not> (\<exists>\<^sub>F w in at p. f w \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite pz
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
infinite pz

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>finite pz\<close>
[PROOF STATE]
proof (prove)
using this:
infinite pz
finite pz

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F w in at p. f w \<noteq> 0

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
isolated_singularity_at f p
not_essential f p
\<exists>\<^sub>F w in at p. f w \<noteq> 0
[PROOF STEP]
obtain r where "pp p \<noteq> 0" and r:"r>0" "pp holomorphic_on cball p r"
                  "(\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0)"
[PROOF STATE]
proof (prove)
using this:
isolated_singularity_at f p
not_essential f p
\<exists>\<^sub>F w in at p. f w \<noteq> 0

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using zorder_exist[of f p,folded po_def pp_def]
[PROOF STATE]
proof (prove)
using this:
isolated_singularity_at f p
not_essential f p
\<exists>\<^sub>F w in at p. f w \<noteq> 0
\<lbrakk>isolated_singularity_at f p; not_essential f p; \<exists>\<^sub>F w in at p. f w \<noteq> 0\<rbrakk> \<Longrightarrow> pp p \<noteq> 0 \<and> (\<exists>r>0. pp holomorphic_on cball p r \<and> (\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0))

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pp p \<noteq> 0
0 < r
pp holomorphic_on cball p r
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define r1 where "r1=min r e1 / 2"
[PROOF STATE]
proof (state)
this:
r1 = min r e1 / 2

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "r1<e1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r1 < e1
[PROOF STEP]
unfolding r1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min r e1 / 2 < e1
[PROOF STEP]
using \<open>e1>0\<close> \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e1
0 < r

goal (1 subgoal):
 1. min r e1 / 2 < e1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r1 < e1

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r1 < e1

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "r1>0" "pp holomorphic_on cball p r1"
                  "(\<forall>w\<in>cball p r1 - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r1 &&& pp holomorphic_on cball p r1 &&& \<forall>w\<in>cball p r1 - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
[PROOF STEP]
unfolding r1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < min r e1 / 2 &&& pp holomorphic_on cball p (min r e1 / 2) &&& \<forall>w\<in>cball p (min r e1 / 2) - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
[PROOF STEP]
using \<open>e1>0\<close> r
[PROOF STATE]
proof (prove)
using this:
0 < e1
0 < r
pp holomorphic_on cball p r
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. 0 < min r e1 / 2 &&& pp holomorphic_on cball p (min r e1 / 2) &&& \<forall>w\<in>cball p (min r e1 / 2) - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < r1
pp holomorphic_on cball p r1
\<forall>w\<in>cball p r1 - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>pp p \<noteq> 0; 0 < r; r < e1; pp holomorphic_on cball p r; \<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r1 < e1
0 < r1
pp holomorphic_on cball p r1
\<forall>w\<in>cball p r1 - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r1 < e1
0 < r1
pp holomorphic_on cball p r1
\<forall>w\<in>cball p r1 - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that \<open>pp p\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
r1 < e1
0 < r1
pp holomorphic_on cball p r1
\<forall>w\<in>cball p r1 - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
\<lbrakk>pp p \<noteq> 0; 0 < ?r; ?r < e1; pp holomorphic_on cball p ?r; \<forall>w\<in>cball p ?r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
pp p \<noteq> 0

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pp p \<noteq> 0
0 < r
r < e1
pp holomorphic_on cball p r
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define e2 where "e2 \<equiv> r/2"
[PROOF STATE]
proof (state)
this:
e2 \<equiv> r / 2

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
have "e2>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e2
[PROOF STEP]
using \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. 0 < e2
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. 0 < r / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e2

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define anal where "anal \<equiv> \<lambda>w. deriv pp w * h w / pp w"
[PROOF STATE]
proof (state)
this:
anal \<equiv> \<lambda>w. deriv pp w * h w / pp w

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
define prin where "prin \<equiv> \<lambda>w. po * h w / (w - p)"
[PROOF STATE]
proof (state)
this:
prin \<equiv> \<lambda>w. of_int po * h w / (w - p)

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
have "((\<lambda>w.  prin w + anal w) has_contour_integral c * po * h p) (circlepath p e2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. prin w + anal w) has_contour_integral c * of_int po * h p) (circlepath p e2)
[PROOF STEP]
proof (rule has_contour_integral_add[of _ _ _ _ 0,simplified])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (prin has_contour_integral c * of_int po * h p) (circlepath p e2)
 2. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
have "ball p r \<subseteq> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball p r \<subseteq> s
[PROOF STEP]
using \<open>r<e1\<close> avoid_def ball_subset_cball e1_avoid
[PROOF STATE]
proof (prove)
using this:
r < e1
avoid \<equiv> \<lambda>p e. \<forall>w\<in>cball p e. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)
ball ?x ?e \<subseteq> cball ?x ?e
avoid p e1

goal (1 subgoal):
 1. ball p r \<subseteq> s
[PROOF STEP]
by (simp add: subset_eq)
[PROOF STATE]
proof (state)
this:
ball p r \<subseteq> s

goal (2 subgoals):
 1. (prin has_contour_integral c * of_int po * h p) (circlepath p e2)
 2. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball p r \<subseteq> s
[PROOF STEP]
have "cball p e2 \<subseteq> s"
[PROOF STATE]
proof (prove)
using this:
ball p r \<subseteq> s

goal (1 subgoal):
 1. cball p e2 \<subseteq> s
[PROOF STEP]
using \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
ball p r \<subseteq> s
0 < r

goal (1 subgoal):
 1. cball p e2 \<subseteq> s
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
ball p r \<subseteq> s
0 < r

goal (1 subgoal):
 1. cball p (r / 2) \<subseteq> s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cball p e2 \<subseteq> s

goal (2 subgoals):
 1. (prin has_contour_integral c * of_int po * h p) (circlepath p e2)
 2. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cball p e2 \<subseteq> s
[PROOF STEP]
have "(\<lambda>w. po * h w) holomorphic_on cball p e2"
[PROOF STATE]
proof (prove)
using this:
cball p e2 \<subseteq> s

goal (1 subgoal):
 1. (\<lambda>w. of_int po * h w) holomorphic_on cball p e2
[PROOF STEP]
using h_holo
[PROOF STATE]
proof (prove)
using this:
cball p e2 \<subseteq> s
h holomorphic_on s

goal (1 subgoal):
 1. (\<lambda>w. of_int po * h w) holomorphic_on cball p e2
[PROOF STEP]
by (auto intro!: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. of_int po * h w) holomorphic_on cball p e2

goal (2 subgoals):
 1. (prin has_contour_integral c * of_int po * h p) (circlepath p e2)
 2. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>w. of_int po * h w) holomorphic_on cball p e2
[PROOF STEP]
show "(prin has_contour_integral c * po * h p ) (circlepath p e2)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. of_int po * h w) holomorphic_on cball p e2

goal (1 subgoal):
 1. (prin has_contour_integral c * of_int po * h p) (circlepath p e2)
[PROOF STEP]
using Cauchy_integral_circlepath_simple[folded c_def, of "\<lambda>w. po * h w"] \<open>e2>0\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. of_int po * h w) holomorphic_on cball p e2
\<lbrakk>(\<lambda>w. of_int po * h w) holomorphic_on cball ?z ?r; cmod (?w - ?z) < ?r\<rbrakk> \<Longrightarrow> ((\<lambda>u. of_int po * h u / (u - ?w)) has_contour_integral c * (of_int po * h ?w)) (circlepath ?z ?r)
0 < e2

goal (1 subgoal):
 1. (prin has_contour_integral c * of_int po * h p) (circlepath p e2)
[PROOF STEP]
unfolding prin_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>w. of_int po * h w) holomorphic_on cball p e2
\<lbrakk>(\<lambda>w. of_int po * h w) holomorphic_on cball ?z ?r; cmod (?w - ?z) < ?r\<rbrakk> \<Longrightarrow> ((\<lambda>u. of_int po * h u / (u - ?w)) has_contour_integral c * (of_int po * h ?w)) (circlepath ?z ?r)
0 < e2

goal (1 subgoal):
 1. ((\<lambda>w. of_int po * h w / (w - p)) has_contour_integral c * of_int po * h p) (circlepath p e2)
[PROOF STEP]
by (auto simp add: mult.assoc)
[PROOF STATE]
proof (state)
this:
(prin has_contour_integral c * of_int po * h p) (circlepath p e2)

goal (1 subgoal):
 1. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
have "anal holomorphic_on ball p r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. anal holomorphic_on ball p r
[PROOF STEP]
unfolding anal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. deriv pp w * h w / pp w) holomorphic_on ball p r
[PROOF STEP]
using pp_holo h_holo pp_po \<open>ball p r \<subseteq> s\<close> \<open>pp p\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
pp holomorphic_on cball p r
h holomorphic_on s
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
ball p r \<subseteq> s
pp p \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>w. deriv pp w * h w / pp w) holomorphic_on ball p r
[PROOF STEP]
by (auto intro!: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
anal holomorphic_on ball p r

goal (1 subgoal):
 1. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
anal holomorphic_on ball p r
[PROOF STEP]
show "(anal has_contour_integral 0) (circlepath p e2)"
[PROOF STATE]
proof (prove)
using this:
anal holomorphic_on ball p r

goal (1 subgoal):
 1. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
using e2_def \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
anal holomorphic_on ball p r
e2 \<equiv> r / 2
0 < r

goal (1 subgoal):
 1. (anal has_contour_integral 0) (circlepath p e2)
[PROOF STEP]
by (auto elim!: Cauchy_theorem_disc_simple)
[PROOF STATE]
proof (state)
this:
(anal has_contour_integral 0) (circlepath p e2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>w. prin w + anal w) has_contour_integral c * of_int po * h p) (circlepath p e2)

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>w. prin w + anal w) has_contour_integral c * of_int po * h p) (circlepath p e2)
[PROOF STEP]
have "cont ff' p e2"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>w. prin w + anal w) has_contour_integral c * of_int po * h p) (circlepath p e2)

goal (1 subgoal):
 1. cont ff' p e2
[PROOF STEP]
unfolding cont_def po_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>w. prin w + anal w) has_contour_integral c * of_int (zorder f p) * h p) (circlepath p e2)

goal (1 subgoal):
 1. (ff' has_contour_integral c * of_int (zorder f p) * h p) (circlepath p e2)
[PROOF STEP]
proof (elim has_contour_integral_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
assume "w \<in> path_image (circlepath p e2)"
[PROOF STATE]
proof (state)
this:
w \<in> path_image (circlepath p e2)

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> path_image (circlepath p e2)
[PROOF STEP]
have "w\<in>ball p r" and "w\<noteq>p"
[PROOF STATE]
proof (prove)
using this:
w \<in> path_image (circlepath p e2)

goal (1 subgoal):
 1. w \<in> ball p r &&& w \<noteq> p
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
w \<in> path_image (circlepath p (r / 2))

goal (1 subgoal):
 1. w \<in> ball p r &&& w \<noteq> p
[PROOF STEP]
using \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
w \<in> path_image (circlepath p (r / 2))
0 < r

goal (1 subgoal):
 1. w \<in> ball p r &&& w \<noteq> p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> ball p r
w \<noteq> p

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
define wp where "wp \<equiv> w-p"
[PROOF STATE]
proof (state)
this:
wp \<equiv> w - p

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
have "wp\<noteq>0" and "pp w \<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp \<noteq> 0 &&& pp w \<noteq> 0
[PROOF STEP]
unfolding wp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w - p \<noteq> 0 &&& pp w \<noteq> 0
[PROOF STEP]
using \<open>w\<noteq>p\<close> \<open>w\<in>ball p r\<close> pp_po
[PROOF STATE]
proof (prove)
using this:
w \<noteq> p
w \<in> ball p r
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. w - p \<noteq> 0 &&& pp w \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wp \<noteq> 0
pp w \<noteq> 0

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wp \<noteq> 0
pp w \<noteq> 0

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
have der_f':"deriv f' w = po * pp w * (w-p) powr (po - 1) + deriv pp w * (w-p) powr po"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv f' w = of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po
[PROOF STEP]
proof (rule DERIV_imp_deriv)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f' has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po) (at w)
[PROOF STEP]
have "(pp has_field_derivative (deriv pp w)) (at w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pp has_field_derivative deriv pp w) (at w)
[PROOF STEP]
using DERIV_deriv_iff_has_field_derivative pp_holo \<open>w\<noteq>p\<close>
[PROOF STATE]
proof (prove)
using this:
(?f has_field_derivative deriv ?f ?x) (at ?x) = (\<exists>f'. (?f has_field_derivative f') (at ?x))
pp holomorphic_on cball p r
w \<noteq> p

goal (1 subgoal):
 1. (pp has_field_derivative deriv pp w) (at w)
[PROOF STEP]
by (meson open_ball \<open>w \<in> ball p r\<close> ball_subset_cball holomorphic_derivI holomorphic_on_subset)
[PROOF STATE]
proof (state)
this:
(pp has_field_derivative deriv pp w) (at w)

goal (1 subgoal):
 1. (f' has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po) (at w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(pp has_field_derivative deriv pp w) (at w)
[PROOF STEP]
show " (f' has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1)
                  + deriv pp w * (w - p) powr of_int po) (at w)"
[PROOF STATE]
proof (prove)
using this:
(pp has_field_derivative deriv pp w) (at w)

goal (1 subgoal):
 1. (f' has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po) (at w)
[PROOF STEP]
unfolding f'_def
[PROOF STATE]
proof (prove)
using this:
(pp has_field_derivative deriv pp w) (at w)

goal (1 subgoal):
 1. ((\<lambda>w. pp w * (w - p) powr of_int po) has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po) (at w)
[PROOF STEP]
using \<open>w\<noteq>p\<close>
[PROOF STATE]
proof (prove)
using this:
(pp has_field_derivative deriv pp w) (at w)
w \<noteq> p

goal (1 subgoal):
 1. ((\<lambda>w. pp w * (w - p) powr of_int po) has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po) (at w)
[PROOF STEP]
by (auto intro!: derivative_eq_intros DERIV_cong[OF has_field_derivative_powr_of_int])
[PROOF STATE]
proof (state)
this:
(f' has_field_derivative of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po) (at w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
deriv f' w = of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> prin x + anal x = ff' x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wp \<noteq> 0
pp w \<noteq> 0
deriv f' w = of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po
[PROOF STEP]
show "prin w + anal w = ff' w"
[PROOF STATE]
proof (prove)
using this:
wp \<noteq> 0
pp w \<noteq> 0
deriv f' w = of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po

goal (1 subgoal):
 1. prin w + anal w = ff' w
[PROOF STEP]
unfolding ff'_def prin_def anal_def
[PROOF STATE]
proof (prove)
using this:
wp \<noteq> 0
pp w \<noteq> 0
deriv f' w = of_int po * pp w * (w - p) powr of_int (po - 1) + deriv pp w * (w - p) powr of_int po

goal (1 subgoal):
 1. of_int po * h w / (w - p) + deriv pp w * h w / pp w = deriv f' w * h w / f' w
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wp \<noteq> 0; pp w \<noteq> 0; deriv f' w = of_int po * pp w * (w - p) powr (of_int po - 1) + deriv pp w * (w - p) powr of_int po\<rbrakk> \<Longrightarrow> of_int po * h w / (w - p) + deriv pp w * h w / pp w = (of_int po * pp w * (w - p) powr (of_int po - 1) + deriv pp w * (w - p) powr of_int po) * h w / f' w
[PROOF STEP]
apply (unfold f'_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wp \<noteq> 0; pp w \<noteq> 0; deriv (\<lambda>w. pp w * (w - p) powr of_int po) w = of_int po * pp w * (w - p) powr (of_int po - 1) + deriv pp w * (w - p) powr of_int po\<rbrakk> \<Longrightarrow> of_int po * h w / (w - p) + deriv pp w * h w / pp w = (of_int po * pp w * (w - p) powr (of_int po - 1) + deriv pp w * (w - p) powr of_int po) * h w / (pp w * (w - p) powr of_int po)
[PROOF STEP]
apply (fold wp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wp \<noteq> 0; pp w \<noteq> 0; deriv (\<lambda>w. pp w * (w - p) powr of_int po) w = of_int po * pp w * wp powr (of_int po - 1) + deriv pp w * wp powr of_int po\<rbrakk> \<Longrightarrow> of_int po * h w / wp + deriv pp w * h w / pp w = (of_int po * pp w * wp powr (of_int po - 1) + deriv pp w * wp powr of_int po) * h w / (pp w * wp powr of_int po)
[PROOF STEP]
apply (auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wp \<noteq> 0; pp w \<noteq> 0; deriv (\<lambda>w. pp w * (w - p) powr of_int po) w = deriv pp w * wp powr of_int po + of_int po * (pp w * wp powr (of_int po - 1)); po \<noteq> 0; wp powr of_int po \<noteq> wp * wp powr (of_int po - 1)\<rbrakk> \<Longrightarrow> h w = 0
[PROOF STEP]
by (metis (no_types, lifting) diff_add_cancel mult.commute powr_add powr_to_1)
[PROOF STATE]
proof (state)
this:
prin w + anal w = ff' w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cont ff' p e2

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cont ff' p e2
[PROOF STEP]
have "cont ff p e2"
[PROOF STATE]
proof (prove)
using this:
cont ff' p e2

goal (1 subgoal):
 1. cont ff p e2
[PROOF STEP]
unfolding cont_def
[PROOF STATE]
proof (prove)
using this:
(ff' has_contour_integral c * of_int (zorder f p) * h p) (circlepath p e2)

goal (1 subgoal):
 1. (ff has_contour_integral c * of_int (zorder f p) * h p) (circlepath p e2)
[PROOF STEP]
proof (elim has_contour_integral_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
assume "w \<in> path_image (circlepath p e2)"
[PROOF STATE]
proof (state)
this:
w \<in> path_image (circlepath p e2)

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<in> path_image (circlepath p e2)
[PROOF STEP]
have "w\<in>ball p r" and "w\<noteq>p"
[PROOF STATE]
proof (prove)
using this:
w \<in> path_image (circlepath p e2)

goal (1 subgoal):
 1. w \<in> ball p r &&& w \<noteq> p
[PROOF STEP]
unfolding e2_def
[PROOF STATE]
proof (prove)
using this:
w \<in> path_image (circlepath p (r / 2))

goal (1 subgoal):
 1. w \<in> ball p r &&& w \<noteq> p
[PROOF STEP]
using \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
w \<in> path_image (circlepath p (r / 2))
0 < r

goal (1 subgoal):
 1. w \<in> ball p r &&& w \<noteq> p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> ball p r
w \<noteq> p

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
have "deriv f' w =  deriv f w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv f' w = deriv f w
[PROOF STEP]
proof (rule complex_derivative_transform_within_open[where s="ball p r - {p}"])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. f' holomorphic_on ball p r - {p}
 2. f holomorphic_on ball p r - {p}
 3. open (ball p r - {p})
 4. w \<in> ball p r - {p}
 5. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
show "f' holomorphic_on ball p r - {p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f' holomorphic_on ball p r - {p}
[PROOF STEP]
unfolding f'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. pp w * (w - p) powr of_int po) holomorphic_on ball p r - {p}
[PROOF STEP]
using pp_holo
[PROOF STATE]
proof (prove)
using this:
pp holomorphic_on cball p r

goal (1 subgoal):
 1. (\<lambda>w. pp w * (w - p) powr of_int po) holomorphic_on ball p r - {p}
[PROOF STEP]
by (auto intro!: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
f' holomorphic_on ball p r - {p}

goal (4 subgoals):
 1. f holomorphic_on ball p r - {p}
 2. open (ball p r - {p})
 3. w \<in> ball p r - {p}
 4. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f holomorphic_on ball p r - {p}
 2. open (ball p r - {p})
 3. w \<in> ball p r - {p}
 4. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
have "ball p e1 - {p} \<subseteq> s - poles"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
using ball_subset_cball e1_avoid[unfolded avoid_def]
[PROOF STATE]
proof (prove)
using this:
ball ?x ?e \<subseteq> cball ?x ?e
\<forall>w\<in>cball p e1. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)

goal (1 subgoal):
 1. ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
unfolding pz_def
[PROOF STATE]
proof (prove)
using this:
ball ?x ?e \<subseteq> cball ?x ?e
\<forall>w\<in>cball p e1. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> {w. f w = 0 \<or> w \<in> poles})

goal (1 subgoal):
 1. ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball p e1 - {p} \<subseteq> s - poles

goal (4 subgoals):
 1. f holomorphic_on ball p r - {p}
 2. open (ball p r - {p})
 3. w \<in> ball p r - {p}
 4. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball p e1 - {p} \<subseteq> s - poles
[PROOF STEP]
have "ball p r - {p} \<subseteq> s - poles"
[PROOF STATE]
proof (prove)
using this:
ball p e1 - {p} \<subseteq> s - poles

goal (1 subgoal):
 1. ball p r - {p} \<subseteq> s - poles
[PROOF STEP]
apply (elim dual_order.trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ball p r - {p} \<subseteq> ball p e1 - {p}
[PROOF STEP]
using \<open>r<e1\<close>
[PROOF STATE]
proof (prove)
using this:
r < e1

goal (1 subgoal):
 1. ball p r - {p} \<subseteq> ball p e1 - {p}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball p r - {p} \<subseteq> s - poles

goal (4 subgoals):
 1. f holomorphic_on ball p r - {p}
 2. open (ball p r - {p})
 3. w \<in> ball p r - {p}
 4. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball p r - {p} \<subseteq> s - poles
[PROOF STEP]
show "f holomorphic_on ball p r - {p}"
[PROOF STATE]
proof (prove)
using this:
ball p r - {p} \<subseteq> s - poles

goal (1 subgoal):
 1. f holomorphic_on ball p r - {p}
[PROOF STEP]
using f_holo
[PROOF STATE]
proof (prove)
using this:
ball p r - {p} \<subseteq> s - poles
f holomorphic_on s - poles

goal (1 subgoal):
 1. f holomorphic_on ball p r - {p}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f holomorphic_on ball p r - {p}

goal (3 subgoals):
 1. open (ball p r - {p})
 2. w \<in> ball p r - {p}
 3. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open (ball p r - {p})
 2. w \<in> ball p r - {p}
 3. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
show "open (ball p r - {p})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (ball p r - {p})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (ball p r - {p})

goal (2 subgoals):
 1. w \<in> ball p r - {p}
 2. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
show "w \<in> ball p r - {p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> ball p r - {p}
[PROOF STEP]
using \<open>w\<in>ball p r\<close> \<open>w\<noteq>p\<close>
[PROOF STATE]
proof (prove)
using this:
w \<in> ball p r
w \<noteq> p

goal (1 subgoal):
 1. w \<in> ball p r - {p}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> ball p r - {p}

goal (1 subgoal):
 1. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
assume "x \<in> ball p r - {p}"
[PROOF STATE]
proof (state)
this:
x \<in> ball p r - {p}

goal (1 subgoal):
 1. \<And>w. w \<in> ball p r - {p} \<Longrightarrow> f' w = f w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> ball p r - {p}
[PROOF STEP]
show "f' x = f x"
[PROOF STATE]
proof (prove)
using this:
x \<in> ball p r - {p}

goal (1 subgoal):
 1. f' x = f x
[PROOF STEP]
using pp_po
[PROOF STATE]
proof (prove)
using this:
x \<in> ball p r - {p}
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. f' x = f x
[PROOF STEP]
unfolding f'_def
[PROOF STATE]
proof (prove)
using this:
x \<in> ball p r - {p}
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0

goal (1 subgoal):
 1. pp x * (x - p) powr of_int po = f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f' x = f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
deriv f' w = deriv f w

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
deriv f' w = deriv f w

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
have " f' w  =  f w "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f' w = f w
[PROOF STEP]
using \<open>w \<in> ball p r\<close> ball_subset_cball subset_iff pp_po \<open>w\<noteq>p\<close>
[PROOF STATE]
proof (prove)
using this:
w \<in> ball p r
ball ?x ?e \<subseteq> cball ?x ?e
(?A \<subseteq> ?B) = (\<forall>t. t \<in> ?A \<longrightarrow> t \<in> ?B)
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
w \<noteq> p

goal (1 subgoal):
 1. f' w = f w
[PROOF STEP]
unfolding f'_def
[PROOF STATE]
proof (prove)
using this:
w \<in> ball p r
ball ?x ?e \<subseteq> cball ?x ?e
(?A \<subseteq> ?B) = (\<forall>t. t \<in> ?A \<longrightarrow> t \<in> ?B)
\<forall>w\<in>cball p r - {p}. f w = pp w * (w - p) powr of_int po \<and> pp w \<noteq> 0
w \<noteq> p

goal (1 subgoal):
 1. pp w * (w - p) powr of_int po = f w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f' w = f w

goal (1 subgoal):
 1. \<And>x. x \<in> path_image (circlepath p e2) \<Longrightarrow> ff' x = ff x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
deriv f' w = deriv f w
f' w = f w
[PROOF STEP]
show "ff' w = ff w"
[PROOF STATE]
proof (prove)
using this:
deriv f' w = deriv f w
f' w = f w

goal (1 subgoal):
 1. ff' w = ff w
[PROOF STEP]
unfolding ff'_def ff_def
[PROOF STATE]
proof (prove)
using this:
deriv f' w = deriv f w
f' w = f w

goal (1 subgoal):
 1. deriv f' w * h w / f' w = deriv f w * h w / f w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ff' w = ff w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cont ff p e2

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cont ff p e2

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
have "cball p e2 \<subseteq> ball p e1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball p e2 \<subseteq> ball p e1
[PROOF STEP]
using \<open>0 < r\<close> \<open>r<e1\<close> e2_def
[PROOF STATE]
proof (prove)
using this:
0 < r
r < e1
e2 \<equiv> r / 2

goal (1 subgoal):
 1. cball p e2 \<subseteq> ball p e1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cball p e2 \<subseteq> ball p e1

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cont ff p e2
cball p e2 \<subseteq> ball p e1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cont ff p e2
cball p e2 \<subseteq> ball p e1

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
using \<open>e2>0\<close>
[PROOF STATE]
proof (prove)
using this:
cont ff p e2
cball p e2 \<subseteq> ball p e1
0 < e2

goal (1 subgoal):
 1. \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
p \<in> pz \<Longrightarrow> \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> pz \<Longrightarrow> \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
[PROOF STEP]
obtain e2 where e2:"p\<in>pz \<longrightarrow> e2>0 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2"
[PROOF STATE]
proof (prove)
using this:
p \<in> pz \<Longrightarrow> \<exists>e2>0. cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2

goal (1 subgoal):
 1. (\<And>e2. p \<in> pz \<longrightarrow> 0 < e2 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<in> pz \<longrightarrow> 0 < e2 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
define e4 where "e4 \<equiv> if p\<in>pz then e2 else  e1"
[PROOF STATE]
proof (state)
this:
e4 \<equiv> if p \<in> pz then e2 else e1

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
have "e4>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e4
[PROOF STEP]
using e2 \<open>e1>0\<close>
[PROOF STATE]
proof (prove)
using this:
p \<in> pz \<longrightarrow> 0 < e2 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
0 < e1

goal (1 subgoal):
 1. 0 < e4
[PROOF STEP]
unfolding e4_def
[PROOF STATE]
proof (prove)
using this:
p \<in> pz \<longrightarrow> 0 < e2 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
0 < e1

goal (1 subgoal):
 1. 0 < (if p \<in> pz then e2 else e1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e4

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e4

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
have "avoid p e4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. avoid p e4
[PROOF STEP]
using e2 \<open>e1>0\<close> e1_avoid
[PROOF STATE]
proof (prove)
using this:
p \<in> pz \<longrightarrow> 0 < e2 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
0 < e1
avoid p e1

goal (1 subgoal):
 1. avoid p e4
[PROOF STEP]
unfolding e4_def avoid_def
[PROOF STATE]
proof (prove)
using this:
p \<in> pz \<longrightarrow> 0 < e2 \<and> cball p e2 \<subseteq> ball p e1 \<and> cont ff p e2
0 < e1
\<forall>w\<in>cball p e1. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)

goal (1 subgoal):
 1. \<forall>w\<in>cball p (if p \<in> pz then e2 else e1). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
avoid p e4

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
avoid p e4

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
have "p\<in>pz \<longrightarrow> cont ff p e4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> pz \<longrightarrow> cont ff p e4
[PROOF STEP]
by (auto simp add: e2 e4_def)
[PROOF STATE]
proof (state)
this:
p \<in> pz \<longrightarrow> cont ff p e4

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < e4
avoid p e4
p \<in> pz \<longrightarrow> cont ff p e4
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e4
avoid p e4
p \<in> pz \<longrightarrow> cont ff p e4

goal (1 subgoal):
 1. \<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>e>0. avoid p e \<and> (p \<in> pz \<longrightarrow> cont ff p e)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?p \<in> s \<Longrightarrow> \<exists>e>0. avoid ?p e \<and> (?p \<in> pz \<longrightarrow> cont ff ?p e)

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?p \<in> s \<Longrightarrow> \<exists>e>0. avoid ?p e \<and> (?p \<in> pz \<longrightarrow> cont ff ?p e)
[PROOF STEP]
obtain get_e where get_e:"\<forall>p\<in>s. get_e p>0 \<and> avoid p (get_e p)
      \<and> (p\<in>pz \<longrightarrow> cont ff p (get_e p))"
[PROOF STATE]
proof (prove)
using this:
?p \<in> s \<Longrightarrow> \<exists>e>0. avoid ?p e \<and> (?p \<in> pz \<longrightarrow> cont ff ?p e)

goal (1 subgoal):
 1. (\<And>get_e. \<forall>p\<in>s. 0 < get_e p \<and> avoid p (get_e p) \<and> (p \<in> pz \<longrightarrow> cont ff p (get_e p)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>s. 0 < get_e p \<and> avoid p (get_e p) \<and> (p \<in> pz \<longrightarrow> cont ff p (get_e p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
define ci where "ci \<equiv> \<lambda>p. contour_integral (circlepath p (get_e p)) ff"
[PROOF STATE]
proof (state)
this:
ci \<equiv> \<lambda>p. contour_integral (circlepath p (get_e p)) ff

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
define w where "w \<equiv> \<lambda>p. winding_number g p"
[PROOF STATE]
proof (state)
this:
w \<equiv> winding_number g

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
have "contour_integral g ff = (\<Sum>p\<in>pz. w p * ci p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral g ff = (\<Sum>p\<in>pz. w p * ci p)
[PROOF STEP]
unfolding ci_def w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral g ff = (\<Sum>p\<in>pz. winding_number g p * contour_integral (circlepath p (get_e p)) ff)
[PROOF STEP]
proof (rule Cauchy_theorem_singularities[OF \<open>open s\<close> \<open>connected s\<close> finite _ \<open>valid_path g\<close> loop
        path_img homo])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ff holomorphic_on s - pz
 2. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
have "open (s - pz)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (s - pz)
[PROOF STEP]
using open_Diff[OF _ finite_imp_closed[OF finite]] \<open>open s\<close>
[PROOF STATE]
proof (prove)
using this:
open ?S \<Longrightarrow> open (?S - pz)
open s

goal (1 subgoal):
 1. open (s - pz)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (s - pz)

goal (2 subgoals):
 1. ff holomorphic_on s - pz
 2. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open (s - pz)
[PROOF STEP]
show "ff holomorphic_on s - pz"
[PROOF STATE]
proof (prove)
using this:
open (s - pz)

goal (1 subgoal):
 1. ff holomorphic_on s - pz
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
using this:
open (s - pz)

goal (1 subgoal):
 1. (\<lambda>x. deriv f x * h x / f x) holomorphic_on s - pz
[PROOF STEP]
using f_holo h_holo
[PROOF STATE]
proof (prove)
using this:
open (s - pz)
f holomorphic_on s - poles
h holomorphic_on s

goal (1 subgoal):
 1. (\<lambda>x. deriv f x * h x / f x) holomorphic_on s - pz
[PROOF STEP]
by (auto intro!: holomorphic_intros simp add:pz_def)
[PROOF STATE]
proof (state)
this:
ff holomorphic_on s - pz

goal (1 subgoal):
 1. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
show "\<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
using get_e
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>s. 0 < get_e p \<and> avoid p (get_e p) \<and> (p \<in> pz \<longrightarrow> cont ff p (get_e p))

goal (1 subgoal):
 1. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
using avoid_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>s. 0 < get_e p \<and> avoid p (get_e p) \<and> (p \<in> pz \<longrightarrow> cont ff p (get_e p))
avoid \<equiv> \<lambda>p e. \<forall>w\<in>cball p e. w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz)

goal (1 subgoal):
 1. \<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>s. 0 < get_e p \<and> (\<forall>w\<in>cball p (get_e p). w \<in> s \<and> (w \<noteq> p \<longrightarrow> w \<notin> pz))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
contour_integral g ff = (\<Sum>p\<in>pz. w p * ci p)

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral g ff = (\<Sum>p\<in>pz. w p * ci p)

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
have "... = (\<Sum>p\<in>pz. c * w p * h p * zorder f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p\<in>pz. w p * ci p) = (\<Sum>p\<in>pz. c * w p * h p * of_int (zorder f p))
[PROOF STEP]
proof (rule sum.cong[of pz pz,simplified])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> pz \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> pz \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
assume "p \<in> pz"
[PROOF STATE]
proof (state)
this:
p \<in> pz

goal (1 subgoal):
 1. \<And>p. p \<in> pz \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
show "w p * ci p = c * w p * h p * (zorder f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
proof (cases "p\<in>s")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<in> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
 2. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
assume "p \<in> s"
[PROOF STATE]
proof (state)
this:
p \<in> s

goal (2 subgoals):
 1. p \<in> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
 2. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
have "ci p = c * h p * (zorder f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ci p = c * h p * of_int (zorder f p)
[PROOF STEP]
unfolding ci_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (circlepath p (get_e p)) ff = c * h p * of_int (zorder f p)
[PROOF STEP]
apply (rule contour_integral_unique)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ff has_contour_integral c * h p * of_int (zorder f p)) (circlepath p (get_e p))
[PROOF STEP]
using get_e \<open>p\<in>s\<close> \<open>p\<in>pz\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>s. 0 < get_e p \<and> avoid p (get_e p) \<and> (p \<in> pz \<longrightarrow> cont ff p (get_e p))
p \<in> s
p \<in> pz

goal (1 subgoal):
 1. (ff has_contour_integral c * h p * of_int (zorder f p)) (circlepath p (get_e p))
[PROOF STEP]
unfolding cont_def
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>s. 0 < get_e p \<and> avoid p (get_e p) \<and> (p \<in> pz \<longrightarrow> (ff has_contour_integral c * of_int (zorder f p) * h p) (circlepath p (get_e p)))
p \<in> s
p \<in> pz

goal (1 subgoal):
 1. (ff has_contour_integral c * h p * of_int (zorder f p)) (circlepath p (get_e p))
[PROOF STEP]
by (metis mult.assoc mult.commute)
[PROOF STATE]
proof (state)
this:
ci p = c * h p * of_int (zorder f p)

goal (2 subgoals):
 1. p \<in> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
 2. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ci p = c * h p * of_int (zorder f p)

goal (1 subgoal):
 1. w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w p * ci p = c * w p * h p * of_int (zorder f p)

goal (1 subgoal):
 1. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
assume "p\<notin>s"
[PROOF STATE]
proof (state)
this:
p \<notin> s

goal (1 subgoal):
 1. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<notin> s
[PROOF STEP]
have "w p=0"
[PROOF STATE]
proof (prove)
using this:
p \<notin> s

goal (1 subgoal):
 1. w p = 0
[PROOF STEP]
using homo
[PROOF STATE]
proof (prove)
using this:
p \<notin> s
\<forall>z. z \<notin> s \<longrightarrow> winding_number g z = 0

goal (1 subgoal):
 1. w p = 0
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
p \<notin> s
\<forall>z. z \<notin> s \<longrightarrow> winding_number g z = 0

goal (1 subgoal):
 1. winding_number g p = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w p = 0

goal (1 subgoal):
 1. p \<notin> s \<Longrightarrow> w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w p = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w p = 0

goal (1 subgoal):
 1. w p * ci p = c * w p * h p * of_int (zorder f p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w p * ci p = c * w p * h p * of_int (zorder f p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w p * ci p = c * w p * h p * of_int (zorder f p)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>p\<in>pz. w p * ci p) = (\<Sum>p\<in>pz. c * w p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>p\<in>pz. w p * ci p) = (\<Sum>p\<in>pz. c * w p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
have "... = c*(\<Sum>p\<in>pz. w p * h p * zorder f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p\<in>pz. c * w p * h p * of_int (zorder f p)) = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p\<in>pz. c * w p * h p * of_int (zorder f p)) = (\<Sum>n\<in>pz. c * (w n * h n * of_int (zorder f n)))
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>p\<in>pz. c * w p * h p * of_int (zorder f p)) = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))
[PROOF STEP]
have "contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))"
[PROOF STATE]
proof (prove)
using this:
contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
contour_integral g ff = c * (\<Sum>p\<in>pz. w p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
unfolding ff_def c_def w_def
[PROOF STATE]
proof (prove)
using this:
contour_integral g (\<lambda>x. deriv f x * h x / f x) = 2 * complex_of_real pi * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))

goal (1 subgoal):
 1. contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
contour_integral g (\<lambda>x. deriv f x * h x / f x) = complex_of_real (2 * pi) * \<i> * (\<Sum>p\<in>pz. winding_number g p * h p * of_int (zorder f p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infsetsum_uminus: "infsetsum (\<lambda>x. -f x) A = -infsetsum f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>ax\<in>A. - f x) = - infsetsum f A
[PROOF STEP]
unfolding infsetsum_def abs_summable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|count_space A. - f x = - integral\<^sup>L (count_space A) f
[PROOF STEP]
by (rule Bochner_Integration.integral_minus)


[STATEMENT]
lemma S_eq:
  "n \<ge> 2 \<Longrightarrow> S (of_nat n) (of_nat n + x) = (ln (G (real n + x)) - ln (fact (n - 1))) / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> n \<Longrightarrow> S (real n) (real n + x) = (ln (G (real n + x)) - ln (fact (n - 1))) / x
[PROOF STEP]
by (subst G_fact [symmetric]) (simp add: S_def add_ac of_nat_diff)


[STATEMENT]
lemma bin_set_cases: obtains "S = {}" | "S = {bin0}" | "S = {bin1}" | "S = binUNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S = {} \<Longrightarrow> thesis; S = {bin0} \<Longrightarrow> thesis; S = {bin1} \<Longrightarrow> thesis; S = binUNIV \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
unfolding bin_empty_iff[of _ "bin0"] bin_UNIV_iff[of _ "bin0"] bin_sing_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bin0 \<notin> S \<and> 1 - bin0 \<notin> S \<Longrightarrow> thesis; bin0 \<in> S \<and> 1 - bin0 \<notin> S \<Longrightarrow> thesis; bin1 \<in> S \<and> 1 - bin1 \<notin> S \<Longrightarrow> thesis; bin0 \<in> S \<and> 1 - bin0 \<in> S \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by fastforce


[STATEMENT]
theorem ln_upper_9: "0<x \<Longrightarrow> ln(x) \<le> ln_upper_9 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> ln_upper_9 x
[PROOF STEP]
by (metis le_less_linear less_eq_real_def ln_upper_9_neg ln_upper_9_pos)


[STATEMENT]
lemma z1pmod2: "(2 * b + 1) mod 2 = (1::int)"
  for b :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 * b + 1) mod 2 = 1
[PROOF STEP]
by arith


[STATEMENT]
lemma monic_imp_div_mod_int_poly_degree:
  fixes p :: "'a::{comm_ring_1,semiring_1_no_zero_divisors} poly"
  assumes m: "monic u"
  shows "\<exists>q r. p = q*u + r \<and> (r = 0 \<or> degree r < degree u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q r. p = q * u + r \<and> (r = 0 \<or> degree r < degree u)
[PROOF STEP]
using pseudo_mod_monic[OF m]
[PROOF STATE]
proof (prove)
using this:
\<exists>q. ?f = u * q + pseudo_mod ?f u
pseudo_mod ?f u = 0 \<or> degree (pseudo_mod ?f u) < degree u

goal (1 subgoal):
 1. \<exists>q r. p = q * u + r \<and> (r = 0 \<or> degree r < degree u)
[PROOF STEP]
using mult.commute
[PROOF STATE]
proof (prove)
using this:
\<exists>q. ?f = u * q + pseudo_mod ?f u
pseudo_mod ?f u = 0 \<or> degree (pseudo_mod ?f u) < degree u
?a * ?b = ?b * ?a

goal (1 subgoal):
 1. \<exists>q r. p = q * u + r \<and> (r = 0 \<or> degree r < degree u)
[PROOF STEP]
by metis


[STATEMENT]
lemma continuous_at_closest_point:
  assumes "convex S"
    and "closed S"
    and "S \<noteq> {}"
  shows "continuous (at x) (closest_point S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (closest_point S) x
[PROOF STEP]
unfolding continuous_at_eps_delta
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. \<forall>x'. dist x' x < d \<longrightarrow> dist (closest_point S x') (closest_point S x) < e
[PROOF STEP]
using le_less_trans[OF closest_point_lipschitz[OF assms]]
[PROOF STATE]
proof (prove)
using this:
dist ?x1 ?y1 < ?z \<Longrightarrow> dist (closest_point S ?x1) (closest_point S ?y1) < ?z

goal (1 subgoal):
 1. \<forall>e>0. \<exists>d>0. \<forall>x'. dist x' x < d \<longrightarrow> dist (closest_point S x') (closest_point S x) < e
[PROOF STEP]
by auto


[STATEMENT]
lemma Inf_closed_res_nuc:
  fixes X :: "'a::quantale set"
  assumes "Inf_closed_set X"
  and  "\<forall>x. \<forall>y \<in> X. x \<rightarrow> y \<in> X"
  and "\<forall>x. \<forall>y \<in> X. y \<leftarrow> x \<in> X"
  shows "nucleus (\<lambda>y. \<Sqinter>{x \<in> X. y \<le> x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nucleus (\<lambda>y. \<Sqinter> {x \<in> X. y \<le> x})
[PROOF STEP]
unfolding nucleus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clop (\<lambda>y. \<Sqinter> {x \<in> X. y \<le> x}) \<and> (\<forall>x y. \<Sqinter> {xa \<in> X. x \<le> xa} \<cdot> \<Sqinter> {x \<in> X. y \<le> x} \<le> \<Sqinter> {xa \<in> X. x \<cdot> y \<le> xa})
[PROOF STEP]
by (simp add: Inf_closed_clop assms lax_aux)


[STATEMENT]
lemma sets_pair_measure:
  "sets (A \<Otimes>\<^sub>M B) = sigma_sets (space A \<times> space B) {a \<times> b | a b. a \<in> sets A \<and> b \<in> sets B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (A \<Otimes>\<^sub>M B) = sigma_sets (space A \<times> space B) {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B}
[PROOF STEP]
unfolding pair_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (measure_of (space A \<times> space B) {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B} (\<lambda>X. \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator X (x, y) \<partial>B \<partial>A)) = sigma_sets (space A \<times> space B) {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B}
[PROOF STEP]
using pair_measure_closed[of A B]
[PROOF STATE]
proof (prove)
using this:
{a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B} \<subseteq> Pow (space A \<times> space B)

goal (1 subgoal):
 1. sets (measure_of (space A \<times> space B) {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B} (\<lambda>X. \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. indicator X (x, y) \<partial>B \<partial>A)) = sigma_sets (space A \<times> space B) {a \<times> b |a b. a \<in> sets A \<and> b \<in> sets B}
[PROOF STEP]
by (rule sets_measure_of)


[STATEMENT]
lemma some_neq_not_eq [simp]: "\<not>((SOME x :: nat. x \<noteq> i) = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<noteq> i) \<noteq> i
[PROOF STEP]
by (subst some_eq_ex) (metis zero_neq_numeral)