[STATEMENT]
lemma T2_axiom_implies_T0_axiom:
  fixes T (structure)
  assumes T2: "\<forall> x \<in> carrier. \<forall> y \<in> carrier. x \<noteq> y
  \<longrightarrow> (\<exists> u \<in> nhds x. \<exists> v \<in> nhds y. u \<inter> v = {})"
  shows "T0_axioms T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T0_axioms T
[PROOF STEP]
proof (rule T0_axioms.intro, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier; x \<noteq> y; \<not> (\<exists>v\<in>nhds y. x \<notin> v)\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds x. y \<notin> u
[PROOF STEP]
interpret carrier T
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier; x \<noteq> y; \<not> (\<exists>v\<in>nhds y. x \<notin> v)\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds x. y \<notin> u
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier; x \<noteq> y; \<not> (\<exists>v\<in>nhds y. x \<notin> v)\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds x. y \<notin> u
[PROOF STEP]
assume neq: "x \<noteq> y" and
    points: "x \<in> carrier" "y \<in> carrier"
[PROOF STATE]
proof (state)
this:
x \<noteq> y
x \<in> carrier
y \<in> carrier

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier; x \<noteq> y; \<not> (\<exists>v\<in>nhds y. x \<notin> v)\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds x. y \<notin> u
[PROOF STEP]
with T2
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
x \<noteq> y
x \<in> carrier
y \<in> carrier
[PROOF STEP]
obtain u v
    where unhd: "u \<in> nhds x" and
    vnhd: "v \<in> nhds y" and Int_empty: "u \<inter> v = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>carrier. \<forall>y\<in>carrier. x \<noteq> y \<longrightarrow> (\<exists>u\<in>nhds x. \<exists>v\<in>nhds y. u \<inter> v = {})
x \<noteq> y
x \<in> carrier
y \<in> carrier

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> nhds x; v \<in> nhds y; u \<inter> v = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
u \<in> nhds x
v \<in> nhds y
u \<inter> v = {}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier; y \<in> carrier; x \<noteq> y; \<not> (\<exists>v\<in>nhds y. x \<notin> v)\<rbrakk> \<Longrightarrow> \<exists>u\<in>nhds x. y \<notin> u
[PROOF STEP]
show "\<exists>u\<in>nhds x. y \<notin> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u\<in>nhds x. y \<notin> u
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y \<notin> ?u
 2. ?u \<in> nhds x
[PROOF STEP]
from vnhd
[PROOF STATE]
proof (chain)
picking this:
v \<in> nhds y
[PROOF STEP]
have "y \<in> v"
[PROOF STATE]
proof (prove)
using this:
v \<in> nhds y

goal (1 subgoal):
 1. y \<in> v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> v

goal (2 subgoals):
 1. y \<notin> ?u
 2. ?u \<in> nhds x
[PROOF STEP]
with Int_empty
[PROOF STATE]
proof (chain)
picking this:
u \<inter> v = {}
y \<in> v
[PROOF STEP]
show "y \<notin> u"
[PROOF STATE]
proof (prove)
using this:
u \<inter> v = {}
y \<in> v

goal (1 subgoal):
 1. y \<notin> u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<notin> u

goal (1 subgoal):
 1. u \<in> nhds x
[PROOF STEP]
qed (rule unhd)
[PROOF STATE]
proof (state)
this:
\<exists>u\<in>nhds x. y \<notin> u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_mult_nat_floor: "nat \<lfloor>a\<rfloor> * nat \<lfloor>b\<rfloor> \<le> nat \<lfloor>a * b\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<lfloor>a\<rfloor> * nat \<lfloor>b\<rfloor> \<le> nat \<lfloor>a * b\<rfloor>
[PROOF STEP]
by (cases "0 \<le> a \<and> 0 \<le> b")
     (auto simp add: nat_mult_distrib[symmetric] nat_mono le_mult_floor)


[STATEMENT]
lemma rel_interior_convex_hull_union:
  fixes S :: "'a \<Rightarrow> 'n::euclidean_space set"
  assumes "finite I"
    and "\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}"
  shows "rel_interior (convex hull (\<Union>(S ` I))) =
    {sum (\<lambda>i. c i *\<^sub>R s i) I | c s. (\<forall>i\<in>I. c i > 0) \<and> sum c I = 1 \<and>
      (\<forall>i\<in>I. s i \<in> rel_interior(S i))}"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
proof (cases "I = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. I = {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
 2. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
I = {}

goal (2 subgoals):
 1. I = {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
 2. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
I = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
I = {}

goal (1 subgoal):
 1. rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
using convex_hull_empty
[PROOF STATE]
proof (prove)
using this:
I = {}
convex hull {} = {}

goal (1 subgoal):
 1. rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
I \<noteq> {}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
define C0 where "C0 = convex hull (\<Union>(S ` I))"
[PROOF STATE]
proof (state)
this:
C0 = convex hull \<Union> (S ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "\<forall>i\<in>I. C0 \<ge> S i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. S i \<subseteq> C0
[PROOF STEP]
unfolding C0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. S i \<subseteq> convex hull \<Union> (S ` I)
[PROOF STEP]
using hull_subset[of "\<Union>(S ` I)"]
[PROOF STATE]
proof (prove)
using this:
\<Union> (S ` I) \<subseteq> ?S hull \<Union> (S ` I)

goal (1 subgoal):
 1. \<forall>i\<in>I. S i \<subseteq> convex hull \<Union> (S ` I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. S i \<subseteq> C0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
define K0 where "K0 = cone hull ({1 :: real} \<times> C0)"
[PROOF STATE]
proof (state)
this:
K0 = cone hull {1} \<times> C0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
define K where "K i = cone hull ({1 :: real} \<times> S i)" for i
[PROOF STATE]
proof (state)
this:
K ?i = cone hull {1} \<times> S ?i

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "\<forall>i\<in>I. K i \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. K i \<noteq> {}
[PROOF STEP]
unfolding K_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. cone hull {1} \<times> S i \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}

goal (1 subgoal):
 1. \<forall>i\<in>I. cone hull {1} \<times> S i \<noteq> {}
[PROOF STEP]
by (simp add: cone_hull_empty_iff[symmetric])
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. K i \<noteq> {}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have convK: "\<forall>i\<in>I. convex (K i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. convex (K i)
[PROOF STEP]
unfolding K_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. convex (cone hull {1} \<times> S i)
[PROOF STEP]
by (simp add: assms(2) convex_Times convex_cone_hull)
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. convex (K i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "K0 \<supseteq> K i" if  "i \<in> I" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K i \<subseteq> K0
[PROOF STEP]
unfolding K0_def K_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cone hull {1} \<times> S i \<subseteq> cone hull {1} \<times> C0
[PROOF STEP]
by (simp add: Sigma_mono \<open>\<forall>i\<in>I. S i \<subseteq> C0\<close> hull_mono that)
[PROOF STATE]
proof (state)
this:
?i \<in> I \<Longrightarrow> K ?i \<subseteq> K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> K ?i \<subseteq> K0
[PROOF STEP]
have "K0 \<supseteq> \<Union>(K ` I)"
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> K ?i \<subseteq> K0

goal (1 subgoal):
 1. \<Union> (K ` I) \<subseteq> K0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (K ` I) \<subseteq> K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> (K ` I) \<subseteq> K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "convex K0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex K0
[PROOF STEP]
unfolding K0_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (cone hull {1} \<times> C0)
[PROOF STEP]
by (simp add: C0_def convex_Times convex_cone_hull)
[PROOF STATE]
proof (state)
this:
convex K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Union> (K ` I) \<subseteq> K0
convex K0
[PROOF STEP]
have geq: "K0 \<supseteq> convex hull (\<Union>(K ` I))"
[PROOF STATE]
proof (prove)
using this:
\<Union> (K ` I) \<subseteq> K0
convex K0

goal (1 subgoal):
 1. convex hull \<Union> (K ` I) \<subseteq> K0
[PROOF STEP]
using hull_minimal[of _ "K0" "convex"]
[PROOF STATE]
proof (prove)
using this:
\<Union> (K ` I) \<subseteq> K0
convex K0
\<lbrakk>?s \<subseteq> K0; convex K0\<rbrakk> \<Longrightarrow> convex hull ?s \<subseteq> K0

goal (1 subgoal):
 1. convex hull \<Union> (K ` I) \<subseteq> K0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convex hull \<Union> (K ` I) \<subseteq> K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "\<forall>i\<in>I. K i \<supseteq> {1 :: real} \<times> S i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. {1} \<times> S i \<subseteq> K i
[PROOF STEP]
using K_def
[PROOF STATE]
proof (prove)
using this:
K ?i = cone hull {1} \<times> S ?i

goal (1 subgoal):
 1. \<forall>i\<in>I. {1} \<times> S i \<subseteq> K i
[PROOF STEP]
by (simp add: hull_subset)
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. {1} \<times> S i \<subseteq> K i

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>I. {1} \<times> S i \<subseteq> K i
[PROOF STEP]
have "\<Union>(K ` I) \<supseteq> {1 :: real} \<times> \<Union>(S ` I)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>I. {1} \<times> S i \<subseteq> K i

goal (1 subgoal):
 1. {1} \<times> \<Union> (S ` I) \<subseteq> \<Union> (K ` I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1} \<times> \<Union> (S ` I) \<subseteq> \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{1} \<times> \<Union> (S ` I) \<subseteq> \<Union> (K ` I)
[PROOF STEP]
have "convex hull \<Union>(K ` I) \<supseteq> convex hull ({1 :: real} \<times> \<Union>(S ` I))"
[PROOF STATE]
proof (prove)
using this:
{1} \<times> \<Union> (S ` I) \<subseteq> \<Union> (K ` I)

goal (1 subgoal):
 1. convex hull {1} \<times> \<Union> (S ` I) \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
by (simp add: hull_mono)
[PROOF STATE]
proof (state)
this:
convex hull {1} \<times> \<Union> (S ` I) \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex hull {1} \<times> \<Union> (S ` I) \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
have "convex hull \<Union>(K ` I) \<supseteq> {1 :: real} \<times> C0"
[PROOF STATE]
proof (prove)
using this:
convex hull {1} \<times> \<Union> (S ` I) \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. {1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
unfolding C0_def
[PROOF STATE]
proof (prove)
using this:
convex hull {1} \<times> \<Union> (S ` I) \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. {1} \<times> (convex hull \<Union> (S ` I)) \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
using convex_hull_Times[of "{(1 :: real)}" "\<Union>(S ` I)"] convex_hull_singleton
[PROOF STATE]
proof (prove)
using this:
convex hull {1} \<times> \<Union> (S ` I) \<subseteq> convex hull \<Union> (K ` I)
convex hull {1} \<times> \<Union> (S ` I) = (convex hull {1}) \<times> (convex hull \<Union> (S ` I))
convex hull {?a} = {?a}

goal (1 subgoal):
 1. {1} \<times> (convex hull \<Union> (S ` I)) \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "cone (convex hull (\<Union>(K ` I)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cone (convex hull \<Union> (K ` I))
[PROOF STEP]
by (simp add: K_def cone_Union cone_cone_hull cone_convex_hull)
[PROOF STATE]
proof (state)
this:
cone (convex hull \<Union> (K ` I))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
cone (convex hull \<Union> (K ` I))
[PROOF STEP]
have "convex hull (\<Union>(K ` I)) \<supseteq> K0"
[PROOF STATE]
proof (prove)
using this:
{1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
cone (convex hull \<Union> (K ` I))

goal (1 subgoal):
 1. K0 \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
unfolding K0_def
[PROOF STATE]
proof (prove)
using this:
{1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
cone (convex hull \<Union> (K ` I))

goal (1 subgoal):
 1. cone hull {1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
using hull_minimal[of _ "convex hull (\<Union>(K ` I))" "cone"]
[PROOF STATE]
proof (prove)
using this:
{1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
cone (convex hull \<Union> (K ` I))
\<lbrakk>?s \<subseteq> convex hull \<Union> (K ` I); cone (convex hull \<Union> (K ` I))\<rbrakk> \<Longrightarrow> cone hull ?s \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. cone hull {1} \<times> C0 \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
K0 \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K0 \<subseteq> convex hull \<Union> (K ` I)
[PROOF STEP]
have "K0 = convex hull (\<Union>(K ` I))"
[PROOF STATE]
proof (prove)
using this:
K0 \<subseteq> convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. K0 = convex hull \<Union> (K ` I)
[PROOF STEP]
using geq
[PROOF STATE]
proof (prove)
using this:
K0 \<subseteq> convex hull \<Union> (K ` I)
convex hull \<Union> (K ` I) \<subseteq> K0

goal (1 subgoal):
 1. K0 = convex hull \<Union> (K ` I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
K0 = convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
K0 = convex hull \<Union> (K ` I)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
have "\<dots> = sum K I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull \<Union> (K ` I) = sum K I
[PROOF STEP]
using assms False \<open>\<forall>i\<in>I. K i \<noteq> {}\<close> cone_hull_eq convK
[PROOF STATE]
proof (prove)
using this:
finite I
\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}
I \<noteq> {}
\<forall>i\<in>I. K i \<noteq> {}
(cone hull ?S = ?S) = cone ?S
\<forall>i\<in>I. convex (K i)

goal (1 subgoal):
 1. convex hull \<Union> (K ` I) = sum K I
[PROOF STEP]
by (intro convex_hull_finite_union_cones; fastforce simp: K_def)
[PROOF STATE]
proof (state)
this:
convex hull \<Union> (K ` I) = sum K I

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
K0 = sum K I
[PROOF STEP]
have "K0 = sum K I"
[PROOF STATE]
proof (prove)
using this:
K0 = sum K I

goal (1 subgoal):
 1. K0 = sum K I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
K0 = sum K I

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K0 = sum K I
[PROOF STEP]
have *: "rel_interior K0 = sum (\<lambda>i. (rel_interior (K i))) I"
[PROOF STATE]
proof (prove)
using this:
K0 = sum K I

goal (1 subgoal):
 1. rel_interior K0 = (\<Sum>i\<in>I. rel_interior (K i))
[PROOF STEP]
using rel_interior_sum_gen[of I K] convK
[PROOF STATE]
proof (prove)
using this:
K0 = sum K I
(\<And>i. i \<in> I \<Longrightarrow> convex (K i)) \<Longrightarrow> rel_interior (sum K I) = (\<Sum>i\<in>I. rel_interior (K i))
\<forall>i\<in>I. convex (K i)

goal (1 subgoal):
 1. rel_interior K0 = (\<Sum>i\<in>I. rel_interior (K i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rel_interior K0 = (\<Sum>i\<in>I. rel_interior (K i))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
rel_interior K0 = (\<Sum>i\<in>I. rel_interior (K i))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
assume "x \<in> ?lhs"
[PROOF STATE]
proof (state)
this:
x \<in> rel_interior (convex hull \<Union> (S ` I))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> rel_interior (convex hull \<Union> (S ` I))
[PROOF STEP]
have "(1::real, x) \<in> rel_interior K0"
[PROOF STATE]
proof (prove)
using this:
x \<in> rel_interior (convex hull \<Union> (S ` I))

goal (1 subgoal):
 1. (1, x) \<in> rel_interior K0
[PROOF STEP]
using K0_def C0_def rel_interior_convex_cone_aux[of C0 "1::real" x] convex_convex_hull
[PROOF STATE]
proof (prove)
using this:
x \<in> rel_interior (convex hull \<Union> (S ` I))
K0 = cone hull {1} \<times> C0
C0 = convex hull \<Union> (S ` I)
convex C0 \<Longrightarrow> ((1, x) \<in> rel_interior (cone hull {1} \<times> C0)) = (0 < 1 \<and> x \<in> (*\<^sub>R) 1 ` rel_interior C0)
convex (convex hull ?s)

goal (1 subgoal):
 1. (1, x) \<in> rel_interior K0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1, x) \<in> rel_interior K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1, x) \<in> rel_interior K0
[PROOF STEP]
obtain k where k: "(1::real, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))"
[PROOF STATE]
proof (prove)
using this:
(1, x) \<in> rel_interior K0

goal (1 subgoal):
 1. (\<And>k. (1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>finite I\<close> * set_sum_alt[of I "\<lambda>i. rel_interior (K i)"]
[PROOF STATE]
proof (prove)
using this:
(1, x) \<in> rel_interior K0
finite I
rel_interior K0 = (\<Sum>i\<in>I. rel_interior (K i))
finite I \<Longrightarrow> (\<Sum>i\<in>I. rel_interior (K i)) = {sum s I |s. \<forall>i\<in>I. s i \<in> rel_interior (K i)}

goal (1 subgoal):
 1. (\<And>k. (1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
assume "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> I
[PROOF STEP]
have "convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)"
[PROOF STATE]
proof (prove)
using this:
i \<in> I

goal (1 subgoal):
 1. convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)
[PROOF STEP]
using k K_def assms
[PROOF STATE]
proof (prove)
using this:
i \<in> I
(1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))
K ?i = cone hull {1} \<times> S ?i
finite I
\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}

goal (1 subgoal):
 1. convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)
[PROOF STEP]
have "\<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)"
[PROOF STATE]
proof (prove)
using this:
convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)

goal (1 subgoal):
 1. \<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)
[PROOF STEP]
using rel_interior_convex_cone[of "S i"]
[PROOF STATE]
proof (prove)
using this:
convex (S i) \<and> k i \<in> rel_interior (cone hull {1} \<times> S i)
convex (S i) \<Longrightarrow> rel_interior (cone hull {1} \<times> S i) = {(c, c *\<^sub>R x) |c x. 0 < c \<and> x \<in> rel_interior (S i)}

goal (1 subgoal):
 1. \<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ci si. k i = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<in> I \<Longrightarrow> \<exists>ci si. k ?i2 = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S ?i2)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 \<in> I \<Longrightarrow> \<exists>ci si. k ?i2 = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S ?i2)
[PROOF STEP]
obtain c s where cs: "\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)"
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> I \<Longrightarrow> \<exists>ci si. k ?i2 = (ci, ci *\<^sub>R si) \<and> 0 < ci \<and> si \<in> rel_interior (S ?i2)

goal (1 subgoal):
 1. (\<And>c s. \<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)
[PROOF STEP]
have "x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)

goal (1 subgoal):
 1. x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1
[PROOF STEP]
using k
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)
(1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))

goal (1 subgoal):
 1. x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1
[PROOF STEP]
by (simp add: sum_prod)
[PROOF STATE]
proof (state)
this:
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1
[PROOF STEP]
have "x \<in> ?rhs"
[PROOF STATE]
proof (prove)
using this:
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1

goal (1 subgoal):
 1. x \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
using k cs
[PROOF STATE]
proof (prove)
using this:
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> sum c I = 1
(1, x) = sum k I \<and> (\<forall>i\<in>I. k i \<in> rel_interior (K i))
\<forall>i\<in>I. k i = (c i, c i *\<^sub>R s i) \<and> 0 < c i \<and> s i \<in> rel_interior (S i)

goal (1 subgoal):
 1. x \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> rel_interior (convex hull \<Union> (S ` I)) \<Longrightarrow> ?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x2 \<in> rel_interior (convex hull \<Union> (S ` I)) \<Longrightarrow> ?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x2 \<in> rel_interior (convex hull \<Union> (S ` I)) \<Longrightarrow> ?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
assume "x \<in> ?rhs"
[PROOF STATE]
proof (state)
this:
x \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
obtain c s where cs: "x = sum (\<lambda>i. c i *\<^sub>R s i) I \<and>
        (\<forall>i\<in>I. c i > 0) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))"
[PROOF STATE]
proof (prove)
using this:
x \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal (1 subgoal):
 1. (\<And>c s. x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
define k where "k i = (c i, c i *\<^sub>R s i)" for i
[PROOF STATE]
proof (state)
this:
k ?i = (c ?i, c ?i *\<^sub>R s ?i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
k ?i = (c ?i, c ?i *\<^sub>R s ?i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
assume "i \<in> I"
[PROOF STATE]
proof (state)
this:
i \<in> I

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> I
[PROOF STEP]
have "k i \<in> rel_interior (K i)"
[PROOF STATE]
proof (prove)
using this:
i \<in> I

goal (1 subgoal):
 1. k i \<in> rel_interior (K i)
[PROOF STEP]
using k_def K_def assms cs rel_interior_convex_cone[of "S i"]
[PROOF STATE]
proof (prove)
using this:
i \<in> I
k ?i = (c ?i, c ?i *\<^sub>R s ?i)
K ?i = cone hull {1} \<times> S ?i
finite I
\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))
convex (S i) \<Longrightarrow> rel_interior (cone hull {1} \<times> S i) = {(c, c *\<^sub>R x) |c x. 0 < c \<and> x \<in> rel_interior (S i)}

goal (1 subgoal):
 1. k i \<in> rel_interior (K i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k i \<in> rel_interior (K i)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<in> I \<Longrightarrow> k ?i2 \<in> rel_interior (K ?i2)

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 \<in> I \<Longrightarrow> k ?i2 \<in> rel_interior (K ?i2)
[PROOF STEP]
have "(1, x) \<in> rel_interior K0"
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> I \<Longrightarrow> k ?i2 \<in> rel_interior (K ?i2)

goal (1 subgoal):
 1. (1, x) \<in> rel_interior K0
[PROOF STEP]
using * set_sum_alt[of I "(\<lambda>i. rel_interior (K i))"] assms cs
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> I \<Longrightarrow> k ?i2 \<in> rel_interior (K ?i2)
rel_interior K0 = (\<Sum>i\<in>I. rel_interior (K i))
finite I \<Longrightarrow> (\<Sum>i\<in>I. rel_interior (K i)) = {sum s I |s. \<forall>i\<in>I. s i \<in> rel_interior (K i)}
finite I
\<forall>i\<in>I. convex (S i) \<and> S i \<noteq> {}
x = (\<Sum>i\<in>I. c i *\<^sub>R s i) \<and> (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))

goal (1 subgoal):
 1. (1, x) \<in> rel_interior K0
[PROOF STEP]
by (simp add: k_def) (metis (mono_tags, lifting) sum_prod)
[PROOF STATE]
proof (state)
this:
(1, x) \<in> rel_interior K0

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1, x) \<in> rel_interior K0
[PROOF STEP]
have "x \<in> ?lhs"
[PROOF STATE]
proof (prove)
using this:
(1, x) \<in> rel_interior K0

goal (1 subgoal):
 1. x \<in> rel_interior (convex hull \<Union> (S ` I))
[PROOF STEP]
using K0_def C0_def rel_interior_convex_cone_aux[of C0 1 x]
[PROOF STATE]
proof (prove)
using this:
(1, x) \<in> rel_interior K0
K0 = cone hull {1} \<times> C0
C0 = convex hull \<Union> (S ` I)
convex C0 \<Longrightarrow> ((1, x) \<in> rel_interior (cone hull {1} \<times> C0)) = (0 < 1 \<and> x \<in> (*\<^sub>R) 1 ` rel_interior C0)

goal (1 subgoal):
 1. x \<in> rel_interior (convex hull \<Union> (S ` I))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> rel_interior (convex hull \<Union> (S ` I))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))} \<Longrightarrow> ?x2 \<in> rel_interior (convex hull \<Union> (S ` I))

goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> rel_interior (convex hull \<Union> (S ` I)) \<Longrightarrow> ?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))} \<Longrightarrow> ?x2 \<in> rel_interior (convex hull \<Union> (S ` I))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> rel_interior (convex hull \<Union> (S ` I)) \<Longrightarrow> ?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
?x2 \<in> {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))} \<Longrightarrow> ?x2 \<in> rel_interior (convex hull \<Union> (S ` I))

goal (1 subgoal):
 1. rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rel_interior (convex hull \<Union> (S ` I)) = {\<Sum>i\<in>I. c i *\<^sub>R s i |c s. (\<forall>i\<in>I. 0 < c i) \<and> sum c I = 1 \<and> (\<forall>i\<in>I. s i \<in> rel_interior (S i))}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arcs_undir_G_eq_2vertsG:
  "\<lbrakk>undirected_tree G\<rbrakk> \<Longrightarrow> card (arcs G) = 2 * (card (verts G) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. undirected_tree G \<Longrightarrow> card (arcs G) = 2 * (card (verts G) - 1)
[PROOF STEP]
using arcs_graph_G_ge_2vertsG undirected_tree.acyclic undirected_tree.axioms(1)
    undirected_tree.connected
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>graph G; Digraph_Component.connected G\<rbrakk> \<Longrightarrow> 2 * (card (verts G) - 1) \<le> card (arcs G)
undirected_tree ?G \<Longrightarrow> card (arcs ?G) \<le> 2 * (card (verts ?G) - 1)
undirected_tree ?G \<Longrightarrow> graph ?G
undirected_tree ?G \<Longrightarrow> Digraph_Component.connected ?G

goal (1 subgoal):
 1. undirected_tree G \<Longrightarrow> card (arcs G) = 2 * (card (verts G) - 1)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma bezout_ring_iff_fin_gen_principal_ideal2:
    "(\<forall>I::'a::comm_ring_1 set. finitely_generated_ideal I \<longrightarrow> principal_ideal I)
    = (class.bezout_ring ((*)::'a\<Rightarrow>'a\<Rightarrow>'a) 1 (+) 0 (-) uminus)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I) = class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus
 2. class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus \<Longrightarrow> \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I
[PROOF STEP]
show "\<forall>I::'a::comm_ring_1 set. finitely_generated_ideal I \<longrightarrow> principal_ideal I
      \<Longrightarrow> class.bezout_ring (*) 1 (+) (0::'a) (-) uminus"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus
[PROOF STEP]
using all_fin_gen_ideals_are_principal_imp_bezout[where ?'a='a]
[PROOF STATE]
proof (prove)
using this:
\<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> OFCLASS('a, bezout_ring_class)

goal (1 subgoal):
 1. \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus
[PROOF STEP]
using OFCLASS_bezout_ring_imp_class_bezout_ring[where ?'a='a]
[PROOF STATE]
proof (prove)
using this:
\<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> OFCLASS('a, bezout_ring_class)
OFCLASS('a, bezout_ring_class) \<Longrightarrow> class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus

goal (1 subgoal):
 1. \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I \<Longrightarrow> class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus

goal (1 subgoal):
 1. class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus \<Longrightarrow> \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I
[PROOF STEP]
show "class.bezout_ring (*) 1 (+) (0::'a) (-) uminus \<Longrightarrow> \<forall>I::'a set.
    finitely_generated_ideal I \<longrightarrow> principal_ideal I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus \<Longrightarrow> \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I
[PROOF STEP]
using bezout_imp_all_fin_gen_ideals_are_principal_unsatisfactory
[PROOF STATE]
proof (prove)
using this:
class.bezout_ring (*) (1::?'b) (+) (0::?'b) (-) uminus \<Longrightarrow> \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I

goal (1 subgoal):
 1. class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus \<Longrightarrow> \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
class.bezout_ring (*) (1::'a) (+) (0::'a) (-) uminus \<Longrightarrow> \<forall>I. finitely_generated_ideal I \<longrightarrow> principal_ideal I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interpret_mvmult_nth:
  assumes "D = CARD('n::enum)"
  assumes "E = CARD('m::enum)"
  assumes "length xs = D * E"
  assumes "length ys = E"
  assumes "n < CARD('n)"
  shows "interpret_floatarith (mvmult_fa D E xs ys ! n) vs =
    ((einterpret xs vs::((real, 'm) vec, 'n) vec) *v einterpret ys vs) \<bullet> (Basis_list ! n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
have "interpret_floatarith (mvmult_fa D E xs ys ! n) vs = einterpret (mvmult_fa D E xs ys) vs \<bullet> (Basis_list ! n::'n rvec)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = einterpret (mvmult_fa D E xs ys) vs \<bullet> Basis_list ! n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D = CARD('n)
E = CARD('m)
length xs = D * E
length ys = E
n < CARD('n)

goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = einterpret (mvmult_fa D E xs ys) vs \<bullet> Basis_list ! n
[PROOF STEP]
by (auto simp: eucl_of_list_inner)
[PROOF STATE]
proof (state)
this:
interpret_floatarith (mvmult_fa D E xs ys ! n) vs = einterpret (mvmult_fa D E xs ys) vs \<bullet> Basis_list ! n

goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
interpret_floatarith (mvmult_fa D E xs ys ! n) vs = einterpret (mvmult_fa D E xs ys) vs \<bullet> Basis_list ! n

goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
from einterpret_mvmult_fa[OF assms(1,2), of xs ys vs]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>length xs = CARD('n) * CARD('m); length ys = CARD('m)\<rbrakk> \<Longrightarrow> einterpret (mvmult_fa D E xs ys) vs = einterpret xs vs *v einterpret ys vs
[PROOF STEP]
have "einterpret (mvmult_fa D E xs ys) vs = (einterpret xs vs::((real, 'm) vec, 'n) vec) *v einterpret ys vs"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length xs = CARD('n) * CARD('m); length ys = CARD('m)\<rbrakk> \<Longrightarrow> einterpret (mvmult_fa D E xs ys) vs = einterpret xs vs *v einterpret ys vs

goal (1 subgoal):
 1. einterpret (mvmult_fa D E xs ys) vs = einterpret xs vs *v einterpret ys vs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length xs = CARD('n) * CARD('m); length ys = CARD('m)\<rbrakk> \<Longrightarrow> einterpret (mvmult_fa D E xs ys) vs = einterpret xs vs *v einterpret ys vs
D = CARD('n)
E = CARD('m)
length xs = D * E
length ys = E
n < CARD('n)

goal (1 subgoal):
 1. einterpret (mvmult_fa D E xs ys) vs = einterpret xs vs *v einterpret ys vs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
einterpret (mvmult_fa D E xs ys) vs = einterpret xs vs *v einterpret ys vs

goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n

goal (1 subgoal):
 1. interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
interpret_floatarith (mvmult_fa D E xs ys ! n) vs = (einterpret xs vs *v einterpret ys vs) \<bullet> Basis_list ! n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cartesian_product:
  fixes f::"('c \<Rightarrow> real)"
  fixes g::"('d \<Rightarrow> real)"
  assumes "finite A"
  assumes "finite B"
shows "(\<Sum>b\<in>B. g b) * (\<Sum>a\<in>A. f a) = (\<Sum>ab\<in>A\<times>B. f (fst ab) * g (snd ab))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g B * sum f A = (\<Sum>ab\<in>A \<times> B. f (fst ab) * g (snd ab))
[PROOF STEP]
using bilinear_times bilinear_sum[where h="(\<lambda>x y. x * y)" and f="f" and g="g"] assms
[PROOF STATE]
proof (prove)
using this:
bilinear (*)
bilinear (*) \<Longrightarrow> sum f ?S * sum g ?T = (\<Sum>(i, j)\<in>?S \<times> ?T. f i * g j)
finite A
finite B

goal (1 subgoal):
 1. sum g B * sum f A = (\<Sum>ab\<in>A \<times> B. f (fst ab) * g (snd ab))
[PROOF STEP]
by (metis (erased, lifting) sum.cong split_beta' Groups.ab_semigroup_mult_class.mult.commute)


[STATEMENT]
lemma universal_lookup_sem:
  assumes "\<And>i. i \<in> set_fml fml \<Longrightarrow> i < length qs"
  assumes "set signs = consistent_sign_vectors qs UNIV"
  shows "(\<forall>x::real. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) \<longleftrightarrow>
    list_all (lookup_sem fml) signs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = list_all (lookup_sem fml) signs
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
set signs = consistent_sign_vectors qs UNIV

goal (1 subgoal):
 1. (\<forall>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = list_all (lookup_sem fml) signs
[PROOF STEP]
unfolding consistent_sign_vectors_def list_all_iff
[PROOF STATE]
proof (prove)
using this:
set signs = range (sign_vec qs)

goal (1 subgoal):
 1. (\<forall>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = Ball (set signs) (lookup_sem fml)
[PROOF STEP]
by (simp add: assms(1) sign_vec_semantics)


[STATEMENT]
lemma radj_ladj_dual:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'b::ord_with_dual"
  shows "radj f x = \<partial> (ladj (\<partial>\<^sub>F f) (\<partial> x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. radj f x = \<partial> (ladj (\<partial>\<^sub>F f) (\<partial> x))
[PROOF STEP]
by (metis fun_dual5 invol_dual_var ladj_radj_dual map_dual_def)


[STATEMENT]
lemma mod_less_dividend: "\<lbrakk> 0 < m; m \<le> n \<rbrakk> \<Longrightarrow> n mod m < (n::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; m \<le> n\<rbrakk> \<Longrightarrow> n mod m < n
[PROOF STEP]
by (rule less_le_trans[OF mod_less_divisor])


[STATEMENT]
lemma split_int_gt_real':
  "(real_of_int (a::int) + b > 0) = (real_of_int a + real_of_int \<lfloor>b\<rfloor> > 0 \<or> (real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < real_of_int a + b) = (0 < real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (0 < real_of_int a + b) = (0 < real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
have th: "(real_of_int a + b >0) = (real_of_int (-a) + (-b)< 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < real_of_int a + b) = (real_of_int (- a) + - b < 0)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(0 < real_of_int a + b) = (real_of_int (- a) + - b < 0)

goal (1 subgoal):
 1. (0 < real_of_int a + b) = (0 < real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < real_of_int a + b) = (0 < real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)
[PROOF STEP]
by (simp only:th split_int_less_real'[where a="-a" and b="-b"]) (auto simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(0 < real_of_int a + b) = (0 < real_of_int a + real_of_int \<lfloor>b\<rfloor> \<or> real_of_int a + real_of_int \<lfloor>b\<rfloor> = 0 \<and> real_of_int \<lfloor>b\<rfloor> - b < 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma perpendicular_moebius [simp]:
  assumes "perpendicular H1 H2"
  shows "perpendicular (moebius_circline M H1) (moebius_circline M H2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. perpendicular (moebius_circline M H1) (moebius_circline M H2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
perpendicular H1 H2

goal (1 subgoal):
 1. perpendicular (moebius_circline M H1) (moebius_circline M H2)
[PROOF STEP]
unfolding perpendicular_def
[PROOF STATE]
proof (prove)
using this:
cos_angle (of_circline H1) (of_circline H2) = 0

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H1)) (of_circline (moebius_circline M H2)) = 0
[PROOF STEP]
using moebius_preserve_circline_angle[of M "of_circline H1" "of_circline H2"]
[PROOF STATE]
proof (prove)
using this:
cos_angle (of_circline H1) (of_circline H2) = 0
cos_angle (moebius_ocircline M (of_circline H1)) (moebius_ocircline M (of_circline H2)) = cos_angle (of_circline H1) (of_circline H2)

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H1)) (of_circline (moebius_circline M H2)) = 0
[PROOF STEP]
using moebius_ocircline_circline[of M "of_circline H1"]
[PROOF STATE]
proof (prove)
using this:
cos_angle (of_circline H1) (of_circline H2) = 0
cos_angle (moebius_ocircline M (of_circline H1)) (moebius_ocircline M (of_circline H2)) = cos_angle (of_circline H1) (of_circline H2)
moebius_ocircline M (of_circline H1) = of_circline (moebius_circline M (of_ocircline (of_circline H1))) \<or> moebius_ocircline M (of_circline H1) = opposite_ocircline (of_circline (moebius_circline M (of_ocircline (of_circline H1))))

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H1)) (of_circline (moebius_circline M H2)) = 0
[PROOF STEP]
using moebius_ocircline_circline[of M "of_circline H2"]
[PROOF STATE]
proof (prove)
using this:
cos_angle (of_circline H1) (of_circline H2) = 0
cos_angle (moebius_ocircline M (of_circline H1)) (moebius_ocircline M (of_circline H2)) = cos_angle (of_circline H1) (of_circline H2)
moebius_ocircline M (of_circline H1) = of_circline (moebius_circline M (of_ocircline (of_circline H1))) \<or> moebius_ocircline M (of_circline H1) = opposite_ocircline (of_circline (moebius_circline M (of_ocircline (of_circline H1))))
moebius_ocircline M (of_circline H2) = of_circline (moebius_circline M (of_ocircline (of_circline H2))) \<or> moebius_ocircline M (of_circline H2) = opposite_ocircline (of_circline (moebius_circline M (of_ocircline (of_circline H2))))

goal (1 subgoal):
 1. cos_angle (of_circline (moebius_circline M H1)) (of_circline (moebius_circline M H2)) = 0
[PROOF STEP]
by (auto simp del: moebius_preserve_circline_angle)


[STATEMENT]
lemma norm1_ge_0: "norm1 (f :: 'a :: {abs,ordered_semiring_0,ordered_ab_group_add_abs}poly) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> norm1 f
[PROOF STEP]
unfolding norm1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> sum_list (map abs (coeffs f))
[PROOF STEP]
by (rule sum_list_nonneg, auto)


[STATEMENT]
lemma tensor_vec_add1:
  fixes v1 v2 v3 :: "'a::comm_ring vec"
  assumes "v1 \<in> carrier_vec d1"
    and "v2 \<in> carrier_vec d1"
    and "v3 \<in> carrier_vec d2"
  shows "tensor_vec (v1 + v2) v3 = tensor_vec v1 v3 + tensor_vec v2 v3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_vec (v1 + v2) v3 = tensor_vec v1 v3 + tensor_vec v2 v3
[PROOF STEP]
apply (rule eq_vecI, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < d \<Longrightarrow> tensor_vec (v1 + v2) v3 $ i = tensor_vec v1 v3 $ i + tensor_vec v2 v3 $ i
[PROOF STEP]
unfolding tensor_vec_eval
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < d \<Longrightarrow> (v1 + v2) $ encode1 i * v3 $ encode2 i = v1 $ encode1 i * v3 $ encode2 i + v2 $ encode1 i * v3 $ encode2 i
[PROOF STEP]
using assms(2) comm_semiring_class.distrib
[PROOF STATE]
proof (prove)
using this:
v2 \<in> carrier_vec d1
(?a + ?b) * ?c = ?a * ?c + ?b * ?c

goal (1 subgoal):
 1. \<And>i. i < d \<Longrightarrow> (v1 + v2) $ encode1 i * v3 $ encode2 i = v1 $ encode1 i * v3 $ encode2 i + v2 $ encode1 i * v3 $ encode2 i
[PROOF STEP]
by force


[STATEMENT]
lemma binomial_Vandermonde:
  "sum (\<lambda>k. (a choose k) * (b choose (n - k))) {0..n} = (a + b) choose n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..n. (a choose k) * (b choose (n - k))) = a + b choose n
[PROOF STEP]
using gbinomial_Vandermonde[of "(of_nat a)" "of_nat b" n]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = 0..n. (of_nat a gchoose k) * (of_nat b gchoose (n - k))) = of_nat a + of_nat b gchoose n

goal (1 subgoal):
 1. (\<Sum>k = 0..n. (a choose k) * (b choose (n - k))) = a + b choose n
[PROOF STEP]
by (simp only: binomial_gbinomial[symmetric] of_nat_mult[symmetric]
                 of_nat_sum[symmetric] of_nat_add[symmetric] of_nat_eq_iff)


[STATEMENT]
lemma formulaTrueAppend:
  fixes formula1 :: Formula and formula2 :: Formula and valuation :: Valuation
  shows "formulaTrue (formula1 @ formula2) valuation = (formulaTrue formula1 valuation \<and> formulaTrue formula2 valuation)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaTrue (formula1 @ formula2) valuation = (formulaTrue formula1 valuation \<and> formulaTrue formula2 valuation)
[PROOF STEP]
by (induct formula1) auto