[STATEMENT]
lemma integrable_EM_remainder':
  fixes a b :: real and f :: "real \<Rightarrow> 'a :: banach"
  assumes "continuous_on {a..b} f"
  shows   "(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
proof (cases "\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
define a' b' where "a' = \<lceil>a\<rceil>" and "b' = \<lfloor>b\<rfloor>"
[PROOF STATE]
proof (state)
this:
a' = \<lceil>a\<rceil>
b' = \<lfloor>b\<rfloor>

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
[PROOF STEP]
have *: "a' \<le> b'" "a' \<ge> a" "b' \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>

goal (1 subgoal):
 1. a' \<le> b' &&& a \<le> real_of_int a' &&& real_of_int b' \<le> b
[PROOF STEP]
by (auto simp: a'_def b'_def)
[PROOF STATE]
proof (state)
this:
a' \<le> b'
a \<le> real_of_int a'
real_of_int b' \<le> b

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
a' \<le> b'
a \<le> real_of_int a'
real_of_int b' \<le> b
[PROOF STEP]
have A: "(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on ({a'..b'})"
[PROOF STATE]
proof (prove)
using this:
a' \<le> b'
a \<le> real_of_int a'
real_of_int b' \<le> b

goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {real_of_int a'..real_of_int b'}
[PROOF STEP]
by (intro integrable_EM_remainder'_int continuous_on_subset[OF assms]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {real_of_int a'..real_of_int b'}

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
have B: "(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on ({a..a'})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'}
[PROOF STEP]
proof (rule integrable_spike)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?f integrable_on {a..real_of_int a'}
 2. negligible ?S
 3. \<And>x. x \<in> {a..real_of_int a'} - ?S \<Longrightarrow> pbernpoly n x *\<^sub>R f x = ?f x
[PROOF STEP]
show "pbernpoly n x *\<^sub>R f x = bernpoly n (x - of_int (floor a)) *\<^sub>R f x"
         if "x \<in> {a..real_of_int a'} - {real_of_int a'}"for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
have "x \<ge> a" "x <real_of_int a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> x &&& x < real_of_int a'
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..real_of_int a'} - {real_of_int a'}

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

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
a \<le> x
x < real_of_int a'
[PROOF STEP]
have "floor x = floor a"
[PROOF STATE]
proof (prove)
using this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
a \<le> x
x < real_of_int a'

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>
[PROOF STEP]
unfolding a'_def
[PROOF STATE]
proof (prove)
using this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
a \<le> x
x < real_of_int \<lceil>a\<rceil>

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>
[PROOF STEP]
using ceiling_diff_floor_le_1[of a]
[PROOF STATE]
proof (prove)
using this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
a \<le> x
x < real_of_int \<lceil>a\<rceil>
\<lceil>a\<rceil> - \<lfloor>a\<rfloor> \<le> 1

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>
[PROOF STEP]
by (intro floor_unique; linarith)
[PROOF STATE]
proof (state)
this:
\<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
by (simp add: pbernpoly_def frac_def)
[PROOF STATE]
proof (state)
this:
pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {a..real_of_int a'} - {real_of_int a'} \<Longrightarrow> pbernpoly n ?x *\<^sub>R f ?x = bernpoly n (?x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f ?x

goal (2 subgoals):
 1. (\<lambda>x. bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x) integrable_on {a..real_of_int a'}
 2. negligible {real_of_int a'}
[PROOF STEP]
qed (insert *, auto intro!: continuous_intros integrable_continuous_real
         continuous_on_subset[OF assms])
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'}

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
have C: "(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on ({b'..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {real_of_int b'..b}
[PROOF STEP]
proof (rule integrable_spike)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?f integrable_on {real_of_int b'..b}
 2. negligible ?S
 3. \<And>x. x \<in> {real_of_int b'..b} - ?S \<Longrightarrow> pbernpoly n x *\<^sub>R f x = ?f x
[PROOF STEP]
show "pbernpoly n x *\<^sub>R f x = bernpoly n (x - of_int b') *\<^sub>R f x"
         if "x \<in> {real_of_int b'..b} - {real_of_int b'}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int b') *\<^sub>R f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int b') *\<^sub>R f x
[PROOF STEP]
have "x \<le> b" "x > real_of_int b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> b &&& real_of_int b' < x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int b'..b} - {real_of_int b'}

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

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int b') *\<^sub>R f x
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
x \<le> b
real_of_int b' < x
[PROOF STEP]
have "floor x = b'"
[PROOF STATE]
proof (prove)
using this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
x \<le> b
real_of_int b' < x

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = b'
[PROOF STEP]
unfolding b'_def
[PROOF STATE]
proof (prove)
using this:
\<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
x \<le> b
real_of_int \<lfloor>b\<rfloor> < x

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>b\<rfloor>
[PROOF STEP]
by (intro floor_unique; linarith)
[PROOF STATE]
proof (state)
this:
\<lfloor>x\<rfloor> = b'

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int b') *\<^sub>R f x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x\<rfloor> = b'

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int b') *\<^sub>R f x
[PROOF STEP]
by (simp add: pbernpoly_def frac_def)
[PROOF STATE]
proof (state)
this:
pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int b') *\<^sub>R f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {real_of_int b'..b} - {real_of_int b'} \<Longrightarrow> pbernpoly n ?x *\<^sub>R f ?x = bernpoly n (?x - real_of_int b') *\<^sub>R f ?x

goal (2 subgoals):
 1. (\<lambda>x. bernpoly n (x - real_of_int b') *\<^sub>R f x) integrable_on {real_of_int b'..b}
 2. negligible {real_of_int b'}
[PROOF STEP]
qed (insert *, auto intro!: continuous_intros integrable_continuous_real
         continuous_on_subset[OF assms])
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {real_of_int b'..b}

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
have "(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on ({a..a'} \<union> {a'..b'} \<union> {b'..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b}
[PROOF STEP]
using * A B C
[PROOF STATE]
proof (prove)
using this:
a' \<le> b'
a \<le> real_of_int a'
real_of_int b' \<le> b
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {real_of_int a'..real_of_int b'}
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'}
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {real_of_int b'..b}

goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b}
[PROOF STEP]
by (intro integrable_Un; (subst ivl_disj_un)?)
       (auto simp: ivl_disj_un max_def min_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b}

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b}

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
have "{a..a'} \<union> {a'..b'} \<union> {b'..b} = {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b} = {a..b}
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
a' \<le> b'
a \<le> real_of_int a'
real_of_int b' \<le> b

goal (1 subgoal):
 1. {a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b} = {a..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a..real_of_int a'} \<union> {real_of_int a'..real_of_int b'} \<union> {real_of_int b'..b} = {a..b}

goal (2 subgoals):
 1. \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
 2. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}

goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}

goal (1 subgoal):
 1. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
assume *: "\<not>ceiling a \<le> floor b"
[PROOF STATE]
proof (state)
this:
\<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>

goal (1 subgoal):
 1. \<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor> \<Longrightarrow> (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
proof (rule integrable_spike)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?f integrable_on {a..b}
 2. negligible ?S
 3. \<And>x. x \<in> {a..b} - ?S \<Longrightarrow> pbernpoly n x *\<^sub>R f x = ?f x
[PROOF STEP]
show "(\<lambda>t. bernpoly n (t - floor a) *\<^sub>R f t) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. bernpoly n (t - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>

goal (1 subgoal):
 1. (\<lambda>t. bernpoly n (t - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f t) integrable_on {a..b}
[PROOF STEP]
by (auto intro!: integrable_continuous_real continuous_intros assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>t. bernpoly n (t - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f t) integrable_on {a..b}

goal (2 subgoals):
 1. negligible ?S
 2. \<And>x. x \<in> {a..b} - ?S \<Longrightarrow> pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. negligible ?S
 2. \<And>x. x \<in> {a..b} - ?S \<Longrightarrow> pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
show "pbernpoly n x *\<^sub>R f x = bernpoly n (x - floor a) *\<^sub>R f x"
         if "x \<in> {a..b} - {}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
\<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
[PROOF STEP]
have **: "b < floor a + 1"
[PROOF STATE]
proof (prove)
using this:
\<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>

goal (1 subgoal):
 1. b < real_of_int (\<lfloor>a\<rfloor> + 1)
[PROOF STEP]
unfolding ceiling_altdef
[PROOF STATE]
proof (prove)
using this:
\<not> (if a = real_of_int \<lfloor>a\<rfloor> then \<lfloor>a\<rfloor> else \<lfloor>a\<rfloor> + 1) \<le> \<lfloor>b\<rfloor>

goal (1 subgoal):
 1. b < real_of_int (\<lfloor>a\<rfloor> + 1)
[PROOF STEP]
by (auto split: if_splits simp: le_floor_iff)
[PROOF STATE]
proof (state)
this:
b < real_of_int (\<lfloor>a\<rfloor> + 1)

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a..b} - {}
[PROOF STEP]
have x: "x \<ge> a" "x \<le> b"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a..b} - {}

goal (1 subgoal):
 1. a \<le> x &&& x \<le> b
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
a \<le> x
x \<le> b

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
with * **
[PROOF STATE]
proof (chain)
picking this:
\<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
b < real_of_int (\<lfloor>a\<rfloor> + 1)
a \<le> x
x \<le> b
[PROOF STEP]
have "floor x = floor a"
[PROOF STATE]
proof (prove)
using this:
\<not> \<lceil>a\<rceil> \<le> \<lfloor>b\<rfloor>
b < real_of_int (\<lfloor>a\<rfloor> + 1)
a \<le> x
x \<le> b

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x\<rfloor> = \<lfloor>a\<rfloor>

goal (1 subgoal):
 1. pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x
[PROOF STEP]
by (simp add: pbernpoly_def frac_def)
[PROOF STATE]
proof (state)
this:
pbernpoly n x *\<^sub>R f x = bernpoly n (x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> {a..b} - {} \<Longrightarrow> pbernpoly n ?x *\<^sub>R f ?x = bernpoly n (?x - real_of_int \<lfloor>a\<rfloor>) *\<^sub>R f ?x

goal (1 subgoal):
 1. negligible {}
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>t. pbernpoly n t *\<^sub>R f t) integrable_on {a..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma point_indices_singleton: "is_singleton (point_indices \<t>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_singleton (point_indices \<t>)
[PROOF STEP]
using point_indices_balanced is_singleton_the_elem
[PROOF STATE]
proof (prove)
using this:
point_indices \<t> = {\<Lambda>\<^sub>t}
is_singleton ?A = (?A = {the_elem ?A})

goal (1 subgoal):
 1. is_singleton (point_indices \<t>)
[PROOF STEP]
by simp


[STATEMENT]
lemma fps_integral0_sub:
  fixes a b :: "'a::{ring_1,inverse} fps"
  shows "fps_integral0 (a-b) = fps_integral0 a - fps_integral0 b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_integral0 (a - b) = fps_integral0 a - fps_integral0 b
[PROOF STEP]
using fps_integral0_linear2[of a 1 b "-1"]
[PROOF STATE]
proof (prove)
using this:
fps_integral0 (a * fps_const (1::'a) + b * fps_const (- (1::'a))) = fps_integral0 a * fps_const (1::'a) + fps_integral0 b * fps_const (- (1::'a))

goal (1 subgoal):
 1. fps_integral0 (a - b) = fps_integral0 a - fps_integral0 b
[PROOF STEP]
by    (simp add: fps_const_neg[symmetric])


[STATEMENT]
lemma im_submodule :
  assumes "RSubmodule N"
  shows   "RModule.RSubmodule R smult' ImG (T ` N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RModule R (\<star>) (T ` N) \<and> T ` N \<subseteq> ImG
[PROOF STEP]
proof (rule RModule.RSubmoduleI, rule RModule_Im)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Group (T ` N) \<and> T ` N \<subseteq> ImG
 2. \<And>r n. \<lbrakk>r \<in> R; n \<in> T ` N\<rbrakk> \<Longrightarrow> r \<star> n \<in> T ` N
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
RSubmodule N
[PROOF STEP]
show "Group.Subgroup (T ` M) (T ` N)"
[PROOF STATE]
proof (prove)
using this:
RSubmodule N

goal (1 subgoal):
 1. Group (T ` N) \<and> T ` N \<subseteq> ImG
[PROOF STEP]
using im_subgroup Subgroup_RSubmodule
[PROOF STATE]
proof (prove)
using this:
RSubmodule N
VecGroup.Subgroup ?H \<Longrightarrow> Group (T ` ?H) \<and> T ` ?H \<subseteq> ImG
RSubmodule ?N \<Longrightarrow> VecGroup.Subgroup ?N

goal (1 subgoal):
 1. Group (T ` N) \<and> T ` N \<subseteq> ImG
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
Group (T ` N) \<and> T ` N \<subseteq> ImG

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> T ` N\<rbrakk> \<Longrightarrow> r \<star> n \<in> T ` N
[PROOF STEP]
from assms R_map
[PROOF STATE]
proof (chain)
picking this:
RSubmodule N
\<lbrakk>?r \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> T (?r \<cdot> ?m) = ?r \<star> T ?m
[PROOF STEP]
show "\<And>r n. r \<in> R \<Longrightarrow> n \<in> T ` N \<Longrightarrow> r \<star> n \<in> T ` N"
[PROOF STATE]
proof (prove)
using this:
RSubmodule N
\<lbrakk>?r \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> T (?r \<cdot> ?m) = ?r \<star> T ?m

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> T ` N\<rbrakk> \<Longrightarrow> r \<star> n \<in> T ` N
[PROOF STEP]
using RModule.smult_closed
[PROOF STATE]
proof (prove)
using this:
RSubmodule N
\<lbrakk>?r \<in> R; ?m \<in> M\<rbrakk> \<Longrightarrow> T (?r \<cdot> ?m) = ?r \<star> T ?m
\<lbrakk>RModule ?R ?smult ?M; ?r \<in> ?R; ?m \<in> ?M\<rbrakk> \<Longrightarrow> ?smult ?r ?m \<in> ?M

goal (1 subgoal):
 1. \<And>r n. \<lbrakk>r \<in> R; n \<in> T ` N\<rbrakk> \<Longrightarrow> r \<star> n \<in> T ` N
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>?r2 \<in> R; ?n2 \<in> T ` N\<rbrakk> \<Longrightarrow> ?r2 \<star> ?n2 \<in> T ` N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ab_group_add) eq_add_iff: "x = x + y \<longleftrightarrow> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = x + y) = (y = (0::'a))
[PROOF STEP]
using add_left_imp_eq[of x y 0]
[PROOF STATE]
proof (prove)
using this:
x + y = x + (0::'a) \<Longrightarrow> y = (0::'a)

goal (1 subgoal):
 1. (x = x + y) = (y = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma closed_map_eq:
   "\<lbrakk>closed_map X X' f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> closed_map X X' g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed_map X X' f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> closed_map X X' g
[PROOF STEP]
unfolding closed_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U. closedin X U \<longrightarrow> closedin X' (f ` U); \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> \<forall>U. closedin X U \<longrightarrow> closedin X' (g ` U)
[PROOF STEP]
by (metis image_cong closedin_subset subset_iff)


[STATEMENT]
lemma deriv_const [simp]: "deriv (\<lambda>w. c) = (\<lambda>z. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>w. c) = (\<lambda>z. 0::'a)
[PROOF STEP]
by (metis DERIV_imp_deriv DERIV_const)


[STATEMENT]
lemma linepath_ball:
  assumes "x \<in> {a<--<b}"
  obtains e where "e > 0" "ball x e \<inter> {y. (y-a) \<bullet> rot(a-b) = 0} \<subseteq> {a <--< b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from eventually_at_open_segment[OF assms] assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
x \<in> {a<--<b}
[PROOF STEP]
obtain e where "0 < e" "ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at x. (y - a) \<bullet> rot (a - b) = 0 \<longrightarrow> y \<in> {a<--<b}
x \<in> {a<--<b}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: eventually_at in_open_segment_iff_rot dist_commute)
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e \<inter> {y. (y - a) \<bullet> rot (a - b) = 0} \<subseteq> {a<--<b}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma KMP_valid_max:  "\<forall> k. KMP_valid w arr bord pos \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take ((KMP w arr bord pos)!k) (drop k w)) (drop k w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. KMP_valid w arr bord pos \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord pos ! k) (drop k w)) (drop k w)
[PROOF STEP]
proof (induct
    rule: KMP.induct[of "\<lambda> w arr bord pos.
(\<forall> k. KMP_valid w arr bord pos \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take ((KMP w arr bord pos)!k) (drop k w)) (drop k w))"]
      )
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>w arr bord. \<forall>k. KMP_valid w arr bord 0 \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord 0 ! k) (drop k w)) (drop k w)
 2. \<And>w arr bord i. \<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w) \<Longrightarrow> \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)
[PROOF STEP]
case (1 w arr bord)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>w arr bord. \<forall>k. KMP_valid w arr bord 0 \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord 0 ! k) (drop k w)) (drop k w)
 2. \<And>w arr bord i. \<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w) \<Longrightarrow> \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. KMP_valid w arr bord 0 \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord 0 ! k) (drop k w)) (drop k w)
[PROOF STEP]
unfolding KMP.simps KMP_valid_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k. \<^bold>|arr\<^bold>| + 0 = \<^bold>|w\<^bold>| \<and> 0 + bord < \<^bold>|w\<^bold>| \<and> take bord (drop 0 w) \<le>p drop 0 w \<and> take bord (drop 0 w) \<le>s drop 0 w \<and> (\<forall>v. v \<le>b w ! (0 - 1) # drop 0 w \<longrightarrow> \<^bold>|v\<^bold>| \<le> Suc bord) \<and> (\<forall>k<\<^bold>|arr\<^bold>|. max_borderP (take (arr ! k) (drop (0 + k) w)) (drop (0 + k) w)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (arr ! k) (drop k w)) (drop k w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>k. KMP_valid w arr bord 0 \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord 0 ! k) (drop k w)) (drop k w)

goal (1 subgoal):
 1. \<And>w arr bord i. \<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w) \<Longrightarrow> \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w arr bord i. \<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w) \<Longrightarrow> \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)
[PROOF STEP]
case (2 w arr bord i)
[PROOF STATE]
proof (state)
this:
\<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)

goal (1 subgoal):
 1. \<And>w arr bord i. \<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w) \<Longrightarrow> \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)

goal (1 subgoal):
 1. \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)
[PROOF STEP]
unfolding KMP.simps
[PROOF STATE]
proof (prove)
using this:
\<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)

goal (1 subgoal):
 1. \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)
[PROOF STEP]
using KMP_valid_step
[PROOF STATE]
proof (prove)
using this:
\<forall>k. KMP_valid w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)
KMP_valid ?w ?arr ?bord (Suc ?i) \<Longrightarrow> KMP_valid ?w (KMP_arr ?w ?arr ?bord (Suc ?i)) (KMP_bord ?w ?arr ?bord (Suc ?i)) (KMP_pos ?w ?arr ?bord (Suc ?i))

goal (1 subgoal):
 1. \<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w (KMP_arr w arr bord (Suc i)) (KMP_bord w arr bord (Suc i)) (KMP_pos w arr bord (Suc i)) ! k) (drop k w)) (drop k w)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>k. KMP_valid w arr bord (Suc i) \<longrightarrow> k < \<^bold>|w\<^bold>| \<longrightarrow> max_borderP (take (KMP w arr bord (Suc i) ! k) (drop k w)) (drop k w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_le_suminf:
  shows "summable f \<Longrightarrow> finite I \<Longrightarrow> (\<And>n. n \<in>- I \<Longrightarrow> 0 \<le> f n) \<Longrightarrow> sum f I \<le> suminf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; finite I; \<And>n. n \<in> - I \<Longrightarrow> (0::'a) \<le> f n\<rbrakk> \<Longrightarrow> sum f I \<le> suminf f
[PROOF STEP]
by (rule sums_le[OF _ sums_If_finite_set summable_sums]) auto


[STATEMENT]
lemma scalar_prod_valuation_after_split_equiv1:
  assumes "(x,y) = split_i_j_x (dim_vec (lpoly_to_vec v)) l X"
  shows "(lpoly_to_vec v) \<bullet> x = (v \<lbrace>\<langle>X\<rangle>\<rbrace>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
from valuate_with_dim_poly[of v "\<langle>X\<rangle>", symmetric]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<dim_poly v. Abstract_Linear_Poly.coeff v i * \<langle>X\<rangle> i) = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
have 1: "(v \<lbrace>\<langle>X\<rangle>\<rbrace>) = (\<Sum>i = 0..<dim_poly v. Abstract_Linear_Poly.coeff v i * \<langle>X\<rangle> i)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<dim_poly v. Abstract_Linear_Poly.coeff v i * \<langle>X\<rangle> i) = v \<lbrace> \<langle>X\<rangle> \<rbrace>

goal (1 subgoal):
 1. v \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>i = 0..<dim_poly v. Abstract_Linear_Poly.coeff v i * \<langle>X\<rangle> i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>i = 0..<dim_poly v. Abstract_Linear_Poly.coeff v i * \<langle>X\<rangle> i)

goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
have "(\<Sum>i = 0..<dim_vec x. (lpoly_to_vec v) $ i * \<langle>X\<rangle> i) =
    (\<Sum>i = 0..<dim_vec x. (lpoly_to_vec v) $ i * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * \<langle>X\<rangle> i) = (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i)
[PROOF STEP]
by (metis (no_types, lifting) assms split_access_fst_1 split_vec_dims(1) sum.ivl_cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * \<langle>X\<rangle> i) = (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i)

goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * \<langle>X\<rangle> i) = (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i)

goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
have "... =  (lpoly_to_vec v) \<bullet> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i) = lpoly_to_vec v \<bullet> x
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i) = (\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * x $ i) = lpoly_to_vec v \<bullet> x

goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * \<langle>X\<rangle> i) = lpoly_to_vec v \<bullet> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<dim_vec x. lpoly_to_vec v $ i * \<langle>X\<rangle> i) = lpoly_to_vec v \<bullet> x

goal (1 subgoal):
 1. lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
by (metis (no_types, lifting) "1" dim_poly_dim_vec_equiv lin_poly_to_vec_coeff_access
        split_vec_dims(1) sum.ivl_cong assms)
[PROOF STATE]
proof (state)
this:
lpoly_to_vec v \<bullet> x = v \<lbrace> \<langle>X\<rangle> \<rbrace>

goal:
No subgoals!
[PROOF STEP]
qed