[STATEMENT]
lemma Proj_idempotent[simp]: \<open>Proj M o\<^sub>C\<^sub>L Proj M = Proj M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
have u1: \<open>(cblinfun_apply (Proj M)) = projection (space_as_set M)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>V) (Proj M) = projection (space_as_set M)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. closed_csubspace M \<Longrightarrow> projection M = projection M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) (Proj M) = projection (space_as_set M)

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
have \<open>closed_csubspace (space_as_set M)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_csubspace (space_as_set M)
[PROOF STEP]
using space_as_set
[PROOF STATE]
proof (prove)
using this:
space_as_set ?x \<in> {S. closed_csubspace S}

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

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
hence u2: \<open>(projection (space_as_set M))\<circ>(projection (space_as_set M))
                = (projection (space_as_set M))\<close>
[PROOF STATE]
proof (prove)
using this:
closed_csubspace (space_as_set M)

goal (1 subgoal):
 1. projection (space_as_set M) \<circ> projection (space_as_set M) = projection (space_as_set M)
[PROOF STEP]
using projection_idem
[PROOF STATE]
proof (prove)
using this:
closed_csubspace (space_as_set M)
closed_csubspace ?M \<Longrightarrow> projection ?M (projection ?M ?x) = projection ?M ?x

goal (1 subgoal):
 1. projection (space_as_set M) \<circ> projection (space_as_set M) = projection (space_as_set M)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
projection (space_as_set M) \<circ> projection (space_as_set M) = projection (space_as_set M)

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
have \<open>(cblinfun_apply (Proj M)) \<circ> (cblinfun_apply (Proj M)) = cblinfun_apply (Proj M)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>V) (Proj M) \<circ> (*\<^sub>V) (Proj M) = (*\<^sub>V) (Proj M)
[PROOF STEP]
using u1 u2
[PROOF STATE]
proof (prove)
using this:
(*\<^sub>V) (Proj M) = projection (space_as_set M)
projection (space_as_set M) \<circ> projection (space_as_set M) = projection (space_as_set M)

goal (1 subgoal):
 1. (*\<^sub>V) (Proj M) \<circ> (*\<^sub>V) (Proj M) = (*\<^sub>V) (Proj M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) (Proj M) \<circ> (*\<^sub>V) (Proj M) = (*\<^sub>V) (Proj M)

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
hence \<open>cblinfun_apply ((Proj M) o\<^sub>C\<^sub>L (Proj M)) = cblinfun_apply (Proj M)\<close>
[PROOF STATE]
proof (prove)
using this:
(*\<^sub>V) (Proj M) \<circ> (*\<^sub>V) (Proj M) = (*\<^sub>V) (Proj M)

goal (1 subgoal):
 1. (*\<^sub>V) (Proj M o\<^sub>C\<^sub>L Proj M) = (*\<^sub>V) (Proj M)
[PROOF STEP]
by (simp add: cblinfun_compose.rep_eq)
[PROOF STATE]
proof (state)
this:
(*\<^sub>V) (Proj M o\<^sub>C\<^sub>L Proj M) = (*\<^sub>V) (Proj M)

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(*\<^sub>V) (Proj M o\<^sub>C\<^sub>L Proj M) = (*\<^sub>V) (Proj M)

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
using cblinfun_apply_inject
[PROOF STATE]
proof (prove)
using this:
(*\<^sub>V) (Proj M o\<^sub>C\<^sub>L Proj M) = (*\<^sub>V) (Proj M)
((*\<^sub>V) ?x = (*\<^sub>V) ?y) = (?x = ?y)

goal (1 subgoal):
 1. Proj M o\<^sub>C\<^sub>L Proj M = Proj M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Proj M o\<^sub>C\<^sub>L Proj M = Proj M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_translation:
  "closed ((+) a ` S)" if "closed S" for a :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed ((+) a ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed ((+) a ` S)
[PROOF STEP]
have "(\<Union>x\<in> {a}. \<Union>y \<in> S. {x + y}) = ((+) a ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>{a}. \<Union>y\<in>S. {x + y}) = (+) a ` S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>{a}. \<Union>y\<in>S. {x + y}) = (+) a ` S

goal (1 subgoal):
 1. closed ((+) a ` S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>x\<in>{a}. \<Union>y\<in>S. {x + y}) = (+) a ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>{a}. \<Union>y\<in>S. {x + y}) = (+) a ` S

goal (1 subgoal):
 1. closed ((+) a ` S)
[PROOF STEP]
using compact_closed_sums [OF compact_sing [of a] that]
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>{a}. \<Union>y\<in>S. {x + y}) = (+) a ` S
closed (\<Union>x\<in>{a}. \<Union>y\<in>S. {x + y})

goal (1 subgoal):
 1. closed ((+) a ` S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
closed ((+) a ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comp_coreflexive_linorder_matrix:
  fixes f g :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "matrix_idempotent_semiring.coreflexive g"
    shows "(f \<odot> g) (i,j) = f (i,j) \<sqinter> g (j,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
have "(f \<odot> g) (i,j) = ((f \<odot> g)\<^sup>t) (j,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<odot> g) (i, j) = ((f \<odot> g)\<^sup>t) (j, i)
[PROOF STEP]
by (simp add: conv_matrix_def)
[PROOF STATE]
proof (state)
this:
(f \<odot> g) (i, j) = ((f \<odot> g)\<^sup>t) (j, i)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<odot> g) (i, j) = ((f \<odot> g)\<^sup>t) (j, i)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
have "... = (g \<odot> f\<^sup>t) (j,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f \<odot> g)\<^sup>t) (j, i) = (g \<odot> f\<^sup>t) (j, i)
[PROOF STEP]
by (simp add: assms matrix_stone_relation_algebra.conv_dist_comp matrix_stone_relation_algebra.coreflexive_symmetric)
[PROOF STATE]
proof (state)
this:
((f \<odot> g)\<^sup>t) (j, i) = (g \<odot> f\<^sup>t) (j, i)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((f \<odot> g)\<^sup>t) (j, i) = (g \<odot> f\<^sup>t) (j, i)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
have "... = g (j,j) \<sqinter> (f\<^sup>t) (j,i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<odot> f\<^sup>t) (j, i) = g (j, j) \<sqinter> (f\<^sup>t) (j, i)
[PROOF STEP]
by (simp add: assms coreflexive_comp_linorder_matrix)
[PROOF STATE]
proof (state)
this:
(g \<odot> f\<^sup>t) (j, i) = g (j, j) \<sqinter> (f\<^sup>t) (j, i)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(g \<odot> f\<^sup>t) (j, i) = g (j, j) \<sqinter> (f\<^sup>t) (j, i)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
have "... = f (i,j) \<sqinter> g (j,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (j, j) \<sqinter> (f\<^sup>t) (j, i) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
by (metis (no_types, lifting) conv_def old.prod.case conv_matrix_def inf_commute)
[PROOF STATE]
proof (state)
this:
g (j, j) \<sqinter> (f\<^sup>t) (j, i) = f (i, j) \<sqinter> g (j, j)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)

goal (1 subgoal):
 1. (f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<odot> g) (i, j) = f (i, j) \<sqinter> g (j, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma append_rows_nth3:
  assumes A': "A' \<in> carrier_mat m n"
  and B: "B \<in> carrier_mat p n"
  and A_def: "A = (A' @\<^sub>r  B)"
  and a: "a\<ge>m" and ap: "a < m + p" and j: "j<n"
  shows "A $$ (a, j) = B $$ (a-m,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
have "A $$ (a, j) = (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (a, j) = (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j))
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A' @\<^sub>r B) $$ (a, j) = (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j))
[PROOF STEP]
by (rule append_rows_nth[OF A' B _ j], insert ap a, auto)
[PROOF STATE]
proof (state)
this:
A $$ (a, j) = (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j))

goal (1 subgoal):
 1. A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A $$ (a, j) = (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j))

goal (1 subgoal):
 1. A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
have "... = B $$ (a-m,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j)) = B $$ (a - m, j)
[PROOF STEP]
using ap a A'
[PROOF STATE]
proof (prove)
using this:
a < m + p
m \<le> a
A' \<in> carrier_mat m n

goal (1 subgoal):
 1. (if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j)) = B $$ (a - m, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if a < dim_row A' then A' $$ (a, j) else B $$ (a - m, j)) = B $$ (a - m, j)

goal (1 subgoal):
 1. A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A $$ (a, j) = B $$ (a - m, j)

goal (1 subgoal):
 1. A $$ (a, j) = B $$ (a - m, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A $$ (a, j) = B $$ (a - m, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma between_imp_collinear:
  fixes x :: "'a :: euclidean_space"
  assumes "between (a,b) x"
    shows "collinear {a,x,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. collinear {a, x, b}
[PROOF STEP]
proof (cases "x = a \<or> x = b \<or> a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = a \<or> x = b \<or> a = b \<Longrightarrow> collinear {a, x, b}
 2. \<not> (x = a \<or> x = b \<or> a = b) \<Longrightarrow> collinear {a, x, b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = a \<or> x = b \<or> a = b

goal (2 subgoals):
 1. x = a \<or> x = b \<or> a = b \<Longrightarrow> collinear {a, x, b}
 2. \<not> (x = a \<or> x = b \<or> a = b) \<Longrightarrow> collinear {a, x, b}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
between (a, b) x
x = a \<or> x = b \<or> a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
between (a, b) x
x = a \<or> x = b \<or> a = b

goal (1 subgoal):
 1. collinear {a, x, b}
[PROOF STEP]
by (auto simp: dist_commute)
[PROOF STATE]
proof (state)
this:
collinear {a, x, b}

goal (1 subgoal):
 1. \<not> (x = a \<or> x = b \<or> a = b) \<Longrightarrow> collinear {a, x, b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (x = a \<or> x = b \<or> a = b) \<Longrightarrow> collinear {a, x, b}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (x = a \<or> x = b \<or> a = b)

goal (1 subgoal):
 1. \<not> (x = a \<or> x = b \<or> a = b) \<Longrightarrow> collinear {a, x, b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (x = a \<or> x = b \<or> a = b)
[PROOF STEP]
have False if "\<And>c. b - x \<noteq> c *\<^sub>R (a - x)"
[PROOF STATE]
proof (prove)
using this:
\<not> (x = a \<or> x = b \<or> a = b)

goal (1 subgoal):
 1. False
[PROOF STEP]
using that [of "-(norm(b - x) / norm(x - a))"] assms
[PROOF STATE]
proof (prove)
using this:
\<not> (x = a \<or> x = b \<or> a = b)
b - x \<noteq> - (norm (b - x) / norm (x - a)) *\<^sub>R (a - x)
between (a, b) x

goal (1 subgoal):
 1. False
[PROOF STEP]
by (simp add: between_norm vector_add_divide_simps flip: real_vector.scale_minus_right)
[PROOF STATE]
proof (state)
this:
(\<And>c. b - x \<noteq> c *\<^sub>R (a - x)) \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> (x = a \<or> x = b \<or> a = b) \<Longrightarrow> collinear {a, x, b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>c. b - x \<noteq> c *\<^sub>R (a - x)) \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>c. b - x \<noteq> c *\<^sub>R (a - x)) \<Longrightarrow> False

goal (1 subgoal):
 1. collinear {a, x, b}
[PROOF STEP]
by (auto simp: collinear_3 collinear_lemma)
[PROOF STATE]
proof (state)
this:
collinear {a, x, b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_insert_ge: "card (insert x A) \<ge> card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A \<le> card (insert x A)
[PROOF STEP]
by (metis card.infinite card_insert_le zero_le)


[STATEMENT]
lemma neg_numeral_less_floor [simp]: "- numeral v < \<lfloor>x\<rfloor> \<longleftrightarrow> - numeral v + 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- numeral v < \<lfloor>x\<rfloor>) = (- numeral v + (1::'a) \<le> x)
[PROOF STEP]
by (simp add: less_floor_iff)


[STATEMENT]
lemma matrix_add_rdistrib: "((B + C) ** A) = (B ** A) + (C ** A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B + C) ** A = B ** A + C ** A
[PROOF STEP]
by (vector matrix_matrix_mult_def sum.distrib[symmetric] field_simps)


[STATEMENT]
lemma cblinfun_power_scaleR: \<open>cblinfun_power (c *\<^sub>R a) n = c^n *\<^sub>R cblinfun_power a n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_power (c *\<^sub>R a) n = c ^ n *\<^sub>R cblinfun_power a n
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. cblinfun_power (c *\<^sub>R a) 0 = c ^ 0 *\<^sub>R cblinfun_power a 0
 2. \<And>n. cblinfun_power (c *\<^sub>R a) n = c ^ n *\<^sub>R cblinfun_power a n \<Longrightarrow> cblinfun_power (c *\<^sub>R a) (Suc n) = c ^ Suc n *\<^sub>R cblinfun_power a (Suc n)
[PROOF STEP]
by (auto simp: cblinfun_power_Suc)


[STATEMENT]
lemma copair_qbs_correct: "Rep_quasi_borel (copair_qbs X Y) = (qbs_space X <+> qbs_space Y, copair_qbs_Mx X Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_quasi_borel (X <+>\<^sub>Q Y) = (qbs_space X <+> qbs_space Y, copair_qbs_Mx X Y)
[PROOF STEP]
unfolding copair_qbs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_quasi_borel (Abs_quasi_borel (qbs_space X <+> qbs_space Y, copair_qbs_Mx X Y)) = (qbs_space X <+> qbs_space Y, copair_qbs_Mx X Y)
[PROOF STEP]
by(auto intro!: Abs_quasi_borel_inverse copair_qbs_f simp: copair_qbs_closed2 copair_qbs_closed1 copair_qbs_closed3)


[STATEMENT]
lemma sum_set_upto_conv_sum_list_int [code_unfold]:
  "sum f (set [i..j::int]) = sum_list (map f [i..j])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (set [i..j]) = sum_list (map f [i..j])
[PROOF STEP]
by (simp add: interv_sum_list_conv_sum_set_int)


[STATEMENT]
lemma card_doubleton_eq2[simp]: "card {a,b} = 2 \<longleftrightarrow> a\<noteq>b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card {a, b} = 2) = (a \<noteq> b)
[PROOF STEP]
by auto


[STATEMENT]
lemma face_of_eq:
    fixes S :: "'a::real_normed_vector set"
    assumes "T face_of S" "U face_of S" "(rel_interior T) \<inter> (rel_interior U) \<noteq> {}"
    shows "T = U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T = U
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
T face_of S
U face_of S
rel_interior T \<inter> rel_interior U \<noteq> {}

goal (1 subgoal):
 1. T = U
[PROOF STEP]
unfolding disjoint_iff_not_equal
[PROOF STATE]
proof (prove)
using this:
T face_of S
U face_of S
\<not> (\<forall>x\<in>rel_interior T. \<forall>y\<in>rel_interior U. x \<noteq> y)

goal (1 subgoal):
 1. T = U
[PROOF STEP]
by (metis IntI empty_iff face_of_imp_subset mem_rel_interior_ball subset_antisym subset_of_face_of)


[STATEMENT]
theorem invertible_commutes_with_inverse:
  "\<lbrakk> invertible a; a \<in> M \<rbrakk> \<Longrightarrow> \<eta> (inverse a) = inverse' (\<eta> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invertible a; a \<in> M\<rbrakk> \<Longrightarrow> \<eta> (inverse a) = inverse' \<eta> a
[PROOF STEP]
using invertible_image_lemma target.inverse_equality
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>invertible ?a; ?a \<in> M\<rbrakk> \<Longrightarrow> \<eta> ?a \<cdot>' \<eta> (inverse ?a) = \<one>'
\<lbrakk>invertible ?a; ?a \<in> M\<rbrakk> \<Longrightarrow> \<eta> (inverse ?a) \<cdot>' \<eta> ?a = \<one>'
\<lbrakk>?u \<cdot>' ?v = \<one>'; ?v \<cdot>' ?u = \<one>'; ?u \<in> M'; ?v \<in> M'\<rbrakk> \<Longrightarrow> inverse' ?u = ?v

goal (1 subgoal):
 1. \<lbrakk>invertible a; a \<in> M\<rbrakk> \<Longrightarrow> \<eta> (inverse a) = inverse' \<eta> a
[PROOF STEP]
by fastforce


[STATEMENT]
lemma atLeast_leadsTo: "FF \<in> atLeast (k - int n) leadsTo atLeast (k::int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FF \<in> {k - int n..} \<longmapsto> {k..}
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. FF \<in> {k - int 0..} \<longmapsto> {k..}
 2. \<And>n. FF \<in> {k - int n..} \<longmapsto> {k..} \<Longrightarrow> FF \<in> {k - int (Suc n)..} \<longmapsto> {k..}
[PROOF STEP]
apply (simp_all add: leadsTo_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. FF \<in> {k - int n..} \<longmapsto> {k..} \<Longrightarrow> FF \<in> {k - (1 + int n)..} \<longmapsto> {k..}
[PROOF STEP]
apply (rule_tac A = "atLeast (k - int n - 1)" in leadsTo_weaken_L)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. FF \<in> {k - int n..} \<longmapsto> {k..} \<Longrightarrow> FF \<in> {k - int n - 1..} \<longmapsto> {k..}
 2. \<And>n. FF \<in> {k - int n..} \<longmapsto> {k..} \<Longrightarrow> {k - (1 + int n)..} \<subseteq> {k - int n - 1..}
[PROOF STEP]
apply (blast intro: leadsTo_Trans atLeast_ensures, force)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem sophomores_dream1:
  "(\<lambda>k::nat. norm (k powi (-k))) summable_on {1..}"
  "integral {0..1} (\<lambda>x. x powr (-x)) = (\<Sum>\<^sub>\<infinity> k\<in>{(1::nat)..}. k powi (-k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) {1..} &&& integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) {1..}
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
let ?I = "integral {0..1} (\<lambda>x. x powr (-x))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) {1..}
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "(\<lambda>k::nat. norm (k powi (-k))) summable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) UNIV
[PROOF STEP]
using abs_summable_sophomores_dream
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>k. 1 / real (k ^ k))

goal (1 subgoal):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) UNIV
[PROOF STEP]
by (intro norm_summable_imp_summable_on) (auto simp: power_int_minus field_simps)
[PROOF STATE]
proof (state)
this:
Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) UNIV

goal (2 subgoals):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) {1..}
 2. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
thus "(\<lambda>k::nat. norm (k powi (-k))) summable_on {1..}"
[PROOF STATE]
proof (prove)
using this:
Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) UNIV

goal (1 subgoal):
 1. Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) {1..}
[PROOF STEP]
by (rule summable_on_subset_banach) auto
[PROOF STATE]
proof (state)
this:
Infinite_Sum.abs_summable_on (\<lambda>k. real k powi - int k) {1..}

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "(\<lambda>n. 1 / (n+1)^(n+1)) sums ?I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) sums integral {0..1} (\<lambda>x. x powr - x)
[PROOF STEP]
using sophomores_dream_aux1
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>k. 1 / real ((k + 1) ^ (k + 1)))
integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>n. 1 / real ((n + 1) ^ (n + 1)))

goal (1 subgoal):
 1. (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) sums integral {0..1} (\<lambda>x. x powr - x)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) sums integral {0..1} (\<lambda>x. x powr - x)

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) sums integral {0..1} (\<lambda>x. x powr - x)

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "summable (\<lambda>n. norm (1 / real (Suc n ^ Suc n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (1 / real (Suc n ^ Suc n)))
[PROOF STEP]
by (subst summable_Suc_iff) (use abs_summable_sophomores_dream in \<open>auto simp: field_simps\<close>)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (1 / real (Suc n ^ Suc n)))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) sums integral {0..1} (\<lambda>x. x powr - x)
summable (\<lambda>n. norm (1 / real (Suc n ^ Suc n)))
[PROOF STEP]
have "has_sum (\<lambda>n::nat. 1 / (n+1)^(n+1)) UNIV ?I"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) sums integral {0..1} (\<lambda>x. x powr - x)
summable (\<lambda>n. norm (1 / real (Suc n ^ Suc n)))

goal (1 subgoal):
 1. has_sum (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) UNIV (integral {0..1} (\<lambda>x. x powr - x))
[PROOF STEP]
by (intro norm_summable_imp_has_sum) auto
[PROOF STATE]
proof (state)
this:
has_sum (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) UNIV (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
has_sum (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) UNIV (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "?this \<longleftrightarrow> has_sum ((\<lambda>n::nat. 1 / n^n) \<circ> Suc) UNIV ?I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) UNIV (integral {0..1} (\<lambda>x. x powr - x)) = has_sum ((\<lambda>n. 1 / real (n ^ n)) \<circ> Suc) UNIV (integral {0..1} (\<lambda>x. x powr - x))
[PROOF STEP]
by (simp add: o_def field_simps)
[PROOF STATE]
proof (state)
this:
has_sum (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) UNIV (integral {0..1} (\<lambda>x. x powr - x)) = has_sum ((\<lambda>n. 1 / real (n ^ n)) \<circ> Suc) UNIV (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
has_sum (\<lambda>n. 1 / real ((n + 1) ^ (n + 1))) UNIV (integral {0..1} (\<lambda>x. x powr - x)) = has_sum ((\<lambda>n. 1 / real (n ^ n)) \<circ> Suc) UNIV (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> has_sum (\<lambda>n::nat. 1 / n ^ n) (Suc ` UNIV) ?I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum ((\<lambda>n. 1 / real (n ^ n)) \<circ> Suc) UNIV (integral {0..1} (\<lambda>x. x powr - x)) = has_sum (\<lambda>n. 1 / real (n ^ n)) (range Suc) (integral {0..1} (\<lambda>x. x powr - x))
[PROOF STEP]
by (intro has_sum_reindex [symmetric]) auto
[PROOF STATE]
proof (state)
this:
has_sum ((\<lambda>n. 1 / real (n ^ n)) \<circ> Suc) UNIV (integral {0..1} (\<lambda>x. x powr - x)) = has_sum (\<lambda>n. 1 / real (n ^ n)) (range Suc) (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
has_sum ((\<lambda>n. 1 / real (n ^ n)) \<circ> Suc) UNIV (integral {0..1} (\<lambda>x. x powr - x)) = has_sum (\<lambda>n. 1 / real (n ^ n)) (range Suc) (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "Suc ` UNIV = {1..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range Suc = {1..}
[PROOF STEP]
using greaterThan_0
[PROOF STATE]
proof (prove)
using this:
{0<..} = range Suc

goal (1 subgoal):
 1. range Suc = {1..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
range Suc = {1..}

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
range Suc = {1..}

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
have "has_sum (\<lambda>n::nat. (1 / real (n ^ n))) {1..} ?I \<longleftrightarrow>
             has_sum (\<lambda>n::nat. n powi (-n)) {1..} ?I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum (\<lambda>n. 1 / real (n ^ n)) {1..} (integral {0..1} (\<lambda>x. x powr - x)) = has_sum (\<lambda>n. real n powi - int n) {1..} (integral {0..1} (\<lambda>x. x powr - x))
[PROOF STEP]
by (intro has_sum_cong) (auto simp: power_int_minus field_simps power_minus')
[PROOF STATE]
proof (state)
this:
has_sum (\<lambda>n. 1 / real (n ^ n)) {1..} (integral {0..1} (\<lambda>x. x powr - x)) = has_sum (\<lambda>n. real n powi - int n) {1..} (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
has_sum (\<lambda>n. real n powi - int n) {1..} (integral {0..1} (\<lambda>x. x powr - x))
[PROOF STEP]
show "integral {0..1} (\<lambda>x. x powr (-x)) = (\<Sum>\<^sub>\<infinity>k\<in>{(1::nat)..}. k powi (-k))"
[PROOF STATE]
proof (prove)
using this:
has_sum (\<lambda>n. real n powi - int n) {1..} (integral {0..1} (\<lambda>x. x powr - x))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)
[PROOF STEP]
by (auto dest!: infsumI simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
integral {0..1} (\<lambda>x. x powr - x) = (\<Sum>\<^sub>\<infinity>k\<in>{1..}. real k powi - int k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_connected_space:
     "X homeomorphic_space Y \<Longrightarrow> connected_space X \<longleftrightarrow> connected_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homeomorphic_space Y \<Longrightarrow> connected_space X = connected_space Y
[PROOF STEP]
unfolding homeomorphic_space_def homeomorphic_maps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. continuous_map X Y f \<and> continuous_map Y X g \<and> (\<forall>x\<in>topspace X. g (f x) = x) \<and> (\<forall>y\<in>topspace Y. f (g y) = y) \<Longrightarrow> connected_space X = connected_space Y
[PROOF STEP]
by (metis connected_space_subconnected connectedin_continuous_map_image connectedin_topspace continuous_map_image_subset_topspace image_eqI image_subset_iff)


[STATEMENT]
lemma content_closed_interval:
  fixes a :: "'a::ordered_euclidean_space"
  assumes "a \<le> b"
  shows "content {a..b} = (\<Prod>i\<in>Basis. b\<bullet>i - a\<bullet>i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content {a..b} = (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i)
[PROOF STEP]
using content_cbox[of a b] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i)
a \<le> b

goal (1 subgoal):
 1. content {a..b} = (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i)
[PROOF STEP]
by (simp add: cbox_interval eucl_le[where 'a='a])


[STATEMENT]
lemma listprepend_correct': "dnf_to_bool \<gamma> (listprepend as ds) \<longleftrightarrow> (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dnf_to_bool \<gamma> (listprepend as ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(induction as)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dnf_to_bool \<gamma> (listprepend [] ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) []) \<and> dnf_to_bool \<gamma> ds)
 2. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (listprepend (a # as) ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) (a # as)) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (listprepend (a # as) ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) (a # as)) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (map ((#) a) ds @ listprepend as ds) = ((cnf_to_bool \<gamma> [a] \<or> dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as)) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(rename_tac a as)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> dnf_to_bool \<gamma> (map ((#) a) ds @ listprepend as ds) = ((cnf_to_bool \<gamma> [a] \<or> dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as)) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
apply(simp add: map_a_and cnf_to_bool_append dnf_to_bool_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a as. dnf_to_bool \<gamma> (listprepend as ds) = (dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds) \<Longrightarrow> (cnf_to_bool \<gamma> [a] \<and> dnf_to_bool \<gamma> ds \<or> dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as) \<and> dnf_to_bool \<gamma> ds) = ((cnf_to_bool \<gamma> [a] \<or> dnf_to_bool \<gamma> (map (\<lambda>a. [a]) as)) \<and> dnf_to_bool \<gamma> ds)
[PROOF STEP]
by blast


[STATEMENT]
lemma rev_butlast_is_tl_rev: "rev (butlast l) = tl (rev l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (butlast l) = tl (rev l)
[PROOF STEP]
by (induct l) auto


[STATEMENT]
lemma eigenspace_memberI:
  assumes "A *\<^sub>V x = e *\<^sub>C x"
  shows "x \<in> space_as_set (eigenspace e A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> space_as_set (eigenspace e A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>V x = e *\<^sub>C x

goal (1 subgoal):
 1. x \<in> space_as_set (eigenspace e A)
[PROOF STEP]
unfolding eigenspace_def
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>V x = e *\<^sub>C x

goal (1 subgoal):
 1. x \<in> space_as_set (kernel (A - e *\<^sub>C id_cblinfun))
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A x e. \<lbrakk>bounded_clinear A; A x = e *\<^sub>C x\<rbrakk> \<Longrightarrow> x \<in> (\<lambda>x. A x - e *\<^sub>C x) -` {0::'a}
[PROOF STEP]
by auto


[STATEMENT]
lemma to_Zp_nat_pow:
  assumes "a \<in> \<O>\<^sub>p"
  shows "to_Zp (a[^](n::nat)) = (to_Zp a)[^]\<^bsub>Z\<^sub>p\<^esub>(n::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp (a [^] n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> n
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. to_Zp (a [^] 0) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> 0
 2. \<And>n. to_Zp (a [^] n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> n \<Longrightarrow> to_Zp (a [^] Suc n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> Suc n
[PROOF STEP]
using assms Group.nat_pow_0 to_Zp_one
[PROOF STATE]
proof (prove)
using this:
a \<in> \<O>\<^sub>p
?x [^]\<^bsub>?G\<^esub> 0 = \<one>\<^bsub>?G\<^esub>
to_Zp \<one> = \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (2 subgoals):
 1. to_Zp (a [^] 0) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> 0
 2. \<And>n. to_Zp (a [^] n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> n \<Longrightarrow> to_Zp (a [^] Suc n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> Suc n
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. to_Zp (a [^] n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> n \<Longrightarrow> to_Zp (a [^] Suc n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> Suc n
[PROOF STEP]
using assms to_Zp_mult[of a] Qp.m_comm Qp.nat_pow_Suc val_ring_memE pow_suc to_Zp_closed val_ring_nat_pow_closed
[PROOF STATE]
proof (prove)
using this:
a \<in> \<O>\<^sub>p
\<lbrakk>a \<in> \<O>\<^sub>p; ?b \<in> \<O>\<^sub>p\<rbrakk> \<Longrightarrow> to_Zp (a \<otimes> ?b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp ?b
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<otimes> ?y = ?y \<otimes> ?x
?x [^] Suc ?n = ?x [^] ?n \<otimes> ?x
?a \<in> \<O>\<^sub>p \<Longrightarrow> 0 \<le> val ?a
?a \<in> \<O>\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?a \<in> carrier Z\<^sub>p \<Longrightarrow> ?a [^]\<^bsub>Z\<^sub>p\<^esub> Suc ?n = ?a \<otimes>\<^bsub>Z\<^sub>p\<^esub> ?a [^]\<^bsub>Z\<^sub>p\<^esub> ?n
?a \<in> carrier Q\<^sub>p \<Longrightarrow> to_Zp ?a \<in> carrier Z\<^sub>p
?a \<in> \<O>\<^sub>p \<Longrightarrow> ?a [^] ?n \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. \<And>n. to_Zp (a [^] n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> n \<Longrightarrow> to_Zp (a [^] Suc n) = to_Zp a [^]\<^bsub>Z\<^sub>p\<^esub> Suc n
[PROOF STEP]
by metis


[STATEMENT]
lemma lmirror_LCons [simp]: "lmirror (LCons x xs) = LCons x (lappend (lmirror xs) (LCons x LNil))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lmirror (LCons x xs) = LCons x (lappend (lmirror xs) (LCons x LNil))
[PROOF STEP]
by(simp only: lmirror_aux_LCons lmirror_def)


[STATEMENT]
lemma stieltjes_gamma_aux5: "(\<Sum>t<k. (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) -
             ln 2 ^ (k+1) / of_nat (k+1) = (-1) ^ k * (deriv ^^ k) g 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
define h where "h = (\<lambda>k x. (\<Sum>n=1..x. ln(real n)^k / real n) -
                         ln (real x)^(k+1) / real(k+1) - stieltjes_gamma k)"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>k x. (\<Sum>n = 1..x. ln (real n) ^ k / real n) - ln (real x) ^ (k + 1) / real (k + 1) - stieltjes_gamma k)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have h_eq: "(\<Sum>n=1..x. ln n ^ k / n) = ln x^(k+1) / real (k+1) + stieltjes_gamma k + h k x"
    for k x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..x. ln (real n) ^ k / real n) = ln (real x) ^ (k + 1) / real (k + 1) + stieltjes_gamma k + h k x
[PROOF STEP]
by (simp add: h_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..?x. ln (real n) ^ ?k / real n) = ln (real ?x) ^ (?k + 1) / real (?k + 1) + stieltjes_gamma ?k + h ?k ?x

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
define h' where "h' = (\<lambda>x. \<Sum>t=0..k. (k choose t) * ln 2 ^ (k - t) * h t x)"
[PROOF STATE]
proof (state)
this:
h' = (\<lambda>x. \<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * h t x)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
define S1 where "S1 = (\<lambda>x. (\<Sum>t=0..k. (k choose t) * ln 2 ^ (k - t) * ln x ^ (t + 1) / (t + 1)))"
[PROOF STATE]
proof (state)
this:
S1 = (\<lambda>x. \<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln x ^ (t + 1) / real (t + 1))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
define S2 where "S2 = (\<lambda>x. (\<Sum>t=0..k. (k choose t) * ln 2 ^ (k - t) * ln x ^ (t + 1) / (k + 1)))"
[PROOF STATE]
proof (state)
this:
S2 = (\<lambda>x. \<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln x ^ (t + 1) / real (k + 1))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have [THEN filterlim_compose, tendsto_intros]: "h t \<longlonglongrightarrow> 0" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h t \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_diff[OF stieltjes_gamma_real_limit_form[of t] tendsto_const[of "stieltjes_gamma t"]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (\<Sum>k = 1..x. ln (real k) ^ t / real k) - ln (real x) ^ (t + 1) / real (t + 1) - stieltjes_gamma t) \<longlonglongrightarrow> stieltjes_gamma t - stieltjes_gamma t

goal (1 subgoal):
 1. h t \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: h_def)
[PROOF STATE]
proof (state)
this:
filterlim ?f sequentially ?F1.0 \<Longrightarrow> ((\<lambda>x. h ?t1 (?f x)) \<longlongrightarrow> 0) ?F1.0

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have eq: "(\<Sum>n=1..2 * x. (-1)^(n+1) * ln n ^ k / n) =
              ln 2 ^ (k+1) / real (k+1) -
              (\<Sum>t<k. (k choose t) * ln 2 ^ (k-t) * stieltjes_gamma t) + h k (2*x) - h' x"
    (is "?lhs x = ?rhs x") if "x > 0" for x :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "2 * (\<Sum>n=1..x. ln (2*n)^k/(2*n)) =
           (\<Sum>n=1..x. \<Sum>t=0..k. 1/n * (k choose t) * ln 2 ^ (k-t) * ln n ^ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..x. 2 * (ln (real (2 * n)) ^ k / real (2 * n))) = (\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
proof (rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
assume n: "n \<in> {1..x}"
[PROOF STATE]
proof (state)
this:
n \<in> {1..x}

goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
have "2 * (ln (2*n)^k / (2*n)) = 1/n * (ln n + ln 2) ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (ln (real (2 * n)) ^ k / real (2 * n)) = 1 / real n * (ln (real n) + ln 2) ^ k
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
n \<in> {1..x}

goal (1 subgoal):
 1. 2 * (ln (real (2 * n)) ^ k / real (2 * n)) = 1 / real n * (ln (real n) + ln 2) ^ k
[PROOF STEP]
by (simp add: ln_mult add_ac)
[PROOF STATE]
proof (state)
this:
2 * (ln (real (2 * n)) ^ k / real (2 * n)) = 1 / real n * (ln (real n) + ln 2) ^ k

goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (ln (real (2 * n)) ^ k / real (2 * n)) = 1 / real n * (ln (real n) + ln 2) ^ k

goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
have "(ln n + ln 2) ^ k = (\<Sum>t=0..k. (k choose t) * ln 2 ^ (k-t) * ln n ^ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ln (real n) + ln 2) ^ k = (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
by (subst binomial_ring, rule sum.cong) auto
[PROOF STATE]
proof (state)
this:
(ln (real n) + ln 2) ^ k = (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(ln (real n) + ln 2) ^ k = (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
have "1/n * \<dots> = (\<Sum>t=0..k. 1/n * (k choose t) * ln 2 ^ (k-t) * ln n ^ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / real n * (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
by (subst sum_distrib_left) (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
1 / real n * (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (2 subgoals):
 1. {1..x} = {1..x}
 2. \<And>xa. xa \<in> {1..x} \<Longrightarrow> 2 * (ln (real (2 * xa)) ^ k / real (2 * xa)) = (\<Sum>t = 0..k. 1 / real xa * real (k choose t) * ln 2 ^ (k - t) * ln (real xa) ^ t)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * (ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
show "2 * (ln (2*n)^k / (2*n)) = \<dots>"
[PROOF STATE]
proof (prove)
using this:
2 * (ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (1 subgoal):
 1. 2 * (ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
2 * (ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (1 subgoal):
 1. {1..x} = {1..x}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = (\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "\<dots> = (\<Sum>t=0..k. \<Sum>n=1..x. 1/n * (k choose t) * ln 2 ^ (k-t) * ln n ^ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. \<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)
[PROOF STEP]
by (rule sum.swap)
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. \<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..x. \<Sum>t = 0..k. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. \<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "\<dots> = (\<Sum>t=0..k. (k choose t) * ln 2 ^ (k - t) *
                      (ln x ^ (t+1) / (t+1) + stieltjes_gamma t + h t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t = 0..k. \<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x))
[PROOF STEP]
proof (rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {0..k} = {0..k}
 2. \<And>xa. xa \<in> {0..k} \<Longrightarrow> (\<Sum>n = 1..x. 1 / real n * real (k choose xa) * ln 2 ^ (k - xa) * ln (real n) ^ xa) = real (k choose xa) * ln 2 ^ (k - xa) * (ln (real x) ^ (xa + 1) / real (xa + 1) + stieltjes_gamma xa + h xa x)
[PROOF STEP]
fix t :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {0..k} = {0..k}
 2. \<And>xa. xa \<in> {0..k} \<Longrightarrow> (\<Sum>n = 1..x. 1 / real n * real (k choose xa) * ln 2 ^ (k - xa) * ln (real n) ^ xa) = real (k choose xa) * ln 2 ^ (k - xa) * (ln (real x) ^ (xa + 1) / real (xa + 1) + stieltjes_gamma xa + h xa x)
[PROOF STEP]
assume t: "t \<in> {0..k}"
[PROOF STATE]
proof (state)
this:
t \<in> {0..k}

goal (2 subgoals):
 1. {0..k} = {0..k}
 2. \<And>xa. xa \<in> {0..k} \<Longrightarrow> (\<Sum>n = 1..x. 1 / real n * real (k choose xa) * ln 2 ^ (k - xa) * ln (real n) ^ xa) = real (k choose xa) * ln 2 ^ (k - xa) * (ln (real x) ^ (xa + 1) / real (xa + 1) + stieltjes_gamma xa + h xa x)
[PROOF STEP]
have "(\<Sum>n=1..x. 1/n * (k choose t) * ln 2 ^ (k-t) * ln n ^ t) =
            (k choose t) * ln 2 ^ (k - t) * (\<Sum>n=1..x. ln n ^ t / n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (\<Sum>n = 1..x. ln (real n) ^ t / real n)
[PROOF STEP]
by (subst sum_distrib_left) (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (\<Sum>n = 1..x. ln (real n) ^ t / real n)

goal (2 subgoals):
 1. {0..k} = {0..k}
 2. \<And>xa. xa \<in> {0..k} \<Longrightarrow> (\<Sum>n = 1..x. 1 / real n * real (k choose xa) * ln 2 ^ (k - xa) * ln (real n) ^ xa) = real (k choose xa) * ln 2 ^ (k - xa) * (ln (real x) ^ (xa + 1) / real (xa + 1) + stieltjes_gamma xa + h xa x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (\<Sum>n = 1..x. ln (real n) ^ t / real n)

goal (2 subgoals):
 1. {0..k} = {0..k}
 2. \<And>xa. xa \<in> {0..k} \<Longrightarrow> (\<Sum>n = 1..x. 1 / real n * real (k choose xa) * ln 2 ^ (k - xa) * ln (real n) ^ xa) = real (k choose xa) * ln 2 ^ (k - xa) * (ln (real x) ^ (xa + 1) / real (xa + 1) + stieltjes_gamma xa + h xa x)
[PROOF STEP]
have "(\<Sum>n=1..x. ln n ^ t / n) = ln x ^ (t+1) / (t+1) + stieltjes_gamma t + h t x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..x. ln (real n) ^ t / real n) = ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x
[PROOF STEP]
using h_eq[of t]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n = 1..?x. ln (real n) ^ t / real n) = ln (real ?x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t ?x

goal (1 subgoal):
 1. (\<Sum>n = 1..x. ln (real n) ^ t / real n) = ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..x. ln (real n) ^ t / real n) = ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x

goal (2 subgoals):
 1. {0..k} = {0..k}
 2. \<And>xa. xa \<in> {0..k} \<Longrightarrow> (\<Sum>n = 1..x. 1 / real n * real (k choose xa) * ln 2 ^ (k - xa) * ln (real n) ^ xa) = real (k choose xa) * ln 2 ^ (k - xa) * (ln (real x) ^ (xa + 1) / real (xa + 1) + stieltjes_gamma xa + h xa x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)
[PROOF STEP]
show "(\<Sum>n=1..x. 1/n * (k choose t) * ln 2 ^ (k-t) * ln n ^ t) =
                      (k choose t) * ln 2 ^ (k - t) * \<dots>"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)

goal (1 subgoal):
 1. (\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)

goal (1 subgoal):
 1. {0..k} = {0..k}
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. \<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. \<Sum>n = 1..x. 1 / real n * real (k choose t) * ln 2 ^ (k - t) * ln (real n) ^ t) = (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "\<dots> = (\<Sum>t=0..k. (k choose t) / (t + 1) * ln 2 ^ (k - t) * ln x ^ (t + 1)) +
                    (\<Sum>t=0..k. (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)) = (\<Sum>t = 0..k. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x
[PROOF STEP]
by (simp add: ring_distribs sum.distrib h'_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)) = (\<Sum>t = 0..k. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * (ln (real x) ^ (t + 1) / real (t + 1) + stieltjes_gamma t + h t x)) = (\<Sum>t = 0..k. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>t=0..k. (k choose t) / (t + 1) * ln 2 ^ (k - t) * ln x ^ (t + 1)) =
               (\<Sum>t=0..k. (Suc k choose Suc t) / (k + 1) * ln 2 ^ (k - t) * ln x ^ (t + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t = 0..k. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) = (\<Sum>t = 0..k. real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1))
[PROOF STEP]
proof (intro sum.cong refl, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
case (1 t)
[PROOF STATE]
proof (state)
this:
t \<in> {0..k}

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
have "of_nat (k choose t) * (of_nat (k + 1) :: real) = of_nat ((k choose t) * (k + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (k choose t) * real (k + 1) = real ((k choose t) * (k + 1))
[PROOF STEP]
by (simp only: of_nat_mult)
[PROOF STATE]
proof (state)
this:
real (k choose t) * real (k + 1) = real ((k choose t) * (k + 1))

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (k choose t) * real (k + 1) = real ((k choose t) * (k + 1))

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
have "(k choose t) * (k + 1) = (Suc k choose Suc t) * (t + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k choose t) * (k + 1) = (Suc k choose Suc t) * (t + 1)
[PROOF STEP]
using Suc_times_binomial_eq[of k t]
[PROOF STATE]
proof (prove)
using this:
Suc k * (k choose t) = (Suc k choose Suc t) * Suc t

goal (1 subgoal):
 1. (k choose t) * (k + 1) = (Suc k choose Suc t) * (t + 1)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(k choose t) * (k + 1) = (Suc k choose Suc t) * (t + 1)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(k choose t) * (k + 1) = (Suc k choose Suc t) * (t + 1)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
have "of_nat \<dots> = of_nat (Suc k choose Suc t) * (of_nat (t + 1) :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real ((Suc k choose Suc t) * (t + 1)) = real (Suc k choose Suc t) * real (t + 1)
[PROOF STEP]
by (simp only: of_nat_mult)
[PROOF STATE]
proof (state)
this:
real ((Suc k choose Suc t) * (t + 1)) = real (Suc k choose Suc t) * real (t + 1)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (k choose t) * real (k + 1) = real (Suc k choose Suc t) * real (t + 1)
[PROOF STEP]
have *: "of_nat (k choose t) / of_nat (t + 1) =
                         (of_nat (Suc k choose Suc t) / (k + 1) :: real)"
[PROOF STATE]
proof (prove)
using this:
real (k choose t) * real (k + 1) = real (Suc k choose Suc t) * real (t + 1)

goal (1 subgoal):
 1. real (k choose t) / real (t + 1) = real (Suc k choose Suc t) / real (k + 1)
[PROOF STEP]
by (simp add: divide_simps flip: of_nat_Suc del: binomial_Suc_Suc)
[PROOF STATE]
proof (state)
this:
real (k choose t) / real (t + 1) = real (Suc k choose Suc t) / real (k + 1)

goal (1 subgoal):
 1. \<And>xa. xa \<in> {0..k} \<Longrightarrow> real (k choose xa) / real (xa + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1) = real (Suc k choose Suc xa) / real (k + 1) * ln 2 ^ (k - xa) * ln (real x) ^ (xa + 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1) = real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)
[PROOF STEP]
by (simp only: *)
[PROOF STATE]
proof (state)
this:
real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1) = real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) = (\<Sum>t = 0..k. real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. real (k choose t) / real (t + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) = (\<Sum>t = 0..k. real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "\<dots> = (\<Sum>t=1..Suc k. (Suc k choose t) / (k + 1) * ln 2 ^ (Suc k - t) * ln x ^ t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t = 0..k. real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) = (\<Sum>t = 1..Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t)
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>t. t-1" Suc]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) = (\<Sum>t = 1..Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t = 0..k. real (Suc k choose Suc t) / real (k + 1) * ln 2 ^ (k - t) * ln (real x) ^ (t + 1)) = (\<Sum>t = 1..Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "{1..Suc k} = {..Suc k} - {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {1..Suc k} = {..Suc k} - {0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1..Suc k} = {..Suc k} - {0}

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{1..Suc k} = {..Suc k} - {0}

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>t\<in>\<dots>. (Suc k choose t) / (k + 1) * ln 2 ^ (Suc k - t) * ln x ^ t) =
                 (\<Sum>t\<le>Suc k. (Suc k choose t) / (k + 1) * ln 2 ^ (Suc k - t) * ln x ^ t) -
                   ln 2 ^ Suc k / (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>{..Suc k} - {0}. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) - ln 2 ^ Suc k / real (k + 1)
[PROOF STEP]
by (subst sum_diff1) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>{..Suc k} - {0}. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) - ln 2 ^ Suc k / real (k + 1)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>{..Suc k} - {0}. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) - ln 2 ^ Suc k / real (k + 1)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>t\<le>Suc k. (Suc k choose t) / (k + 1) * ln 2 ^ (Suc k - t) * ln x ^ t) =
               (ln x + ln 2) ^ Suc k / (k + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (ln (real x) + ln 2) ^ Suc k / real (k + 1)
[PROOF STEP]
unfolding binomial_ring
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (\<Sum>ka\<le>Suc k. real (Suc k choose ka) * ln (real x) ^ ka * ln 2 ^ (Suc k - ka)) / real (k + 1)
[PROOF STEP]
by (subst sum_divide_distrib) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (ln (real x) + ln 2) ^ Suc k / real (k + 1)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<le>Suc k. real (Suc k choose t) / real (k + 1) * ln 2 ^ (Suc k - t) * ln (real x) ^ t) = (ln (real x) + ln 2) ^ Suc k / real (k + 1)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "ln x + ln 2 = ln (2 * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (real x) + ln 2 = ln (real (2 * x))
[PROOF STEP]
using \<open>x > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. ln (real x) + ln 2 = ln (real (2 * x))
[PROOF STEP]
by (simp add: ln_mult)
[PROOF STATE]
proof (state)
this:
ln (real x) + ln 2 = ln (real (2 * x))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln (real (2 * x)) ^ Suc k / real (k + 1) - ln 2 ^ Suc k / real (k + 1) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x
[PROOF STEP]
have eq1: "2 * (\<Sum>n=1..x. ln (real (2*n))^k / real (2*n)) =
                         ln (real (2*x))^(k+1) / real (k+1) - ln 2^(k+1) / real (k+1) +
                         (\<Sum>t=0..k. (k choose t) * ln 2^(k - t) * stieltjes_gamma t) + h' x"
[PROOF STATE]
proof (prove)
using this:
2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln (real (2 * x)) ^ Suc k / real (k + 1) - ln 2 ^ Suc k / real (k + 1) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x

goal (1 subgoal):
 1. 2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln (real (2 * x)) ^ (k + 1) / real (k + 1) - ln 2 ^ (k + 1) / real (k + 1) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln (real (2 * x)) ^ (k + 1) / real (k + 1) - ln 2 ^ (k + 1) / real (k + 1) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have eq2: "(\<Sum>n=1..2*x. ln n ^ k / n) = ln (real (2*x))^(k+1) / real (k+1) + stieltjes_gamma k + h k (2*x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) = ln (real (2 * x)) ^ (k + 1) / real (k + 1) + stieltjes_gamma k + h k (2 * x)
[PROOF STEP]
by (simp only: h_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) = ln (real (2 * x)) ^ (k + 1) / real (k + 1) + stieltjes_gamma k + h k (2 * x)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>n=1..2*x. (-1)^(n+1) * ln n ^ k / n) =
          (\<Sum>n=1..2*x. ln n ^ k / n - 2 * (if even n then ln n ^ k / n else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n - 2 * (if even n then ln (real n) ^ k / real n else 0))
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n - 2 * (if even n then ln (real n) ^ k / real n else 0))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n - 2 * (if even n then ln (real n) ^ k / real n else 0))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "\<dots> = (\<Sum>n=1..2*x. ln n ^ k / n) -
                    2 * (\<Sum>n=1..2*x. if even n then ln n ^ k / n else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n - 2 * (if even n then ln (real n) ^ k / real n else 0)) = (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..2 * x. if even n then ln (real n) ^ k / real n else 0)
[PROOF STEP]
by (simp only: sum_subtractf sum_distrib_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. ln (real n) ^ k / real n - 2 * (if even n then ln (real n) ^ k / real n else 0)) = (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..2 * x. if even n then ln (real n) ^ k / real n else 0)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. ln (real n) ^ k / real n - 2 * (if even n then ln (real n) ^ k / real n else 0)) = (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..2 * x. if even n then ln (real n) ^ k / real n else 0)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>n=1..2*x. if even n then ln n ^ k / n else 0) =
               (\<Sum>n | n \<in> {1..2*x} \<and> even n. ln n ^ k / n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. if even n then ln (real n) ^ k / real n else 0) = (\<Sum>x\<in>{n \<in> {1..2 * x}. even n}. ln (real x) ^ k / real x)
[PROOF STEP]
by (intro sum.mono_neutral_cong_right) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. if even n then ln (real n) ^ k / real n else 0) = (\<Sum>x\<in>{n \<in> {1..2 * x}. even n}. ln (real x) ^ k / real x)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. if even n then ln (real n) ^ k / real n else 0) = (\<Sum>x\<in>{n \<in> {1..2 * x}. even n}. ln (real x) ^ k / real x)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "\<dots> = (\<Sum>n=1..x. ln (real (2*n)) ^ k / real (2*n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{n \<in> {1..2 * x}. even n}. ln (real x) ^ k / real x) = (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n))
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>n. 2*n" "\<lambda>n. n div 2"]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{n \<in> {1..2 * x}. even n}. ln (real x) ^ k / real x) = (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{n \<in> {1..2 * x}. even n}. ln (real x) ^ k / real x) = (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>n=1..2*x. ln n ^ k / n) - 2 * \<dots> =
                 ln 2^(k+1) / real (k+1) -
                ((\<Sum>t=0..k. (k choose t) * ln 2^(k - t) * stieltjes_gamma t) - stieltjes_gamma k) +
                h k (2*x) - h' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln 2 ^ (k + 1) / real (k + 1) - ((\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) - stieltjes_gamma k) + h k (2 * x) - h' x
[PROOF STEP]
using arg_cong2[OF eq1 eq2, of "(-)"]
[PROOF STATE]
proof (prove)
using this:
2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) - (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) = ln (real (2 * x)) ^ (k + 1) / real (k + 1) - ln 2 ^ (k + 1) / real (k + 1) + (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h' x - (ln (real (2 * x)) ^ (k + 1) / real (k + 1) + stieltjes_gamma k + h k (2 * x))

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln 2 ^ (k + 1) / real (k + 1) - ((\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) - stieltjes_gamma k) + h k (2 * x) - h' x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln 2 ^ (k + 1) / real (k + 1) - ((\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) - stieltjes_gamma k) + h k (2 * x) - h' x

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. ln (real n) ^ k / real n) - 2 * (\<Sum>n = 1..x. ln (real (2 * n)) ^ k / real (2 * n)) = ln 2 ^ (k + 1) / real (k + 1) - ((\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) - stieltjes_gamma k) + h k (2 * x) - h' x

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "{0..k} = insert k {..<k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..k} = insert k {..<k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..k} = insert k {..<k}

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{0..k} = insert k {..<k}

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
have "(\<Sum>t\<in>\<dots>. (k choose t) * ln 2^(k - t) * stieltjes_gamma t) - stieltjes_gamma k =
                 (\<Sum>t<k. (k choose t) * ln 2^(k - t) * stieltjes_gamma t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>t\<in>insert k {..<k}. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) - stieltjes_gamma k = (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
[PROOF STEP]
by (subst sum.insert) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>t\<in>insert k {..<k}. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) - stieltjes_gamma k = (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x

goal (1 subgoal):
 1. (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?x \<Longrightarrow> (\<Sum>n = 1..2 * ?x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * ?x) - h' ?x

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "?rhs \<longlonglongrightarrow> ln 2 ^ (k+1) / real (k+1) -
                            (\<Sum>t<k. (k choose t) * ln 2 ^ (k-t) * stieltjes_gamma t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * a) - h' a) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
[PROOF STEP]
unfolding h'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * a) - (\<Sum>t = 0..k. real (k choose t) * ln 2 ^ (k - t) * h t a)) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
[PROOF STEP]
by (rule tendsto_eq_intros refl mult_nat_left_at_top filterlim_ident | simp)+
[PROOF STATE]
proof (state)
this:
(\<lambda>a. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * a) - h' a) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>a. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * a) - h' a) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "eventually (\<lambda>x. ?rhs x = ?lhs x) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x = (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n)
[PROOF STEP]
using eventually_gt_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (0::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x = (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n)
[PROOF STEP]
by eventually_elim (simp only: eq)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x = (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>a. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * a) - h' a) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
\<forall>\<^sub>F x in sequentially. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x = (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n)
[PROOF STEP]
have *: "?lhs \<longlonglongrightarrow> ln 2 ^ (k+1) / real (k+1) -
                                   (\<Sum>t<k. (k choose t) * ln 2 ^ (k-t) * stieltjes_gamma t)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>a. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * a) - h' a) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
\<forall>\<^sub>F x in sequentially. ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t) + h k (2 * x) - h' x = (\<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n)

goal (1 subgoal):
 1. (\<lambda>a. \<Sum>n = 1..2 * a. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
[PROOF STEP]
by (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>a. \<Sum>n = 1..2 * a. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>a. \<Sum>n = 1..2 * a. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "(\<lambda>x. \<Sum>n=1..2*x. (-1)^(n+1) * ln (real n)^k / real n) =
             (\<lambda>x. \<Sum>n<2*x. -((-1)^(n+1) * ln (real (n+1))^k / real (n+1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = (\<lambda>x. \<Sum>n<2 * x. - ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1)))
[PROOF STEP]
by (intro ext sum.reindex_bij_witness[of _ Suc "\<lambda>n. n - 1"]) (auto simp: power_diff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = (\<lambda>x. \<Sum>n<2 * x. - ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1)))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n = 1..2 * x. (- 1) ^ (n + 1) * ln (real n) ^ k / real n) = (\<lambda>x. \<Sum>n<2 * x. - ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1)))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "\<dots> = (\<lambda>x. -(\<Sum>n<2*x. ((-1)^(n+1) * ln (real (n+1))^k / real (n+1))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. - ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) = (\<lambda>x. - (\<Sum>n<2 * x. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1)))
[PROOF STEP]
by (subst sum_negf) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n<2 * x. - ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) = (\<lambda>x. - (\<Sum>n<2 * x. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1)))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>a. - (\<Sum>n<2 * a. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
[PROOF STEP]
have *: "\<dots> \<longlonglongrightarrow> (ln 2 ^ (k+1) / real (k+1) -
                              (\<Sum>t<k. (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>a. - (\<Sum>n<2 * a. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<lambda>x. - (\<Sum>n<2 * x. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. - (\<Sum>n<2 * x. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have lim1: "(\<lambda>x. (\<Sum>n<2*x. complex_of_real ((-1)^(n+1) * ln (real (n+1))^k / real (n+1))))
              \<longlonglongrightarrow> -(ln 2 ^ (k+1) / of_nat (k+1) -
                      (\<Sum>t<k. (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t))"
    (is "?lhs' \<longlonglongrightarrow> _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))
[PROOF STEP]
using tendsto_of_real[OF tendsto_minus[OF *], where ?'a = complex]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. complex_of_real (- (- (\<Sum>n<2 * x. (- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))
[PROOF STEP]
by (simp add: Ln_Reals_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "?lhs' \<longlonglongrightarrow> ((- 1) ^ k * (deriv ^^ k) g 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have **: "filterlim (\<lambda>n::nat. 2 * n) sequentially sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim ((*) 2) sequentially sequentially
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
filterlim ((*) 2) sequentially sequentially

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "(\<lambda>x. (\<Sum>n<2*x. complex_of_real ((-1)^(n+1) * ln (real (n+1))^k / real (n+1))))
              \<longlonglongrightarrow> ((- 1) ^ k * (deriv ^^ k) g 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
by (rule filterlim_compose[OF _ **]) (use stieltjes_gamma_aux1 in \<open>simp add: sums_def\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1

goal (1 subgoal):
 1. (\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
have "-(ln 2 ^ (k+1) / of_nat (k+1) -
                      (\<Sum>t<k. (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)) =
                   (-1) ^ k * (deriv ^^ k) g 1"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t)))
(\<lambda>x. \<Sum>n<2 * x. complex_of_real ((- 1) ^ (n + 1) * ln (real (n + 1)) ^ k / real (n + 1))) \<longlonglongrightarrow> (- 1) ^ k * (deriv ^^ k) g 1

goal (1 subgoal):
 1. complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t))) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
by (rule LIMSEQ_unique)
[PROOF STATE]
proof (state)
this:
complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t))) = (- 1) ^ k * (deriv ^^ k) g 1

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
complex_of_real (- (ln 2 ^ (k + 1) / real (k + 1) - (\<Sum>t<k. real (k choose t) * ln 2 ^ (k - t) * stieltjes_gamma t))) = (- 1) ^ k * (deriv ^^ k) g 1

goal (1 subgoal):
 1. (\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1
[PROOF STEP]
by (simp add: Ln_Reals_eq)
[PROOF STATE]
proof (state)
this:
(\<Sum>t<k. of_nat (k choose t) * Ln 2 ^ (k - t) * stieltjes_gamma t) - Ln 2 ^ (k + 1) / of_nat (k + 1) = (- 1) ^ k * (deriv ^^ k) g 1

goal:
No subgoals!
[PROOF STEP]
qed