[STATEMENT]
lemma DERIV_arctan_series:
  assumes "\<bar>x\<bar> < 1"
  shows "DERIV (\<lambda>x'. \<Sum>k. (-1)^k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) x :>
      (\<Sum>k. (-1)^k * x^(k * 2))"
    (is "DERIV ?arctan _ :> ?Int")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
let ?f = "\<lambda>n. if even n then (-1)^(n div 2) * 1 / real (Suc n) else 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
have n_even: "even n \<Longrightarrow> 2 * (n div 2) = n" for n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even n \<Longrightarrow> 2 * (n div 2) = n
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
even ?n \<Longrightarrow> 2 * (?n div 2) = ?n

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even ?n \<Longrightarrow> 2 * (?n div 2) = ?n
[PROOF STEP]
have if_eq: "?f n * real (Suc n) * x'^n =
      (if even n then (-1)^(n div 2) * x'^(2 * (n div 2)) else 0)"
    for n x'
[PROOF STATE]
proof (prove)
using this:
even ?n \<Longrightarrow> 2 * (?n div 2) = ?n

goal (1 subgoal):
 1. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n = (if even n then (- 1) ^ (n div 2) * x' ^ (2 * (n div 2)) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if even ?n then (- 1) ^ (?n div 2) * 1 / real (Suc ?n) else 0) * real (Suc ?n) * ?x' ^ ?n = (if even ?n then (- 1) ^ (?n div 2) * ?x' ^ (2 * (?n div 2)) else 0)

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
have summable_Integral: "summable (\<lambda> n. (- 1) ^ n * x^(2 * n))" if "\<bar>x\<bar> < 1" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * x ^ (2 * n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * x ^ (2 * n))
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> < 1
[PROOF STEP]
have "x\<^sup>2 < 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < 1

goal (1 subgoal):
 1. x\<^sup>2 < 1
[PROOF STEP]
by (simp add: abs_square_less_1)
[PROOF STATE]
proof (state)
this:
x\<^sup>2 < 1

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * x ^ (2 * n))
[PROOF STEP]
have "summable (\<lambda> n. (- 1) ^ n * (x\<^sup>2) ^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * x\<^sup>2 ^ n)
[PROOF STEP]
by (rule summable_Leibniz(1))
        (auto intro!: LIMSEQ_realpow_zero monoseq_realpow \<open>x\<^sup>2 < 1\<close> order_less_imp_le[OF \<open>x\<^sup>2 < 1\<close>])
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * x\<^sup>2 ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * x ^ (2 * n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. (- 1) ^ n * x\<^sup>2 ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (- 1) ^ n * x\<^sup>2 ^ n)

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ n * x ^ (2 * n))
[PROOF STEP]
by (simp only: power_mult)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ n * x ^ (2 * n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>?x\<bar> < 1 \<Longrightarrow> summable (\<lambda>n. (- 1) ^ n * ?x ^ (2 * n))

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
have sums_even: "(sums) f = (sums) (\<lambda> n. if even n then f (n div 2) else 0)"
    for f :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sums) f = (sums) (\<lambda>n. if even n then f (n div 2) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (sums) f = (sums) (\<lambda>n. if even n then f (n div 2) else 0)
[PROOF STEP]
have "f sums x = (\<lambda> n. if even n then f (n div 2) else 0) sums x" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums x = (\<lambda>n. if even n then f (n div 2) else 0) sums x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f sums x \<Longrightarrow> (\<lambda>n. if even n then f (n div 2) else 0) sums x
 2. (\<lambda>n. if even n then f (n div 2) else 0) sums x \<Longrightarrow> f sums x
[PROOF STEP]
assume "f sums x"
[PROOF STATE]
proof (state)
this:
f sums x

goal (2 subgoals):
 1. f sums x \<Longrightarrow> (\<lambda>n. if even n then f (n div 2) else 0) sums x
 2. (\<lambda>n. if even n then f (n div 2) else 0) sums x \<Longrightarrow> f sums x
[PROOF STEP]
from sums_if[OF sums_zero this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. if even n then f (n div 2) else 0) sums (0 + x)
[PROOF STEP]
show "(\<lambda>n. if even n then f (n div 2) else 0) sums x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. if even n then f (n div 2) else 0) sums (0 + x)

goal (1 subgoal):
 1. (\<lambda>n. if even n then f (n div 2) else 0) sums x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if even n then f (n div 2) else 0) sums x

goal (1 subgoal):
 1. (\<lambda>n. if even n then f (n div 2) else 0) sums x \<Longrightarrow> f sums x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. if even n then f (n div 2) else 0) sums x \<Longrightarrow> f sums x
[PROOF STEP]
assume "(\<lambda> n. if even n then f (n div 2) else 0) sums x"
[PROOF STATE]
proof (state)
this:
(\<lambda>n. if even n then f (n div 2) else 0) sums x

goal (1 subgoal):
 1. (\<lambda>n. if even n then f (n div 2) else 0) sums x \<Longrightarrow> f sums x
[PROOF STEP]
from LIMSEQ_linear[OF this[simplified sums_def] pos2, simplified sum_split_even_odd[simplified mult.commute]]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i<n. f (i * 2 div 2)) + (\<Sum>i<n. 0)) \<longlonglongrightarrow> x
[PROOF STEP]
show "f sums x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i<n. f (i * 2 div 2)) + (\<Sum>i<n. 0)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. f sums x
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i<n. f (i * 2 div 2)) + (\<Sum>i<n. 0)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. (\<lambda>n. sum f {..<n}) \<longlonglongrightarrow> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f sums x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f sums ?x = (\<lambda>n. if even n then f (n div 2) else 0) sums ?x

goal (1 subgoal):
 1. (sums) f = (sums) (\<lambda>n. if even n then f (n div 2) else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f sums ?x = (\<lambda>n. if even n then f (n div 2) else 0) sums ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f sums ?x = (\<lambda>n. if even n then f (n div 2) else 0) sums ?x

goal (1 subgoal):
 1. (sums) f = (sums) (\<lambda>n. if even n then f (n div 2) else 0)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(sums) f = (sums) (\<lambda>n. if even n then f (n div 2) else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(sums) ?f = (sums) (\<lambda>n. if even n then ?f (n div 2) else 0)

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
have Int_eq: "(\<Sum>n. ?f n * real (Suc n) * x^n) = ?Int"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n) = (\<Sum>k. (- 1) ^ k * x ^ (k * 2))
[PROOF STEP]
unfolding if_eq mult.commute[of _ 2]
      suminf_def sums_even[of "\<lambda> n. (- 1) ^ n * x ^ (2 * n)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. The ((sums) (\<lambda>n. (- 1) ^ n * x ^ (2 * n))) = The ((sums) (\<lambda>k. (- 1) ^ k * x ^ (2 * k)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n) = (\<Sum>k. (- 1) ^ k * x ^ (k * 2))

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
have arctan_eq: "(\<Sum>n. ?f n * x^(Suc n)) = ?arctan x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x ^ (k * 2 + 1)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x ^ (k * 2 + 1)))
[PROOF STEP]
have if_eq': "\<And>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n =
      (if even n then (- 1) ^ (n div 2) * (1 / real (Suc (2 * (n div 2))) * x ^ Suc (2 * (n div 2))) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n = (if even n then (- 1) ^ (n div 2) * (1 / real (Suc (2 * (n div 2))) * x ^ Suc (2 * (n div 2))) else 0)
[PROOF STEP]
using n_even
[PROOF STATE]
proof (prove)
using this:
even ?n \<Longrightarrow> 2 * (?n div 2) = ?n

goal (1 subgoal):
 1. \<And>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n = (if even n then (- 1) ^ (n div 2) * (1 / real (Suc (2 * (n div 2))) * x ^ Suc (2 * (n div 2))) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if even ?n then (- 1) ^ (?n div 2) * 1 / real (Suc ?n) else 0) * x ^ Suc ?n = (if even ?n then (- 1) ^ (?n div 2) * (1 / real (Suc (2 * (?n div 2))) * x ^ Suc (2 * (?n div 2))) else 0)

goal (1 subgoal):
 1. (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x ^ (k * 2 + 1)))
[PROOF STEP]
have idx_eq: "\<And>n. n * 2 + 1 = Suc (2 * n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n * 2 + 1 = Suc (2 * n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?n * 2 + 1 = Suc (2 * ?n)

goal (1 subgoal):
 1. (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x ^ (k * 2 + 1)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?n * 2 + 1 = Suc (2 * ?n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?n * 2 + 1 = Suc (2 * ?n)

goal (1 subgoal):
 1. (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x ^ (k * 2 + 1)))
[PROOF STEP]
unfolding if_eq' idx_eq suminf_def
        sums_even[of "\<lambda> n. (- 1) ^ n * (1 / real (Suc (2 * n)) * x ^ Suc (2 * n))", symmetric]
[PROOF STATE]
proof (prove)
using this:
Suc (2 * ?n) = Suc (2 * ?n)

goal (1 subgoal):
 1. The ((sums) (\<lambda>n. (- 1) ^ n * (1 / real (Suc (2 * n)) * x ^ Suc (2 * n)))) = The ((sums) (\<lambda>k. (- 1) ^ k * (1 / real (Suc (2 * k)) * x ^ Suc (2 * k))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x ^ (k * 2 + 1)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * ?x ^ Suc n) = (\<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * ?x ^ (k * 2 + 1)))

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
have "DERIV (\<lambda> x. \<Sum> n. ?f n * x^(Suc n)) x :> (\<Sum>n. ?f n * real (Suc n) * x^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) has_real_derivative (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n)) (at x)
[PROOF STEP]
proof (rule DERIV_power_series')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {- ?R<..<?R} \<Longrightarrow> summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n)
 2. x \<in> {- ?R<..<?R}
 3. 0 < ?R
[PROOF STEP]
show "x \<in> {- 1 <..< 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {- 1<..<1}
[PROOF STEP]
using \<open>\<bar> x \<bar> < 1\<close>
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < 1

goal (1 subgoal):
 1. x \<in> {- 1<..<1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {- 1<..<1}

goal (2 subgoals):
 1. \<And>x. x \<in> {- 1<..<1} \<Longrightarrow> summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n)
 2. 0 < 1
[PROOF STEP]
show "summable (\<lambda> n. ?f n * real (Suc n) * x'^n)"
      if x'_bounds: "x' \<in> {- 1 <..< 1}" for x' :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
x' \<in> {- 1<..<1}
[PROOF STEP]
have "\<bar>x'\<bar> < 1"
[PROOF STATE]
proof (prove)
using this:
x' \<in> {- 1<..<1}

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

goal (1 subgoal):
 1. summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>x'\<bar> < 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>x'\<bar> < 1

goal (1 subgoal):
 1. summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n)
[PROOF STEP]
using that sums_summable sums_if [OF sums_0 [of "\<lambda>x. 0"] summable_sums [OF summable_Integral]]
[PROOF STATE]
proof (prove)
using this:
\<bar>x'\<bar> < 1
x' \<in> {- 1<..<1}
?f sums ?l \<Longrightarrow> summable ?f
\<lbrakk>\<And>n. 0 = 0; \<bar>?x2\<bar> < 1\<rbrakk> \<Longrightarrow> (\<lambda>n. if even n then (- 1) ^ (n div 2) * ?x2 ^ (2 * (n div 2)) else 0) sums (0 + (\<Sum>n. (- 1) ^ n * ?x2 ^ (2 * n)))

goal (1 subgoal):
 1. summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n)
[PROOF STEP]
by (auto simp add: if_distrib [of "\<lambda>x. x * y" for y] cong: if_cong)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x' ^ n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x' \<in> {- 1<..<1} \<Longrightarrow> summable (\<lambda>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * ?x' ^ n)

goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) has_real_derivative (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n)) (at x)

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) has_real_derivative (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n)) (at x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * x ^ Suc n) has_real_derivative (\<Sum>n. (if even n then (- 1) ^ (n div 2) * 1 / real (Suc n) else 0) * real (Suc n) * x ^ n)) (at x)

goal (1 subgoal):
 1. ((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)
[PROOF STEP]
by (simp only: Int_eq arctan_eq)
[PROOF STATE]
proof (state)
this:
((\<lambda>x'. \<Sum>k. (- 1) ^ k * (1 / real (k * 2 + 1) * x' ^ (k * 2 + 1))) has_real_derivative (\<Sum>k. (- 1) ^ k * x ^ (k * 2))) (at x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vsubset_vtimes_vbrelation:
  assumes "r \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<circ> B"
  shows "vbrelation r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vbrelation r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
r \<subseteq>\<^sub>\<circ> A \<times>\<^sub>\<circ> B

goal (1 subgoal):
 1. vbrelation r
[PROOF STEP]
by auto


[STATEMENT]
lemma setdist_le_sing: "x \<in> S ==> setdist S T \<le> setdist {x} T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S \<Longrightarrow> setdist S T \<le> setdist {x} T
[PROOF STEP]
using setdist_subset_left
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?S \<noteq> {}; ?S \<subseteq> ?T\<rbrakk> \<Longrightarrow> setdist ?T ?u \<le> setdist ?S ?u

goal (1 subgoal):
 1. x \<in> S \<Longrightarrow> setdist S T \<le> setdist {x} T
[PROOF STEP]
by auto


[STATEMENT]
lemma r_match_alt:
  "r_match L l \<longleftrightarrow> length L = length l \<and> (\<forall>i<length l. l!i \<in> L!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_match L l = (length L = length l \<and> (\<forall>i<length l. l ! i \<in> L ! i))
[PROOF STEP]
apply (induct L l rule: r_match.induct)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. r_match [] [] = (length [] = length [] \<and> (\<forall>i<length []. [] ! i \<in> [] ! i))
 2. \<And>A AS a as. r_match AS as = (length AS = length as \<and> (\<forall>i<length as. as ! i \<in> AS ! i)) \<Longrightarrow> r_match (A # AS) (a # as) = (length (A # AS) = length (a # as) \<and> (\<forall>i<length (a # as). (a # as) ! i \<in> (A # AS) ! i))
 3. \<And>v va. r_match (v # va) [] = (length (v # va) = length [] \<and> (\<forall>i<length []. [] ! i \<in> (v # va) ! i))
 4. \<And>v va. r_match [] (v # va) = (length [] = length (v # va) \<and> (\<forall>i<length (v # va). (v # va) ! i \<in> [] ! i))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A AS a as i. \<lbrakk>r_match AS as; a \<in> A; length AS = length as; \<forall>i<length as. as ! i \<in> AS ! i; i < Suc (length as)\<rbrakk> \<Longrightarrow> (a # as) ! i \<in> (A # AS) ! i
[PROOF STEP]
apply (case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A AS a as i. \<lbrakk>r_match AS as; a \<in> A; length AS = length as; \<forall>i<length as. as ! i \<in> AS ! i; i < Suc (length as); i = 0\<rbrakk> \<Longrightarrow> (a # as) ! i \<in> (A # AS) ! i
 2. \<And>A AS a as i nat. \<lbrakk>r_match AS as; a \<in> A; length AS = length as; \<forall>i<length as. as ! i \<in> AS ! i; i < Suc (length as); i = Suc nat\<rbrakk> \<Longrightarrow> (a # as) ! i \<in> (A # AS) ! i
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done

\<comment> \<open>Whether a rule matches the given state, label and list of sets of states\<close>


[STATEMENT]
lemma queue_invar_simps[simp]:
  "queue_invar []"
  "queue_invar (t#q) \<longleftrightarrow> tree_invar t \<and> queue_invar q"
  "queue_invar (q@q') \<longleftrightarrow> queue_invar q \<and> queue_invar q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_invar [] &&& queue_invar (t # q) = (tree_invar t \<and> queue_invar q) &&& queue_invar (q @ q') = (queue_invar q \<and> queue_invar q')
[PROOF STEP]
unfolding queue_invar_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>set []. tree_invar t &&& (\<forall>t\<in>set (t # q). tree_invar t) = (tree_invar t \<and> (\<forall>t\<in>set q. tree_invar t)) &&& (\<forall>t\<in>set (q @ q'). tree_invar t) = ((\<forall>t\<in>set q. tree_invar t) \<and> (\<forall>t\<in>set q'. tree_invar t))
[PROOF STEP]
by auto


[STATEMENT]
lemma flow_has_vector_derivative_at_0:
  assumes"t \<in> existence_ivl t0 x0"
  shows "((\<lambda>h. flow t0 x0 (t + h)) has_vector_derivative f t (flow t0 x0 t)) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>h. flow t0 x0 (t + h)) has_vector_derivative f t (flow t0 x0 t)) (at 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>h. flow t0 x0 (t + h)) has_vector_derivative f t (flow t0 x0 t)) (at 0)
[PROOF STEP]
from flow_has_vector_derivative[OF assms]
[PROOF STATE]
proof (chain)
picking this:
(flow t0 x0 has_vector_derivative f t (flow t0 x0 t)) (at t)
[PROOF STEP]
have
    "((+) t has_vector_derivative 1) (at 0)"
    "(flow t0 x0 has_vector_derivative f t (flow t0 x0 t)) (at (t + 0))"
[PROOF STATE]
proof (prove)
using this:
(flow t0 x0 has_vector_derivative f t (flow t0 x0 t)) (at t)

goal (1 subgoal):
 1. ((+) t has_vector_derivative 1) (at 0) &&& (flow t0 x0 has_vector_derivative f t (flow t0 x0 t)) (at (t + 0))
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((+) t has_vector_derivative 1) (at 0)
(flow t0 x0 has_vector_derivative f t (flow t0 x0 t)) (at (t + 0))

goal (1 subgoal):
 1. ((\<lambda>h. flow t0 x0 (t + h)) has_vector_derivative f t (flow t0 x0 t)) (at 0)
[PROOF STEP]
from vector_diff_chain_at[OF this]
[PROOF STATE]
proof (chain)
picking this:
(flow t0 x0 \<circ> (+) t has_vector_derivative 1 *\<^sub>R f t (flow t0 x0 t)) (at 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(flow t0 x0 \<circ> (+) t has_vector_derivative 1 *\<^sub>R f t (flow t0 x0 t)) (at 0)

goal (1 subgoal):
 1. ((\<lambda>h. flow t0 x0 (t + h)) has_vector_derivative f t (flow t0 x0 t)) (at 0)
[PROOF STEP]
by (simp add: o_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>h. flow t0 x0 (t + h)) has_vector_derivative f t (flow t0 x0 t)) (at 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_circle_01: fixes P::"real poly" assumes hP: "degree P \<le> p" and "P \<noteq> 0"
  and "proots_count (map_poly of_real P) circle_01_diam = 0"
shows "Bernstein_changes_01 p P = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
let ?Q = "(reciprocal_poly p P) \<circ>\<^sub>p [:1, 1:]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
have hQ: "?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 assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

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

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
hence 1: "changes (coeffs ?Q) \<ge> proots_count ?Q {x. 0 < x} \<and>
        even (changes (coeffs ?Q) - proots_count ?Q {x. 0 < x})"
[PROOF STATE]
proof (prove)
using this:
reciprocal_poly p P \<circ>\<^sub>p [:1, 1:] \<noteq> 0

goal (1 subgoal):
 1. int (proots_count (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) {x. 0 < x}) \<le> changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<and> even (changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) - int (proots_count (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) {x. 0 < x}))
[PROOF STEP]
by (rule descartes_sign)
[PROOF STATE]
proof (state)
this:
int (proots_count (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) {x. 0 < x}) \<le> changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<and> even (changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) - int (proots_count (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) {x. 0 < x}))

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
have hdeg: "degree (map_poly complex_of_real P) \<le> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (map_poly complex_of_real P) \<le> p
[PROOF STEP]
by (rule le_trans, rule degree_map_poly_le, auto simp: assms)
[PROOF STATE]
proof (state)
this:
degree (map_poly complex_of_real P) \<le> p

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
have hx: "\<And>x. 1 + x = 0 \<Longrightarrow> 0 < Re x \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 + x = 0; 0 < Re x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 + x = 0; 0 < Re x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix x::complex
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 + x = 0; 0 < Re x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "1 + x = 0"
[PROOF STATE]
proof (state)
this:
1 + x = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 + x = 0; 0 < Re x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
hence "x = -1"
[PROOF STATE]
proof (prove)
using this:
1 + x = 0

goal (1 subgoal):
 1. x = - 1
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
x = - 1

goal (1 subgoal):
 1. \<And>x. \<lbrakk>1 + x = 0; 0 < Re x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
thus "0 < Re x \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
x = - 1

goal (1 subgoal):
 1. 0 < Re x \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Re x \<Longrightarrow> False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>1 + ?x = 0; 0 < Re ?x\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
have 2: "proots_count (map_poly of_real P) circle_01_diam =
           proots_count (map_poly of_real ?Q) {x. 0 < Re x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real P) circle_01_diam = proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x}
[PROOF STEP]
apply (subst pos_real_map[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x}
[PROOF STEP]
apply (subst of_real_hom.map_poly_pcompose)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real (reciprocal_poly p P) \<circ>\<^sub>p map_poly complex_of_real [:1, 1:]) {x. 0 < Re x}
[PROOF STEP]
apply (subst map_poly_reciprocal)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. degree P \<le> p
 2. complex_of_real 0 = 0
 3. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (reciprocal_poly p (map_poly complex_of_real P) \<circ>\<^sub>p map_poly complex_of_real [:1, 1:]) {x. 0 < Re x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (3 subgoals):
 1. degree P \<le> p
 2. complex_of_real 0 = 0
 3. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (reciprocal_poly p (map_poly complex_of_real P) \<circ>\<^sub>p map_poly complex_of_real [:1, 1:]) {x. 0 < Re x}
[PROOF STEP]
apply auto[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (reciprocal_poly p (map_poly complex_of_real P) \<circ>\<^sub>p map_poly complex_of_real [:1, 1:]) {x. 0 < Re x}
[PROOF STEP]
apply (subst proots_pcompose)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. reciprocal_poly p (map_poly complex_of_real P) \<noteq> 0
 2. degree (map_poly complex_of_real [:1, 1:]) = 1
 3. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (reciprocal_poly p (map_poly complex_of_real P)) (poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (3 subgoals):
 1. reciprocal_poly p (map_poly complex_of_real P) \<noteq> 0
 2. degree (map_poly complex_of_real [:1, 1:]) = 1
 3. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (reciprocal_poly p (map_poly complex_of_real P)) (poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x})
[PROOF STEP]
apply (auto simp: reciprocal_0_iff degree_map_poly)[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (reciprocal_poly p (map_poly complex_of_real P)) (poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x})
[PROOF STEP]
apply (subst proots_count_reciprocal)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. degree (map_poly complex_of_real P) \<le> p
 2. map_poly complex_of_real P \<noteq> 0
 3. 0 \<notin> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}
 4. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real P) {x. inverse x \<in> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (4 subgoals):
 1. degree (map_poly complex_of_real P) \<le> p
 2. map_poly complex_of_real P \<noteq> 0
 3. 0 \<notin> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}
 4. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real P) {x. inverse x \<in> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}}
[PROOF STEP]
apply (auto simp: degree_map_poly inverse_eq_divide)[2]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<notin> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}
 2. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real P) {x. inverse x \<in> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}}
[PROOF STEP]
using hx
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 + ?x = 0; 0 < Re ?x\<rbrakk> \<Longrightarrow> False

goal (2 subgoals):
 1. 0 \<notin> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}
 2. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real P) {x. inverse x \<in> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}}
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count (map_poly complex_of_real P) {x. 1 / x \<in> (\<lambda>x. x + 1) ` {x. 0 < Re x}} = proots_count (map_poly complex_of_real P) {x. inverse x \<in> poly (map_poly complex_of_real [:1, 1:]) ` {x. 0 < Re x}}
[PROOF STEP]
by (auto simp: inverse_eq_divide algebra_simps)
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real P) circle_01_diam = proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x}

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
hence 3:"proots_count (map_poly of_real ?Q) {x. 0 < Re x} = 0"
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real P) circle_01_diam = proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x}

goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real P) circle_01_diam = proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x}
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
hence "\<And>x::complex.
         poly (map_poly of_real (smult (inverse (lead_coeff ?Q)) ?Q)) x = 0 \<Longrightarrow>
         Re x \<le> 0"
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0

goal (1 subgoal):
 1. \<And>x. poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0 \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; ?P1 x\<rbrakk> \<Longrightarrow> Re x \<le> 0
 2. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> ?P1 x\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
fix x::complex
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; ?P1 x\<rbrakk> \<Longrightarrow> Re x \<le> 0
 2. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> ?P1 x\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
show "Re x \<le> 0 \<Longrightarrow> Re x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re x \<le> 0 \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Re x \<le> 0 \<Longrightarrow> Re x \<le> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
assume "\<not>Re x \<le> 0"
[PROOF STATE]
proof (state)
this:
\<not> Re x \<le> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
hence h:"0 < Re x"
[PROOF STATE]
proof (prove)
using this:
\<not> Re x \<le> 0

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
assume "poly (map_poly of_real (smult (inverse (lead_coeff ?Q)) ?Q)) x = 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:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
hence h2:"poly (map_poly of_real ?Q) x = 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:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0

goal (1 subgoal):
 1. poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
hence "order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) > 0"
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
[PROOF STEP]
by (fastforce simp: order_root pcompose_eq_0 reciprocal_0_iff)
[PROOF STATE]
proof (state)
this:
0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
hence "proots_count (map_poly of_real ?Q) {x. 0 < Re x} \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))

goal (1 subgoal):
 1. proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
have h3: "finite {x. poly (map_poly complex_of_real
                (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {x. poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}
[PROOF STEP]
apply (rule poly_roots_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (1 subgoal):
 1. map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) \<noteq> 0
[PROOF STEP]
by (fastforce simp: order_root pcompose_eq_0 reciprocal_0_iff)
[PROOF STATE]
proof (state)
this:
finite {x. poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
have "0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
[PROOF STEP]
using h2 assms
[PROOF STATE]
proof (prove)
using this:
poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
[PROOF STEP]
by (fastforce simp: order_root pcompose_eq_0 reciprocal_0_iff)
[PROOF STATE]
proof (state)
this:
0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
have "... \<le> (\<Sum>r\<in>{x. 0 < Re x \<and>
                  poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x =
                  0}.
           order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<le> (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))
[PROOF STEP]
apply (rule member_le_sum)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. x \<in> {x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}
 2. \<And>xa. xa \<in> {x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0} - {x} \<Longrightarrow> 0 \<le> order xa (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
 3. finite {x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}
[PROOF STEP]
using h h2 h3
[PROOF STATE]
proof (prove)
using this:
0 < Re x
poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0
finite {x. poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}

goal (3 subgoals):
 1. x \<in> {x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}
 2. \<And>xa. xa \<in> {x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0} - {x} \<Longrightarrow> 0 \<le> order xa (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
 3. finite {x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<le> (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))
[PROOF STEP]
have
        "0 < (\<Sum>r\<in>{x. 0 < Re x \<and>
         poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}.
         order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))"
[PROOF STATE]
proof (prove)
using this:
0 < (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))

goal (1 subgoal):
 1. 0 < (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
thus
        "0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow>
         proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
         {x. 0 < Re x} \<noteq> 0 "
[PROOF STATE]
proof (prove)
using this:
0 < (\<Sum>r\<in>{x. 0 < Re x \<and> poly (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) x = 0}. order r (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])))

goal (1 subgoal):
 1. 0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
[PROOF STEP]
by (auto simp: proots_count_def proots_within_def)
[PROOF STATE]
proof (state)
this:
0 < order x (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) \<Longrightarrow> proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>poly (map_poly complex_of_real (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) x = 0; proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0; \<not> Re x \<le> 0\<rbrakk> \<Longrightarrow> Re x \<le> 0
[PROOF STEP]
thus "Re x \<le> 0"
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0

goal (1 subgoal):
 1. Re x \<le> 0
[PROOF STEP]
using 3
[PROOF STATE]
proof (prove)
using this:
proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} \<noteq> 0
proots_count (map_poly complex_of_real (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) {x. 0 < Re x} = 0

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

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:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) ?x = 0 \<Longrightarrow> Re ?x \<le> 0

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
hence "\<And>i. coeff (smult (inverse (lead_coeff ?Q)) ?Q) i \<ge> 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:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) ?x = 0 \<Longrightarrow> Re ?x \<le> 0

goal (1 subgoal):
 1. \<And>i. 0 \<le> coeff (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) i
[PROOF STEP]
apply (frule descartes_sign_zero)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. monic (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
 2. \<And>i. 0 \<le> coeff (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) (?i i) \<Longrightarrow> 0 \<le> coeff (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p
P \<noteq> 0
proots_count (map_poly complex_of_real P) circle_01_diam = 0

goal (2 subgoals):
 1. \<And>i. monic (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))
 2. \<And>i. 0 \<le> coeff (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) (?i i) \<Longrightarrow> 0 \<le> coeff (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) i
[PROOF STEP]
by (fastforce simp: pcompose_eq_0 reciprocal_0_iff)
[PROOF STATE]
proof (state)
this:
0 \<le> coeff (smult (inverse (lead_coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]))) (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) ?i

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

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:]))) = 0
[PROOF STEP]
by (subst changes_all_nonneg, auto simp: nth_default_coeffs_eq)
[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:]))) = 0

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
hence "changes (coeffs ?Q) = 0"
[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:]))) = 0

goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 0
[PROOF STEP]
using hQ
[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:]))) = 0
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:])) = 0
[PROOF STEP]
by (auto simp: coeffs_smult changes_scale_const)
[PROOF STATE]
proof (state)
this:
changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 0

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 0

goal (1 subgoal):
 1. Bernstein_changes_01 p P = 0
[PROOF STEP]
apply (subst Bernstein_changes_01_eq_changes["OF" hP])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 0 \<Longrightarrow> changes (coeffs (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:])) = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Bernstein_changes_01 p P = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma structInduct: assumes "P []" and "\<forall>x xs. P (xs) \<longrightarrow> P (x#xs)"
                    shows "P l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P l
[PROOF STEP]
using assms list_nonempty_induct
[PROOF STATE]
proof (prove)
using this:
P []
\<forall>x xs. P xs \<longrightarrow> P (x # xs)
\<lbrakk>?xs \<noteq> []; \<And>x. ?P [x]; \<And>x xs. \<lbrakk>xs \<noteq> []; ?P xs\<rbrakk> \<Longrightarrow> ?P (x # xs)\<rbrakk> \<Longrightarrow> ?P ?xs

goal (1 subgoal):
 1. P l
[PROOF STEP]
by (metis)


[STATEMENT]
lemma (in ring) ideal_prod_inter:
  assumes "ideal I R" "ideal J R"
  shows "I \<cdot> J \<subseteq> I \<inter> J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<cdot> J \<subseteq> I \<inter> J
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> I \<cdot> J \<Longrightarrow> x \<in> I \<inter> J
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> I \<cdot> J \<Longrightarrow> x \<in> I \<inter> J
[PROOF STEP]
assume "s \<in> I \<cdot> J"
[PROOF STATE]
proof (state)
this:
s \<in> I \<cdot> J

goal (1 subgoal):
 1. \<And>x. x \<in> I \<cdot> J \<Longrightarrow> x \<in> I \<inter> J
[PROOF STEP]
thus "s \<in> I \<inter> J"
[PROOF STATE]
proof (prove)
using this:
s \<in> I \<cdot> J

goal (1 subgoal):
 1. s \<in> I \<inter> J
[PROOF STEP]
apply (induct s rule: ideal_prod.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i \<in> I; j \<in> J\<rbrakk> \<Longrightarrow> i \<otimes> j \<in> I \<inter> J
 2. \<And>s1 s2. \<lbrakk>s1 \<in> I \<cdot> J; s1 \<in> I \<inter> J; s2 \<in> I \<cdot> J; s2 \<in> I \<inter> J\<rbrakk> \<Longrightarrow> s1 \<oplus> s2 \<in> I \<inter> J
[PROOF STEP]
apply (auto, (meson assms ideal.I_r_closed ideal.I_l_closed ideal.Icarr)+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s1 s2. \<lbrakk>s1 \<in> I \<cdot> J; s2 \<in> I \<cdot> J; s1 \<in> I; s1 \<in> J; s2 \<in> I; s2 \<in> J\<rbrakk> \<Longrightarrow> s1 \<oplus> s2 \<in> I
 2. \<And>s1 s2. \<lbrakk>s1 \<in> I \<cdot> J; s2 \<in> I \<cdot> J; s1 \<in> I; s1 \<in> J; s2 \<in> I; s2 \<in> J\<rbrakk> \<Longrightarrow> s1 \<oplus> s2 \<in> J
[PROOF STEP]
apply (simp_all add: additive_subgroup.a_closed assms ideal.axioms(1))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
s \<in> I \<inter> J

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "x \<le> y ==> x < y + (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y \<Longrightarrow> x < y + 1
[PROOF STEP]
by arith


[STATEMENT]
lemma "(\<forall>x. \<exists>y. J x y) \<and>
        (\<forall>x. \<exists>y. G x y) \<and>
        (\<forall>x y. J x y \<or> G x y \<longrightarrow>
        (\<forall>z. J y z \<or> G y z \<longrightarrow> H x z))
    \<longrightarrow> (\<forall>x. \<exists>y. H x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. \<exists>y. J x y) \<and> (\<forall>x. \<exists>y. G x y) \<and> (\<forall>x y. J x y \<or> G x y \<longrightarrow> (\<forall>z. J y z \<or> G y z \<longrightarrow> H x z)) \<longrightarrow> (\<forall>x. \<exists>y. H x y)
[PROOF STEP]
by blast


[STATEMENT]
lemma exp_scaleR_diagonal1:
  assumes "mtx_invertible P" and "A = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i) * P"
    shows "exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
have "exp (t *\<^sub>R A) = exp (P\<^sup>-\<^sup>1 * (t *\<^sub>R sq_mtx_diag f) * P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (t *\<^sub>R A) = exp (P\<^sup>-\<^sup>1 * t *\<^sub>R sq_mtx_diag f * P)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mtx_invertible P
A = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. f i) * P

goal (1 subgoal):
 1. exp (t *\<^sub>R A) = exp (P\<^sup>-\<^sup>1 * t *\<^sub>R sq_mtx_diag f * P)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (t *\<^sub>R A) = exp (P\<^sup>-\<^sup>1 * t *\<^sub>R sq_mtx_diag f * P)

goal (1 subgoal):
 1. exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (t *\<^sub>R A) = exp (P\<^sup>-\<^sup>1 * t *\<^sub>R sq_mtx_diag f * P)

goal (1 subgoal):
 1. exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
have "... = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (P\<^sup>-\<^sup>1 * t *\<^sub>R sq_mtx_diag f * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
by (metis assms(1) exp_similiar_sq_mtx_diag_eq exp_sq_mtx_diag scaleR_sq_mtx_diag)
[PROOF STATE]
proof (state)
this:
exp (P\<^sup>-\<^sup>1 * t *\<^sub>R sq_mtx_diag f * P) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P

goal (1 subgoal):
 1. exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
show "exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P"
[PROOF STATE]
proof (prove)
using this:
exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P

goal (1 subgoal):
 1. exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
exp (t *\<^sub>R A) = P\<^sup>-\<^sup>1 * (\<d>\<i>\<a>\<g> i. exp (t * f i)) * P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem cyc_checker_codeT_correct:
  assumes 1: "graph G" "finite (graph_defs.reachable G)"
  assumes 2: "(Gi, G) \<in> \<langle>Rm, Id\<rangle>g_impl_rel_ext"
  shows "cyc_checker_codeT Gi \<longleftrightarrow> (\<not>acyclic (g_E G \<inter> ((g_E G)\<^sup>* `` g_V0 G) \<times> UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
note cyc_checker_codeT.refine[OF 2]
[PROOF STATE]
proof (state)
this:
RETURN (cyc_checker_codeT Gi) \<le> \<Down> bool_rel (cyc_checker_implT G)

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
RETURN (cyc_checker_codeT Gi) \<le> \<Down> bool_rel (cyc_checker_implT G)

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
note cyc_checker_implT_refine
[PROOF STATE]
proof (state)
this:
cyc_checker_implT ?G \<le> \<Down> bool_rel (cyc_checkerT ?G)

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cyc_checker_implT ?G \<le> \<Down> bool_rel (cyc_checkerT ?G)

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
note cyc_checkerT_correct
[PROOF STATE]
proof (state)
this:
cyc_checkerT ?G \<le> cyc_checkerT_spec ?G

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
RETURN (cyc_checker_codeT Gi) \<le> cyc_checkerT_spec G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
RETURN (cyc_checker_codeT Gi) \<le> cyc_checkerT_spec G

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
RETURN (cyc_checker_codeT Gi) \<le> cyc_checkerT_spec G
graph G
finite ((g_E G)\<^sup>* `` g_V0 G)

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
unfolding cyc_checkerT_spec_def
[PROOF STATE]
proof (prove)
using this:
RETURN (cyc_checker_codeT Gi) \<le> ASSERT (graph G \<and> finite ((g_E G)\<^sup>* `` g_V0 G)) \<bind> (\<lambda>_. SPEC (\<lambda>r. r = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))))
graph G
finite ((g_E G)\<^sup>* `` g_V0 G)

goal (1 subgoal):
 1. cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cyc_checker_codeT Gi = (\<not> acyclic (g_E G \<inter> (g_E G)\<^sup>* `` g_V0 G \<times> UNIV))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sup_option_assoc: "sup_option (sup_option x y) z = sup_option x (sup_option y z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_option (sup_option x y) z = sup_option x (sup_option y z)
[PROOF STEP]
by(cases z) simp_all


[STATEMENT]
theorem pseudo_rationalizable:
  assumes "f_range_on A f"
  shows "path_independent_on A f
           \<longleftrightarrow> (\<exists>Rs. pseudo_rationalizable_on A Rs f \<and> (\<forall>r\<in>Rs. refl_on A r \<and> total_on A r \<longleftrightarrow> decisive_on A f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_independent_on A f = (\<exists>Rs. pseudo_rationalizable_on A Rs f \<and> (\<forall>r\<in>Rs. (refl_on A r \<and> total_on A r) = decisive_on A f))
[PROOF STEP]
using %invisible pseudo_rationalizable_on_path_independent_on path_independent_on_pseudo_rationalizable_on[OF _ assms]
[PROOF STATE]
proof (prove)
using this:
pseudo_rationalizable_on ?A ?Rs ?f \<Longrightarrow> path_independent_on ?A ?f
\<lbrakk>path_independent_on A f; ?Rs = (\<Union>C\<in>Pow A. linord_of_list ` mk_linear_orders f C A)\<rbrakk> \<Longrightarrow> pseudo_rationalizable_on A ?Rs f \<and> (\<forall>r\<in>?Rs. (refl_on A r \<and> total_on A r) = decisive_on A f)

goal (1 subgoal):
 1. path_independent_on A f = (\<exists>Rs. pseudo_rationalizable_on A Rs f \<and> (\<forall>r\<in>Rs. (refl_on A r \<and> total_on A r) = decisive_on A f))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma measure_density_const:
  "A \<in> sets M \<Longrightarrow> c \<noteq> \<infinity> \<Longrightarrow> measure (density M (\<lambda>_. c)) A = enn2real c * measure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; c \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure (density M (\<lambda>_. c)) A = enn2real c * Sigma_Algebra.measure M A
[PROOF STEP]
by (auto simp: emeasure_density_const measure_def enn2real_mult)


[STATEMENT]
lemma lens_plus_sub_comm: "X \<bowtie> Y \<Longrightarrow> X +\<^sub>L Y \<subseteq>\<^sub>L Y +\<^sub>L X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<bowtie> Y \<Longrightarrow> X +\<^sub>L Y \<subseteq>\<^sub>L Y +\<^sub>L X
[PROOF STEP]
apply (simp add: sublens_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<bowtie> Y \<Longrightarrow> \<exists>Z. vwb_lens Z \<and> X +\<^sub>L Y = Z ;\<^sub>L (Y +\<^sub>L X)
[PROOF STEP]
apply (rule_tac x="snd\<^sub>L +\<^sub>L fst\<^sub>L" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<bowtie> Y \<Longrightarrow> vwb_lens swap\<^sub>L \<and> X +\<^sub>L Y = swap\<^sub>L ;\<^sub>L (Y +\<^sub>L X)
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. X \<bowtie> Y \<Longrightarrow> vwb_lens swap\<^sub>L
 2. X \<bowtie> Y \<Longrightarrow> X +\<^sub>L Y = swap\<^sub>L ;\<^sub>L (Y +\<^sub>L X)
[PROOF STEP]
apply (simp add: fst_vwb_lens lens_indep_sym snd_vwb_lens)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<bowtie> Y \<Longrightarrow> X +\<^sub>L Y = swap\<^sub>L ;\<^sub>L (Y +\<^sub>L X)
[PROOF STEP]
apply (simp add: lens_indep_sym lens_plus_swap)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Ex1_one_point2 [simp]:
  "(\<exists>! x. P x \<and> Q x \<and> x = a) = (P a \<and> Q a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>!x. P x \<and> Q x \<and> x = a) = (P a \<and> Q a)
[PROOF STEP]
by auto


[STATEMENT]
lemma vint_minus_transfer[transfer_rule]:
  includes lifting_syntax
  shows "(cr_vint ===> cr_vint ===> cr_vint) (-\<^sub>\<int>) (-)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cr_vint ===> cr_vint ===> cr_vint) (-\<^sub>\<int>) (-)
[PROOF STEP]
using vint_fpair_in_fproduct_vint
[PROOF STATE]
proof (prove)
using this:
[?a\<^sub>\<int>, ?b\<^sub>\<int>]\<^sub>\<circ> \<in>\<^sub>\<circ> \<int>\<^sub>\<circ> ^\<^sub>\<times> 2\<^sub>\<nat>

goal (1 subgoal):
 1. (cr_vint ===> cr_vint ===> cr_vint) (-\<^sub>\<int>) (-)
[PROOF STEP]
by (intro rel_funI, unfold vint_minus_def cr_vint_def cr_scalar_def)
    (simp add: nat_omega_simps)


[STATEMENT]
lemma inverse_octo_1_sym: "x \<noteq> 0 \<Longrightarrow> inverse x * x = (1 :: octo)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> inverse x * x = 1
[PROOF STEP]
by (metis cnj_cnj cnj_inverse cnj_mult cnj_one cnj_zero inverse_octo_1)


[STATEMENT]
lemma lconjby_Abs_freelist_relator_freeword:
  "\<lbrakk> s\<in>S; t\<in>S; xs\<in>lists S \<rbrakk> \<Longrightarrow>
    lconjby (Abs_freelist xs) (pair_relator_freeword s t) \<in> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> S; t \<in> S; xs \<in> lists S\<rbrakk> \<Longrightarrow> lconjby (Abs_freelist xs) (pair_relator_freeword s t) \<in> \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` Abs_freeword ` map (charpair S) ` R\<rangle>
[PROOF STEP]
using GroupWithGeneratorsRelators.lconjby_Abs_freelist_relator_freeword[
          OF GroupWithGeneratorsRelators_S_R
        ]
        relator_freeword
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?rs \<in> R; ?xs \<in> lists S\<rbrakk> \<Longrightarrow> lconjby (Abs_freelist ?xs) (relator_freeword ?rs) \<in> \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` Abs_freeword ` map (charpair S) ` R\<rangle>
\<lbrakk>?s \<in> S; ?t \<in> S\<rbrakk> \<Longrightarrow> pair_relator_freeword ?s ?t = relator_freeword (pair_relator_list ?s ?t)

goal (1 subgoal):
 1. \<lbrakk>s \<in> S; t \<in> S; xs \<in> lists S\<rbrakk> \<Longrightarrow> lconjby (Abs_freelist xs) (pair_relator_freeword s t) \<in> \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` Abs_freeword ` map (charpair S) ` R\<rangle>
[PROOF STEP]
by    force


[STATEMENT]
theorem Theorem_11:
  shows "\<exists>y\<in>match (TruePref.gfp_F ds). (x, y) \<in> Pd' (Xd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>TruePref.match (TruePref.gfp_F ds). (x, y) \<in> Pd' (Xd x)
[PROOF STEP]
using Theorem_11_fp_cop_F TruePref.Theorem_15_match
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>TruePref.cop ds. (x, y) \<in> Pd' (Xd x)
TruePref.match (TruePref.gfp_F ?ds) = TruePref.cop ?ds

goal (1 subgoal):
 1. \<exists>y\<in>TruePref.match (TruePref.gfp_F ds). (x, y) \<in> Pd' (Xd x)
[PROOF STEP]
by simp


[STATEMENT]
lemma higherPoly\<^sub>0_add : "higherPoly\<^sub>0 x y (p + q) = higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higherPoly\<^sub>0 x y (p + q) = higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q
[PROOF STEP]
using poly_mapping_eq_iff[where a = "higherPoly\<^sub>0 x y (p + q)", where b = "higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q"]
    plus_poly_mapping.rep_eq[where x = "higherPoly\<^sub>0 x y (p + q)", where xa = "higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q"]
[PROOF STATE]
proof (prove)
using this:
(higherPoly\<^sub>0 x y (p + q) = higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q) = (lookup (higherPoly\<^sub>0 x y (p + q)) = lookup (higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q))
lookup (higherPoly\<^sub>0 x y (p + q) + (higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q)) = (\<lambda>k. lookup (higherPoly\<^sub>0 x y (p + q)) k + lookup (higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q) k)

goal (1 subgoal):
 1. higherPoly\<^sub>0 x y (p + q) = higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lookup (higherPoly\<^sub>0 x y (p + q) + (higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q)) = (\<lambda>k. lookup (higherPoly\<^sub>0 x y (p + q)) k + lookup (higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q) k); higherPoly\<^sub>0 x y (p + q) \<noteq> higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q; lookup (higherPoly\<^sub>0 x y (p + q)) \<noteq> lookup (higherPoly\<^sub>0 x y p + higherPoly\<^sub>0 x y q)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (simp add: higherPoly\<^sub>0.rep_eq lookup_add poly_mapping_eqI)


[STATEMENT]
lemma p2rel_dflt[p2rel]:
  "p2rel (=) = Id"
  "p2rel (rel_fun A B) = p2rel A \<rightarrow> p2rel B"
  "p2rel (rel_prod A B) = p2rel A \<times>\<^sub>r p2rel B"
  "p2rel (rel_sum A B) = \<langle>p2rel A, p2rel B\<rangle>sum_rel"
  "p2rel (rel_option A) = \<langle>p2rel A\<rangle>option_rel"
  "p2rel (list_all2 A) = \<langle>p2rel A\<rangle>list_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p2rel (=) = Id &&& p2rel (rel_fun A B) = p2rel A \<rightarrow> p2rel B &&& p2rel (rel_prod A B) = p2rel A \<times>\<^sub>r p2rel B) &&& p2rel (rel_sum A B) = \<langle>p2rel A, p2rel B\<rangle>sum_rel &&& p2rel (rel_option A) = \<langle>p2rel A\<rangle>option_rel &&& p2rel (list_all2 A) = \<langle>p2rel A\<rangle>list_rel
[PROOF STEP]
by (auto
    simp: p2rel_def[abs_def]
    simp: fun_rel_def rel_fun_def
    simp: sum_rel_def elim: rel_sum.cases
    simp: option_rel_def elim: option.rel_cases
    simp: list_rel_def
    )


[STATEMENT]
lemma length_bv_prepend: "length (bv_prepend n b l) = n+length l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (bv_prepend n b l) = n + length l
[PROOF STEP]
by (induct n) (simp_all add: bv_prepend)


[STATEMENT]
lemma ordinal_0_le [iff]: "0 \<le> (x::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x
[PROOF STEP]
by (unfold ordinal_zero_def, rule oZero_least)


[STATEMENT]
lemma box_d_import_iff_2:
  "d(x) * d(y) \<le> |z]w \<longleftrightarrow> d(x) * d(y) \<le> |d(y) * z]w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d x * d y \<le> | z ] w) = (d x * d y \<le> | d y * z ] w)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. d x * d y \<le> | z ] w \<Longrightarrow> d x * d y \<le> | d y * z ] w
 2. d x * d y \<le> | d y * z ] w \<Longrightarrow> d x * d y \<le> | z ] w
[PROOF STEP]
using box_d_export le_supI2
[PROOF STATE]
proof (prove)
using this:
| d ?x * ?y ] ?z = a ?x \<squnion> | ?y ] ?z
?x \<le> ?b \<Longrightarrow> ?x \<le> ?a \<squnion> ?b

goal (2 subgoals):
 1. d x * d y \<le> | z ] w \<Longrightarrow> d x * d y \<le> | d y * z ] w
 2. d x * d y \<le> | d y * z ] w \<Longrightarrow> d x * d y \<le> | z ] w
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x * d y \<le> | d y * z ] w \<Longrightarrow> d x * d y \<le> | z ] w
[PROOF STEP]
by (metis box_d_import d_commutative d_restrict_iff_1)


[STATEMENT]
lemma cond :
  "    \<lbrace>\<lambda>\<sigma>. P \<sigma> \<and> cond \<sigma>\<rbrace> M \<lbrace>Q\<rbrace>
   \<Longrightarrow> \<lbrace>\<lambda>\<sigma>. P \<sigma> \<and> \<not> cond \<sigma>\<rbrace> M' \<lbrace>Q\<rbrace>
   \<Longrightarrow> \<lbrace>P\<rbrace>if\<^sub>S\<^sub>E cond then M else M' fi\<lbrace>Q\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<lbrace>\<lambda>\<sigma>. P \<sigma> \<and> cond \<sigma>\<rbrace> M \<lbrace>Q\<rbrace>; \<lbrace>\<lambda>\<sigma>. P \<sigma> \<and> \<not> cond \<sigma>\<rbrace> M' \<lbrace>Q\<rbrace>\<rbrakk> \<Longrightarrow> \<lbrace>P\<rbrace> _if_SE cond M M' \<lbrace>Q\<rbrace>
[PROOF STEP]
unfolding hoare\<^sub>3_def hoare\<^sub>3'_def bind_SE_def if_SE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<sigma>. P \<sigma> \<and> cond \<sigma> \<longrightarrow> (case M \<sigma> of None \<Rightarrow> False | Some (x, \<sigma>') \<Rightarrow> Q x \<sigma>'); \<forall>\<sigma>. P \<sigma> \<and> \<not> cond \<sigma> \<longrightarrow> (case M' \<sigma> of None \<Rightarrow> False | Some (x, \<sigma>') \<Rightarrow> Q x \<sigma>')\<rbrakk> \<Longrightarrow> \<forall>\<sigma>. P \<sigma> \<longrightarrow> (case if cond \<sigma> then M \<sigma> else M' \<sigma> of None \<Rightarrow> False | Some (x, \<sigma>') \<Rightarrow> Q x \<sigma>')
[PROOF STEP]
by auto


[STATEMENT]
lemma integr_index: "integrable (measure_pmf (config'' (BIT_init, BIT_step) qs init n))
   (\<lambda>(s, is). real (Suc (index s (qs ! n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (measure_pmf (config'_rand BIT (fst BIT init \<bind> (\<lambda>is. return_pmf (init, is))) (take n qs))) (\<lambda>(s, is). real (Suc (index s (qs ! n))))
[PROOF STEP]
apply(rule measure_pmf.integrable_const_bound[where B="Suc (length init)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. AE x in measure_pmf (config'_rand BIT (fst BIT init \<bind> (\<lambda>is. return_pmf (init, is))) (take n qs)). norm (case x of (s, is) \<Rightarrow> real (Suc (index s (qs ! n)))) \<le> real (Suc (length init))
 2. measure_pmf.random_variable (config'_rand BIT (fst BIT init \<bind> (\<lambda>is. return_pmf (init, is))) (take n qs)) borel (\<lambda>(s, is). real (Suc (index s (qs ! n))))
[PROOF STEP]
apply(simp add: split_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. AE x in measure_pmf (config'_rand BIT (fst BIT init \<bind> (\<lambda>is. return_pmf (init, is))) (take n qs)). index (fst x) (qs ! n) \<le> length init
 2. measure_pmf.random_variable (config'_rand BIT (fst BIT init \<bind> (\<lambda>is. return_pmf (init, is))) (take n qs)) borel (\<lambda>(s, is). real (Suc (index s (qs ! n))))
[PROOF STEP]
apply (metis (mono_tags) index_le_size AE_measure_pmf_iff config_rand_length)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.random_variable (config'_rand BIT (fst BIT init \<bind> (\<lambda>is. return_pmf (init, is))) (take n qs)) borel (\<lambda>(s, is). real (Suc (index s (qs ! n))))
[PROOF STEP]
by (auto)


[STATEMENT]
lemma single_valued_inter1: "single_valued R \<Longrightarrow> single_valued (R\<inter>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_valued R \<Longrightarrow> single_valued (R \<inter> S)
[PROOF STEP]
by (auto intro: single_valuedI dest: single_valuedD)


[STATEMENT]
lemma Constrains_Un:
    "[| F \<in> A Co A'; F \<in> B Co B' |] ==> F \<in> (A \<union> B) Co (A' \<union> B')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A Co A'; F \<in> B Co B'\<rbrakk> \<Longrightarrow> F \<in> A \<union> B Co A' \<union> B'
[PROOF STEP]
apply (unfold Constrains_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> {F. F \<in> reachable F \<inter> A co A'}; F \<in> {F. F \<in> reachable F \<inter> B co B'}\<rbrakk> \<Longrightarrow> F \<in> {F. F \<in> reachable F \<inter> (A \<union> B) co A' \<union> B'}
[PROOF STEP]
apply (blast intro: constrains_Un [THEN constrains_weaken])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vunion_assoc: "A \<union>\<^sub>\<circ> (B \<union>\<^sub>\<circ> C) = (A \<union>\<^sub>\<circ> B) \<union>\<^sub>\<circ> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union>\<^sub>\<circ> (B \<union>\<^sub>\<circ> C) = A \<union>\<^sub>\<circ> B \<union>\<^sub>\<circ> C
[PROOF STEP]
by auto


[STATEMENT]
lemma elts_cmult: "elts (\<kappa>' \<otimes> \<kappa>) \<approx> elts \<kappa>' \<times> elts \<kappa>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (\<kappa>' \<otimes> \<kappa>) \<approx> elts \<kappa>' \<times> elts \<kappa>
[PROOF STEP]
by (simp add: cmult_def elts_vcard_VSigma_eqpoll)


[STATEMENT]
lemma countable_approach:
  fixes x :: ereal
  assumes "x \<noteq> -\<infinity>"
  shows "\<exists>f. incseq f \<and> (\<forall>i::nat. f i < x) \<and> (f \<longlonglongrightarrow> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
proof (cases x)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>r. x = ereal r \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 3. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
case (real r)
[PROOF STATE]
proof (state)
this:
x = ereal r

goal (3 subgoals):
 1. \<And>r. x = ereal r \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 3. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = ereal r

goal (3 subgoals):
 1. \<And>r. x = ereal r \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 3. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
have "(\<lambda>n. r - inverse (real (Suc n))) \<longlonglongrightarrow> r - 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. r - inverse (real (Suc n))) \<longlonglongrightarrow> r - 0
[PROOF STEP]
by (intro tendsto_intros LIMSEQ_inverse_real_of_nat)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. r - inverse (real (Suc n))) \<longlonglongrightarrow> r - 0

goal (3 subgoals):
 1. \<And>r. x = ereal r \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 3. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = ereal r
(\<lambda>n. r - inverse (real (Suc n))) \<longlonglongrightarrow> r - 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = ereal r
(\<lambda>n. r - inverse (real (Suc n))) \<longlonglongrightarrow> r - 0

goal (1 subgoal):
 1. \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
by (intro exI[of _ "\<lambda>n. x - inverse (Suc n)"]) (auto simp: incseq_def)
[PROOF STATE]
proof (state)
this:
\<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x

goal (2 subgoals):
 1. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
case PInf
[PROOF STATE]
proof (state)
this:
x = \<infinity>

goal (2 subgoals):
 1. x = \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
 2. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
with LIMSEQ_SUP[of "\<lambda>n::nat. ereal (real n)"]
[PROOF STATE]
proof (chain)
picking this:
incseq (\<lambda>n. ereal (real n)) \<Longrightarrow> (\<lambda>n. ereal (real n)) \<longlonglongrightarrow> (SUP i. ereal (real i))
x = \<infinity>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. ereal (real n)) \<Longrightarrow> (\<lambda>n. ereal (real n)) \<longlonglongrightarrow> (SUP i. ereal (real i))
x = \<infinity>

goal (1 subgoal):
 1. \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
by (intro exI[of _ "\<lambda>n. ereal (real n)"]) (auto simp: incseq_def SUP_nat_Infty)
[PROOF STATE]
proof (state)
this:
\<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x

goal (1 subgoal):
 1. x = - \<infinity> \<Longrightarrow> \<exists>f. incseq f \<and> (\<forall>i. f i < x) \<and> f \<longlonglongrightarrow> x
[PROOF STEP]
qed (simp add: assms)


[STATEMENT]
lemma nu_star:
assumes "\<And>x. x\<^sup>\<star> \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>"
and "\<And>x y z. x \<cdot> (y \<cdot> z) = (x \<cdot> y) \<cdot> z"
shows "(\<nu> x)\<^sup>\<star> \<cdot> (1\<^sub>\<sigma> + \<tau> x) = x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> x\<^sup>\<star> \<cdot> (1\<^sub>\<sigma> + \<tau> x) = x\<^sup>\<star>
[PROOF STEP]
by (simp add: assms(1) assms(2) local.dual_order.antisym nu_star1 nu_star2)


[STATEMENT]
lemma connected_component_of_trans:
   "\<lbrakk>connected_component_of X x y; connected_component_of X y z\<rbrakk>
        \<Longrightarrow> connected_component_of X x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected_component_of X x y; connected_component_of X y z\<rbrakk> \<Longrightarrow> connected_component_of X x z
[PROOF STEP]
unfolding connected_component_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>T. connectedin X T \<and> x \<in> T \<and> y \<in> T; \<exists>T. connectedin X T \<and> y \<in> T \<and> z \<in> T\<rbrakk> \<Longrightarrow> \<exists>T. connectedin X T \<and> x \<in> T \<and> z \<in> T
[PROOF STEP]
using connectedin_Un
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>connectedin ?X ?S; connectedin ?X ?T; ?S \<inter> ?T \<noteq> {}\<rbrakk> \<Longrightarrow> connectedin ?X (?S \<union> ?T)

goal (1 subgoal):
 1. \<lbrakk>\<exists>T. connectedin X T \<and> x \<in> T \<and> y \<in> T; \<exists>T. connectedin X T \<and> y \<in> T \<and> z \<in> T\<rbrakk> \<Longrightarrow> \<exists>T. connectedin X T \<and> x \<in> T \<and> z \<in> T
[PROOF STEP]
by blast


[STATEMENT]
theorem set_of_binsert [simp]: "set_of (binsert x t) = set_of t Un {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (binsert x t) = set_of t \<union> {x}
[PROOF STEP]
by (induct t) auto


[STATEMENT]
lemma mask_subsume:
  "\<lbrakk>n \<le> m\<rbrakk> \<Longrightarrow> ((x::'a::len word) OR y AND mask n) AND NOT (mask m) = x AND NOT (mask m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m \<Longrightarrow> (x OR y AND mask n) AND NOT (mask m) = x AND NOT (mask m)
[PROOF STEP]
by (rule bit_word_eqI) (auto simp add: bit_simps word_size)


[STATEMENT]
lemma hom_factorization_lattice [hom_distribs]:
  shows "map (map_vec hom) (factorization_lattice u k m) = factorization_lattice (map_poly hom u) k (hom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map vec\<^sub>h (factorization_lattice u k m) = factorization_lattice (map_poly hom u) k (hom m)
[PROOF STEP]
by (auto intro!:arg_cong[of _ _ "\<lambda>p. vec_of_poly_n p _"] simp: list_eq_iff_nth_eq nth_factorization_lattice hom_vec_of_poly_n map_poly_hom_mult_monom)


[STATEMENT]
lemma subset_one: "A \<inter> B \<subseteq> {\<one>} \<longleftrightarrow> A \<inter> B = {\<one>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<inter> B \<subseteq> {\<one>}) = (A \<inter> B = {\<one>})
[PROOF STEP]
by  auto


[STATEMENT]
theorem list_fast_rec_correct:
  "\<lbrakk> length ts = 2 ^ k; \<forall>i < 2 ^ k. braun_list (ts ! i) (take_nths i k xs) \<rbrakk>
    \<Longrightarrow> list_fast_rec ts = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs)\<rbrakk> \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
proof (induct xs arbitrary: k ts rule: measure_induct_rule[where f=length])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x k ts. \<lbrakk>\<And>y k ts. \<lbrakk>length y < length x; length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k y)\<rbrakk> \<Longrightarrow> list_fast_rec ts = y; length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k x)\<rbrakk> \<Longrightarrow> list_fast_rec ts = x
[PROOF STEP]
case (less xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length ?y < length xs; length ?ts = 2 ^ ?k; \<forall>i<2 ^ ?k. braun_list (?ts ! i) (take_nths i ?k ?y)\<rbrakk> \<Longrightarrow> list_fast_rec ?ts = ?y
length ts = 2 ^ k
\<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs)

goal (1 subgoal):
 1. \<And>x k ts. \<lbrakk>\<And>y k ts. \<lbrakk>length y < length x; length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k y)\<rbrakk> \<Longrightarrow> list_fast_rec ts = y; length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k x)\<rbrakk> \<Longrightarrow> list_fast_rec ts = x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_fast_rec ts = xs
[PROOF STEP]
proof (cases "length xs < 2 ^ k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
 2. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
length xs < 2 ^ k

goal (2 subgoals):
 1. length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
 2. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
from less.prems True
[PROOF STATE]
proof (chain)
picking this:
length ts = 2 ^ k
\<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs)
length xs < 2 ^ k
[PROOF STEP]
have filter:
      "\<exists>n. ts = map (\<lambda>x. Node Leaf x Leaf) xs @ replicate n Leaf"
[PROOF STATE]
proof (prove)
using this:
length ts = 2 ^ k
\<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs)
length xs < 2 ^ k

goal (1 subgoal):
 1. \<exists>n. ts = map (\<lambda>x. \<langle>\<langle>\<rangle>, x, \<langle>\<rangle>\<rangle>) xs @ replicate n \<langle>\<rangle>
[PROOF STEP]
apply (rule_tac x="length ts - length xs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs); length xs < 2 ^ k\<rbrakk> \<Longrightarrow> ts = map (\<lambda>x. \<langle>\<langle>\<rangle>, x, \<langle>\<rangle>\<rangle>) xs @ replicate (length ts - length xs) \<langle>\<rangle>
[PROOF STEP]
apply (clarsimp simp: list_eq_iff_nth_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>length ts = 2 ^ k; \<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs); length xs < 2 ^ k; i < 2 ^ k\<rbrakk> \<Longrightarrow> ts ! i = (map (\<lambda>x. \<langle>\<langle>\<rangle>, x, \<langle>\<rangle>\<rangle>) xs @ replicate (2 ^ k - length xs) \<langle>\<rangle>) ! i
[PROOF STEP]
apply(auto simp: nth_append braun_list_not_Nil take_nths_eq_single braun_list_Nil hd_drop_conv_nth)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>n. ts = map (\<lambda>x. \<langle>\<langle>\<rangle>, x, \<langle>\<rangle>\<rangle>) xs @ replicate n \<langle>\<rangle>

goal (2 subgoals):
 1. length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
 2. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ts = map (\<lambda>x. \<langle>\<langle>\<rangle>, x, \<langle>\<rangle>\<rangle>) xs @ replicate n \<langle>\<rangle>

goal (1 subgoal):
 1. list_fast_rec ts = xs
[PROOF STEP]
by (clarsimp simp: list_fast_rec.simps[of ts] o_def list_fast_rec_all_Leaf)
[PROOF STATE]
proof (state)
this:
list_fast_rec ts = xs

goal (1 subgoal):
 1. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> length xs < 2 ^ k

goal (1 subgoal):
 1. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
with less.prems(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs)
\<not> length xs < 2 ^ k
[PROOF STEP]
have *:
      "\<forall>i < 2 ^ k. ts ! i \<noteq> Leaf
         \<and> value (ts ! i) = xs ! i
         \<and> braun_list (left (ts ! i)) (take_nths (i + 2 ^ k) (Suc k) xs)
         \<and> (\<forall>ys. ys = take_nths (i + 2 * 2 ^ k) (Suc k) xs
                 \<longrightarrow> braun_list (right (ts ! i)) ys)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<2 ^ k. braun_list (ts ! i) (take_nths i k xs)
\<not> length xs < 2 ^ k

goal (1 subgoal):
 1. \<forall>i<2 ^ k. ts ! i \<noteq> \<langle>\<rangle> \<and> value (ts ! i) = xs ! i \<and> braun_list (left (ts ! i)) (take_nths (i + 2 ^ k) (Suc k) xs) \<and> (\<forall>ys. ys = take_nths (i + 2 * 2 ^ k) (Suc k) xs \<longrightarrow> braun_list (right (ts ! i)) ys)
[PROOF STEP]
by (auto simp: take_nths_empty hd_take_nths braun_list_not_Nil take_nths_take_nths
                     algebra_simps)
[PROOF STATE]
proof (state)
this:
\<forall>i<2 ^ k. ts ! i \<noteq> \<langle>\<rangle> \<and> value (ts ! i) = xs ! i \<and> braun_list (left (ts ! i)) (take_nths (i + 2 ^ k) (Suc k) xs) \<and> (\<forall>ys. ys = take_nths (i + 2 * 2 ^ k) (Suc k) xs \<longrightarrow> braun_list (right (ts ! i)) ys)

goal (1 subgoal):
 1. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
have 1: "map value ts = take (2 ^ k) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map value ts = take (2 ^ k) xs
[PROOF STEP]
using less.prems(1) False
[PROOF STATE]
proof (prove)
using this:
length ts = 2 ^ k
\<not> length xs < 2 ^ k

goal (1 subgoal):
 1. map value ts = take (2 ^ k) xs
[PROOF STEP]
by (simp add: list_eq_iff_nth_eq *)
[PROOF STATE]
proof (state)
this:
map value ts = take (2 ^ k) xs

goal (1 subgoal):
 1. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
have 2: "list_fast_rec (map left ts @ map right ts) = drop (2 ^ k) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_fast_rec (map left ts @ map right ts) = drop (2 ^ k) xs
[PROOF STEP]
using less.prems(1) False
[PROOF STATE]
proof (prove)
using this:
length ts = 2 ^ k
\<not> length xs < 2 ^ k

goal (1 subgoal):
 1. list_fast_rec (map left ts @ map right ts) = drop (2 ^ k) xs
[PROOF STEP]
by (auto intro!: Nat.diff_less less.hyps[where k= "Suc k"]
               simp: nth_append * take_nths_drop algebra_simps)
[PROOF STATE]
proof (state)
this:
list_fast_rec (map left ts @ map right ts) = drop (2 ^ k) xs

goal (1 subgoal):
 1. \<not> length xs < 2 ^ k \<Longrightarrow> list_fast_rec ts = xs
[PROOF STEP]
from less.prems(1) False
[PROOF STATE]
proof (chain)
picking this:
length ts = 2 ^ k
\<not> length xs < 2 ^ k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length ts = 2 ^ k
\<not> length xs < 2 ^ k

goal (1 subgoal):
 1. list_fast_rec ts = xs
[PROOF STEP]
by (auto simp: list_fast_rec.simps[of ts] 1 2 * all_set_conv_all_nth)
[PROOF STATE]
proof (state)
this:
list_fast_rec ts = xs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
list_fast_rec ts = xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ncop_distincts:
  assumes "\<not> Coplanar A B C D"
  shows "A \<noteq> B \<and> A \<noteq> C \<and> A \<noteq> D \<and> B \<noteq> C \<and> B \<noteq> D \<and> C \<noteq> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> B \<and> A \<noteq> C \<and> A \<noteq> D \<and> B \<noteq> C \<and> B \<noteq> D \<and> C \<noteq> D
[PROOF STEP]
using Coplanar_def assms col_trivial_1 col_trivial_2
[PROOF STATE]
proof (prove)
using this:
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
\<not> Coplanar A B C D
Col ?A ?A ?B
Col ?A ?B ?B

goal (1 subgoal):
 1. A \<noteq> B \<and> A \<noteq> C \<and> A \<noteq> D \<and> B \<noteq> C \<and> B \<noteq> D \<and> C \<noteq> D
[PROOF STEP]
by blast


[STATEMENT]
lemma put_scene_override_le_distrib:
  "\<lbrakk> vwb_lens x; idem_scene A; \<lbrakk>x\<rbrakk>\<^sub>\<sim> \<le> A \<rbrakk> \<Longrightarrow> put\<^bsub>x\<^esub> (s\<^sub>1 \<oplus>\<^sub>S s\<^sub>2 on A) v = (put\<^bsub>x\<^esub> s\<^sub>1 v) \<oplus>\<^sub>S (put\<^bsub>x\<^esub> s\<^sub>2 v) on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>vwb_lens x; idem_scene A; \<lbrakk>x\<rbrakk>\<^sub>\<sim> \<subseteq>\<^sub>S A\<rbrakk> \<Longrightarrow> put\<^bsub>x\<^esub> (s\<^sub>1 \<oplus>\<^sub>S s\<^sub>2 on A) v = put\<^bsub>x\<^esub> s\<^sub>1 v \<oplus>\<^sub>S put\<^bsub>x\<^esub> s\<^sub>2 v on A
[PROOF STEP]
by (metis put_scene_override_indep put_scene_override_le scene_le_iff_indep_inv scene_override_commute)


[STATEMENT]
lemma Inf_upset_id [simp]: "Inf \<circ> \<up> = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf \<circ> \<up> = id
[PROOF STEP]
by (simp add:  dual_upset)


[STATEMENT]
lemma inv2_rbt_baldL_B: "inv2 l \<Longrightarrow> inv2 r \<Longrightarrow> bheight l + 1 = bheight r \<Longrightarrow> color_of r = RBT_Impl.B \<Longrightarrow>
  inv2 (rbt_baldL l a b r) \<and> bheight (rbt_baldL l a b r) = bheight r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inv2 l; inv2 r; bheight l + 1 = bheight r; color_of r = B\<rbrakk> \<Longrightarrow> inv2 (rbt_baldL l a b r) \<and> bheight (rbt_baldL l a b r) = bheight r
[PROOF STEP]
by (induct l a b r rule: rbt_baldL.induct) (auto simp add: inv2_rbt_baliR rbt_bheight_rbt_baliR)


[STATEMENT]
lemma lt__nle:
  assumes "A B Lt C D"
  shows "\<not> C D Le A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> C D Le A B
[PROOF STEP]
using assms le__nlt
[PROOF STATE]
proof (prove)
using this:
A B Lt C D
?A ?B Le ?C ?D \<Longrightarrow> \<not> ?C ?D Lt ?A ?B

goal (1 subgoal):
 1. \<not> C D Le A B
[PROOF STEP]
by blast


[STATEMENT]
lemma (in pre_digraph) arcs_ends_iso:
  assumes "digraph_isomorphism hom"
  shows "arcs_ends (app_iso hom G) = (\<lambda>(u,v). (iso_verts hom u, iso_verts hom v)) ` arcs_ends G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcs_ends (app_iso hom G) = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` arcs_ends G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom

goal (1 subgoal):
 1. arcs_ends (app_iso hom G) = (\<lambda>(u, v). (iso_verts hom u, iso_verts hom v)) ` arcs_ends G
[PROOF STEP]
by (auto simp: arcs_ends_conv image_image iso_verts_tail iso_verts_head cong: image_cong)


[STATEMENT]
lemma parComm:
  fixes P :: ccs
  and   Q :: ccs

  assumes C1: "\<And>R T. (R \<parallel> T, T \<parallel> R) \<in> Rel"

  shows "P \<parallel> Q \<leadsto>[Rel] Q \<parallel> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<parallel> Q \<leadsto>[Rel] Q \<parallel> P
[PROOF STEP]
by(fastforce simp add: simulation_def elim: parCases intro: Par1 Par2 Comm C1)


[STATEMENT]
lemma invariance_of_domain_homeomorphism:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "open S" "continuous_on S f" "DIM('b) \<le> DIM('a)" "inj_on f S"
  obtains g where "homeomorphism S (f ` S) f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. homeomorphism S (f ` S) f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. homeomorphism S (f ` S) f g \<Longrightarrow> thesis) \<Longrightarrow> homeomorphism S (f ` S) f ?g2
[PROOF STEP]
show "homeomorphism S (f ` S) f (inv_into S f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphism S (f ` S) f (inv_into S f)
[PROOF STEP]
by (simp add: assms continuous_on_inverse_open homeomorphism_def)
[PROOF STATE]
proof (state)
this:
homeomorphism S (f ` S) f (inv_into S f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_row_space:
  shows "vec.subspace (row_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.subspace (row_space A)
[PROOF STEP]
by (metis row_space_def vec.subspace_span)


[STATEMENT]
lemma one_Integer_neq_bottom [simp]: "(1::Integer) \<noteq> \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<noteq> \<bottom>
[PROOF STEP]
by (simp add: one_Integer_def)


[STATEMENT]
lemma setdiff_irrelevant:
  assumes "finite A"
  shows "F g (A - {x. g x = z}) = F g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g (A - {x. g x = \<^bold>1}) = F g A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. F g (A - {x. g x = \<^bold>1}) = F g A
[PROOF STEP]
by (induct A) (simp_all add: insert_Diff_if)


[STATEMENT]
lemma bounded_range_subset:
  "bounded (range f :: real set) \<Longrightarrow> bounded (f ` X')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range f) \<Longrightarrow> bounded (f ` X')
[PROOF STEP]
by (auto simp: bounded_iff)