[STATEMENT]
lemma Greatest_bounded_Suc:
  fixes P :: "nat \<Rightarrow> nat"
  shows "(if P n > 0 then Suc n
          else if \<exists>j<n. P j > 0 then Suc (GREATEST j. j < n \<and> P j > 0) else 0) =
    (if \<exists>j<Suc n. P j > 0 then Suc (GREATEST j. j < Suc n \<and> P j > 0) else 0)"
      (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
proof (cases "\<exists>j<Suc n. P j > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>j<Suc n. 0 < P j \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> (\<exists>j<Suc n. 0 < P j) \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
case 1: True
[PROOF STATE]
proof (state)
this:
\<exists>j<Suc n. 0 < P j

goal (2 subgoals):
 1. \<exists>j<Suc n. 0 < P j \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> (\<exists>j<Suc n. 0 < P j) \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
proof (cases "P n > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < P n

goal (2 subgoals):
 1. 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < P n
[PROOF STEP]
have "(GREATEST j. j < Suc n \<and> P j > 0) = n"
[PROOF STATE]
proof (prove)
using this:
0 < P n

goal (1 subgoal):
 1. (GREATEST j. j < Suc n \<and> 0 < P j) = n
[PROOF STEP]
using Greatest_equality[of "\<lambda>j. j < Suc n \<and> P j > 0"]
[PROOF STATE]
proof (prove)
using this:
0 < P n
\<lbrakk>?x < Suc n \<and> 0 < P ?x; \<And>y. y < Suc n \<and> 0 < P y \<Longrightarrow> y \<le> ?x\<rbrakk> \<Longrightarrow> (GREATEST j. j < Suc n \<and> 0 < P j) = ?x

goal (1 subgoal):
 1. (GREATEST j. j < Suc n \<and> 0 < P j) = n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(GREATEST j. j < Suc n \<and> 0 < P j) = n

goal (2 subgoals):
 1. 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(GREATEST j. j < Suc n \<and> 0 < P j) = n

goal (2 subgoals):
 1. 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
have "?rhs = Suc (GREATEST j. j < Suc n \<and> P j > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<exists>j<Suc n. 0 < P j

goal (1 subgoal):
 1. (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)

goal (2 subgoals):
 1. 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(GREATEST j. j < Suc n \<and> 0 < P j) = n
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
have "?rhs = Suc n"
[PROOF STATE]
proof (prove)
using this:
(GREATEST j. j < Suc n \<and> 0 < P j) = n
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)

goal (1 subgoal):
 1. (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc n

goal (2 subgoals):
 1. 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
 2. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc n

goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc n
0 < P n

goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 < P n

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 < P n
[PROOF STEP]
have "?lhs = Suc (GREATEST j. j < n \<and> P j > 0)"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < P n

goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < n \<and> 0 < P j)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<not> 0 < P n
\<exists>j<Suc n. 0 < P j

goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < n \<and> 0 < P j)
[PROOF STEP]
by (metis less_SucE)
[PROOF STATE]
proof (state)
this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < n \<and> 0 < P j)

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < n \<and> 0 < P j)

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
have "?rhs = Suc (GREATEST j. j < Suc n \<and> P j > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
\<exists>j<Suc n. 0 < P j

goal (1 subgoal):
 1. (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
have "(GREATEST j. j < n \<and> P j > 0) =
        (GREATEST j. j < Suc n \<and> P j > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (GREATEST j. j < n \<and> 0 < P j) = (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
using 1 False
[PROOF STATE]
proof (prove)
using this:
\<exists>j<Suc n. 0 < P j
\<not> 0 < P n

goal (1 subgoal):
 1. (GREATEST j. j < n \<and> 0 < P j) = (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
by (metis less_SucI less_Suc_eq)
[PROOF STATE]
proof (state)
this:
(GREATEST j. j < n \<and> 0 < P j) = (GREATEST j. j < Suc n \<and> 0 < P j)

goal (1 subgoal):
 1. \<not> 0 < P n \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < n \<and> 0 < P j)
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
(GREATEST j. j < n \<and> 0 < P j) = (GREATEST j. j < Suc n \<and> 0 < P j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < n \<and> 0 < P j)
(if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0) = Suc (GREATEST j. j < Suc n \<and> 0 < P j)
(GREATEST j. j < n \<and> 0 < P j) = (GREATEST j. j < Suc n \<and> 0 < P j)

goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)

goal (1 subgoal):
 1. \<not> (\<exists>j<Suc n. 0 < P j) \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>j<Suc n. 0 < P j) \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>j<Suc n. 0 < P j)

goal (1 subgoal):
 1. \<not> (\<exists>j<Suc n. 0 < P j) \<Longrightarrow> (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<exists>j<Suc n. 0 < P j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>j<Suc n. 0 < P j)

goal (1 subgoal):
 1. (if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if 0 < P n then Suc n else if \<exists>j<n. 0 < P j then Suc (GREATEST j. j < n \<and> 0 < P j) else 0) = (if \<exists>j<Suc n. 0 < P j then Suc (GREATEST j. j < Suc n \<and> 0 < P j) else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_less_eq: "(of_rat r :: 'a::linordered_field) \<le> of_rat s \<longleftrightarrow> r \<le> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r \<le> of_rat s) = (r \<le> s)
[PROOF STEP]
unfolding le_less
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r < of_rat s \<or> of_rat r = of_rat s) = (r < s \<or> r = s)
[PROOF STEP]
by (auto simp add: of_rat_less)


[STATEMENT]
lemma expands_to_drop_zero:
  assumes "eventually (\<lambda>x. eval C x = 0) at_top"
  assumes "(f expands_to (MS (MSLCons (C, e) xs) g)) basis"
  shows   "(f expands_to (MS xs g)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f expands_to MS xs g) basis
[PROOF STEP]
using assms drop_zero_ms[of C e xs g basis]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. eval C x = 0
(f expands_to MS (MSLCons (C, e) xs) g) basis
\<lbrakk>\<forall>\<^sub>F x in at_top. eval C x = 0; is_expansion (MS (MSLCons (C, e) xs) g) basis\<rbrakk> \<Longrightarrow> is_expansion (MS xs g) basis

goal (1 subgoal):
 1. (f expands_to MS xs g) basis
[PROOF STEP]
by (simp add: expands_to.simps)


[STATEMENT]
lemma univariate_power: assumes "univariate_power x m = Some n"
  shows "sum_var m = (\<lambda> y. if x = y then n else 0)"
   "eval_monom \<alpha> m = ((\<alpha> x)^n)"
   "n \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_var m = (\<lambda>y. if x = y then n else 0) &&& eval_monom \<alpha> m = \<alpha> x ^ n &&& 1 \<le> n
[PROOF STEP]
by (atomize(full), insert assms, transfer, auto dest: univariate_power_list)


[STATEMENT]
lemma monom_1_b:
  defines "P == (\<lambda> x n. (x[^]\<^bsub>(R)\<^esub> (CARD('a) ^ n) = x))"
  assumes m: "monom 1 1 \<in> carrier R"
  and monom_1_1: "P (monom 1 1) m'"
  and b: "b < degree f"
  shows "P (monom 1 b) m'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
have "monom 1 b = (\<Prod>i = 0..<b. monom 1 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'b) b = (\<Prod>i = 0..<b. monom (1::'b) 1)
[PROOF STEP]
by (metis prod_pow x_pow_n)
[PROOF STATE]
proof (state)
this:
monom (1::?'b2) b = (\<Prod>i = 0..<b. monom (1::?'b2) 1)

goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
monom (1::?'b2) b = (\<Prod>i = 0..<b. monom (1::?'b2) 1)

goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
have "... = (\<Prod>i = 0..<b. monom 1 1) mod f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<b. monom 1 1) = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
by (rule mod_poly_less[symmetric], auto)
       (metis One_nat_def b degree_linear_power x_as_monom)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<b. monom 1 1) = (\<Prod>i = 0..<b. monom 1 1) mod f

goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
monom 1 b = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
have eq2: "monom 1 b = (\<Prod>i = 0..<b. monom 1 1) mod f"
[PROOF STATE]
proof (prove)
using this:
monom 1 b = (\<Prod>i = 0..<b. monom 1 1) mod f

goal (1 subgoal):
 1. monom 1 b = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
monom 1 b = (\<Prod>i = 0..<b. monom 1 1) mod f

goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (monom 1 b) m'
[PROOF STEP]
unfolding eq2 P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Prod>i = 0..<b. monom 1 1) mod f) [^]\<^bsub>R\<^esub> CARD('a) ^ m' = (\<Prod>i = 0..<b. monom 1 1) mod f
[PROOF STEP]
by (rule prod_monom_1_1[OF m monom_1_1[unfolded P_def]])
[PROOF STATE]
proof (state)
this:
P (monom 1 b) m'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma initial_root_problem_complex_of_real_poly:
  "initial_root_problem (map_poly complex_of_real p) =
   map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
let ?c = "of_real :: real \<Rightarrow> complex"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
let ?cp = "map_poly ?c"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
let ?p = "?cp p :: complex poly"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define cn where "cn = degree ?p"
[PROOF STATE]
proof (state)
this:
cn = degree (map_poly complex_of_real p)

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define n where "n = degree p"
[PROOF STATE]
proof (state)
this:
n = degree p

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
have n: "cn = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cn = n
[PROOF STEP]
unfolding n_def cn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly complex_of_real p) = degree p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cn = n

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
note def = initial_root_problem_def[of ?p]
[PROOF STATE]
proof (state)
this:
initial_root_problem (map_poly complex_of_real p) = (let n = degree (map_poly complex_of_real p); cs = coeffs (map_poly complex_of_real p); rcs = remdups (filter (\<lambda>c. c \<notin> \<int>) cs); pairs = map (\<lambda>c. (c, min_int_poly c)) rcs; spairs = sort_key (\<lambda>(c, f). degree f) pairs; triples = zip [0..<length spairs] spairs; mpoly = \<Sum>i\<le>n. let c = coeff (map_poly complex_of_real p) i in MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = c) triples of None \<Rightarrow> Const (to_int c) | Some (j, pair) \<Rightarrow> Var (Suc j)) in (mpoly, triples))

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
note def = def[folded cn_def, unfolded n]
[PROOF STATE]
proof (state)
this:
initial_root_problem (map_poly complex_of_real p) = (let n = n; cs = coeffs (map_poly complex_of_real p); rcs = remdups (filter (\<lambda>c. c \<notin> \<int>) cs); pairs = map (\<lambda>c. (c, min_int_poly c)) rcs; spairs = sort_key (\<lambda>(c, f). degree f) pairs; triples = zip [0..<length spairs] spairs; mpoly = \<Sum>i\<le>n. let c = coeff (map_poly complex_of_real p) i in MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = c) triples of None \<Rightarrow> Const (to_int c) | Some (j, pair) \<Rightarrow> Var (Suc j)) in (mpoly, triples))

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define ccs where "ccs = coeffs ?p"
[PROOF STATE]
proof (state)
this:
ccs = coeffs (map_poly complex_of_real p)

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define cs where "cs = coeffs p"
[PROOF STATE]
proof (state)
this:
cs = coeffs p

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
have cs: "ccs = map ?c cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccs = map complex_of_real cs
[PROOF STEP]
unfolding ccs_def cs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs (map_poly complex_of_real p) = map complex_of_real (coeffs p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ccs = map complex_of_real cs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
note def = def[folded ccs_def]
[PROOF STATE]
proof (state)
this:
initial_root_problem (map_poly complex_of_real p) = (let n = n; cs = ccs; rcs = remdups (filter (\<lambda>c. c \<notin> \<int>) cs); pairs = map (\<lambda>c. (c, min_int_poly c)) rcs; spairs = sort_key (\<lambda>(c, f). degree f) pairs; triples = zip [0..<length spairs] spairs; mpoly = \<Sum>i\<le>n. let c = coeff (map_poly complex_of_real p) i in MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = c) triples of None \<Rightarrow> Const (to_int c) | Some (j, pair) \<Rightarrow> Var (Suc j)) in (mpoly, triples))

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define crcs where "crcs = remdups (filter (\<lambda>c. c \<notin> \<int>) ccs)"
[PROOF STATE]
proof (state)
this:
crcs = remdups (filter (\<lambda>c. c \<notin> \<int>) ccs)

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define rcs where "rcs = remdups (filter (\<lambda>c. c \<notin> \<int>) cs)"
[PROOF STATE]
proof (state)
this:
rcs = remdups (filter (\<lambda>c. c \<notin> \<int>) cs)

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
have rcs: "crcs = map ?c rcs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crcs = map complex_of_real rcs
[PROOF STEP]
unfolding crcs_def rcs_def cs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remdups (filter (\<lambda>c. c \<notin> \<int>) (map complex_of_real cs)) = map complex_of_real (remdups (filter (\<lambda>c. c \<notin> \<int>) cs))
[PROOF STEP]
by (induct cs, auto)
[PROOF STATE]
proof (state)
this:
crcs = map complex_of_real rcs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define cpairs where "cpairs = map (\<lambda>c. (c, min_int_poly c)) crcs"
[PROOF STATE]
proof (state)
this:
cpairs = map (\<lambda>c. (c, min_int_poly c)) crcs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define pairs where "pairs = map (\<lambda>c. (c, min_int_poly c)) rcs"
[PROOF STATE]
proof (state)
this:
pairs = map (\<lambda>c. (c, min_int_poly c)) rcs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
have pairs: "cpairs = map (map_prod ?c id) pairs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cpairs = map (map_prod complex_of_real id) pairs
[PROOF STEP]
unfolding pairs_def cpairs_def rcs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>c. (c, min_int_poly c)) (map complex_of_real rcs) = map (map_prod complex_of_real id) (map (\<lambda>c. (c, min_int_poly c)) rcs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cpairs = map (map_prod complex_of_real id) pairs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define cspairs where "cspairs = sort_key (\<lambda>(c, y). degree y) cpairs"
[PROOF STATE]
proof (state)
this:
cspairs = sort_key (\<lambda>(c, y). degree y) cpairs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define spairs where "spairs = sort_key (\<lambda>(c, y). degree y) pairs"
[PROOF STATE]
proof (state)
this:
spairs = sort_key (\<lambda>(c, y). degree y) pairs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
have spairs: "cspairs = map (map_prod ?c id) spairs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspairs = map (map_prod complex_of_real id) spairs
[PROOF STEP]
unfolding spairs_def cspairs_def pairs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sort_key (\<lambda>(c, y). degree y) (map (map_prod complex_of_real id) pairs) = map (map_prod complex_of_real id) (sort_key (\<lambda>(c, y). degree y) pairs)
[PROOF STEP]
by (rule sym, rule map_sort_key, auto)
[PROOF STATE]
proof (state)
this:
cspairs = map (map_prod complex_of_real id) spairs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define ctriples where "ctriples = zip [0..<length cspairs] cspairs"
[PROOF STATE]
proof (state)
this:
ctriples = zip [0..<length cspairs] cspairs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
define triples where "triples = zip [0..<length spairs] spairs"
[PROOF STATE]
proof (state)
this:
triples = zip [0..<length spairs] spairs

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
have triples: "ctriples = map (map_prod id (map_prod ?c id)) triples"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ctriples = map (map_prod id (map_prod complex_of_real id)) triples
[PROOF STEP]
unfolding ctriples_def triples_def spairs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zip [0..<length (map (map_prod complex_of_real id) spairs)] (map (map_prod complex_of_real id) spairs) = map (map_prod id (map_prod complex_of_real id)) (zip [0..<length spairs] spairs)
[PROOF STEP]
by (rule nth_equalityI, auto)
[PROOF STATE]
proof (state)
this:
ctriples = map (map_prod id (map_prod complex_of_real id)) triples

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
note def = def[unfolded Let_def, folded crcs_def, folded cpairs_def, folded cspairs_def, folded ctriples_def,
      unfolded of_real_hom.coeff_map_poly_hom]
[PROOF STATE]
proof (state)
this:
initial_root_problem (map_poly complex_of_real p) = (\<Sum>i\<le>n. MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = complex_of_real (coeff p i)) ctriples of None \<Rightarrow> Const (to_int (complex_of_real (coeff p i))) | Some (j, pair) \<Rightarrow> Var (Suc j)), ctriples)

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
note def2 = initial_root_problem_def[of p, unfolded Let_def, folded n_def cs_def, folded rcs_def, folded pairs_def,
      folded spairs_def, folded triples_def]
[PROOF STATE]
proof (state)
this:
initial_root_problem p = (\<Sum>i\<le>n. MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = coeff p i) triples of None \<Rightarrow> Const (to_int (coeff p i)) | Some (j, pair) \<Rightarrow> Var (Suc j)), triples)

goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
show "initial_root_problem ?p = map_prod id (map (map_prod id (map_prod ?c id))) (initial_root_problem p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)
[PROOF STEP]
unfolding def def2 triples to_int_complex_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = complex_of_real (coeff p i)) (map (map_prod id (map_prod complex_of_real id)) triples) of None \<Rightarrow> Const (to_int (coeff p i)) | Some (j, pair) \<Rightarrow> Var (Suc j)), map (map_prod id (map_prod complex_of_real id)) triples) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (\<Sum>i\<le>n. MPoly_Type.monom (monomial i 0) 1 * (case find (\<lambda>(j, d, f). d = coeff p i) triples of None \<Rightarrow> Const (to_int (coeff p i)) | Some (j, pair) \<Rightarrow> Var (Suc j)), triples)
[PROOF STEP]
by (simp, intro sum.cong refl arg_cong[of _ _ "\<lambda> x. _ * x"], induct triples, auto)
[PROOF STATE]
proof (state)
this:
initial_root_problem (map_poly complex_of_real p) = map_prod id (map (map_prod id (map_prod complex_of_real id))) (initial_root_problem p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_powr_eq_powerI:
  "x > 0 \<Longrightarrow> y = real y' \<Longrightarrow> x powr y = x ^ y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; y = real y'\<rbrakk> \<Longrightarrow> x powr y = x ^ y'
[PROOF STEP]
by (simp add: powr_realpow)


[STATEMENT]
lemma inorder: "inorder(tree23_of_list as) = as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder (tree23_of_list as) = as
[PROOF STEP]
by(simp add: tree23_of_list_def inorder_join_all inorder2_leaves)


[STATEMENT]
lemma closedin_compact:
   "\<lbrakk>compact S; closedin (top_of_set S) T\<rbrakk> \<Longrightarrow> compact T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>compact S; closedin (top_of_set S) T\<rbrakk> \<Longrightarrow> compact T
[PROOF STEP]
by (metis closedin_closed compact_Int_closed)


[STATEMENT]
lemma desargues_config_3D_coplanar_5 :
  assumes "desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>"
  shows "rk {A, B, C, \<alpha>, \<beta>} = 3" and "rk {A', B', C', \<alpha>, \<beta>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>} = 3 &&& rk {A', B', C', \<alpha>, \<beta>} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rk {A, B, C, \<alpha>, \<beta>} = 3
 2. rk {A', B', C', \<alpha>, \<beta>} = 3
[PROOF STEP]
show "rk {A, B, C, \<alpha>, \<beta>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>} = 3
[PROOF STEP]
using assms desargues_config_3D_def coplanar_5
[PROOF STATE]
proof (prove)
using this:
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D ?A ?B ?C ?A' ?B' ?C' ?P ?\<alpha> ?\<beta> ?\<gamma> \<equiv> rk {?A, ?B, ?C} = 3 \<and> rk {?A', ?B', ?C'} = 3 \<and> rk {?A, ?A', ?P} = 2 \<and> rk {?B, ?B', ?P} = 2 \<and> rk {?C, ?C', ?P} = 2 \<and> 4 \<le> rk {?A, ?B, ?C, ?A', ?B', ?C'} \<and> rk {?B, ?C, ?\<alpha>} = 2 \<and> rk {?B', ?C', ?\<alpha>} = 2 \<and> rk {?A, ?C, ?\<beta>} = 2 \<and> rk {?A', ?C', ?\<beta>} = 2 \<and> rk {?A, ?B, ?\<gamma>} = 2 \<and> rk {?A', ?B', ?\<gamma>} = 2
\<lbrakk>rk {?A, ?B, ?C} = 3; rk {?B, ?C, ?\<alpha>} = 2; rk {?A, ?C, ?\<beta>} = 2\<rbrakk> \<Longrightarrow> rk {?A, ?B, ?C, ?\<alpha>, ?\<beta>} = 3

goal (1 subgoal):
 1. rk {A, B, C, \<alpha>, \<beta>} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A, B, C, \<alpha>, \<beta>} = 3

goal (1 subgoal):
 1. rk {A', B', C', \<alpha>, \<beta>} = 3
[PROOF STEP]
show "rk {A', B', C', \<alpha>, \<beta>} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A', B', C', \<alpha>, \<beta>} = 3
[PROOF STEP]
using assms desargues_config_3D_def coplanar_5
[PROOF STATE]
proof (prove)
using this:
desargues_config_3D A B C A' B' C' P \<alpha> \<beta> \<gamma>
desargues_config_3D ?A ?B ?C ?A' ?B' ?C' ?P ?\<alpha> ?\<beta> ?\<gamma> \<equiv> rk {?A, ?B, ?C} = 3 \<and> rk {?A', ?B', ?C'} = 3 \<and> rk {?A, ?A', ?P} = 2 \<and> rk {?B, ?B', ?P} = 2 \<and> rk {?C, ?C', ?P} = 2 \<and> 4 \<le> rk {?A, ?B, ?C, ?A', ?B', ?C'} \<and> rk {?B, ?C, ?\<alpha>} = 2 \<and> rk {?B', ?C', ?\<alpha>} = 2 \<and> rk {?A, ?C, ?\<beta>} = 2 \<and> rk {?A', ?C', ?\<beta>} = 2 \<and> rk {?A, ?B, ?\<gamma>} = 2 \<and> rk {?A', ?B', ?\<gamma>} = 2
\<lbrakk>rk {?A, ?B, ?C} = 3; rk {?B, ?C, ?\<alpha>} = 2; rk {?A, ?C, ?\<beta>} = 2\<rbrakk> \<Longrightarrow> rk {?A, ?B, ?C, ?\<alpha>, ?\<beta>} = 3

goal (1 subgoal):
 1. rk {A', B', C', \<alpha>, \<beta>} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A', B', C', \<alpha>, \<beta>} = 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma
  fixes d ::"nat\<Rightarrow>real " and  a b ::"nat\<Rightarrow>int " and A::real
  assumes "A > 1" and d: "\<forall>n. d n> 1" and a: "\<forall>n. a n>0" and b:"\<forall>n. b n>0"
    and assu1: "(( \<lambda> n. (of_int (a n)) powr(1 /of_int (2^n)))\<longlongrightarrow> A) sequentially "
    and assu3: "filterlim ( \<lambda> n. (d n)^(2^n)/ b n) at_top sequentially"
    and "convergent_prod d"
  shows issummable: "summable (\<lambda>j. b j / a j)"
    and show5: "\<forall>\<^sub>F n in sequentially. (\<Sum>j. (b (n + j)) / (a (n + j))) \<le> 2 * b n / a n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j)) &&& \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j))
 2. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
define c where "c = (\<lambda>j. b j / a j)"
[PROOF STATE]
proof (state)
this:
c = (\<lambda>j. real_of_int (b j) / real_of_int (a j))

goal (2 subgoals):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j))
 2. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
have c_pos:"c j>0" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c j
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n
\<forall>n. 0 < b n

goal (1 subgoal):
 1. 0 < c j
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n
\<forall>n. 0 < b n

goal (1 subgoal):
 1. 0 < real_of_int (b j) / real_of_int (a j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < c ?j

goal (2 subgoals):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j))
 2. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
have c_ratio_tendsto:"(\<lambda>n. c (n+1) / c n ) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
define nn where "nn \<equiv> (\<lambda>n. (2::int) ^ (Suc n))"
[PROOF STATE]
proof (state)
this:
nn \<equiv> \<lambda>n. 2 ^ Suc n

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
define ff where "ff \<equiv> (\<lambda>n. (a n / a (Suc n)) powr(1 /nn n)*(d(Suc n)))"
[PROOF STATE]
proof (state)
this:
ff \<equiv> \<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n)) * d (Suc n)

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
have nn_pos:"nn n>0" and ff_pos:"ff n>0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < nn n &&& 0 < ff n
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < nn n
[PROOF STEP]
unfolding nn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2 ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ff n
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < ff n
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n)) * d (Suc n)
[PROOF STEP]
using d[rule_format, of "Suc n"] a[rule_format, of n] a[rule_format, of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
1 < d (Suc n)
0 < a n
0 < a (Suc n)

goal (1 subgoal):
 1. 0 < (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n)) * d (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
0 < nn ?n
0 < ff ?n

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
have ff_tendsto:"ff \<longlonglongrightarrow> 1 / sqrt A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
have "(of_int (a n)) powr(1 / (nn n)) = sqrt(of_int (a n) powr(1 /of_int (2^n)))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a n) powr (1 / real_of_int (nn n)) = sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))
[PROOF STEP]
unfolding nn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a n) powr (1 / real_of_int (2 ^ Suc n)) = sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 0 < a n

goal (1 subgoal):
 1. real_of_int (a n) powr (1 / real_of_int (2 ^ Suc n)) = sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))
[PROOF STEP]
by (simp add: powr_half_sqrt [symmetric] powr_powr ac_simps)
[PROOF STATE]
proof (state)
this:
real_of_int (a ?n) powr (1 / real_of_int (nn ?n)) = sqrt (real_of_int (a ?n) powr (1 / real_of_int (2 ^ ?n)))

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int (a ?n) powr (1 / real_of_int (nn ?n)) = sqrt (real_of_int (a ?n) powr (1 / real_of_int (2 ^ ?n)))

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
have "(( \<lambda> n. sqrt(of_int (a n) powr(1 /of_int (2^n))))\<longlongrightarrow> sqrt A) sequentially "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))) \<longlonglongrightarrow> sqrt A
[PROOF STEP]
using assu1 tendsto_real_sqrt
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (a n) powr (1 / real_of_int (2 ^ n))) \<longlonglongrightarrow> A
(?f \<longlongrightarrow> ?x) ?F \<Longrightarrow> ((\<lambda>x. sqrt (?f x)) \<longlongrightarrow> sqrt ?x) ?F

goal (1 subgoal):
 1. (\<lambda>n. sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))) \<longlonglongrightarrow> sqrt A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))) \<longlonglongrightarrow> sqrt A

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int (a ?n) powr (1 / real_of_int (nn ?n)) = sqrt (real_of_int (a ?n) powr (1 / real_of_int (2 ^ ?n)))
(\<lambda>n. sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))) \<longlonglongrightarrow> sqrt A
[PROOF STEP]
have "(( \<lambda> n. (of_int (a n)) powr(1 /of_int (nn n)))\<longlongrightarrow> sqrt A) sequentially "
[PROOF STATE]
proof (prove)
using this:
real_of_int (a ?n) powr (1 / real_of_int (nn ?n)) = sqrt (real_of_int (a ?n) powr (1 / real_of_int (2 ^ ?n)))
(\<lambda>n. sqrt (real_of_int (a n) powr (1 / real_of_int (2 ^ n)))) \<longlonglongrightarrow> sqrt A

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (a n) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> sqrt A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (a n) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> sqrt A

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
from tendsto_divide[OF this assu1[THEN LIMSEQ_ignore_initial_segment[where k=1]]]
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> 0 \<Longrightarrow> (\<lambda>x. real_of_int (a x) powr (1 / real_of_int (nn x)) / real_of_int (a (x + 1)) powr (1 / real_of_int (2 ^ (x + 1)))) \<longlonglongrightarrow> sqrt A / A
[PROOF STEP]
have "(\<lambda>n. (a n / a (Suc n)) powr(1 /nn n)) \<longlonglongrightarrow> 1/sqrt A"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<Longrightarrow> (\<lambda>x. real_of_int (a x) powr (1 / real_of_int (nn x)) / real_of_int (a (x + 1)) powr (1 / real_of_int (2 ^ (x + 1)))) \<longlonglongrightarrow> sqrt A / A

goal (1 subgoal):
 1. (\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
using \<open>A>1\<close> a
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<Longrightarrow> (\<lambda>x. real_of_int (a x) powr (1 / real_of_int (nn x)) / real_of_int (a (x + 1)) powr (1 / real_of_int (2 ^ (x + 1)))) \<longlonglongrightarrow> sqrt A / A
1 < A
\<forall>n. 0 < a n

goal (1 subgoal):
 1. (\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
unfolding nn_def
[PROOF STATE]
proof (prove)
using this:
A \<noteq> 0 \<Longrightarrow> (\<lambda>x. real_of_int (a x) powr (1 / real_of_int (2 ^ Suc x)) / real_of_int (a (x + 1)) powr (1 / real_of_int (2 ^ (x + 1)))) \<longlonglongrightarrow> sqrt A / A
1 < A
\<forall>n. 0 < a n

goal (1 subgoal):
 1. (\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (2 ^ Suc n))) \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
by (auto simp add:powr_divide less_imp_le inverse_eq_divide sqrt_divide_self_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
have "(\<lambda>n. d (Suc n))\<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. d (Suc n)) \<longlonglongrightarrow> 1
[PROOF STEP]
apply (rule convergent_prod_imp_LIMSEQ)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod (\<lambda>n. d (Suc n))
[PROOF STEP]
using convergent_prod_iff_shift[of d 1] \<open>convergent_prod d\<close>
[PROOF STATE]
proof (prove)
using this:
convergent_prod (\<lambda>i. d (i + 1)) = convergent_prod d
convergent_prod d

goal (1 subgoal):
 1. convergent_prod (\<lambda>n. d (Suc n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. d (Suc n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A
(\<lambda>n. d (Suc n)) \<longlonglongrightarrow> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A
(\<lambda>n. d (Suc n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. ff \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n))) \<longlonglongrightarrow> 1 / sqrt A
(\<lambda>n. d (Suc n)) \<longlonglongrightarrow> 1

goal (1 subgoal):
 1. (\<lambda>n. (real_of_int (a n) / real_of_int (a (Suc n))) powr (1 / real_of_int (nn n)) * d (Suc n)) \<longlonglongrightarrow> 1 / sqrt A
[PROOF STEP]
by (auto intro:tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
ff \<longlonglongrightarrow> 1 / sqrt A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ff \<longlonglongrightarrow> 1 / sqrt A

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. (ff n) powr nn n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
define aa where "aa=(1+1/sqrt A) / 2"
[PROOF STATE]
proof (state)
this:
aa = (1 + 1 / sqrt A) / 2

goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "eventually (\<lambda>n. ff n<aa) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ff n < aa
[PROOF STEP]
apply (rule order_tendstoD[OF ff_tendsto])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / sqrt A < aa
[PROOF STEP]
unfolding aa_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / sqrt A < (1 + 1 / sqrt A) / 2
[PROOF STEP]
using \<open>A>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < A

goal (1 subgoal):
 1. 1 / sqrt A < (1 + 1 / sqrt A) / 2
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ff n < aa

goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ff n < aa

goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. aa powr nn n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>y. aa ^ (nat \<circ> nn) y) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. aa ^ (nat \<circ> nn) y) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (rule tendsto_power_zero)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. filterlim (nat \<circ> nn) sequentially sequentially
 2. norm aa < 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim (nat \<circ> nn) sequentially sequentially
[PROOF STEP]
unfolding nn_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM y sequentially. nat (2 ^ Suc y) :> sequentially
[PROOF STEP]
apply (rule filterlim_subseq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono (\<lambda>y. nat (2 ^ Suc y))
[PROOF STEP]
by (auto intro:strict_monoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm aa < 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm aa < 1
[PROOF STEP]
unfolding aa_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((1 + 1 / sqrt A) / 2) < 1
[PROOF STEP]
using \<open>A>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < A

goal (1 subgoal):
 1. norm ((1 + 1 / sqrt A) / 2) < 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>y. aa ^ (nat \<circ> nn) y) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>y. aa ^ (nat \<circ> nn) y) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>y. aa ^ (nat \<circ> nn) y) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (elim filterlim_mono_eventually)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
 3. \<forall>\<^sub>F x in sequentially. aa ^ (nat \<circ> nn) x = aa powr real_of_int (nn x)
[PROOF STEP]
have "aa>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < aa
[PROOF STEP]
unfolding aa_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (1 + 1 / sqrt A) / 2
[PROOF STEP]
using \<open>A>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < A

goal (1 subgoal):
 1. 0 < (1 + 1 / sqrt A) / 2
[PROOF STEP]
by  (auto simp add:field_simps pos_add_strict)
[PROOF STATE]
proof (state)
this:
0 < aa

goal (3 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
 3. \<forall>\<^sub>F x in sequentially. aa ^ (nat \<circ> nn) x = aa powr real_of_int (nn x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < aa
[PROOF STEP]
show " \<forall>\<^sub>F x in sequentially. aa ^ (nat \<circ> nn) x = aa powr real_of_int (nn x)"
[PROOF STATE]
proof (prove)
using this:
0 < aa

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. aa ^ (nat \<circ> nn) x = aa powr real_of_int (nn x)
[PROOF STEP]
by (auto simp: powr_int order.strict_implies_order[OF nn_pos])
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. aa ^ (nat \<circ> nn) x = aa powr real_of_int (nn x)

goal (2 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ff n < aa
(\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ff n < aa
(\<lambda>n. aa powr real_of_int (nn n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (elim metric_tendsto_imp_tendsto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ff n < aa \<Longrightarrow> \<forall>\<^sub>F x in sequentially. dist (ff x powr real_of_int (nn x)) 0 \<le> dist (aa powr real_of_int (nn x)) 0
[PROOF STEP]
apply (auto intro!:powr_mono2 elim!:eventually_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. ff x < aa \<Longrightarrow> 0 \<le> nn x
 2. \<And>x. ff x < aa \<Longrightarrow> 0 \<le> ff x
[PROOF STEP]
using nn_pos ff_pos
[PROOF STATE]
proof (prove)
using this:
0 < nn ?n
0 < ff ?n

goal (2 subgoals):
 1. \<And>x. ff x < aa \<Longrightarrow> 0 \<le> nn x
 2. \<And>x. ff x < aa \<Longrightarrow> 0 \<le> ff x
[PROOF STEP]
by (meson le_cases not_le)+
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. (d (Suc n))^(nat (nn n)) * (a n / a (Suc n))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ff n powr real_of_int (nn n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. d (Suc n) ^ nat (nn n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
proof (elim filterlim_mono_eventually)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
 3. \<forall>\<^sub>F x in sequentially. ff x powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
show "\<forall>\<^sub>F x in sequentially. ff x powr  (nn x) = d (Suc x) ^ nat (nn x) * (a x / a (Suc x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. ff x powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ff x powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ff x powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((real_of_int (a x) / real_of_int (a (Suc x))) powr (1 / real_of_int (nn x)) * d (Suc x)) powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
using a[rule_format,of x] a[rule_format,of "Suc x"] d[rule_format,of "Suc x"] nn_pos[of x]
[PROOF STATE]
proof (prove)
using this:
0 < a x
0 < a (Suc x)
1 < d (Suc x)
0 < nn x

goal (1 subgoal):
 1. ((real_of_int (a x) / real_of_int (a (Suc x))) powr (1 / real_of_int (nn x)) * d (Suc x)) powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
apply (auto simp add:field_simps powr_divide powr_powr powr_mult )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a x; 0 < a (Suc x); 1 < d (Suc x); 0 < nn x\<rbrakk> \<Longrightarrow> d (Suc x) powr real_of_int (nn x) = d (Suc x) ^ nat (nn x)
[PROOF STEP]
by (simp add: powr_int)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. ff x powr real_of_int (nn x) = d (Suc x) ^ nat (nn x) * (real_of_int (a x) / real_of_int (a (Suc x)))

goal (2 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. d (Suc n) ^ nat (nn n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. d (Suc n) ^ nat (nn n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. b (Suc n) / (d (Suc n))^(nat (nn n))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_inverse_0_at_top[OF assu3,THEN LIMSEQ_ignore_initial_segment[where k=1]]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (d (n + 1) ^ 2 ^ (n + 1) / real_of_int (b (n + 1)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding nn_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (d (n + 1) ^ 2 ^ (n + 1) / real_of_int (b (n + 1)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (2 ^ Suc n)) \<longlonglongrightarrow> 0
[PROOF STEP]
by (auto simp add:field_simps nat_mult_distrib nat_power_eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (nn n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. d (Suc n) ^ nat (nn n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
(\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (nn n)) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. b (Suc n) * (a n / a (Suc n))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. d (Suc n) ^ nat (nn n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
(\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (nn n)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>n. d (Suc n) ^ nat (nn n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0; (\<lambda>n. real_of_int (b (Suc n)) / d (Suc n) ^ nat (nn n)) \<longlonglongrightarrow> 0\<rbrakk> \<Longrightarrow> (\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
subgoal premises asm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
using tendsto_mult[OF asm,simplified]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. if d (Suc x) = 0 \<and> 0 < nn x then 0 else real_of_int (a x) * real_of_int (b (Suc x)) / real_of_int (a (Suc x))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (elim filterlim_mono_eventually)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
 3. \<forall>\<^sub>F x in sequentially. (if d (Suc x) = 0 \<and> 0 < nn x then 0 else real_of_int (a x) * real_of_int (b (Suc x)) / real_of_int (a (Suc x))) = real_of_int (b (Suc x)) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
using d
[PROOF STATE]
proof (prove)
using this:
\<forall>n. 1 < d n

goal (3 subgoals):
 1. nhds 0 \<le> nhds 0
 2. sequentially \<le> sequentially
 3. \<forall>\<^sub>F x in sequentially. (if d (Suc x) = 0 \<and> 0 < nn x then 0 else real_of_int (a x) * real_of_int (b (Suc x)) / real_of_int (a (Suc x))) = real_of_int (b (Suc x)) * (real_of_int (a x) / real_of_int (a (Suc x)))
[PROOF STEP]
by (auto simp add:algebra_simps,metis (mono_tags, lifting) always_eventually
            not_one_less_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. (b (Suc n) / b n) * (a n / a (Suc n))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (Suc n)) / real_of_int (b n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
apply (elim Lim_transform_bound[rotated])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. norm (real_of_int (b (Suc n)) / real_of_int (b n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<le> norm (real_of_int (b (Suc n)) * (real_of_int (a n) / real_of_int (a (Suc n))))
[PROOF STEP]
apply (rule eventuallyI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm (real_of_int (b (Suc x)) / real_of_int (b x) * (real_of_int (a x) / real_of_int (a (Suc x)))) \<le> norm (real_of_int (b (Suc x)) * (real_of_int (a x) / real_of_int (a (Suc x))))
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (real_of_int (b (Suc x)) / real_of_int (b x) * (real_of_int (a x) / real_of_int (a (Suc x)))) \<le> norm (real_of_int (b (Suc x)) * (real_of_int (a x) / real_of_int (a (Suc x))))
[PROOF STEP]
using a[rule_format, of x] a[rule_format, of "Suc x"]
          b[rule_format, of x] b[rule_format, of "Suc x"]
[PROOF STATE]
proof (prove)
using this:
0 < a x
0 < a (Suc x)
0 < b x
0 < b (Suc x)

goal (1 subgoal):
 1. norm (real_of_int (b (Suc x)) / real_of_int (b x) * (real_of_int (a x) / real_of_int (a (Suc x)))) \<le> norm (real_of_int (b (Suc x)) * (real_of_int (a x) / real_of_int (a (Suc x))))
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_int (b (Suc n)) / real_of_int (b n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real_of_int (b (Suc n)) / real_of_int (b n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (Suc n)) / real_of_int (b n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (Suc n)) / real_of_int (b n) * (real_of_int (a n) / real_of_int (a (Suc n)))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1)) / (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j))
 2. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
from c_ratio_tendsto
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. norm (b (Suc n) / a (Suc n)) / norm (b n / a n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. c (n + 1) / c n) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. norm (real_of_int (b (Suc n)) / real_of_int (a (Suc n))) / norm (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1)) / (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. norm (real_of_int (b (Suc n)) / real_of_int (a (Suc n))) / norm (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1)) / (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0
\<forall>n. 0 < a n
\<forall>n. 0 < b n

goal (1 subgoal):
 1. (\<lambda>n. norm (real_of_int (b (Suc n)) / real_of_int (a (Suc n))) / norm (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0
[PROOF STEP]
by (force simp add:divide_simps abs_of_pos intro: Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. norm (real_of_int (b (Suc n)) / real_of_int (a (Suc n))) / norm (real_of_int (b n) / real_of_int (a n))) \<longlonglongrightarrow> 0

goal (2 subgoals):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j))
 2. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
from summable_ratio_test_tendsto[OF _ _ this] a b
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < 1; \<forall>n. real_of_int (b n) / real_of_int (a n) \<noteq> 0\<rbrakk> \<Longrightarrow> summable (\<lambda>n. real_of_int (b n) / real_of_int (a n))
\<forall>n. 0 < a n
\<forall>n. 0 < b n
[PROOF STEP]
show "summable c"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; \<forall>n. real_of_int (b n) / real_of_int (a n) \<noteq> 0\<rbrakk> \<Longrightarrow> summable (\<lambda>n. real_of_int (b n) / real_of_int (a n))
\<forall>n. 0 < a n
\<forall>n. 0 < b n

goal (1 subgoal):
 1. summable c
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; \<forall>n. real_of_int (b n) / real_of_int (a n) \<noteq> 0\<rbrakk> \<Longrightarrow> summable (\<lambda>n. real_of_int (b n) / real_of_int (a n))
\<forall>n. 0 < a n
\<forall>n. 0 < b n

goal (1 subgoal):
 1. summable (\<lambda>j. real_of_int (b j) / real_of_int (a j))
[PROOF STEP]
by (metis c_def c_pos less_irrefl zero_less_one)
[PROOF STATE]
proof (state)
this:
summable c

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n
[PROOF STEP]
obtain N where N_ratio:"\<forall>n\<ge>N. c (n + 1) / c n < 1 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. c (n + 1) / c n < 1 / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. c (n + 1) / c n < 1 / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "eventually (\<lambda>n. c (n+1) / c n < 1/2) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) / c n < 1 / 2
[PROOF STEP]
using c_ratio_tendsto[unfolded tendsto_iff,rule_format, of "1/2",simplified]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. \<bar>c (Suc x)\<bar> * 2 / \<bar>c x\<bar> < 1

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c (n + 1) / c n < 1 / 2
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<bar>c (Suc n)\<bar> * 2 / \<bar>c n\<bar> < 1 \<Longrightarrow> c (n + 1) / c n < 1 / 2
[PROOF STEP]
subgoal for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>c (Suc n)\<bar> * 2 / \<bar>c n\<bar> < 1 \<Longrightarrow> c (n + 1) / c n < 1 / 2
[PROOF STEP]
using c_pos[of n] c_pos[of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
0 < c n
0 < c (Suc n)

goal (1 subgoal):
 1. \<bar>c (Suc n)\<bar> * 2 / \<bar>c n\<bar> < 1 \<Longrightarrow> c (n + 1) / c n < 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c (n + 1) / c n < 1 / 2

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. c (n + 1) / c n < 1 / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. c (n + 1) / c n < 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. c (n + 1) / c n < 1 / 2

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. c (n + 1) / c n < 1 / 2
\<forall>n\<ge>?N. c (n + 1) / c n < 1 / 2 \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. c (n + 1) / c n < 1 / 2
\<forall>n\<ge>?N. c (n + 1) / c n < 1 / 2 \<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:
\<forall>n\<ge>N. c (n + 1) / c n < 1 / 2

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n
[PROOF STEP]
have "(\<Sum>j. c (j + n)) \<le> 2 * c n" when "n\<ge>N" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
have "(\<Sum>j<m. c (j + n)) \<le> 2*c n * (1 - 1 / 2^(m+1))" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1))
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Sum>j<0. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (0 + 1))
 2. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<Sum>j<0. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (0 + 1))
 2. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<0. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (0 + 1))
[PROOF STEP]
using c_pos[of n]
[PROOF STATE]
proof (prove)
using this:
0 < c n

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

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1))

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
have "(\<Sum>j<Suc m. c (j + n)) = c n + (\<Sum>i<m. c (Suc i + n)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<Suc m. c (j + n)) = c n + (\<Sum>i<m. c (Suc i + n))
[PROOF STEP]
unfolding sum.lessThan_Suc_shift
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c (0 + n) + (\<Sum>i<m. c (Suc i + n)) = c n + (\<Sum>i<m. c (Suc i + n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j<Suc m. c (j + n)) = c n + (\<Sum>i<m. c (Suc i + n))

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<Suc m. c (j + n)) = c n + (\<Sum>i<m. c (Suc i + n))

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
have "... \<le> c n + (\<Sum>i<m. c (i + n) / 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)
[PROOF STEP]
have "c (Suc i + n) \<le> c (i + n) / 2" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c (Suc i + n) \<le> c (i + n) / 2
[PROOF STEP]
using N_ratio[rule_format,of "i+n"] \<open>n\<ge>N\<close> c_pos[of "i+n"]
[PROOF STATE]
proof (prove)
using this:
N \<le> i + n \<Longrightarrow> c (i + n + 1) / c (i + n) < 1 / 2
N \<le> n
0 < c (i + n)

goal (1 subgoal):
 1. c (Suc i + n) \<le> c (i + n) / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c (Suc ?i + n) \<le> c (?i + n) / 2

goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c (Suc ?i + n) \<le> c (?i + n) / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c (Suc ?i + n) \<le> c (?i + n) / 2

goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)
[PROOF STEP]
by (auto intro:sum_mono)
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (Suc i + n)) \<le> c n + (\<Sum>i<m. c (i + n) / 2)

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
have "... = c n + (\<Sum>i<m. c (i + n)) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (i + n) / 2) = c n + (\<Sum>i<m. c (i + n)) / 2
[PROOF STEP]
unfolding sum_divide_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (i + n) / 2) = c n + (\<Sum>na<m. c (na + n) / 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (i + n) / 2) = c n + (\<Sum>i<m. c (i + n)) / 2

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (i + n) / 2) = c n + (\<Sum>i<m. c (i + n)) / 2

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
have "... \<le> c n + c n * (1 - 1 / 2 ^ (m + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (i + n)) / 2 \<le> c n + c n * (1 - 1 / 2 ^ (m + 1))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1))

goal (1 subgoal):
 1. c n + (\<Sum>i<m. c (i + n)) / 2 \<le> c n + c n * (1 - 1 / 2 ^ (m + 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (i + n)) / 2 \<le> c n + c n * (1 - 1 / 2 ^ (m + 1))

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c n + (\<Sum>i<m. c (i + n)) / 2 \<le> c n + c n * (1 - 1 / 2 ^ (m + 1))

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
have "... = 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c n + c n * (1 - 1 / 2 ^ (m + 1)) = 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
c n + c n * (1 - 1 / 2 ^ (m + 1)) = 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))

goal (1 subgoal):
 1. \<And>m. (\<Sum>j<m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (m + 1)) \<Longrightarrow> (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))

goal (1 subgoal):
 1. (\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j<Suc m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (Suc m + 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (?m + 1))

goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (?m + 1))
[PROOF STEP]
have "(\<Sum>j<m. c (j + n)) \<le> 2*c n" for m
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (?m + 1))

goal (1 subgoal):
 1. (\<Sum>j<m. c (j + n)) \<le> 2 * c n
[PROOF STEP]
using c_pos[of n]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n * (1 - 1 / 2 ^ (?m + 1))
0 < c n

goal (1 subgoal):
 1. (\<Sum>j<m. c (j + n)) \<le> 2 * c n
[PROOF STEP]
by (smt divide_le_eq_1_pos divide_pos_pos nonzero_mult_div_cancel_left zero_less_power)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n

goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n

goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
have "summable (\<lambda>j. c (j + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>j. c (j + n))
[PROOF STEP]
using \<open>summable c\<close>
[PROOF STATE]
proof (prove)
using this:
summable c

goal (1 subgoal):
 1. summable (\<lambda>j. c (j + n))
[PROOF STEP]
by (simp add: summable_iff_shift)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>j. c (j + n))

goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n
summable (\<lambda>j. c (j + n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n
summable (\<lambda>j. c (j + n))

goal (1 subgoal):
 1. (\<Sum>j. c (j + n)) \<le> 2 * c n
[PROOF STEP]
using suminf_le_const[of "\<lambda>j. c (j+n)" "2*c n"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<?m. c (j + n)) \<le> 2 * c n
summable (\<lambda>j. c (j + n))
\<lbrakk>summable (\<lambda>j. c (j + n)); \<And>na. (\<Sum>j<na. c (j + n)) \<le> 2 * c n\<rbrakk> \<Longrightarrow> (\<Sum>j. c (j + n)) \<le> 2 * c n

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> (\<Sum>j. c (j + ?n)) \<le> 2 * c ?n

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

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> (\<Sum>j. c (j + ?n)) \<le> 2 * c ?n

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. (\<Sum>j. c (n + j)) \<le> 2 * c n
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n

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

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n
[PROOF STEP]
show "\<forall>\<^sub>F n in sequentially. (\<Sum>j. (b (n + j)) /  (a (n + j))) \<le> 2 * b n / a n"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (\<Sum>j. c (n + j)) \<le> 2 * c n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
unfolding c_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> 2 * (real_of_int (b n) / real_of_int (a n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (\<Sum>j. real_of_int (b (n + j)) / real_of_int (a (n + j))) \<le> real_of_int (2 * b n) / real_of_int (a n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_0_power: "coeff (p ^ n) 0 = coeff p 0 ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (p ^ n) 0 = coeff p 0 ^ n
[PROOF STEP]
by (induct n) (simp_all add: coeff_mult)


[STATEMENT]
lemma locally_compactE:
  fixes S :: "'a :: metric_space set"
  assumes "locally compact S"
  obtains u v where "\<And>x. x \<in> S \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> S \<and>
                             openin (top_of_set S) (u x) \<and> compact (v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u v. (\<And>x. x \<in> S \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> S \<and> openin (top_of_set S) (u x) \<and> compact (v x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally compact S

goal (1 subgoal):
 1. (\<And>u v. (\<And>x. x \<in> S \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> S \<and> openin (top_of_set S) (u x) \<and> compact (v x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding locally_compact
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<exists>u v. x \<in> u \<and> u \<subseteq> v \<and> v \<subseteq> S \<and> openin (top_of_set S) u \<and> compact v

goal (1 subgoal):
 1. (\<And>u v. (\<And>x. x \<in> S \<Longrightarrow> x \<in> u x \<and> u x \<subseteq> v x \<and> v x \<subseteq> S \<and> openin (top_of_set S) (u x) \<and> compact (v x)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis


[STATEMENT]
lemma Borsuk_maps_homotopic_in_path_component:
  assumes "path_component (- s) a b"
    shows "homotopic_with_canon (\<lambda>x. True) s (sphere 0 1)
                   (\<lambda>x. inverse(norm(x - a)) *\<^sub>R (x - a))
                   (\<lambda>x. inverse(norm(x - b)) *\<^sub>R (x - b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>x. True) s (sphere (0::'a) 1) (\<lambda>x. (x - a) /\<^sub>R norm (x - a)) (\<lambda>x. (x - b) /\<^sub>R norm (x - b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>x. True) s (sphere (0::'a) 1) (\<lambda>x. (x - a) /\<^sub>R norm (x - a)) (\<lambda>x. (x - b) /\<^sub>R norm (x - b))
[PROOF STEP]
obtain g where "path g" "path_image g \<subseteq> -s" "pathstart g = a" "pathfinish g = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>path g; path_image g \<subseteq> - s; pathstart g = a; pathfinish g = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path_component (- s) a b

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>path g; path_image g \<subseteq> - s; pathstart g = a; pathfinish g = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: path_component_def)
[PROOF STATE]
proof (state)
this:
path g
path_image g \<subseteq> - s
pathstart g = a
pathfinish g = b

goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>x. True) s (sphere (0::'a) 1) (\<lambda>x. (x - a) /\<^sub>R norm (x - a)) (\<lambda>x. (x - b) /\<^sub>R norm (x - b))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path g
path_image g \<subseteq> - s
pathstart g = a
pathfinish g = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
path g
path_image g \<subseteq> - s
pathstart g = a
pathfinish g = b

goal (1 subgoal):
 1. homotopic_with_canon (\<lambda>x. True) s (sphere (0::'a) 1) (\<lambda>x. (x - a) /\<^sub>R norm (x - a)) (\<lambda>x. (x - b) /\<^sub>R norm (x - b))
[PROOF STEP]
apply (simp add: path_def path_image_def pathstart_def pathfinish_def homotopic_with_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> \<exists>h. continuous_on ({0..1} \<times> s) h \<and> h ` ({0..1} \<times> s) \<subseteq> sphere (0::'a) 1 \<and> (\<forall>x. h (0, x) = (x - a) /\<^sub>R norm (x - a)) \<and> (\<forall>x. h (1, x) = (x - b) /\<^sub>R norm (x - b))
[PROOF STEP]
apply (rule_tac x = "\<lambda>z. inverse(norm(snd z - (g \<circ> fst)z)) *\<^sub>R (snd z - (g \<circ> fst)z)" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> continuous_on ({0..1} \<times> s) (\<lambda>z. (snd z - (g \<circ> fst) z) /\<^sub>R norm (snd z - (g \<circ> fst) z)) \<and> (\<lambda>z. (snd z - (g \<circ> fst) z) /\<^sub>R norm (snd z - (g \<circ> fst) z)) ` ({0..1} \<times> s) \<subseteq> sphere (0::'a) 1 \<and> (\<forall>x. (snd (0, x) - (g \<circ> fst) (0, x)) /\<^sub>R norm (snd (0, x) - (g \<circ> fst) (0, x)) = (x - a) /\<^sub>R norm (x - a)) \<and> (\<forall>x. (snd (1, x) - (g \<circ> fst) (1, x)) /\<^sub>R norm (snd (1, x) - (g \<circ> fst) (1, x)) = (x - b) /\<^sub>R norm (x - b))
[PROOF STEP]
apply (intro conjI continuous_intros)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> continuous_on (fst ` ({0..1} \<times> s)) g
 2. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> \<forall>x\<in>{0..1} \<times> s. norm (snd x - (g \<circ> fst) x) \<noteq> 0
 3. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> continuous_on (fst ` ({0..1} \<times> s)) g
 4. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> (\<lambda>z. (snd z - (g \<circ> fst) z) /\<^sub>R norm (snd z - (g \<circ> fst) z)) ` ({0..1} \<times> s) \<subseteq> sphere (0::'a) 1
 5. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> \<forall>x. (snd (0, x) - (g \<circ> fst) (0, x)) /\<^sub>R norm (snd (0, x) - (g \<circ> fst) (0, x)) = (x - a) /\<^sub>R norm (x - a)
 6. \<lbrakk>continuous_on {0..1} g; g ` {0..1} \<subseteq> - s; g 0 = a; g 1 = b\<rbrakk> \<Longrightarrow> \<forall>x. (snd (1, x) - (g \<circ> fst) (1, x)) /\<^sub>R norm (snd (1, x) - (g \<circ> fst) (1, x)) = (x - b) /\<^sub>R norm (x - b)
[PROOF STEP]
apply (rule continuous_intros | erule continuous_on_subset | fastforce simp: divide_simps sphere_def)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
homotopic_with_canon (\<lambda>x. True) s (sphere (0::'a) 1) (\<lambda>x. (x - a) /\<^sub>R norm (x - a)) (\<lambda>x. (x - b) /\<^sub>R norm (x - b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj_monom_mult: "proj_poly k (monom_mult c t p) = punit.monom_mult c t (proj_poly k p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (monom_mult c t p) = punit.monom_mult c t (proj_poly k p)
[PROOF STEP]
by (metis mult_scalar_monomial proj_mult_scalar punit.mult_scalar_monomial punit_mult_scalar)


[STATEMENT]
lemma dyad_rec_41_times2:
  assumes "n > 0"
    shows "dyad_rec b l r (2 * ((4 * real m + 1) / 2^Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
obtain n' where n': "n = Suc n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n'. n = Suc n' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms not0_implies_Suc
[PROOF STATE]
proof (prove)
using this:
0 < n
?n \<noteq> 0 \<Longrightarrow> \<exists>m. ?n = Suc m

goal (1 subgoal):
 1. (\<And>n'. n = Suc n' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = Suc n'

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
have "dyad_rec b l r (2 * ((4 * real m + 1) / 2^Suc n)) = dyad_rec b l r ((2 * (4 * real m + 1)) / (2 * 2^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = dyad_rec b l r (2 * (4 * real m + 1) / (2 * 2 ^ n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = dyad_rec b l r (2 * (4 * real m + 1) / (2 * 2 ^ n))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = dyad_rec b l r (2 * (4 * real m + 1) / (2 * 2 ^ n))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
have "... = dyad_rec b l r ((4 * real m + 1) / 2^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dyad_rec b l r (2 * (4 * real m + 1) / (2 * 2 ^ n)) = dyad_rec b l r ((4 * real m + 1) / 2 ^ n)
[PROOF STEP]
by (subst mult_divide_mult_cancel_left) auto
[PROOF STATE]
proof (state)
this:
dyad_rec b l r (2 * (4 * real m + 1) / (2 * 2 ^ n)) = dyad_rec b l r ((4 * real m + 1) / 2 ^ n)

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dyad_rec b l r (2 * (4 * real m + 1) / (2 * 2 ^ n)) = dyad_rec b l r ((4 * real m + 1) / 2 ^ n)

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
have "... = l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dyad_rec b l r ((4 * real m + 1) / 2 ^ n) = l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n'))
[PROOF STEP]
by (simp add: add.commute [of 1] n' del: power_Suc)
[PROOF STATE]
proof (state)
this:
dyad_rec b l r ((4 * real m + 1) / 2 ^ n) = l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n'))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dyad_rec b l r ((4 * real m + 1) / 2 ^ n) = l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n'))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
have "... = l (dyad_rec b l r ((2 * (2 * real m + 1)) / (2 * 2 ^ n')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n')) = l (dyad_rec b l r (2 * (2 * real m + 1) / (2 * 2 ^ n')))
[PROOF STEP]
by (subst mult_divide_mult_cancel_left) auto
[PROOF STATE]
proof (state)
this:
l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n')) = l (dyad_rec b l r (2 * (2 * real m + 1) / (2 * 2 ^ n')))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l (dyad_rec b l r ((2 * real m + 1) / 2 ^ n')) = l (dyad_rec b l r (2 * (2 * real m + 1) / (2 * 2 ^ n')))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
have "... = l (dyad_rec b l r (2 * (2 * real m + 1) / 2^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l (dyad_rec b l r (2 * (2 * real m + 1) / (2 * 2 ^ n'))) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
by (simp add: add.commute n')
[PROOF STATE]
proof (state)
this:
l (dyad_rec b l r (2 * (2 * real m + 1) / (2 * 2 ^ n'))) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))

goal (1 subgoal):
 1. dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dyad_rec b l r (2 * ((4 * real m + 1) / 2 ^ Suc n)) = l (dyad_rec b l r (2 * (2 * real m + 1) / 2 ^ n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_unit_monom_trivial: "is_unit p \<Longrightarrow> monom (coeff p (degree p)) 0 = p"
  for p :: "'a::field poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit p \<Longrightarrow> monom (lead_coeff p) 0 = p
[PROOF STEP]
by (cases p) (simp_all add: monom_0 is_unit_pCons_iff)