[STATEMENT]
theorem select_rec_partition:
  assumes "k < length xs"
  shows "select k xs = (
           let (ls, es, gs) = partition3 x xs
           in
             if k < length ls then select k ls
             else if k < length ls + length es then x
             else select (k - length ls - length es) gs
          )" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
define ls es gs where "ls = filter (\<lambda>y. y < x) xs" and "es = filter (\<lambda>y. y = x) xs"
                    and "gs = filter (\<lambda>y. y > x) xs"
[PROOF STATE]
proof (state)
this:
ls = filter (\<lambda>y. y < x) xs
es = filter (\<lambda>y. y = x) xs
gs = filter ((<) x) xs

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
define nl ne where [simp]: "nl = length ls" "ne = length es"
[PROOF STATE]
proof (state)
this:
nl = length ls
ne = length es

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have mset_eq: "mset xs = mset ls + mset es + mset gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset xs = mset ls + mset es + mset gs
[PROOF STEP]
unfolding ls_def es_def gs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset xs = mset (filter (\<lambda>y. y < x) xs) + mset (filter (\<lambda>y. y = x) xs) + mset (filter ((<) x) xs)
[PROOF STEP]
by (induction xs) auto
[PROOF STATE]
proof (state)
this:
mset xs = mset ls + mset es + mset gs

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have length_eq: "length xs = length ls + length es + length gs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ls + length es + length gs
[PROOF STEP]
unfolding ls_def es_def gs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length (filter (\<lambda>y. y < x) xs) + length (filter (\<lambda>y. y = x) xs) + length (filter ((<) x) xs)
[PROOF STEP]
using [[simp_depth_limit = 1]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length (filter (\<lambda>y. y < x) xs) + length (filter (\<lambda>y. y = x) xs) + length (filter ((<) x) xs)
[PROOF STEP]
by (induction xs) auto
[PROOF STATE]
proof (state)
this:
length xs = length ls + length es + length gs

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have [simp]: "select i es = x" if "i < length es" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select i es = x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. select i es = x
[PROOF STEP]
have "select i es \<in> set (sort es)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select i es \<in> set (sort es)
[PROOF STEP]
unfolding select_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sort es ! i \<in> set (sort es)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
i < length es

goal (1 subgoal):
 1. sort es ! i \<in> set (sort es)
[PROOF STEP]
by (intro nth_mem) auto
[PROOF STATE]
proof (state)
this:
select i es \<in> set (sort es)

goal (1 subgoal):
 1. select i es = x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
select i es \<in> set (sort es)

goal (1 subgoal):
 1. select i es = x
[PROOF STEP]
by (auto simp: es_def)
[PROOF STATE]
proof (state)
this:
select i es = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i < length es \<Longrightarrow> select ?i es = x

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have "select k xs = select k (ls @ (es @ gs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k xs = select k (ls @ es @ gs)
[PROOF STEP]
by (intro select_mset_cong) (simp_all add: mset_eq)
[PROOF STATE]
proof (state)
this:
select k xs = select k (ls @ es @ gs)

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
select k xs = select k (ls @ es @ gs)

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have "\<dots> = (if k < nl then select k ls else select (k - nl) (es @ gs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k (ls @ es @ gs) = (if k < nl then select k ls else select (k - nl) (es @ gs))
[PROOF STEP]
unfolding nl_ne_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select k (ls @ es @ gs) = (if k < length ls then select k ls else select (k - length ls) (es @ gs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k < length xs

goal (1 subgoal):
 1. select k (ls @ es @ gs) = (if k < length ls then select k ls else select (k - length ls) (es @ gs))
[PROOF STEP]
by (intro select_append') (auto simp: ls_def es_def gs_def length_eq)
[PROOF STATE]
proof (state)
this:
select k (ls @ es @ gs) = (if k < nl then select k ls else select (k - nl) (es @ gs))

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
select k (ls @ es @ gs) = (if k < nl then select k ls else select (k - nl) (es @ gs))

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have "\<dots> = (if k < nl then select k ls else if k < nl + ne then x
                    else select (k - nl - ne) gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if k < nl then select k ls else select (k - nl) (es @ gs)) = (if k < nl then select k ls else if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
proof (rule if_cong)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (k < nl) = (k < nl)
 2. k < nl \<Longrightarrow> select k ls = select k ls
 3. \<not> k < nl \<Longrightarrow> select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
assume "\<not>k < nl"
[PROOF STATE]
proof (state)
this:
\<not> k < nl

goal (3 subgoals):
 1. (k < nl) = (k < nl)
 2. k < nl \<Longrightarrow> select k ls = select k ls
 3. \<not> k < nl \<Longrightarrow> select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
have "select (k - nl) (es @ gs) =
                 (if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select (k - nl) (es @ gs) = (if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs)
[PROOF STEP]
unfolding nl_ne_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. select (k - length ls) (es @ gs) = (if k - length ls < length es then select (k - length ls) es else select (k - length ls - length es) gs)
[PROOF STEP]
using assms \<open>\<not>k < nl\<close>
[PROOF STATE]
proof (prove)
using this:
k < length xs
\<not> k < nl

goal (1 subgoal):
 1. select (k - length ls) (es @ gs) = (if k - length ls < length es then select (k - length ls) es else select (k - length ls - length es) gs)
[PROOF STEP]
by (intro select_append') (auto simp: ls_def es_def gs_def length_eq)
[PROOF STATE]
proof (state)
this:
select (k - nl) (es @ gs) = (if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs)

goal (3 subgoals):
 1. (k < nl) = (k < nl)
 2. k < nl \<Longrightarrow> select k ls = select k ls
 3. \<not> k < nl \<Longrightarrow> select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
select (k - nl) (es @ gs) = (if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs)

goal (3 subgoals):
 1. (k < nl) = (k < nl)
 2. k < nl \<Longrightarrow> select k ls = select k ls
 3. \<not> k < nl \<Longrightarrow> select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
have "\<dots> = (if k < nl + ne then x else select (k - nl - ne) gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
using \<open>\<not>k < nl\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> k < nl

goal (1 subgoal):
 1. (if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if k - nl < ne then select (k - nl) es else select (k - nl - ne) gs) = (if k < nl + ne then x else select (k - nl - ne) gs)

goal (3 subgoals):
 1. (k < nl) = (k < nl)
 2. k < nl \<Longrightarrow> select k ls = select k ls
 3. \<not> k < nl \<Longrightarrow> select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
show "select (k - nl) (es @ gs) = \<dots>"
[PROOF STATE]
proof (prove)
using this:
select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)

goal (1 subgoal):
 1. select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
select (k - nl) (es @ gs) = (if k < nl + ne then x else select (k - nl - ne) gs)

goal (2 subgoals):
 1. (k < nl) = (k < nl)
 2. k < nl \<Longrightarrow> select k ls = select k ls
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
(if k < nl then select k ls else select (k - nl) (es @ gs)) = (if k < nl then select k ls else if k < nl + ne then x else select (k - nl - ne) gs)

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(if k < nl then select k ls else select (k - nl) (es @ gs)) = (if k < nl then select k ls else if k < nl + ne then x else select (k - nl - ne) gs)

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if k < nl then select k ls else if k < nl + ne then x else select (k - nl - ne) gs) = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
by (simp add: partition3_def ls_def es_def gs_def)
[PROOF STATE]
proof (state)
this:
(if k < nl then select k ls else if k < nl + ne then x else select (k - nl - ne) gs) = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)

goal (1 subgoal):
 1. select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
select k xs = (let (ls, es, gs) = partition3 x xs in if k < length ls then select k ls else if k < length ls + length es then x else select (k - length ls - length es) gs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upper_circle_rescale: assumes "l < r"
  shows "upper_circle l r = (\<lambda> x . (x*(r - l) + l)) ` upper_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_circle l r = (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. upper_circle l r \<subseteq> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01
 2. (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01 \<subseteq> upper_circle l r
[PROOF STEP]
show "upper_circle l r \<subseteq>
        (\<lambda>x. x * (of_real r - of_real l) + of_real l) ` upper_circle_01"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper_circle l r \<subseteq> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle l r \<Longrightarrow> x \<in> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01
[PROOF STEP]
apply (rule image_eqI[of _ _ "(_ - of_real l)/(of_real r - of_real l)"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> upper_circle l r \<Longrightarrow> x = (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) * (complex_of_real r - complex_of_real l) + complex_of_real l
 2. \<And>x. x \<in> upper_circle l r \<Longrightarrow> (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) \<in> upper_circle_01
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < r

goal (2 subgoals):
 1. \<And>x. x \<in> upper_circle l r \<Longrightarrow> x = (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) * (complex_of_real r - complex_of_real l) + complex_of_real l
 2. \<And>x. x \<in> upper_circle l r \<Longrightarrow> (?uu7 x - complex_of_real l) / (complex_of_real r - complex_of_real l) \<in> upper_circle_01
[PROOF STEP]
apply (auto simp: divide_simps)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> upper_circle l r \<Longrightarrow> (x - complex_of_real l) / (complex_of_real r - complex_of_real l) \<in> upper_circle_01
[PROOF STEP]
by (auto simp: upper_circle_01_def upper_circle_def)
[PROOF STATE]
proof (state)
this:
upper_circle l r \<subseteq> (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01

goal (1 subgoal):
 1. (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01 \<subseteq> upper_circle l r
[PROOF STEP]
show "(\<lambda>x. x * (of_real r - of_real l) + of_real l) ` upper_circle_01 \<subseteq>
        upper_circle l r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01 \<subseteq> upper_circle l r
[PROOF STEP]
apply (rule subsetI, subst(asm) image_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<exists>xa\<in>upper_circle_01. x = xa * (complex_of_real r - complex_of_real l) + complex_of_real l \<Longrightarrow> x \<in> upper_circle l r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < r

goal (1 subgoal):
 1. \<And>x. \<exists>xa\<in>upper_circle_01. x = xa * (complex_of_real r - complex_of_real l) + complex_of_real l \<Longrightarrow> x \<in> upper_circle l r
[PROOF STEP]
by (auto simp: upper_circle_01_def upper_circle_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x * (complex_of_real r - complex_of_real l) + complex_of_real l) ` upper_circle_01 \<subseteq> upper_circle l r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_limsup_lim_add:
  fixes u v::"nat \<Rightarrow> ereal"
  assumes "u \<longlonglongrightarrow> a" "abs(a) \<noteq> \<infinity>"
  shows "limsup (\<lambda>n. u n + v n) = a + limsup v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have "limsup u = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup u = a
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a

goal (1 subgoal):
 1. limsup u = a
[PROOF STEP]
using tendsto_iff_Liminf_eq_Limsup trivial_limit_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
?F \<noteq> bot \<Longrightarrow> (?f \<longlongrightarrow> ?f0.0) ?F = (Liminf ?F ?f = ?f0.0 \<and> Limsup ?F ?f = ?f0.0)
at_top \<noteq> bot

goal (1 subgoal):
 1. limsup u = a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
limsup u = a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have "(\<lambda>n. -u n) \<longlonglongrightarrow> -a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. - u n) \<longlonglongrightarrow> - a
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a

goal (1 subgoal):
 1. (\<lambda>n. - u n) \<longlonglongrightarrow> - a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. - u n) \<longlonglongrightarrow> - a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. - u n) \<longlonglongrightarrow> - a
[PROOF STEP]
have "limsup (\<lambda>n. -u n) = -a"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - u n) \<longlonglongrightarrow> - a

goal (1 subgoal):
 1. limsup (\<lambda>n. - u n) = - a
[PROOF STEP]
using tendsto_iff_Liminf_eq_Limsup trivial_limit_at_top_linorder
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - u n) \<longlonglongrightarrow> - a
?F \<noteq> bot \<Longrightarrow> (?f \<longlongrightarrow> ?f0.0) ?F = (Liminf ?F ?f = ?f0.0 \<and> Limsup ?F ?f = ?f0.0)
at_top \<noteq> bot

goal (1 subgoal):
 1. limsup (\<lambda>n. - u n) = - a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. - u n) = - a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have "limsup (\<lambda>n. u n + v n) \<le> limsup u + limsup v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) \<le> limsup u + limsup v
[PROOF STEP]
by (rule ereal_limsup_add_mono)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u n + v n) \<le> limsup u + limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>n. u n + v n) \<le> limsup u + limsup v
[PROOF STEP]
have up: "limsup (\<lambda>n. u n + v n) \<le> a + limsup v"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. u n + v n) \<le> limsup u + limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) \<le> a + limsup v
[PROOF STEP]
using \<open>limsup u = a\<close>
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. u n + v n) \<le> limsup u + limsup v
limsup u = a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) \<le> a + limsup v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u n + v n) \<le> a + limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have a: "limsup (\<lambda>n. (u n + v n) + (-u n)) \<le> limsup (\<lambda>n. u n + v n) + limsup (\<lambda>n. -u n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n + - u n) \<le> limsup (\<lambda>n. u n + v n) + limsup (\<lambda>n. - u n)
[PROOF STEP]
by (rule ereal_limsup_add_mono)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u n + v n + - u n) \<le> limsup (\<lambda>n. u n + v n) + limsup (\<lambda>n. - u n)

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have "eventually (\<lambda>n. u n = ereal(real_of_ereal(u n))) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
[PROOF STEP]
using assms
    real_lim_then_eventually_real
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> a
\<bar>a\<bar> \<noteq> \<infinity>
(?u \<longlongrightarrow> ereal ?l) ?F \<Longrightarrow> \<forall>\<^sub>F n in ?F. ?u n = ereal (real_of_ereal (?u n))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have "\<And>x. x = ereal(real_of_ereal(x)) \<Longrightarrow> x + (-x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x = ereal (real_of_ereal x) \<Longrightarrow> x + - x = 0
[PROOF STEP]
by (metis plus_ereal.simps(1) right_minus uminus_ereal.simps(1) zero_ereal_def)
[PROOF STATE]
proof (state)
this:
?x = ereal (real_of_ereal ?x) \<Longrightarrow> ?x + - ?x = 0

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
?x = ereal (real_of_ereal ?x) \<Longrightarrow> ?x + - ?x = 0
[PROOF STEP]
have "eventually (\<lambda>n. u n + (-u n) = 0) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n = ereal (real_of_ereal (u n))
?x = ereal (real_of_ereal ?x) \<Longrightarrow> ?x + - ?x = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n + - u n = 0
[PROOF STEP]
by (metis (mono_tags, lifting) eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
have "\<And>n. u n + (-u n) = 0 \<Longrightarrow> u n + v n + (-u n) = v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. u n + - u n = 0 \<Longrightarrow> u n + v n + - u n = v n
[PROOF STEP]
by (metis add.commute add.left_commute add.left_neutral)
[PROOF STATE]
proof (state)
this:
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n
[PROOF STEP]
have "eventually (\<lambda>n. u n + v n + (-u n) = v n) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
[PROOF STEP]
using eventually_mono
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + - u n = 0
u ?n + - u ?n = 0 \<Longrightarrow> u ?n + v ?n + - u ?n = v ?n
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
[PROOF STEP]
have "limsup v = limsup (\<lambda>n. u n + v n + (-u n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n

goal (1 subgoal):
 1. limsup v = limsup (\<lambda>n. u n + v n + - u n)
[PROOF STEP]
using Limsup_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. u n + v n + - u n = v n
\<forall>\<^sub>F x in ?net. ?f x = ?g x \<Longrightarrow> Limsup ?net ?f = Limsup ?net ?g

goal (1 subgoal):
 1. limsup v = limsup (\<lambda>n. u n + v n + - u n)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
limsup v = limsup (\<lambda>n. u n + v n + - u n)

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup v = limsup (\<lambda>n. u n + v n + - u n)
[PROOF STEP]
have "limsup v \<le> limsup (\<lambda>n. u n + v n) -a"
[PROOF STATE]
proof (prove)
using this:
limsup v = limsup (\<lambda>n. u n + v n + - u n)

goal (1 subgoal):
 1. limsup v \<le> limsup (\<lambda>n. u n + v n) - a
[PROOF STEP]
using a \<open>limsup (\<lambda>n. -u n) = -a\<close>
[PROOF STATE]
proof (prove)
using this:
limsup v = limsup (\<lambda>n. u n + v n + - u n)
limsup (\<lambda>n. u n + v n + - u n) \<le> limsup (\<lambda>n. u n + v n) + limsup (\<lambda>n. - u n)
limsup (\<lambda>n. - u n) = - a

goal (1 subgoal):
 1. limsup v \<le> limsup (\<lambda>n. u n + v n) - a
[PROOF STEP]
by (simp add: minus_ereal_def)
[PROOF STATE]
proof (state)
this:
limsup v \<le> limsup (\<lambda>n. u n + v n) - a

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup v \<le> limsup (\<lambda>n. u n + v n) - a
[PROOF STEP]
have "limsup (\<lambda>n. u n + v n) \<ge> a + limsup v"
[PROOF STATE]
proof (prove)
using this:
limsup v \<le> limsup (\<lambda>n. u n + v n) - a

goal (1 subgoal):
 1. a + limsup v \<le> limsup (\<lambda>n. u n + v n)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
limsup v \<le> limsup (\<lambda>n. u n + v n) - a
\<bar>a\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. a + limsup v \<le> limsup (\<lambda>n. u n + v n)
[PROOF STEP]
by (metis add.commute ereal_le_minus)
[PROOF STATE]
proof (state)
this:
a + limsup v \<le> limsup (\<lambda>n. u n + v n)

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a + limsup v \<le> limsup (\<lambda>n. u n + v n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a + limsup v \<le> limsup (\<lambda>n. u n + v n)

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
using up
[PROOF STATE]
proof (prove)
using this:
a + limsup v \<le> limsup (\<lambda>n. u n + v n)
limsup (\<lambda>n. u n + v n) \<le> a + limsup v

goal (1 subgoal):
 1. limsup (\<lambda>n. u n + v n) = a + limsup v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u n + v n) = a + limsup v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_minus_cancel [simp]: "norm (- x) = norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (- x) = norm x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (- x) = norm x
[PROOF STEP]
have "- 1 *\<^sub>R x = - (1 *\<^sub>R x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 1 *\<^sub>R x = - (1 *\<^sub>R x)
[PROOF STEP]
unfolding add_eq_0_iff2[symmetric] scaleR_add_left[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1 + 1) *\<^sub>R x = (0::'a)
[PROOF STEP]
using norm_eq_zero
[PROOF STATE]
proof (prove)
using this:
(norm ?x = 0) = (?x = (0::'a))

goal (1 subgoal):
 1. (- 1 + 1) *\<^sub>R x = (0::'a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
- 1 *\<^sub>R x = - (1 *\<^sub>R x)

goal (1 subgoal):
 1. norm (- x) = norm x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- 1 *\<^sub>R x = - (1 *\<^sub>R x)
[PROOF STEP]
have "norm (- x) = norm (scaleR (- 1) x)"
[PROOF STATE]
proof (prove)
using this:
- 1 *\<^sub>R x = - (1 *\<^sub>R x)

goal (1 subgoal):
 1. norm (- x) = norm (- 1 *\<^sub>R x)
[PROOF STEP]
by (simp only: scaleR_one)
[PROOF STATE]
proof (state)
this:
norm (- x) = norm (- 1 *\<^sub>R x)

goal (1 subgoal):
 1. norm (- x) = norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (- x) = norm (- 1 *\<^sub>R x)

goal (1 subgoal):
 1. norm (- x) = norm x
[PROOF STEP]
have "\<dots> = \<bar>- 1\<bar> * norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (- 1 *\<^sub>R x) = \<bar>- 1\<bar> * norm x
[PROOF STEP]
by (rule norm_scaleR)
[PROOF STATE]
proof (state)
this:
norm (- 1 *\<^sub>R x) = \<bar>- 1\<bar> * norm x

goal (1 subgoal):
 1. norm (- x) = norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (- x) = \<bar>- 1\<bar> * norm x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (- x) = \<bar>- 1\<bar> * norm x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card2_get2: assumes "card x = 2"
  obtains a b where  "x = {a, b}" "a \<noteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
card x = 2
[PROOF STEP]
have [simp,intro!]: "finite x"
[PROOF STATE]
proof (prove)
using this:
card x = 2

goal (1 subgoal):
 1. finite x
[PROOF STEP]
apply(rule_tac ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>card x = 2; infinite x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite x

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
card x = 2
[PROOF STEP]
obtain a where ax: "a \<in> x"
[PROOF STATE]
proof (prove)
using this:
card x = 2

goal (1 subgoal):
 1. (\<And>a. a \<in> x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a \<in> x

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
card x = 2
a \<in> x
[PROOF STEP]
have "card (x - {a}) = 1"
[PROOF STATE]
proof (prove)
using this:
card x = 2
a \<in> x

goal (1 subgoal):
 1. card (x - {a}) = 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
card (x - {a}) = 1

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (x - {a}) = 1
[PROOF STEP]
obtain b where "x - {a} = {b}" "a \<noteq> b"
[PROOF STATE]
proof (prove)
using this:
card (x - {a}) = 1

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>x - {a} = {b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Diff_cancel Diff_idemp card_1_singletonE insert_not_empty)
[PROOF STATE]
proof (state)
this:
x - {a} = {b}
a \<noteq> b

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = {a, b}; a \<noteq> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with that ax
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x = {?a, ?b}; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> thesis
a \<in> x
x - {a} = {b}
a \<noteq> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = {?a, ?b}; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> thesis
a \<in> x
x - {a} = {b}
a \<noteq> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_restriction_comp: "
  \<lbrakk> set_restriction f; set_restriction g \<rbrakk> \<Longrightarrow> set_restriction (f \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set_restriction f; set_restriction g\<rbrakk> \<Longrightarrow> set_restriction (f \<circ> g)
[PROOF STEP]
apply (unfold set_restriction_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>P. \<forall>A. f A = {x \<in> A. P x}; \<exists>P. \<forall>A. g A = {x \<in> A. P x}\<rbrakk> \<Longrightarrow> \<exists>P. \<forall>A. (f \<circ> g) A = {x \<in> A. P x}
[PROOF STEP]
apply (elim exE, rename_tac P1 P2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P1 P2. \<lbrakk>\<forall>A. f A = {x \<in> A. P1 x}; \<forall>A. g A = {x \<in> A. P2 x}\<rbrakk> \<Longrightarrow> \<exists>P. \<forall>A. (f \<circ> g) A = {x \<in> A. P x}
[PROOF STEP]
apply (rule_tac x="\<lambda>x. P1 x \<and> P2 x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P1 P2. \<lbrakk>\<forall>A. f A = {x \<in> A. P1 x}; \<forall>A. g A = {x \<in> A. P2 x}\<rbrakk> \<Longrightarrow> \<forall>A. (f \<circ> g) A = {x \<in> A. P1 x \<and> P2 x}
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma rref_upt_condition3_explicit:
assumes "reduced_row_echelon_form_upt_k A k"
and "i < i + 1"
and "\<not> is_zero_row_upt_k i k A"
and "\<not> is_zero_row_upt_k (i + 1) k A "
shows "(LEAST n. A $ i $ n \<noteq> 0) < (LEAST n. A $ (i + 1) $ n \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
using assms rref_upt_condition3
[PROOF STATE]
proof (prove)
using this:
reduced_row_echelon_form_upt_k A k
i < i + (1::'c)
\<not> is_zero_row_upt_k i k A
\<not> is_zero_row_upt_k (i + (1::'c)) k A
reduced_row_echelon_form_upt_k ?A ?k \<Longrightarrow> \<forall>i. i < i + (1::?'c) \<and> \<not> is_zero_row_upt_k i ?k ?A \<and> \<not> is_zero_row_upt_k (i + (1::?'c)) ?k ?A \<longrightarrow> (LEAST n. ?A $ i $ n \<noteq> (0::?'a)) < (LEAST n. ?A $ (i + (1::?'c)) $ n \<noteq> (0::?'a))

goal (1 subgoal):
 1. (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ (i + (1::'c)) $ n \<noteq> (0::'a))
[PROOF STEP]
by blast


[STATEMENT]
lemma aff_dim_convex_Int_open:
  fixes S :: "'a::euclidean_space set"
  shows "\<lbrakk>convex S; open T; S \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow>  aff_dim(S \<inter> T) = aff_dim S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>convex S; open T; S \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> T) = aff_dim S
[PROOF STEP]
using aff_dim_convex_Int_nonempty_interior interior_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>convex ?S; ?S \<inter> interior ?T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (?S \<inter> ?T) = aff_dim ?S
(interior ?S = ?S) = open ?S

goal (1 subgoal):
 1. \<lbrakk>convex S; open T; S \<inter> T \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> T) = aff_dim S
[PROOF STEP]
by blast


[STATEMENT]
lemma Bernstein_Poly_altdef:
  assumes "c \<noteq> d" and "j \<le> p"
  shows "Bernstein_Poly j p c d = smult (p choose j)
            ([:-c/(d-c), 1/(d-c):]^j * [:d/(d-c), -1/(d-c):]^(p-j))"
    (is "?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
have "?L = smult (p choose j) (smult ((1/(d - c))^j)
        (smult ((1/(d - c))^(p-j)) ([:-c, 1:]^j * [:d, -1:]^(p-j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) (smult ((1 / (d - c)) ^ (p - j)) ([:- c, 1:] ^ j * [:d, - 1:] ^ (p - j))))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d
j \<le> p

goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) (smult ((1 / (d - c)) ^ (p - j)) ([:- c, 1:] ^ j * [:d, - 1:] ^ (p - j))))
[PROOF STEP]
by (auto simp: Bernstein_Poly_def monom_altdef hom_distribs
                    pcompose_pCons smult_eq_iff field_simps power_add[symmetric])
[PROOF STATE]
proof (state)
this:
Bernstein_Poly j p c d = smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) (smult ((1 / (d - c)) ^ (p - j)) ([:- c, 1:] ^ j * [:d, - 1:] ^ (p - j))))

goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Bernstein_Poly j p c d = smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) (smult ((1 / (d - c)) ^ (p - j)) ([:- c, 1:] ^ j * [:d, - 1:] ^ (p - j))))

goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
have "... = ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) (smult ((1 / (d - c)) ^ (p - j)) ([:- c, 1:] ^ j * [:d, - 1:] ^ (p - j)))) = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
apply (subst mult_smult_right[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) ([:- c, 1:] ^ j * smult ((1 / (d - c)) ^ (p - j)) ([:d, - 1:] ^ (p - j)))) = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
apply (subst mult_smult_left[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) ([:- c, 1:] ^ j) * smult ((1 / (d - c)) ^ (p - j)) ([:d, - 1:] ^ (p - j))) = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
apply (subst smult_power)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (real (p choose j)) (smult (1 / (d - c)) [:- c, 1:] ^ j * smult ((1 / (d - c)) ^ (p - j)) ([:d, - 1:] ^ (p - j))) = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
apply (subst smult_power)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smult (real (p choose j)) (smult (1 / (d - c)) [:- c, 1:] ^ j * smult (1 / (d - c)) [:d, - 1:] ^ (p - j)) = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
smult (real (p choose j)) (smult ((1 / (d - c)) ^ j) (smult ((1 / (d - c)) ^ (p - j)) ([:- c, 1:] ^ j * [:d, - 1:] ^ (p - j)))) = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))

goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))

goal (1 subgoal):
 1. Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Bernstein_Poly j p c d = smult (real (p choose j)) ([:- c / (d - c), 1 / (d - c):] ^ j * [:d / (d - c), - 1 / (d - c):] ^ (p - j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_pcompose_x_pow_n: fixes f :: "'a :: comm_ring_1 poly"
  assumes n: "n \<noteq> 0"
  shows "coeff (f \<circ>\<^sub>p monom 1 n) (n * i) = coeff f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (f \<circ>\<^sub>p monom (1::'a) n) (n * i) = coeff f i
[PROOF STEP]
using coeff_pcompose_monom[of 0 n f i] n
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> coeff (f \<circ>\<^sub>p monom (1::'a) n) (n * i + 0) = (if 0 = 0 then coeff f i else (0::'a))
n \<noteq> 0

goal (1 subgoal):
 1. coeff (f \<circ>\<^sub>p monom (1::'a) n) (n * i) = coeff f i
[PROOF STEP]
by auto


[STATEMENT]
lemma upper_bound_sharp:
  "k > 0 \<Longrightarrow> t = full_tree k a h \<Longrightarrow> height t = h \<and> root_order k t \<and> bal t \<and> ((2*k+1)^(height t) - 1) = nodes t * (2*k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; t = full_tree k a h\<rbrakk> \<Longrightarrow> height t = h \<and> root_order k t \<and> bal t \<and> bound (2 * k) (height t) = nodes t * (2 * k)
[PROOF STEP]
unfolding full_tree_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; t = full_node k a h\<rbrakk> \<Longrightarrow> height t = h \<and> root_order k t \<and> bal t \<and> bound (2 * k) (height t) = nodes t * (2 * k)
[PROOF STEP]
using order_impl_root_order[of k t]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < k; order k t\<rbrakk> \<Longrightarrow> root_order k t

goal (1 subgoal):
 1. \<lbrakk>0 < k; t = full_node k a h\<rbrakk> \<Longrightarrow> height t = h \<and> root_order k t \<and> bal t \<and> bound (2 * k) (height t) = nodes t * (2 * k)
[PROOF STEP]
by (simp add: bal_full_node height_full_node order_full_node full_btrees_sharp)


[STATEMENT]
lemma right_ideal_minus:
  assumes "right_ideal I"
  and "a\<in>I" and "b\<in>I"
  shows "a - b \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - b \<in> I
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) diff_minus_eq_add minus_minus right_ideal_def subgroup_def)


[STATEMENT]
lemma ennreal_sum_less_top[simp]:
  fixes f :: "'a \<Rightarrow> ennreal"
  shows "finite I \<Longrightarrow> (\<Sum>i\<in>I. f i) < top \<longleftrightarrow> (\<forall>i\<in>I. f i < top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> (sum f I < top) = (\<forall>i\<in>I. f i < top)
[PROOF STEP]
by (induction I rule: finite_induct) auto


[STATEMENT]
lemma bit_split_inv: "bit_concat (high x d) (low x d) d = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit_concat (high x d) (low x d) d = x
[PROOF STEP]
unfolding bit_concat_def high_def low_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x div 2 ^ d * 2 ^ d + x mod 2 ^ d = x
[PROOF STEP]
by presburger


[STATEMENT]
lemma integrable_on_localized_vector_derivative:
    "(\<lambda>x. f (g x) * vector_derivative p (at x within {a..b})) integrable_on {a..b} \<longleftrightarrow>
     (\<lambda>x. f (g x) * vector_derivative p (at x)) integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x) * vector_derivative p (at x within {a..b})) integrable_on {a..b}) = ((\<lambda>x. f (g x) * vector_derivative p (at x)) integrable_on {a..b})
[PROOF STEP]
by (simp add: integrable_on_def has_integral_localized_vector_derivative)


[STATEMENT]
lemma partition_on_mset_combine:
  assumes "partition_on_mset A P"
  assumes "partition_on_mset B Q"
  shows "partition_on_mset (A + B) (P + Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_on_mset (A + B) (P + Q)
[PROOF STEP]
unfolding partition_on_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum>\<^sub># (P + Q) = A + B \<and> {#} \<notin># P + Q
[PROOF STEP]
using assms partition_on_msetD1 partition_on_msetD2
[PROOF STATE]
proof (prove)
using this:
partition_on_mset A P
partition_on_mset B Q
partition_on_mset ?A ?P \<Longrightarrow> \<Sum>\<^sub># ?P = ?A
partition_on_mset ?A ?P \<Longrightarrow> {#} \<notin># ?P

goal (1 subgoal):
 1. \<Sum>\<^sub># (P + Q) = A + B \<and> {#} \<notin># P + Q
[PROOF STEP]
by auto


[STATEMENT]
lemma matrix_add_rdistrib: "((B + C) ** A) = (B ** A) + (C ** A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (B + C) ** A = B ** A + C ** A
[PROOF STEP]
by (vector matrix_matrix_mult_def sum.distrib[symmetric] field_simps)


[STATEMENT]
lemma countable_iff_less_\<omega>1:
  assumes "Ord \<alpha>"
  shows "countable (elts \<alpha>) \<longleftrightarrow> \<alpha> < \<omega>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable (elts \<alpha>) = (\<alpha> < \<omega>1)
[PROOF STEP]
by (simp add: assms countable_iff_le_Aleph0 lt_csucc_iff one_V_def)


[STATEMENT]
lemma neg_numeral_plus_neg_numeral:
  "- Num.numeral m + - Num.numeral n = (- Num.numeral (m + n) ::'a::neg_numeral)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - numeral m + - numeral n = - numeral (m + n)
[PROOF STEP]
by simp


[STATEMENT]
lemma fact_less_mono_nat: "0 < m \<Longrightarrow> m < n \<Longrightarrow> fact m < (fact n :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m < n\<rbrakk> \<Longrightarrow> fact m < fact n
[PROOF STEP]
by (induct n) (auto simp: less_Suc_eq)


[STATEMENT]
lemma finite_mset_set_inter:
  \<open>finite A \<Longrightarrow> finite B \<Longrightarrow> mset_set (A \<inter> B) = mset_set A \<inter># mset_set B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B\<rbrakk> \<Longrightarrow> mset_set (A \<inter> B) = mset_set A \<inter># mset_set B
[PROOF STEP]
apply (induction A rule: finite_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite B \<Longrightarrow> mset_set ({} \<inter> B) = mset_set {} \<inter># mset_set B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite B \<Longrightarrow> mset_set (F \<inter> B) = mset_set F \<inter># mset_set B; finite B\<rbrakk> \<Longrightarrow> mset_set (insert x F \<inter> B) = mset_set (insert x F) \<inter># mset_set B
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B \<Longrightarrow> mset_set ({} \<inter> B) = mset_set {} \<inter># mset_set B
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; finite B \<Longrightarrow> mset_set (F \<inter> B) = mset_set F \<inter># mset_set B; finite B\<rbrakk> \<Longrightarrow> mset_set (insert x F \<inter> B) = mset_set (insert x F) \<inter># mset_set B
[PROOF STEP]
subgoal for a A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; a \<notin> A; finite B \<Longrightarrow> mset_set (A \<inter> B) = mset_set A \<inter># mset_set B; finite B\<rbrakk> \<Longrightarrow> mset_set (insert a A \<inter> B) = mset_set (insert a A) \<inter># mset_set B
[PROOF STEP]
by (cases \<open>a \<in> B\<close>; cases \<open>a \<in># mset_set B\<close>)
      (use multi_member_split[of a \<open>mset_set B\<close>] in
        \<open>auto simp: mset_set.insert_remove\<close>)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Func_upd: "\<lbrakk>f \<in> Func A B; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> f(x := y) \<in> Func A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Func A B; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> f(x := y) \<in> Func A B
[PROOF STEP]
unfolding Func_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {f. (\<forall>a\<in>A. f a \<in> B) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)}; x \<in> A; y \<in> B\<rbrakk> \<Longrightarrow> f(x := y) \<in> {f. (\<forall>a\<in>A. f a \<in> B) \<and> (\<forall>a. a \<notin> A \<longrightarrow> f a = undefined)}
[PROOF STEP]
by auto


[STATEMENT]
lemma injection_union: assumes "inj_on f A" "inj_on f B" "(f`A) \<inter> (f`B) = {}"
              shows "inj_on f (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (A \<union> B)
[PROOF STEP]
using assms lm13
[PROOF STATE]
proof (prove)
using this:
inj_on f A
inj_on f B
f ` A \<inter> f ` B = {}
\<lbrakk>inj_on ?f ?A; inj_on ?f ?B\<rbrakk> \<Longrightarrow> inj_on ?f (?A \<union> ?B) = (?f ` (?A - ?B) \<inter> ?f ` (?B - ?A) = {})

goal (1 subgoal):
 1. inj_on f (A \<union> B)
[PROOF STEP]
by fast


[STATEMENT]
lemma algebraic_diff_cancel_left [simp]:
  assumes "algebraic x"
  shows   "algebraic (x - y) \<longleftrightarrow> algebraic y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic (x - y) = algebraic y
[PROOF STEP]
using algebraic_add_cancel_left[of x "-y"] assms
[PROOF STATE]
proof (prove)
using this:
algebraic x \<Longrightarrow> algebraic (x + - y) = algebraic (- y)
algebraic x

goal (1 subgoal):
 1. algebraic (x - y) = algebraic y
[PROOF STEP]
by (simp del: algebraic_add_cancel_left)


[STATEMENT]
lemma all_gval_not_false:
  "(\<forall>g \<in> set G. gval g s \<noteq> false) = (\<forall>g \<in> set G. gval g s = true) \<or> (\<exists>g \<in> set G. gval g s = invalid)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>g\<in>set G. gval g s \<noteq> false) = (\<forall>g\<in>set G. gval g s = true) \<or> (\<exists>g\<in>set G. gval g s = invalid)
[PROOF STEP]
using trilean.exhaust
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y = true \<Longrightarrow> ?P; ?y = false \<Longrightarrow> ?P; ?y = invalid \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. (\<forall>g\<in>set G. gval g s \<noteq> false) = (\<forall>g\<in>set G. gval g s = true) \<or> (\<exists>g\<in>set G. gval g s = invalid)
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_catalan_recurrence:
  "fps_catalan = 1 + fps_X * fps_catalan^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_catalan = 1 + fps_X * fps_catalan\<^sup>2
[PROOF STEP]
proof (rule fps_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fps_nth fps_catalan n = fps_nth (1 + fps_X * fps_catalan\<^sup>2) n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fps_nth fps_catalan n = fps_nth (1 + fps_X * fps_catalan\<^sup>2) n
[PROOF STEP]
show "fps_nth fps_catalan n = fps_nth (1 + fps_X * fps_catalan^2) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_nth fps_catalan n = fps_nth (1 + fps_X * fps_catalan\<^sup>2) n
[PROOF STEP]
by (cases n) (simp_all add: fps_square_nth catalan_Suc)
[PROOF STATE]
proof (state)
this:
fps_nth fps_catalan n = fps_nth (1 + fps_X * fps_catalan\<^sup>2) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfv_Exists: "MFOTL.nfv (MFOTL.Exists \<phi>) = MFOTL.nfv \<phi> - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MFOTL.nfv (formula.Exists \<phi>) = MFOTL.nfv \<phi> - 1
[PROOF STEP]
unfolding MFOTL.nfv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max (insert 0 (Suc ` fv (formula.Exists \<phi>))) = Max (insert 0 (Suc ` fv \<phi>)) - 1
[PROOF STEP]
by (cases "fv \<phi> = {}") (auto simp add: image_Suc_fvi mono_Max_commute[symmetric] mono_def)


[STATEMENT]
lemma gen_upd_app: "\<And>es'. gen_upd var (es@es') = gen_upd var es' \<circ> gen_upd var es"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>es'. gen_upd var (es @ es') = gen_upd var es' \<circ> gen_upd var es
[PROOF STEP]
apply (induct es)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>es'. gen_upd var ([] @ es') = gen_upd var es' \<circ> gen_upd var []
 2. \<And>a es es'. (\<And>es'. gen_upd var (es @ es') = gen_upd var es' \<circ> gen_upd var es) \<Longrightarrow> gen_upd var ((a # es) @ es') = gen_upd var es' \<circ> gen_upd var (a # es)
[PROOF STEP]
apply  (rule ext)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>es' x. gen_upd var ([] @ es') x = (gen_upd var es' \<circ> gen_upd var []) x
 2. \<And>a es es'. (\<And>es'. gen_upd var (es @ es') = gen_upd var es' \<circ> gen_upd var es) \<Longrightarrow> gen_upd var ((a # es) @ es') = gen_upd var es' \<circ> gen_upd var (a # es)
[PROOF STEP]
apply  (simp add: gen_upd_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a es es'. (\<And>es'. gen_upd var (es @ es') = gen_upd var es' \<circ> gen_upd var es) \<Longrightarrow> gen_upd var ((a # es) @ es') = gen_upd var es' \<circ> gen_upd var (a # es)
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a es es' x. (\<And>es'. gen_upd var (es @ es') = gen_upd var es' \<circ> gen_upd var es) \<Longrightarrow> gen_upd var ((a # es) @ es') x = (gen_upd var es' \<circ> gen_upd var (a # es)) x
[PROOF STEP]
apply (simp add: gen_upd_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma real_eq_affinity: "m \<noteq> 0 \<Longrightarrow> y = m * x + c  \<longleftrightarrow> inverse m * y + - (c / m) = x"
  for m :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> (0::'a) \<Longrightarrow> (y = m * x + c) = (inverse m * y + - (c / m) = x)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma card_sccs_eq: "card G.sccs = card H.sccs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card G.sccs = card H.sccs
[PROOF STEP]
using card_sccs_verts G.inj_on_verts_sccs H.inj_on_verts_sccs
[PROOF STATE]
proof (prove)
using this:
card G.sccs_verts = card H.sccs_verts
inj_on verts G.sccs
inj_on verts H.sccs

goal (1 subgoal):
 1. card G.sccs = card H.sccs
[PROOF STEP]
by (auto simp: G.sccs_verts_conv H.sccs_verts_conv card_image)


[STATEMENT]
lemma one_le_floor [simp]: "1 \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> \<lfloor>x\<rfloor>) = ((1::'a) \<le> x)
[PROOF STEP]
by (simp add: le_floor_iff)


[STATEMENT]
lemma isomorphic_group_reduced_homology_of_contractible:
   "\<lbrakk>contractible_space X; topspace X \<inter> S \<noteq> {}\<rbrakk>
        \<Longrightarrow> reduced_homology_group p (subtopology X S) \<cong> relative_homology_group(p + 1) X S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>contractible_space X; topspace X \<inter> S \<noteq> {}\<rbrakk> \<Longrightarrow> reduced_homology_group p (subtopology X S) \<cong> relative_homology_group (p + 1) X S
[PROOF STEP]
by (metis add.commute add_diff_cancel_left' group.iso_sym group_relative_homology_group isomorphic_group_relative_homology_of_contractible)


[STATEMENT]
lemma contour_integral_primitive_lemma:
  fixes f :: "complex \<Rightarrow> complex" and g :: "real \<Rightarrow> complex"
  assumes "a \<le> b"
      and "\<And>x. x \<in> S \<Longrightarrow> (f has_field_derivative f' x) (at x within S)"
      and "g piecewise_differentiable_on {a..b}"  "\<And>x. x \<in> {a..b} \<Longrightarrow> g x \<in> S"
    shows "((\<lambda>x. f'(g x) * vector_derivative g (at x within {a..b}))
             has_integral (f(g b) - f(g a))) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
obtain K where "finite K" and K: "\<forall>x\<in>{a..b} - K. g differentiable (at x within {a..b})" and cg: "continuous_on {a..b} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>K. \<lbrakk>finite K; \<forall>x\<in>{a..b} - K. g differentiable at x within {a..b}; continuous_on {a..b} g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> S \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within S)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> S

goal (1 subgoal):
 1. (\<And>K. \<lbrakk>finite K; \<forall>x\<in>{a..b} - K. g differentiable at x within {a..b}; continuous_on {a..b} g\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: piecewise_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
finite K
\<forall>x\<in>{a..b} - K. g differentiable at x within {a..b}
continuous_on {a..b} g

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
have "continuous_on (g ` {a..b}) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (g ` {a..b}) f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> S \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within S)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> S

goal (1 subgoal):
 1. continuous_on (g ` {a..b}) f
[PROOF STEP]
by (metis field_differentiable_def field_differentiable_imp_continuous_at continuous_on_eq_continuous_within continuous_on_subset image_subset_iff)
[PROOF STATE]
proof (state)
this:
continuous_on (g ` {a..b}) f

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (g ` {a..b}) f
[PROOF STEP]
have cfg: "continuous_on {a..b} (\<lambda>x. f (g x))"
[PROOF STATE]
proof (prove)
using this:
continuous_on (g ` {a..b}) f

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. f (g x))
[PROOF STEP]
by (rule continuous_on_compose [OF cg, unfolded o_def])
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. f (g x))

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
fix x::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
assume a: "a < x" and b: "x < b" and xk: "x \<notin> K"
[PROOF STATE]
proof (state)
this:
a < x
x < b
x \<notin> K

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a < x
x < b
x \<notin> K
[PROOF STEP]
have "g differentiable at x within {a..b}"
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<notin> K

goal (1 subgoal):
 1. g differentiable at x within {a..b}
[PROOF STEP]
using K
[PROOF STATE]
proof (prove)
using this:
a < x
x < b
x \<notin> K
\<forall>x\<in>{a..b} - K. g differentiable at x within {a..b}

goal (1 subgoal):
 1. g differentiable at x within {a..b}
[PROOF STEP]
by (simp add: differentiable_at_withinI)
[PROOF STATE]
proof (state)
this:
g differentiable at x within {a..b}

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g differentiable at x within {a..b}
[PROOF STEP]
have "(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})"
[PROOF STATE]
proof (prove)
using this:
g differentiable at x within {a..b}

goal (1 subgoal):
 1. (g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
by (simp add: vector_derivative_works has_field_derivative_def scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
have gdiff: "(g has_derivative (\<lambda>u. u * vector_derivative g (at x within {a..b}))) (at x within {a..b})"
[PROOF STATE]
proof (prove)
using this:
(g has_vector_derivative vector_derivative g (at x within {a..b})) (at x within {a..b})

goal (1 subgoal):
 1. (g has_derivative (\<lambda>xa. complex_of_real xa * vector_derivative g (at x within {a..b}))) (at x within {a..b})
[PROOF STEP]
by (simp add: has_vector_derivative_def scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(g has_derivative (\<lambda>xa. complex_of_real xa * vector_derivative g (at x within {a..b}))) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
have "(f has_field_derivative (f' (g x))) (at (g x) within g ` {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> S \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within S)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> S

goal (1 subgoal):
 1. (f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})
[PROOF STEP]
by (metis a atLeastAtMost_iff b DERIV_subset image_subset_iff less_eq_real_def)
[PROOF STATE]
proof (state)
this:
(f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})
[PROOF STEP]
have fdiff: "(f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})"
[PROOF STATE]
proof (prove)
using this:
(f has_field_derivative f' (g x)) (at (g x) within g ` {a..b})

goal (1 subgoal):
 1. (f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})
[PROOF STEP]
by (simp add: has_field_derivative_def)
[PROOF STATE]
proof (state)
this:
(f has_derivative (*) (f' (g x))) (at (g x) within g ` {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
have "((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
using diff_chain_within [OF gdiff fdiff]
[PROOF STATE]
proof (prove)
using this:
(f \<circ> g has_derivative (*) (f' (g x)) \<circ> (\<lambda>xa. complex_of_real xa * vector_derivative g (at x within {a..b}))) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})
[PROOF STEP]
by (simp add: has_vector_derivative_def scaleR_conv_of_real o_def mult_ac)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (g x)) has_vector_derivative f' (g x) * vector_derivative g (at x within {a..b})) (at x within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x2; ?x2 < b; ?x2 \<notin> K\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_vector_derivative f' (g ?x2) * vector_derivative g (at ?x2 within {a..b})) (at ?x2 within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>a < ?x2; ?x2 < b; ?x2 \<notin> K\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_vector_derivative f' (g ?x2) * vector_derivative g (at ?x2 within {a..b})) (at ?x2 within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
using assms cfg *
[PROOF STATE]
proof (prove)
using this:
a \<le> b
?x \<in> S \<Longrightarrow> (f has_field_derivative f' ?x) (at ?x within S)
g piecewise_differentiable_on {a..b}
?x \<in> {a..b} \<Longrightarrow> g ?x \<in> S
continuous_on {a..b} (\<lambda>x. f (g x))
\<lbrakk>a < ?x2; ?x2 < b; ?x2 \<notin> K\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_vector_derivative f' (g ?x2) * vector_derivative g (at ?x2 within {a..b})) (at ?x2 within {a..b})

goal (1 subgoal):
 1. ((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}
[PROOF STEP]
by (force simp: at_within_Icc_at intro: fundamental_theorem_of_calculus_interior_strong [OF \<open>finite K\<close>])
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f' (g x) * vector_derivative g (at x within {a..b})) has_integral f (g b) - f (g a)) {a..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_mult_le_one:
  fixes m n::nat
  assumes "m \<le> 1" "n \<le> 1"
  shows "m * n \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m * n \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<le> 1
n \<le> 1

goal (1 subgoal):
 1. m * n \<le> 1
[PROOF STEP]
by (induct n) (auto)


[STATEMENT]
lemma vec_of_basis_enum_scaleR:
  "vec_of_basis_enum (r *\<^sub>R b) = complex_of_real r \<cdot>\<^sub>v (vec_of_basis_enum b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (r *\<^sub>R b) = complex_of_real r \<cdot>\<^sub>v vec_of_basis_enum b
[PROOF STEP]
by (simp add: scaleR_scaleC vec_of_basis_enum_scaleC)


[STATEMENT]
lemma path_component_mem:
  assumes "path_component S x y"
  shows "x \<in> S" and "y \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S &&& y \<in> S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
path_component S x y

goal (1 subgoal):
 1. x \<in> S &&& y \<in> S
[PROOF STEP]
unfolding path_defs
[PROOF STATE]
proof (prove)
using this:
\<exists>g. continuous_on {0..1} g \<and> g ` {0..1} \<subseteq> S \<and> g 0 = x \<and> g 1 = y

goal (1 subgoal):
 1. x \<in> S &&& y \<in> S
[PROOF STEP]
by auto


[STATEMENT]
lemma alt_group_is_subgroup: "subgroup (carrier (alt_group n)) (sym_group n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (carrier (alt_group n)) (sym_group n)
[PROOF STEP]
using group_hom.subgroup_kernel[OF sign_group_hom]
[PROOF STATE]
proof (prove)
using this:
subgroup (kernel (sym_group ?n1) sign_img sign) (sym_group ?n1)

goal (1 subgoal):
 1. subgroup (carrier (alt_group n)) (sym_group n)
[PROOF STEP]
unfolding alt_group_is_sign_kernel
[PROOF STATE]
proof (prove)
using this:
subgroup (kernel (sym_group ?n1) sign_img sign) (sym_group ?n1)

goal (1 subgoal):
 1. subgroup (kernel (sym_group n) sign_img sign) (sym_group n)
[PROOF STEP]
by blast


[STATEMENT]
lemma connected_UNIV[simp]: "connected (UNIV::'a::linear_continuum_topology set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected UNIV
[PROOF STEP]
by (simp add: connected_iff_interval)


[STATEMENT]
lemma set_restriction_Int_conv:
  "set_restriction f = (\<exists>B. \<forall>A. f A = A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_restriction f = (\<exists>B. \<forall>A. f A = A \<inter> B)
[PROOF STEP]
apply (unfold set_restriction_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>P. \<forall>A. f A = {x \<in> A. P x}) = (\<exists>B. \<forall>A. f A = A \<inter> B)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>P. \<forall>A. f A = {x \<in> A. P x} \<Longrightarrow> \<exists>B. \<forall>A. f A = A \<inter> B
 2. \<exists>B. \<forall>A. f A = A \<inter> B \<Longrightarrow> \<exists>P. \<forall>A. f A = {x \<in> A. P x}
[PROOF STEP]
apply (erule exE, rule_tac x="Collect P" in exI, blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B. \<forall>A. f A = A \<inter> B \<Longrightarrow> \<exists>P. \<forall>A. f A = {x \<in> A. P x}
[PROOF STEP]
apply (erule exE, rule_tac x="\<lambda>x. x \<in> B" in exI, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma isomorphic_designs_implies_block_map: "(\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>') \<Longrightarrow> \<exists> \<pi> . image_mset ((`) \<pi>) \<B> = \<B>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>') \<Longrightarrow> \<exists>\<pi>. image_mset ((`) \<pi>) \<B> = \<B>'
[PROOF STEP]
using incidence_system_isomorphism.block_img isomorphic_designs_def
[PROOF STATE]
proof (prove)
using this:
incidence_system_isomorphism ?\<V> ?\<B> ?\<V>' ?\<B>' ?bij_map \<Longrightarrow> image_mset ((`) ?bij_map) ?\<B> = ?\<B>'
(?\<D> \<cong>\<^sub>D ?\<D>') = (\<exists>\<pi>. design_isomorphism (fst ?\<D>) (snd ?\<D>) (fst ?\<D>') (snd ?\<D>') \<pi>)

goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>') \<Longrightarrow> \<exists>\<pi>. image_mset ((`) \<pi>) \<B> = \<B>'
[PROOF STEP]
using design_isomorphism.axioms(1)
[PROOF STATE]
proof (prove)
using this:
incidence_system_isomorphism ?\<V> ?\<B> ?\<V>' ?\<B>' ?bij_map \<Longrightarrow> image_mset ((`) ?bij_map) ?\<B> = ?\<B>'
(?\<D> \<cong>\<^sub>D ?\<D>') = (\<exists>\<pi>. design_isomorphism (fst ?\<D>) (snd ?\<D>) (fst ?\<D>') (snd ?\<D>') \<pi>)
design_isomorphism ?\<V> ?\<B> ?\<V>' ?\<B>' ?bij_map \<Longrightarrow> incidence_system_isomorphism ?\<V> ?\<B> ?\<V>' ?\<B>' ?bij_map

goal (1 subgoal):
 1. (\<V>, \<B>) \<cong>\<^sub>D (\<V>', \<B>') \<Longrightarrow> \<exists>\<pi>. image_mset ((`) \<pi>) \<B> = \<B>'
[PROOF STEP]
by fastforce


[STATEMENT]
lemma tendsto_artanh [tendsto_intros]:
  fixes f :: "'a \<Rightarrow> real"
  assumes "(f \<longlongrightarrow> a) F" "a > -1" "a < 1"
  shows   "((\<lambda>x. artanh (f x)) \<longlongrightarrow> artanh a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. artanh (f x)) \<longlongrightarrow> artanh a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_artanh]) (use assms in auto)


[STATEMENT]
lemma path_connected_uncountable:
  fixes S :: "'a::metric_space set"
  assumes "path_connected S" "a \<in> S" "b \<in> S" "a \<noteq> b" shows "uncountable S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable S
[PROOF STEP]
using path_connected_imp_connected assms connected_uncountable
[PROOF STATE]
proof (prove)
using this:
path_connected ?S \<Longrightarrow> connected ?S
path_connected S
a \<in> S
b \<in> S
a \<noteq> b
\<lbrakk>connected ?S; ?a \<in> ?S; ?b \<in> ?S; ?a \<noteq> ?b\<rbrakk> \<Longrightarrow> uncountable ?S

goal (1 subgoal):
 1. uncountable S
[PROOF STEP]
by metis


[STATEMENT]
lemma isCont_iff: "isCont f x = (\<lambda>h. f (x + h)) \<midarrow>0\<rightarrow> f x"
  for f :: "'a::real_normed_vector \<Rightarrow> 'b::topological_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x = (\<lambda>h. f (x + h)) \<midarrow>0::'a\<rightarrow> f x
[PROOF STEP]
by (simp add: isCont_def LIM_isCont_iff)


[STATEMENT]
lemma card_filter_point_indices: "card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V> . P v }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V>. P v}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V>. P v}
[PROOF STEP]
have "{v \<in> \<V> . P v }= (\<lambda> i. \<V>s ! i) ` {i \<in> {0..<\<v>}. P (\<V>s ! i)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v \<in> \<V>. P v} = (!) \<V>s ` {i \<in> {0..<\<v>}. P (\<V>s ! i)}
[PROOF STEP]
by (metis Compr_image_eq lessThan_atLeast0 points_set_index_img)
[PROOF STATE]
proof (state)
this:
{v \<in> \<V>. P v} = (!) \<V>s ` {i \<in> {0..<\<v>}. P (\<V>s ! i)}

goal (1 subgoal):
 1. card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V>. P v}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{v \<in> \<V>. P v} = (!) \<V>s ` {i \<in> {0..<\<v>}. P (\<V>s ! i)}

goal (1 subgoal):
 1. card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V>. P v}
[PROOF STEP]
using inj_on_nth points_list_length
[PROOF STATE]
proof (prove)
using this:
{v \<in> \<V>. P v} = (!) \<V>s ` {i \<in> {0..<\<v>}. P (\<V>s ! i)}
\<lbrakk>distinct ?xs; \<forall>i\<in>?I. i < length ?xs\<rbrakk> \<Longrightarrow> inj_on ((!) ?xs) ?I
length \<V>s = \<v>

goal (1 subgoal):
 1. card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V>. P v}
[PROOF STEP]
by (metis (no_types, lifting) card_image distinct lessThan_atLeast0 lessThan_iff mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
card {i \<in> {0..<\<v>}. P (\<V>s ! i)} = card {v \<in> \<V>. P v}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Idomain) idom_mult_cancel_r:"\<lbrakk>a \<in> carrier R;
       b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; a \<cdot>\<^sub>r c = b \<cdot>\<^sub>r c\<rbrakk> \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; a \<cdot>\<^sub>r c = b \<cdot>\<^sub>r c\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; a \<cdot>\<^sub>r c = b \<cdot>\<^sub>r c; aGroup R\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (frule ring_tOp_closed[of "a" "c"], assumption+,
        frule ring_tOp_closed[of "b" "c"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; a \<cdot>\<^sub>r c = b \<cdot>\<^sub>r c; aGroup R; a \<cdot>\<^sub>r c \<in> carrier R; b \<cdot>\<^sub>r c \<in> carrier R\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (simp add:aGroup.ag_eq_diffzero[of "R" "a \<cdot>\<^sub>r c" "b \<cdot>\<^sub>r c"],
        simp add:ring_inv1_1,
        frule aGroup.ag_mOp_closed[of "R" "b"], assumption,
        simp add:ring_distrib2[THEN sym, of "c" "a" "-\<^sub>a b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; (a \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r c = \<zero>; aGroup R; a \<cdot>\<^sub>r c \<in> carrier R; b \<cdot>\<^sub>r c \<in> carrier R; -\<^sub>a b \<in> carrier R\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (frule aGroup.ag_pOp_closed[of "R" "a" "-\<^sub>a b"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; (a \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r c = \<zero>; aGroup R; a \<cdot>\<^sub>r c \<in> carrier R; b \<cdot>\<^sub>r c \<in> carrier R; -\<^sub>a b \<in> carrier R; a \<plusminus> -\<^sub>a b \<in> carrier R\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
apply (subst aGroup.ag_eq_diffzero[of R a b], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; (a \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r c = \<zero>; aGroup R; a \<cdot>\<^sub>r c \<in> carrier R; b \<cdot>\<^sub>r c \<in> carrier R; -\<^sub>a b \<in> carrier R; a \<plusminus> -\<^sub>a b \<in> carrier R\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b = \<zero>
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; c \<noteq> \<zero>; (a \<plusminus> -\<^sub>a b) \<cdot>\<^sub>r c = \<zero>; aGroup R; a \<cdot>\<^sub>r c \<in> carrier R; b \<cdot>\<^sub>r c \<in> carrier R; -\<^sub>a b \<in> carrier R; a \<plusminus> -\<^sub>a b \<in> carrier R; a \<plusminus> -\<^sub>a b \<noteq> \<zero>\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule idom_tOp_nonzeros[of "a \<plusminus> -\<^sub>a b" c], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inverse_roots: assumes x: "(x :: 'a :: field_char_0) \<noteq> 0"
  shows "ipoly (reflect_poly p) x = 0 \<longleftrightarrow> ipoly p (inverse x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ipoly (reflect_poly p) x = (0::'a)) = (ipoly p (inverse x) = (0::'a))
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. (ipoly (reflect_poly p) x = (0::'a)) = (ipoly p (inverse x) = (0::'a))
[PROOF STEP]
by (auto simp: ipoly_reflect_poly)


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


[STATEMENT]
lemma fref_mono: "\<lbrakk> \<And>x. P' x \<Longrightarrow> P x; R' \<subseteq> R; S \<subseteq> S' \<rbrakk>
    \<Longrightarrow> fref P R S \<subseteq> fref P' R' S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. P' x \<Longrightarrow> P x; R' \<subseteq> R; S \<subseteq> S'\<rbrakk> \<Longrightarrow> [P]\<^sub>f R \<rightarrow> S \<subseteq> [P']\<^sub>f R' \<rightarrow> S'
[PROOF STEP]
unfolding fref_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. P' x \<Longrightarrow> P x; R' \<subseteq> R; S \<subseteq> S'\<rbrakk> \<Longrightarrow> {(f, g). \<forall>x y. P y \<and> (x, y) \<in> R \<longrightarrow> (f x, g y) \<in> S} \<subseteq> {(f, g). \<forall>x y. P' y \<and> (x, y) \<in> R' \<longrightarrow> (f x, g y) \<in> S'}
[PROOF STEP]
by auto blast


[STATEMENT]
lemma fin_sum_periodic_arithmetic_set:
  fixes f g :: "nat \<Rightarrow> complex"
  assumes "\<forall>i\<in>A. periodic_arithmetic (h i) k"
  shows "periodic_arithmetic (\<lambda>n. \<Sum>i \<in> A. h i n) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. \<Sum>i\<in>A. h i n) k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>A. periodic_arithmetic (h i) k

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. \<Sum>i\<in>A. h i n) k
[PROOF STEP]
by (simp add: periodic_arithmetic_def)


[STATEMENT]
lemma proots_count_cong:
  assumes order_eq:"\<forall>x\<in>s. order x p = order x q" and "p\<noteq>0" and "q\<noteq>0"
  shows "proots_count p s = proots_count q s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proots_count p s = proots_count q s
[PROOF STEP]
unfolding proots_count_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r\<in>proots_within p s. order r p) = (\<Sum>r\<in>proots_within q s. order r q)
[PROOF STEP]
proof (rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. proots_within p s = proots_within q s
 2. \<And>x. x \<in> proots_within q s \<Longrightarrow> order x p = order x q
[PROOF STEP]
have "poly p x = 0 \<longleftrightarrow> poly q x = 0" when "x\<in>s" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p x = (0::'a)) = (poly q x = (0::'a))
[PROOF STEP]
using order_eq that
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s. order x p = order x q
x \<in> s

goal (1 subgoal):
 1. (poly p x = (0::'a)) = (poly q x = (0::'a))
[PROOF STEP]
by (simp add: assms(2) assms(3) order_root)
[PROOF STATE]
proof (state)
this:
?x \<in> s \<Longrightarrow> (poly p ?x = (0::'a)) = (poly q ?x = (0::'a))

goal (2 subgoals):
 1. proots_within p s = proots_within q s
 2. \<And>x. x \<in> proots_within q s \<Longrightarrow> order x p = order x q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> s \<Longrightarrow> (poly p ?x = (0::'a)) = (poly q ?x = (0::'a))
[PROOF STEP]
show "proots_within p s = proots_within q s"
[PROOF STATE]
proof (prove)
using this:
?x \<in> s \<Longrightarrow> (poly p ?x = (0::'a)) = (poly q ?x = (0::'a))

goal (1 subgoal):
 1. proots_within p s = proots_within q s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
proots_within p s = proots_within q s

goal (1 subgoal):
 1. \<And>x. x \<in> proots_within q s \<Longrightarrow> order x p = order x q
[PROOF STEP]
show "\<And>x. x \<in> proots_within q s \<Longrightarrow> order x p = order x q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> proots_within q s \<Longrightarrow> order x p = order x q
[PROOF STEP]
using order_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s. order x p = order x q

goal (1 subgoal):
 1. \<And>x. x \<in> proots_within q s \<Longrightarrow> order x p = order x q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> proots_within q s \<Longrightarrow> order ?x p = order ?x q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rbt_lookup_rbt_union:
  "\<lbrakk> rbt_sorted s; rbt_sorted t \<rbrakk> \<Longrightarrow>
  rbt_lookup (rbt_union s t) = rbt_lookup s ++ rbt_lookup t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbt_sorted s; rbt_sorted t\<rbrakk> \<Longrightarrow> rbt_lookup (rbt_union s t) = rbt_lookup s ++ rbt_lookup t
[PROOF STEP]
by(rule ext)(simp add: rbt_lookup_rbt_unionwk rbt_union_def map_add_def split: option.split)


[STATEMENT]
lemma length_filter_less:
  "\<lbrakk> x \<in> set xs; \<not> P x \<rbrakk> \<Longrightarrow> length(filter P xs) < length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>x \<in> set []; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P []) < length []
 2. \<And>a xs. \<lbrakk>\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs; x \<in> set (a # xs); \<not> P x\<rbrakk> \<Longrightarrow> length (filter P (a # xs)) < length (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
x \<in> set []
\<not> P x

goal (2 subgoals):
 1. \<lbrakk>x \<in> set []; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P []) < length []
 2. \<And>a xs. \<lbrakk>\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs; x \<in> set (a # xs); \<not> P x\<rbrakk> \<Longrightarrow> length (filter P (a # xs)) < length (a # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x \<in> set []
\<not> P x

goal (1 subgoal):
 1. length (filter P []) < length []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (filter P []) < length []

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs; x \<in> set (a # xs); \<not> P x\<rbrakk> \<Longrightarrow> length (filter P (a # xs)) < length (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs; x \<in> set (a # xs); \<not> P x\<rbrakk> \<Longrightarrow> length (filter P (a # xs)) < length (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs
x \<in> set (x # xs)
\<not> P x

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs; x \<in> set (a # xs); \<not> P x\<rbrakk> \<Longrightarrow> length (filter P (a # xs)) < length (a # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs
x \<in> set (x # xs)
\<not> P x

goal (1 subgoal):
 1. length (filter P (x # xs)) < length (x # xs)
[PROOF STEP]
using Suc_le_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> set xs; \<not> P x\<rbrakk> \<Longrightarrow> length (filter P xs) < length xs
x \<in> set (x # xs)
\<not> P x
(Suc ?m \<le> ?n) = (?m < ?n)

goal (1 subgoal):
 1. length (filter P (x # xs)) < length (x # xs)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
length (filter P (x # xs)) < length (x # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_integral_periodic_offset_pos:
  fixes f :: "real \<Rightarrow> real"
  assumes f: "has_bochner_integral (lebesgue_on {a..b}) f i" and periodic: "\<And>x. f(x + (b-a)) = f x"
      and c: "c \<ge> 0" "a + c \<le> b"
  shows "has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f(x + c)) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
have "{a..a + c} \<subseteq> {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a..a + c} \<subseteq> {a..b}
[PROOF STEP]
by (simp add: assms(4))
[PROOF STATE]
proof (state)
this:
{a..a + c} \<subseteq> {a..b}

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{a..a + c} \<subseteq> {a..b}
[PROOF STEP]
have 1: "has_bochner_integral (lebesgue_on {a..a+c}) f(integral\<^sup>L (lebesgue_on {a..a+c}) f)"
[PROOF STATE]
proof (prove)
using this:
{a..a + c} \<subseteq> {a..b}

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..a + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)
[PROOF STEP]
by (meson integrable_subinterval f has_bochner_integral_iff)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {a..a + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral (lebesgue_on {a..a + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)
[PROOF STEP]
have 3: "has_bochner_integral (lebesgue_on {b..b+c}) f(integral\<^sup>L (lebesgue_on {a..a+c}) f)"
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {a..a + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {b..b + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)
[PROOF STEP]
using has_integral_periodic_offset_lemma periodic
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {a..a + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)
\<lbrakk>\<And>x. ?f (x + (?b - ?a)) = ?f x; has_bochner_integral (lebesgue_on {?a..?a + ?c}) ?f ?i\<rbrakk> \<Longrightarrow> has_bochner_integral (lebesgue_on {?b..?b + ?c}) ?f ?i
f (?x + (b - a)) = f ?x

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {b..b + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {b..b + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
have "{a + c..b} \<subseteq> {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a + c..b} \<subseteq> {a..b}
[PROOF STEP]
by (simp add: c)
[PROOF STATE]
proof (state)
this:
{a + c..b} \<subseteq> {a..b}

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{a + c..b} \<subseteq> {a..b}
[PROOF STEP]
have 2: "has_bochner_integral (lebesgue_on {a+c..b}) f(integral\<^sup>L (lebesgue_on {a+c..b}) f)"
[PROOF STATE]
proof (prove)
using this:
{a + c..b} \<subseteq> {a..b}

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a + c..b}) f (integral\<^sup>L (lebesgue_on {a + c..b}) f)
[PROOF STEP]
by (meson integrable_subinterval f has_bochner_integral_integrable integrable.intros)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {a + c..b}) f (integral\<^sup>L (lebesgue_on {a + c..b}) f)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
have "integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f = i
[PROOF STEP]
by (metis integral_combine add.commute c f has_bochner_integral_iff le_add_same_cancel1)
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f = i

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f = i
[PROOF STEP]
have "has_bochner_integral (lebesgue_on {a+c..b+c}) f i"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f = i

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a + c..b + c}) f i
[PROOF STEP]
using has_bochner_integral_combine [OF _ _ 2 3] 1 2
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f = i
\<lbrakk>a + c \<le> b; b \<le> b + c\<rbrakk> \<Longrightarrow> has_bochner_integral (lebesgue_on {a + c..b + c}) f (integral\<^sup>L (lebesgue_on {a + c..b}) f + integral\<^sup>L (lebesgue_on {a..a + c}) f)
has_bochner_integral (lebesgue_on {a..a + c}) f (integral\<^sup>L (lebesgue_on {a..a + c}) f)
has_bochner_integral (lebesgue_on {a + c..b}) f (integral\<^sup>L (lebesgue_on {a + c..b}) f)

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a + c..b + c}) f i
[PROOF STEP]
by (simp add: c)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {a + c..b + c}) f i

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
has_bochner_integral (lebesgue_on {a + c..b + c}) f i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral (lebesgue_on {a + c..b + c}) f i

goal (1 subgoal):
 1. has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i
[PROOF STEP]
by (metis add_diff_cancel_right' has_integral_offset)
[PROOF STATE]
proof (state)
this:
has_bochner_integral (lebesgue_on {a..b}) (\<lambda>x. f (x + c)) i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_map_compose_closed:
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "is_poly_tuple k gs"
  assumes "length gs = n"
  shows "is_poly_tuple k (map (poly_compose n k gs) fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poly_tuple k (map (poly_compose n k gs) fs)
[PROOF STEP]
unfolding is_poly_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (poly_compose n k gs) fs) \<subseteq> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (map (poly_compose n k gs) fs) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (map (poly_compose n k gs) fs) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
assume A: "y \<in> set (map (poly_compose n k gs) fs)"
[PROOF STATE]
proof (state)
this:
y \<in> set (map (poly_compose n k gs) fs)

goal (1 subgoal):
 1. \<And>x. x \<in> set (map (poly_compose n k gs) fs) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> set (map (poly_compose n k gs) fs)
[PROOF STEP]
obtain f where f_def: "f \<in> set fs \<and> y = poly_compose n k gs f"
[PROOF STATE]
proof (prove)
using this:
y \<in> set (map (poly_compose n k gs) fs)

goal (1 subgoal):
 1. (\<And>f. f \<in> set fs \<and> y = poly_compose n k gs f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (smt in_set_conv_nth length_map nth_map)
[PROOF STATE]
proof (state)
this:
f \<in> set fs \<and> y = poly_compose n k gs f

goal (1 subgoal):
 1. \<And>x. x \<in> set (map (poly_compose n k gs) fs) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> set fs \<and> y = poly_compose n k gs f
[PROOF STEP]
show "y \<in> carrier (coord_ring R k)"
[PROOF STATE]
proof (prove)
using this:
f \<in> set fs \<and> y = poly_compose n k gs f

goal (1 subgoal):
 1. y \<in> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
using assms poly_compose_closed
[PROOF STATE]
proof (prove)
using this:
f \<in> set fs \<and> y = poly_compose n k gs f
is_poly_tuple n fs
length fs = m
is_poly_tuple k gs
length gs = n
\<lbrakk>is_poly_tuple ?m ?fs; length ?fs = ?n; ?f \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])\<rbrakk> \<Longrightarrow> poly_compose ?n ?m ?fs ?f \<in> carrier (R [\<X>\<^bsub>?m\<^esub>])

goal (1 subgoal):
 1. y \<in> carrier (R [\<X>\<^bsub>k\<^esub>])
[PROOF STEP]
by (metis in_set_conv_nth is_poly_tupleE )
[PROOF STATE]
proof (state)
this:
y \<in> carrier (R [\<X>\<^bsub>k\<^esub>])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem dual_Meet [intro?]: "dual (\<Sqinter>A) = \<Squnion>(dual ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual (\<Sqinter>A) = \<Squnion>dual ` A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dual (\<Sqinter>A) = \<Squnion>dual ` A
[PROOF STEP]
from is_Inf_Meet
[PROOF STATE]
proof (chain)
picking this:
is_Inf ?A (\<Sqinter>?A)
[PROOF STEP]
have "is_Sup (dual ` A) (dual (\<Sqinter>A))"
[PROOF STATE]
proof (prove)
using this:
is_Inf ?A (\<Sqinter>?A)

goal (1 subgoal):
 1. is_Sup (dual ` A) (dual (\<Sqinter>A))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
is_Sup (dual ` A) (dual (\<Sqinter>A))

goal (1 subgoal):
 1. dual (\<Sqinter>A) = \<Squnion>dual ` A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_Sup (dual ` A) (dual (\<Sqinter>A))
[PROOF STEP]
have "\<Squnion>(dual ` A) = dual (\<Sqinter>A)"
[PROOF STATE]
proof (prove)
using this:
is_Sup (dual ` A) (dual (\<Sqinter>A))

goal (1 subgoal):
 1. \<Squnion>dual ` A = dual (\<Sqinter>A)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<Squnion>dual ` A = dual (\<Sqinter>A)

goal (1 subgoal):
 1. dual (\<Sqinter>A) = \<Squnion>dual ` A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Squnion>dual ` A = dual (\<Sqinter>A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Squnion>dual ` A = dual (\<Sqinter>A)

goal (1 subgoal):
 1. dual (\<Sqinter>A) = \<Squnion>dual ` A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dual (\<Sqinter>A) = \<Squnion>dual ` A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma run_rel_converse[simp]: "(ra, rb) \<in> run_rel (R\<inverse>) \<longleftrightarrow> (rb, ra) \<in> run_rel R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((ra, rb) \<in> run_rel (R\<inverse>)) = ((rb, ra) \<in> run_rel R)
[PROOF STEP]
unfolding run_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((ra, rb) \<in> {(ra, rb). \<forall>i. (ra i, rb i) \<in> R\<inverse>}) = ((rb, ra) \<in> {(ra, rb). \<forall>i. (ra i, rb i) \<in> R})
[PROOF STEP]
by auto


[STATEMENT]
lemma mahler_landau_graeffe_approximation:
  assumes g: "g = graeffe_poly_impl f k" "dd = d^(2^(Suc k))" "kk = 2^(Suc k)"
  shows "\<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g
[PROOF STEP]
have id1: "real_of_int (int (d ^ 2 ^ Suc k)) = (real d) ^ 2 ^ Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (int (d ^ 2 ^ Suc k)) = real d ^ 2 ^ Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int (int (d ^ 2 ^ Suc k)) = real d ^ 2 ^ Suc k

goal (1 subgoal):
 1. \<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g
[PROOF STEP]
have id2: "root (2 ^ Suc k) (real d ^ 2 ^ Suc k) = real d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root (2 ^ Suc k) (real d ^ 2 ^ Suc k) = real d
[PROOF STEP]
by (simp add: real_root_power_cancel)
[PROOF STATE]
proof (state)
this:
root (2 ^ Suc k) (real d ^ 2 ^ Suc k) = real d

goal (1 subgoal):
 1. \<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g
[PROOF STEP]
unfolding mahler_landau_graeffe_approximation_def Let_def root_int_floor of_int_mult g(2-3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>real d * mahler_measure f\<rfloor> \<le> \<lfloor>root (2 ^ Suc k) (real_of_int (int (d ^ 2 ^ Suc k)) * real_of_int (\<Sum>a\<leftarrow>coeffs g. a * a))\<rfloor>
[PROOF STEP]
by (rule floor_mono, unfold real_root_mult id1 id2, rule mult_left_mono,
    rule mahler_landau_graeffe_approximation_core[OF g(1)], auto)
[PROOF STATE]
proof (state)
this:
\<lfloor>real d * mahler_measure f\<rfloor> \<le> mahler_landau_graeffe_approximation kk dd g

goal:
No subgoals!
[PROOF STEP]
qed