[STATEMENT]
theorem Taylor:
  fixes a :: real and n :: nat
  assumes INIT: "n > 0" "diff 0 = f"
    and DERIV: "\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> b \<longrightarrow> DERIV (diff m) t :> diff (Suc m) t"
    and INTERV: "a \<le> c " "c \<le> b" "a \<le> x" "x \<le> b" "x \<noteq> c"
  shows "\<exists>t.
    (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and>
    f x = (\<Sum>m<n. (diff m c / fact m) * (x - c)^m) + (diff n t / fact n) * (x - c)^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
proof (cases "x < c")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x < c

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
note INIT
[PROOF STATE]
proof (state)
this:
0 < n
diff 0 = f

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < n
diff 0 = f

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
have "\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> DERIV (diff m) t :> diff (Suc m) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
[PROOF STEP]
using DERIV and INTERV
[PROOF STATE]
proof (prove)
using this:
\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c

goal (1 subgoal):
 1. \<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
note True
[PROOF STATE]
proof (state)
this:
x < c

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x < c

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
from INTERV
[PROOF STATE]
proof (chain)
picking this:
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c
[PROOF STEP]
have "c \<le> b"
[PROOF STATE]
proof (prove)
using this:
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c

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

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < n
diff 0 = f
\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
x < c
c \<le> b
[PROOF STEP]
have "\<exists>t>x. t < c \<and> f x =
    (\<Sum>m<n. diff m c / (fact m) * (x - c) ^ m) + diff n t / (fact n) * (x - c) ^ n"
[PROOF STATE]
proof (prove)
using this:
0 < n
diff 0 = f
\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
x < c
c \<le> b

goal (1 subgoal):
 1. \<exists>t>x. t < c \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
by (rule Taylor_down)
[PROOF STATE]
proof (state)
this:
\<exists>t>x. t < c \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n

goal (2 subgoals):
 1. x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
 2. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
x < c
\<exists>t>x. t < c \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < c
\<exists>t>x. t < c \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n

goal (1 subgoal):
 1. \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> x < c

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
note INIT
[PROOF STATE]
proof (state)
this:
0 < n
diff 0 = f

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < n
diff 0 = f

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
have "\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> DERIV (diff m) t :> diff (Suc m) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
[PROOF STEP]
using DERIV and INTERV
[PROOF STATE]
proof (prove)
using this:
\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> b \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c

goal (1 subgoal):
 1. \<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
from INTERV
[PROOF STATE]
proof (chain)
picking this:
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c
[PROOF STEP]
have "a \<le> c"
[PROOF STATE]
proof (prove)
using this:
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c

goal (1 subgoal):
 1. a \<le> c
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
a \<le> c

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<le> c

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
from False and INTERV
[PROOF STATE]
proof (chain)
picking this:
\<not> x < c
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c
[PROOF STEP]
have "c < x"
[PROOF STATE]
proof (prove)
using this:
\<not> x < c
a \<le> c
c \<le> b
a \<le> x
x \<le> b
x \<noteq> c

goal (1 subgoal):
 1. c < x
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
c < x

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < n
diff 0 = f
\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
a \<le> c
c < x
[PROOF STEP]
have "\<exists>t>c. t < x \<and> f x =
    (\<Sum>m<n. diff m c / (fact m) * (x - c) ^ m) + diff n t / (fact n) * (x - c) ^ n"
[PROOF STATE]
proof (prove)
using this:
0 < n
diff 0 = f
\<forall>m t. m < n \<and> a \<le> t \<and> t \<le> x \<longrightarrow> (diff m has_real_derivative diff (Suc m) t) (at t)
a \<le> c
c < x

goal (1 subgoal):
 1. \<exists>t>c. t < x \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
by (rule Taylor_up)
[PROOF STATE]
proof (state)
this:
\<exists>t>c. t < x \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n

goal (1 subgoal):
 1. \<not> x < c \<Longrightarrow> \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> x < c
\<exists>t>c. t < x \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> x < c
\<exists>t>c. t < x \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n

goal (1 subgoal):
 1. \<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>t. (if x < c then x < t \<and> t < c else c < t \<and> t < x) \<and> f x = (\<Sum>m<n. diff m c / fact m * (x - c) ^ m) + diff n t / fact n * (x - c) ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_intermediate_ball:
  fixes a :: "'a :: euclidean_space"
  shows "\<lbrakk>ball a r \<subseteq> T; T \<subseteq> cball a r\<rbrakk> \<Longrightarrow> convex T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ball a r \<subseteq> T; T \<subseteq> cball a r\<rbrakk> \<Longrightarrow> convex T
[PROOF STEP]
apply (simp add: convex_contains_open_segment, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa b x. \<lbrakk>ball a r \<subseteq> T; T \<subseteq> cball a r; aa \<in> T; b \<in> T; x \<in> open_segment aa b\<rbrakk> \<Longrightarrow> x \<in> T
[PROOF STEP]
by (metis (no_types, opaque_lifting) less_le_trans mem_ball mem_cball subsetCE dist_decreases_open_segment)


[STATEMENT]
lemma compose_map2: "S1 \<bullet> map_dds f g S2 = map_dds id g (map_dds id f S1 \<bullet> S2)"
  for S1 :: "('a, 'b) dds" and S2 :: "('b, 'c) dds"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S1 \<bullet> map_dds f g S2 = map_dds id g (map_dds id f S1 \<bullet> S2)
[PROOF STEP]
using compose_parametric[of "Grp UNIV id :: 'a \<Rightarrow> 'a \<Rightarrow> bool" "(Grp UNIV f)\<inverse>\<inverse>" "Grp UNIV g"]
[PROOF STATE]
proof (prove)
using this:
(rel_dds (Grp UNIV id) (Grp UNIV f)\<inverse>\<inverse> ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV id) (Grp UNIV g)) (\<bullet>) (\<bullet>)

goal (1 subgoal):
 1. S1 \<bullet> map_dds f g S2 = map_dds id g (map_dds id f S1 \<bullet> S2)
[PROOF STEP]
apply(rewrite in "rel_dds \<hole> _ ===> _" in asm conversep_conversep[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_dds (Grp UNIV id)\<inverse>\<inverse>\<inverse>\<inverse> (Grp UNIV f)\<inverse>\<inverse> ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV id) (Grp UNIV g)) (\<bullet>) (\<bullet>) \<Longrightarrow> S1 \<bullet> map_dds f g S2 = map_dds id g (map_dds id f S1 \<bullet> S2)
[PROOF STEP]
apply(rewrite in "_ ===> _ ===> rel_dds \<hole> _" in asm conversep_Grp_id[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rel_dds (Grp UNIV id)\<inverse>\<inverse>\<inverse>\<inverse> (Grp UNIV f)\<inverse>\<inverse> ===> rel_dds (Grp UNIV f)\<inverse>\<inverse> (Grp UNIV g) ===> rel_dds (Grp UNIV id)\<inverse>\<inverse> (Grp UNIV g)) (\<bullet>) (\<bullet>) \<Longrightarrow> S1 \<bullet> map_dds f g S2 = map_dds id g (map_dds id f S1 \<bullet> S2)
[PROOF STEP]
apply(simp only: rel_dds_conversep rel_dds_Grp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Grp UNIV (map_dds id f))\<inverse>\<inverse> ===> Grp UNIV (map_dds f g) ===> Grp UNIV (map_dds id g)) (\<bullet>) (\<bullet>) \<Longrightarrow> S1 \<bullet> map_dds f g S2 = map_dds id g (map_dds id f S1 \<bullet> S2)
[PROOF STEP]
apply(simp add: rel_fun_def Grp_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma deriv_scaleR_right:
  "f field_differentiable (at z) \<Longrightarrow> deriv (\<lambda>x. k *\<^sub>R f x) z = k *\<^sub>R deriv f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f field_differentiable at z \<Longrightarrow> deriv (\<lambda>x. k *\<^sub>R f x) z = k *\<^sub>R deriv f z
[PROOF STEP]
by (simp add: DERIV_imp_deriv field_differentiable_derivI has_field_derivative_scaleR_right)


[STATEMENT]
lemma Aleph_increasing:
  assumes ab: "\<alpha> < \<beta>" "Ord \<alpha>" "Ord \<beta>" shows "\<aleph>\<alpha> < \<aleph>\<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<aleph>\<alpha> < \<aleph>\<beta>
[PROOF STEP]
by (meson Aleph_in_Aleph InfCard_Aleph Card_iff_initial InfCard_def Ord_mem_iff_lt assms)


[STATEMENT]
lemma hyperpow_gt_zero: "\<And>r n. (0::'a::{linordered_semidom} star) < r \<Longrightarrow> 0 < r pow n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r n. 0 < r \<Longrightarrow> 0 < r pow n
[PROOF STEP]
by transfer (rule zero_less_power)


[STATEMENT]
lemma (in flowgraph) ntr_add_context:
  "\<lbrakk>(c,w,c')\<in>trcl (ntr fg); mon_ww fg w \<inter> mon_c fg cn = {}\<rbrakk>
    \<Longrightarrow> (c+cn,w,c'+cn)\<in>trcl (ntr fg)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(c, w, c') \<in> trcl (ntr fg); mon_ww fg w \<inter> mon_c fg cn = {}\<rbrakk> \<Longrightarrow> (c + cn, w, c' + cn) \<in> trcl (ntr fg)
[PROOF STEP]
by (induct rule: trcl.induct) (simp, force dest: ntr_add_context_s)


[STATEMENT]
lemma inf_right_dist_sum:
  fixes f :: "'b::finite \<Rightarrow> 'a"
  shows "(\<Squnion>\<^sub>k f k \<sqinter> x) = (\<Squnion>\<^sub>k f k) \<sqinter> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_monoid_add.sum (\<squnion>) bot (\<lambda>k. f k \<sqinter> x) {k. True} = comm_monoid_add.sum (\<squnion>) bot f {k. True} \<sqinter> x
[PROOF STEP]
by (rule comp_inf.comp_right_dist_sum)


[STATEMENT]
lemma smap_streams: "s \<in> streams A \<Longrightarrow> (\<And>x. x \<in> A \<Longrightarrow> f x \<in> B) \<Longrightarrow> smap f s \<in> streams B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<in> streams A; \<And>x. x \<in> A \<Longrightarrow> f x \<in> B\<rbrakk> \<Longrightarrow> smap f s \<in> streams B
[PROOF STEP]
unfolding streams_iff_sset stream.set_map
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sset s \<subseteq> A; \<And>x. x \<in> A \<Longrightarrow> f x \<in> B\<rbrakk> \<Longrightarrow> f ` sset s \<subseteq> B
[PROOF STEP]
by auto


[STATEMENT]
lemma par_symmetry:
  assumes "A B Par C D"
  shows "C D Par A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C D Par A B
[PROOF STEP]
by (smt NCol_perm Par_def assms l6_16_1 par_strict_symmetry)


[STATEMENT]
lemma (in group) subgroup_mult_equality:
  "\<lbrakk> subgroup H G; h1 \<in> H; h2 \<in> H \<rbrakk> \<Longrightarrow>  h1 \<otimes>\<^bsub>G \<lparr> carrier := H \<rparr>\<^esub> h2 = h1 \<otimes> h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subgroup H G; h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> h2 = h1 \<otimes> h2
[PROOF STEP]
unfolding subgroup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(H \<subseteq> carrier G \<and> (\<forall>x y. x \<in> H \<longrightarrow> y \<in> H \<longrightarrow> x \<otimes> y \<in> H)) \<and> \<one> \<in> H \<and> (\<forall>x. x \<in> H \<longrightarrow> inv x \<in> H); h1 \<in> H; h2 \<in> H\<rbrakk> \<Longrightarrow> h1 \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> h2 = h1 \<otimes> h2
[PROOF STEP]
by simp


[STATEMENT]
lemma ennreal_less_one_iff[simp]: "ennreal x < 1 \<longleftrightarrow> x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ennreal x < 1) = (x < 1)
[PROOF STEP]
by (cases "0 \<le> x") (auto simp: ennreal_neg ennreal_less_iff simp flip: ennreal_1)


[STATEMENT]
lemma hahn_decomp_space_diff:
  assumes "hahn_space_decomp M1 M2"
    and "hahn_space_decomp N1 N2"
  shows "pos_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)"
    "neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M) &&& neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pos_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)
 2. neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)
[PROOF STEP]
show "pos_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pos_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)
[PROOF STEP]
by (metis Int_Un_distrib2 assms(1) assms(2) hahn_space_decomp_def
        neg_sym_diff_pos_meas_set pos_meas_set_sym_diff pos_meas_set_union)
[PROOF STATE]
proof (state)
this:
pos_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)

goal (1 subgoal):
 1. neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)
[PROOF STEP]
show "neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)
[PROOF STEP]
by (metis Int_Un_distrib2 assms(1) assms(2) hahn_space_decomp_def
        neg_meas_set_sym_diff neg_meas_set_union pos_sym_diff_neg_meas_set)
[PROOF STATE]
proof (state)
this:
neg_meas_set ((sym_diff M1 N1 \<union> sym_diff M2 N2) \<inter> space M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_sq_le_rd: "star_sq x \<le> star_rd x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star_sq x \<le> star_rd x
[PROOF STEP]
apply (auto simp: star_rd_def star_sq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {proto_dioid.power_sq 1\<^sub>\<sigma> (\<cdot>) sup x i |i. i \<in> \<nat>} \<le> Sup {proto_dioid.power_rd 1\<^sub>\<sigma> (\<cdot>) sup bot x i |i. i \<in> \<nat>}
[PROOF STEP]
apply (rule Sup_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<in> {proto_dioid.power_sq 1\<^sub>\<sigma> (\<cdot>) sup x i |i. i \<in> \<nat>} \<Longrightarrow> \<exists>b\<in>{proto_dioid.power_rd 1\<^sub>\<sigma> (\<cdot>) sup bot x i |i. i \<in> \<nat>}. a \<le> b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> \<nat> \<Longrightarrow> \<exists>xa. (\<exists>i. xa = proto_dioid.power_rd 1\<^sub>\<sigma> (\<cdot>) sup bot x i \<and> i \<in> \<nat>) \<and> proto_dioid.power_sq 1\<^sub>\<sigma> (\<cdot>) sup x i \<le> xa
[PROOF STEP]
by (metis Nats_1 Nats_add Suc_eq_plus1 local.Sup_empty pd.power_sq_le_rd)


[STATEMENT]
lemma closed_segment_of_real:
    "closed_segment (of_real x) (of_real y) = of_real ` closed_segment x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment (of_real x) (of_real y) = of_real ` closed_segment x y
[PROOF STEP]
apply (auto simp: image_iff in_segment scaleR_conv_of_real)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> \<exists>xa\<in>closed_segment x y. ((1::'a) - of_real u) * of_real x + of_real u * of_real y = of_real xa
 2. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> \<exists>ua\<ge>0. ua \<le> 1 \<and> ((1::'a) - of_real u) * of_real x + of_real u * of_real y = ((1::'a) - of_real ua) * of_real x + of_real ua * of_real y
[PROOF STEP]
apply (rule_tac x="(1-u)*x + u*y" in bexI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> ((1::'a) - of_real u) * of_real x + of_real u * of_real y = of_real ((1 - u) * x + u * y)
 2. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> (1 - u) * x + u * y \<in> closed_segment x y
 3. \<And>u. \<lbrakk>0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> \<exists>ua\<ge>0. ua \<le> 1 \<and> ((1::'a) - of_real u) * of_real x + of_real u * of_real y = ((1::'a) - of_real ua) * of_real x + of_real ua * of_real y
[PROOF STEP]
apply (auto simp: in_segment)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_arg_max_le:
  assumes "finite (X :: 'c set)" "X \<noteq> {}"
  shows "s \<in> X \<Longrightarrow> (f :: 'c \<Rightarrow> real) s \<le> f (arg_max_on (f :: 'c \<Rightarrow> real) X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> X \<Longrightarrow> f s \<le> f (arg_max_on f X)
[PROOF STEP]
unfolding arg_max_def arg_max_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> X \<Longrightarrow> f s \<le> f (Eps (is_arg_max f (\<lambda>x. x \<in> X)))
[PROOF STEP]
by (metis assms(1) assms(2) finite_is_arg_max is_arg_max_linorder someI_ex)


[STATEMENT]
lemma sum_list_vdiff_distr [simp]:
  assumes "v \<le>\<^sub>v u"
  shows "sum_list (u -\<^sub>v v) = sum_list u - sum_list v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (u -\<^sub>v v) = sum_list u - sum_list v
[PROOF STEP]
by (metis (no_types, lifting) assms diff_zero dotprod_1_right
      length_map length_replicate length_upt
      less_eq_def vdiff_def vdiff_dotprod_distr)


[STATEMENT]
lemma functional_insert [simp]: "functional (insert (x,y) g) \<longleftrightarrow> (g``{x} \<subseteq> {y} \<and> functional g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. functional (insert (x, y) g) = (g `` {x} \<subseteq> {y} \<and> functional g)
[PROOF STEP]
by (auto simp add:functional_def inj_on_def image_def)


[STATEMENT]
lemma bmod_assoc_weak_aux:
  "f u \<cdot> \<Squnion>{g v \<cdot> h z |v z. \<rho> y v z} = \<Squnion>{(f::'a \<Rightarrow> 'b::weak_quantale) u \<cdot> g v \<cdot> h z |v z. \<rho> y v z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f u \<cdot> \<Squnion>{g v \<cdot> h z |v z. \<rho> y v z} = \<Squnion>{f u \<cdot> g v \<cdot> h z |v z. \<rho> y v z}
[PROOF STEP]
apply (subst weak_Sup_distl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {g v \<cdot> h z |v z. \<rho> y v z} \<noteq> {}
 2. \<Squnion>{f u \<cdot> ya |ya. ya \<in> {g v \<cdot> h z |v z. \<rho> y v z}} = \<Squnion>{f u \<cdot> g v \<cdot> h z |v z. \<rho> y v z}
[PROOF STEP]
using unitl_ex
[PROOF STATE]
proof (prove)
using this:
\<exists>e\<in>\<xi>. \<rho> ?x e ?x

goal (2 subgoals):
 1. {g v \<cdot> h z |v z. \<rho> y v z} \<noteq> {}
 2. \<Squnion>{f u \<cdot> ya |ya. ya \<in> {g v \<cdot> h z |v z. \<rho> y v z}} = \<Squnion>{f u \<cdot> g v \<cdot> h z |v z. \<rho> y v z}
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{f u \<cdot> ya |ya. ya \<in> {g v \<cdot> h z |v z. \<rho> y v z}} = \<Squnion>{f u \<cdot> g v \<cdot> h z |v z. \<rho> y v z}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{f u \<cdot> ya |ya. \<exists>v z. ya = g v \<cdot> h z \<and> \<rho> y v z} = \<Squnion>{f u \<cdot> g v \<cdot> h z |v z. \<rho> y v z}
[PROOF STEP]
by (metis (no_types, lifting) mult.assoc)


[STATEMENT]
lemma mult_1_is_id[simp]: "(*) (1 :: 'a :: ring_1) = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*) (1::'a) = id
[PROOF STEP]
by auto


[STATEMENT]
lemma negligible_outer_le:
     "negligible S \<longleftrightarrow> (\<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> measure lebesgue T \<le> e)" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible S = (\<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. negligible S \<Longrightarrow> \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e
 2. \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e \<Longrightarrow> negligible S
[PROOF STEP]
assume "negligible S"
[PROOF STATE]
proof (state)
this:
negligible S

goal (2 subgoals):
 1. negligible S \<Longrightarrow> \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e
 2. \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e \<Longrightarrow> negligible S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
negligible S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
negligible S

goal (1 subgoal):
 1. \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e
[PROOF STEP]
by (metis dual_order.strict_implies_order negligible_imp_measurable negligible_imp_measure0 order_refl)
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e

goal (1 subgoal):
 1. \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e \<Longrightarrow> negligible S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e \<Longrightarrow> negligible S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e

goal (1 subgoal):
 1. \<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e \<Longrightarrow> negligible S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e
[PROOF STEP]
show "negligible S"
[PROOF STATE]
proof (prove)
using this:
\<forall>e>0. \<exists>T. S \<subseteq> T \<and> T \<in> lmeasurable \<and> Sigma_Algebra.measure lebesgue T \<le> e

goal (1 subgoal):
 1. negligible S
[PROOF STEP]
by (metis le_less_trans negligible_outer field_lbound_gt_zero)
[PROOF STATE]
proof (state)
this:
negligible S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma downset_set_prop_var2: "x \<in> \<Down>X \<Longrightarrow> y \<le> x \<Longrightarrow> y \<in> \<Down>X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> \<Down> X; y \<le> x\<rbrakk> \<Longrightarrow> y \<in> \<Down> X
[PROOF STEP]
unfolding downset_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> {y. Bex X ((\<le>) y)}; y \<le> x\<rbrakk> \<Longrightarrow> y \<in> {y. Bex X ((\<le>) y)}
[PROOF STEP]
using order_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. \<lbrakk>x \<in> {y. Bex X ((\<le>) y)}; y \<le> x\<rbrakk> \<Longrightarrow> y \<in> {y. Bex X ((\<le>) y)}
[PROOF STEP]
by blast


[STATEMENT]
lemma closed_segment_subset_convex_hull:
    "\<lbrakk>x \<in> convex hull S; y \<in> convex hull S\<rbrakk> \<Longrightarrow> closed_segment x y \<subseteq> convex hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> convex hull S; y \<in> convex hull S\<rbrakk> \<Longrightarrow> closed_segment x y \<subseteq> convex hull S
[PROOF STEP]
using convex_contains_segment
[PROOF STATE]
proof (prove)
using this:
convex ?S = (\<forall>a\<in>?S. \<forall>b\<in>?S. closed_segment a b \<subseteq> ?S)

goal (1 subgoal):
 1. \<lbrakk>x \<in> convex hull S; y \<in> convex hull S\<rbrakk> \<Longrightarrow> closed_segment x y \<subseteq> convex hull S
[PROOF STEP]
by blast


[STATEMENT]
lemma real_floor_code [code]: "\<lfloor>Ratreal x\<rfloor> = \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>Ratreal x\<rfloor> = \<lfloor>x\<rfloor>
[PROOF STEP]
by (metis Ratreal_def floor_le_iff floor_unique le_floor_iff
      of_int_floor_le of_rat_of_int_eq real_less_eq_code)


[STATEMENT]
lemma mono_infArg:
  fixes f :: "'a::lattice \<Rightarrow> 'b::order"
  shows "mono f \<Longrightarrow> mono (\<lambda>x. f (inf x X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> mono (\<lambda>x. f (inf x X))
[PROOF STEP]
apply (rule monoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>mono f; x \<le> y\<rbrakk> \<Longrightarrow> f (inf x X) \<le> f (inf y X)
[PROOF STEP]
apply (erule monoD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. x \<le> y \<Longrightarrow> inf x X \<le> inf y X
[PROOF STEP]
apply (metis inf_mono order_refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma DERIV_neg_imp_decreasing_at_top:
  fixes f :: "real \<Rightarrow> real"
  assumes der: "\<And>x. x \<ge> b \<Longrightarrow> \<exists>y. DERIV f x :> y \<and> y < 0"
    and lim: "(f \<longlongrightarrow> flim) at_top"
  shows "flim < f b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flim < f b
[PROOF STEP]
apply (rule DERIV_pos_imp_increasing_at_bot [where f = "\<lambda>i. f (-i)" and b = "-b", simplified])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<le> - b \<Longrightarrow> \<exists>y. ((\<lambda>i. f (- i)) has_real_derivative y) (at x) \<and> 0 < y
 2. ((\<lambda>i. f (- i)) \<longlongrightarrow> flim) at_bot
[PROOF STEP]
apply (metis DERIV_mirror der le_minus_iff neg_0_less_iff_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. f (- i)) \<longlongrightarrow> flim) at_bot
[PROOF STEP]
apply (metis filterlim_at_top_mirror lim)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem prefix_length_le: "prefix xs ys \<Longrightarrow> length xs \<le> length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix xs ys \<Longrightarrow> length xs \<le> length ys
[PROOF STEP]
by (auto simp add: prefix_def)


[STATEMENT]
lemma claim: "(A | B | C) = (~C --> ~B --> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<or> B \<or> C) = (\<not> C \<longrightarrow> \<not> B \<longrightarrow> A)
[PROOF STEP]
by auto


[STATEMENT]
lemma cball_divide_subset: "d \<ge> 1 \<Longrightarrow> cball x (e/d) \<subseteq> cball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> d \<Longrightarrow> cball x (e / d) \<subseteq> cball x e
[PROOF STEP]
apply (cases "e < 0", simp add: field_split_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> d; \<not> e < 0\<rbrakk> \<Longrightarrow> cball x (e / d) \<subseteq> cball x e
[PROOF STEP]
by (metis div_by_1 frac_le less_numeral_extra(1) not_le order_refl subset_cball)


[STATEMENT]
lemma iso_imp_ordertype_eq_ordertype:
  assumes iso: "iso r r' f"
    and "wf r"
    and "Total r"
    and sm: "small (Field r)"
  shows "ordertype (Field r) r = ordertype (Field r') r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype (Field r) r = ordertype (Field r') r'
[PROOF STEP]
by (metis (no_types, lifting) iso_forward iso_wf assms iso_Field ordertype_inc_eq sm)


[STATEMENT]
lemma equiv_Eps_preserves:
  assumes ECH: "equiv A r" and X: "X \<in> A//r"
  shows "Eps (\<lambda>x. x \<in> X) \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<in> X) \<in> A
[PROOF STEP]
apply (rule in_mono[rule_format])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ?A \<subseteq> A
 2. (SOME x. x \<in> X) \<in> ?A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
equiv A r
X \<in> A // r

goal (2 subgoals):
 1. ?A \<subseteq> A
 2. (SOME x. x \<in> X) \<in> ?A
[PROOF STEP]
apply (rule in_quotient_imp_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<in> X) \<in> X
[PROOF STEP]
by (rule equiv_Eps_in) (rule assms)+


[STATEMENT]
lemma "{{true}}factorial num{{result = fact(\<guillemotleft>num\<guillemotright>)}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrace>true\<rbrace> result := 1 ;; i := \<guillemotleft>num\<guillemotright> ;; while 1 <\<^sub>u &i invr &result * uop fact &i =\<^sub>u uop fact \<guillemotleft>num\<guillemotright> do result := &result * &i ;; i := &i - 1 od \<lbrace>&result =\<^sub>u uop fact \<guillemotleft>num\<guillemotright>\<rbrace>\<^sub>u
[PROOF STEP]
apply (hoare_auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i\<^sub>v result\<^sub>v. \<lbrakk>Suc 0 < i\<^sub>v; result\<^sub>v * fact i\<^sub>v = fact num\<rbrakk> \<Longrightarrow> result\<^sub>v * i\<^sub>v * fact (i\<^sub>v - Suc 0) = fact num
 2. \<And>i\<^sub>v result\<^sub>v. \<lbrakk>\<not> Suc 0 < i\<^sub>v; result\<^sub>v * fact i\<^sub>v = fact num\<rbrakk> \<Longrightarrow> result\<^sub>v = fact num
[PROOF STEP]
apply (simp add: fact_reduce)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i\<^sub>v result\<^sub>v. \<lbrakk>\<not> Suc 0 < i\<^sub>v; result\<^sub>v * fact i\<^sub>v = fact num\<rbrakk> \<Longrightarrow> result\<^sub>v = fact num
[PROOF STEP]
apply (metis fact_0 fact_Suc_0 less_Suc0 linorder_neqE_nat mult.right_neutral)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma infinity_evalUni_EqUni : "(\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = (evalUni (substNegInfinityUni (EqUni p)) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = evalUni (substNegInfinityUni (EqUni p)) x
[PROOF STEP]
proof(cases p)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c. p = (a, b, c) \<Longrightarrow> (\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = evalUni (substNegInfinityUni (EqUni p)) x
[PROOF STEP]
case (fields a b c)
[PROOF STATE]
proof (state)
this:
p = (a, b, c)

goal (1 subgoal):
 1. \<And>a b c. p = (a, b, c) \<Longrightarrow> (\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = evalUni (substNegInfinityUni (EqUni p)) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = evalUni (substNegInfinityUni (EqUni p)) x
[PROOF STEP]
using infzeros[of _ a b c]
[PROOF STATE]
proof (prove)
using this:
\<forall>x<?y. a * x\<^sup>2 + b * x + c = 0 \<Longrightarrow> a = 0 \<and> b = 0 \<and> c = 0

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = evalUni (substNegInfinityUni (EqUni p)) x
[PROOF STEP]
by(auto simp add: fields)
[PROOF STATE]
proof (state)
this:
(\<exists>x. \<forall>y<x. aEvalUni (EqUni p) y) = evalUni (substNegInfinityUni (EqUni p)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_root: "P (root n x) \<longleftrightarrow> (n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar>^n = x \<longrightarrow> P y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
 2. n \<noteq> 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
 2. n \<noteq> 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))
[PROOF STEP]
by simp (metis root_sgn_power sgn_power_root)
[PROOF STATE]
proof (state)
this:
P (root n x) = ((n = 0 \<longrightarrow> P 0) \<and> (0 < n \<longrightarrow> (\<forall>y. sgn y * \<bar>y\<bar> ^ n = x \<longrightarrow> P y)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DirProd_list_iso:
  "(\<lambda>(g, gs). g # gs) \<in> iso (G \<times>\<times> (DirProd_list Gs)) (DirProd_list (G # Gs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(g, gs). g # gs) \<in> Group.iso (G \<times>\<times> DirProd_list Gs) (DirProd_list (G # Gs))
[PROOF STEP]
using inj_imp_image_group_iso[OF inj_on_DirProd_carrier]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(g, gs). g # gs) \<in> Group.iso (?G1 \<times>\<times> DirProd_list ?Gs1) (image_group (\<lambda>(g, gs). g # gs) (?G1 \<times>\<times> DirProd_list ?Gs1))

goal (1 subgoal):
 1. (\<lambda>(g, gs). g # gs) \<in> Group.iso (G \<times>\<times> DirProd_list Gs) (DirProd_list (G # Gs))
[PROOF STEP]
unfolding DirProd_list_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(g, gs). g # gs) \<in> Group.iso (?G1 \<times>\<times> foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) ?Gs1 nil_monoid) (image_group (\<lambda>(g, gs). g # gs) (?G1 \<times>\<times> foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) ?Gs1 nil_monoid))

goal (1 subgoal):
 1. (\<lambda>(g, gs). g # gs) \<in> Group.iso (G \<times>\<times> foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) Gs nil_monoid) (foldr (\<lambda>G H. image_group (\<lambda>(x, y). x # y) (G \<times>\<times> H)) (G # Gs) nil_monoid)
[PROOF STEP]
by auto


[STATEMENT]
lemma lists_length_eq_eq_empty_iff:
  "{xs. set xs \<subseteq> A \<and> length xs = n} = {} \<longleftrightarrow> (A = {} \<and> n > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
 2. \<And>nat. n = Suc nat \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
 2. \<And>nat. n = Suc nat \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n = Suc n

goal (1 subgoal):
 1. \<And>nat. n = Suc nat \<Longrightarrow> ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = Suc n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = Suc n

goal (1 subgoal):
 1. ({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)
[PROOF STEP]
by (auto simp only: lists_length_eq_Suc_eq_empty_iff)
[PROOF STATE]
proof (state)
this:
({xs. set xs \<subseteq> A \<and> length xs = n} = {}) = (A = {} \<and> 0 < n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_after_subset :
  "set T2 \<subseteq> set T1 \<Longrightarrow> set (after T2 xs) \<subseteq> set (after T1 xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prefix_Tree.set T2 \<subseteq> Prefix_Tree.set T1 \<Longrightarrow> Prefix_Tree.set (after T2 xs) \<subseteq> Prefix_Tree.set (after T1 xs)
[PROOF STEP]
unfolding after_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Prefix_Tree.set T2 \<subseteq> Prefix_Tree.set T1 \<Longrightarrow> Set.insert [] {xs'. xs @ xs' \<in> Prefix_Tree.set T2} \<subseteq> Set.insert [] {xs'. xs @ xs' \<in> Prefix_Tree.set T1}
[PROOF STEP]
by auto


[STATEMENT]
lemma leq_sum_to_sum_list: "(\<Sum>x \<le> n. f x) = (\<Sum>x\<leftarrow>[0..<Suc n]. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} = sum_list (map f [0..<Suc n])
[PROOF STEP]
by (metis atMost_upto sum_set_upt_conv_sum_list_nat)


[STATEMENT]
lemma Arctan_of_real: "Arctan (of_real x) = of_real (arctan x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arctan (complex_of_real x) = complex_of_real (arctan x)
[PROOF STEP]
unfolding arctan_eq_Re_Arctan divide_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arctan (complex_of_real x) = complex_of_real (Re (Arctan (complex_of_real x)))
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma Inf_pres_downset: "Inf_pres (\<down>::'a::complete_lattice \<Rightarrow> 'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_pres \<down>
[PROOF STEP]
unfolding downset_prop fun_eq_iff comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. {y. y \<le> \<Sqinter> x} = (\<Inter>x\<in>x. {y. y \<le> x})
[PROOF STEP]
by (safe, simp_all add: le_Inf_iff)


[STATEMENT]
lemma SUP_funpow_contracting:
  fixes f :: "'a \<Rightarrow> ('a::complete_lattice)"
  assumes C: "cont f"
  shows "f (SUP i. (f^^i) m) \<le> (SUP i. (f^^i) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
have 1: "\<And>i x. f ((f^^i) x) = (f^^(Suc i)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i x. f ((f ^^ i) x) = (f ^^ Suc i) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f ((f ^^ ?i) ?x) = (f ^^ Suc ?i) ?x

goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
have "f (SUP i. (f^^i) m) = (SUP i. f ((f ^^ i) m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) = (SUP i. f ((f ^^ i) m))
[PROOF STEP]
by (subst contD[OF C]) (simp_all add: image_comp)
[PROOF STATE]
proof (state)
this:
f (SUP i. (f ^^ i) m) = (SUP i. f ((f ^^ i) m))

goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (SUP i. (f ^^ i) m) = (SUP i. f ((f ^^ i) m))

goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
have "\<dots> \<le> (SUP i. (f^^i) m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. f ((f ^^ i) m)) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (rule SUP_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> f ((f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (simp, subst 1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (f ^^ Suc i) m \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
apply (rule SUP_upper)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. Suc i \<in> UNIV
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(SUP i. f ((f ^^ i) m)) \<le> (SUP i. (f ^^ i) m)

goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)

goal (1 subgoal):
 1. f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f (SUP i. (f ^^ i) m) \<le> (SUP i. (f ^^ i) m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma
  fixes S :: "nat set"
  assumes S: "infinite S"
  shows range_enumerate: "range (enumerate S) = S"
    and strict_mono_enumerate: "strict_mono (enumerate S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (wellorder_class.enumerate S) = S &&& strict_mono (wellorder_class.enumerate S)
[PROOF STEP]
by (auto simp add: bij_betw_imp_surj_on bij_enumerate assms strict_mono_def)


[STATEMENT]
lemma convex_halfspace_gt: "convex {x. inner a x > b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex {x. b < a \<bullet> x}
[PROOF STEP]
using convex_halfspace_lt[of "-a" "-b"]
[PROOF STATE]
proof (prove)
using this:
convex {x. - a \<bullet> x < - b}

goal (1 subgoal):
 1. convex {x. b < a \<bullet> x}
[PROOF STEP]
by auto


[STATEMENT]
lemma singleton_power [simp]: "{a} *^ n = {b . b = a ^ n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a} *^ n = {b. b = a ^ n}
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {a} *^ 0 = {b. b = a ^ 0}
 2. \<And>n. {a} *^ n = {b. b = a ^ n} \<Longrightarrow> {a} *^ Suc n = {b. b = a ^ Suc n}
[PROOF STEP]
apply auto [1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {a} *^ n = {b. b = a ^ n} \<Longrightarrow> {a} *^ Suc n = {b. b = a ^ Suc n}
[PROOF STEP]
by (simp add: times_set_def)


[STATEMENT]
lemma add_carrier_vec[simp]:
  "v\<^sub>1 \<in> carrier_vec n \<Longrightarrow> v\<^sub>2 \<in> carrier_vec n \<Longrightarrow> v\<^sub>1 + v\<^sub>2 \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v\<^sub>1 \<in> carrier_vec n; v\<^sub>2 \<in> carrier_vec n\<rbrakk> \<Longrightarrow> v\<^sub>1 + v\<^sub>2 \<in> carrier_vec n
[PROOF STEP]
unfolding carrier_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v\<^sub>1 \<in> {v. dim_vec v = n}; v\<^sub>2 \<in> {v. dim_vec v = n}\<rbrakk> \<Longrightarrow> v\<^sub>1 + v\<^sub>2 \<in> {v. dim_vec v = n}
[PROOF STEP]
by auto


[STATEMENT]
lemma The_Min: "Ex1 P \<Longrightarrow> The P = Min {x. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex1 P \<Longrightarrow> The P = Min {x. P x}
[PROOF STEP]
apply (rule the_equality)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Ex1 P \<Longrightarrow> P (Min {x. P x})
 2. \<And>x. \<lbrakk>Ex1 P; P x\<rbrakk> \<Longrightarrow> x = Min {x. P x}
[PROOF STEP]
apply (metis (mono_tags) Min.infinite Min_in Min_singleton all_not_in_conv finite_subset insert_iff mem_Collect_eq subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Ex1 P; P x\<rbrakk> \<Longrightarrow> x = Min {x. P x}
[PROOF STEP]
by (metis (erased, opaque_lifting) Least_Min Least_equality Set.set_insert ex_in_conv finite.emptyI finite_insert insert_iff mem_Collect_eq order_refl)


[STATEMENT]
lemma log_powr_cancel [simp]: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> log a (a powr y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1\<rbrakk> \<Longrightarrow> log a (a powr y) = y
[PROOF STEP]
by (simp add: log_def powr_def)


[STATEMENT]
lemma stocks_of:
  assumes "UNIV \<noteq> S"
  shows "stocks (discrete_market_of S A) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
have "stk_strict_subs S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stk_strict_subs S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
UNIV \<noteq> S

goal (1 subgoal):
 1. stk_strict_subs S
[PROOF STEP]
unfolding stk_strict_subs_def
[PROOF STATE]
proof (prove)
using this:
UNIV \<noteq> S

goal (1 subgoal):
 1. S \<noteq> UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
stk_strict_subs S

goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
hence fct: "((if (stk_strict_subs S) then S else {}), A) \<in> {(s, a). stk_strict_subs s}"
[PROOF STATE]
proof (prove)
using this:
stk_strict_subs S

goal (1 subgoal):
 1. (if stk_strict_subs S then S else {}, A) \<in> {(s, a). stk_strict_subs s}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if stk_strict_subs S then S else {}, A) \<in> {(s, a). stk_strict_subs s}

goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
have "discrete_market_of S A = Abs_discrete_market (if (stk_strict_subs S) then S else {}, A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. discrete_market_of S A = Abs_discrete_market (if stk_strict_subs S then S else {}, A)
[PROOF STEP]
unfolding discrete_market_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_discrete_market (if stk_strict_subs S then S else {}, A) = Abs_discrete_market (if stk_strict_subs S then S else {}, A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
discrete_market_of S A = Abs_discrete_market (if stk_strict_subs S then S else {}, A)

goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
hence "Rep_discrete_market (discrete_market_of S A) = (if (stk_strict_subs S) then S else {},A)"
[PROOF STATE]
proof (prove)
using this:
discrete_market_of S A = Abs_discrete_market (if stk_strict_subs S then S else {}, A)

goal (1 subgoal):
 1. Rep_discrete_market (discrete_market_of S A) = (if stk_strict_subs S then S else {}, A)
[PROOF STEP]
using Abs_discrete_market_inverse[of "(if (stk_strict_subs S) then S else {}, A)"] fct
[PROOF STATE]
proof (prove)
using this:
discrete_market_of S A = Abs_discrete_market (if stk_strict_subs S then S else {}, A)
(if stk_strict_subs S then S else {}, A) \<in> {(s, a). stk_strict_subs s} \<Longrightarrow> Rep_discrete_market (Abs_discrete_market (if stk_strict_subs S then S else {}, A)) = (if stk_strict_subs S then S else {}, A)
(if stk_strict_subs S then S else {}, A) \<in> {(s, a). stk_strict_subs s}

goal (1 subgoal):
 1. Rep_discrete_market (discrete_market_of S A) = (if stk_strict_subs S then S else {}, A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Rep_discrete_market (discrete_market_of S A) = (if stk_strict_subs S then S else {}, A)

goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Rep_discrete_market (discrete_market_of S A) = (if stk_strict_subs S then S else {}, A)

goal (1 subgoal):
 1. stocks (discrete_market_of S A) = S
[PROOF STEP]
unfolding stocks_def
[PROOF STATE]
proof (prove)
using this:
Rep_discrete_market (discrete_market_of S A) = (if stk_strict_subs S then S else {}, A)

goal (1 subgoal):
 1. fst (Rep_discrete_market (discrete_market_of S A)) = S
[PROOF STEP]
using \<open>stk_strict_subs S\<close>
[PROOF STATE]
proof (prove)
using this:
Rep_discrete_market (discrete_market_of S A) = (if stk_strict_subs S then S else {}, A)
stk_strict_subs S

goal (1 subgoal):
 1. fst (Rep_discrete_market (discrete_market_of S A)) = S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
stocks (discrete_market_of S A) = S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gR_rel_trans: "x \<preceq>\<^sub>R y \<Longrightarrow> y \<preceq>\<^sub>R z \<Longrightarrow> x \<preceq>\<^sub>R z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<preceq>\<^sub>R y; y \<preceq>\<^sub>R z\<rbrakk> \<Longrightarrow> x \<preceq>\<^sub>R z
[PROOF STEP]
by (metis gR_rel_def add_assoc add_assocD_var2)


[STATEMENT]
lemma FP_JN: "FP (\<Squnion>i \<in> I. F i) = (\<Inter>i \<in> I. FP (F i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FP (JOIN I F) = (\<Inter>i\<in>I. FP (F i))
[PROOF STEP]
by (simp add: FP_def JN_stable INTER_eq)


[STATEMENT]
lemma meld_mset: "\<lbrakk>queue_invar q; queue_invar q'\<rbrakk> \<Longrightarrow>
  queue_to_multiset (meld q q') =
  queue_to_multiset q + queue_to_multiset q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>queue_invar q; queue_invar q'\<rbrakk> \<Longrightarrow> queue_to_multiset (meld q q') = queue_to_multiset q + queue_to_multiset q'
[PROOF STEP]
by(induct q q' rule: meld.induct)
  (auto simp add: link_tree_invar meld_queue_invar ins_mset union_ac)


[STATEMENT]
lemma at_right_to_top: "(at_right (0::real)) = filtermap inverse at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_right 0 = filtermap inverse at_top
[PROOF STEP]
by (intro filtermap_fun_inverse[symmetric, where g=inverse])
     (auto intro: filterlim_inverse_at_top_right filterlim_inverse_at_right_top)


[STATEMENT]
lemma div_decomp_comp:
  fixes a::nat
  shows "coprime m n \<Longrightarrow> a dvd m*n \<longleftrightarrow> (\<exists>b c. a = b * c \<and> b dvd m \<and> c dvd n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime m n \<Longrightarrow> (a dvd m * n) = (\<exists>b c. a = b * c \<and> b dvd m \<and> c dvd n)
[PROOF STEP]
by (auto simp only: division_decomp mult_dvd_mono)


[STATEMENT]
lemma delete_point_finite:
    "finite_incidence_system (del_point p) (del_point_blocks p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_incidence_system (del_point p) (del_point_blocks p)
[PROOF STEP]
using finite_sets delete_point_wf
[PROOF STATE]
proof (prove)
using this:
finite \<V>
incidence_system (del_point ?p) (del_point_blocks ?p)

goal (1 subgoal):
 1. finite_incidence_system (del_point p) (del_point_blocks p)
[PROOF STEP]
by (unfold_locales) (simp_all add: incidence_system_def del_point_def)


[STATEMENT]
lemma topspace_subtopology_subset:
   "S \<subseteq> topspace X \<Longrightarrow> topspace(subtopology X S) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> topspace X \<Longrightarrow> topspace (subtopology X S) = S
[PROOF STEP]
by (simp add: inf.absorb_iff2)


[STATEMENT]
lemma gcd_unique:
  "d dvd a \<and> d dvd b \<and> normalize d = d \<and> (\<forall>e. e dvd a \<and> e dvd b \<longrightarrow> e dvd d) \<longleftrightarrow> d = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d dvd a \<and> d dvd b \<and> normalize d = d \<and> (\<forall>e. e dvd a \<and> e dvd b \<longrightarrow> e dvd d)) = (d = gcd a b)
[PROOF STEP]
by rule (auto intro: gcdI simp: gcd_greatest)


[STATEMENT]
lemma SA_nonzero_set_memI:
  assumes "f \<in> carrier (SA n)"
  assumes "x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f x \<noteq>  \<zero>"
  shows  "x \<in> SA_nonzero_set n f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> SA_nonzero_set n f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f x \<noteq> \<zero>

goal (1 subgoal):
 1. x \<in> SA_nonzero_set n f
[PROOF STEP]
unfolding SA_nonzero_set_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f x \<noteq> \<zero>

goal (1 subgoal):
 1. x \<in> {x \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>). f x \<noteq> \<zero>}
[PROOF STEP]
by blast


[STATEMENT]
lemma l_minus:
  "\<lbrakk> x \<in> carrier R; y \<in> carrier R \<rbrakk> \<Longrightarrow> (\<ominus> x) \<otimes> y = \<ominus> (x \<otimes> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
assume R: "x \<in> carrier R" "y \<in> carrier R"
[PROOF STATE]
proof (state)
this:
x \<in> carrier R
y \<in> carrier R

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
[PROOF STEP]
have "(\<ominus> x) \<otimes> y \<oplus> x \<otimes> y = (\<ominus> x \<oplus> x) \<otimes> y"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R

goal (1 subgoal):
 1. \<ominus> x \<otimes> y \<oplus> x \<otimes> y = (\<ominus> x \<oplus> x) \<otimes> y
[PROOF STEP]
by (simp add: l_distr)
[PROOF STATE]
proof (state)
this:
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = (\<ominus> x \<oplus> x) \<otimes> y

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = (\<ominus> x \<oplus> x) \<otimes> y

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
from R
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
[PROOF STEP]
have "... = \<zero>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R

goal (1 subgoal):
 1. (\<ominus> x \<oplus> x) \<otimes> y = \<zero>
[PROOF STEP]
by (simp add: l_neg)
[PROOF STATE]
proof (state)
this:
(\<ominus> x \<oplus> x) \<otimes> y = \<zero>

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = \<zero>
[PROOF STEP]
have "(\<ominus> x) \<otimes> y \<oplus> x \<otimes> y = \<zero>"
[PROOF STATE]
proof (prove)
using this:
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = \<zero>

goal (1 subgoal):
 1. \<ominus> x \<otimes> y \<oplus> x \<otimes> y = \<zero>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = \<zero>

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
with R
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = \<zero>
[PROOF STEP]
have "(\<ominus> x) \<otimes> y \<oplus> x \<otimes> y \<oplus> \<ominus> (x \<otimes> y) = \<zero> \<oplus> \<ominus> (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
\<ominus> x \<otimes> y \<oplus> x \<otimes> y = \<zero>

goal (1 subgoal):
 1. \<ominus> x \<otimes> y \<oplus> x \<otimes> y \<oplus> \<ominus> (x \<otimes> y) = \<zero> \<oplus> \<ominus> (x \<otimes> y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<ominus> x \<otimes> y \<oplus> x \<otimes> y \<oplus> \<ominus> (x \<otimes> y) = \<zero> \<oplus> \<ominus> (x \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier R; y \<in> carrier R\<rbrakk> \<Longrightarrow> \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
with R
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
\<ominus> x \<otimes> y \<oplus> x \<otimes> y \<oplus> \<ominus> (x \<otimes> y) = \<zero> \<oplus> \<ominus> (x \<otimes> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
\<ominus> x \<otimes> y \<oplus> x \<otimes> y \<oplus> \<ominus> (x \<otimes> y) = \<zero> \<oplus> \<ominus> (x \<otimes> y)

goal (1 subgoal):
 1. \<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)
[PROOF STEP]
by (simp add: a_assoc r_neg)
[PROOF STATE]
proof (state)
this:
\<ominus> x \<otimes> y = \<ominus> (x \<otimes> y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma openI [intro?]: "(\<And>x. x\<in>S \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> S) \<Longrightarrow> open S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> S \<Longrightarrow> \<exists>e>0. ball x e \<subseteq> S) \<Longrightarrow> open S
[PROOF STEP]
by (auto simp: open_contains_ball)


[STATEMENT]
lemma tendsto_inverse_0_at_infinity:
    "LIM x F. f x :> at_infinity \<Longrightarrow> ((\<lambda>x. inverse (f x) :: real) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_infinity F \<Longrightarrow> ((\<lambda>x. inverse (f x)) \<longlongrightarrow> 0) F
[PROOF STEP]
by (metis filterlim_at filterlim_inverse_at_iff)


[STATEMENT]
lemma same_price_in_argmax :
  assumes i_agt: "i \<in> agents"
  assumes lns : "local_nonsatiation consumption_set Pr[i]"
  assumes "x \<in> arg_max_set (U[i]) (budget_constraint (calculate_value P) consumption_set (poe_wealth P i Y))"
  assumes "y \<in> arg_max_set (U[i]) (budget_constraint (calculate_value P) consumption_set (poe_wealth P i Y))"
  shows "(P \<bullet> x) = (P \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> x = P \<bullet> y
[PROOF STEP]
using am_utilises_entire_bgt assms lns
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i \<in> agents; local_nonsatiation consumption_set Pr[?i]; ?X \<in> arg_max_set U[?i] (budget_constraint ((\<bullet>) ?P) consumption_set (poe_wealth ?P ?i ?Y))\<rbrakk> \<Longrightarrow> ?P \<bullet> ?X = poe_wealth ?P ?i ?Y
i \<in> agents
local_nonsatiation consumption_set Pr[i]
x \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i Y))
y \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i Y))
local_nonsatiation consumption_set Pr[i]

goal (1 subgoal):
 1. P \<bullet> x = P \<bullet> y
[PROOF STEP]
by (metis (no_types) am_utilises_entire_bgt assms(3) assms(4) i_agt lns)


[STATEMENT]
lemma (in CRR_market) rn_rev_price_rev_borel_adapt:
assumes "cash_flow \<in> borel_measurable (G matur)"
and "N = bernoulli_stream q"
and "0 < q"
and "q < 1"
shows "(n \<le> matur) \<Longrightarrow> (rn_rev_price N cash_flow matur n) \<in> borel_measurable (G (matur - n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n))
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur 0 \<in> borel_measurable (G (matur - 0))
 2. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 \<le> matur

goal (2 subgoals):
 1. 0 \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur 0 \<in> borel_measurable (G (matur - 0))
 2. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> matur

goal (1 subgoal):
 1. rn_rev_price N cash_flow matur 0 \<in> borel_measurable (G (matur - 0))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> matur
cash_flow \<in> borel_measurable (G matur)
N = bernoulli_stream q
0 < q
q < 1

goal (1 subgoal):
 1. rn_rev_price N cash_flow matur 0 \<in> borel_measurable (G (matur - 0))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
rn_rev_price N cash_flow matur 0 \<in> borel_measurable (G (matur - 0))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n))
Suc n \<le> matur

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
have "rn_rev_price N cash_flow matur (Suc n) =
      (\<lambda>w. discount_factor r (Suc 0) w *
        (expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n)) w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rn_rev_price N cash_flow matur (Suc n) = (\<lambda>w. discount_factor r (Suc 0) w * expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) w)
[PROOF STEP]
using rn_rev_price.simps(2)
[PROOF STATE]
proof (prove)
using this:
rn_rev_price ?N ?der ?matur (Suc ?n) ?w = discount_factor r (Suc 0) ?w * expl_cond_expect ?N (proj_stoch_proc geom_proc (?matur - Suc ?n)) (rn_rev_price ?N ?der ?matur ?n) ?w

goal (1 subgoal):
 1. rn_rev_price N cash_flow matur (Suc n) = (\<lambda>w. discount_factor r (Suc 0) w * expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) w)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rn_rev_price N cash_flow matur (Suc n) = (\<lambda>w. discount_factor r (Suc 0) w * expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) w)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rn_rev_price N cash_flow matur (Suc n) = (\<lambda>w. discount_factor r (Suc 0) w * expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) w)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
have "... \<in> borel_measurable (G (matur - Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. discount_factor r (Suc 0) w * expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) w) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
proof (rule borel_measurable_times)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. discount_factor r (Suc 0) \<in> borel_measurable (G (matur - Suc n))
 2. expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
show "discount_factor r (Suc 0) \<in> borel_measurable (G (matur - Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. discount_factor r (Suc 0) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
by (simp add:discount_factor_borel_measurable)
[PROOF STATE]
proof (state)
this:
discount_factor r (Suc 0) \<in> borel_measurable (G (matur - Suc n))

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
show "expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n)
      \<in> borel_measurable (G (matur - Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cash_flow \<in> borel_measurable (G matur)
N = bernoulli_stream q
0 < q
q < 1

goal (1 subgoal):
 1. expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
by (simp add: bernoulli_expl_cond_expect_adapt)
[PROOF STATE]
proof (state)
this:
expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) \<in> borel_measurable (G (matur - Suc n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>w. discount_factor r (Suc 0) w * expl_cond_expect N (proj_stoch_proc geom_proc (matur - Suc n)) (rn_rev_price N cash_flow matur n) w) \<in> borel_measurable (G (matur - Suc n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> matur \<Longrightarrow> rn_rev_price N cash_flow matur n \<in> borel_measurable (G (matur - n)); Suc n \<le> matur\<rbrakk> \<Longrightarrow> rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
show "rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))"
[PROOF STATE]
proof (prove)
using this:
rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))

goal (1 subgoal):
 1. rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
rn_rev_price N cash_flow matur (Suc n) \<in> borel_measurable (G (matur - Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma octo_inverse_eq_cnj: "norm q = 1 \<Longrightarrow> inverse q = cnj q" for q::octo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm q = 1 \<Longrightarrow> inverse q = Octonions.cnj q
[PROOF STEP]
by (simp add: octo_inverse_cnj)


[STATEMENT]
lemma subset_imp_less_mset: "A \<subset># B \<Longrightarrow> A < B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subset># B \<Longrightarrow> A < B
[PROOF STEP]
by (simp add: order.not_eq_order_implies_strict subset_eq_imp_le_multiset)


[STATEMENT]
lemma projection_eqI:
  fixes  M :: \<open>('a::chilbert_space) set\<close>
  assumes  \<open>closed_csubspace M\<close> and \<open>h - x \<in> orthogonal_complement M\<close> and \<open>x \<in> M\<close>
  shows \<open>projection M h = x\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projection M h = x
[PROOF STEP]
by (metis assms(1) assms(2) assms(3) is_projection_on_iff_orthog orthog_proj_exists projection_def is_projection_on_eqI tfl_some)


[STATEMENT]
lemma "(\<forall>x. P(a) \<and> (P(x)\<longrightarrow>P(b))\<longrightarrow>P(c))  =
     (\<forall>x. (\<not>P(a) \<or> P(x) \<or> P(c)) \<and> (\<not>P(a) \<or> \<not>P(b) \<or> P(c)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P a \<and> (P x \<longrightarrow> P b) \<longrightarrow> P c) = (\<forall>x. (\<not> P a \<or> P x \<or> P c) \<and> (\<not> P a \<or> \<not> P b \<or> P c))
[PROOF STEP]
by blast


[STATEMENT]
lemma euclid_ext_eq [simp]:
  "euclid_ext a b = (bezout_coefficients a b, gcd a b)" (is "?p = ?q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b = (bezout_coefficients a b, gcd a b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = fst (bezout_coefficients a b, gcd a b)
 2. snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = snd (bezout_coefficients a b, gcd a b)
[PROOF STEP]
show "fst ?p = fst ?q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = fst (bezout_coefficients a b, gcd a b)
[PROOF STEP]
by (simp add: bezout_coefficients_def)
[PROOF STATE]
proof (state)
this:
fst (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = fst (bezout_coefficients a b, gcd a b)

goal (1 subgoal):
 1. snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = snd (bezout_coefficients a b, gcd a b)
[PROOF STEP]
have "snd (euclid_ext_aux 1 0 0 1 a b) = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = gcd a b
[PROOF STEP]
by (rule euclid_ext_aux_eq_gcd [of a b a b 1 0 0 1])
      (simp_all add: prod_eq_iff)
[PROOF STATE]
proof (state)
this:
snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = gcd a b

goal (1 subgoal):
 1. snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = snd (bezout_coefficients a b, gcd a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = gcd a b
[PROOF STEP]
show "snd ?p = snd ?q"
[PROOF STATE]
proof (prove)
using this:
snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = gcd a b

goal (1 subgoal):
 1. snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = snd (bezout_coefficients a b, gcd a b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (euclid_ext_aux (1::'a) (0::'a) (0::'a) (1::'a) a b) = snd (bezout_coefficients a b, gcd a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma preal_mult_assoc: "((x::preal) * y) * z = x * (y * z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y * z = x * (y * z)
[PROOF STEP]
apply (simp add: preal_mult_def mem_mult_set Rep_preal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_set (mult_set (Rep_preal x) (Rep_preal y)) (Rep_preal z) = mult_set (Rep_preal x) (mult_set (Rep_preal y) (Rep_preal z))
[PROOF STEP]
apply (simp add: mult_set_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {w. \<exists>xa. (\<exists>x\<in>Rep_preal x. \<exists>y\<in>Rep_preal y. xa = x * y) \<and> (\<exists>y\<in>Rep_preal z. w = xa * y)} = {w. \<exists>x\<in>Rep_preal x. \<exists>ya. (\<exists>x\<in>Rep_preal y. \<exists>y\<in>Rep_preal z. ya = x * y) \<and> w = x * ya}
[PROOF STEP]
apply (metis (no_types, opaque_lifting) ab_semigroup_mult_class.mult_ac(1))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem wls_Abs_vsubst_all_aux:
assumes "wls s X" and "wls s X'"
shows
"(Abs xs x X = Abs xs x' X') =
 (\<forall> y. (y = x \<or> fresh xs y X) \<and> (y = x' \<or> fresh xs y X') \<longrightarrow>
       (X #[y // x]_xs) = (X' #[y // x']_xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs xs x X = Abs xs x' X') = (\<forall>y. (y = x \<or> fresh xs y X) \<and> (y = x' \<or> fresh xs y X') \<longrightarrow> X #[y // x]_xs = X' #[y // x']_xs)
[PROOF STEP]
using assms wls_Abs_swap_all
[PROOF STATE]
proof (prove)
using this:
wls s X
wls s X'
\<lbrakk>wls ?s ?X; wls ?s ?X'\<rbrakk> \<Longrightarrow> (Abs ?xs ?x ?X = Abs ?xs ?x' ?X') = (\<forall>y. (y = ?x \<or> fresh ?xs y ?X) \<and> (y = ?x' \<or> fresh ?xs y ?X') \<longrightarrow> ?X #[y \<and> ?x]_?xs = ?X' #[y \<and> ?x']_?xs)

goal (1 subgoal):
 1. (Abs xs x X = Abs xs x' X') = (\<forall>y. (y = x \<or> fresh xs y X) \<and> (y = x' \<or> fresh xs y X') \<longrightarrow> X #[y // x]_xs = X' #[y // x']_xs)
[PROOF STEP]
by (simp add: wls_vsubst_eq_swap)


[STATEMENT]
lemma (in FinGroup) group_ring_spanning_set :
  "\<exists>gs. distinct gs \<and> set gs = G
        \<and> (\<forall>f\<in> (group_ring :: ('b::semiring_1, 'g) aezfun set). \<exists>bs.
          length bs = length gs \<and> f = (\<Sum>(b,g)\<leftarrow>zip bs gs. (b \<delta>\<delta> 0) * (1 \<delta>\<delta> g)) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>gs. distinct gs \<and> set gs = G \<and> (\<forall>f\<in>group_ring. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'b) \<delta>\<delta> g)) bs gs))
[PROOF STEP]
using     finite aezfun_common_supp_spanning_set_decomp[of G] group_ringD
[PROOF STATE]
proof (prove)
using this:
finite G
finite G \<Longrightarrow> \<exists>gs. distinct gs \<and> set gs = G \<and> (\<forall>x\<in>group_ring. \<exists>rs. length rs = length gs \<and> x = sum_list (map2 (\<lambda>r g. r \<delta>\<delta> (0::'g) * ((1::?'r) \<delta>\<delta> g)) rs gs))
group_ring = {x. supp (aezfun x) \<subseteq> G}

goal (1 subgoal):
 1. \<exists>gs. distinct gs \<and> set gs = G \<and> (\<forall>f\<in>group_ring. \<exists>bs. length bs = length gs \<and> f = sum_list (map2 (\<lambda>b g. b \<delta>\<delta> (0::'g) * ((1::'b) \<delta>\<delta> g)) bs gs))
[PROOF STEP]
by        fast


[STATEMENT]
lemma union_result: "\<forall>x \<in> {S . (\<exists> (m::nat) n .  {m..n }=S) }.
         \<forall>y \<in> {S . (\<exists> (m::nat) n .  {m..n }=S)  }.
           x \<noteq> {} \<and> y \<noteq> {} \<and> Max x +1 = Min y
            \<longrightarrow> x \<union> y \<in>{S . (\<exists> (m::nat) n . {m..n }=S)  }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{S. \<exists>m n. {m..n} = S}. \<forall>y\<in>{S. \<exists>m n. {m..n} = S}. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
proof (rule ballI)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {S. \<exists>m n. {m..n} = S}; y \<in> {S. \<exists>m n. {m..n} = S}\<rbrakk> \<Longrightarrow> x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {S. \<exists>m n. {m..n} = S}; y \<in> {S. \<exists>m n. {m..n} = S}\<rbrakk> \<Longrightarrow> x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
assume "x\<in> {S . (\<exists> (m::nat) n .  {m..n }=S) }"
    and "y\<in> {S . (\<exists> (m::nat) n .  {m..n }=S) }"
[PROOF STATE]
proof (state)
this:
x \<in> {S. \<exists>m n. {m..n} = S}
y \<in> {S. \<exists>m n. {m..n} = S}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {S. \<exists>m n. {m..n} = S}; y \<in> {S. \<exists>m n. {m..n} = S}\<rbrakk> \<Longrightarrow> x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {S. \<exists>m n. {m..n} = S}
y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
have x_def:"(\<exists>m n.  {m..n} = x) "
    and y_def:"(\<exists>m n.  {m..n} = y) "
[PROOF STATE]
proof (prove)
using this:
x \<in> {S. \<exists>m n. {m..n} = S}
y \<in> {S. \<exists>m n. {m..n} = S}

goal (1 subgoal):
 1. \<exists>m n. {m..n} = x &&& \<exists>m n. {m..n} = y
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
\<exists>m n. {m..n} = x
\<exists>m n. {m..n} = y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> {S. \<exists>m n. {m..n} = S}; y \<in> {S. \<exists>m n. {m..n} = S}\<rbrakk> \<Longrightarrow> x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
show   " x \<noteq> {} \<and> y \<noteq> {} \<and>   Max x+1 = Min y
            \<longrightarrow> x \<union>  y \<in> {S. (\<exists>m n.  {m..n} = S) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
assume pre:"x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y"
[PROOF STATE]
proof (state)
this:
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y
[PROOF STEP]
have x_int:"\<exists>m n. m \<le> n \<and> {m..n} = x"
          and y_int:"(\<exists>m n. m \<le> n \<and> {m..n} = y)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y

goal (1 subgoal):
 1. \<exists>m n. m \<le> n \<and> {m..n} = x &&& \<exists>m n. m \<le> n \<and> {m..n} = y
[PROOF STEP]
using  x_def y_def
[PROOF STATE]
proof (prove)
using this:
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y
\<exists>m n. {m..n} = x
\<exists>m n. {m..n} = y

goal (1 subgoal):
 1. \<exists>m n. m \<le> n \<and> {m..n} = x &&& \<exists>m n. m \<le> n \<and> {m..n} = y
[PROOF STEP]
by force+
[PROOF STATE]
proof (state)
this:
\<exists>m n. m \<le> n \<and> {m..n} = x
\<exists>m n. m \<le> n \<and> {m..n} = y

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<exists>m n. m \<le> n \<and> {m..n} = x
\<exists>m n. m \<le> n \<and> {m..n} = y

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
fix ya yb xa xb
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
assume y_prop:"ya \<le> yb \<and> {ya..yb} = y" and x_prop:"xa \<le> xb \<and> {xa..xb} = x"
[PROOF STATE]
proof (state)
this:
ya \<le> yb \<and> {ya..yb} = y
xa \<le> xb \<and> {xa..xb} = x

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ya \<le> yb \<and> {ya..yb} = y
xa \<le> xb \<and> {xa..xb} = x
[PROOF STEP]
have upper_x:"Max x = xb" and lower_y: "Min y = ya"
[PROOF STATE]
proof (prove)
using this:
ya \<le> yb \<and> {ya..yb} = y
xa \<le> xb \<and> {xa..xb} = x

goal (1 subgoal):
 1. Max x = xb &&& Min y = ya
[PROOF STEP]
by (auto simp: Max_eq_iff Min_eq_iff)
[PROOF STATE]
proof (state)
this:
Max x = xb
Min y = ya

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
from upper_x and lower_y and pre
[PROOF STATE]
proof (chain)
picking this:
Max x = xb
Min y = ya
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y
[PROOF STEP]
have upper_eq_lower: "xb+1 = ya"
[PROOF STATE]
proof (prove)
using this:
Max x = xb
Min y = ya
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y

goal (1 subgoal):
 1. xb + 1 = ya
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
xb + 1 = ya

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
hence "y= {xb+1 .. yb}"
[PROOF STATE]
proof (prove)
using this:
xb + 1 = ya

goal (1 subgoal):
 1. y = {xb + 1..yb}
[PROOF STEP]
using y_prop
[PROOF STATE]
proof (prove)
using this:
xb + 1 = ya
ya \<le> yb \<and> {ya..yb} = y

goal (1 subgoal):
 1. y = {xb + 1..yb}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = {xb + 1..yb}

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
hence "x \<union> y = {xa..yb}"
[PROOF STATE]
proof (prove)
using this:
y = {xb + 1..yb}

goal (1 subgoal):
 1. x \<union> y = {xa..yb}
[PROOF STEP]
using un_consec_seq upper_eq_lower x_prop y_prop
[PROOF STATE]
proof (prove)
using this:
y = {xb + 1..yb}
?m \<le> ?n \<and> ?n + 1 \<le> ?l \<longrightarrow> {?m..?n} \<union> {?n + 1..?l} = {?m..?l}
xb + 1 = ya
xa \<le> xb \<and> {xa..xb} = x
ya \<le> yb \<and> {ya..yb} = y

goal (1 subgoal):
 1. x \<union> y = {xa..yb}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<union> y = {xa..yb}

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<union> y = {xa..yb}
[PROOF STEP]
have " x \<union> y \<in> {S.(\<exists>m n.  {m..n} = S) }"
[PROOF STATE]
proof (prove)
using this:
x \<union> y = {xa..yb}

goal (1 subgoal):
 1. x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<union> y \<in> {S. \<exists>m n. {m..n} = S}

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?ya2 \<le> ?yb2 \<and> {?ya2..?yb2} = y; ?xa2 \<le> ?xb2 \<and> {?xa2..?xb2} = x\<rbrakk> \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}

goal (1 subgoal):
 1. x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?ya2 \<le> ?yb2 \<and> {?ya2..?yb2} = y; ?xa2 \<le> ?xb2 \<and> {?xa2..?xb2} = x\<rbrakk> \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
show "x \<union> y \<in> {S.(\<exists>m n.  {m..n} = S)}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ya2 \<le> ?yb2 \<and> {?ya2..?yb2} = y; ?xa2 \<le> ?xb2 \<and> {?xa2..?xb2} = x\<rbrakk> \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}

goal (1 subgoal):
 1. x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
using x_int y_int
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ya2 \<le> ?yb2 \<and> {?ya2..?yb2} = y; ?xa2 \<le> ?xb2 \<and> {?xa2..?xb2} = x\<rbrakk> \<Longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
\<exists>m n. m \<le> n \<and> {m..n} = x
\<exists>m n. m \<le> n \<and> {m..n} = y

goal (1 subgoal):
 1. x \<union> y \<in> {S. \<exists>m n. {m..n} = S}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<union> y \<in> {S. \<exists>m n. {m..n} = S}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> {} \<and> y \<noteq> {} \<and> Max x + 1 = Min y \<longrightarrow> x \<union> y \<in> {S. \<exists>m n. {m..n} = S}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gen_lucas_lehmer_sequence_4_closed_form1:
  "real_of_int (gen_lucas_lehmer_sequence 4 n) = (2 + sqrt 3) ^ (2 ^ n) + (2 - sqrt 3) ^ (2 ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (gen_lucas_lehmer_sequence 4 n) = (2 + sqrt 3) ^ 2 ^ n + (2 - sqrt 3) ^ 2 ^ n
[PROOF STEP]
by (induction n)
     (auto simp: algebra_simps power2_eq_square power_mult simp flip: power_mult_distrib)


[STATEMENT]
lemma has_derivative_at2: "(f has_derivative f') (at x) \<longleftrightarrow>
    bounded_linear f' \<and> ((\<lambda>y. (1 / (norm(y - x))) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> 0) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at x) = (bounded_linear f' \<and> (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<midarrow>x\<rightarrow> (0::'b))
[PROOF STEP]
using has_derivative_within [of f f' x UNIV]
[PROOF STATE]
proof (prove)
using this:
(f has_derivative f') (at x) = (bounded_linear f' \<and> (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<midarrow>x\<rightarrow> (0::'b))

goal (1 subgoal):
 1. (f has_derivative f') (at x) = (bounded_linear f' \<and> (\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<midarrow>x\<rightarrow> (0::'b))
[PROOF STEP]
by simp


[STATEMENT]
lemma min_height_size1_log_if_incomplete:
  "\<not> complete t \<Longrightarrow> min_height t < log 2 (size1 t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Tree.complete t \<Longrightarrow> real (min_height t) < log 2 (real (size1 t))
[PROOF STEP]
by (simp add: less_log2_of_power min_height_size1_if_incomplete)


[STATEMENT]
lemma iMOD_singleton_eq_conv: "([r, mod m] = {a}) = (r = a \<and> m = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r, mod m ] = {a}) = (r = a \<and> m = 0)
[PROOF STEP]
apply (rule_tac t="[r, mod m] = {a}" and s="[r, mod m] \<subseteq> {a}" in subst)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ([ r, mod m ] \<subseteq> {a}) = ([ r, mod m ] = {a})
 2. ([ r, mod m ] \<subseteq> {a}) = (r = a \<and> m = 0)
[PROOF STEP]
apply (simp add: subset_singleton_conv iMOD_not_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r, mod m ] \<subseteq> {a}) = (r = a \<and> m = 0)
[PROOF STEP]
apply (simp add: iMOD_singleton_subset_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma has_ivl_integral_ivl_integral:
  "f integrable_on (closed_segment a b) \<longleftrightarrow> (f has_ivl_integral (ivl_integral a b f)) a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f integrable_on closed_segment a b) = (f has_ivl_integral ivl_integral a b f) a b
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl has_ivl_integral_def ivl_integral_def)


[STATEMENT]
lemma wnf_lemma_4:
  "(n(r * L) * n(q * L) \<squnion> an(p * L) * an(q * L)) * an(q * L) = an(p * L) * an(q * L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n (r * L) * n (q * L) \<squnion> an (p * L) * an (q * L)) * an (q * L) = an (p * L) * an (q * L)
[PROOF STEP]
by (metis an_mult_commutative n_mult_commutative wnf_lemma_3)


[STATEMENT]
lemma "oalist_tc_of_list [(0::nat, 4::nat), (1, 3), (0, 2), (1, 1)] = oalist_tc_of_list [(0, 4), (1, 3)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. oalist_tc_of_list [(0, 4), (1, 3), (0, 2), (1, 1)] = oalist_tc_of_list [(0, 4), (1, 3)]
[PROOF STEP]
by eval


[STATEMENT]
lemma all_eq_all: "\<forall>x. P x = Q x ==> (\<forall>x. P x) = (\<forall>x. Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. P x = Q x \<Longrightarrow> (\<forall>x. P x) = (\<forall>x. Q x)
[PROOF STEP]
by blast