[STATEMENT]
theorem theorem_3_10_Erdos_Straus:
  fixes a::"nat \<Rightarrow> int"
  assumes a_pos:"\<forall> n. a n >0" and "mono a"
    and nth_1:"(\<lambda>n. nth_prime n / (a n)^2) \<longlonglongrightarrow> 0"
    and nth_2:"liminf (\<lambda>n. a n / nth_prime n) = 0"
  shows "(\<Sum>n. (nth_prime n / (\<Prod>i \<le> n. a i))) \<notin> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<notin> \<rat>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
assume asm:"(\<Sum>n. (nth_prime n / (\<Prod>i \<le> n. a i))) \<in> \<rat>"
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat>

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a2_omega:"(\<lambda>n. (a n)^2) \<in> \<omega>(\<lambda>x. x * ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
have "(\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))
[PROOF STEP]
apply (rule smalloI_tendsto[OF nth_1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. real_of_int ((a x)\<^sup>2) \<noteq> 0
[PROOF STEP]
using a_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. real_of_int ((a x)\<^sup>2) \<noteq> 0
[PROOF STEP]
by (metis (mono_tags, lifting) less_int_code(1)
          not_eventuallyD of_int_0_eq_iff zero_eq_power2)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))

goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))

goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
have "(\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
using nth_prime_bigtheta
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. real (nth_prime x)) \<in> \<Theta>(\<lambda>x. real x * ln (real x))

goal (1 subgoal):
 1. (\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))

goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))
(\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))
(\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))

goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
using landau_omega.small_big_trans smallo_imp_smallomega
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (nth_prime n)) \<in> o(\<lambda>n. real_of_int ((a n)\<^sup>2))
(\<lambda>x. real (nth_prime x)) \<in> \<Omega>(\<lambda>x. real x * ln (real x))
\<lbrakk>?f \<in> \<omega>[?F](?g); ?g \<in> \<Omega>[?F](?h)\<rbrakk> \<Longrightarrow> ?f \<in> \<omega>[?F](?h)
?f \<in> o[?F](?g) \<Longrightarrow> ?g \<in> \<omega>[?F](?f)

goal (1 subgoal):
 1. (\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real_of_int ((a x)\<^sup>2)) \<in> \<omega>(\<lambda>x. real x * ln (real x))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_gt_1:"\<forall>\<^sub>F n in sequentially. 1 < a n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a n
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. \<bar>x * ln x\<bar> \<le> (a x)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real x * ln (real x)\<bar> \<le> real_of_int ((a x)\<^sup>2)
[PROOF STEP]
using a2_omega[unfolded smallomega_def,simplified,rule_format,of 1]
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. 1 * \<bar>real x * ln (real x)\<bar> \<le> (real_of_int (a x))\<^sup>2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real x * ln (real x)\<bar> \<le> real_of_int ((a x)\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real x * ln (real x)\<bar> \<le> real_of_int ((a x)\<^sup>2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. \<bar>real x * ln (real x)\<bar> \<le> real_of_int ((a x)\<^sup>2)
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. \<bar>(x+3) * ln (x+3)\<bar> \<le> (a (x+3))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real x * ln (real x)\<bar> \<le> real_of_int ((a x)\<^sup>2)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)
[PROOF STEP]
apply (subst (asm) eventually_sequentially_seg[symmetric, of _ 3])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<bar>real (n + 3) * ln (real (n + 3))\<bar> \<le> real_of_int ((a (n + 3))\<^sup>2) \<Longrightarrow> \<forall>\<^sub>F x in sequentially. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. 1 < a ( n+3)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a (n + 3)
[PROOF STEP]
proof (elim eventually_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2) \<Longrightarrow> 1 < a (x + 3)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2) \<Longrightarrow> 1 < a (x + 3)
[PROOF STEP]
assume "\<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)"
[PROOF STATE]
proof (state)
this:
\<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)

goal (1 subgoal):
 1. \<And>x. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2) \<Longrightarrow> 1 < a (x + 3)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)

goal (1 subgoal):
 1. \<And>x. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2) \<Longrightarrow> 1 < a (x + 3)
[PROOF STEP]
have "\<bar>real (x + 3) * ln (real (x + 3))\<bar> > 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
have "ln (real (x + 3)) > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < ln (real (x + 3))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < ln (real x + 3)
[PROOF STEP]
using ln3_gt_1 ln_gt_1
[PROOF STATE]
proof (prove)
using this:
1 < ln 3
3 < ?x \<Longrightarrow> 1 < ln ?x

goal (1 subgoal):
 1. 1 < ln (real x + 3)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
1 < ln (real (x + 3))

goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 < ln (real (x + 3))

goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
have "real(x+3) \<ge> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> real (x + 3)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
3 \<le> real (x + 3)

goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 < ln (real (x + 3))
3 \<le> real (x + 3)
[PROOF STEP]
have "(x+3)*ln (real (x + 3)) > 3*1 "
[PROOF STATE]
proof (prove)
using this:
1 < ln (real (x + 3))
3 \<le> real (x + 3)

goal (1 subgoal):
 1. 3 * 1 < real (x + 3) * ln (real (x + 3))
[PROOF STEP]
apply (rule_tac mult_le_less_imp_less)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>1 < ln (real (x + 3)); 3 \<le> real (x + 3)\<rbrakk> \<Longrightarrow> 3 \<le> real (x + 3)
 2. \<lbrakk>1 < ln (real (x + 3)); 3 \<le> real (x + 3)\<rbrakk> \<Longrightarrow> 1 < ln (real (x + 3))
 3. \<lbrakk>1 < ln (real (x + 3)); 3 \<le> real (x + 3)\<rbrakk> \<Longrightarrow> 0 < 3
 4. \<lbrakk>1 < ln (real (x + 3)); 3 \<le> real (x + 3)\<rbrakk> \<Longrightarrow> 0 \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 * 1 < real (x + 3) * ln (real (x + 3))

goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 * 1 < real (x + 3) * ln (real (x + 3))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
3 * 1 < real (x + 3) * ln (real (x + 3))

goal (1 subgoal):
 1. 3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>

goal (1 subgoal):
 1. \<And>x. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2) \<Longrightarrow> 1 < a (x + 3)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)
3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>
[PROOF STEP]
have "real_of_int ((a (x + 3))\<^sup>2) > 3"
[PROOF STATE]
proof (prove)
using this:
\<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2)
3 < \<bar>real (x + 3) * ln (real (x + 3))\<bar>

goal (1 subgoal):
 1. 3 < real_of_int ((a (x + 3))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
3 < real_of_int ((a (x + 3))\<^sup>2)

goal (1 subgoal):
 1. \<And>x. \<bar>real (x + 3) * ln (real (x + 3))\<bar> \<le> real_of_int ((a (x + 3))\<^sup>2) \<Longrightarrow> 1 < a (x + 3)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 < real_of_int ((a (x + 3))\<^sup>2)
[PROOF STEP]
show "1 < a (x + 3)"
[PROOF STATE]
proof (prove)
using this:
3 < real_of_int ((a (x + 3))\<^sup>2)

goal (1 subgoal):
 1. 1 < a (x + 3)
[PROOF STEP]
by (smt Suc3_eq_add_3 a_pos add.commute of_int_1 one_power2)
[PROOF STATE]
proof (state)
this:
1 < a (x + 3)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < a (n + 3)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 1 < a (n + 3)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 1 < a (n + 3)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a n
[PROOF STEP]
apply (subst eventually_sequentially_seg[symmetric, of _ 3])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < a (n + 3) \<Longrightarrow> \<forall>\<^sub>F n in sequentially. 1 < a (n + 3)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < a n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < a n

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
obtain B::int and c where
    "B>0" and Bc_large:"\<forall>\<^sub>F n in sequentially. B * nth_prime n
                = c n * a n - c (n + 1) \<and> \<bar>c (n + 1)\<bar> <  a n / 2"
    and ca_vanish: "(\<lambda>n. c (Suc n) / real_of_int (a n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
note a_gt_1
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < a n

goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < a n

goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar>
                    / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
define f where "f=(\<lambda>n. nth_prime (n+1) / (a n * a (n+1)))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>n. real (nth_prime (n + 1)) / real_of_int (a n * a (n + 1)))

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
define g where "g=(\<lambda>n. 2*nth_prime n / (a n)^2)"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>n. real (2 * nth_prime n) / real_of_int ((a n)\<^sup>2))

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. nth_prime (n+1) < 2*nth_prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n
[PROOF STEP]
using ratio_of_consecutive_primes[unfolded tendsto_iff
              ,rule_format,of 1,simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. dist (real (nth_prime (Suc x)) / real (nth_prime x)) 1 < 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n
[PROOF STEP]
apply (elim eventually_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. dist (real (nth_prime (Suc x)) / real (nth_prime x)) 1 < 1 \<Longrightarrow> nth_prime (x + 1) < 2 * nth_prime x
[PROOF STEP]
by (auto simp :divide_simps dist_norm)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. real_of_int (a n * a (n+1))
                           \<ge> (a n)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int ((a n)\<^sup>2) \<le> real_of_int (a n * a (n + 1))
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))
[PROOF STEP]
using \<open>mono a\<close>
[PROOF STATE]
proof (prove)
using this:
incseq a

goal (1 subgoal):
 1. \<And>x. real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))
[PROOF STEP]
by (auto simp:power2_eq_square a_pos incseq_SucD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int ((a n)\<^sup>2) \<le> real_of_int (a n * a (n + 1))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n
\<forall>\<^sub>F n in sequentially. real_of_int ((a n)\<^sup>2) \<le> real_of_int (a n * a (n + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n
\<forall>\<^sub>F n in sequentially. real_of_int ((a n)\<^sup>2) \<le> real_of_int (a n * a (n + 1))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. nth_prime (n + 1) < 2 * nth_prime n
\<forall>\<^sub>F n in sequentially. real_of_int ((a n)\<^sup>2) \<le> real_of_int (a n * a (n + 1))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (real (nth_prime (x + 1)) / real_of_int (a x * a (x + 1))) \<le> real (2 * nth_prime x) / real_of_int ((a x)\<^sup>2)
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> norm (real (nth_prime (x + 1)) / real_of_int (a x * a (x + 1))) \<le> real (2 * nth_prime x) / real_of_int ((a x)\<^sup>2)
[PROOF STEP]
apply (subst norm_divide)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> norm (real (nth_prime (x + 1))) / norm (real_of_int (a x * a (x + 1))) \<le> real (2 * nth_prime x) / real_of_int ((a x)\<^sup>2)
[PROOF STEP]
apply (rule_tac linordered_field_class.frac_le)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> 0 \<le> real (2 * nth_prime x)
 2. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> norm (real (nth_prime (x + 1))) \<le> real (2 * nth_prime x)
 3. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> 0 < real_of_int ((a x)\<^sup>2)
 4. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> real_of_int ((a x)\<^sup>2) \<le> norm (real_of_int (a x * a (x + 1)))
[PROOF STEP]
using a_pos[rule_format, THEN order.strict_implies_not_eq ]
[PROOF STATE]
proof (prove)
using this:
0 \<noteq> a ?n1

goal (4 subgoals):
 1. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> 0 \<le> real (2 * nth_prime x)
 2. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> norm (real (nth_prime (x + 1))) \<le> real (2 * nth_prime x)
 3. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> 0 < real_of_int ((a x)\<^sup>2)
 4. \<And>x. \<lbrakk>nth_prime (x + 1) < 2 * nth_prime x; real_of_int ((a x)\<^sup>2) \<le> real_of_int (a x * a (x + 1))\<rbrakk> \<Longrightarrow> real_of_int ((a x)\<^sup>2) \<le> norm (real_of_int (a x * a (x + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "g \<longlonglongrightarrow> 0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<longlonglongrightarrow> 0
[PROOF STEP]
using nth_1[THEN tendsto_mult_right_zero,of 2]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. 2 * (real (nth_prime x) / real_of_int ((a x)\<^sup>2))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. g \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. 2 * (real (nth_prime x) / real_of_int ((a x)\<^sup>2))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real (2 * nth_prime n) / real_of_int ((a n)\<^sup>2)) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
g \<longlonglongrightarrow> 0
[PROOF STEP]
have "f \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
g \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. f \<longlonglongrightarrow> 0
[PROOF STEP]
using Lim_null_comparison[of f g sequentially]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x
g \<longlonglongrightarrow> 0
\<lbrakk>\<forall>\<^sub>F x in sequentially. norm (f x) \<le> g x; g \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> f \<longlonglongrightarrow> 0

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

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real (nth_prime (n + 1)) / real_of_int (a n * a (n + 1))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (rule_tac LIMSEQ_imp_Suc) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "(\<Sum>n. real_of_int (int (nth_prime n))
                    / real_of_int (prod a {..n})) \<in> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>
[PROOF STEP]
using asm
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat>

goal (1 subgoal):
 1. (\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>

goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 1 < a n
(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
(\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>
[PROOF STEP]
have "\<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially.
              B * int (nth_prime n) = c n * a n - c (n + 1) \<and>
              real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and>
          (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 1 < a n
(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
(\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>

goal (1 subgoal):
 1. \<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
using ab_rationality_imp[OF a_pos,of nth_prime]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 1 < a n
(\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0
(\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>
\<lbrakk>\<forall>\<^sub>F n in sequentially. 1 < a n; (\<lambda>n. real_of_int \<bar>int (nth_prime n)\<bar> / real_of_int (a (n - 1) * a n)) \<longlonglongrightarrow> 0; (\<Sum>n. real_of_int (int (nth_prime n)) / real_of_int (prod a {..n})) \<in> \<rat>\<rbrakk> \<Longrightarrow> \<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. thesis
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
apply (rule_tac c=c and B=B in that)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> 0 < B
 2. \<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
 3. \<And>B c. \<lbrakk>0 < B; \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < B
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have bac_close:"(\<lambda>n. B * nth_prime n / a n - c n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. B * nth_prime n - c n * a n + c (n + 1) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) - c n * a n + c (n + 1) = 0
[PROOF STEP]
using Bc_large
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) - c n * a n + c (n + 1) = 0
[PROOF STEP]
by (auto elim!:eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) - c n * a n + c (n + 1) = 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) - c n * a n + c (n + 1) = 0
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. (B * nth_prime n - c n * a n + c (n+1)) / a n = 0 "
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) - c n * a n + c (n + 1) = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n) - c n * a n + c (n + 1)) / real_of_int (a n) = 0
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n) - c n * a n + c (n + 1)) / real_of_int (a n) = 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n) - c n * a n + c (n + 1)) / real_of_int (a n) = 0
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. B * nth_prime n / a n - c n  + c (n + 1) / a n = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n) - c n * a n + c (n + 1)) / real_of_int (a n) = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n) = 0
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. real_of_int (B * int (nth_prime n) - c n * a n + c (n + 1)) / real_of_int (a n) = 0 \<Longrightarrow> real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n) = 0
[PROOF STEP]
using a_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n

goal (1 subgoal):
 1. \<And>n. real_of_int (B * int (nth_prime n) - c n * a n + c (n + 1)) / real_of_int (a n) = 0 \<Longrightarrow> real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n) = 0
[PROOF STEP]
by (auto simp:divide_simps) (metis less_irrefl)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n) = 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n) = 0
[PROOF STEP]
have "(\<lambda>n. B * nth_prime n / a n - c n  + c (n + 1) / a n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n) = 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: eventually_mono tendsto_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n) + real_of_int (c (n + 1)) / real_of_int (a n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
from tendsto_diff[OF this ca_vanish]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. real_of_int (B * int (nth_prime x)) / real_of_int (a x) - real_of_int (c x) + real_of_int (c (x + 1)) / real_of_int (a x) - real_of_int (c (Suc x)) / real_of_int (a x)) \<longlonglongrightarrow> 0 - 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. real_of_int (B * int (nth_prime x)) / real_of_int (a x) - real_of_int (c x) + real_of_int (c (x + 1)) / real_of_int (a x) - real_of_int (c (Suc x)) / real_of_int (a x)) \<longlonglongrightarrow> 0 - 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have c_pos:"\<forall>\<^sub>F n in sequentially. c n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n
[PROOF STEP]
from bac_close
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have *:"\<forall>\<^sub>F n in sequentially. c n \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> c n
[PROOF STEP]
apply (elim tendsto_of_int_diff_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < real_of_int (B * int (nth_prime n)) / real_of_int (a n)
[PROOF STEP]
using a_gt_1
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 1 < a n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < real_of_int (B * int (nth_prime n)) / real_of_int (a n)
[PROOF STEP]
apply (eventually_elim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 1 < a n \<Longrightarrow> 0 < real_of_int (B * int (nth_prime n)) / real_of_int (a n)
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < B

goal (1 subgoal):
 1. \<And>n. 1 < a n \<Longrightarrow> 0 < real_of_int (B * int (nth_prime n)) / real_of_int (a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 \<le> c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>\<^sub>F n in sequentially. c n > 0)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>\<^sub>F n in sequentially. 0 < c n)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>\<^sub>F n in sequentially. 0 < c n)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. c (Suc n) \<ge> 0 \<and> c n\<ge>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> c (Suc n) \<and> 0 \<le> c n
[PROOF STEP]
using * eventually_sequentially_Suc[of "\<lambda>n. c n\<ge>0"]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 \<le> c n
(\<forall>\<^sub>F i in sequentially. 0 \<le> c (Suc i)) = (\<forall>\<^sub>F n in sequentially. 0 \<le> c n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> c (Suc n) \<and> 0 \<le> c n
[PROOF STEP]
by (metis (mono_tags, lifting) eventually_at_top_linorder le_Suc_eq)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 \<le> c (Suc n) \<and> 0 \<le> c n

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>\<^sub>F n in sequentially. 0 < c n)
\<forall>\<^sub>F n in sequentially. 0 \<le> c (Suc n) \<and> 0 \<le> c n
[PROOF STEP]
have "\<exists>\<^sub>F n in sequentially. c n = 0 \<and> c (Suc n) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>\<^sub>F n in sequentially. 0 < c n)
\<forall>\<^sub>F n in sequentially. 0 \<le> c (Suc n) \<and> 0 \<le> c n

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)
[PROOF STEP]
using eventually_elim2 frequently_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>\<^sub>F n in sequentially. 0 < c n)
\<forall>\<^sub>F n in sequentially. 0 \<le> c (Suc n) \<and> 0 \<le> c n
\<lbrakk>eventually ?P ?F; eventually ?Q ?F; \<And>i. \<lbrakk>?P i; ?Q i\<rbrakk> \<Longrightarrow> ?R i\<rbrakk> \<Longrightarrow> eventually ?R ?F
frequently ?P ?F = (\<not> (\<forall>\<^sub>F x in ?F. \<not> ?P x))

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. nth_prime n > 0
                        \<and> B * nth_prime n = c n * a n - c (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < nth_prime n \<and> B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
using Bc_large
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < nth_prime n \<and> B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < nth_prime n \<and> B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < nth_prime n \<and> B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
have "\<exists>\<^sub>F n in sequentially. c n = 0 \<and> c (Suc n) \<ge> 0
          \<and> B * nth_prime n = c n * a n - c (n + 1)"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < nth_prime n \<and> B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n) \<and> B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
using frequently_eventually_frequently
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < nth_prime n \<and> B * int (nth_prime n) = c n * a n - c (n + 1)
\<lbrakk>frequently ?P ?F; eventually ?Q ?F\<rbrakk> \<Longrightarrow> \<exists>\<^sub>F x in ?F. ?P x \<and> ?Q x

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n) \<and> B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F n in sequentially. c n = 0 \<and> 0 \<le> c (Suc n) \<and> B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
from frequently_ex[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. c x = 0 \<and> 0 \<le> c (Suc x) \<and> B * int (nth_prime x) = c x * a x - c (x + 1)
[PROOF STEP]
obtain n where "c n = 0" "c (Suc n) \<ge> 0"
        "B * nth_prime n = c n * a n - c (n + 1)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. c x = 0 \<and> 0 \<le> c (Suc x) \<and> B * int (nth_prime x) = c x * a x - c (x + 1)

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>c n = 0; 0 \<le> c (Suc n); B * int (nth_prime n) = c n * a n - c (n + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c n = 0
0 \<le> c (Suc n)
B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c n = 0
0 \<le> c (Suc n)
B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
have "B * nth_prime n \<le> 0"
[PROOF STATE]
proof (prove)
using this:
c n = 0
0 \<le> c (Suc n)
B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. B * int (nth_prime n) \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B * int (nth_prime n) \<le> 0

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. 0 < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B * int (nth_prime n) \<le> 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) \<le> 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>B > 0\<close>
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) \<le> 0
0 < B

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c n

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have B_nth_prime:"\<forall>\<^sub>F n in sequentially. nth_prime n > B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B < int (nth_prime n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B < int (nth_prime n)
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. B+1 \<le> nth_prime x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. B + 1 \<le> int (nth_prime x)
[PROOF STEP]
using nth_prime_at_top[unfolded filterlim_at_top_ge[where c="nat B+1"]
          ,rule_format,of "nat B + 1",simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. Suc (nat B) \<le> nth_prime x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. B + 1 \<le> int (nth_prime x)
[PROOF STEP]
apply (elim eventually_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Suc (nat B) \<le> nth_prime x \<Longrightarrow> B + 1 \<le> int (nth_prime x)
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < B

goal (1 subgoal):
 1. \<And>x. Suc (nat B) \<le> nth_prime x \<Longrightarrow> B + 1 \<le> int (nth_prime x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. B + 1 \<le> int (nth_prime x)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B < int (nth_prime n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. B + 1 \<le> int (nth_prime x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. B + 1 \<le> int (nth_prime x)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B < int (nth_prime n)
[PROOF STEP]
by (auto elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B < int (nth_prime n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B < int (nth_prime n)

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have bc_epsilon:"\<forall>\<^sub>F n in sequentially. nth_prime (n+1)
            / nth_prime n >  (c (n+1) - \<epsilon>) / c n" when "\<epsilon>>0" "\<epsilon><1" for \<epsilon>::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. \<bar>c (Suc x) / a x\<bar> < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2
[PROOF STEP]
using ca_vanish[unfolded tendsto_iff,rule_format, of "\<epsilon>/2"] \<open>\<epsilon>>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon> / 2 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (real_of_int (c (Suc x)) / real_of_int (a x)) 0 < \<epsilon> / 2
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. \<bar>c (x+2) / a (x+1)\<bar> < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2
[PROOF STEP]
apply (subst (asm) eventually_sequentially_Suc[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. \<bar>real_of_int (c (Suc (Suc i))) / real_of_int (a (Suc i))\<bar> < \<epsilon> / 2 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. B * nth_prime (n+1) = c (n+1) * a (n+1) - c (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
[PROOF STEP]
using Bc_large
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
[PROOF STEP]
apply (subst (asm) eventually_sequentially_Suc[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. B * int (nth_prime (Suc i)) = c (Suc i) * a (Suc i) - c (Suc i + 1) \<and> \<bar>real_of_int (c (Suc i + 1))\<bar> < real_of_int (a (Suc i)) / 2 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
[PROOF STEP]
by (auto elim:eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. c n > 0 \<and> c (n+1) > 0 \<and> c (n+2) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
[PROOF STEP]
using c_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
[PROOF STEP]
by (subst eventually_sequentially_Suc) simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))
[PROOF STEP]
using c_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))
[PROOF STEP]
by (subst eventually_sequentially_Suc) simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
using c_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < c (Suc (Suc n))
\<forall>\<^sub>F n in sequentially. 0 < c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
using Bc_large
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon> / 2
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (x + 2)) / real_of_int (a (x + 1))\<bar> < \<epsilon> / 2
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2
\<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
define \<epsilon>\<^sub>0 \<epsilon>\<^sub>1 where "\<epsilon>\<^sub>0 = c (n+1) / a n" and "\<epsilon>\<^sub>1 = c (n+2) / a (n+1)"
[PROOF STATE]
proof (state)
this:
\<epsilon>\<^sub>0 = real_of_int (c (n + 1)) / real_of_int (a n)
\<epsilon>\<^sub>1 = real_of_int (c (n + 2)) / real_of_int (a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "\<epsilon>\<^sub>0 > 0" "\<epsilon>\<^sub>1 > 0" "\<epsilon>\<^sub>0 < \<epsilon>/2" "\<epsilon>\<^sub>1 < \<epsilon>/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < \<epsilon>\<^sub>0 &&& 0 < \<epsilon>\<^sub>1) &&& \<epsilon>\<^sub>0 < \<epsilon> / 2 &&& \<epsilon>\<^sub>1 < \<epsilon> / 2
[PROOF STEP]
using a_pos elim \<open>mono a\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2
\<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
incseq a

goal (1 subgoal):
 1. (0 < \<epsilon>\<^sub>0 &&& 0 < \<epsilon>\<^sub>1) &&& \<epsilon>\<^sub>0 < \<epsilon> / 2 &&& \<epsilon>\<^sub>1 < \<epsilon> / 2
[PROOF STEP]
by (auto simp add: \<epsilon>\<^sub>0_def \<epsilon>\<^sub>1_def abs_of_pos)
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>\<^sub>0
0 < \<epsilon>\<^sub>1
\<epsilon>\<^sub>0 < \<epsilon> / 2
\<epsilon>\<^sub>1 < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "(\<epsilon> - \<epsilon>\<^sub>1) * c n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)
[PROOF STEP]
using \<open>\<epsilon>\<^sub>1 > 0\<close> \<open>\<epsilon>\<^sub>1 < \<epsilon>/2\<close> \<open>\<epsilon>>0\<close> elim
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>\<^sub>1
\<epsilon>\<^sub>1 < \<epsilon> / 2
0 < \<epsilon>
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2
\<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. 0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "\<epsilon>\<^sub>0 * (c (n+1) - \<epsilon>) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)
[PROOF STEP]
using \<open>\<epsilon>\<^sub>0 > 0\<close> elim(4) that(2)
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>\<^sub>0
0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
\<epsilon> < 1

goal (1 subgoal):
 1. 0 < \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)
0 < \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)
[PROOF STEP]
have "(\<epsilon> - \<epsilon>\<^sub>1) * c n + \<epsilon>\<^sub>0 * (c (n+1) - \<epsilon>) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)
0 < \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)

goal (1 subgoal):
 1. 0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n) + \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n) + \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n) + \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "c n - \<epsilon>\<^sub>0 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < real_of_int (c n) - \<epsilon>\<^sub>0
[PROOF STEP]
using \<open>\<epsilon>\<^sub>0 < \<epsilon> / 2\<close> elim(4) that(2)
[PROOF STATE]
proof (prove)
using this:
\<epsilon>\<^sub>0 < \<epsilon> / 2
0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
\<epsilon> < 1

goal (1 subgoal):
 1. 0 < real_of_int (c n) - \<epsilon>\<^sub>0
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < real_of_int (c n) - \<epsilon>\<^sub>0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < real_of_int (c n) - \<epsilon>\<^sub>0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "c n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c n
[PROOF STEP]
by (simp add: elim(4))
[PROOF STATE]
proof (state)
this:
0 < c n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n) + \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)
0 < real_of_int (c n) - \<epsilon>\<^sub>0
0 < c n
[PROOF STEP]
have "(c (n+1) - \<epsilon>) / c n < (c (n+1) - \<epsilon>\<^sub>1) / (c n -  \<epsilon>\<^sub>0)"
[PROOF STATE]
proof (prove)
using this:
0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n) + \<epsilon>\<^sub>0 * (real_of_int (c (n + 1)) - \<epsilon>)
0 < real_of_int (c n) - \<epsilon>\<^sub>0
0 < c n

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "... \<le> (c (n+1) - \<epsilon>\<^sub>1) / (c n -  \<epsilon>\<^sub>0) * (a (n+1) / a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))
[PROOF STEP]
have "(c (n+1) - \<epsilon>\<^sub>1) / (c n -  \<epsilon>\<^sub>0) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)
[PROOF STEP]
by (smt \<open>0 < (\<epsilon> - \<epsilon>\<^sub>1) * real_of_int (c n)\<close> \<open>0 < real_of_int (c n) - \<epsilon>\<^sub>0\<close>
              divide_pos_pos elim(4) mult_le_0_iff of_int_less_1_iff that(2))
[PROOF STATE]
proof (state)
this:
0 < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))
[PROOF STEP]
have "(a (n+1) / a n) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> real_of_int (a (n + 1)) / real_of_int (a n)
[PROOF STEP]
using a_pos \<open>mono a\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n
incseq a

goal (1 subgoal):
 1. 1 \<le> real_of_int (a (n + 1)) / real_of_int (a n)
[PROOF STEP]
by (simp add: mono_def)
[PROOF STATE]
proof (state)
this:
1 \<le> real_of_int (a (n + 1)) / real_of_int (a n)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)
1 \<le> real_of_int (a (n + 1)) / real_of_int (a n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0)
1 \<le> real_of_int (a (n + 1)) / real_of_int (a n)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))
[PROOF STEP]
by (metis mult_cancel_left1 mult_le_cancel_iff2)
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) \<le> (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "... = (B * nth_prime (n+1)) / (B * nth_prime n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
have "B * nth_prime n = c n * a n - c (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2
\<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
have "... = a n * (c n - \<epsilon>\<^sub>0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c n * a n - c (n + 1)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)
[PROOF STEP]
using a_pos[rule_format,of n]
[PROOF STATE]
proof (prove)
using this:
0 < a n

goal (1 subgoal):
 1. real_of_int (c n * a n - c (n + 1)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)
[PROOF STEP]
unfolding \<epsilon>\<^sub>0_def
[PROOF STATE]
proof (prove)
using this:
0 < a n

goal (1 subgoal):
 1. real_of_int (c n * a n - c (n + 1)) = real_of_int (a n) * (real_of_int (c n) - real_of_int (c (n + 1)) / real_of_int (a n))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (c n * a n - c (n + 1)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)
[PROOF STEP]
have "B * nth_prime n = a n * (c n - \<epsilon>\<^sub>0)"
[PROOF STATE]
proof (prove)
using this:
real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
have "B * nth_prime (n+1) = a (n+1) * (c (n+1) - \<epsilon>\<^sub>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime (n + 1))) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1)
[PROOF STEP]
unfolding \<epsilon>\<^sub>1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime (n + 1))) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - real_of_int (c (n + 2)) / real_of_int (a (n + 1)))
[PROOF STEP]
using a_pos[rule_format,of "n+1"]
[PROOF STATE]
proof (prove)
using this:
0 < a (n + 1)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime (n + 1))) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - real_of_int (c (n + 2)) / real_of_int (a (n + 1)))
[PROOF STEP]
apply (subst \<open>B * nth_prime (n + 1) = c (n + 1) * a (n + 1) - c (n + 2)\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a (n + 1) \<Longrightarrow> real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - real_of_int (c (n + 2)) / real_of_int (a (n + 1)))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime (n + 1))) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)
real_of_int (B * int (nth_prime (n + 1))) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int (B * int (nth_prime n)) = real_of_int (a n) * (real_of_int (c n) - \<epsilon>\<^sub>0)
real_of_int (B * int (nth_prime (n + 1))) = real_of_int (a (n + 1)) * (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))
[PROOF STEP]
by (simp add: mult.commute)
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>\<^sub>1) / (real_of_int (c n) - \<epsilon>\<^sub>0) * (real_of_int (a (n + 1)) / real_of_int (a n)) = real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
have "... = nth_prime (n+1) / nth_prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n)) = real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < B

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n)) = real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime (n + 1))) / real_of_int (B * int (nth_prime n)) = real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon> / 2; \<bar>real_of_int (c (n + 2)) / real_of_int (a (n + 1))\<bar> < \<epsilon> / 2; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); 0 < c n \<and> 0 < c (n + 1) \<and> 0 < c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?\<epsilon>; ?\<epsilon> < 1\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - ?\<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have c_ubound:"\<forall>x. \<exists>n. c n > x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<exists>n. x < c n
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
assume " \<not> (\<forall>x. \<exists>n. x < c n)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>x. \<exists>n. x < c n)

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>x. \<exists>n. x < c n)
[PROOF STEP]
obtain ub where "\<forall>n. c n \<le> ub" "ub > 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x. \<exists>n. x < c n)

goal (1 subgoal):
 1. (\<And>ub. \<lbrakk>\<forall>n. c n \<le> ub; 0 < ub\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson dual_order.trans int_one_le_iff_zero_less le_cases not_le)
[PROOF STATE]
proof (state)
this:
\<forall>n. c n \<le> ub
0 < ub

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
define pa where "pa = (\<lambda>n. nth_prime n / a n)"
[PROOF STATE]
proof (state)
this:
pa = (\<lambda>n. real (nth_prime n) / real_of_int (a n))

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
have pa_pos:"\<And>n. pa n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < pa n
[PROOF STEP]
unfolding pa_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < real (nth_prime n) / real_of_int (a n)
[PROOF STEP]
by (simp add: a_pos)
[PROOF STATE]
proof (state)
this:
0 < pa ?n

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
have "liminf (\<lambda>n. 1 / pa n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (1 / pa x)) = 0
[PROOF STEP]
using nth_2
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (real_of_int (a x) / real (nth_prime x))) = 0

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (1 / pa x)) = 0
[PROOF STEP]
unfolding pa_def
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (real_of_int (a x) / real (nth_prime x))) = 0

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (1 / (real (nth_prime x) / real_of_int (a x)))) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (1 / pa x)) = 0

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
liminf (\<lambda>x. ereal (1 / pa x)) = 0
[PROOF STEP]
have "(\<exists>y<ereal (real_of_int B / real_of_int (ub + 1)).
      \<exists>\<^sub>F x in sequentially. ereal (1 / pa x) \<le> y)"
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (1 / pa x)) = 0

goal (1 subgoal):
 1. \<exists>y<ereal (real_of_int B / real_of_int (ub + 1)). \<exists>\<^sub>F x in sequentially. ereal (1 / pa x) \<le> y
[PROOF STEP]
apply (subst less_Liminf_iff[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (1 / pa x)) = 0 \<Longrightarrow> liminf (\<lambda>x. ereal (1 / pa x)) < ereal (real_of_int B / real_of_int (ub + 1))
[PROOF STEP]
using \<open>0 < B\<close> \<open>0 < ub\<close>
[PROOF STATE]
proof (prove)
using this:
0 < B
0 < ub

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (1 / pa x)) = 0 \<Longrightarrow> liminf (\<lambda>x. ereal (1 / pa x)) < ereal (real_of_int B / real_of_int (ub + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y<ereal (real_of_int B / real_of_int (ub + 1)). \<exists>\<^sub>F x in sequentially. ereal (1 / pa x) \<le> y

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y<ereal (real_of_int B / real_of_int (ub + 1)). \<exists>\<^sub>F x in sequentially. ereal (1 / pa x) \<le> y
[PROOF STEP]
have "\<exists>\<^sub>F x in sequentially. 1 / pa x < B/(ub+1)"
[PROOF STATE]
proof (prove)
using this:
\<exists>y<ereal (real_of_int B / real_of_int (ub + 1)). \<exists>\<^sub>F x in sequentially. ereal (1 / pa x) \<le> y

goal (1 subgoal):
 1. \<exists>\<^sub>F x in sequentially. 1 / pa x < real_of_int B / real_of_int (ub + 1)
[PROOF STEP]
by (meson frequently_mono le_less_trans less_ereal.simps(1))
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F x in sequentially. 1 / pa x < real_of_int B / real_of_int (ub + 1)

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F x in sequentially. 1 / pa x < real_of_int B / real_of_int (ub + 1)
[PROOF STEP]
have "\<exists>\<^sub>F x in sequentially. B*pa x > (ub+1)"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F x in sequentially. 1 / pa x < real_of_int B / real_of_int (ub + 1)

goal (1 subgoal):
 1. \<exists>\<^sub>F x in sequentially. real_of_int (ub + 1) < real_of_int B * pa x
[PROOF STEP]
apply (elim frequently_elim1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. 1 / pa i < real_of_int B / real_of_int (ub + 1) \<Longrightarrow> real_of_int (ub + 1) < real_of_int B * pa i
[PROOF STEP]
by (metis \<open>0 < ub\<close> mult.left_neutral of_int_0_less_iff pa_pos pos_divide_less_eq
          pos_less_divide_eq times_divide_eq_left zless_add1_eq)
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F x in sequentially. real_of_int (ub + 1) < real_of_int B * pa x

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F x in sequentially. real_of_int (ub + 1) < real_of_int B * pa x

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. c x \<le> ub"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. c x \<le> ub
[PROOF STEP]
using \<open>\<forall>n. c n \<le> ub\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n. c n \<le> ub

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. c x \<le> ub
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. c x \<le> ub

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F x in sequentially. real_of_int (ub + 1) < real_of_int B * pa x
\<forall>\<^sub>F x in sequentially. c x \<le> ub
[PROOF STEP]
have "\<exists>\<^sub>F x in sequentially. B*pa x - c x > 1"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F x in sequentially. real_of_int (ub + 1) < real_of_int B * pa x
\<forall>\<^sub>F x in sequentially. c x \<le> ub

goal (1 subgoal):
 1. \<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x)
[PROOF STEP]
by (elim frequently_rev_mp eventually_mono) linarith
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x)

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x)

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
have "(\<lambda>n. B * pa n - c n) \<longlonglongrightarrow>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int B * pa n - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding pa_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int B * (real (nth_prime n) / real_of_int (a n)) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
using bac_close
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (B * int (nth_prime n)) / real_of_int (a n) - real_of_int (c n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int B * (real (nth_prime n) / real_of_int (a n)) - real_of_int (c n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int B * pa n - real_of_int (c n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
from tendstoD[OF this,of 1]
[PROOF STATE]
proof (chain)
picking this:
0 < 1 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (real_of_int B * pa x - real_of_int (c x)) 0 < 1
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially.  \<bar>B * pa n - c n\<bar> < 1"
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (real_of_int B * pa x - real_of_int (c x)) 0 < 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. \<bar>real_of_int B * pa n - real_of_int (c n)\<bar> < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. \<bar>real_of_int B * pa n - real_of_int (c n)\<bar> < 1

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x)
\<forall>\<^sub>F n in sequentially. \<bar>real_of_int B * pa n - real_of_int (c n)\<bar> < 1
[PROOF STEP]
have "\<exists>\<^sub>F x in sequentially. B*pa x - c x > 1 \<and> \<bar>B * pa x - c x\<bar> < 1"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x)
\<forall>\<^sub>F n in sequentially. \<bar>real_of_int B * pa n - real_of_int (c n)\<bar> < 1

goal (1 subgoal):
 1. \<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x) \<and> \<bar>real_of_int B * pa x - real_of_int (c x)\<bar> < 1
[PROOF STEP]
using frequently_eventually_frequently
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x)
\<forall>\<^sub>F n in sequentially. \<bar>real_of_int B * pa n - real_of_int (c n)\<bar> < 1
\<lbrakk>frequently ?P ?F; eventually ?Q ?F\<rbrakk> \<Longrightarrow> \<exists>\<^sub>F x in ?F. ?P x \<and> ?Q x

goal (1 subgoal):
 1. \<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x) \<and> \<bar>real_of_int B * pa x - real_of_int (c x)\<bar> < 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x) \<and> \<bar>real_of_int B * pa x - real_of_int (c x)\<bar> < 1

goal (1 subgoal):
 1. \<not> (\<forall>x. \<exists>n. x < c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x) \<and> \<bar>real_of_int B * pa x - real_of_int (c x)\<bar> < 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F x in sequentially. 1 < real_of_int B * pa x - real_of_int (c x) \<and> \<bar>real_of_int B * pa x - real_of_int (c x)\<bar> < 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. \<exists>n. x < c n

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have eq_2_11:"\<forall>\<^sub>F n in sequentially. c (n+1)>c n \<longrightarrow>
                  nth_prime (n+1) > nth_prime n + (1 - \<epsilon>)^2 * a n / B"
    when "\<epsilon>>0" "\<epsilon><1" for \<epsilon>::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. \<bar>c (Suc x) / a x\<bar> < \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>
[PROOF STEP]
using ca_vanish[unfolded tendsto_iff,rule_format, of \<epsilon>] \<open>\<epsilon>>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (real_of_int (c (Suc x)) / real_of_int (a x)) 0 < \<epsilon>
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. c n > 0 \<and> c (n+1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
[PROOF STEP]
using c_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
[PROOF STEP]
by (subst eventually_sequentially_Suc) simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
[PROOF STEP]
using c_pos
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (Suc n)
\<forall>\<^sub>F n in sequentially. 0 < c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
using Bc_large bc_epsilon[OF \<open>\<epsilon>>0\<close> \<open>\<epsilon><1\<close>]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>
\<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1)
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
\<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
proof (eventually_elim, rule_tac impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
assume "c n < c (n + 1)"
[PROOF STATE]
proof (state)
this:
c n < c (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "c (n+1) / a n < \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon>
[PROOF STEP]
using a_pos[rule_format,of n]
[PROOF STATE]
proof (prove)
using this:
0 < a n

goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon>
[PROOF STEP]
using elim(1,2)
[PROOF STATE]
proof (prove)
using this:
0 < a n
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)

goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon>

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon>

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... \<le> \<epsilon> * c n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon> \<le> \<epsilon> * real_of_int (c n)
[PROOF STEP]
using elim(2) that(1)
[PROOF STATE]
proof (prove)
using this:
0 < c n \<and> 0 < c (n + 1)
0 < \<epsilon>

goal (1 subgoal):
 1. \<epsilon> \<le> \<epsilon> * real_of_int (c n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<epsilon> \<le> \<epsilon> * real_of_int (c n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)
[PROOF STEP]
have "c (n+1) / a n < \<epsilon> * c n"
[PROOF STATE]
proof (prove)
using this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)

goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)
[PROOF STEP]
have "c (n+1) / c n < \<epsilon> * a n"
[PROOF STATE]
proof (prove)
using this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)

goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (c n) < \<epsilon> * real_of_int (a n)
[PROOF STEP]
using a_pos[rule_format,of n] elim
[PROOF STATE]
proof (prove)
using this:
real_of_int (c (n + 1)) / real_of_int (a n) < \<epsilon> * real_of_int (c n)
0 < a n
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (c n) < \<epsilon> * real_of_int (a n)
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1)) / real_of_int (c n) < \<epsilon> * real_of_int (a n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_int (c (n + 1)) / real_of_int (c n) < \<epsilon> * real_of_int (a n)
[PROOF STEP]
have "(1 - \<epsilon>) * a n < a n - c (n+1) / c n"
[PROOF STATE]
proof (prove)
using this:
real_of_int (c (n + 1)) / real_of_int (c n) < \<epsilon> * real_of_int (a n)

goal (1 subgoal):
 1. (1 - \<epsilon>) * real_of_int (a n) < real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
(1 - \<epsilon>) * real_of_int (a n) < real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - \<epsilon>) * real_of_int (a n) < real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)
[PROOF STEP]
have "(1 - \<epsilon>)^2 * a n / B < (1 - \<epsilon>) * (a n - c (n+1) / c n) / B"
[PROOF STATE]
proof (prove)
using this:
(1 - \<epsilon>) * real_of_int (a n) < real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)

goal (1 subgoal):
 1. (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
apply (subst (asm) mult_less_iff1[symmetric, of "(1-\<epsilon>)/B"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < (1 - \<epsilon>) / real_of_int B
 2. (1 - \<epsilon>) * real_of_int (a n) * ((1 - \<epsilon>) / real_of_int B) < (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) * ((1 - \<epsilon>) / real_of_int B) \<Longrightarrow> (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
using \<open>\<epsilon><1\<close> \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<epsilon> < 1
0 < B

goal (2 subgoals):
 1. 0 < (1 - \<epsilon>) / real_of_int B
 2. (1 - \<epsilon>) * real_of_int (a n) * ((1 - \<epsilon>) / real_of_int B) < (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) * ((1 - \<epsilon>) / real_of_int B) \<Longrightarrow> (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
by (auto simp: divide_simps power2_eq_square mult_less_iff1)
[PROOF STATE]
proof (state)
this:
(1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
have "nth_prime n + (1 - \<epsilon>)^2 * a n / B < nth_prime n + (1 - \<epsilon>) * (a n - c (n+1) / c n) / B"
[PROOF STATE]
proof (prove)
using this:
(1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
(1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
0 < B

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... = nth_prime n + (1 - \<epsilon>) * ((c n *a n - c (n+1)) / c n) / B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (a n) - real_of_int (c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... = nth_prime n + (1 - \<epsilon>) * (nth_prime n / c n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))
[PROOF STEP]
have "B * nth_prime n = c n * a n - c (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. B * int (nth_prime n) = c n * a n - c (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B * int (nth_prime n) = c n * a n - c (n + 1)

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))
[PROOF STEP]
from this[symmetric]
[PROOF STATE]
proof (chain)
picking this:
c n * a n - c (n + 1) = B * int (nth_prime n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c n * a n - c (n + 1) = B * int (nth_prime n)

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
c n * a n - c (n + 1) = B * int (nth_prime n)
0 < B

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real_of_int (c n * a n - c (n + 1)) / real_of_int (c n)) / real_of_int B = real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... = (1+(1-\<epsilon>)/c n) * nth_prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n)) = (1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n)
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n)) = (1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>) * (real (nth_prime n) / real_of_int (c n)) = (1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... = ((c n+1-\<epsilon>)/c n) * nth_prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n) = (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. (1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n) = (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
(1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n) = (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 + (1 - \<epsilon>) / real_of_int (c n)) * real (nth_prime n) = (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... \<le> ((c (n+1) -\<epsilon>)/c n) * nth_prime n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
define cp where "cp = c n+1"
[PROOF STATE]
proof (state)
this:
cp = c n + 1

goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
have "c (n+1) \<ge> cp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cp \<le> c (n + 1)
[PROOF STEP]
unfolding cp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n + 1 \<le> c (n + 1)
[PROOF STEP]
using \<open>c n < c (n + 1)\<close>
[PROOF STATE]
proof (prove)
using this:
c n < c (n + 1)

goal (1 subgoal):
 1. c n + 1 \<le> c (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cp \<le> c (n + 1)

goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cp \<le> c (n + 1)

goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
have "c n>0" "nth_prime n>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c n &&& 0 < nth_prime n
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

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

goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cp \<le> c (n + 1)
0 < c n
0 < nth_prime n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cp \<le> c (n + 1)
0 < c n
0 < nth_prime n

goal (1 subgoal):
 1. (real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
apply (fold cp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cp \<le> c (n + 1); 0 < c n; 0 < nth_prime n\<rbrakk> \<Longrightarrow> (real_of_int cp - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
(real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real_of_int (c n + 1) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) \<le> (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
have "... < nth_prime (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) < real (nth_prime (n + 1))
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>
0 < c n \<and> 0 < c (n + 1)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n)

goal (1 subgoal):
 1. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) < real (nth_prime (n + 1))
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
(real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) * real (nth_prime n) < real (nth_prime (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<bar>real_of_int (c (Suc n)) / real_of_int (a n)\<bar> < \<epsilon>; 0 < c n \<and> 0 < c (n + 1); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); \<forall>\<^sub>F x in sequentially. \<bar>real_of_int (c (Suc x)) / real_of_int (a x)\<bar> < \<epsilon>; \<forall>\<^sub>F n in sequentially. 0 < c n \<and> 0 < c (n + 1); \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; \<forall>\<^sub>F n in sequentially. (real_of_int (c (n + 1)) - \<epsilon>) / real_of_int (c n) < real (nth_prime (n + 1)) / real (nth_prime n); c n < c (n + 1)\<rbrakk> \<Longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
show "real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n)
          / real_of_int B < real (nth_prime (n + 1))"
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))

goal (1 subgoal):
 1. real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - \<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?\<epsilon>; ?\<epsilon> < 1\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. c n < c (n + 1) \<longrightarrow> real (nth_prime n) + (1 - ?\<epsilon>)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (n + 1))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have c_neq_large:"\<forall>\<^sub>F n in sequentially. c (n+1) \<noteq> c n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n)"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n)
[PROOF STEP]
have that:"\<exists>\<^sub>F n in sequentially. c (n + 1) = c n"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n)

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. c (n + 1) = c n
[PROOF STEP]
unfolding frequently_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F x in sequentially. c (x + 1) \<noteq> c x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F n in sequentially. c (n + 1) = c n

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. (B * int (nth_prime x) = c x * a x - c (x + 1)
        \<and> \<bar>real_of_int (c (x + 1))\<bar> < real_of_int (a x) / 2) \<and> 0 < c x \<and> B < int (nth_prime x)
        \<and> (c (x+1)>c x \<longrightarrow> nth_prime (x+1) > nth_prime x +  a x / (2* B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. (B * int (nth_prime x) = c x * a x - c (x + 1) \<and> \<bar>real_of_int (c (x + 1))\<bar> < real_of_int (a x) / 2) \<and> 0 < c x \<and> B < int (nth_prime x) \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))
[PROOF STEP]
using Bc_large c_pos B_nth_prime eq_2_11[of "1-1/ sqrt 2",simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
\<forall>\<^sub>F n in sequentially. 0 < c n
\<forall>\<^sub>F n in sequentially. B < int (nth_prime n)
\<forall>\<^sub>F n in sequentially. c n < c (Suc n) \<longrightarrow> real (nth_prime n) + (1 / sqrt 2)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (Suc n))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. (B * int (nth_prime x) = c x * a x - c (x + 1) \<and> \<bar>real_of_int (c (x + 1))\<bar> < real_of_int (a x) / 2) \<and> 0 < c x \<and> B < int (nth_prime x) \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))
[PROOF STEP]
by eventually_elim (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. (B * int (nth_prime x) = c x * a x - c (x + 1) \<and> \<bar>real_of_int (c (x + 1))\<bar> < real_of_int (a x) / 2) \<and> 0 < c x \<and> B < int (nth_prime x) \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. (B * int (nth_prime x) = c x * a x - c (x + 1) \<and> \<bar>real_of_int (c (x + 1))\<bar> < real_of_int (a x) / 2) \<and> 0 < c x \<and> B < int (nth_prime x) \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))
[PROOF STEP]
have "\<exists>\<^sub>F m in sequentially. nth_prime (m+1) > (1+1/(2*B))*nth_prime m"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. (B * int (nth_prime x) = c x * a x - c (x + 1) \<and> \<bar>real_of_int (c (x + 1))\<bar> < real_of_int (a x) / 2) \<and> 0 < c x \<and> B < int (nth_prime x) \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))

goal (1 subgoal):
 1. \<exists>\<^sub>F m in sequentially. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))
[PROOF STEP]
proof (elim frequently_eventually_at_top[OF that, THEN frequently_at_top_elim])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
assume "c (n + 1) = c n \<and>
           (\<forall>y\<ge>n. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and>
                    \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and>
                   0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow>
                   real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B)
                   < real (nth_prime (y + 1))))"
[PROOF STATE]
proof (state)
this:
c (n + 1) = c n \<and> (\<forall>y\<ge>n. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1))))

goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c (n + 1) = c n \<and> (\<forall>y\<ge>n. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1))))
[PROOF STEP]
have "c (n + 1) = c n"
        and Bc_eq:"\<forall>y\<ge>n. B * int (nth_prime y) = c y * a y - c (y + 1) \<and> 0 < c y
                            \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2
                            \<and> B < int (nth_prime y)
                            \<and> (c y < c (y + 1) \<longrightarrow>
                   real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B)
                   < real (nth_prime (y + 1)))"
[PROOF STATE]
proof (prove)
using this:
c (n + 1) = c n \<and> (\<forall>y\<ge>n. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1))))

goal (1 subgoal):
 1. c (n + 1) = c n &&& \<forall>y\<ge>n. B * int (nth_prime y) = c y * a y - c (y + 1) \<and> 0 < c y \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2 \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c (n + 1) = c n
\<forall>y\<ge>n. B * int (nth_prime y) = c y * a y - c (y + 1) \<and> 0 < c y \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2 \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))

goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
obtain m where "n<m" "c m \<le> c n" "c n<c (m+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>N. N > n \<and> c N > c n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N>n. c n < c N
[PROOF STEP]
using c_ubound[rule_format, of "MAX x\<in>{..n}. c x"]
[PROOF STATE]
proof (prove)
using this:
\<exists>na. Max (c ` {..n}) < c na

goal (1 subgoal):
 1. \<exists>N>n. c n < c N
[PROOF STEP]
by (metis Max_ge atMost_iff dual_order.trans finite_atMost finite_imageI image_eqI
              linorder_not_le order_refl)
[PROOF STATE]
proof (state)
this:
\<exists>N>n. c n < c N

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>N>n. c n < c N
[PROOF STEP]
obtain N where "N>n" "c N>c n"
[PROOF STATE]
proof (prove)
using this:
\<exists>N>n. c n < c N

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>n < N; c n < c N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < N
c n < c N

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define A m where "A={m. n<m \<and> (m+1)\<le>N \<and> c (m+1) > c n}" and "m = Min A"
[PROOF STATE]
proof (state)
this:
A = {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
m = Min A

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
[PROOF STEP]
by (metis (no_types, lifting) A_def add_leE finite_nat_set_iff_bounded_le mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "N-1\<in>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N - 1 \<in> A
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N - 1 \<in> {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
[PROOF STEP]
using \<open>c n < c N\<close> \<open>n < N\<close> \<open>c (n + 1) = c n\<close>
[PROOF STATE]
proof (prove)
using this:
c n < c N
n < N
c (n + 1) = c n

goal (1 subgoal):
 1. N - 1 \<in> {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
[PROOF STEP]
by (smt Suc_diff_Suc Suc_eq_plus1 Suc_leI Suc_pred  add.commute
              add_diff_inverse_nat add_leD1 diff_is_0_eq' mem_Collect_eq nat_add_left_cancel_less
              zero_less_one)
[PROOF STATE]
proof (state)
this:
N - 1 \<in> A

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite A
N - 1 \<in> A
[PROOF STEP]
have "m\<in>A"
[PROOF STATE]
proof (prove)
using this:
finite A
N - 1 \<in> A

goal (1 subgoal):
 1. m \<in> A
[PROOF STEP]
using Min_in
[PROOF STATE]
proof (prove)
using this:
finite A
N - 1 \<in> A
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A

goal (1 subgoal):
 1. m \<in> A
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
finite A
N - 1 \<in> A
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Min ?A \<in> ?A

goal (1 subgoal):
 1. Min A \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> A

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<in> A
[PROOF STEP]
have "n<m"  "c n<c (m+1)" "m>0"
[PROOF STATE]
proof (prove)
using this:
m \<in> A

goal (1 subgoal):
 1. n < m &&& c n < c (m + 1) &&& 0 < m
[PROOF STEP]
unfolding m_def A_def
[PROOF STATE]
proof (prove)
using this:
Min {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)} \<in> {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}

goal (1 subgoal):
 1. n < Min {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)} &&& c n < c (Min {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)} + 1) &&& 0 < Min {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < m
c n < c (m + 1)
0 < m

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n < m
c n < c (m + 1)
0 < m

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "c m \<le> c n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c m \<le> c n
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> c m \<le> c n \<Longrightarrow> False
[PROOF STEP]
assume " \<not> c m \<le> c n"
[PROOF STATE]
proof (state)
this:
\<not> c m \<le> c n

goal (1 subgoal):
 1. \<not> c m \<le> c n \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> c m \<le> c n
[PROOF STEP]
have "m-1\<in>A"
[PROOF STATE]
proof (prove)
using this:
\<not> c m \<le> c n

goal (1 subgoal):
 1. m - 1 \<in> A
[PROOF STEP]
using \<open>m\<in>A\<close> \<open>c (n + 1) = c n\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> c m \<le> c n
m \<in> A
c (n + 1) = c n

goal (1 subgoal):
 1. m - 1 \<in> A
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
\<not> c m \<le> c n
m \<in> {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
c (n + 1) = c n

goal (1 subgoal):
 1. m - 1 \<in> {m. n < m \<and> m + 1 \<le> N \<and> c n < c (m + 1)}
[PROOF STEP]
by auto (smt One_nat_def Suc_eq_plus1 Suc_lessI less_diff_conv)
[PROOF STATE]
proof (state)
this:
m - 1 \<in> A

goal (1 subgoal):
 1. \<not> c m \<le> c n \<Longrightarrow> False
[PROOF STEP]
from  Min_le[OF \<open>finite A\<close> this,folded m_def] \<open>m>0\<close>
[PROOF STATE]
proof (chain)
picking this:
m \<le> m - 1
0 < m
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
m \<le> m - 1
0 < m

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c m \<le> c n

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n < m
c n < c (m + 1)
0 < m
c m \<le> c n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n < m
c n < c (m + 1)
0 < m
c m \<le> c n

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that[of m]
[PROOF STATE]
proof (prove)
using this:
n < m
c n < c (m + 1)
0 < m
c m \<le> c n
\<lbrakk>n < m; c m \<le> c n; c n < c (m + 1)\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
n < m
c m \<le> c n
c n < c (m + 1)

goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
have "(1 + 1 / (2 * B)) * nth_prime m < nth_prime m + a m / (2*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)
[PROOF STEP]
have "nth_prime m < a m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
have "B * int (nth_prime m) < c m * (a m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * int (nth_prime m) < c m * (a m - 1)
[PROOF STEP]
using Bc_eq[rule_format,of m] \<open>c m \<le> c n\<close> \<open>c n < c (m + 1)\<close> \<open>n < m\<close>
[PROOF STATE]
proof (prove)
using this:
n \<le> m \<Longrightarrow> B * int (nth_prime m) = c m * a m - c (m + 1) \<and> 0 < c m \<and> \<bar>real_of_int (c (m + 1))\<bar> < real_of_int (a m) / 2 \<and> B < int (nth_prime m) \<and> (c m < c (m + 1) \<longrightarrow> real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B) < real (nth_prime (m + 1)))
c m \<le> c n
c n < c (m + 1)
n < m

goal (1 subgoal):
 1. B * int (nth_prime m) < c m * (a m - 1)
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
B * int (nth_prime m) < c m * (a m - 1)

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B * int (nth_prime m) < c m * (a m - 1)

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
have "... \<le> c n * (a m - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c m * (a m - 1) \<le> c n * (a m - 1)
[PROOF STEP]
by (simp add: \<open>c m \<le> c n\<close> a_pos mult_right_mono)
[PROOF STATE]
proof (state)
this:
c m * (a m - 1) \<le> c n * (a m - 1)

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
B * int (nth_prime m) < c n * (a m - 1)
[PROOF STEP]
have "B * int (nth_prime m) < c n * (a m - 1)"
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime m) < c n * (a m - 1)

goal (1 subgoal):
 1. B * int (nth_prime m) < c n * (a m - 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
B * int (nth_prime m) < c n * (a m - 1)

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B * int (nth_prime m) < c n * (a m - 1)

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
have "c n\<le>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
have " B * int (nth_prime n) = c n * (a n - 1)" "B < int (nth_prime n)"
              and c_a:"\<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B * int (nth_prime n) = c n * (a n - 1) &&& B < int (nth_prime n)) &&& \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
[PROOF STEP]
using Bc_eq[rule_format,of n] \<open>c (n + 1) = c n\<close>
[PROOF STATE]
proof (prove)
using this:
n \<le> n \<Longrightarrow> B * int (nth_prime n) = c n * a n - c (n + 1) \<and> 0 < c n \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2 \<and> B < int (nth_prime n) \<and> (c n < c (n + 1) \<longrightarrow> real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B) < real (nth_prime (n + 1)))
c (n + 1) = c n

goal (1 subgoal):
 1. (B * int (nth_prime n) = c n * (a n - 1) &&& B < int (nth_prime n)) &&& \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
B * int (nth_prime n) = c n * (a n - 1)
B < int (nth_prime n)
\<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
B * int (nth_prime n) = c n * (a n - 1)
[PROOF STEP]
have " c n dvd (B * int (nth_prime n))"
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) = c n * (a n - 1)

goal (1 subgoal):
 1. c n dvd B * int (nth_prime n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c n dvd B * int (nth_prime n)

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c n dvd B * int (nth_prime n)

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
have "coprime (c n) (int (nth_prime n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
have "c n < int (nth_prime n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n < int (nth_prime n)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> c n < int (nth_prime n)"
[PROOF STATE]
proof (state)
this:
\<not> c n < int (nth_prime n)

goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> c n < int (nth_prime n)
[PROOF STEP]
have asm:"c n \<ge> int (nth_prime n)"
[PROOF STATE]
proof (prove)
using this:
\<not> c n < int (nth_prime n)

goal (1 subgoal):
 1. int (nth_prime n) \<le> c n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (nth_prime n) \<le> c n

goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (nth_prime n) \<le> c n
[PROOF STEP]
have "a n > 2 * nth_prime n"
[PROOF STATE]
proof (prove)
using this:
int (nth_prime n) \<le> c n

goal (1 subgoal):
 1. int (2 * nth_prime n) < a n
[PROOF STEP]
using c_a \<open>c (n + 1) = c n\<close>
[PROOF STATE]
proof (prove)
using this:
int (nth_prime n) \<le> c n
\<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
c (n + 1) = c n

goal (1 subgoal):
 1. int (2 * nth_prime n) < a n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (2 * nth_prime n) < a n

goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (2 * nth_prime n) < a n
[PROOF STEP]
have "a n -1 \<ge> 2 * nth_prime n"
[PROOF STATE]
proof (prove)
using this:
int (2 * nth_prime n) < a n

goal (1 subgoal):
 1. int (2 * nth_prime n) \<le> a n - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int (2 * nth_prime n) \<le> a n - 1

goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (2 * nth_prime n) \<le> a n - 1
[PROOF STEP]
have "a n - 1 > 2 * B"
[PROOF STATE]
proof (prove)
using this:
int (2 * nth_prime n) \<le> a n - 1

goal (1 subgoal):
 1. 2 * B < a n - 1
[PROOF STEP]
using \<open>B < int (nth_prime n)\<close>
[PROOF STATE]
proof (prove)
using this:
int (2 * nth_prime n) \<le> a n - 1
B < int (nth_prime n)

goal (1 subgoal):
 1. 2 * B < a n - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 * B < a n - 1

goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
from mult_le_less_imp_less[OF asm this] \<open>B>0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < int (nth_prime n); 0 \<le> 2 * B\<rbrakk> \<Longrightarrow> int (nth_prime n) * (2 * B) < c n * (a n - 1)
0 < B
[PROOF STEP]
have "int (nth_prime n) * (2 * B) < c n * (a n - 1)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < int (nth_prime n); 0 \<le> 2 * B\<rbrakk> \<Longrightarrow> int (nth_prime n) * (2 * B) < c n * (a n - 1)
0 < B

goal (1 subgoal):
 1. int (nth_prime n) * (2 * B) < c n * (a n - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int (nth_prime n) * (2 * B) < c n * (a n - 1)

goal (1 subgoal):
 1. \<not> c n < int (nth_prime n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (nth_prime n) * (2 * B) < c n * (a n - 1)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
int (nth_prime n) * (2 * B) < c n * (a n - 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>B * int (nth_prime n) = c n * (a n - 1)\<close>
[PROOF STATE]
proof (prove)
using this:
int (nth_prime n) * (2 * B) < c n * (a n - 1)
B * int (nth_prime n) = c n * (a n - 1)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (smt \<open>0 < B\<close> \<open>B < int (nth_prime n)\<close> combine_common_factor
                      mult.commute mult_pos_pos)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c n < int (nth_prime n)

goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c n < int (nth_prime n)
[PROOF STEP]
have "\<not> nth_prime n dvd c n"
[PROOF STATE]
proof (prove)
using this:
c n < int (nth_prime n)

goal (1 subgoal):
 1. \<not> int (nth_prime n) dvd c n
[PROOF STEP]
by (simp add: Bc_eq zdvd_not_zless)
[PROOF STATE]
proof (state)
this:
\<not> int (nth_prime n) dvd c n

goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> int (nth_prime n) dvd c n
[PROOF STEP]
have "coprime (int (nth_prime n)) (c n)"
[PROOF STATE]
proof (prove)
using this:
\<not> int (nth_prime n) dvd c n

goal (1 subgoal):
 1. coprime (int (nth_prime n)) (c n)
[PROOF STEP]
by (auto intro!:prime_imp_coprime_int)
[PROOF STATE]
proof (state)
this:
coprime (int (nth_prime n)) (c n)

goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
coprime (int (nth_prime n)) (c n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coprime (int (nth_prime n)) (c n)

goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
using coprime_commute
[PROOF STATE]
proof (prove)
using this:
coprime (int (nth_prime n)) (c n)
coprime ?b ?a = coprime ?a ?b

goal (1 subgoal):
 1. coprime (c n) (int (nth_prime n))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
coprime (c n) (int (nth_prime n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
coprime (c n) (int (nth_prime n))

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
c n dvd B * int (nth_prime n)
coprime (c n) (int (nth_prime n))
[PROOF STEP]
have "c n dvd B"
[PROOF STATE]
proof (prove)
using this:
c n dvd B * int (nth_prime n)
coprime (c n) (int (nth_prime n))

goal (1 subgoal):
 1. c n dvd B
[PROOF STEP]
using coprime_dvd_mult_left_iff
[PROOF STATE]
proof (prove)
using this:
c n dvd B * int (nth_prime n)
coprime (c n) (int (nth_prime n))
coprime ?a ?c \<Longrightarrow> (?a dvd ?b * ?c) = (?a dvd ?b)

goal (1 subgoal):
 1. c n dvd B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c n dvd B

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c n dvd B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c n dvd B

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
using \<open>0 < B\<close> zdvd_imp_le
[PROOF STATE]
proof (prove)
using this:
c n dvd B
0 < B
\<lbrakk>?z dvd ?n; 0 < ?n\<rbrakk> \<Longrightarrow> ?z \<le> ?n

goal (1 subgoal):
 1. c n \<le> B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
c n \<le> B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c n \<le> B

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
c n \<le> B

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
have "c n > 0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c n
[PROOF STEP]
using Bc_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<ge>n. B * int (nth_prime y) = c y * a y - c (y + 1) \<and> 0 < c y \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2 \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))

goal (1 subgoal):
 1. 0 < c n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < c n

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B * int (nth_prime m) < c n * (a m - 1)
c n \<le> B
0 < c n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime m) < c n * (a m - 1)
c n \<le> B
0 < c n

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime m) < c n * (a m - 1)
c n \<le> B
0 < c n
0 < B

goal (1 subgoal):
 1. int (nth_prime m) < a m
[PROOF STEP]
by (smt a_pos mult_mono)
[PROOF STATE]
proof (state)
this:
int (nth_prime m) < a m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int (nth_prime m) < a m

goal (1 subgoal):
 1. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (nth_prime m) < a m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int (nth_prime m) < a m

goal (1 subgoal):
 1. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
int (nth_prime m) < a m
0 < B

goal (1 subgoal):
 1. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
(1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)

goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B)

goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
have "... < nth_prime (m+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B) < real (nth_prime (m + 1))
[PROOF STEP]
using Bc_eq[rule_format, of m] \<open>n<m\<close> \<open>c m \<le> c n\<close> \<open>c n < c (m+1)\<close>
[PROOF STATE]
proof (prove)
using this:
n \<le> m \<Longrightarrow> B * int (nth_prime m) = c m * a m - c (m + 1) \<and> 0 < c m \<and> \<bar>real_of_int (c (m + 1))\<bar> < real_of_int (a m) / 2 \<and> B < int (nth_prime m) \<and> (c m < c (m + 1) \<longrightarrow> real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B) < real (nth_prime (m + 1)))
n < m
c m \<le> c n
c n < c (m + 1)

goal (1 subgoal):
 1. real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B) < real (nth_prime (m + 1))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real (nth_prime m) + real_of_int (a m) / real_of_int (2 * B) < real (nth_prime (m + 1))

goal (1 subgoal):
 1. \<And>i. c (i + 1) = c i \<and> (\<forall>y\<ge>i. (B * int (nth_prime y) = c y * a y - c (y + 1) \<and> \<bar>real_of_int (c (y + 1))\<bar> < real_of_int (a y) / 2) \<and> 0 < c y \<and> B < int (nth_prime y) \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))) \<Longrightarrow> \<exists>j>i. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))
[PROOF STEP]
show "\<exists>j>n. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j)
                       < real (nth_prime (j + 1))"
[PROOF STATE]
proof (prove)
using this:
(1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))

goal (1 subgoal):
 1. \<exists>j>n. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
using \<open>m>n\<close>
[PROOF STATE]
proof (prove)
using this:
(1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))
n < m

goal (1 subgoal):
 1. \<exists>j>n. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>j>n. (1 + 1 / real_of_int (2 * B)) * real (nth_prime j) < real (nth_prime (j + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F m in sequentially. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F m in sequentially. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))
[PROOF STEP]
have "\<exists>\<^sub>F m in sequentially. nth_prime (m+1)/nth_prime m > (1+1/(2*B))"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F m in sequentially. (1 + 1 / real_of_int (2 * B)) * real (nth_prime m) < real (nth_prime (m + 1))

goal (1 subgoal):
 1. \<exists>\<^sub>F m in sequentially. 1 + 1 / real_of_int (2 * B) < real (nth_prime (m + 1)) / real (nth_prime m)
[PROOF STEP]
by (auto elim:frequently_elim1 simp:field_simps)
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F m in sequentially. 1 + 1 / real_of_int (2 * B) < real (nth_prime (m + 1)) / real (nth_prime m)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F m in sequentially. 1 + 1 / real_of_int (2 * B) < real (nth_prime (m + 1)) / real (nth_prime m)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F m in sequentially. nth_prime (m+1)/nth_prime m < (1+1/(2*B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F m in sequentially. real (nth_prime (m + 1)) / real (nth_prime m) < 1 + 1 / real_of_int (2 * B)
[PROOF STEP]
using ratio_of_consecutive_primes[unfolded tendsto_iff,rule_format,of "1/(2*B)"]
        \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < 1 / real_of_int (2 * B) \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (real (nth_prime (x + 1)) / real (nth_prime x)) 1 < 1 / real_of_int (2 * B)
0 < B

goal (1 subgoal):
 1. \<forall>\<^sub>F m in sequentially. real (nth_prime (m + 1)) / real (nth_prime m) < 1 + 1 / real_of_int (2 * B)
[PROOF STEP]
unfolding dist_real_def
[PROOF STATE]
proof (prove)
using this:
0 < 1 / real_of_int (2 * B) \<Longrightarrow> \<forall>\<^sub>F x in sequentially. \<bar>real (nth_prime (x + 1)) / real (nth_prime x) - 1\<bar> < 1 / real_of_int (2 * B)
0 < B

goal (1 subgoal):
 1. \<forall>\<^sub>F m in sequentially. real (nth_prime (m + 1)) / real (nth_prime m) < 1 + 1 / real_of_int (2 * B)
[PROOF STEP]
by (auto elim!:eventually_mono simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F m in sequentially. real (nth_prime (m + 1)) / real (nth_prime m) < 1 + 1 / real_of_int (2 * B)

goal (1 subgoal):
 1. \<not> (\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<^sub>F m in sequentially. 1 + 1 / real_of_int (2 * B) < real (nth_prime (m + 1)) / real (nth_prime m)
\<forall>\<^sub>F m in sequentially. real (nth_prime (m + 1)) / real (nth_prime m) < 1 + 1 / real_of_int (2 * B)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<exists>\<^sub>F m in sequentially. 1 + 1 / real_of_int (2 * B) < real (nth_prime (m + 1)) / real (nth_prime m)
\<forall>\<^sub>F m in sequentially. real (nth_prime (m + 1)) / real (nth_prime m) < 1 + 1 / real_of_int (2 * B)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (simp add: eventually_mono frequently_def)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have c_gt_half:"\<forall>\<^sub>F N in sequentially. card {n\<in>{N..<2*N}.  c n > c (n+1)} > N / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
define h where "h=(\<lambda>n. (nth_prime (2*n) - nth_prime n)
                              /  sqrt (nth_prime n))"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>n. real (nth_prime (2 * n) - nth_prime n) / sqrt (real (nth_prime n)))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. h n < n / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n / 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n / 2
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. h n < n powr (5/6)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n powr (5 / 6)
[PROOF STEP]
using nth_prime_double_sqrt_less[of "1/3"]
[PROOF STATE]
proof (prove)
using this:
0 < 1 / 3 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. real (nth_prime (2 * n) - nth_prime n) / sqrt (real (nth_prime n)) < real n powr (1 / 2 + 1 / 3)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n powr (5 / 6)
[PROOF STEP]
unfolding h_def
[PROOF STATE]
proof (prove)
using this:
0 < 1 / 3 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. real (nth_prime (2 * n) - nth_prime n) / sqrt (real (nth_prime n)) < real n powr (1 / 2 + 1 / 3)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (nth_prime (2 * n) - nth_prime n) / sqrt (real (nth_prime n)) < real n powr (5 / 6)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. h n < real n powr (5 / 6)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n / 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. h n < real n powr (5 / 6)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n / 2
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. n powr (5/6) < (n /2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real n powr (5 / 6) < real n / 2
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real n powr (5 / 6) < real n / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n / 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. h n < real n powr (5 / 6)
\<forall>\<^sub>F n in sequentially. real n powr (5 / 6) < real n / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. h n < real n powr (5 / 6)
\<forall>\<^sub>F n in sequentially. real n powr (5 / 6) < real n / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. h n < real n / 2
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. h n < real n / 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. h n < real n / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. h n < real n / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. sqrt (nth_prime n) / a n < 1 / (2*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B)
[PROOF STEP]
using nth_1[THEN tendsto_real_sqrt,unfolded tendsto_iff
          ,rule_format,of "1/(2*B)"] \<open>B>0\<close> a_pos
[PROOF STATE]
proof (prove)
using this:
0 < 1 / real_of_int (2 * B) \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (sqrt (real (nth_prime x) / real_of_int ((a x)\<^sup>2))) (sqrt 0) < 1 / real_of_int (2 * B)
0 < B
\<forall>n. 0 < a n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B)
[PROOF STEP]
by (auto simp:real_sqrt_divide abs_of_pos)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B)

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. h n < real n / 2
\<forall>\<^sub>F n in sequentially. sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B)
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. c (x+1) \<noteq> c x
        \<and> sqrt (nth_prime x) / a x < 1 / (2*B)
        \<and>  h x < x / 2
        \<and> (c (x+1)>c x \<longrightarrow> nth_prime (x+1) > nth_prime x +  a x / (2* B))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. h n < real n / 2
\<forall>\<^sub>F n in sequentially. sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. c (x + 1) \<noteq> c x \<and> sqrt (real (nth_prime x)) / real_of_int (a x) < 1 / real_of_int (2 * B) \<and> h x < real x / 2 \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))
[PROOF STEP]
using c_neq_large B_nth_prime eq_2_11[of "1-1/ sqrt 2",simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. h n < real n / 2
\<forall>\<^sub>F n in sequentially. sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B)
\<forall>\<^sub>F n in sequentially. c (n + 1) \<noteq> c n
\<forall>\<^sub>F n in sequentially. B < int (nth_prime n)
\<forall>\<^sub>F n in sequentially. c n < c (Suc n) \<longrightarrow> real (nth_prime n) + (1 / sqrt 2)\<^sup>2 * real_of_int (a n) / real_of_int B < real (nth_prime (Suc n))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. c (x + 1) \<noteq> c x \<and> sqrt (real (nth_prime x)) / real_of_int (a x) < 1 / real_of_int (2 * B) \<and> h x < real x / 2 \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))
[PROOF STEP]
by eventually_elim (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. c (x + 1) \<noteq> c x \<and> sqrt (real (nth_prime x)) / real_of_int (a x) < 1 / real_of_int (2 * B) \<and> h x < real x / 2 \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. c (x + 1) \<noteq> c x \<and> sqrt (real (nth_prime x)) / real_of_int (a x) < 1 / real_of_int (2 * B) \<and> h x < real x / 2 \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. c (x + 1) \<noteq> c x \<and> sqrt (real (nth_prime x)) / real_of_int (a x) < 1 / real_of_int (2 * B) \<and> h x < real x / 2 \<and> (c x < c (x + 1) \<longrightarrow> real (nth_prime x) + real_of_int (a x) / real_of_int (2 * B) < real (nth_prime (x + 1)))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
proof (elim eventually_at_top_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
fix N
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
assume "N\<ge>1" and N_asm:"\<forall>y\<ge>N. c (y + 1) \<noteq> c y \<and>
               sqrt (real (nth_prime y)) / real_of_int (a y)
               < 1 / real_of_int (2 * B) \<and>  h y < y / 2 \<and>
               (c y < c (y + 1) \<longrightarrow>
                real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B)
                < real (nth_prime (y + 1)))"
[PROOF STATE]
proof (state)
this:
1 \<le> N
\<forall>y\<ge>N. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
define S where "S={n \<in> {N..<2 * N}. c n < c (n + 1)}"
[PROOF STATE]
proof (state)
this:
S = {n \<in> {N..<2 * N}. c n < c (n + 1)}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
define g where "g=(\<lambda>n. (nth_prime (n+1) - nth_prime n)
                              /  sqrt (nth_prime n))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>n. real (nth_prime (n + 1) - nth_prime n) / sqrt (real (nth_prime n)))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
define f where "f=(\<lambda>n. nth_prime (n+1) - nth_prime n)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>n. nth_prime (n + 1) - nth_prime n)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have g_gt_1:"g n>1" when "n\<ge>N" "c n < c (n + 1)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < g n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < g n
[PROOF STEP]
have "nth_prime n + sqrt (nth_prime n) < nth_prime (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
have "nth_prime n + sqrt (nth_prime n) < nth_prime n + a n / (2*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B)
[PROOF STEP]
using N_asm[rule_format,OF \<open>n\<ge>N\<close>] a_pos
[PROOF STATE]
proof (prove)
using this:
c (n + 1) \<noteq> c n \<and> sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B) \<and> h n < real n / 2 \<and> (c n < c (n + 1) \<longrightarrow> real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B) < real (nth_prime (n + 1)))
\<forall>n. 0 < a n

goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B)
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B)

goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B)

goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
have "... < nth_prime (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B) < real (nth_prime (n + 1))
[PROOF STEP]
using N_asm[rule_format,OF \<open>n\<ge>N\<close>] \<open>c n < c (n + 1)\<close>
[PROOF STATE]
proof (prove)
using this:
c (n + 1) \<noteq> c n \<and> sqrt (real (nth_prime n)) / real_of_int (a n) < 1 / real_of_int (2 * B) \<and> h n < real n / 2 \<and> (c n < c (n + 1) \<longrightarrow> real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B) < real (nth_prime (n + 1)))
c n < c (n + 1)

goal (1 subgoal):
 1. real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B) < real (nth_prime (n + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + real_of_int (a n) / real_of_int (2 * B) < real (nth_prime (n + 1))

goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))

goal (1 subgoal):
 1. real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))

goal (1 subgoal):
 1. 1 < g n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))

goal (1 subgoal):
 1. 1 < g n
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))

goal (1 subgoal):
 1. 1 < real (nth_prime (n + 1) - nth_prime n) / sqrt (real (nth_prime n))
[PROOF STEP]
using \<open>c n < c (n + 1)\<close>
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) + sqrt (real (nth_prime n)) < real (nth_prime (n + 1))
c n < c (n + 1)

goal (1 subgoal):
 1. 1 < real (nth_prime (n + 1) - nth_prime n) / sqrt (real (nth_prime n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < g n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?n; c ?n < c (?n + 1)\<rbrakk> \<Longrightarrow> 1 < g ?n

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have g_geq_0:"g n \<ge> 0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> g n
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real (nth_prime (n + 1) - nth_prime n) / sqrt (real (nth_prime n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> g ?n

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "finite S" "\<forall>x\<in>S. x\<ge>N \<and> c x<c (x+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S &&& \<forall>x\<in>S. N \<le> x \<and> c x < c (x + 1)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {n \<in> {N..<2 * N}. c n < c (n + 1)} &&& \<forall>x\<in>{n \<in> {N..<2 * N}. c n < c (n + 1)}. N \<le> x \<and> c x < c (x + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite S
\<forall>x\<in>S. N \<le> x \<and> c x < c (x + 1)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S
\<forall>x\<in>S. N \<le> x \<and> c x < c (x + 1)
[PROOF STEP]
have "card S \<le> sum g S"
[PROOF STATE]
proof (prove)
using this:
finite S
\<forall>x\<in>S. N \<le> x \<and> c x < c (x + 1)

goal (1 subgoal):
 1. real (card S) \<le> sum g S
[PROOF STEP]
proof (induct S)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>x\<in>{}. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card {}) \<le> sum g {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{}. N \<le> x \<and> c x < c (x + 1)

goal (2 subgoals):
 1. \<forall>x\<in>{}. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card {}) \<le> sum g {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{}. N \<le> x \<and> c x < c (x + 1)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{}. N \<le> x \<and> c x < c (x + 1)

goal (1 subgoal):
 1. real (card {}) \<le> sum g {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card {}) \<le> sum g {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F
\<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F
\<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
have "g x>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < g x
[PROOF STEP]
have "c x < c (x+1)" "x\<ge>N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c x < c (x + 1) &&& N \<le> x
[PROOF STEP]
using insert(4)
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)

goal (1 subgoal):
 1. c x < c (x + 1) &&& N \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c x < c (x + 1)
N \<le> x

goal (1 subgoal):
 1. 1 < g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c x < c (x + 1)
N \<le> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c x < c (x + 1)
N \<le> x

goal (1 subgoal):
 1. 1 < g x
[PROOF STEP]
using g_gt_1
[PROOF STATE]
proof (prove)
using this:
c x < c (x + 1)
N \<le> x
\<lbrakk>N \<le> ?n; c ?n < c (?n + 1)\<rbrakk> \<Longrightarrow> 1 < g ?n

goal (1 subgoal):
 1. 1 < g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < g x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 < g x

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F; \<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)\<rbrakk> \<Longrightarrow> real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
\<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F
\<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)
1 < g x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<forall>x\<in>F. N \<le> x \<and> c x < c (x + 1) \<Longrightarrow> real (card F) \<le> sum g F
\<forall>x\<in>insert x F. N \<le> x \<and> c x < c (x + 1)
1 < g x

goal (1 subgoal):
 1. real (card (insert x F)) \<le> sum g (insert x F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (card (insert x F)) \<le> sum g (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (card S) \<le> sum g S

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card S) \<le> sum g S

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... \<le> sum g {N..<2*N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g S \<le> sum g {N..<2 * N}
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {N..<2 * N}
 2. S \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - S \<Longrightarrow> 0 \<le> g b
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {N..<2 * N}
 2. {n \<in> {N..<2 * N}. c n < c (n + 1)} \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - {n \<in> {N..<2 * N}. c n < c (n + 1)} \<Longrightarrow> 0 \<le> g b
[PROOF STEP]
using g_geq_0
[PROOF STATE]
proof (prove)
using this:
0 \<le> g ?n

goal (3 subgoals):
 1. finite {N..<2 * N}
 2. {n \<in> {N..<2 * N}. c n < c (n + 1)} \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - {n \<in> {N..<2 * N}. c n < c (n + 1)} \<Longrightarrow> 0 \<le> g b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum g S \<le> sum g {N..<2 * N}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum g S \<le> sum g {N..<2 * N}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... \<le> sum (\<lambda>n. f n/sqrt (nth_prime N)) {N..<2*N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g {N..<2 * N} \<le> (\<Sum>n = N..<2 * N. real (f n) / sqrt (real (nth_prime N)))
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = N..<2 * N. real (nth_prime (n + 1) - nth_prime n) / sqrt (real (nth_prime n))) \<le> (\<Sum>n = N..<2 * N. real (nth_prime (n + 1) - nth_prime n) / sqrt (real (nth_prime N)))
[PROOF STEP]
by (auto intro!:sum_mono divide_left_mono)
[PROOF STATE]
proof (state)
this:
sum g {N..<2 * N} \<le> (\<Sum>n = N..<2 * N. real (f n) / sqrt (real (nth_prime N)))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum g {N..<2 * N} \<le> (\<Sum>n = N..<2 * N. real (f n) / sqrt (real (nth_prime N)))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... = sum f {N..<2*N} / sqrt (nth_prime N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = N..<2 * N. real (f n) / sqrt (real (nth_prime N))) = real (sum f {N..<2 * N}) / sqrt (real (nth_prime N))
[PROOF STEP]
unfolding sum_divide_distrib[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = N..<2 * N. real (f n)) / sqrt (real (nth_prime N)) = real (sum f {N..<2 * N}) / sqrt (real (nth_prime N))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n = N..<2 * N. real (f n) / sqrt (real (nth_prime N))) = real (sum f {N..<2 * N}) / sqrt (real (nth_prime N))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = N..<2 * N. real (f n) / sqrt (real (nth_prime N))) = real (sum f {N..<2 * N}) / sqrt (real (nth_prime N))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... = (nth_prime (2*N) - nth_prime N) / sqrt (nth_prime N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))
[PROOF STEP]
have "sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N
[PROOF STEP]
proof (induct N)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sum f {0..<2 * 0} = nth_prime (2 * 0) - nth_prime 0
 2. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. sum f {0..<2 * 0} = nth_prime (2 * 0) - nth_prime 0
 2. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {0..<2 * 0} = nth_prime (2 * 0) - nth_prime 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {0..<2 * 0} = nth_prime (2 * 0) - nth_prime 0

goal (1 subgoal):
 1. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
case (Suc N)
[PROOF STATE]
proof (state)
this:
sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N

goal (1 subgoal):
 1. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have ?case if "N=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have "sum f {Suc N..<2 * Suc N} = sum f {1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = sum f {1}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
N = 0

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = sum f {1}
[PROOF STEP]
by (simp add: numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = sum f {1}

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = sum f {1}

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have "... = nth_prime 2 - nth_prime 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {1} = nth_prime 2 - nth_prime 1
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<in>{1}. nth_prime (n + 1) - nth_prime n) = nth_prime 2 - nth_prime 1
[PROOF STEP]
by (simp add:numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
sum f {1} = nth_prime 2 - nth_prime 1

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {1} = nth_prime 2 - nth_prime 1

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have "... = nth_prime (2 * Suc N) - nth_prime (Suc N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_prime 2 - nth_prime 1 = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
N = 0

goal (1 subgoal):
 1. nth_prime 2 - nth_prime 1 = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nth_prime 2 - nth_prime 1 = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N = 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
N = 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have ?case if "N\<noteq>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have "sum f {Suc N..<2 * Suc N} = sum f {N..<2 * Suc N} - f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = sum f {N..<2 * Suc N} - f N
[PROOF STEP]
apply (subst (2) sum.atLeast_Suc_lessThan)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. N < 2 * Suc N
 2. sum f {Suc N..<2 * Suc N} = f N + sum f {Suc N..<2 * Suc N} - f N
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
N \<noteq> 0

goal (2 subgoals):
 1. N < 2 * Suc N
 2. sum f {Suc N..<2 * Suc N} = f N + sum f {Suc N..<2 * Suc N} - f N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = sum f {N..<2 * Suc N} - f N

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = sum f {N..<2 * Suc N} - f N

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have "... = sum f {N..<2 * N}+ f (2*N) + f(2*N+1) - f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {N..<2 * Suc N} - f N = sum f {N..<2 * N} + f (2 * N) + f (2 * N + 1) - f N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f {N..<2 * Suc N} - f N = sum f {N..<2 * N} + f (2 * N) + f (2 * N + 1) - f N

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {N..<2 * Suc N} - f N = sum f {N..<2 * N} + f (2 * N) + f (2 * N + 1) - f N

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
have "... = nth_prime (2 * Suc N) - nth_prime (Suc N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {N..<2 * N} + f (2 * N) + f (2 * N + 1) - f N = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N

goal (1 subgoal):
 1. sum f {N..<2 * N} + f (2 * N) + f (2 * N + 1) - f N = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>a = N..<2 * N. nth_prime (a + 1) - nth_prime a) = nth_prime (2 * N) - nth_prime N

goal (1 subgoal):
 1. (\<Sum>n = N..<2 * N. nth_prime (n + 1) - nth_prime n) + (nth_prime (2 * N + 1) - nth_prime (2 * N)) + (nth_prime (2 * N + 1 + 1) - nth_prime (2 * N + 1)) - (nth_prime (N + 1) - nth_prime N) = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum f {N..<2 * N} + f (2 * N) + f (2 * N + 1) - f N = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N \<noteq> 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. \<And>N. sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
N = 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
N \<noteq> 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
N = 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
N \<noteq> 0 \<Longrightarrow> sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal (1 subgoal):
 1. sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum f {Suc N..<2 * Suc N} = nth_prime (2 * Suc N) - nth_prime (Suc N)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N

goal (1 subgoal):
 1. real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f {N..<2 * N} = nth_prime (2 * N) - nth_prime N

goal (1 subgoal):
 1. real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (sum f {N..<2 * N}) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... = h N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N)) = h N
[PROOF STEP]
unfolding h_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N)) = real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N)) = h N

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (nth_prime (2 * N) - nth_prime N) / sqrt (real (nth_prime N)) = h N

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... < N/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h N < real N / 2
[PROOF STEP]
using N_asm
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<ge>N. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))

goal (1 subgoal):
 1. h N < real N / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h N < real N / 2

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (card S) < real N / 2
[PROOF STEP]
have "card S < N/2"
[PROOF STATE]
proof (prove)
using this:
real (card S) < real N / 2

goal (1 subgoal):
 1. real (card S) < real N / 2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real (card S) < real N / 2

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
define T where "T={n \<in> {N..<2 * N}. c n > c (n + 1)}"
[PROOF STATE]
proof (state)
this:
T = {n \<in> {N..<2 * N}. c (n + 1) < c n}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "T \<union> S = {N..<2 * N}" "T \<inter> S = {}" "finite T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<union> S = {N..<2 * N} &&& T \<inter> S = {} &&& finite T
[PROOF STEP]
unfolding T_def S_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {n \<in> {N..<2 * N}. c (n + 1) < c n} \<union> {n \<in> {N..<2 * N}. c n < c (n + 1)} = {N..<2 * N} &&& {n \<in> {N..<2 * N}. c (n + 1) < c n} \<inter> {n \<in> {N..<2 * N}. c n < c (n + 1)} = {} &&& finite {n \<in> {N..<2 * N}. c (n + 1) < c n}
[PROOF STEP]
using N_asm
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<ge>N. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))

goal (1 subgoal):
 1. {n \<in> {N..<2 * N}. c (n + 1) < c n} \<union> {n \<in> {N..<2 * N}. c n < c (n + 1)} = {N..<2 * N} &&& {n \<in> {N..<2 * N}. c (n + 1) < c n} \<inter> {n \<in> {N..<2 * N}. c n < c (n + 1)} = {} &&& finite {n \<in> {N..<2 * N}. c (n + 1) < c n}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
T \<union> S = {N..<2 * N}
T \<inter> S = {}
finite T

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T \<union> S = {N..<2 * N}
T \<inter> S = {}
finite T
[PROOF STEP]
have "card T + card S = card {N..<2 * N}"
[PROOF STATE]
proof (prove)
using this:
T \<union> S = {N..<2 * N}
T \<inter> S = {}
finite T

goal (1 subgoal):
 1. card T + card S = card {N..<2 * N}
[PROOF STEP]
using card_Un_disjoint \<open>finite S\<close>
[PROOF STATE]
proof (prove)
using this:
T \<union> S = {N..<2 * N}
T \<inter> S = {}
finite T
\<lbrakk>finite ?A; finite ?B; ?A \<inter> ?B = {}\<rbrakk> \<Longrightarrow> card (?A \<union> ?B) = card ?A + card ?B
finite S

goal (1 subgoal):
 1. card T + card S = card {N..<2 * N}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card T + card S = card {N..<2 * N}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card T + card S = card {N..<2 * N}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
have "... = N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {N..<2 * N} = N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {N..<2 * N} = N

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card T + card S = N
[PROOF STEP]
have "card T + card S = N"
[PROOF STATE]
proof (prove)
using this:
card T + card S = N

goal (1 subgoal):
 1. card T + card S = N
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card T + card S = N

goal (1 subgoal):
 1. \<And>x. \<lbrakk>?z1 \<le> x; \<forall>y\<ge>x. c (y + 1) \<noteq> c y \<and> sqrt (real (nth_prime y)) / real_of_int (a y) < 1 / real_of_int (2 * B) \<and> h y < real y / 2 \<and> (c y < c (y + 1) \<longrightarrow> real (nth_prime y) + real_of_int (a y) / real_of_int (2 * B) < real (nth_prime (y + 1)))\<rbrakk> \<Longrightarrow> real x / 2 < real (card {n \<in> {x..<2 * x}. c (n + 1) < c n})
[PROOF STEP]
with \<open>card S < N/2\<close>
[PROOF STATE]
proof (chain)
picking this:
real (card S) < real N / 2
card T + card S = N
[PROOF STEP]
show "card T > N/2"
[PROOF STATE]
proof (prove)
using this:
real (card S) < real N / 2
card T + card S = N

goal (1 subgoal):
 1. real N / 2 < real (card T)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real N / 2 < real (card T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
text\<open>Inequality (3.5) in the original paper required a slight modification: \<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_gt_plus:"\<forall>\<^sub>F n in sequentially. c n > c (n+1) \<longrightarrow>a (n+1) > a n + (a n - c(n+1) - 1) / c (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
note a_gt_1[THEN eventually_all_ge_at_top] c_pos[THEN eventually_all_ge_at_top]
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 1 < a y
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 0 < c y

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 1 < a y
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 0 < c y

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially.
              B * int (nth_prime (n+1)) = c (n+1) * a (n+1) - c (n + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
[PROOF STEP]
using Bc_large
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
[PROOF STEP]
apply (subst (asm) eventually_sequentially_Suc[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in sequentially. B * int (nth_prime (Suc i)) = c (Suc i) * a (Suc i) - c (Suc i + 1) \<and> \<bar>real_of_int (c (Suc i + 1))\<bar> < real_of_int (a (Suc i)) / 2 \<Longrightarrow> \<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
[PROOF STEP]
by (auto elim:eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially.
                        B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>c (n + 1)\<bar> <  a n / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
[PROOF STEP]
using Bc_large
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
[PROOF STEP]
by (auto elim:eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 1 < a y
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 0 < c y
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 1 < a y
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 0 < c y
\<forall>\<^sub>F n in sequentially. B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
apply (eventually_elim)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
proof (rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
assume "\<forall>y\<ge>n. 1 < a y" "\<forall>y\<ge>n. 0 < c y"
        and
        Suc_n_eq:"B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)" and
        "B * int (nth_prime n) = c n * a n - c (n + 1) \<and>
                real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2"
        and "c (n + 1) < c n"
[PROOF STATE]
proof (state)
this:
\<forall>y\<ge>n. 1 < a y
\<forall>y\<ge>n. 0 < c y
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
c (n + 1) < c n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<ge>n. 1 < a y
\<forall>y\<ge>n. 0 < c y
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
c (n + 1) < c n
[PROOF STEP]
have n_eq:"B * int (nth_prime n) = c n * a n - c (n + 1)" and
        c_less_a: "real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<ge>n. 1 < a y
\<forall>y\<ge>n. 0 < c y
B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
c (n + 1) < c n

goal (1 subgoal):
 1. B * int (nth_prime n) = c n * a n - c (n + 1) &&& real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B * int (nth_prime n) = c n * a n - c (n + 1)
real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
from \<open>\<forall>y\<ge>n. 1 < a y\<close> \<open>\<forall>y\<ge>n. 0 < c y\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<ge>n. 1 < a y
\<forall>y\<ge>n. 0 < c y
[PROOF STEP]
have *:"a n>1" "a (n+1) > 1" "c n > 0"
        "c (n+1) > 0"  "c (n+2) > 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<ge>n. 1 < a y
\<forall>y\<ge>n. 0 < c y

goal (1 subgoal):
 1. (1 < a n &&& 1 < a (n + 1)) &&& 0 < c n &&& 0 < c (n + 1) &&& 0 < c (n + 2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 < a n
1 < a (n + 1)
0 < c n
0 < c (n + 1)
0 < c (n + 2)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < a n
1 < a (n + 1)
0 < c n
0 < c (n + 1)
0 < c (n + 2)
[PROOF STEP]
have "(1+1/c (n+1))* (a n - 1)/a (n+1) = (c (n+1)+1) * ((a n - 1) / (c (n+1) * a (n+1)))"
[PROOF STATE]
proof (prove)
using this:
1 < a n
1 < a (n + 1)
0 < c n
0 < c (n + 1)
0 < c (n + 2)

goal (1 subgoal):
 1. (1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) = real_of_int (c (n + 1) + 1) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1)))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) = real_of_int (c (n + 1) + 1) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) = real_of_int (c (n + 1) + 1) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "... \<le> c n * ((a n - 1) / (c (n+1) * a (n+1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c (n + 1) + 1) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))) \<le> real_of_int (c n) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1)))
[PROOF STEP]
apply (rule mult_right_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. real_of_int (c (n + 1) + 1) \<le> real_of_int (c n)
 2. 0 \<le> real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c (n + 1) + 1) \<le> real_of_int (c n)
[PROOF STEP]
using \<open>c (n + 1) < c n\<close>
[PROOF STATE]
proof (prove)
using this:
c (n + 1) < c n

goal (1 subgoal):
 1. real_of_int (c (n + 1) + 1) \<le> real_of_int (c n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))
[PROOF STEP]
by (smt \<open>0 < c (n + 1)\<close> a_pos divide_nonneg_pos mult_pos_pos of_int_0_le_iff
              of_int_0_less_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1) + 1) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))) \<le> real_of_int (c n) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1) + 1) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))) \<le> real_of_int (c n) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "... = (c n * (a n - 1)) / (c (n+1) * a (n+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c n) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))) = real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (c n) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))) = real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c n) * (real_of_int (a n - 1) / real_of_int (c (n + 1) * a (n + 1))) = real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "... < (c n * (a n - 1)) / (c (n+1) * a (n+1)  - c (n+2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1)) < real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2))
[PROOF STEP]
apply (rule divide_strict_left_mono)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) < real_of_int (c (n + 1) * a (n + 1))
 2. 0 < real_of_int (c n * (a n - 1))
 3. 0 < real_of_int (c (n + 1) * a (n + 1)) * real_of_int (c (n + 1) * a (n + 1) - c (n + 2))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) < real_of_int (c (n + 1) * a (n + 1))
[PROOF STEP]
using \<open>c (n+2) > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c (n + 2)

goal (1 subgoal):
 1. real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) < real_of_int (c (n + 1) * a (n + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < real_of_int (c n * (a n - 1))
 2. 0 < real_of_int (c (n + 1) * a (n + 1)) * real_of_int (c (n + 1) * a (n + 1) - c (n + 2))
[PROOF STEP]
unfolding Suc_n_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < real_of_int (c n * (a n - 1))
 2. 0 < real_of_int (c (n + 1) * a (n + 1)) * real_of_int (B * int (nth_prime (n + 1)))
[PROOF STEP]
using * \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
1 < a n
1 < a (n + 1)
0 < c n
0 < c (n + 1)
0 < c (n + 2)
0 < B

goal (2 subgoals):
 1. 0 < real_of_int (c n * (a n - 1))
 2. 0 < real_of_int (c (n + 1) * a (n + 1)) * real_of_int (B * int (nth_prime (n + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1)) < real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1)) < real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "... < (c n * a n - c (n+1)) / (c (n+1) * a (n+1)  - c (n+2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) < real_of_int (c n * a n - c (n + 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2))
[PROOF STEP]
apply (rule frac_less)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<le> real_of_int (c n * (a n - 1))
 2. real_of_int (c n * (a n - 1)) < real_of_int (c n * a n - c (n + 1))
 3. 0 < real_of_int (c (n + 1) * a (n + 1) - c (n + 2))
 4. real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) \<le> real_of_int (c (n + 1) * a (n + 1) - c (n + 2))
[PROOF STEP]
unfolding Suc_n_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<le> real_of_int (c n * (a n - 1))
 2. real_of_int (c n * (a n - 1)) < real_of_int (c n * a n - c (n + 1))
 3. 0 < real_of_int (B * int (nth_prime (n + 1)))
 4. real_of_int (B * int (nth_prime (n + 1))) \<le> real_of_int (B * int (nth_prime (n + 1)))
[PROOF STEP]
using * \<open>B>0\<close> \<open>c (n + 1) < c n\<close>
[PROOF STATE]
proof (prove)
using this:
1 < a n
1 < a (n + 1)
0 < c n
0 < c (n + 1)
0 < c (n + 2)
0 < B
c (n + 1) < c n

goal (4 subgoals):
 1. 0 \<le> real_of_int (c n * (a n - 1))
 2. real_of_int (c n * (a n - 1)) < real_of_int (c n * a n - c (n + 1))
 3. 0 < real_of_int (B * int (nth_prime (n + 1)))
 4. real_of_int (B * int (nth_prime (n + 1))) \<le> real_of_int (B * int (nth_prime (n + 1)))
[PROOF STEP]
by (auto simp:algebra_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) < real_of_int (c n * a n - c (n + 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c n * (a n - 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) < real_of_int (c n * a n - c (n + 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "... = nth_prime n / nth_prime (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c n * a n - c (n + 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) = real (nth_prime n) / real (nth_prime (n + 1))
[PROOF STEP]
unfolding Suc_n_eq[symmetric] n_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (B * int (nth_prime (n + 1))) = real (nth_prime n) / real (nth_prime (n + 1))
[PROOF STEP]
using \<open>B>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < B

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (B * int (nth_prime (n + 1))) = real (nth_prime n) / real (nth_prime (n + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (c n * a n - c (n + 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) = real (nth_prime n) / real (nth_prime (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c n * a n - c (n + 1)) / real_of_int (c (n + 1) * a (n + 1) - c (n + 2)) = real (nth_prime n) / real (nth_prime (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
have "... < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (nth_prime n) / real (nth_prime (n + 1)) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (nth_prime n) / real (nth_prime (n + 1)) < 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1
[PROOF STEP]
have "(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1)
        / real_of_int (a (n + 1)) < 1 "
[PROOF STATE]
proof (prove)
using this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1

goal (1 subgoal):
 1. (1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>y\<ge>n. 1 < a y; \<forall>y\<ge>n. 0 < c y; B * int (nth_prime (n + 1)) = c (n + 1) * a (n + 1) - c (n + 2); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2; c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1
[PROOF STEP]
show "a n + (a n - c (n + 1) - 1) /  (c (n + 1)) < (a (n + 1))"
[PROOF STATE]
proof (prove)
using this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1

goal (1 subgoal):
 1. real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
(1 + 1 / real_of_int (c (n + 1))) * real_of_int (a n - 1) / real_of_int (a (n + 1)) < 1
1 < a n
1 < a (n + 1)
0 < c n
0 < c (n + 1)
0 < c (n + 2)

goal (1 subgoal):
 1. real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_gt_1:"\<forall>\<^sub>F n in sequentially. c n > c (n+1) \<longrightarrow> a (n+1) > a n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
using Bc_large a_gt_plus c_pos[THEN eventually_all_ge_at_top]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 0 < c y

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y\<rbrakk> \<Longrightarrow> c (n + 1) < c n \<longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
proof (rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
assume
      "c (n + 1) < c n \<longrightarrow> a n +  (a n - c (n + 1) - 1) / c (n + 1) <  a (n + 1)"
      "c (n + 1) < c n" and B_eq:"B * int (nth_prime n) = c n * a n - c (n + 1) \<and>
         \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2" and c_pos:"\<forall>y\<ge>n. 0 < c y"
[PROOF STATE]
proof (state)
this:
c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
c (n + 1) < c n
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
\<forall>y\<ge>n. 0 < c y

goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
from this(1,2)
[PROOF STATE]
proof (chain)
picking this:
c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
c (n + 1) < c n
[PROOF STEP]
have "a n +  (a n - c (n + 1) - 1) / c (n + 1) <  a (n + 1)"
[PROOF STATE]
proof (prove)
using this:
c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
c (n + 1) < c n

goal (1 subgoal):
 1. real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
have "a n - 2 * c (n+1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a n - 2 * c (n + 1)
[PROOF STEP]
using B_eq c_pos[rule_format,of "n+1"]
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
n \<le> n + 1 \<Longrightarrow> 0 < c (n + 1)

goal (1 subgoal):
 1. 0 < a n - 2 * c (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < a n - 2 * c (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a n - 2 * c (n + 1)
[PROOF STEP]
have "a n - 2 * c (n+1) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
0 < a n - 2 * c (n + 1)

goal (1 subgoal):
 1. 1 \<le> a n - 2 * c (n + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> a n - 2 * c (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> a n - 2 * c (n + 1)
[PROOF STEP]
have "(a n - c (n + 1) - 1) / c (n + 1) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> a n - 2 * c (n + 1)

goal (1 subgoal):
 1. 1 \<le> real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))
[PROOF STEP]
using c_pos[rule_format,of "n+1"]
[PROOF STATE]
proof (prove)
using this:
1 \<le> a n - 2 * c (n + 1)
n \<le> n + 1 \<Longrightarrow> 0 < c (n + 1)

goal (1 subgoal):
 1. 1 \<le> real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
1 \<le> real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); \<forall>y\<ge>n. 0 < c y; c (n + 1) < c n\<rbrakk> \<Longrightarrow> a n + 1 < a (n + 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
1 \<le> real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))
[PROOF STEP]
show "a n + 1 < a (n + 1)"
[PROOF STATE]
proof (prove)
using this:
real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
1 \<le> real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))

goal (1 subgoal):
 1. a n + 1 < a (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a n + 1 < a (n + 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> a n + 1 < a (n + 1)

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
text\<open>The following corresponds to inequality (3.6) in the paper, which had to be
        slightly corrected:  \<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> a n + 1 < a (n + 1)

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_gt_sqrt:"\<forall>\<^sub>F n in sequentially. c n > c (n+1) \<longrightarrow> a (n+1) > a n + (sqrt n - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have a_2N:"\<forall>\<^sub>F N in sequentially. a (2*N) \<ge> N /2 +1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
using c_gt_half a_gt_1[THEN eventually_all_ge_at_top]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
case (elim N)
[PROOF STATE]
proof (state)
this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
define S where "S={n \<in> {N..<2 * N}. c (n + 1) < c n}"
[PROOF STATE]
proof (state)
this:
S = {n \<in> {N..<2 * N}. c (n + 1) < c n}

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
define f where "f = (\<lambda>n. a (Suc n) - a n)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>n. a (Suc n) - a n)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
have f_1:"\<forall>x\<in>S. f x\<ge>1" and f_0:"\<forall>x. f x\<ge>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. 1 \<le> f x &&& \<forall>x. 0 \<le> f x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. 1 \<le> f x
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)

goal (1 subgoal):
 1. \<forall>x\<in>S. 1 \<le> f x
[PROOF STEP]
unfolding S_def f_def
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)

goal (1 subgoal):
 1. \<forall>x\<in>{n \<in> {N..<2 * N}. c (n + 1) < c n}. 1 \<le> a (Suc x) - a x
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 \<le> f x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 \<le> f x
[PROOF STEP]
using \<open>mono a\<close>[THEN incseq_SucD]
[PROOF STATE]
proof (prove)
using this:
a ?i \<le> a (Suc ?i)

goal (1 subgoal):
 1. \<forall>x. 0 \<le> f x
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
a ?i \<le> a (Suc ?i)

goal (1 subgoal):
 1. \<forall>x. 0 \<le> a (Suc x) - a x
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. 1 \<le> f x
\<forall>x. 0 \<le> f x

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
have "N / 2 < card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N / 2 < real (card S)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)

goal (1 subgoal):
 1. real N / 2 < real (card S)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)

goal (1 subgoal):
 1. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real N / 2 < real (card S)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real N / 2 < real (card S)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
have "... \<le> sum f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card S) \<le> real_of_int (sum f S)
[PROOF STEP]
unfolding of_int_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card S) \<le> (\<Sum>x\<in>S. real_of_int (f x))
[PROOF STEP]
apply (rule sum_bounded_below[of _ 1,simplified])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> S \<Longrightarrow> 1 \<le> real_of_int (f i)
[PROOF STEP]
using f_1
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. 1 \<le> f x

goal (1 subgoal):
 1. \<And>i. i \<in> S \<Longrightarrow> 1 \<le> real_of_int (f i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card S) \<le> real_of_int (sum f S)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card S) \<le> real_of_int (sum f S)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
have "... \<le> sum f {N..<2 * N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (sum f S) \<le> real_of_int (sum f {N..<2 * N})
[PROOF STEP]
unfolding of_int_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>S. real_of_int (f x)) \<le> (\<Sum>x = N..<2 * N. real_of_int (f x))
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {N..<2 * N}
 2. S \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - S \<Longrightarrow> 0 \<le> real_of_int (f b)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {N..<2 * N}
 2. {n \<in> {N..<2 * N}. c (n + 1) < c n} \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - {n \<in> {N..<2 * N}. c (n + 1) < c n} \<Longrightarrow> 0 \<le> real_of_int (f b)
[PROOF STEP]
using f_0
[PROOF STATE]
proof (prove)
using this:
\<forall>x. 0 \<le> f x

goal (3 subgoals):
 1. finite {N..<2 * N}
 2. {n \<in> {N..<2 * N}. c (n + 1) < c n} \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - {n \<in> {N..<2 * N}. c (n + 1) < c n} \<Longrightarrow> 0 \<le> real_of_int (f b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (sum f S) \<le> real_of_int (sum f {N..<2 * N})

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (sum f S) \<le> real_of_int (sum f {N..<2 * N})

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
have "... = a (2*N) - a N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (sum f {N..<2 * N}) = real_of_int (a (2 * N) - a N)
[PROOF STEP]
unfolding of_int_sum f_def of_int_diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x = N..<2 * N. real_of_int (a (Suc x)) - real_of_int (a x)) = real_of_int (a (2 * N)) - real_of_int (a N)
[PROOF STEP]
apply (rule sum_Suc_diff')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> 2 * N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (sum f {N..<2 * N}) = real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real N / 2 < real_of_int (a (2 * N) - a N)
[PROOF STEP]
have "N / 2 < a (2*N) - a N"
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. real N / 2 < real_of_int (a (2 * N) - a N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real N / 2 < real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> a y + 1 < a (y + 1)\<rbrakk> \<Longrightarrow> real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real N / 2 < real_of_int (a (2 * N) - a N)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
using a_pos[rule_format,of N]
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real_of_int (a (2 * N) - a N)
0 < a N

goal (1 subgoal):
 1. real N / 2 + 1 \<le> real_of_int (a (2 * N))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real N / 2 + 1 \<le> real_of_int (a (2 * N))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. real N / 2 + 1 \<le> real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have a_n4:"\<forall>\<^sub>F n in sequentially. a n > n/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)
[PROOF STEP]
obtain N where a_N:"\<forall>n\<ge>N. a (2*n) \<ge> n /2+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. real n / 2 + 1 \<le> real_of_int (a (2 * n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using a_2N
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. real N / 2 + 1 \<le> real_of_int (a (2 * N))

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. real n / 2 + 1 \<le> real_of_int (a (2 * n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. real n / 2 + 1 \<le> real_of_int (a (2 * n))

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. real n / 2 + 1 \<le> real_of_int (a (2 * n)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. real n / 2 + 1 \<le> real_of_int (a (2 * n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)
[PROOF STEP]
have "a n>n/4" when "n\<ge>2*N" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
define n' where "n'=n div 2"
[PROOF STATE]
proof (state)
this:
n' = n div 2

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
have "n'\<ge>N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> n'
[PROOF STEP]
unfolding n'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> n div 2
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
2 * N \<le> n

goal (1 subgoal):
 1. N \<le> n div 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> n'

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
have "n/4 < n' /2+1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n / 4 < real n' / 2 + 1
[PROOF STEP]
unfolding n'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n / 4 < real (n div 2) / 2 + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real n / 4 < real n' / 2 + 1

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n / 4 < real n' / 2 + 1

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
have "... \<le> a (2*n')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n' / 2 + 1 \<le> real_of_int (a (2 * n'))
[PROOF STEP]
using a_N \<open>n'\<ge>N\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>N. real n / 2 + 1 \<le> real_of_int (a (2 * n))
N \<le> n'

goal (1 subgoal):
 1. real n' / 2 + 1 \<le> real_of_int (a (2 * n'))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real n' / 2 + 1 \<le> real_of_int (a (2 * n'))

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n' / 2 + 1 \<le> real_of_int (a (2 * n'))

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
have "... \<le>a n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a (2 * n')) \<le> real_of_int (a n)
[PROOF STEP]
unfolding n'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a (2 * (n div 2))) \<le> real_of_int (a n)
[PROOF STEP]
apply (cases "even n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. even n \<Longrightarrow> real_of_int (a (2 * (n div 2))) \<le> real_of_int (a n)
 2. odd n \<Longrightarrow> real_of_int (a (2 * (n div 2))) \<le> real_of_int (a n)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even n \<Longrightarrow> real_of_int (a (2 * (n div 2))) \<le> real_of_int (a n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd n \<Longrightarrow> real_of_int (a (2 * (n div 2))) \<le> real_of_int (a n)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd n \<Longrightarrow> real_of_int (a (2 * (n div 2))) \<le> real_of_int (a n)
[PROOF STEP]
by (simp add: assms(2) incseqD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real_of_int (a (2 * n')) \<le> real_of_int (a n)

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real n / 4 < real_of_int (a n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real n / 4 < real_of_int (a n)

goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real n / 4 < real_of_int (a n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 * N \<le> ?n \<Longrightarrow> real ?n / 4 < real_of_int (a ?n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * N \<le> ?n \<Longrightarrow> real ?n / 4 < real_of_int (a ?n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 * N \<le> ?n \<Longrightarrow> real ?n / 4 < real_of_int (a ?n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)
[PROOF STEP]
unfolding eventually_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
2 * N \<le> ?n \<Longrightarrow> real ?n / 4 < real_of_int (a ?n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. real n / 4 < real_of_int (a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have c_sqrt:"\<forall>\<^sub>F n in sequentially. c n < sqrt n / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. x>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((<) 1) sequentially
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eventually ((<) 1) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
eventually ((<) 1) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
[PROOF STEP]
using nth_prime_asymptotics[unfolded asymp_equiv_def,THEN order_tendstoD(2),of 2]
[PROOF STATE]
proof (prove)
using this:
1 < 2 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. (if real (nth_prime x) = 0 \<and> real x * ln (real x) = 0 then 1 else real (nth_prime x) / (real x * ln (real x))) < 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
eventually ((<) 1) sequentially
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. c n < B*8 *ln n + 1"
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 1) sequentially
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
using a_n4 Bc_large
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 1) sequentially
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
\<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)
\<forall>\<^sub>F n in sequentially. B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
1 < n
real (nth_prime n) / (real n * ln (real n)) < 2
real n / 4 < real_of_int (a n)
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
from this(4)
[PROOF STATE]
proof (chain)
picking this:
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
[PROOF STEP]
have "c n=(B*nth_prime n+c (n+1))/a n"
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. real_of_int (c n) = real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n)
[PROOF STEP]
using a_pos[rule_format,of n]
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2
0 < a n

goal (1 subgoal):
 1. real_of_int (c n) = real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n)
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (c n) = real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (c n) = real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
have "... = (B*nth_prime n)/a n+c (n+1)/a n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n) = real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n)
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n) = real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n) + c (n + 1)) / real_of_int (a n) = real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
have "... < (B*nth_prime n)/a n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1
[PROOF STEP]
have "c (n+1)/a n < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (a n) < 1
[PROOF STEP]
using elim(4)
[PROOF STATE]
proof (prove)
using this:
B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2

goal (1 subgoal):
 1. real_of_int (c (n + 1)) / real_of_int (a n) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (c (n + 1)) / real_of_int (a n) < 1

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_int (c (n + 1)) / real_of_int (a n) < 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int (c (n + 1)) / real_of_int (a n) < 1

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) + real_of_int (c (n + 1)) / real_of_int (a n) < real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
have "... < B*8 * ln n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
have "B*nth_prime n < 2*B*n*ln n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)
[PROOF STEP]
using \<open>real (nth_prime n) / (real n * ln (real n)) < 2\<close> \<open>B>0\<close> \<open> 1 < n\<close>
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) / (real n * ln (real n)) < 2
0 < B
1 < n

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
have "real n / 4 < real_of_int (a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n / 4 < real_of_int (a n)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
real n / 4 < real_of_int (a n)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)
real n / 4 < real_of_int (a n)
[PROOF STEP]
have "(B*nth_prime n) / a n < (2*B*n*ln n) / (n/4)"
[PROOF STATE]
proof (prove)
using this:
real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)
real n / 4 < real_of_int (a n)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) < real_of_int (2 * B * int n) * ln (real n) / (real n / 4)
[PROOF STEP]
apply (rule_tac frac_less)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> 0 \<le> real_of_int (B * int (nth_prime n))
 2. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)
 3. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> 0 < real n / 4
 4. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> real n / 4 \<le> real_of_int (a n)
[PROOF STEP]
using \<open>B>0\<close> \<open> 1 < n\<close>
[PROOF STATE]
proof (prove)
using this:
0 < B
1 < n

goal (4 subgoals):
 1. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> 0 \<le> real_of_int (B * int (nth_prime n))
 2. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n)
 3. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> 0 < real n / 4
 4. \<lbrakk>real_of_int (B * int (nth_prime n)) < real_of_int (2 * B * int n) * ln (real n); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> real n / 4 \<le> real_of_int (a n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) < real_of_int (2 * B * int n) * ln (real n) / (real n / 4)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) < real_of_int (2 * B * int n) * ln (real n) / (real n / 4)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
have "... = B*8 * ln n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (2 * B * int n) * ln (real n) / (real n / 4) = real_of_int (B * 8) * ln (real n)
[PROOF STEP]
using \<open> 1 < n\<close>
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. real_of_int (2 * B * int n) * ln (real n) / (real n / 4) = real_of_int (B * 8) * ln (real n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (2 * B * int n) * ln (real n) / (real n / 4) = real_of_int (B * 8) * ln (real n)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) < real_of_int (B * 8) * ln (real n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) < real_of_int (B * 8) * ln (real n)

goal (1 subgoal):
 1. real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_int (B * int (nth_prime n)) / real_of_int (a n) + 1 < real_of_int (B * 8) * ln (real n) + 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>1 < n; real (nth_prime n) / (real n * ln (real n)) < 2; real n / 4 < real_of_int (a n); B * int (nth_prime n) = c n * a n - c (n + 1) \<and> \<bar>real_of_int (c (n + 1))\<bar> < real_of_int (a n) / 2\<rbrakk> \<Longrightarrow> real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1

goal (1 subgoal):
 1. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. B*8 *ln n + 1 < sqrt n / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (B * 8) * ln (real n) + 1 < sqrt (real n) / 4
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (B * 8) * ln (real n) + 1 < sqrt (real n) / 4

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
\<forall>\<^sub>F n in sequentially. real_of_int (B * 8) * ln (real n) + 1 < sqrt (real n) / 4
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real_of_int (c n) < real_of_int (B * 8) * ln (real n) + 1
\<forall>\<^sub>F n in sequentially. real_of_int (B * 8) * ln (real n) + 1 < sqrt (real n) / 4

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real_of_int (c n) < sqrt (real n) / 4

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have
      "\<forall>\<^sub>F n in sequentially. 0 < c (n+1)"
      "\<forall>\<^sub>F n in sequentially. c (n+1) < sqrt (n+1) / 4"
      "\<forall>\<^sub>F n in sequentially. n > 4"
      "\<forall>\<^sub>F n in sequentially. (n - 4) / sqrt (n + 1) + 1 > sqrt n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F n in sequentially. 0 < c (n + 1) &&& \<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4) &&& eventually ((<) 4) sequentially &&& \<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (n + 1)
[PROOF STEP]
using c_pos[THEN eventually_all_ge_at_top]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. 0 < c y

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 < c (n + 1)
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
 2. eventually ((<) 4) sequentially
 3. \<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
[PROOF STEP]
using  c_sqrt[THEN eventually_all_ge_at_top]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. real_of_int (c y) < sqrt (real y) / 4

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
[PROOF STEP]
by eventually_elim (use le_add1 in blast)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. eventually ((<) 4) sequentially
 2. \<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((<) 4) sequentially
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 0 < c (n + 1)
\<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
eventually ((<) 4) sequentially
\<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 0 < c (n + 1)
\<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
eventually ((<) 4) sequentially
\<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (n + 1)
\<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
eventually ((<) 4) sequentially
\<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
using a_gt_plus a_n4
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 0 < c (n + 1)
\<forall>\<^sub>F n in sequentially. real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
eventually ((<) 4) sequentially
\<forall>\<^sub>F n in sequentially. sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
\<forall>\<^sub>F n in sequentially. real n / 4 < real_of_int (a n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n)\<rbrakk> \<Longrightarrow> c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
proof (rule impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
assume asm:"0 < c (n + 1)" "c (n + 1) < sqrt (real (n + 1)) / 4" and
        a_ineq:"c (n + 1) < c n \<longrightarrow> a n +  (a n - c (n + 1) - 1) /  c (n + 1) < a (n + 1)"
        "c (n + 1) < c n"  and "n / 4 < a n" "n > 4"
        and n_neq:" sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1"
[PROOF STATE]
proof (state)
this:
0 < c (n + 1)
real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4
c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
c (n + 1) < c n
real n / 4 < real_of_int (a n)
4 < n
sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have "(n-4) / sqrt(n+1) = (n/4 - 1)/ (sqrt (real (n + 1)) / 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (n - 4) / sqrt (real (n + 1)) = (real n / 4 - 1) / (sqrt (real (n + 1)) / 4)
[PROOF STEP]
using \<open>n>4\<close>
[PROOF STATE]
proof (prove)
using this:
4 < n

goal (1 subgoal):
 1. real (n - 4) / sqrt (real (n + 1)) = (real n / 4 - 1) / (sqrt (real (n + 1)) / 4)
[PROOF STEP]
by (auto simp:divide_simps)
[PROOF STATE]
proof (state)
this:
real (n - 4) / sqrt (real (n + 1)) = (real n / 4 - 1) / (sqrt (real (n + 1)) / 4)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (n - 4) / sqrt (real (n + 1)) = (real n / 4 - 1) / (sqrt (real (n + 1)) / 4)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have "... < (a n - 1) /  c (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real n / 4 - 1) / (sqrt (real (n + 1)) / 4) < real_of_int (a n - 1) / real_of_int (c (n + 1))
[PROOF STEP]
apply (rule frac_less)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0 \<le> real n / 4 - 1
 2. real n / 4 - 1 < real_of_int (a n - 1)
 3. 0 < real_of_int (c (n + 1))
 4. real_of_int (c (n + 1)) \<le> sqrt (real (n + 1)) / 4
[PROOF STEP]
using \<open>n > 4\<close> \<open>n / 4 < a n\<close> \<open>0 < c (n + 1)\<close> \<open>c (n + 1) < sqrt (real (n + 1)) / 4\<close>
[PROOF STATE]
proof (prove)
using this:
4 < n
real n / 4 < real_of_int (a n)
0 < c (n + 1)
real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4

goal (4 subgoals):
 1. 0 \<le> real n / 4 - 1
 2. real n / 4 - 1 < real_of_int (a n - 1)
 3. 0 < real_of_int (c (n + 1))
 4. real_of_int (c (n + 1)) \<le> sqrt (real (n + 1)) / 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(real n / 4 - 1) / (sqrt (real (n + 1)) / 4) < real_of_int (a n - 1) / real_of_int (c (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(real n / 4 - 1) / (sqrt (real (n + 1)) / 4) < real_of_int (a n - 1) / real_of_int (c (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have "... - 1 = (a n - c (n + 1) - 1) /  c (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a n - 1) / real_of_int (c (n + 1)) - 1 = real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))
[PROOF STEP]
using \<open>0 < c (n + 1)\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c (n + 1)

goal (1 subgoal):
 1. real_of_int (a n - 1) / real_of_int (c (n + 1)) - 1 = real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (a n - 1) / real_of_int (c (n + 1)) - 1 = real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (a n - 1) / real_of_int (c (n + 1)) - 1 = real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have "a n + ... < a (n+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
using a_ineq
[PROOF STATE]
proof (prove)
using this:
c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
c (n + 1) < c n

goal (1 subgoal):
 1. real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x < y \<Longrightarrow> x - 1 < y - 1; \<And>x y. x < y \<Longrightarrow> real_of_int (a n) + x < real_of_int (a n) + y\<rbrakk> \<Longrightarrow> real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))
[PROOF STEP]
have "a n + ((n - 4) / sqrt (n + 1) - 1) < a (n + 1)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x < y \<Longrightarrow> x - 1 < y - 1; \<And>x y. x < y \<Longrightarrow> real_of_int (a n) + x < real_of_int (a n) + y\<rbrakk> \<Longrightarrow> real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
have "(n - 4) / sqrt (n + 1) - 1 > sqrt n - 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real n) - 2 < real (n - 4) / sqrt (real (n + 1)) - 1
[PROOF STEP]
using n_neq[THEN diff_strict_right_mono,of 2] \<open>n>4\<close>
[PROOF STATE]
proof (prove)
using this:
sqrt (real n) - 2 < real (n - 4) / sqrt (real (n + 1)) + 1 - 2
4 < n

goal (1 subgoal):
 1. sqrt (real n) - 2 < real (n - 4) / sqrt (real (n + 1)) - 1
[PROOF STEP]
by (auto simp:algebra_simps of_nat_diff)
[PROOF STATE]
proof (state)
this:
sqrt (real n) - 2 < real (n - 4) / sqrt (real (n + 1)) - 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < c (n + 1); real_of_int (c (n + 1)) < sqrt (real (n + 1)) / 4; 4 < n; sqrt (real n) < real (n - 4) / sqrt (real (n + 1)) + 1; c (n + 1) < c n \<longrightarrow> real_of_int (a n) + real_of_int (a n - c (n + 1) - 1) / real_of_int (c (n + 1)) < real_of_int (a (n + 1)); real n / 4 < real_of_int (a n); c (n + 1) < c n\<rbrakk> \<Longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))
sqrt (real n) - 2 < real (n - 4) / sqrt (real (n + 1)) - 1
[PROOF STEP]
show "real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))"
[PROOF STATE]
proof (prove)
using this:
real_of_int (a n) + (real (n - 4) / sqrt (real (n + 1)) - 1) < real_of_int (a (n + 1))
sqrt (real n) - 2 < real (n - 4) / sqrt (real (n + 1)) - 1

goal (1 subgoal):
 1. real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
text\<open>The following corresponds to inequality $ a_{2N} > N^{3/2}/2$ in the paper,
 which had to be slightly corrected: \<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) < c n \<longrightarrow> real_of_int (a n) + (sqrt (real n) - 2) < real_of_int (a (n + 1))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_2N_sqrt:"\<forall>\<^sub>F N in sequentially. a (2*N) >  real N * (sqrt (real N)/2 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
using c_gt_half a_gt_sqrt[THEN eventually_all_ge_at_top] eventually_gt_at_top[of 4]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>\<^sub>F x in sequentially. \<forall>y\<ge>x. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1))
eventually ((<) (4::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
case (elim N)
[PROOF STATE]
proof (state)
this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1))
4 < N

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
define S where "S={n \<in> {N..<2 * N}. c (n + 1) < c n}"
[PROOF STATE]
proof (state)
this:
S = {n \<in> {N..<2 * N}. c (n + 1) < c n}

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
define f where "f = (\<lambda>n. a (Suc n) - a n)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>n. a (Suc n) - a n)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
have f_N:"\<forall>x\<in>S. f x\<ge>sqrt N - 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
assume "x\<in>S"
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
have "sqrt (real x) - 2 < f x" "x\<ge>N"
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. sqrt (real x) - 2 < real_of_int (f x) &&& N \<le> x
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
x \<in> S
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1))
4 < N

goal (1 subgoal):
 1. sqrt (real x) - 2 < real_of_int (f x) &&& N \<le> x
[PROOF STEP]
unfolding S_def f_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {n \<in> {N..<2 * N}. c (n + 1) < c n}
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1))
4 < N

goal (1 subgoal):
 1. sqrt (real x) - 2 < real_of_int (a (Suc x) - a x) &&& N \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sqrt (real x) - 2 < real_of_int (f x)
N \<le> x

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sqrt (real x) - 2 < real_of_int (f x)
N \<le> x

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
have "sqrt x - 2 \<ge> sqrt N - 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real N) - 2 \<le> sqrt (real x) - 2
[PROOF STEP]
using \<open>x\<ge>N\<close>
[PROOF STATE]
proof (prove)
using this:
N \<le> x

goal (1 subgoal):
 1. sqrt (real N) - 2 \<le> sqrt (real x) - 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (real N) - 2 \<le> sqrt (real x) - 2

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sqrt (real x) - 2 < real_of_int (f x)
N \<le> x
sqrt (real N) - 2 \<le> sqrt (real x) - 2
[PROOF STEP]
show  "sqrt (real N) - 2 \<le> real_of_int (f x)"
[PROOF STATE]
proof (prove)
using this:
sqrt (real x) - 2 < real_of_int (f x)
N \<le> x
sqrt (real N) - 2 \<le> sqrt (real x) - 2

goal (1 subgoal):
 1. sqrt (real N) - 2 \<le> real_of_int (f x)
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
sqrt (real N) - 2 \<le> real_of_int (f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. sqrt (real N) - 2 \<le> real_of_int (f x)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
have f_0:"\<forall>x. f x\<ge>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 \<le> f x
[PROOF STEP]
using \<open>mono a\<close>[THEN incseq_SucD]
[PROOF STATE]
proof (prove)
using this:
a ?i \<le> a (Suc ?i)

goal (1 subgoal):
 1. \<forall>x. 0 \<le> f x
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
a ?i \<le> a (Suc ?i)

goal (1 subgoal):
 1. \<forall>x. 0 \<le> a (Suc x) - a x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x. 0 \<le> f x

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
have "(N / 2)  * (sqrt N - 2) < card S * (sqrt N - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N / 2 * (sqrt (real N) - 2) < real (card S) * (sqrt (real N) - 2)
[PROOF STEP]
apply (rule mult_strict_right_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. real N / 2 < real (card S)
 2. 0 < sqrt (real N) - 2
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N / 2 < real (card S)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1))
4 < N

goal (1 subgoal):
 1. real N / 2 < real (card S)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
using this:
real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
\<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1))
4 < N

goal (1 subgoal):
 1. real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n})
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sqrt (real N) - 2
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sqrt (real N) - 2
[PROOF STEP]
using \<open>N>4\<close>
[PROOF STATE]
proof (prove)
using this:
4 < N

goal (1 subgoal):
 1. 0 < sqrt (real N) - 2
[PROOF STEP]
by (metis diff_gt_0_iff_gt numeral_less_real_of_nat_iff real_sqrt_four real_sqrt_less_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real N / 2 * (sqrt (real N) - 2) < real (card S) * (sqrt (real N) - 2)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real N / 2 * (sqrt (real N) - 2) < real (card S) * (sqrt (real N) - 2)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
have "...  \<le> sum f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card S) * (sqrt (real N) - 2) \<le> real_of_int (sum f S)
[PROOF STEP]
unfolding of_int_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card S) * (sqrt (real N) - 2) \<le> (\<Sum>x\<in>S. real_of_int (f x))
[PROOF STEP]
apply (rule sum_bounded_below)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f i)
[PROOF STEP]
using f_N
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. sqrt (real N) - 2 \<le> real_of_int (f x)

goal (1 subgoal):
 1. \<And>i. i \<in> S \<Longrightarrow> sqrt (real N) - 2 \<le> real_of_int (f i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (card S) * (sqrt (real N) - 2) \<le> real_of_int (sum f S)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card S) * (sqrt (real N) - 2) \<le> real_of_int (sum f S)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
have "... \<le> sum f {N..<2 * N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (sum f S) \<le> real_of_int (sum f {N..<2 * N})
[PROOF STEP]
unfolding of_int_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>S. real_of_int (f x)) \<le> (\<Sum>x = N..<2 * N. real_of_int (f x))
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {N..<2 * N}
 2. S \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - S \<Longrightarrow> 0 \<le> real_of_int (f b)
[PROOF STEP]
unfolding S_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {N..<2 * N}
 2. {n \<in> {N..<2 * N}. c (n + 1) < c n} \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - {n \<in> {N..<2 * N}. c (n + 1) < c n} \<Longrightarrow> 0 \<le> real_of_int (f b)
[PROOF STEP]
using f_0
[PROOF STATE]
proof (prove)
using this:
\<forall>x. 0 \<le> f x

goal (3 subgoals):
 1. finite {N..<2 * N}
 2. {n \<in> {N..<2 * N}. c (n + 1) < c n} \<subseteq> {N..<2 * N}
 3. \<And>b. b \<in> {N..<2 * N} - {n \<in> {N..<2 * N}. c (n + 1) < c n} \<Longrightarrow> 0 \<le> real_of_int (f b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (sum f S) \<le> real_of_int (sum f {N..<2 * N})

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (sum f S) \<le> real_of_int (sum f {N..<2 * N})

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
have "... = a (2*N) - a N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (sum f {N..<2 * N}) = real_of_int (a (2 * N) - a N)
[PROOF STEP]
unfolding of_int_sum f_def of_int_diff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x = N..<2 * N. real_of_int (a (Suc x)) - real_of_int (a x)) = real_of_int (a (2 * N)) - real_of_int (a N)
[PROOF STEP]
apply (rule sum_Suc_diff')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> 2 * N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (sum f {N..<2 * N}) = real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)
[PROOF STEP]
have "real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)"
[PROOF STATE]
proof (prove)
using this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)
[PROOF STEP]
have "real N / 2 * (sqrt (real N) - 2) < a (2 * N)"
[PROOF STATE]
proof (prove)
using this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)

goal (1 subgoal):
 1. real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N))
[PROOF STEP]
using a_pos[rule_format,of N]
[PROOF STATE]
proof (prove)
using this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N) - a N)
0 < a N

goal (1 subgoal):
 1. real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<And>N. \<lbrakk>real N / 2 < real (card {n \<in> {N..<2 * N}. c (n + 1) < c n}); \<forall>y\<ge>N. c (y + 1) < c y \<longrightarrow> real_of_int (a y) + (sqrt (real y) - 2) < real_of_int (a (y + 1)); 4 < N\<rbrakk> \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real N / 2 * (sqrt (real N) - 2) < real_of_int (a (2 * N))

goal (1 subgoal):
 1. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
by (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
text\<open>The following part is required to derive the final contradiction of the proof.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_n_sqrt:"\<forall>\<^sub>F n in sequentially. a n > (((n-1)/2) powr (3/2) - (n-1)) /2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2 < real_of_int (a n)
[PROOF STEP]
proof (rule sequentially_even_odd_imp)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real_of_int (a (2 * N))
 2. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
define f where "f=(\<lambda>N. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>N. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2)

goal (2 subgoals):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real_of_int (a (2 * N))
 2. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
define g where "g=(\<lambda>N. real N * (sqrt (real N) / 2 - 1))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>N. real N * (sqrt (real N) / 2 - 1))

goal (2 subgoals):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real_of_int (a (2 * N))
 2. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
have "\<forall>\<^sub>F N in sequentially. g N > f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. f N < g N
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real N * (sqrt (real N) / 2 - 1)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. f N < g N

goal (2 subgoals):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real_of_int (a (2 * N))
 2. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. f N < g N

goal (2 subgoals):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real_of_int (a (2 * N))
 2. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
have "\<forall>\<^sub>F N in sequentially. a (2 * N) > g N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
using a_2N_sqrt
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))

goal (2 subgoals):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N - 1) / 2) powr (3 / 2) - real (2 * N - 1)) / 2 < real_of_int (a (2 * N))
 2. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F N in sequentially. f N < g N
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))
[PROOF STEP]
show "\<forall>\<^sub>F N in sequentially. f N < a (2 * N)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. f N < g N
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. f N < real_of_int (a (2 * N))
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. f N < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
define f where "f=(\<lambda>N. ((real (2 * N + 1 - 1) / 2) powr (3 / 2)
                                  - real (2 * N + 1 - 1)) / 2)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>N. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
define g where "g=(\<lambda>N. real N * (sqrt (real N) / 2 - 1))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>N. real N * (sqrt (real N) / 2 - 1))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
have "\<forall>\<^sub>F N in sequentially. g N = f N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. g N = f N
[PROOF STEP]
using eventually_gt_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (0::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. g N = f N
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. 0 < N \<Longrightarrow> g N = f N
[PROOF STEP]
unfolding f_def g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. 0 < N \<Longrightarrow> real N * (sqrt (real N) / 2 - 1) = ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2
[PROOF STEP]
by (auto simp:algebra_simps powr_half_sqrt[symmetric] powr_mult_base)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. g N = f N

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. g N = f N

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
have "\<forall>\<^sub>F N in sequentially. a (2 * N) > g N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
using a_2N_sqrt
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. real N * (sqrt (real N) / 2 - 1) < real_of_int (a (2 * N))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
have "\<forall>\<^sub>F N in sequentially. a (2 * N + 1) \<ge> a (2*N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. a (2 * N) \<le> a (2 * N + 1)
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. a (2 * x) \<le> a (2 * x + 1)
[PROOF STEP]
using \<open>mono a\<close>
[PROOF STATE]
proof (prove)
using this:
incseq a

goal (1 subgoal):
 1. \<And>x. a (2 * x) \<le> a (2 * x + 1)
[PROOF STEP]
by (simp add: incseqD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. a (2 * N) \<le> a (2 * N + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. ((real (2 * N + 1 - 1) / 2) powr (3 / 2) - real (2 * N + 1 - 1)) / 2 < real_of_int (a (2 * N + 1))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F N in sequentially. g N = f N
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))
\<forall>\<^sub>F N in sequentially. a (2 * N) \<le> a (2 * N + 1)
[PROOF STEP]
show "\<forall>\<^sub>F N in sequentially. f N < (a (2 * N + 1))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F N in sequentially. g N = f N
\<forall>\<^sub>F N in sequentially. g N < real_of_int (a (2 * N))
\<forall>\<^sub>F N in sequentially. a (2 * N) \<le> a (2 * N + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. f N < real_of_int (a (2 * N + 1))
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. f N < real_of_int (a (2 * N + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2 < real_of_int (a n)

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_nth_prime_gt:"\<forall>\<^sub>F n in sequentially. a n / nth_prime n > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
define f where "f=(\<lambda>n::nat. (((n-1)/2) powr (3/2) - (n-1)) /2)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>n. ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
[PROOF STEP]
using nth_prime_asymptotics[unfolded asymp_equiv_def,THEN order_tendstoD(2),of 2]
[PROOF STATE]
proof (prove)
using this:
1 < 2 \<Longrightarrow> \<forall>\<^sub>F x in sequentially. (if real (nth_prime x) = 0 \<and> real x * ln (real x) = 0 then 1 else real (nth_prime x) / (real x * ln (real x))) < 2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
from this eventually_gt_at_top[of 1]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
eventually ((<) (1::?'a1)) at_top
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. real (nth_prime n)   < 2*(real n * ln n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. real (nth_prime x) / (real x * ln (real x)) < 2
eventually ((<) (1::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. real (nth_prime n) < 2 * (real n * ln (real n))
[PROOF STEP]
by eventually_elim (auto simp:field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real (nth_prime n) < 2 * (real n * ln (real n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. real (nth_prime n) < 2 * (real n * ln (real n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
have *:"\<forall>\<^sub>F N in sequentially. f N >0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. 0 < f N
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. 0 < ((real (N - 1) / 2) powr (3 / 2) - real (N - 1)) / 2
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. 0 < f N

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. 0 < f N

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
have " \<forall>\<^sub>F n in sequentially. f n < a n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. f n < real_of_int (a n)
[PROOF STEP]
using a_n_sqrt
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2 < real_of_int (a n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. f n < real_of_int (a n)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2 < real_of_int (a n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2 < real_of_int (a n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. f n < real_of_int (a n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. real (nth_prime n) < 2 * (real n * ln (real n))
\<forall>\<^sub>F N in sequentially. 0 < f N
\<forall>\<^sub>F n in sequentially. f n < real_of_int (a n)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. a n / nth_prime n > f n / (2*(real n * ln n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. real (nth_prime n) < 2 * (real n * ln (real n))
\<forall>\<^sub>F N in sequentially. 0 < f N
\<forall>\<^sub>F n in sequentially. f n < real_of_int (a n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>real (nth_prime n) < 2 * (real n * ln (real n)); 0 < f n; f n < real_of_int (a n)\<rbrakk> \<Longrightarrow> f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
real (nth_prime n) < 2 * (real n * ln (real n))
0 < f n
f n < real_of_int (a n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>real (nth_prime n) < 2 * (real n * ln (real n)); 0 < f n; f n < real_of_int (a n)\<rbrakk> \<Longrightarrow> f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real (nth_prime n) < 2 * (real n * ln (real n))
0 < f n
f n < real_of_int (a n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real (nth_prime n) < 2 * (real n * ln (real n))
0 < f n
f n < real_of_int (a n)

goal (1 subgoal):
 1. f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
by (auto intro: frac_less2)
[PROOF STATE]
proof (state)
this:
f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. (f n)/ (2*(real n * ln n)) > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < f n / (2 * (real n * ln (real n)))
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < ((real (n - 1) / 2) powr (3 / 2) - real (n - 1)) / 2 / (2 * (real n * ln (real n)))
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < f n / (2 * (real n * ln (real n)))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)
\<forall>\<^sub>F n in sequentially. 1 < f n / (2 * (real n * ln (real n)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. f n / (2 * (real n * ln (real n))) < real_of_int (a n) / real (nth_prime n)
\<forall>\<^sub>F n in sequentially. 1 < f n / (2 * (real n * ln (real n)))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
[PROOF STEP]
by eventually_elim argo
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
have a_nth_prime_lt:"\<exists>\<^sub>F n in sequentially. a n / nth_prime n < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1
[PROOF STEP]
have "liminf (\<lambda>x. a x / nth_prime x) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real_of_int (a x) / real (nth_prime x))) < 1
[PROOF STEP]
using nth_2
[PROOF STATE]
proof (prove)
using this:
liminf (\<lambda>x. ereal (real_of_int (a x) / real (nth_prime x))) = 0

goal (1 subgoal):
 1. liminf (\<lambda>x. ereal (real_of_int (a x) / real (nth_prime x))) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
liminf (\<lambda>x. ereal (real_of_int (a x) / real (nth_prime x))) < 1

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1
[PROOF STEP]
from this[unfolded less_Liminf_iff]
[PROOF STATE]
proof (chain)
picking this:
\<exists>y<1. \<exists>\<^sub>F x in sequentially. ereal (real_of_int (a x) / real (nth_prime x)) \<le> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>y<1. \<exists>\<^sub>F x in sequentially. ereal (real_of_int (a x) / real (nth_prime x)) \<le> y

goal (1 subgoal):
 1. \<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1
[PROOF STEP]
apply (auto elim!:frequently_elim1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y i. \<lbrakk>y < 1; ereal (real_of_int (a i) / real (nth_prime i)) \<le> y\<rbrakk> \<Longrightarrow> real_of_int (a i) < real (nth_prime i)
[PROOF STEP]
by (meson divide_less_eq_1 ereal_less_eq(7) leD leI
          nth_prime_nonzero of_nat_eq_0_iff of_nat_less_0_iff order.trans)
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1

goal (1 subgoal):
 1. (\<Sum>n. real (nth_prime n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> False
[PROOF STEP]
from a_nth_prime_gt a_nth_prime_lt
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
\<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. 1 < real_of_int (a n) / real (nth_prime n)
\<exists>\<^sub>F n in sequentially. real_of_int (a n) / real (nth_prime n) < 1

goal (1 subgoal):
 1. False
[PROOF STEP]
by (simp add: eventually_mono frequently_def)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed