[STATEMENT]
theorem nat_even_power_sums_complex:
  assumes n': "n' > 0"
  shows   "(\<lambda>k. 1 / of_nat (Suc k) ^ (2*n') :: complex) sums
             of_real ((-1) ^ Suc n' * bernoulli (2*n') * (2 * pi) ^ (2 * n') / (2 * fact (2*n')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define n where "n = 2 * n'"
[PROOF STATE]
proof (state)
this:
n = 2 * n'

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
from n'
[PROOF STATE]
proof (chain)
picking this:
0 < n'
[PROOF STEP]
have n: "n \<ge> 2" "even n"
[PROOF STATE]
proof (prove)
using this:
0 < n'

goal (1 subgoal):
 1. 2 \<le> n &&& even n
[PROOF STEP]
by (auto simp: n_def)
[PROOF STATE]
proof (state)
this:
2 \<le> n
even n

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define zeta :: complex where "zeta = (\<Sum>k. 1 / of_nat (Suc k) ^ n)"
[PROOF STATE]
proof (state)
this:
zeta = (\<Sum>k. 1 / of_nat (Suc k) ^ n)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "summable (\<lambda>k. 1 / of_nat (Suc k) ^ n :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. 1 / of_nat (Suc k) ^ n)
[PROOF STEP]
using inverse_power_summable[of n] n
[PROOF STATE]
proof (prove)
using this:
2 \<le> n \<Longrightarrow> summable (\<lambda>na. inverse (of_nat na ^ n))
2 \<le> n
even n

goal (1 subgoal):
 1. summable (\<lambda>k. 1 / of_nat (Suc k) ^ n)
[PROOF STEP]
by (subst summable_Suc_iff) (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>k. 1 / of_nat (Suc k) ^ n)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
hence "(\<lambda>k. \<Sum>i<k. 1 / of_nat (Suc i) ^ n) \<longlonglongrightarrow> zeta"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>k. 1 / of_nat (Suc k) ^ n)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. 1 / of_nat (Suc i) ^ n) \<longlonglongrightarrow> zeta
[PROOF STEP]
by (subst (asm) summable_sums_iff) (simp add: sums_def zeta_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i<k. 1 / of_nat (Suc i) ^ n) \<longlonglongrightarrow> zeta

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i<k. 1 / of_nat (Suc i) ^ n) \<longlonglongrightarrow> zeta

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "(\<lambda>k. \<Sum>i<k. 1 / of_nat (Suc i) ^ n) = (\<lambda>k. \<Sum>i\<in>{0<..k}. 1 / of_nat i ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. (1::'a) / of_nat (Suc i) ^ n) = (\<lambda>k. \<Sum>i\<in>{0<..k}. (1::'a) / of_nat i ^ n)
[PROOF STEP]
by (intro ext sum.reindex_bij_witness[of _ "\<lambda>n. n - 1" Suc]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i<k. (1::?'a1) / of_nat (Suc i) ^ n) = (\<lambda>k. \<Sum>i\<in>{0<..k}. (1::?'a1) / of_nat i ^ n)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. \<Sum>i\<in>{0<..k}. 1 / of_nat i ^ n) \<longlonglongrightarrow> zeta
[PROOF STEP]
have zeta_limit: "(\<lambda>k. \<Sum>i\<in>{0<..k}. 1 / of_nat i ^ n) \<longlonglongrightarrow> zeta"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. \<Sum>i\<in>{0<..k}. 1 / of_nat i ^ n) \<longlonglongrightarrow> zeta

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<in>{0<..k}. 1 / of_nat i ^ n) \<longlonglongrightarrow> zeta
[PROOF STEP]
.

  \<comment> \<open>This is the exponential generating function of the Bernoulli numbers.\<close>
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i\<in>{0<..k}. 1 / of_nat i ^ n) \<longlonglongrightarrow> zeta

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define f where "f = (\<lambda>z::complex. if z = 0 then 1 else z / (exp z - 1))"

  \<comment> \<open>We will integrate over this function, since its residue at the origin
      is the $n$-th coefficient of @{term f}. Note that it has singularities
      at all points $2ik\pi$ for $k\in\mathbb{Z}$.\<close>
[PROOF STATE]
proof (state)
this:
f = (\<lambda>z. if z = 0 then 1 else z / (exp z - 1))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define g where "g = (\<lambda>z::complex. 1 / (z ^ n * (exp z - 1)))"

  \<comment> \<open>We integrate along a rectangle of width $2m$ and height $2(2m+1)\pi$
      with its centre at the origin. The benefit of the rectangular path is that
      it is easier to bound the value of the exponential appearing in the integrand.
      The horizontal lines of the rectangle are always right in the middle between
      two adjacent singularities.\<close>
[PROOF STATE]
proof (state)
this:
g = (\<lambda>z. 1 / (z ^ n * (exp z - 1)))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define \<gamma> :: "nat \<Rightarrow> real \<Rightarrow> complex"
    where "\<gamma> = (\<lambda>m. rectpath (-real m - real (2*m+1)*pi*\<i>) (real m + real (2*m+1)*pi*\<i>))"

  \<comment> \<open>This set is a convex open enclosing set the contains our path.\<close>
[PROOF STATE]
proof (state)
this:
\<gamma> = (\<lambda>m. rectpath (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define A where "A = (\<lambda>m::nat. box (-(real m+1) - (2*m+2)*pi*\<i>) (real m+1 + (2*m+2)*pi*\<i>))"

  \<comment> \<open>These are all the singularities in the enclosing inside the path
      (and also inside @{term A}).\<close>
[PROOF STATE]
proof (state)
this:
A = (\<lambda>m. box (complex_of_real (- (real m + 1)) - complex_of_real (real (2 * m + 2) * pi) * \<i>) (complex_of_real (real m + 1) + complex_of_real (real (2 * m + 2) * pi) * \<i>))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
define S where "S = (\<lambda>m::nat. (\<lambda>n. 2 * pi * of_int n * \<i>) ` {-m..m})"

  \<comment> \<open>Any singularity in @{term A} is of the form $2ki\pi$ where $|k| \leq m$.\<close>
[PROOF STATE]
proof (state)
this:
S = (\<lambda>m. (\<lambda>n. complex_of_real (2 * pi * real_of_int n) * \<i>) ` {- int m..int m})

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have int_bound: "k \<in> {-int m..int m}" if "2 * pi * k * \<i> \<in> A m" for k m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (2 * pi * real_of_int k) * \<i> \<in> A m
[PROOF STEP]
have "(-real (Suc m)) * (2 * pi) < real_of_int k * (2 * pi) \<and>
                        real (Suc m) * (2 * pi) > real_of_int k * (2 * pi)"
[PROOF STATE]
proof (prove)
using this:
complex_of_real (2 * pi * real_of_int k) * \<i> \<in> A m

goal (1 subgoal):
 1. - real (Suc m) * (2 * pi) < real_of_int k * (2 * pi) \<and> real_of_int k * (2 * pi) < real (Suc m) * (2 * pi)
[PROOF STEP]
by (auto simp: A_def in_box_complex_iff algebra_simps)
[PROOF STATE]
proof (state)
this:
- real (Suc m) * (2 * pi) < real_of_int k * (2 * pi) \<and> real_of_int k * (2 * pi) < real (Suc m) * (2 * pi)

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
hence "-real (Suc m) < real_of_int k \<and> real_of_int k < real (Suc m)"
[PROOF STATE]
proof (prove)
using this:
- real (Suc m) * (2 * pi) < real_of_int k * (2 * pi) \<and> real_of_int k * (2 * pi) < real (Suc m) * (2 * pi)

goal (1 subgoal):
 1. - real (Suc m) < real_of_int k \<and> real_of_int k < real (Suc m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- real (Suc m) < real_of_int k \<and> real_of_int k < real (Suc m)

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- real (Suc m) < real_of_int k \<and> real_of_int k < real (Suc m)

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
have "-real (Suc m) = real_of_int (-int (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - real (Suc m) = real_of_int (- int (Suc m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- real (Suc m) = real_of_int (- int (Suc m))

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- real (Suc m) = real_of_int (- int (Suc m))

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
have "real (Suc m) = real_of_int (int (Suc m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (Suc m) = real_of_int (int (Suc m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (Suc m) = real_of_int (int (Suc m))

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (Suc m) = real_of_int (int (Suc m))

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
have "real_of_int (- int (Suc m)) < real_of_int k \<and>
                 real_of_int k < real_of_int (int (Suc m)) \<longleftrightarrow> k \<in> {-int m..int m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (- int (Suc m)) < real_of_int k \<and> real_of_int k < real_of_int (int (Suc m))) = (k \<in> {- int m..int m})
[PROOF STEP]
by (subst of_int_less_iff) auto
[PROOF STATE]
proof (state)
this:
(real_of_int (- int (Suc m)) < real_of_int k \<and> real_of_int k < real_of_int (int (Suc m))) = (k \<in> {- int m..int m})

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k \<in> {- int m..int m}
[PROOF STEP]
show "k \<in> {-int m..int m}"
[PROOF STATE]
proof (prove)
using this:
k \<in> {- int m..int m}

goal (1 subgoal):
 1. k \<in> {- int m..int m}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
k \<in> {- int m..int m}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
complex_of_real (2 * pi * real_of_int ?k1) * \<i> \<in> A ?m1 \<Longrightarrow> ?k1 \<in> {- int ?m1..int ?m1}

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have zeros: "\<exists>k\<in>{-int m..int m}. z = 2 * pi * of_int k * \<i>" if "z \<in> A m" "exp z = 1" for z m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k\<in>{- int m..int m}. z = complex_of_real (2 * pi * real_of_int k) * \<i>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k\<in>{- int m..int m}. z = complex_of_real (2 * pi * real_of_int k) * \<i>
[PROOF STEP]
from that(2)
[PROOF STATE]
proof (chain)
picking this:
exp z = 1
[PROOF STEP]
obtain k where z_eq: "z = 2 * pi * of_int k * \<i>"
[PROOF STATE]
proof (prove)
using this:
exp z = 1

goal (1 subgoal):
 1. (\<And>k. z = complex_of_real (2 * pi * real_of_int k) * \<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>k. z = complex_of_real (2 * pi * real_of_int k) * \<i> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
z = complex_of_real (2 * pi * real_of_int k) * \<i>

goal (1 subgoal):
 1. \<exists>k\<in>{- int m..int m}. z = complex_of_real (2 * pi * real_of_int k) * \<i>
[PROOF STEP]
with int_bound[of k] and that(1)
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (2 * pi * real_of_int k) * \<i> \<in> A ?m1 \<Longrightarrow> k \<in> {- int ?m1..int ?m1}
z \<in> A m
z = complex_of_real (2 * pi * real_of_int k) * \<i>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
complex_of_real (2 * pi * real_of_int k) * \<i> \<in> A ?m1 \<Longrightarrow> k \<in> {- int ?m1..int ?m1}
z \<in> A m
z = complex_of_real (2 * pi * real_of_int k) * \<i>

goal (1 subgoal):
 1. \<exists>k\<in>{- int m..int m}. z = complex_of_real (2 * pi * real_of_int k) * \<i>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k\<in>{- int m..int m}. z = complex_of_real (2 * pi * real_of_int k) * \<i>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z1 \<in> A ?m1; exp ?z1 = 1\<rbrakk> \<Longrightarrow> \<exists>k\<in>{- int ?m1..int ?m1}. ?z1 = complex_of_real (2 * pi * real_of_int k) * \<i>

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have zeros': "z ^ n * (exp z - 1) \<noteq> 0" if "z \<in> A m - S m" for z m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z ^ n * (exp z - 1) \<noteq> 0
[PROOF STEP]
using zeros[of z] that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>z \<in> A ?m1; exp z = 1\<rbrakk> \<Longrightarrow> \<exists>k\<in>{- int ?m1..int ?m1}. z = complex_of_real (2 * pi * real_of_int k) * \<i>
z \<in> A m - S m

goal (1 subgoal):
 1. z ^ n * (exp z - 1) \<noteq> 0
[PROOF STEP]
by (auto simp: S_def)

  \<comment> \<open>The singularities all lie strictly inside the integration path.\<close>
[PROOF STATE]
proof (state)
this:
?z1 \<in> A ?m1 - S ?m1 \<Longrightarrow> ?z1 ^ n * (exp ?z1 - 1) \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have subset: "S m \<subseteq> box (-real m - real(2*m+1)*pi*\<i>) (real m + real(2*m+1)*pi*\<i>)" if "m > 0" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S m \<subseteq> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
proof (rule, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S m \<Longrightarrow> x \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
case (1 z)
[PROOF STATE]
proof (state)
this:
z \<in> S m

goal (1 subgoal):
 1. \<And>x. x \<in> S m \<Longrightarrow> x \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> S m
[PROOF STEP]
obtain k :: int where k: "k \<in> {-int m..int m}" "z = 2 * pi * k * \<i>"
[PROOF STATE]
proof (prove)
using this:
z \<in> S m

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<in> {- int m..int m}; z = complex_of_real (2 * pi * real_of_int k) * \<i>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
z \<in> (\<lambda>n. complex_of_real (2 * pi * real_of_int n) * \<i>) ` {- int m..int m}

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<in> {- int m..int m}; z = complex_of_real (2 * pi * real_of_int k) * \<i>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k \<in> {- int m..int m}
z = complex_of_real (2 * pi * real_of_int k) * \<i>

goal (1 subgoal):
 1. \<And>x. x \<in> S m \<Longrightarrow> x \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
have "2 * pi * -m + -pi < 2 * pi * k + 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k \<in> {- int m..int m}
z = complex_of_real (2 * pi * real_of_int k) * \<i>

goal (1 subgoal):
 1. 2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0
[PROOF STEP]
by (intro add_le_less_mono mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0

goal (1 subgoal):
 1. \<And>x. x \<in> S m \<Longrightarrow> x \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0

goal (1 subgoal):
 1. \<And>x. x \<in> S m \<Longrightarrow> x \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
have "2 * pi * k + 0 < 2 * pi * m + pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * pi * real_of_int k + 0 < 2 * pi * real m + pi
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
k \<in> {- int m..int m}
z = complex_of_real (2 * pi * real_of_int k) * \<i>

goal (1 subgoal):
 1. 2 * pi * real_of_int k + 0 < 2 * pi * real m + pi
[PROOF STEP]
by (intro add_le_less_mono mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
2 * pi * real_of_int k + 0 < 2 * pi * real m + pi

goal (1 subgoal):
 1. \<And>x. x \<in> S m \<Longrightarrow> x \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0
2 * pi * real_of_int k + 0 < 2 * pi * real m + pi
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0
2 * pi * real_of_int k + 0 < 2 * pi * real m + pi

goal (1 subgoal):
 1. z \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
using k \<open>m > 0\<close>
[PROOF STATE]
proof (prove)
using this:
2 * pi * real_of_int (- int m) + - pi < 2 * pi * real_of_int k + 0
2 * pi * real_of_int k + 0 < 2 * pi * real m + pi
k \<in> {- int m..int m}
z = complex_of_real (2 * pi * real_of_int k) * \<i>
0 < m

goal (1 subgoal):
 1. z \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
by (auto simp: A_def in_box_complex_iff algebra_simps)
[PROOF STATE]
proof (state)
this:
z \<in> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?m1 \<Longrightarrow> S ?m1 \<subseteq> box (complex_of_real (- real ?m1) - complex_of_real (real (2 * ?m1 + 1) * pi) * \<i>) (complex_of_real (real ?m1) + complex_of_real (real (2 * ?m1 + 1) * pi) * \<i>)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
from n and zeros'
[PROOF STATE]
proof (chain)
picking this:
2 \<le> n
even n
?z1 \<in> A ?m1 - S ?m1 \<Longrightarrow> ?z1 ^ n * (exp ?z1 - 1) \<noteq> 0
[PROOF STEP]
have holo: "g holomorphic_on A m - S m" for m
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
even n
?z1 \<in> A ?m1 - S ?m1 \<Longrightarrow> ?z1 ^ n * (exp ?z1 - 1) \<noteq> 0

goal (1 subgoal):
 1. g holomorphic_on A m - S m
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
even n
?z1 \<in> A ?m1 - S ?m1 \<Longrightarrow> ?z1 ^ n * (exp ?z1 - 1) \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>z. 1 / (z ^ n * (exp z - 1))) holomorphic_on A m - S m
[PROOF STEP]
by (intro holomorphic_intros) auto

  \<comment> \<open>The integration path lies completely inside $A$ and does not cross
      any singularities.\<close>
[PROOF STATE]
proof (state)
this:
g holomorphic_on A ?m1 - S ?m1

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have path_subset: "path_image (\<gamma> m) \<subseteq> A m - S m" if "m > 0" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
have "path_image (\<gamma> m) \<subseteq> cbox (-real m - (2 * m + 1) * pi * \<i>) (real m + (2 * m + 1) * pi * \<i>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
unfolding \<gamma>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (rectpath (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)) \<subseteq> cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
[PROOF STEP]
by (rule path_image_rectpath_subset_cbox) auto
[PROOF STATE]
proof (state)
this:
path_image (\<gamma> m) \<subseteq> cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
path_image (\<gamma> m) \<subseteq> cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
have "\<dots> \<subseteq> A m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> A m
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> box (complex_of_real (- (real m + 1)) - complex_of_real (real (2 * m + 2) * pi) * \<i>) (complex_of_real (real m + 1) + complex_of_real (real (2 * m + 2) * pi) * \<i>)
[PROOF STEP]
by (subst subset_box_complex) auto
[PROOF STATE]
proof (state)
this:
cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> A m

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
path_image (\<gamma> m) \<subseteq> A m
[PROOF STEP]
have "path_image (\<gamma> m) \<subseteq> A m"
[PROOF STATE]
proof (prove)
using this:
path_image (\<gamma> m) \<subseteq> A m

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
path_image (\<gamma> m) \<subseteq> A m

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
path_image (\<gamma> m) \<subseteq> A m

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
have "path_image (\<gamma> m) \<inter> S m = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_image (\<gamma> m) \<inter> S m = {}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
assume z: "z \<in> path_image (\<gamma> m)" "z \<in> S m"
[PROOF STATE]
proof (state)
this:
z \<in> path_image (\<gamma> m)
z \<in> S m

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
z \<in> S m
[PROOF STEP]
obtain k :: int where k: "z = 2 * pi * k * \<i>"
[PROOF STATE]
proof (prove)
using this:
z \<in> S m

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
hence [simp]: "Re z = 0"
[PROOF STATE]
proof (prove)
using this:
z = complex_of_real (2 * pi * real_of_int k) * \<i>

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
from z(1)
[PROOF STATE]
proof (chain)
picking this:
z \<in> path_image (\<gamma> m)
[PROOF STEP]
have "\<bar>Im z\<bar> = of_int (2*m+1) * pi"
[PROOF STATE]
proof (prove)
using this:
z \<in> path_image (\<gamma> m)

goal (1 subgoal):
 1. \<bar>Im z\<bar> = real_of_int (int (2 * m + 1)) * pi
[PROOF STEP]
using \<open>m > 0\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> path_image (\<gamma> m)
0 < m

goal (1 subgoal):
 1. \<bar>Im z\<bar> = real_of_int (int (2 * m + 1)) * pi
[PROOF STEP]
by (auto simp: \<gamma>_def path_image_rectpath)
[PROOF STATE]
proof (state)
this:
\<bar>Im z\<bar> = real_of_int (int (2 * m + 1)) * pi

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>Im z\<bar> = real_of_int (int (2 * m + 1)) * pi

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
have "\<bar>Im z\<bar> = of_int (2 * \<bar>k\<bar>) * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Im z\<bar> = real_of_int (2 * \<bar>k\<bar>) * pi
[PROOF STEP]
by (simp add: k abs_mult)
[PROOF STATE]
proof (state)
this:
\<bar>Im z\<bar> = real_of_int (2 * \<bar>k\<bar>) * pi

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (2 * \<bar>k\<bar>) * pi = real_of_int (int (2 * m + 1)) * pi
[PROOF STEP]
have "2 * \<bar>k\<bar> = 2 * m + 1"
[PROOF STATE]
proof (prove)
using this:
real_of_int (2 * \<bar>k\<bar>) * pi = real_of_int (int (2 * m + 1)) * pi

goal (1 subgoal):
 1. 2 * \<bar>k\<bar> = int (2 * m + 1)
[PROOF STEP]
by (subst (asm) mult_cancel_right, subst (asm) of_int_eq_iff) simp
[PROOF STATE]
proof (state)
this:
2 * \<bar>k\<bar> = int (2 * m + 1)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
hence False
[PROOF STATE]
proof (prove)
using this:
2 * \<bar>k\<bar> = int (2 * m + 1)

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> path_image (\<gamma> m); x \<in> S m\<rbrakk> \<Longrightarrow> x \<in> {}
[PROOF STEP]
thus "z \<in> {}"
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. z \<in> {}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
z \<in> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
path_image (\<gamma> m) \<inter> S m = {}

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
path_image (\<gamma> m) \<subseteq> A m
path_image (\<gamma> m) \<inter> S m = {}
[PROOF STEP]
show "path_image (\<gamma> m) \<subseteq> A m - S m"
[PROOF STATE]
proof (prove)
using this:
path_image (\<gamma> m) \<subseteq> A m
path_image (\<gamma> m) \<inter> S m = {}

goal (1 subgoal):
 1. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
path_image (\<gamma> m) \<subseteq> A m - S m

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>We now obtain a closed form for the Bernoulli numbers using the integral.\<close>
[PROOF STATE]
proof (state)
this:
0 < ?m1 \<Longrightarrow> path_image (\<gamma> ?m1) \<subseteq> A ?m1 - S ?m1

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have eq: "(\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) =
              contour_integral (\<gamma> m) g * (2 * pi * \<i>) ^ n / (4 * pi * \<i>) -
              complex_of_real (bernoulli n / fact n) * (2 * pi * \<i>) ^ n / 2"
    if m: "m > 0" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
proof -
    \<comment> \<open>We relate the formal power series of the Bernoulli numbers to the
        corresponding complex function.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "subdegree (fps_exp 1 - 1 :: complex fps) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (fps_exp 1 - 1) = 1
[PROOF STEP]
by (intro subdegreeI) auto
[PROOF STATE]
proof (state)
this:
subdegree (fps_exp 1 - 1) = 1

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
hence expansion: "f has_fps_expansion bernoulli_fps"
[PROOF STATE]
proof (prove)
using this:
subdegree (fps_exp 1 - 1) = 1

goal (1 subgoal):
 1. f has_fps_expansion bernoulli_fps
[PROOF STEP]
unfolding f_def bernoulli_fps_def
[PROOF STATE]
proof (prove)
using this:
subdegree (fps_exp 1 - 1) = 1

goal (1 subgoal):
 1. (\<lambda>z. if z = 0 then 1 else z / (exp z - 1)) has_fps_expansion fps_X / (fps_exp 1 - 1)
[PROOF STEP]
by (auto intro!: fps_expansion_intros)

    \<comment> \<open>We use the Residue Theorem to explicitly compute the integral.\<close>
[PROOF STATE]
proof (state)
this:
f has_fps_expansion bernoulli_fps

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "contour_integral (\<gamma> m) g =
             2 * pi * \<i> * (\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (\<gamma> m) g = complex_of_real (2 * pi) * \<i> * (\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z)
[PROOF STEP]
proof (rule Residue_theorem)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. open ?s
 2. connected ?s
 3. finite (S m)
 4. g holomorphic_on ?s - S m
 5. valid_path (\<gamma> m)
 6. pathfinish (\<gamma> m) = pathstart (\<gamma> m)
 7. path_image (\<gamma> m) \<subseteq> ?s - S m
 8. \<forall>z. z \<notin> ?s \<longrightarrow> winding_number (\<gamma> m) z = 0
[PROOF STEP]
have "cbox (-real m - (2 * m + 1) * pi * \<i>) (real m + (2 * m + 1) * pi * \<i>) \<subseteq> A m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> A m
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> box (complex_of_real (- (real m + 1)) - complex_of_real (real (2 * m + 2) * pi) * \<i>) (complex_of_real (real m + 1) + complex_of_real (real (2 * m + 2) * pi) * \<i>)
[PROOF STEP]
by (subst subset_box_complex) simp_all
[PROOF STATE]
proof (state)
this:
cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> A m

goal (8 subgoals):
 1. open ?s
 2. connected ?s
 3. finite (S m)
 4. g holomorphic_on ?s - S m
 5. valid_path (\<gamma> m)
 6. pathfinish (\<gamma> m) = pathstart (\<gamma> m)
 7. path_image (\<gamma> m) \<subseteq> ?s - S m
 8. \<forall>z. z \<notin> ?s \<longrightarrow> winding_number (\<gamma> m) z = 0
[PROOF STEP]
thus "\<forall>z. z \<notin> A m \<longrightarrow> winding_number (\<gamma> m) z = 0"
[PROOF STATE]
proof (prove)
using this:
cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> A m

goal (1 subgoal):
 1. \<forall>z. z \<notin> A m \<longrightarrow> winding_number (\<gamma> m) z = 0
[PROOF STEP]
unfolding \<gamma>_def
[PROOF STATE]
proof (prove)
using this:
cbox (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) \<subseteq> A m

goal (1 subgoal):
 1. \<forall>z. z \<notin> A m \<longrightarrow> winding_number (rectpath (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)) z = 0
[PROOF STEP]
by (intro winding_number_rectpath_outside allI impI) auto
[PROOF STATE]
proof (state)
this:
\<forall>z. z \<notin> A m \<longrightarrow> winding_number (\<gamma> m) z = 0

goal (7 subgoals):
 1. open (A m)
 2. connected (A m)
 3. finite (S m)
 4. g holomorphic_on A m - S m
 5. valid_path (\<gamma> m)
 6. pathfinish (\<gamma> m) = pathstart (\<gamma> m)
 7. path_image (\<gamma> m) \<subseteq> A m - S m
[PROOF STEP]
qed (insert holo path_subset m, auto simp: \<gamma>_def A_def S_def intro: convex_connected)
    \<comment> \<open>Clearly, all the winding numbers are 1\<close>
[PROOF STATE]
proof (state)
this:
contour_integral (\<gamma> m) g = complex_of_real (2 * pi) * \<i> * (\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
contour_integral (\<gamma> m) g = complex_of_real (2 * pi) * \<i> * (\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "winding_number (\<gamma> m) z = 1" if "z \<in> S m" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (\<gamma> m) z = 1
[PROOF STEP]
unfolding \<gamma>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (rectpath (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)) z = 1
[PROOF STEP]
using subset[of m] that m
[PROOF STATE]
proof (prove)
using this:
0 < m \<Longrightarrow> S m \<subseteq> box (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)
z \<in> S m
0 < m

goal (1 subgoal):
 1. winding_number (rectpath (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)) z = 1
[PROOF STEP]
by (subst winding_number_rectpath) blast+
[PROOF STATE]
proof (state)
this:
?z1 \<in> S m \<Longrightarrow> winding_number (\<gamma> m) ?z1 = 1

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
hence "(\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z) = (\<Sum>z\<in>S m. residue g z)"
[PROOF STATE]
proof (prove)
using this:
?z1 \<in> S m \<Longrightarrow> winding_number (\<gamma> m) ?z1 = 1

goal (1 subgoal):
 1. (\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z) = sum (residue g) (S m)
[PROOF STEP]
by (intro sum.cong) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z) = sum (residue g) (S m)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>S m. winding_number (\<gamma> m) z * residue g z) = sum (residue g) (S m)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "\<dots> = (\<Sum>k=-int m..int m. residue g (2 * pi * of_int k * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (residue g) (S m) = (\<Sum>k = - int m..int m. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (residue g) ((\<lambda>n. complex_of_real (2 * pi * real_of_int n) * \<i>) ` {- int m..int m}) = (\<Sum>k = - int m..int m. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))
[PROOF STEP]
by (subst sum.reindex) (auto simp: inj_on_def o_def)
[PROOF STATE]
proof (state)
this:
sum (residue g) (S m) = (\<Sum>k = - int m..int m. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (residue g) (S m) = (\<Sum>k = - int m..int m. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "{-int m..int m} = insert 0 ({-int m..int m}-{0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {- int m..int m} = insert 0 ({- int m..int m} - {0})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{- int m..int m} = insert 0 ({- int m..int m} - {0})

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{- int m..int m} = insert 0 ({- int m..int m} - {0})

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "(\<Sum>k\<in>\<dots>. residue g (2 * pi * of_int k * \<i>)) =
                 residue g 0 + (\<Sum>k\<in>{-int m..m}-{0}. residue g (2 * pi * of_int k * \<i>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>insert 0 ({- int m..int m} - {0}). residue g (complex_of_real (2 * pi * real_of_int k) * \<i>)) = residue g 0 + (\<Sum>k\<in>{- int m..int m} - {0}. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))
[PROOF STEP]
by (subst sum.insert) auto
    \<comment> \<open>The residue at the origin is just the $n$-th coefficient of $f$.\<close>
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>insert 0 ({- int m..int m} - {0}). residue g (complex_of_real (2 * pi * real_of_int k) * \<i>)) = residue g 0 + (\<Sum>k\<in>{- int m..int m} - {0}. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>insert 0 ({- int m..int m} - {0}). residue g (complex_of_real (2 * pi * real_of_int k) * \<i>)) = residue g 0 + (\<Sum>k\<in>{- int m..int m} - {0}. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>))

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "residue g 0 = residue (\<lambda>z. f z / z ^ Suc n) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue g 0 = residue (\<lambda>z. f z / z ^ Suc n) 0
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ n * (exp z - 1))) 0 = residue (\<lambda>z. (if z = 0 then 1 else z / (exp z - 1)) / z ^ Suc n) 0
[PROOF STEP]
by (intro residue_cong eventually_mono[OF eventually_at_ball[of 1]]) auto
[PROOF STATE]
proof (state)
this:
residue g 0 = residue (\<lambda>z. f z / z ^ Suc n) 0

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
residue g 0 = residue (\<lambda>z. f z / z ^ Suc n) 0

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "\<dots> = fps_nth bernoulli_fps n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. residue (\<lambda>z. f z / z ^ Suc n) 0 = bernoulli_fps $ n
[PROOF STEP]
by (rule residue_fps_expansion_over_power_at_0 [OF expansion])
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. f z / z ^ Suc n) 0 = bernoulli_fps $ n

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
residue (\<lambda>z. f z / z ^ Suc n) 0 = bernoulli_fps $ n

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "\<dots> = of_real (bernoulli n / fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bernoulli_fps $ n = complex_of_real (bernoulli n / fact n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bernoulli_fps $ n = complex_of_real (bernoulli n / fact n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bernoulli_fps $ n = complex_of_real (bernoulli n / fact n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "(\<Sum>k\<in>{-int m..m}-{0}. residue g (2 * pi * of_int k * \<i>)) =
                 (\<Sum>k\<in>{-int m..m}-{0}. 1 / of_int k ^ n) / (2 * pi * \<i>) ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{- int m..int m} - {0}. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>)) = (\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) / (complex_of_real (2 * pi) * \<i>) ^ n
[PROOF STEP]
proof (subst sum_divide_distrib, intro refl sum.cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {- int m..int m} - {0} \<Longrightarrow> residue g (complex_of_real (2 * pi * real_of_int x) * \<i>) = 1 / of_int x ^ n / (complex_of_real (2 * pi) * \<i>) ^ n
[PROOF STEP]
case (1 k)
[PROOF STATE]
proof (state)
this:
k \<in> {- int m..int m} - {0}

goal (1 subgoal):
 1. \<And>x. x \<in> {- int m..int m} - {0} \<Longrightarrow> residue g (complex_of_real (2 * pi * real_of_int x) * \<i>) = 1 / of_int x ^ n / (complex_of_real (2 * pi) * \<i>) ^ n
[PROOF STEP]
hence *: "residue g (2 * pi * of_int k * \<i>) = 1 / (2 * complex_of_real pi * of_int k * \<i>) ^ n"
[PROOF STATE]
proof (prove)
using this:
k \<in> {- int m..int m} - {0}

goal (1 subgoal):
 1. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / (2 * complex_of_real pi * of_int k * \<i>) ^ n
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
k \<in> {- int m..int m} - {0}

goal (1 subgoal):
 1. residue (\<lambda>z. 1 / (z ^ n * (exp z - 1))) (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / (2 * complex_of_real pi * of_int k * \<i>) ^ n
[PROOF STEP]
by (subst residue_bernoulli) auto
[PROOF STATE]
proof (state)
this:
residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / (2 * complex_of_real pi * of_int k * \<i>) ^ n

goal (1 subgoal):
 1. \<And>x. x \<in> {- int m..int m} - {0} \<Longrightarrow> residue g (complex_of_real (2 * pi * real_of_int x) * \<i>) = 1 / of_int x ^ n / (complex_of_real (2 * pi) * \<i>) ^ n
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / (2 * complex_of_real pi * of_int k * \<i>) ^ n

goal (1 subgoal):
 1. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / of_int k ^ n / (complex_of_real (2 * pi) * \<i>) ^ n
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / (2 * complex_of_real pi * of_int k * \<i>) ^ n
k \<in> {- int m..int m} - {0}

goal (1 subgoal):
 1. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / of_int k ^ n / (complex_of_real (2 * pi) * \<i>) ^ n
[PROOF STEP]
by (subst *) (simp add: divide_simps power_mult_distrib)
[PROOF STATE]
proof (state)
this:
residue g (complex_of_real (2 * pi * real_of_int k) * \<i>) = 1 / of_int k ^ n / (complex_of_real (2 * pi) * \<i>) ^ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{- int m..int m} - {0}. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>)) = (\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) / (complex_of_real (2 * pi) * \<i>) ^ n

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{- int m..int m} - {0}. residue g (complex_of_real (2 * pi * real_of_int k) * \<i>)) = (\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) / (complex_of_real (2 * pi) * \<i>) ^ n

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "(\<Sum>k\<in>{-int m..m}-{0}. 1 / of_int k ^ n) =
                 (\<Sum>(a,b)\<in>{0<..m}\<times>{-1,1::int}. 1 / of_int (int a) ^ n :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) = (\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
even n

goal (1 subgoal):
 1. (\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) = (\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n)
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>k. snd k * int (fst k)" "\<lambda>k. (nat \<bar>k\<bar>,sgn k)"])
         (auto split: if_splits simp: abs_if)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) = (\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<in>{- int m..int m} - {0}. 1 / of_int k ^ n) = (\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n) = (\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
even n

goal (1 subgoal):
 1. (\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n) = (\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n)
[PROOF STEP]
by (subst sum.Sigma [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n) = (\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(a, b)\<in>{0<..m} \<times> {- 1, 1}. 1 / of_int (int a) ^ n) = (\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) * 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n) = (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) * 2
[PROOF STEP]
by (simp add: sum_distrib_right)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0<..m}. 2 / of_nat x ^ n) = (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) * 2

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
contour_integral (\<gamma> m) g = complex_of_real (2 * pi) * \<i> * (complex_of_real (bernoulli n / fact n) + (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) * 2 / (complex_of_real (2 * pi) * \<i>) ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
contour_integral (\<gamma> m) g = complex_of_real (2 * pi) * \<i> * (complex_of_real (bernoulli n / fact n) + (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) * 2 / (complex_of_real (2 * pi) * \<i>) ^ n)

goal (1 subgoal):
 1. (\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{0<..m}. 1 / of_nat x ^ n) = contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>The ugly part: We have to prove a bound on the integral by splitting
      it into four integrals over lines and bounding each part separately.\<close>
[PROOF STATE]
proof (state)
this:
0 < ?m1 \<Longrightarrow> (\<Sum>x\<in>{0<..?m1}. 1 / of_nat x ^ n) = contour_integral (\<gamma> ?m1) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "eventually (\<lambda>m. norm (contour_integral (\<gamma> m) g) \<le>
          ((4 + 12 * pi) + 6 * pi / m) / real m ^ (n - 1)) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F m in sequentially. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
using eventually_gt_at_top[of "1::nat"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 1) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F m in sequentially. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
case (elim m)
[PROOF STATE]
proof (state)
this:
1 < m

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
let ?c = "(2*m+1) * pi * \<i>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
define I where "I = (\<lambda>p1 p2. contour_integral (linepath p1 p2) g)"
[PROOF STATE]
proof (state)
this:
I = (\<lambda>p1 p2. contour_integral (linepath p1 p2) g)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
define p1 p2 p3 p4 where "p1 = -real m - ?c" and "p2 = real m - ?c"
                         and "p3 = real m + ?c" and "p4 = -real m + ?c"
[PROOF STATE]
proof (state)
this:
p1 = complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>
p2 = complex_of_real (real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>
p3 = complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>
p4 = complex_of_real (- real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have eq: "\<gamma> m = linepath p1 p2 +++ linepath p2 p3 +++ linepath p3 p4 +++ linepath p4 p1"
      (is "\<gamma> m = ?\<gamma>'")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> m = linepath p1 p2 +++ linepath p2 p3 +++ linepath p3 p4 +++ linepath p4 p1
[PROOF STEP]
unfolding \<gamma>_def rectpath_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linepath (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) (Complex (Re (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)) (Im (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>))) +++ linepath (Complex (Re (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>)) (Im (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>))) (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) +++ linepath (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>) (Complex (Re (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>)) (Im (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>))) +++ linepath (Complex (Re (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>)) (Im (complex_of_real (real m) + complex_of_real (real (2 * m + 1) * pi) * \<i>))) (complex_of_real (- real m) - complex_of_real (real (2 * m + 1) * pi) * \<i>) = linepath p1 p2 +++ linepath p2 p3 +++ linepath p3 p4 +++ linepath p4 p1
[PROOF STEP]
by (intro joinpaths_cong linepath_cong)
         (simp_all add: p1_def p2_def p3_def p4_def complex_eq_iff)
[PROOF STATE]
proof (state)
this:
\<gamma> m = linepath p1 p2 +++ linepath p2 p3 +++ linepath p3 p4 +++ linepath p4 p1

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have integrable: "g contour_integrable_on \<gamma> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g contour_integrable_on \<gamma> m
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (1 subgoal):
 1. g contour_integrable_on \<gamma> m
[PROOF STEP]
by (intro contour_integrable_holomorphic_simple[OF holo _ _ path_subset])
         (auto simp: \<gamma>_def A_def S_def intro!: finite_imp_closed)
[PROOF STATE]
proof (state)
this:
g contour_integrable_on \<gamma> m

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (contour_integral (\<gamma> m) g) = norm (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (\<gamma> m) g) = cmod (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1)
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (\<gamma> m) g) = cmod (contour_integral (linepath p1 p2) g + contour_integral (linepath p2 p3) g + contour_integral (linepath p3 p4) g + contour_integral (linepath p4 p1) g)
[PROOF STEP]
by (insert integrable, unfold eq)
                         (subst contour_integral_join; (force simp: add_ac)?)+
[PROOF STATE]
proof (state)
this:
cmod (contour_integral (\<gamma> m) g) = cmod (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (contour_integral (\<gamma> m) g) = cmod (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "\<dots> \<le> norm (I p1 p2) + norm (I p2 p3) + norm (I p3 p4) + norm (I p4 p1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1) \<le> cmod (I p1 p2) + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1)
[PROOF STEP]
by (intro norm_triangle_mono order.refl)
[PROOF STATE]
proof (state)
this:
cmod (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1) \<le> cmod (I p1 p2) + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (I p1 p2 + I p2 p3 + I p3 p4 + I p4 p1) \<le> cmod (I p1 p2) + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (I p1 p2) \<le> 1 / real m ^ n * norm (p2 - p1)" (is "_ \<le> ?B1 * _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (I p1 p2) \<le> 1 / real m ^ n * cmod (p2 - p1)
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (linepath p1 p2) g) \<le> 1 / real m ^ n * cmod (p2 - p1)
[PROOF STEP]
proof (intro contour_integral_bound_linepath)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
assume z: "z \<in> closed_segment p1 p2"
[PROOF STATE]
proof (state)
this:
z \<in> closed_segment p1 p2

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
define a where "a = Re z"
[PROOF STATE]
proof (state)
this:
a = Re z

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<in> closed_segment p1 p2
[PROOF STEP]
have z: "z = a - (2*m+1) * pi * \<i>"
[PROOF STATE]
proof (prove)
using this:
z \<in> closed_segment p1 p2

goal (1 subgoal):
 1. z = complex_of_real a - complex_of_real (real (2 * m + 1) * pi) * \<i>
[PROOF STEP]
by (subst (asm) closed_segment_same_Im)
           (auto simp: p1_def p2_def complex_eq_iff a_def)
[PROOF STATE]
proof (state)
this:
z = complex_of_real a - complex_of_real (real (2 * m + 1) * pi) * \<i>

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "real m * 1 \<le> (2*m+1) * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real m * 1 \<le> real (2 * m + 1) * pi
[PROOF STEP]
using pi_ge_two
[PROOF STATE]
proof (prove)
using this:
2 \<le> pi

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

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real m * 1 \<le> real (2 * m + 1) * pi

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "(2*m+1) * pi = \<bar>Im z\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (2 * m + 1) * pi = \<bar>Im z\<bar>
[PROOF STEP]
by (simp add: z)
[PROOF STATE]
proof (state)
this:
real (2 * m + 1) * pi = \<bar>Im z\<bar>

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (2 * m + 1) * pi = \<bar>Im z\<bar>

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "\<bar>Im z\<bar> \<le> norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Im z\<bar> \<le> cmod z
[PROOF STEP]
by (rule abs_Im_le_cmod)
[PROOF STATE]
proof (state)
this:
\<bar>Im z\<bar> \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real m * 1 \<le> cmod z
[PROOF STEP]
have "norm z \<ge> m"
[PROOF STATE]
proof (prove)
using this:
real m * 1 \<le> cmod z

goal (1 subgoal):
 1. real m \<le> cmod z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "exp z - 1 = -of_real (exp a + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp z - 1 = - complex_of_real (exp a + 1)
[PROOF STEP]
using exp_integer_2pi_plus1[of m]
[PROOF STATE]
proof (prove)
using this:
real m \<in> \<int> \<Longrightarrow> exp (complex_of_real ((2 * real m + 1) * pi) * \<i>) = - 1

goal (1 subgoal):
 1. exp z - 1 = - complex_of_real (exp a + 1)
[PROOF STEP]
by (simp add: z exp_diff algebra_simps exp_of_real)
[PROOF STATE]
proof (state)
this:
exp z - 1 = - complex_of_real (exp a + 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp z - 1 = - complex_of_real (exp a + 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "norm \<dots> \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> cmod (- complex_of_real (exp a + 1))
[PROOF STEP]
unfolding norm_minus_cancel norm_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> \<bar>exp a + 1\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (- complex_of_real (exp a + 1))

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 \<le> cmod (exp z - 1)
[PROOF STEP]
have "norm (exp z - 1) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> cmod (exp z - 1)

goal (1 subgoal):
 1. 1 \<le> cmod (exp z - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real m \<le> cmod z
1 \<le> cmod (exp z - 1)
[PROOF STEP]
have "norm z ^ n * norm (exp z - 1) \<ge> real m ^ n * 1"
[PROOF STATE]
proof (prove)
using this:
real m \<le> cmod z
1 \<le> cmod (exp z - 1)

goal (1 subgoal):
 1. real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
[PROOF STEP]
by (intro mult_mono power_mono) auto
[PROOF STATE]
proof (state)
this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p1 p2 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
thus "norm (g z) \<le> 1 / real m ^ n"
[PROOF STATE]
proof (prove)
using this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)

goal (1 subgoal):
 1. cmod (g z) \<le> 1 / real m ^ n
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
1 < m

goal (1 subgoal):
 1. cmod (g z) \<le> 1 / real m ^ n
[PROOF STEP]
by (simp add: g_def divide_simps norm_divide norm_mult norm_power mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
cmod (g z) \<le> 1 / real m ^ n

goal (2 subgoals):
 1. g contour_integrable_on linepath p1 p2
 2. 0 \<le> 1 / real m ^ n
[PROOF STEP]
qed (insert integrable, auto simp: eq)
[PROOF STATE]
proof (state)
this:
cmod (I p1 p2) \<le> 1 / real m ^ n * cmod (p2 - p1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (I p1 p2) \<le> 1 / real m ^ n * cmod (p2 - p1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (p2 - p1) = 2 * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (p2 - p1) = real (2 * m)
[PROOF STEP]
by (simp add: p2_def p1_def)
[PROOF STATE]
proof (state)
this:
cmod (p2 - p1) = real (2 * m)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (p2 - p1) = real (2 * m)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (I p3 p4) \<le> 1 / real m ^ n * norm (p4 - p3)" (is "_ \<le> ?B3 * _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (I p3 p4) \<le> 1 / real m ^ n * cmod (p4 - p3)
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (linepath p3 p4) g) \<le> 1 / real m ^ n * cmod (p4 - p3)
[PROOF STEP]
proof (intro contour_integral_bound_linepath)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
assume z: "z \<in> closed_segment p3 p4"
[PROOF STATE]
proof (state)
this:
z \<in> closed_segment p3 p4

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
define a where "a = Re z"
[PROOF STATE]
proof (state)
this:
a = Re z

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<in> closed_segment p3 p4
[PROOF STEP]
have z: "z = a + (2*m+1) * pi * \<i>"
[PROOF STATE]
proof (prove)
using this:
z \<in> closed_segment p3 p4

goal (1 subgoal):
 1. z = complex_of_real a + complex_of_real (real (2 * m + 1) * pi) * \<i>
[PROOF STEP]
by (subst (asm) closed_segment_same_Im)
           (auto simp: p3_def p4_def complex_eq_iff a_def)
[PROOF STATE]
proof (state)
this:
z = complex_of_real a + complex_of_real (real (2 * m + 1) * pi) * \<i>

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "real m * 1 \<le> (2*m+1) * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real m * 1 \<le> real (2 * m + 1) * pi
[PROOF STEP]
using pi_ge_two
[PROOF STATE]
proof (prove)
using this:
2 \<le> pi

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

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real m * 1 \<le> real (2 * m + 1) * pi

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "(2*m+1) * pi = \<bar>Im z\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (2 * m + 1) * pi = \<bar>Im z\<bar>
[PROOF STEP]
by (simp add: z)
[PROOF STATE]
proof (state)
this:
real (2 * m + 1) * pi = \<bar>Im z\<bar>

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (2 * m + 1) * pi = \<bar>Im z\<bar>

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "\<bar>Im z\<bar> \<le> norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Im z\<bar> \<le> cmod z
[PROOF STEP]
by (rule abs_Im_le_cmod)
[PROOF STATE]
proof (state)
this:
\<bar>Im z\<bar> \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real m * 1 \<le> cmod z
[PROOF STEP]
have "norm z \<ge> m"
[PROOF STATE]
proof (prove)
using this:
real m * 1 \<le> cmod z

goal (1 subgoal):
 1. real m \<le> cmod z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "exp z - 1 = -of_real (exp a + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp z - 1 = - complex_of_real (exp a + 1)
[PROOF STEP]
using exp_integer_2pi_plus1[of m]
[PROOF STATE]
proof (prove)
using this:
real m \<in> \<int> \<Longrightarrow> exp (complex_of_real ((2 * real m + 1) * pi) * \<i>) = - 1

goal (1 subgoal):
 1. exp z - 1 = - complex_of_real (exp a + 1)
[PROOF STEP]
by (simp add: z exp_add algebra_simps exp_of_real)
[PROOF STATE]
proof (state)
this:
exp z - 1 = - complex_of_real (exp a + 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp z - 1 = - complex_of_real (exp a + 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "norm \<dots> \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> cmod (- complex_of_real (exp a + 1))
[PROOF STEP]
unfolding norm_minus_cancel norm_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> \<bar>exp a + 1\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (- complex_of_real (exp a + 1))

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 \<le> cmod (exp z - 1)
[PROOF STEP]
have "norm (exp z - 1) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> cmod (exp z - 1)

goal (1 subgoal):
 1. 1 \<le> cmod (exp z - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real m \<le> cmod z
1 \<le> cmod (exp z - 1)
[PROOF STEP]
have "norm z ^ n * norm (exp z - 1) \<ge> real m ^ n * 1"
[PROOF STATE]
proof (prove)
using this:
real m \<le> cmod z
1 \<le> cmod (exp z - 1)

goal (1 subgoal):
 1. real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
[PROOF STEP]
by (intro mult_mono power_mono) auto
[PROOF STATE]
proof (state)
this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p3 p4 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
thus "norm (g z) \<le> 1 / real m ^ n"
[PROOF STATE]
proof (prove)
using this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)

goal (1 subgoal):
 1. cmod (g z) \<le> 1 / real m ^ n
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
1 < m

goal (1 subgoal):
 1. cmod (g z) \<le> 1 / real m ^ n
[PROOF STEP]
by (simp add: g_def divide_simps norm_divide norm_mult norm_power mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
cmod (g z) \<le> 1 / real m ^ n

goal (2 subgoals):
 1. g contour_integrable_on linepath p3 p4
 2. 0 \<le> 1 / real m ^ n
[PROOF STEP]
qed (insert integrable, auto simp: eq)
[PROOF STATE]
proof (state)
this:
cmod (I p3 p4) \<le> 1 / real m ^ n * cmod (p4 - p3)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (I p3 p4) \<le> 1 / real m ^ n * cmod (p4 - p3)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (p4 - p3) = 2 * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (p4 - p3) = real (2 * m)
[PROOF STEP]
by (simp add: p4_def p3_def)
[PROOF STATE]
proof (state)
this:
cmod (p4 - p3) = real (2 * m)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (p4 - p3) = real (2 * m)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (I p2 p3) \<le> (1 / real m ^ n) * norm (p3 - p2)" (is "_ \<le> ?B2 * _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (I p2 p3) \<le> 1 / real m ^ n * cmod (p3 - p2)
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (linepath p2 p3) g) \<le> 1 / real m ^ n * cmod (p3 - p2)
[PROOF STEP]
proof (rule contour_integral_bound_linepath)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
assume z: "z \<in> closed_segment p2 p3"
[PROOF STATE]
proof (state)
this:
z \<in> closed_segment p2 p3

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
define b where "b = Im z"
[PROOF STATE]
proof (state)
this:
b = Im z

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<in> closed_segment p2 p3
[PROOF STEP]
have z: "z = m + b * \<i>"
[PROOF STATE]
proof (prove)
using this:
z \<in> closed_segment p2 p3

goal (1 subgoal):
 1. z = of_nat m + complex_of_real b * \<i>
[PROOF STEP]
by (subst (asm) closed_segment_same_Re)
           (auto simp: p2_def p3_def algebra_simps complex_eq_iff b_def)
[PROOF STATE]
proof (state)
this:
z = of_nat m + complex_of_real b * \<i>

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
from elim
[PROOF STATE]
proof (chain)
picking this:
1 < m
[PROOF STEP]
have "2 \<le> 1 + real m"
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (1 subgoal):
 1. 2 \<le> 1 + real m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 \<le> 1 + real m

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 \<le> 1 + real m

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "\<dots> \<le> exp (real m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + real m \<le> exp (real m)
[PROOF STEP]
by (rule exp_ge_add_one_self)
[PROOF STATE]
proof (state)
this:
1 + real m \<le> exp (real m)

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + real m \<le> exp (real m)

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "exp (real m) - 1 = norm (exp z) - norm (1::complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (real m) - 1 = cmod (exp z) - cmod 1
[PROOF STEP]
by (simp add: z)
[PROOF STATE]
proof (state)
this:
exp (real m) - 1 = cmod (exp z) - cmod 1

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (real m) - 1 = cmod (exp z) - cmod 1

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "\<dots> \<le> norm (exp z - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (exp z) - cmod 1 \<le> cmod (exp z - 1)
[PROOF STEP]
by (rule norm_triangle_ineq2)
[PROOF STATE]
proof (state)
this:
cmod (exp z) - cmod 1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> x - 1 \<le> y - 1) \<Longrightarrow> 2 - 1 \<le> cmod (exp z - 1)
[PROOF STEP]
have "norm (exp z - 1) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> x - 1 \<le> y - 1) \<Longrightarrow> 2 - 1 \<le> cmod (exp z - 1)

goal (1 subgoal):
 1. 1 \<le> cmod (exp z - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
have "norm z \<ge> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real m \<le> cmod z
[PROOF STEP]
using z and abs_Re_le_cmod[of z]
[PROOF STATE]
proof (prove)
using this:
z = of_nat m + complex_of_real b * \<i>
\<bar>Re z\<bar> \<le> cmod z

goal (1 subgoal):
 1. real m \<le> cmod z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 \<le> cmod (exp z - 1)
real m \<le> cmod z
[PROOF STEP]
have "norm z ^ n * norm (exp z - 1) \<ge> real m ^ n * 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> cmod (exp z - 1)
real m \<le> cmod z

goal (1 subgoal):
 1. real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
1 \<le> cmod (exp z - 1)
real m \<le> cmod z
1 < m

goal (1 subgoal):
 1. real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
[PROOF STEP]
by (intro mult_mono power_mono) (auto simp: z)
[PROOF STATE]
proof (state)
this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
 3. \<And>x. x \<in> closed_segment p2 p3 \<Longrightarrow> cmod (g x) \<le> 1 / real m ^ n
[PROOF STEP]
thus "norm (g z) \<le> 1 / real m ^ n"
[PROOF STATE]
proof (prove)
using this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)

goal (1 subgoal):
 1. cmod (g z) \<le> 1 / real m ^ n
[PROOF STEP]
using n and elim
[PROOF STATE]
proof (prove)
using this:
real m ^ n * 1 \<le> cmod z ^ n * cmod (exp z - 1)
2 \<le> n
even n
1 < m

goal (1 subgoal):
 1. cmod (g z) \<le> 1 / real m ^ n
[PROOF STEP]
by (simp add: g_def norm_mult norm_divide norm_power divide_simps mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
cmod (g z) \<le> 1 / real m ^ n

goal (2 subgoals):
 1. g contour_integrable_on linepath p2 p3
 2. 0 \<le> 1 / real m ^ n
[PROOF STEP]
qed (insert integrable, auto simp: eq)
[PROOF STATE]
proof (state)
this:
cmod (I p2 p3) \<le> 1 / real m ^ n * cmod (p3 - p2)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (I p2 p3) \<le> 1 / real m ^ n * cmod (p3 - p2)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "p3 - p2 = of_real (2*(2*real m+1)*pi) * \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p3 - p2 = complex_of_real (2 * (2 * real m + 1) * pi) * \<i>
[PROOF STEP]
by (simp add: p2_def p3_def)
[PROOF STATE]
proof (state)
this:
p3 - p2 = complex_of_real (2 * (2 * real m + 1) * pi) * \<i>

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p3 - p2 = complex_of_real (2 * (2 * real m + 1) * pi) * \<i>

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm \<dots> = 2 * (2 * real m + 1) * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real (2 * (2 * real m + 1) * pi) * \<i>) = 2 * (2 * real m + 1) * pi
[PROOF STEP]
unfolding norm_mult norm_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>2 * (2 * real m + 1) * pi\<bar> * cmod \<i> = 2 * (2 * real m + 1) * pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (2 * (2 * real m + 1) * pi) * \<i>) = 2 * (2 * real m + 1) * pi

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (2 * (2 * real m + 1) * pi) * \<i>) = 2 * (2 * real m + 1) * pi

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm (I p4 p1) \<le> (2 / real m ^ n) * norm (p1 - p4)" (is "_ \<le> ?B4 * _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (I p4 p1) \<le> 2 / real m ^ n * cmod (p1 - p4)
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (contour_integral (linepath p4 p1) g) \<le> 2 / real m ^ n * cmod (p1 - p4)
[PROOF STEP]
proof (rule contour_integral_bound_linepath)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
assume z: "z \<in> closed_segment p4 p1"
[PROOF STATE]
proof (state)
this:
z \<in> closed_segment p4 p1

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
define b where "b = Im z"
[PROOF STATE]
proof (state)
this:
b = Im z

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
z \<in> closed_segment p4 p1
[PROOF STEP]
have z: "z = -real m + b * \<i>"
[PROOF STATE]
proof (prove)
using this:
z \<in> closed_segment p4 p1

goal (1 subgoal):
 1. z = complex_of_real (- real m) + complex_of_real b * \<i>
[PROOF STEP]
by (subst (asm) closed_segment_same_Re)
           (auto simp: p1_def p4_def algebra_simps b_def complex_eq_iff)
[PROOF STATE]
proof (state)
this:
z = complex_of_real (- real m) + complex_of_real b * \<i>

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
from elim
[PROOF STATE]
proof (chain)
picking this:
1 < m
[PROOF STEP]
have "2 \<le> 1 + real m"
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (1 subgoal):
 1. 2 \<le> 1 + real m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 \<le> 1 + real m

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 \<le> 1 + real m

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
have "\<dots> \<le> exp (real m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + real m \<le> exp (real m)
[PROOF STEP]
by (rule exp_ge_add_one_self)
[PROOF STATE]
proof (state)
this:
1 + real m \<le> exp (real m)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 \<le> exp (real m)
[PROOF STEP]
have "1 / 2 \<le> 1 - exp (-real m)"
[PROOF STATE]
proof (prove)
using this:
2 \<le> exp (real m)

goal (1 subgoal):
 1. 1 / 2 \<le> 1 - exp (- real m)
[PROOF STEP]
by (subst exp_minus) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
1 / 2 \<le> 1 - exp (- real m)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / 2 \<le> 1 - exp (- real m)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
have "1 - exp (-real m) = norm (1::complex) - norm (exp z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - exp (- real m) = cmod 1 - cmod (exp z)
[PROOF STEP]
by (simp add: z)
[PROOF STATE]
proof (state)
this:
1 - exp (- real m) = cmod 1 - cmod (exp z)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 - exp (- real m) = cmod 1 - cmod (exp z)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
have "\<dots> \<le> norm (exp z - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod 1 - cmod (exp z) \<le> cmod (exp z - 1)
[PROOF STEP]
by (subst norm_minus_commute, rule norm_triangle_ineq2)
[PROOF STATE]
proof (state)
this:
cmod 1 - cmod (exp z) \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 / 2 \<le> cmod (exp z - 1)
[PROOF STEP]
have "norm (exp z - 1) \<ge> 1 / 2"
[PROOF STATE]
proof (prove)
using this:
1 / 2 \<le> cmod (exp z - 1)

goal (1 subgoal):
 1. 1 / 2 \<le> cmod (exp z - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 / 2 \<le> cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
have "norm z \<ge> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real m \<le> cmod z
[PROOF STEP]
using z and abs_Re_le_cmod[of z]
[PROOF STATE]
proof (prove)
using this:
z = complex_of_real (- real m) + complex_of_real b * \<i>
\<bar>Re z\<bar> \<le> cmod z

goal (1 subgoal):
 1. real m \<le> cmod z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real m \<le> cmod z

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 / 2 \<le> cmod (exp z - 1)
real m \<le> cmod z
[PROOF STEP]
have "norm z ^ n * norm (exp z - 1) \<ge> real m ^ n * (1 / 2)"
[PROOF STATE]
proof (prove)
using this:
1 / 2 \<le> cmod (exp z - 1)
real m \<le> cmod z

goal (1 subgoal):
 1. real m ^ n * (1 / 2) \<le> cmod z ^ n * cmod (exp z - 1)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
1 / 2 \<le> cmod (exp z - 1)
real m \<le> cmod z
1 < m

goal (1 subgoal):
 1. real m ^ n * (1 / 2) \<le> cmod z ^ n * cmod (exp z - 1)
[PROOF STEP]
by (intro mult_mono power_mono) (auto simp: z)
[PROOF STATE]
proof (state)
this:
real m ^ n * (1 / 2) \<le> cmod z ^ n * cmod (exp z - 1)

goal (3 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
 3. \<And>x. x \<in> closed_segment p4 p1 \<Longrightarrow> cmod (g x) \<le> 2 / real m ^ n
[PROOF STEP]
thus "norm (g z) \<le> 2 / real m ^ n"
[PROOF STATE]
proof (prove)
using this:
real m ^ n * (1 / 2) \<le> cmod z ^ n * cmod (exp z - 1)

goal (1 subgoal):
 1. cmod (g z) \<le> 2 / real m ^ n
[PROOF STEP]
using n and elim
[PROOF STATE]
proof (prove)
using this:
real m ^ n * (1 / 2) \<le> cmod z ^ n * cmod (exp z - 1)
2 \<le> n
even n
1 < m

goal (1 subgoal):
 1. cmod (g z) \<le> 2 / real m ^ n
[PROOF STEP]
by (simp add: g_def norm_mult norm_divide norm_power divide_simps mult_less_0_iff)
[PROOF STATE]
proof (state)
this:
cmod (g z) \<le> 2 / real m ^ n

goal (2 subgoals):
 1. g contour_integrable_on linepath p4 p1
 2. 0 \<le> 2 / real m ^ n
[PROOF STEP]
qed (insert integrable, auto simp: eq)
[PROOF STATE]
proof (state)
this:
cmod (I p4 p1) \<le> 2 / real m ^ n * cmod (p1 - p4)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (I p4 p1) \<le> 2 / real m ^ n * cmod (p1 - p4)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "p1 - p4 = -of_real (2*(2*real m+1)*pi) * \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 - p4 = - complex_of_real (2 * (2 * real m + 1) * pi) * \<i>
[PROOF STEP]
by (simp add: p1_def p4_def algebra_simps)
[PROOF STATE]
proof (state)
this:
p1 - p4 = - complex_of_real (2 * (2 * real m + 1) * pi) * \<i>

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p1 - p4 = - complex_of_real (2 * (2 * real m + 1) * pi) * \<i>

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "norm \<dots> = 2 * (2 * real m + 1) * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (- complex_of_real (2 * (2 * real m + 1) * pi) * \<i>) = 2 * (2 * real m + 1) * pi
[PROOF STEP]
unfolding norm_mult norm_of_real norm_minus_cancel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>2 * (2 * real m + 1) * pi\<bar> * cmod \<i> = 2 * (2 * real m + 1) * pi
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (- complex_of_real (2 * (2 * real m + 1) * pi) * \<i>) = 2 * (2 * real m + 1) * pi

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (- complex_of_real (2 * (2 * real m + 1) * pi) * \<i>) = 2 * (2 * real m + 1) * pi

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "?B1 * (2*m) + ?B2 * (2*(2*real m+1)*pi) + ?B3 * (2*m) + ?B4 * (2*(2*real m+1)*pi) =
                 (4 * m + 6 * (2 * m + 1) * pi) / real m ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + 2 / real m ^ n * (2 * (2 * real m + 1) * pi) = (real (4 * m) + real (6 * (2 * m + 1)) * pi) / real m ^ n
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + 2 / real m ^ n * (2 * (2 * real m + 1) * pi) = (real (4 * m) + real (6 * (2 * m + 1)) * pi) / real m ^ n

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + 2 / real m ^ n * (2 * (2 * real m + 1) * pi) = (real (4 * m) + real (6 * (2 * m + 1)) * pi) / real m ^ n

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "(4 * m + 6 * (2 * m + 1) * pi) = (4 + 12 * pi) * m + 6 * pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (4 * m) + real (6 * (2 * m + 1)) * pi = (4 + 12 * pi) * real m + 6 * pi
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
real (4 * m) + real (6 * (2 * m + 1)) * pi = (4 + 12 * pi) * real m + 6 * pi

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (4 * m) + real (6 * (2 * m + 1)) * pi = (4 + 12 * pi) * real m + 6 * pi

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
have "\<dots> / real m ^ n = ((4 + 12 * pi) + 6 * pi / m) / real m ^ (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((4 + 12 * pi) * real m + 6 * pi) / real m ^ n = (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
even n

goal (1 subgoal):
 1. ((4 + 12 * pi) * real m + 6 * pi) / real m ^ n = (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
by (cases n) (simp_all add: divide_simps)
[PROOF STATE]
proof (state)
this:
((4 + 12 * pi) * real m + 6 * pi) / real m ^ n = (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)

goal (1 subgoal):
 1. \<And>m. 1 < m \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1) \<le> y + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1); \<And>x y. x \<le> y \<Longrightarrow> 1 / real m ^ n * real (2 * m) + cmod (I p2 p3) + x + cmod (I p4 p1) \<le> 1 / real m ^ n * real (2 * m) + cmod (I p2 p3) + y + cmod (I p4 p1); \<And>x y. x \<le> y \<Longrightarrow> 1 / real m ^ n * real (2 * m) + x + 1 / real m ^ n * real (2 * m) + cmod (I p4 p1) \<le> 1 / real m ^ n * real (2 * m) + y + 1 / real m ^ n * real (2 * m) + cmod (I p4 p1); \<And>x y. x \<le> y \<Longrightarrow> 1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + x \<le> 1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + y\<rbrakk> \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
show "cmod (contour_integral (\<gamma> m) g) \<le> \<dots>"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1) \<le> y + cmod (I p2 p3) + cmod (I p3 p4) + cmod (I p4 p1); \<And>x y. x \<le> y \<Longrightarrow> 1 / real m ^ n * real (2 * m) + cmod (I p2 p3) + x + cmod (I p4 p1) \<le> 1 / real m ^ n * real (2 * m) + cmod (I p2 p3) + y + cmod (I p4 p1); \<And>x y. x \<le> y \<Longrightarrow> 1 / real m ^ n * real (2 * m) + x + 1 / real m ^ n * real (2 * m) + cmod (I p4 p1) \<le> 1 / real m ^ n * real (2 * m) + y + 1 / real m ^ n * real (2 * m) + cmod (I p4 p1); \<And>x y. x \<le> y \<Longrightarrow> 1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + x \<le> 1 / real m ^ n * real (2 * m) + 1 / real m ^ n * (2 * (2 * real m + 1) * pi) + 1 / real m ^ n * real (2 * m) + y\<rbrakk> \<Longrightarrow> cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)

goal (1 subgoal):
 1. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>It is clear that this bound goes to 0 since @{prop "n \<ge> 2"}.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F m in sequentially. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F m in sequentially. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "(\<lambda>m. (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule real_tendsto_divide_at_top tendsto_add tendsto_const
          filterlim_real_sequentially filterlim_pow_at_top | use n in simp)+
[PROOF STATE]
proof (state)
this:
(\<lambda>m. (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F m in sequentially. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
(\<lambda>m. (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)) \<longlonglongrightarrow> 0
[PROOF STEP]
have *: "(\<lambda>m. contour_integral (\<gamma> m) g) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F m in sequentially. cmod (contour_integral (\<gamma> m) g) \<le> (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)
(\<lambda>m. (4 + 12 * pi + 6 * pi / real m) / real m ^ (n - 1)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>m. contour_integral (\<gamma> m) g) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule Lim_null_comparison)

  \<comment> \<open>Since the infinite sum over the residues can expressed using the
      zeta function, we have now related the Bernoulli numbers at even
      positive integers to the zeta function.\<close>
[PROOF STATE]
proof (state)
this:
(\<lambda>m. contour_integral (\<gamma> m) g) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "(\<lambda>m. contour_integral (\<gamma> m) g * (2 * pi * \<i>) ^ n / (4 * pi * \<i>) -
             of_real (bernoulli n / fact n) * (2 * pi * \<i>) ^ n / 2) \<longlonglongrightarrow>
           0 * (2 * pi * \<i>) ^ n / (4 * pi * \<i>) -
           of_real (bernoulli n / fact n) * (2 * pi * \<i>) ^ n / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2) \<longlonglongrightarrow> 0 * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
even n

goal (1 subgoal):
 1. (\<lambda>m. contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2) \<longlonglongrightarrow> 0 * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
by (intro tendsto_intros * zeta_limit) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>m. contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2) \<longlonglongrightarrow> 0 * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2) \<longlonglongrightarrow> 0 * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow>
               - of_real (bernoulli n / fact n) * (2 * pi * \<i>) ^ n / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2) \<longlonglongrightarrow> 0 * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2 = (\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
by (intro filterlim_cong eventually_mono [OF eventually_gt_at_top[of "0::nat"]])
       (use eq in simp_all)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. contour_integral (\<gamma> m) g * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2) \<longlonglongrightarrow> 0 * (complex_of_real (2 * pi) * \<i>) ^ n / (complex_of_real (4 * pi) * \<i>) - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2 = (\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
have "(\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n)
                   \<longlonglongrightarrow> - of_real (bernoulli n / fact n) * (of_real (2 * pi) * \<i>) ^ n / 2"
    (is "_ \<longlonglongrightarrow> ?L")
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "(\<lambda>m. \<Sum>k\<in>{0<..m}. 1 / of_nat k ^ n) = (\<lambda>m. \<Sum>k\<in>{..<m}. 1 / of_nat (Suc k) ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>k\<in>{0<..m}. (1::'a) / of_nat k ^ n) = (\<lambda>m. \<Sum>k<m. (1::'a) / of_nat (Suc k) ^ n)
[PROOF STEP]
by (intro ext sum.reindex_bij_witness[of _ Suc "\<lambda>n. n - 1"]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k\<in>{0<..m}. (1::?'a2) / of_nat k ^ n) = (\<lambda>m. \<Sum>k<m. (1::?'a2) / of_nat (Suc k) ^ n)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k\<in>{0<..m}. (1::?'a2) / of_nat k ^ n) = (\<lambda>m. \<Sum>k<m. (1::?'a2) / of_nat (Suc k) ^ n)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "\<dots> \<longlonglongrightarrow> ?L \<longleftrightarrow> (\<lambda>k. 1 / of_nat (Suc k) ^ n) sums ?L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>k<m. 1 / of_nat (Suc k) ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2 = (\<lambda>k. 1 / of_nat (Suc k) ^ n) sums (- complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2)
[PROOF STEP]
by (simp add: sums_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k<m. 1 / of_nat (Suc k) ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2 = (\<lambda>k. 1 / of_nat (Suc k) ^ n) sums (- complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>k<m. 1 / of_nat (Suc k) ^ n) \<longlonglongrightarrow> - complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2 = (\<lambda>k. 1 / of_nat (Suc k) ^ n) sums (- complex_of_real (bernoulli n / fact n) * (complex_of_real (2 * pi) * \<i>) ^ n / 2)

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "(2 * pi * \<i>) ^ n = (2 * pi) ^ n * (-1) ^ n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (complex_of_real (2 * pi) * \<i>) ^ n = complex_of_real ((2 * pi) ^ n * (- 1) ^ n')
[PROOF STEP]
by (simp add: n_def divide_simps power_mult_distrib power_mult power_minus')
[PROOF STATE]
proof (state)
this:
(complex_of_real (2 * pi) * \<i>) ^ n = complex_of_real ((2 * pi) ^ n * (- 1) ^ n')

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(complex_of_real (2 * pi) * \<i>) ^ n = complex_of_real ((2 * pi) ^ n * (- 1) ^ n')

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
have "- of_real (bernoulli n / fact n) * \<dots> / 2 =
               of_real ((-1) ^ Suc n' * bernoulli (2*n') * (2*pi)^(2*n') / (2 * fact (2*n')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - complex_of_real (bernoulli n / fact n) * complex_of_real ((2 * pi) ^ n * (- 1) ^ n') / 2 = complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
by (simp add: n_def divide_simps)
[PROOF STATE]
proof (state)
this:
- complex_of_real (bernoulli n / fact n) * complex_of_real ((2 * pi) ^ n * (- 1) ^ n') / 2 = complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. 1 / of_nat (Suc k) ^ n) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. 1 / of_nat (Suc k) ^ n) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))

goal (1 subgoal):
 1. (\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / of_nat (Suc k) ^ (2 * n')) sums complex_of_real ((- 1) ^ Suc n' * bernoulli (2 * n') * (2 * pi) ^ (2 * n') / (2 * fact (2 * n')))

goal:
No subgoals!
[PROOF STEP]
qed