[STATEMENT]
lemma hurwitz_formula_integral_semiannulus:
  fixes N :: nat and r :: real and s :: complex
  defines "R \<equiv> real (2 * N + 1) * pi"
  assumes "r > 0" and "r < 2"
  shows "exp (-\<i> * pi * s) * integral {r..R} (\<lambda>x. x powr (-s) * exp (-a * x) / (1 - exp (-x))) +
         integral {r..R} (\<lambda>x. x powr (-s) * exp (a * x) / (1 - exp x)) +
         contour_integral (part_circlepath 0 R 0 pi) (f s) +
         contour_integral (part_circlepath 0 r pi 0) (f s)
         = -2 * pi * \<i> * exp (- s * of_real pi * \<i> / 2) * (\<Sum>k\<in>{0<..N}. Res s k)" (is ?thesis1)
    and "f s contour_integrable_on hankel_semiannulus r N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N} &&& f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "2 < 1 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 < 1 * pi
[PROOF STEP]
using pi_gt3
[PROOF STATE]
proof (prove)
using this:
3 < pi

goal (1 subgoal):
 1. 2 < 1 * pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 < 1 * pi

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 < 1 * pi

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "\<dots> \<le> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * pi \<le> R
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * pi \<le> real (2 * N + 1) * pi
[PROOF STEP]
by (intro mult_right_mono) auto
[PROOF STATE]
proof (state)
this:
1 * pi \<le> R

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 < R
[PROOF STEP]
have "R > 2"
[PROOF STATE]
proof (prove)
using this:
2 < R

goal (1 subgoal):
 1. 2 < R
[PROOF STEP]
by (auto simp: R_def)
[PROOF STATE]
proof (state)
this:
2 < R

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
note r_R = \<open>r > 0\<close> \<open>r < 2\<close> this

  \<comment>\<open>We integrate along the edge of a semi-annulus in the upper half of the complex plane.
     It consists of a big semicircle, a small semicircle, and two lines connecting the two
     circles, one on the positive real axis and one on the negative real axis.

     The integral along the big circle will vanish as the radius of the circle tends to \<open>\<infinity>\<close>,
     whereas the remaining path becomes a Hankel contour, and the integral along that Hankel
     contour is what we are interested in, since it is connected to the Hurwitz zeta function.\<close>
[PROOF STATE]
proof (state)
this:
0 < r
r < 2
2 < R

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define big_circle where "big_circle = part_circlepath 0 R 0 pi"
[PROOF STATE]
proof (state)
this:
big_circle = part_circlepath 0 R 0 pi

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define small_circle where "small_circle = part_circlepath 0 r pi 0"
[PROOF STATE]
proof (state)
this:
small_circle = part_circlepath 0 r pi 0

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define neg_line where "neg_line = linepath (complex_of_real (-R)) (complex_of_real (-r))"
[PROOF STATE]
proof (state)
this:
neg_line = linepath (complex_of_real (- R)) (complex_of_real (- r))

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define pos_line where "pos_line = linepath (complex_of_real r) (complex_of_real R)"
[PROOF STATE]
proof (state)
this:
pos_line = linepath (complex_of_real r) (complex_of_real R)

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define \<gamma> where "\<gamma> = hankel_semiannulus r N"
[PROOF STATE]
proof (state)
this:
\<gamma> = hankel_semiannulus r N

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have \<gamma>_altdef: "\<gamma> = big_circle +++ neg_line +++ small_circle +++ pos_line"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> = big_circle +++ neg_line +++ small_circle +++ pos_line
[PROOF STEP]
by (simp add: \<gamma>_def R_def add_ac hankel_semiannulus_def big_circle_def
                  neg_line_def small_circle_def pos_line_def)
[PROOF STATE]
proof (state)
this:
\<gamma> = big_circle +++ neg_line +++ small_circle +++ pos_line

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have [simp]: "path \<gamma>" "valid_path \<gamma>" "pathfinish \<gamma> = pathstart \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path \<gamma> &&& valid_path \<gamma> &&& pathfinish \<gamma> = pathstart \<gamma>
[PROOF STEP]
by (simp_all add: \<gamma>_def)

  \<comment>\<open>The integrand has a branch cut along the non-positive imaginary axis and additional
     simple poles at $2n\pi i$ for any \<open>n \<in> \<nat>\<^sub>>\<^sub>0\<close>. The radius of the smaller circle will always
     be less than $2\pi$ and the radius of the bigger circle of the form $(2N+1)\pi$, so we
     always have precisely the first $N$ poles inside our path.\<close>
[PROOF STATE]
proof (state)
this:
path \<gamma>
valid_path \<gamma>
pathfinish \<gamma> = pathstart \<gamma>

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define sngs where "sngs = (\<lambda>n. of_real (2 * pi * real n) * \<i>) ` {0<..}"
[PROOF STATE]
proof (state)
this:
sngs = (\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define sngs' where "sngs' = (\<lambda>n. of_real (2 * pi * real n) * \<i>) ` {0<..N}"
[PROOF STATE]
proof (state)
this:
sngs' = (\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..N}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have sngs_subset: "sngs' \<subseteq> sngs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sngs' \<subseteq> sngs
[PROOF STEP]
unfolding sngs_def sngs'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..N} \<subseteq> (\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..}
[PROOF STEP]
by (intro image_mono) auto
[PROOF STATE]
proof (state)
this:
sngs' \<subseteq> sngs

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have closed_sngs [intro]: "closed (sngs - sngs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (sngs - sngs')
[PROOF STEP]
unfolding sngs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed ((\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..} - sngs')
[PROOF STEP]
proof (rule discrete_imp_closed[of "2 * pi"]; safe?)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
fix m n :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
assume "dist (of_real (2 * pi * real m) * \<i>) (of_real (2 * pi * real n) * \<i>) < 2 * pi"
[PROOF STATE]
proof (state)
this:
dist (complex_of_real (2 * pi * real m) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (complex_of_real (2 * pi * real m) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
have "dist (of_real (2 * pi * real m) * \<i>) (of_real (2 * pi * real n) * \<i>) =
                norm (of_real (2 * pi * real m) * \<i> - of_real (2 * pi * real n) * \<i>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (complex_of_real (2 * pi * real m) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) = cmod (complex_of_real (2 * pi * real m) * \<i> - complex_of_real (2 * pi * real n) * \<i>)
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist (complex_of_real (2 * pi * real m) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) = cmod (complex_of_real (2 * pi * real m) * \<i> - complex_of_real (2 * pi * real n) * \<i>)

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (complex_of_real (2 * pi * real m) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) = cmod (complex_of_real (2 * pi * real m) * \<i> - complex_of_real (2 * pi * real n) * \<i>)

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
have "of_real (2 * pi * real m) * \<i> - of_real (2 * pi * real n) * \<i> =
                 of_real (2 * pi) * \<i> * of_int (int m - int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (2 * pi * real m) * \<i> - complex_of_real (2 * pi * real n) * \<i> = complex_of_real (2 * pi) * \<i> * of_int (int m - int n)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
complex_of_real (2 * pi * real m) * \<i> - complex_of_real (2 * pi * real n) * \<i> = complex_of_real (2 * pi) * \<i> * of_int (int m - int n)

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (2 * pi * real m) * \<i> - complex_of_real (2 * pi * real n) * \<i> = complex_of_real (2 * pi) * \<i> * of_int (int m - int n)

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
have "norm \<dots> = 2 * pi * of_int \<bar>int m - int n\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (2 * pi) * \<i> * of_int (int m - int n)) = 2 * pi * real_of_int \<bar>int m - int n\<bar>
[PROOF STEP]
unfolding norm_mult norm_of_int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (2 * pi)) * cmod \<i> * \<bar>real_of_int (int m - int n)\<bar> = 2 * pi * real_of_int \<bar>int m - int n\<bar>
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (2 * pi) * \<i> * of_int (int m - int n)) = 2 * pi * real_of_int \<bar>int m - int n\<bar>

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * pi * real_of_int \<bar>int m - int n\<bar> < 2 * pi
[PROOF STEP]
have "\<bar>real m - real n\<bar> < 1"
[PROOF STATE]
proof (prove)
using this:
2 * pi * real_of_int \<bar>int m - int n\<bar> < 2 * pi

goal (1 subgoal):
 1. \<bar>real m - real n\<bar> < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>real m - real n\<bar> < 1

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
hence "m = n"
[PROOF STATE]
proof (prove)
using this:
\<bar>real m - real n\<bar> < 1

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

goal (2 subgoals):
 1. 0 < 2 * pi
 2. \<And>x n y na. \<lbrakk>complex_of_real (2 * pi * real n) * \<i> \<notin> sngs'; 0 < n; complex_of_real (2 * pi * real na) * \<i> \<notin> sngs'; 0 < na; dist (complex_of_real (2 * pi * real na) * \<i>) (complex_of_real (2 * pi * real n) * \<i>) < 2 * pi\<rbrakk> \<Longrightarrow> complex_of_real (2 * pi * real na) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
thus "of_real (2 * pi * real m) * \<i> = of_real (2 * pi * real n) * \<i>"
[PROOF STATE]
proof (prove)
using this:
m = n

goal (1 subgoal):
 1. complex_of_real (2 * pi * real m) * \<i> = complex_of_real (2 * pi * real n) * \<i>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real (2 * pi * real m) * \<i> = complex_of_real (2 * pi * real n) * \<i>

goal (1 subgoal):
 1. 0 < 2 * pi
[PROOF STEP]
qed auto

  \<comment>\<open>We define an area within which the integrand is holomorphic. Choosing this area as big as
     possible makes things easier later on, so we only remove the branch cut and the poles.\<close>
[PROOF STATE]
proof (state)
this:
closed (sngs - sngs')

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define S where "S = - {z. Re z = 0 \<and> Im z \<le> 0} - (sngs - sngs')"
[PROOF STATE]
proof (state)
this:
S = - {z. Re z = 0 \<and> Im z \<le> 0} - (sngs - sngs')

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
define S' where "S' = - {z. Re z = 0 \<and> Im z \<le> 0}"
[PROOF STATE]
proof (state)
this:
S' = - {z. Re z = 0 \<and> Im z \<le> 0}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have sngs: "exp z = 1 \<longleftrightarrow> z \<in> sngs" if "Re z \<noteq> 0 \<or> Im z > 0" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp z = 1) = (z \<in> sngs)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. exp z = 1 \<Longrightarrow> z \<in> sngs
 2. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
assume "exp z = 1"
[PROOF STATE]
proof (state)
this:
exp z = 1

goal (2 subgoals):
 1. exp z = 1 \<Longrightarrow> z \<in> sngs
 2. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
exp z = 1
[PROOF STEP]
obtain n where n: "z = 2 * pi * of_int n * \<i>"
[PROOF STATE]
proof (prove)
using this:
exp z = 1

goal (1 subgoal):
 1. (\<And>n. z = complex_of_real (2 * pi * real_of_int n) * \<i> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding exp_eq_1
[PROOF STATE]
proof (prove)
using this:
Re z = 0 \<and> (\<exists>n. Im z = real_of_int (2 * n) * pi)

goal (1 subgoal):
 1. (\<And>n. z = complex_of_real (2 * pi * real_of_int n) * \<i> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: complex_eq_iff mult_ac)
[PROOF STATE]
proof (state)
this:
z = complex_of_real (2 * pi * real_of_int n) * \<i>

goal (2 subgoals):
 1. exp z = 1 \<Longrightarrow> z \<in> sngs
 2. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z = complex_of_real (2 * pi * real_of_int n) * \<i>

goal (2 subgoals):
 1. exp z = 1 \<Longrightarrow> z \<in> sngs
 2. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
from n and pi_gt_zero and that
[PROOF STATE]
proof (chain)
picking this:
z = complex_of_real (2 * pi * real_of_int n) * \<i>
0 < pi
Re z \<noteq> 0 \<or> 0 < Im z
[PROOF STEP]
have "n > 0"
[PROOF STATE]
proof (prove)
using this:
z = complex_of_real (2 * pi * real_of_int n) * \<i>
0 < pi
Re z \<noteq> 0 \<or> 0 < Im z

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by (auto simp: zero_less_mult_iff)
[PROOF STATE]
proof (state)
this:
0 < n

goal (2 subgoals):
 1. exp z = 1 \<Longrightarrow> z \<in> sngs
 2. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z = complex_of_real (2 * pi * real_of_int n) * \<i>
0 < n
[PROOF STEP]
have "z = of_real (2 * pi * nat n) * \<i>" and "nat n \<in> {0<..}"
[PROOF STATE]
proof (prove)
using this:
z = complex_of_real (2 * pi * real_of_int n) * \<i>
0 < n

goal (1 subgoal):
 1. z = complex_of_real (2 * pi * real (nat n)) * \<i> &&& nat n \<in> {0<..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z = complex_of_real (2 * pi * real (nat n)) * \<i>
nat n \<in> {0<..}

goal (2 subgoals):
 1. exp z = 1 \<Longrightarrow> z \<in> sngs
 2. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
thus "z \<in> sngs"
[PROOF STATE]
proof (prove)
using this:
z = complex_of_real (2 * pi * real (nat n)) * \<i>
nat n \<in> {0<..}

goal (1 subgoal):
 1. z \<in> sngs
[PROOF STEP]
unfolding sngs_def
[PROOF STATE]
proof (prove)
using this:
z = complex_of_real (2 * pi * real (nat n)) * \<i>
nat n \<in> {0<..}

goal (1 subgoal):
 1. z \<in> (\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> sngs

goal (1 subgoal):
 1. z \<in> sngs \<Longrightarrow> exp z = 1
[PROOF STEP]
qed (insert that, auto simp: sngs_def exp_eq_polar)

  \<comment>\<open>We show that the path stays within the well-behaved area.\<close>
[PROOF STATE]
proof (state)
this:
Re ?z \<noteq> 0 \<or> 0 < Im ?z \<Longrightarrow> (exp ?z = 1) = (?z \<in> sngs)

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "path_image neg_line = of_real ` {-R..-r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image neg_line = complex_of_real ` {- R..- r}
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. path_image neg_line = complex_of_real ` {- R..- r}
[PROOF STEP]
by (auto simp: neg_line_def closed_segment_Reals closed_segment_eq_real_ivl)
[PROOF STATE]
proof (state)
this:
path_image neg_line = complex_of_real ` {- R..- r}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "path_image neg_line \<subseteq> S - sngs'"
[PROOF STATE]
proof (prove)
using this:
path_image neg_line = complex_of_real ` {- R..- r}

goal (1 subgoal):
 1. path_image neg_line \<subseteq> S - sngs'
[PROOF STEP]
using r_R sngs_subset
[PROOF STATE]
proof (prove)
using this:
path_image neg_line = complex_of_real ` {- R..- r}
0 < r
r < 2
2 < R
sngs' \<subseteq> sngs

goal (1 subgoal):
 1. path_image neg_line \<subseteq> S - sngs'
[PROOF STEP]
by (auto simp: S_def sngs_def complex_eq_iff)
[PROOF STATE]
proof (state)
this:
path_image neg_line \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "path_image pos_line = of_real ` {r..R}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image pos_line = complex_of_real ` {r..R}
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. path_image pos_line = complex_of_real ` {r..R}
[PROOF STEP]
by (auto simp: pos_line_def closed_segment_Reals closed_segment_eq_real_ivl)
[PROOF STATE]
proof (state)
this:
path_image pos_line = complex_of_real ` {r..R}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "path_image pos_line \<subseteq> S - sngs'"
[PROOF STATE]
proof (prove)
using this:
path_image pos_line = complex_of_real ` {r..R}

goal (1 subgoal):
 1. path_image pos_line \<subseteq> S - sngs'
[PROOF STEP]
using r_R sngs_subset
[PROOF STATE]
proof (prove)
using this:
path_image pos_line = complex_of_real ` {r..R}
0 < r
r < 2
2 < R
sngs' \<subseteq> sngs

goal (1 subgoal):
 1. path_image pos_line \<subseteq> S - sngs'
[PROOF STEP]
by (auto simp: S_def sngs_def complex_eq_iff)
[PROOF STATE]
proof (state)
this:
path_image pos_line \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have part_circlepath_in_S: "z \<in> S - sngs'"
    if "z \<in> path_image (part_circlepath 0 r' 0 pi) \<or> z \<in> path_image (part_circlepath 0 r' pi 0)"
    and "r' > 0" "r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}" for z r'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
have z: "norm z = r' \<and> Im z \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod z = r' \<and> 0 \<le> Im z
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
z \<in> path_image (part_circlepath 0 r' 0 pi) \<or> z \<in> path_image (part_circlepath 0 r' pi 0)
0 < r'
r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}

goal (1 subgoal):
 1. cmod z = r' \<and> 0 \<le> Im z
[PROOF STEP]
by (auto simp: path_image_def part_circlepath_def norm_mult Im_exp linepath_def
               intro!: mult_nonneg_nonneg sin_ge_zero)
[PROOF STATE]
proof (state)
this:
cmod z = r' \<and> 0 \<le> Im z

goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
hence "Re z \<noteq> 0 \<or> Im z > 0"
[PROOF STATE]
proof (prove)
using this:
cmod z = r' \<and> 0 \<le> Im z

goal (1 subgoal):
 1. Re z \<noteq> 0 \<or> 0 < Im z
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cmod z = r' \<and> 0 \<le> Im z
z \<in> path_image (part_circlepath 0 r' 0 pi) \<or> z \<in> path_image (part_circlepath 0 r' pi 0)
0 < r'
r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}

goal (1 subgoal):
 1. Re z \<noteq> 0 \<or> 0 < Im z
[PROOF STEP]
by (auto simp: cmod_def)
[PROOF STATE]
proof (state)
this:
Re z \<noteq> 0 \<or> 0 < Im z

goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re z \<noteq> 0 \<or> 0 < Im z

goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
from z and that
[PROOF STATE]
proof (chain)
picking this:
cmod z = r' \<and> 0 \<le> Im z
z \<in> path_image (part_circlepath 0 r' 0 pi) \<or> z \<in> path_image (part_circlepath 0 r' pi 0)
0 < r'
r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}
[PROOF STEP]
have "z \<notin> sngs"
[PROOF STATE]
proof (prove)
using this:
cmod z = r' \<and> 0 \<le> Im z
z \<in> path_image (part_circlepath 0 r' 0 pi) \<or> z \<in> path_image (part_circlepath 0 r' pi 0)
0 < r'
r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}

goal (1 subgoal):
 1. z \<notin> sngs
[PROOF STEP]
by (auto simp: sngs_def norm_mult image_iff)
[PROOF STATE]
proof (state)
this:
z \<notin> sngs

goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re z \<noteq> 0 \<or> 0 < Im z
z \<notin> sngs
[PROOF STEP]
show "z \<in> S - sngs'"
[PROOF STATE]
proof (prove)
using this:
Re z \<noteq> 0 \<or> 0 < Im z
z \<notin> sngs

goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
using sngs_subset
[PROOF STATE]
proof (prove)
using this:
Re z \<noteq> 0 \<or> 0 < Im z
z \<notin> sngs
sngs' \<subseteq> sngs

goal (1 subgoal):
 1. z \<in> S - sngs'
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
z \<in> S - sngs'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z \<in> path_image (part_circlepath 0 ?r' 0 pi) \<or> ?z \<in> path_image (part_circlepath 0 ?r' pi 0); 0 < ?r'; ?r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}\<rbrakk> \<Longrightarrow> ?z \<in> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z \<in> path_image (part_circlepath 0 ?r' 0 pi) \<or> ?z \<in> path_image (part_circlepath 0 ?r' pi 0); 0 < ?r'; ?r' \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}\<rbrakk> \<Longrightarrow> ?z \<in> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
assume n: "n > 0"
[PROOF STATE]
proof (state)
this:
0 < n

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "r < 2 * pi * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r < 2 * pi * 1
[PROOF STEP]
using pi_gt3 r_R
[PROOF STATE]
proof (prove)
using this:
3 < pi
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. r < 2 * pi * 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r < 2 * pi * 1

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
r < 2 * pi * 1

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "\<dots> \<le> 2 * pi * real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * pi * 1 \<le> 2 * pi * real n
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 2 * pi * 1 \<le> 2 * pi * real n
[PROOF STEP]
by (intro mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
2 * pi * 1 \<le> 2 * pi * real n

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
r < 2 * pi * real n
[PROOF STEP]
have "r < \<dots>"
[PROOF STATE]
proof (prove)
using this:
r < 2 * pi * real n

goal (1 subgoal):
 1. r < 2 * pi * real n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
r < 2 * pi * real n

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?n2 \<Longrightarrow> r < 2 * pi * real ?n2

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "r \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}"
[PROOF STATE]
proof (prove)
using this:
0 < ?n2 \<Longrightarrow> r < 2 * pi * real ?n2

goal (1 subgoal):
 1. r \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < ?n2 \<Longrightarrow> r < 2 * pi * real ?n2
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. r \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
from part_circlepath_in_S[OF _ _ this] r_R
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?z \<in> path_image (part_circlepath 0 r 0 pi) \<or> ?z \<in> path_image (part_circlepath 0 r pi 0); 0 < r\<rbrakk> \<Longrightarrow> ?z \<in> S - sngs'
0 < r
r < 2
2 < R
[PROOF STEP]
have "path_image small_circle \<subseteq> S - sngs'"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?z \<in> path_image (part_circlepath 0 r 0 pi) \<or> ?z \<in> path_image (part_circlepath 0 r pi 0); 0 < r\<rbrakk> \<Longrightarrow> ?z \<in> S - sngs'
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. path_image small_circle \<subseteq> S - sngs'
[PROOF STEP]
by (auto simp: small_circle_def)
[PROOF STATE]
proof (state)
this:
path_image small_circle \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
path_image small_circle \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
assume n: "n > 0" "2 * pi * real n = real (2 * N + 1) * pi"
[PROOF STATE]
proof (state)
this:
0 < n
2 * pi * real n = real (2 * N + 1) * pi

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "real (2 * n) = real (2 * N + 1)"
[PROOF STATE]
proof (prove)
using this:
0 < n
2 * pi * real n = real (2 * N + 1) * pi

goal (1 subgoal):
 1. real (2 * n) = real (2 * N + 1)
[PROOF STEP]
unfolding of_nat_mult
[PROOF STATE]
proof (prove)
using this:
0 < n
2 * pi * real n = real (2 * N + 1) * pi

goal (1 subgoal):
 1. real 2 * real n = real (2 * N + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (2 * n) = real (2 * N + 1)

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
real (2 * n) = real (2 * N + 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding of_nat_eq_iff
[PROOF STATE]
proof (prove)
using this:
2 * n = 2 * N + 1

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

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?n2; 2 * pi * real ?n2 = real (2 * N + 1) * pi\<rbrakk> \<Longrightarrow> False

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "R \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?n2; 2 * pi * real ?n2 = real (2 * N + 1) * pi\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. R \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?n2; 2 * pi * real ?n2 = real (2 * N + 1) * pi\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. real (2 * N + 1) * pi \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
R \<notin> (\<lambda>n. 2 * pi * real n) ` {0<..}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
from part_circlepath_in_S[OF _ _ this] r_R
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?z \<in> path_image (part_circlepath 0 R 0 pi) \<or> ?z \<in> path_image (part_circlepath 0 R pi 0); 0 < R\<rbrakk> \<Longrightarrow> ?z \<in> S - sngs'
0 < r
r < 2
2 < R
[PROOF STEP]
have "path_image big_circle \<subseteq> S - sngs'"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?z \<in> path_image (part_circlepath 0 R 0 pi) \<or> ?z \<in> path_image (part_circlepath 0 R pi 0); 0 < R\<rbrakk> \<Longrightarrow> ?z \<in> S - sngs'
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. path_image big_circle \<subseteq> S - sngs'
[PROOF STEP]
by (auto simp: big_circle_def)
[PROOF STATE]
proof (state)
this:
path_image big_circle \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
note path_images =
    \<open>path_image small_circle \<subseteq> S - sngs'\<close> \<open>path_image big_circle \<subseteq> S - sngs'\<close>
    \<open>path_image neg_line \<subseteq> S - sngs'\<close> \<open>path_image pos_line \<subseteq> S - sngs'\<close>
[PROOF STATE]
proof (state)
this:
path_image small_circle \<subseteq> S - sngs'
path_image big_circle \<subseteq> S - sngs'
path_image neg_line \<subseteq> S - sngs'
path_image pos_line \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "path_image \<gamma> \<subseteq> S - sngs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> S - sngs'
[PROOF STEP]
using path_images
[PROOF STATE]
proof (prove)
using this:
path_image small_circle \<subseteq> S - sngs'
path_image big_circle \<subseteq> S - sngs'
path_image neg_line \<subseteq> S - sngs'
path_image pos_line \<subseteq> S - sngs'

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> S - sngs'
[PROOF STEP]
by (auto simp: \<gamma>_altdef path_image_join big_circle_def neg_line_def
                   small_circle_def pos_line_def)

  \<comment>\<open>We need to show that the complex plane is still connected after we removed the branch cut
     and the poles. We do this by showing that the complex plane with the branch cut removed
     is starlike and therefore connected. Then we remove the (countably many) poles, which does not
     break connectedness either.\<close>
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S
[PROOF STEP]
using closed_neg_Im_slit
[PROOF STATE]
proof (prove)
using this:
closed {z. Re z = 0 \<and> Im z \<le> 0}

goal (1 subgoal):
 1. open S
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
open S

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "starlike (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})"
    (is "starlike ?S'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. starlike (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})
[PROOF STEP]
unfolding starlike_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a\<in>UNIV - {z. Re z = 0 \<and> Im z \<le> 0}. \<forall>x\<in>UNIV - {z. Re z = 0 \<and> Im z \<le> 0}. closed_segment a x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
proof (rule bexI ballI)+
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment ?a x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
 2. ?a \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
have "1 \<le> 1 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> 1 * pi
[PROOF STEP]
using pi_gt3
[PROOF STATE]
proof (prove)
using this:
3 < pi

goal (1 subgoal):
 1. 1 \<le> 1 * pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> 1 * pi

goal (2 subgoals):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment ?a x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
 2. ?a \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 \<le> 1 * pi

goal (2 subgoals):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment ?a x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
 2. ?a \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
have "\<dots> < (2 + 2 * real N) * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * pi < (2 + 2 * real N) * pi
[PROOF STEP]
by (intro mult_strict_right_mono) auto
[PROOF STATE]
proof (state)
this:
1 * pi < (2 + 2 * real N) * pi

goal (2 subgoals):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment ?a x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
 2. ?a \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < (2 + 2 * real N) * pi
[PROOF STEP]
show *: "\<i> \<in> ?S'"
[PROOF STATE]
proof (prove)
using this:
1 < (2 + 2 * real N) * pi

goal (1 subgoal):
 1. \<i> \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
\<i> \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}

goal (1 subgoal):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment \<i> x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment \<i> x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
assume z: "z \<in> ?S'"
[PROOF STATE]
proof (state)
this:
z \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}

goal (1 subgoal):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment \<i> x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
have "closed_segment \<i> z \<inter> {z. Re z = 0 \<and> Im z \<le> 0} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment \<i> z \<inter> {z. Re z = 0 \<and> Im z \<le> 0} = {}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> closed_segment \<i> z; Re x = 0; Im x \<le> 0\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> closed_segment \<i> z; Re x = 0; Im x \<le> 0\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
assume s: "s \<in> closed_segment \<i> z" "Re s = 0" "Im s \<le> 0"
[PROOF STATE]
proof (state)
this:
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> closed_segment \<i> z; Re x = 0; Im x \<le> 0\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0
[PROOF STEP]
obtain t where t: "t \<in> {0..1}" "s = linepath \<i> z t"
[PROOF STATE]
proof (prove)
using this:
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> {0..1}; s = linepath \<i> z t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using linepath_image_01
[PROOF STATE]
proof (prove)
using this:
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0
linepath ?a ?b ` {0..1} = closed_segment ?a ?b

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> {0..1}; s = linepath \<i> z t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<in> {0..1}
s = linepath \<i> z t

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> closed_segment \<i> z; Re x = 0; Im x \<le> 0\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
with z s t
[PROOF STATE]
proof (chain)
picking this:
z \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0
t \<in> {0..1}
s = linepath \<i> z t
t \<in> {0..1}
s = linepath \<i> z t
[PROOF STEP]
have z': "Re z = 0" "Im z > 0"
[PROOF STATE]
proof (prove)
using this:
z \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0
t \<in> {0..1}
s = linepath \<i> z t
t \<in> {0..1}
s = linepath \<i> z t

goal (1 subgoal):
 1. Re z = 0 &&& 0 < Im z
[PROOF STEP]
by (auto simp: Re_linepath' S_def linepath_0')
[PROOF STATE]
proof (state)
this:
Re z = 0
0 < Im z

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> closed_segment \<i> z; Re x = 0; Im x \<le> 0\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
with s
[PROOF STATE]
proof (chain)
picking this:
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0
Re z = 0
0 < Im z
[PROOF STEP]
have "Im s \<in> closed_segment 1 (Im z) \<and> Im s \<le> 0"
[PROOF STATE]
proof (prove)
using this:
s \<in> closed_segment \<i> z
Re s = 0
Im s \<le> 0
Re z = 0
0 < Im z

goal (1 subgoal):
 1. Im s \<in> closed_segment 1 (Im z) \<and> Im s \<le> 0
[PROOF STEP]
by (subst (asm) closed_segment_same_Re) auto
[PROOF STATE]
proof (state)
this:
Im s \<in> closed_segment 1 (Im z) \<and> Im s \<le> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> closed_segment \<i> z; Re x = 0; Im x \<le> 0\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
with z'
[PROOF STATE]
proof (chain)
picking this:
Re z = 0
0 < Im z
Im s \<in> closed_segment 1 (Im z) \<and> Im s \<le> 0
[PROOF STEP]
show "s \<in> {}"
[PROOF STATE]
proof (prove)
using this:
Re z = 0
0 < Im z
Im s \<in> closed_segment 1 (Im z) \<and> Im s \<le> 0

goal (1 subgoal):
 1. s \<in> {}
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl split: if_splits)
[PROOF STATE]
proof (state)
this:
s \<in> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closed_segment \<i> z \<inter> {z. Re z = 0 \<and> Im z \<le> 0} = {}

goal (1 subgoal):
 1. \<And>x. x \<in> UNIV - {z. Re z = 0 \<and> Im z \<le> 0} \<Longrightarrow> closed_segment \<i> x \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
thus "closed_segment \<i> z \<subseteq> ?S'"
[PROOF STATE]
proof (prove)
using this:
closed_segment \<i> z \<inter> {z. Re z = 0 \<and> Im z \<le> 0} = {}

goal (1 subgoal):
 1. closed_segment \<i> z \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
closed_segment \<i> z \<subseteq> UNIV - {z. Re z = 0 \<and> Im z \<le> 0}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
starlike (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "connected ?S'"
[PROOF STATE]
proof (prove)
using this:
starlike (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})

goal (1 subgoal):
 1. connected (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})
[PROOF STEP]
by (rule starlike_imp_connected)
[PROOF STATE]
proof (state)
this:
connected (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "connected S'"
[PROOF STATE]
proof (prove)
using this:
connected (UNIV - {z. Re z = 0 \<and> Im z \<le> 0})

goal (1 subgoal):
 1. connected S'
[PROOF STEP]
by (simp add: Compl_eq_Diff_UNIV S'_def)
[PROOF STATE]
proof (state)
this:
connected S'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected S
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (- {z. Re z = 0 \<and> Im z \<le> 0} - (sngs - sngs'))
[PROOF STEP]
by (rule connected_open_diff_countable)
       (insert \<open>connected S'\<close>, auto simp: sngs_def closed_neg_Im_slit S'_def)

  \<comment>\<open>The integrand is now clearly holomorphic on @{term "S - sngs'"} and we can apply the
     Residue Theorem.\<close>
[PROOF STATE]
proof (state)
this:
connected S

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have holo: "f s holomorphic_on (S - sngs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f s holomorphic_on S - sngs'
[PROOF STEP]
unfolding f_def Ln'_def S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. exp ((Ln (- \<i> * z) + \<i> * complex_of_real pi / 2) * - s + complex_of_real a * z) / (1 - exp z)) holomorphic_on - {z. Re z = 0 \<and> Im z \<le> 0} - (sngs - sngs') - sngs'
[PROOF STEP]
using sngs
[PROOF STATE]
proof (prove)
using this:
Re ?z \<noteq> 0 \<or> 0 < Im ?z \<Longrightarrow> (exp ?z = 1) = (?z \<in> sngs)

goal (1 subgoal):
 1. (\<lambda>z. exp ((Ln (- \<i> * z) + \<i> * complex_of_real pi / 2) * - s + complex_of_real a * z) / (1 - exp z)) holomorphic_on - {z. Re z = 0 \<and> Im z \<le> 0} - (sngs - sngs') - sngs'
[PROOF STEP]
by (auto intro!: holomorphic_intros simp: complex_nonpos_Reals_iff)
[PROOF STATE]
proof (state)
this:
f s holomorphic_on S - sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "contour_integral \<gamma> (f s) =
          of_real (2 * pi) * \<i> * (\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral \<gamma> (f s) = complex_of_real (2 * pi) * \<i> * (\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z)
[PROOF STEP]
proof (rule Residue_theorem)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. open ?s
 2. connected ?s
 3. finite sngs'
 4. f s holomorphic_on ?s - sngs'
 5. valid_path \<gamma>
 6. pathfinish \<gamma> = pathstart \<gamma>
 7. path_image \<gamma> \<subseteq> ?s - sngs'
 8. \<forall>z. z \<notin> ?s \<longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
show "\<forall>z. z \<notin> S \<longrightarrow> winding_number \<gamma> z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z. z \<notin> S \<longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. z \<notin> S \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. z \<notin> S \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
assume "z \<notin> S"
[PROOF STATE]
proof (state)
this:
z \<notin> S

goal (1 subgoal):
 1. \<And>z. z \<notin> S \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
hence "Re z = 0 \<and> Im z \<le> 0 \<or> z \<in> sngs - sngs'"
[PROOF STATE]
proof (prove)
using this:
z \<notin> S

goal (1 subgoal):
 1. Re z = 0 \<and> Im z \<le> 0 \<or> z \<in> sngs - sngs'
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
Re z = 0 \<and> Im z \<le> 0 \<or> z \<in> sngs - sngs'

goal (1 subgoal):
 1. \<And>z. z \<notin> S \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
thus "winding_number \<gamma> z = 0"
[PROOF STATE]
proof (prove)
using this:
Re z = 0 \<and> Im z \<le> 0 \<or> z \<in> sngs - sngs'

goal (1 subgoal):
 1. winding_number \<gamma> z = 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
define x where "x = -Im z"
[PROOF STATE]
proof (state)
this:
x = - Im z

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
assume "Re z = 0 \<and> Im z \<le> 0"
[PROOF STATE]
proof (state)
this:
Re z = 0 \<and> Im z \<le> 0

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
hence x: "z = -of_real x * \<i>" "x \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
Re z = 0 \<and> Im z \<le> 0

goal (1 subgoal):
 1. z = - complex_of_real x * \<i> &&& 0 \<le> x
[PROOF STEP]
unfolding complex_eq_iff
[PROOF STATE]
proof (prove)
using this:
Re z = 0 \<and> Im z \<le> 0

goal (1 subgoal):
 1. Re z = Re (- complex_of_real x * \<i>) \<and> Im z = Im (- complex_of_real x * \<i>) &&& 0 \<le> x
[PROOF STEP]
by (simp_all add: x_def)
[PROOF STATE]
proof (state)
this:
z = - complex_of_real x * \<i>
0 \<le> x

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
obtain B where "\<And>z. norm z \<ge> B \<Longrightarrow> winding_number \<gamma> z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. (\<And>z. B \<le> cmod z \<Longrightarrow> winding_number \<gamma> z = 0) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using winding_number_zero_at_infinity[of \<gamma>]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>\<rbrakk> \<Longrightarrow> \<exists>B. \<forall>z. B \<le> cmod z \<longrightarrow> winding_number \<gamma> z = 0

goal (1 subgoal):
 1. (\<And>B. (\<And>z. B \<le> cmod z \<Longrightarrow> winding_number \<gamma> z = 0) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<le> cmod ?z \<Longrightarrow> winding_number \<gamma> ?z = 0

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
hence "winding_number \<gamma> (-of_real (max B 0) * \<i>) = 0"
[PROOF STATE]
proof (prove)
using this:
B \<le> cmod ?z \<Longrightarrow> winding_number \<gamma> ?z = 0

goal (1 subgoal):
 1. winding_number \<gamma> (- complex_of_real (max B 0) * \<i>) = 0
[PROOF STEP]
by (auto simp: norm_mult)
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> (- complex_of_real (max B 0) * \<i>) = 0

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> (- complex_of_real (max B 0) * \<i>) = 0

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
have "winding_number \<gamma> (-of_real (max B 0) * \<i>) = winding_number \<gamma> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> (- complex_of_real (max B 0) * \<i>) = winding_number \<gamma> z
[PROOF STEP]
proof (rule winding_number_eq)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. path \<gamma>
 2. pathfinish \<gamma> = pathstart \<gamma>
 3. - complex_of_real (max B 0) * \<i> \<in> ?S
 4. z \<in> ?S
 5. connected ?S
 6. ?S \<inter> path_image \<gamma> = {}
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
z = - complex_of_real x * \<i>
0 \<le> x
[PROOF STEP]
have "closed_segment (-of_real (max B 0) * \<i>) z \<subseteq> {z. Re z = 0 \<and> Im z \<le> 0}"
[PROOF STATE]
proof (prove)
using this:
z = - complex_of_real x * \<i>
0 \<le> x

goal (1 subgoal):
 1. closed_segment (- complex_of_real (max B 0) * \<i>) z \<subseteq> {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
by (auto simp: closed_segment_same_Re closed_segment_eq_real_ivl)
[PROOF STATE]
proof (state)
this:
closed_segment (- complex_of_real (max B 0) * \<i>) z \<subseteq> {z. Re z = 0 \<and> Im z \<le> 0}

goal (6 subgoals):
 1. path \<gamma>
 2. pathfinish \<gamma> = pathstart \<gamma>
 3. - complex_of_real (max B 0) * \<i> \<in> ?S
 4. z \<in> ?S
 5. connected ?S
 6. ?S \<inter> path_image \<gamma> = {}
[PROOF STEP]
with \<open>path_image \<gamma> \<subseteq> S - sngs'\<close>
[PROOF STATE]
proof (chain)
picking this:
path_image \<gamma> \<subseteq> S - sngs'
closed_segment (- complex_of_real (max B 0) * \<i>) z \<subseteq> {z. Re z = 0 \<and> Im z \<le> 0}
[PROOF STEP]
show "closed_segment (-of_real (max B 0) * \<i>) z \<inter> path_image \<gamma> = {}"
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> S - sngs'
closed_segment (- complex_of_real (max B 0) * \<i>) z \<subseteq> {z. Re z = 0 \<and> Im z \<le> 0}

goal (1 subgoal):
 1. closed_segment (- complex_of_real (max B 0) * \<i>) z \<inter> path_image \<gamma> = {}
[PROOF STEP]
by (auto simp: S_def)
[PROOF STATE]
proof (state)
this:
closed_segment (- complex_of_real (max B 0) * \<i>) z \<inter> path_image \<gamma> = {}

goal (5 subgoals):
 1. path \<gamma>
 2. pathfinish \<gamma> = pathstart \<gamma>
 3. - complex_of_real (max B 0) * \<i> \<in> closed_segment (- complex_of_real (max B 0) * \<i>) z
 4. z \<in> closed_segment (- complex_of_real (max B 0) * \<i>) z
 5. connected (closed_segment (- complex_of_real (max B 0) * \<i>) z)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> (- complex_of_real (max B 0) * \<i>) = winding_number \<gamma> z

goal (2 subgoals):
 1. Re z = 0 \<and> Im z \<le> 0 \<Longrightarrow> winding_number \<gamma> z = 0
 2. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
winding_number \<gamma> z = 0
[PROOF STEP]
show "winding_number \<gamma> z = 0"
[PROOF STATE]
proof (prove)
using this:
winding_number \<gamma> z = 0

goal (1 subgoal):
 1. winding_number \<gamma> z = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = 0

goal (1 subgoal):
 1. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
assume z: "z \<in> sngs - sngs'"
[PROOF STATE]
proof (state)
this:
z \<in> sngs - sngs'

goal (1 subgoal):
 1. z \<in> sngs - sngs' \<Longrightarrow> winding_number \<gamma> z = 0
[PROOF STEP]
show "winding_number \<gamma> z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z = 0
[PROOF STEP]
proof (rule winding_number_zero_outside)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. path \<gamma>
 2. convex ?s
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. z \<notin> ?s
 5. path_image \<gamma> \<subseteq> ?s
[PROOF STEP]
have "path_image \<gamma> = path_image big_circle \<union> path_image neg_line \<union>
                                 path_image small_circle \<union> path_image pos_line"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> = path_image big_circle \<union> path_image neg_line \<union> path_image small_circle \<union> path_image pos_line
[PROOF STEP]
unfolding \<gamma>_altdef small_circle_def big_circle_def pos_line_def neg_line_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (part_circlepath 0 R 0 pi +++ linepath (complex_of_real (- R)) (complex_of_real (- r)) +++ part_circlepath 0 r pi 0 +++ linepath (complex_of_real r) (complex_of_real R)) = path_image (part_circlepath 0 R 0 pi) \<union> path_image (linepath (complex_of_real (- R)) (complex_of_real (- r))) \<union> path_image (part_circlepath 0 r pi 0) \<union> path_image (linepath (complex_of_real r) (complex_of_real R))
[PROOF STEP]
by (simp add: path_image_join Un_assoc)
[PROOF STATE]
proof (state)
this:
path_image \<gamma> = path_image big_circle \<union> path_image neg_line \<union> path_image small_circle \<union> path_image pos_line

goal (5 subgoals):
 1. path \<gamma>
 2. convex ?s
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. z \<notin> ?s
 5. path_image \<gamma> \<subseteq> ?s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
path_image \<gamma> = path_image big_circle \<union> path_image neg_line \<union> path_image small_circle \<union> path_image pos_line

goal (5 subgoals):
 1. path \<gamma>
 2. convex ?s
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. z \<notin> ?s
 5. path_image \<gamma> \<subseteq> ?s
[PROOF STEP]
have "\<dots> \<subseteq> cball 0 ((2 * N + 1) * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image big_circle \<union> path_image neg_line \<union> path_image small_circle \<union> path_image pos_line \<subseteq> cball 0 (real (2 * N + 1) * pi)
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. path_image big_circle \<union> path_image neg_line \<union> path_image small_circle \<union> path_image pos_line \<subseteq> cball 0 (real (2 * N + 1) * pi)
[PROOF STEP]
by (auto simp: small_circle_def big_circle_def pos_line_def neg_line_def
                           path_image_join norm_mult R_def path_image_part_circlepath'
                           in_Reals_norm closed_segment_Reals closed_segment_eq_real_ivl)
[PROOF STATE]
proof (state)
this:
path_image big_circle \<union> path_image neg_line \<union> path_image small_circle \<union> path_image pos_line \<subseteq> cball 0 (real (2 * N + 1) * pi)

goal (5 subgoals):
 1. path \<gamma>
 2. convex ?s
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. z \<notin> ?s
 5. path_image \<gamma> \<subseteq> ?s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
path_image \<gamma> \<subseteq> cball 0 (real (2 * N + 1) * pi)
[PROOF STEP]
show "path_image \<gamma> \<subseteq> \<dots>"
[PROOF STATE]
proof (prove)
using this:
path_image \<gamma> \<subseteq> cball 0 (real (2 * N + 1) * pi)

goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> cball 0 (real (2 * N + 1) * pi)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> cball 0 (real (2 * N + 1) * pi)

goal (4 subgoals):
 1. path \<gamma>
 2. convex (cball 0 (real (2 * N + 1) * pi))
 3. pathfinish \<gamma> = pathstart \<gamma>
 4. z \<notin> cball 0 (real (2 * N + 1) * pi)
[PROOF STEP]
qed (insert z, auto simp: sngs_def sngs'_def norm_mult)
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>z. z \<notin> S \<longrightarrow> winding_number \<gamma> z = 0

goal (7 subgoals):
 1. open S
 2. connected S
 3. finite sngs'
 4. f s holomorphic_on S - sngs'
 5. valid_path \<gamma>
 6. pathfinish \<gamma> = pathstart \<gamma>
 7. path_image \<gamma> \<subseteq> S - sngs'
[PROOF STEP]
qed (insert \<open>path_image \<gamma> \<subseteq> S - sngs'\<close> \<open>connected S\<close> \<open>open S\<close> holo, auto simp: sngs'_def)

  \<comment>\<open>We can use Wenda Li's framework to compute the winding numbers at the poles and show that
     they are all 1.\<close>
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (f s) = complex_of_real (2 * pi) * \<i> * (\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z)

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (f s) = complex_of_real (2 * pi) * \<i> * (\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z)

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "winding_number \<gamma> z = 1" if "z \<in> sngs'" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
have "r < 2 * pi * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r < 2 * pi * 1
[PROOF STEP]
using pi_gt3 r_R
[PROOF STATE]
proof (prove)
using this:
3 < pi
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. r < 2 * pi * 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r < 2 * pi * 1

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
r < 2 * pi * 1

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
have "\<dots> \<le> 2 * pi * real n" if "n > 0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * pi * 1 \<le> 2 * pi * real n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. 2 * pi * 1 \<le> 2 * pi * real n
[PROOF STEP]
by (intro mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
0 < ?n \<Longrightarrow> 2 * pi * 1 \<le> 2 * pi * real ?n

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < ?n1 \<Longrightarrow> r < 2 * pi * real ?n1
[PROOF STEP]
have norm_z: "norm z > r" "norm z < R"
[PROOF STATE]
proof (prove)
using this:
0 < ?n1 \<Longrightarrow> r < 2 * pi * real ?n1

goal (1 subgoal):
 1. r < cmod z &&& cmod z < R
[PROOF STEP]
using that r_R
[PROOF STATE]
proof (prove)
using this:
0 < ?n1 \<Longrightarrow> r < 2 * pi * real ?n1
z \<in> sngs'
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. r < cmod z &&& cmod z < R
[PROOF STEP]
by (auto simp: sngs'_def norm_mult R_def)
[PROOF STATE]
proof (state)
this:
r < cmod z
cmod z < R

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
have "cindex_pathE big_circle z = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE big_circle z = - 1
[PROOF STEP]
using r_R that
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R
z \<in> sngs'

goal (1 subgoal):
 1. cindex_pathE big_circle z = - 1
[PROOF STEP]
unfolding big_circle_def
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R
z \<in> sngs'

goal (1 subgoal):
 1. cindex_pathE (part_circlepath 0 R 0 pi) z = - 1
[PROOF STEP]
by (subst cindex_pathE_circlepath_upper(1)) (auto simp: sngs'_def norm_mult R_def)
[PROOF STATE]
proof (state)
this:
cindex_pathE big_circle z = - 1

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
have "cindex_pathE small_circle z = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE small_circle z = - 1
[PROOF STEP]
using r_R that norm_z
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R
z \<in> sngs'
r < cmod z
cmod z < R

goal (1 subgoal):
 1. cindex_pathE small_circle z = - 1
[PROOF STEP]
unfolding small_circle_def
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R
z \<in> sngs'
r < cmod z
cmod z < R

goal (1 subgoal):
 1. cindex_pathE (part_circlepath 0 r pi 0) z = - 1
[PROOF STEP]
by (subst cindex_pathE_reversepath', subst reversepath_part_circlepath,
          subst cindex_pathE_circlepath_upper(2)) (auto simp: sngs'_def norm_mult)
[PROOF STATE]
proof (state)
this:
cindex_pathE small_circle z = - 1

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
have "cindex_pathE neg_line z = 0" "cindex_pathE pos_line z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE neg_line z = 0 &&& cindex_pathE pos_line z = 0
[PROOF STEP]
unfolding neg_line_def pos_line_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (linepath (complex_of_real (- R)) (complex_of_real (- r))) z = 0 &&& cindex_pathE (linepath (complex_of_real r) (complex_of_real R)) z = 0
[PROOF STEP]
using r_R that
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R
z \<in> sngs'

goal (1 subgoal):
 1. cindex_pathE (linepath (complex_of_real (- R)) (complex_of_real (- r))) z = 0 &&& cindex_pathE (linepath (complex_of_real r) (complex_of_real R)) z = 0
[PROOF STEP]
by (subst cindex_pathE_linepath; force simp: neg_line_def cindex_pathE_linepath
            closed_segment_Reals closed_segment_eq_real_ivl sngs'_def complex_eq_iff)+
[PROOF STATE]
proof (state)
this:
cindex_pathE neg_line z = 0
cindex_pathE pos_line z = 0

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
note indices = \<open>cindex_pathE big_circle z = -1\<close> \<open>cindex_pathE small_circle z = -1\<close>
                   \<open>cindex_pathE neg_line z = 0\<close> \<open>cindex_pathE pos_line z = 0\<close>
[PROOF STATE]
proof (state)
this:
cindex_pathE big_circle z = - 1
cindex_pathE small_circle z = - 1
cindex_pathE neg_line z = 0
cindex_pathE pos_line z = 0

goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number \<gamma> z = 1
[PROOF STEP]
unfolding \<gamma>_altdef big_circle_def small_circle_def pos_line_def neg_line_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (part_circlepath 0 R 0 pi +++ linepath (complex_of_real (- R)) (complex_of_real (- r)) +++ part_circlepath 0 r pi 0 +++ linepath (complex_of_real r) (complex_of_real R)) z = 1
[PROOF STEP]
by eval_winding (insert indices path_images that,
                       auto simp: big_circle_def small_circle_def pos_line_def neg_line_def)
[PROOF STATE]
proof (state)
this:
winding_number \<gamma> z = 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?z \<in> sngs' \<Longrightarrow> winding_number \<gamma> ?z = 1

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "(\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z) = (\<Sum>z\<in>sngs'. residue (f s) z)"
[PROOF STATE]
proof (prove)
using this:
?z \<in> sngs' \<Longrightarrow> winding_number \<gamma> ?z = 1

goal (1 subgoal):
 1. (\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z) = sum (residue (f s)) sngs'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z) = sum (residue (f s)) sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>sngs'. winding_number \<gamma> z * residue (f s) z) = sum (residue (f s)) sngs'

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "\<dots> = (\<Sum>k\<in>{0<..N}. residue (f s) (2 * pi * of_nat k * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (residue (f s)) sngs' = (\<Sum>k\<in>{0<..N}. residue (f s) (complex_of_real (2 * pi * real k) * \<i>))
[PROOF STEP]
unfolding sngs'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (residue (f s)) ((\<lambda>n. complex_of_real (2 * pi * real n) * \<i>) ` {0<..N}) = (\<Sum>k\<in>{0<..N}. residue (f s) (complex_of_real (2 * pi * real k) * \<i>))
[PROOF STEP]
by (subst sum.reindex) (auto intro!: inj_onI simp: o_def)

  \<comment>\<open>Next, we compute the residues at each pole.\<close>
[PROOF STATE]
proof (state)
this:
sum (residue (f s)) sngs' = (\<Sum>k\<in>{0<..N}. residue (f s) (complex_of_real (2 * pi * real k) * \<i>))

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (residue (f s)) sngs' = (\<Sum>k\<in>{0<..N}. residue (f s) (complex_of_real (2 * pi * real k) * \<i>))

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
have "residue (f s) (2 * pi * of_nat k * \<i>) = -exp (- s * of_real pi * \<i> / 2) * Res s k"
    if "k \<in> {0<..N}" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (f s) (complex_of_real (2 * pi * real k) * \<i>) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. exp (Ln' z * - s + complex_of_real a * z) / (1 - exp z)) (complex_of_real (2 * pi * real k) * \<i>) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
proof (subst residue_simple_pole_deriv)
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. (\<lambda>z. exp (Ln' z * - s + complex_of_real a * z)) holomorphic_on ?s
 2. (\<lambda>z. 1 - exp z) holomorphic_on ?s
 3. open ?s
 4. connected ?s
 5. complex_of_real (2 * pi * real k) * \<i> \<in> ?s
 6. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 7. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 8. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 9. ?g' \<noteq> 0
 10. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
show "open S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S'
[PROOF STEP]
using closed_neg_Im_slit
[PROOF STATE]
proof (prove)
using this:
closed {z. Re z = 0 \<and> Im z \<le> 0}

goal (1 subgoal):
 1. open S'
[PROOF STEP]
by (auto simp: S'_def)
[PROOF STATE]
proof (state)
this:
open S'

goal (9 subgoals):
 1. (\<lambda>z. exp (Ln' z * - s + complex_of_real a * z)) holomorphic_on S'
 2. (\<lambda>z. 1 - exp z) holomorphic_on S'
 3. connected S'
 4. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 5. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 6. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 7. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 8. ?g' \<noteq> 0
 9. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
show "connected S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected S'
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
connected S'

goal (8 subgoals):
 1. (\<lambda>z. exp (Ln' z * - s + complex_of_real a * z)) holomorphic_on S'
 2. (\<lambda>z. 1 - exp z) holomorphic_on S'
 3. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 4. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 5. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 6. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 7. ?g' \<noteq> 0
 8. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
show "(\<lambda>z. exp (Ln' z * (-s) + of_real a * z)) holomorphic_on S'"
         "(\<lambda>z. 1 - exp z) holomorphic_on S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. exp (Ln' z * - s + complex_of_real a * z)) holomorphic_on S' &&& (\<lambda>z. 1 - exp z) holomorphic_on S'
[PROOF STEP]
by (auto simp: S'_def Ln'_def complex_nonpos_Reals_iff intro!: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>z. exp (Ln' z * - s + complex_of_real a * z)) holomorphic_on S'
(\<lambda>z. 1 - exp z) holomorphic_on S'

goal (6 subgoals):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 2. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 3. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 4. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 5. ?g' \<noteq> 0
 6. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
have "((\<lambda>z. 1 - exp z) has_field_derivative -exp (2 * pi * k * \<i>))
            (at (of_real (2 * pi * real k) * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. 1 - exp z) has_field_derivative - exp (complex_of_real (2 * pi * real k) * \<i>)) (at (complex_of_real (2 * pi * real k) * \<i>))
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. 1 - exp z) has_field_derivative - exp (complex_of_real (2 * pi * real k) * \<i>)) (at (complex_of_real (2 * pi * real k) * \<i>))

goal (6 subgoals):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 2. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 3. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 4. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 5. ?g' \<noteq> 0
 6. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>z. 1 - exp z) has_field_derivative - exp (complex_of_real (2 * pi * real k) * \<i>)) (at (complex_of_real (2 * pi * real k) * \<i>))

goal (6 subgoals):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 2. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 3. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 4. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 5. ?g' \<noteq> 0
 6. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
have "-exp (2 * pi * k * \<i>) = -1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - exp (complex_of_real (2 * pi * real k) * \<i>) = - 1
[PROOF STEP]
by (simp add: exp_eq_polar)
[PROOF STATE]
proof (state)
this:
- exp (complex_of_real (2 * pi * real k) * \<i>) = - 1

goal (6 subgoals):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 2. ((\<lambda>z. 1 - exp z) has_field_derivative ?g') (at (complex_of_real (2 * pi * real k) * \<i>))
 3. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 4. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 5. ?g' \<noteq> 0
 6. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / ?g' = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. 1 - exp z) has_field_derivative - 1) (at (complex_of_real (2 * pi * real k) * \<i>))
[PROOF STEP]
show "((\<lambda>z. 1 - exp z) has_field_derivative -1)
                    (at (of_real (2 * pi * real k) * \<i>))"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. 1 - exp z) has_field_derivative - 1) (at (complex_of_real (2 * pi * real k) * \<i>))

goal (1 subgoal):
 1. ((\<lambda>z. 1 - exp z) has_field_derivative - 1) (at (complex_of_real (2 * pi * real k) * \<i>))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>z. 1 - exp z) has_field_derivative - 1) (at (complex_of_real (2 * pi * real k) * \<i>))

goal (5 subgoals):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 2. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 3. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 4. - 1 \<noteq> 0
 5. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
have "Im (of_real (2 * pi * real k) * \<i>) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Im (complex_of_real (2 * pi * real k) * \<i>)
[PROOF STEP]
using pi_gt_zero that
[PROOF STATE]
proof (prove)
using this:
0 < pi
k \<in> {0<..N}

goal (1 subgoal):
 1. 0 < Im (complex_of_real (2 * pi * real k) * \<i>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Im (complex_of_real (2 * pi * real k) * \<i>)

goal (5 subgoals):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
 2. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 3. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 4. - 1 \<noteq> 0
 5. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
thus "of_real (2 * pi * real k) * \<i> \<in> S'"
[PROOF STATE]
proof (prove)
using this:
0 < Im (complex_of_real (2 * pi * real k) * \<i>)

goal (1 subgoal):
 1. complex_of_real (2 * pi * real k) * \<i> \<in> S'
[PROOF STEP]
by (simp add: S'_def)
[PROOF STATE]
proof (state)
this:
complex_of_real (2 * pi * real k) * \<i> \<in> S'

goal (4 subgoals):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 2. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 3. - 1 \<noteq> 0
 4. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
have "exp (\<i> * pi / 2) = \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (\<i> * complex_of_real pi / 2) = \<i>
[PROOF STEP]
by (simp add: exp_eq_polar)
[PROOF STATE]
proof (state)
this:
exp (\<i> * complex_of_real pi / 2) = \<i>

goal (4 subgoals):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 2. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 3. - 1 \<noteq> 0
 4. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
hence "exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * -s +
              of_real a * (of_real (2 * pi * real k) * \<i>)) / -1 =
            - exp (2 * k * a * pi * \<i> - s * pi * \<i> / 2 - s * ln (2 * k * pi))" (is "?R = _")
[PROOF STATE]
proof (prove)
using this:
exp (\<i> * complex_of_real pi / 2) = \<i>

goal (1 subgoal):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi)))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
exp (\<i> * complex_of_real pi / 2) = \<i>
k \<in> {0<..N}

goal (1 subgoal):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi)))
[PROOF STEP]
by (subst Ln'_times_of_real) (simp_all add: Ln'_i algebra_simps exp_diff)
[PROOF STATE]
proof (state)
this:
exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi)))

goal (4 subgoals):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 2. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 3. - 1 \<noteq> 0
 4. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi)))

goal (4 subgoals):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 2. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 3. - 1 \<noteq> 0
 4. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
have "\<dots> = -exp (- s * of_real pi * \<i> / 2) * Res s k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi))) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
k \<in> {0<..N}

goal (1 subgoal):
 1. - exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi))) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
by (simp add: Res_def exp_diff powr_def exp_minus inverse_eq_divide Ln_Reals_eq mult_ac)
[PROOF STATE]
proof (state)
this:
- exp (complex_of_real (real (2 * k) * a * pi) * \<i> - s * complex_of_real pi * \<i> / 2 - s * complex_of_real (ln (real (2 * k) * pi))) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k

goal (4 subgoals):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 2. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 3. - 1 \<noteq> 0
 4. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
show "?R = -exp (- s * of_real pi * \<i> / 2) * Res s k"
[PROOF STATE]
proof (prove)
using this:
exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k

goal (1 subgoal):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) / - 1 = - exp (- s * complex_of_real pi * \<i> / 2) * Res s k

goal (3 subgoals):
 1. exp (Ln' (complex_of_real (2 * pi * real k) * \<i>) * - s + complex_of_real a * (complex_of_real (2 * pi * real k) * \<i>)) \<noteq> 0
 2. 1 - exp (complex_of_real (2 * pi * real k) * \<i>) = 0
 3. - 1 \<noteq> 0
[PROOF STEP]
qed (insert that, auto simp: S'_def exp_eq_polar)
[PROOF STATE]
proof (state)
this:
?k \<in> {0<..N} \<Longrightarrow> residue (f s) (complex_of_real (2 * pi * real ?k) * \<i>) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s ?k

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
hence "(\<Sum>k\<in>{0<..N}. residue (f s) (2 * pi * of_nat k * \<i>)) =
           -exp (- s * of_real pi * \<i> / 2) * (\<Sum>k\<in>{0<..N}. Res s k)"
[PROOF STATE]
proof (prove)
using this:
?k \<in> {0<..N} \<Longrightarrow> residue (f s) (complex_of_real (2 * pi * real ?k) * \<i>) = - exp (- s * complex_of_real pi * \<i> / 2) * Res s ?k

goal (1 subgoal):
 1. (\<Sum>k\<in>{0<..N}. residue (f s) (complex_of_real (2 * pi * real k) * \<i>)) = - exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
by (simp add: sum_distrib_left)

  \<comment>\<open>This gives us the final result:\<close>
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{0<..N}. residue (f s) (complex_of_real (2 * pi * real k) * \<i>)) = - exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
contour_integral \<gamma> (f s) = complex_of_real (2 * pi) * \<i> * (- exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N})
[PROOF STEP]
have "contour_integral \<gamma> (f s) =
                  -2 * pi * \<i> * exp (- s * of_real pi * \<i> / 2) * (\<Sum>k\<in>{0<..N}. Res s k)"
[PROOF STATE]
proof (prove)
using this:
contour_integral \<gamma> (f s) = complex_of_real (2 * pi) * \<i> * (- exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N})

goal (1 subgoal):
 1. contour_integral \<gamma> (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
by simp

  \<comment>\<open>Lastly, we decompose the contour integral into its four constituent integrals because this
     makes them somewhat nicer to work with later on.\<close>
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}

goal (2 subgoals):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
 2. f s contour_integrable_on hankel_semiannulus r N
[PROOF STEP]
show "f s contour_integrable_on \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f s contour_integrable_on \<gamma>
[PROOF STEP]
proof (rule contour_integrable_holomorphic_simple)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f s holomorphic_on ?S
 2. open ?S
 3. valid_path \<gamma>
 4. path_image \<gamma> \<subseteq> ?S
[PROOF STEP]
show "path_image \<gamma> \<subseteq> S - sngs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image \<gamma> \<subseteq> S - sngs'
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
path_image \<gamma> \<subseteq> S - sngs'

goal (3 subgoals):
 1. f s holomorphic_on S - sngs'
 2. open (S - sngs')
 3. valid_path \<gamma>
[PROOF STEP]
have "closed sngs'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed sngs'
[PROOF STEP]
by (intro finite_imp_closed) (auto simp: sngs'_def)
[PROOF STATE]
proof (state)
this:
closed sngs'

goal (3 subgoals):
 1. f s holomorphic_on S - sngs'
 2. open (S - sngs')
 3. valid_path \<gamma>
[PROOF STEP]
with \<open>open S\<close>
[PROOF STATE]
proof (chain)
picking this:
open S
closed sngs'
[PROOF STEP]
show "open (S - sngs')"
[PROOF STATE]
proof (prove)
using this:
open S
closed sngs'

goal (1 subgoal):
 1. open (S - sngs')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (S - sngs')

goal (2 subgoals):
 1. f s holomorphic_on S - sngs'
 2. valid_path \<gamma>
[PROOF STEP]
qed (insert holo, auto)
[PROOF STATE]
proof (state)
this:
f s contour_integrable_on \<gamma>

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
hence eq: "contour_integral \<gamma> (f s) =
               contour_integral big_circle (f s) + contour_integral neg_line (f s) +
               contour_integral small_circle (f s) + contour_integral pos_line (f s)"
[PROOF STATE]
proof (prove)
using this:
f s contour_integrable_on \<gamma>

goal (1 subgoal):
 1. contour_integral \<gamma> (f s) = contour_integral big_circle (f s) + contour_integral neg_line (f s) + contour_integral small_circle (f s) + contour_integral pos_line (f s)
[PROOF STEP]
unfolding \<gamma>_altdef big_circle_def neg_line_def small_circle_def pos_line_def
[PROOF STATE]
proof (prove)
using this:
f s contour_integrable_on part_circlepath 0 R 0 pi +++ linepath (complex_of_real (- R)) (complex_of_real (- r)) +++ part_circlepath 0 r pi 0 +++ linepath (complex_of_real r) (complex_of_real R)

goal (1 subgoal):
 1. contour_integral (part_circlepath 0 R 0 pi +++ linepath (complex_of_real (- R)) (complex_of_real (- r)) +++ part_circlepath 0 r pi 0 +++ linepath (complex_of_real r) (complex_of_real R)) (f s) = contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (linepath (complex_of_real (- R)) (complex_of_real (- r))) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) + contour_integral (linepath (complex_of_real r) (complex_of_real R)) (f s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (f s) = contour_integral big_circle (f s) + contour_integral neg_line (f s) + contour_integral small_circle (f s) + contour_integral pos_line (f s)

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral \<gamma> (f s) = contour_integral big_circle (f s) + contour_integral neg_line (f s) + contour_integral small_circle (f s) + contour_integral pos_line (f s)

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
have "contour_integral neg_line (f s) = integral {-R..-r} (\<lambda>x. f s (complex_of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral neg_line (f s) = integral {- R..- r} (\<lambda>x. f s (complex_of_real x))
[PROOF STEP]
unfolding neg_line_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath (complex_of_real (- R)) (complex_of_real (- r))) (f s) = integral {- R..- r} (\<lambda>x. f s (complex_of_real x))
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. contour_integral (linepath (complex_of_real (- R)) (complex_of_real (- r))) (f s) = integral {- R..- r} (\<lambda>x. f s (complex_of_real x))
[PROOF STEP]
by (subst contour_integral_linepath_Reals_eq) auto
[PROOF STATE]
proof (state)
this:
contour_integral neg_line (f s) = integral {- R..- r} (\<lambda>x. f s (complex_of_real x))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral neg_line (f s) = integral {- R..- r} (\<lambda>x. f s (complex_of_real x))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
have "\<dots> = exp (- \<i> * pi * s) *
                    integral {r..R} (\<lambda>x. exp (-ln x * s) * exp (-a * x) / (1 - exp (-x)))"
    (is "_ = _ * ?I")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {- R..- r} (\<lambda>x. f s (complex_of_real x)) = exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))
[PROOF STEP]
unfolding integral_mult_right [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {- R..- r} (\<lambda>x. f s (complex_of_real x)) = integral {r..R} (\<lambda>x. exp (- \<i> * complex_of_real pi * s) * (exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))))
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. integral {- R..- r} (\<lambda>x. f s (complex_of_real x)) = integral {r..R} (\<lambda>x. exp (- \<i> * complex_of_real pi * s) * (exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))))
[PROOF STEP]
by (subst Henstock_Kurzweil_Integration.integral_reflect_real [symmetric], intro integral_cong)
       (auto simp: f_def exp_of_real Ln'_of_real_neg exp_minus exp_Reals_eq
                   exp_diff exp_add field_simps)
[PROOF STATE]
proof (state)
this:
integral {- R..- r} (\<lambda>x. f s (complex_of_real x)) = exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {- R..- r} (\<lambda>x. f s (complex_of_real x)) = exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
have "?I = integral {r..R} (\<lambda>x. x powr (-s) * exp (-a * x) / (1 - exp (-x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))
[PROOF STEP]
by (intro integral_cong) (auto simp: powr_def Ln_Reals_eq exp_minus exp_diff field_simps)
[PROOF STATE]
proof (state)
this:
integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {r..R} (\<lambda>x. exp (complex_of_real (- ln x) * s) * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x)))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
have "contour_integral pos_line (f s) = integral {r..R} (\<lambda>x. f s (complex_of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral pos_line (f s) = integral {r..R} (\<lambda>x. f s (complex_of_real x))
[PROOF STEP]
unfolding pos_line_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath (complex_of_real r) (complex_of_real R)) (f s) = integral {r..R} (\<lambda>x. f s (complex_of_real x))
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. contour_integral (linepath (complex_of_real r) (complex_of_real R)) (f s) = integral {r..R} (\<lambda>x. f s (complex_of_real x))
[PROOF STEP]
by (subst contour_integral_linepath_Reals_eq) auto
[PROOF STATE]
proof (state)
this:
contour_integral pos_line (f s) = integral {r..R} (\<lambda>x. f s (complex_of_real x))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral pos_line (f s) = integral {r..R} (\<lambda>x. f s (complex_of_real x))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
have "\<dots> = integral {r..R} (\<lambda>x. x powr (-s) * exp (a * x) / (1 - exp x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {r..R} (\<lambda>x. f s (complex_of_real x)) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x))
[PROOF STEP]
using r_R
[PROOF STATE]
proof (prove)
using this:
0 < r
r < 2
2 < R

goal (1 subgoal):
 1. integral {r..R} (\<lambda>x. f s (complex_of_real x)) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x))
[PROOF STEP]
by (intro integral_cong) (simp add: f_def Ln'_of_real_pos exp_diff exp_minus
                                                  exp_Reals_eq field_simps powr_def Ln_Reals_eq)
[PROOF STATE]
proof (state)
this:
integral {r..R} (\<lambda>x. f s (complex_of_real x)) = integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x))

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
contour_integral big_circle (f s) + exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + contour_integral small_circle (f s) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
show ?thesis1
[PROOF STATE]
proof (prove)
using this:
contour_integral big_circle (f s) + exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + contour_integral small_circle (f s) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}

goal (1 subgoal):
 1. exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}
[PROOF STEP]
by (simp only: add_ac big_circle_def small_circle_def)
[PROOF STATE]
proof (state)
this:
exp (- \<i> * complex_of_real pi * s) * integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (- a * x)) / complex_of_real (1 - exp (- x))) + integral {r..R} (\<lambda>x. complex_of_real x powr - s * complex_of_real (exp (a * x)) / complex_of_real (1 - exp x)) + contour_integral (part_circlepath 0 R 0 pi) (f s) + contour_integral (part_circlepath 0 r pi 0) (f s) = complex_of_real (- 2 * pi) * \<i> * exp (- s * complex_of_real pi * \<i> / 2) * sum (Res s) {0<..N}

goal:
No subgoals!
[PROOF STEP]
qed