[STATEMENT]
lemma jumpF_pathstart_part_circlepath:
  assumes "st<tt" "r>0" "cmod (z-z0) \<noteq>r"
  shows "jumpF_pathstart (part_circlepath z r st tt) z0 = (
            if r * cos st + Re z - Re z0 = 0 then
              (let
                \<Delta> = r* sin st + Im z - Im z0
              in
                if (sin st > 0 \<or> cos st=1 ) \<and> \<Delta> < 0
                    \<or> (sin st < 0 \<or>  cos st=-1 ) \<and> \<Delta> > 0  then
                  1/2
                else
                  - 1/2)
            else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define f where "f=(\<lambda>i. r * sin i + Im z - Im z0)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>i. r * sin i + Im z - Im z0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define g where "g=(\<lambda>i. r * cos i + Re z - Re z0)"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>i. r * cos i + Re z - Re z0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have jumpF_eq:"jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i/g i) (at_right st)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
have "jumpF_pathstart (part_circlepath z r st tt) z0
        = jumpF ((\<lambda>i. f i/g i) o linepath st tt) (at_right 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_right 0)
[PROOF STEP]
unfolding jumpF_pathstart_def part_circlepath_def exp_Euler f_def g_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF (\<lambda>t. Im (z + complex_of_real r * (cos (complex_of_real (linepath st tt t)) + \<i> * sin (complex_of_real (linepath st tt t))) - z0) / Re (z + complex_of_real r * (cos (complex_of_real (linepath st tt t)) + \<i> * sin (complex_of_real (linepath st tt t))) - z0)) (at_right 0) = jumpF (\<lambda>x. (r * sin (linepath st tt x) + Im z - Im z0) / (r * cos (linepath st tt x) + Re z - Re z0)) (at_right 0)
[PROOF STEP]
by (simp add:cos_of_real sin_of_real algebra_simps)
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_right 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
have "... = jumpF (\<lambda>i. f i/g i) (at_right st)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_right 0) = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
using jumpF_linear_comp(2)[of "tt-st" "(\<lambda>i. f i/g i)" st 0,symmetric] \<open>st<tt\<close>
[PROOF STATE]
proof (prove)
using this:
tt - st \<noteq> 0 \<Longrightarrow> (if 0 < tt - st then jumpF (\<lambda>i. f i / g i) (at_right ((tt - st) * 0 + st)) else jumpF (\<lambda>i. f i / g i) (at_left ((tt - st) * 0 + st))) = jumpF ((\<lambda>i. f i / g i) \<circ> (\<lambda>x. (tt - st) * x + st)) (at_right 0)
st < tt

goal (1 subgoal):
 1. jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_right 0) = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
unfolding linepath_def
[PROOF STATE]
proof (prove)
using this:
tt - st \<noteq> 0 \<Longrightarrow> (if 0 < tt - st then jumpF (\<lambda>i. f i / g i) (at_right ((tt - st) * 0 + st)) else jumpF (\<lambda>i. f i / g i) (at_left ((tt - st) * 0 + st))) = jumpF ((\<lambda>i. f i / g i) \<circ> (\<lambda>x. (tt - st) * x + st)) (at_right 0)
st < tt

goal (1 subgoal):
 1. jumpF ((\<lambda>i. f i / g i) \<circ> (\<lambda>x. (1 - x) *\<^sub>R st + x *\<^sub>R tt)) (at_right 0) = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_right 0) = jumpF (\<lambda>i. f i / g i) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have g_has_sgnx1:"(g has_sgnx 1) (at_right st)" when "g st=0" "sin st < 0 \<or> cos st=-1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
have ?thesis when "sin st<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
have "(g has_sgnx sgn (- r * sin st)) (at_right st)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx sgn (- r * sin st)) (at_right st)
[PROOF STEP]
apply (rule has_sgnx_derivative_at_right[of g "- r * sin st" st])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (g has_real_derivative - r * sin st) (at st)
 2. g st = 0
 3. - r * sin st \<noteq> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_real_derivative - r * sin st) (at st)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. r * cos i + Re z - Re z0) has_real_derivative - r * sin st) (at st)
[PROOF STEP]
by (auto intro!:derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. g st = 0
 2. - r * sin st \<noteq> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g st = 0
[PROOF STEP]
using \<open>g st=0\<close>
[PROOF STATE]
proof (prove)
using this:
g st = 0

goal (1 subgoal):
 1. g st = 0
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - r * sin st \<noteq> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - r * sin st \<noteq> 0
[PROOF STEP]
using \<open>r>0\<close> \<open>sin st<0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r
sin st < 0

goal (1 subgoal):
 1. - r * sin st \<noteq> 0
[PROOF STEP]
by (simp add: mult_pos_neg)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(g has_sgnx sgn (- r * sin st)) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_sgnx sgn (- r * sin st)) (at_right st)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx sgn (- r * sin st)) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
using \<open>r>0\<close> that
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx sgn (- r * sin st)) (at_right st)
0 < r
sin st < 0

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
by (simp add: sgn_mult)
[PROOF STATE]
proof (state)
this:
(g has_sgnx 1) (at_right st)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sin st < 0 \<Longrightarrow> (g has_sgnx 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sin st < 0 \<Longrightarrow> (g has_sgnx 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
have ?thesis when "cos st = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
have "g i > 0" when "st<i" "i<st+pi" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
obtain k where k_def:"st = 2 * of_int k * pi+ pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. st = 2 * real_of_int k * pi + pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>cos st = -1\<close>
[PROOF STATE]
proof (prove)
using this:
cos st = - 1

goal (1 subgoal):
 1. (\<And>k. st = 2 * real_of_int k * pi + pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis cos_eq_minus1 distrib_left mult.commute mult.right_neutral)
[PROOF STATE]
proof (state)
this:
st = 2 * real_of_int k * pi + pi

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
have "cos (i-st) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (i - st) < 1
[PROOF STEP]
using cos_monotone_0_pi[of 0 "i-st" ] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> 0; 0 < i - st; i - st \<le> pi\<rbrakk> \<Longrightarrow> cos (i - st) < cos 0
st < i
i < st + pi

goal (1 subgoal):
 1. cos (i - st) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos (i - st) < 1

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cos (i - st) < 1

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
have "cos (i-st) = - cos i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (i - st) = - cos i
[PROOF STEP]
apply (rule cos_eq_neg_periodic_intro[of _ _ "-k-1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i - st - i = 2 * real_of_int (- k - 1) * pi + pi \<or> i - st + i = 2 * real_of_int (- k - 1) * pi + pi
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i - (2 * real_of_int k * pi + pi) - i = 2 * real_of_int (- k - 1) * pi + pi \<or> i - (2 * real_of_int k * pi + pi) + i = 2 * real_of_int (- k - 1) * pi + pi
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cos (i - st) = - cos i

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cos (i - st) < 1
cos (i - st) = - cos i
[PROOF STEP]
have "cos i>-1"
[PROOF STATE]
proof (prove)
using this:
cos (i - st) < 1
cos (i - st) = - cos i

goal (1 subgoal):
 1. - 1 < cos i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- 1 < cos i

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- 1 < cos i
[PROOF STEP]
have "cos st<cos i"
[PROOF STATE]
proof (prove)
using this:
- 1 < cos i

goal (1 subgoal):
 1. cos st < cos i
[PROOF STEP]
using \<open>cos st=-1\<close>
[PROOF STATE]
proof (prove)
using this:
- 1 < cos i
cos st = - 1

goal (1 subgoal):
 1. cos st < cos i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos st < cos i

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
have "0 = r * cos st + Re z - Re z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = r * cos st + Re z - Re z0
[PROOF STEP]
using \<open>g st = 0\<close>
[PROOF STATE]
proof (prove)
using this:
g st = 0

goal (1 subgoal):
 1. 0 = r * cos st + Re z - Re z0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 = 0

goal (1 subgoal):
 1. 0 = r * cos st + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = r * cos st + Re z - Re z0

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = r * cos st + Re z - Re z0

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
have "... < r * cos i + Re z - Re z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * cos st + Re z - Re z0 < r * cos i + Re z - Re z0
[PROOF STEP]
using \<open>cos st < cos i\<close> \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
cos st < cos i
0 < r

goal (1 subgoal):
 1. r * cos st + Re z - Re z0 < r * cos i + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r * cos st + Re z - Re z0 < r * cos i + Re z - Re z0

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < r * cos i + Re z - Re z0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < r * cos i + Re z - Re z0

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
0 < r * cos i + Re z - Re z0

goal (1 subgoal):
 1. 0 < r * cos i + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < g i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> 0 < g ?i

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> 0 < g ?i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> 0 < g ?i

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
unfolding has_sgnx_def eventually_at_right
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> 0 < g ?i

goal (1 subgoal):
 1. \<exists>b>st. \<forall>y>st. y < b \<longrightarrow> sgn (g y) = 1
[PROOF STEP]
apply (intro exI[where x="st+pi"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>st < i; i < st + pi\<rbrakk> \<Longrightarrow> 0 < g i) \<Longrightarrow> st < st + pi \<and> (\<forall>y>st. y < st + pi \<longrightarrow> sgn (g y) = 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(g has_sgnx 1) (at_right st)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cos st = - 1 \<Longrightarrow> (g has_sgnx 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sin st < 0 \<Longrightarrow> (g has_sgnx 1) (at_right st)
cos st = - 1 \<Longrightarrow> (g has_sgnx 1) (at_right st)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sin st < 0 \<Longrightarrow> (g has_sgnx 1) (at_right st)
cos st = - 1 \<Longrightarrow> (g has_sgnx 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx 1) (at_right st)
[PROOF STEP]
using that(2)
[PROOF STATE]
proof (prove)
using this:
sin st < 0 \<Longrightarrow> (g has_sgnx 1) (at_right st)
cos st = - 1 \<Longrightarrow> (g has_sgnx 1) (at_right st)
sin st < 0 \<or> cos st = - 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>g st = 0; sin st < 0 \<or> cos st = - 1\<rbrakk> \<Longrightarrow> (g has_sgnx 1) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have g_has_sgnx2:"(g has_sgnx -1) (at_right st)" when "g st=0" "sin st > 0 \<or> cos st=1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
have ?thesis when "sin st>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
have "(g has_sgnx sgn (- r * sin st)) (at_right st)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx sgn (- r * sin st)) (at_right st)
[PROOF STEP]
apply (rule has_sgnx_derivative_at_right[of _ "- r * sin st"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (g has_real_derivative - r * sin st) (at st)
 2. g st = 0
 3. - r * sin st \<noteq> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_real_derivative - r * sin st) (at st)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. r * cos i + Re z - Re z0) has_real_derivative - r * sin st) (at st)
[PROOF STEP]
by (auto intro!:derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. g st = 0
 2. - r * sin st \<noteq> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g st = 0
[PROOF STEP]
using \<open>g st=0\<close>
[PROOF STATE]
proof (prove)
using this:
g st = 0

goal (1 subgoal):
 1. g st = 0
[PROOF STEP]
.
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - r * sin st \<noteq> 0
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - r * sin st \<noteq> 0
[PROOF STEP]
using \<open>r>0\<close> \<open>sin st>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r
0 < sin st

goal (1 subgoal):
 1. - r * sin st \<noteq> 0
[PROOF STEP]
by (simp add: mult_pos_neg)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(g has_sgnx sgn (- r * sin st)) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_sgnx sgn (- r * sin st)) (at_right st)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx sgn (- r * sin st)) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
using \<open>r>0\<close> that
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx sgn (- r * sin st)) (at_right st)
0 < r
0 < sin st

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
by (simp add: sgn_mult)
[PROOF STATE]
proof (state)
this:
(g has_sgnx - 1) (at_right st)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < sin st \<Longrightarrow> (g has_sgnx - 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < sin st \<Longrightarrow> (g has_sgnx - 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
have ?thesis when "cos st=1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
have "g i < 0" when "st<i" "i<st+pi" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
obtain k where k_def:"st = 2 * of_int k * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. st = 2 * real_of_int k * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>cos st=1\<close> cos_one_2pi_int
[PROOF STATE]
proof (prove)
using this:
cos st = 1
(cos ?x = 1) = (\<exists>x. ?x = real_of_int x * 2 * pi)

goal (1 subgoal):
 1. (\<And>k. st = 2 * real_of_int k * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
st = 2 * real_of_int k * pi

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
have "cos (i-st) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (i - st) < 1
[PROOF STEP]
using cos_monotone_0_pi[of 0 "i-st" ] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> 0; 0 < i - st; i - st \<le> pi\<rbrakk> \<Longrightarrow> cos (i - st) < cos 0
st < i
i < st + pi

goal (1 subgoal):
 1. cos (i - st) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos (i - st) < 1

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cos (i - st) < 1

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
have "cos (i-st) = cos i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (i - st) = cos i
[PROOF STEP]
apply (rule cos_eq_periodic_intro[of _ _ "-k"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i - st - i = 2 * real_of_int (- k) * pi \<or> i - st + i = 2 * real_of_int (- k) * pi
[PROOF STEP]
unfolding k_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i - 2 * real_of_int k * pi - i = 2 * real_of_int (- k) * pi \<or> i - 2 * real_of_int k * pi + i = 2 * real_of_int (- k) * pi
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cos (i - st) = cos i

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cos (i - st) < 1
cos (i - st) = cos i
[PROOF STEP]
have "cos i<1"
[PROOF STATE]
proof (prove)
using this:
cos (i - st) < 1
cos (i - st) = cos i

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

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cos i < 1
[PROOF STEP]
have "cos st>cos i"
[PROOF STATE]
proof (prove)
using this:
cos i < 1

goal (1 subgoal):
 1. cos i < cos st
[PROOF STEP]
using \<open>cos st=1\<close>
[PROOF STATE]
proof (prove)
using this:
cos i < 1
cos st = 1

goal (1 subgoal):
 1. cos i < cos st
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cos i < cos st

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
have "0 = r * cos st + Re z - Re z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = r * cos st + Re z - Re z0
[PROOF STEP]
using \<open>g st = 0\<close>
[PROOF STATE]
proof (prove)
using this:
g st = 0

goal (1 subgoal):
 1. 0 = r * cos st + Re z - Re z0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 = 0

goal (1 subgoal):
 1. 0 = r * cos st + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = r * cos st + Re z - Re z0

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = r * cos st + Re z - Re z0

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
have "... > r * cos i + Re z - Re z0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * cos i + Re z - Re z0 < r * cos st + Re z - Re z0
[PROOF STEP]
using \<open>cos st > cos i\<close> \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
cos i < cos st
0 < r

goal (1 subgoal):
 1. r * cos i + Re z - Re z0 < r * cos st + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r * cos i + Re z - Re z0 < r * cos st + Re z - Re z0

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
r * cos i + Re z - Re z0 < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r * cos i + Re z - Re z0 < 0

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
r * cos i + Re z - Re z0 < 0

goal (1 subgoal):
 1. r * cos i + Re z - Re z0 < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g i < 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> g ?i < 0

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> g ?i < 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> g ?i < 0

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
unfolding has_sgnx_def eventually_at_right
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>st < ?i; ?i < st + pi\<rbrakk> \<Longrightarrow> g ?i < 0

goal (1 subgoal):
 1. \<exists>b>st. \<forall>y>st. y < b \<longrightarrow> sgn (g y) = - 1
[PROOF STEP]
apply (intro exI[where x="st+pi"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. \<lbrakk>st < i; i < st + pi\<rbrakk> \<Longrightarrow> g i < 0) \<Longrightarrow> st < st + pi \<and> (\<forall>y>st. y < st + pi \<longrightarrow> sgn (g y) = - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(g has_sgnx - 1) (at_right st)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cos st = 1 \<Longrightarrow> (g has_sgnx - 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < sin st \<Longrightarrow> (g has_sgnx - 1) (at_right st)
cos st = 1 \<Longrightarrow> (g has_sgnx - 1) (at_right st)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < sin st \<Longrightarrow> (g has_sgnx - 1) (at_right st)
cos st = 1 \<Longrightarrow> (g has_sgnx - 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
using that(2)
[PROOF STATE]
proof (prove)
using this:
0 < sin st \<Longrightarrow> (g has_sgnx - 1) (at_right st)
cos st = 1 \<Longrightarrow> (g has_sgnx - 1) (at_right st)
0 < sin st \<or> cos st = 1

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_right st)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(g has_sgnx - 1) (at_right st)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>g st = 0; 0 < sin st \<or> cos st = 1\<rbrakk> \<Longrightarrow> (g has_sgnx - 1) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "r * cos st + Re z - Re z0 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "g st \<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g st \<noteq> 0
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 \<noteq> 0

goal (1 subgoal):
 1. g st \<noteq> 0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 \<noteq> 0

goal (1 subgoal):
 1. r * cos st + Re z - Re z0 \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g st \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g st \<noteq> 0
[PROOF STEP]
have "continuous (at_right st) (\<lambda>i. f i / g i)"
[PROOF STATE]
proof (prove)
using this:
g st \<noteq> 0

goal (1 subgoal):
 1. continuous (at_right st) (\<lambda>i. f i / g i)
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 \<noteq> 0

goal (1 subgoal):
 1. continuous (at_right st) (\<lambda>i. (r * sin i + Im z - Im z0) / (r * cos i + Re z - Re z0))
[PROOF STEP]
by (auto intro!:continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous (at_right st) (\<lambda>i. f i / g i)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous (at_right st) (\<lambda>i. f i / g i)
[PROOF STEP]
have "jumpF (\<lambda>i. f i/g i) (at_right st) = 0"
[PROOF STATE]
proof (prove)
using this:
continuous (at_right st) (\<lambda>i. f i / g i)

goal (1 subgoal):
 1. jumpF (\<lambda>i. f i / g i) (at_right st) = 0
[PROOF STEP]
using jumpF_not_infinity[of "at_right st" "(\<lambda>i. f i/g i)"]
[PROOF STATE]
proof (prove)
using this:
continuous (at_right st) (\<lambda>i. f i / g i)
\<lbrakk>continuous (at_right st) (\<lambda>i. f i / g i); at_right st \<noteq> bot\<rbrakk> \<Longrightarrow> jumpF (\<lambda>i. f i / g i) (at_right st) = 0

goal (1 subgoal):
 1. jumpF (\<lambda>i. f i / g i) (at_right st) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 0

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 0

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jumpF_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 0
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
r * cos st + Re z - Re z0 \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
r * cos st + Re z - Re z0 \<noteq> 0 \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r * cos st + Re z - Re z0 \<noteq> 0 \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "r * cos st + Re z - Re z0 = 0"
    "(sin st > 0 \<or> (cos st=1) ) \<and> f st < 0
                    \<or> (sin st < 0 \<or>  (cos st=-1) ) \<and> f st > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "g st = 0" "f st\<noteq>0" and g_cont: "continuous (at_right st) g" and f_cont:"continuous (at_right st) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g st = 0 &&& f st \<noteq> 0) &&& continuous (at_right st) g &&& continuous (at_right st) f
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 = 0
(0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st

goal (1 subgoal):
 1. (g st = 0 &&& f st \<noteq> 0) &&& continuous (at_right st) g &&& continuous (at_right st) f
[PROOF STEP]
unfolding g_def f_def
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 = 0
(0 < sin st \<or> cos st = 1) \<and> r * sin st + Im z - Im z0 < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < r * sin st + Im z - Im z0

goal (1 subgoal):
 1. (r * cos st + Re z - Re z0 = 0 &&& r * sin st + Im z - Im z0 \<noteq> 0) &&& continuous (at_right st) (\<lambda>i. r * cos i + Re z - Re z0) &&& continuous (at_right st) (\<lambda>i. r * sin i + Im z - Im z0)
[PROOF STEP]
by (auto intro!:continuous_intros)
[PROOF STATE]
proof (state)
this:
g st = 0
f st \<noteq> 0
continuous (at_right st) g
continuous (at_right st) f

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "(g has_sgnx sgn (f st)) (at_right st)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx sgn (f st)) (at_right st)
[PROOF STEP]
using g_has_sgnx1[OF \<open>g st=0\<close>] g_has_sgnx2[OF \<open>g st=0\<close>] that(2)
[PROOF STATE]
proof (prove)
using this:
sin st < 0 \<or> cos st = - 1 \<Longrightarrow> (g has_sgnx 1) (at_right st)
0 < sin st \<or> cos st = 1 \<Longrightarrow> (g has_sgnx - 1) (at_right st)
(0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st

goal (1 subgoal):
 1. (g has_sgnx sgn (f st)) (at_right st)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(g has_sgnx sgn (f st)) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_sgnx sgn (f st)) (at_right st)
[PROOF STEP]
have "LIM x at_right st. f x / g x :> at_top"
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx sgn (f st)) (at_right st)

goal (1 subgoal):
 1. LIM x at_right st. f x / g x :> at_top
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of f "f st" "at_right st" g])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (g has_sgnx sgn (f st)) (at_right st) \<Longrightarrow> (f \<longlongrightarrow> f st) (at_right st)
 2. (g has_sgnx sgn (f st)) (at_right st) \<Longrightarrow> f st \<noteq> 0
 3. (g has_sgnx sgn (f st)) (at_right st) \<Longrightarrow> (g \<longlongrightarrow> 0) (at_right st) \<and> (g has_sgnx sgn (f st)) (at_right st)
[PROOF STEP]
using \<open>f st\<noteq>0\<close> \<open>g st = 0\<close> g_cont f_cont
[PROOF STATE]
proof (prove)
using this:
f st \<noteq> 0
g st = 0
continuous (at_right st) g
continuous (at_right st) f

goal (3 subgoals):
 1. (g has_sgnx sgn (f st)) (at_right st) \<Longrightarrow> (f \<longlongrightarrow> f st) (at_right st)
 2. (g has_sgnx sgn (f st)) (at_right st) \<Longrightarrow> f st \<noteq> 0
 3. (g has_sgnx sgn (f st)) (at_right st) \<Longrightarrow> (g \<longlongrightarrow> 0) (at_right st) \<and> (g has_sgnx sgn (f st)) (at_right st)
[PROOF STEP]
by (auto simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
LIM x at_right st. f x / g x :> at_top

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right st. f x / g x :> at_top
[PROOF STEP]
have "jumpF (\<lambda>i. f i/g i) (at_right st) = 1/2"
[PROOF STATE]
proof (prove)
using this:
LIM x at_right st. f x / g x :> at_top

goal (1 subgoal):
 1. jumpF (\<lambda>i. f i / g i) (at_right st) = 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right st. f x / g x :> at_top

goal (1 subgoal):
 1. (if LIM i at_right st. f i / g i :> at_top then 1 / 2 else if LIM i at_right st. f i / g i :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jumpF_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_right st) = 1 / 2
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
r * cos st + Re z - Re z0 = 0
(0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. (r * sin i + Im z - Im z0) / g i) (at_right st) = 1 / 2
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. (r * sin i + Im z - Im z0) / g i) (at_right st)
r * cos st + Re z - Re z0 = 0
(0 < sin st \<or> cos st = 1) \<and> r * sin st + Im z - Im z0 < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < r * sin st + Im z - Im z0

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>r * cos st + Re z - Re z0 = 0; (0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>r * cos st + Re z - Re z0 = 0; (0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "r * cos st + Re z - Re z0 = 0"
    "\<not> ((sin st > 0 \<or> cos st=1 ) \<and> f st < 0
                    \<or> (sin st < 0 \<or>  cos st=-1 ) \<and> f st > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define neq1 where "neq1 = (\<forall>k::int. st \<noteq> 2*k*pi)"
[PROOF STATE]
proof (state)
this:
neq1 = (\<forall>x. st \<noteq> 2 * real_of_int x * pi)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define neq2 where "neq2 = (\<forall>k::int. st \<noteq> 2*k*pi+pi)"
[PROOF STATE]
proof (state)
this:
neq2 = (\<forall>x. st \<noteq> 2 * real_of_int x * pi + pi)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "g st = 0" and g_cont: "continuous (at_right st) g" and f_cont:"continuous (at_right st) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g st = 0 &&& continuous (at_right st) g &&& continuous (at_right st) f
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 = 0
\<not> ((0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st)

goal (1 subgoal):
 1. g st = 0 &&& continuous (at_right st) g &&& continuous (at_right st) f
[PROOF STEP]
unfolding g_def f_def
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 = 0
\<not> ((0 < sin st \<or> cos st = 1) \<and> r * sin st + Im z - Im z0 < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < r * sin st + Im z - Im z0)

goal (1 subgoal):
 1. r * cos st + Re z - Re z0 = 0 &&& continuous (at_right st) (\<lambda>i. r * cos i + Re z - Re z0) &&& continuous (at_right st) (\<lambda>i. r * sin i + Im z - Im z0)
[PROOF STEP]
by (auto intro!:continuous_intros)
[PROOF STATE]
proof (state)
this:
g st = 0
continuous (at_right st) g
continuous (at_right st) f

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "f st\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f st \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> f st \<noteq> 0"
[PROOF STATE]
proof (state)
this:
\<not> f st \<noteq> 0

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

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

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f st = 0
[PROOF STEP]
have "Im (z0 - z) =r * sin st " "Re (z0 - z) = r * cos st"
[PROOF STATE]
proof (prove)
using this:
f st = 0

goal (1 subgoal):
 1. Im (z0 - z) = r * sin st &&& Re (z0 - z) = r * cos st
[PROOF STEP]
using \<open>g st=0\<close>
[PROOF STATE]
proof (prove)
using this:
f st = 0
g st = 0

goal (1 subgoal):
 1. Im (z0 - z) = r * sin st &&& Re (z0 - z) = r * cos st
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
using this:
r * sin st + Im z - Im z0 = 0
r * cos st + Re z - Re z0 = 0

goal (1 subgoal):
 1. Im (z0 - z) = r * sin st &&& Re (z0 - z) = r * cos st
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
Im (z0 - z) = r * sin st
Re (z0 - z) = r * cos st

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Im (z0 - z) = r * sin st
Re (z0 - z) = r * cos st
[PROOF STEP]
have "cmod (z0 - z) = sqrt((r * sin st)^2 + (r * cos st)^2)"
[PROOF STATE]
proof (prove)
using this:
Im (z0 - z) = r * sin st
Re (z0 - z) = r * cos st

goal (1 subgoal):
 1. cmod (z0 - z) = sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2)
[PROOF STEP]
unfolding cmod_def
[PROOF STATE]
proof (prove)
using this:
Im (z0 - z) = r * sin st
Re (z0 - z) = r * cos st

goal (1 subgoal):
 1. sqrt ((Re (z0 - z))\<^sup>2 + (Im (z0 - z))\<^sup>2) = sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod (z0 - z) = sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2)

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (z0 - z) = sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2)

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "... = sqrt (r^2 * ((sin st)^2 + (cos st)^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2) = sqrt (r\<^sup>2 * ((sin st)\<^sup>2 + (cos st)\<^sup>2))
[PROOF STEP]
by (auto simp only:algebra_simps power_mult_distrib)
[PROOF STATE]
proof (state)
this:
sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2) = sqrt (r\<^sup>2 * ((sin st)\<^sup>2 + (cos st)\<^sup>2))

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt ((r * sin st)\<^sup>2 + (r * cos st)\<^sup>2) = sqrt (r\<^sup>2 * ((sin st)\<^sup>2 + (cos st)\<^sup>2))

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "... = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (r\<^sup>2 * ((sin st)\<^sup>2 + (cos st)\<^sup>2)) = r
[PROOF STEP]
using \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. sqrt (r\<^sup>2 * ((sin st)\<^sup>2 + (cos st)\<^sup>2)) = r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (r\<^sup>2 * ((sin st)\<^sup>2 + (cos st)\<^sup>2)) = r

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (z0 - z) = r
[PROOF STEP]
have "cmod (z0 - z) = r"
[PROOF STATE]
proof (prove)
using this:
cmod (z0 - z) = r

goal (1 subgoal):
 1. cmod (z0 - z) = r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (z0 - z) = r

goal (1 subgoal):
 1. \<not> f st \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (z0 - z) = r
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
cmod (z0 - z) = r

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>cmod (z-z0) \<noteq>r\<close>
[PROOF STATE]
proof (prove)
using this:
cmod (z0 - z) = r
cmod (z - z0) \<noteq> r

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

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

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "(sin st > 0 \<or> (cos st=1) ) \<and> f st > 0 \<or> (sin st < 0 \<or>  (cos st=-1) ) \<and> f st < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
have "sin st = 0 \<longleftrightarrow> cos st=-1 \<or> cos st=1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin st = 0) = (cos st = - 1 \<or> cos st = 1)
[PROOF STEP]
by (metis (no_types, opaque_lifting) add.right_neutral cancel_comm_monoid_add_class.diff_cancel
            cos_diff cos_zero mult_eq_0_iff power2_eq_1_iff power2_eq_square sin_squared_eq)
[PROOF STATE]
proof (state)
this:
(sin st = 0) = (cos st = - 1 \<or> cos st = 1)

goal (1 subgoal):
 1. (0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(sin st = 0) = (cos st = - 1 \<or> cos st = 1)

goal (1 subgoal):
 1. (0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
have "((sin st \<le> 0 \<and> cos st \<noteq>1 ) \<or> f st > 0) \<and> ((sin st \<ge> 0 \<and>  cos st\<noteq>-1) \<or> f st < 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin st \<le> 0 \<and> cos st \<noteq> 1 \<or> 0 < f st) \<and> (0 \<le> sin st \<and> cos st \<noteq> - 1 \<or> f st < 0)
[PROOF STEP]
using that(2) \<open>f st\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> ((0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st)
f st \<noteq> 0

goal (1 subgoal):
 1. (sin st \<le> 0 \<and> cos st \<noteq> 1 \<or> 0 < f st) \<and> (0 \<le> sin st \<and> cos st \<noteq> - 1 \<or> f st < 0)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
(sin st \<le> 0 \<and> cos st \<noteq> 1 \<or> 0 < f st) \<and> (0 \<le> sin st \<and> cos st \<noteq> - 1 \<or> f st < 0)

goal (1 subgoal):
 1. (0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(sin st = 0) = (cos st = - 1 \<or> cos st = 1)
(sin st \<le> 0 \<and> cos st \<noteq> 1 \<or> 0 < f st) \<and> (0 \<le> sin st \<and> cos st \<noteq> - 1 \<or> f st < 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(sin st = 0) = (cos st = - 1 \<or> cos st = 1)
(sin st \<le> 0 \<and> cos st \<noteq> 1 \<or> 0 < f st) \<and> (0 \<le> sin st \<and> cos st \<noteq> - 1 \<or> f st < 0)

goal (1 subgoal):
 1. (0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
by (meson linorder_neqE_linordered_idom not_le)
[PROOF STATE]
proof (state)
this:
(0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
[PROOF STEP]
have "(g has_sgnx - sgn (f st)) (at_right st)"
[PROOF STATE]
proof (prove)
using this:
(0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0

goal (1 subgoal):
 1. (g has_sgnx - sgn (f st)) (at_right st)
[PROOF STEP]
using g_has_sgnx1[OF \<open>g st=0\<close>] g_has_sgnx2[OF \<open>g st=0\<close>]
[PROOF STATE]
proof (prove)
using this:
(0 < sin st \<or> cos st = 1) \<and> 0 < f st \<or> (sin st < 0 \<or> cos st = - 1) \<and> f st < 0
sin st < 0 \<or> cos st = - 1 \<Longrightarrow> (g has_sgnx 1) (at_right st)
0 < sin st \<or> cos st = 1 \<Longrightarrow> (g has_sgnx - 1) (at_right st)

goal (1 subgoal):
 1. (g has_sgnx - sgn (f st)) (at_right st)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(g has_sgnx - sgn (f st)) (at_right st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_sgnx - sgn (f st)) (at_right st)
[PROOF STEP]
have "LIM x at_right st. f x / g x :> at_bot"
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx - sgn (f st)) (at_right st)

goal (1 subgoal):
 1. LIM x at_right st. f x / g x :> at_bot
[PROOF STEP]
apply (subst filterlim_divide_at_bot_at_top_iff[of f "f st" "at_right st" g])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (g has_sgnx - sgn (f st)) (at_right st) \<Longrightarrow> (f \<longlongrightarrow> f st) (at_right st)
 2. (g has_sgnx - sgn (f st)) (at_right st) \<Longrightarrow> f st \<noteq> 0
 3. (g has_sgnx - sgn (f st)) (at_right st) \<Longrightarrow> (g \<longlongrightarrow> 0) (at_right st) \<and> (g has_sgnx - sgn (f st)) (at_right st)
[PROOF STEP]
using \<open>f st\<noteq>0\<close> \<open>g st = 0\<close> g_cont f_cont
[PROOF STATE]
proof (prove)
using this:
f st \<noteq> 0
g st = 0
continuous (at_right st) g
continuous (at_right st) f

goal (3 subgoals):
 1. (g has_sgnx - sgn (f st)) (at_right st) \<Longrightarrow> (f \<longlongrightarrow> f st) (at_right st)
 2. (g has_sgnx - sgn (f st)) (at_right st) \<Longrightarrow> f st \<noteq> 0
 3. (g has_sgnx - sgn (f st)) (at_right st) \<Longrightarrow> (g \<longlongrightarrow> 0) (at_right st) \<and> (g has_sgnx - sgn (f st)) (at_right st)
[PROOF STEP]
by (auto simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
LIM x at_right st. f x / g x :> at_bot

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_right st. f x / g x :> at_bot
[PROOF STEP]
have "jumpF (\<lambda>i. f i/g i) (at_right st) = -1/2"
[PROOF STATE]
proof (prove)
using this:
LIM x at_right st. f x / g x :> at_bot

goal (1 subgoal):
 1. jumpF (\<lambda>i. f i / g i) (at_right st) = - 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_right st. f x / g x :> at_bot

goal (1 subgoal):
 1. (if LIM i at_right st. f i / g i :> at_top then 1 / 2 else if LIM i at_right st. f i / g i :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>i. f i / g i) (at_right st) = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>i. f i / g i) (at_right st) = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_right st) = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using jumpF_eq that
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_right st) = - 1 / 2
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_right st)
r * cos st + Re z - Re z0 = 0
\<not> ((0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. (r * sin i + Im z - Im z0) / g i) (at_right st) = - 1 / 2
jumpF_pathstart (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. (r * sin i + Im z - Im z0) / g i) (at_right st)
r * cos st + Re z - Re z0 = 0
\<not> ((0 < sin st \<or> cos st = 1) \<and> r * sin st + Im z - Im z0 < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < r * sin st + Im z - Im z0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>r * cos st + Re z - Re z0 = 0; \<not> ((0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st)\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r * cos st + Re z - Re z0 \<noteq> 0 \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>r * cos st + Re z - Re z0 = 0; (0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>r * cos st + Re z - Re z0 = 0; \<not> ((0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st)\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r * cos st + Re z - Re z0 \<noteq> 0 \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>r * cos st + Re z - Re z0 = 0; (0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
\<lbrakk>r * cos st + Re z - Re z0 = 0; \<not> ((0 < sin st \<or> cos st = 1) \<and> f st < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < f st)\<rbrakk> \<Longrightarrow> jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
jumpF_pathstart (part_circlepath z r st tt) z0 = (if r * cos st + Re z - Re z0 = 0 then let \<Delta> = r * sin st + Im z - Im z0 in if (0 < sin st \<or> cos st = 1) \<and> \<Delta> < 0 \<or> (sin st < 0 \<or> cos st = - 1) \<and> 0 < \<Delta> then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_inv_sqrt_pow2: "0 < x \<Longrightarrow> (inverse (sqrt x))\<^sup>2 = inverse x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (inverse (sqrt x))\<^sup>2 = inverse x
[PROOF STEP]
by (simp add: power_inverse)


[STATEMENT]
lemma "(0::real) < 1 + x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 + x\<^sup>2
[PROOF STEP]
by (sos "((R<1 + ((R<1 * (R<1 * [x]^2)) + ((A<=0 * R<1) * (R<1 * [1]^2)))))")


[STATEMENT]
lemma "foo_cost \<in> \<Theta>(\<lambda>n. real n powr akra_bazzi_exponent [1,1] [1/3,3/4])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foo_cost \<in> \<Theta>(\<lambda>n. real n powr akra_bazzi_exponent [1, 1] [1 / 3, 3 / 4])
[PROOF STEP]
proof (master_theorem 1 p': 1)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. \<And>x. \<lbrakk>0 \<le> x; x < 200\<rbrakk> \<Longrightarrow> 0 \<le> foo_cost x
 2. \<And>x. 200 \<le> x \<Longrightarrow> foo_cost x = real x + (foo_cost (nat \<lfloor>real x / 3\<rfloor>) + foo_cost (nat \<lfloor>3 * real x / 4\<rfloor> + 42))
 3. \<And>x. 200 \<le> x \<Longrightarrow> 0 \<le> real x
 4. real \<in> O(real)
 5. 1 < (1 / 3) powr 1 + (3 / 4) powr 1
 6. \<forall>\<^sub>F x in sequentially. 0 < foo_cost x
[PROOF STEP]
have "\<forall>n\<ge>200. foo_cost n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<ge>200. 0 < foo_cost n
[PROOF STEP]
by (simp add: add_nonneg_pos)
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>200. 0 < foo_cost n

goal (6 subgoals):
 1. \<And>x. \<lbrakk>0 \<le> x; x < 200\<rbrakk> \<Longrightarrow> 0 \<le> foo_cost x
 2. \<And>x. 200 \<le> x \<Longrightarrow> foo_cost x = real x + (foo_cost (nat \<lfloor>real x / 3\<rfloor>) + foo_cost (nat \<lfloor>3 * real x / 4\<rfloor> + 42))
 3. \<And>x. 200 \<le> x \<Longrightarrow> 0 \<le> real x
 4. real \<in> O(real)
 5. 1 < (1 / 3) powr 1 + (3 / 4) powr 1
 6. \<forall>\<^sub>F x in sequentially. 0 < foo_cost x
[PROOF STEP]
thus "eventually (\<lambda>n. foo_cost n > 0) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>200. 0 < foo_cost n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < foo_cost n
[PROOF STEP]
unfolding eventually_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>200. 0 < foo_cost n

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. 0 < foo_cost n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < foo_cost n

goal (5 subgoals):
 1. \<And>x. \<lbrakk>0 \<le> x; x < 200\<rbrakk> \<Longrightarrow> 0 \<le> foo_cost x
 2. \<And>x. 200 \<le> x \<Longrightarrow> foo_cost x = real x + (foo_cost (nat \<lfloor>real x / 3\<rfloor>) + foo_cost (nat \<lfloor>3 * real x / 4\<rfloor> + 42))
 3. \<And>x. 200 \<le> x \<Longrightarrow> 0 \<le> real x
 4. real \<in> O(real)
 5. 1 < (1 / 3) powr 1 + (3 / 4) powr 1
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma unitary_gen_iff':
  shows "unitary_gen M \<longleftrightarrow>
         (\<exists> k::complex. k \<noteq> 0 \<and> congruence M (1, 0, 0, 1) = k *\<^sub>s\<^sub>m (1, 0, 0, 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary_gen M = (\<exists>k. k \<noteq> 0 \<and> congruence M (1, 0, 0, 1) = k *\<^sub>s\<^sub>m (1, 0, 0, 1))
[PROOF STEP]
unfolding unitary_gen_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>k. k \<noteq> 0 \<and> mat_adj M *\<^sub>m\<^sub>m M = k *\<^sub>s\<^sub>m eye) = (\<exists>k. k \<noteq> 0 \<and> congruence M (1, 0, 0, 1) = k *\<^sub>s\<^sub>m (1, 0, 0, 1))
[PROOF STEP]
using mat_eye_r
[PROOF STATE]
proof (prove)
using this:
?A *\<^sub>m\<^sub>m eye = ?A

goal (1 subgoal):
 1. (\<exists>k. k \<noteq> 0 \<and> mat_adj M *\<^sub>m\<^sub>m M = k *\<^sub>s\<^sub>m eye) = (\<exists>k. k \<noteq> 0 \<and> congruence M (1, 0, 0, 1) = k *\<^sub>s\<^sub>m (1, 0, 0, 1))
[PROOF STEP]
by (auto simp add: mult.assoc)


[STATEMENT]
lemma from_hma\<^sub>m_diff: "from_hma\<^sub>m a - from_hma\<^sub>m b = from_hma\<^sub>m (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_hma\<^sub>m a - from_hma\<^sub>m b = from_hma\<^sub>m (a - b)
[PROOF STEP]
unfolding from_hma\<^sub>m_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat CARD('c) CARD('b) (\<lambda>(i, j). a $h Bij_Nat.from_nat i $h Bij_Nat.from_nat j) - Matrix.mat CARD('c) CARD('b) (\<lambda>(i, j). b $h Bij_Nat.from_nat i $h Bij_Nat.from_nat j) = Matrix.mat CARD('c) CARD('b) (\<lambda>(i, j). (a - b) $h Bij_Nat.from_nat i $h Bij_Nat.from_nat j)
[PROOF STEP]
by auto


[STATEMENT]
lemma inc_nat_pow:
  assumes "a \<in> carrier Z\<^sub>p"
  shows "\<iota> ([(n::nat)] \<cdot>\<^bsub>Z\<^sub>p\<^esub>a) = [n]\<cdot>(\<iota> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<iota> ([0] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [0] \<cdot> \<iota> a
 2. \<And>n. \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a \<Longrightarrow> \<iota> ([Suc n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [Suc n] \<cdot> \<iota> a
[PROOF STEP]
apply (metis Q\<^sub>p_def Qp.int_inc_zero Qp.nat_mult_zero Zp.add.nat_pow_0 Zp_int_inc_zero' \<iota>_def frac_inc_of_int)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a \<Longrightarrow> \<iota> ([Suc n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [Suc n] \<cdot> \<iota> a
[PROOF STEP]
unfolding Qp.add.nat_pow_Suc Zp.add.nat_pow_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a \<Longrightarrow> \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a \<oplus>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a \<oplus> \<iota> a
[PROOF STEP]
using Zp_nat_mult_closed assms inc_of_sum
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier Z\<^sub>p \<Longrightarrow> [?n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> ?x \<in> carrier Z\<^sub>p
a \<in> carrier Z\<^sub>p
\<lbrakk>?a \<in> carrier Z\<^sub>p; ?b \<in> carrier Z\<^sub>p\<rbrakk> \<Longrightarrow> \<iota> (?a \<oplus>\<^bsub>Z\<^sub>p\<^esub> ?b) = \<iota> ?a \<oplus> \<iota> ?b

goal (1 subgoal):
 1. \<And>n. \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a \<Longrightarrow> \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> a \<oplus>\<^bsub>Z\<^sub>p\<^esub> a) = [n] \<cdot> \<iota> a \<oplus> \<iota> a
[PROOF STEP]
by presburger


[STATEMENT]
lemma iT_Div_card_ge__is_maximal_lower_bound: "
  \<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and>
        f (card I) d \<le> card (I \<oslash> d) \<Longrightarrow>
  f (card (I::nat set)) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d) \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (case_tac "I = {}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I = {}\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (erule_tac x=I in allE, erule_tac x=d in allE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I = {}; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d)\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (simp add: iT_Div_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (case_tac "d = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d = 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (frule_tac x="{}" in spec, erule_tac x=I in allE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; d = 0; \<forall>d. card {} div d + (if card {} mod d = 0 then 0 else Suc 0) \<le> f (card {}) d \<and> f (card {}) d \<le> card ({} \<oslash> d); \<forall>d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d)\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (erule_tac x=d in allE, erule_tac x=d in allE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; d = 0; card {} div d + (if card {} mod d = 0 then 0 else Suc 0) \<le> f (card {}) d \<and> f (card {}) d \<le> card ({} \<oslash> d); card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d)\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (clarsimp simp: iT_Div_0 iTILL_card iT_Div_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (rule order_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (case_tac "finite I")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0; finite I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0; infinite I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0; infinite I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0; finite I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (erule_tac x=I in allE, erule_tac x=d in allE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; d \<noteq> 0; infinite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d)\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
 2. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0; finite I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (simp add: iT_Div_finite_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>I d. card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d \<and> f (card I) d \<le> card (I \<oslash> d); I \<noteq> {}; d \<noteq> 0; finite I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (erule_tac x="[\<dots>card I - Suc 0]" in allE, erule_tac x=d in allE, elim conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; d \<noteq> 0; finite I; card [\<dots>card I - Suc 0] div d + (if card [\<dots>card I - Suc 0] mod d = 0 then 0 else Suc 0) \<le> f (card [\<dots>card I - Suc 0]) d; f (card [\<dots>card I - Suc 0]) d \<le> card ([\<dots>card I - Suc 0] \<oslash> d)\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (frule not_empty_card_gr0_conv[THEN iffD1], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; d \<noteq> 0; finite I; card [\<dots>card I - Suc 0] div d + (if card [\<dots>card I - Suc 0] mod d = 0 then 0 else Suc 0) \<le> f (card [\<dots>card I - Suc 0]) d; f (card [\<dots>card I - Suc 0]) d \<le> card ([\<dots>card I - Suc 0] \<oslash> d); 0 < card I\<rbrakk> \<Longrightarrow> f (card I) d \<le> card I div d + (if card I mod d = 0 then 0 else Suc 0)
[PROOF STEP]
apply (simp add: iTILL_card iTILL_div)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I\<rbrakk> \<Longrightarrow> (card I mod d = 0 \<longrightarrow> f (card I) d = card I div d) \<and> (0 < card I mod d \<longrightarrow> f (card I) d = Suc (card I div d))
[PROOF STEP]
apply (intro conjI impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; card I mod d = 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d
 2. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply (simp add: mod_0_imp_sub_1_div_conv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0\<rbrakk> \<Longrightarrow> f (card I) d = card I div d
 2. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply (subgoal_tac "d \<le> card I")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0; d \<le> card I\<rbrakk> \<Longrightarrow> f (card I) d = card I div d
 2. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0\<rbrakk> \<Longrightarrow> d \<le> card I
 3. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0\<rbrakk> \<Longrightarrow> d \<le> card I
 2. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0; d \<le> card I\<rbrakk> \<Longrightarrow> f (card I) d = card I div d
 3. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply (clarsimp elim!: dvdE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0; d \<le> card I\<rbrakk> \<Longrightarrow> f (card I) d = card I div d
 2. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply (drule div_le_mono[of d _ d])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d \<le> f (card I) d; f (card I) d \<le> Suc (card I div d - Suc 0); 0 < card I; card I mod d = 0; d div d \<le> card I div d\<rbrakk> \<Longrightarrow> f (card I) d = card I div d
 2. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply (case_tac "d = Suc 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> {}; 0 < d; finite I; card I div d + (if card I mod d = 0 then 0 else Suc 0) \<le> f (card I) d; f (card I) d \<le> Suc ((card I - Suc 0) div d); 0 < card I; 0 < card I mod d; d \<noteq> Suc 0\<rbrakk> \<Longrightarrow> f (card I) d = Suc (card I div d)
[PROOF STEP]
apply (simp add: div_diff1_eq1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma eexp_special_values [simp]:
  "eexp 0 = 1"
  "eexp (\<infinity>) = \<infinity>"
  "eexp(-\<infinity>) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eexp 0 = 1 &&& eexp \<infinity> = \<infinity> &&& eexp (- \<infinity>) = 0
[PROOF STEP]
unfolding eexp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2ereal (ennexp 0) = 1 &&& enn2ereal (ennexp \<infinity>) = \<infinity> &&& enn2ereal (ennexp (- \<infinity>)) = 0
[PROOF STEP]
by (auto simp add: zero_ennreal.rep_eq one_ennreal.rep_eq)


[STATEMENT]
lemma lookup_mult_vec:
  "lookup (p ** q) v = lookup ((proj_poly (component_of_term v) p) * (proj_poly (component_of_term v) q)) (pp_of_term v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (p ** q) v = lookup (proj_poly (component_of_term v) p * proj_poly (component_of_term v) q) (pp_of_term v)
[PROOF STEP]
unfolding mult_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (lift_poly_fun_2 (*) p q) v = lookup (proj_poly (component_of_term v) p * proj_poly (component_of_term v) q) (pp_of_term v)
[PROOF STEP]
by (rule lookup_lift_poly_fun_2_homogenous, simp)


[STATEMENT]
lemma finite_union_of_Un:
   "\<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(finite union_of P) S; (finite union_of P) T\<rbrakk> \<Longrightarrow> (finite union_of P) (S \<union> T)
[PROOF STEP]
by (auto simp: union_of_def)


[STATEMENT]
lemma epred_iadd1: "a \<noteq> 0 \<Longrightarrow> epred (a + b) = epred a + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> epred (a + b) = epred a + b
[PROOF STEP]
apply(cases a b rule: enat.exhaust[case_product enat.exhaust])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>nat__ nata__. \<lbrakk>a \<noteq> 0; a = enat nat__; b = enat nata__\<rbrakk> \<Longrightarrow> epred (a + b) = epred a + b
 2. \<And>nat__. \<lbrakk>a \<noteq> 0; a = enat nat__; b = \<infinity>\<rbrakk> \<Longrightarrow> epred (a + b) = epred a + b
 3. \<And>nat__. \<lbrakk>a \<noteq> 0; a = \<infinity>; b = enat nat__\<rbrakk> \<Longrightarrow> epred (a + b) = epred a + b
 4. \<lbrakk>a \<noteq> 0; a = \<infinity>; b = \<infinity>\<rbrakk> \<Longrightarrow> epred (a + b) = epred a + b
[PROOF STEP]
apply(simp_all add: epred_conv_minus eSuc_def one_enat_def zero_enat_def split: enat.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unit_disc_fix_f_unit_disc:
  assumes "unit_disc_fix_f M"
  shows "M ` unit_disc = unit_disc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M ` unit_disc = unit_disc
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix_f M

goal (1 subgoal):
 1. M ` unit_disc = unit_disc
[PROOF STEP]
unfolding unit_disc_fix_f_def
[PROOF STATE]
proof (prove)
using this:
\<exists>Ma. unit_disc_fix Ma \<and> (M = moebius_pt Ma \<or> M = moebius_pt Ma \<circ> conjugate)

goal (1 subgoal):
 1. M ` unit_disc = unit_disc
[PROOF STEP]
using image_comp
[PROOF STATE]
proof (prove)
using this:
\<exists>Ma. unit_disc_fix Ma \<and> (M = moebius_pt Ma \<or> M = moebius_pt Ma \<circ> conjugate)
?f ` ?g ` ?r = (?f \<circ> ?g) ` ?r

goal (1 subgoal):
 1. M ` unit_disc = unit_disc
[PROOF STEP]
by force


[STATEMENT]
lemma Times_mset_subset_mset_cancel1: "x \<in># A \<Longrightarrow> (A \<times># B \<subseteq># A \<times># C) = (B \<subseteq># C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in># A \<Longrightarrow> (A \<times># B \<subseteq># A \<times># C) = (B \<subseteq># C)
[PROOF STEP]
by (auto simp: subseteq_mset_def count_Sigma_mset)


[STATEMENT]
lemma unatSuc: "1 + n \<noteq> 0 \<Longrightarrow> unat (1 + n) = Suc (unat n)"
  for n :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + n \<noteq> 0 \<Longrightarrow> unat (1 + n) = Suc (unat n)
[PROOF STEP]
by unat_arith


[STATEMENT]
lemma open_segment_in_Reals:
   "\<lbrakk>x \<in> open_segment a b; a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> x \<in> Reals"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> open_segment a b; a \<in> \<real>; b \<in> \<real>\<rbrakk> \<Longrightarrow> x \<in> \<real>
[PROOF STEP]
by (metis Diff_iff closed_segment_in_Reals open_segment_def)


[STATEMENT]
lemma coprime_add_mult_iff2 [simp]:
     "coprime (k * m + n) (m::'a::semiring_gcd) = coprime n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (k * m + n) m = coprime n m
[PROOF STEP]
by (simp add: add.commute)