[STATEMENT]
lemma Re_winding_number_poly_linepth:
  fixes pp::"complex poly"
  defines "g \<equiv> (\<lambda>r. poly pp o linepath (-r) (of_real r))"
  assumes "lead_coeff pp=1" and no_real_zero:"\<forall>x\<in>proots pp. Im x\<noteq>0"
  shows "((\<lambda>r. 2*Re (winding_number (g r) 0) + cindex_pathE (g r) 0 ) \<longlongrightarrow> 0 ) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
define p where "p=map_poly Re pp"
[PROOF STATE]
proof (state)
this:
p = map_poly Re pp

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
define q where "q=map_poly Im pp"
[PROOF STATE]
proof (state)
this:
q = map_poly Im pp

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
define f where "f=(\<lambda>t. poly q t / poly p t)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. poly q t / poly p t)

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have sgnx_top:"sgnx (poly p) at_top = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) at_top = 1
[PROOF STEP]
unfolding sgnx_poly_at_top sgn_pos_inf_def p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (lead_coeff (map_poly Re pp)) = 1
[PROOF STEP]
using \<open>lead_coeff pp=1\<close>
[PROOF STATE]
proof (prove)
using this:
monic pp

goal (1 subgoal):
 1. sgn (lead_coeff (map_poly Re pp)) = 1
[PROOF STEP]
by (subst lead_coeff_map_poly_nz,auto)
[PROOF STATE]
proof (state)
this:
sgnx (poly p) at_top = 1

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have not_g_image:"0 \<notin> path_image (g r)" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image (g r)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<notin> path_image (g r) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> 0 \<notin> path_image (g r)"
[PROOF STATE]
proof (state)
this:
\<not> 0 \<notin> path_image (g r)

goal (1 subgoal):
 1. \<not> 0 \<notin> path_image (g r) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 \<notin> path_image (g r)
[PROOF STEP]
obtain x where "poly pp x=0" "x\<in>closed_segment (- of_real r) (of_real r)"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<notin> path_image (g r)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>poly pp x = 0; x \<in> closed_segment (- complex_of_real r) (complex_of_real r)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding g_def path_image_compose of_real_linepath
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<notin> poly pp ` path_image (linepath (complex_of_real (- r)) (complex_of_real (of_real r)))

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>poly pp x = 0; x \<in> closed_segment (- complex_of_real r) (complex_of_real r)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly pp x = 0
x \<in> closed_segment (- complex_of_real r) (complex_of_real r)

goal (1 subgoal):
 1. \<not> 0 \<notin> path_image (g r) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly pp x = 0
x \<in> closed_segment (- complex_of_real r) (complex_of_real r)
[PROOF STEP]
have "Im x=0" "x\<in>proots pp"
[PROOF STATE]
proof (prove)
using this:
poly pp x = 0
x \<in> closed_segment (- complex_of_real r) (complex_of_real r)

goal (1 subgoal):
 1. Im x = 0 &&& x \<in> proots pp
[PROOF STEP]
using closed_segment_imp_Re_Im(2)
[PROOF STATE]
proof (prove)
using this:
poly pp x = 0
x \<in> closed_segment (- complex_of_real r) (complex_of_real r)
\<lbrakk>?x \<in> closed_segment ?lb ?ub; Im ?lb \<le> Im ?ub\<rbrakk> \<Longrightarrow> Im ?lb \<le> Im ?x \<and> Im ?x \<le> Im ?ub

goal (1 subgoal):
 1. Im x = 0 &&& x \<in> proots pp
[PROOF STEP]
unfolding proots_def
[PROOF STATE]
proof (prove)
using this:
poly pp x = 0
x \<in> closed_segment (- complex_of_real r) (complex_of_real r)
\<lbrakk>?x \<in> closed_segment ?lb ?ub; Im ?lb \<le> Im ?ub\<rbrakk> \<Longrightarrow> Im ?lb \<le> Im ?x \<and> Im ?x \<le> Im ?ub

goal (1 subgoal):
 1. Im x = 0 &&& x \<in> {x. poly pp x = 0}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
Im x = 0
x \<in> proots pp

goal (1 subgoal):
 1. \<not> 0 \<notin> path_image (g r) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Im x = 0
x \<in> proots pp
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
Im x = 0
x \<in> proots pp

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>\<forall>x\<in>proots pp. Im x\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
Im x = 0
x \<in> proots pp
\<forall>x\<in>proots pp. Im x \<noteq> 0

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:
0 \<notin> path_image (g ?r)

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have arctan_f_tendsto:"((\<lambda>r. (arctan (f r) -  arctan (f (-r))) / pi) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
proof (cases "degree p>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
 2. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < degree p

goal (2 subgoals):
 1. 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
 2. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have "degree p>degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
have "degree p=degree pp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p = degree pp
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly Re pp) = degree pp
[PROOF STEP]
using \<open>lead_coeff pp=1\<close>
[PROOF STATE]
proof (prove)
using this:
monic pp

goal (1 subgoal):
 1. degree (map_poly Re pp) = degree pp
[PROOF STEP]
by (auto intro:map_poly_degree_eq)
[PROOF STATE]
proof (state)
this:
degree p = degree pp

goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree p = degree pp

goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree p = degree pp
[PROOF STEP]
have "degree q<degree pp"
[PROOF STATE]
proof (prove)
using this:
degree p = degree pp

goal (1 subgoal):
 1. degree q < degree pp
[PROOF STEP]
unfolding q_def
[PROOF STATE]
proof (prove)
using this:
degree p = degree pp

goal (1 subgoal):
 1. degree (map_poly Im pp) < degree pp
[PROOF STEP]
using \<open>lead_coeff pp=1\<close> True
[PROOF STATE]
proof (prove)
using this:
degree p = degree pp
monic pp
0 < degree p

goal (1 subgoal):
 1. degree (map_poly Im pp) < degree pp
[PROOF STEP]
by (auto intro!:map_poly_degree_less)
[PROOF STATE]
proof (state)
this:
degree q < degree pp

goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree p = degree pp
degree q < degree pp
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree p = degree pp
degree q < degree pp

goal (1 subgoal):
 1. degree q < degree p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree q < degree p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree q < degree p

goal (2 subgoals):
 1. 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
 2. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree q < degree p
[PROOF STEP]
have "(f \<longlongrightarrow> 0) at_infinity"
[PROOF STATE]
proof (prove)
using this:
degree q < degree p

goal (1 subgoal):
 1. (f \<longlongrightarrow> 0) at_infinity
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
degree q < degree p

goal (1 subgoal):
 1. ((\<lambda>t. poly q t / poly p t) \<longlongrightarrow> 0) at_infinity
[PROOF STEP]
using poly_divide_tendsto_0_at_infinity
[PROOF STATE]
proof (prove)
using this:
degree q < degree p
degree ?q < degree ?p \<Longrightarrow> ((\<lambda>x. poly ?q x / poly ?p x) \<longlongrightarrow> (0::?'a)) at_infinity

goal (1 subgoal):
 1. ((\<lambda>t. poly q t / poly p t) \<longlongrightarrow> 0) at_infinity
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> 0) at_infinity

goal (2 subgoals):
 1. 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
 2. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> 0) at_infinity
[PROOF STEP]
have "(f \<longlongrightarrow> 0) at_bot" "(f \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> 0) at_infinity

goal (1 subgoal):
 1. (f \<longlongrightarrow> 0) at_bot &&& (f \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (auto elim!:filterlim_mono simp add:at_top_le_at_infinity at_bot_le_at_infinity)
[PROOF STATE]
proof (state)
this:
(f \<longlongrightarrow> 0) at_bot
(f \<longlongrightarrow> 0) at_top

goal (2 subgoals):
 1. 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
 2. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> 0) at_bot
(f \<longlongrightarrow> 0) at_top
[PROOF STEP]
have "((\<lambda>r. arctan (f r))\<longlongrightarrow> 0) at_top" "((\<lambda>r. arctan (f (-r)))\<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> 0) at_bot
(f \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. arctan (f r)) \<longlongrightarrow> 0) at_top &&& ((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(f \<longlongrightarrow> 0) at_bot; (f \<longlongrightarrow> 0) at_top\<rbrakk> \<Longrightarrow> ((\<lambda>r. arctan (f r)) \<longlongrightarrow> 0) at_top
 2. \<lbrakk>(f \<longlongrightarrow> 0) at_bot; (f \<longlongrightarrow> 0) at_top\<rbrakk> \<Longrightarrow> ((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> 0) at_bot; (f \<longlongrightarrow> 0) at_top\<rbrakk> \<Longrightarrow> ((\<lambda>r. arctan (f r)) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (auto intro:tendsto_eq_intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> 0) at_bot; (f \<longlongrightarrow> 0) at_top\<rbrakk> \<Longrightarrow> ((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> 0) at_bot; (f \<longlongrightarrow> 0) at_top\<rbrakk> \<Longrightarrow> ((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top
[PROOF STEP]
apply (subst tendsto_compose_filtermap[of _ uminus,unfolded comp_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> 0) at_bot; (f \<longlongrightarrow> 0) at_top\<rbrakk> \<Longrightarrow> ((\<lambda>a. arctan (f a)) \<longlongrightarrow> 0) (filtermap uminus at_top)
[PROOF STEP]
by (auto intro:tendsto_eq_intros simp add:at_bot_mirror[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((\<lambda>r. arctan (f r)) \<longlongrightarrow> 0) at_top
((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top

goal (2 subgoals):
 1. 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
 2. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>r. arctan (f r)) \<longlongrightarrow> 0) at_top
((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>r. arctan (f r)) \<longlongrightarrow> 0) at_top
((\<lambda>r. arctan (f (- r))) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (auto intro:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < degree p

goal (1 subgoal):
 1. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
obtain c where "f=(\<lambda>r. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "degree p=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p = 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < degree p

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

goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree p = 0

goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "degree q\<le>degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
have "degree p=degree pp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p = degree pp
[PROOF STEP]
unfolding p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly Re pp) = degree pp
[PROOF STEP]
using \<open>lead_coeff pp=1\<close>
[PROOF STATE]
proof (prove)
using this:
monic pp

goal (1 subgoal):
 1. degree (map_poly Re pp) = degree pp
[PROOF STEP]
by (auto intro:map_poly_degree_eq)
[PROOF STATE]
proof (state)
this:
degree p = degree pp

goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree p = degree pp

goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
have "degree q\<le>degree pp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree q \<le> degree pp
[PROOF STEP]
unfolding q_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly Im pp) \<le> degree pp
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree q \<le> degree pp

goal (1 subgoal):
 1. degree q \<le> degree p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree p = degree pp
degree q \<le> degree pp
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree p = degree pp
degree q \<le> degree pp

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
degree q \<le> degree p

goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree p = 0
degree q \<le> degree p
[PROOF STEP]
have "degree q=0"
[PROOF STATE]
proof (prove)
using this:
degree p = 0
degree q \<le> degree p

goal (1 subgoal):
 1. degree q = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree q = 0

goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree q = 0
[PROOF STEP]
obtain pa qa where "p=[:pa:]" "q=[:qa:]"
[PROOF STATE]
proof (prove)
using this:
degree q = 0

goal (1 subgoal):
 1. (\<And>pa qa. \<lbrakk>p = [:pa:]; q = [:qa:]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>degree p=0\<close>
[PROOF STATE]
proof (prove)
using this:
degree q = 0
degree p = 0

goal (1 subgoal):
 1. (\<And>pa qa. \<lbrakk>p = [:pa:]; q = [:qa:]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson degree_eq_zeroE)
[PROOF STATE]
proof (state)
this:
p = [:pa:]
q = [:qa:]

goal (1 subgoal):
 1. (\<And>c. f = (\<lambda>r. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:pa:]
q = [:qa:]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = [:pa:]
q = [:qa:]

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
p = [:pa:]
q = [:qa:]
f = (\<lambda>r. ?c) \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
p = [:pa:]
q = [:qa:]
(\<lambda>t. poly q t / poly p t) = (\<lambda>r. ?c) \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f = (\<lambda>r. c)

goal (1 subgoal):
 1. \<not> 0 < degree p \<Longrightarrow> ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f = (\<lambda>r. c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>r. c)

goal (1 subgoal):
 1. ((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have [simp]:"valid_path (g r)" "path (g r)" "finite_ReZ_segments (g r) 0" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (g r) &&& path (g r) &&& finite_ReZ_segments (g r) 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. valid_path (g r)
 2. path (g r)
 3. finite_ReZ_segments (g r) 0
[PROOF STEP]
show "valid_path (g r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (g r)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (poly pp \<circ> (\<lambda>x. complex_of_real (linepath (- r) (of_real r) x)))
[PROOF STEP]
apply (rule valid_path_compose_holomorphic[where S=UNIV])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. valid_path (\<lambda>x. complex_of_real (linepath (- r) (of_real r) x))
 2. poly pp holomorphic_on UNIV
 3. open UNIV
 4. path_image (\<lambda>x. complex_of_real (linepath (- r) (of_real r) x)) \<subseteq> UNIV
[PROOF STEP]
by (auto simp add:of_real_linepath)
[PROOF STATE]
proof (state)
this:
valid_path (g r)

goal (2 subgoals):
 1. path (g r)
 2. finite_ReZ_segments (g r) 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
valid_path (g r)
[PROOF STEP]
show "path (g r)"
[PROOF STATE]
proof (prove)
using this:
valid_path (g r)

goal (1 subgoal):
 1. path (g r)
[PROOF STEP]
using valid_path_imp_path
[PROOF STATE]
proof (prove)
using this:
valid_path (g r)
valid_path ?g \<Longrightarrow> path ?g

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

goal (1 subgoal):
 1. finite_ReZ_segments (g r) 0
[PROOF STEP]
show "finite_ReZ_segments (g r) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (g r) 0
[PROOF STEP]
unfolding g_def of_real_linepath
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (poly pp \<circ> linepath (complex_of_real (- r)) (complex_of_real (of_real r))) 0
[PROOF STEP]
using finite_ReZ_segments_poly_linepath
[PROOF STATE]
proof (prove)
using this:
finite_ReZ_segments (poly ?p \<circ> linepath ?a ?b) ?z

goal (1 subgoal):
 1. finite_ReZ_segments (poly pp \<circ> linepath (complex_of_real (- r)) (complex_of_real (of_real r))) 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite_ReZ_segments (g r) 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
valid_path (g ?r)
path (g ?r)
finite_ReZ_segments (g ?r) 0

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have g_f_eq:"Im (g r t) / Re (g r t) = (f o (\<lambda>x. 2*r*x - r)) t" for r t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
have "Im (g r t) / Re (g r t) = Im ((poly pp o of_real o (\<lambda>x. 2*r*x - r)) t)
        / Re ((poly pp o of_real o (\<lambda>x. 2*r*x - r)) t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = Im ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) / Re ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t)
[PROOF STEP]
unfolding g_def linepath_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (poly pp (complex_of_real ((1 - t) *\<^sub>R - r + t *\<^sub>R of_real r))) / Re (poly pp (complex_of_real ((1 - t) *\<^sub>R - r + t *\<^sub>R of_real r))) = Im (poly pp (complex_of_real (2 * r * t - r))) / Re (poly pp (complex_of_real (2 * r * t - r)))
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
Im (g r t) / Re (g r t) = Im ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) / Re ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t)

goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Im (g r t) / Re (g r t) = Im ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) / Re ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t)

goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
have "... = (f o (\<lambda>x. 2*r*x - r)) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) / Re ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (poly pp (complex_of_real (2 * r * t - r))) / Re (poly pp (complex_of_real (2 * r * t - r))) = f (2 * r * t - r)
[PROOF STEP]
by (simp only:Im_poly_of_real diff_0_right Re_poly_of_real f_def q_def p_def)
[PROOF STATE]
proof (state)
this:
Im ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) / Re ((poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t

goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t

goal (1 subgoal):
 1. Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Im (g r t) / Re (g r t) = (f \<circ> (\<lambda>x. 2 * r * x - r)) t

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Im (g ?r ?t) / Re (g ?r ?t) = (f \<circ> (\<lambda>x. 2 * ?r * x - ?r)) ?t

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have ?thesis when "proots p={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have "\<forall>\<^sub>Fr in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0
        = (arctan (f r) -  arctan (f (-r))) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
proof (rule eventually_at_top_linorderI[of 1])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
fix r::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
assume "r\<ge>1"
[PROOF STATE]
proof (state)
this:
1 \<le> r

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have image_pos:"\<forall>p\<in>path_image (g r).  0<Re p "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>path_image (g r). 0 < Re p
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>p\<in>path_image (g r). 0 < Re p) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>p\<in>path_image (g r). 0 < Re p)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>p\<in>path_image (g r). 0 < Re p)

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

goal (1 subgoal):
 1. (\<And>t. poly p t \<le> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding g_def path_image_compose of_real_linepath p_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>p\<in>poly pp ` path_image (linepath (complex_of_real (- r)) (complex_of_real (of_real r))). 0 < Re p)

goal (1 subgoal):
 1. (\<And>t. poly (map_poly Re pp) t \<le> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Re_poly_of_real
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>p\<in>poly pp ` path_image (linepath (complex_of_real (- r)) (complex_of_real (of_real r))). 0 < Re p)
Re (poly ?p (complex_of_real ?x)) = poly (map_poly Re ?p) ?x

goal (1 subgoal):
 1. (\<And>t. poly (map_poly Re pp) t \<le> 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
apply (simp add:closed_segment_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>t. poly (map_poly Re pp) t \<le> 0 \<Longrightarrow> thesis; \<exists>p. (\<exists>u. p = u *\<^sub>R complex_of_real r - (1 - u) *\<^sub>R complex_of_real r \<and> 0 \<le> u \<and> u \<le> 1) \<and> \<not> 0 < Re (poly pp p); \<And>p x. Re (poly p (complex_of_real x)) = poly (map_poly Re p) x\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (metis not_less of_real_def real_vector.scale_scale scaleR_left_diff_distrib)
[PROOF STATE]
proof (state)
this:
poly p t \<le> 0

goal (1 subgoal):
 1. \<not> (\<forall>p\<in>path_image (g r). 0 < Re p) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly p t \<le> 0

goal (1 subgoal):
 1. \<not> (\<forall>p\<in>path_image (g r). 0 < Re p) \<Longrightarrow> False
[PROOF STEP]
have False when "poly p t<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "sgnx (poly p) (at_right t) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgnx (poly p) (at_right t) = - 1
[PROOF STEP]
using sgnx_poly_nz that
[PROOF STATE]
proof (prove)
using this:
poly ?p ?x \<noteq> 0 \<Longrightarrow> sgnx (poly ?p) (at_left ?x) = sgn (poly ?p ?x)
poly ?p ?x \<noteq> 0 \<Longrightarrow> sgnx (poly ?p) (at_right ?x) = sgn (poly ?p ?x)
poly p t < 0

goal (1 subgoal):
 1. sgnx (poly p) (at_right t) = - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sgnx (poly p) (at_right t) = - 1

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sgnx (poly p) (at_right t) = - 1
[PROOF STEP]
obtain x where "x>t" "poly p x = 0"
[PROOF STATE]
proof (prove)
using this:
sgnx (poly p) (at_right t) = - 1

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>t < x; poly p x = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using sgnx_at_top_IVT[of p t] sgnx_top
[PROOF STATE]
proof (prove)
using this:
sgnx (poly p) (at_right t) = - 1
sgnx (poly p) (at_right t) \<noteq> sgnx (poly p) at_top \<Longrightarrow> \<exists>x>t. poly p x = 0
sgnx (poly p) at_top = 1

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

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t < x
poly p x = 0
[PROOF STEP]
have "x\<in>proots p"
[PROOF STATE]
proof (prove)
using this:
t < x
poly p x = 0

goal (1 subgoal):
 1. x \<in> proots p
[PROOF STEP]
unfolding proots_def
[PROOF STATE]
proof (prove)
using this:
t < x
poly p x = 0

goal (1 subgoal):
 1. x \<in> {x. poly p x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> proots p

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> proots p
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<in> proots p

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>proots p={}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> proots p
proots p = {}

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:
poly p t < 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> (\<forall>p\<in>path_image (g r). 0 < Re p) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly p t < 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> (\<forall>p\<in>path_image (g r). 0 < Re p) \<Longrightarrow> False
[PROOF STEP]
have False when "poly p t=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>proots p={}\<close> that
[PROOF STATE]
proof (prove)
using this:
proots p = {}
poly p t = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding proots_def
[PROOF STATE]
proof (prove)
using this:
{x. poly p x = 0} = {}
poly p t = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly p t = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> (\<forall>p\<in>path_image (g r). 0 < Re p) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poly p t \<le> 0
poly p t < 0 \<Longrightarrow> False
poly p t = 0 \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
poly p t \<le> 0
poly p t < 0 \<Longrightarrow> False
poly p t = 0 \<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>p\<in>path_image (g r). 0 < Re p

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "Re (winding_number (g r) 0) = (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r))))
          / (2 * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number (g r) 0) = (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi)
[PROOF STEP]
apply (rule Re_winding_number_half_right[of "g r" 0,simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>p\<in>path_image (g r). 0 \<le> Re p
 2. 0 \<notin> path_image (g r)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>path_image (g r). 0 \<le> Re p
[PROOF STEP]
using image_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>path_image (g r). 0 < Re p

goal (1 subgoal):
 1. \<forall>p\<in>path_image (g r). 0 \<le> Re p
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image (g r)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image (g r)
[PROOF STEP]
by (auto simp add:not_g_image)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Re (winding_number (g r) 0) = (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi)

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (winding_number (g r) 0) = (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi)

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "... = (arctan (f r) - arctan (f (-r)))/(2*pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
have "Im (Ln (pathfinish (g r))) = arctan (f r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
have "Re (pathfinish (g r)) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (pathfinish (g r))
[PROOF STEP]
by (auto intro: image_pos[rule_format])
[PROOF STATE]
proof (state)
this:
0 < Re (pathfinish (g r))

goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < Re (pathfinish (g r))
[PROOF STEP]
have "Im (Ln (pathfinish (g r)))
              = arctan (Im (pathfinish (g r)) / Re (pathfinish (g r)))"
[PROOF STATE]
proof (prove)
using this:
0 < Re (pathfinish (g r))

goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (Im (pathfinish (g r)) / Re (pathfinish (g r)))
[PROOF STEP]
by (subst Im_Ln_eq,auto)
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish (g r))) = arctan (Im (pathfinish (g r)) / Re (pathfinish (g r)))

goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish (g r))) = arctan (Im (pathfinish (g r)) / Re (pathfinish (g r)))

goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
have "... = arctan (f r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (Im (pathfinish (g r)) / Re (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (Im (g r 1) / Re (g r 1)) = arctan (f r)
[PROOF STEP]
by (subst g_f_eq,auto)
[PROOF STATE]
proof (state)
this:
arctan (Im (pathfinish (g r)) / Re (pathfinish (g r))) = arctan (f r)

goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathfinish (g r))) = arctan (f r)

goal (1 subgoal):
 1. Im (Ln (pathfinish (g r))) = arctan (f r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish (g r))) = arctan (f r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish (g r))) = arctan (f r)

goal (1 subgoal):
 1. (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish (g r))) = arctan (f r)

goal (1 subgoal):
 1. (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
have "Im (Ln (pathstart (g r))) = arctan (f (-r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
have "Re (pathstart (g r)) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (pathstart (g r))
[PROOF STEP]
by (auto intro: image_pos[rule_format])
[PROOF STATE]
proof (state)
this:
0 < Re (pathstart (g r))

goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < Re (pathstart (g r))
[PROOF STEP]
have "Im (Ln (pathstart (g r)))
              = arctan (Im (pathstart (g r)) / Re (pathstart (g r)))"
[PROOF STATE]
proof (prove)
using this:
0 < Re (pathstart (g r))

goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (Im (pathstart (g r)) / Re (pathstart (g r)))
[PROOF STEP]
by (subst Im_Ln_eq,auto)
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart (g r))) = arctan (Im (pathstart (g r)) / Re (pathstart (g r)))

goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart (g r))) = arctan (Im (pathstart (g r)) / Re (pathstart (g r)))

goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
have "... = arctan (f (-r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (Im (pathstart (g r)) / Re (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (Im (g r 0) / Re (g r 0)) = arctan (f (- r))
[PROOF STEP]
by (subst g_f_eq,auto)
[PROOF STATE]
proof (state)
this:
arctan (Im (pathstart (g r)) / Re (pathstart (g r))) = arctan (f (- r))

goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathstart (g r))) = arctan (f (- r))

goal (1 subgoal):
 1. Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart (g r))) = arctan (f (- r))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart (g r))) = arctan (f (- r))

goal (1 subgoal):
 1. (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathfinish (g r))) = arctan (f r)
Im (Ln (pathstart (g r))) = arctan (f (- r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathfinish (g r))) = arctan (f r)
Im (Ln (pathstart (g r))) = arctan (f (- r))

goal (1 subgoal):
 1. (Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Im (Ln (pathfinish (g r))) - Im (Ln (pathstart (g r)))) / (2 * pi) = (arctan (f r) - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
have "Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (-r)))/(2*pi)"
[PROOF STATE]
proof (prove)
using this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "cindex_pathE (g r) 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
have "cindex_pathE (g r) 0 = cindex_pathE (poly pp o of_real o (\<lambda>x. 2*r*x - r)) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (g r) 0 = cindex_pathE (poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) 0
[PROOF STEP]
unfolding g_def linepath_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (\<lambda>x. poly pp (complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) 0 = cindex_pathE (\<lambda>x. poly pp (complex_of_real (2 * r * x - r))) 0
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE (g r) 0 = cindex_pathE (poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) 0

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (g r) 0 = cindex_pathE (poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) 0

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
have "... = cindexE 0 1 (f o (\<lambda>x. 2*r*x - r)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) 0 = cindexE 0 1 (f \<circ> (\<lambda>x. 2 * r * x - r))
[PROOF STEP]
unfolding cindex_pathE_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (poly pp (complex_of_real (2 * r * t - r)) - 0) / Re (poly pp (complex_of_real (2 * r * t - r)) - 0)) = cindexE 0 1 (\<lambda>x. f (2 * r * x - r))
[PROOF STEP]
by (simp only:Im_poly_of_real diff_0_right Re_poly_of_real f_def q_def p_def)
[PROOF STATE]
proof (state)
this:
cindex_pathE (poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) 0 = cindexE 0 1 (f \<circ> (\<lambda>x. 2 * r * x - r))

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (poly pp \<circ> complex_of_real \<circ> (\<lambda>x. 2 * r * x - r)) 0 = cindexE 0 1 (f \<circ> (\<lambda>x. 2 * r * x - r))

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
have "... = cindexE (-r) r f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. 2 * r * x - r)) = cindexE (- r) r f
[PROOF STEP]
apply (subst cindexE_linear_comp[of "2*r" 0 1 _ "-r",simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. r \<noteq> 0
 2. (if 0 < r then cindexE (2 * r * 0 + - r) (2 * r * 1 + - r) f else - cindexE (2 * r * 1 + - r) (2 * r * 0 + - r) f) = cindexE (- r) r f
[PROOF STEP]
using \<open>r\<ge>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 \<le> r

goal (2 subgoals):
 1. r \<noteq> 0
 2. (if 0 < r then cindexE (2 * r * 0 + - r) (2 * r * 1 + - r) f else - cindexE (2 * r * 1 + - r) (2 * r * 0 + - r) f) = cindexE (- r) r f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. 2 * r * x - r)) = cindexE (- r) r f

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. 2 * r * x - r)) = cindexE (- r) r f

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (- r) r f = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE (- r) r f = 0
[PROOF STEP]
have "jumpF f (at_left x) =0" "jumpF f (at_right x) = 0" when "x\<in>{-r..r}" 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 "poly p x\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p x \<noteq> 0
[PROOF STEP]
using \<open>proots p={}\<close>
[PROOF STATE]
proof (prove)
using this:
proots p = {}

goal (1 subgoal):
 1. poly p x \<noteq> 0
[PROOF STEP]
unfolding proots_def
[PROOF STATE]
proof (prove)
using this:
{x. poly p x = 0} = {}

goal (1 subgoal):
 1. poly p x \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly p x \<noteq> 0

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:
poly p x \<noteq> 0
[PROOF STEP]
show "jumpF f (at_left x) =0" "jumpF f (at_right x) = 0"
[PROOF STATE]
proof (prove)
using this:
poly p x \<noteq> 0

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

goal (1 subgoal):
 1. jumpF (\<lambda>t. poly q t / poly p t) (at_left x) = 0 &&& jumpF (\<lambda>t. poly q t / poly p t) (at_right x) = 0
[PROOF STEP]
by (auto intro!: jumpF_not_infinity continuous_intros)
[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> {- r..r} \<Longrightarrow> jumpF f (at_left ?x) = 0
?x \<in> {- r..r} \<Longrightarrow> jumpF f (at_right ?x) = 0

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

goal (1 subgoal):
 1. cindexE (- r) r f = 0
[PROOF STEP]
unfolding cindexE_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> {- r..r} \<Longrightarrow> jumpF f (at_left ?x) = 0
?x \<in> {- r..r} \<Longrightarrow> jumpF f (at_right ?x) = 0

goal (1 subgoal):
 1. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> - r \<le> x \<and> x < r. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> - r < x \<and> x \<le> r. jumpF f (at_left x)) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE (- r) r f = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE (- r) r f = 0

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (g r) 0 = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (g r) 0 = 0

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

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

goal (1 subgoal):
 1. \<And>x. 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
cindex_pathE (g r) 0 = 0
[PROOF STEP]
show "2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0
          = (arctan (f r) -  arctan (f (-r))) / pi"
[PROOF STATE]
proof (prove)
using this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
cindex_pathE (g r) 0 = 0

goal (1 subgoal):
 1. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
Re (winding_number (g r) 0) = (arctan (f r) - arctan (f (- r))) / (2 * pi)
cindex_pathE (g r) 0 = 0

goal (1 subgoal):
 1. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
with arctan_f_tendsto
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
\<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
\<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (auto dest:tendsto_cong)
[PROOF STATE]
proof (state)
this:
((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proots p = {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
proots p = {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have ?thesis when "proots p\<noteq>{}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
define max_r where "max_r=Max (proots p)"
[PROOF STATE]
proof (state)
this:
max_r = Max (proots p)

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
define min_r where "min_r=Min (proots p)"
[PROOF STATE]
proof (state)
this:
min_r = Min (proots p)

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have "max_r \<in>proots p" "min_r \<in>proots p" "min_r\<le>max_r" and
      min_max_bound:"\<forall>p\<in>proots p. p\<in>{min_r..max_r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (max_r \<in> proots p &&& min_r \<in> proots p &&& min_r \<le> max_r) &&& \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. max_r \<in> proots p
 2. min_r \<in> proots p
 3. min_r \<le> max_r
 4. \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
have "p\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
have "(0::real) \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<noteq> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<noteq> 1

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<noteq> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<noteq> 1

goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by (metis (full_types) \<open>p \<equiv> map_poly Re pp\<close> assms(2) coeff_0 coeff_map_poly one_complex.simps(1) zero_complex.sel(1))
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

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

goal (4 subgoals):
 1. max_r \<in> proots p
 2. min_r \<in> proots p
 3. min_r \<le> max_r
 4. \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
have "finite (proots p)"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

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

goal (4 subgoals):
 1. max_r \<in> proots p
 2. min_r \<in> proots p
 3. min_r \<le> max_r
 4. \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (proots p)
[PROOF STEP]
show "max_r \<in>proots p" "min_r \<in>proots p"
[PROOF STATE]
proof (prove)
using this:
finite (proots p)

goal (1 subgoal):
 1. max_r \<in> proots p &&& min_r \<in> proots p
[PROOF STEP]
using Min_in Max_in that
[PROOF STATE]
proof (prove)
using this:
finite (proots p)
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max ?A \<in> ?A
proots p \<noteq> {}

goal (1 subgoal):
 1. max_r \<in> proots p &&& min_r \<in> proots p
[PROOF STEP]
unfolding max_r_def min_r_def
[PROOF STATE]
proof (prove)
using this:
finite (proots p)
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max ?A \<in> ?A
proots p \<noteq> {}

goal (1 subgoal):
 1. Max (proots p) \<in> proots p &&& Min (proots p) \<in> proots p
[PROOF STEP]
by fast+
[PROOF STATE]
proof (state)
this:
max_r \<in> proots p
min_r \<in> proots p

goal (2 subgoals):
 1. min_r \<le> max_r
 2. \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
max_r \<in> proots p
min_r \<in> proots p
[PROOF STEP]
show "\<forall>p\<in>proots p. p\<in>{min_r..max_r}"
[PROOF STATE]
proof (prove)
using this:
max_r \<in> proots p
min_r \<in> proots p

goal (1 subgoal):
 1. \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
using Min_le Max_ge \<open>finite (proots p)\<close>
[PROOF STATE]
proof (prove)
using this:
max_r \<in> proots p
min_r \<in> proots p
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> Min ?A \<le> ?x
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?x \<le> Max ?A
finite (proots p)

goal (1 subgoal):
 1. \<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
unfolding max_r_def min_r_def
[PROOF STATE]
proof (prove)
using this:
Max (proots p) \<in> proots p
Min (proots p) \<in> proots p
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> Min ?A \<le> ?x
\<lbrakk>finite ?A; ?x \<in> ?A\<rbrakk> \<Longrightarrow> ?x \<le> Max ?A
finite (proots p)

goal (1 subgoal):
 1. \<forall>pa\<in>proots p. pa \<in> {Min (proots p)..Max (proots p)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>proots p. p \<in> {min_r..max_r}

goal (1 subgoal):
 1. min_r \<le> max_r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>p\<in>proots p. p \<in> {min_r..max_r}
[PROOF STEP]
show "min_r\<le>max_r"
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>proots p. p \<in> {min_r..max_r}

goal (1 subgoal):
 1. min_r \<le> max_r
[PROOF STEP]
using \<open>max_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>proots p. p \<in> {min_r..max_r}
max_r \<in> proots p

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
max_r \<in> proots p
min_r \<in> proots p
min_r \<le> max_r
\<forall>p\<in>proots p. p \<in> {min_r..max_r}

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have "\<forall>\<^sub>Fr in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0
        = (arctan (f r) -  arctan (f (-r))) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
proof (rule eventually_at_top_linorderI[of "max (norm max_r) (norm min_r) + 1"])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
assume r_asm:"max (norm max_r) (norm min_r) + 1 \<le> r"
[PROOF STATE]
proof (state)
this:
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
max (norm max_r) (norm min_r) + 1 \<le> r
[PROOF STEP]
have "r\<noteq>0" "min_r>-r" "max_r<r"
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. r \<noteq> 0 &&& - r < min_r &&& max_r < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r \<noteq> 0
- r < min_r
max_r < r

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
define u where "u=(min_r + r)/(2*r)"
[PROOF STATE]
proof (state)
this:
u = (min_r + r) / (2 * r)

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
define v where "v=(max_r + r)/(2*r)"
[PROOF STATE]
proof (state)
this:
v = (max_r + r) / (2 * r)

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have uv:"u\<in>{0..1}" "v\<in>{0..1}" "u\<le>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> {0..1} &&& v \<in> {0..1} &&& u \<le> v
[PROOF STEP]
unfolding u_def v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (min_r + r) / (2 * r) \<in> {0..1} &&& (max_r + r) / (2 * r) \<in> {0..1} &&& (min_r + r) / (2 * r) \<le> (max_r + r) / (2 * r)
[PROOF STEP]
using r_asm  \<open>min_r\<le>max_r\<close>
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r
min_r \<le> max_r

goal (1 subgoal):
 1. (min_r + r) / (2 * r) \<in> {0..1} &&& (max_r + r) / (2 * r) \<in> {0..1} &&& (min_r + r) / (2 * r) \<le> (max_r + r) / (2 * r)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
u \<in> {0..1}
v \<in> {0..1}
u \<le> v

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
define g1 where "g1=subpath 0 u (g r)"
[PROOF STATE]
proof (state)
this:
g1 = subpath 0 u (g r)

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
define g2 where "g2=subpath u v (g r)"
[PROOF STATE]
proof (state)
this:
g2 = subpath u v (g r)

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
define g3 where "g3=subpath v 1 (g r)"
[PROOF STATE]
proof (state)
this:
g3 = subpath v 1 (g r)

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "path g1" "path g2" "path g3" "valid_path g1" "valid_path g2" "valid_path g3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (path g1 &&& path g2 &&& path g3) &&& valid_path g1 &&& valid_path g2 &&& valid_path g3
[PROOF STEP]
unfolding g1_def g2_def g3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (path (subpath 0 u (g r)) &&& path (subpath u v (g r)) &&& path (subpath v 1 (g r))) &&& valid_path (subpath 0 u (g r)) &&& valid_path (subpath u v (g r)) &&& valid_path (subpath v 1 (g r))
[PROOF STEP]
using uv
[PROOF STATE]
proof (prove)
using this:
u \<in> {0..1}
v \<in> {0..1}
u \<le> v

goal (1 subgoal):
 1. (path (subpath 0 u (g r)) &&& path (subpath u v (g r)) &&& path (subpath v 1 (g r))) &&& valid_path (subpath 0 u (g r)) &&& valid_path (subpath u v (g r)) &&& valid_path (subpath v 1 (g r))
[PROOF STEP]
by (auto intro!:path_subpath valid_path_subpath)
[PROOF STATE]
proof (state)
this:
path g1
path g2
path g3
valid_path g1
valid_path g2
valid_path g3

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
define wc_add where "wc_add = (\<lambda>g. 2*Re (winding_number g 0)  + cindex_pathE g 0)"
[PROOF STATE]
proof (state)
this:
wc_add = (\<lambda>g. 2 * Re (winding_number g 0) + cindex_pathE g 0)

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
[PROOF STEP]
have "winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0
[PROOF STEP]
unfolding g1_def g2_def g3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (g r) 0 = winding_number (subpath 0 u (g r)) 0 + winding_number (subpath u v (g r)) 0 + winding_number (subpath v 1 (g r)) 0
[PROOF STEP]
using \<open>u\<in>{0..1}\<close> \<open>v\<in>{0..1}\<close> not_g_image
[PROOF STATE]
proof (prove)
using this:
u \<in> {0..1}
v \<in> {0..1}
0 \<notin> path_image (g ?r)

goal (1 subgoal):
 1. winding_number (g r) 0 = winding_number (subpath 0 u (g r)) 0 + winding_number (subpath u v (g r)) 0 + winding_number (subpath v 1 (g r)) 0
[PROOF STEP]
by (subst winding_number_subpath_combine,simp_all)+
[PROOF STATE]
proof (state)
this:
winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0

goal (1 subgoal):
 1. wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0

goal (1 subgoal):
 1. wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
[PROOF STEP]
have "cindex_pathE (g r) 0 = cindex_pathE g1 0 + cindex_pathE g2 0 + cindex_pathE g3 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (g r) 0 = cindex_pathE g1 0 + cindex_pathE g2 0 + cindex_pathE g3 0
[PROOF STEP]
unfolding g1_def g2_def g3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (g r) 0 = cindex_pathE (subpath 0 u (g r)) 0 + cindex_pathE (subpath u v (g r)) 0 + cindex_pathE (subpath v 1 (g r)) 0
[PROOF STEP]
using \<open>u\<in>{0..1}\<close> \<open>v\<in>{0..1}\<close> \<open>u\<le>v\<close> not_g_image
[PROOF STATE]
proof (prove)
using this:
u \<in> {0..1}
v \<in> {0..1}
u \<le> v
0 \<notin> path_image (g ?r)

goal (1 subgoal):
 1. cindex_pathE (g r) 0 = cindex_pathE (subpath 0 u (g r)) 0 + cindex_pathE (subpath u v (g r)) 0 + cindex_pathE (subpath v 1 (g r)) 0
[PROOF STEP]
by (subst cindex_pathE_subpath_combine,simp_all)+
[PROOF STATE]
proof (state)
this:
cindex_pathE (g r) 0 = cindex_pathE g1 0 + cindex_pathE g2 0 + cindex_pathE g3 0

goal (1 subgoal):
 1. wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0
cindex_pathE (g r) 0 = cindex_pathE g1 0 + cindex_pathE g2 0 + cindex_pathE g3 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0
cindex_pathE (g r) 0 = cindex_pathE g1 0 + cindex_pathE g2 0 + cindex_pathE g3 0

goal (1 subgoal):
 1. wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
[PROOF STEP]
unfolding wc_add_def
[PROOF STATE]
proof (prove)
using this:
winding_number (g r) 0 = winding_number g1 0 + winding_number g2 0 + winding_number g3 0
cindex_pathE (g r) 0 = cindex_pathE g1 0 + cindex_pathE g2 0 + cindex_pathE g3 0

goal (1 subgoal):
 1. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = 2 * Re (winding_number g1 0) + cindex_pathE g1 0 + (2 * Re (winding_number g2 0) + cindex_pathE g2 0) + (2 * Re (winding_number g3 0) + cindex_pathE g3 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "wc_add g2=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g2 = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add g2 = 0
[PROOF STEP]
have "2 * Re (winding_number g2 0) = - cindex_pathE g2 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number g2 0) = - cindex_pathE g2 0
[PROOF STEP]
unfolding g2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number (subpath u v (g r)) 0) = - cindex_pathE (subpath u v (g r)) 0
[PROOF STEP]
apply (rule winding_number_cindex_pathE_aux)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. finite_ReZ_segments (subpath u v (g r)) 0
 2. valid_path (subpath u v (g r))
 3. 0 \<notin> path_image (subpath u v (g r))
 4. Re (subpath u v (g r) 1) = Re 0
 5. Re (subpath u v (g r) 0) = Re 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (subpath u v (g r)) 0
[PROOF STEP]
using uv
[PROOF STATE]
proof (prove)
using this:
u \<in> {0..1}
v \<in> {0..1}
u \<le> v

goal (1 subgoal):
 1. finite_ReZ_segments (subpath u v (g r)) 0
[PROOF STEP]
by (auto intro:finite_ReZ_segments_subpath)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. valid_path (subpath u v (g r))
 2. 0 \<notin> path_image (subpath u v (g r))
 3. Re (subpath u v (g r) 1) = Re 0
 4. Re (subpath u v (g r) 0) = Re 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (subpath u v (g r))
[PROOF STEP]
using uv
[PROOF STATE]
proof (prove)
using this:
u \<in> {0..1}
v \<in> {0..1}
u \<le> v

goal (1 subgoal):
 1. valid_path (subpath u v (g r))
[PROOF STEP]
by (auto intro:valid_path_subpath)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 \<notin> path_image (subpath u v (g r))
 2. Re (subpath u v (g r) 1) = Re 0
 3. Re (subpath u v (g r) 0) = Re 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image (subpath u v (g r))
[PROOF STEP]
using Path_Connected.path_image_subpath_subset \<open>\<And>r. path (g r)\<close> not_g_image uv
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?u \<in> {0..1}; ?v \<in> {0..1}\<rbrakk> \<Longrightarrow> path_image (subpath ?u ?v ?g) \<subseteq> path_image ?g
path (g ?r)
0 \<notin> path_image (g ?r)
u \<in> {0..1}
v \<in> {0..1}
u \<le> v

goal (1 subgoal):
 1. 0 \<notin> path_image (subpath u v (g r))
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Re (subpath u v (g r) 1) = Re 0
 2. Re (subpath u v (g r) 0) = Re 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (subpath u v (g r) 1) = Re 0
[PROOF STEP]
unfolding subpath_def v_def g_def linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) (((max_r + r) / (2 * r) - u) * 1 + u)) = Re 0
[PROOF STEP]
using r_asm \<open>max_r \<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r
max_r \<in> proots p

goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) (((max_r + r) / (2 * r) - u) * 1 + u)) = Re 0
[PROOF STEP]
by (auto simp add:field_simps Re_poly_of_real p_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (subpath u v (g r) 0) = Re 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (subpath u v (g r) 0) = Re 0
[PROOF STEP]
unfolding subpath_def u_def g_def linepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) ((v - (min_r + r) / (2 * r)) * 0 + (min_r + r) / (2 * r))) = Re 0
[PROOF STEP]
using r_asm \<open>min_r \<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r
min_r \<in> proots p

goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) ((v - (min_r + r) / (2 * r)) * 0 + (min_r + r) / (2 * r))) = Re 0
[PROOF STEP]
by (auto simp add:field_simps Re_poly_of_real p_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number g2 0) = - cindex_pathE g2 0

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

goal (1 subgoal):
 1. wc_add g2 = 0
[PROOF STEP]
unfolding wc_add_def
[PROOF STATE]
proof (prove)
using this:
2 * Re (winding_number g2 0) = - cindex_pathE g2 0

goal (1 subgoal):
 1. 2 * Re (winding_number g2 0) + cindex_pathE g2 0 = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wc_add g2 = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
wc_add g2 = 0

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wc_add g2 = 0

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "wc_add g1=- arctan (f (-r)) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have g1_pq:
          "Re (g1 t) = poly p (min_r*t+r*t-r)"
          "Im (g1 t) = poly q (min_r*t+r*t-r)"
          "Im (g1 t)/Re (g1 t) = (f o (\<lambda>x. (min_r+r)*x - r)) t"
          for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g1 t) = poly p (min_r * t + r * t - r) &&& Im (g1 t) = poly q (min_r * t + r * t - r) &&& Im (g1 t) / Re (g1 t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Re (g1 t) = poly p (min_r * t + r * t - r)
 2. Im (g1 t) = poly q (min_r * t + r * t - r)
 3. Im (g1 t) / Re (g1 t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) t
[PROOF STEP]
have "g1 t = poly pp (of_real (min_r*t+r*t-r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g1 t = poly pp (complex_of_real (min_r * t + r * t - r))
[PROOF STEP]
using \<open>r\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. g1 t = poly pp (complex_of_real (min_r * t + r * t - r))
[PROOF STEP]
unfolding g1_def g_def linepath_def subpath_def u_def p_def
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. (poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) (((min_r + r) / (2 * r) - 0) * t + 0) = poly pp (complex_of_real (min_r * t + r * t - r))
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
g1 t = poly pp (complex_of_real (min_r * t + r * t - r))

goal (3 subgoals):
 1. Re (g1 t) = poly p (min_r * t + r * t - r)
 2. Im (g1 t) = poly q (min_r * t + r * t - r)
 3. Im (g1 t) / Re (g1 t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g1 t = poly pp (complex_of_real (min_r * t + r * t - r))
[PROOF STEP]
show
              "Re (g1 t) = poly p (min_r*t+r*t-r)"
              "Im (g1 t) = poly q (min_r*t+r*t-r)"
[PROOF STATE]
proof (prove)
using this:
g1 t = poly pp (complex_of_real (min_r * t + r * t - r))

goal (1 subgoal):
 1. Re (g1 t) = poly p (min_r * t + r * t - r) &&& Im (g1 t) = poly q (min_r * t + r * t - r)
[PROOF STEP]
unfolding p_def q_def
[PROOF STATE]
proof (prove)
using this:
g1 t = poly pp (complex_of_real (min_r * t + r * t - r))

goal (1 subgoal):
 1. Re (g1 t) = poly (map_poly Re pp) (min_r * t + r * t - r) &&& Im (g1 t) = poly (map_poly Im pp) (min_r * t + r * t - r)
[PROOF STEP]
by (simp only:Re_poly_of_real Im_poly_of_real)+
[PROOF STATE]
proof (state)
this:
Re (g1 t) = poly p (min_r * t + r * t - r)
Im (g1 t) = poly q (min_r * t + r * t - r)

goal (1 subgoal):
 1. Im (g1 t) / Re (g1 t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g1 t) = poly p (min_r * t + r * t - r)
Im (g1 t) = poly q (min_r * t + r * t - r)
[PROOF STEP]
show "Im (g1 t)/Re (g1 t) = (f o (\<lambda>x. (min_r+r)*x - r)) t"
[PROOF STATE]
proof (prove)
using this:
Re (g1 t) = poly p (min_r * t + r * t - r)
Im (g1 t) = poly q (min_r * t + r * t - r)

goal (1 subgoal):
 1. Im (g1 t) / Re (g1 t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) t
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
Re (g1 t) = poly p (min_r * t + r * t - r)
Im (g1 t) = poly q (min_r * t + r * t - r)

goal (1 subgoal):
 1. Im (g1 t) / Re (g1 t) = ((\<lambda>t. poly q t / poly p t) \<circ> (\<lambda>x. (min_r + r) * x - r)) t
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
Im (g1 t) / Re (g1 t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) t

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g1 ?t) = poly p (min_r * ?t + r * ?t - r)
Im (g1 ?t) = poly q (min_r * ?t + r * ?t - r)
Im (g1 ?t) / Re (g1 ?t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) ?t

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have "Re(g1 1)=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g1 1) = 0
[PROOF STEP]
using \<open>r\<noteq>0\<close> Re_poly_of_real \<open>min_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
Re (poly ?p (complex_of_real ?x)) = poly (map_poly Re ?p) ?x
min_r \<in> proots p

goal (1 subgoal):
 1. Re (g1 1) = 0
[PROOF STEP]
unfolding g1_def subpath_def u_def g_def linepath_def
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
Re (poly ?p (complex_of_real ?x)) = poly (map_poly Re ?p) ?x
min_r \<in> proots p

goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) (((min_r + r) / (2 * r) - 0) * 1 + 0)) = 0
[PROOF STEP]
by (auto simp add:field_simps p_def)
[PROOF STATE]
proof (state)
this:
Re (g1 1) = 0

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have "0 \<notin> path_image g1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image g1
[PROOF STEP]
by (metis (full_types) path_image_subpath_subset \<open>\<And>r. path (g r)\<close>
              atLeastAtMost_iff g1_def le_less not_g_image subsetCE uv(1) zero_le_one)
[PROOF STATE]
proof (state)
this:
0 \<notin> path_image g1

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have wc_add_pos:"wc_add h = - arctan (poly q (- r) / poly p (-r)) / pi" when
          Re_pos:"\<forall>x\<in>{0..<1}. 0 < (Re \<circ> h) x"
          and hp:"\<forall>t. Re (h t) = c*poly p (min_r*t+r*t-r)"
          and hq:"\<forall>t. Im (h t) = c*poly q (min_r*t+r*t-r)"
          and [simp]:"c\<noteq>0"
          (*and hpq:"\<forall>t. Im (h t)/Re (h t) = (f o (\<lambda>x. (min_r+r)*x - r)) t"*)
          and "Re (h 1) = 0"
          and "valid_path h"
          and h_img:"0 \<notin> path_image h"
          for h c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
define f where "f=(\<lambda>t. c*poly q t / (c*poly p t))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. c * poly q t / (c * poly p t))

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
define farg where "farg= (if 0 < Im (h 1) then pi / 2 else - pi / 2)"
[PROOF STATE]
proof (state)
this:
farg = (if 0 < Im (h 1) then pi / 2 else - pi / 2)

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
have "Re (winding_number h 0) = (Im (Ln (pathfinish h))
              - Im (Ln (pathstart h))) / (2 * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number h 0) = (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi)
[PROOF STEP]
apply (rule Re_winding_number_half_right[of h 0,simplified])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>p\<in>path_image h. 0 \<le> Re p
 2. valid_path h
 3. 0 \<notin> path_image h
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>path_image h. 0 \<le> Re p
[PROOF STEP]
using that \<open>Re (h 1) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..<1}. 0 < (Re \<circ> h) x
\<forall>t. Re (h t) = c * poly p (min_r * t + r * t - r)
\<forall>t. Im (h t) = c * poly q (min_r * t + r * t - r)
c \<noteq> 0
Re (h 1) = 0
valid_path h
0 \<notin> path_image h
Re (h 1) = 0

goal (1 subgoal):
 1. \<forall>p\<in>path_image h. 0 \<le> Re p
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..<1}. 0 < (Re \<circ> h) x
\<forall>t. Re (h t) = c * poly p (min_r * t + r * t - r)
\<forall>t. Im (h t) = c * poly q (min_r * t + r * t - r)
c \<noteq> 0
Re (h 1) = 0
valid_path h
0 \<notin> h ` {0..1}
Re (h 1) = 0

goal (1 subgoal):
 1. \<forall>p\<in>h ` {0..1}. 0 \<le> Re p
[PROOF STEP]
by (auto simp add:le_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. valid_path h
 2. 0 \<notin> path_image h
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path h
[PROOF STEP]
using \<open>valid_path h\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path h

goal (1 subgoal):
 1. valid_path h
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image h
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image h
[PROOF STEP]
using h_img
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image h

goal (1 subgoal):
 1. 0 \<notin> path_image h
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
have "... = (farg - arctan (f (-r))) / (2 * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
have "Im (Ln (pathfinish h)) = farg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = farg
[PROOF STEP]
using \<open>Re(h 1)=0\<close>
[PROOF STATE]
proof (prove)
using this:
Re (h 1) = 0

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = farg
[PROOF STEP]
unfolding farg_def path_defs
[PROOF STATE]
proof (prove)
using this:
Re (h 1) = 0

goal (1 subgoal):
 1. Im (Ln (h 1)) = (if 0 < Im (h 1) then pi / 2 else - pi / 2)
[PROOF STEP]
apply (subst Im_Ln_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Re (h 1) = 0 \<Longrightarrow> h 1 \<noteq> 0
 2. Re (h 1) = 0 \<Longrightarrow> (if Re (h 1) \<noteq> 0 then if 0 < Re (h 1) then arctan (Im (h 1) / Re (h 1)) else if 0 \<le> Im (h 1) then arctan (Im (h 1) / Re (h 1)) + pi else arctan (Im (h 1) / Re (h 1)) - pi else if 0 < Im (h 1) then pi / 2 else - pi / 2) = (if 0 < Im (h 1) then pi / 2 else - pi / 2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h 1) = 0 \<Longrightarrow> h 1 \<noteq> 0
[PROOF STEP]
using h_img
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image h

goal (1 subgoal):
 1. Re (h 1) = 0 \<Longrightarrow> h 1 \<noteq> 0
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
0 \<notin> h ` {0..1}

goal (1 subgoal):
 1. Re (h 1) = 0 \<Longrightarrow> h 1 \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h 1) = 0 \<Longrightarrow> (if Re (h 1) \<noteq> 0 then if 0 < Re (h 1) then arctan (Im (h 1) / Re (h 1)) else if 0 \<le> Im (h 1) then arctan (Im (h 1) / Re (h 1)) + pi else arctan (Im (h 1) / Re (h 1)) - pi else if 0 < Im (h 1) then pi / 2 else - pi / 2) = (if 0 < Im (h 1) then pi / 2 else - pi / 2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h 1) = 0 \<Longrightarrow> (if Re (h 1) \<noteq> 0 then if 0 < Re (h 1) then arctan (Im (h 1) / Re (h 1)) else if 0 \<le> Im (h 1) then arctan (Im (h 1) / Re (h 1)) + pi else arctan (Im (h 1) / Re (h 1)) - pi else if 0 < Im (h 1) then pi / 2 else - pi / 2) = (if 0 < Im (h 1) then pi / 2 else - pi / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish h)) = farg

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish h)) = farg

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
have "Im (Ln (pathstart h)) = arctan (f (-r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
have "pathstart h \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathstart h \<noteq> 0
[PROOF STEP]
using h_img
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image h

goal (1 subgoal):
 1. pathstart h \<noteq> 0
[PROOF STEP]
by (metis pathstart_in_path_image)
[PROOF STATE]
proof (state)
this:
pathstart h \<noteq> 0

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pathstart h \<noteq> 0
[PROOF STEP]
have "Im (Ln (pathstart h)) = arctan (Im (pathstart h) / Re (pathstart h))"
[PROOF STATE]
proof (prove)
using this:
pathstart h \<noteq> 0

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (Im (pathstart h) / Re (pathstart h))
[PROOF STEP]
using Re_pos[rule_format,of 0]
[PROOF STATE]
proof (prove)
using this:
pathstart h \<noteq> 0
0 \<in> {0..<1} \<Longrightarrow> 0 < (Re \<circ> h) 0

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (Im (pathstart h) / Re (pathstart h))
[PROOF STEP]
by (simp add: Im_Ln_eq path_defs)
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart h)) = arctan (Im (pathstart h) / Re (pathstart h))

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart h)) = arctan (Im (pathstart h) / Re (pathstart h))

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
have "... = arctan (f (-r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (Im (pathstart h) / Re (pathstart h)) = arctan (f (- r))
[PROOF STEP]
unfolding f_def path_defs hp[rule_format] hq[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (c * poly q (min_r * 0 + r * 0 - r) / (c * poly p (min_r * 0 + r * 0 - r))) = arctan (c * poly q (- r) / (c * poly p (- r)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arctan (Im (pathstart h) / Re (pathstart h)) = arctan (f (- r))

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathstart h)) = arctan (f (- r))

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart h)) = arctan (f (- r))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart h)) = arctan (f (- r))

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathfinish h)) = farg
Im (Ln (pathstart h)) = arctan (f (- r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathfinish h)) = farg
Im (Ln (pathstart h)) = arctan (f (- r))

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (farg - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
have "Re (winding_number h 0) = (farg - arctan (f (-r))) / (2 * pi)"
[PROOF STATE]
proof (prove)
using this:
Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
have "cindex_pathE h 0 = (-farg/pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
have "cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r))
[PROOF STEP]
unfolding cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (h t - 0) / Re (h t - 0)) = cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r))
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (h t - 0) / Re (h t - 0)) = cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r))
[PROOF STEP]
by (auto simp add:hp hq f_def comp_def algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r))

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r))

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
have "... = cindexE (-r) min_r f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r)) = cindexE (- r) min_r f
[PROOF STEP]
apply (subst cindexE_linear_comp[where b="-r",simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. min_r + r \<noteq> 0
 2. (if 0 < min_r + r then cindexE ((min_r + r) * 0 + - r) ((min_r + r) * 1 + - r) f else - cindexE ((min_r + r) * 1 + - r) ((min_r + r) * 0 + - r) f) = cindexE (- r) min_r f
[PROOF STEP]
using r_asm
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r

goal (2 subgoals):
 1. min_r + r \<noteq> 0
 2. (if 0 < min_r + r then cindexE ((min_r + r) * 0 + - r) ((min_r + r) * 1 + - r) f else - cindexE ((min_r + r) * 1 + - r) ((min_r + r) * 0 + - r) f) = cindexE (- r) min_r f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r)) = cindexE (- r) min_r f

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (min_r + r) * x - r)) = cindexE (- r) min_r f

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
have "... = - jumpF f (at_left min_r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
define right where "right = {x. jumpF f (at_right x) \<noteq> 0 \<and> - r \<le> x \<and> x < min_r}"
[PROOF STATE]
proof (state)
this:
right = {x. jumpF f (at_right x) \<noteq> 0 \<and> - r \<le> x \<and> x < min_r}

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
define left where "left = {x. jumpF f (at_left x) \<noteq> 0 \<and> - r < x \<and> x \<le> min_r}"
[PROOF STATE]
proof (state)
this:
left = {x. jumpF f (at_left x) \<noteq> 0 \<and> - r < x \<and> x \<le> min_r}

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
have *:"jumpF f (at_right x) =0" "jumpF f (at_left x) =0" when "x\<in>{-r..<min_r}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right x) = 0 &&& jumpF f (at_left x) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. jumpF f (at_right x) = 0
 2. jumpF f (at_left x) = 0
[PROOF STEP]
have False when "poly p x =0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "x\<ge>min_r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_r \<le> x
[PROOF STEP]
using min_max_bound[rule_format,of x] that
[PROOF STATE]
proof (prove)
using this:
x \<in> proots p \<Longrightarrow> x \<in> {min_r..max_r}
poly p x = 0

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

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
min_r \<le> x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
min_r \<le> x

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>x\<in>{-r..<min_r}\<close>
[PROOF STATE]
proof (prove)
using this:
min_r \<le> x
x \<in> {- r..<min_r}

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:
poly p x = 0 \<Longrightarrow> False

goal (2 subgoals):
 1. jumpF f (at_right x) = 0
 2. jumpF f (at_left x) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly p x = 0 \<Longrightarrow> False
[PROOF STEP]
show "jumpF f (at_right x) =0" "jumpF f (at_left x) =0"
[PROOF STATE]
proof (prove)
using this:
poly p x = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. jumpF f (at_right x) = 0 &&& jumpF f (at_left x) = 0
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
poly p x = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. jumpF (\<lambda>t. c * poly q t / (c * poly p t)) (at_right x) = 0 &&& jumpF (\<lambda>t. c * poly q t / (c * poly p t)) (at_left x) = 0
[PROOF STEP]
by (auto intro!:jumpF_not_infinity continuous_intros)
[PROOF STATE]
proof (state)
this:
jumpF f (at_right x) = 0
jumpF f (at_left x) = 0

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

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_right ?x) = 0
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_left ?x) = 0
[PROOF STEP]
have "right = {}"
[PROOF STATE]
proof (prove)
using this:
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_right ?x) = 0
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_left ?x) = 0

goal (1 subgoal):
 1. right = {}
[PROOF STEP]
unfolding right_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_right ?x) = 0
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_left ?x) = 0

goal (1 subgoal):
 1. {x. jumpF f (at_right x) \<noteq> 0 \<and> - r \<le> x \<and> x < min_r} = {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
right = {}

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
right = {}

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
have "left = (if jumpF f (at_left min_r) = 0 then {} else {min_r})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. left = (if jumpF f (at_left min_r) = 0 then {} else {min_r})
[PROOF STEP]
unfolding left_def le_less
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF f (at_left x) \<noteq> 0 \<and> - r < x \<and> (x < min_r \<or> x = min_r)} = (if jumpF f (at_left min_r) = 0 then {} else {min_r})
[PROOF STEP]
using * r_asm
[PROOF STATE]
proof (prove)
using this:
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_right ?x) = 0
?x \<in> {- r..<min_r} \<Longrightarrow> jumpF f (at_left ?x) = 0
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. {x. jumpF f (at_left x) \<noteq> 0 \<and> - r < x \<and> (x < min_r \<or> x = min_r)} = (if jumpF f (at_left min_r) = 0 then {} else {min_r})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
left = (if jumpF f (at_left min_r) = 0 then {} else {min_r})

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
right = {}
left = (if jumpF f (at_left min_r) = 0 then {} else {min_r})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
right = {}
left = (if jumpF f (at_left min_r) = 0 then {} else {min_r})

goal (1 subgoal):
 1. cindexE (- r) min_r f = - jumpF f (at_left min_r)
[PROOF STEP]
unfolding cindexE_def
[PROOF STATE]
proof (prove)
using this:
right = {}
left = (if jumpF f (at_left min_r) = 0 then {} else {min_r})

goal (1 subgoal):
 1. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> - r \<le> x \<and> x < min_r. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> - r < x \<and> x \<le> min_r. jumpF f (at_left x)) = - jumpF f (at_left min_r)
[PROOF STEP]
by (fold left_def right_def,auto)
[PROOF STATE]
proof (state)
this:
cindexE (- r) min_r f = - jumpF f (at_left min_r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE (- r) min_r f = - jumpF f (at_left min_r)

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE (- r) min_r f = - jumpF f (at_left min_r)

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
have "... = (-farg/pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have p_pos:"c*poly p x > 0" when "x \<in> {- r<..<min_r}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
define hh where "hh=(\<lambda>t. min_r*t+r*t-r)"
[PROOF STATE]
proof (state)
this:
hh = (\<lambda>t. min_r * t + r * t - r)

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
have "(x+r)/(min_r+r) \<in> {0..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + r) / (min_r + r) \<in> {0..<1}
[PROOF STEP]
using that r_asm
[PROOF STATE]
proof (prove)
using this:
x \<in> {- r<..<min_r}
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. (x + r) / (min_r + r) \<in> {0..<1}
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
(x + r) / (min_r + r) \<in> {0..<1}

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x + r) / (min_r + r) \<in> {0..<1}
[PROOF STEP]
have "0 < c*poly p (hh ((x+r)/(min_r+r)))"
[PROOF STATE]
proof (prove)
using this:
(x + r) / (min_r + r) \<in> {0..<1}

goal (1 subgoal):
 1. 0 < c * poly p (hh ((x + r) / (min_r + r)))
[PROOF STEP]
apply (drule_tac Re_pos[rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (Re \<circ> h) ((x + r) / (min_r + r)) \<Longrightarrow> 0 < c * poly p (hh ((x + r) / (min_r + r)))
[PROOF STEP]
unfolding comp_def hp[rule_format]  hq[rule_format] hh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c * poly p (min_r * ((x + r) / (min_r + r)) + r * ((x + r) / (min_r + r)) - r) \<Longrightarrow> 0 < c * poly p (min_r * ((x + r) / (min_r + r)) + r * ((x + r) / (min_r + r)) - r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < c * poly p (hh ((x + r) / (min_r + r)))

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < c * poly p (hh ((x + r) / (min_r + r)))

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
have "hh ((x+r)/(min_r+r)) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hh ((x + r) / (min_r + r)) = x
[PROOF STEP]
unfolding hh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_r * ((x + r) / (min_r + r)) + r * ((x + r) / (min_r + r)) - r = x
[PROOF STEP]
using \<open>min_r>-r\<close>
[PROOF STATE]
proof (prove)
using this:
- r < min_r

goal (1 subgoal):
 1. min_r * ((x + r) / (min_r + r)) + r * ((x + r) / (min_r + r)) - r = x
[PROOF STEP]
apply (auto simp add:divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - r < min_r \<Longrightarrow> min_r * (x + r) + r * (x + r) - r * (min_r + r) = x * (min_r + r)
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
hh ((x + r) / (min_r + r)) = x

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < c * poly p (hh ((x + r) / (min_r + r)))
hh ((x + r) / (min_r + r)) = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < c * poly p (hh ((x + r) / (min_r + r)))
hh ((x + r) / (min_r + r)) = x

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < c * poly p x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {- r<..<min_r} \<Longrightarrow> 0 < c * poly p ?x

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have "c*poly q min_r \<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * poly q min_r \<noteq> 0
[PROOF STEP]
using no_real_zero \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>proots pp. Im x \<noteq> 0
c \<noteq> 0

goal (1 subgoal):
 1. c * poly q min_r \<noteq> 0
[PROOF STEP]
by (metis Im_complex_of_real UNIV_I \<open>min_r \<in> proots p\<close> cpoly_of_decompose
                    mult_eq_0_iff p_def poly_cpoly_of_real_iff proots_within_iff q_def)
[PROOF STATE]
proof (state)
this:
c * poly q min_r \<noteq> 0

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c * poly q min_r \<noteq> 0

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have ?thesis when "c*poly q min_r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have "0 < Im (h 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Im (h 1)
[PROOF STEP]
unfolding hq[rule_format] hp[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c * poly q (min_r * 1 + r * 1 - r)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c * poly q min_r

goal (1 subgoal):
 1. 0 < c * poly q (min_r * 1 + r * 1 - r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Im (h 1)

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < Im (h 1)

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have "jumpF f (at_left min_r) = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_left min_r) = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_left min_r) = 1 / 2
[PROOF STEP]
have "((\<lambda>t. c*poly p t) has_sgnx 1) (at_left min_r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_left min_r. sgn (c * poly p x) = 1
[PROOF STEP]
apply (rule eventually_at_leftI[of "-r"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {- r<..<min_r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. - r < min_r
[PROOF STEP]
using p_pos \<open>min_r>-r\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> {- r<..<min_r} \<Longrightarrow> 0 < c * poly p ?x
- r < min_r

goal (2 subgoals):
 1. \<And>x. x \<in> {- r<..<min_r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. - r < min_r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)

goal (1 subgoal):
 1. jumpF f (at_left min_r) = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)
[PROOF STEP]
have "filterlim f at_top (at_left min_r)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)

goal (1 subgoal):
 1. filterlim f at_top (at_left min_r)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)

goal (1 subgoal):
 1. LIM t at_left min_r. c * poly q t / (c * poly p t) :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "c*poly q min_r"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q min_r) (at_left min_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> c * poly q min_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_left min_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx sgn (c * poly q min_r)) (at_left min_r)
[PROOF STEP]
using that \<open>min_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c * poly q min_r
min_r \<in> proots p

goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q min_r) (at_left min_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> c * poly q min_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_left min_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx sgn (c * poly q min_r)) (at_left min_r)
[PROOF STEP]
by (auto intro!:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
filterlim f at_top (at_left min_r)

goal (1 subgoal):
 1. jumpF f (at_left min_r) = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top (at_left min_r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top (at_left min_r)

goal (1 subgoal):
 1. jumpF f (at_left min_r) = 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top (at_left min_r)

goal (1 subgoal):
 1. (if filterlim f at_top (at_left min_r) then 1 / 2 else if filterlim f at_bot (at_left min_r) then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF f (at_left min_r) = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF f (at_left min_r) = 1 / 2

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < Im (h 1)
jumpF f (at_left min_r) = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < Im (h 1)
jumpF f (at_left min_r) = 1 / 2

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
unfolding farg_def
[PROOF STATE]
proof (prove)
using this:
0 < Im (h 1)
jumpF f (at_left min_r) = 1 / 2

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - (if 0 < Im (h 1) then pi / 2 else - pi / 2) / pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- jumpF f (at_left min_r) = - farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < c * poly q min_r \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < c * poly q min_r \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have ?thesis when "c*poly q min_r < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have "0 > Im (h 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (h 1) < 0
[PROOF STEP]
unfolding hq[rule_format] hp[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * poly q (min_r * 1 + r * 1 - r) < 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c * poly q min_r < 0

goal (1 subgoal):
 1. c * poly q (min_r * 1 + r * 1 - r) < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Im (h 1) < 0

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Im (h 1) < 0

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
have "jumpF f (at_left min_r) = - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_left min_r) = - 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_left min_r) = - 1 / 2
[PROOF STEP]
have "((\<lambda>t. c*poly p t) has_sgnx 1) (at_left min_r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_left min_r. sgn (c * poly p x) = 1
[PROOF STEP]
apply (rule eventually_at_leftI[of "-r"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {- r<..<min_r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. - r < min_r
[PROOF STEP]
using p_pos \<open>min_r>-r\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> {- r<..<min_r} \<Longrightarrow> 0 < c * poly p ?x
- r < min_r

goal (2 subgoals):
 1. \<And>x. x \<in> {- r<..<min_r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. - r < min_r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)

goal (1 subgoal):
 1. jumpF f (at_left min_r) = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)
[PROOF STEP]
have "filterlim f at_bot (at_left min_r)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)

goal (1 subgoal):
 1. filterlim f at_bot (at_left min_r)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r)

goal (1 subgoal):
 1. LIM t at_left min_r. c * poly q t / (c * poly p t) :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "c*poly q min_r"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q min_r) (at_left min_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> c * poly q min_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_left min_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx - sgn (c * poly q min_r)) (at_left min_r)
[PROOF STEP]
using that \<open>min_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
c * poly q min_r < 0
min_r \<in> proots p

goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q min_r) (at_left min_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> c * poly q min_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_left min_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_left min_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx - sgn (c * poly q min_r)) (at_left min_r)
[PROOF STEP]
by (auto intro!:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
filterlim f at_bot (at_left min_r)

goal (1 subgoal):
 1. jumpF f (at_left min_r) = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_bot (at_left min_r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_bot (at_left min_r)

goal (1 subgoal):
 1. jumpF f (at_left min_r) = - 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
filterlim f at_bot (at_left min_r)

goal (1 subgoal):
 1. (if filterlim f at_top (at_left min_r) then 1 / 2 else if filterlim f at_bot (at_left min_r) then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF f (at_left min_r) = - 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF f (at_left min_r) = - 1 / 2

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Im (h 1) < 0
jumpF f (at_left min_r) = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (h 1) < 0
jumpF f (at_left min_r) = - 1 / 2

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
unfolding farg_def
[PROOF STATE]
proof (prove)
using this:
Im (h 1) < 0
jumpF f (at_left min_r) = - 1 / 2

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - (if 0 < Im (h 1) then pi / 2 else - pi / 2) / pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- jumpF f (at_left min_r) = - farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c * poly q min_r < 0 \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c * poly q min_r \<noteq> 0
0 < c * poly q min_r \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi
c * poly q min_r < 0 \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c * poly q min_r \<noteq> 0
0 < c * poly q min_r \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi
c * poly q min_r < 0 \<Longrightarrow> - jumpF f (at_left min_r) = - farg / pi

goal (1 subgoal):
 1. - jumpF f (at_left min_r) = - farg / pi
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
- jumpF f (at_left min_r) = - farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
- jumpF f (at_left min_r) = - farg / pi

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE h 0 = - farg / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE h 0 = - farg / pi

goal (1 subgoal):
 1. cindex_pathE h 0 = - farg / pi
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = - farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = - farg / pi

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)
cindex_pathE h 0 = - farg / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (winding_number h 0) = (farg - arctan (f (- r))) / (2 * pi)
cindex_pathE h 0 = - farg / pi

goal (1 subgoal):
 1. wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
unfolding wc_add_def f_def
[PROOF STATE]
proof (prove)
using this:
Re (winding_number h 0) = (farg - arctan (c * poly q (- r) / (c * poly p (- r)))) / (2 * pi)
cindex_pathE h 0 = - farg / pi

goal (1 subgoal):
 1. 2 * Re (winding_number h 0) + cindex_pathE h 0 = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
wc_add h = - arctan (poly q (- r) / poly p (- r)) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>x\<in>{0..<1}. 0 < (Re \<circ> ?h) x; \<forall>t. Re (?h t) = ?c * poly p (min_r * t + r * t - r); \<forall>t. Im (?h t) = ?c * poly q (min_r * t + r * t - r); ?c \<noteq> 0; Re (?h 1) = 0; valid_path ?h; 0 \<notin> path_image ?h\<rbrakk> \<Longrightarrow> wc_add ?h = - arctan (poly q (- r) / poly p (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have "\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0)

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0)
[PROOF STEP]
obtain t where t_def:"Re (g1 t) =0" "t\<in>{0..<1}"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>Re (g1 t) = 0; t \<in> {0..<1}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>Re (g1 t) = 0; t \<in> {0..<1}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Re (g1 t) = 0
t \<in> {0..<1}

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
define m where "m=min_r*t+r*t-r"
[PROOF STATE]
proof (state)
this:
m = min_r * t + r * t - r

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "poly p m=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
have "Re (g1 t) = Re (poly pp (of_real m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g1 t) = Re (poly pp (complex_of_real m))
[PROOF STEP]
unfolding m_def g1_def g_def linepath_def subpath_def u_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) (((min_r + r) / (2 * r) - 0) * t + 0)) = Re (poly pp (complex_of_real (min_r * t + r * t - r)))
[PROOF STEP]
using \<open>r\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) (((min_r + r) / (2 * r) - 0) * t + 0)) = Re (poly pp (complex_of_real (min_r * t + r * t - r)))
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
Re (g1 t) = Re (poly pp (complex_of_real m))

goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g1 t) = Re (poly pp (complex_of_real m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (g1 t) = Re (poly pp (complex_of_real m))

goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
using t_def
[PROOF STATE]
proof (prove)
using this:
Re (g1 t) = Re (poly pp (complex_of_real m))
Re (g1 t) = 0
t \<in> {0..<1}

goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
unfolding Re_poly_of_real p_def
[PROOF STATE]
proof (prove)
using this:
Re (g1 t) = poly (map_poly Re pp) m
Re (g1 t) = 0
t \<in> {0..<1}

goal (1 subgoal):
 1. poly (map_poly Re pp) m = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly p m = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly p m = 0

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly p m = 0

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "m<min_r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < min_r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m < min_r
[PROOF STEP]
have "min_r+r>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < min_r + r
[PROOF STEP]
using r_asm
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. 0 < min_r + r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < min_r + r

goal (1 subgoal):
 1. m < min_r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < min_r + r
[PROOF STEP]
have "(min_r + r)*(t-1)<0"
[PROOF STATE]
proof (prove)
using this:
0 < min_r + r

goal (1 subgoal):
 1. (min_r + r) * (t - 1) < 0
[PROOF STEP]
using \<open>t\<in>{0..<1}\<close>
[PROOF STATE]
proof (prove)
using this:
0 < min_r + r
t \<in> {0..<1}

goal (1 subgoal):
 1. (min_r + r) * (t - 1) < 0
[PROOF STEP]
by (simp add: mult_pos_neg)
[PROOF STATE]
proof (state)
this:
(min_r + r) * (t - 1) < 0

goal (1 subgoal):
 1. m < min_r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(min_r + r) * (t - 1) < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(min_r + r) * (t - 1) < 0

goal (1 subgoal):
 1. m < min_r
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
(min_r + r) * (t - 1) < 0

goal (1 subgoal):
 1. min_r * t + r * t - r < min_r
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
m < min_r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
m < min_r

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poly p m = 0
m < min_r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
poly p m = 0
m < min_r

goal (1 subgoal):
 1. False
[PROOF STEP]
using min_max_bound
[PROOF STATE]
proof (prove)
using this:
poly p m = 0
m < min_r
\<forall>p\<in>proots p. p \<in> {min_r..max_r}

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding proots_def
[PROOF STATE]
proof (prove)
using this:
poly p m = 0
m < min_r
\<forall>p\<in>{x. poly p x = 0}. p \<in> {min_r..max_r}

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:
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0
[PROOF STEP]
have "(\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x) \<or> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x \<noteq> 0

goal (1 subgoal):
 1. (\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x) \<or> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0)
[PROOF STEP]
apply (elim continuous_on_neq_split)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0..<1} (Re \<circ> g1)
 2. connected {0..<1}
[PROOF STEP]
using \<open>path g1\<close>
[PROOF STATE]
proof (prove)
using this:
path g1

goal (2 subgoals):
 1. continuous_on {0..<1} (Re \<circ> g1)
 2. connected {0..<1}
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g1

goal (2 subgoals):
 1. continuous_on {0..<1} (Re \<circ> g1)
 2. connected {0..<1}
[PROOF STEP]
by (auto intro!:continuous_intros elim:continuous_on_subset)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x) \<or> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0)

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x) \<or> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0)

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have ?thesis when "\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have "wc_add (uminus o g1) = - arctan (f (- r)) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (uminus \<circ> g1) = - arctan (f (- r)) / pi
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (uminus \<circ> g1) = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
apply (rule wc_add_pos[of _ "-1"])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<forall>x\<in>{0..<1}. 0 < (Re \<circ> (uminus \<circ> g1)) x
 2. \<forall>t. Re ((uminus \<circ> g1) t) = - 1 * poly p (min_r * t + r * t - r)
 3. \<forall>t. Im ((uminus \<circ> g1) t) = - 1 * poly q (min_r * t + r * t - r)
 4. - 1 \<noteq> 0
 5. Re ((uminus \<circ> g1) 1) = 0
 6. valid_path (uminus \<circ> g1)
 7. 0 \<notin> path_image (uminus \<circ> g1)
[PROOF STEP]
using g1_pq that \<open>min_r \<in>proots p\<close> \<open>valid_path g1\<close> \<open>0 \<notin> path_image g1\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g1 ?t) = poly p (min_r * ?t + r * ?t - r)
Im (g1 ?t) = poly q (min_r * ?t + r * ?t - r)
Im (g1 ?t) / Re (g1 ?t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) ?t
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0
min_r \<in> proots p
valid_path g1
0 \<notin> path_image g1

goal (7 subgoals):
 1. \<forall>x\<in>{0..<1}. 0 < (Re \<circ> (uminus \<circ> g1)) x
 2. \<forall>t. Re ((uminus \<circ> g1) t) = - 1 * poly p (min_r * t + r * t - r)
 3. \<forall>t. Im ((uminus \<circ> g1) t) = - 1 * poly q (min_r * t + r * t - r)
 4. - 1 \<noteq> 0
 5. Re ((uminus \<circ> g1) 1) = 0
 6. valid_path (uminus \<circ> g1)
 7. 0 \<notin> path_image (uminus \<circ> g1)
[PROOF STEP]
by (auto simp add:path_image_compose)
[PROOF STATE]
proof (state)
this:
wc_add (uminus \<circ> g1) = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wc_add (uminus \<circ> g1) = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have "wc_add (uminus \<circ> g1) = wc_add g1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (uminus \<circ> g1) = wc_add g1
[PROOF STEP]
unfolding wc_add_def cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number (uminus \<circ> g1) 0) + cindexE 0 1 (\<lambda>t. Im ((uminus \<circ> g1) t - 0) / Re ((uminus \<circ> g1) t - 0)) = 2 * Re (winding_number g1 0) + cindexE 0 1 (\<lambda>t. Im (g1 t - 0) / Re (g1 t - 0))
[PROOF STEP]
apply (subst winding_number_uminus_comp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. valid_path g1
 2. - 0 \<notin> path_image g1
 3. 2 * Re (winding_number g1 (- 0)) + cindexE 0 1 (\<lambda>t. Im ((uminus \<circ> g1) t - 0) / Re ((uminus \<circ> g1) t - 0)) = 2 * Re (winding_number g1 0) + cindexE 0 1 (\<lambda>t. Im (g1 t - 0) / Re (g1 t - 0))
[PROOF STEP]
using \<open>valid_path g1\<close> \<open>0 \<notin> path_image g1\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path g1
0 \<notin> path_image g1

goal (3 subgoals):
 1. valid_path g1
 2. - 0 \<notin> path_image g1
 3. 2 * Re (winding_number g1 (- 0)) + cindexE 0 1 (\<lambda>t. Im ((uminus \<circ> g1) t - 0) / Re ((uminus \<circ> g1) t - 0)) = 2 * Re (winding_number g1 0) + cindexE 0 1 (\<lambda>t. Im (g1 t - 0) / Re (g1 t - 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wc_add (uminus \<circ> g1) = wc_add g1

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wc_add (uminus \<circ> g1) = - arctan (f (- r)) / pi
wc_add (uminus \<circ> g1) = wc_add g1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
wc_add (uminus \<circ> g1) = - arctan (f (- r)) / pi
wc_add (uminus \<circ> g1) = wc_add g1

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wc_add g1 = - arctan (f (- r)) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0 \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0 \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
have ?thesis when "\<forall>x\<in>{0..<1}. (Re \<circ> g1) x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g1 = - arctan (poly q (- r) / poly p (- r)) / pi
[PROOF STEP]
apply (rule wc_add_pos[of _ "1"])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x
 2. \<forall>t. Re (g1 t) = 1 * poly p (min_r * t + r * t - r)
 3. \<forall>t. Im (g1 t) = 1 * poly q (min_r * t + r * t - r)
 4. 1 \<noteq> 0
 5. Re (g1 1) = 0
 6. valid_path g1
 7. 0 \<notin> path_image g1
[PROOF STEP]
using g1_pq that \<open>min_r \<in>proots p\<close> \<open>valid_path g1\<close> \<open>0 \<notin> path_image g1\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g1 ?t) = poly p (min_r * ?t + r * ?t - r)
Im (g1 ?t) = poly q (min_r * ?t + r * ?t - r)
Im (g1 ?t) / Re (g1 ?t) = (f \<circ> (\<lambda>x. (min_r + r) * x - r)) ?t
\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x
min_r \<in> proots p
valid_path g1
0 \<notin> path_image g1

goal (7 subgoals):
 1. \<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x
 2. \<forall>t. Re (g1 t) = 1 * poly p (min_r * t + r * t - r)
 3. \<forall>t. Im (g1 t) = 1 * poly q (min_r * t + r * t - r)
 4. 1 \<noteq> 0
 5. Re (g1 1) = 0
 6. valid_path g1
 7. 0 \<notin> path_image g1
[PROOF STEP]
by (auto simp add:path_image_compose)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x) \<or> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0)
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0 \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi
\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x) \<or> (\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0)
\<forall>x\<in>{0..<1}. (Re \<circ> g1) x < 0 \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi
\<forall>x\<in>{0..<1}. 0 < (Re \<circ> g1) x \<Longrightarrow> wc_add g1 = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. wc_add g1 = - arctan (f (- r)) / pi
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
wc_add g1 = - arctan (f (- r)) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
wc_add g1 = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wc_add g1 = - arctan (f (- r)) / pi

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
have "wc_add g3 = arctan (f r) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have g3_pq:
          "Re (g3 t) = poly p ((r-max_r)*t + max_r)"
          "Im (g3 t) = poly q ((r-max_r)*t + max_r)"
          "Im (g3 t)/Re (g3 t) = (f o (\<lambda>x. (r-max_r)*x + max_r)) t"
          for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g3 t) = poly p ((r - max_r) * t + max_r) &&& Im (g3 t) = poly q ((r - max_r) * t + max_r) &&& Im (g3 t) / Re (g3 t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. Re (g3 t) = poly p ((r - max_r) * t + max_r)
 2. Im (g3 t) = poly q ((r - max_r) * t + max_r)
 3. Im (g3 t) / Re (g3 t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t
[PROOF STEP]
have "g3 t = poly pp (of_real ((r-max_r)*t + max_r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g3 t = poly pp (complex_of_real ((r - max_r) * t + max_r))
[PROOF STEP]
using \<open>r\<noteq>0\<close> \<open>max_r<r\<close>
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
max_r < r

goal (1 subgoal):
 1. g3 t = poly pp (complex_of_real ((r - max_r) * t + max_r))
[PROOF STEP]
unfolding g3_def g_def linepath_def subpath_def v_def p_def
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
max_r < r

goal (1 subgoal):
 1. (poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) ((1 - (max_r + r) / (2 * r)) * t + (max_r + r) / (2 * r)) = poly pp (complex_of_real ((r - max_r) * t + max_r))
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
g3 t = poly pp (complex_of_real ((r - max_r) * t + max_r))

goal (3 subgoals):
 1. Re (g3 t) = poly p ((r - max_r) * t + max_r)
 2. Im (g3 t) = poly q ((r - max_r) * t + max_r)
 3. Im (g3 t) / Re (g3 t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g3 t = poly pp (complex_of_real ((r - max_r) * t + max_r))
[PROOF STEP]
show
              "Re (g3 t) = poly p ((r-max_r)*t + max_r)"
              "Im (g3 t) = poly q ((r-max_r)*t + max_r)"
[PROOF STATE]
proof (prove)
using this:
g3 t = poly pp (complex_of_real ((r - max_r) * t + max_r))

goal (1 subgoal):
 1. Re (g3 t) = poly p ((r - max_r) * t + max_r) &&& Im (g3 t) = poly q ((r - max_r) * t + max_r)
[PROOF STEP]
unfolding p_def q_def
[PROOF STATE]
proof (prove)
using this:
g3 t = poly pp (complex_of_real ((r - max_r) * t + max_r))

goal (1 subgoal):
 1. Re (g3 t) = poly (map_poly Re pp) ((r - max_r) * t + max_r) &&& Im (g3 t) = poly (map_poly Im pp) ((r - max_r) * t + max_r)
[PROOF STEP]
by (simp only:Re_poly_of_real Im_poly_of_real)+
[PROOF STATE]
proof (state)
this:
Re (g3 t) = poly p ((r - max_r) * t + max_r)
Im (g3 t) = poly q ((r - max_r) * t + max_r)

goal (1 subgoal):
 1. Im (g3 t) / Re (g3 t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g3 t) = poly p ((r - max_r) * t + max_r)
Im (g3 t) = poly q ((r - max_r) * t + max_r)
[PROOF STEP]
show "Im (g3 t)/Re (g3 t) = (f o (\<lambda>x. (r-max_r)*x + max_r)) t"
[PROOF STATE]
proof (prove)
using this:
Re (g3 t) = poly p ((r - max_r) * t + max_r)
Im (g3 t) = poly q ((r - max_r) * t + max_r)

goal (1 subgoal):
 1. Im (g3 t) / Re (g3 t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
Re (g3 t) = poly p ((r - max_r) * t + max_r)
Im (g3 t) = poly q ((r - max_r) * t + max_r)

goal (1 subgoal):
 1. Im (g3 t) / Re (g3 t) = ((\<lambda>t. poly q t / poly p t) \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
Im (g3 t) / Re (g3 t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) t

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re (g3 ?t) = poly p ((r - max_r) * ?t + max_r)
Im (g3 ?t) = poly q ((r - max_r) * ?t + max_r)
Im (g3 ?t) / Re (g3 ?t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) ?t

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have "Re(g3 0)=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g3 0) = 0
[PROOF STEP]
using \<open>r\<noteq>0\<close> Re_poly_of_real \<open>max_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
Re (poly ?p (complex_of_real ?x)) = poly (map_poly Re ?p) ?x
max_r \<in> proots p

goal (1 subgoal):
 1. Re (g3 0) = 0
[PROOF STEP]
unfolding g3_def subpath_def v_def g_def linepath_def
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
Re (poly ?p (complex_of_real ?x)) = poly (map_poly Re ?p) ?x
max_r \<in> proots p

goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) ((1 - (max_r + r) / (2 * r)) * 0 + (max_r + r) / (2 * r))) = 0
[PROOF STEP]
by (auto simp add:field_simps p_def)
[PROOF STATE]
proof (state)
this:
Re (g3 0) = 0

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have "0 \<notin> path_image g3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image g3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<notin> path_image g3
[PROOF STEP]
have "(1::real) \<in> {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<in> {0..1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<in> {0..1}

goal (1 subgoal):
 1. 0 \<notin> path_image g3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<in> {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<in> {0..1}

goal (1 subgoal):
 1. 0 \<notin> path_image g3
[PROOF STEP]
using Path_Connected.path_image_subpath_subset \<open>\<And>r. path (g r)\<close> g3_def not_g_image uv(2)
[PROOF STATE]
proof (prove)
using this:
1 \<in> {0..1}
\<lbrakk>?u \<in> {0..1}; ?v \<in> {0..1}\<rbrakk> \<Longrightarrow> path_image (subpath ?u ?v ?g) \<subseteq> path_image ?g
path (g ?r)
g3 = subpath v 1 (g r)
0 \<notin> path_image (g ?r)
v \<in> {0..1}

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

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

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have wc_add_pos:"wc_add h = arctan (poly q r / poly p r) / pi" when
          Re_pos:"\<forall>x\<in>{0<..1}. 0 < (Re \<circ> h) x"
          and hp:"\<forall>t. Re (h t) = c*poly p ((r-max_r)*t + max_r)"
          and hq:"\<forall>t. Im (h t) = c*poly q ((r-max_r)*t + max_r)"
          and [simp]:"c\<noteq>0"
          (*and hpq:"\<forall>t. Im (h t)/Re (h t) = (f o (\<lambda>x. (min_r+r)*x - r)) t"*)
          and "Re (h 0) = 0"
          and "valid_path h"
          and h_img:"0 \<notin> path_image h"
          for h c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
define f where "f=(\<lambda>t. c*poly q t / (c*poly p t))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. c * poly q t / (c * poly p t))

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
define farg where "farg= (if 0 < Im (h 0) then pi / 2 else - pi / 2)"
[PROOF STATE]
proof (state)
this:
farg = (if 0 < Im (h 0) then pi / 2 else - pi / 2)

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
have "Re (winding_number h 0) = (Im (Ln (pathfinish h))
              - Im (Ln (pathstart h))) / (2 * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (winding_number h 0) = (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi)
[PROOF STEP]
apply (rule Re_winding_number_half_right[of h 0,simplified])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>p\<in>path_image h. 0 \<le> Re p
 2. valid_path h
 3. 0 \<notin> path_image h
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>p\<in>path_image h. 0 \<le> Re p
[PROOF STEP]
using that \<open>Re (h 0) = 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0<..1}. 0 < (Re \<circ> h) x
\<forall>t. Re (h t) = c * poly p ((r - max_r) * t + max_r)
\<forall>t. Im (h t) = c * poly q ((r - max_r) * t + max_r)
c \<noteq> 0
Re (h 0) = 0
valid_path h
0 \<notin> path_image h
Re (h 0) = 0

goal (1 subgoal):
 1. \<forall>p\<in>path_image h. 0 \<le> Re p
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0<..1}. 0 < (Re \<circ> h) x
\<forall>t. Re (h t) = c * poly p ((r - max_r) * t + max_r)
\<forall>t. Im (h t) = c * poly q ((r - max_r) * t + max_r)
c \<noteq> 0
Re (h 0) = 0
valid_path h
0 \<notin> h ` {0..1}
Re (h 0) = 0

goal (1 subgoal):
 1. \<forall>p\<in>h ` {0..1}. 0 \<le> Re p
[PROOF STEP]
by (auto simp add:le_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. valid_path h
 2. 0 \<notin> path_image h
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path h
[PROOF STEP]
using \<open>valid_path h\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path h

goal (1 subgoal):
 1. valid_path h
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image h
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<notin> path_image h
[PROOF STEP]
using h_img
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image h

goal (1 subgoal):
 1. 0 \<notin> path_image h
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
have "... = (arctan (f r) - farg) / (2 * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
have "Im (Ln (pathstart h)) = farg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Ln (pathstart h)) = farg
[PROOF STEP]
using \<open>Re(h 0)=0\<close>
[PROOF STATE]
proof (prove)
using this:
Re (h 0) = 0

goal (1 subgoal):
 1. Im (Ln (pathstart h)) = farg
[PROOF STEP]
unfolding farg_def path_defs
[PROOF STATE]
proof (prove)
using this:
Re (h 0) = 0

goal (1 subgoal):
 1. Im (Ln (h 0)) = (if 0 < Im (h 0) then pi / 2 else - pi / 2)
[PROOF STEP]
apply (subst Im_Ln_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Re (h 0) = 0 \<Longrightarrow> h 0 \<noteq> 0
 2. Re (h 0) = 0 \<Longrightarrow> (if Re (h 0) \<noteq> 0 then if 0 < Re (h 0) then arctan (Im (h 0) / Re (h 0)) else if 0 \<le> Im (h 0) then arctan (Im (h 0) / Re (h 0)) + pi else arctan (Im (h 0) / Re (h 0)) - pi else if 0 < Im (h 0) then pi / 2 else - pi / 2) = (if 0 < Im (h 0) then pi / 2 else - pi / 2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h 0) = 0 \<Longrightarrow> h 0 \<noteq> 0
[PROOF STEP]
using h_img
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image h

goal (1 subgoal):
 1. Re (h 0) = 0 \<Longrightarrow> h 0 \<noteq> 0
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
0 \<notin> h ` {0..1}

goal (1 subgoal):
 1. Re (h 0) = 0 \<Longrightarrow> h 0 \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h 0) = 0 \<Longrightarrow> (if Re (h 0) \<noteq> 0 then if 0 < Re (h 0) then arctan (Im (h 0) / Re (h 0)) else if 0 \<le> Im (h 0) then arctan (Im (h 0) / Re (h 0)) + pi else arctan (Im (h 0) / Re (h 0)) - pi else if 0 < Im (h 0) then pi / 2 else - pi / 2) = (if 0 < Im (h 0) then pi / 2 else - pi / 2)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (h 0) = 0 \<Longrightarrow> (if Re (h 0) \<noteq> 0 then if 0 < Re (h 0) then arctan (Im (h 0) / Re (h 0)) else if 0 \<le> Im (h 0) then arctan (Im (h 0) / Re (h 0)) + pi else arctan (Im (h 0) / Re (h 0)) - pi else if 0 < Im (h 0) then pi / 2 else - pi / 2) = (if 0 < Im (h 0) then pi / 2 else - pi / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart h)) = farg

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Im (Ln (pathstart h)) = farg

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
have "Im (Ln (pathfinish h)) = arctan (f r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
have "pathfinish h \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathfinish h \<noteq> 0
[PROOF STEP]
using h_img
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image h

goal (1 subgoal):
 1. pathfinish h \<noteq> 0
[PROOF STEP]
by (metis pathfinish_in_path_image)
[PROOF STATE]
proof (state)
this:
pathfinish h \<noteq> 0

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pathfinish h \<noteq> 0
[PROOF STEP]
have "Im (Ln (pathfinish h)) = arctan (Im (pathfinish h) / Re (pathfinish h))"
[PROOF STATE]
proof (prove)
using this:
pathfinish h \<noteq> 0

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (Im (pathfinish h) / Re (pathfinish h))
[PROOF STEP]
using Re_pos[rule_format,of 1]
[PROOF STATE]
proof (prove)
using this:
pathfinish h \<noteq> 0
1 \<in> {0<..1} \<Longrightarrow> 0 < (Re \<circ> h) 1

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (Im (pathfinish h) / Re (pathfinish h))
[PROOF STEP]
by (simp add: Im_Ln_eq path_defs)
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish h)) = arctan (Im (pathfinish h) / Re (pathfinish h))

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish h)) = arctan (Im (pathfinish h) / Re (pathfinish h))

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
have "... = arctan (f r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (Im (pathfinish h) / Re (pathfinish h)) = arctan (f r)
[PROOF STEP]
unfolding f_def path_defs hp[rule_format] hq[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arctan (c * poly q ((r - max_r) * 1 + max_r) / (c * poly p ((r - max_r) * 1 + max_r))) = arctan (c * poly q r / (c * poly p r))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arctan (Im (pathfinish h) / Re (pathfinish h)) = arctan (f r)

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathfinish h)) = arctan (f r)

goal (1 subgoal):
 1. Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish h)) = arctan (f r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Im (Ln (pathfinish h)) = arctan (f r)

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Im (Ln (pathstart h)) = farg
Im (Ln (pathfinish h)) = arctan (f r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (Ln (pathstart h)) = farg
Im (Ln (pathfinish h)) = arctan (f r)

goal (1 subgoal):
 1. (Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Im (Ln (pathfinish h)) - Im (Ln (pathstart h))) / (2 * pi) = (arctan (f r) - farg) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
have "Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)"
[PROOF STATE]
proof (prove)
using this:
Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)

goal (1 subgoal):
 1. Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
have "cindex_pathE h 0 = farg/pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
have "cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (r-max_r)*x + max_r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r))
[PROOF STEP]
unfolding cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (h t - 0) / Re (h t - 0)) = cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r))
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (h t - 0) / Re (h t - 0)) = cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r))
[PROOF STEP]
by (auto simp add:hp hq f_def comp_def algebra_simps)
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r))

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r))

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
have "... = cindexE max_r r f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) = cindexE max_r r f
[PROOF STEP]
apply (subst cindexE_linear_comp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. r - max_r \<noteq> 0
 2. (if 0 < r - max_r then cindexE ((r - max_r) * 0 + max_r) ((r - max_r) * 1 + max_r) f else - cindexE ((r - max_r) * 1 + max_r) ((r - max_r) * 0 + max_r) f) = cindexE max_r r f
[PROOF STEP]
using r_asm
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r

goal (2 subgoals):
 1. r - max_r \<noteq> 0
 2. (if 0 < r - max_r then cindexE ((r - max_r) * 0 + max_r) ((r - max_r) * 1 + max_r) f else - cindexE ((r - max_r) * 1 + max_r) ((r - max_r) * 0 + max_r) f) = cindexE max_r r f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) = cindexE max_r r f

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) = cindexE max_r r f

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
have "... = jumpF f (at_right max_r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
define right where "right = {x. jumpF f (at_right x) \<noteq> 0 \<and> max_r \<le> x \<and> x < r}"
[PROOF STATE]
proof (state)
this:
right = {x. jumpF f (at_right x) \<noteq> 0 \<and> max_r \<le> x \<and> x < r}

goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
define left where "left = {x. jumpF f (at_left x) \<noteq> 0 \<and> max_r < x \<and> x \<le> r}"
[PROOF STATE]
proof (state)
this:
left = {x. jumpF f (at_left x) \<noteq> 0 \<and> max_r < x \<and> x \<le> r}

goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
have *:"jumpF f (at_right x) =0" "jumpF f (at_left x) =0" when "x\<in>{max_r<..r}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right x) = 0 &&& jumpF f (at_left x) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. jumpF f (at_right x) = 0
 2. jumpF f (at_left x) = 0
[PROOF STEP]
have False when "poly p x =0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "x\<le>max_r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> max_r
[PROOF STEP]
using min_max_bound[rule_format,of x] that
[PROOF STATE]
proof (prove)
using this:
x \<in> proots p \<Longrightarrow> x \<in> {min_r..max_r}
poly p x = 0

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

goal (1 subgoal):
 1. False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<le> max_r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
x \<le> max_r

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>x\<in>{max_r<..r}\<close>
[PROOF STATE]
proof (prove)
using this:
x \<le> max_r
x \<in> {max_r<..r}

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:
poly p x = 0 \<Longrightarrow> False

goal (2 subgoals):
 1. jumpF f (at_right x) = 0
 2. jumpF f (at_left x) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly p x = 0 \<Longrightarrow> False
[PROOF STEP]
show "jumpF f (at_right x) =0" "jumpF f (at_left x) =0"
[PROOF STATE]
proof (prove)
using this:
poly p x = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. jumpF f (at_right x) = 0 &&& jumpF f (at_left x) = 0
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
poly p x = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. jumpF (\<lambda>t. c * poly q t / (c * poly p t)) (at_right x) = 0 &&& jumpF (\<lambda>t. c * poly q t / (c * poly p t)) (at_left x) = 0
[PROOF STEP]
by (auto intro!:jumpF_not_infinity continuous_intros)
[PROOF STATE]
proof (state)
this:
jumpF f (at_right x) = 0
jumpF f (at_left x) = 0

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

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

goal (1 subgoal):
 1. left = {}
[PROOF STEP]
unfolding left_def
[PROOF STATE]
proof (prove)
using this:
?x \<in> {max_r<..r} \<Longrightarrow> jumpF f (at_right ?x) = 0
?x \<in> {max_r<..r} \<Longrightarrow> jumpF f (at_left ?x) = 0

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

goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
left = {}

goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
have "right = (if jumpF f (at_right max_r) = 0 then {} else {max_r})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. right = (if jumpF f (at_right max_r) = 0 then {} else {max_r})
[PROOF STEP]
unfolding right_def le_less
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. jumpF f (at_right x) \<noteq> 0 \<and> (max_r < x \<or> max_r = x) \<and> x < r} = (if jumpF f (at_right max_r) = 0 then {} else {max_r})
[PROOF STEP]
using * r_asm
[PROOF STATE]
proof (prove)
using this:
?x \<in> {max_r<..r} \<Longrightarrow> jumpF f (at_right ?x) = 0
?x \<in> {max_r<..r} \<Longrightarrow> jumpF f (at_left ?x) = 0
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. {x. jumpF f (at_right x) \<noteq> 0 \<and> (max_r < x \<or> max_r = x) \<and> x < r} = (if jumpF f (at_right max_r) = 0 then {} else {max_r})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
right = (if jumpF f (at_right max_r) = 0 then {} else {max_r})

goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
left = {}
right = (if jumpF f (at_right max_r) = 0 then {} else {max_r})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
left = {}
right = (if jumpF f (at_right max_r) = 0 then {} else {max_r})

goal (1 subgoal):
 1. cindexE max_r r f = jumpF f (at_right max_r)
[PROOF STEP]
unfolding cindexE_def
[PROOF STATE]
proof (prove)
using this:
left = {}
right = (if jumpF f (at_right max_r) = 0 then {} else {max_r})

goal (1 subgoal):
 1. (\<Sum>x | jumpF f (at_right x) \<noteq> 0 \<and> max_r \<le> x \<and> x < r. jumpF f (at_right x)) - (\<Sum>x | jumpF f (at_left x) \<noteq> 0 \<and> max_r < x \<and> x \<le> r. jumpF f (at_left x)) = jumpF f (at_right max_r)
[PROOF STEP]
by (fold left_def right_def,auto)
[PROOF STATE]
proof (state)
this:
cindexE max_r r f = jumpF f (at_right max_r)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE max_r r f = jumpF f (at_right max_r)

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE max_r r f = jumpF f (at_right max_r)

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
have "... = farg/pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have p_pos:"c*poly p x > 0" when "x \<in> {max_r<..<r}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
define hh where "hh=(\<lambda>t. (r-max_r)*t + max_r)"
[PROOF STATE]
proof (state)
this:
hh = (\<lambda>t. (r - max_r) * t + max_r)

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
have "(x-max_r)/(r-max_r) \<in> {0<..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - max_r) / (r - max_r) \<in> {0<..1}
[PROOF STEP]
using that r_asm
[PROOF STATE]
proof (prove)
using this:
x \<in> {max_r<..<r}
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. (x - max_r) / (r - max_r) \<in> {0<..1}
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
(x - max_r) / (r - max_r) \<in> {0<..1}

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x - max_r) / (r - max_r) \<in> {0<..1}
[PROOF STEP]
have "0 < c*poly p (hh ((x-max_r)/(r-max_r)))"
[PROOF STATE]
proof (prove)
using this:
(x - max_r) / (r - max_r) \<in> {0<..1}

goal (1 subgoal):
 1. 0 < c * poly p (hh ((x - max_r) / (r - max_r)))
[PROOF STEP]
apply (drule_tac Re_pos[rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (Re \<circ> h) ((x - max_r) / (r - max_r)) \<Longrightarrow> 0 < c * poly p (hh ((x - max_r) / (r - max_r)))
[PROOF STEP]
unfolding comp_def hp[rule_format]  hq[rule_format] hh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c * poly p ((r - max_r) * ((x - max_r) / (r - max_r)) + max_r) \<Longrightarrow> 0 < c * poly p ((r - max_r) * ((x - max_r) / (r - max_r)) + max_r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < c * poly p (hh ((x - max_r) / (r - max_r)))

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < c * poly p (hh ((x - max_r) / (r - max_r)))

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
have "hh ((x-max_r)/(r-max_r)) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hh ((x - max_r) / (r - max_r)) = x
[PROOF STEP]
unfolding hh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r - max_r) * ((x - max_r) / (r - max_r)) + max_r = x
[PROOF STEP]
using \<open>max_r<r\<close>
[PROOF STATE]
proof (prove)
using this:
max_r < r

goal (1 subgoal):
 1. (r - max_r) * ((x - max_r) / (r - max_r)) + max_r = x
[PROOF STEP]
by (auto simp add:divide_simps)
[PROOF STATE]
proof (state)
this:
hh ((x - max_r) / (r - max_r)) = x

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < c * poly p (hh ((x - max_r) / (r - max_r)))
hh ((x - max_r) / (r - max_r)) = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < c * poly p (hh ((x - max_r) / (r - max_r)))
hh ((x - max_r) / (r - max_r)) = x

goal (1 subgoal):
 1. 0 < c * poly p x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < c * poly p x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {max_r<..<r} \<Longrightarrow> 0 < c * poly p ?x

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have "c*poly q max_r \<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * poly q max_r \<noteq> 0
[PROOF STEP]
using no_real_zero \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>proots pp. Im x \<noteq> 0
c \<noteq> 0

goal (1 subgoal):
 1. c * poly q max_r \<noteq> 0
[PROOF STEP]
by (metis Im_complex_of_real UNIV_I \<open>max_r \<in> proots p\<close> cpoly_of_decompose
                    mult_eq_0_iff p_def poly_cpoly_of_real_iff proots_within_iff q_def)
[PROOF STATE]
proof (state)
this:
c * poly q max_r \<noteq> 0

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c * poly q max_r \<noteq> 0

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have ?thesis when "c*poly q max_r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have "0 < Im (h 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Im (h 0)
[PROOF STEP]
unfolding hq[rule_format] hp[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c * poly q ((r - max_r) * 0 + max_r)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < c * poly q max_r

goal (1 subgoal):
 1. 0 < c * poly q ((r - max_r) * 0 + max_r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Im (h 0)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < Im (h 0)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have "jumpF f (at_right max_r) = 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = 1 / 2
[PROOF STEP]
have "((\<lambda>t. c*poly p t) has_sgnx 1) (at_right max_r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right max_r. sgn (c * poly p x) = 1
[PROOF STEP]
apply (rule eventually_at_rightI[of _ "r"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {max_r<..<r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. max_r < r
[PROOF STEP]
using p_pos \<open>max_r<r\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> {max_r<..<r} \<Longrightarrow> 0 < c * poly p ?x
max_r < r

goal (2 subgoals):
 1. \<And>x. x \<in> {max_r<..<r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. max_r < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)
[PROOF STEP]
have "filterlim f at_top (at_right max_r)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)

goal (1 subgoal):
 1. filterlim f at_top (at_right max_r)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)

goal (1 subgoal):
 1. LIM t at_right max_r. c * poly q t / (c * poly p t) :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "c*poly q max_r"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q max_r) (at_right max_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> c * poly q max_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_right max_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx sgn (c * poly q max_r)) (at_right max_r)
[PROOF STEP]
using that \<open>max_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c * poly q max_r
max_r \<in> proots p

goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q max_r) (at_right max_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> c * poly q max_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_right max_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx sgn (c * poly q max_r)) (at_right max_r)
[PROOF STEP]
by (auto intro!:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
filterlim f at_top (at_right max_r)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top (at_right max_r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top (at_right max_r)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top (at_right max_r)

goal (1 subgoal):
 1. (if filterlim f at_top (at_right max_r) then 1 / 2 else if filterlim f at_bot (at_right max_r) then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = 1 / 2

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < Im (h 0)
jumpF f (at_right max_r) = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < Im (h 0)
jumpF f (at_right max_r) = 1 / 2

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
unfolding farg_def
[PROOF STATE]
proof (prove)
using this:
0 < Im (h 0)
jumpF f (at_right max_r) = 1 / 2

goal (1 subgoal):
 1. jumpF f (at_right max_r) = (if 0 < Im (h 0) then pi / 2 else - pi / 2) / pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < c * poly q max_r \<Longrightarrow> jumpF f (at_right max_r) = farg / pi

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < c * poly q max_r \<Longrightarrow> jumpF f (at_right max_r) = farg / pi

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have ?thesis when "c*poly q max_r < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have "0 > Im (h 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (h 0) < 0
[PROOF STEP]
unfolding hq[rule_format] hp[rule_format]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * poly q ((r - max_r) * 0 + max_r) < 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
c * poly q max_r < 0

goal (1 subgoal):
 1. c * poly q ((r - max_r) * 0 + max_r) < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Im (h 0) < 0

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Im (h 0) < 0

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
have "jumpF f (at_right max_r) = - 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = - 1 / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF f (at_right max_r) = - 1 / 2
[PROOF STEP]
have "((\<lambda>t. c*poly p t) has_sgnx 1) (at_right max_r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right max_r. sgn (c * poly p x) = 1
[PROOF STEP]
apply (rule eventually_at_rightI[of _ "r"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {max_r<..<r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. max_r < r
[PROOF STEP]
using p_pos \<open>max_r<r\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> {max_r<..<r} \<Longrightarrow> 0 < c * poly p ?x
max_r < r

goal (2 subgoals):
 1. \<And>x. x \<in> {max_r<..<r} \<Longrightarrow> sgn (c * poly p x) = 1
 2. max_r < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)
[PROOF STEP]
have "filterlim f at_bot (at_right max_r)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)

goal (1 subgoal):
 1. filterlim f at_bot (at_right max_r)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r)

goal (1 subgoal):
 1. LIM t at_right max_r. c * poly q t / (c * poly p t) :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of _ "c*poly q max_r"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q max_r) (at_right max_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> c * poly q max_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_right max_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx - sgn (c * poly q max_r)) (at_right max_r)
[PROOF STEP]
using that \<open>max_r\<in>proots p\<close>
[PROOF STATE]
proof (prove)
using this:
c * poly q max_r < 0
max_r \<in> proots p

goal (3 subgoals):
 1. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly q t) \<longlongrightarrow> c * poly q max_r) (at_right max_r)
 2. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> c * poly q max_r \<noteq> 0
 3. ((\<lambda>t. c * poly p t) has_sgnx 1) (at_right max_r) \<Longrightarrow> ((\<lambda>t. c * poly p t) \<longlongrightarrow> 0) (at_right max_r) \<and> ((\<lambda>x. c * poly p x) has_sgnx - sgn (c * poly q max_r)) (at_right max_r)
[PROOF STEP]
by (auto intro!:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
filterlim f at_bot (at_right max_r)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = - 1 / 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_bot (at_right max_r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_bot (at_right max_r)

goal (1 subgoal):
 1. jumpF f (at_right max_r) = - 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
filterlim f at_bot (at_right max_r)

goal (1 subgoal):
 1. (if filterlim f at_top (at_right max_r) then 1 / 2 else if filterlim f at_bot (at_right max_r) then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = - 1 / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = - 1 / 2

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Im (h 0) < 0
jumpF f (at_right max_r) = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im (h 0) < 0
jumpF f (at_right max_r) = - 1 / 2

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
unfolding farg_def
[PROOF STATE]
proof (prove)
using this:
Im (h 0) < 0
jumpF f (at_right max_r) = - 1 / 2

goal (1 subgoal):
 1. jumpF f (at_right max_r) = (if 0 < Im (h 0) then pi / 2 else - pi / 2) / pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c * poly q max_r < 0 \<Longrightarrow> jumpF f (at_right max_r) = farg / pi

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c * poly q max_r \<noteq> 0
0 < c * poly q max_r \<Longrightarrow> jumpF f (at_right max_r) = farg / pi
c * poly q max_r < 0 \<Longrightarrow> jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c * poly q max_r \<noteq> 0
0 < c * poly q max_r \<Longrightarrow> jumpF f (at_right max_r) = farg / pi
c * poly q max_r < 0 \<Longrightarrow> jumpF f (at_right max_r) = farg / pi

goal (1 subgoal):
 1. jumpF f (at_right max_r) = farg / pi
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF f (at_right max_r) = farg / pi

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE h 0 = farg / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE h 0 = farg / pi

goal (1 subgoal):
 1. cindex_pathE h 0 = farg / pi
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = farg / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE h 0 = farg / pi

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)
cindex_pathE h 0 = farg / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (winding_number h 0) = (arctan (f r) - farg) / (2 * pi)
cindex_pathE h 0 = farg / pi

goal (1 subgoal):
 1. wc_add h = arctan (poly q r / poly p r) / pi
[PROOF STEP]
unfolding wc_add_def f_def
[PROOF STATE]
proof (prove)
using this:
Re (winding_number h 0) = (arctan (c * poly q r / (c * poly p r)) - farg) / (2 * pi)
cindex_pathE h 0 = farg / pi

goal (1 subgoal):
 1. 2 * Re (winding_number h 0) + cindex_pathE h 0 = arctan (poly q r / poly p r) / pi
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
wc_add h = arctan (poly q r / poly p r) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>x\<in>{0<..1}. 0 < (Re \<circ> ?h) x; \<forall>t. Re (?h t) = ?c * poly p ((r - max_r) * t + max_r); \<forall>t. Im (?h t) = ?c * poly q ((r - max_r) * t + max_r); ?c \<noteq> 0; Re (?h 0) = 0; valid_path ?h; 0 \<notin> path_image ?h\<rbrakk> \<Longrightarrow> wc_add ?h = arctan (poly q r / poly p r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have "\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0)

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0)
[PROOF STEP]
obtain t where t_def:"Re (g3 t) =0" "t\<in>{0<..1}"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>Re (g3 t) = 0; t \<in> {0<..1}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding path_image_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>Re (g3 t) = 0; t \<in> {0<..1}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Re (g3 t) = 0
t \<in> {0<..1}

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
define m where "m=(r-max_r)*t + max_r"
[PROOF STATE]
proof (state)
this:
m = (r - max_r) * t + max_r

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "poly p m=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
have "Re (g3 t) = Re (poly pp (of_real m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (g3 t) = Re (poly pp (complex_of_real m))
[PROOF STEP]
unfolding m_def g3_def g_def linepath_def subpath_def v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) ((1 - (max_r + r) / (2 * r)) * t + (max_r + r) / (2 * r))) = Re (poly pp (complex_of_real ((r - max_r) * t + max_r)))
[PROOF STEP]
using \<open>r\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. Re ((poly pp \<circ> (\<lambda>x. complex_of_real ((1 - x) *\<^sub>R - r + x *\<^sub>R of_real r))) ((1 - (max_r + r) / (2 * r)) * t + (max_r + r) / (2 * r))) = Re (poly pp (complex_of_real ((r - max_r) * t + max_r)))
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
Re (g3 t) = Re (poly pp (complex_of_real m))

goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Re (g3 t) = Re (poly pp (complex_of_real m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (g3 t) = Re (poly pp (complex_of_real m))

goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
using t_def
[PROOF STATE]
proof (prove)
using this:
Re (g3 t) = Re (poly pp (complex_of_real m))
Re (g3 t) = 0
t \<in> {0<..1}

goal (1 subgoal):
 1. poly p m = 0
[PROOF STEP]
unfolding Re_poly_of_real p_def
[PROOF STATE]
proof (prove)
using this:
Re (g3 t) = poly (map_poly Re pp) m
Re (g3 t) = 0
t \<in> {0<..1}

goal (1 subgoal):
 1. poly (map_poly Re pp) m = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly p m = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly p m = 0

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
poly p m = 0

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "m>max_r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_r < m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. max_r < m
[PROOF STEP]
have "r-max_r>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r - max_r
[PROOF STEP]
using r_asm
[PROOF STATE]
proof (prove)
using this:
max (norm max_r) (norm min_r) + 1 \<le> r

goal (1 subgoal):
 1. 0 < r - max_r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < r - max_r

goal (1 subgoal):
 1. max_r < m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < r - max_r
[PROOF STEP]
have "(r - max_r)*t>0"
[PROOF STATE]
proof (prove)
using this:
0 < r - max_r

goal (1 subgoal):
 1. 0 < (r - max_r) * t
[PROOF STEP]
using \<open>t\<in>{0<..1}\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r - max_r
t \<in> {0<..1}

goal (1 subgoal):
 1. 0 < (r - max_r) * t
[PROOF STEP]
by (simp add: mult_pos_neg)
[PROOF STATE]
proof (state)
this:
0 < (r - max_r) * t

goal (1 subgoal):
 1. max_r < m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < (r - max_r) * t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < (r - max_r) * t

goal (1 subgoal):
 1. max_r < m
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
0 < (r - max_r) * t

goal (1 subgoal):
 1. max_r < (r - max_r) * t + max_r
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
max_r < m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
max_r < m

goal (1 subgoal):
 1. \<not> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
poly p m = 0
max_r < m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
poly p m = 0
max_r < m

goal (1 subgoal):
 1. False
[PROOF STEP]
using min_max_bound
[PROOF STATE]
proof (prove)
using this:
poly p m = 0
max_r < m
\<forall>p\<in>proots p. p \<in> {min_r..max_r}

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding proots_def
[PROOF STATE]
proof (prove)
using this:
poly p m = 0
max_r < m
\<forall>p\<in>{x. poly p x = 0}. p \<in> {min_r..max_r}

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:
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0
[PROOF STEP]
have "(\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x) \<or> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x \<noteq> 0

goal (1 subgoal):
 1. (\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x) \<or> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0)
[PROOF STEP]
apply (elim continuous_on_neq_split)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. continuous_on {0<..1} (Re \<circ> g3)
 2. connected {0<..1}
[PROOF STEP]
using \<open>path g3\<close>
[PROOF STATE]
proof (prove)
using this:
path g3

goal (2 subgoals):
 1. continuous_on {0<..1} (Re \<circ> g3)
 2. connected {0<..1}
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} g3

goal (2 subgoals):
 1. continuous_on {0<..1} (Re \<circ> g3)
 2. connected {0<..1}
[PROOF STEP]
by (auto intro!:continuous_intros elim:continuous_on_subset)
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x) \<or> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0)

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x) \<or> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0)

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have ?thesis when "\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have "wc_add (uminus o g3) = arctan (f r) / pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (uminus \<circ> g3) = arctan (f r) / pi
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (uminus \<circ> g3) = arctan (poly q r / poly p r) / pi
[PROOF STEP]
apply (rule wc_add_pos[of _ "-1"])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<forall>x\<in>{0<..1}. 0 < (Re \<circ> (uminus \<circ> g3)) x
 2. \<forall>t. Re ((uminus \<circ> g3) t) = - 1 * poly p ((r - max_r) * t + max_r)
 3. \<forall>t. Im ((uminus \<circ> g3) t) = - 1 * poly q ((r - max_r) * t + max_r)
 4. - 1 \<noteq> 0
 5. Re ((uminus \<circ> g3) 0) = 0
 6. valid_path (uminus \<circ> g3)
 7. 0 \<notin> path_image (uminus \<circ> g3)
[PROOF STEP]
using g3_pq that \<open>max_r \<in>proots p\<close> \<open>valid_path g3\<close> \<open>0 \<notin> path_image g3\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g3 ?t) = poly p ((r - max_r) * ?t + max_r)
Im (g3 ?t) = poly q ((r - max_r) * ?t + max_r)
Im (g3 ?t) / Re (g3 ?t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) ?t
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0
max_r \<in> proots p
valid_path g3
0 \<notin> path_image g3

goal (7 subgoals):
 1. \<forall>x\<in>{0<..1}. 0 < (Re \<circ> (uminus \<circ> g3)) x
 2. \<forall>t. Re ((uminus \<circ> g3) t) = - 1 * poly p ((r - max_r) * t + max_r)
 3. \<forall>t. Im ((uminus \<circ> g3) t) = - 1 * poly q ((r - max_r) * t + max_r)
 4. - 1 \<noteq> 0
 5. Re ((uminus \<circ> g3) 0) = 0
 6. valid_path (uminus \<circ> g3)
 7. 0 \<notin> path_image (uminus \<circ> g3)
[PROOF STEP]
by (auto simp add:path_image_compose)
[PROOF STATE]
proof (state)
this:
wc_add (uminus \<circ> g3) = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wc_add (uminus \<circ> g3) = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have "wc_add (uminus \<circ> g3) = wc_add g3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add (uminus \<circ> g3) = wc_add g3
[PROOF STEP]
unfolding wc_add_def cindex_pathE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * Re (winding_number (uminus \<circ> g3) 0) + cindexE 0 1 (\<lambda>t. Im ((uminus \<circ> g3) t - 0) / Re ((uminus \<circ> g3) t - 0)) = 2 * Re (winding_number g3 0) + cindexE 0 1 (\<lambda>t. Im (g3 t - 0) / Re (g3 t - 0))
[PROOF STEP]
apply (subst winding_number_uminus_comp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. valid_path g3
 2. - 0 \<notin> path_image g3
 3. 2 * Re (winding_number g3 (- 0)) + cindexE 0 1 (\<lambda>t. Im ((uminus \<circ> g3) t - 0) / Re ((uminus \<circ> g3) t - 0)) = 2 * Re (winding_number g3 0) + cindexE 0 1 (\<lambda>t. Im (g3 t - 0) / Re (g3 t - 0))
[PROOF STEP]
using \<open>valid_path g3\<close> \<open>0 \<notin> path_image g3\<close>
[PROOF STATE]
proof (prove)
using this:
valid_path g3
0 \<notin> path_image g3

goal (3 subgoals):
 1. valid_path g3
 2. - 0 \<notin> path_image g3
 3. 2 * Re (winding_number g3 (- 0)) + cindexE 0 1 (\<lambda>t. Im ((uminus \<circ> g3) t - 0) / Re ((uminus \<circ> g3) t - 0)) = 2 * Re (winding_number g3 0) + cindexE 0 1 (\<lambda>t. Im (g3 t - 0) / Re (g3 t - 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wc_add (uminus \<circ> g3) = wc_add g3

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wc_add (uminus \<circ> g3) = arctan (f r) / pi
wc_add (uminus \<circ> g3) = wc_add g3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
wc_add (uminus \<circ> g3) = arctan (f r) / pi
wc_add (uminus \<circ> g3) = wc_add g3

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wc_add g3 = arctan (f r) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0 \<Longrightarrow> wc_add g3 = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0 \<Longrightarrow> wc_add g3 = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have ?thesis when "\<forall>x\<in>{0<..1}. (Re \<circ> g3) x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wc_add g3 = arctan (poly q r / poly p r) / pi
[PROOF STEP]
apply (rule wc_add_pos[of _ "1"])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x
 2. \<forall>t. Re (g3 t) = 1 * poly p ((r - max_r) * t + max_r)
 3. \<forall>t. Im (g3 t) = 1 * poly q ((r - max_r) * t + max_r)
 4. 1 \<noteq> 0
 5. Re (g3 0) = 0
 6. valid_path g3
 7. 0 \<notin> path_image g3
[PROOF STEP]
using g3_pq that \<open>max_r \<in>proots p\<close> \<open>valid_path g3\<close> \<open>0 \<notin> path_image g3\<close>
[PROOF STATE]
proof (prove)
using this:
Re (g3 ?t) = poly p ((r - max_r) * ?t + max_r)
Im (g3 ?t) = poly q ((r - max_r) * ?t + max_r)
Im (g3 ?t) / Re (g3 ?t) = (f \<circ> (\<lambda>x. (r - max_r) * x + max_r)) ?t
\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x
max_r \<in> proots p
valid_path g3
0 \<notin> path_image g3

goal (7 subgoals):
 1. \<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x
 2. \<forall>t. Re (g3 t) = 1 * poly p ((r - max_r) * t + max_r)
 3. \<forall>t. Im (g3 t) = 1 * poly q ((r - max_r) * t + max_r)
 4. 1 \<noteq> 0
 5. Re (g3 0) = 0
 6. valid_path g3
 7. 0 \<notin> path_image g3
[PROOF STEP]
by (auto simp add:path_image_compose)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x \<Longrightarrow> wc_add g3 = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x) \<or> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0)
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0 \<Longrightarrow> wc_add g3 = arctan (f r) / pi
\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x \<Longrightarrow> wc_add g3 = arctan (f r) / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x) \<or> (\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0)
\<forall>x\<in>{0<..1}. (Re \<circ> g3) x < 0 \<Longrightarrow> wc_add g3 = arctan (f r) / pi
\<forall>x\<in>{0<..1}. 0 < (Re \<circ> g3) x \<Longrightarrow> wc_add g3 = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add g3 = arctan (f r) / pi
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
wc_add g3 = arctan (f r) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
wc_add g3 = arctan (f r) / pi

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
wc_add g2 = 0
wc_add g1 = - arctan (f (- r)) / pi
wc_add g3 = arctan (f r) / pi
[PROOF STEP]
have "wc_add (g r) = (arctan (f r) - arctan (f (-r))) / pi "
[PROOF STATE]
proof (prove)
using this:
wc_add (g r) = wc_add g1 + wc_add g2 + wc_add g3
wc_add g2 = 0
wc_add g1 = - arctan (f (- r)) / pi
wc_add g3 = arctan (f r) / pi

goal (1 subgoal):
 1. wc_add (g r) = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
wc_add (g r) = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. \<And>x. max (norm max_r) (norm min_r) + 1 \<le> x \<Longrightarrow> 2 * Re (winding_number (g x) 0) + cindex_pathE (g x) 0 = (arctan (f x) - arctan (f (- x))) / pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
wc_add (g r) = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
show "2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0
          = (arctan (f r) - arctan (f (- r))) / pi"
[PROOF STATE]
proof (prove)
using this:
wc_add (g r) = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
unfolding wc_add_def
[PROOF STATE]
proof (prove)
using this:
2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
with arctan_f_tendsto
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
\<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>r. (arctan (f r) - arctan (f (- r))) / pi) \<longlongrightarrow> 0) at_top
\<forall>\<^sub>F r in at_top. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0 = (arctan (f r) - arctan (f (- r))) / pi

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (auto dest:tendsto_cong)
[PROOF STATE]
proof (state)
this:
((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proots p \<noteq> {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
proots p = {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
proots p \<noteq> {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
proots p = {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
proots p \<noteq> {} \<Longrightarrow> ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>r. 2 * Re (winding_number (g r) 0) + cindex_pathE (g r) 0) \<longlongrightarrow> 0) at_top

goal:
No subgoals!
[PROOF STEP]
qed