[STATEMENT]
lemma two_circles_01:
  fixes P::"real poly"
  assumes hP: "degree P \<le> p" and hP0: "P \<noteq> 0" and hp0: "p \<noteq> 0"
  and h: "proots_count (map_poly of_real P)
          (upper_circle_01 \<union> lower_circle_01) = 1"
shows "Bernstein_changes_01 p P = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_changes_01 p P = 1
[PROOF STEP]
proof (subst Bernstein_changes_01_eq_changes[OF hP])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
let ?Q = "reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
have hQ0: "?Q \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<noteq> 0
[PROOF STEP]
using hP0
[PROOF STATE]
proof (prove)
using this:
P \<noteq> 0

goal (1 subgoal):
 1. reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<noteq> 0
[PROOF STEP]
by (simp add: pcompose_eq_0 hP reciprocal_0_iff)
[PROOF STATE]
proof (state)
this:
reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<noteq> 0

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
from h
[PROOF STATE]
proof (chain)
picking this:
proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01) = 1
[PROOF STEP]
obtain x' where hroot': "poly (map_poly of_real P) x' = 0"
    and hx':"x' \<in> upper_circle_01 \<union> lower_circle_01"
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01) = 1

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>poly (map_poly complex_of_real P) x' = 0; x' \<in> upper_circle_01 \<union> lower_circle_01\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using proots_count_pos
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01) = 1
0 < proots_count ?P ?S \<Longrightarrow> \<exists>x\<in>?S. poly ?P x = (0::?'a)

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>poly (map_poly complex_of_real P) x' = 0; x' \<in> upper_circle_01 \<union> lower_circle_01\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis less_numeral_extra(1))
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real P) x' = 0
x' \<in> upper_circle_01 \<union> lower_circle_01

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
obtain x where hxx': "x' = complex_of_real x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x' = complex_of_real x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "Im x' = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' = 0\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume "Im x' = 0" and h: "\<And>x. x' = complex_of_real x \<Longrightarrow> thesis"
[PROOF STATE]
proof (state)
this:
Im x' = 0
x' = complex_of_real ?x \<Longrightarrow> thesis

goal (2 subgoals):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' = 0\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Im x' = 0
x' = complex_of_real ?x \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
using this:
Im x' = 0
x' = complex_of_real ?x \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using h[of "Re x'"]
[PROOF STATE]
proof (prove)
using this:
Im x' = 0
x' = complex_of_real ?x \<Longrightarrow> thesis
x' = complex_of_real (Re x') \<Longrightarrow> thesis

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

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume hx'': "Im x' \<noteq> 0"
[PROOF STATE]
proof (state)
this:
Im x' \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have 1: "card {x', cnj x'} = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x', cnj x'} = 2
[PROOF STEP]
proof (subst card_2_iff)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y. {x', cnj x'} = {x, y} \<and> x \<noteq> y
[PROOF STEP]
from hx''
[PROOF STATE]
proof (chain)
picking this:
Im x' \<noteq> 0
[PROOF STEP]
have "x' \<noteq> cnj x'" and "{x', cnj x'} = {x', cnj x'}"
[PROOF STATE]
proof (prove)
using this:
Im x' \<noteq> 0

goal (1 subgoal):
 1. x' \<noteq> cnj x' &&& {x', cnj x'} = {x', cnj x'}
[PROOF STEP]
by (metis cnj.simps(2) neg_equal_zero, argo)
[PROOF STATE]
proof (state)
this:
x' \<noteq> cnj x'
{x', cnj x'} = {x', cnj x'}

goal (1 subgoal):
 1. \<exists>x y. {x', cnj x'} = {x, y} \<and> x \<noteq> y
[PROOF STEP]
thus "\<exists>x y. {x', cnj x'} = {x, y} \<and> x \<noteq> y"
[PROOF STATE]
proof (prove)
using this:
x' \<noteq> cnj x'
{x', cnj x'} = {x', cnj x'}

goal (1 subgoal):
 1. \<exists>x y. {x', cnj x'} = {x, y} \<and> x \<noteq> y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x y. {x', cnj x'} = {x, y} \<and> x \<noteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {x', cnj x'} = 2

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card {x', cnj x'} = 2

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "{x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
[PROOF STEP]
using hx'
[PROOF STATE]
proof (prove)
using this:
x' \<in> upper_circle_01 \<union> lower_circle_01

goal (1 subgoal):
 1. {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
[PROOF STEP]
apply (rule UnE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x' \<in> upper_circle_01 \<Longrightarrow> {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
 2. x' \<in> lower_circle_01 \<Longrightarrow> {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
[PROOF STEP]
by (auto simp: cnj_upper_circle_01[symmetric])
[PROOF STATE]
proof (state)
this:
{x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "\<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly of_real P) x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0
[PROOF STEP]
using hroot' poly_map_poly_of_real_cnj
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real P) x' = 0
poly (map_poly complex_of_real ?p) (cnj ?z) = cnj (poly (map_poly complex_of_real ?p) ?z)

goal (1 subgoal):
 1. \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) ?x = 0

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card {x', cnj x'} = 2
{x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
?x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) ?x = 0
[PROOF STEP]
have
      "proots_count (map_poly of_real P) (upper_circle_01 \<union> lower_circle_01) \<ge> 2"
[PROOF STATE]
proof (prove)
using this:
card {x', cnj x'} = 2
{x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
?x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) ?x = 0

goal (1 subgoal):
 1. 2 \<le> proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst 1[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0\<rbrakk> \<Longrightarrow> card {x', cnj x'} \<le> proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (rule proots_count_of_root_set)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0\<rbrakk> \<Longrightarrow> map_poly complex_of_real P \<noteq> 0
 2. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0\<rbrakk> \<Longrightarrow> {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
 3. \<And>x. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0; x \<in> {x', cnj x'}\<rbrakk> \<Longrightarrow> poly (map_poly complex_of_real P) x = 0
[PROOF STEP]
using assms(2) of_real_poly_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
P \<noteq> 0
(map_poly of_real ?p = 0) = (?p = 0)

goal (3 subgoals):
 1. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0\<rbrakk> \<Longrightarrow> map_poly complex_of_real P \<noteq> 0
 2. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0\<rbrakk> \<Longrightarrow> {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01
 3. \<And>x. \<lbrakk>card {x', cnj x'} = 2; {x', cnj x'} \<subseteq> upper_circle_01 \<union> lower_circle_01; \<And>x. x \<in> {x', cnj x'} \<Longrightarrow> poly (map_poly complex_of_real P) x = 0; x \<in> {x', cnj x'}\<rbrakk> \<Longrightarrow> poly (map_poly complex_of_real P) x = 0
[PROOF STEP]
by (blast, blast, blast)
[PROOF STATE]
proof (state)
this:
2 \<le> proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<lbrakk>\<And>x. x' = complex_of_real x \<Longrightarrow> thesis; Im x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus thesis
[PROOF STATE]
proof (prove)
using this:
2 \<le> proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using assms(4)
[PROOF STATE]
proof (prove)
using this:
2 \<le> proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01)
proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01) = 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x' = complex_of_real x

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
hence hroot: "poly P x = 0"
[PROOF STATE]
proof (prove)
using this:
x' = complex_of_real x

goal (1 subgoal):
 1. poly P x = 0
[PROOF STEP]
using hroot'
[PROOF STATE]
proof (prove)
using this:
x' = complex_of_real x
poly (map_poly complex_of_real P) x' = 0

goal (1 subgoal):
 1. poly P x = 0
[PROOF STEP]
by (metis of_real_0 of_real_eq_iff of_real_poly_map_poly)
[PROOF STATE]
proof (state)
this:
poly P x = 0

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
have that: "3 * sqrt (x * x + 1 / 3 - x) < sqrt 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * sqrt (x * x + 1 / 3 - x) < sqrt 3
[PROOF STEP]
using hx'
[PROOF STATE]
proof (prove)
using this:
x' \<in> upper_circle_01 \<union> lower_circle_01

goal (1 subgoal):
 1. 3 * sqrt (x * x + 1 / 3 - x) < sqrt 3
[PROOF STEP]
apply (rule UnE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x' \<in> upper_circle_01 \<Longrightarrow> 3 * sqrt (x * x + 1 / 3 - x) < sqrt 3
 2. x' \<in> lower_circle_01 \<Longrightarrow> 3 * sqrt (x * x + 1 / 3 - x) < sqrt 3
[PROOF STEP]
by (auto simp: cmod_def power2_eq_square algebra_simps upper_circle_01_def
        lower_circle_01_def hxx')
[PROOF STATE]
proof (state)
this:
3 * sqrt (x * x + 1 / 3 - x) < sqrt 3

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
have hx: "0 < x \<and> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
have "3 * sqrt (x * x + 1 / 3 - x) = sqrt (9 * (x * x + 1 / 3 - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * sqrt (x * x + 1 / 3 - x) = sqrt (9 * (x * x + 1 / 3 - x))
[PROOF STEP]
by (subst real_sqrt_mult, simp)
[PROOF STATE]
proof (state)
this:
3 * sqrt (x * x + 1 / 3 - x) = sqrt (9 * (x * x + 1 / 3 - x))

goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
hence "9 * (x * x + 1 / 3 - x) < 3"
[PROOF STATE]
proof (prove)
using this:
3 * sqrt (x * x + 1 / 3 - x) = sqrt (9 * (x * x + 1 / 3 - x))

goal (1 subgoal):
 1. 9 * (x * x + 1 / 3 - x) < 3
[PROOF STEP]
using that real_sqrt_less_iff
[PROOF STATE]
proof (prove)
using this:
3 * sqrt (x * x + 1 / 3 - x) = sqrt (9 * (x * x + 1 / 3 - x))
3 * sqrt (x * x + 1 / 3 - x) < sqrt 3
(sqrt ?x < sqrt ?y) = (?x < ?y)

goal (1 subgoal):
 1. 9 * (x * x + 1 / 3 - x) < 3
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
9 * (x * x + 1 / 3 - x) < 3

goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
hence "x*x - x < 0"
[PROOF STATE]
proof (prove)
using this:
9 * (x * x + 1 / 3 - x) < 3

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

goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
thus "0 < x \<and> x < 1"
[PROOF STATE]
proof (prove)
using this:
x * x - x < 0

goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
using mult_eq_0_iff mult_less_cancel_right_disj
[PROOF STATE]
proof (prove)
using this:
x * x - x < 0
(?a * ?b = (0::?'a)) = (?a = (0::?'a) \<or> ?b = (0::?'a))
(?a * ?c < ?b * ?c) = ((0::?'a) < ?c \<and> ?a < ?b \<or> ?c < (0::?'a) \<and> ?b < ?a)

goal (1 subgoal):
 1. 0 < x \<and> x < 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < x \<and> x < 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < x \<and> x < 1

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
let ?y = "1/x - 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
from hroot hx assms
[PROOF STATE]
proof (chain)
picking this:
poly P x = 0
0 < x \<and> x < 1
degree P \<le> p
P \<noteq> 0
p \<noteq> 0
proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01) = 1
[PROOF STEP]
have "poly ?Q ?y = 0"
[PROOF STATE]
proof (prove)
using this:
poly P x = 0
0 < x \<and> x < 1
degree P \<le> p
P \<noteq> 0
p \<noteq> 0
proots_count (map_poly complex_of_real P) (upper_circle_01 \<union> lower_circle_01) = 1

goal (1 subgoal):
 1. poly (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (1 / x - 1) = 0
[PROOF STEP]
by (auto simp: poly_pcompose poly_reciprocal)
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (1 / x - 1) = 0

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
hence "[:-?y, 1:] dvd ?Q"
[PROOF STATE]
proof (prove)
using this:
poly (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (1 / x - 1) = 0

goal (1 subgoal):
 1. [:- (1 / x - 1), 1:] dvd reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]
[PROOF STEP]
using poly_eq_0_iff_dvd
[PROOF STATE]
proof (prove)
using this:
poly (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (1 / x - 1) = 0
(poly ?p ?c = (0::?'a)) = ([:- ?c, 1::?'a:] dvd ?p)

goal (1 subgoal):
 1. [:- (1 / x - 1), 1:] dvd reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[:- (1 / x - 1), 1:] dvd reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[:- (1 / x - 1), 1:] dvd reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]
[PROOF STEP]
obtain R where hR: "?Q = R * [:-?y, 1:]"
[PROOF STATE]
proof (prove)
using this:
[:- (1 / x - 1), 1:] dvd reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]

goal (1 subgoal):
 1. (\<And>R. reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] = R * [:- (1 / x - 1), 1:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] = R * [:- (1 / x - 1), 1:]

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
hence hR0: "R \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] = R * [:- (1 / x - 1), 1:]

goal (1 subgoal):
 1. R \<noteq> 0
[PROOF STEP]
using hQ0
[PROOF STATE]
proof (prove)
using this:
reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] = R * [:- (1 / x - 1), 1:]
reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<noteq> 0

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

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
interpret map_poly_idom_hom complex_of_real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_idom_hom complex_of_real
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
have "normal_poly (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_poly (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)
[PROOF STEP]
proof (rule normal_poly_of_roots)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>z. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
 2. monic (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)
[PROOF STEP]
show "\<And>z. poly (map_poly complex_of_real
          (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow>
          Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
assume
        "poly (map_poly complex_of_real
         (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0"
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0

goal (1 subgoal):
 1. \<And>z. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
hence hroot2: "poly (map_poly complex_of_real R) z = 0"
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0

goal (1 subgoal):
 1. poly (map_poly complex_of_real R) z = 0
[PROOF STEP]
by (auto simp: map_poly_smult hQ0)
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real R) z = 0

goal (1 subgoal):
 1. \<And>z. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) z = 0 \<Longrightarrow> Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
show "Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2)"
[PROOF STATE]
proof (state)
this:
\<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence 1: "0 < Re z \<or> 4 * (Re z)\<^sup>2 < (cmod z)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
\<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2)

goal (1 subgoal):
 1. 0 < Re z \<or> 4 * (Re z)\<^sup>2 < (cmod z)\<^sup>2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
0 < Re z \<or> 4 * (Re z)\<^sup>2 < (cmod z)\<^sup>2

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence hz: "z \<noteq> -1"
[PROOF STATE]
proof (prove)
using this:
0 < Re z \<or> 4 * (Re z)\<^sup>2 < (cmod z)\<^sup>2

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

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "Im z > - sqrt 3 * Re z \<or> sqrt 3 * Re z > Im z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
proof (cases "Im z \<ge> sqrt 3 * Re z", cases "- sqrt 3 * Re z \<ge> Im z")
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
assume 2: "sqrt 3 * Re z \<le> Im z" "Im z \<le> - sqrt 3 * Re z"
[PROOF STATE]
proof (state)
this:
sqrt 3 * Re z \<le> Im z
Im z \<le> - sqrt 3 * Re z

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
hence "sqrt 3 * Re z \<le> sqrt 3 * - Re z"
[PROOF STATE]
proof (prove)
using this:
sqrt 3 * Re z \<le> Im z
Im z \<le> - sqrt 3 * Re z

goal (1 subgoal):
 1. sqrt 3 * Re z \<le> sqrt 3 * - Re z
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
sqrt 3 * Re z \<le> sqrt 3 * - Re z

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
hence "Re z \<le> - Re z"
[PROOF STATE]
proof (prove)
using this:
sqrt 3 * Re z \<le> sqrt 3 * - Re z

goal (1 subgoal):
 1. Re z \<le> - Re z
[PROOF STEP]
apply (rule mult_left_le_imp_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sqrt 3
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Re z \<le> - Re z

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
hence "Re z \<le> 0"
[PROOF STATE]
proof (prove)
using this:
Re z \<le> - Re z

goal (1 subgoal):
 1. Re z \<le> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re z \<le> 0

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re z \<le> 0

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
have "(Im z)^2 \<le> (-sqrt 3 * Re z)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Im z)\<^sup>2 \<le> (- sqrt 3 * Re z)\<^sup>2
[PROOF STEP]
apply (subst power2_eq_square, subst power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im z * Im z \<le> - sqrt 3 * Re z * (- sqrt 3 * Re z)
[PROOF STEP]
apply (rule square_bounded_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- sqrt 3 * Re z) \<le> Im z \<and> Im z \<le> - sqrt 3 * Re z
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
sqrt 3 * Re z \<le> Im z
Im z \<le> - sqrt 3 * Re z

goal (1 subgoal):
 1. - (- sqrt 3 * Re z) \<le> Im z \<and> Im z \<le> - sqrt 3 * Re z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(Im z)\<^sup>2 \<le> (- sqrt 3 * Re z)\<^sup>2

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re z \<le> 0
(Im z)\<^sup>2 \<le> (- sqrt 3 * Re z)\<^sup>2
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
Re z \<le> 0
(Im z)\<^sup>2 \<le> (- sqrt 3 * Re z)\<^sup>2

goal (1 subgoal):
 1. False
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
Re z \<le> 0
(Im z)\<^sup>2 \<le> (- sqrt 3 * Re z)\<^sup>2
0 < Re z \<or> 4 * (Re z)\<^sup>2 < (cmod z)\<^sup>2

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

goal (3 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 3. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
- sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z

goal (2 subgoals):
 1. \<lbrakk>sqrt 3 * Re z \<le> Im z; \<not> Im z \<le> - sqrt 3 * Re z\<rbrakk> \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
 2. \<not> sqrt 3 * Re z \<le> Im z \<Longrightarrow> - sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
- sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence "z \<in> {z. - sqrt 3 * Re z < Im z} \<union> {z. Im z < sqrt 3 * Re z}"
[PROOF STATE]
proof (prove)
using this:
- sqrt 3 * Re z < Im z \<or> Im z < sqrt 3 * Re z

goal (1 subgoal):
 1. z \<in> {z. - sqrt 3 * Re z < Im z} \<union> {z. Im z < sqrt 3 * Re z}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> {z. - sqrt 3 * Re z < Im z} \<union> {z. Im z < sqrt 3 * Re z}

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence 1: "inverse (1 + z) \<in> upper_circle_01 \<union> lower_circle_01"
[PROOF STATE]
proof (prove)
using this:
z \<in> {z. - sqrt 3 * Re z < Im z} \<union> {z. Im z < sqrt 3 * Re z}

goal (1 subgoal):
 1. inverse (1 + z) \<in> upper_circle_01 \<union> lower_circle_01
[PROOF STEP]
by (force simp: inverse_eq_divide upper_circle_map[symmetric]
              lower_circle_map[symmetric])
[PROOF STATE]
proof (state)
this:
inverse (1 + z) \<in> upper_circle_01 \<union> lower_circle_01

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have hRdeg': "degree R < p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree R < p
[PROOF STEP]
apply (rule less_le_trans[of "degree R" "degree ?Q"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. degree R < degree (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])
 2. degree (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) \<le> p
[PROOF STEP]
apply (subst hR, subst degree_mult_eq[OF hR0], fastforce, fastforce)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) \<le> p
[PROOF STEP]
by (auto simp: degree_pcompose degree_reciprocal hP)
[PROOF STATE]
proof (state)
this:
degree R < p

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
hence hRdeg: "degree R \<le> p"
[PROOF STATE]
proof (prove)
using this:
degree R < p

goal (1 subgoal):
 1. degree R \<le> p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
degree R \<le> p

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have 2: "map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:-1, 1:])) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:])) \<noteq> 0
[PROOF STEP]
apply (subst of_real_poly_eq_0_iff, subst reciprocal_0_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. R \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
[PROOF STEP]
apply (force simp: hRdeg degree_pcompose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
[PROOF STEP]
using hR0 pcompose_eq_0
[PROOF STATE]
proof (prove)
using this:
R \<noteq> 0
degree ?q \<noteq> 0 \<Longrightarrow> (?p \<circ>\<^sub>p ?q = 0) = (?p = 0)

goal (1 subgoal):
 1. R \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
[PROOF STEP]
by (metis degree_eq_zeroE gr_zeroI pCons_eq_iff pCons_one zero_neq_one)
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:])) \<noteq> 0

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have 3:
          "poly (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:-1, 1:])))
                 (inverse (1 + z)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (inverse (1 + z)) = 0
[PROOF STEP]
apply (subst map_poly_reciprocal)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. complex_of_real 0 = 0
 3. poly (reciprocal_poly p (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:]))) (inverse (1 + z)) = 0
[PROOF STEP]
using hRdeg
[PROOF STATE]
proof (prove)
using this:
degree R \<le> p

goal (3 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. complex_of_real 0 = 0
 3. poly (reciprocal_poly p (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:]))) (inverse (1 + z)) = 0
[PROOF STEP]
apply (force simp: degree_pcompose)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. complex_of_real 0 = 0
 2. poly (reciprocal_poly p (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:]))) (inverse (1 + z)) = 0
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (reciprocal_poly p (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:]))) (inverse (1 + z)) = 0
[PROOF STEP]
apply (subst poly_reciprocal)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. degree (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) \<le> p
 2. inverse (1 + z) \<noteq> 0
 3. inverse (1 + z) ^ p * poly (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) (inverse (inverse (1 + z))) = 0
[PROOF STEP]
using hRdeg
[PROOF STATE]
proof (prove)
using this:
degree R \<le> p

goal (3 subgoals):
 1. degree (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) \<le> p
 2. inverse (1 + z) \<noteq> 0
 3. inverse (1 + z) ^ p * poly (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) (inverse (inverse (1 + z))) = 0
[PROOF STEP]
apply (force simp: degree_map_poly degree_pcompose)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inverse (1 + z) \<noteq> 0
 2. inverse (1 + z) ^ p * poly (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) (inverse (inverse (1 + z))) = 0
[PROOF STEP]
using hz
[PROOF STATE]
proof (prove)
using this:
z \<noteq> - 1

goal (2 subgoals):
 1. inverse (1 + z) \<noteq> 0
 2. inverse (1 + z) ^ p * poly (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) (inverse (inverse (1 + z))) = 0
[PROOF STEP]
apply (metis inverse_nonzero_iff_nonzero neg_eq_iff_add_eq_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (1 + z) ^ p * poly (map_poly complex_of_real (R \<circ>\<^sub>p [:- 1, 1:])) (inverse (inverse (1 + z))) = 0
[PROOF STEP]
by (auto simp: of_real_hom.map_poly_pcompose poly_pcompose hroot2)
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (inverse (1 + z)) = 0

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "proots_count (map_poly of_real (reciprocal_poly p (R \<circ>\<^sub>p [:-1, 1:])))
               (upper_circle_01 \<union> lower_circle_01) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
by (rule proots_count_of_root[OF 2 1 3])
[PROOF STATE]
proof (state)
this:
0 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "proots_count
                     (map_poly complex_of_real
                     (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])))
                     (upper_circle_01 \<union> lower_circle_01) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst map_poly_reciprocal)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. degree ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. complex_of_real 0 = 0
 3. 0 < proots_count (reciprocal_poly p (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hp0 less_eq_Suc_le
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
(?n < ?m) = (Suc ?n \<le> ?m)

goal (3 subgoals):
 1. degree ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. complex_of_real 0 = 0
 3. 0 < proots_count (reciprocal_poly p (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (simp add: degree_pcompose)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. complex_of_real 0 = 0
 2. 0 < proots_count (reciprocal_poly p (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (reciprocal_poly p (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst proots_count_reciprocal)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. degree (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) \<le> p
 2. map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]) \<noteq> 0
 3. 0 \<notin> upper_circle_01 \<union> lower_circle_01
 4. 0 < proots_count (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01}
[PROOF STEP]
using hp0 less_eq_Suc_le
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
(?n < ?m) = (Suc ?n \<le> ?m)

goal (4 subgoals):
 1. degree (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) \<le> p
 2. map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]) \<noteq> 0
 3. 0 \<notin> upper_circle_01 \<union> lower_circle_01
 4. 0 < proots_count (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01}
[PROOF STEP]
apply (simp add: degree_pcompose degree_map_poly)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]) \<noteq> 0
 2. 0 \<notin> upper_circle_01 \<union> lower_circle_01
 3. 0 < proots_count (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01}
[PROOF STEP]
apply (auto simp: pcompose_pCons)[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<notin> upper_circle_01 \<union> lower_circle_01
 2. 0 < proots_count (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01}
[PROOF STEP]
apply (auto simp: cmod_def power2_eq_square real_sqrt_divide
                    real_div_sqrt upper_circle_01_def lower_circle_01_def)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])) {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01}
[PROOF STEP]
apply (subst of_real_hom.map_poly_pcompose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real [:1 - 1 / x, 1:] \<circ>\<^sub>p map_poly complex_of_real [:- 1, 1:]) {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01}
[PROOF STEP]
apply (subst proots_pcompose, fastforce, force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real [:1 - 1 / x, 1:]) (poly (map_poly complex_of_real [:- 1, 1:]) ` {x. inverse x \<in> upper_circle_01 \<union> lower_circle_01})
[PROOF STEP]
apply (subst lower_circle_map[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real [:1 - 1 / x, 1:]) (poly (map_poly complex_of_real [:- 1, 1:]) ` {x. inverse x \<in> upper_circle_01 \<union> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. - sqrt 3 * Re x < Im x}}})
[PROOF STEP]
apply (subst upper_circle_map[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < proots_count (map_poly complex_of_real [:1 - 1 / x, 1:]) (poly (map_poly complex_of_real [:- 1, 1:]) ` {x. inverse x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<union> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. - sqrt 3 * Re x < Im x}}})
[PROOF STEP]
apply (rule proots_count_of_root[of _ "of_real (1/x - 1)"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. map_poly complex_of_real [:1 - 1 / x, 1:] \<noteq> 0
 2. complex_of_real (1 / x - 1) \<in> poly (map_poly complex_of_real [:- 1, 1:]) ` {x. inverse x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<union> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. - sqrt 3 * Re x < Im x}}}
 3. poly (map_poly complex_of_real [:1 - 1 / x, 1:]) (complex_of_real (1 / x - 1)) = 0
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. complex_of_real (1 / x - 1) \<in> poly (map_poly complex_of_real [:- 1, 1:]) ` {x. inverse x \<in> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. Im x < sqrt 3 * Re x}} \<union> {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. - sqrt 3 * Re x < Im x}}}
 2. poly (map_poly complex_of_real [:1 - 1 / x, 1:]) (complex_of_real (1 / x - 1)) = 0
[PROOF STEP]
apply (auto simp: bij_image_Collect_eq bij_def inj_def image_iff
                    inverse_eq_divide inj_imp_inv_eq[of _ "\<lambda> x. x+1"] hx)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (map_poly complex_of_real [:1 - 1 / x, 1:]) (complex_of_real (1 / x - 1)) = 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0 < proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
0 < proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
have "proots_count
                 (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:])))
                 (upper_circle_01 \<union> lower_circle_01) +
            proots_count
             (map_poly complex_of_real
               (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:])))
             (upper_circle_01 \<union> lower_circle_01) > 1"
[PROOF STATE]
proof (prove)
using this:
0 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
0 < proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. 1 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
1 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "... = proots_count (map_poly complex_of_real
                   (monom 1 p * reciprocal_poly p (?Q \<circ>\<^sub>p [:- 1, 1:])))
           (upper_circle_01 \<union> lower_circle_01)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst eq_commute, subst hR, subst pcompose_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:] * [:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst reciprocal_mult, subst degree_mult_eq)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. R \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
 2. [:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
 3. degree (R \<circ>\<^sub>p [:- 1, 1:]) + degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 4. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 5. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 6. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hR0
[PROOF STATE]
proof (prove)
using this:
R \<noteq> 0

goal (6 subgoals):
 1. R \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
 2. [:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
 3. degree (R \<circ>\<^sub>p [:- 1, 1:]) + degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 4. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 5. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 6. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (fastforce simp: pcompose_eq_0)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. [:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:] \<noteq> 0
 2. degree (R \<circ>\<^sub>p [:- 1, 1:]) + degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 3. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 4. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 5. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (fastforce simp: pcompose_pCons)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) + degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 3. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 4. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hRdeg'
[PROOF STATE]
proof (prove)
using this:
degree R < p

goal (4 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) + degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 3. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 4. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (simp add: degree_pcompose)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 3. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hRdeg
[PROOF STATE]
proof (prove)
using this:
degree R \<le> p

goal (3 subgoals):
 1. degree (R \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 3. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (simp add: degree_pcompose)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hp0
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (2 subgoals):
 1. degree ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]) \<le> p
 2. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (auto simp: degree_pcompose)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]) * reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst hom_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:])) * map_poly complex_of_real (reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst proots_count_times)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:])) * map_poly complex_of_real (reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:])) \<noteq> 0
 2. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hp0 hRdeg' hR0
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree R < p
R \<noteq> 0

goal (2 subgoals):
 1. map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:])) * map_poly complex_of_real (reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:])) \<noteq> 0
 2. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (fastforce simp: reciprocal_0_iff degree_pcompose pcompose_eq_0
                 pcompose_pCons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:- (1 / x - 1), 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (reciprocal_poly p (R \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p ([:1 - 1 / x, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "... = proots_count
           (map_poly complex_of_real
             (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:])))
           (upper_circle_01 \<union> lower_circle_01)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst hom_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (monom 1 p) * map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst proots_count_times)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map_poly complex_of_real (monom 1 p) * map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:])) \<noteq> 0
 2. proots_count (map_poly complex_of_real (monom 1 p)) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
using hp0 hP hP0
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
degree P \<le> p
P \<noteq> 0

goal (2 subgoals):
 1. map_poly complex_of_real (monom 1 p) * map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:])) \<noteq> 0
 2. proots_count (map_poly complex_of_real (monom 1 p)) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (auto simp: map_poly_reciprocal degree_pcompose
                  degree_reciprocal of_real_hom.map_poly_pcompose
                  reciprocal_0_iff degree_map_poly pcompose_eq_0)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (monom 1 p)) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst map_poly_monom, fastforce)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (monom (complex_of_real 1) p) (upper_circle_01 \<union> lower_circle_01) + proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (subst of_real_1, subst proots_count_monom)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<notin> upper_circle_01 \<union> lower_circle_01
 2. 0 + proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
apply (auto simp: cmod_def power2_eq_square real_sqrt_divide
                  real_div_sqrt upper_circle_01_def lower_circle_01_def)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 + proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (monom 1 p * reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01)

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = 1
[PROOF STEP]
by (auto simp: pcompose_assoc["symmetric"] pcompose_pCons
              reciprocal_reciprocal hP h)
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (reciprocal_poly p (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<circ>\<^sub>p [:- 1, 1:]))) (upper_circle_01 \<union> lower_circle_01) = 1

goal (1 subgoal):
 1. \<not> (Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
1 < 1

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re z \<le> 0 \<and> (cmod z)\<^sup>2 \<le> 4 * (Re z)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)) ?z = 0 \<Longrightarrow> Re ?z \<le> 0 \<and> (cmod ?z)\<^sup>2 \<le> 4 * (Re ?z)\<^sup>2

goal (1 subgoal):
 1. monic (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)
[PROOF STEP]
show "lead_coeff
         (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)
[PROOF STEP]
by (auto simp: hR degree_add_eq_right hR0 coeff_eq_0)
[PROOF STATE]
proof (state)
this:
monic (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
normal_poly (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
hence "changes (coeffs (smult (inverse (lead_coeff ?Q)) ?Q)) = 1"
[PROOF STATE]
proof (prove)
using this:
normal_poly (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)

goal (1 subgoal):
 1. changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) = 1
[PROOF STEP]
apply (subst hR, subst mult_smult_left[symmetric], rule normal_changes)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>normal_poly (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R); normal_poly (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) R)\<rbrakk> \<Longrightarrow> 0 < 1 / x - 1
[PROOF STEP]
by (auto simp: hx)
[PROOF STATE]
proof (state)
this:
changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) = 1

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) = 1

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
have "changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) =
      changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))
        (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))
[PROOF STEP]
by (auto simp: pcompose_eq_0 reciprocal_0_iff hP hP0 coeffs_smult
        changes_scale_const[symmetric])
[PROOF STATE]
proof (state)
this:
changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) = 1
changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))
[PROOF STEP]
show "changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1"
[PROOF STATE]
proof (prove)
using this:
changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) = 1
changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = changes (coeffs (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma negligible_translation:
  assumes "negligible S"
    shows "negligible ((+) c ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible ((+) c ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. negligible ((+) c ` S)
[PROOF STEP]
have inj: "inj ((+) c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj ((+) c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inj ((+) c)

goal (1 subgoal):
 1. negligible ((+) c ` S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible ((+) c ` S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
negligible S

goal (1 subgoal):
 1. negligible ((+) c ` S)
[PROOF STEP]
proof (clarsimp simp: negligible_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<forall>a b. (indicat_real S has_integral 0) (cbox a b) \<Longrightarrow> (indicat_real ((+) c ` S) has_integral 0) (cbox a b)
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<forall>a b. (indicat_real S has_integral 0) (cbox a b) \<Longrightarrow> (indicat_real ((+) c ` S) has_integral 0) (cbox a b)
[PROOF STEP]
assume "\<forall>x y. (indicator S has_integral 0) (cbox x y)"
[PROOF STATE]
proof (state)
this:
\<forall>x y. (indicator S has_integral (0::'b)) (cbox x y)

goal (1 subgoal):
 1. \<And>a b. \<forall>a b. (indicat_real S has_integral 0) (cbox a b) \<Longrightarrow> (indicat_real ((+) c ` S) has_integral 0) (cbox a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. (indicator S has_integral (0::'b)) (cbox x y)
[PROOF STEP]
have *: "(indicator S has_integral 0) (cbox (a-c) (b-c))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. (indicator S has_integral (0::'b)) (cbox x y)

goal (1 subgoal):
 1. (indicator S has_integral (0::'c)) (cbox (a - c) (b - c))
[PROOF STEP]
by (meson Diff_iff assms has_integral_negligible indicator_simps(2))
[PROOF STATE]
proof (state)
this:
(indicator S has_integral (0::?'c2)) (cbox (a - c) (b - c))

goal (1 subgoal):
 1. \<And>a b. \<forall>a b. (indicat_real S has_integral 0) (cbox a b) \<Longrightarrow> (indicat_real ((+) c ` S) has_integral 0) (cbox a b)
[PROOF STEP]
have eq: "indicator ((+) c ` S) = (\<lambda>x. indicator S (x - c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator ((+) c ` S) = (\<lambda>x. indicator S (x - c))
[PROOF STEP]
by (force simp add: indicator_def)
[PROOF STATE]
proof (state)
this:
indicator ((+) c ` S) = (\<lambda>x. indicator S (x - c))

goal (1 subgoal):
 1. \<And>a b. \<forall>a b. (indicat_real S has_integral 0) (cbox a b) \<Longrightarrow> (indicat_real ((+) c ` S) has_integral 0) (cbox a b)
[PROOF STEP]
show "(indicator ((+) c ` S) has_integral 0) (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (indicator ((+) c ` S) has_integral (0::'c)) (cbox a b)
[PROOF STEP]
using has_integral_affinity [OF *, of 1 "-c"]
            cbox_translation [of "c" "-c+a" "-c+b"]
[PROOF STATE]
proof (prove)
using this:
1 \<noteq> 0 \<Longrightarrow> ((\<lambda>x. indicator S (1 *\<^sub>R x + - c)) has_integral (1 / \<bar>1\<bar> ^ DIM('a)) *\<^sub>R (0::?'c3)) ((\<lambda>x. (1 / 1) *\<^sub>R x + - ((1 / 1) *\<^sub>R - c)) ` cbox (a - c) (b - c))
cbox (c + (- c + a)) (c + (- c + b)) = (+) c ` cbox (- c + a) (- c + b)

goal (1 subgoal):
 1. (indicator ((+) c ` S) has_integral (0::'c)) (cbox a b)
[PROOF STEP]
by (simp add: eq) (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
(indicator ((+) c ` S) has_integral (0::?'c4)) (cbox a b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
negligible ((+) c ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Interleaves_equal_fst:
 "xs \<cong> {ys, zs, P} \<Longrightarrow> xs \<cong> {ys', zs, P} \<Longrightarrow> ys = ys'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<cong> {ys, zs, P}; xs \<cong> {ys', zs, P}\<rbrakk> \<Longrightarrow> ys = ys'
[PROOF STEP]
by ((drule Interleaves_interleaves)+, rule interleaves_equal_fst)


[STATEMENT]
lemma strictly_subsumes_antisym: "strictly_subsumes C D \<Longrightarrow> \<not> strictly_subsumes D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strictly_subsumes C D \<Longrightarrow> \<not> strictly_subsumes D C
[PROOF STEP]
unfolding strictly_subsumes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subsumes C D \<and> \<not> subsumes D C \<Longrightarrow> \<not> (subsumes D C \<and> \<not> subsumes C D)
[PROOF STEP]
by blast


[STATEMENT]
lemma downset_onI:
  "(\<And>x y. (x, y) \<in> r \<Longrightarrow> y \<in> A \<Longrightarrow> x \<in> A) \<Longrightarrow> downset_on A r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>(x, y) \<in> r; y \<in> A\<rbrakk> \<Longrightarrow> x \<in> A) \<Longrightarrow> downset_on A r
[PROOF STEP]
by (auto simp: downset_on_def)


[STATEMENT]
lemma (in comm_group) finprod_exp:
  assumes "A \<subseteq> carrier G" "f \<in> A \<rightarrow> carrier G"
  shows "(finprod G f A) [^] (k::int) = finprod G ((\<lambda>a. a [^] k) \<circ> f) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier G
f \<in> A \<rightarrow> carrier G

goal (1 subgoal):
 1. finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
[PROOF STEP]
proof(induction A rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
case i: (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F
insert x F \<subseteq> carrier G
f \<in> insert x F \<rightarrow> carrier G

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
hence ih: "finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F"
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F
insert x F \<subseteq> carrier G
f \<in> insert x F \<rightarrow> carrier G

goal (1 subgoal):
 1. finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
have fpc: "finprod G f F \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f F \<in> carrier G
[PROOF STEP]
by (intro finprod_closed, use i in auto)
[PROOF STATE]
proof (state)
this:
finprod G f F \<in> carrier G

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
have fxc: "f x \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<in> carrier G
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F
insert x F \<subseteq> carrier G
f \<in> insert x F \<rightarrow> carrier G

goal (1 subgoal):
 1. f x \<in> carrier G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<in> carrier G

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
have "finprod G f (insert x F) = f x \<otimes> finprod G f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finprod G f (insert x F) = f x \<otimes> finprod G f F
[PROOF STEP]
by (intro finprod_insert, use i in auto)
[PROOF STATE]
proof (state)
this:
finprod G f (insert x F) = f x \<otimes> finprod G f F

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
hence "finprod G f (insert x F) [^] k = (f x \<otimes> finprod G f F) [^] k"
[PROOF STATE]
proof (prove)
using this:
finprod G f (insert x F) = f x \<otimes> finprod G f F

goal (1 subgoal):
 1. finprod G f (insert x F) [^] k = (f x \<otimes> finprod G f F) [^] k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finprod G f (insert x F) [^] k = (f x \<otimes> finprod G f F) [^] k

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
finprod G f (insert x F) [^] k = (f x \<otimes> finprod G f F) [^] k

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
have "\<dots> = f x [^] k \<otimes> finprod G f F [^] k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x \<otimes> finprod G f F) [^] k = f x [^] k \<otimes> finprod G f F [^] k
[PROOF STEP]
using fpc fxc int_pow_distrib
[PROOF STATE]
proof (prove)
using this:
finprod G f F \<in> carrier G
f x \<in> carrier G
\<lbrakk>?x \<in> carrier G; ?y \<in> carrier G\<rbrakk> \<Longrightarrow> (?x \<otimes> ?y) [^] ?i = ?x [^] ?i \<otimes> ?y [^] ?i

goal (1 subgoal):
 1. (f x \<otimes> finprod G f F) [^] k = f x [^] k \<otimes> finprod G f F [^] k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(f x \<otimes> finprod G f F) [^] k = f x [^] k \<otimes> finprod G f F [^] k

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f x \<otimes> finprod G f F) [^] k = f x [^] k \<otimes> finprod G f F [^] k

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
have "\<dots> = ((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x [^] k \<otimes> finprod G f F [^] k = ((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F
[PROOF STEP]
using ih
[PROOF STATE]
proof (prove)
using this:
finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F

goal (1 subgoal):
 1. f x [^] k \<otimes> finprod G f F [^] k = ((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x [^] k \<otimes> finprod G f F [^] k = ((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x [^] k \<otimes> finprod G f F [^] k = ((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
have "\<dots> = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
by (intro finprod_insert[symmetric], use i in auto)
[PROOF STATE]
proof (state)
this:
((\<lambda>a. a [^] k) \<circ> f) x \<otimes> finprod G ((\<lambda>a. a [^] k) \<circ> f) F = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)

goal (3 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>F \<subseteq> carrier G; f \<in> F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f F [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) F; insert x F \<subseteq> carrier G; f \<in> insert x F \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)

goal (1 subgoal):
 1. finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finprod G f (insert x F) [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) (insert x F)

goal (2 subgoals):
 1. \<And>A. \<lbrakk>infinite A; A \<subseteq> carrier G; f \<in> A \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f A [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) A
 2. \<lbrakk>{} \<subseteq> carrier G; f \<in> {} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {} [^] k = finprod G ((\<lambda>a. a [^] k) \<circ> f) {}
[PROOF STEP]
qed auto


[STATEMENT]
lemma consistent_signs_prop_R:
  fixes p:: "real poly"
  assumes nonzero: "p\<noteq>0"
  fixes qs:: "real poly list"
  fixes sign:: "rat list"
  fixes x:: "real"
  assumes root_p: "x \<in> {x. poly p x = 0}"
  assumes sign_fix: "sign = consistent_sign_vec qs x"
  shows  "list_all (\<lambda>s. s = 1 \<or> s = 0 \<or> s = -1) sign"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>s. s = 1 \<or> s = 0 \<or> s = - 1) sign
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
x \<in> {x. poly p x = 0}
sign = consistent_sign_vec qs x

goal (1 subgoal):
 1. list_all (\<lambda>s. s = 1 \<or> s = 0 \<or> s = - 1) sign
[PROOF STEP]
unfolding consistent_sign_vec_def squash_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
x \<in> {x. poly p x = 0}
sign = map (\<lambda>q. if 0 < poly q x then 1 else if poly q x = 0 then 0 else - 1) qs

goal (1 subgoal):
 1. list_all (\<lambda>s. s = 1 \<or> s = 0 \<or> s = - 1) sign
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<noteq> 0; poly p x = 0; sign = map (\<lambda>q. if 0 < poly q x then 1 else if poly q x = 0 then 0 else - 1) qs\<rbrakk> \<Longrightarrow> list_all (\<lambda>s. s = 1 \<or> s = 0 \<or> s = - 1) (map (\<lambda>q. if 0 < poly q x then 1 else if poly q x = 0 then 0 else - 1) qs)
[PROOF STEP]
by (smt (z3) length_map list_all_length nth_map)


[STATEMENT]
lemma keys_mult_scalar_monomial_right_subset: "keys (p \<odot> monomial c v) \<subseteq> (\<lambda>t. t \<oplus> v) ` keys p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (p \<odot> monomial c v) \<subseteq> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> keys (p \<odot> monomial c v) \<Longrightarrow> x \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> keys (p \<odot> monomial c v) \<Longrightarrow> x \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
assume "u \<in> keys (p \<odot> monomial c v)"
[PROOF STATE]
proof (state)
this:
u \<in> keys (p \<odot> monomial c v)

goal (1 subgoal):
 1. \<And>x. x \<in> keys (p \<odot> monomial c v) \<Longrightarrow> x \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u \<in> keys (p \<odot> monomial c v)
[PROOF STEP]
obtain t w where "t \<in> keys p" and "w \<in> keys (monomial c v)" and "u = t \<oplus> w"
[PROOF STATE]
proof (prove)
using this:
u \<in> keys (p \<odot> monomial c v)

goal (1 subgoal):
 1. (\<And>t w. \<lbrakk>t \<in> keys p; w \<in> keys (monomial c v); u = t \<oplus> w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule in_keys_mult_scalarE)
[PROOF STATE]
proof (state)
this:
t \<in> keys p
w \<in> keys (monomial c v)
u = t \<oplus> w

goal (1 subgoal):
 1. \<And>x. x \<in> keys (p \<odot> monomial c v) \<Longrightarrow> x \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
w \<in> keys (monomial c v)
[PROOF STEP]
have "w = v"
[PROOF STATE]
proof (prove)
using this:
w \<in> keys (monomial c v)

goal (1 subgoal):
 1. w = v
[PROOF STEP]
by (metis empty_iff insert_iff keys_single)
[PROOF STATE]
proof (state)
this:
w = v

goal (1 subgoal):
 1. \<And>x. x \<in> keys (p \<odot> monomial c v) \<Longrightarrow> x \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
from \<open>t \<in> keys p\<close>
[PROOF STATE]
proof (chain)
picking this:
t \<in> keys p
[PROOF STEP]
show "u \<in> (\<lambda>t. t \<oplus> v) ` keys p"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p

goal (1 subgoal):
 1. u \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
unfolding \<open>u = t \<oplus> w\<close> \<open>w = v\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p

goal (1 subgoal):
 1. t \<oplus> v \<in> (\<lambda>t. t \<oplus> v) ` keys p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
u \<in> (\<lambda>t. t \<oplus> v) ` keys p

goal:
No subgoals!
[PROOF STEP]
qed