[STATEMENT]
lemma (in PolynRg) deg_to_X_d:"Idomain S \<Longrightarrow>  deg_n R S X (X^\<^bsup>R d\<^esup>) = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Idomain S \<Longrightarrow> deg_n R S X (X^\<^bsup>R d\<^esup>) = d
[PROOF STEP]
apply (cut_tac subring, frule subring_Ring,
       cut_tac polyn_ring_S_nonzero,
       cut_tac X_mem_R,
       cut_tac polyn_ring_X_nonzero,
       cut_tac polyn_ring_integral)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S = Idomain R\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R d\<^esup>) = d
[PROOF STEP]
apply (induct_tac d)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Idomain S; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S = Idomain R\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R 0\<^esup>) = 0
 2. \<And>n. \<lbrakk>Idomain S; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S = Idomain R; deg_n R S X (X^\<^bsup>R n\<^esup>) = n\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R Suc n\<^esup>) = Suc n
[PROOF STEP]
apply (cut_tac ring_one,
        simp add:Subring_one_ring_one[THEN sym],
        simp add:Subring_zero_ring_zero)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Idomain R; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S; 1\<^sub>r\<^bsub>S\<^esub> \<in> carrier R\<rbrakk> \<Longrightarrow> deg_n R S X 1\<^sub>r\<^bsub>S\<^esub> = 0
 2. \<And>n. \<lbrakk>Idomain S; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S = Idomain R; deg_n R S X (X^\<^bsup>R n\<^esup>) = n\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R Suc n\<^esup>) = Suc n
[PROOF STEP]
apply (subst pol_of_deg0[of "1\<^sub>r\<^bsub>S\<^esub>"], assumption+, simp add:Ring.ring_one[of S])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain S; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S = Idomain R; deg_n R S X (X^\<^bsup>R n\<^esup>) = n\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R Suc n\<^esup>) = Suc n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain R; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S; deg_n R S X (X^\<^bsup>R n\<^esup>) = n\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R n\<^esup> \<cdot>\<^sub>r X) = Suc n
[PROOF STEP]
apply (subst deg_mult_pols, assumption+,
        simp add:npClose,
        rule Idomain.idom_potent_nonzero, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>Idomain R; Subring R S; Ring S; 1\<^sub>r\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>; X \<in> carrier R; X \<noteq> \<zero>; Idomain S; deg_n R S X (X^\<^bsup>R n\<^esup>) = n\<rbrakk> \<Longrightarrow> deg_n R S X (X^\<^bsup>R n\<^esup>) + deg_n R S X X = Suc n
[PROOF STEP]
apply (simp add:deg_n_of_X)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rank_1_proj_square_mat:
  shows "square_mat (rank_1_proj v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (rank_1_proj v)
[PROOF STEP]
using outer_prod_dim
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m

goal (1 subgoal):
 1. square_mat (rank_1_proj v)
[PROOF STEP]
unfolding rank_1_proj_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?m\<rbrakk> \<Longrightarrow> outer_prod ?v ?w \<in> carrier_mat ?n ?m

goal (1 subgoal):
 1. square_mat (outer_prod v v)
[PROOF STEP]
by (metis carrier_matD(1) carrier_matD(2) carrier_vec_dim_vec  square_mat.simps)


[STATEMENT]
lemma echelon_form_of_euclidean_invertible_cancelled_first:
"\<exists>Rep Abs. type_definition Rep Abs {0..<int n} \<Longrightarrow> 1 < m \<Longrightarrow> 1 < n \<Longrightarrow>
  A \<in> carrier_mat m n \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m
  \<and> P * (A::int mat) = echelon_form_of_JNF A euclid_ext2 \<and> echelon_form_JNF (echelon_form_of_JNF A euclid_ext2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>Rep Abs. type_definition Rep Abs {0..<int n}; 1 < m; 1 < n; A \<in> carrier_mat m n\<rbrakk> \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> P * A = echelon_form_of_JNF A euclid_ext2 \<and> echelon_form_JNF (echelon_form_of_JNF A euclid_ext2)
[PROOF STEP]
using echelon_form_of_euclidean_invertible_nontriv_mod_ring_aux[cancel_type_definition, of m n A]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{0..<int m} \<noteq> {}; \<exists>Rep Abs. type_definition Rep Abs {0..<int n}; 1 < m; 1 < n; A \<in> carrier_mat m n\<rbrakk> \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> P * A = echelon_form_of_JNF A euclid_ext2 \<and> echelon_form_JNF (echelon_form_of_JNF A euclid_ext2)

goal (1 subgoal):
 1. \<lbrakk>\<exists>Rep Abs. type_definition Rep Abs {0..<int n}; 1 < m; 1 < n; A \<in> carrier_mat m n\<rbrakk> \<Longrightarrow> \<exists>P. invertible_mat P \<and> P \<in> carrier_mat m m \<and> P * A = echelon_form_of_JNF A euclid_ext2 \<and> echelon_form_JNF (echelon_form_of_JNF A euclid_ext2)
[PROOF STEP]
by force


[STATEMENT]
lemma Fr_ClBr: "Int_2 \<I> \<Longrightarrow> \<forall>A. Fr(A) = (Cl(A) \<and> Br(A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Int_2 \<I> \<Longrightarrow> \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
using BF_rel Br_fr_def CF_rel Cl_fr_def eq_ext' join_def meet_def
[PROOF STATE]
proof (prove)
using this:
Int_2 \<I> \<Longrightarrow> \<B> \<^bold>\<equiv> \<B>\<^sub>F \<F>
\<B>\<^sub>F ?\<F> \<equiv> \<lambda>A. A \<^bold>\<and> ?\<F> A
Int_2 \<I> \<Longrightarrow> \<C> \<^bold>\<equiv> \<C>\<^sub>F \<F>
\<C>\<^sub>F ?\<F> \<equiv> \<lambda>A. A \<^bold>\<or> ?\<F> A
?a \<^bold>\<equiv> ?b \<Longrightarrow> ?a = ?b
?A \<^bold>\<or> ?B \<equiv> \<lambda>w. ?A w \<or> ?B w
?A \<^bold>\<and> ?B \<equiv> \<lambda>w. ?A w \<and> ?B w

goal (1 subgoal):
 1. Int_2 \<I> \<Longrightarrow> \<forall>A. (\<forall>w. \<F> A w = A w) = ((\<forall>w. \<C> A w = A w) \<and> (\<forall>w. \<B> A w = A w))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma tendsto_mult_ereal [tendsto_intros]:
  fixes f g::"_ \<Rightarrow> ereal"
  assumes "(f \<longlongrightarrow> l) F" "(g \<longlongrightarrow> m) F" "\<not>((l=0 \<and> abs(m) = \<infinity>) \<or> (m=0 \<and> abs(l) = \<infinity>))"
  shows "((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
 2. \<not> ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
assume "l=0 \<or> m=0"
[PROOF STATE]
proof (state)
this:
l = 0 \<or> m = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
 2. \<not> ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l = 0 \<or> m = 0
[PROOF STEP]
have "abs(l) \<noteq> \<infinity>" "abs(m) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
using this:
l = 0 \<or> m = 0

goal (1 subgoal):
 1. \<bar>l\<bar> \<noteq> \<infinity> &&& \<bar>m\<bar> \<noteq> \<infinity>
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
l = 0 \<or> m = 0
\<not> (l = 0 \<and> \<bar>m\<bar> = \<infinity> \<or> m = 0 \<and> \<bar>l\<bar> = \<infinity>)

goal (1 subgoal):
 1. \<bar>l\<bar> \<noteq> \<infinity> &&& \<bar>m\<bar> \<noteq> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>l\<bar> \<noteq> \<infinity>
\<bar>m\<bar> \<noteq> \<infinity>

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
 2. \<not> ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>l\<bar> \<noteq> \<infinity>
\<bar>m\<bar> \<noteq> \<infinity>
[PROOF STEP]
obtain lr mr where "l = ereal lr" "m = ereal mr"
[PROOF STATE]
proof (prove)
using this:
\<bar>l\<bar> \<noteq> \<infinity>
\<bar>m\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<And>lr mr. \<lbrakk>l = ereal lr; m = ereal mr\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l = ereal lr
m = ereal mr

goal (2 subgoals):
 1. ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
 2. \<not> ?P \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l = ereal lr
m = ereal mr
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l = ereal lr
m = ereal mr

goal (1 subgoal):
 1. ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
using tendsto_mult_real_ereal assms
[PROOF STATE]
proof (prove)
using this:
l = ereal lr
m = ereal mr
\<lbrakk>(?u \<longlongrightarrow> ereal ?l) ?F; (?v \<longlongrightarrow> ereal ?m) ?F\<rbrakk> \<Longrightarrow> ((\<lambda>n. ?u n * ?v n) \<longlongrightarrow> ereal ?l * ereal ?m) ?F
(f \<longlongrightarrow> l) F
(g \<longlongrightarrow> m) F
\<not> (l = 0 \<and> \<bar>m\<bar> = \<infinity> \<or> m = 0 \<and> \<bar>l\<bar> = \<infinity>)

goal (1 subgoal):
 1. ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
have sgn_finite: "\<And>a::ereal. abs(sgn a) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<bar>sgn a\<bar> \<noteq> \<infinity>
[PROOF STEP]
by (metis MInfty_neq_ereal(2) PInfty_neq_ereal(2) abs_eq_infinity_cases ereal_times(1) ereal_times(3) ereal_uminus_eq_reorder sgn_ereal.elims)
[PROOF STATE]
proof (state)
this:
\<bar>sgn ?a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>sgn ?a\<bar> \<noteq> \<infinity>
[PROOF STEP]
have sgn_finite2: "\<And>a b::ereal. abs(sgn a * sgn b) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<bar>sgn ?a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<And>a b. \<bar>sgn a * sgn b\<bar> \<noteq> \<infinity>
[PROOF STEP]
by (metis abs_eq_infinity_cases abs_ereal.simps(2) abs_ereal.simps(3) ereal_mult_eq_MInfty ereal_mult_eq_PInfty)
[PROOF STATE]
proof (state)
this:
\<bar>sgn ?a * sgn ?b\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
assume "\<not>(l=0 \<or> m=0)"
[PROOF STATE]
proof (state)
this:
\<not> (l = 0 \<or> m = 0)

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (l = 0 \<or> m = 0)
[PROOF STEP]
have "l \<noteq> 0" "m \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (l = 0 \<or> m = 0)

goal (1 subgoal):
 1. l \<noteq> 0 &&& m \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l \<noteq> 0
m \<noteq> 0

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l \<noteq> 0
m \<noteq> 0
[PROOF STEP]
have "abs(l) > 0" "abs(m) > 0"
[PROOF STATE]
proof (prove)
using this:
l \<noteq> 0
m \<noteq> 0

goal (1 subgoal):
 1. 0 < \<bar>l\<bar> &&& 0 < \<bar>m\<bar>
[PROOF STEP]
by (metis abs_ereal_ge0 abs_ereal_less0 abs_ereal_pos ereal_uminus_uminus ereal_uminus_zero less_le not_less)+
[PROOF STATE]
proof (state)
this:
0 < \<bar>l\<bar>
0 < \<bar>m\<bar>

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < \<bar>l\<bar>
0 < \<bar>m\<bar>
[PROOF STEP]
have "sgn(l) * l > 0" "sgn(m) * m > 0"
[PROOF STATE]
proof (prove)
using this:
0 < \<bar>l\<bar>
0 < \<bar>m\<bar>

goal (1 subgoal):
 1. 0 < sgn l * l &&& 0 < sgn m * m
[PROOF STEP]
using ereal_sgn_abs
[PROOF STATE]
proof (prove)
using this:
0 < \<bar>l\<bar>
0 < \<bar>m\<bar>
sgn ?l * ?l = \<bar>?l\<bar>

goal (1 subgoal):
 1. 0 < sgn l * l &&& 0 < sgn m * m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < sgn l * l
0 < sgn m * m

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < sgn l * l
0 < sgn m * m

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
have "((\<lambda>x. sgn(l) * f x) \<longlongrightarrow> (sgn(l) * l)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn l * f x) \<longlongrightarrow> sgn l * l) F
[PROOF STEP]
by (rule tendsto_cmult_ereal, auto simp add: sgn_finite assms(1))
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sgn l * f x) \<longlongrightarrow> sgn l * l) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sgn l * f x) \<longlongrightarrow> sgn l * l) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
have "((\<lambda>x. sgn(m) * g x) \<longlongrightarrow> (sgn(m) * m)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn m * g x) \<longlongrightarrow> sgn m * m) F
[PROOF STEP]
by (rule tendsto_cmult_ereal, auto simp add: sgn_finite assms(2))
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sgn m * g x) \<longlongrightarrow> sgn m * m) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < sgn l * l
0 < sgn m * m
((\<lambda>x. sgn l * f x) \<longlongrightarrow> sgn l * l) F
((\<lambda>x. sgn m * g x) \<longlongrightarrow> sgn m * m) F
[PROOF STEP]
have *: "((\<lambda>x. (sgn(l) * f x) * (sgn(m) * g x)) \<longlongrightarrow> (sgn(l) * l) * (sgn(m) * m)) F"
[PROOF STATE]
proof (prove)
using this:
0 < sgn l * l
0 < sgn m * m
((\<lambda>x. sgn l * f x) \<longlongrightarrow> sgn l * l) F
((\<lambda>x. sgn m * g x) \<longlongrightarrow> sgn m * m) F

goal (1 subgoal):
 1. ((\<lambda>x. sgn l * f x * (sgn m * g x)) \<longlongrightarrow> sgn l * l * (sgn m * m)) F
[PROOF STEP]
using tendsto_mult_ereal_pos
[PROOF STATE]
proof (prove)
using this:
0 < sgn l * l
0 < sgn m * m
((\<lambda>x. sgn l * f x) \<longlongrightarrow> sgn l * l) F
((\<lambda>x. sgn m * g x) \<longlongrightarrow> sgn m * m) F
\<lbrakk>(?f \<longlongrightarrow> ?l) ?F; (?g \<longlongrightarrow> ?m) ?F; 0 < ?l; 0 < ?m\<rbrakk> \<Longrightarrow> ((\<lambda>x. ?f x * ?g x) \<longlongrightarrow> ?l * ?m) ?F

goal (1 subgoal):
 1. ((\<lambda>x. sgn l * f x * (sgn m * g x)) \<longlongrightarrow> sgn l * l * (sgn m * m)) F
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sgn l * f x * (sgn m * g x)) \<longlongrightarrow> sgn l * l * (sgn m * m)) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
have "((\<lambda>x. (sgn(l) * sgn(m)) * ((sgn(l) * f x) * (sgn(m) * g x))) \<longlongrightarrow> (sgn(l) * sgn(m)) * ((sgn(l) * l) * (sgn(m) * m))) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sgn l * sgn m * (sgn l * f x * (sgn m * g x))) \<longlongrightarrow> sgn l * sgn m * (sgn l * l * (sgn m * m))) F
[PROOF STEP]
by (rule tendsto_cmult_ereal, auto simp add: sgn_finite2 *)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sgn l * sgn m * (sgn l * f x * (sgn m * g x))) \<longlongrightarrow> sgn l * sgn m * (sgn l * l * (sgn m * m))) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sgn l * sgn m * (sgn l * f x * (sgn m * g x))) \<longlongrightarrow> sgn l * sgn m * (sgn l * l * (sgn m * m))) F

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
have "\<And>x. (sgn(l) * sgn(m)) * ((sgn(l) * f x) * (sgn(m) * g x)) = f x * g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. sgn l * sgn m * (sgn l * f x * (sgn m * g x)) = f x * g x
[PROOF STEP]
by (metis mult.left_neutral sgn_squared_ereal[OF \<open>l \<noteq> 0\<close>] sgn_squared_ereal[OF \<open>m \<noteq> 0\<close>] mult.assoc mult.commute)
[PROOF STATE]
proof (state)
this:
sgn l * sgn m * (sgn l * f ?x * (sgn m * g ?x)) = f ?x * g ?x

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sgn l * sgn m * (sgn l * f ?x * (sgn m * g ?x)) = f ?x * g ?x

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
have "(sgn(l) * sgn(m)) * ((sgn(l) * l) * (sgn(m) * m)) = l * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn l * sgn m * (sgn l * l * (sgn m * m)) = l * m
[PROOF STEP]
by (metis mult.left_neutral sgn_squared_ereal[OF \<open>l \<noteq> 0\<close>] sgn_squared_ereal[OF \<open>m \<noteq> 0\<close>] mult.assoc mult.commute)
[PROOF STATE]
proof (state)
this:
sgn l * sgn m * (sgn l * l * (sgn m * m)) = l * m

goal (1 subgoal):
 1. \<not> (l = 0 \<or> m = 0) \<Longrightarrow> ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. sgn l * sgn m * (sgn l * f x * (sgn m * g x))) \<longlongrightarrow> sgn l * sgn m * (sgn l * l * (sgn m * m))) F
sgn l * sgn m * (sgn l * f ?x * (sgn m * g ?x)) = f ?x * g ?x
sgn l * sgn m * (sgn l * l * (sgn m * m)) = l * m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. sgn l * sgn m * (sgn l * f x * (sgn m * g x))) \<longlongrightarrow> sgn l * sgn m * (sgn l * l * (sgn m * m))) F
sgn l * sgn m * (sgn l * f ?x * (sgn m * g ?x)) = f ?x * g ?x
sgn l * sgn m * (sgn l * l * (sgn m * m)) = l * m

goal (1 subgoal):
 1. ((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x * g x) \<longlongrightarrow> l * m) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma plus_mtx2: "mtx
  ([a1, b1] #
   [c1, d1] # []) + mtx
  ([a2, b2] #
   [c2, d2] # []) = ((mtx
  ([a1+a2, b1+b2] #
   [c1+c2, d1+d2] # []))::2 sq_mtx)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mtx [[a1, b1], [c1, d1]] + mtx [[a2, b2], [c2, d2]] = mtx [[a1 + a2, b1 + b2], [c1 + c2, d1 + d2]]
[PROOF STEP]
by (simp add: sq_mtx_eq_iff)


[STATEMENT]
lemma real_transfer_operator_int [intro]:
  assumes "integrable M f"
  shows "integrable M (real_transfer_operator f)"
        "(\<integral>x. real_transfer_operator f x \<partial>M) = (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (real_transfer_operator f) &&& integral\<^sup>L M (real_transfer_operator f) = integral\<^sup>L M f
[PROOF STEP]
using real_transfer_operator_intg[where ?f = "\<lambda>x. 1" and ?g = f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>integrable M (\<lambda>x. 1 * f x); (\<lambda>x. 1) \<in> borel_measurable M; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. 1 * real_transfer_operator f x)
\<lbrakk>integrable M (\<lambda>x. 1 * f x); (\<lambda>x. 1) \<in> borel_measurable M; f \<in> borel_measurable M\<rbrakk> \<Longrightarrow> LINT x|M. 1 * real_transfer_operator f x = LINT x|M. 1 * f x
integrable M f

goal (1 subgoal):
 1. integrable M (real_transfer_operator f) &&& integral\<^sup>L M (real_transfer_operator f) = integral\<^sup>L M f
[PROOF STEP]
by auto


[STATEMENT]
lemma (in psemicategory) psmc_smc_prod_vdiff_vunion_Comp:
  assumes "J \<subseteq>\<^sub>\<circ> I"
    and "g : b \<mapsto>\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Cj\<in>\<^sub>\<circ>I -\<^sub>\<circ> J. \<AA> j)\<^esub> c"
    and "g' : b' \<mapsto>\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Ck\<in>\<^sub>\<circ>J. \<AA> k)\<^esub> c'"
    and "f : a \<mapsto>\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Cj\<in>\<^sub>\<circ>I -\<^sub>\<circ> J. \<AA> j)\<^esub> b"
    and "f' : a' \<mapsto>\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Ck\<in>\<^sub>\<circ>J. \<AA> k)\<^esub> b'"
  shows "(g \<circ>\<^sub>A\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Cj\<in>\<^sub>\<circ>I -\<^sub>\<circ> J. \<AA> j)\<^esub> f) \<union>\<^sub>\<circ> (g' \<circ>\<^sub>A\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Cj\<in>\<^sub>\<circ>J. \<AA> j)\<^esub> f') =
    g \<union>\<^sub>\<circ> g' \<circ>\<^sub>A\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Cj\<in>\<^sub>\<circ>I. \<AA> j)\<^esub> f \<union>\<^sub>\<circ> f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ>\<^sub>A\<^bsub>smc_prod (I -\<^sub>\<circ> J) \<AA>\<^esub> f) \<union>\<^sub>\<circ> (g' \<circ>\<^sub>A\<^bsub>smc_prod J \<AA>\<^esub> f') = g \<union>\<^sub>\<circ> g' \<circ>\<^sub>A\<^bsub>smc_prod I \<AA>\<^esub> f \<union>\<^sub>\<circ> f'
[PROOF STEP]
by
    (
      vdiff_of_vunion'
        rule: psmc_smc_prod_vunion_Comp assms: assms(2-5) subset: assms(1)
    )


[STATEMENT]
lemma continuous_map_eq_image_closure_subset_gen:
     "continuous_map X Y f \<longleftrightarrow>
        f ` (topspace X) \<subseteq> topspace Y \<and>
        (\<forall>S. f ` (X closure_of S) \<subseteq> Y closure_of f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X Y f = (f ` topspace X \<subseteq> topspace Y \<and> (\<forall>S. f ` (X closure_of S) \<subseteq> Y closure_of f ` S))
[PROOF STEP]
using continuous_map_subset_aux1 continuous_map_subset_aux2 continuous_map_image_subset_topspace
[PROOF STATE]
proof (prove)
using this:
continuous_map ?X ?Y ?f \<Longrightarrow> \<forall>S. ?f ` (?X closure_of S) \<subseteq> ?Y closure_of ?f ` S
\<forall>S\<subseteq>topspace ?X. ?f ` (?X closure_of S) \<subseteq> ?Y closure_of ?f ` S \<Longrightarrow> continuous_map ?X ?Y ?f
continuous_map ?X ?Y ?f \<Longrightarrow> ?f ` topspace ?X \<subseteq> topspace ?Y

goal (1 subgoal):
 1. continuous_map X Y f = (f ` topspace X \<subseteq> topspace Y \<and> (\<forall>S. f ` (X closure_of S) \<subseteq> Y closure_of f ` S))
[PROOF STEP]
by metis


[STATEMENT]
lemma prop_unfold_equiv_card:
  "finite P \<Longrightarrow> card {abs_ltln\<^sub>Q \<psi> |\<psi>. prop_atoms \<psi> \<subseteq> P} \<le> 2 ^ 2 ^ card P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite P \<Longrightarrow> card {abs_ltln\<^sub>Q \<psi> |\<psi>. prop_atoms \<psi> \<subseteq> P} \<le> 2 ^ 2 ^ card P
[PROOF STEP]
using prop_unfold_equiv_helper(2)[OF prop_equiv_finite[unfolded image_Collect[symmetric]]] prop_equiv_card
[PROOF STATE]
proof (prove)
using this:
finite ?P1 \<Longrightarrow> card (abs_ltln\<^sub>Q ` {\<psi>. prop_atoms \<psi> \<subseteq> ?P1}) \<le> card (abs_ltln\<^sub>P ` {\<psi>. prop_atoms \<psi> \<subseteq> ?P1})
finite ?P \<Longrightarrow> card {abs_ltln\<^sub>P \<psi> |\<psi>. prop_atoms \<psi> \<subseteq> ?P} \<le> 2 ^ 2 ^ card ?P

goal (1 subgoal):
 1. finite P \<Longrightarrow> card {abs_ltln\<^sub>Q \<psi> |\<psi>. prop_atoms \<psi> \<subseteq> P} \<le> 2 ^ 2 ^ card P
[PROOF STEP]
unfolding image_Collect[symmetric]
[PROOF STATE]
proof (prove)
using this:
finite ?P1 \<Longrightarrow> card (abs_ltln\<^sub>Q ` {\<psi>. prop_atoms \<psi> \<subseteq> ?P1}) \<le> card (abs_ltln\<^sub>P ` {\<psi>. prop_atoms \<psi> \<subseteq> ?P1})
finite ?P \<Longrightarrow> card (abs_ltln\<^sub>P ` {\<psi>. prop_atoms \<psi> \<subseteq> ?P}) \<le> 2 ^ 2 ^ card ?P

goal (1 subgoal):
 1. finite P \<Longrightarrow> card (abs_ltln\<^sub>Q ` {\<psi>. prop_atoms \<psi> \<subseteq> P}) \<le> 2 ^ 2 ^ card P
[PROOF STEP]
by fastforce


[STATEMENT]
lemma nat_cut_le_Max_le: "
  I \<down>\<le> t \<noteq> {} \<Longrightarrow> Max (I \<down>\<le> t) \<le> (t::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<down>\<le> t \<noteq> {} \<Longrightarrow> Max (I \<down>\<le> t) \<le> t
[PROOF STEP]
by (rule cut_le_bound[OF Max_in[OF nat_cut_le_finite]])


[STATEMENT]
lemma fps_nth_Lambert_W_1 [simp]: "fps_nth fps_Lambert_W 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_Lambert_W $ 1 = 1
[PROOF STEP]
by (simp add: fps_Lambert_W_def fps_inv_def)


[STATEMENT]
lemma hurwitz_zeta_critical_strip:
  fixes s :: complex and a :: real
  defines "S \<equiv> (\<lambda>n. \<Sum>i<n. (of_nat i + a) powr - s)"
  defines "I' \<equiv> (\<lambda>n. of_nat n powr (1 - s) / (1 - s))"
  assumes "Re s > 0" "s \<noteq> 1" and "a > 0"
  shows   "(\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a
[PROOF STEP]
have [simp]: "s \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. s \<noteq> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s \<noteq> 1

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
let ?f = "\<lambda>x. of_real (x + a) powr -s"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
let ?fs = "\<lambda>n x. (-1) ^ n * pochhammer s n * of_real (x + a) powr (-s - of_nat n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have minus_commute: "-a - b = -b - a" for a b :: complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a - b = - b - a
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
- ?a - ?b = - ?b - ?a

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define I where "I = (\<lambda>n. (of_nat n + a) powr (1 - s) / (1 - s))"
[PROOF STATE]
proof (state)
this:
I = (\<lambda>n. complex_of_real (real n + a) powr (1 - s) / (1 - s))

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define R where "R = (\<lambda>n. EM_remainder' 1 (?fs 1) (real 0) (real n))"
[PROOF STATE]
proof (state)
this:
R = (\<lambda>n. EM_remainder' 1 (\<lambda>x. (- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) (real 0) (real n))

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define R_lim where "R_lim = EM_remainder 1 (?fs 1) 0"
[PROOF STATE]
proof (state)
this:
R_lim = EM_remainder 1 (\<lambda>x. (- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) 0

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define C where "C = - (a powr -s / 2)"
[PROOF STATE]
proof (state)
this:
C = - (complex_of_real a powr - s / 2)

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define D where "D = (\<lambda>n. (1/2) * (of_real (a + real n) powr - s))"
[PROOF STATE]
proof (state)
this:
D = (\<lambda>n. 1 / 2 * complex_of_real (a + real n) powr - s)

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define D' where "D' = (\<lambda>n. of_real (a + real n) powr - s)"
[PROOF STATE]
proof (state)
this:
D' = (\<lambda>n. complex_of_real (a + real n) powr - s)

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define C' where "C' = a powr (1 - s) / (1 - s)"
[PROOF STATE]
proof (state)
this:
C' = complex_of_real a powr (1 - s) / (1 - s)

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
define C'' where "C'' = of_real a powr - s"
[PROOF STATE]
proof (state)
this:
C'' = complex_of_real a powr - s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
C'' = complex_of_real a powr - s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
assume n: "n > 0"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "((\<lambda>x. of_real (x + a) powr -s) has_integral (of_real (real n + a) powr (1-s) / (1 - s) -
            of_real (0 + a) powr (1 - s) / (1 - s))) {0..real n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. complex_of_real (x + a) powr - s) has_integral complex_of_real (real n + a) powr (1 - s) / (1 - s) - complex_of_real (0 + a) powr (1 - s) / (1 - s)) {0..real n}
[PROOF STEP]
using n assms
[PROOF STATE]
proof (prove)
using this:
0 < n
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. ((\<lambda>x. complex_of_real (x + a) powr - s) has_integral complex_of_real (real n + a) powr (1 - s) / (1 - s) - complex_of_real (0 + a) powr (1 - s) / (1 - s)) {0..real n}
[PROOF STEP]
by (intro fundamental_theorem_of_calculus)
         (auto intro!: continuous_intros has_vector_derivative_real_field derivative_eq_intros
               simp: complex_nonpos_Reals_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. complex_of_real (x + a) powr - s) has_integral complex_of_real (real n + a) powr (1 - s) / (1 - s) - complex_of_real (0 + a) powr (1 - s) / (1 - s)) {0..real n}

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
hence I: "((\<lambda>x. of_real (x + a) powr -s) has_integral (I n - C')) {0..n}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. complex_of_real (x + a) powr - s) has_integral complex_of_real (real n + a) powr (1 - s) / (1 - s) - complex_of_real (0 + a) powr (1 - s) / (1 - s)) {0..real n}

goal (1 subgoal):
 1. ((\<lambda>x. complex_of_real (x + a) powr - s) has_integral I n - C') {0..real n}
[PROOF STEP]
by (auto simp: divide_simps C'_def I_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. complex_of_real (x + a) powr - s) has_integral I n - C') {0..real n}

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "(\<Sum>i\<in>{0<..n}. ?f (real i)) - integral {real 0..real n} ?f =
            (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R (?fs k (real n) - ?fs k (real 0))) + R n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) - integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) + R n
[PROOF STEP]
using n assms
[PROOF STATE]
proof (prove)
using this:
0 < n
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. (\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) - integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) + R n
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
using this:
0 < n
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. (\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) - integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) + EM_remainder' 1 (\<lambda>x. (- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) (real 0) (real n)
[PROOF STEP]
by (intro euler_maclaurin_strong_raw_nat[where Y = "{0}"])
         (auto intro!: continuous_intros derivative_eq_intros has_vector_derivative_real_field
               simp: pochhammer_rec' algebra_simps complex_nonpos_Reals_iff add_eq_0_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) - integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) + R n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) - integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) + R n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "(\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R (?fs k (real n) - ?fs k (real 0))) =
                  ((n + a) powr - s - a powr - s) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) = (complex_of_real (real n + a) powr - s - complex_of_real a powr - s) / 2
[PROOF STEP]
by (simp add: lessThan_nat_numeral scaleR_conv_of_real numeral_2_eq_2 [symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) = (complex_of_real (real n + a) powr - s - complex_of_real a powr - s) / 2

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<1. (bernoulli' (Suc k) / fact (Suc k)) *\<^sub>R ((- 1) ^ k * pochhammer s k * complex_of_real (real n + a) powr (- s - of_nat k) - (- 1) ^ k * pochhammer s k * complex_of_real (real 0 + a) powr (- s - of_nat k))) = (complex_of_real (real n + a) powr - s - complex_of_real a powr - s) / 2

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "\<dots> = C + D n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (complex_of_real (real n + a) powr - s - complex_of_real a powr - s) / 2 = C + D n
[PROOF STEP]
by (simp add: C_def D_def field_simps)
[PROOF STATE]
proof (state)
this:
(complex_of_real (real n + a) powr - s - complex_of_real a powr - s) / 2 = C + D n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(complex_of_real (real n + a) powr - s - complex_of_real a powr - s) / 2 = C + D n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = I n - C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = I n - C'
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. complex_of_real (x + a) powr - s) has_integral I n - C') {0..real n}

goal (1 subgoal):
 1. integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = I n - C'
[PROOF STEP]
by (simp add: has_integral_iff)
[PROOF STATE]
proof (state)
this:
integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = I n - C'

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral {real 0..real n} (\<lambda>x. complex_of_real (x + a) powr - s) = I n - C'

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "(\<Sum>i\<in>{0<..n}. of_real (real i + a) powr - s) =
                 (\<Sum>i=0..n. of_real (real i + a) powr - s) - of_real a powr -s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) = (\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) - complex_of_real a powr - s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. (\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) = (\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) - complex_of_real a powr - s
[PROOF STEP]
by (subst sum.head) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) = (\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) - complex_of_real a powr - s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0<..n}. complex_of_real (real i + a) powr - s) = (\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) - complex_of_real a powr - s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "(\<Sum>i=0..n. of_real (real i + a) powr - s) = S n + of_real (real n + a) powr -s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) = S n + complex_of_real (real n + a) powr - s
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) = (\<Sum>i<n. complex_of_real (real i + a) powr - s) + complex_of_real (real n + a) powr - s
[PROOF STEP]
by (subst sum.last_plus) (auto simp: atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..n. complex_of_real (real i + a) powr - s) = S n + complex_of_real (real n + a) powr - s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S n + complex_of_real (real n + a) powr - s - complex_of_real a powr - s - (I n - C') = C + D n + R n
[PROOF STEP]
have "C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n"
[PROOF STATE]
proof (prove)
using this:
S n + complex_of_real (real n + a) powr - s - complex_of_real a powr - s - (I n - C') = C + D n + R n

goal (1 subgoal):
 1. C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n
[PROOF STEP]
by (simp add: algebra_simps S_def D'_def C''_def)
[PROOF STATE]
proof (state)
this:
C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?n2 \<Longrightarrow> C - C' + C'' - D' ?n2 + D ?n2 + R ?n2 + (I ?n2 - I' ?n2) = S ?n2 - I' ?n2

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
hence ev: "eventually (\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n) at_top"
[PROOF STATE]
proof (prove)
using this:
0 < ?n2 \<Longrightarrow> C - C' + C'' - D' ?n2 + D ?n2 + R ?n2 + (I ?n2 - I' ?n2) = S ?n2 - I' ?n2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n
[PROOF STEP]
by (intro eventually_mono[OF eventually_gt_at_top[of 0]]) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have [simp]: "-1 - s = -s - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 - s = - s - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- 1 - s = - s - 1

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
- 1 - s = - s - 1

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
let ?C = "norm (pochhammer s 1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "R \<longlonglongrightarrow> R_lim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<longlonglongrightarrow> R_lim
[PROOF STEP]
unfolding R_def R_lim_def of_nat_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. EM_remainder' 1 (\<lambda>x. (- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) 0 (real n)) \<longlonglongrightarrow> EM_remainder 1 (\<lambda>x. (- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) 0
[PROOF STEP]
proof (subst of_int_0 [symmetric], rule tendsto_EM_remainder)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>y. real_of_int 0 \<le> y \<Longrightarrow> (?G has_real_derivative ?g y) (at y within {real_of_int 0..})
 2. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 3. convergent (\<lambda>y. ?G (real y))
 4. \<forall>\<^sub>F x in at_top. cmod ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) \<le> ?g x
[PROOF STEP]
show "eventually (\<lambda>x. norm (?fs 1 x) \<le> ?C * (x + a) powr (-Re s - 1)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. cmod ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) \<le> cmod (pochhammer s 1) * (x + a) powr (- Re s - 1)
[PROOF STEP]
using eventually_ge_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) (0::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. cmod ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) \<le> cmod (pochhammer s 1) * (x + a) powr (- Re s - 1)
[PROOF STEP]
by eventually_elim (insert assms, auto simp: norm_mult norm_powr_real_powr)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. cmod ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (x + a) powr (- s - of_nat 1)) \<le> cmod (pochhammer s 1) * (x + a) powr (- Re s - 1)

goal (3 subgoals):
 1. \<And>y. real_of_int 0 \<le> y \<Longrightarrow> (?G has_real_derivative cmod (pochhammer s 1) * (y + a) powr (- Re s - 1)) (at y within {real_of_int 0..})
 2. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 3. convergent (\<lambda>y. ?G (real y))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>y. real_of_int 0 \<le> y \<Longrightarrow> (?G has_real_derivative cmod (pochhammer s 1) * (y + a) powr (- Re s - 1)) (at y within {real_of_int 0..})
 2. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 3. convergent (\<lambda>y. ?G (real y))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>y. real_of_int 0 \<le> y \<Longrightarrow> (?G has_real_derivative cmod (pochhammer s 1) * (y + a) powr (- Re s - 1)) (at y within {real_of_int 0..})
 2. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 3. convergent (\<lambda>y. ?G (real y))
[PROOF STEP]
assume x: "x \<ge> real_of_int 0"
[PROOF STATE]
proof (state)
this:
real_of_int 0 \<le> x

goal (3 subgoals):
 1. \<And>y. real_of_int 0 \<le> y \<Longrightarrow> (?G has_real_derivative cmod (pochhammer s 1) * (y + a) powr (- Re s - 1)) (at y within {real_of_int 0..})
 2. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 3. convergent (\<lambda>y. ?G (real y))
[PROOF STEP]
have [simp]: "-numeral n - (x :: real) = -x - numeral n" for x n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - numeral n - x = - x - numeral n
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
- numeral ?n - ?x = - ?x - numeral ?n

goal (3 subgoals):
 1. \<And>y. real_of_int 0 \<le> y \<Longrightarrow> (?G has_real_derivative cmod (pochhammer s 1) * (y + a) powr (- Re s - 1)) (at y within {real_of_int 0..})
 2. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 3. convergent (\<lambda>y. ?G (real y))
[PROOF STEP]
show "((\<lambda>x. ?C / (-Re s) * (x + a) powr (-Re s)) has_real_derivative
              ?C * (x + a) powr (- Re s - 1)) (at x within {real_of_int 0..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. cmod (pochhammer s 1) / - Re s * (x + a) powr - Re s) has_real_derivative cmod (pochhammer s 1) * (x + a) powr (- Re s - 1)) (at x within {real_of_int 0..})
[PROOF STEP]
using assms x
[PROOF STATE]
proof (prove)
using this:
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a
real_of_int 0 \<le> x

goal (1 subgoal):
 1. ((\<lambda>x. cmod (pochhammer s 1) / - Re s * (x + a) powr - Re s) has_real_derivative cmod (pochhammer s 1) * (x + a) powr (- Re s - 1)) (at x within {real_of_int 0..})
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. cmod (pochhammer s 1) / - Re s * (x + a) powr - Re s) has_real_derivative cmod (pochhammer s 1) * (x + a) powr (- Re s - 1)) (at x within {real_of_int 0..})

goal (2 subgoals):
 1. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 2. convergent (\<lambda>y. cmod (pochhammer s 1) / - Re s * (real y + a) powr - Re s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 2. convergent (\<lambda>y. cmod (pochhammer s 1) / - Re s * (real y + a) powr - Re s)
[PROOF STEP]
have "(\<lambda>y. ?C / (- Re s) * (a + real y) powr (- Re s)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. cmod (pochhammer s 1) / - Re s * (a + real y) powr - Re s) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro tendsto_mult_right_zero tendsto_neg_powr filterlim_real_sequentially
                  filterlim_tendsto_add_at_top[OF tendsto_const]) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>y. cmod (pochhammer s 1) / - Re s * (a + real y) powr - Re s) \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
 2. convergent (\<lambda>y. cmod (pochhammer s 1) / - Re s * (real y + a) powr - Re s)
[PROOF STEP]
thus "convergent (\<lambda>y. ?C / (- Re s) * (real y + a) powr (- Re s))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>y. cmod (pochhammer s 1) / - Re s * (a + real y) powr - Re s) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. convergent (\<lambda>y. cmod (pochhammer s 1) / - Re s * (real y + a) powr - Re s)
[PROOF STEP]
by (auto simp: add_ac convergent_def)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>y. cmod (pochhammer s 1) / - Re s * (real y + a) powr - Re s)

goal (1 subgoal):
 1. \<And>a' n. \<lbrakk>real_of_int 0 \<le> a'; a' \<le> n\<rbrakk> \<Longrightarrow> (\<lambda>t. pbernpoly 1 t *\<^sub>R ((- 1) ^ 1 * pochhammer s 1 * complex_of_real (t + a) powr (- s - of_nat 1))) integrable_on {a'..n}
[PROOF STEP]
qed (intro integrable_EM_remainder' continuous_intros, insert assms, auto simp: add_eq_0_iff)
[PROOF STATE]
proof (state)
this:
R \<longlonglongrightarrow> R_lim

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
R \<longlonglongrightarrow> R_lim

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
R \<longlonglongrightarrow> R_lim

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. (complex_of_real (real n + a) powr (1 - s) -
                 of_real (real n) powr (1 - s)) / (1 - s)) \<longlonglongrightarrow> 0 / (1 - s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (complex_of_real (real n + a) powr (1 - s) - complex_of_real (real n) powr (1 - s)) / (1 - s)) \<longlonglongrightarrow> 0 / (1 - s)
[PROOF STEP]
using assms(3-5)
[PROOF STATE]
proof (prove)
using this:
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. (\<lambda>n. (complex_of_real (real n + a) powr (1 - s) - complex_of_real (real n) powr (1 - s)) / (1 - s)) \<longlonglongrightarrow> 0 / (1 - s)
[PROOF STEP]
by (intro filterlim_compose[OF _ filterlim_real_sequentially]
                             tendsto_divide complex_powr_add_minus_powr_asymptotics) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (complex_of_real (real n + a) powr (1 - s) - complex_of_real (real n) powr (1 - s)) / (1 - s)) \<longlonglongrightarrow> 0 / (1 - s)

goal (1 subgoal):
 1. (\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0
[PROOF STEP]
thus "(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (complex_of_real (real n + a) powr (1 - s) - complex_of_real (real n) powr (1 - s)) / (1 - s)) \<longlonglongrightarrow> 0 / (1 - s)

goal (1 subgoal):
 1. (\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: I_def I'_def divide_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
R \<longlonglongrightarrow> R_lim
(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n))
                     \<longlonglongrightarrow> C - C' + C'' - 0 + 0 + R_lim + 0"
[PROOF STATE]
proof (prove)
using this:
R \<longlonglongrightarrow> R_lim
(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> C - C' + C'' - 0 + 0 + R_lim + 0
[PROOF STEP]
unfolding D_def D'_def
[PROOF STATE]
proof (prove)
using this:
R \<longlonglongrightarrow> R_lim
(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. C - C' + C'' - complex_of_real (a + real n) powr - s + 1 / 2 * complex_of_real (a + real n) powr - s + R n + (I n - I' n)) \<longlonglongrightarrow> C - C' + C'' - 0 + 0 + R_lim + 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R \<longlonglongrightarrow> R_lim
(\<lambda>n. I n - I' n) \<longlonglongrightarrow> 0
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. (\<lambda>n. C - C' + C'' - complex_of_real (a + real n) powr - s + 1 / 2 * complex_of_real (a + real n) powr - s + R n + (I n - I' n)) \<longlonglongrightarrow> C - C' + C'' - 0 + 0 + R_lim + 0
[PROOF STEP]
by (intro tendsto_add tendsto_diff tendsto_const tendsto_mult_right_zero
              tendsto_neg_powr_complex_of_real filterlim_tendsto_add_at_top
              filterlim_real_sequentially) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> C - C' + C'' - 0 + 0 + R_lim + 0

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> C - C' + C'' - 0 + 0 + R_lim + 0

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "C - C' + C'' - 0 + 0 + R_lim + 0 =
               (a powr - s / 2) + a powr (1 - s) / (s - 1) + R_lim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C - C' + C'' - 0 + 0 + R_lim + 0 = complex_of_real a powr - s / 2 + complex_of_real a powr (1 - s) / (s - 1) + R_lim
[PROOF STEP]
by (simp add: C_def C'_def C''_def field_simps)
[PROOF STATE]
proof (state)
this:
C - C' + C'' - 0 + 0 + R_lim + 0 = complex_of_real a powr - s / 2 + complex_of_real a powr (1 - s) / (s - 1) + R_lim

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
C - C' + C'' - 0 + 0 + R_lim + 0 = complex_of_real a powr - s / 2 + complex_of_real a powr (1 - s) / (s - 1) + R_lim

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "\<dots> = hurwitz_zeta a s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real a powr - s / 2 + complex_of_real a powr (1 - s) / (s - 1) + R_lim = hurwitz_zeta a s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<equiv> \<lambda>n. \<Sum>i<n. complex_of_real (real i + a) powr - s
I' \<equiv> \<lambda>n. of_nat n powr (1 - s) / (1 - s)
0 < Re s
s \<noteq> 1
0 < a

goal (1 subgoal):
 1. complex_of_real a powr - s / 2 + complex_of_real a powr (1 - s) / (s - 1) + R_lim = hurwitz_zeta a s
[PROOF STEP]
by (simp add: hurwitz_zeta_def pre_zeta_def pre_zeta_aux_def
                              R_lim_def scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
complex_of_real a powr - s / 2 + complex_of_real a powr (1 - s) / (s - 1) + R_lim = hurwitz_zeta a s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
have "(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s

goal (1 subgoal):
 1. (\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
with ev
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. C - C' + C'' - D' n + D n + R n + (I n - I' n) = S n - I' n
(\<lambda>n. C - C' + C'' - D' n + D n + R n + (I n - I' n)) \<longlonglongrightarrow> hurwitz_zeta a s

goal (1 subgoal):
 1. (\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s
[PROOF STEP]
by (blast intro: Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. S n - I' n) \<longlonglongrightarrow> hurwitz_zeta a s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Plus_mem_iff2: "x + k \<in> (I \<oplus> k) = (x \<in> I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + k \<in> I \<oplus> k) = (x \<in> I)
[PROOF STEP]
by (simp add: iT_Plus_def image_iff)


[STATEMENT]
lemma real_0_less_add_iff: "0 < x + y \<longleftrightarrow> - x < y"
  for x y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < x + y) = (- x < y)
[PROOF STEP]
by auto


[STATEMENT]
lemma gt_half_sum: "a < b \<Longrightarrow> (a+b)/(1+1) < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b \<Longrightarrow> (a + b) / ((1::'a) + (1::'a)) < b
[PROOF STEP]
by (metis local.add_pos_pos local.add_strict_left_mono local.mult_imp_div_pos_less local.semiring_normalization_rules(24) local.semiring_normalization_rules(4) local.zero_less_one mult_commute)


[STATEMENT]
lemma hRe_diff [simp]: "\<And>x y. hRe (x - y) = hRe x - hRe y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. hRe (x - y) = hRe x - hRe y
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma pmf_prod_pmf:
  assumes "finite I"
  shows "pmf (prod_pmf I M) x = (if x \<in> extensional I then \<Prod>i \<in> I. (pmf (M i)) (x i) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (prod_pmf I M) x = (if x \<in> extensional I then \<Prod>i\<in>I. pmf (M i) (x i) else 0)
[PROOF STEP]
by (simp add:  pmf_Pi[OF assms(1)] extensional_def)


[STATEMENT]
lemma binrelchain_setfuncong_Cons_snoc:
  "\<lbrakk> \<forall>x\<in>A. \<forall>y. P x y \<longrightarrow> y\<in>A; \<forall>x\<in>A. \<forall>y. P x y \<longrightarrow> f y = f x; x\<in>A;
      binrelchain P (x#zs@[y]) \<rbrakk> \<Longrightarrow> f y = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A. \<forall>y. P x y \<longrightarrow> y \<in> A; \<forall>x\<in>A. \<forall>y. P x y \<longrightarrow> f y = f x; x \<in> A; binrelchain P (x # zs @ [y])\<rbrakk> \<Longrightarrow> f y = f x
[PROOF STEP]
using binrelchain_funcong_extra_condition_Cons_snoc[of "\<lambda>x. x\<in>A" P f x zs y]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. \<lbrakk>x \<in> A; P x y\<rbrakk> \<Longrightarrow> y \<in> A; \<And>x y. \<lbrakk>x \<in> A; P x y\<rbrakk> \<Longrightarrow> f y = f x; x \<in> A; binrelchain P (x # zs @ [y])\<rbrakk> \<Longrightarrow> f y = f x

goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>A. \<forall>y. P x y \<longrightarrow> y \<in> A; \<forall>x\<in>A. \<forall>y. P x y \<longrightarrow> f y = f x; x \<in> A; binrelchain P (x # zs @ [y])\<rbrakk> \<Longrightarrow> f y = f x
[PROOF STEP]
by    fast


[STATEMENT]
lemma divide_less_ennreal: "b \<noteq> 0 \<Longrightarrow> b < top \<Longrightarrow> a / b < c \<longleftrightarrow> a < (c * b :: ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> 0; b < top\<rbrakk> \<Longrightarrow> (a / b < c) = (a < c * b)
[PROOF STEP]
by (cases a; cases b; cases c)
     (auto simp: divide_ennreal ennreal_mult[symmetric] ennreal_less_iff field_simps ennreal_top_mult ennreal_top_divide)


[STATEMENT]
lemma real_of_nat_less_numeral_iff [simp]: "real n < numeral w \<longleftrightarrow> n < numeral w"
  for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real n < numeral w) = (n < numeral w)
[PROOF STEP]
by (metis of_nat_less_iff of_nat_numeral)


[STATEMENT]
lemma finite_primes_less [intro]: "finite {q::nat. prime q \<and> q < p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {q. prime q \<and> q < p}
[PROOF STEP]
by (rule finite_subset[of _ "{..<p}"]) auto


[STATEMENT]
lemma coprime_ord:
  fixes n::nat
  assumes "coprime n a"
  shows "ord n a > 0 \<and> [a ^(ord n a) = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a^ m \<noteq> 1] (mod n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
let ?P = "\<lambda>d. 0 < d \<and> [a ^ d = 1] (mod n)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
from bigger_prime[of a]
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. prime p \<and> a < p
[PROOF STEP]
obtain p where p: "prime p" "a < p"
[PROOF STATE]
proof (prove)
using this:
\<exists>p. prime p \<and> a < p

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; a < p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prime p
a < p

goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
coprime n a
[PROOF STEP]
have o: "ord n a = Least ?P"
[PROOF STATE]
proof (prove)
using this:
coprime n a

goal (1 subgoal):
 1. ord n a = (LEAST d. 0 < d \<and> [a ^ d = 1] (mod n))
[PROOF STEP]
by (simp add: ord_def)
[PROOF STATE]
proof (state)
this:
ord n a = (LEAST d. 0 < d \<and> [a ^ d = 1] (mod n))

goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
have ex: "\<exists>m>0. ?P m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
proof (cases "n \<ge> 2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
 2. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
2 \<le> n

goal (2 subgoals):
 1. 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
 2. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
2 \<le> n

goal (2 subgoals):
 1. 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
 2. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
coprime n a
[PROOF STEP]
have "coprime a n"
[PROOF STATE]
proof (prove)
using this:
coprime n a

goal (1 subgoal):
 1. coprime a n
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
coprime a n

goal (2 subgoals):
 1. 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
 2. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime a n
[PROOF STEP]
have "[a ^ totient n = 1] (mod n)"
[PROOF STATE]
proof (prove)
using this:
coprime a n

goal (1 subgoal):
 1. [a ^ totient n = 1] (mod n)
[PROOF STEP]
by (rule euler_theorem)
[PROOF STATE]
proof (state)
this:
[a ^ totient n = 1] (mod n)

goal (2 subgoals):
 1. 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
 2. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
2 \<le> n
[a ^ totient n = 1] (mod n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 \<le> n
[a ^ totient n = 1] (mod n)

goal (1 subgoal):
 1. \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
by (auto intro: exI [where x = "totient n"])
[PROOF STATE]
proof (state)
this:
\<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)

goal (1 subgoal):
 1. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 2 \<le> n

goal (1 subgoal):
 1. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 2 \<le> n
[PROOF STEP]
have "n = 0 \<or> n = 1"
[PROOF STATE]
proof (prove)
using this:
\<not> 2 \<le> n

goal (1 subgoal):
 1. n = 0 \<or> n = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = 0 \<or> n = 1

goal (1 subgoal):
 1. \<not> 2 \<le> n \<Longrightarrow> \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
coprime n a
n = 0 \<or> n = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coprime n a
n = 0 \<or> n = 1

goal (1 subgoal):
 1. \<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)

goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
from nat_exists_least_iff'[of ?P] ex assms
[PROOF STATE]
proof (chain)
picking this:
(\<exists>na>0. [a ^ na = 1] (mod n)) = ((0 < (LEAST d. 0 < d \<and> [a ^ d = 1] (mod n)) \<and> [a ^ (LEAST d. 0 < d \<and> [a ^ d = 1] (mod n)) = 1] (mod n)) \<and> (\<forall>m<LEAST d. 0 < d \<and> [a ^ d = 1] (mod n). \<not> (0 < m \<and> [a ^ m = 1] (mod n))))
\<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
coprime n a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>na>0. [a ^ na = 1] (mod n)) = ((0 < (LEAST d. 0 < d \<and> [a ^ d = 1] (mod n)) \<and> [a ^ (LEAST d. 0 < d \<and> [a ^ d = 1] (mod n)) = 1] (mod n)) \<and> (\<forall>m<LEAST d. 0 < d \<and> [a ^ d = 1] (mod n). \<not> (0 < m \<and> [a ^ m = 1] (mod n))))
\<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
coprime n a

goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
unfolding o[symmetric]
[PROOF STATE]
proof (prove)
using this:
(\<exists>na>0. [a ^ na = 1] (mod n)) = ((0 < ord n a \<and> [a ^ ord n a = 1] (mod n)) \<and> (\<forall>m<ord n a. \<not> (0 < m \<and> [a ^ m = 1] (mod n))))
\<exists>m>0. 0 < m \<and> [a ^ m = 1] (mod n)
coprime n a

goal (1 subgoal):
 1. 0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < ord n a \<and> [a ^ ord n a = 1] (mod n) \<and> (\<forall>m. 0 < m \<and> m < ord n a \<longrightarrow> [a ^ m \<noteq> 1] (mod n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_mult_left_iff [simp]:
   "c \<noteq> 0 \<Longrightarrow> tendsto(\<lambda>x. c * f x) (c * l) F \<longleftrightarrow> tendsto f l F" for c :: "'a::{topological_semigroup_mult,field}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> ((\<lambda>x. c * f x) \<longlongrightarrow> c * l) F = (f \<longlongrightarrow> l) F
[PROOF STEP]
by (auto simp: tendsto_mult_left dest: tendsto_mult_left [where c = "1/c"])


[STATEMENT]
lemma exact_seq_imp_triviality:
   "\<lbrakk>exact_seq ([E,D,C,B,A], [k,h,g,f]); f \<in> iso A B; k \<in> iso D E\<rbrakk> \<Longrightarrow> trivial_group C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>exact_seq ([E, D, C, B, A], [k, h, g, f]); f \<in> Group.iso A B; k \<in> Group.iso D E\<rbrakk> \<Longrightarrow> trivial_group C
[PROOF STEP]
by (metis (no_types, lifting) Group.iso_def bij_betw_def exact_seq_eq_triviality mem_Collect_eq)


[STATEMENT]
lemma has_real_derivative_polynomial_function:
  assumes "real_polynomial_function p"
    shows "\<exists>p'. real_polynomial_function p' \<and>
                 (\<forall>x. (p has_real_derivative (p' x)) (at x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (p has_real_derivative p' x) (at x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p

goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (p has_real_derivative p' x) (at x))
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>f. bounded_linear f \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x))
 2. \<And>c. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 4. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
case (linear p)
[PROOF STATE]
proof (state)
this:
bounded_linear p

goal (4 subgoals):
 1. \<And>f. bounded_linear f \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x))
 2. \<And>c. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 4. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
bounded_linear p

goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (p has_real_derivative p' x) (at x))
[PROOF STEP]
by (force simp: real_bounded_linear const intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (p has_real_derivative p' x) (at x))

goal (3 subgoals):
 1. \<And>c. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>c. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
case (const c)
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>c. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 3. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))
[PROOF STEP]
by (rule_tac x="\<lambda>x. 0" in exI) auto
[PROOF STATE]
proof (state)
this:
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. c) has_real_derivative p' x) (at x))

goal (2 subgoals):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
case (add f1 f2)
[PROOF STATE]
proof (state)
this:
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))

goal (2 subgoals):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))
[PROOF STEP]
obtain p1 p2 where
    "real_polynomial_function p1" "\<And>x. (f1 has_real_derivative p1 x) (at x)"
    "real_polynomial_function p2" "\<And>x. (f2 has_real_derivative p2 x) (at x)"
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>real_polynomial_function p1; \<And>x. (f1 has_real_derivative p1 x) (at x); real_polynomial_function p2; \<And>x. (f2 has_real_derivative p2 x) (at x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)

goal (2 subgoals):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a + g a) has_real_derivative p' x) (at x))
 2. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)

goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f1 a + f2 a) has_real_derivative p' x) (at x))
[PROOF STEP]
by (rule_tac x="\<lambda>x. p1 x + p2 x" in exI) (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f1 a + f2 a) has_real_derivative p' x) (at x))

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
case (mult f1 f2)
[PROOF STATE]
proof (state)
this:
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))
[PROOF STEP]
obtain p1 p2 where
    "real_polynomial_function p1" "\<And>x. (f1 has_real_derivative p1 x) (at x)"
    "real_polynomial_function p2" "\<And>x. (f2 has_real_derivative p2 x) (at x)"
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))

goal (1 subgoal):
 1. (\<And>p1 p2. \<lbrakk>real_polynomial_function p1; \<And>x. (f1 has_real_derivative p1 x) (at x); real_polynomial_function p2; \<And>x. (f2 has_real_derivative p2 x) (at x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)

goal (1 subgoal):
 1. \<And>f g. \<lbrakk>real_polynomial_function f; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f has_real_derivative p' x) (at x)); real_polynomial_function g; \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (g has_real_derivative p' x) (at x))\<rbrakk> \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f a * g a) has_real_derivative p' x) (at x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)

goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f1 a * f2 a) has_real_derivative p' x) (at x))
[PROOF STEP]
using mult
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p1
(f1 has_real_derivative p1 ?x) (at ?x)
real_polynomial_function p2
(f2 has_real_derivative p2 ?x) (at ?x)
real_polynomial_function f1
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f1 has_real_derivative p' x) (at x))
real_polynomial_function f2
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (f2 has_real_derivative p' x) (at x))

goal (1 subgoal):
 1. \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f1 a * f2 a) has_real_derivative p' x) (at x))
[PROOF STEP]
by (rule_tac x="\<lambda>x. f1 x * p2 x + f2 x * p1 x" in exI) (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
\<exists>p'. real_polynomial_function p' \<and> (\<forall>x. ((\<lambda>a. f1 a * f2 a) has_real_derivative p' x) (at x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_le_nat_alt: "a \<le> b \<longleftrightarrow> unat a \<le> unat b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> b) = (unat a \<le> unat b)
[PROOF STEP]
by transfer (simp add: nat_le_eq_zle)


[STATEMENT]
lemma cblinfun_of_matrix_apply:
  "cblinfun_of_matrix a x = (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. ((j \<bullet>\<^sub>C x) * a i j) *\<^sub>C i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cblinfun_apply (cblinfun_of_matrix a) x = (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * a i j) *\<^sub>C i)
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a x. (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * a i j) *\<^sub>C i) = (\<Sum>i\<in>CBasis. \<Sum>j\<in>CBasis. (j \<bullet>\<^sub>C x * a i j) *\<^sub>C i)
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_times_conv_fls_times:
  fixes   f g :: "'a::{comm_monoid_add,mult_zero} fps"
  shows   "f * g = fls_regpart (fps_to_fls f * fps_to_fls g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * g = fls_regpart (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
using   fls_subdegree_fls_to_fps_gt0 fls_times_conv_regpart[symmetric]
[PROOF STATE]
proof (prove)
using this:
0 \<le> fls_subdegree (fps_to_fls ?f)
\<lbrakk>0 \<le> fls_subdegree ?f; 0 \<le> fls_subdegree ?g\<rbrakk> \<Longrightarrow> fls_regpart ?f * fls_regpart ?g = fls_regpart (?f * ?g)

goal (1 subgoal):
 1. f * g = fls_regpart (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
by      fastforce


[STATEMENT]
lemma to_nat_plus_1_set:
shows "to_nat a + 1 \<in> {1..<CARD('a)+1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat a + 1 \<in> {1..<CARD('a) + 1}
[PROOF STEP]
using to_nat_less_card
[PROOF STATE]
proof (prove)
using this:
mod_type_class.to_nat ?j < CARD('a)

goal (1 subgoal):
 1. mod_type_class.to_nat a + 1 \<in> {1..<CARD('a) + 1}
[PROOF STEP]
by simp


[STATEMENT]
lemma integrable_weighted_\<theta>:
  assumes "2 \<le> a" "a \<le> x"
  shows   "((\<lambda>t. \<theta> t / (t * ln t ^ 2)) integrable_on {a..x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
[PROOF STEP]
proof (cases "a < x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
 2. \<not> a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a < x

goal (2 subgoals):
 1. a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
 2. \<not> a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
[PROOF STEP]
hence "((\<lambda>t. \<theta> t * (1 / (t * ln t ^ 2))) integrable_on {a..x})"
[PROOF STATE]
proof (prove)
using this:
a < x

goal (1 subgoal):
 1. (\<lambda>t. \<theta> t * (1 / (t * (ln t)\<^sup>2))) integrable_on {a..x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < x
2 \<le> a
a \<le> x

goal (1 subgoal):
 1. (\<lambda>t. \<theta> t * (1 / (t * (ln t)\<^sup>2))) integrable_on {a..x}
[PROOF STEP]
unfolding \<theta>_def prime_sum_upto_altdef1
[PROOF STATE]
proof (prove)
using this:
a < x
2 \<le> a
a \<le> x

goal (1 subgoal):
 1. (\<lambda>t. sum_upto (\<lambda>p. ind prime p * ln (real p)) t * (1 / (t * (ln t)\<^sup>2))) integrable_on {a..x}
[PROOF STEP]
by (intro partial_summation_integrable_strong[where X = "{}" and f = "\<lambda>x. -1 / ln x"])
       (auto simp flip: has_real_derivative_iff_has_vector_derivative
             intro!: derivative_eq_intros continuous_intros simp: power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. \<theta> t * (1 / (t * (ln t)\<^sup>2))) integrable_on {a..x}

goal (2 subgoals):
 1. a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
 2. \<not> a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. \<theta> t * (1 / (t * (ln t)\<^sup>2))) integrable_on {a..x}

goal (1 subgoal):
 1. (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}

goal (1 subgoal):
 1. \<not> a < x \<Longrightarrow> (\<lambda>t. \<theta> t / (t * (ln t)\<^sup>2)) integrable_on {a..x}
[PROOF STEP]
qed (insert has_integral_refl[of _ a] assms, auto simp: has_integral_iff)


[STATEMENT]
lemma sum_list_in_set: "(l::('x \<times> ('e,'a::linorder) Prio) list)\<noteq>[] \<Longrightarrow>
  sum_list (map snd l) \<in> set (map snd l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l)
[PROOF STEP]
apply (induct l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [] \<noteq> [] \<Longrightarrow> sum_list (map snd []) \<in> set (map snd [])
 2. \<And>a l. \<lbrakk>l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l); a # l \<noteq> []\<rbrakk> \<Longrightarrow> sum_list (map snd (a # l)) \<in> set (map snd (a # l))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l); a # l \<noteq> []\<rbrakk> \<Longrightarrow> sum_list (map snd (a # l)) \<in> set (map snd (a # l))
[PROOF STEP]
apply (case_tac l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a l. \<lbrakk>l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l); a # l \<noteq> []; l = []\<rbrakk> \<Longrightarrow> sum_list (map snd (a # l)) \<in> set (map snd (a # l))
 2. \<And>a l aa list. \<lbrakk>l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l); a # l \<noteq> []; l = aa # list\<rbrakk> \<Longrightarrow> sum_list (map snd (a # l)) \<in> set (map snd (a # l))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l aa list. \<lbrakk>l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l); a # l \<noteq> []; l = aa # list\<rbrakk> \<Longrightarrow> sum_list (map snd (a # l)) \<in> set (map snd (a # l))
[PROOF STEP]
using prio_selects_one
[PROOF STATE]
proof (prove)
using this:
?a + ?b = ?a \<or> ?a + ?b = ?b

goal (1 subgoal):
 1. \<And>a l aa list. \<lbrakk>l \<noteq> [] \<Longrightarrow> sum_list (map snd l) \<in> set (map snd l); a # l \<noteq> []; l = aa # list\<rbrakk> \<Longrightarrow> sum_list (map snd (a # l)) \<in> set (map snd (a # l))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b ba list. \<lbrakk>\<And>a b. a + b = a \<or> a + b = b; b + ba \<noteq> b; b + ba \<notin> snd ` set list; ba + sum_list (map snd list) = ba\<rbrakk> \<Longrightarrow> b + ba = ba
 2. \<And>b ba list a. \<lbrakk>\<And>a b. a + b = a \<or> a + b = b; b + (ba + sum_list (map snd list)) \<noteq> b; b + (ba + sum_list (map snd list)) \<notin> snd ` set list; (a, ba + sum_list (map snd list)) \<in> set list\<rbrakk> \<Longrightarrow> b + (ba + sum_list (map snd list)) = ba
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b ba list a. \<lbrakk>\<And>a b. a + b = a \<or> a + b = b; b + (ba + sum_list (map snd list)) \<noteq> b; b + (ba + sum_list (map snd list)) \<notin> snd ` set list; (a, ba + sum_list (map snd list)) \<in> set list\<rbrakk> \<Longrightarrow> b + (ba + sum_list (map snd list)) = ba
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma p2ndf_simps[simp]:
  "\<lceil>P\<rceil> \<le> \<lceil>Q\<rceil> = (\<forall>s. P s \<longrightarrow> Q s)"
  "(\<lceil>P\<rceil> = \<lceil>Q\<rceil>) = (\<forall>s. P s = Q s)"
  "(\<lceil>P\<rceil> \<cdot> \<lceil>Q\<rceil>) = \<lceil>\<lambda>s. P s \<and> Q s\<rceil>"
  "(\<lceil>P\<rceil> + \<lceil>Q\<rceil>) = \<lceil>\<lambda>s. P s \<or> Q s\<rceil>"
  "\<tt>\<tt> \<lceil>P\<rceil> = \<lceil>P\<rceil>"
  "n \<lceil>P\<rceil> = \<lceil>\<lambda>s. \<not> P s\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lceil>P\<rceil> \<le> \<lceil>Q\<rceil>) = (\<forall>s. P s \<longrightarrow> Q s) &&& (\<lceil>P\<rceil> = \<lceil>Q\<rceil>) = (\<forall>s. P s = Q s) &&& \<lceil>P\<rceil> \<cdot> \<lceil>Q\<rceil> = \<lceil>\<lambda>s. P s \<and> Q s\<rceil>) &&& \<lceil>P\<rceil> + \<lceil>Q\<rceil> = \<lceil>\<lambda>s. P s \<or> Q s\<rceil> &&& \<tt>\<tt> \<lceil>P\<rceil> = \<lceil>P\<rceil> &&& !\<lceil>P\<rceil> = \<lceil>\<lambda>s. \<not> P s\<rceil>
[PROOF STEP]
unfolding p2ndf_def one_nd_fun_def less_eq_nd_fun_def times_nd_fun_def plus_nd_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (id (\<lambda>f g. f\<^sub>\<bullet> \<le> g\<^sub>\<bullet>) ((\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet>) ((\<lambda>x. {s. s = x \<and> Q s})\<^sup>\<bullet>) = (\<forall>s. P s \<longrightarrow> Q s) &&& ((\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet> = (\<lambda>x. {s. s = x \<and> Q s})\<^sup>\<bullet>) = (\<forall>s. P s = Q s) &&& id (\<lambda>f g. (f\<^sub>\<bullet> \<circ>\<^sub>K g\<^sub>\<bullet>)\<^sup>\<bullet>) ((\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet>) ((\<lambda>x. {s. s = x \<and> Q s})\<^sup>\<bullet>) = (\<lambda>x. {s. s = x \<and> P s \<and> Q s})\<^sup>\<bullet>) &&& (((\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet>)\<^sub>\<bullet> \<squnion> ((\<lambda>x. {s. s = x \<and> Q s})\<^sup>\<bullet>)\<^sub>\<bullet>)\<^sup>\<bullet> = (\<lambda>x. {s. s = x \<and> (P s \<or> Q s)})\<^sup>\<bullet> &&& \<tt>\<tt> ((\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet>) = (\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet> &&& !((\<lambda>x. {s. s = x \<and> P s})\<^sup>\<bullet>) = (\<lambda>x. {s. s = x \<and> \<not> P s})\<^sup>\<bullet>
[PROOF STEP]
by (auto simp: nd_fun_eq_iff kcomp_def le_fun_def n_op_nd_fun_def)


[STATEMENT]
theorem Goedel_I: "\<exists>\<phi>. \<not> {} \<turnstile> \<phi> \<and> \<not> {} \<turnstile> Neg \<phi> \<and> eval_fm e0 \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. \<not> {} \<turnstile> \<phi> \<and> \<not> {} \<turnstile> Neg \<phi> \<and> eval_fm e0 \<phi>
[PROOF STEP]
by (meson Iff_MP2_same g1.recover_proofs.goedel_first_classic_strong[OF consistent] neg_Neg)


[STATEMENT]
lemma d_delta_arctan_upper_34:
  "((\<lambda>x. arctan_upper_34 x - arctan x) has_field_derivative diff_delta_arctan_upper_34 x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arctan_upper_34 x - arctan x) has_real_derivative diff_delta_arctan_upper_34 x) (at x)
[PROOF STEP]
unfolding arctan_upper_34_def diff_delta_arctan_upper_34_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. pi / 2 - (33 + 170 * x\<^sup>2 + 165 * x ^ 4) * 7 * x / (5 * (5 + 105 * x\<^sup>2 + 315 * x ^ 4 + 231 * x ^ 6)) - arctan x) has_real_derivative - 256 / ((5 + 105 * x\<^sup>2 + 315 * x ^ 4 + 231 * x ^ 6)\<^sup>2 * (1 + x\<^sup>2))) (at x)
[PROOF STEP]
apply (intro derivative_eq_intros | simp add: add_nonneg_eq_0_iff)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ((((2380 * x + 4620 * x ^ 3) * x + (231 + 1190 * x\<^sup>2 + 1155 * x ^ 4)) * (25 + 525 * x\<^sup>2 + 1575 * x ^ 4 + 1155 * x ^ 6) - (231 + 1190 * x\<^sup>2 + 1155 * x ^ 4) * x * (1050 * x + 6300 * x ^ 3 + 6930 * x ^ 5)) / ((25 + 525 * x\<^sup>2 + 1575 * x ^ 4 + 1155 * x ^ 6) * (25 + 525 * x\<^sup>2 + 1575 * x ^ 4 + 1155 * x ^ 6))) - inverse (1 + x\<^sup>2) = - (256 / ((5 + 105 * x\<^sup>2 + 315 * x ^ 4 + 231 * x ^ 6)\<^sup>2 * (1 + x\<^sup>2)))
[PROOF STEP]
apply (simp add: divide_simps add_nonneg_eq_0_iff, algebra)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done