[STATEMENT]
lemma transcendental_i_pi: "\<not>algebraic (\<i> * pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> algebraic (\<i> * complex_of_real pi)
[PROOF STEP]
proof
  \<comment> \<open>Suppose $i\pi$ were algebraic.\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
assume "algebraic (\<i> * pi)"
  \<comment> \<open>We obtain some nonzero integer polynomial that has $i\pi$ as a root. We can assume
      w.\,l.\,o.\,g.\ that the constant coefficient of this polynomial is nonzero.\<close>
[PROOF STATE]
proof (state)
this:
algebraic (\<i> * complex_of_real pi)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
algebraic (\<i> * complex_of_real pi)
[PROOF STEP]
obtain p
    where p: "poly (of_int_poly p) (\<i> * pi) = 0" "p \<noteq> 0" "poly.coeff p 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
algebraic (\<i> * complex_of_real pi)

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>poly (of_int_poly p) (\<i> * complex_of_real pi) = 0; p \<noteq> 0; poly.coeff p 0 \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim algebraicE'_nonzero) auto
[PROOF STATE]
proof (state)
this:
poly (of_int_poly p) (\<i> * complex_of_real pi) = 0
p \<noteq> 0
poly.coeff p 0 \<noteq> 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define n where "n = Polynomial.degree p"

  \<comment> \<open>We define the sequence of the roots of this polynomial:\<close>
[PROOF STATE]
proof (state)
this:
n = Polynomial.degree p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
obtain root where "Polynomial.smult (Polynomial.lead_coeff (of_int_poly p))
                       (\<Prod>i<n. [:-root i :: complex, 1:]) = of_int_poly p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>root. Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<n. [:- root i, 1:]) = of_int_poly p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using complex_poly_decompose'[of "of_int_poly p"]
[PROOF STATE]
proof (prove)
using this:
(\<And>root. Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<Polynomial.degree (of_int_poly p). [:- root i, 1:]) = of_int_poly p \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>root. Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<n. [:- root i, 1:]) = of_int_poly p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
using this:
(\<And>root. Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<Polynomial.degree (of_int_poly p). [:- root i, 1:]) = of_int_poly p \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>root. Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<Polynomial.degree p. [:- root i, 1:]) = of_int_poly p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<n. [:- root i, 1:]) = of_int_poly p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
note root = this [symmetric]

  \<comment> \<open>We note that $i\pi$ is, of course, among these roots.\<close>
[PROOF STATE]
proof (state)
this:
of_int_poly p = Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<n. [:- root i, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
from p and root
[PROOF STATE]
proof (chain)
picking this:
poly (of_int_poly p) (\<i> * complex_of_real pi) = 0
p \<noteq> 0
poly.coeff p 0 \<noteq> 0
of_int_poly p = Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<n. [:- root i, 1:])
[PROOF STEP]
obtain idx where idx: "idx < n" "root idx = \<i> * pi"
[PROOF STATE]
proof (prove)
using this:
poly (of_int_poly p) (\<i> * complex_of_real pi) = 0
p \<noteq> 0
poly.coeff p 0 \<noteq> 0
of_int_poly p = Polynomial.smult (Polynomial.lead_coeff (of_int_poly p)) (\<Prod>i<n. [:- root i, 1:])

goal (1 subgoal):
 1. (\<And>idx. \<lbrakk>idx < n; root idx = \<i> * complex_of_real pi\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: poly_prod)

  \<comment> \<open>We now define a new polynomial \<open>P'\<close>, whose roots are all numbers that arise as a
      sum of any subset of roots of \<open>p\<close>. We also count all those subsets that sum up to 0
      and call their number \<open>A\<close>.\<close>
[PROOF STATE]
proof (state)
this:
idx < n
root idx = \<i> * complex_of_real pi

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define root' where "root' = (\<lambda>X. (\<Sum>j\<in>X. root j))"
[PROOF STATE]
proof (state)
this:
root' = sum root

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define P where "P = (\<lambda>i. \<Prod>X | X \<subseteq> {..<n} \<and> card X = i. [:-root' X, 1:])"
[PROOF STATE]
proof (state)
this:
P = (\<lambda>i. \<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = i}. [:- root' X, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define P' where "P' = (\<Prod>i\<in>{0<..n}. P i)"
[PROOF STATE]
proof (state)
this:
P' = prod P {0<..n}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define A where "A = card {X\<in>Pow {..<n}. root' X = 0}"
[PROOF STATE]
proof (state)
this:
A = card {X \<in> Pow {..<n}. root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have [simp]: "P' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' \<noteq> 0
[PROOF STEP]
by (auto simp: P'_def P_def)

  \<comment> \<open>We give the name \<open>Roots'\<close> to those subsets that do not sum to zero and note that there
      is at least one, namely $\{i\pi\}$.\<close>
[PROOF STATE]
proof (state)
this:
P' \<noteq> 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define Roots' where "Roots' = {X. X \<subseteq> {..<n} \<and> root' X \<noteq> 0}"
[PROOF STATE]
proof (state)
this:
Roots' = {X. X \<subseteq> {..<n} \<and> root' X \<noteq> 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have [intro]: "finite Roots'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Roots'
[PROOF STEP]
by (auto simp: Roots'_def)
[PROOF STATE]
proof (state)
this:
finite Roots'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "{idx} \<in> Roots'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {idx} \<in> Roots'
[PROOF STEP]
using idx
[PROOF STATE]
proof (prove)
using this:
idx < n
root idx = \<i> * complex_of_real pi

goal (1 subgoal):
 1. {idx} \<in> Roots'
[PROOF STEP]
by (auto simp: Roots'_def root'_def)
[PROOF STATE]
proof (state)
this:
{idx} \<in> Roots'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence "Roots' \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
{idx} \<in> Roots'

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

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence card_Roots': "card Roots' > 0"
[PROOF STATE]
proof (prove)
using this:
Roots' \<noteq> {}

goal (1 subgoal):
 1. 0 < card Roots'
[PROOF STEP]
by (auto simp: card_eq_0_iff)
[PROOF STATE]
proof (state)
this:
0 < card Roots'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have P'_altdef: "P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:-root' X, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
have "P' = (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' = (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:])
[PROOF STEP]
unfolding P'_def P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>{0<..n}. \<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = i}. [:- root' X, 1:]) = (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:])
[PROOF STEP]
by (subst prod.Sigma) auto
[PROOF STATE]
proof (state)
this:
P' = (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:])

goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P' = (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:])

goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
have "\<dots> = (\<Prod>X\<in>Pow{..<n} - {{}}. [:- root' X, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:]) = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
using card_mono[of "{..<n}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {..<n}; ?A \<subseteq> {..<n}\<rbrakk> \<Longrightarrow> card ?A \<le> card {..<n}

goal (1 subgoal):
 1. (\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:]) = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
by (intro prod.reindex_bij_witness[of _ "\<lambda>X. (card X, X)" "\<lambda>(_, X). X"])
         (auto simp: case_prod_unfold card_gt_0_iff intro: finite_subset[of _ "{..<n}"])
[PROOF STATE]
proof (state)
this:
(\<Prod>(i, X)\<in>(SIGMA x:{0<..n}. {X. X \<subseteq> {..<n} \<and> card X = x}). [:- root' X, 1:]) = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])

goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])

goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>Clearly, @{term A} is nonzero, since the empty set sums to 0.\<close>
[PROOF STATE]
proof (state)
this:
P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "A > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < A
[PROOF STEP]
have "{} \<in> {X\<in>Pow {..<n}. root' X = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {} \<in> {X \<in> Pow {..<n}. root' X = 0}
[PROOF STEP]
by (auto simp: root'_def)
[PROOF STATE]
proof (state)
this:
{} \<in> {X \<in> Pow {..<n}. root' X = 0}

goal (1 subgoal):
 1. 0 < A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{} \<in> {X \<in> Pow {..<n}. root' X = 0}

goal (1 subgoal):
 1. 0 < A
[PROOF STEP]
by (auto simp: A_def card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
0 < A

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>Since $e^{i\pi} + 1 = 0$, we know the following:\<close>
[PROOF STATE]
proof (state)
this:
0 < A

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "0 = (\<Prod>i<n. exp (root i) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = (\<Prod>i<n. exp (root i) + 1)
[PROOF STEP]
using idx
[PROOF STATE]
proof (prove)
using this:
idx < n
root idx = \<i> * complex_of_real pi

goal (1 subgoal):
 1. 0 = (\<Prod>i<n. exp (root i) + 1)
[PROOF STEP]
by force
  \<comment> \<open>We rearrange this product of sums into a sum of products and collect all summands that are
      1 into a separate sum, which we call @{term A}:\<close>
[PROOF STATE]
proof (state)
this:
0 = (\<Prod>i<n. exp (root i) + 1)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = (\<Prod>i<n. exp (root i) + 1)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (\<Sum>X\<in>Pow {..<n}. \<Prod>i\<in>X. exp (root i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i<n. exp (root i) + 1) = sum (prod (\<lambda>i. exp (root i))) (Pow {..<n})
[PROOF STEP]
by (subst prod_add) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i<n. exp (root i) + 1) = sum (prod (\<lambda>i. exp (root i))) (Pow {..<n})

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i<n. exp (root i) + 1) = sum (prod (\<lambda>i. exp (root i))) (Pow {..<n})

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (\<Sum>X\<in>Pow {..<n}. exp (root' X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (prod (\<lambda>i. exp (root i))) (Pow {..<n}) = (\<Sum>X\<in>Pow {..<n}. exp (root' X))
[PROOF STEP]
by (intro sum.cong refl, subst exp_sum [symmetric])
       (auto simp: root'_def intro: finite_subset[of _ "{..<n}"])
[PROOF STATE]
proof (state)
this:
sum (prod (\<lambda>i. exp (root i))) (Pow {..<n}) = (\<Sum>X\<in>Pow {..<n}. exp (root' X))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (prod (\<lambda>i. exp (root i))) (Pow {..<n}) = (\<Sum>X\<in>Pow {..<n}. exp (root' X))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "Pow {..<n} = {X\<in>Pow {..<n}. root' X \<noteq> 0} \<union> {X\<in>Pow {..<n}. root' X = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pow {..<n} = {X \<in> Pow {..<n}. root' X \<noteq> 0} \<union> {X \<in> Pow {..<n}. root' X = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Pow {..<n} = {X \<in> Pow {..<n}. root' X \<noteq> 0} \<union> {X \<in> Pow {..<n}. root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Pow {..<n} = {X \<in> Pow {..<n}. root' X \<noteq> 0} \<union> {X \<in> Pow {..<n}. root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>X\<in>\<dots>. exp (root' X)) = (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) +
                                       (\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>X\<in>{X \<in> Pow {..<n}. root' X \<noteq> 0} \<union> {X \<in> Pow {..<n}. root' X = 0}. exp (root' X)) = (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) + (\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X))
[PROOF STEP]
by (subst sum.union_disjoint) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>X\<in>{X \<in> Pow {..<n}. root' X \<noteq> 0} \<union> {X \<in> Pow {..<n}. root' X = 0}. exp (root' X)) = (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) + (\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>X\<in>{X \<in> Pow {..<n}. root' X \<noteq> 0} \<union> {X \<in> Pow {..<n}. root' X = 0}. exp (root' X)) = (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) + (\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X)) = of_nat A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X)) = of_nat A
[PROOF STEP]
by (simp add: A_def)
  \<comment> \<open>Finally, we obtain the fact that the sum of $\exp(u)$ with $u$ ranging over all the non-zero
      roots of @{term P'} is a negative integer.\<close>
[PROOF STATE]
proof (state)
this:
(\<Sum>X | X \<subseteq> {..<n} \<and> root' X = 0. exp (root' X)) = of_nat A

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 = (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) + of_nat A
[PROOF STEP]
have eq: "(\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) = -of_nat A"
[PROOF STATE]
proof (prove)
using this:
0 = (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) + of_nat A

goal (1 subgoal):
 1. (\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) = - of_nat A
[PROOF STEP]
by (simp add: add_eq_0_iff2)

  \<comment> \<open>Next, we show that \<open>P'\<close> is a rational polynomial since it can be written as a symmetric
      polynomial expression (with rational coefficients) in the roots of \<open>p\<close>.\<close>
[PROOF STATE]
proof (state)
this:
(\<Sum>X | X \<subseteq> {..<n} \<and> root' X \<noteq> 0. exp (root' X)) = - of_nat A

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define ratpolys where "ratpolys = {p::complex poly. \<forall>i. poly.coeff p i \<in> \<rat>}"
[PROOF STATE]
proof (state)
this:
ratpolys = {p. \<forall>i. poly.coeff p i \<in> \<rat>}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have ratpolysI: "p \<in> ratpolys" if "\<And>i. poly.coeff p i \<in> \<rat>" for p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> ratpolys
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
poly.coeff p ?i \<in> \<rat>

goal (1 subgoal):
 1. p \<in> ratpolys
[PROOF STEP]
by (auto simp: ratpolys_def)
[PROOF STATE]
proof (state)
this:
(\<And>i. poly.coeff ?p i \<in> \<rat>) \<Longrightarrow> ?p \<in> ratpolys

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "P' \<in> ratpolys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
define Pmv :: "nat \<Rightarrow> complex poly mpoly"
      where "Pmv = (\<lambda>i. \<Prod>X | X \<subseteq> {..<n} \<and> card X = i. Const ([:0,1:]) -
                          (\<Sum>i\<in>X. monom (Poly_Mapping.single i 1) 1))"
[PROOF STATE]
proof (state)
this:
Pmv = (\<lambda>i. \<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = i}. Const [:0, 1:] - (\<Sum>i\<in>X. MPoly_Type.monom (Poly_Mapping.single i 1) 1))

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
define P'mv where "P'mv = (\<Prod>i\<in>{0<..n}. Pmv i)"
[PROOF STATE]
proof (state)
this:
P'mv = prod Pmv {0<..n}

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
have "insertion (\<lambda>i. [:root i:]) P'mv \<in> ratpolys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion (\<lambda>i. [:root i:]) P'mv \<in> ratpolys
[PROOF STEP]
proof (rule symmetric_poly_of_roots_in_subring[where l = "\<lambda>x. [:x:]"])
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. ring_closed ratpolys
 2. \<forall>m. MPoly_Type.coeff P'mv m \<in> ratpolys
 3. ring_homomorphism (\<lambda>i. [:i:])
 4. finite ?A
 5. symmetric_mpoly ?A P'mv
 6. vars P'mv \<subseteq> ?A
 7. ?cinv * [:?c:] = 1
 8. ?cinv \<in> ratpolys
 9. ?p = Polynomial.smult ?c (\<Prod>i\<in>?A. [:- root i, 1:])
 10. \<forall>i. [:poly.coeff ?p i:] \<in> ratpolys
[PROOF STEP]
show "ring_closed ratpolys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_closed ratpolys
[PROOF STEP]
by standard (auto simp: ratpolys_def coeff_mult)
[PROOF STATE]
proof (state)
this:
ring_closed ratpolys

goal (9 subgoals):
 1. \<forall>m. MPoly_Type.coeff P'mv m \<in> ratpolys
 2. ring_homomorphism (\<lambda>i. [:i:])
 3. finite ?A
 4. symmetric_mpoly ?A P'mv
 5. vars P'mv \<subseteq> ?A
 6. ?cinv * [:?c:] = 1
 7. ?cinv \<in> ratpolys
 8. ?p = Polynomial.smult ?c (\<Prod>i\<in>?A. [:- root i, 1:])
 9. \<forall>i. [:poly.coeff ?p i:] \<in> ratpolys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ring_closed ratpolys
[PROOF STEP]
interpret ring_closed ratpolys
[PROOF STATE]
proof (prove)
using this:
ring_closed ratpolys

goal (1 subgoal):
 1. ring_closed ratpolys
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<forall>m. MPoly_Type.coeff P'mv m \<in> ratpolys
 2. ring_homomorphism (\<lambda>i. [:i:])
 3. finite ?A
 4. symmetric_mpoly ?A P'mv
 5. vars P'mv \<subseteq> ?A
 6. ?cinv * [:?c:] = 1
 7. ?cinv \<in> ratpolys
 8. ?p = Polynomial.smult ?c (\<Prod>i\<in>?A. [:- root i, 1:])
 9. \<forall>i. [:poly.coeff ?p i:] \<in> ratpolys
[PROOF STEP]
show "\<forall>m. coeff P'mv m \<in> ratpolys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. MPoly_Type.coeff P'mv m \<in> ratpolys
[PROOF STEP]
by (auto simp: P'mv_def Pmv_def coeff_monom when_def mpoly_coeff_Const coeff_pCons' ratpolysI
                 intro!: coeff_prod_closed minus_closed sum_closed uminus_closed)
[PROOF STATE]
proof (state)
this:
\<forall>m. MPoly_Type.coeff P'mv m \<in> ratpolys

goal (8 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite ?A
 3. symmetric_mpoly ?A P'mv
 4. vars P'mv \<subseteq> ?A
 5. ?cinv * [:?c:] = 1
 6. ?cinv \<in> ratpolys
 7. ?p = Polynomial.smult ?c (\<Prod>i\<in>?A. [:- root i, 1:])
 8. \<forall>i. [:poly.coeff ?p i:] \<in> ratpolys
[PROOF STEP]
show "\<forall>i. [:poly.coeff (of_int_poly p) i:] \<in> ratpolys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. [:poly.coeff (of_int_poly p) i:] \<in> ratpolys
[PROOF STEP]
by (intro ratpolysI allI) (auto simp: coeff_pCons')
[PROOF STATE]
proof (state)
this:
\<forall>i. [:poly.coeff (of_int_poly p) i:] \<in> ratpolys

goal (7 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite ?A
 3. symmetric_mpoly ?A P'mv
 4. vars P'mv \<subseteq> ?A
 5. ?cinv * [:?c:] = 1
 6. ?cinv \<in> ratpolys
 7. of_int_poly p = Polynomial.smult ?c (\<Prod>i\<in>?A. [:- root i, 1:])
[PROOF STEP]
show "[:inverse (of_int (Polynomial.lead_coeff p)):] *
              [:of_int (Polynomial.lead_coeff p) :: complex:] = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:inverse (of_int (Polynomial.lead_coeff p)):] * [:of_int (Polynomial.lead_coeff p):] = 1
[PROOF STEP]
using \<open>p \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. [:inverse (of_int (Polynomial.lead_coeff p)):] * [:of_int (Polynomial.lead_coeff p):] = 1
[PROOF STEP]
by (auto intro!: poly_eqI simp: field_simps)
[PROOF STATE]
proof (state)
this:
[:inverse (of_int (Polynomial.lead_coeff p)):] * [:of_int (Polynomial.lead_coeff p):] = 1

goal (6 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite ?A
 3. symmetric_mpoly ?A P'mv
 4. vars P'mv \<subseteq> ?A
 5. [:inverse (of_int (Polynomial.lead_coeff p)):] \<in> ratpolys
 6. of_int_poly p = Polynomial.smult (of_int (Polynomial.lead_coeff p)) (\<Prod>i\<in>?A. [:- root i, 1:])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite ?A
 3. symmetric_mpoly ?A P'mv
 4. vars P'mv \<subseteq> ?A
 5. [:inverse (of_int (Polynomial.lead_coeff p)):] \<in> ratpolys
 6. of_int_poly p = Polynomial.smult (of_int (Polynomial.lead_coeff p)) (\<Prod>i\<in>?A. [:- root i, 1:])
[PROOF STEP]
have "symmetric_mpoly {..<n} (Pmv k)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symmetric_mpoly {..<n} (Pmv k)
[PROOF STEP]
unfolding symmetric_mpoly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<pi>. \<pi> permutes {..<n} \<longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
fix \<pi> :: "nat \<Rightarrow> nat"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
assume \<pi>: "\<pi> permutes {..<n}"
[PROOF STATE]
proof (state)
this:
\<pi> permutes {..<n}

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
hence "mpoly_map_vars \<pi> (Pmv k) =
                 (\<Prod>X | X \<subseteq> {..<n} \<and> card X = k. Const [:0, 1:] -
                    (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1))"
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<n}

goal (1 subgoal):
 1. mpoly_map_vars \<pi> (Pmv k) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1))
[PROOF STEP]
by (simp add: Pmv_def permutes_bij)
[PROOF STATE]
proof (state)
this:
mpoly_map_vars \<pi> (Pmv k) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1))

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mpoly_map_vars \<pi> (Pmv k) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1))

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
have "\<dots> = (\<Prod>X | X \<subseteq> {..<n} \<and> card X = k. Const [:0, 1:] -
                          (\<Sum>x\<in>\<pi>`X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1)) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))
[PROOF STEP]
using \<pi>
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<n}

goal (1 subgoal):
 1. (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1)) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))
[PROOF STEP]
by (subst sum.reindex) (auto simp: permutes_inj_on)
[PROOF STATE]
proof (state)
this:
(\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1)) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single (\<pi> x) (Suc 0)) 1)) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
have "\<dots> = (\<Prod>X \<in> (\<lambda>X. \<pi>`X)`{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] -
                          (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1)) = (\<Prod>X\<in>(`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))
[PROOF STEP]
by (subst prod.reindex) (auto intro!: inj_on_image permutes_inj_on[OF \<pi>])
[PROOF STATE]
proof (state)
this:
(\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1)) = (\<Prod>X\<in>(`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>\<pi> ` X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1)) = (\<Prod>X\<in>(`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
have "(\<lambda>X. \<pi>`X)`{X. X \<subseteq> {..<n} \<and> card X = k} = {X. X \<subseteq> \<pi> ` {..<n} \<and> card X = k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k} = {X. X \<subseteq> \<pi> ` {..<n} \<and> card X = k}
[PROOF STEP]
using \<pi>
[PROOF STATE]
proof (prove)
using this:
\<pi> permutes {..<n}

goal (1 subgoal):
 1. (`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k} = {X. X \<subseteq> \<pi> ` {..<n} \<and> card X = k}
[PROOF STEP]
by (subst image_image_fixed_card_subset) (auto simp: permutes_inj_on)
[PROOF STATE]
proof (state)
this:
(`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k} = {X. X \<subseteq> \<pi> ` {..<n} \<and> card X = k}

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(`) \<pi> ` {X. X \<subseteq> {..<n} \<and> card X = k} = {X. X \<subseteq> \<pi> ` {..<n} \<and> card X = k}

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
have "\<pi> ` {..<n} = {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> ` {..<n} = {..<n}
[PROOF STEP]
by (intro permutes_image \<pi>)
[PROOF STATE]
proof (state)
this:
\<pi> ` {..<n} = {..<n}

goal (1 subgoal):
 1. \<And>\<pi>. \<pi> permutes {..<n} \<Longrightarrow> mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mpoly_map_vars \<pi> (Pmv k) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))
[PROOF STEP]
show "mpoly_map_vars \<pi> (Pmv k) = Pmv k"
[PROOF STATE]
proof (prove)
using this:
mpoly_map_vars \<pi> (Pmv k) = (\<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = k}. Const [:0, 1:] - (\<Sum>x\<in>X. MPoly_Type.monom (Poly_Mapping.single x (Suc 0)) 1))

goal (1 subgoal):
 1. mpoly_map_vars \<pi> (Pmv k) = Pmv k
[PROOF STEP]
by (simp add: Pmv_def)
[PROOF STATE]
proof (state)
this:
mpoly_map_vars \<pi> (Pmv k) = Pmv k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
symmetric_mpoly {..<n} (Pmv ?k)

goal (6 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite ?A
 3. symmetric_mpoly ?A P'mv
 4. vars P'mv \<subseteq> ?A
 5. [:inverse (of_int (Polynomial.lead_coeff p)):] \<in> ratpolys
 6. of_int_poly p = Polynomial.smult (of_int (Polynomial.lead_coeff p)) (\<Prod>i\<in>?A. [:- root i, 1:])
[PROOF STEP]
thus "symmetric_mpoly {..<n} P'mv"
[PROOF STATE]
proof (prove)
using this:
symmetric_mpoly {..<n} (Pmv ?k)

goal (1 subgoal):
 1. symmetric_mpoly {..<n} P'mv
[PROOF STEP]
unfolding P'mv_def
[PROOF STATE]
proof (prove)
using this:
symmetric_mpoly {..<n} (Pmv ?k)

goal (1 subgoal):
 1. symmetric_mpoly {..<n} (prod Pmv {0<..n})
[PROOF STEP]
by (intro symmetric_mpoly_prod) auto
[PROOF STATE]
proof (state)
this:
symmetric_mpoly {..<n} P'mv

goal (5 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite {..<n}
 3. vars P'mv \<subseteq> {..<n}
 4. [:inverse (of_int (Polynomial.lead_coeff p)):] \<in> ratpolys
 5. of_int_poly p = Polynomial.smult (of_int (Polynomial.lead_coeff p)) (\<Prod>i<n. [:- root i, 1:])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite {..<n}
 3. vars P'mv \<subseteq> {..<n}
 4. [:inverse (of_int (Polynomial.lead_coeff p)):] \<in> ratpolys
 5. of_int_poly p = Polynomial.smult (of_int (Polynomial.lead_coeff p)) (\<Prod>i<n. [:- root i, 1:])
[PROOF STEP]
show vars_P'mv: "vars P'mv \<subseteq> {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars P'mv \<subseteq> {..<n}
[PROOF STEP]
unfolding P'mv_def Pmv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (\<Prod>i\<in>{0<..n}. \<Prod>X\<in>{X. X \<subseteq> {..<n} \<and> card X = i}. Const [:0, 1:] - (\<Sum>i\<in>X. MPoly_Type.monom (Poly_Mapping.single i 1) 1)) \<subseteq> {..<n}
[PROOF STEP]
by (intro order.trans[OF vars_prod] UN_least order.trans[OF vars_diff]
                   Un_least order.trans[OF vars_sum] order.trans[OF vars_monom_subset]) auto
[PROOF STATE]
proof (state)
this:
vars P'mv \<subseteq> {..<n}

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>i. [:i:])
 2. finite {..<n}
 3. [:inverse (of_int (Polynomial.lead_coeff p)):] \<in> ratpolys
 4. of_int_poly p = Polynomial.smult (of_int (Polynomial.lead_coeff p)) (\<Prod>i<n. [:- root i, 1:])
[PROOF STEP]
qed (insert root, auto intro!: ratpolysI simp: coeff_pCons')
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. [:root i:]) P'mv \<in> ratpolys

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. [:root i:]) P'mv \<in> ratpolys

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
have "insertion (\<lambda>i. [:root i:]) (Pmv k) = P k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion (\<lambda>i. [:root i:]) (Pmv k) = P k
[PROOF STEP]
by (simp add: Pmv_def insertion_prod insertion_diff insertion_sum root'_def P_def
                    sum_to_poly del: insertion_monom)
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. [:root i:]) (Pmv ?k) = P ?k

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
(* TODO: insertion_monom should not be a simp rule *)
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. [:root i:]) (Pmv ?k) = P ?k

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
hence "insertion (\<lambda>i. [:root i:]) P'mv = P'"
[PROOF STATE]
proof (prove)
using this:
insertion (\<lambda>i. [:root i:]) (Pmv ?k) = P ?k

goal (1 subgoal):
 1. insertion (\<lambda>i. [:root i:]) P'mv = P'
[PROOF STEP]
by (simp add: P'mv_def insertion_prod P'_def)
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. [:root i:]) P'mv = P'

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P' \<in> ratpolys
[PROOF STEP]
show "P' \<in> ratpolys"
[PROOF STATE]
proof (prove)
using this:
P' \<in> ratpolys

goal (1 subgoal):
 1. P' \<in> ratpolys
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P' \<in> ratpolys

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>We clear the denominators and remove all powers of $X$ from @{term P'} to obtain a new
      integer polynomial \<open>Q\<close>.\<close>
[PROOF STATE]
proof (state)
this:
P' \<in> ratpolys

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define Q' where "Q' = (\<Prod>X\<in>Roots'. [:- root' X, 1:])"
[PROOF STATE]
proof (state)
this:
Q' = (\<Prod>X\<in>Roots'. [:- root' X, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "P' = (\<Prod>X\<in>Pow {..<n}-{{}}. [:-root' X, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])
[PROOF STEP]
by (simp add: P'_altdef)
[PROOF STATE]
proof (state)
this:
P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P' = (\<Prod>X\<in>Pow {..<n} - {{}}. [:- root' X, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "Pow {..<n}-{{}} = Roots' \<union>
               {X. X \<in> Pow {..<n} - {{}} \<and> root' X = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pow {..<n} - {{}} = Roots' \<union> {X \<in> Pow {..<n} - {{}}. root' X = 0}
[PROOF STEP]
by (auto simp: root'_def Roots'_def)
[PROOF STATE]
proof (state)
this:
Pow {..<n} - {{}} = Roots' \<union> {X \<in> Pow {..<n} - {{}}. root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Pow {..<n} - {{}} = Roots' \<union> {X \<in> Pow {..<n} - {{}}. root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "(\<Prod>X\<in>\<dots>. [:-root' X, 1:]) =
               Q' * [:0, 1:] ^ card {X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>X\<in>Roots' \<union> {X \<in> Pow {..<n} - {{}}. root' X = 0}. [:- root' X, 1:]) = Q' * [:0, 1:] ^ card {X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0}
[PROOF STEP]
by (subst prod.union_disjoint) (auto simp: Q'_def Roots'_def)
[PROOF STATE]
proof (state)
this:
(\<Prod>X\<in>Roots' \<union> {X \<in> Pow {..<n} - {{}}. root' X = 0}. [:- root' X, 1:]) = Q' * [:0, 1:] ^ card {X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>X\<in>Roots' \<union> {X \<in> Pow {..<n} - {{}}. root' X = 0}. [:- root' X, 1:]) = Q' * [:0, 1:] ^ card {X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "{X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0} = {X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0} = {X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0} = {X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{X. X \<subseteq> {..<n} \<and> X \<noteq> {} \<and> root' X = 0} = {X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "card \<dots> = A - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}) = A - 1
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}) = card {X \<in> Pow {..<n}. root' X = 0} - 1
[PROOF STEP]
by (subst card_Diff_singleton) (auto simp: root'_def)
[PROOF STATE]
proof (state)
this:
card ({X. X \<subseteq> {..<n} \<and> root' X = 0} - {{}}) = A - 1

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P' = Q' * [:0, 1:] ^ (A - 1)
[PROOF STEP]
have Q': "P' = Polynomial.monom 1 (A - 1) * Q'"
[PROOF STATE]
proof (prove)
using this:
P' = Q' * [:0, 1:] ^ (A - 1)

goal (1 subgoal):
 1. P' = Polynomial.monom 1 (A - 1) * Q'
[PROOF STEP]
by (simp add: Polynomial.monom_altdef)
[PROOF STATE]
proof (state)
this:
P' = Polynomial.monom 1 (A - 1) * Q'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have degree_Q': "Polynomial.degree P' = Polynomial.degree Q' + (A - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.degree P' = Polynomial.degree Q' + (A - 1)
[PROOF STEP]
by (subst Q')
       (auto simp: Q'_def Roots'_def degree_mult_eq Polynomial.degree_monom_eq degree_prod_eq)
[PROOF STATE]
proof (state)
this:
Polynomial.degree P' = Polynomial.degree Q' + (A - 1)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "\<forall>i. poly.coeff Q' i \<in> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
have "poly.coeff Q' i = Polynomial.coeff P' (i + (A - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff Q' i = poly.coeff P' (i + (A - 1))
[PROOF STEP]
by (simp add: Q' Polynomial.coeff_monom_mult)
[PROOF STATE]
proof (state)
this:
poly.coeff Q' i = poly.coeff P' (i + (A - 1))

goal (1 subgoal):
 1. \<And>i. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly.coeff Q' i = poly.coeff P' (i + (A - 1))

goal (1 subgoal):
 1. \<And>i. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
have "\<dots> \<in> \<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff P' (i + (A - 1)) \<in> \<rat>
[PROOF STEP]
using \<open>P' \<in> ratpolys\<close>
[PROOF STATE]
proof (prove)
using this:
P' \<in> ratpolys

goal (1 subgoal):
 1. poly.coeff P' (i + (A - 1)) \<in> \<rat>
[PROOF STEP]
by (auto simp: ratpolys_def)
[PROOF STATE]
proof (state)
this:
poly.coeff P' (i + (A - 1)) \<in> \<rat>

goal (1 subgoal):
 1. \<And>i. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
show "poly.coeff Q' i \<in> \<rat>"
[PROOF STATE]
proof (prove)
using this:
poly.coeff Q' i \<in> \<rat>

goal (1 subgoal):
 1. poly.coeff Q' i \<in> \<rat>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly.coeff Q' i \<in> \<rat>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i. poly.coeff Q' i \<in> \<rat>

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
from ratpoly_to_intpoly[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>q c. \<lbrakk>c \<noteq> 0; Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly q)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain c Q
    where [simp]: "c \<noteq> 0" and Q: "Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly Q)"
[PROOF STATE]
proof (prove)
using this:
(\<And>q c. \<lbrakk>c \<noteq> 0; Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly q)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>c Q. \<lbrakk>c \<noteq> 0; Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly Q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
c \<noteq> 0
Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly Q)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have [simp]: "Q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q \<noteq> 0
[PROOF STEP]
using Q Q'
[PROOF STATE]
proof (prove)
using this:
Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly Q)
P' = Polynomial.monom 1 (A - 1) * Q'

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

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have Q': "of_int_poly Q = Polynomial.smult (of_nat c) Q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly Q = Polynomial.smult (of_nat c) Q'
[PROOF STEP]
using Q
[PROOF STATE]
proof (prove)
using this:
Q' = Polynomial.smult (inverse (of_nat c)) (of_int_poly Q)

goal (1 subgoal):
 1. of_int_poly Q = Polynomial.smult (of_nat c) Q'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int_poly Q = Polynomial.smult (of_nat c) Q'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have degree_Q: "Polynomial.degree Q = Polynomial.degree Q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.degree Q = Polynomial.degree Q'
[PROOF STEP]
by (subst Q) auto
[PROOF STATE]
proof (state)
this:
Polynomial.degree Q = Polynomial.degree Q'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "Polynomial.lead_coeff (of_int_poly Q :: complex poly) = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.lead_coeff (of_int_poly Q) = of_nat c
[PROOF STEP]
by (subst Q') (simp_all add: degree_Q Q'_def lead_coeff_prod)
[PROOF STATE]
proof (state)
this:
Polynomial.lead_coeff (of_int_poly Q) = of_nat c

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence lead_coeff_Q: "Polynomial.lead_coeff Q = int c"
[PROOF STATE]
proof (prove)
using this:
Polynomial.lead_coeff (of_int_poly Q) = of_nat c

goal (1 subgoal):
 1. Polynomial.lead_coeff Q = int c
[PROOF STEP]
using of_int_eq_iff[of "Polynomial.lead_coeff Q" "of_nat c"]
[PROOF STATE]
proof (prove)
using this:
Polynomial.lead_coeff (of_int_poly Q) = of_nat c
(of_int (Polynomial.lead_coeff Q) = of_int (int c)) = (Polynomial.lead_coeff Q = int c)

goal (1 subgoal):
 1. Polynomial.lead_coeff Q = int c
[PROOF STEP]
by (auto simp del: of_int_eq_iff)
[PROOF STATE]
proof (state)
this:
Polynomial.lead_coeff Q = int c

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have Q_decompose: "of_int_poly Q =
               Polynomial.smult (of_nat c) (\<Prod>X\<in>Roots'. [:- root' X, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly Q = Polynomial.smult (of_nat c) (\<Prod>X\<in>Roots'. [:- root' X, 1:])
[PROOF STEP]
by (subst Q') (auto simp: Q'_def lead_coeff_Q)
[PROOF STATE]
proof (state)
this:
of_int_poly Q = Polynomial.smult (of_nat c) (\<Prod>X\<in>Roots'. [:- root' X, 1:])

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "poly (of_int_poly Q) (\<i> * pi) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (of_int_poly Q) (\<i> * complex_of_real pi) = 0
[PROOF STEP]
using \<open>{idx} \<in> Roots'\<close> \<open>finite Roots'\<close> idx
[PROOF STATE]
proof (prove)
using this:
{idx} \<in> Roots'
finite Roots'
idx < n
root idx = \<i> * complex_of_real pi

goal (1 subgoal):
 1. poly (of_int_poly Q) (\<i> * complex_of_real pi) = 0
[PROOF STEP]
by (force simp: root'_def Q_decompose poly_prod)
[PROOF STATE]
proof (state)
this:
poly (of_int_poly Q) (\<i> * complex_of_real pi) = 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have degree_Q: "Polynomial.degree (of_int_poly Q :: complex poly) = card Roots'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.degree (of_int_poly Q) = card Roots'
[PROOF STEP]
by (subst Q') (auto simp: Q'_def degree_prod_eq)
[PROOF STATE]
proof (state)
this:
Polynomial.degree (of_int_poly Q) = card Roots'

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "poly (of_int_poly Q) (0 :: complex) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (of_int_poly Q) 0 \<noteq> 0
[PROOF STEP]
by (subst Q') (auto simp: Q'_def Roots'_def poly_prod)
[PROOF STATE]
proof (state)
this:
poly (of_int_poly Q) 0 \<noteq> 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence [simp]: "poly Q 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
poly (of_int_poly Q) 0 \<noteq> 0

goal (1 subgoal):
 1. poly Q 0 \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly Q 0 \<noteq> 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have [simp]: "poly (of_int_poly Q) (root' Y) = 0" if "Y \<in> Roots'" for Y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (of_int_poly Q) (root' Y) = 0
[PROOF STEP]
using that \<open>finite Roots'\<close>
[PROOF STATE]
proof (prove)
using this:
Y \<in> Roots'
finite Roots'

goal (1 subgoal):
 1. poly (of_int_poly Q) (root' Y) = 0
[PROOF STEP]
by (auto simp: Q' Q'_def poly_prod)

  \<comment> \<open>We find some closed ball that contains all the roots of @{term Q}.\<close>
[PROOF STATE]
proof (state)
this:
?Y \<in> Roots' \<Longrightarrow> poly (of_int_poly Q) (root' ?Y) = 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define r where "r = Polynomial.degree Q"
[PROOF STATE]
proof (state)
this:
r = Polynomial.degree Q

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using degree_Q card_Roots'
[PROOF STATE]
proof (prove)
using this:
Polynomial.degree (of_int_poly Q) = card Roots'
0 < card Roots'

goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
by (auto simp: r_def)
[PROOF STATE]
proof (state)
this:
0 < r

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define Radius where "Radius = Max ((\<lambda>Y. norm (root' Y)) ` Roots')"
[PROOF STATE]
proof (state)
this:
Radius = (MAX Y\<in>Roots'. cmod (root' Y))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have Radius: "norm (root' Y) \<le> Radius" if "Y \<in> Roots'" for Y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (root' Y) \<le> Radius
[PROOF STEP]
using \<open>finite Roots'\<close> that
[PROOF STATE]
proof (prove)
using this:
finite Roots'
Y \<in> Roots'

goal (1 subgoal):
 1. cmod (root' Y) \<le> Radius
[PROOF STEP]
by (auto simp: Radius_def)
[PROOF STATE]
proof (state)
this:
?Y \<in> Roots' \<Longrightarrow> cmod (root' ?Y) \<le> Radius

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
from Radius[of "{idx}"]
[PROOF STATE]
proof (chain)
picking this:
{idx} \<in> Roots' \<Longrightarrow> cmod (root' {idx}) \<le> Radius
[PROOF STEP]
have "Radius \<ge> pi"
[PROOF STATE]
proof (prove)
using this:
{idx} \<in> Roots' \<Longrightarrow> cmod (root' {idx}) \<le> Radius

goal (1 subgoal):
 1. pi \<le> Radius
[PROOF STEP]
using idx
[PROOF STATE]
proof (prove)
using this:
{idx} \<in> Roots' \<Longrightarrow> cmod (root' {idx}) \<le> Radius
idx < n
root idx = \<i> * complex_of_real pi

goal (1 subgoal):
 1. pi \<le> Radius
[PROOF STEP]
by (auto simp: Roots'_def norm_mult root'_def)
[PROOF STATE]
proof (state)
this:
pi \<le> Radius

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence Radius_nonneg: "Radius \<ge> 0" and "Radius > 0"
[PROOF STATE]
proof (prove)
using this:
pi \<le> Radius

goal (1 subgoal):
 1. 0 \<le> Radius &&& 0 < Radius
[PROOF STEP]
using pi_gt3
[PROOF STATE]
proof (prove)
using this:
pi \<le> Radius
3 < pi

goal (1 subgoal):
 1. 0 \<le> Radius &&& 0 < Radius
[PROOF STEP]
by linarith+

  \<comment> \<open>Since this ball is compact, @{term Q} is bounded on it. We obtain such a bound.\<close>
[PROOF STATE]
proof (state)
this:
0 \<le> Radius
0 < Radius

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "compact (poly (of_int_poly Q :: complex poly) ` cball 0 Radius)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (poly (of_int_poly Q) ` cball 0 Radius)
[PROOF STEP]
by (intro compact_continuous_image continuous_intros) auto
[PROOF STATE]
proof (state)
this:
compact (poly (of_int_poly Q) ` cball 0 Radius)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compact (poly (of_int_poly Q) ` cball 0 Radius)
[PROOF STEP]
obtain Q_ub
    where Q_ub: "Q_ub > 0"
                "\<And>u :: complex. u \<in> cball 0 Radius \<Longrightarrow> norm (poly (of_int_poly Q) u) \<le> Q_ub"
[PROOF STATE]
proof (prove)
using this:
compact (poly (of_int_poly Q) ` cball 0 Radius)

goal (1 subgoal):
 1. (\<And>Q_ub. \<lbrakk>0 < Q_ub; \<And>u. u \<in> cball 0 Radius \<Longrightarrow> cmod (poly (of_int_poly Q) u) \<le> Q_ub\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest!: compact_imp_bounded simp: bounded_pos cball_def)

  \<comment> \<open>Using this, define another upper bound that we will need later.\<close>
[PROOF STATE]
proof (state)
this:
0 < Q_ub
?u \<in> cball 0 Radius \<Longrightarrow> cmod (poly (of_int_poly Q) ?u) \<le> Q_ub

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define fp_ub
    where "fp_ub = (\<lambda>p. \<bar>c\<bar> ^ (r * p - 1) / fact (p - 1) * (Radius ^ (p - 1) * Q_ub ^ p))"
[PROOF STATE]
proof (state)
this:
fp_ub = (\<lambda>p. real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (Radius ^ (p - 1) * Q_ub ^ p))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have fp_ub_nonneg: "fp_ub p \<ge> 0" for p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fp_ub p
[PROOF STEP]
unfolding fp_ub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (Radius ^ (p - 1) * Q_ub ^ p)
[PROOF STEP]
using \<open>Radius \<ge> 0\<close> Q_ub
[PROOF STATE]
proof (prove)
using this:
0 \<le> Radius
0 < Q_ub
?u \<in> cball 0 Radius \<Longrightarrow> cmod (poly (of_int_poly Q) ?u) \<le> Q_ub

goal (1 subgoal):
 1. 0 \<le> real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (Radius ^ (p - 1) * Q_ub ^ p)
[PROOF STEP]
by (intro mult_nonneg_nonneg divide_nonneg_pos zero_le_power) auto
[PROOF STATE]
proof (state)
this:
0 \<le> fp_ub ?p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define C where "C = card Roots' * Radius * exp Radius"

  \<comment> \<open>We will now show that any sufficiently large prime number leads to
      \<open>C * fp_ub p \<ge> 1\<close>, from which we will then derive a contradiction.\<close>
[PROOF STATE]
proof (state)
this:
C = real (card Roots') * Radius * exp Radius

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
define primes_at_top where "primes_at_top = inf_class.inf sequentially (principal {p. prime p})"
[PROOF STATE]
proof (state)
this:
primes_at_top = inf sequentially (principal {p. prime p})

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "eventually (\<lambda>p. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. p > x) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F p in sequentially. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p
[PROOF STEP]
by (intro eventually_ball_finite ballI eventually_gt_at_top) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in sequentially. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence "eventually (\<lambda>p. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. p > x) primes_at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in sequentially. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p

goal (1 subgoal):
 1. \<forall>\<^sub>F p in primes_at_top. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p
[PROOF STEP]
unfolding primes_at_top_def eventually_inf_principal
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in sequentially. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. x \<in> Collect prime \<longrightarrow> (\<forall>xa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. xa < x)
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "eventually (\<lambda>p. prime p) primes_at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually prime primes_at_top
[PROOF STEP]
by (auto simp: primes_at_top_def eventually_inf_principal)
[PROOF STATE]
proof (state)
this:
eventually prime primes_at_top

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F p in primes_at_top. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p
eventually prime primes_at_top
[PROOF STEP]
have "eventually (\<lambda>p. C * fp_ub p \<ge> 1) primes_at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in primes_at_top. \<forall>x\<in>{nat \<bar>poly Q 0\<bar>, c, A}. x < p
eventually prime primes_at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F p in primes_at_top. 1 \<le> C * fp_ub p
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
case (elim p)
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>{nat \<bar>poly Q 0\<bar>, c, A}. p < p
prime p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
hence p: "prime p" "p > nat \<bar>poly Q 0\<bar>" "p > c" "p > A"
[PROOF STATE]
proof (prove)
using this:
\<forall>p\<in>{nat \<bar>poly Q 0\<bar>, c, A}. p < p
prime p

goal (1 subgoal):
 1. (prime p &&& nat \<bar>poly Q 0\<bar> < p) &&& c < p &&& A < p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime p
nat \<bar>poly Q 0\<bar> < p
c < p
A < p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
hence "p > 1"
[PROOF STATE]
proof (prove)
using this:
prime p
nat \<bar>poly Q 0\<bar> < p
c < p
A < p

goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
by (auto dest: prime_gt_1_nat)

    \<comment> \<open>We define the polynomial $f(X) = \frac{c^s}{(p-1)!} X^{p-1} Q(X)^p$, where $c$ is
        the leading coefficient of $Q$. We also define $F(X)$ to be the sum of all its
        derivatives.\<close>
[PROOF STATE]
proof (state)
this:
1 < p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
define s where "s = r * p - 1"
[PROOF STATE]
proof (state)
this:
s = r * p - 1

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
define fp :: "complex poly"
      where "fp = Polynomial.smult (of_nat c ^ s / fact (p - 1))
                    (Polynomial.monom 1 (p - 1) * of_int_poly Q ^ p)"
[PROOF STATE]
proof (state)
this:
fp = Polynomial.smult (of_nat c ^ s / fact (p - 1)) (Polynomial.monom 1 (p - 1) * of_int_poly Q ^ p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
define Fp where "Fp = (\<Sum>i\<le>s+p. (pderiv ^^ i) fp)"
[PROOF STATE]
proof (state)
this:
Fp = (\<Sum>i\<le>s + p. (pderiv ^^ i) fp)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
define f F where "f = poly fp" and "F = poly Fp"
[PROOF STATE]
proof (state)
this:
f = poly fp
F = poly Fp

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have degree_fp: "Polynomial.degree fp = s + p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.degree fp = s + p
[PROOF STEP]
using degree_Q card_Roots' \<open>p > 1\<close>
[PROOF STATE]
proof (prove)
using this:
Polynomial.degree (of_int_poly Q) = card Roots'
0 < card Roots'
1 < p

goal (1 subgoal):
 1. Polynomial.degree fp = s + p
[PROOF STEP]
by (simp add: fp_def s_def degree_mult_eq degree_monom_eq
                    degree_power_eq r_def algebra_simps)

    \<comment> \<open>Using the same argument as in the case of the transcendence of $e$, we now
        consider the function
        \[I(u) := e^u F(0) - F(u) = u \int\limits_0^1 e^{(1-t)x} f(tx)\,\textrm{d}t\]
        whose absolute value can be bounded with a standard ``maximum times length'' estimate
        using our upper bound on $f$. All of this can be reused from the proof for $e$, so
        there is not much to do here. In particular, we will look at $\sum I(x_i)$ with the
        $x_i$ ranging over the roots of $Q$ and bound this sum in two different ways.\<close>
[PROOF STATE]
proof (state)
this:
Polynomial.degree fp = s + p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
interpret lindemann_weierstrass_aux fp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have I_altdef: "I = (\<lambda>u. exp u * F 0 - F u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I = (\<lambda>u. exp u * F 0 - F u)
[PROOF STEP]
by (intro ext) (simp add: I_def degree_fp F_def Fp_def poly_sum)

    \<comment> \<open>We show that @{term fp_ub} is indeed an upper bound for $f$.\<close>
[PROOF STATE]
proof (state)
this:
I = (\<lambda>u. exp u * F 0 - F u)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have fp_ub:  "norm (poly fp u) \<le> fp_ub p" if "u \<in> cball 0 Radius" for u
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
have "norm (poly fp u) = \<bar>c\<bar> ^ (r * p - 1) / fact (p - 1) * (norm u ^ (p - 1) *
                                 norm (poly (of_int_poly Q) u) ^ p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (poly fp u) = real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p)
[PROOF STEP]
by (simp add: fp_def f_def s_def norm_mult poly_monom norm_divide norm_power)
[PROOF STATE]
proof (state)
this:
cmod (poly fp u) = real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p)

goal (1 subgoal):
 1. cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (poly fp u) = real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p)

goal (1 subgoal):
 1. cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
have "\<dots> \<le> fp_ub p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p) \<le> fp_ub p
[PROOF STEP]
unfolding fp_ub_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p) \<le> real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (Radius ^ (p - 1) * Q_ub ^ p)
[PROOF STEP]
using that Q_ub \<open>Radius \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
u \<in> cball 0 Radius
0 < Q_ub
?u \<in> cball 0 Radius \<Longrightarrow> cmod (poly (of_int_poly Q) ?u) \<le> Q_ub
0 \<le> Radius

goal (1 subgoal):
 1. real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p) \<le> real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (Radius ^ (p - 1) * Q_ub ^ p)
[PROOF STEP]
by (intro mult_left_mono[OF mult_mono] power_mono zero_le_power) auto
[PROOF STATE]
proof (state)
this:
real_of_int (\<bar>int c\<bar> ^ (r * p - 1)) / fact (p - 1) * (cmod u ^ (p - 1) * cmod (poly (of_int_poly Q) u) ^ p) \<le> fp_ub p

goal (1 subgoal):
 1. cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (poly fp u) \<le> fp_ub p

goal (1 subgoal):
 1. cmod (poly fp u) \<le> fp_ub p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (poly fp u) \<le> fp_ub p

goal:
No subgoals!
[PROOF STEP]
qed

    \<comment> \<open>We now show that the following sum is an integer multiple of $p$. This argument again
        uses the fundamental theorem of symmetric functions, exploiting that the inner sums are
        symmetric over the roots of $Q$.\<close>
[PROOF STATE]
proof (state)
this:
?u \<in> cball 0 Radius \<Longrightarrow> cmod (poly fp ?u) \<le> fp_ub p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "(\<Sum>i=p..s+p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / p \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
proof (subst sum_divide_distrib, intro Ints_sum[of "{a..b}" for a b])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
assume i: "i \<in> {p..s+p}"
[PROOF STATE]
proof (state)
this:
i \<in> {p..s + p}

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {p..s + p}
[PROOF STEP]
obtain roots' where roots': "distinct roots'" "set roots' = Roots'"
[PROOF STATE]
proof (prove)
using this:
i \<in> {p..s + p}

goal (1 subgoal):
 1. (\<And>roots'. \<lbrakk>distinct roots'; set roots' = Roots'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_distinct_list \<open>finite Roots'\<close>
[PROOF STATE]
proof (prove)
using this:
i \<in> {p..s + p}
finite ?A \<Longrightarrow> \<exists>xs. set xs = ?A \<and> distinct xs
finite Roots'

goal (1 subgoal):
 1. (\<And>roots'. \<lbrakk>distinct roots'; set roots' = Roots'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
distinct roots'
set roots' = Roots'

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
define l where "l = length roots'"
[PROOF STATE]
proof (state)
this:
l = length roots'

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
define fp' where "fp' = (pderiv ^^ i) fp"
[PROOF STATE]
proof (state)
this:
fp' = (pderiv ^^ i) fp

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
define d where "d = Polynomial.degree fp'"
      \<comment> \<open>We define a multivariate polynomial for the inner sum $\sum f(x_i)/p$ in order
          to show that it is indeed a symmetric function over the $x_i$.\<close>
[PROOF STATE]
proof (state)
this:
d = Polynomial.degree fp'

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
define R where "R = (smult (1 / of_nat p) (\<Sum>k\<le>d. \<Sum>i<l. smult (poly.coeff fp' k)
                             (monom (Poly_Mapping.single i k) (1 / of_int (c ^ k)))) :: complex mpoly)"

      \<comment> \<open>The $j$-th coefficient of the $i$-th derivative of $f$ are integer multiples
          of $c^j p$ since $i \geq p$.\<close>
[PROOF STATE]
proof (state)
this:
R = MPoly_Type.smult (1 / of_nat p) (\<Sum>k\<le>d. \<Sum>i<l. MPoly_Type.smult (poly.coeff fp' k) (MPoly_Type.monom (Poly_Mapping.single i k) (1 / of_int (int (c ^ k)))))

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
have integer: "poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>" if "j \<le> d" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
define fp'' where "fp'' = Polynomial.monom 1 (p - 1) * Q ^ p"
[PROOF STATE]
proof (state)
this:
fp'' = Polynomial.monom 1 (p - 1) * Q ^ p

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
define x
          where "x = c ^ s * poly.coeff ((pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)) j"
[PROOF STATE]
proof (state)
this:
x = int (c ^ s) * poly.coeff ((pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)) j

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
have "[:fact p:] dvd ([:fact i:] :: int poly)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:fact p:] dvd [:fact i:]
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<in> {p..s + p}

goal (1 subgoal):
 1. [:fact p:] dvd [:fact i:]
[PROOF STEP]
by (auto intro: fact_dvd)
[PROOF STATE]
proof (state)
this:
[:fact p:] dvd [:fact i:]

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[:fact p:] dvd [:fact i:]

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
have "[:fact i:] dvd ((pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:fact i:] dvd (pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)
[PROOF STEP]
by (rule fact_dvd_higher_pderiv)
[PROOF STATE]
proof (state)
this:
[:fact i:] dvd (pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[:fact p:] dvd (pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)
[PROOF STEP]
have "c ^ j * fact p dvd x"
[PROOF STATE]
proof (prove)
using this:
[:fact p:] dvd (pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)

goal (1 subgoal):
 1. int (c ^ j * fact p) dvd x
[PROOF STEP]
unfolding x_def of_nat_mult
[PROOF STATE]
proof (prove)
using this:
[:fact p:] dvd (pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)

goal (1 subgoal):
 1. int (c ^ j) * int (fact p) dvd int (c ^ s) * poly.coeff ((pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)) j
[PROOF STEP]
using that i
[PROOF STATE]
proof (prove)
using this:
[:fact p:] dvd (pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)
j \<le> d
i \<in> {p..s + p}

goal (1 subgoal):
 1. int (c ^ j) * int (fact p) dvd int (c ^ s) * poly.coeff ((pderiv ^^ i) (Polynomial.monom 1 (p - 1) * Q ^ p)) j
[PROOF STEP]
by (intro mult_dvd_mono)
             (auto intro!: le_imp_power_dvd simp: s_def d_def fp'_def degree_higher_pderiv degree_fp)
[PROOF STATE]
proof (state)
this:
int (c ^ j * fact p) dvd x

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
hence "of_int x / (of_int (c ^ j * fact p) :: complex) \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
int (c ^ j * fact p) dvd x

goal (1 subgoal):
 1. of_int x / of_int (int (c ^ j * fact p)) \<in> \<int>
[PROOF STEP]
by (intro of_int_divide_in_Ints) auto
[PROOF STATE]
proof (state)
this:
of_int x / of_int (int (c ^ j * fact p)) \<in> \<int>

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int x / of_int (int (c ^ j * fact p)) \<in> \<int>

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
have "of_int x / (of_int (c ^ j * fact p) :: complex) =
                     poly.coeff fp' j / (of_nat c ^ j * of_nat p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int x / of_int (int (c ^ j * fact p)) = poly.coeff fp' j / (of_nat c ^ j * of_nat p)
[PROOF STEP]
using \<open>p > 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < p

goal (1 subgoal):
 1. of_int x / of_int (int (c ^ j * fact p)) = poly.coeff fp' j / (of_nat c ^ j * of_nat p)
[PROOF STEP]
by (auto simp: fact_reduce[of p] fp'_def fp_def higher_pderiv_smult x_def field_simps
                   simp flip: coeff_of_int_poly higher_pderiv_of_int_poly)
[PROOF STATE]
proof (state)
this:
of_int x / of_int (int (c ^ j * fact p)) = poly.coeff fp' j / (of_nat c ^ j * of_nat p)

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>

goal (1 subgoal):
 1. poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly.coeff fp' j / (of_nat c ^ j * of_nat p) \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed

      \<comment> \<open>Evaluating $R$ yields is an integer since it is symmetric.\<close>
[PROOF STATE]
proof (state)
this:
?j \<le> d \<Longrightarrow> poly.coeff fp' ?j / (of_nat c ^ ?j * of_nat p) \<in> \<int>

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
have "insertion (\<lambda>i. c * root' (roots' ! i)) R \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion (\<lambda>i. of_nat c * root' (roots' ! i)) R \<in> \<int>
[PROOF STEP]
proof (intro symmetric_poly_of_roots_in_subring_monic allI)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. ring_closed \<int>
 2. \<And>m. MPoly_Type.coeff R m \<in> \<int>
 3. ring_homomorphism (\<lambda>a. a)
 4. finite ?A
 5. symmetric_mpoly ?A R
 6. vars R \<subseteq> ?A
 7. ?p = (\<Prod>i\<in>?A. [:- (of_nat c * root' (roots' ! i)), 1:])
 8. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
define Q' where "Q' = of_int_poly Q \<circ>\<^sub>p [:0, 1 / of_nat c :: complex:]"
[PROOF STATE]
proof (state)
this:
Q' = of_int_poly Q \<circ>\<^sub>p [:0, 1 / of_nat c:]

goal (8 subgoals):
 1. ring_closed \<int>
 2. \<And>m. MPoly_Type.coeff R m \<in> \<int>
 3. ring_homomorphism (\<lambda>a. a)
 4. finite ?A
 5. symmetric_mpoly ?A R
 6. vars R \<subseteq> ?A
 7. ?p = (\<Prod>i\<in>?A. [:- (of_nat c * root' (roots' ! i)), 1:])
 8. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
show "symmetric_mpoly {..<l} R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symmetric_mpoly {..<l} R
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. symmetric_mpoly {..<l} (MPoly_Type.smult (1 / of_nat p) (\<Sum>k\<le>d. \<Sum>i<l. MPoly_Type.smult (poly.coeff fp' k) (MPoly_Type.monom (Poly_Mapping.single i k) (1 / of_int (int (c ^ k))))))
[PROOF STEP]
by (intro symmetric_mpoly_smult symmetric_mpoly_sum[of "{..d}"] symmetric_mpoly_symmetric_sum)
             (simp_all add: mpoly_map_vars_monom permutes_bij permutep_single bij_imp_bij_inv permutes_inv_inv)
[PROOF STATE]
proof (state)
this:
symmetric_mpoly {..<l} R

goal (7 subgoals):
 1. ring_closed \<int>
 2. \<And>m. MPoly_Type.coeff R m \<in> \<int>
 3. ring_homomorphism (\<lambda>a. a)
 4. finite {..<l}
 5. vars R \<subseteq> {..<l}
 6. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 7. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
show "MPoly_Type.coeff R m \<in> \<int>" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.coeff R m \<in> \<int>
[PROOF STEP]
unfolding R_def coeff_sum coeff_smult sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<le>d. \<Sum>na<l. 1 / of_nat p * (poly.coeff fp' n * MPoly_Type.coeff (MPoly_Type.monom (Poly_Mapping.single na n) (1 / of_int (int (c ^ n)))) m)) \<in> \<int>
[PROOF STEP]
using integer
[PROOF STATE]
proof (prove)
using this:
?j \<le> d \<Longrightarrow> poly.coeff fp' ?j / (of_nat c ^ ?j * of_nat p) \<in> \<int>

goal (1 subgoal):
 1. (\<Sum>n\<le>d. \<Sum>na<l. 1 / of_nat p * (poly.coeff fp' n * MPoly_Type.coeff (MPoly_Type.monom (Poly_Mapping.single na n) (1 / of_int (int (c ^ n)))) m)) \<in> \<int>
[PROOF STEP]
by (auto simp: R_def coeff_monom when_def intro!: Ints_sum)
[PROOF STATE]
proof (state)
this:
MPoly_Type.coeff R ?m \<in> \<int>

goal (6 subgoals):
 1. ring_closed \<int>
 2. ring_homomorphism (\<lambda>a. a)
 3. finite {..<l}
 4. vars R \<subseteq> {..<l}
 5. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 6. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
show "vars R \<subseteq> {..<l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars R \<subseteq> {..<l}
[PROOF STEP]
unfolding R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (MPoly_Type.smult (1 / of_nat p) (\<Sum>k\<le>d. \<Sum>i<l. MPoly_Type.smult (poly.coeff fp' k) (MPoly_Type.monom (Poly_Mapping.single i k) (1 / of_int (int (c ^ k)))))) \<subseteq> {..<l}
[PROOF STEP]
by (intro order.trans[OF vars_smult] order.trans[OF vars_sum] UN_least
                    order.trans[OF vars_monom_subset]) auto
[PROOF STATE]
proof (state)
this:
vars R \<subseteq> {..<l}

goal (5 subgoals):
 1. ring_closed \<int>
 2. ring_homomorphism (\<lambda>a. a)
 3. finite {..<l}
 4. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 5. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
show "ring_closed \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_closed \<int>
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
this:
ring_closed \<int>

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
have "(\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:]) =
                (\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:]) = (\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:])
[PROOF STEP]
by (subst prod_list_prod_nth) (auto simp: atLeast0LessThan l_def)
[PROOF STATE]
proof (state)
this:
(\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:]) = (\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:])

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:]) = (\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:])

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
have "\<dots> = (\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:])
[PROOF STEP]
using roots'
[PROOF STATE]
proof (prove)
using this:
distinct roots'
set roots' = Roots'

goal (1 subgoal):
 1. (\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:])
[PROOF STEP]
by (subst prod.distinct_set_conv_list [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:])

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>Y\<leftarrow>roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:])

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
have "\<dots> = (\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) ([:-root' Y, 1:])) \<circ>\<^sub>p [:0, 1 / c:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) [:- root' Y, 1:]) \<circ>\<^sub>p [:0, complex_of_real (1 / real c):]
[PROOF STEP]
by (simp add: pcompose_prod pcompose_pCons)
[PROOF STATE]
proof (state)
this:
(\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) [:- root' Y, 1:]) \<circ>\<^sub>p [:0, complex_of_real (1 / real c):]

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>Y\<in>Roots'. [:- (of_nat c * root' Y), 1:]) = (\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) [:- root' Y, 1:]) \<circ>\<^sub>p [:0, complex_of_real (1 / real c):]

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
have "(\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) ([:-root' Y, 1:])) =
                     Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:-root' Y, 1:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:])
[PROOF STEP]
by (subst prod_smult) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:])

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>Y\<in>Roots'. Polynomial.smult (of_nat c) [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:])

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
have "\<dots> = Polynomial.smult (of_nat c ^ (card Roots' - 1))
                          (Polynomial.smult c (\<Prod>Y\<in>Roots'. [:-root' Y, 1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ (card Roots' - 1)) (Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]))
[PROOF STEP]
using \<open>finite Roots'\<close> and \<open>Roots' \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
finite Roots'
Roots' \<noteq> {}

goal (1 subgoal):
 1. Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ (card Roots' - 1)) (Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]))
[PROOF STEP]
by (subst power_diff) (auto simp: Suc_le_eq card_gt_0_iff)
[PROOF STATE]
proof (state)
this:
Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ (card Roots' - 1)) (Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]))

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polynomial.smult (of_nat c ^ card Roots') (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = Polynomial.smult (of_nat c ^ (card Roots' - 1)) (Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]))

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
have "Polynomial.smult c (\<Prod>Y\<in>Roots'. [:-root' Y, 1:]) = of_int_poly Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = of_int_poly Q
[PROOF STEP]
using Q_decompose
[PROOF STATE]
proof (prove)
using this:
of_int_poly Q = Polynomial.smult (of_nat c) (\<Prod>X\<in>Roots'. [:- root' X, 1:])

goal (1 subgoal):
 1. Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = of_int_poly Q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Polynomial.smult (of_nat c) (\<Prod>Y\<in>Roots'. [:- root' Y, 1:]) = of_int_poly Q

goal (4 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. ?p = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
 4. \<And>i. poly.coeff ?p i \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:]) = Polynomial.smult (of_nat c ^ (card Roots' - 1)) (of_int_poly Q) \<circ>\<^sub>p [:0, complex_of_real (1 / real c):]
[PROOF STEP]
show "Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q' =
                        (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:]) = Polynomial.smult (of_nat c ^ (card Roots' - 1)) (of_int_poly Q) \<circ>\<^sub>p [:0, complex_of_real (1 / real c):]

goal (1 subgoal):
 1. Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q' = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])
[PROOF STEP]
by (simp add: pcompose_smult Q'_def)
[PROOF STATE]
proof (state)
this:
Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q' = (\<Prod>i<l. [:- (of_nat c * root' (roots' ! i)), 1:])

goal (3 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. \<And>i. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) (of_int_poly Q \<circ>\<^sub>p [:0, 1 / of_nat c:])) i \<in> \<int>
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
 3. \<And>i. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) (of_int_poly Q \<circ>\<^sub>p [:0, 1 / of_nat c:])) i \<in> \<int>
[PROOF STEP]
show "poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
proof (cases i "Polynomial.degree Q" rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 2. i = Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 3. Polynomial.degree Q < i \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
case greater
[PROOF STATE]
proof (state)
this:
Polynomial.degree Q < i

goal (3 subgoals):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 2. i = Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 3. Polynomial.degree Q < i \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Polynomial.degree Q < i

goal (1 subgoal):
 1. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
by (auto simp: Q'_def coeff_pcompose_linear coeff_eq_0)
[PROOF STATE]
proof (state)
this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>

goal (2 subgoals):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 2. i = Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 2. i = Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
case equal
[PROOF STATE]
proof (state)
this:
i = Polynomial.degree Q

goal (2 subgoals):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
 2. i = Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = Polynomial.degree Q

goal (1 subgoal):
 1. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
using \<open>Roots' \<noteq> {}\<close> degree_Q card_Roots' lead_coeff_Q
[PROOF STATE]
proof (prove)
using this:
i = Polynomial.degree Q
Roots' \<noteq> {}
Polynomial.degree (of_int_poly Q) = card Roots'
0 < card Roots'
Polynomial.lead_coeff Q = int c

goal (1 subgoal):
 1. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
by (auto simp: Q'_def coeff_pcompose_linear lead_coeff_Q power_divide power_diff)
[PROOF STATE]
proof (state)
this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>

goal (1 subgoal):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
i < Polynomial.degree Q

goal (1 subgoal):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
have "poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i =
                  of_int (poly.coeff Q i) * (of_int (c ^ (card Roots' - 1)) / of_int (c ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i = of_int (poly.coeff Q i) * (of_int (int (c ^ (card Roots' - 1))) / of_int (int (c ^ i)))
[PROOF STEP]
by (auto simp: Q'_def coeff_pcompose_linear power_divide)
[PROOF STATE]
proof (state)
this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i = of_int (poly.coeff Q i) * (of_int (int (c ^ (card Roots' - 1))) / of_int (int (c ^ i)))

goal (1 subgoal):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i = of_int (poly.coeff Q i) * (of_int (int (c ^ (card Roots' - 1))) / of_int (int (c ^ i)))

goal (1 subgoal):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
have "\<dots> \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (poly.coeff Q i) * (of_int (int (c ^ (card Roots' - 1))) / of_int (int (c ^ i))) \<in> \<int>
[PROOF STEP]
using less degree_Q
[PROOF STATE]
proof (prove)
using this:
i < Polynomial.degree Q
Polynomial.degree (of_int_poly Q) = card Roots'

goal (1 subgoal):
 1. of_int (poly.coeff Q i) * (of_int (int (c ^ (card Roots' - 1))) / of_int (int (c ^ i))) \<in> \<int>
[PROOF STEP]
by (intro Ints_mult of_int_divide_in_Ints) (auto intro!: le_imp_power_dvd)
[PROOF STATE]
proof (state)
this:
of_int (poly.coeff Q i) * (of_int (int (c ^ (card Roots' - 1))) / of_int (int (c ^ i))) \<in> \<int>

goal (1 subgoal):
 1. i < Polynomial.degree Q \<Longrightarrow> poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>

goal (1 subgoal):
 1. poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly.coeff (Polynomial.smult (of_nat c ^ (card Roots' - 1)) Q') i \<in> \<int>

goal (2 subgoals):
 1. ring_homomorphism (\<lambda>a. a)
 2. finite {..<l}
[PROOF STEP]
qed auto
      \<comment> \<open>Moreover, by definition, evaluating @{term R} gives us $\sum f(x_i)/p$.\<close>
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. of_nat c * root' (roots' ! i)) R \<in> \<int>

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. of_nat c * root' (roots' ! i)) R \<in> \<int>

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
have "insertion (\<lambda>i. c * root' (roots' ! i)) R =
                   (\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion (\<lambda>i. of_nat c * root' (roots' ! i)) R = (\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p
[PROOF STEP]
by (simp add: insertion_sum R_def poly_altdef d_def sum_list_sum_nth atLeast0LessThan
                    l_def power_mult_distrib algebra_simps
                    sum.swap[of _ "{..Polynomial.degree fp'}"] del: insertion_monom)
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. of_nat c * root' (roots' ! i)) R = (\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
insertion (\<lambda>i. of_nat c * root' (roots' ! i)) R = (\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
have "\<dots> = (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p = (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p
[PROOF STEP]
using roots'
[PROOF STATE]
proof (prove)
using this:
distinct roots'
set roots' = Roots'

goal (1 subgoal):
 1. (\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p = (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p
[PROOF STEP]
by (subst sum_list_distinct_conv_sum_set) (auto simp: fp'_def poly_pcompose)
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<leftarrow>roots'. poly fp' (root' Y)) / of_nat p = (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ x) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
show "\<dots> \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>

goal (1 subgoal):
 1. (\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>
[PROOF STEP]
obtain K where K: "(\<Sum>i=p..s+p. \<Sum>Y\<in>Roots'.
                               poly ((pderiv ^^ i) fp) (root' Y)) = of_int K * p"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>

goal (1 subgoal):
 1. (\<And>K. (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (of_int K * int p) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>p > 1\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) / of_nat p \<in> \<int>
1 < p

goal (1 subgoal):
 1. (\<And>K. (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (of_int K * int p) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim!: Ints_cases simp: field_simps)

    \<comment> \<open>Next, we show that $F(0)$ is an integer and coprime to $p$.\<close>
[PROOF STATE]
proof (state)
this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (of_int K * int p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
obtain F0 :: int where F0: "F 0 = of_int F0" "coprime (int p) F0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "(\<Sum>i=p..s + p. poly ((pderiv ^^ i) fp) 0) / of_nat p \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) / of_nat p \<in> \<int>
[PROOF STEP]
unfolding sum_divide_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = p..s + p. poly ((pderiv ^^ n) fp) 0 / of_nat p) \<in> \<int>
[PROOF STEP]
proof (intro Ints_sum)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
assume i: "i \<in> {p..s+p}"
[PROOF STATE]
proof (state)
this:
i \<in> {p..s + p}

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
hence "fact p dvd poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0"
[PROOF STATE]
proof (prove)
using this:
i \<in> {p..s + p}

goal (1 subgoal):
 1. fact p dvd poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0
[PROOF STEP]
by (intro fact_dvd_poly_higher_pderiv_aux') auto
[PROOF STATE]
proof (state)
this:
fact p dvd poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fact p dvd poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0
[PROOF STEP]
obtain k where k: "poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0 = k * fact p"
[PROOF STATE]
proof (prove)
using this:
fact p dvd poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0

goal (1 subgoal):
 1. (\<And>k. poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0 = k * fact p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0 = k * fact p

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
have "(pderiv ^^ i) fp = Polynomial.smult (of_nat c ^ s / fact (p - 1))
                (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pderiv ^^ i) fp = Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))
[PROOF STEP]
by (simp add: fp_def higher_pderiv_smult Polynomial.monom_altdef
                   flip: higher_pderiv_of_int_poly)
[PROOF STATE]
proof (state)
this:
(pderiv ^^ i) fp = Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(pderiv ^^ i) fp = Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
have "poly \<dots> 0 / of_nat p = of_int (c ^ s * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))) 0 / of_nat p = of_int (int (c ^ s) * k)
[PROOF STEP]
using k \<open>p > 1\<close>
[PROOF STATE]
proof (prove)
using this:
poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)) 0 = k * fact p
1 < p

goal (1 subgoal):
 1. poly (Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))) 0 / of_nat p = of_int (int (c ^ s) * k)
[PROOF STEP]
by (simp add: fact_reduce[of p])
[PROOF STATE]
proof (state)
this:
poly (Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))) 0 / of_nat p = of_int (int (c ^ s) * k)

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly (Polynomial.smult (of_nat c ^ s / fact (p - 1)) (of_int_poly ((pderiv ^^ i) ([:0, 1:] ^ (p - 1) * Q ^ p)))) 0 / of_nat p = of_int (int (c ^ s) * k)

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
have "\<dots> \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (int (c ^ s) * k) \<in> \<int>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int (int (c ^ s) * k) \<in> \<int>

goal (1 subgoal):
 1. \<And>x. x \<in> {p..s + p} \<Longrightarrow> poly ((pderiv ^^ x) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly ((pderiv ^^ i) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
show "poly ((pderiv ^^ i) fp) 0 / of_nat p \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
poly ((pderiv ^^ i) fp) 0 / of_nat p \<in> \<int>

goal (1 subgoal):
 1. poly ((pderiv ^^ i) fp) 0 / of_nat p \<in> \<int>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
poly ((pderiv ^^ i) fp) 0 / of_nat p \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) / of_nat p \<in> \<int>

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) / of_nat p \<in> \<int>
[PROOF STEP]
obtain S where S: "(\<Sum>i=p..s + p. poly ((pderiv ^^ i) fp) 0) = of_int S * p"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) / of_nat p \<in> \<int>

goal (1 subgoal):
 1. (\<And>S. (\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) = of_int (of_int S * int p) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>p > 1\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) / of_nat p \<in> \<int>
1 < p

goal (1 subgoal):
 1. (\<And>S. (\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) = of_int (of_int S * int p) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim!: Ints_cases simp: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) = of_int (of_int S * int p)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "F 0 = (\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F 0 = (\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0)
[PROOF STEP]
by (auto simp: F_def Fp_def poly_sum)
[PROOF STATE]
proof (state)
this:
F 0 = (\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
F 0 = (\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0) = (\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0)
[PROOF STEP]
proof (intro sum.mono_neutral_right ballI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite {..s + p}
 2. insert (p - 1) {p..s + p} \<subseteq> {..s + p}
 3. \<And>i. i \<in> {..s + p} - insert (p - 1) {p..s + p} \<Longrightarrow> poly ((pderiv ^^ i) fp) 0 = 0
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite {..s + p}
 2. insert (p - 1) {p..s + p} \<subseteq> {..s + p}
 3. \<And>i. i \<in> {..s + p} - insert (p - 1) {p..s + p} \<Longrightarrow> poly ((pderiv ^^ i) fp) 0 = 0
[PROOF STEP]
assume i: "i \<in> {..s + p} - insert (p - 1) {p..s + p}"
[PROOF STATE]
proof (state)
this:
i \<in> {..s + p} - insert (p - 1) {p..s + p}

goal (3 subgoals):
 1. finite {..s + p}
 2. insert (p - 1) {p..s + p} \<subseteq> {..s + p}
 3. \<And>i. i \<in> {..s + p} - insert (p - 1) {p..s + p} \<Longrightarrow> poly ((pderiv ^^ i) fp) 0 = 0
[PROOF STEP]
hence "i < p - 1"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..s + p} - insert (p - 1) {p..s + p}

goal (1 subgoal):
 1. i < p - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < p - 1

goal (3 subgoals):
 1. finite {..s + p}
 2. insert (p - 1) {p..s + p} \<subseteq> {..s + p}
 3. \<And>i. i \<in> {..s + p} - insert (p - 1) {p..s + p} \<Longrightarrow> poly ((pderiv ^^ i) fp) 0 = 0
[PROOF STEP]
have "Polynomial.monom 1 (p - 1) dvd fp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.monom 1 (p - 1) dvd fp
[PROOF STEP]
by (auto simp: fp_def intro: dvd_smult)
[PROOF STATE]
proof (state)
this:
Polynomial.monom 1 (p - 1) dvd fp

goal (3 subgoals):
 1. finite {..s + p}
 2. insert (p - 1) {p..s + p} \<subseteq> {..s + p}
 3. \<And>i. i \<in> {..s + p} - insert (p - 1) {p..s + p} \<Longrightarrow> poly ((pderiv ^^ i) fp) 0 = 0
[PROOF STEP]
with i
[PROOF STATE]
proof (chain)
picking this:
i \<in> {..s + p} - insert (p - 1) {p..s + p}
Polynomial.monom 1 (p - 1) dvd fp
[PROOF STEP]
show "poly ((pderiv ^^ i) fp) 0 = 0"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..s + p} - insert (p - 1) {p..s + p}
Polynomial.monom 1 (p - 1) dvd fp

goal (1 subgoal):
 1. poly ((pderiv ^^ i) fp) 0 = 0
[PROOF STEP]
by (intro poly_higher_pderiv_aux1'[of _ "p - 1"]) (auto simp: Polynomial.monom_altdef)
[PROOF STATE]
proof (state)
this:
poly ((pderiv ^^ i) fp) 0 = 0

goal (2 subgoals):
 1. finite {..s + p}
 2. insert (p - 1) {p..s + p} \<subseteq> {..s + p}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0) = (\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>s + p. poly ((pderiv ^^ i) fp) 0) = (\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<dots> = poly ((pderiv ^^ (p - 1)) fp) 0 + of_int S * of_nat p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0) = poly ((pderiv ^^ (p - 1)) fp) 0 + of_int S * of_nat p
[PROOF STEP]
using \<open>p > 1\<close> S
[PROOF STATE]
proof (prove)
using this:
1 < p
(\<Sum>i = p..s + p. poly ((pderiv ^^ i) fp) 0) = of_int (of_int S * int p)

goal (1 subgoal):
 1. (\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0) = poly ((pderiv ^^ (p - 1)) fp) 0 + of_int S * of_nat p
[PROOF STEP]
by (subst sum.insert) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0) = poly ((pderiv ^^ (p - 1)) fp) 0 + of_int S * of_nat p

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>insert (p - 1) {p..s + p}. poly ((pderiv ^^ i) fp) 0) = poly ((pderiv ^^ (p - 1)) fp) 0 + of_int S * of_nat p

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "poly ((pderiv ^^ (p - 1)) fp) 0 = of_int (c ^ s * poly Q 0 ^ p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly ((pderiv ^^ (p - 1)) fp) 0 = of_int (int (c ^ s) * poly Q 0 ^ p)
[PROOF STEP]
using poly_higher_pderiv_aux2[of "p - 1" 0 "of_int_poly Q ^ p :: complex poly"]
[PROOF STATE]
proof (prove)
using this:
poly ((pderiv ^^ (p - 1)) ([:- 0, 1:] ^ (p - 1) * of_int_poly Q ^ p)) 0 = fact (p - 1) * poly (of_int_poly Q ^ p) 0

goal (1 subgoal):
 1. poly ((pderiv ^^ (p - 1)) fp) 0 = of_int (int (c ^ s) * poly Q 0 ^ p)
[PROOF STEP]
by (simp add: fp_def higher_pderiv_smult Polynomial.monom_altdef)
[PROOF STATE]
proof (state)
this:
poly ((pderiv ^^ (p - 1)) fp) 0 = of_int (int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
F 0 = of_int (int (c ^ s) * poly Q 0 ^ p) + of_int S * of_nat p
[PROOF STEP]
have "F 0 = of_int (S * int p + c ^ s * poly Q 0 ^ p)"
[PROOF STATE]
proof (prove)
using this:
F 0 = of_int (int (c ^ s) * poly Q 0 ^ p) + of_int S * of_nat p

goal (1 subgoal):
 1. F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "coprime p c" "coprime (int p) (poly Q 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime p c &&& coprime (int p) (poly Q 0)
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
prime p
nat \<bar>poly Q 0\<bar> < p
c < p
A < p

goal (1 subgoal):
 1. coprime p c &&& coprime (int p) (poly Q 0)
[PROOF STEP]
by (auto intro!: prime_imp_coprime dest: dvd_imp_le_int[rotated])
[PROOF STATE]
proof (state)
this:
coprime p c
coprime (int p) (poly Q 0)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "coprime (int p) (c ^ s * poly Q 0 ^ p)"
[PROOF STATE]
proof (prove)
using this:
coprime p c
coprime (int p) (poly Q 0)

goal (1 subgoal):
 1. coprime (int p) (int (c ^ s) * poly Q 0 ^ p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (int p) (int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "coprime (int p) (S * int p + c ^ s * poly Q 0 ^ p)"
[PROOF STATE]
proof (prove)
using this:
coprime (int p) (int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. coprime (int p) (S * int p + int (c ^ s) * poly Q 0 ^ p)
[PROOF STEP]
unfolding coprime_iff_gcd_eq_1 gcd_add_mult
[PROOF STATE]
proof (prove)
using this:
gcd (int p) (int (c ^ s) * poly Q 0 ^ p) = 1

goal (1 subgoal):
 1. gcd (int p) (int (c ^ s) * poly Q 0 ^ p) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (int p) (S * int p + int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. (\<And>F0. \<lbrakk>F 0 = of_int F0; coprime (int p) F0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p)
coprime (int p) (S * int p + int (c ^ s) * poly Q 0 ^ p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p)
coprime (int p) (S * int p + int (c ^ s) * poly Q 0 ^ p)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that[of "S * int p + c ^ s * poly Q 0 ^ p"]
[PROOF STATE]
proof (prove)
using this:
F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p)
coprime (int p) (S * int p + int (c ^ s) * poly Q 0 ^ p)
\<lbrakk>F 0 = of_int (S * int p + int (c ^ s) * poly Q 0 ^ p); coprime (int p) (S * int p + int (c ^ s) * poly Q 0 ^ p)\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed

    \<comment> \<open>Putting everything together, we have shown that $\sum I(x_i)$ is an integer coprime
        to $p$, and therefore a nonzero integer, and therefore has an absolute value of at least 1.\<close>
[PROOF STATE]
proof (state)
this:
F 0 = of_int F0
coprime (int p) F0

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "(\<Sum>Y\<in>Roots'. I (root' Y)) = F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>Y\<in>Roots'. I (root' Y)) = F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y))
[PROOF STEP]
by (simp add: I_altdef sum_subtractf sum_distrib_left sum_distrib_right algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "\<dots> = -(of_int (F0 * int A) +
                      (\<Sum>i\<le>s+p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y)) = - (of_int (F0 * int A) + (\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)))
[PROOF STEP]
using F0
[PROOF STATE]
proof (prove)
using this:
F 0 = of_int F0
coprime (int p) F0

goal (1 subgoal):
 1. F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y)) = - (of_int (F0 * int A) + (\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)))
[PROOF STEP]
by (simp add: Roots'_def eq F_def Fp_def poly_sum sum.swap[of _ "{..s+p}"])
[PROOF STATE]
proof (state)
this:
F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y)) = - (of_int (F0 * int A) + (\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
F 0 * (\<Sum>Y\<in>Roots'. exp (root' Y)) - (\<Sum>Y\<in>Roots'. F (root' Y)) = - (of_int (F0 * int A) + (\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "(\<Sum>i\<le>s+p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) =
                 (\<Sum>i=p..s+p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y))
[PROOF STEP]
proof (intro sum.mono_neutral_right ballI sum.neutral)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite {..s + p}
 2. {p..s + p} \<subseteq> {..s + p}
 3. \<And>i x. \<lbrakk>i \<in> {..s + p} - {p..s + p}; x \<in> Roots'\<rbrakk> \<Longrightarrow> poly ((pderiv ^^ i) fp) (root' x) = 0
[PROOF STEP]
fix i Y
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite {..s + p}
 2. {p..s + p} \<subseteq> {..s + p}
 3. \<And>i x. \<lbrakk>i \<in> {..s + p} - {p..s + p}; x \<in> Roots'\<rbrakk> \<Longrightarrow> poly ((pderiv ^^ i) fp) (root' x) = 0
[PROOF STEP]
assume i: "i \<in> {..s+p} - {p..s+p}" and Y: "Y \<in> Roots'"
[PROOF STATE]
proof (state)
this:
i \<in> {..s + p} - {p..s + p}
Y \<in> Roots'

goal (3 subgoals):
 1. finite {..s + p}
 2. {p..s + p} \<subseteq> {..s + p}
 3. \<And>i x. \<lbrakk>i \<in> {..s + p} - {p..s + p}; x \<in> Roots'\<rbrakk> \<Longrightarrow> poly ((pderiv ^^ i) fp) (root' x) = 0
[PROOF STEP]
have "[:-root' Y, 1:] ^ p dvd of_int_poly Q ^ p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:- root' Y, 1:] ^ p dvd of_int_poly Q ^ p
[PROOF STEP]
by (intro dvd_power_same) (auto simp: dvd_iff_poly_eq_0 Y)
[PROOF STATE]
proof (state)
this:
[:- root' Y, 1:] ^ p dvd of_int_poly Q ^ p

goal (3 subgoals):
 1. finite {..s + p}
 2. {p..s + p} \<subseteq> {..s + p}
 3. \<And>i x. \<lbrakk>i \<in> {..s + p} - {p..s + p}; x \<in> Roots'\<rbrakk> \<Longrightarrow> poly ((pderiv ^^ i) fp) (root' x) = 0
[PROOF STEP]
hence "[:-root' Y, 1:] ^ p dvd fp"
[PROOF STATE]
proof (prove)
using this:
[:- root' Y, 1:] ^ p dvd of_int_poly Q ^ p

goal (1 subgoal):
 1. [:- root' Y, 1:] ^ p dvd fp
[PROOF STEP]
by (auto simp: fp_def intro!: dvd_smult)
[PROOF STATE]
proof (state)
this:
[:- root' Y, 1:] ^ p dvd fp

goal (3 subgoals):
 1. finite {..s + p}
 2. {p..s + p} \<subseteq> {..s + p}
 3. \<And>i x. \<lbrakk>i \<in> {..s + p} - {p..s + p}; x \<in> Roots'\<rbrakk> \<Longrightarrow> poly ((pderiv ^^ i) fp) (root' x) = 0
[PROOF STEP]
thus "poly ((pderiv ^^ i) fp) (root' Y) = 0"
[PROOF STATE]
proof (prove)
using this:
[:- root' Y, 1:] ^ p dvd fp

goal (1 subgoal):
 1. poly ((pderiv ^^ i) fp) (root' Y) = 0
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
[:- root' Y, 1:] ^ p dvd fp
i \<in> {..s + p} - {p..s + p}

goal (1 subgoal):
 1. poly ((pderiv ^^ i) fp) (root' Y) = 0
[PROOF STEP]
by (intro poly_higher_pderiv_aux1') auto
[PROOF STATE]
proof (state)
this:
poly ((pderiv ^^ i) fp) (root' Y) = 0

goal (2 subgoals):
 1. finite {..s + p}
 2. {p..s + p} \<subseteq> {..s + p}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "\<dots> = of_int (K * int p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (K * int p)
[PROOF STEP]
using K
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (of_int K * int p)

goal (1 subgoal):
 1. (\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (K * int p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = p..s + p. \<Sum>Y\<in>Roots'. poly ((pderiv ^^ i) fp) (root' Y)) = of_int (K * int p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = - (of_int (F0 * int A) + of_int (K * int p))
[PROOF STEP]
have "(\<Sum>Y\<in>Roots'. I (root' Y)) = -of_int (K * int p + F0 * int A)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = - (of_int (F0 * int A) + of_int (K * int p))

goal (1 subgoal):
 1. (\<Sum>Y\<in>Roots'. I (root' Y)) = - of_int (K * int p + F0 * int A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = - of_int (K * int p + F0 * int A)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = - of_int (K * int p + F0 * int A)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "coprime p A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime p A
[PROOF STEP]
using p \<open>A > 0\<close>
[PROOF STATE]
proof (prove)
using this:
prime p
nat \<bar>poly Q 0\<bar> < p
c < p
A < p
0 < A

goal (1 subgoal):
 1. coprime p A
[PROOF STEP]
by (intro prime_imp_coprime) (auto dest!: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
coprime p A

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
hence "coprime (int p) (F0 * int A)"
[PROOF STATE]
proof (prove)
using this:
coprime p A

goal (1 subgoal):
 1. coprime (int p) (F0 * int A)
[PROOF STEP]
using F0
[PROOF STATE]
proof (prove)
using this:
coprime p A
F 0 = of_int F0
coprime (int p) F0

goal (1 subgoal):
 1. coprime (int p) (F0 * int A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (int p) (F0 * int A)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
hence "coprime (int p) (K * int p + F0 * int A)"
[PROOF STATE]
proof (prove)
using this:
coprime (int p) (F0 * int A)

goal (1 subgoal):
 1. coprime (int p) (K * int p + F0 * int A)
[PROOF STEP]
using F0
[PROOF STATE]
proof (prove)
using this:
coprime (int p) (F0 * int A)
F 0 = of_int F0
coprime (int p) F0

goal (1 subgoal):
 1. coprime (int p) (K * int p + F0 * int A)
[PROOF STEP]
unfolding coprime_iff_gcd_eq_1 gcd_add_mult
[PROOF STATE]
proof (prove)
using this:
gcd (int p) (F0 * int A) = 1
F 0 = of_int F0
gcd (int p) F0 = 1

goal (1 subgoal):
 1. gcd (int p) (F0 * int A) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
coprime (int p) (K * int p + F0 * int A)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
hence "K * int p + F0 * int A \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
coprime (int p) (K * int p + F0 * int A)

goal (1 subgoal):
 1. K * int p + F0 * int A \<noteq> 0
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
coprime (int p) (K * int p + F0 * int A)
prime p
nat \<bar>poly Q 0\<bar> < p
c < p
A < p

goal (1 subgoal):
 1. K * int p + F0 * int A \<noteq> 0
[PROOF STEP]
by (intro notI) auto
[PROOF STATE]
proof (state)
this:
K * int p + F0 * int A \<noteq> 0

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
hence "norm (-of_int (K * int p + F0 * int A) :: complex) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
K * int p + F0 * int A \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> cmod (- of_int (K * int p + F0 * int A))
[PROOF STEP]
unfolding norm_minus_cancel norm_of_int
[PROOF STATE]
proof (prove)
using this:
K * int p + F0 * int A \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> \<bar>real_of_int (K * int p + F0 * int A)\<bar>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (- of_int (K * int p + F0 * int A))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = - of_int (K * int p + F0 * int A)
1 \<le> cmod (- of_int (K * int p + F0 * int A))
[PROOF STEP]
have "1 \<le> norm (\<Sum>Y\<in>Roots'. I (root' Y))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>Y\<in>Roots'. I (root' Y)) = - of_int (K * int p + F0 * int A)
1 \<le> cmod (- of_int (K * int p + F0 * int A))

goal (1 subgoal):
 1. 1 \<le> cmod (\<Sum>Y\<in>Roots'. I (root' Y))
[PROOF STEP]
by metis

    \<comment> \<open>The M--L bound on the integral gives us an upper bound:\<close>
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (\<Sum>Y\<in>Roots'. I (root' Y))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 \<le> cmod (\<Sum>Y\<in>Roots'. I (root' Y))

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "norm (\<Sum>Y\<in>Roots'. I (root' Y)) \<le>
                 (\<Sum>Y\<in>Roots'. norm (root' Y) * exp (norm (root' Y)) * fp_ub p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (\<Sum>Y\<in>Roots'. I (root' Y)) \<le> (\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p)
[PROOF STEP]
proof (intro sum_norm_le lindemann_weierstrass_integral_bound fp_ub fp_ub_nonneg)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> Roots'; t \<in> closed_segment 0 (root' x)\<rbrakk> \<Longrightarrow> t \<in> cball 0 Radius
[PROOF STEP]
fix Y u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> Roots'; t \<in> closed_segment 0 (root' x)\<rbrakk> \<Longrightarrow> t \<in> cball 0 Radius
[PROOF STEP]
assume *: "Y \<in> Roots'" "u \<in> closed_segment 0 (root' Y)"
[PROOF STATE]
proof (state)
this:
Y \<in> Roots'
u \<in> closed_segment 0 (root' Y)

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> Roots'; t \<in> closed_segment 0 (root' x)\<rbrakk> \<Longrightarrow> t \<in> cball 0 Radius
[PROOF STEP]
hence "closed_segment 0 (root' Y) \<subseteq> cball 0 Radius"
[PROOF STATE]
proof (prove)
using this:
Y \<in> Roots'
u \<in> closed_segment 0 (root' Y)

goal (1 subgoal):
 1. closed_segment 0 (root' Y) \<subseteq> cball 0 Radius
[PROOF STEP]
using \<open>Radius \<ge> 0\<close> Radius[of Y]
[PROOF STATE]
proof (prove)
using this:
Y \<in> Roots'
u \<in> closed_segment 0 (root' Y)
0 \<le> Radius
Y \<in> Roots' \<Longrightarrow> cmod (root' Y) \<le> Radius

goal (1 subgoal):
 1. closed_segment 0 (root' Y) \<subseteq> cball 0 Radius
[PROOF STEP]
by (intro closed_segment_subset) auto
[PROOF STATE]
proof (state)
this:
closed_segment 0 (root' Y) \<subseteq> cball 0 Radius

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> Roots'; t \<in> closed_segment 0 (root' x)\<rbrakk> \<Longrightarrow> t \<in> cball 0 Radius
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
Y \<in> Roots'
u \<in> closed_segment 0 (root' Y)
closed_segment 0 (root' Y) \<subseteq> cball 0 Radius
[PROOF STEP]
show "u \<in> cball 0 Radius"
[PROOF STATE]
proof (prove)
using this:
Y \<in> Roots'
u \<in> closed_segment 0 (root' Y)
closed_segment 0 (root' Y) \<subseteq> cball 0 Radius

goal (1 subgoal):
 1. u \<in> cball 0 Radius
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> cball 0 Radius

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>Y\<in>Roots'. I (root' Y)) \<le> (\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (\<Sum>Y\<in>Roots'. I (root' Y)) \<le> (\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "\<dots> \<le> (\<Sum>Y\<in>Roots'. Radius * exp (Radius) * fp_ub p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p) \<le> (\<Sum>Y\<in>Roots'. Radius * exp Radius * fp_ub p)
[PROOF STEP]
using Radius
[PROOF STATE]
proof (prove)
using this:
?Y \<in> Roots' \<Longrightarrow> cmod (root' ?Y) \<le> Radius

goal (1 subgoal):
 1. (\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p) \<le> (\<Sum>Y\<in>Roots'. Radius * exp Radius * fp_ub p)
[PROOF STEP]
by (intro sum_mono mult_right_mono mult_mono fp_ub_nonneg \<open>Radius \<ge> 0\<close>) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p) \<le> (\<Sum>Y\<in>Roots'. Radius * exp Radius * fp_ub p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. cmod (root' Y) * exp (cmod (root' Y)) * fp_ub p) \<le> (\<Sum>Y\<in>Roots'. Radius * exp Radius * fp_ub p)

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
have "\<dots> = C * fp_ub p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>Y\<in>Roots'. Radius * exp Radius * fp_ub p) = C * fp_ub p
[PROOF STEP]
by (simp add: C_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>Y\<in>Roots'. Radius * exp Radius * fp_ub p) = C * fp_ub p

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>pa\<in>{nat \<bar>poly Q 0\<bar>, c, A}. pa < p; prime p\<rbrakk> \<Longrightarrow> 1 \<le> C * fp_ub p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 \<le> C * fp_ub p
[PROOF STEP]
show "1 \<le> C * fp_ub p"
[PROOF STATE]
proof (prove)
using this:
1 \<le> C * fp_ub p

goal (1 subgoal):
 1. 1 \<le> C * fp_ub p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
1 \<le> C * fp_ub p

goal:
No subgoals!
[PROOF STEP]
qed

  \<comment> \<open>It now only remains to show that this inequality is inconsistent for large $p$.
      This is obvious, since the upper bound is an exponential divided by a factorial and
      therefore clearly tends to zero.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. 1 \<le> C * fp_ub p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "(\<lambda>p. C * fp_ub p) \<in> \<Theta>(\<lambda>p. (C / (Radius * \<bar>c\<bar>)) * (p / 2 ^ p) *
                                     ((2 * \<bar>c\<bar> ^ r * Radius * Q_ub) ^ p / fact p))"
    (is "_ \<in> \<Theta>(?f)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. C * fp_ub p) \<in> \<Theta>(\<lambda>p. C / (Radius * real_of_int \<bar>int c\<bar>) * (real p / 2 ^ p) * ((real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ p / fact p))
[PROOF STEP]
using degree_Q card_Roots' \<open>Radius > 0\<close>
[PROOF STATE]
proof (prove)
using this:
Polynomial.degree (of_int_poly Q) = card Roots'
0 < card Roots'
0 < Radius

goal (1 subgoal):
 1. (\<lambda>p. C * fp_ub p) \<in> \<Theta>(\<lambda>p. C / (Radius * real_of_int \<bar>int c\<bar>) * (real p / 2 ^ p) * ((real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ p / fact p))
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of 0]])
       (auto simp: fact_reduce power_mult [symmetric] r_def
                   fp_ub_def power_diff power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(\<lambda>p. C * fp_ub p) \<in> \<Theta>(\<lambda>p. C / (Radius * real_of_int \<bar>int c\<bar>) * (real p / 2 ^ p) * ((real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ p / fact p))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>p. C * fp_ub p) \<in> \<Theta>(\<lambda>p. C / (Radius * real_of_int \<bar>int c\<bar>) * (real p / 2 ^ p) * ((real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ p / fact p))

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "?f \<in> o(\<lambda>p. 1 * 1 * 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. C / (Radius * real_of_int \<bar>int c\<bar>) * (real p / 2 ^ p) * ((real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ p / fact p)) \<in> o(\<lambda>p. 1 * 1 * 1)
[PROOF STEP]
proof (intro landau_o.big_small_mult landau_o.big_mult)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. C / (Radius * real_of_int \<bar>int c\<bar>)) \<in> O(\<lambda>x. 1)
 2. (\<lambda>x. real x / 2 ^ x) \<in> O(\<lambda>x. 1)
 3. (\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<in> o(\<lambda>x. 1)
[PROOF STEP]
have "(\<lambda>x. (real_of_int (2 * \<bar>c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro power_over_fact_tendsto_0)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<longlonglongrightarrow> 0

goal (3 subgoals):
 1. (\<lambda>x. C / (Radius * real_of_int \<bar>int c\<bar>)) \<in> O(\<lambda>x. 1)
 2. (\<lambda>x. real x / 2 ^ x) \<in> O(\<lambda>x. 1)
 3. (\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<in> o(\<lambda>x. 1)
[PROOF STEP]
thus "(\<lambda>x. (real_of_int (2 * \<bar>c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<in> o(\<lambda>x. 1)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<in> o(\<lambda>x. 1)
[PROOF STEP]
by (intro smalloI_tendsto) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ x / fact x) \<in> o(\<lambda>x. 1)

goal (2 subgoals):
 1. (\<lambda>x. C / (Radius * real_of_int \<bar>int c\<bar>)) \<in> O(\<lambda>x. 1)
 2. (\<lambda>x. real x / 2 ^ x) \<in> O(\<lambda>x. 1)
[PROOF STEP]
qed real_asymp+
[PROOF STATE]
proof (state)
this:
(\<lambda>p. C / (Radius * real_of_int \<bar>int c\<bar>) * (real p / 2 ^ p) * ((real_of_int (2 * \<bar>int c\<bar> ^ r) * Radius * Q_ub) ^ p / fact p)) \<in> o(\<lambda>p. 1 * 1 * 1)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>p. C * fp_ub p) \<in> o(\<lambda>p. 1 * 1 * 1)
[PROOF STEP]
have "(\<lambda>p. C * fp_ub p) \<in> o(\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>p. C * fp_ub p) \<in> o(\<lambda>p. 1 * 1 * 1)

goal (1 subgoal):
 1. (\<lambda>p. C * fp_ub p) \<in> o(\<lambda>_. 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>p. C * fp_ub p) \<in> o(\<lambda>_. 1)

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
from smalloD_tendsto[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. C * fp_ub x / 1) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>p. C * fp_ub p) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. C * fp_ub x / 1) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>p. C * fp_ub p) \<longlonglongrightarrow> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>p. C * fp_ub p) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence "eventually (\<lambda>p. C * fp_ub p < 1) at_top"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>p. C * fp_ub p) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F p in sequentially. C * fp_ub p < 1
[PROOF STEP]
by (intro order_tendstoD) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in sequentially. C * fp_ub p < 1

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
hence "eventually (\<lambda>p. C * fp_ub p < 1) primes_at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in sequentially. C * fp_ub p < 1

goal (1 subgoal):
 1. \<forall>\<^sub>F p in primes_at_top. C * fp_ub p < 1
[PROOF STEP]
unfolding primes_at_top_def eventually_inf_principal
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in sequentially. C * fp_ub p < 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. x \<in> Collect prime \<longrightarrow> C * fp_ub x < 1
[PROOF STEP]
by eventually_elim auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. C * fp_ub p < 1

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. C * fp_ub p < 1

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
note \<open>eventually (\<lambda>p. C * fp_ub p \<ge> 1) primes_at_top\<close>
  \<comment> \<open>We therefore have a contradiction for any sufficiently large prime.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. 1 \<le> C * fp_ub p

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F p in primes_at_top. C * fp_ub p < 1
\<forall>\<^sub>F p in primes_at_top. 1 \<le> C * fp_ub p
[PROOF STEP]
have "eventually (\<lambda>p. False) primes_at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in primes_at_top. C * fp_ub p < 1
\<forall>\<^sub>F p in primes_at_top. 1 \<le> C * fp_ub p

goal (1 subgoal):
 1. \<forall>\<^sub>F p in primes_at_top. False
[PROOF STEP]
by eventually_elim auto

  \<comment> \<open>Since sufficiently large primes always exist, this concludes the theorem.\<close>
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. False

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F p in primes_at_top. False

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
have "frequently (\<lambda>p. prime p) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frequently prime sequentially
[PROOF STEP]
using primes_infinite
[PROOF STATE]
proof (prove)
using this:
infinite {p. prime p}

goal (1 subgoal):
 1. frequently prime sequentially
[PROOF STEP]
by (simp add: cofinite_eq_sequentially[symmetric] Inf_many_def)
[PROOF STATE]
proof (state)
this:
frequently prime sequentially

goal (1 subgoal):
 1. algebraic (\<i> * complex_of_real pi) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F p in primes_at_top. False
frequently prime sequentially
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in primes_at_top. False
frequently prime sequentially

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

goal:
No subgoals!
[PROOF STEP]
qed