[STATEMENT]
lemma jumpF_pathfinish_part_circlepath:
  assumes "st<tt" "r>0" "cmod (z-z0) \<noteq>r"
  shows "jumpF_pathfinish (part_circlepath z r st tt) z0 = (
            if r * cos tt + Re z - Re z0 = 0 then
              (let
                \<Delta> = r* sin tt + Im z - Im z0
              in
                if (sin tt > 0 \<or> cos tt=-1 ) \<and> \<Delta> < 0
                    \<or> (sin tt < 0 \<or>  cos tt=1 ) \<and> \<Delta> > 0  then
                  - 1/2
                else
                  1/2)
            else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < \<Delta> then - 1 / 2 else 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < \<Delta> then - 1 / 2 else 1 / 2 else 0)
[PROOF STEP]
have jumpF_eq:"jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i/g i) (at_left tt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_left tt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_left tt)
[PROOF STEP]
have "jumpF_pathfinish (part_circlepath z r st tt) z0
        = jumpF ((\<lambda>i. f i/g i) o linepath st tt) (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_left 1)
[PROOF STEP]
unfolding jumpF_pathfinish_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_left 1) = jumpF (\<lambda>x. (r * sin (linepath st tt x) + Im z - Im z0) / (r * cos (linepath st tt x) + Re z - Re z0)) (at_left 1)
[PROOF STEP]
by (simp add:cos_of_real sin_of_real algebra_simps)
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_left 1)

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

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_left tt)
[PROOF STEP]
have "... = jumpF (\<lambda>i. f i/g i) (at_left tt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_left 1) = jumpF (\<lambda>i. f i / g i) (at_left tt)
[PROOF STEP]
using jumpF_linear_comp(1)[of "tt-st" "(\<lambda>i. f i/g i)" st 1,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_left ((tt - st) * 1 + st)) else jumpF (\<lambda>i. f i / g i) (at_right ((tt - st) * 1 + st))) = jumpF ((\<lambda>i. f i / g i) \<circ> (\<lambda>x. (tt - st) * x + st)) (at_left 1)
st < tt

goal (1 subgoal):
 1. jumpF ((\<lambda>i. f i / g i) \<circ> linepath st tt) (at_left 1) = jumpF (\<lambda>i. f i / g i) (at_left tt)
[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_left ((tt - st) * 1 + st)) else jumpF (\<lambda>i. f i / g i) (at_right ((tt - st) * 1 + st))) = jumpF ((\<lambda>i. f i / g i) \<circ> (\<lambda>x. (tt - st) * x + st)) (at_left 1)
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_left 1) = jumpF (\<lambda>i. f i / g i) (at_left tt)
[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_left 1) = jumpF (\<lambda>i. f i / g i) (at_left tt)

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

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

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

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

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

goal (1 subgoal):
 1. - r * sin tt \<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 tt)) (at_left tt)

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

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

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

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

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

goal (1 subgoal):
 1. (g has_sgnx - 1) (at_left tt)
[PROOF STEP]
have ?thesis when "cos tt=1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_left tt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx - 1) (at_left tt)
[PROOF STEP]
have "g i < 0" when "tt-pi<i" "i<tt" 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:"tt = 2 * of_int k * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. tt = 2 * real_of_int k * pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>cos tt=1\<close> cos_one_2pi_int
[PROOF STATE]
proof (prove)
using this:
cos tt = 1
(cos ?x = 1) = (\<exists>x. ?x = real_of_int x * 2 * pi)

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

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

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

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

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
have "cos (i-tt) = cos i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (i - tt) = cos i
[PROOF STEP]
apply (rule cos_eq_periodic_intro[of _ _ "-k"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i - tt - i = 2 * real_of_int (- k) * pi \<or> i - tt + 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 - tt) = cos i

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

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

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

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

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

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

goal (1 subgoal):
 1. g i < 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = r * cos tt + 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 tt + Re z - Re z0
[PROOF STEP]
using \<open>cos tt > cos i\<close> \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
cos i < cos tt
0 < r

goal (1 subgoal):
 1. r * cos i + Re z - Re z0 < r * cos tt + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r * cos i + Re z - Re z0 < r * cos tt + 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>tt - pi < ?i; ?i < tt\<rbrakk> \<Longrightarrow> g ?i < 0

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. - r * sin tt \<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 tt)) (at_left tt)

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

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

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

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

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

goal (1 subgoal):
 1. (g has_sgnx 1) (at_left tt)
[PROOF STEP]
have ?thesis when "cos tt = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_left tt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g has_sgnx 1) (at_left tt)
[PROOF STEP]
have "g i > 0" when "tt-pi<i" "i<tt" 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:"tt = 2 * of_int k * pi+ pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. tt = 2 * real_of_int k * pi + pi \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>cos tt = -1\<close>
[PROOF STATE]
proof (prove)
using this:
cos tt = - 1

goal (1 subgoal):
 1. (\<And>k. tt = 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:
tt = 2 * real_of_int k * pi + pi

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

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

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

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
have "cos (i-tt) = - cos i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (i - tt) = - cos i
[PROOF STEP]
apply (rule cos_eq_neg_periodic_intro[of _ _ "-k-1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i - tt - i = 2 * real_of_int (- k - 1) * pi + pi \<or> i - tt + 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 - tt) = - cos i

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

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

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

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

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

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

goal (1 subgoal):
 1. 0 < g i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = r * cos tt + 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 tt + Re z - Re z0 < r * cos i + Re z - Re z0
[PROOF STEP]
using \<open>cos tt < cos i\<close> \<open>r>0\<close>
[PROOF STATE]
proof (prove)
using this:
cos tt < cos i
0 < r

goal (1 subgoal):
 1. r * cos tt + Re z - Re z0 < r * cos i + Re z - Re z0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r * cos tt + 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>tt - pi < ?i; ?i < tt\<rbrakk> \<Longrightarrow> 0 < g ?i

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

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

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

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. continuous (at_left tt) (\<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_left tt) (\<lambda>i. f i / g i)

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

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

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

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_left tt) = 0

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = 0
jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_left tt)
r * cos tt + Re z - Re z0 \<noteq> 0

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

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

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

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

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

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

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

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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 tt)) (at_left tt)
[PROOF STEP]
have "LIM x at_left tt. f x / g x :> at_bot"
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx - sgn (f tt)) (at_left tt)

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

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

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

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

goal (1 subgoal):
 1. (if LIM i at_left tt. f i / g i :> at_top then 1 / 2 else if LIM i at_left tt. 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_left tt) = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_left tt) = - 1 / 2

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = - 1 / 2
jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_left tt)
r * cos tt + Re z - Re z0 = 0
(0 < sin tt \<or> cos tt = - 1) \<and> f tt < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < f tt

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = - 1 / 2
jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. (r * sin i + Im z - Im z0) / g i) (at_left tt)
r * cos tt + Re z - Re z0 = 0
(0 < sin tt \<or> cos tt = - 1) \<and> r * sin tt + Im z - Im z0 < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < r * sin tt + Im z - Im z0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. \<not> f tt \<noteq> 0 \<Longrightarrow> False
[PROOF STEP]
have "... = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (r\<^sup>2 * ((sin tt)\<^sup>2 + (cos tt)\<^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 tt)\<^sup>2 + (cos tt)\<^sup>2)) = r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (r\<^sup>2 * ((sin tt)\<^sup>2 + (cos tt)\<^sup>2)) = r

goal (1 subgoal):
 1. \<not> f tt \<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 tt \<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 tt \<noteq> 0

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < \<Delta> then - 1 / 2 else 1 / 2 else 0)
[PROOF STEP]
have "(sin tt > 0 \<or> cos tt=-1 ) \<and> f tt > 0 \<or> (sin tt < 0 \<or>  cos tt=1 ) \<and> f tt < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < sin tt \<or> cos tt = - 1) \<and> 0 < f tt \<or> (sin tt < 0 \<or> cos tt = 1) \<and> f tt < 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0 < sin tt \<or> cos tt = - 1) \<and> 0 < f tt \<or> (sin tt < 0 \<or> cos tt = 1) \<and> f tt < 0
[PROOF STEP]
have "sin tt = 0 \<longleftrightarrow> cos tt=-1 \<or> cos tt=1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin tt = 0) = (cos tt = - 1 \<or> cos tt = 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 tt = 0) = (cos tt = - 1 \<or> cos tt = 1)

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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 tt)) (at_left tt)
[PROOF STEP]
have "LIM x at_left tt. f x / g x :> at_top"
[PROOF STATE]
proof (prove)
using this:
(g has_sgnx sgn (f tt)) (at_left tt)

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

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

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

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

goal (1 subgoal):
 1. (if LIM i at_left tt. f i / g i :> at_top then 1 / 2 else if LIM i at_left tt. 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_left tt) = 1 / 2

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>i. f i / g i) (at_left tt) = 1 / 2

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = 1 / 2
jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. f i / g i) (at_left tt)
r * cos tt + Re z - Re z0 = 0
\<not> ((0 < sin tt \<or> cos tt = - 1) \<and> f tt < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < f tt)

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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_left tt) = 1 / 2
jumpF_pathfinish (part_circlepath z r st tt) z0 = jumpF (\<lambda>i. (r * sin i + Im z - Im z0) / g i) (at_left tt)
r * cos tt + Re z - Re z0 = 0
\<not> ((0 < sin tt \<or> cos tt = - 1) \<and> r * sin tt + Im z - Im z0 < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < r * sin tt + Im z - Im z0)

goal (1 subgoal):
 1. jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < \<Delta> then - 1 / 2 else 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 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 tt + Re z - Re z0 = 0; \<not> ((0 < sin tt \<or> cos tt = - 1) \<and> f tt < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < f tt)\<rbrakk> \<Longrightarrow> jumpF_pathfinish (part_circlepath z r st tt) z0 = (if r * cos tt + Re z - Re z0 = 0 then let \<Delta> = r * sin tt + Im z - Im z0 in if (0 < sin tt \<or> cos tt = - 1) \<and> \<Delta> < 0 \<or> (sin tt < 0 \<or> cos tt = 1) \<and> 0 < \<Delta> then - 1 / 2 else 1 / 2 else 0)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_closed_coclop:
  fixes X :: "'a::complete_lattice set"
  shows "Sup_closed_set X \<Longrightarrow> coclop (\<lambda>y. \<Squnion>{x \<in> X. x \<le> y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_closed_set X \<Longrightarrow> coclop (\<lambda>y. \<Squnion> {x \<in> X. x \<le> y})
[PROOF STEP]
unfolding Sup_closed_set_def coclop_def mono_def le_fun_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Y\<subseteq>X. \<Squnion> Y \<in> X \<Longrightarrow> (\<forall>x. \<Squnion> {xa \<in> X. xa \<le> x} \<le> id x) \<and> (\<forall>x y. x \<le> y \<longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {x \<in> X. x \<le> y}) \<and> (\<forall>x. \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {xa \<in> X. xa \<le> \<Squnion> {xa \<in> X. xa \<le> x}})
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<forall>Y\<subseteq>X. \<Squnion> Y \<in> X \<Longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> id x
 2. \<And>x y. \<lbrakk>\<forall>Y\<subseteq>X. \<Squnion> Y \<in> X; x \<le> y\<rbrakk> \<Longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {x \<in> X. x \<le> y}
 3. \<And>x. \<forall>Y\<subseteq>X. \<Squnion> Y \<in> X \<Longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {xa \<in> X. xa \<le> \<Squnion> {xa \<in> X. xa \<le> x}}
[PROOF STEP]
apply (metis (no_types, lifting) Sup_least eq_id_iff mem_Collect_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<lbrakk>\<forall>Y\<subseteq>X. \<Squnion> Y \<in> X; x \<le> y\<rbrakk> \<Longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {x \<in> X. x \<le> y}
 2. \<And>x. \<forall>Y\<subseteq>X. \<Squnion> Y \<in> X \<Longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {xa \<in> X. xa \<le> \<Squnion> {xa \<in> X. xa \<le> x}}
[PROOF STEP]
apply (smt Collect_mono_iff Sup_subset_mono dual_order.trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<forall>Y\<subseteq>X. \<Squnion> Y \<in> X \<Longrightarrow> \<Squnion> {xa \<in> X. xa \<le> x} \<le> \<Squnion> {xa \<in> X. xa \<le> \<Squnion> {xa \<in> X. xa \<le> x}}
[PROOF STEP]
by (simp add: Collect_mono_iff Sup_subset_mono Sup_upper)


[STATEMENT]
lemma UP_smult_assoc2:
  "[| a \<in> carrier R; p \<in> carrier P; q \<in> carrier P |] ==>
  (a \<odot>\<^bsub>P\<^esub> p) \<otimes>\<^bsub>P\<^esub> q = a \<odot>\<^bsub>P\<^esub> (p \<otimes>\<^bsub>P\<^esub> q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; p \<in> carrier P; q \<in> carrier P\<rbrakk> \<Longrightarrow> a \<odot>\<^bsub>P\<^esub> p \<otimes>\<^bsub>P\<^esub> q = a \<odot>\<^bsub>P\<^esub> (p \<otimes>\<^bsub>P\<^esub> q)
[PROOF STEP]
by (rule up_eqI) (simp_all add: R.finsum_rdistr R.m_assoc Pi_def)


[STATEMENT]
lemma vdisjnt_vifunion_iff:
  "vdisjnt A (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i) \<longleftrightarrow> (\<forall>i\<in>\<^sub>\<circ>I. vdisjnt A (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt A (\<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I)) = (\<forall>i\<in>elts I. vdisjnt A (f i))
[PROOF STEP]
by (force intro!: vsubset_antisym simp: vdisjnt_iff)+


[STATEMENT]
lemma slim_nodes_sharp: "nodes (slim_node k a h) * k = bound k h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (slim_node k a h) * k = bound k h
[PROOF STEP]
apply(induction k a h rule: slim_node.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k c. nodes (slim_node k c 0) * k = bound k 0
 2. \<And>k c n. \<lbrakk>nodes (slim_node k c n) * k = bound k n; nodes (slim_node k c n) * k = bound k n\<rbrakk> \<Longrightarrow> nodes (slim_node k c (Suc n)) * k = bound k (Suc n)
[PROOF STEP]
apply (auto simp add: height_slim_node algebra_simps sum_list_replicate compow_id_point)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma kk_squared [simp]: "\<k>^2 = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<k>\<^sup>2 = - 1
[PROOF STEP]
by (simp add: power2_eq_square quat.expand)


[STATEMENT]
lemma bounded_pos_less: "bounded S \<longleftrightarrow> (\<exists>b>0. \<forall>x\<in> S. norm x < b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S = (\<exists>b>0. \<forall>x\<in>S. norm x < b)
[PROOF STEP]
by (metis bounded_pos le_less_trans less_imp_le linordered_field_no_ub)


[STATEMENT]
lemma moebius_rotation_dilatation:
  assumes "a \<noteq> 0"
  shows "moebius_rotation_dilatation a = moebius_rotation (Arg a) + moebius_dilatation (cmod a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_rotation_dilatation a = moebius_rotation (Arg a) + moebius_dilatation (cmod a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. moebius_rotation_dilatation a = moebius_rotation (Arg a) + moebius_dilatation (cmod a)
[PROOF STEP]
unfolding moebius_rotation_dilatation_def moebius_rotation_def moebius_dilatation_def
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. moebius_similarity a 0 = moebius_similarity (cis (Arg a)) 0 + moebius_similarity (cor (cmod a)) 0
[PROOF STEP]
by simp


[STATEMENT]
lemma numeral_assoc_simps:
  "((a::real) + numeral b) + numeral c = a + numeral (b + c)"
  "(a + numeral b) - numeral c = a + neg_numeral_class.sub b c"
  "(a - numeral b) + numeral c = a + neg_numeral_class.sub c b"
  "(a - numeral b) - numeral c = a - numeral (b + c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + numeral b + numeral c = a + numeral (b + c) &&& a + numeral b - numeral c = a + neg_numeral_class.sub b c) &&& a - numeral b + numeral c = a + neg_numeral_class.sub c b &&& a - numeral b - numeral c = a - numeral (b + c)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma CompFun_ChiRel:
  "\<lbrakk> S1 \<in> HAStates A; SA \<in> the (CompFun A S1);
     S2 \<in> States SA \<rbrakk> \<Longrightarrow> (S1,S2) \<in> ChiRel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S1 \<in> HAStates A; SA \<in> the (CompFun A S1); S2 \<in> States SA\<rbrakk> \<Longrightarrow> (S1, S2) \<in> ChiRel A
[PROOF STEP]
apply (unfold ChiRel_def Chi_def restrict_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S1 \<in> HAStates A; SA \<in> the (CompFun A S1); S2 \<in> States SA\<rbrakk> \<Longrightarrow> (S1, S2) \<in> {(S, S'). S \<in> HAStates A \<and> S' \<in> HAStates A \<and> S' \<in> (if S \<in> HAStates A then {S'. \<exists>SA\<in>SAs A. SA \<in> the (CompFun A S) \<and> S' \<in> States SA} else SOME y. True)}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S1 \<in> HAStates A; SA \<in> the (CompFun A S1); S2 \<in> States SA\<rbrakk> \<Longrightarrow> S2 \<in> HAStates A
[PROOF STEP]
apply (cut_tac A=A and S=S1 in HAStates_CompFun_SAs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>S1 \<in> HAStates A; SA \<in> the (CompFun A S1); S2 \<in> States SA\<rbrakk> \<Longrightarrow> S1 \<in> HAStates A
 2. \<lbrakk>S1 \<in> HAStates A; SA \<in> the (CompFun A S1); S2 \<in> States SA; the (CompFun A S1) \<subseteq> SAs A\<rbrakk> \<Longrightarrow> S2 \<in> HAStates A
[PROOF STEP]
apply (unfold HAStates_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>S1 \<in> \<Union> (States ` SAs A); SA \<in> the (CompFun A S1); S2 \<in> States SA\<rbrakk> \<Longrightarrow> S1 \<in> \<Union> (States ` SAs A)
 2. \<lbrakk>S1 \<in> \<Union> (States ` SAs A); SA \<in> the (CompFun A S1); S2 \<in> States SA; the (CompFun A S1) \<subseteq> SAs A\<rbrakk> \<Longrightarrow> S2 \<in> \<Union> (States ` SAs A)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem cayley_group:
  "\<exists>G' composition' unit'. transformation_group G' G \<and> (G, (\<cdot>), \<one>) \<cong>\<^sub>M (G', composition', unit')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>G' composition' unit'. transformation_group G' G \<and> (G, (\<cdot>), \<one>) \<cong>\<^sub>M (G', composition', unit')
[PROOF STEP]
by (simp add: isomorphic_as_monoids_def) (fast intro: Translations_transformation_group)


[STATEMENT]
lemma continuous_at_imp_continuous_within:
  "continuous (at x) f \<Longrightarrow> continuous (at x within s) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x \<Longrightarrow> continuous (at x within s) f
[PROOF STEP]
unfolding continuous_within continuous_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>x\<rightarrow> f x \<Longrightarrow> (f \<longlongrightarrow> f x) (at x within s)
[PROOF STEP]
using Lim_at_imp_Lim_at_within
[PROOF STATE]
proof (prove)
using this:
?f \<midarrow>?x\<rightarrow> ?l \<Longrightarrow> (?f \<longlongrightarrow> ?l) (at ?x within ?S)

goal (1 subgoal):
 1. f \<midarrow>x\<rightarrow> f x \<Longrightarrow> (f \<longlongrightarrow> f x) (at x within s)
[PROOF STEP]
by auto


[STATEMENT]
lemma spanset_reduce_Cons :
  "set ms \<subseteq> M \<Longrightarrow> m \<in> RSpan ms \<Longrightarrow> RSpan (m#ms) = RSpan ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set ms \<subseteq> M; m \<in> RSpan ms\<rbrakk> \<Longrightarrow> RSpan (m # ms) = RSpan ms
[PROOF STEP]
using RSpan_Cons RSpan_RSpan_closed[of ms "[m]"]
        RSpan_contains_RSpans_Cons_right[of m ms]
        RSubmodule_RSpan[of ms]
        RModule.set_plus_closed[of R smult "RSpan ms" "RSpan [m]" "RSpan ms"]
[PROOF STATE]
proof (prove)
using this:
RSpan (?m # ?ms) = RSpan [?m] + RSpan ?ms
\<lbrakk>set ms \<subseteq> M; set [m] \<subseteq> RSpan ms\<rbrakk> \<Longrightarrow> RSpan [m] \<subseteq> RSpan ms
m \<in> M \<Longrightarrow> RSpan ms \<subseteq> RSpan (m # ms)
set ms \<subseteq> M \<Longrightarrow> RSubmodule (RSpan ms)
\<lbrakk>RModule R (\<cdot>) (RSpan ms); RSpan [m] \<subseteq> RSpan ms; RSpan ms \<subseteq> RSpan ms\<rbrakk> \<Longrightarrow> RSpan [m] + RSpan ms \<subseteq> RSpan ms

goal (1 subgoal):
 1. \<lbrakk>set ms \<subseteq> M; m \<in> RSpan ms\<rbrakk> \<Longrightarrow> RSpan (m # ms) = RSpan ms
[PROOF STEP]
by    auto


[STATEMENT]
lemma of_nat_prod_mset: "prod_mset (image_mset of_nat A) = of_nat (prod_mset A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>\<^sub># (image_mset of_nat A) = of_nat (\<Prod>\<^sub># A)
[PROOF STEP]
by (induction A) simp_all


[STATEMENT]
lemma Icc_subset_Ici_iff[simp]:
  "{l\<le>\<^sub>a..\<le>\<^sub>ah} \<subseteq> {l'\<le>\<^sub>a..} = (\<not> l \<le>\<^sub>a h \<or> l \<ge>\<^sub>a l')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({l\<le>\<^sub>a..\<le>\<^sub>ah} \<subseteq> {l'\<le>\<^sub>a..}) = (\<not> l \<le>\<^sub>a h \<or> l' \<le>\<^sub>a l)
[PROOF STEP]
by (auto simp: subset_eq intro: order_trans)


[STATEMENT]
lemma real_of_rat_Fract[simp]: "real_of_rat (Fract a b) = a / b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (Fract a b) = real_of_int a / real_of_int b
[PROOF STEP]
by (simp add: Fract_of_int_quotient of_rat_divide)


[STATEMENT]
lemma power2_less_sqrt_iff: "(x::real)\<^sup>2 < y \<longleftrightarrow> (y \<ge> 0 \<and> abs x < sqrt y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x\<^sup>2 < y) = (0 \<le> y \<and> \<bar>x\<bar> < sqrt y)
[PROOF STEP]
apply (auto simp: real_less_rsqrt abs_real_def less_sqrt_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x < 0; x\<^sup>2 < y\<rbrakk> \<Longrightarrow> 0 \<le> y
 2. \<lbrakk>\<not> x < 0; x\<^sup>2 < y\<rbrakk> \<Longrightarrow> 0 \<le> y
[PROOF STEP]
apply (meson le_less le_less_trans not_less power2_less_0)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma if_is_pr3 [prec]: "\<lbrakk> p \<in> PrimRec3; q1 \<in> PrimRec3; q2 \<in> PrimRec3\<rbrakk> \<Longrightarrow> (\<lambda> x y z. if (p x y z = 0) then (q1 x y z) else (q2 x y z)) \<in> PrimRec3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec3; q1 \<in> PrimRec3; q2 \<in> PrimRec3\<rbrakk> \<Longrightarrow> (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec3; q1 \<in> PrimRec3; q2 \<in> PrimRec3\<rbrakk> \<Longrightarrow> (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3
[PROOF STEP]
have if_as_pr: "(\<lambda> x y z. if (p x y z = 0) then (q1 x y z) else (q2 x y z)) = (\<lambda> x y z. (sgn2 (p x y z)) * (q1 x y z) + (sgn1 (p x y z)) * (q2 x y z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) = (\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z)
[PROOF STEP]
proof (rule ext, rule ext, rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y z. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
show "(if (p x y z = 0) then (q1 x y z) else (q2 x y z)) = (sgn2 (p x y z)) * (q1 x y z) + (sgn1 (p x y z)) * (q2 x y z)" (is "?left = ?right")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
 2. \<not> ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
assume A1: "p x y z = 0"
[PROOF STATE]
proof (state)
this:
p x y z = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
 2. \<not> ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p x y z = 0
[PROOF STEP]
have S1: "?left = q1 x y z"
[PROOF STATE]
proof (prove)
using this:
p x y z = 0

goal (1 subgoal):
 1. (if p x y z = 0 then q1 x y z else q2 x y z) = q1 x y z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p x y z = 0 then q1 x y z else q2 x y z) = q1 x y z

goal (2 subgoals):
 1. ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
 2. \<not> ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
p x y z = 0
[PROOF STEP]
have S2: "?right = q1 x y z"
[PROOF STATE]
proof (prove)
using this:
p x y z = 0

goal (1 subgoal):
 1. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z = q1 x y z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z = q1 x y z

goal (2 subgoals):
 1. ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
 2. \<not> ?P \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
from S1 S2
[PROOF STATE]
proof (chain)
picking this:
(if p x y z = 0 then q1 x y z else q2 x y z) = q1 x y z
sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z = q1 x y z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if p x y z = 0 then q1 x y z else q2 x y z) = q1 x y z
sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z = q1 x y z

goal (1 subgoal):
 1. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z

goal (1 subgoal):
 1. p x y z \<noteq> 0 \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p x y z \<noteq> 0 \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
assume A2: "p x y z \<noteq> 0"
[PROOF STATE]
proof (state)
this:
p x y z \<noteq> 0

goal (1 subgoal):
 1. p x y z \<noteq> 0 \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p x y z \<noteq> 0
[PROOF STEP]
have S3: "p x y z > 0"
[PROOF STATE]
proof (prove)
using this:
p x y z \<noteq> 0

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

goal (1 subgoal):
 1. p x y z \<noteq> 0 \<Longrightarrow> (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p x y z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < p x y z

goal (1 subgoal):
 1. (if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if p x y z = 0 then q1 x y z else q2 x y z) = sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) = (\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z)

goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec3; q1 \<in> PrimRec3; q2 \<in> PrimRec3\<rbrakk> \<Longrightarrow> (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3
[PROOF STEP]
assume "p \<in> PrimRec3" and "q1 \<in> PrimRec3" and "q2 \<in> PrimRec3"
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec3
q1 \<in> PrimRec3
q2 \<in> PrimRec3

goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec3; q1 \<in> PrimRec3; q2 \<in> PrimRec3\<rbrakk> \<Longrightarrow> (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p \<in> PrimRec3
q1 \<in> PrimRec3
q2 \<in> PrimRec3
[PROOF STEP]
have "(\<lambda> x y z. (sgn2 (p x y z)) * (q1 x y z) + (sgn1 (p x y z)) * (q2 x y z)) \<in> PrimRec3"
[PROOF STATE]
proof (prove)
using this:
p \<in> PrimRec3
q1 \<in> PrimRec3
q2 \<in> PrimRec3

goal (1 subgoal):
 1. (\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z) \<in> PrimRec3
[PROOF STEP]
by prec0
[PROOF STATE]
proof (state)
this:
(\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z) \<in> PrimRec3

goal (1 subgoal):
 1. \<lbrakk>p \<in> PrimRec3; q1 \<in> PrimRec3; q2 \<in> PrimRec3\<rbrakk> \<Longrightarrow> (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3
[PROOF STEP]
with if_as_pr
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) = (\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z)
(\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z) \<in> PrimRec3
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) = (\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z)
(\<lambda>x y z. sgn2 (p x y z) * q1 x y z + sgn1 (p x y z) * q2 x y z) \<in> PrimRec3

goal (1 subgoal):
 1. (\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x y z. if p x y z = 0 then q1 x y z else q2 x y z) \<in> PrimRec3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIMSEQ_imp_Suc: "(\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l \<Longrightarrow> f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (Suc n)) \<longlonglongrightarrow> l \<Longrightarrow> f \<longlonglongrightarrow> l
[PROOF STEP]
by (rule LIMSEQ_offset [where k="Suc 0"]) simp


[STATEMENT]
lemma proj2_line_abs_rep [simp]: "proj2_line_abs (proj2_line_rep l) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_line_abs (proj2_line_rep l) = l
[PROOF STEP]
unfolding proj2_line_abs_def and proj2_line_rep_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P2L (proj2_abs (proj2_rep (L2P l))) = l
[PROOF STEP]
by (simp add: proj2_abs_rep)


[STATEMENT]
lemma directed_eq_rtrancl: "x \<in> directed_towards A r \<longleftrightarrow> (\<exists>a\<in>A. (x, a) \<in> r\<^sup>*)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> directed_towards A r) = (\<exists>a\<in>A. (x, a) \<in> r\<^sup>*)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> directed_towards A r \<Longrightarrow> \<exists>a\<in>A. (x, a) \<in> r\<^sup>*
 2. \<exists>a\<in>A. (x, a) \<in> r\<^sup>* \<Longrightarrow> x \<in> directed_towards A r
[PROOF STEP]
assume "x \<in> directed_towards A r"
[PROOF STATE]
proof (state)
this:
x \<in> directed_towards A r

goal (2 subgoals):
 1. x \<in> directed_towards A r \<Longrightarrow> \<exists>a\<in>A. (x, a) \<in> r\<^sup>*
 2. \<exists>a\<in>A. (x, a) \<in> r\<^sup>* \<Longrightarrow> x \<in> directed_towards A r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> directed_towards A r
[PROOF STEP]
show "\<exists>a\<in>A. (x, a) \<in> r\<^sup>*"
[PROOF STATE]
proof (prove)
using this:
x \<in> directed_towards A r

goal (1 subgoal):
 1. \<exists>a\<in>A. (x, a) \<in> r\<^sup>*
[PROOF STEP]
by induction (auto intro: converse_rtrancl_into_rtrancl)
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>A. (x, a) \<in> r\<^sup>*

goal (1 subgoal):
 1. \<exists>a\<in>A. (x, a) \<in> r\<^sup>* \<Longrightarrow> x \<in> directed_towards A r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a\<in>A. (x, a) \<in> r\<^sup>* \<Longrightarrow> x \<in> directed_towards A r
[PROOF STEP]
assume "\<exists>a\<in>A. (x, a) \<in> r\<^sup>*"
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>A. (x, a) \<in> r\<^sup>*

goal (1 subgoal):
 1. \<exists>a\<in>A. (x, a) \<in> r\<^sup>* \<Longrightarrow> x \<in> directed_towards A r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a\<in>A. (x, a) \<in> r\<^sup>*
[PROOF STEP]
obtain a where "(x, a) \<in> r\<^sup>*" "a \<in> A"
[PROOF STATE]
proof (prove)
using this:
\<exists>a\<in>A. (x, a) \<in> r\<^sup>*

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>(x, a) \<in> r\<^sup>*; a \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x, a) \<in> r\<^sup>*
a \<in> A

goal (1 subgoal):
 1. \<exists>a\<in>A. (x, a) \<in> r\<^sup>* \<Longrightarrow> x \<in> directed_towards A r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x, a) \<in> r\<^sup>*
a \<in> A
[PROOF STEP]
show "x \<in> directed_towards A r"
[PROOF STATE]
proof (prove)
using this:
(x, a) \<in> r\<^sup>*
a \<in> A

goal (1 subgoal):
 1. x \<in> directed_towards A r
[PROOF STEP]
by (induction rule: converse_rtrancl_induct)
       (auto intro: directed_towards.start directed_towards.step)
[PROOF STATE]
proof (state)
this:
x \<in> directed_towards A r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hyp_times_divide_assoc [simp]:
  fixes a b c :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "a * (b / c) = (a * b) / c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (b / c) = a * b / c
[PROOF STEP]
by (simp add: hyp_divide_inverse mult.assoc)


[STATEMENT]
lemma prime_factors_product:
  "x \<noteq> 0 \<Longrightarrow> y \<noteq> 0 \<Longrightarrow> prime_factors (x * y) = prime_factors x \<union> prime_factors y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<noteq> (0::'a); y \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> prime_factors (x * y) = prime_factors x \<union> prime_factors y
[PROOF STEP]
by (simp add: prime_factorization_mult)


[STATEMENT]
lemma lm06: fixes f m P
            shows "(map f [n . n <- [0..<m], P n]) = [ f n . n <- [0..<m], P n]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (concat (map (\<lambda>n. if P n then [n] else []) [0..<m])) = concat (map (\<lambda>n. if P n then [f n] else []) [0..<m])
[PROOF STEP]
by (induct m) auto


[STATEMENT]
lemma Union_of_alt_def: "Union_of f A = (\<Union>x \<in> A. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Union_of f A = \<Union> (f ` A)
[PROOF STEP]
unfolding Union_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (f ` A) = \<Union> (f ` A)
[PROOF STEP]
by simp


[STATEMENT]
lemma lm076:
  assumes "g \<in> injections A B"
  shows   "g outside C \<in> injections (A - C) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Outside' C g \<in> injections (A - C) B
[PROOF STEP]
using assms Outside_def Range_outside_sub lm030 mem_Collect_eq outside_reduces_domain
[PROOF STATE]
proof (prove)
using this:
g \<in> injections A B
Outside' ?X ?R = ?R - ?X \<times> Range ?R
Range ?R \<subseteq> ?Y \<Longrightarrow> Range (Outside' ?X ?R) \<subseteq> ?Y
?a \<in> injectionsUniverse \<Longrightarrow> ?a - ?b \<in> injectionsUniverse
(?a \<in> Collect ?P) = ?P ?a
Domain (Outside' ?X ?P) = Domain ?P - ?X

goal (1 subgoal):
 1. Outside' C g \<in> injections (A - C) B
[PROOF STEP]
unfolding injections_def
[PROOF STATE]
proof (prove)
using this:
g \<in> {R. Domain R = A \<and> Range R \<subseteq> B \<and> runiq R \<and> runiq (R\<inverse>)}
Outside' ?X ?R = ?R - ?X \<times> Range ?R
Range ?R \<subseteq> ?Y \<Longrightarrow> Range (Outside' ?X ?R) \<subseteq> ?Y
?a \<in> injectionsUniverse \<Longrightarrow> ?a - ?b \<in> injectionsUniverse
(?a \<in> Collect ?P) = ?P ?a
Domain (Outside' ?X ?P) = Domain ?P - ?X

goal (1 subgoal):
 1. Outside' C g \<in> {R. Domain R = A - C \<and> Range R \<subseteq> B \<and> runiq R \<and> runiq (R\<inverse>)}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma s_delayed_has_field_derivative[derivative_intros]:
  assumes "\<delta> < t" "0 \<le> v" "a < 0"
  shows "((\<lambda>x. s (x - \<delta>)) has_field_derivative s' (t - \<delta>)) (at t within {\<delta><..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. s (x - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t within {\<delta><..})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. s (x - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t within {\<delta><..})
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<delta> < t
0 \<le> v
a < 0
[PROOF STEP]
have "((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)"
[PROOF STATE]
proof (prove)
using this:
\<delta> < t
0 \<le> v
a < 0

goal (1 subgoal):
 1. ((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)
[PROOF STEP]
using DERIV_shift[of "s" "(s' (t - \<delta>))" t "-\<delta>"] s_has_real_derivative_at
[PROOF STATE]
proof (prove)
using this:
\<delta> < t
0 \<le> v
a < 0
(s has_real_derivative s' (t - \<delta>)) (at (t + - \<delta>)) = ((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)
\<lbrakk>0 < ?x; 0 \<le> v; a < 0\<rbrakk> \<Longrightarrow> (s has_real_derivative s' ?x) (at ?x)

goal (1 subgoal):
 1. ((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)

goal (1 subgoal):
 1. ((\<lambda>x. s (x - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t within {\<delta><..})
[PROOF STEP]
thus "((\<lambda>x. s (x - \<delta>)) has_field_derivative s' (t - \<delta>)) (at t within {\<delta><..})"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)

goal (1 subgoal):
 1. ((\<lambda>x. s (x - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t within {\<delta><..})
[PROOF STEP]
using has_field_derivative_at_within
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. s (x + - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t)
(?f has_field_derivative ?f') (at ?x) \<Longrightarrow> (?f has_field_derivative ?f') (at ?x within ?s)

goal (1 subgoal):
 1. ((\<lambda>x. s (x - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t within {\<delta><..})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. s (x - \<delta>)) has_real_derivative s' (t - \<delta>)) (at t within {\<delta><..})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fst_divmod_abs [simp]:
  "fst (divmod_abs k l) = \<bar>k\<bar> div \<bar>l\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (divmod_abs k l) = \<bar>k\<bar> div \<bar>l\<bar>
[PROOF STEP]
by (simp add: divmod_abs_def)


[STATEMENT]
lemma V_is_adj_nodes: "V = { v . adjacent_nodes v \<noteq> {} }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V = {v. adjacent_nodes v \<noteq> {}}
[PROOF STEP]
unfolding V_def adjacent_nodes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {u. \<exists>v. (u, v) \<in> E \<or> (v, u) \<in> E} = {v. E `` {v} \<union> E\<inverse> `` {v} \<noteq> {}}
[PROOF STEP]
by auto


[STATEMENT]
lemma SUP_combine:
  fixes f :: "'a::semilattice_sup \<Rightarrow> 'a::semilattice_sup \<Rightarrow> 'b::complete_lattice"
  assumes mono: "\<And>a b c d. a \<le> b \<Longrightarrow> c \<le> d \<Longrightarrow> f a c \<le> f b d"
  shows "(SUP i\<in>UNIV. SUP j\<in>UNIV. f i j) = (SUP i. f i i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. Sup (range (f i))) = (SUP i. f i i)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (SUP i. Sup (range (f i))) \<le> (SUP i. f i i)
 2. (SUP i. f i i) \<le> (SUP i. Sup (range (f i)))
[PROOF STEP]
show "(SUP i j. f i j) \<le> (SUP i. f i i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. Sup (range (f i))) \<le> (SUP i. f i i)
[PROOF STEP]
by (rule SUP_least SUP_upper2[where i="sup i j" for i j] UNIV_I mono sup_ge1 sup_ge2)+
[PROOF STATE]
proof (state)
this:
(SUP i. Sup (range (f i))) \<le> (SUP i. f i i)

goal (1 subgoal):
 1. (SUP i. f i i) \<le> (SUP i. Sup (range (f i)))
[PROOF STEP]
show "(SUP i. f i i) \<le> (SUP i j. f i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. f i i) \<le> (SUP i. Sup (range (f i)))
[PROOF STEP]
by (rule SUP_least SUP_upper2 UNIV_I mono order_refl)+
[PROOF STATE]
proof (state)
this:
(SUP i. f i i) \<le> (SUP i. Sup (range (f i)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Liminf_obtain':
  fixes u::"'a \<Rightarrow> 'b::complete_linorder"
  assumes "Liminf F u < c" "eventually P F"
  shows "\<exists>n. P n \<and> u n < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. P n \<and> u n < c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. P n \<and> u n < c
[PROOF STEP]
have *: "(SUP P\<in>{P. eventually P F}. INF x\<in>{x. P x}. u x) < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP P\<in>{P. eventually P F}. Inf (u ` {x. P x})) < c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Liminf F u < c
eventually P F

goal (1 subgoal):
 1. (SUP P\<in>{P. eventually P F}. Inf (u ` {x. P x})) < c
[PROOF STEP]
by (simp add: Liminf_def)
[PROOF STATE]
proof (state)
this:
(SUP P\<in>{P. eventually P F}. Inf (u ` {x. P x})) < c

goal (1 subgoal):
 1. \<exists>n. P n \<and> u n < c
[PROOF STEP]
have **: "(INF x\<in>{x. P x}. u x) < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf (u ` {x. P x}) < c
[PROOF STEP]
using SUP_lessD[OF *, of P] assms
[PROOF STATE]
proof (prove)
using this:
P \<in> {P. eventually P F} \<Longrightarrow> Inf (u ` {x. P x}) < c
Liminf F u < c
eventually P F

goal (1 subgoal):
 1. Inf (u ` {x. P x}) < c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Inf (u ` {x. P x}) < c

goal (1 subgoal):
 1. \<exists>n. P n \<and> u n < c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf (u ` {x. P x}) < c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Inf (u ` {x. P x}) < c

goal (1 subgoal):
 1. \<exists>n. P n \<and> u n < c
[PROOF STEP]
by (simp add: INF_less_iff)
[PROOF STATE]
proof (state)
this:
\<exists>n. P n \<and> u n < c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsubsetD [elim, intro?]: "a \<le> b \<Longrightarrow> c \<in> elts a \<Longrightarrow> c \<in> elts b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<in> elts a\<rbrakk> \<Longrightarrow> c \<in> elts b
[PROOF STEP]
using less_eq_V_def
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<equiv> elts ?x \<subseteq> elts ?y

goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<in> elts a\<rbrakk> \<Longrightarrow> c \<in> elts b
[PROOF STEP]
by auto


[STATEMENT]
lemma tensor_mat_hermitian:
  assumes "m1 \<in> carrier_mat d1 d1"
    and "m2 \<in> carrier_mat d2 d2"
    and "hermitian m1"
    and "hermitian m2"
  shows "hermitian (tensor_mat m1 m2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitian (tensor_mat m1 m2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d2 d2
hermitian m1
hermitian m2

goal (1 subgoal):
 1. hermitian (tensor_mat m1 m2)
[PROOF STEP]
by (metis hermitian_def tensor_mat_adjoint)