[STATEMENT]
theorem winding_number_cindex_pathE:
  fixes g::"real \<Rightarrow> complex"
  assumes "finite_ReZ_segments g z" and "valid_path g" "z \<notin> path_image g" and
    loop: "pathfinish g = pathstart g"
  shows "winding_number g z = - cindex_pathE g z / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
proof (rule finite_ReZ_segment_cases[OF assms(1)])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
assume "s \<in> {0..<1}" "s = 0 \<or> Re (g s) = Re z"
          and const:"\<forall>t\<in>{s<..<1}. Re (g t) = Re z"
          and finite:"finite_ReZ_segments (subpath 0 s g) z"
[PROOF STATE]
proof (state)
this:
s \<in> {0..<1}
s = 0 \<or> Re (g s) = Re z
\<forall>t\<in>{s<..<1}. Re (g t) = Re z
finite_ReZ_segments (subpath 0 s g) z

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
have "Re (g 1) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g 1) = Re z
[PROOF STEP]
apply(rule continuous_constant_on_closure[of "{s<..<1}" "\<lambda>t. Re(g t)"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on (closure {s<..<1}) (\<lambda>t. Re (g t))
 2. \<And>x. x \<in> {s<..<1} \<Longrightarrow> Re (g x) = Re z
 3. 1 \<in> closure {s<..<1}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closure {s<..<1}) (\<lambda>t. Re (g t))
[PROOF STEP]
using valid_path_imp_path[OF \<open>valid_path g\<close>,unfolded path_def] \<open>s\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g
s \<in> {0..<1}

goal (1 subgoal):
 1. continuous_on (closure {s<..<1}) (\<lambda>t. Re (g t))
[PROOF STEP]
by (auto intro!:continuous_intros continuous_Re elim:continuous_on_subset)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {s<..<1} \<Longrightarrow> Re (g x) = Re z
 2. 1 \<in> closure {s<..<1}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> {s<..<1} \<Longrightarrow> Re (g x_) = Re z
[PROOF STEP]
using const
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{s<..<1}. Re (g t) = Re z

goal (1 subgoal):
 1. x_ \<in> {s<..<1} \<Longrightarrow> Re (g x_) = Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<in> closure {s<..<1}
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<in> closure {s<..<1}
[PROOF STEP]
using \<open>s\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..<1}

goal (1 subgoal):
 1. 1 \<in> closure {s<..<1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Re (g 1) = Re z

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (g 1) = Re z

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g 1) = Re z
[PROOF STEP]
have "Re (g 0) = Re z"
[PROOF STATE]
proof (prove)
using this:
Re (g 1) = Re z

goal (1 subgoal):
 1. Re (g 0) = Re z
[PROOF STEP]
using loop
[PROOF STATE]
proof (prove)
using this:
Re (g 1) = Re z
pathfinish g = pathstart g

goal (1 subgoal):
 1. Re (g 0) = Re z
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
Re (g 1) = Re z
g 1 = g 0

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

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (g 1) = Re z
Re (g 0) = Re z
[PROOF STEP]
have "2 * Re (winding_number g z) = - cindex_pathE g z"
[PROOF STATE]
proof (prove)
using this:
Re (g 1) = Re z
Re (g 0) = Re z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
using winding_number_cindex_pathE_aux[of g z] assms(1-3)
[PROOF STATE]
proof (prove)
using this:
Re (g 1) = Re z
Re (g 0) = Re z
\<lbrakk>finite_ReZ_segments g z; valid_path g; z \<notin> path_image g; Re (g 1) = Re z; Re (g 0) = Re z\<rbrakk> \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
finite_ReZ_segments g z
valid_path g
z \<notin> path_image g

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
have "winding_number g z \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number g z \<in> \<int>
[PROOF STEP]
using integer_winding_number[OF _ loop \<open>z\<notin>path_image g\<close>] valid_path_imp_path[OF \<open>valid_path g\<close>]
[PROOF STATE]
proof (prove)
using this:
path g \<Longrightarrow> winding_number g z \<in> \<int>
path g

goal (1 subgoal):
 1. winding_number g z \<in> \<int>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
winding_number g z \<in> \<int>

goal (2 subgoals):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) = Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
 2. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 * Re (winding_number g z) = - cindex_pathE g z
winding_number g z \<in> \<int>
[PROOF STEP]
show "winding_number g z = - cindex_pathE g z / 2"
[PROOF STATE]
proof (prove)
using this:
2 * Re (winding_number g z) = - cindex_pathE g z
winding_number g z \<in> \<int>

goal (1 subgoal):
 1. winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
by (metis add.right_neutral complex_eq complex_is_Int_iff mult_zero_right
        nonzero_mult_div_cancel_left of_real_0 zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
winding_number g z = complex_of_real (- cindex_pathE g z / 2)

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
assume "s \<in> {0..<1}" "s = 0 \<or> Re (g s) = Re z"
          and Re_neq:"\<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z"
          and finite:"finite_ReZ_segments (subpath 0 s g) z"
[PROOF STATE]
proof (state)
this:
s \<in> {0..<1}
s = 0 \<or> Re (g s) = Re z
\<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z
finite_ReZ_segments (subpath 0 s g) z

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
have "path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path g
[PROOF STEP]
using \<open>valid_path g\<close> valid_path_imp_path
[PROOF STATE]
proof (prove)
using this:
valid_path g
valid_path ?g \<Longrightarrow> path ?g

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

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
let ?goal = "2 * Re (winding_number g z) = - cindex_pathE g z"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
have ?goal when "s=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have index_ends:"cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z"
      when Re_neq:"\<forall>t\<in>{0<..<1}. Re (h t) \<noteq> Re z" and "valid_path h" for h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
define f where "f = (\<lambda>t. Im (h t - z) / Re (h t - z))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. Im (h t - z) / Re (h t - z))

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
define Ri where "Ri = {x. jumpF f (at_right x) \<noteq> 0 \<and> 0 \<le> x \<and> x < 1}"
[PROOF STATE]
proof (state)
this:
Ri = {x. jumpF f (at_right x) \<noteq> 0 \<and> 0 \<le> x \<and> x < 1}

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
define Le where "Le = {x. jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1}"
[PROOF STATE]
proof (state)
this:
Le = {x. jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1}

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
have "path h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path h
[PROOF STEP]
using \<open>valid_path h\<close> valid_path_imp_path
[PROOF STATE]
proof (prove)
using this:
valid_path h
valid_path ?g \<Longrightarrow> path ?g

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

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
have jumpF_eq0: "jumpF f (at_left x) = 0" "jumpF f (at_right x) = 0" when "x\<in>{0<..<1}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_left x) = 0 &&& jumpF f (at_right x) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. jumpF f (at_left x) = 0
 2. jumpF f (at_right x) = 0
[PROOF STEP]
have "Re (h x) \<noteq> Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h x) \<noteq> Re z
[PROOF STEP]
using  \<open>\<forall>t\<in>{0<..<1}. Re (h t) \<noteq> Re z\<close> that
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re (h t) \<noteq> Re z
x \<in> {0<..<1}

goal (1 subgoal):
 1. Re (h x) \<noteq> Re z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Re (h x) \<noteq> Re z

goal (2 subgoals):
 1. jumpF f (at_left x) = 0
 2. jumpF f (at_right x) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (h x) \<noteq> Re z
[PROOF STEP]
have "isCont f x"
[PROOF STATE]
proof (prove)
using this:
Re (h x) \<noteq> Re z

goal (1 subgoal):
 1. isCont f x
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
Re (h x) \<noteq> Re z

goal (1 subgoal):
 1. isCont (\<lambda>t. Im (h t - z) / Re (h t - z)) x
[PROOF STEP]
using continuous_on_interior[OF \<open>path h\<close>[unfolded path_def]] that
[PROOF STATE]
proof (prove)
using this:
Re (h x) \<noteq> Re z
?x \<in> interior {0..1} \<Longrightarrow> isCont h ?x
x \<in> {0<..<1}

goal (1 subgoal):
 1. isCont (\<lambda>t. Im (h t - z) / Re (h t - z)) x
[PROOF STEP]
by (auto intro!: continuous_intros isCont_Im isCont_Re)
[PROOF STATE]
proof (state)
this:
isCont f x

goal (2 subgoals):
 1. jumpF f (at_left x) = 0
 2. jumpF f (at_right x) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isCont f x
[PROOF STEP]
show "jumpF f (at_left x) = 0" "jumpF f (at_right x) = 0"
[PROOF STATE]
proof (prove)
using this:
isCont f x

goal (1 subgoal):
 1. jumpF f (at_left x) = 0 &&& jumpF f (at_right x) = 0
[PROOF STEP]
unfolding continuous_at_split
[PROOF STATE]
proof (prove)
using this:
continuous (at_left x) f \<and> continuous (at_right x) f

goal (1 subgoal):
 1. jumpF f (at_left x) = 0 &&& jumpF f (at_right x) = 0
[PROOF STEP]
by (auto intro: jumpF_not_infinity)
[PROOF STATE]
proof (state)
this:
jumpF f (at_left x) = 0
jumpF f (at_right x) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {0<..<1} \<Longrightarrow> jumpF f (at_left ?x) = 0
?x \<in> {0<..<1} \<Longrightarrow> jumpF f (at_right ?x) = 0

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
have "cindex_pathE h z  = cindexE 0 1 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE h z = cindexE 0 1 f
[PROOF STEP]
unfolding cindex_pathE_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (h t - z) / Re (h t - z)) = cindexE 0 1 (\<lambda>t. Im (h t - z) / Re (h t - z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindex_pathE h z = cindexE 0 1 f

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE h z = cindexE 0 1 f

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
have "... = sum (\<lambda>x. jumpF f (at_right x)) Ri - sum (\<lambda>x. jumpF f (at_left x)) Le"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 f = (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x))
[PROOF STEP]
unfolding cindexE_def Ri_def Le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> 0 \<le> x \<and> x < 1. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1. jumpF f (at_left x)) = (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> 0 \<le> x \<and> x < 1. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1. jumpF f (at_left x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 f = (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x))

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 f = (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x))

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
have "... = jumpF f (at_right 0) -  jumpF f (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)
[PROOF STEP]
have "sum (\<lambda>x. jumpF f (at_right x)) Ri = jumpF f (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
proof (cases "jumpF f (at_right 0) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. jumpF f (at_right 0) = 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
 2. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
jumpF f (at_right 0) = 0

goal (2 subgoals):
 1. jumpF f (at_right 0) = 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
 2. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
hence False if "x \<in> Ri" for x
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_right 0) = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_right 0) = 0
x \<in> Ri

goal (1 subgoal):
 1. False
[PROOF STEP]
by (cases "x = 0") (auto simp: jumpF_eq0 Ri_def)
[PROOF STATE]
proof (state)
this:
?x \<in> Ri \<Longrightarrow> False

goal (2 subgoals):
 1. jumpF f (at_right 0) = 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
 2. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
hence "Ri = {}"
[PROOF STATE]
proof (prove)
using this:
?x \<in> Ri \<Longrightarrow> False

goal (1 subgoal):
 1. Ri = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Ri = {}

goal (2 subgoals):
 1. jumpF f (at_right 0) = 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
 2. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Ri = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Ri = {}

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
Ri = {}
jumpF f (at_right 0) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)

goal (1 subgoal):
 1. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
jumpF f (at_right 0) \<noteq> 0

goal (1 subgoal):
 1. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
hence "x \<in> Ri \<longleftrightarrow> x = 0" for x
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_right 0) \<noteq> 0

goal (1 subgoal):
 1. (x \<in> Ri) = (x = 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_right 0) \<noteq> 0
\<forall>t\<in>{0<..<1}. Re (h t) \<noteq> Re z
valid_path h

goal (1 subgoal):
 1. (x \<in> Ri) = (x = 0)
[PROOF STEP]
by (cases "x = 0") (auto simp: jumpF_eq0 Ri_def)
[PROOF STATE]
proof (state)
this:
(?x \<in> Ri) = (?x = 0)

goal (1 subgoal):
 1. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?x \<in> Ri) = (?x = 0)
[PROOF STEP]
have "Ri = {0}"
[PROOF STATE]
proof (prove)
using this:
(?x \<in> Ri) = (?x = 0)

goal (1 subgoal):
 1. Ri = {0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Ri = {0}

goal (1 subgoal):
 1. jumpF f (at_right 0) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Ri = {0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Ri = {0}

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)
[PROOF STEP]
have "sum (\<lambda>x. jumpF f (at_left x)) Le = jumpF f (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
proof (cases "jumpF f (at_left 1) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. jumpF f (at_left 1) = 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
 2. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
jumpF f (at_left 1) = 0

goal (2 subgoals):
 1. jumpF f (at_left 1) = 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
 2. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF f (at_left 1) = 0
[PROOF STEP]
have "Le = {}"
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_left 1) = 0

goal (1 subgoal):
 1. Le = {}
[PROOF STEP]
unfolding Le_def
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_left 1) = 0

goal (1 subgoal):
 1. {x. jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1} = {}
[PROOF STEP]
using jumpF_eq0(1) greaterThanLessThan_iff
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_left 1) = 0
?x \<in> {0<..<1} \<Longrightarrow> jumpF f (at_left ?x) = 0
(?i \<in> {?l<..<?u}) = (?l < ?i \<and> ?i < ?u)

goal (1 subgoal):
 1. {x. jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1} = {}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Le = {}

goal (2 subgoals):
 1. jumpF f (at_left 1) = 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
 2. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Le = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Le = {}

goal (1 subgoal):
 1. (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
Le = {}
jumpF f (at_left 1) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)

goal (1 subgoal):
 1. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
jumpF f (at_left 1) \<noteq> 0

goal (1 subgoal):
 1. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF f (at_left 1) \<noteq> 0
[PROOF STEP]
have "Le = {1}"
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_left 1) \<noteq> 0

goal (1 subgoal):
 1. Le = {1}
[PROOF STEP]
unfolding Le_def
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_left 1) \<noteq> 0

goal (1 subgoal):
 1. {x. jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1} = {1}
[PROOF STEP]
using jumpF_eq0(1) greaterThanLessThan_iff
[PROOF STATE]
proof (prove)
using this:
jumpF f (at_left 1) \<noteq> 0
?x \<in> {0<..<1} \<Longrightarrow> jumpF f (at_left ?x) = 0
(?i \<in> {?l<..<?u}) = (?l < ?i \<and> ?i < ?u)

goal (1 subgoal):
 1. {x. jumpF f (at_left x) \<noteq> 0 \<and> 0 < x \<and> x \<le> 1} = {1}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Le = {1}

goal (1 subgoal):
 1. jumpF f (at_left 1) \<noteq> 0 \<Longrightarrow> (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Le = {1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Le = {1}

goal (1 subgoal):
 1. (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
(\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) = jumpF f (at_right 0)
(\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_left 1)

goal (1 subgoal):
 1. (\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>Ri. jumpF f (at_right x)) - (\<Sum>x\<in>Le. jumpF f (at_left x)) = jumpF f (at_right 0) - jumpF f (at_left 1)

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
have "... = jumpF_pathstart h z - jumpF_pathfinish h z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right 0) - jumpF f (at_left 1) = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
unfolding jumpF_pathstart_def jumpF_pathfinish_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF (\<lambda>t. Im (h t - z) / Re (h t - z)) (at_right 0) - jumpF (\<lambda>t. Im (h t - z) / Re (h t - z)) (at_left 1) = jumpF (\<lambda>t. Im (h t - z) / Re (h t - z)) (at_right 0) - jumpF (\<lambda>t. Im (h t - z) / Re (h t - z)) (at_left 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF f (at_right 0) - jumpF f (at_left 1) = jumpF_pathstart h z - jumpF_pathfinish h z

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z

goal (1 subgoal):
 1. cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE h z = jumpF_pathstart h z - jumpF_pathfinish h z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>t\<in>{0<..<1}. Re (?h t) \<noteq> Re z; valid_path ?h\<rbrakk> \<Longrightarrow> cindex_pathE ?h z = jumpF_pathstart ?h z - jumpF_pathfinish ?h z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
define fI where "fI=(\<lambda>t. Im (g t - z))"
[PROOF STATE]
proof (state)
this:
fI = (\<lambda>t. Im (g t - z))

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
define fR where "fR=(\<lambda>t. Re (g t - z))"
[PROOF STATE]
proof (state)
this:
fR = (\<lambda>t. Re (g t - z))

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have fI: "(fI \<longlongrightarrow> fI 0) (at_right 0)" "(fI \<longlongrightarrow> fI 1) (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0) &&& (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
have "continuous (at_right 0) fI"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_right 0) fI
[PROOF STEP]
apply (rule continuous_on_at_right[of _ 1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..1} fI
 2. 0 < 1
[PROOF STEP]
using \<open>path g\<close>
[PROOF STATE]
proof (prove)
using this:
path g

goal (2 subgoals):
 1. continuous_on {0..1} fI
 2. 0 < 1
[PROOF STEP]
unfolding fI_def path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. Im (g t - z))
 2. 0 < 1
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous (at_right 0) fI

goal (2 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous (at_right 0) fI
[PROOF STEP]
show "(fI \<longlongrightarrow> fI 0) (at_right 0)"
[PROOF STATE]
proof (prove)
using this:
continuous (at_right 0) fI

goal (1 subgoal):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
[PROOF STEP]
by (simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
(fI \<longlongrightarrow> fI 0) (at_right 0)

goal (1 subgoal):
 1. (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
have "continuous (at_left 1) fI"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_left 1) fI
[PROOF STEP]
apply (rule continuous_on_at_left[of 0])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..1} fI
 2. 0 < 1
[PROOF STEP]
using \<open>path g\<close>
[PROOF STATE]
proof (prove)
using this:
path g

goal (2 subgoals):
 1. continuous_on {0..1} fI
 2. 0 < 1
[PROOF STEP]
unfolding fI_def path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. Im (g t - z))
 2. 0 < 1
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous (at_left 1) fI

goal (1 subgoal):
 1. (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous (at_left 1) fI
[PROOF STEP]
show "(fI \<longlongrightarrow> fI 1) (at_left 1)"
[PROOF STATE]
proof (prove)
using this:
continuous (at_left 1) fI

goal (1 subgoal):
 1. (fI \<longlongrightarrow> fI 1) (at_left 1)
[PROOF STEP]
by (simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
(fI \<longlongrightarrow> fI 1) (at_left 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have fR: "(fR \<longlongrightarrow> 0) (at_right 0)" "(fR \<longlongrightarrow> 0) (at_left 1)" when "Re (g 0) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_right 0) &&& (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (fR \<longlongrightarrow> 0) (at_right 0)
 2. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
have "continuous (at_right 0) fR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_right 0) fR
[PROOF STEP]
apply (rule continuous_on_at_right[of _ 1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..1} fR
 2. 0 < 1
[PROOF STEP]
using \<open>path g\<close>
[PROOF STATE]
proof (prove)
using this:
path g

goal (2 subgoals):
 1. continuous_on {0..1} fR
 2. 0 < 1
[PROOF STEP]
unfolding fR_def path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. Re (g t - z))
 2. 0 < 1
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous (at_right 0) fR

goal (2 subgoals):
 1. (fR \<longlongrightarrow> 0) (at_right 0)
 2. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous (at_right 0) fR
[PROOF STEP]
show "(fR \<longlongrightarrow> 0) (at_right 0)"
[PROOF STATE]
proof (prove)
using this:
continuous (at_right 0) fR

goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
continuous (at_right 0) fR
Re (g 0) = Re z

goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
unfolding fR_def
[PROOF STATE]
proof (prove)
using this:
continuous (at_right 0) (\<lambda>t. Re (g t - z))
Re (g 0) = Re z

goal (1 subgoal):
 1. ((\<lambda>t. Re (g t - z)) \<longlongrightarrow> 0) (at_right 0)
[PROOF STEP]
by (simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
(fR \<longlongrightarrow> 0) (at_right 0)

goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
have "continuous (at_left 1) fR"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_left 1) fR
[PROOF STEP]
apply (rule continuous_on_at_left[of 0])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..1} fR
 2. 0 < 1
[PROOF STEP]
using \<open>path g\<close>
[PROOF STATE]
proof (prove)
using this:
path g

goal (2 subgoals):
 1. continuous_on {0..1} fR
 2. 0 < 1
[PROOF STEP]
unfolding fR_def path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>t. Re (g t - z))
 2. 0 < 1
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous (at_left 1) fR

goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous (at_left 1) fR
[PROOF STEP]
show "(fR \<longlongrightarrow> 0) (at_left 1)"
[PROOF STATE]
proof (prove)
using this:
continuous (at_left 1) fR

goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
using that loop
[PROOF STATE]
proof (prove)
using this:
continuous (at_left 1) fR
Re (g 0) = Re z
pathfinish g = pathstart g

goal (1 subgoal):
 1. (fR \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
unfolding fR_def path_defs
[PROOF STATE]
proof (prove)
using this:
continuous (at_left 1) (\<lambda>t. Re (g t - z))
Re (g 0) = Re z
g 1 = g 0

goal (1 subgoal):
 1. ((\<lambda>t. Re (g t - z)) \<longlongrightarrow> 0) (at_left 1)
[PROOF STEP]
by (simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
(fR \<longlongrightarrow> 0) (at_left 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g 0) = Re z \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_right 0)
Re (g 0) = Re z \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1)

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "(\<forall>t\<in>{0<..<1}. Re (g t) > Re z) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)) \<Longrightarrow> False
[PROOF STEP]
assume " \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z))"
[PROOF STATE]
proof (state)
this:
\<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z))

goal (1 subgoal):
 1. \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z))
[PROOF STEP]
obtain t1 t2 where t:"t1\<in>{0<..<1}" "t2\<in>{0<..<1}" "Re (g t1)\<le>Re z" "Re (g t2)\<ge>Re z"
[PROOF STATE]
proof (prove)
using this:
\<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z))

goal (1 subgoal):
 1. (\<And>t1 t2. \<lbrakk>t1 \<in> {0<..<1}; t2 \<in> {0<..<1}; Re (g t1) \<le> Re z; Re z \<le> Re (g t2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
\<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z))

goal (1 subgoal):
 1. (\<And>t1 t2. \<lbrakk>t1 \<in> {0<..<1}; t2 \<in> {0<..<1}; Re (g t1) \<le> Re z; Re z \<le> Re (g t2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)) \<Longrightarrow> False
[PROOF STEP]
have False when "t1\<le>t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "continuous_on {t1..t2} (\<lambda>t. Re (g t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {t1..t2} (\<lambda>t. Re (g t))
[PROOF STEP]
using valid_path_imp_path[OF \<open>valid_path g\<close>] t
[PROOF STATE]
proof (prove)
using this:
path g
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. continuous_on {t1..t2} (\<lambda>t. Re (g t))
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. continuous_on {t1..t2} (\<lambda>t. Re (g t))
[PROOF STEP]
by (metis (full_types) atLeastatMost_subset_iff continuous_on_Re continuous_on_subset
            eucl_less_le_not_le greaterThanLessThan_iff)
[PROOF STATE]
proof (state)
this:
continuous_on {t1..t2} (\<lambda>t. Re (g t))

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {t1..t2} (\<lambda>t. Re (g t))
[PROOF STEP]
obtain t' where t':"t'\<ge>t1" "t'\<le>t2" "Re (g t') = Re z"
[PROOF STATE]
proof (prove)
using this:
continuous_on {t1..t2} (\<lambda>t. Re (g t))

goal (1 subgoal):
 1. (\<And>t'. \<lbrakk>t1 \<le> t'; t' \<le> t2; Re (g t') = Re z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  IVT'[of "\<lambda>t. Re (g t)" t1 _ t2] t \<open>t1\<le>t2\<close>
[PROOF STATE]
proof (prove)
using this:
continuous_on {t1..t2} (\<lambda>t. Re (g t))
\<lbrakk>Re (g t1) \<le> ?y; ?y \<le> Re (g t2); t1 \<le> t2; continuous_on {t1..t2} (\<lambda>t. Re (g t))\<rbrakk> \<Longrightarrow> \<exists>x\<ge>t1. x \<le> t2 \<and> Re (g x) = ?y
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)
t1 \<le> t2

goal (1 subgoal):
 1. (\<And>t'. \<lbrakk>t1 \<le> t'; t' \<le> t2; Re (g t') = Re z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t1 \<le> t'
t' \<le> t2
Re (g t') = Re z

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t1 \<le> t'
t' \<le> t2
Re (g t') = Re z
[PROOF STEP]
have "t'\<in>{0<..<1}"
[PROOF STATE]
proof (prove)
using this:
t1 \<le> t'
t' \<le> t2
Re (g t') = Re z

goal (1 subgoal):
 1. t' \<in> {0<..<1}
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t1 \<le> t'
t' \<le> t2
Re (g t') = Re z
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. t' \<in> {0<..<1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t' \<in> {0<..<1}

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t' \<in> {0<..<1}
[PROOF STEP]
have "Re (g t') \<noteq> Re z"
[PROOF STATE]
proof (prove)
using this:
t' \<in> {0<..<1}

goal (1 subgoal):
 1. Re (g t') \<noteq> Re z
[PROOF STEP]
using Re_neq \<open>s=0\<close>
[PROOF STATE]
proof (prove)
using this:
t' \<in> {0<..<1}
\<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z
s = 0

goal (1 subgoal):
 1. Re (g t') \<noteq> Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re (g t') \<noteq> Re z

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g t') \<noteq> Re z
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Re (g t') \<noteq> Re z

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>Re (g t') = Re z\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g t') \<noteq> Re z
Re (g t') = Re z

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
t1 \<le> t2 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
t1 \<le> t2 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)) \<Longrightarrow> False
[PROOF STEP]
have False when "t1\<ge>t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "continuous_on {t2..t1} (\<lambda>t. Re (g t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {t2..t1} (\<lambda>t. Re (g t))
[PROOF STEP]
using valid_path_imp_path[OF \<open>valid_path g\<close>] t
[PROOF STATE]
proof (prove)
using this:
path g
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. continuous_on {t2..t1} (\<lambda>t. Re (g t))
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. continuous_on {t2..t1} (\<lambda>t. Re (g t))
[PROOF STEP]
by (metis (full_types) atLeastatMost_subset_iff continuous_on_Re continuous_on_subset
            eucl_less_le_not_le greaterThanLessThan_iff)
[PROOF STATE]
proof (state)
this:
continuous_on {t2..t1} (\<lambda>t. Re (g t))

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {t2..t1} (\<lambda>t. Re (g t))
[PROOF STEP]
obtain t' where t':"t'\<le>t1" "t'\<ge>t2" "Re (g t') = Re z"
[PROOF STATE]
proof (prove)
using this:
continuous_on {t2..t1} (\<lambda>t. Re (g t))

goal (1 subgoal):
 1. (\<And>t'. \<lbrakk>t' \<le> t1; t2 \<le> t'; Re (g t') = Re z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using  IVT2'[of "\<lambda>t. Re (g t)" t1 _ t2] t \<open>t1\<ge>t2\<close>
[PROOF STATE]
proof (prove)
using this:
continuous_on {t2..t1} (\<lambda>t. Re (g t))
\<lbrakk>Re (g t1) \<le> ?y; ?y \<le> Re (g t2); t2 \<le> t1; continuous_on {t2..t1} (\<lambda>t. Re (g t))\<rbrakk> \<Longrightarrow> \<exists>x\<ge>t2. x \<le> t1 \<and> Re (g x) = ?y
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)
t2 \<le> t1

goal (1 subgoal):
 1. (\<And>t'. \<lbrakk>t' \<le> t1; t2 \<le> t'; Re (g t') = Re z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t' \<le> t1
t2 \<le> t'
Re (g t') = Re z

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t' \<le> t1
t2 \<le> t'
Re (g t') = Re z
[PROOF STEP]
have "t'\<in>{0<..<1}"
[PROOF STATE]
proof (prove)
using this:
t' \<le> t1
t2 \<le> t'
Re (g t') = Re z

goal (1 subgoal):
 1. t' \<in> {0<..<1}
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t' \<le> t1
t2 \<le> t'
Re (g t') = Re z
t1 \<in> {0<..<1}
t2 \<in> {0<..<1}
Re (g t1) \<le> Re z
Re z \<le> Re (g t2)

goal (1 subgoal):
 1. t' \<in> {0<..<1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t' \<in> {0<..<1}

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t' \<in> {0<..<1}
[PROOF STEP]
have "Re (g t') \<noteq> Re z"
[PROOF STATE]
proof (prove)
using this:
t' \<in> {0<..<1}

goal (1 subgoal):
 1. Re (g t') \<noteq> Re z
[PROOF STEP]
using Re_neq \<open>s=0\<close>
[PROOF STATE]
proof (prove)
using this:
t' \<in> {0<..<1}
\<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z
s = 0

goal (1 subgoal):
 1. Re (g t') \<noteq> Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re (g t') \<noteq> Re z

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g t') \<noteq> Re z
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Re (g t') \<noteq> Re z

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>Re (g t') = Re z\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g t') \<noteq> Re z
Re (g t') = Re z

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
t2 \<le> t1 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> ((\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
t1 \<le> t2 \<Longrightarrow> False
t2 \<le> t1 \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
t1 \<le> t2 \<Longrightarrow> False
t2 \<le> t1 \<Longrightarrow> False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have ?thesis when Re_pos:"\<forall>t\<in>{0<..<1}. Re (g t) > Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "Re (winding_number g z) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number g z) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Re (winding_number g z) = 0
[PROOF STEP]
have "\<forall>p\<in>path_image g. Re z \<le> Re p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>path_image g. Re z \<le> Re p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re z \<le> Re p
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re z \<le> Re p
[PROOF STEP]
assume "p \<in> path_image g"
[PROOF STATE]
proof (state)
this:
p \<in> path_image g

goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re z \<le> Re p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> path_image g
[PROOF STEP]
obtain t where "0\<le>t" "t\<le>1" "p = g t"
[PROOF STATE]
proof (prove)
using this:
p \<in> path_image g

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; p = g t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
p \<in> g ` {0..1}

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; p = g t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> t
t \<le> 1
p = g t

goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re z \<le> Re p
[PROOF STEP]
have "Re z \<le> Re (g t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re z \<le> Re (g t)
[PROOF STEP]
apply (rule continuous_ge_on_closure[of "{0<..<1}" "\<lambda>t. Re (g t)" t "Re z",simplified])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on {0..1} (\<lambda>x. Re (g x))
 2. 0 \<le> t \<and> t \<le> 1
 3. \<And>x. 0 < x \<and> x < 1 \<Longrightarrow> Re z \<le> Re (g x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. Re (g x))
[PROOF STEP]
using valid_path_imp_path[OF \<open>valid_path g\<close>,unfolded path_def]
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. Re (g x))
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> t \<and> t \<le> 1
 2. \<And>x. 0 < x \<and> x < 1 \<Longrightarrow> Re z \<le> Re (g x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> 1
[PROOF STEP]
using \<open>0\<le>t\<close> \<open>t\<le>1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> t
t \<le> 1

goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < x \<and> x < 1 \<Longrightarrow> Re z \<le> Re (g x)
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<and> x < 1 \<Longrightarrow> Re z \<le> Re (g x)
[PROOF STEP]
using that[rule_format,of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1} \<Longrightarrow> Re z < Re (g x)

goal (1 subgoal):
 1. 0 < x \<and> x < 1 \<Longrightarrow> Re z \<le> Re (g x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Re z \<le> Re (g t)

goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re z \<le> Re p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re z \<le> Re (g t)
[PROOF STEP]
show "Re z \<le> Re p"
[PROOF STATE]
proof (prove)
using this:
Re z \<le> Re (g t)

goal (1 subgoal):
 1. Re z \<le> Re p
[PROOF STEP]
using \<open>p = g t\<close>
[PROOF STATE]
proof (prove)
using this:
Re z \<le> Re (g t)
p = g t

goal (1 subgoal):
 1. Re z \<le> Re p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re z \<le> Re p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>path_image g. Re z \<le> Re p

goal (1 subgoal):
 1. Re (winding_number g z) = 0
[PROOF STEP]
from Re_winding_number_half_right[OF this \<open>valid_path g\<close> \<open>z\<notin>path_image g\<close>] loop
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number g z) = (Im (Ln (pathfinish g - z)) - Im (Ln (pathstart g - z))) / (2 * pi)
pathfinish g = pathstart g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (winding_number g z) = (Im (Ln (pathfinish g - z)) - Im (Ln (pathstart g - z))) / (2 * pi)
pathfinish g = pathstart g

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (winding_number g z) = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (winding_number g z) = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "cindex_pathE g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
have "cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
[PROOF STEP]
using index_ends[OF _ \<open>valid_path g\<close>] Re_neq \<open>s=0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re (g t) \<noteq> Re z \<Longrightarrow> cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
\<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z
s = 0

goal (1 subgoal):
 1. cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
have "jumpF_pathstart g z = jumpF_pathfinish g z" when "Re (g 0) \<noteq> Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathstart g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = 0
[PROOF STEP]
using jumpF_pathstart_eq_0[OF \<open>path g\<close>] that
[PROOF STATE]
proof (prove)
using this:
Re (pathstart g) \<noteq> Re ?z \<Longrightarrow> jumpF_pathstart g ?z = 0
Re (g 0) \<noteq> Re z

goal (1 subgoal):
 1. jumpF_pathstart g z = 0
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
Re (g 0) \<noteq> Re ?z \<Longrightarrow> jumpF_pathstart g ?z = 0
Re (g 0) \<noteq> Re z

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

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathfinish g z=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 0
[PROOF STEP]
using jumpF_pathfinish_eq_0[OF \<open>path g\<close>] that loop
[PROOF STATE]
proof (prove)
using this:
Re (pathfinish g) \<noteq> Re ?z \<Longrightarrow> jumpF_pathfinish g ?z = 0
Re (g 0) \<noteq> Re z
pathfinish g = pathstart g

goal (1 subgoal):
 1. jumpF_pathfinish g z = 0
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
Re (g 1) \<noteq> Re ?z \<Longrightarrow> jumpF_pathfinish g ?z = 0
Re (g 0) \<noteq> Re z
g 1 = g 0

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

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart g z = 0
jumpF_pathfinish g z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart g z = 0
jumpF_pathfinish g z = 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
have "jumpF_pathstart g z = jumpF_pathfinish g z" when "Re (g 0) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have [simp]:"(fR has_sgnx 1) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fR has_sgnx 1) (at_right 0)
[PROOF STEP]
unfolding fR_def has_sgnx_def eventually_at_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b>0. \<forall>y>0. y < b \<longrightarrow> sgn (Re (g y - z)) = 1
[PROOF STEP]
apply (rule exI[where x=1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = 1)
[PROOF STEP]
using Re_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re z < Re (g t)

goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fR has_sgnx 1) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have [simp]:"(fR has_sgnx 1) (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fR has_sgnx 1) (at_left 1)
[PROOF STEP]
unfolding fR_def has_sgnx_def eventually_at_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b<1. \<forall>y>b. y < 1 \<longrightarrow> sgn (Re (g y - z)) = 1
[PROOF STEP]
apply (rule exI[where x=0])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = 1)
[PROOF STEP]
using Re_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re z < Re (g t)

goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fR has_sgnx 1) (at_left 1)

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "fI 0\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fI 0 \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> fI 0 \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> fI 0 \<noteq> 0"
[PROOF STATE]
proof (state)
this:
\<not> fI 0 \<noteq> 0

goal (1 subgoal):
 1. \<not> fI 0 \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> fI 0 \<noteq> 0
[PROOF STEP]
have "g 0 =z"
[PROOF STATE]
proof (prove)
using this:
\<not> fI 0 \<noteq> 0

goal (1 subgoal):
 1. g 0 = z
[PROOF STEP]
using \<open>Re (g 0) = Re z\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> fI 0 \<noteq> 0
Re (g 0) = Re z

goal (1 subgoal):
 1. g 0 = z
[PROOF STEP]
unfolding fI_def
[PROOF STATE]
proof (prove)
using this:
\<not> Im (g 0 - z) \<noteq> 0
Re (g 0) = Re z

goal (1 subgoal):
 1. g 0 = z
[PROOF STEP]
by (simp add: complex.expand)
[PROOF STATE]
proof (state)
this:
g 0 = z

goal (1 subgoal):
 1. \<not> fI 0 \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g 0 = z
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
g 0 = z

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>z \<notin> path_image g\<close>
[PROOF STATE]
proof (prove)
using this:
g 0 = z
z \<notin> path_image g

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
g 0 = z
z \<notin> g ` {0..1}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fI 0 \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fI 0 \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have ?thesis when "fI 0>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathstart g z = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
have "(LIM x at_right 0. fI x / fR x :> at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_right 0. fI x / fR x :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 0"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx sgn (fI 0)) (at_right 0)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < fI 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx sgn (fI 0)) (at_right 0)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. fI x / fR x :> at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
unfolding jumpF_pathstart_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. Im (g x - z) / Re (g x - z) :> at_top

goal (1 subgoal):
 1. (if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathfinish g z = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
have "fI 1>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < fI 1
[PROOF STEP]
using loop that
[PROOF STATE]
proof (prove)
using this:
pathfinish g = pathstart g
0 < fI 0

goal (1 subgoal):
 1. 0 < fI 1
[PROOF STEP]
unfolding path_defs fI_def
[PROOF STATE]
proof (prove)
using this:
g 1 = g 0
0 < Im (g 0 - z)

goal (1 subgoal):
 1. 0 < Im (g 1 - z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < fI 1

goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < fI 1
[PROOF STEP]
have "(LIM x at_left 1. fI x / fR x :> at_top)"
[PROOF STATE]
proof (prove)
using this:
0 < fI 1

goal (1 subgoal):
 1. LIM x at_left 1. fI x / fR x :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 1"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < fI 1 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. 0 < fI 1 \<Longrightarrow> fI 1 \<noteq> 0
 3. 0 < fI 1 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx sgn (fI 1)) (at_left 1)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < fI 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. 0 < fI 1 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. 0 < fI 1 \<Longrightarrow> fI 1 \<noteq> 0
 3. 0 < fI 1 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx sgn (fI 1)) (at_left 1)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_left 1. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_left 1. fI x / fR x :> at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
unfolding jumpF_pathfinish_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. Im (g x - z) / Re (g x - z) :> at_top

goal (1 subgoal):
 1. (if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart g z = 1 / 2
jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart g z = 1 / 2
jumpF_pathfinish g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have ?thesis when "fI 0<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathstart g z = - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
have "(LIM x at_right 0. fI x / fR x :> at_bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_right 0. fI x / fR x :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 0"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx - sgn (fI 0)) (at_right 0)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
fI 0 < 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx - sgn (fI 0)) (at_right 0)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. fI x / fR x :> at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
unfolding jumpF_pathstart_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. Im (g x - z) / Re (g x - z) :> at_bot

goal (1 subgoal):
 1. (if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = - 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathfinish g z = - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
have "fI 1<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fI 1 < 0
[PROOF STEP]
using loop that
[PROOF STATE]
proof (prove)
using this:
pathfinish g = pathstart g
fI 0 < 0

goal (1 subgoal):
 1. fI 1 < 0
[PROOF STEP]
unfolding path_defs fI_def
[PROOF STATE]
proof (prove)
using this:
g 1 = g 0
Im (g 0 - z) < 0

goal (1 subgoal):
 1. Im (g 1 - z) < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fI 1 < 0

goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fI 1 < 0
[PROOF STEP]
have "(LIM x at_left 1. fI x / fR x :> at_bot)"
[PROOF STATE]
proof (prove)
using this:
fI 1 < 0

goal (1 subgoal):
 1. LIM x at_left 1. fI x / fR x :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 1"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. fI 1 < 0 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. fI 1 < 0 \<Longrightarrow> fI 1 \<noteq> 0
 3. fI 1 < 0 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx - sgn (fI 1)) (at_left 1)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
fI 0 < 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. fI 1 < 0 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. fI 1 < 0 \<Longrightarrow> fI 1 \<noteq> 0
 3. fI 1 < 0 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx - sgn (fI 1)) (at_left 1)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_left 1. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_left 1. fI x / fR x :> at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
unfolding jumpF_pathfinish_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. Im (g x - z) / Re (g x - z) :> at_bot

goal (1 subgoal):
 1. (if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = - 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart g z = - 1 / 2
jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart g z = - 1 / 2
jumpF_pathfinish g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fI 0 < 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fI 0 \<noteq> 0
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
fI 0 < 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fI 0 \<noteq> 0
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
fI 0 < 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g 0) = Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
Re (g 0) = Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
Re (g 0) = Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE g z = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number g z) = 0
cindex_pathE g z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (winding_number g z) = 0
cindex_pathE g z = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>{0<..<1}. Re z < Re (g t) \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>{0<..<1}. Re z < Re (g t) \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have ?thesis when Re_neg:"\<forall>t\<in>{0<..<1}. Re (g t) < Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "Re (winding_number g z) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number g z) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Re (winding_number g z) = 0
[PROOF STEP]
have "\<forall>p\<in>path_image g. Re z \<ge> Re p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>path_image g. Re p \<le> Re z
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re p \<le> Re z
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re p \<le> Re z
[PROOF STEP]
assume "p \<in> path_image g"
[PROOF STATE]
proof (state)
this:
p \<in> path_image g

goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re p \<le> Re z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> path_image g
[PROOF STEP]
obtain t where "0\<le>t" "t\<le>1" "p = g t"
[PROOF STATE]
proof (prove)
using this:
p \<in> path_image g

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; p = g t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
p \<in> g ` {0..1}

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>0 \<le> t; t \<le> 1; p = g t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> t
t \<le> 1
p = g t

goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re p \<le> Re z
[PROOF STEP]
have "Re z \<ge> Re (g t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g t) \<le> Re z
[PROOF STEP]
apply (rule continuous_le_on_closure[of "{0<..<1}" "\<lambda>t. Re (g t)" t "Re z",simplified])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on {0..1} (\<lambda>x. Re (g x))
 2. 0 \<le> t \<and> t \<le> 1
 3. \<And>x. 0 < x \<and> x < 1 \<Longrightarrow> Re (g x) \<le> Re z
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. Re (g x))
[PROOF STEP]
using valid_path_imp_path[OF \<open>valid_path g\<close>,unfolded path_def]
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. Re (g x))
[PROOF STEP]
by (auto intro:continuous_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<le> t \<and> t \<le> 1
 2. \<And>x. 0 < x \<and> x < 1 \<Longrightarrow> Re (g x) \<le> Re z
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> 1
[PROOF STEP]
using \<open>0\<le>t\<close> \<open>t\<le>1\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> t
t \<le> 1

goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < x \<and> x < 1 \<Longrightarrow> Re (g x) \<le> Re z
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<and> x < 1 \<Longrightarrow> Re (g x) \<le> Re z
[PROOF STEP]
using that[rule_format,of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1} \<Longrightarrow> Re (g x) < Re z

goal (1 subgoal):
 1. 0 < x \<and> x < 1 \<Longrightarrow> Re (g x) \<le> Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Re (g t) \<le> Re z

goal (1 subgoal):
 1. \<And>p. p \<in> path_image g \<Longrightarrow> Re p \<le> Re z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g t) \<le> Re z
[PROOF STEP]
show "Re z \<ge> Re p"
[PROOF STATE]
proof (prove)
using this:
Re (g t) \<le> Re z

goal (1 subgoal):
 1. Re p \<le> Re z
[PROOF STEP]
using \<open>p = g t\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g t) \<le> Re z
p = g t

goal (1 subgoal):
 1. Re p \<le> Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re p \<le> Re z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>path_image g. Re p \<le> Re z

goal (1 subgoal):
 1. Re (winding_number g z) = 0
[PROOF STEP]
from Re_winding_number_half_left[OF this \<open>valid_path g\<close> \<open>z\<notin>path_image g\<close>] loop
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number g z) = (Im (Ln (z - pathfinish g)) - Im (Ln (z - pathstart g))) / (2 * pi)
pathfinish g = pathstart g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (winding_number g z) = (Im (Ln (z - pathfinish g)) - Im (Ln (z - pathstart g))) / (2 * pi)
pathfinish g = pathstart g

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (winding_number g z) = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (winding_number g z) = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "cindex_pathE g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
have "cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
[PROOF STEP]
using index_ends[OF _ \<open>valid_path g\<close>] Re_neq \<open>s=0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re (g t) \<noteq> Re z \<Longrightarrow> cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
\<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z
s = 0

goal (1 subgoal):
 1. cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
have "jumpF_pathstart g z = jumpF_pathfinish g z" when "Re (g 0) \<noteq> Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathstart g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = 0
[PROOF STEP]
using jumpF_pathstart_eq_0[OF \<open>path g\<close>] that
[PROOF STATE]
proof (prove)
using this:
Re (pathstart g) \<noteq> Re ?z \<Longrightarrow> jumpF_pathstart g ?z = 0
Re (g 0) \<noteq> Re z

goal (1 subgoal):
 1. jumpF_pathstart g z = 0
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
Re (g 0) \<noteq> Re ?z \<Longrightarrow> jumpF_pathstart g ?z = 0
Re (g 0) \<noteq> Re z

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

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathfinish g z=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 0
[PROOF STEP]
using jumpF_pathfinish_eq_0[OF \<open>path g\<close>] that loop
[PROOF STATE]
proof (prove)
using this:
Re (pathfinish g) \<noteq> Re ?z \<Longrightarrow> jumpF_pathfinish g ?z = 0
Re (g 0) \<noteq> Re z
pathfinish g = pathstart g

goal (1 subgoal):
 1. jumpF_pathfinish g z = 0
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
Re (g 1) \<noteq> Re ?z \<Longrightarrow> jumpF_pathfinish g ?z = 0
Re (g 0) \<noteq> Re z
g 1 = g 0

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

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart g z = 0
jumpF_pathfinish g z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart g z = 0
jumpF_pathfinish g z = 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
have "jumpF_pathstart g z = jumpF_pathfinish g z" when "Re (g 0) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have [simp]:"(fR has_sgnx - 1) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fR has_sgnx - 1) (at_right 0)
[PROOF STEP]
unfolding fR_def has_sgnx_def eventually_at_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b>0. \<forall>y>0. y < b \<longrightarrow> sgn (Re (g y - z)) = - 1
[PROOF STEP]
apply (rule exI[where x=1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = - 1)
[PROOF STEP]
using Re_neg
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re (g t) < Re z

goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fR has_sgnx - 1) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have [simp]:"(fR has_sgnx - 1) (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fR has_sgnx - 1) (at_left 1)
[PROOF STEP]
unfolding fR_def has_sgnx_def eventually_at_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b<1. \<forall>y>b. y < 1 \<longrightarrow> sgn (Re (g y - z)) = - 1
[PROOF STEP]
apply (rule exI[where x=0])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = - 1)
[PROOF STEP]
using Re_neg
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>{0<..<1}. Re (g t) < Re z

goal (1 subgoal):
 1. 0 < 1 \<and> (\<forall>y>0. y < 1 \<longrightarrow> sgn (Re (g y - z)) = - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(fR has_sgnx - 1) (at_left 1)

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "fI 0\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fI 0 \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> fI 0 \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> fI 0 \<noteq> 0"
[PROOF STATE]
proof (state)
this:
\<not> fI 0 \<noteq> 0

goal (1 subgoal):
 1. \<not> fI 0 \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> fI 0 \<noteq> 0
[PROOF STEP]
have "g 0 =z"
[PROOF STATE]
proof (prove)
using this:
\<not> fI 0 \<noteq> 0

goal (1 subgoal):
 1. g 0 = z
[PROOF STEP]
using \<open>Re (g 0) = Re z\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> fI 0 \<noteq> 0
Re (g 0) = Re z

goal (1 subgoal):
 1. g 0 = z
[PROOF STEP]
unfolding fI_def
[PROOF STATE]
proof (prove)
using this:
\<not> Im (g 0 - z) \<noteq> 0
Re (g 0) = Re z

goal (1 subgoal):
 1. g 0 = z
[PROOF STEP]
by (simp add: complex.expand)
[PROOF STATE]
proof (state)
this:
g 0 = z

goal (1 subgoal):
 1. \<not> fI 0 \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g 0 = z
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
g 0 = z

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>z \<notin> path_image g\<close>
[PROOF STATE]
proof (prove)
using this:
g 0 = z
z \<notin> path_image g

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
g 0 = z
z \<notin> g ` {0..1}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fI 0 \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fI 0 \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have ?thesis when "fI 0>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathstart g z = - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
have "(LIM x at_right 0. fI x / fR x :> at_bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_right 0. fI x / fR x :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 0"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx - sgn (fI 0)) (at_right 0)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < fI 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx - sgn (fI 0)) (at_right 0)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. fI x / fR x :> at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart g z = - 1 / 2
[PROOF STEP]
unfolding jumpF_pathstart_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. Im (g x - z) / Re (g x - z) :> at_bot

goal (1 subgoal):
 1. (if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = - 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathfinish g z = - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
have "fI 1>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < fI 1
[PROOF STEP]
using loop that
[PROOF STATE]
proof (prove)
using this:
pathfinish g = pathstart g
0 < fI 0

goal (1 subgoal):
 1. 0 < fI 1
[PROOF STEP]
unfolding path_defs fI_def
[PROOF STATE]
proof (prove)
using this:
g 1 = g 0
0 < Im (g 0 - z)

goal (1 subgoal):
 1. 0 < Im (g 1 - z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < fI 1

goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < fI 1
[PROOF STEP]
have "(LIM x at_left 1. fI x / fR x :> at_bot)"
[PROOF STATE]
proof (prove)
using this:
0 < fI 1

goal (1 subgoal):
 1. LIM x at_left 1. fI x / fR x :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 1"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 < fI 1 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. 0 < fI 1 \<Longrightarrow> fI 1 \<noteq> 0
 3. 0 < fI 1 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx - sgn (fI 1)) (at_left 1)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
0 < fI 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. 0 < fI 1 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. 0 < fI 1 \<Longrightarrow> fI 1 \<noteq> 0
 3. 0 < fI 1 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx - sgn (fI 1)) (at_left 1)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_left 1. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_left 1. fI x / fR x :> at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. fI x / fR x :> at_bot

goal (1 subgoal):
 1. jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
unfolding jumpF_pathfinish_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. Im (g x - z) / Re (g x - z) :> at_bot

goal (1 subgoal):
 1. (if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = - 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart g z = - 1 / 2
jumpF_pathfinish g z = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart g z = - 1 / 2
jumpF_pathfinish g z = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have ?thesis when "fI 0<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathstart g z = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
have "(LIM x at_right 0. fI x / fR x :> at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_right 0. fI x / fR x :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 0"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx sgn (fI 0)) (at_right 0)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
fI 0 < 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. (fI \<longlongrightarrow> fI 0) (at_right 0)
 2. fI 0 \<noteq> 0
 3. (fR \<longlongrightarrow> 0) (at_right 0) \<and> (fR has_sgnx sgn (fI 0)) (at_right 0)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_right 0. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right 0. fI x / fR x :> at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathstart g z = 1 / 2
[PROOF STEP]
unfolding jumpF_pathstart_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right 0. Im (g x - z) / Re (g x - z) :> at_top

goal (1 subgoal):
 1. (if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_right 0. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
have "jumpF_pathfinish g z = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
have "fI 1<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fI 1 < 0
[PROOF STEP]
using loop that
[PROOF STATE]
proof (prove)
using this:
pathfinish g = pathstart g
fI 0 < 0

goal (1 subgoal):
 1. fI 1 < 0
[PROOF STEP]
unfolding path_defs fI_def
[PROOF STATE]
proof (prove)
using this:
g 1 = g 0
Im (g 0 - z) < 0

goal (1 subgoal):
 1. Im (g 1 - z) < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fI 1 < 0

goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fI 1 < 0
[PROOF STEP]
have "(LIM x at_left 1. fI x / fR x :> at_top)"
[PROOF STATE]
proof (prove)
using this:
fI 1 < 0

goal (1 subgoal):
 1. LIM x at_left 1. fI x / fR x :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "fI 1"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. fI 1 < 0 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. fI 1 < 0 \<Longrightarrow> fI 1 \<noteq> 0
 3. fI 1 < 0 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx sgn (fI 1)) (at_left 1)
[PROOF STEP]
using that fI fR[OF \<open>Re (g 0) = Re z\<close>]
[PROOF STATE]
proof (prove)
using this:
fI 0 < 0
(fI \<longlongrightarrow> fI 0) (at_right 0)
(fI \<longlongrightarrow> fI 1) (at_left 1)
(fR \<longlongrightarrow> 0) (at_right 0)
(fR \<longlongrightarrow> 0) (at_left 1)

goal (3 subgoals):
 1. fI 1 < 0 \<Longrightarrow> (fI \<longlongrightarrow> fI 1) (at_left 1)
 2. fI 1 < 0 \<Longrightarrow> fI 1 \<noteq> 0
 3. fI 1 < 0 \<Longrightarrow> (fR \<longlongrightarrow> 0) (at_left 1) \<and> (fR has_sgnx sgn (fI 1)) (at_left 1)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LIM x at_left 1. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_left 1. fI x / fR x :> at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. fI x / fR x :> at_top

goal (1 subgoal):
 1. jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
unfolding jumpF_pathfinish_def fI_def fR_def jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 1. Im (g x - z) / Re (g x - z) :> at_top

goal (1 subgoal):
 1. (if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_top then 1 / 2 else if LIM t at_left 1. Im (g t - z) / Re (g t - z) :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart g z = 1 / 2
jumpF_pathfinish g z = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart g z = 1 / 2
jumpF_pathfinish g z = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fI 0 < 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fI 0 \<noteq> 0
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
fI 0 < 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fI 0 \<noteq> 0
0 < fI 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
fI 0 < 0 \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
jumpF_pathstart g z = jumpF_pathfinish g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g 0) = Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

goal (1 subgoal):
 1. cindex_pathE g z = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
Re (g 0) = Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE g z = jumpF_pathstart g z - jumpF_pathfinish g z
Re (g 0) \<noteq> Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z
Re (g 0) = Re z \<Longrightarrow> jumpF_pathstart g z = jumpF_pathfinish g z

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE g z = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number g z) = 0
cindex_pathE g z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (winding_number g z) = 0
cindex_pathE g z = 0

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>{0<..<1}. Re (g t) < Re z \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)
\<forall>t\<in>{0<..<1}. Re z < Re (g t) \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
\<forall>t\<in>{0<..<1}. Re (g t) < Re z \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>t\<in>{0<..<1}. Re z < Re (g t)) \<or> (\<forall>t\<in>{0<..<1}. Re (g t) < Re z)
\<forall>t\<in>{0<..<1}. Re z < Re (g t) \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
\<forall>t\<in>{0<..<1}. Re (g t) < Re z \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
s = 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
s = 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
have ?goal when "s\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "Re (g s) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g s) = Re z
[PROOF STEP]
using \<open>s = 0 \<or> Re (g s) = Re z\<close> that
[PROOF STATE]
proof (prove)
using this:
s = 0 \<or> Re (g s) = Re z
s \<noteq> 0

goal (1 subgoal):
 1. Re (g s) = Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Re (g s) = Re z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
define g' where "g' = shiftpath s g"
[PROOF STATE]
proof (state)
this:
g' = shiftpath s g

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "2 * Re (winding_number g' z) = - cindex_pathE g' z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number g' z) = - cindex_pathE g' z
[PROOF STEP]
proof (rule winding_number_cindex_pathE_aux)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. finite_ReZ_segments g' z
 2. valid_path g'
 3. z \<notin> path_image g'
 4. Re (g' 1) = Re z
 5. Re (g' 0) = Re z
[PROOF STEP]
show "Re (g' 1) = Re z" "Re (g' 0) = Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g' 1) = Re z &&& Re (g' 0) = Re z
[PROOF STEP]
using \<open>Re (g s) = Re z\<close> \<open>s\<in>{0..<1}\<close> \<open>s\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g s) = Re z
s \<in> {0..<1}
s \<noteq> 0

goal (1 subgoal):
 1. Re (g' 1) = Re z &&& Re (g' 0) = Re z
[PROOF STEP]
unfolding g'_def shiftpath_def
[PROOF STATE]
proof (prove)
using this:
Re (g s) = Re z
s \<in> {0..<1}
s \<noteq> 0

goal (1 subgoal):
 1. Re (if s + 1 \<le> 1 then g (s + 1) else g (s + 1 - 1)) = Re z &&& Re (if s + 0 \<le> 1 then g (s + 0) else g (s + 0 - 1)) = Re z
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
Re (g' 1) = Re z
Re (g' 0) = Re z

goal (3 subgoals):
 1. finite_ReZ_segments g' z
 2. valid_path g'
 3. z \<notin> path_image g'
[PROOF STEP]
show "valid_path g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path g'
[PROOF STEP]
using valid_path_shiftpath[OF \<open>valid_path g\<close> loop,of s,folded g'_def] \<open>s\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..1} \<Longrightarrow> valid_path g'
s \<in> {0..<1}

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

goal (2 subgoals):
 1. finite_ReZ_segments g' z
 2. z \<notin> path_image g'
[PROOF STEP]
show "z \<notin> path_image g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image g'
[PROOF STEP]
using \<open>s \<in> {0..<1}\<close> assms(3) g'_def loop path_image_shiftpath
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..<1}
z \<notin> path_image g
g' = shiftpath s g
pathfinish g = pathstart g
\<lbrakk>?a \<in> {0..1}; pathfinish ?g = pathstart ?g\<rbrakk> \<Longrightarrow> path_image (shiftpath ?a ?g) = path_image ?g

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

goal (1 subgoal):
 1. finite_ReZ_segments g' z
[PROOF STEP]
show "finite_ReZ_segments g' z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments g' z
[PROOF STEP]
using finite_ReZ_segments_shiftpah[OF \<open>finite_ReZ_segments g z\<close> _ \<open>path g\<close> loop] \<open>s\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
?s \<in> {0..1} \<Longrightarrow> finite_ReZ_segments (shiftpath ?s g) z
s \<in> {0..<1}

goal (1 subgoal):
 1. finite_ReZ_segments g' z
[PROOF STEP]
unfolding g'_def
[PROOF STATE]
proof (prove)
using this:
?s \<in> {0..1} \<Longrightarrow> finite_ReZ_segments (shiftpath ?s g) z
s \<in> {0..<1}

goal (1 subgoal):
 1. finite_ReZ_segments (shiftpath s g) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite_ReZ_segments g' z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g' z) = - cindex_pathE g' z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g' z) = - cindex_pathE g' z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "winding_number g' z = winding_number g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number g' z = winding_number g z
[PROOF STEP]
unfolding g'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (shiftpath s g) z = winding_number g z
[PROOF STEP]
apply (rule winding_number_shiftpath[OF \<open>path g\<close> \<open>z \<notin> path_image g\<close> loop])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> {0..1}
[PROOF STEP]
using \<open>s\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..<1}

goal (1 subgoal):
 1. s \<in> {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
winding_number g' z = winding_number g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
winding_number g' z = winding_number g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have "cindex_pathE g' z = cindex_pathE g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE g' z = cindex_pathE g z
[PROOF STEP]
unfolding g'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
apply (rule cindex_pathE_shiftpath[OF \<open>finite_ReZ_segments g z\<close> _ \<open>path g\<close> loop])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> {0..1}
[PROOF STEP]
using \<open>s\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..<1}

goal (1 subgoal):
 1. s \<in> {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE g' z = cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 * Re (winding_number g' z) = - cindex_pathE g' z
winding_number g' z = winding_number g z
cindex_pathE g' z = cindex_pathE g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * Re (winding_number g' z) = - cindex_pathE g' z
winding_number g' z = winding_number g z
cindex_pathE g' z = cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
s \<noteq> 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
s = 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
s \<noteq> 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
have ?goal
[PROOF STATE]
proof (prove)
using this:
s = 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z
s \<noteq> 0 \<Longrightarrow> 2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. 2 * Re (winding_number g z) = - cindex_pathE g z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g z) = - cindex_pathE g z

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
have "winding_number g z \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number g z \<in> \<int>
[PROOF STEP]
using integer_winding_number[OF _ loop \<open>z\<notin>path_image g\<close>] valid_path_imp_path[OF \<open>valid_path g\<close>]
[PROOF STATE]
proof (prove)
using this:
path g \<Longrightarrow> winding_number g z \<in> \<int>
path g

goal (1 subgoal):
 1. winding_number g z \<in> \<int>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
winding_number g z \<in> \<int>

goal (1 subgoal):
 1. \<And>s. \<lbrakk>s \<in> {0..<1}; s = 0 \<or> Re (g s) = Re z; \<forall>t\<in>{s<..<1}. Re (g t) \<noteq> Re z; finite_ReZ_segments (subpath 0 s g) z\<rbrakk> \<Longrightarrow> winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 * Re (winding_number g z) = - cindex_pathE g z
winding_number g z \<in> \<int>
[PROOF STEP]
show "winding_number g z = - cindex_pathE g z / 2"
[PROOF STATE]
proof (prove)
using this:
2 * Re (winding_number g z) = - cindex_pathE g z
winding_number g z \<in> \<int>

goal (1 subgoal):
 1. winding_number g z = complex_of_real (- cindex_pathE g z / 2)
[PROOF STEP]
by (metis add.right_neutral complex_eq complex_is_Int_iff mult_zero_right
        nonzero_mult_div_cancel_left of_real_0 zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
winding_number g z = complex_of_real (- cindex_pathE g z / 2)

goal:
No subgoals!
[PROOF STEP]
qed