[STATEMENT]
lemma approx_tse_generic:
  assumes "bounded_by xs vs"
    and bnd_c: "bounded_by (xs[x := c]) vs"
    and "x < length vs" and "x < length xs"
    and bnd_x: "vs ! x = Some ivlx"
    and ate: "approx_tse prec x s c k f vs = Some ivl"
  shows "\<exists> n. (\<forall> m < n. \<forall> (z::real) \<in> set_of (real_interval ivlx).
      DERIV (\<lambda> y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) z :>
            (interpret_floatarith ((DERIV_floatarith x ^^ (Suc m)) f) (xs[x := z])))
   \<and> (\<forall> (t::real) \<in> set_of (real_interval ivlx).  (\<Sum> i = 0..<n. inverse (real (\<Prod> j \<in> {k..<k+i}. j)) *
                  interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := c]) *
                  (xs!x - c)^i) +
      inverse (real (\<Prod> j \<in> {k..<k+n}. j)) *
      interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) *
      (xs!x - c)^n \<in>\<^sub>r ivl)" (is "\<exists> n. ?taylor f k ivl n")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
using ate
[PROOF STATE]
proof (prove)
using this:
approx_tse prec x s c k f vs = Some ivl

goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
proof (induct s arbitrary: k f ivl)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
approx_tse prec x 0 c k f vs = Some ivl

goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
approx_tse prec x 0 c k f vs = Some ivl

goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
fix t::real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
assume "t \<in>\<^sub>r ivlx"
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>r ivlx

goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
note bounded_by_update_var[OF \<open>bounded_by xs vs\<close> bnd_x this]
[PROOF STATE]
proof (state)
this:
bounded_by (xs[x := t]) vs

goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
from approx[OF this 0[unfolded approx_tse.simps]]
[PROOF STATE]
proof (chain)
picking this:
interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl
[PROOF STEP]
have "(interpret_floatarith f (xs[x := t])) \<in>\<^sub>r ivl"
[PROOF STATE]
proof (prove)
using this:
interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl

goal (1 subgoal):
 1. interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl

goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?t2 \<in>\<^sub>r ivlx \<Longrightarrow> interpret_floatarith f (xs[x := ?t2]) \<in>\<^sub>r ivl

goal (2 subgoals):
 1. \<And>k f ivl. approx_tse prec x 0 c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?t2 \<in>\<^sub>r ivlx \<Longrightarrow> interpret_floatarith f (xs[x := ?t2]) \<in>\<^sub>r ivl

goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
by (auto intro!: exI[of _ 0])
[PROOF STATE]
proof (state)
this:
\<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)

goal (1 subgoal):
 1. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
case (Suc s)
[PROOF STATE]
proof (state)
this:
approx_tse prec x s c ?k ?f vs = Some ?ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) ?f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) ?f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{?k..<?k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) ?f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{?k..<?k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) ?f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ?ivl)
approx_tse prec x (Suc s) c k f vs = Some ivl

goal (1 subgoal):
 1. \<And>s k f ivl. \<lbrakk>\<And>k f ivl. approx_tse prec x s c k f vs = Some ivl \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl); approx_tse prec x (Suc s) c k f vs = Some ivl\<rbrakk> \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
proof (cases "isDERIV_approx prec x f vs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> isDERIV_approx prec x f vs

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
note ap = Suc.prems[unfolded approx_tse.simps if_not_P[OF False]]
[PROOF STATE]
proof (state)
this:
approx prec f vs = Some ivl

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
approx prec f vs = Some ivl

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
fix t::real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
assume "t \<in>\<^sub>r ivlx"
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>r ivlx

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
note bounded_by_update_var[OF \<open>bounded_by xs vs\<close> bnd_x this]
[PROOF STATE]
proof (state)
this:
bounded_by (xs[x := t]) vs

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
from approx[OF this ap]
[PROOF STATE]
proof (chain)
picking this:
interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl
[PROOF STEP]
have "(interpret_floatarith f (xs[x := t])) \<in>\<^sub>r ivl"
[PROOF STATE]
proof (prove)
using this:
interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl

goal (1 subgoal):
 1. interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
interpret_floatarith f (xs[x := t]) \<in>\<^sub>r ivl

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?t2 \<in>\<^sub>r ivlx \<Longrightarrow> interpret_floatarith f (xs[x := ?t2]) \<in>\<^sub>r ivl

goal (2 subgoals):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
 2. \<not> isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?t2 \<in>\<^sub>r ivlx \<Longrightarrow> interpret_floatarith f (xs[x := ?t2]) \<in>\<^sub>r ivl

goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
by (auto intro!: exI[of _ 0])
[PROOF STATE]
proof (state)
this:
\<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
isDERIV_approx prec x f vs

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
with Suc.prems
[PROOF STATE]
proof (chain)
picking this:
approx_tse prec x (Suc s) c k f vs = Some ivl
isDERIV_approx prec x f vs
[PROOF STEP]
obtain ivl1 ivl2
      where a: "approx prec f (vs[x := Some (interval_of c)]) = Some ivl1"
        and ate: "approx_tse prec x s c (Suc k) (DERIV_floatarith x f) vs = Some ivl2"
        and final: "approx prec
          (Add (Var 0)
               (Mult (Inverse (Num (Float (int k) 0)))
                     (Mult (Add (Var (Suc (Suc 0))) (Minus (Num c)))
                           (Var (Suc 0))))) [Some ivl1, Some ivl2, vs!x] = Some ivl"
[PROOF STATE]
proof (prove)
using this:
approx_tse prec x (Suc s) c k f vs = Some ivl
isDERIV_approx prec x f vs

goal (1 subgoal):
 1. (\<And>ivl1 ivl2. \<lbrakk>approx prec f (vs[x := Some (interval_of c)]) = Some ivl1; approx_tse prec x s c (Suc k) (DERIV_floatarith x f) vs = Some ivl2; approx prec (Add (Var 0) (Mult (Inverse (Num (Float (int k) 0))) (Mult (Add (Var (Suc (Suc 0))) (Minus (Num c))) (Var (Suc 0))))) [Some ivl1, Some ivl2, vs ! x] = Some ivl\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim!: lift_bin_aux)
[PROOF STATE]
proof (state)
this:
approx prec f (vs[x := Some (interval_of c)]) = Some ivl1
approx_tse prec x s c (Suc k) (DERIV_floatarith x f) vs = Some ivl2
approx prec (Add (Var 0) (Mult (Inverse (Num (Float (int k) 0))) (Mult (Add (Var (Suc (Suc 0))) (Minus (Num c))) (Var (Suc 0))))) [Some ivl1, Some ivl2, vs ! x] = Some ivl

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
from bnd_c \<open>x < length xs\<close>
[PROOF STATE]
proof (chain)
picking this:
bounded_by (xs[x := real_of_float c]) vs
x < length xs
[PROOF STEP]
have bnd: "bounded_by (xs[x:=c]) (vs[x:= Some (interval_of c)])"
[PROOF STATE]
proof (prove)
using this:
bounded_by (xs[x := real_of_float c]) vs
x < length xs

goal (1 subgoal):
 1. bounded_by (xs[x := real_of_float c]) (vs[x := Some (interval_of c)])
[PROOF STEP]
by (auto intro!: bounded_by_update)
[PROOF STATE]
proof (state)
this:
bounded_by (xs[x := real_of_float c]) (vs[x := Some (interval_of c)])

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
from approx[OF this a]
[PROOF STATE]
proof (chain)
picking this:
interpret_floatarith f (xs[x := real_of_float c]) \<in>\<^sub>r ivl1
[PROOF STEP]
have f_c: "interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := c]) \<in>\<^sub>r ivl1"
              (is "?f 0 (real_of_float c) \<in> _")
[PROOF STATE]
proof (prove)
using this:
interpret_floatarith f (xs[x := real_of_float c]) \<in>\<^sub>r ivl1

goal (1 subgoal):
 1. interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl1

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
have funpow_Suc[symmetric]: "(f ^^ Suc n) x = (f ^^ n) (f x)"
      for f :: "'a \<Rightarrow> 'a" and n :: nat and x :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ Suc n) x = (f ^^ n) (f x)
[PROOF STEP]
by (induct n) auto
[PROOF STATE]
proof (state)
this:
(?f ^^ ?n) (?f ?x) = (?f ^^ Suc ?n) ?x

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
from Suc.hyps[OF ate, unfolded this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc m)) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl2)
[PROOF STEP]
obtain n
      where DERIV_hyp: "\<And>m z. \<lbrakk> m < n ; (z::real) \<in>\<^sub>r ivlx \<rbrakk> \<Longrightarrow>
        DERIV (?f (Suc m)) z :> ?f (Suc (Suc m)) z"
      and hyp: "\<forall>t \<in> set_of (real_interval ivlx).
        (\<Sum> i = 0..<n. inverse (real (\<Prod> j \<in> {Suc k..<Suc k + i}. j)) * ?f (Suc i) c * (xs!x - c)^i) +
          inverse (real (\<Prod> j \<in> {Suc k..<Suc k + n}. j)) * ?f (Suc n) t * (xs!x - c)^n \<in>\<^sub>r ivl2"
          (is "\<forall> t \<in> _. ?X (Suc k) f n t \<in> _")
[PROOF STATE]
proof (prove)
using this:
\<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc m)) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl2)

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<And>m z. \<lbrakk>m < n; z \<in>\<^sub>r ivlx\<rbrakk> \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc m)) f) (xs[x := z])) (at z); \<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?m1 < n; ?z1 \<in>\<^sub>r ivlx\<rbrakk> \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ Suc ?m1) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc ?m1)) f) (xs[x := ?z1])) (at ?z1)
\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl2

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
have DERIV: "DERIV (?f m) z :> ?f (Suc m) z"
      if "m < Suc n" and bnd_z: "z \<in>\<^sub>r ivlx" for m and z::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
proof (cases m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
 2. \<And>nat. m = Suc nat \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
 2. \<And>nat. m = Suc nat \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
with DERIV_floatarith[OF \<open>x < length xs\<close>
        isDERIV_approx'[OF \<open>bounded_by xs vs\<close> bnd_x bnd_z True]]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x'. interpret_floatarith f (xs[x := x'])) has_real_derivative interpret_floatarith (DERIV_floatarith x f) (xs[x := z])) (at z)
m = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x'. interpret_floatarith f (xs[x := x'])) has_real_derivative interpret_floatarith (DERIV_floatarith x f) (xs[x := z])) (at z)
m = 0

goal (1 subgoal):
 1. ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
case (Suc m')
[PROOF STATE]
proof (state)
this:
m = Suc m'

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
hence "m' < n"
[PROOF STATE]
proof (prove)
using this:
m = Suc m'

goal (1 subgoal):
 1. m' < n
[PROOF STEP]
using \<open>m < Suc n\<close>
[PROOF STATE]
proof (prove)
using this:
m = Suc m'
m < Suc n

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

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
from DERIV_hyp[OF this bnd_z]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ Suc m') f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc m')) f) (xs[x := z])) (at z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ Suc m') f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc m')) f) (xs[x := z])) (at z)

goal (1 subgoal):
 1. ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ Suc m') f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc (Suc m')) f) (xs[x := z])) (at z)
m = Suc m'

goal (1 subgoal):
 1. ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?m1 < Suc n; ?z1 \<in>\<^sub>r ivlx\<rbrakk> \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ ?m1) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc ?m1) f) (xs[x := ?z1])) (at ?z1)

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
have "\<And>k i. k < i \<Longrightarrow> {k ..< i} = insert k {Suc k ..< i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k i. k < i \<Longrightarrow> {k..<i} = insert k {Suc k..<i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k1 < ?i1 \<Longrightarrow> {?k1..<?i1} = insert ?k1 {Suc ?k1..<?i1}

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
hence prod_head_Suc: "\<And>k i. \<Prod>{k ..< k + Suc i} = k * \<Prod>{Suc k ..< Suc k + i}"
[PROOF STATE]
proof (prove)
using this:
?k1 < ?i1 \<Longrightarrow> {?k1..<?i1} = insert ?k1 {Suc ?k1..<?i1}

goal (1 subgoal):
 1. \<And>k i. \<Prod>{k..<k + Suc i} = k * \<Prod>{Suc k..<Suc k + i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Prod>{?k1..<?k1 + Suc ?i1} = ?k1 * \<Prod>{Suc ?k1..<Suc ?k1 + ?i1}

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
have sum_move0: "\<And>k F. sum F {0..<Suc k} = F 0 + sum (\<lambda> k. F (Suc k)) {0..<k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k F. sum F {0..<Suc k} = F 0 + (\<Sum>k = 0..<k. F (Suc k))
[PROOF STEP]
unfolding sum.shift_bounds_Suc_ivl[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k F. sum F {0..<Suc k} = F 0 + sum F {Suc 0..<Suc k}
[PROOF STEP]
unfolding sum.atLeast_Suc_lessThan[OF zero_less_Suc]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k F. F 0 + sum F {Suc 0..<Suc k} = F 0 + sum F {Suc 0..<Suc k}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
sum ?F1 {0..<Suc ?k1} = ?F1 0 + (\<Sum>k = 0..<?k1. ?F1 (Suc k))

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
define C where "C = xs!x - c"
[PROOF STATE]
proof (state)
this:
C = xs ! x - real_of_float c

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
C = xs ! x - real_of_float c

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
fix t::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
assume t: "t \<in>\<^sub>r ivlx"
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>r ivlx

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
hence "bounded_by [xs!x] [vs!x]"
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>r ivlx

goal (1 subgoal):
 1. bounded_by [xs ! x] [vs ! x]
[PROOF STEP]
using \<open>bounded_by xs vs\<close>[THEN bounded_byE, OF \<open>x < length vs\<close>]
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>r ivlx
case vs ! x of None \<Rightarrow> True | Some ivl \<Rightarrow> xs ! x \<in>\<^sub>r ivl

goal (1 subgoal):
 1. bounded_by [xs ! x] [vs ! x]
[PROOF STEP]
by (cases "vs!x", auto simp add: bounded_by_def)
[PROOF STATE]
proof (state)
this:
bounded_by [xs ! x] [vs ! x]

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
with hyp[THEN bspec, OF t] f_c
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl2
interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl1
bounded_by [xs ! x] [vs ! x]
[PROOF STEP]
have "bounded_by [?f 0 c, ?X (Suc k) f n t, xs!x] [Some ivl1, Some ivl2, vs!x]"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl2
interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl1
bounded_by [xs ! x] [vs ! x]

goal (1 subgoal):
 1. bounded_by [interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]), (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n, xs ! x] [Some ivl1, Some ivl2, vs ! x]
[PROOF STEP]
by (auto intro!: bounded_by_Cons)
[PROOF STATE]
proof (state)
this:
bounded_by [interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]), (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n, xs ! x] [Some ivl1, Some ivl2, vs ! x]

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
from approx[OF this final, unfolded atLeastAtMost_iff[symmetric]]
[PROOF STATE]
proof (chain)
picking this:
interpret_floatarith (Add (Var 0) (Mult (Inverse (Num (Float (int k) 0))) (Mult (Add (Var (Suc (Suc 0))) (Minus (Num c))) (Var (Suc 0))))) [interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]), (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n, xs ! x] \<in>\<^sub>r ivl
[PROOF STEP]
have "?X (Suc k) f n t * (xs!x - real_of_float c) * inverse k + ?f 0 c \<in>\<^sub>r ivl"
[PROOF STATE]
proof (prove)
using this:
interpret_floatarith (Add (Var 0) (Mult (Inverse (Num (Float (int k) 0))) (Mult (Add (Var (Suc (Suc 0))) (Minus (Num c))) (Var (Suc 0))))) [interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]), (\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n, xs ! x] \<in>\<^sub>r ivl

goal (1 subgoal):
 1. ((\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n) * (xs ! x - real_of_float c) * inverse (real k) + interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl
[PROOF STEP]
by (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
((\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n) * (xs ! x - real_of_float c) * inverse (real k) + interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n) * (xs ! x - real_of_float c) * inverse (real k) + interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) \<in>\<^sub>r ivl

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
have "?X (Suc k) f n t * (xs!x - real_of_float c) * inverse (real k) + ?f 0 c =
               (\<Sum> i = 0..<Suc n. inverse (real (\<Prod> j \<in> {k..<k+i}. j)) * ?f i c * (xs!x - c)^i) +
               inverse (real (\<Prod> j \<in> {k..<k+Suc n}. j)) * ?f (Suc n) t * (xs!x - c)^Suc n" (is "_ = ?T")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n) * (xs ! x - real_of_float c) * inverse (real k) + interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) = (\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ Suc n
[PROOF STEP]
unfolding funpow_Suc C_def[symmetric] sum_move0 prod_head_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * C ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * C ^ n) * C * inverse (real k) + interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) = inverse (real (\<Prod>{k..<k + 0})) * interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) * C ^ 0 + (\<Sum>k = 0..<n. inverse (real (k * \<Prod>{Suc k..<Suc k + k})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc k) f) (xs[x := real_of_float c]) * C ^ Suc k) + inverse (real (k * \<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * C ^ Suc n
[PROOF STEP]
by (auto simp add: algebra_simps)
          (simp only: mult.left_commute [of _ "inverse (real k)"] sum_distrib_left [symmetric])
[PROOF STATE]
proof (state)
this:
((\<Sum>i = 0..<n. inverse (real (\<Prod>{Suc k..<Suc k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{Suc k..<Suc k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n) * (xs ! x - real_of_float c) * inverse (real k) + interpret_floatarith ((DERIV_floatarith x ^^ 0) f) (xs[x := real_of_float c]) = (\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ Suc n

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl
[PROOF STEP]
have "?T \<in>\<^sub>r ivl"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl

goal (1 subgoal):
 1. (\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?t4 \<in>\<^sub>r ivlx \<Longrightarrow> (\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := ?t4]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl

goal (1 subgoal):
 1. isDERIV_approx prec x f vs \<Longrightarrow> \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?t4 \<in>\<^sub>r ivlx \<Longrightarrow> (\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := ?t4]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl

goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
using DERIV
[PROOF STATE]
proof (prove)
using this:
?t4 \<in>\<^sub>r ivlx \<Longrightarrow> (\<Sum>i = 0..<Suc n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + Suc n})) * interpret_floatarith ((DERIV_floatarith x ^^ Suc n) f) (xs[x := ?t4]) * (xs ! x - real_of_float c) ^ Suc n \<in>\<^sub>r ivl
\<lbrakk>?m1 < Suc n; ?z1 \<in>\<^sub>r ivlx\<rbrakk> \<Longrightarrow> ((\<lambda>a. interpret_floatarith ((DERIV_floatarith x ^^ ?m1) f) (xs[x := a])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc ?m1) f) (xs[x := ?z1])) (at ?z1)

goal (1 subgoal):
 1. \<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>n. (\<forall>m<n. \<forall>z\<in>set_of (real_interval ivlx). ((\<lambda>y. interpret_floatarith ((DERIV_floatarith x ^^ m) f) (xs[x := y])) has_real_derivative interpret_floatarith ((DERIV_floatarith x ^^ Suc m) f) (xs[x := z])) (at z)) \<and> (\<forall>t\<in>set_of (real_interval ivlx). (\<Sum>i = 0..<n. inverse (real (\<Prod>{k..<k + i})) * interpret_floatarith ((DERIV_floatarith x ^^ i) f) (xs[x := real_of_float c]) * (xs ! x - real_of_float c) ^ i) + inverse (real (\<Prod>{k..<k + n})) * interpret_floatarith ((DERIV_floatarith x ^^ n) f) (xs[x := t]) * (xs ! x - real_of_float c) ^ n \<in>\<^sub>r ivl)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_inter_subsets: "bij_betw f A B \<Longrightarrow> a1 \<subseteq> A \<Longrightarrow> a2 \<subseteq> A
    \<Longrightarrow> f ` (a1 \<inter> a2) = (f ` a1) \<inter> (f ` a2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bij_betw f A B; a1 \<subseteq> A; a2 \<subseteq> A\<rbrakk> \<Longrightarrow> f ` (a1 \<inter> a2) = f ` a1 \<inter> f ` a2
[PROOF STEP]
by (meson bij_betw_imp_inj_on inj_on_image_Int)


[STATEMENT]
lemma monic_irreducible_gcd:
  "monic (f::'a::{field,euclidean_ring_gcd,semiring_gcd_mult_normalize,
                  normalization_euclidean_semiring_multiplicative} poly) \<Longrightarrow>
   irreducible f \<Longrightarrow> gcd f u \<in> {1,f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>monic f; irreducible f\<rbrakk> \<Longrightarrow> gcd f u \<in> {1, f}
[PROOF STEP]
by (metis gcd_dvd1 irreducible_altdef insertCI is_unit_gcd_iff poly_dvd_antisym poly_gcd_monic)


[STATEMENT]
lemma wlp_SetDC:
  assumes wp: "\<And>s x. x \<in> S s \<Longrightarrow> P x \<tturnstile> wlp (f x) Q"
      and ne: "\<And>s. S s \<noteq> {}"
      and sP: "\<And>x. sound (P x)"
  shows "(\<lambda>s. Inf ((\<lambda>x. P x s) ` S s)) \<tturnstile> wlp (SetDC f S) Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>s. INF x\<in>S s. P x s \<tturnstile> wlp (SetDC f S) Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> S ?s \<Longrightarrow> P ?x \<tturnstile> wlp (f ?x) Q
S ?s \<noteq> {}
sound (P ?x)

goal (1 subgoal):
 1. \<lambda>s. INF x\<in>S s. P x s \<tturnstile> wlp (SetDC f S) Q
[PROOF STEP]
by(intro le_funI, simp add:wp_eval, blast intro!:cInf_mono)


[STATEMENT]
lemma all_star_eq: "(\<forall>x. P x) \<longleftrightarrow> (\<forall>X. P (star_n X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x) = (\<forall>X. P (star_n X))
[PROOF STEP]
by (metis star_cases)


[STATEMENT]
lemma gamma_meet[simp]: "\<gamma>(a1 \<sqinter> a2) = \<gamma> a1 \<inter> \<gamma> a2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> (a1 \<sqinter> a2) = \<gamma> a1 \<inter> \<gamma> a2
[PROOF STEP]
by (metis equalityI inter_gamma_subset_gamma_meet le_inf_iff mono_gamma meet_le1 meet_le2)


[STATEMENT]
lemma (in ergodic_fmpt) Invariants_cond_exp_is_integral_fmpt:
  fixes f::"_ \<Rightarrow> real"
  assumes "integrable M f"
  shows "AE x in M. real_cond_exp M Invariants f x = (\<integral>x. f x \<partial>M) / measure M (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)
[PROOF STEP]
have "AE x in M. real_cond_exp M Invariants f x = (\<integral>x. real_cond_exp M Invariants f x \<partial>M)/\<^sub>R (measure M (space M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M (real_cond_exp M Invariants f) /\<^sub>R Sigma_Algebra.measure M (space M)
[PROOF STEP]
by (rule Invariant_func_integral(2), simp add: borel_measurable_cond_exp)
[PROOF STATE]
proof (state)
this:
AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M (real_cond_exp M Invariants f) /\<^sub>R Sigma_Algebra.measure M (space M)

goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M (real_cond_exp M Invariants f) /\<^sub>R Sigma_Algebra.measure M (space M)

goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)
[PROOF STEP]
have "(\<integral>x. real_cond_exp M Invariants f x \<partial>M) = (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M (real_cond_exp M Invariants f) = integral\<^sup>L M f
[PROOF STEP]
by (simp add: assms real_cond_exp_int(2))
[PROOF STATE]
proof (state)
this:
integral\<^sup>L M (real_cond_exp M Invariants f) = integral\<^sup>L M f

goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M (real_cond_exp M Invariants f) /\<^sub>R Sigma_Algebra.measure M (space M)
integral\<^sup>L M (real_cond_exp M Invariants f) = integral\<^sup>L M f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M (real_cond_exp M Invariants f) /\<^sub>R Sigma_Algebra.measure M (space M)
integral\<^sup>L M (real_cond_exp M Invariants f) = integral\<^sup>L M f

goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)
[PROOF STEP]
by (simp add: divide_real_def mult.commute)
[PROOF STATE]
proof (state)
this:
AE x in M. real_cond_exp M Invariants f x = integral\<^sup>L M f / Sigma_Algebra.measure M (space M)

goal:
No subgoals!
[PROOF STEP]
qed