[STATEMENT]
lemma Cauchy_integral_formula_global_weak:
  assumes "open U" and holf: "f holomorphic_on U"
        and z: "z \<in> U" and \<gamma>: "polynomial_function \<gamma>"
        and pasz: "path_image \<gamma> \<subseteq> U - {z}" and loop: "pathfinish \<gamma> = pathstart \<gamma>"
        and zero: "\<And>w. w \<notin> U \<Longrightarrow> winding_number \<gamma> w = 0"
      shows "((\<lambda>w. f w / (w - z)) has_contour_integral (2*pi * \<i> * winding_number \<gamma> z * f z)) \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
obtain \<gamma>' where pf\<gamma>': "polynomial_function \<gamma>'" and \<gamma>': "\<And>x. (\<gamma> has_vector_derivative (\<gamma>' x)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<gamma>'. \<lbrakk>polynomial_function \<gamma>'; \<And>x. (\<gamma> has_vector_derivative \<gamma>' x) (at x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using has_vector_derivative_polynomial_function [OF \<gamma>]
[PROOF STATE]
proof (prove)
using this:
(\<And>p'. \<lbrakk>polynomial_function p'; \<And>x. (\<gamma> has_vector_derivative p' x) (at x)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>\<gamma>'. \<lbrakk>polynomial_function \<gamma>'; \<And>x. (\<gamma> has_vector_derivative \<gamma>' x) (at x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
polynomial_function \<gamma>'
(\<gamma> has_vector_derivative \<gamma>' ?x) (at ?x)

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
polynomial_function \<gamma>'
(\<gamma> has_vector_derivative \<gamma>' ?x) (at ?x)
[PROOF STEP]
have "bounded(path_image \<gamma>')"
[PROOF STATE]
proof (prove)
using this:
polynomial_function \<gamma>'
(\<gamma> has_vector_derivative \<gamma>' ?x) (at ?x)

goal (1 subgoal):
 1. bounded (path_image \<gamma>')
[PROOF STEP]
by (simp add: path_image_def compact_imp_bounded compact_continuous_image continuous_on_polymonial_function)
[PROOF STATE]
proof (state)
this:
bounded (path_image \<gamma>')

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded (path_image \<gamma>')
[PROOF STEP]
obtain B where "B>0" and B: "\<And>x. x \<in> path_image \<gamma>' \<Longrightarrow> norm x \<le> B"
[PROOF STATE]
proof (prove)
using this:
bounded (path_image \<gamma>')

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>0 < B; \<And>x. x \<in> path_image \<gamma>' \<Longrightarrow> cmod x \<le> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bounded_pos
[PROOF STATE]
proof (prove)
using this:
bounded (path_image \<gamma>')
bounded ?S = (\<exists>b>0. \<forall>x\<in>?S. norm x \<le> b)

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>0 < B; \<And>x. x \<in> path_image \<gamma>' \<Longrightarrow> cmod x \<le> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < B
?x \<in> path_image \<gamma>' \<Longrightarrow> cmod ?x \<le> B

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
define d where [abs_def]: "d z w = (if w = z then deriv f z else (f w - f z)/(w - z))" for z w
[PROOF STATE]
proof (state)
this:
d \<equiv> \<lambda>z w. if w = z then deriv f z else (f w - f z) / (w - z)

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
define v where "v = {w. w \<notin> path_image \<gamma> \<and> winding_number \<gamma> w = 0}"
[PROOF STATE]
proof (state)
this:
v = {w. w \<notin> path_image \<gamma> \<and> winding_number \<gamma> w = 0}

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "path \<gamma>" "valid_path \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path \<gamma> &&& valid_path \<gamma>
[PROOF STEP]
using \<gamma>
[PROOF STATE]
proof (prove)
using this:
polynomial_function \<gamma>

goal (1 subgoal):
 1. path \<gamma> &&& valid_path \<gamma>
[PROOF STEP]
by (auto simp: path_polynomial_function valid_path_polynomial_function)
[PROOF STATE]
proof (state)
this:
path \<gamma>
valid_path \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path \<gamma>
valid_path \<gamma>
[PROOF STEP]
have ov: "open v"
[PROOF STATE]
proof (prove)
using this:
path \<gamma>
valid_path \<gamma>

goal (1 subgoal):
 1. open v
[PROOF STEP]
by (simp add: v_def open_winding_number_levelsets loop)
[PROOF STATE]
proof (state)
this:
open v

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have uv_Un: "U \<union> v = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<union> v = UNIV
[PROOF STEP]
using pasz zero
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> U - {z}
?w \<notin> U \<Longrightarrow> winding_number \<gamma> ?w = 0

goal (1 subgoal):
 1. U \<union> v = UNIV
[PROOF STEP]
by (auto simp: v_def)
[PROOF STATE]
proof (state)
this:
U \<union> v = UNIV

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have conf: "continuous_on U f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U f
[PROOF STEP]
by (metis holf holomorphic_on_imp_continuous_on)
[PROOF STATE]
proof (state)
this:
continuous_on U f

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have hol_d: "(d y) holomorphic_on U" if "y \<in> U" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
have *: "(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U
[PROOF STEP]
by (simp add: holf pole_lemma_open \<open>open U\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U

goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U
[PROOF STEP]
have "isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U

goal (1 subgoal):
 1. isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y
[PROOF STEP]
using at_within_open field_differentiable_imp_continuous_at holomorphic_on_def that \<open>open U\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U
\<lbrakk>?a \<in> ?S; open ?S\<rbrakk> \<Longrightarrow> at ?a within ?S = at ?a
?f field_differentiable at ?x within ?S \<Longrightarrow> continuous (at ?x within ?S) ?f
?f holomorphic_on ?s \<equiv> \<forall>x\<in>?s. ?f field_differentiable at x within ?s
y \<in> U
open U

goal (1 subgoal):
 1. isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y

goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y
[PROOF STEP]
have "continuous_on U (d y)"
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y

goal (1 subgoal):
 1. continuous_on U (d y)
[PROOF STEP]
using "*" d_def holomorphic_on_imp_continuous_on
[PROOF STATE]
proof (prove)
using this:
isCont (\<lambda>x. if x = y then deriv f y else (f x - f y) / (x - y)) y
(\<lambda>c. if c = y then deriv f y else (f c - f y) / (c - y)) holomorphic_on U
d \<equiv> \<lambda>z w. if w = z then deriv f z else (f w - f z) / (w - z)
?f holomorphic_on ?s \<Longrightarrow> continuous_on ?s ?f

goal (1 subgoal):
 1. continuous_on U (d y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on U (d y)

goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on U (d y)

goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
have "d y holomorphic_on U - {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d y holomorphic_on U - {y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d y holomorphic_on U - {y}
[PROOF STEP]
have "(\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) field_differentiable at w"
        if "w \<in> U - {y}" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) field_differentiable at w
[PROOF STEP]
proof (rule field_differentiable_transform_within)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 < ?d
 2. w \<in> UNIV
 3. \<And>x'. \<lbrakk>x' \<in> UNIV; dist x' w < ?d\<rbrakk> \<Longrightarrow> ?f x' = (if x' = y then deriv f y else (f x' - f y) / (x' - y))
 4. ?f field_differentiable at w
[PROOF STEP]
show "(\<lambda>w. (f w - f y) / (w - y)) field_differentiable at w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. (f w - f y) / (w - y)) field_differentiable at w
[PROOF STEP]
using that \<open>open U\<close> holf
[PROOF STATE]
proof (prove)
using this:
w \<in> U - {y}
open U
f holomorphic_on U

goal (1 subgoal):
 1. (\<lambda>w. (f w - f y) / (w - y)) field_differentiable at w
[PROOF STEP]
by (auto intro!: holomorphic_on_imp_differentiable_at derivative_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. (f w - f y) / (w - y)) field_differentiable at w

goal (3 subgoals):
 1. 0 < ?d
 2. w \<in> UNIV
 3. \<And>x'. \<lbrakk>x' \<in> UNIV; dist x' w < ?d\<rbrakk> \<Longrightarrow> (f x' - f y) / (x' - y) = (if x' = y then deriv f y else (f x' - f y) / (x' - y))
[PROOF STEP]
show "dist w y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < dist w y
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
w \<in> U - {y}

goal (1 subgoal):
 1. 0 < dist w y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < dist w y

goal (2 subgoals):
 1. w \<in> UNIV
 2. \<And>x'. \<lbrakk>x' \<in> UNIV; dist x' w < dist w y\<rbrakk> \<Longrightarrow> (f x' - f y) / (x' - y) = (if x' = y then deriv f y else (f x' - f y) / (x' - y))
[PROOF STEP]
qed (auto simp: dist_commute)
[PROOF STATE]
proof (state)
this:
?w \<in> U - {y} \<Longrightarrow> (\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) field_differentiable at ?w

goal (1 subgoal):
 1. d y holomorphic_on U - {y}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?w \<in> U - {y} \<Longrightarrow> (\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) field_differentiable at ?w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?w \<in> U - {y} \<Longrightarrow> (\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) field_differentiable at ?w

goal (1 subgoal):
 1. d y holomorphic_on U - {y}
[PROOF STEP]
unfolding field_differentiable_def
[PROOF STATE]
proof (prove)
using this:
?w \<in> U - {y} \<Longrightarrow> \<exists>f'. ((\<lambda>w. if w = y then deriv f y else (f w - f y) / (w - y)) has_field_derivative f') (at ?w)

goal (1 subgoal):
 1. d y holomorphic_on U - {y}
[PROOF STEP]
by (simp add: d_def holomorphic_on_open \<open>open U\<close> open_delete)
[PROOF STATE]
proof (state)
this:
d y holomorphic_on U - {y}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
d y holomorphic_on U - {y}

goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on U (d y)
d y holomorphic_on U - {y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on U (d y)
d y holomorphic_on U - {y}

goal (1 subgoal):
 1. d y holomorphic_on U
[PROOF STEP]
by (rule no_isolated_singularity) (auto simp: \<open>open U\<close>)
[PROOF STATE]
proof (state)
this:
d y holomorphic_on U

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> U \<Longrightarrow> d ?y holomorphic_on U

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have cint_fxy: "(\<lambda>x. (f x - f y) / (x - y)) contour_integrable_on \<gamma>" if "y \<notin> path_image \<gamma>" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x - f y) / (x - y)) contour_integrable_on \<gamma>
[PROOF STEP]
proof (rule contour_integrable_holomorphic_simple [where S = "U-{y}"])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<lambda>x. (f x - f y) / (x - y)) holomorphic_on U - {y}
 2. open (U - {y})
 3. valid_path \<gamma>
 4. path_image \<gamma> \<subseteq> U - {y}
[PROOF STEP]
show "(\<lambda>x. (f x - f y) / (x - y)) holomorphic_on U - {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x - f y) / (x - y)) holomorphic_on U - {y}
[PROOF STEP]
by (force intro: holomorphic_intros holomorphic_on_subset [OF holf])
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x - f y) / (x - y)) holomorphic_on U - {y}

goal (3 subgoals):
 1. open (U - {y})
 2. valid_path \<gamma>
 3. path_image \<gamma> \<subseteq> U - {y}
[PROOF STEP]
show "path_image \<gamma> \<subseteq> U - {y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> U - {y}
[PROOF STEP]
using pasz that
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> U - {z}
y \<notin> path_image \<gamma>

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> U - {y}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> U - {y}

goal (2 subgoals):
 1. open (U - {y})
 2. valid_path \<gamma>
[PROOF STEP]
qed (auto simp: \<open>open U\<close> open_delete \<open>valid_path \<gamma>\<close>)
[PROOF STATE]
proof (state)
this:
?y \<notin> path_image \<gamma> \<Longrightarrow> (\<lambda>x. (f x - f ?y) / (x - ?y)) contour_integrable_on \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
define h where
    "h z = (if z \<in> U then contour_integral \<gamma> (d z) else contour_integral \<gamma> (\<lambda>w. f w/(w - z)))" for z
[PROOF STATE]
proof (state)
this:
h ?z = (if ?z \<in> U then contour_integral \<gamma> (d ?z) else contour_integral \<gamma> (\<lambda>w. f w / (w - ?z)))

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have U: "((d z) has_contour_integral h z) \<gamma>" if "z \<in> U" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d z has_contour_integral h z) \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (d z has_contour_integral h z) \<gamma>
[PROOF STEP]
have "d z holomorphic_on U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d z holomorphic_on U
[PROOF STEP]
by (simp add: hol_d that)
[PROOF STATE]
proof (state)
this:
d z holomorphic_on U

goal (1 subgoal):
 1. (d z has_contour_integral h z) \<gamma>
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
z \<in> U
d z holomorphic_on U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> U
d z holomorphic_on U

goal (1 subgoal):
 1. (d z has_contour_integral h z) \<gamma>
[PROOF STEP]
by (metis Diff_subset \<open>valid_path \<gamma>\<close> \<open>open U\<close> contour_integrable_holomorphic_simple h_def has_contour_integral_integral pasz subset_trans)
[PROOF STATE]
proof (state)
this:
(d z has_contour_integral h z) \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> U \<Longrightarrow> (d ?z has_contour_integral h ?z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have V: "((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>" if z: "z \<in> v" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
have 0: "0 = (f z) * 2 * of_real (2 * pi) * \<i> * winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = f z * 2 * complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z
[PROOF STEP]
using v_def z
[PROOF STATE]
proof (prove)
using this:
v = {w. w \<notin> path_image \<gamma> \<and> winding_number \<gamma> w = 0}
z \<in> v

goal (1 subgoal):
 1. 0 = f z * 2 * complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = f z * 2 * complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 = f z * 2 * complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z
[PROOF STEP]
have "((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
0 = f z * 2 * complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z

goal (1 subgoal):
 1. ((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>
[PROOF STEP]
using z v_def  has_contour_integral_winding_number [OF \<open>valid_path \<gamma>\<close>]
[PROOF STATE]
proof (prove)
using this:
0 = f z * 2 * complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z
z \<in> v
v = {w. w \<notin> path_image \<gamma> \<and> winding_number \<gamma> w = 0}
?z \<notin> path_image \<gamma> \<Longrightarrow> ((\<lambda>w. 1 / (w - ?z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> ?z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>
[PROOF STEP]
have "((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>
[PROOF STEP]
using has_contour_integral_lmul
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. 1 / (x - z)) has_contour_integral 0) \<gamma>
(?f has_contour_integral ?i) ?g \<Longrightarrow> ((\<lambda>x. ?c * ?f x) has_contour_integral ?c * ?i) ?g

goal (1 subgoal):
 1. ((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>
[PROOF STEP]
have "((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f z * (1 / (x - z))) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
have "((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> v

goal (1 subgoal):
 1. ((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
apply (simp add: v_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image \<gamma> \<and> winding_number \<gamma> z = 0 \<Longrightarrow> ((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
apply (metis (no_types, lifting) contour_integrable_eq d_def has_contour_integral_eq has_contour_integral_integral cint_fxy)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>
((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
have *: "((\<lambda>x. f z / (x - z) + (f x - f z) / (x - z)) has_contour_integral (0 + contour_integral \<gamma> (d z))) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f z / (x - z)) has_contour_integral 0) \<gamma>
((\<lambda>x. (f x - f z) / (x - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>x. f z / (x - z) + (f x - f z) / (x - z)) has_contour_integral 0 + contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
by (rule has_contour_integral_add)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f z / (x - z) + (f x - f z) / (x - z)) has_contour_integral 0 + contour_integral \<gamma> (d z)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
have "((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>"
      if "z \<in> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f z / (x - z) + (f x - f z) / (x - z)) has_contour_integral 0 + contour_integral \<gamma> (d z)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
[PROOF STEP]
by (auto simp: divide_simps has_contour_integral_eq)
[PROOF STATE]
proof (state)
this:
z \<in> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
have "((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>"
      if "z \<notin> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>
[PROOF STEP]
proof (rule has_contour_integral_integral [OF contour_integrable_holomorphic_simple [where S=U]])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<lambda>w. f w / (w - z)) holomorphic_on U
 2. open U
 3. valid_path \<gamma>
 4. path_image \<gamma> \<subseteq> U
[PROOF STEP]
show "(\<lambda>w. f w / (w - z)) holomorphic_on U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. f w / (w - z)) holomorphic_on U
[PROOF STEP]
by (rule holomorphic_intros assms | use that in force)+
[PROOF STATE]
proof (state)
this:
(\<lambda>w. f w / (w - z)) holomorphic_on U

goal (3 subgoals):
 1. open U
 2. valid_path \<gamma>
 3. path_image \<gamma> \<subseteq> U
[PROOF STEP]
qed (use \<open>open U\<close> pasz \<open>valid_path \<gamma>\<close> in auto)
[PROOF STATE]
proof (state)
this:
z \<notin> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
z \<notin> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
z \<notin> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
z \<in> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (d z)) \<gamma>
z \<notin> U \<Longrightarrow> ((\<lambda>w. f w / (w - z)) has_contour_integral contour_integral \<gamma> (\<lambda>w. f w / (w - z))) \<gamma>
z \<in> v

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>
[PROOF STEP]
by (simp add: h_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>w. f w / (w - z)) has_contour_integral h z) \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> v \<Longrightarrow> ((\<lambda>w. f w / (w - ?z)) has_contour_integral h ?z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have znot: "z \<notin> path_image \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image \<gamma>
[PROOF STEP]
using pasz
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> U - {z}

goal (1 subgoal):
 1. z \<notin> path_image \<gamma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<notin> path_image \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
obtain d0 where "d0>0" and d0: "\<And>x y. x \<in> path_image \<gamma> \<Longrightarrow> y \<in> - U \<Longrightarrow> d0 \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d0. \<lbrakk>0 < d0; \<And>x y. \<lbrakk>x \<in> path_image \<gamma>; y \<in> - U\<rbrakk> \<Longrightarrow> d0 \<le> dist x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using separate_compact_closed [of "path_image \<gamma>" "-U"] pasz \<open>open U\<close> \<open>path \<gamma>\<close> compact_path_image
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact (path_image \<gamma>); closed (- U); path_image \<gamma> \<inter> - U = {}\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x\<in>path_image \<gamma>. \<forall>y\<in>- U. d \<le> dist x y
path_image \<gamma> \<subseteq> U - {z}
open U
path \<gamma>
path ?g \<Longrightarrow> compact (path_image ?g)

goal (1 subgoal):
 1. (\<And>d0. \<lbrakk>0 < d0; \<And>x y. \<lbrakk>x \<in> path_image \<gamma>; y \<in> - U\<rbrakk> \<Longrightarrow> d0 \<le> dist x y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < d0
\<lbrakk>?x \<in> path_image \<gamma>; ?y \<in> - U\<rbrakk> \<Longrightarrow> d0 \<le> dist ?x ?y

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
obtain dd where "0 < dd" and dd: "{y + k | y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>dd. \<lbrakk>0 < dd; {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>dd. \<lbrakk>0 < dd; {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?dd2
 2. (\<And>dd. \<lbrakk>0 < dd; {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 ?dd2} \<subseteq> U
[PROOF STEP]
show "0 < d0 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d0 / 2
[PROOF STEP]
using \<open>0 < d0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < d0

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

goal (1 subgoal):
 1. (\<And>dd. \<lbrakk>0 < dd; {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 (d0 / 2)} \<subseteq> U
[PROOF STEP]
qed (use \<open>0 < d0\<close> d0 in \<open>force simp: dist_norm\<close>)
[PROOF STATE]
proof (state)
this:
0 < dd
{y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
define T where "T \<equiv> {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> cball 0 (dd / 2)}"
[PROOF STATE]
proof (state)
this:
T \<equiv> {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> cball 0 (dd / 2)}

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "\<And>x x'. \<lbrakk>x \<in> path_image \<gamma>; dist x x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x'. \<lbrakk>x \<in> path_image \<gamma>; dist x x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd
[PROOF STEP]
apply (rule_tac x=x in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x'. \<lbrakk>x \<in> path_image \<gamma>; dist x x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>k. x' = x + k \<and> x \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd
[PROOF STEP]
apply (rule_tac x="x'-x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x x'. \<lbrakk>x \<in> path_image \<gamma>; dist x x' * 2 < dd\<rbrakk> \<Longrightarrow> x' = x + (x' - x) \<and> x \<in> path_image \<gamma> \<and> dist 0 (x' - x) * 2 \<le> dd
[PROOF STEP]
apply (force simp: dist_norm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> path_image \<gamma>; dist ?x ?x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. ?x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> path_image \<gamma>; dist ?x ?x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. ?x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd
[PROOF STEP]
have subt: "path_image \<gamma> \<subseteq> interior T"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> path_image \<gamma>; dist ?x ?x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. ?x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> interior T
[PROOF STEP]
using \<open>0 < dd\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> path_image \<gamma>; dist ?x ?x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. ?x' = y + k \<and> y \<in> path_image \<gamma> \<and> dist 0 k * 2 \<le> dd
0 < dd

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> interior T
[PROOF STEP]
apply (clarsimp simp add: mem_interior T_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>x x'. \<lbrakk>x \<in> path_image \<gamma>; dist x x' * 2 < dd\<rbrakk> \<Longrightarrow> \<exists>y k. x' = y + k \<and> y \<in> path_image \<gamma> \<and> cmod k * 2 \<le> dd; 0 < dd; x \<in> path_image \<gamma>\<rbrakk> \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> {y + k |y k. y \<in> path_image \<gamma> \<and> cmod k * 2 \<le> dd}
[PROOF STEP]
apply (rule_tac x="dd/2" in exI, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> interior T

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "compact T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact T
[PROOF STEP]
unfolding T_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> cball 0 (dd / 2)}
[PROOF STEP]
by (fastforce simp add: \<open>valid_path \<gamma>\<close> compact_valid_path_image intro!: compact_sums)
[PROOF STATE]
proof (state)
this:
compact T

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have T: "T \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<subseteq> U
[PROOF STEP]
unfolding T_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> cball 0 (dd / 2)} \<subseteq> U
[PROOF STEP]
using \<open>0 < dd\<close> dd
[PROOF STATE]
proof (prove)
using this:
0 < dd
{y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> ball 0 dd} \<subseteq> U

goal (1 subgoal):
 1. {y + k |y k. y \<in> path_image \<gamma> \<and> k \<in> cball 0 (dd / 2)} \<subseteq> U
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
T \<subseteq> U

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
obtain L where "L>0"
           and L: "\<And>f B. \<lbrakk>f holomorphic_on interior T; \<And>z. z\<in>interior T \<Longrightarrow> cmod (f z) \<le> B\<rbrakk> \<Longrightarrow>
                         cmod (contour_integral \<gamma> f) \<le> L * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>f B. \<lbrakk>f holomorphic_on interior T; \<And>z. z \<in> interior T \<Longrightarrow> cmod (f z) \<le> B\<rbrakk> \<Longrightarrow> cmod (contour_integral \<gamma> f) \<le> L * B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contour_integral_bound_exists [OF open_interior \<open>valid_path \<gamma>\<close> subt]
[PROOF STATE]
proof (prove)
using this:
\<exists>L>0. \<forall>f B. f holomorphic_on interior T \<and> (\<forall>z\<in>interior T. cmod (f z) \<le> B) \<longrightarrow> cmod (contour_integral \<gamma> f) \<le> L * B

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>f B. \<lbrakk>f holomorphic_on interior T; \<And>z. z \<in> interior T \<Longrightarrow> cmod (f z) \<le> B\<rbrakk> \<Longrightarrow> cmod (contour_integral \<gamma> f) \<le> L * B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < L
\<lbrakk>?f holomorphic_on interior T; \<And>z. z \<in> interior T \<Longrightarrow> cmod (?f z) \<le> ?B\<rbrakk> \<Longrightarrow> cmod (contour_integral \<gamma> ?f) \<le> L * ?B

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "bounded(f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (f ` T)
[PROOF STEP]
by (meson \<open>compact T\<close> compact_continuous_image compact_imp_bounded conf continuous_on_subset T)
[PROOF STATE]
proof (state)
this:
bounded (f ` T)

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded (f ` T)
[PROOF STEP]
obtain D where "D>0" and D: "\<And>x. x \<in> T \<Longrightarrow> norm (f x) \<le> D"
[PROOF STATE]
proof (prove)
using this:
bounded (f ` T)

goal (1 subgoal):
 1. (\<And>D. \<lbrakk>0 < D; \<And>x. x \<in> T \<Longrightarrow> cmod (f x) \<le> D\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: bounded_pos)
[PROOF STATE]
proof (state)
this:
0 < D
?x \<in> T \<Longrightarrow> cmod (f ?x) \<le> D

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
obtain C where "C>0" and C: "\<And>x. x \<in> T \<Longrightarrow> norm x \<le> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>0 < C; \<And>x. x \<in> T \<Longrightarrow> cmod x \<le> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>compact T\<close> bounded_pos compact_imp_bounded
[PROOF STATE]
proof (prove)
using this:
compact T
bounded ?S = (\<exists>b>0. \<forall>x\<in>?S. norm x \<le> b)
compact ?U \<Longrightarrow> bounded ?U

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>0 < C; \<And>x. x \<in> T \<Longrightarrow> cmod x \<le> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < C
?x \<in> T \<Longrightarrow> cmod ?x \<le> C

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "dist (h y) 0 \<le> e" if "0 < e" and le: "D * L / e + C \<le> cmod y" for e y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have "D * L / e > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < D * L / e
[PROOF STEP]
using \<open>D>0\<close> \<open>L>0\<close> \<open>e>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < D
0 < L
0 < e

goal (1 subgoal):
 1. 0 < D * L / e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < D * L / e

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
with le
[PROOF STATE]
proof (chain)
picking this:
D * L / e + C \<le> cmod y
0 < D * L / e
[PROOF STEP]
have ybig: "norm y > C"
[PROOF STATE]
proof (prove)
using this:
D * L / e + C \<le> cmod y
0 < D * L / e

goal (1 subgoal):
 1. C < cmod y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
C < cmod y

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
with C
[PROOF STATE]
proof (chain)
picking this:
?x \<in> T \<Longrightarrow> cmod ?x \<le> C
C < cmod y
[PROOF STEP]
have "y \<notin> T"
[PROOF STATE]
proof (prove)
using this:
?x \<in> T \<Longrightarrow> cmod ?x \<le> C
C < cmod y

goal (1 subgoal):
 1. y \<notin> T
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
y \<notin> T

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<notin> T
[PROOF STEP]
have ynot: "y \<notin> path_image \<gamma>"
[PROOF STATE]
proof (prove)
using this:
y \<notin> T

goal (1 subgoal):
 1. y \<notin> path_image \<gamma>
[PROOF STEP]
using subt interior_subset
[PROOF STATE]
proof (prove)
using this:
y \<notin> T
path_image \<gamma> \<subseteq> interior T
interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. y \<notin> path_image \<gamma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<notin> path_image \<gamma>

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have [simp]: "winding_number \<gamma> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> y = 0
[PROOF STEP]
proof (rule winding_number_zero_outside)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. path \<gamma>
 2. convex ?s
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. y \<notin> ?s
 5. path_image \<gamma> \<subseteq> ?s
[PROOF STEP]
show "path_image \<gamma> \<subseteq> cball 0 C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> cball 0 C
[PROOF STEP]
by (meson C interior_subset mem_cball_0 subset_eq subt)
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> cball 0 C

goal (4 subgoals):
 1. path \<gamma>
 2. convex (cball 0 C)
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. y \<notin> cball 0 C
[PROOF STEP]
qed (use ybig loop \<open>path \<gamma>\<close> in auto)
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> y = 0

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have [simp]: "h y = contour_integral \<gamma> (\<lambda>w. f w/(w - y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h y = contour_integral \<gamma> (\<lambda>w. f w / (w - y))
[PROOF STEP]
by (rule contour_integral_unique [symmetric]) (simp add: v_def ynot V)
[PROOF STATE]
proof (state)
this:
h y = contour_integral \<gamma> (\<lambda>w. f w / (w - y))

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have holint: "(\<lambda>w. f w / (w - y)) holomorphic_on interior T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. f w / (w - y)) holomorphic_on interior T
[PROOF STEP]
proof (intro holomorphic_intros)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f holomorphic_on interior T
 2. \<And>w. w \<in> interior T \<Longrightarrow> w - y \<noteq> 0
[PROOF STEP]
show "f holomorphic_on interior T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f holomorphic_on interior T
[PROOF STEP]
using holf holomorphic_on_subset interior_subset T
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on U
\<lbrakk>?f holomorphic_on ?s; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> ?f holomorphic_on ?t
interior ?S \<subseteq> ?S
T \<subseteq> U

goal (1 subgoal):
 1. f holomorphic_on interior T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f holomorphic_on interior T

goal (1 subgoal):
 1. \<And>w. w \<in> interior T \<Longrightarrow> w - y \<noteq> 0
[PROOF STEP]
qed (use \<open>y \<notin> T\<close> interior_subset in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. f w / (w - y)) holomorphic_on interior T

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have leD: "cmod (f z / (z - y)) \<le> D * (e / L / D)" if z: "z \<in> interior T" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
have "D * L / e + cmod z \<le> cmod y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D * L / e + cmod z \<le> cmod y
[PROOF STEP]
using le C [of z] z
[PROOF STATE]
proof (prove)
using this:
D * L / e + C \<le> cmod y
z \<in> T \<Longrightarrow> cmod z \<le> C
z \<in> interior T

goal (1 subgoal):
 1. D * L / e + cmod z \<le> cmod y
[PROOF STEP]
using interior_subset
[PROOF STATE]
proof (prove)
using this:
D * L / e + C \<le> cmod y
z \<in> T \<Longrightarrow> cmod z \<le> C
z \<in> interior T
interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. D * L / e + cmod z \<le> cmod y
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
D * L / e + cmod z \<le> cmod y

goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
D * L / e + cmod z \<le> cmod y
[PROOF STEP]
have DL2: "D * L / e \<le> cmod (z - y)"
[PROOF STATE]
proof (prove)
using this:
D * L / e + cmod z \<le> cmod y

goal (1 subgoal):
 1. D * L / e \<le> cmod (z - y)
[PROOF STEP]
using norm_triangle_ineq2 [of y z]
[PROOF STATE]
proof (prove)
using this:
D * L / e + cmod z \<le> cmod y
cmod y - cmod z \<le> cmod (y - z)

goal (1 subgoal):
 1. D * L / e \<le> cmod (z - y)
[PROOF STEP]
by (simp add: norm_minus_commute)
[PROOF STATE]
proof (state)
this:
D * L / e \<le> cmod (z - y)

goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
have "cmod (f z / (z - y)) = cmod (f z) * inverse (cmod (z - y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (f z / (z - y)) = cmod (f z) * inverse (cmod (z - y))
[PROOF STEP]
by (simp add: norm_mult norm_inverse Fields.field_class.field_divide_inverse)
[PROOF STATE]
proof (state)
this:
cmod (f z / (z - y)) = cmod (f z) * inverse (cmod (z - y))

goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (f z / (z - y)) = cmod (f z) * inverse (cmod (z - y))

goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
have "\<dots> \<le> D * (e / L / D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (f z) * inverse (cmod (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
proof (rule mult_mono)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. cmod (f z) \<le> D
 2. inverse (cmod (z - y)) \<le> e / L / D
 3. 0 \<le> D
 4. 0 \<le> inverse (cmod (z - y))
[PROOF STEP]
show "cmod (f z) \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (f z) \<le> D
[PROOF STEP]
using D interior_subset z
[PROOF STATE]
proof (prove)
using this:
?x \<in> T \<Longrightarrow> cmod (f ?x) \<le> D
interior ?S \<subseteq> ?S
z \<in> interior T

goal (1 subgoal):
 1. cmod (f z) \<le> D
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cmod (f z) \<le> D

goal (3 subgoals):
 1. inverse (cmod (z - y)) \<le> e / L / D
 2. 0 \<le> D
 3. 0 \<le> inverse (cmod (z - y))
[PROOF STEP]
show "inverse (cmod (z - y)) \<le> e / L / D" "D \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (cmod (z - y)) \<le> e / L / D &&& 0 \<le> D
[PROOF STEP]
using \<open>L>0\<close> \<open>e>0\<close> \<open>D>0\<close> DL2
[PROOF STATE]
proof (prove)
using this:
0 < L
0 < e
0 < D
D * L / e \<le> cmod (z - y)

goal (1 subgoal):
 1. inverse (cmod (z - y)) \<le> e / L / D &&& 0 \<le> D
[PROOF STEP]
by (auto simp: norm_divide field_split_simps)
[PROOF STATE]
proof (state)
this:
inverse (cmod (z - y)) \<le> e / L / D
0 \<le> D

goal (1 subgoal):
 1. 0 \<le> inverse (cmod (z - y))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
cmod (f z) * inverse (cmod (z - y)) \<le> D * (e / L / D)

goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (f z / (z - y)) \<le> D * (e / L / D)

goal (1 subgoal):
 1. cmod (f z / (z - y)) \<le> D * (e / L / D)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (f z / (z - y)) \<le> D * (e / L / D)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> interior T \<Longrightarrow> cmod (f ?z / (?z - y)) \<le> D * (e / L / D)

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have "dist (h y) 0 = cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (h y) 0 = cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y)))
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist (h y) 0 = cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y)))

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (h y) 0 = cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y)))

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have "\<dots> \<le> L * (D * (e / L / D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y))) \<le> L * (D * (e / L / D))
[PROOF STEP]
by (rule L [OF holint leD])
[PROOF STATE]
proof (state)
this:
cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y))) \<le> L * (D * (e / L / D))

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (contour_integral \<gamma> (\<lambda>w. f w / (w - y))) \<le> L * (D * (e / L / D))

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
have "\<dots> = e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L * (D * (e / L / D)) = e
[PROOF STEP]
using  \<open>L>0\<close> \<open>0 < D\<close>
[PROOF STATE]
proof (prove)
using this:
0 < L
0 < D

goal (1 subgoal):
 1. L * (D * (e / L / D)) = e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L * (D * (e / L / D)) = e

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (h y) 0 \<le> e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (h y) 0 \<le> e

goal (1 subgoal):
 1. dist (h y) 0 \<le> e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dist (h y) 0 \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?e; D * L / ?e + C \<le> cmod ?y\<rbrakk> \<Longrightarrow> dist (h ?y) 0 \<le> ?e

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < ?e; D * L / ?e + C \<le> cmod ?y\<rbrakk> \<Longrightarrow> dist (h ?y) 0 \<le> ?e
[PROOF STEP]
have "(h \<longlongrightarrow> 0) at_infinity"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?e; D * L / ?e + C \<le> cmod ?y\<rbrakk> \<Longrightarrow> dist (h ?y) 0 \<le> ?e

goal (1 subgoal):
 1. (h \<longlongrightarrow> 0) at_infinity
[PROOF STEP]
by (meson Lim_at_infinityI)
[PROOF STATE]
proof (state)
this:
(h \<longlongrightarrow> 0) at_infinity

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(h \<longlongrightarrow> 0) at_infinity

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "h holomorphic_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have con_ff: "continuous (at (x,z)) (\<lambda>(x,y). (f y - f x) / (y - x))"
                 if "x \<in> U" "z \<in> U" "x \<noteq> z" for x z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>(x, y). (f y - f x) / (y - x)) (x, z)
[PROOF STEP]
using that conf
[PROOF STATE]
proof (prove)
using this:
x \<in> U
z \<in> U
x \<noteq> z
continuous_on U f

goal (1 subgoal):
 1. isCont (\<lambda>(x, y). (f y - f x) / (y - x)) (x, z)
[PROOF STEP]
apply (simp add: split_def continuous_on_eq_continuous_at \<open>open U\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> U; z \<in> U; x \<noteq> z; \<forall>x\<in>U. isCont f x\<rbrakk> \<Longrightarrow> isCont (\<lambda>p. (f (snd p) - f (fst p)) / (snd p - fst p)) (x, z)
[PROOF STEP]
apply (simp | rule continuous_intros continuous_within_compose2 [where g=f])+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> U; ?z \<in> U; ?x \<noteq> ?z\<rbrakk> \<Longrightarrow> isCont (\<lambda>(x, y). (f y - f x) / (y - x)) (?x, ?z)

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have con_fstsnd: "continuous_on UNIV (\<lambda>x. (fst x - snd x) ::complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. fst x - snd x)
[PROOF STEP]
by (rule continuous_intros)+
[PROOF STATE]
proof (state)
this:
continuous_on UNIV (\<lambda>x. fst x - snd x)

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have open_uu_Id: "open (U \<times> U - Id)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (U \<times> U - Id)
[PROOF STEP]
proof (rule open_Diff)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. open (U \<times> U)
 2. closed Id
[PROOF STEP]
show "open (U \<times> U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (U \<times> U)
[PROOF STEP]
by (simp add: open_Times \<open>open U\<close>)
[PROOF STATE]
proof (state)
this:
open (U \<times> U)

goal (1 subgoal):
 1. closed Id
[PROOF STEP]
show "closed (Id :: complex rel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed Id
[PROOF STEP]
using continuous_closed_preimage_constant [OF con_fstsnd closed_UNIV, of 0]
[PROOF STATE]
proof (prove)
using this:
closed {x \<in> UNIV. fst x - snd x = 0}

goal (1 subgoal):
 1. closed Id
[PROOF STEP]
by (auto simp: Id_fstsnd_eq algebra_simps)
[PROOF STATE]
proof (state)
this:
closed Id

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
open (U \<times> U - Id)

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have con_derf: "continuous (at z) (deriv f)" if "z \<in> U" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (deriv f) z
[PROOF STEP]
proof (rule continuous_on_interior)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on ?s (deriv f)
 2. z \<in> interior ?s
[PROOF STEP]
show "continuous_on U (deriv f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U (deriv f)
[PROOF STEP]
by (simp add: holf holomorphic_deriv holomorphic_on_imp_continuous_on \<open>open U\<close>)
[PROOF STATE]
proof (state)
this:
continuous_on U (deriv f)

goal (1 subgoal):
 1. z \<in> interior U
[PROOF STEP]
qed (simp add: interior_open that \<open>open U\<close>)
[PROOF STATE]
proof (state)
this:
?z \<in> U \<Longrightarrow> isCont (deriv f) ?z

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have tendsto_f': "((\<lambda>(x,y). if y = x then deriv f (x)
                                else (f (y) - f (x)) / (y - x)) \<longlongrightarrow> deriv f x)
                      (at (x, x) within U \<times> U)" if "x \<in> U" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>(x, y). if y = x then deriv f x else (f y - f x) / (y - x)) \<longlongrightarrow> deriv f x) (at (x, x) within U \<times> U)
[PROOF STEP]
proof (rule Lim_withinI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
fix e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
obtain k1 where "k1>0" and k1: "\<And>x'. norm (x' - x) \<le> k1 \<Longrightarrow> norm (deriv f x' - deriv f x) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k1. \<lbrakk>0 < k1; \<And>x'. cmod (x' - x) \<le> k1 \<Longrightarrow> cmod (deriv f x' - deriv f x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < e\<close> continuous_within_E [OF con_derf [OF \<open>x \<in> U\<close>]]
[PROOF STATE]
proof (prove)
using this:
0 < e
\<lbrakk>0 < ?e; \<And>d. \<lbrakk>0 < d; \<And>x'. \<lbrakk>x' \<in> UNIV; dist x' x \<le> d\<rbrakk> \<Longrightarrow> dist (deriv f x') (deriv f x) < ?e\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>k1. \<lbrakk>0 < k1; \<And>x'. cmod (x' - x) \<le> k1 \<Longrightarrow> cmod (deriv f x' - deriv f x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis UNIV_I dist_norm)
[PROOF STATE]
proof (state)
this:
0 < k1
cmod (?x' - x) \<le> k1 \<Longrightarrow> cmod (deriv f ?x' - deriv f x) < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
obtain k2 where "k2>0" and k2: "ball x k2 \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k2. \<lbrakk>0 < k2; ball x k2 \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: openE [OF \<open>open U\<close>] \<open>x \<in> U\<close>)
[PROOF STATE]
proof (state)
this:
0 < k2
ball x k2 \<subseteq> U

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
have neq: "norm ((f z' - f x') / (z' - x') - deriv f x) \<le> e"
                    if "z' \<noteq> x'" and less_k1: "norm (x'-x, z'-x) < k1" and less_k2: "norm (x'-x, z'-x) < k2"
                 for x' z'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
have cs_less: "w \<in> closed_segment x' z' \<Longrightarrow> cmod (w - x) \<le> norm (x'-x, z'-x)" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> closed_segment x' z' \<Longrightarrow> cmod (w - x) \<le> norm (x' - x, z' - x)
[PROOF STEP]
using segment_furthest_le [of w x' z' x]
[PROOF STATE]
proof (prove)
using this:
w \<in> closed_segment x' z' \<Longrightarrow> cmod (x - w) \<le> cmod (x - x') \<or> cmod (x - w) \<le> cmod (x - z')

goal (1 subgoal):
 1. w \<in> closed_segment x' z' \<Longrightarrow> cmod (w - x) \<le> norm (x' - x, z' - x)
[PROOF STEP]
by (metis (no_types) dist_commute dist_norm norm_fst_le norm_snd_le order_trans)
[PROOF STATE]
proof (state)
this:
?w \<in> closed_segment x' z' \<Longrightarrow> cmod (?w - x) \<le> norm (x' - x, z' - x)

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
have derf_le: "w \<in> closed_segment x' z' \<Longrightarrow> z' \<noteq> x' \<Longrightarrow> cmod (deriv f w - deriv f x) \<le> e" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<in> closed_segment x' z'; z' \<noteq> x'\<rbrakk> \<Longrightarrow> cmod (deriv f w - deriv f x) \<le> e
[PROOF STEP]
by (blast intro: cs_less less_k1 k1 [unfolded divide_const_simps dist_norm] less_imp_le le_less_trans)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?w \<in> closed_segment x' z'; z' \<noteq> x'\<rbrakk> \<Longrightarrow> cmod (deriv f ?w - deriv f x) \<le> e

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
have f_has_der: "\<And>x. x \<in> U \<Longrightarrow> (f has_field_derivative deriv f x) (at x within U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> U \<Longrightarrow> (f has_field_derivative deriv f x) (at x within U)
[PROOF STEP]
by (metis DERIV_deriv_iff_field_differentiable at_within_open holf holomorphic_on_def \<open>open U\<close>)
[PROOF STATE]
proof (state)
this:
?x \<in> U \<Longrightarrow> (f has_field_derivative deriv f ?x) (at ?x within U)

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
have "closed_segment x' z' \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment x' z' \<subseteq> U
[PROOF STEP]
by (rule order_trans [OF _ k2]) (simp add: cs_less  le_less_trans [OF _ less_k2] dist_complex_def norm_minus_commute subset_iff)
[PROOF STATE]
proof (state)
this:
closed_segment x' z' \<subseteq> U

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed_segment x' z' \<subseteq> U
[PROOF STEP]
have cint_derf: "(deriv f has_contour_integral f z' - f x') (linepath x' z')"
[PROOF STATE]
proof (prove)
using this:
closed_segment x' z' \<subseteq> U

goal (1 subgoal):
 1. (deriv f has_contour_integral f z' - f x') (linepath x' z')
[PROOF STEP]
using contour_integral_primitive [OF f_has_der valid_path_linepath] pasz
[PROOF STATE]
proof (prove)
using this:
closed_segment x' z' \<subseteq> U
\<lbrakk>\<And>x. x \<in> U \<Longrightarrow> x \<in> U; path_image (linepath ?a1 ?b1) \<subseteq> U\<rbrakk> \<Longrightarrow> (deriv f has_contour_integral f (pathfinish (linepath ?a1 ?b1)) - f (pathstart (linepath ?a1 ?b1))) (linepath ?a1 ?b1)
path_image \<gamma> \<subseteq> U - {z}

goal (1 subgoal):
 1. (deriv f has_contour_integral f z' - f x') (linepath x' z')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(deriv f has_contour_integral f z' - f x') (linepath x' z')

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(deriv f has_contour_integral f z' - f x') (linepath x' z')
[PROOF STEP]
have *: "((\<lambda>x. deriv f x / (z' - x')) has_contour_integral (f z' - f x') / (z' - x')) (linepath x' z')"
[PROOF STATE]
proof (prove)
using this:
(deriv f has_contour_integral f z' - f x') (linepath x' z')

goal (1 subgoal):
 1. ((\<lambda>x. deriv f x / (z' - x')) has_contour_integral (f z' - f x') / (z' - x')) (linepath x' z')
[PROOF STEP]
by (rule has_contour_integral_div)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. deriv f x / (z' - x')) has_contour_integral (f z' - f x') / (z' - x')) (linepath x' z')

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
have "norm ((f z' - f x') / (z' - x') - deriv f x) \<le> e/norm(z' - x') * norm(z' - x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e / cmod (z' - x') * cmod (z' - x')
[PROOF STEP]
apply (rule has_contour_integral_bound_linepath [OF has_contour_integral_diff [OF *]])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (?f2.1 has_contour_integral deriv f x) (linepath x' z')
 2. 0 \<le> e / cmod (z' - x')
 3. \<And>x. x \<in> closed_segment x' z' \<Longrightarrow> cmod (deriv f x / (z' - x') - ?f2.1 x) \<le> e / cmod (z' - x')
[PROOF STEP]
using has_contour_integral_div [where c = "z' - x'", OF has_contour_integral_const_linepath [of "deriv f x" z' x']]
                 \<open>e > 0\<close>  \<open>z' \<noteq> x'\<close>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>xa. deriv f x / (z' - x')) has_contour_integral deriv f x * (z' - x') / (z' - x')) (linepath x' z')
0 < e
z' \<noteq> x'

goal (3 subgoals):
 1. (?f2.1 has_contour_integral deriv f x) (linepath x' z')
 2. 0 \<le> e / cmod (z' - x')
 3. \<And>x. x \<in> closed_segment x' z' \<Longrightarrow> cmod (deriv f x / (z' - x') - ?f2.1 x) \<le> e / cmod (z' - x')
[PROOF STEP]
apply (auto simp: norm_divide divide_simps derf_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e / cmod (z' - x') * cmod (z' - x')

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e / cmod (z' - x') * cmod (z' - x')

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
have "\<dots> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e / cmod (z' - x') * cmod (z' - x') \<le> e
[PROOF STEP]
using \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. e / cmod (z' - x') * cmod (z' - x') \<le> e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e / cmod (z' - x') * cmod (z' - x') \<le> e

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e

goal (1 subgoal):
 1. cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod ((f z' - f x') / (z' - x') - deriv f x) \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z' \<noteq> ?x'; norm (?x' - x, ?z' - x) < k1; norm (?x' - x, ?z' - x) < k2\<rbrakk> \<Longrightarrow> cmod ((f ?z' - f ?x') / (?z' - ?x') - deriv f x) \<le> e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
show "\<exists>d>0. \<forall>xa\<in>U \<times> U.
                  0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow>
                  dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e
[PROOF STEP]
apply (rule_tac x="min k1 k2" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < min k1 k2 \<and> (\<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < min k1 k2 \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e)
[PROOF STEP]
using \<open>k1>0\<close> \<open>k2>0\<close> \<open>e>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < k1
0 < k2
0 < e

goal (1 subgoal):
 1. 0 < min k1 k2 \<and> (\<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < min k1 k2 \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e)
[PROOF STEP]
by (force simp: dist_norm neq intro: dual_order.strict_trans2 k1 less_imp_le norm_fst_le)
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>xa\<in>U \<times> U. 0 < dist xa (x, x) \<and> dist xa (x, x) < d \<longrightarrow> dist (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x)) (deriv f x) \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> U \<Longrightarrow> ((\<lambda>(x, y). if y = x then deriv f x else (f y - f x) / (y - x)) \<longlongrightarrow> deriv f ?x) (at (?x, ?x) within U \<times> U)

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have con_pa_f: "continuous_on (path_image \<gamma>) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image \<gamma>) f
[PROOF STEP]
by (meson holf holomorphic_on_imp_continuous_on holomorphic_on_subset interior_subset subt T)
[PROOF STATE]
proof (state)
this:
continuous_on (path_image \<gamma>) f

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have le_B: "\<And>T. T \<in> {0..1} \<Longrightarrow> cmod (vector_derivative \<gamma> (at T)) \<le> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>T. T \<in> {0..1} \<Longrightarrow> cmod (vector_derivative \<gamma> (at T)) \<le> B
[PROOF STEP]
using \<gamma>' B
[PROOF STATE]
proof (prove)
using this:
(\<gamma> has_vector_derivative \<gamma>' ?x) (at ?x)
?x \<in> path_image \<gamma>' \<Longrightarrow> cmod ?x \<le> B

goal (1 subgoal):
 1. \<And>T. T \<in> {0..1} \<Longrightarrow> cmod (vector_derivative \<gamma> (at T)) \<le> B
[PROOF STEP]
by (simp add: path_image_def vector_derivative_at rev_image_eqI)
[PROOF STATE]
proof (state)
this:
?T \<in> {0..1} \<Longrightarrow> cmod (vector_derivative \<gamma> (at ?T)) \<le> B

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have f_has_cint: "\<And>w. w \<in> v - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ 1) has_contour_integral h w) \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. w \<in> v - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f u / (u - w) ^ 1) has_contour_integral h w) \<gamma>
[PROOF STEP]
by (simp add: V)
[PROOF STATE]
proof (state)
this:
?w \<in> v - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f u / (u - ?w) ^ 1) has_contour_integral h ?w) \<gamma>

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have cond_uu: "continuous_on (U \<times> U) (\<lambda>(x,y). d x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (U \<times> U) (\<lambda>(x, y). d x y)
[PROOF STEP]
apply (simp add: continuous_on_eq_continuous_within d_def continuous_within tendsto_f')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>U. \<forall>y\<in>U. y \<noteq> x \<longrightarrow> ((\<lambda>(x, y). if y = x then deriv f x else (f y - f x) / (y - x)) \<longlongrightarrow> (f y - f x) / (y - x)) (at (x, y) within U \<times> U)
[PROOF STEP]
apply (simp add: tendsto_within_open_NO_MATCH open_Times \<open>open U\<close>, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x\<rbrakk> \<Longrightarrow> (\<lambda>(x, y). if y = x then deriv f x else (f y - f x) / (y - x)) \<midarrow>(x, y)\<rightarrow> (f y - f x) / (y - x)
[PROOF STEP]
apply (rule Lim_transform_within_open [OF _ open_uu_Id, where f = "(\<lambda>(x,y). (f y - f x) / (y - x))"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x\<rbrakk> \<Longrightarrow> (\<lambda>(x, y). (f y - f x) / (y - x)) \<midarrow>(x, y)\<rightarrow> (f y - f x) / (y - x)
 2. \<And>x y. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x\<rbrakk> \<Longrightarrow> (x, y) \<in> U \<times> U - Id
 3. \<And>x y xa. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x; xa \<in> U \<times> U - Id; xa \<noteq> (x, y)\<rbrakk> \<Longrightarrow> (case xa of (x, y) \<Rightarrow> (f y - f x) / (y - x)) = (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x))
[PROOF STEP]
using con_ff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> U; ?z \<in> U; ?x \<noteq> ?z\<rbrakk> \<Longrightarrow> isCont (\<lambda>(x, y). (f y - f x) / (y - x)) (?x, ?z)

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x\<rbrakk> \<Longrightarrow> (\<lambda>(x, y). (f y - f x) / (y - x)) \<midarrow>(x, y)\<rightarrow> (f y - f x) / (y - x)
 2. \<And>x y. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x\<rbrakk> \<Longrightarrow> (x, y) \<in> U \<times> U - Id
 3. \<And>x y xa. \<lbrakk>x \<in> U; y \<in> U; y \<noteq> x; xa \<in> U \<times> U - Id; xa \<noteq> (x, y)\<rbrakk> \<Longrightarrow> (case xa of (x, y) \<Rightarrow> (f y - f x) / (y - x)) = (case xa of (x, y) \<Rightarrow> if y = x then deriv f x else (f y - f x) / (y - x))
[PROOF STEP]
apply (auto simp: continuous_within)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
continuous_on (U \<times> U) (\<lambda>(x, y). d x y)

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have hol_dw: "(\<lambda>z. d z w) holomorphic_on U" if "w \<in> U" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. d z w) holomorphic_on U
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>z. d z w) holomorphic_on U
[PROOF STEP]
have "continuous_on U ((\<lambda>(x,y). d x y) \<circ> (\<lambda>z. (w,z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U ((\<lambda>(x, y). d x y) \<circ> Pair w)
[PROOF STEP]
by (rule continuous_on_compose continuous_intros continuous_on_subset [OF cond_uu] | force intro: that)+
[PROOF STATE]
proof (state)
this:
continuous_on U ((\<lambda>(x, y). d x y) \<circ> Pair w)

goal (1 subgoal):
 1. (\<lambda>z. d z w) holomorphic_on U
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on U ((\<lambda>(x, y). d x y) \<circ> Pair w)
[PROOF STEP]
have *: "continuous_on U (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z))"
[PROOF STATE]
proof (prove)
using this:
continuous_on U ((\<lambda>(x, y). d x y) \<circ> Pair w)

goal (1 subgoal):
 1. continuous_on U (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z))
[PROOF STEP]
by (rule rev_iffD1 [OF _ continuous_on_cong [OF refl]]) (simp add: d_def field_simps)
[PROOF STATE]
proof (state)
this:
continuous_on U (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z))

goal (1 subgoal):
 1. (\<lambda>z. d z w) holomorphic_on U
[PROOF STEP]
have **: "(\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) field_differentiable at x"
        if "x \<in> U" "x \<noteq> w" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) field_differentiable at x
[PROOF STEP]
proof (rule_tac f = "\<lambda>x. (f w - f x)/(w - x)" and d = "dist x w" in field_differentiable_transform_within)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 < dist x w
 2. x \<in> UNIV
 3. \<And>x'. \<lbrakk>x' \<in> UNIV; dist x' x < dist x w\<rbrakk> \<Longrightarrow> (f w - f x') / (w - x') = (if w = x' then deriv f x' else (f w - f x') / (w - x'))
 4. (\<lambda>x. (f w - f x) / (w - x)) field_differentiable at x
[PROOF STEP]
show "(\<lambda>x. (f w - f x) / (w - x)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f w - f x) / (w - x)) field_differentiable at x
[PROOF STEP]
using that \<open>open U\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> U
x \<noteq> w
open U

goal (1 subgoal):
 1. (\<lambda>x. (f w - f x) / (w - x)) field_differentiable at x
[PROOF STEP]
by (intro derivative_intros holomorphic_on_imp_differentiable_at [OF holf]; force)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f w - f x) / (w - x)) field_differentiable at x

goal (3 subgoals):
 1. 0 < dist x w
 2. x \<in> UNIV
 3. \<And>x'. \<lbrakk>x' \<in> UNIV; dist x' x < dist x w\<rbrakk> \<Longrightarrow> (f w - f x') / (w - x') = (if w = x' then deriv f x' else (f w - f x') / (w - x'))
[PROOF STEP]
qed (use that \<open>open U\<close> in \<open>auto simp: dist_commute\<close>)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> U; ?x \<noteq> w\<rbrakk> \<Longrightarrow> (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) field_differentiable at ?x

goal (1 subgoal):
 1. (\<lambda>z. d z w) holomorphic_on U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. d z w) holomorphic_on U
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) holomorphic_on U
[PROOF STEP]
proof (rule no_isolated_singularity [OF * _ \<open>open U\<close>])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) holomorphic_on U - ?K1
 2. finite ?K1
[PROOF STEP]
show "(\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) holomorphic_on U - {w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) holomorphic_on U - {w}
[PROOF STEP]
by (auto simp: field_differentiable_def [symmetric] holomorphic_on_open open_Diff \<open>open U\<close> **)
[PROOF STATE]
proof (state)
this:
(\<lambda>z. if w = z then deriv f z else (f w - f z) / (w - z)) holomorphic_on U - {w}

goal (1 subgoal):
 1. finite {w}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>z. d z w) holomorphic_on U

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?w \<in> U \<Longrightarrow> (\<lambda>z. d z ?w) holomorphic_on U

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?w \<in> U \<Longrightarrow> (\<lambda>z. d z ?w) holomorphic_on U

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
assume abu: "closed_segment a b \<subseteq> U"
[PROOF STATE]
proof (state)
this:
closed_segment a b \<subseteq> U

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have cont_cint_d: "continuous_on U (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
proof (rule contour_integral_continuous_on_linepath_2D [OF \<open>open U\<close> _ _ abu])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) contour_integrable_on linepath a b
 2. continuous_on (U \<times> U) (\<lambda>(x, y). d y x)
[PROOF STEP]
show "\<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) contour_integrable_on (linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) contour_integrable_on linepath a b
[PROOF STEP]
by (metis abu hol_dw continuous_on_subset contour_integrable_continuous_linepath holomorphic_on_imp_continuous_on)
[PROOF STATE]
proof (state)
this:
?w \<in> U \<Longrightarrow> (\<lambda>z. d z ?w) contour_integrable_on linepath a b

goal (1 subgoal):
 1. continuous_on (U \<times> U) (\<lambda>(x, y). d y x)
[PROOF STEP]
show "continuous_on (U \<times> U) (\<lambda>(x, y). d y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (U \<times> U) (\<lambda>(x, y). d y x)
[PROOF STEP]
by (auto intro: continuous_on_swap_args cond_uu)
[PROOF STATE]
proof (state)
this:
continuous_on (U \<times> U) (\<lambda>(x, y). d y x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on U (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have cont_cint_d\<gamma>: "continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) \<circ> \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) \<circ> \<gamma>)
[PROOF STEP]
proof (rule continuous_on_compose)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on {0..1} \<gamma>
 2. continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
show "continuous_on {0..1} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} \<gamma>
[PROOF STEP]
using \<open>path \<gamma>\<close> path_def
[PROOF STATE]
proof (prove)
using this:
path \<gamma>
path ?g = continuous_on {0..1} ?g

goal (1 subgoal):
 1. continuous_on {0..1} \<gamma>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} \<gamma>

goal (1 subgoal):
 1. continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
show "continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
using pasz
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> U - {z}

goal (1 subgoal):
 1. continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
\<gamma> ` {0..1} \<subseteq> U - {z}

goal (1 subgoal):
 1. continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
by (auto intro!: continuous_on_subset [OF cont_cint_d])
[PROOF STATE]
proof (state)
this:
continuous_on (\<gamma> ` {0..1}) (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} ((\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) \<circ> \<gamma>)

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have "continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))
[PROOF STEP]
using pf\<gamma>'
[PROOF STATE]
proof (prove)
using this:
polynomial_function \<gamma>'

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))
[PROOF STEP]
by (simp add: continuous_on_polymonial_function vector_derivative_at [OF \<gamma>'])
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))
[PROOF STEP]
have cint_cint: "(\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x))

goal (1 subgoal):
 1. (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>
[PROOF STEP]
apply (simp add: contour_integrable_on)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x)) \<Longrightarrow> (\<lambda>t. contour_integral (linepath a b) (\<lambda>z. d z (\<gamma> t)) * vector_derivative \<gamma> (at t)) integrable_on {0..1}
[PROOF STEP]
apply (rule integrable_continuous_real)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x)) \<Longrightarrow> continuous_on {0..1} (\<lambda>t. contour_integral (linepath a b) (\<lambda>z. d z (\<gamma> t)) * vector_derivative \<gamma> (at t))
[PROOF STEP]
by (rule continuous_on_mult [OF cont_cint_d\<gamma> [unfolded o_def]])
[PROOF STATE]
proof (state)
this:
(\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have "contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))
[PROOF STEP]
using abu
[PROOF STATE]
proof (prove)
using this:
closed_segment a b \<subseteq> U

goal (1 subgoal):
 1. contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))
[PROOF STEP]
by (force simp: h_def intro: contour_integral_eq)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) h = contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have "\<dots> =  contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z)) = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
proof (rule contour_integral_swap)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. continuous_on (path_image (linepath a b) \<times> path_image \<gamma>) (\<lambda>(y1, y2). d y1 y2)
 2. valid_path (linepath a b)
 3. valid_path \<gamma>
 4. continuous_on {0..1} (\<lambda>t. vector_derivative (linepath a b) (at t))
 5. continuous_on {0..1} (\<lambda>t. vector_derivative \<gamma> (at t))
[PROOF STEP]
show "continuous_on (path_image (linepath a b) \<times> path_image \<gamma>) (\<lambda>(y1, y2). d y1 y2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (path_image (linepath a b) \<times> path_image \<gamma>) (\<lambda>(y1, y2). d y1 y2)
[PROOF STEP]
using abu pasz
[PROOF STATE]
proof (prove)
using this:
closed_segment a b \<subseteq> U
path_image \<gamma> \<subseteq> U - {z}

goal (1 subgoal):
 1. continuous_on (path_image (linepath a b) \<times> path_image \<gamma>) (\<lambda>(y1, y2). d y1 y2)
[PROOF STEP]
by (auto intro: continuous_on_subset [OF cond_uu])
[PROOF STATE]
proof (state)
this:
continuous_on (path_image (linepath a b) \<times> path_image \<gamma>) (\<lambda>(y1, y2). d y1 y2)

goal (4 subgoals):
 1. valid_path (linepath a b)
 2. valid_path \<gamma>
 3. continuous_on {0..1} (\<lambda>t. vector_derivative (linepath a b) (at t))
 4. continuous_on {0..1} (\<lambda>t. vector_derivative \<gamma> (at t))
[PROOF STEP]
show "continuous_on {0..1} (\<lambda>t. vector_derivative (linepath a b) (at t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>t. vector_derivative (linepath a b) (at t))
[PROOF STEP]
by (auto intro!: continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>t. vector_derivative (linepath a b) (at t))

goal (3 subgoals):
 1. valid_path (linepath a b)
 2. valid_path \<gamma>
 3. continuous_on {0..1} (\<lambda>t. vector_derivative \<gamma> (at t))
[PROOF STEP]
show "continuous_on {0..1} (\<lambda>t. vector_derivative \<gamma> (at t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>t. vector_derivative \<gamma> (at t))
[PROOF STEP]
by (metis \<gamma>' continuous_on_eq path_def path_polynomial_function pf\<gamma>' vector_derivative_at)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>t. vector_derivative \<gamma> (at t))

goal (2 subgoals):
 1. valid_path (linepath a b)
 2. valid_path \<gamma>
[PROOF STEP]
qed (use \<open>valid_path \<gamma>\<close> in auto)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) (\<lambda>z. contour_integral \<gamma> (d z)) = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
contour_integral (linepath a b) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
have cint_h_eq:
          "contour_integral (linepath a b) h =
                    contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))"
[PROOF STATE]
proof (prove)
using this:
contour_integral (linepath a b) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))

goal (1 subgoal):
 1. contour_integral (linepath a b) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
note cint_cint cint_h_eq
[PROOF STATE]
proof (state)
this:
(\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w)) contour_integrable_on \<gamma>
contour_integral (linepath a b) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath a b) (\<lambda>z. d z w))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
closed_segment ?a2 ?b2 \<subseteq> U \<Longrightarrow> (\<lambda>w. contour_integral (linepath ?a2 ?b2) (\<lambda>z. d z w)) contour_integrable_on \<gamma>
closed_segment ?a2 ?b2 \<subseteq> U \<Longrightarrow> contour_integral (linepath ?a2 ?b2) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath ?a2 ?b2) (\<lambda>z. d z w))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
note cint_h = this
[PROOF STATE]
proof (state)
this:
closed_segment ?a2 ?b2 \<subseteq> U \<Longrightarrow> (\<lambda>w. contour_integral (linepath ?a2 ?b2) (\<lambda>z. d z w)) contour_integrable_on \<gamma>
closed_segment ?a2 ?b2 \<subseteq> U \<Longrightarrow> contour_integral (linepath ?a2 ?b2) h = contour_integral \<gamma> (\<lambda>w. contour_integral (linepath ?a2 ?b2) (\<lambda>z. d z w))

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
have conthu: "continuous_on U h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U h
[PROOF STEP]
proof (simp add: continuous_on_sequentially, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
fix a x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
assume x: "x \<in> U" and au: "\<forall>n. a n \<in> U" and ax: "a \<longlonglongrightarrow> x"
[PROOF STATE]
proof (state)
this:
x \<in> U
\<forall>n. a n \<in> U
a \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> U
\<forall>n. a n \<in> U
a \<longlonglongrightarrow> x
[PROOF STEP]
have A1: "\<forall>\<^sub>F n in sequentially. d (a n) contour_integrable_on \<gamma>"
[PROOF STATE]
proof (prove)
using this:
x \<in> U
\<forall>n. a n \<in> U
a \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. d (a n) contour_integrable_on \<gamma>
[PROOF STEP]
by (meson U contour_integrable_on_def eventuallyI)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. d (a n) contour_integrable_on \<gamma>

goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
obtain dd where "dd>0" and dd: "cball x dd \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>dd. \<lbrakk>0 < dd; cball x dd \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using open_contains_cball \<open>open U\<close> x
[PROOF STATE]
proof (prove)
using this:
open ?S = (\<forall>x\<in>?S. \<exists>e>0. cball x e \<subseteq> ?S)
open U
x \<in> U

goal (1 subgoal):
 1. (\<And>dd. \<lbrakk>0 < dd; cball x dd \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < dd
cball x dd \<subseteq> U

goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
have A2: "uniform_limit (path_image \<gamma>) (\<lambda>n. d (a n)) (d x) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit (path_image \<gamma>) (\<lambda>n. d (a n)) (d x) sequentially
[PROOF STEP]
unfolding uniform_limit_iff dist_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>e>0. \<forall>\<^sub>F n in sequentially. \<forall>xa\<in>path_image \<gamma>. cmod (d (a n) xa - d x xa) < e
[PROOF STEP]
proof clarify
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in sequentially. \<forall>xa\<in>path_image \<gamma>. cmod (d (a n) xa - d x xa) < e
[PROOF STEP]
fix ee::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in sequentially. \<forall>xa\<in>path_image \<gamma>. cmod (d (a n) xa - d x xa) < e
[PROOF STEP]
assume "0 < ee"
[PROOF STATE]
proof (state)
this:
0 < ee

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F n in sequentially. \<forall>xa\<in>path_image \<gamma>. cmod (d (a n) xa - d x xa) < e
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
let ?ddpa = "{(w,z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
have "uniformly_continuous_on ?ddpa (\<lambda>(x,y). d x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>} (\<lambda>(x, y). d x y)
[PROOF STEP]
proof (rule compact_uniformly_continuous [OF continuous_on_subset[OF cond_uu]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>} \<subseteq> U \<times> U
 2. compact {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}
[PROOF STEP]
show "compact {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}
[PROOF STEP]
using \<open>valid_path \<gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path \<gamma>

goal (1 subgoal):
 1. compact {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}
[PROOF STEP]
by (auto simp: compact_Times compact_valid_path_image simp del: mem_cball)
[PROOF STATE]
proof (state)
this:
compact {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}

goal (1 subgoal):
 1. {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>} \<subseteq> U \<times> U
[PROOF STEP]
qed (use dd pasz in auto)
[PROOF STATE]
proof (state)
this:
uniformly_continuous_on {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>} (\<lambda>(x, y). d x y)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
uniformly_continuous_on {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>} (\<lambda>(x, y). d x y)
[PROOF STEP]
obtain kk where "kk>0"
            and kk: "\<And>x x'. \<lbrakk>x \<in> ?ddpa; x' \<in> ?ddpa; dist x' x < kk\<rbrakk> \<Longrightarrow>
                             dist ((\<lambda>(x,y). d x y) x') ((\<lambda>(x,y). d x y) x) < ee"
[PROOF STATE]
proof (prove)
using this:
uniformly_continuous_on {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>} (\<lambda>(x, y). d x y)

goal (1 subgoal):
 1. (\<And>kk. \<lbrakk>0 < kk; \<And>xa x'. \<lbrakk>xa \<in> {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}; x' \<in> {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}; dist x' xa < kk\<rbrakk> \<Longrightarrow> dist (case x' of (x, y) \<Rightarrow> d x y) (case xa of (x, y) \<Rightarrow> d x y) < ee\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule uniformly_continuous_onE [where e = ee]) (use \<open>0 < ee\<close> in auto)
[PROOF STATE]
proof (state)
this:
0 < kk
\<lbrakk>?x \<in> {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}; ?x' \<in> {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}; dist ?x' ?x < kk\<rbrakk> \<Longrightarrow> dist (case ?x' of (x, y) \<Rightarrow> d x y) (case ?x of (x, y) \<Rightarrow> d x y) < ee

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
have kk: "\<lbrakk>norm (w - x) \<le> dd; z \<in> path_image \<gamma>; norm ((w, z) - (x, z)) < kk\<rbrakk> \<Longrightarrow> norm (d w z - d x z) < ee"
            for  w z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod (w - x) \<le> dd; z \<in> path_image \<gamma>; norm ((w, z) - (x, z)) < kk\<rbrakk> \<Longrightarrow> cmod (d w z - d x z) < ee
[PROOF STEP]
using \<open>dd>0\<close> kk [of "(x,z)" "(w,z)"]
[PROOF STATE]
proof (prove)
using this:
0 < dd
\<lbrakk>(x, z) \<in> {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}; (w, z) \<in> {(w, z) |w z. w \<in> cball x dd \<and> z \<in> path_image \<gamma>}; dist (w, z) (x, z) < kk\<rbrakk> \<Longrightarrow> dist (case (w, z) of (x, y) \<Rightarrow> d x y) (case (x, z) of (x, y) \<Rightarrow> d x y) < ee

goal (1 subgoal):
 1. \<lbrakk>cmod (w - x) \<le> dd; z \<in> path_image \<gamma>; norm ((w, z) - (x, z)) < kk\<rbrakk> \<Longrightarrow> cmod (d w z - d x z) < ee
[PROOF STEP]
by (force simp: norm_minus_commute dist_norm)
[PROOF STATE]
proof (state)
this:
\<lbrakk>cmod (?w - x) \<le> dd; ?z \<in> path_image \<gamma>; norm ((?w, ?z) - (x, ?z)) < kk\<rbrakk> \<Longrightarrow> cmod (d ?w ?z - d x ?z) < ee

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
obtain no where "\<forall>n\<ge>no. dist (a n) x < min dd kk"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>no. \<forall>n\<ge>no. dist (a n) x < min dd kk \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ax
[PROOF STATE]
proof (prove)
using this:
a \<longlonglongrightarrow> x

goal (1 subgoal):
 1. (\<And>no. \<forall>n\<ge>no. dist (a n) x < min dd kk \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding lim_sequentially
[PROOF STATE]
proof (prove)
using this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (a n) x < r

goal (1 subgoal):
 1. (\<And>no. \<forall>n\<ge>no. dist (a n) x < min dd kk \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson \<open>0 < dd\<close> \<open>0 < kk\<close> min_less_iff_conj)
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>no. dist (a n) x < min dd kk

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>no. dist (a n) x < min dd kk
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>no. dist (a n) x < min dd kk

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
using \<open>dd > 0\<close> \<open>kk > 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>no. dist (a n) x < min dd kk
0 < dd
0 < kk

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee
[PROOF STEP]
by (fastforce simp: eventually_sequentially kk dist_norm)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. \<forall>\<xi>\<in>path_image \<gamma>. cmod (d (a n) \<xi> - d x \<xi>) < ee

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
uniform_limit (path_image \<gamma>) (\<lambda>n. d (a n)) (d x) sequentially

goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
have "(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> contour_integral \<gamma> (d x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> contour_integral \<gamma> (d x)
[PROOF STEP]
by (rule contour_integral_uniform_limit [OF A1 A2 le_B]) (auto simp: \<open>valid_path \<gamma>\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> contour_integral \<gamma> (d x)

goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> contour_integral \<gamma> (d x)
[PROOF STEP]
have tendsto_hx: "(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> contour_integral \<gamma> (d x)

goal (1 subgoal):
 1. (\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x
[PROOF STEP]
by (simp add: h_def x)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x

goal (1 subgoal):
 1. \<And>x a. \<lbrakk>a \<in> U; \<forall>n. x n \<in> U; x \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> (h \<circ> x) \<longlonglongrightarrow> h a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x
[PROOF STEP]
show "(h \<circ> a) \<longlonglongrightarrow> h x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. contour_integral \<gamma> (d (a n))) \<longlonglongrightarrow> h x

goal (1 subgoal):
 1. (h \<circ> a) \<longlonglongrightarrow> h x
[PROOF STEP]
by (simp add: h_def x au o_def)
[PROOF STATE]
proof (state)
this:
(h \<circ> a) \<longlonglongrightarrow> h x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on U h

goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h holomorphic_on UNIV
[PROOF STEP]
proof (simp add: holomorphic_on_open field_differentiable_def [symmetric], clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. h field_differentiable at x
[PROOF STEP]
fix z0
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. h field_differentiable at x
[PROOF STEP]
consider "z0 \<in> v" | "z0 \<in> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>z0 \<in> v \<Longrightarrow> thesis; z0 \<in> U \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using uv_Un
[PROOF STATE]
proof (prove)
using this:
U \<union> v = UNIV

goal (1 subgoal):
 1. \<lbrakk>z0 \<in> v \<Longrightarrow> thesis; z0 \<in> U \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>z0 \<in> v \<Longrightarrow> ?thesis; z0 \<in> U \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x. h field_differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>z0 \<in> v \<Longrightarrow> ?thesis; z0 \<in> U \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show "h field_differentiable at z0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z0 \<in> v \<Longrightarrow> ?thesis; z0 \<in> U \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. h field_differentiable at z0
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z0 \<in> v \<Longrightarrow> h field_differentiable at z0
 2. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
assume "z0 \<in> v"
[PROOF STATE]
proof (state)
this:
z0 \<in> v

goal (2 subgoals):
 1. z0 \<in> v \<Longrightarrow> h field_differentiable at z0
 2. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z0 \<in> v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z0 \<in> v

goal (1 subgoal):
 1. h field_differentiable at z0
[PROOF STEP]
using Cauchy_next_derivative [OF con_pa_f le_B f_has_cint _ ov] V f_has_cint \<open>valid_path \<gamma>\<close>
[PROOF STATE]
proof (prove)
using this:
z0 \<in> v
\<lbrakk>\<And>t. t \<in> {0..1} \<Longrightarrow> t \<in> {0..1}; \<And>w. w \<in> v - path_image \<gamma> \<Longrightarrow> w \<in> v - path_image \<gamma>; 1 \<noteq> 0; valid_path \<gamma>; ?w \<in> v - path_image \<gamma>\<rbrakk> \<Longrightarrow> (\<lambda>u. f u / (u - ?w) ^ Suc 1) contour_integrable_on \<gamma>
\<lbrakk>\<And>t. t \<in> {0..1} \<Longrightarrow> t \<in> {0..1}; \<And>w. w \<in> v - path_image \<gamma> \<Longrightarrow> w \<in> v - path_image \<gamma>; 1 \<noteq> 0; valid_path \<gamma>; ?w \<in> v - path_image \<gamma>\<rbrakk> \<Longrightarrow> (h has_field_derivative of_nat 1 * contour_integral \<gamma> (\<lambda>u. f u / (u - ?w) ^ Suc 1)) (at ?w)
?z \<in> v \<Longrightarrow> ((\<lambda>w. f w / (w - ?z)) has_contour_integral h ?z) \<gamma>
?w \<in> v - path_image \<gamma> \<Longrightarrow> ((\<lambda>u. f u / (u - ?w) ^ 1) has_contour_integral h ?w) \<gamma>
valid_path \<gamma>

goal (1 subgoal):
 1. h field_differentiable at z0
[PROOF STEP]
by (auto simp: field_differentiable_def v_def)
[PROOF STATE]
proof (state)
this:
h field_differentiable at z0

goal (1 subgoal):
 1. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
assume "z0 \<in> U"
[PROOF STATE]
proof (state)
this:
z0 \<in> U

goal (1 subgoal):
 1. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z0 \<in> U
[PROOF STEP]
obtain e where "e>0" and e: "ball z0 e \<subseteq> U"
[PROOF STATE]
proof (prove)
using this:
z0 \<in> U

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball z0 e \<subseteq> U\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast intro: openE [OF \<open>open U\<close>])
[PROOF STATE]
proof (state)
this:
0 < e
ball z0 e \<subseteq> U

goal (1 subgoal):
 1. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
have *: "contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0"
                if abc_subset: "convex hull {a, b, c} \<subseteq> ball z0 e"  for a b c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
have *: "\<And>x1 x2 z. z \<in> U \<Longrightarrow> closed_segment x1 x2 \<subseteq> U \<Longrightarrow> (\<lambda>w. d w z) contour_integrable_on linepath x1 x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 z. \<lbrakk>z \<in> U; closed_segment x1 x2 \<subseteq> U\<rbrakk> \<Longrightarrow> (\<lambda>w. d w z) contour_integrable_on linepath x1 x2
[PROOF STEP]
using  hol_dw holomorphic_on_imp_continuous_on \<open>open U\<close>
[PROOF STATE]
proof (prove)
using this:
?w \<in> U \<Longrightarrow> (\<lambda>z. d z ?w) holomorphic_on U
?f holomorphic_on ?s \<Longrightarrow> continuous_on ?s ?f
open U

goal (1 subgoal):
 1. \<And>x1 x2 z. \<lbrakk>z \<in> U; closed_segment x1 x2 \<subseteq> U\<rbrakk> \<Longrightarrow> (\<lambda>w. d w z) contour_integrable_on linepath x1 x2
[PROOF STEP]
by (auto intro!: contour_integrable_holomorphic_simple)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z \<in> U; closed_segment ?x1.0 ?x2.0 \<subseteq> U\<rbrakk> \<Longrightarrow> (\<lambda>w. d w ?z) contour_integrable_on linepath ?x1.0 ?x2.0

goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
have abc: "closed_segment a b \<subseteq> U"  "closed_segment b c \<subseteq> U"  "closed_segment c a \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b \<subseteq> U &&& closed_segment b c \<subseteq> U &&& closed_segment c a \<subseteq> U
[PROOF STEP]
using that e segments_subset_convex_hull
[PROOF STATE]
proof (prove)
using this:
convex hull {a, b, c} \<subseteq> ball z0 e
ball z0 e \<subseteq> U
closed_segment ?a ?b \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?a ?c \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?b ?c \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?b ?a \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?c ?a \<subseteq> convex hull {?a, ?b, ?c}
closed_segment ?c ?b \<subseteq> convex hull {?a, ?b, ?c}

goal (1 subgoal):
 1. closed_segment a b \<subseteq> U &&& closed_segment b c \<subseteq> U &&& closed_segment c a \<subseteq> U
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
closed_segment a b \<subseteq> U
closed_segment b c \<subseteq> U
closed_segment c a \<subseteq> U

goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
have eq0: "\<And>w. w \<in> U \<Longrightarrow> contour_integral (linepath a b +++ linepath b c +++ linepath c a) (\<lambda>z. d z w) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. w \<in> U \<Longrightarrow> contour_integral (linepath a b +++ linepath b c +++ linepath c a) (\<lambda>z. d z w) = 0
[PROOF STEP]
proof (rule contour_integral_unique [OF Cauchy_theorem_triangle])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) holomorphic_on convex hull {a, b, c}
[PROOF STEP]
show "\<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) holomorphic_on convex hull {a, b, c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) holomorphic_on convex hull {a, b, c}
[PROOF STEP]
using e abc_subset
[PROOF STATE]
proof (prove)
using this:
ball z0 e \<subseteq> U
convex hull {a, b, c} \<subseteq> ball z0 e

goal (1 subgoal):
 1. \<And>w. w \<in> U \<Longrightarrow> (\<lambda>z. d z w) holomorphic_on convex hull {a, b, c}
[PROOF STEP]
by (auto intro: holomorphic_on_subset [OF hol_dw])
[PROOF STATE]
proof (state)
this:
?w \<in> U \<Longrightarrow> (\<lambda>z. d z ?w) holomorphic_on convex hull {a, b, c}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?w \<in> U \<Longrightarrow> contour_integral (linepath a b +++ linepath b c +++ linepath c a) (\<lambda>z. d z ?w) = 0

goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
have "contour_integral \<gamma>
                   (\<lambda>x. contour_integral (linepath a b) (\<lambda>z. d z x) +
                        (contour_integral (linepath b c) (\<lambda>z. d z x) +
                         contour_integral (linepath c a) (\<lambda>z. d z x)))  =  0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (\<lambda>x. contour_integral (linepath a b) (\<lambda>z. d z x) + (contour_integral (linepath b c) (\<lambda>z. d z x) + contour_integral (linepath c a) (\<lambda>z. d z x))) = 0
[PROOF STEP]
apply (rule contour_integral_eq_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. z \<in> path_image \<gamma> \<Longrightarrow> contour_integral (linepath a b) (\<lambda>za. d za z) + (contour_integral (linepath b c) (\<lambda>za. d za z) + contour_integral (linepath c a) (\<lambda>za. d za z)) = 0
[PROOF STEP]
using abc pasz U
[PROOF STATE]
proof (prove)
using this:
closed_segment a b \<subseteq> U
closed_segment b c \<subseteq> U
closed_segment c a \<subseteq> U
path_image \<gamma> \<subseteq> U - {z}
?z \<in> U \<Longrightarrow> (d ?z has_contour_integral h ?z) \<gamma>

goal (1 subgoal):
 1. \<And>z. z \<in> path_image \<gamma> \<Longrightarrow> contour_integral (linepath a b) (\<lambda>za. d za z) + (contour_integral (linepath b c) (\<lambda>za. d za z) + contour_integral (linepath c a) (\<lambda>za. d za z)) = 0
[PROOF STEP]
apply (subst contour_integral_join [symmetric], auto intro: eq0 *)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (\<lambda>x. contour_integral (linepath a b) (\<lambda>z. d z x) + (contour_integral (linepath b c) (\<lambda>z. d z x) + contour_integral (linepath c a) (\<lambda>z. d z x))) = 0

goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
contour_integral \<gamma> (\<lambda>x. contour_integral (linepath a b) (\<lambda>z. d z x) + (contour_integral (linepath b c) (\<lambda>z. d z x) + contour_integral (linepath c a) (\<lambda>z. d z x))) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
contour_integral \<gamma> (\<lambda>x. contour_integral (linepath a b) (\<lambda>z. d z x) + (contour_integral (linepath b c) (\<lambda>z. d z x) + contour_integral (linepath c a) (\<lambda>z. d z x))) = 0

goal (1 subgoal):
 1. contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0
[PROOF STEP]
by (simp add: cint_h abc contour_integrable_add contour_integral_add [symmetric] add_ac)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) h + contour_integral (linepath b c) h + contour_integral (linepath c a) h = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
convex hull {?a, ?b, ?c} \<subseteq> ball z0 e \<Longrightarrow> contour_integral (linepath ?a ?b) h + contour_integral (linepath ?b ?c) h + contour_integral (linepath ?c ?a) h = 0

goal (1 subgoal):
 1. z0 \<in> U \<Longrightarrow> h field_differentiable at z0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h field_differentiable at z0
[PROOF STEP]
using e \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
ball z0 e \<subseteq> U
0 < e

goal (1 subgoal):
 1. h field_differentiable at z0
[PROOF STEP]
by (auto intro!: holomorphic_on_imp_differentiable_at [OF _ open_ball] analytic_imp_holomorphic
                           Morera_triangle continuous_on_subset [OF conthu] *)
[PROOF STATE]
proof (state)
this:
h field_differentiable at z0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h field_differentiable at z0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h holomorphic_on UNIV

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h holomorphic_on UNIV

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(h \<longlongrightarrow> 0) at_infinity
h holomorphic_on UNIV
[PROOF STEP]
have [simp]: "h z = 0" for z
[PROOF STATE]
proof (prove)
using this:
(h \<longlongrightarrow> 0) at_infinity
h holomorphic_on UNIV

goal (1 subgoal):
 1. h z = 0
[PROOF STEP]
by (meson Liouville_weak)
[PROOF STATE]
proof (state)
this:
h ?z = 0

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have "((\<lambda>w. 1 / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z) \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. 1 / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z) \<gamma>
[PROOF STEP]
by (rule has_contour_integral_winding_number [OF \<open>valid_path \<gamma>\<close> znot])
[PROOF STATE]
proof (state)
this:
((\<lambda>w. 1 / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>w. 1 / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z) \<gamma>
[PROOF STEP]
have "((\<lambda>w. f z * (1 / (w - z))) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>w. 1 / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f z * (1 / (w - z))) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
by (metis mult.commute has_contour_integral_lmul)
[PROOF STATE]
proof (state)
this:
((\<lambda>w. f z * (1 / (w - z))) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>w. f z * (1 / (w - z))) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have 1: "((\<lambda>w. f z / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>w. f z * (1 / (w - z))) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f z / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>w. f z / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>w. f z / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
have 2: "((\<lambda>w. (f w - f z) / (w - z)) has_contour_integral 0) \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. (f w - f z) / (w - z)) has_contour_integral 0) \<gamma>
[PROOF STEP]
using U [OF z] pasz d_def
[PROOF STATE]
proof (prove)
using this:
(d z has_contour_integral h z) \<gamma>
path_image \<gamma> \<subseteq> U - {z}
d \<equiv> \<lambda>z w. if w = z then deriv f z else (f w - f z) / (w - z)

goal (1 subgoal):
 1. ((\<lambda>w. (f w - f z) / (w - z)) has_contour_integral 0) \<gamma>
[PROOF STEP]
by (force elim: has_contour_integral_eq [where g = "\<lambda>w. (f w - f z)/(w - z)"])
[PROOF STATE]
proof (state)
this:
((\<lambda>w. (f w - f z) / (w - z)) has_contour_integral 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
using has_contour_integral_add [OF 1 2]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f z / (x - z) + (f x - f z) / (x - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z + 0) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>
[PROOF STEP]
by (simp add: diff_divide_distrib)
[PROOF STATE]
proof (state)
this:
((\<lambda>w. f w / (w - z)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number \<gamma> z * f z) \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed