[STATEMENT]
lemma measure_space_measure_of_st_vec': "measure_space UNIV UNIV (measure_of_st_vec' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_space UNIV UNIV (measure_of_st_vec' x)
[PROOF STEP]
unfolding measure_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra UNIV UNIV \<and> positive UNIV (measure_of_st_vec' x) \<and> countably_additive UNIV (measure_of_st_vec' x)
[PROOF STEP]
proof (simp, simp add: countably_additive_def measure_of_st_vec'_def disjoint_family_on_def,
  clarify, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
case (1 A)
[PROOF STATE]
proof (state)
this:
\<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {}

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
let ?x = "st_vec x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
define N where "N = {i. A i \<noteq> {}}"
[PROOF STATE]
proof (state)
this:
N = {i. A i \<noteq> {}}

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
let ?A = "\<Union>(A ` N)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
have "finite B \<Longrightarrow> B \<subseteq> ?A \<Longrightarrow> \<exists> K. finite K \<and> K \<subseteq> N \<and> B \<subseteq> \<Union>(A ` K)" for B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite B; B \<subseteq> \<Union> (A ` N)\<rbrakk> \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> B \<subseteq> \<Union> (A ` K)
[PROOF STEP]
proof (induct rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {} \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> {} \<subseteq> \<Union> (A ` K)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> F \<subseteq> \<Union> (A ` K); insert x F \<subseteq> \<Union> (A ` N)\<rbrakk> \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> insert x F \<subseteq> \<Union> (A ` K)
[PROOF STEP]
case (insert b B)
[PROOF STATE]
proof (state)
this:
finite B
b \<notin> B
B \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> B \<subseteq> \<Union> (A ` K)
insert b B \<subseteq> \<Union> (A ` N)

goal (2 subgoals):
 1. {} \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> {} \<subseteq> \<Union> (A ` K)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> F \<subseteq> \<Union> (A ` K); insert x F \<subseteq> \<Union> (A ` N)\<rbrakk> \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> insert x F \<subseteq> \<Union> (A ` K)
[PROOF STEP]
from insert(3-4)
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> B \<subseteq> \<Union> (A ` K)
insert b B \<subseteq> \<Union> (A ` N)
[PROOF STEP]
obtain K where K: "finite K" "K \<subseteq> N" "B \<subseteq> \<Union>(A ` K)"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> B \<subseteq> \<Union> (A ` K)
insert b B \<subseteq> \<Union> (A ` N)

goal (1 subgoal):
 1. (\<And>K. \<lbrakk>finite K; K \<subseteq> N; B \<subseteq> \<Union> (A ` K)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite K
K \<subseteq> N
B \<subseteq> \<Union> (A ` K)

goal (2 subgoals):
 1. {} \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> {} \<subseteq> \<Union> (A ` K)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> F \<subseteq> \<Union> (A ` K); insert x F \<subseteq> \<Union> (A ` N)\<rbrakk> \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> insert x F \<subseteq> \<Union> (A ` K)
[PROOF STEP]
from insert(4)
[PROOF STATE]
proof (chain)
picking this:
insert b B \<subseteq> \<Union> (A ` N)
[PROOF STEP]
obtain a where a: "a \<in> N" "b \<in> A a"
[PROOF STATE]
proof (prove)
using this:
insert b B \<subseteq> \<Union> (A ` N)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> N; b \<in> A a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> N
b \<in> A a

goal (2 subgoals):
 1. {} \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> {} \<subseteq> \<Union> (A ` K)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; F \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> F \<subseteq> \<Union> (A ` K); insert x F \<subseteq> \<Union> (A ` N)\<rbrakk> \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> insert x F \<subseteq> \<Union> (A ` K)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>K. finite K \<and> K \<subseteq> N \<and> insert b B \<subseteq> \<Union> (A ` K)
[PROOF STEP]
by (intro exI[of _ "insert a K"], insert a K, auto)
[PROOF STATE]
proof (state)
this:
\<exists>K. finite K \<and> K \<subseteq> N \<and> insert b B \<subseteq> \<Union> (A ` K)

goal (1 subgoal):
 1. {} \<subseteq> \<Union> (A ` N) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> {} \<subseteq> \<Union> (A ` K)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite ?B; ?B \<subseteq> \<Union> (A ` N)\<rbrakk> \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> ?B \<subseteq> \<Union> (A ` K)

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
from this[OF _ subset_refl]
[PROOF STATE]
proof (chain)
picking this:
finite (\<Union> (A ` N)) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> \<Union> (A ` N) \<subseteq> \<Union> (A ` K)
[PROOF STEP]
obtain K where *: "finite K" "K \<subseteq> N" "\<Union>(A ` K) = ?A"
[PROOF STATE]
proof (prove)
using this:
finite (\<Union> (A ` N)) \<Longrightarrow> \<exists>K. finite K \<and> K \<subseteq> N \<and> \<Union> (A ` N) \<subseteq> \<Union> (A ` K)

goal (1 subgoal):
 1. (\<And>K. \<lbrakk>finite K; K \<subseteq> N; \<Union> (A ` K) = \<Union> (A ` N)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite K
K \<subseteq> N
\<Union> (A ` K) = \<Union> (A ` N)

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
finite K
K \<subseteq> N
\<Union> (A ` K) = \<Union> (A ` N)

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
assume "K \<subset> N"
[PROOF STATE]
proof (state)
this:
K \<subset> N

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K \<subset> N
[PROOF STEP]
obtain n where **: "n \<in> N" "n \<notin> K"
[PROOF STATE]
proof (prove)
using this:
K \<subset> N

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>n \<in> N; n \<notin> K\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n \<in> N
n \<notin> K

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
from this[unfolded N_def]
[PROOF STATE]
proof (chain)
picking this:
n \<in> {i. A i \<noteq> {}}
n \<notin> K
[PROOF STEP]
obtain a where a: "a \<in> A n"
[PROOF STATE]
proof (prove)
using this:
n \<in> {i. A i \<noteq> {}}
n \<notin> K

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

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
with ** *
[PROOF STATE]
proof (chain)
picking this:
n \<in> N
n \<notin> K
finite K
K \<subseteq> N
\<Union> (A ` K) = \<Union> (A ` N)
a \<in> A n
[PROOF STEP]
obtain k where ***: "k \<in> K" "a \<in> A k"
[PROOF STATE]
proof (prove)
using this:
n \<in> N
n \<notin> K
finite K
K \<subseteq> N
\<Union> (A ` K) = \<Union> (A ` N)
a \<in> A n

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>k \<in> K; a \<in> A k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
k \<in> K
a \<in> A k

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
from ** ***
[PROOF STATE]
proof (chain)
picking this:
n \<in> N
n \<notin> K
k \<in> K
a \<in> A k
[PROOF STEP]
have "n \<noteq> k"
[PROOF STATE]
proof (prove)
using this:
n \<in> N
n \<notin> K
k \<in> K
a \<in> A k

goal (1 subgoal):
 1. n \<noteq> k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n \<noteq> k

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
from 1[rule_format, OF this]
[PROOF STATE]
proof (chain)
picking this:
A n \<inter> A k = {}
[PROOF STEP]
have "A n \<inter> A k = {}"
[PROOF STATE]
proof (prove)
using this:
A n \<inter> A k = {}

goal (1 subgoal):
 1. A n \<inter> A k = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A n \<inter> A k = {}

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
with *** a
[PROOF STATE]
proof (chain)
picking this:
k \<in> K
a \<in> A k
a \<in> A n
A n \<inter> A k = {}
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
k \<in> K
a \<in> A k
a \<in> A n
A n \<inter> A k = {}

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

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
K \<subset> N \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
finite K
K \<subseteq> N
\<Union> (A ` K) = \<Union> (A ` N)
K \<subset> N \<Longrightarrow> False
[PROOF STEP]
have fin: "finite N"
[PROOF STATE]
proof (prove)
using this:
finite K
K \<subseteq> N
\<Union> (A ` K) = \<Union> (A ` N)
K \<subset> N \<Longrightarrow> False

goal (1 subgoal):
 1. finite N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite N

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
have id: "\<Union>(A ` UNIV) = ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range A) = \<Union> (A ` N)
[PROOF STEP]
unfolding N_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range A) = \<Union> (A ` {i. A i \<noteq> {}})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (range A) = \<Union> (A ` N)

goal (1 subgoal):
 1. \<And>A. \<forall>m n. m \<noteq> n \<longrightarrow> A m \<inter> A n = {} \<Longrightarrow> (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
show "(\<Sum>i. ennreal (sum (($h) ?x) (A i))) =
    ennreal (sum (($h) ?x) (\<Union>(A ` UNIV)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (A ` N)))
[PROOF STEP]
apply (subst suminf_finite[OF fin], (auto simp: N_def)[1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<in>N. ennreal (sum (($h) (st_vec x)) (A n))) = ennreal (sum (($h) (st_vec x)) (\<Union> (A ` N)))
[PROOF STEP]
apply (subst sum_ennreal, (insert non_neg_vec_st_vec[of x], auto simp: non_neg_vec_def intro!: sum_nonneg)[1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (\<Sum>n\<in>N. sum (($h) (st_vec x)) (A n)) = ennreal (sum (($h) (st_vec x)) (\<Union> (A ` N)))
[PROOF STEP]
apply (rule arg_cong[of _ _ ennreal])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<in>N. sum (($h) (st_vec x)) (A n)) = sum (($h) (st_vec x)) (\<Union> (A ` N))
[PROOF STEP]
apply (subst sum.UNION_disjoint[OF fin], insert 1, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>i. ennreal (sum (($h) (st_vec x)) (A i))) = ennreal (sum (($h) (st_vec x)) (\<Union> (range A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isnonconstant_coefficients_length: "isnonconstant p \<Longrightarrow> length (coefficients p) > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isnonconstant p \<Longrightarrow> 1 < length (coefficients p)
[PROOF STEP]
unfolding isnonconstant_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> isconstant p \<Longrightarrow> 1 < length (coefficients p)
[PROOF STEP]
apply (cases p)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>x1. \<lbrakk>\<not> isconstant p; p = (x1)\<^sub>p\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 2. \<And>x2. \<lbrakk>\<not> isconstant p; p = Bound x2\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 3. \<And>x31 x32. \<lbrakk>\<not> isconstant p; p = Add x31 x32\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 4. \<And>x41 x42. \<lbrakk>\<not> isconstant p; p = Sub x41 x42\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 5. \<And>x51 x52. \<lbrakk>\<not> isconstant p; p = Mul x51 x52\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 6. \<And>x6. \<lbrakk>\<not> isconstant p; p = Neg x6\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 7. \<And>x71 x72. \<lbrakk>\<not> isconstant p; p = Pw x71 x72\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
 8. \<And>x81 x82 x83. \<lbrakk>\<not> isconstant p; p = CN x81 x82 x83\<rbrakk> \<Longrightarrow> 1 < length (coefficients p)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x81 x82 x83. \<lbrakk>\<not> isconstant (CN x81 x82 x83); p = CN x81 x82 x83\<rbrakk> \<Longrightarrow> Suc 0 < length (coefficients (CN x81 x82 x83))
[PROOF STEP]
apply (rename_tac nat a, case_tac nat)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x81 nat a. \<lbrakk>\<not> isconstant (CN x81 nat a); p = CN x81 nat a; nat = 0\<rbrakk> \<Longrightarrow> Suc 0 < length (coefficients (CN x81 nat a))
 2. \<And>x81 nat a nata. \<lbrakk>\<not> isconstant (CN x81 nat a); p = CN x81 nat a; nat = Suc nata\<rbrakk> \<Longrightarrow> Suc 0 < length (coefficients (CN x81 nat a))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma assumes "\<exists>x\<in>lset xs. \<not> P x"
  shows lhd_ldropWhile: "\<not> P (lhd (ldropWhile P xs))" (is ?thesis1)
  and lhd_ldropWhile_in_lset: "lhd (ldropWhile P xs) \<in> lset xs" (is ?thesis2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P (lhd (ldropWhile P xs)) &&& lhd (ldropWhile P xs) \<in> lset xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> P (lhd (ldropWhile P xs))
 2. lhd (ldropWhile P xs) \<in> lset xs
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>lset xs. \<not> P x
[PROOF STEP]
obtain x where "x \<in> lset xs" "\<not> P x"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>lset xs. \<not> P x

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> lset xs; \<not> P x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> lset xs
\<not> P x

goal (2 subgoals):
 1. \<not> P (lhd (ldropWhile P xs))
 2. lhd (ldropWhile P xs) \<in> lset xs
[PROOF STEP]
thus ?thesis1 ?thesis2
[PROOF STATE]
proof (prove)
using this:
x \<in> lset xs
\<not> P x

goal (1 subgoal):
 1. \<not> P (lhd (ldropWhile P xs)) &&& lhd (ldropWhile P xs) \<in> lset xs
[PROOF STEP]
by induct simp_all
[PROOF STATE]
proof (state)
this:
\<not> P (lhd (ldropWhile P xs))
lhd (ldropWhile P xs) \<in> lset xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Max_V_viterbi:
  "(MAX t \<in> \<S>. viterbi_prob s t os) =
   Max {T (s, o) {\<omega> \<in> space S. V os as \<omega>} | as. length as = length os \<and> set as \<subseteq> \<S>}" if "s \<in> \<S>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (MAX t\<in>\<S>. viterbi_prob s t os) = Max {emeasure (T (s, o)) {\<omega> \<in> space (stream_space (count_space UNIV)). \<exists>\<omega>'. \<omega> = zip as os @- \<omega>'} |as. length as = length os \<and> set as \<subseteq> \<S>}
[PROOF STEP]
using that states_finite states_wellformed
[PROOF STATE]
proof (prove)
using this:
s \<in> \<S>
finite \<S>
\<S> \<noteq> {}

goal (1 subgoal):
 1. (MAX t\<in>\<S>. viterbi_prob s t os) = Max {emeasure (T (s, o)) {\<omega> \<in> space (stream_space (count_space UNIV)). \<exists>\<omega>'. \<omega> = zip as os @- \<omega>'} |as. length as = length os \<and> set as \<subseteq> \<S>}
[PROOF STEP]
by (induction os arbitrary: s o; simp
        add: Max_start max_prob_Cons[simplified] Max_image_commute Max_image_left_mult Max_to_image2
        cong: Max_image_cong
      )


[STATEMENT]
lemma set_comp_types:
"comp (set_cat U) \<in> hom (set_cat U) B C \<rightarrow> hom (set_cat U) A B \<rightarrow> hom (set_cat U) A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bullet>\<^bsub>set_cat U\<^esub>) \<in> Hom\<^bsub>set_cat U\<^esub> B C \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
proof (rule funcsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> B C \<Longrightarrow> (\<bullet>\<^bsub>set_cat U\<^esub>) x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
fix g
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> B C \<Longrightarrow> (\<bullet>\<^bsub>set_cat U\<^esub>) x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
assume g_BC: "g \<in> hom (set_cat U) B C"
[PROOF STATE]
proof (state)
this:
g \<in> Hom\<^bsub>set_cat U\<^esub> B C

goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> B C \<Longrightarrow> (\<bullet>\<^bsub>set_cat U\<^esub>) x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
hence comp_cod: "set_cod g = C"
[PROOF STATE]
proof (prove)
using this:
g \<in> Hom\<^bsub>set_cat U\<^esub> B C

goal (1 subgoal):
 1. set_cod g = C
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
set_cod g = C

goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> B C \<Longrightarrow> (\<bullet>\<^bsub>set_cat U\<^esub>) x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
show "comp (set_cat U) g \<in> hom (set_cat U) A B \<rightarrow> hom (set_cat U) A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bullet>\<^bsub>set_cat U\<^esub>) g \<in> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
proof (rule funcsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<Longrightarrow> g \<bullet>\<^bsub>set_cat U\<^esub> x \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<Longrightarrow> g \<bullet>\<^bsub>set_cat U\<^esub> x \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
assume f_AB: "f \<in> hom (set_cat U) A B"
[PROOF STATE]
proof (state)
this:
f \<in> Hom\<^bsub>set_cat U\<^esub> A B

goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<Longrightarrow> g \<bullet>\<^bsub>set_cat U\<^esub> x \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
hence comp_dom: "set_dom f = A"
[PROOF STATE]
proof (prove)
using this:
f \<in> Hom\<^bsub>set_cat U\<^esub> A B

goal (1 subgoal):
 1. set_dom f = A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
set_dom f = A

goal (1 subgoal):
 1. \<And>x. x \<in> Hom\<^bsub>set_cat U\<^esub> A B \<Longrightarrow> g \<bullet>\<^bsub>set_cat U\<^esub> x \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
show "comp (set_cat U) g f \<in> hom (set_cat U) A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
have "comp (set_cat U) g f =
        \<lparr>
        set_dom = A,
        set_func = compose (set_dom f) (set_func g) (set_func f),
        set_cod = C
        \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f = \<lparr>set_dom = A, set_func = compose (set_dom f) (set_func g) (set_func f), set_cod = C\<rparr>
[PROOF STEP]
by (simp add: set_cat_def set_comp_def comp_cod comp_dom)
[PROOF STATE]
proof (state)
this:
g \<bullet>\<^bsub>set_cat U\<^esub> f = \<lparr>set_dom = A, set_func = compose (set_dom f) (set_func g) (set_func f), set_cod = C\<rparr>

goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g \<bullet>\<^bsub>set_cat U\<^esub> f = \<lparr>set_dom = A, set_func = compose (set_dom f) (set_func g) (set_func f), set_cod = C\<rparr>

goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
have "\<dots> \<in> hom (set_cat U) A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>set_dom = A, set_func = compose (set_dom f) (set_func g) (set_func f), set_cod = C\<rparr> \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
proof (rule set_homI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. A \<subseteq> U
 2. C \<subseteq> U
 3. compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C
 4. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
from f_AB
[PROOF STATE]
proof (chain)
picking this:
f \<in> Hom\<^bsub>set_cat U\<^esub> A B
[PROOF STEP]
show "A \<subseteq> U"
[PROOF STATE]
proof (prove)
using this:
f \<in> Hom\<^bsub>set_cat U\<^esub> A B

goal (1 subgoal):
 1. A \<subseteq> U
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
A \<subseteq> U

goal (3 subgoals):
 1. C \<subseteq> U
 2. compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C
 3. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
from g_BC
[PROOF STATE]
proof (chain)
picking this:
g \<in> Hom\<^bsub>set_cat U\<^esub> B C
[PROOF STEP]
show "C \<subseteq> U"
[PROOF STATE]
proof (prove)
using this:
g \<in> Hom\<^bsub>set_cat U\<^esub> B C

goal (1 subgoal):
 1. C \<subseteq> U
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
C \<subseteq> U

goal (2 subgoals):
 1. compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C
 2. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
from f_AB
[PROOF STATE]
proof (chain)
picking this:
f \<in> Hom\<^bsub>set_cat U\<^esub> A B
[PROOF STEP]
have fs_f: "set_func f: A \<rightarrow> B"
[PROOF STATE]
proof (prove)
using this:
f \<in> Hom\<^bsub>set_cat U\<^esub> A B

goal (1 subgoal):
 1. set_func f \<in> A \<rightarrow> B
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
set_func f \<in> A \<rightarrow> B

goal (2 subgoals):
 1. compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C
 2. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
from g_BC
[PROOF STATE]
proof (chain)
picking this:
g \<in> Hom\<^bsub>set_cat U\<^esub> B C
[PROOF STEP]
have fs_g: "set_func g: B \<rightarrow> C"
[PROOF STATE]
proof (prove)
using this:
g \<in> Hom\<^bsub>set_cat U\<^esub> B C

goal (1 subgoal):
 1. set_func g \<in> B \<rightarrow> C
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
set_func g \<in> B \<rightarrow> C

goal (2 subgoals):
 1. compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C
 2. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
from fs_g and fs_f
[PROOF STATE]
proof (chain)
picking this:
set_func g \<in> B \<rightarrow> C
set_func f \<in> A \<rightarrow> B
[PROOF STEP]
show " compose (set_dom f) (set_func g) (set_func f) : A \<rightarrow> C"
[PROOF STATE]
proof (prove)
using this:
set_func g \<in> B \<rightarrow> C
set_func f \<in> A \<rightarrow> B

goal (1 subgoal):
 1. compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C
[PROOF STEP]
by (simp only: comp_dom) (rule funcset_compose)
[PROOF STATE]
proof (state)
this:
compose (set_dom f) (set_func g) (set_func f) \<in> A \<rightarrow> C

goal (1 subgoal):
 1. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
show "compose (set_dom f) (set_func g) (set_func f) \<in> extensional A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compose (set_dom f) (set_func g) (set_func f) \<in> extensional A
[PROOF STEP]
by (simp only: comp_dom) (rule compose_extensional)
[PROOF STATE]
proof (state)
this:
compose (set_dom f) (set_func g) (set_func f) \<in> extensional A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lparr>set_dom = A, set_func = compose (set_dom f) (set_func g) (set_func f), set_cod = C\<rparr> \<in> Hom\<^bsub>set_cat U\<^esub> A C

goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C

goal (1 subgoal):
 1. g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g \<bullet>\<^bsub>set_cat U\<^esub> f \<in> Hom\<^bsub>set_cat U\<^esub> A C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<bullet>\<^bsub>set_cat U\<^esub>) g \<in> Hom\<^bsub>set_cat U\<^esub> A B \<rightarrow> Hom\<^bsub>set_cat U\<^esub> A C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_least_r_d_k_path_is_least :
  assumes "is_least_r_d_k_path M q1 q2 (t#p)"
  shows "r_distinguishable_k M q1 q2 (snd (snd t)) \<and> (snd (snd t)) = (LEAST k' . r_distinguishable_k M q1 q2 k')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
proof (cases p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
p = []

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = []
[PROOF STEP]
obtain x where "t = ((q1,q2),x,0)" and "is_least_r_d_k_path M q1 q2 [((q1,q2),x,0)]"
[PROOF STATE]
proof (prove)
using this:
p = []

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>t = ((q1, q2), x, 0); is_least_r_d_k_path M q1 q2 [((q1, q2), x, 0)]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms is_least_r_d_k_path_0_extract
[PROOF STATE]
proof (prove)
using this:
p = []
is_least_r_d_k_path M q1 q2 (t # p)
is_least_r_d_k_path ?M ?q1.0 ?q2.0 [?t] \<Longrightarrow> \<exists>x. ?t = ((?q1.0, ?q2.0), x, 0)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>t = ((q1, q2), x, 0); is_least_r_d_k_path M q1 q2 [((q1, q2), x, 0)]\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
t = ((q1, q2), x, 0)
is_least_r_d_k_path M q1 q2 [((q1, q2), x, 0)]

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
have *: "r_distinguishable_k M q1 q2 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 0
[PROOF STEP]
using is_least_r_d_k_path_immediate_elim[OF \<open>is_least_r_d_k_path M q1 q2 [((q1,q2),x,0)]\<close>]
[PROOF STATE]
proof (prove)
using this:
(\<lbrakk>x \<in> FSM.inputs M; \<forall>t1\<in>FSM.transitions M. t_source t1 = q1 \<longrightarrow> (\<forall>t2\<in>FSM.transitions M. t_input t2 = x \<longrightarrow> t_input t1 = x \<longrightarrow> t_source t2 = q2 \<longrightarrow> t_output t1 \<noteq> t_output t2)\<rbrakk> \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 0
[PROOF STEP]
unfolding r_distinguishable_k.simps
[PROOF STATE]
proof (prove)
using this:
(\<lbrakk>x \<in> FSM.inputs M; \<forall>t1\<in>FSM.transitions M. t_source t1 = q1 \<longrightarrow> (\<forall>t2\<in>FSM.transitions M. t_input t2 = x \<longrightarrow> t_input t1 = x \<longrightarrow> t_source t2 = q2 \<longrightarrow> t_output t1 \<noteq> t_output t2)\<rbrakk> \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. \<exists>x\<in>FSM.inputs M. \<not> (\<exists>t1\<in>FSM.transitions M. \<exists>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r_distinguishable_k M q1 q2 0

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r_distinguishable_k M q1 q2 0
[PROOF STEP]
have "(\<exists>k. r_distinguishable_k M q1 q2 k)"
[PROOF STATE]
proof (prove)
using this:
r_distinguishable_k M q1 q2 0

goal (1 subgoal):
 1. \<exists>k. r_distinguishable_k M q1 q2 k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. r_distinguishable_k M q1 q2 k

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. r_distinguishable_k M q1 q2 k
[PROOF STEP]
have "0 = (LEAST k' . r_distinguishable_k M q1 q2 k')"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. r_distinguishable_k M q1 q2 k

goal (1 subgoal):
 1. 0 = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
using \<open>r_distinguishable_k M q1 q2 0\<close>
[PROOF STATE]
proof (prove)
using this:
\<exists>k. r_distinguishable_k M q1 q2 k
r_distinguishable_k M q1 q2 0

goal (1 subgoal):
 1. 0 = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = (LEAST k'. r_distinguishable_k M q1 q2 k')

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 = (LEAST k'. r_distinguishable_k M q1 q2 k')

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
have "snd (snd t) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd t) = 0
[PROOF STEP]
using \<open>t = ((q1,q2),x,0)\<close>
[PROOF STATE]
proof (prove)
using this:
t = ((q1, q2), x, 0)

goal (1 subgoal):
 1. snd (snd t) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
snd (snd t) = 0

goal (2 subgoals):
 1. p = [] \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
 2. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 = (LEAST k'. r_distinguishable_k M q1 q2 k')
snd (snd t) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 = (LEAST k'. r_distinguishable_k M q1 q2 k')
snd (snd t) = 0

goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
0 = (LEAST k'. r_distinguishable_k M q1 q2 k')
snd (snd t) = 0
r_distinguishable_k M q1 q2 0

goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
case (Cons t' p')
[PROOF STATE]
proof (state)
this:
p = t' # p'

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = t' # p'
[PROOF STEP]
obtain x k where "t = ((q1,q2),x,Suc k)" and "is_least_r_d_k_path M q1 q2 (((q1,q2),x,Suc k)#t'#p')"
[PROOF STATE]
proof (prove)
using this:
p = t' # p'

goal (1 subgoal):
 1. (\<And>x k. \<lbrakk>t = ((q1, q2), x, Suc k); is_least_r_d_k_path M q1 q2 (((q1, q2), x, Suc k) # t' # p')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms is_least_r_d_k_path_Suc_extract
[PROOF STATE]
proof (prove)
using this:
p = t' # p'
is_least_r_d_k_path M q1 q2 (t # p)
is_least_r_d_k_path ?M ?q1.0 ?q2.0 (?t # ?t' # ?p) \<Longrightarrow> \<exists>x k. ?t = ((?q1.0, ?q2.0), x, Suc k)

goal (1 subgoal):
 1. (\<And>x k. \<lbrakk>t = ((q1, q2), x, Suc k); is_least_r_d_k_path M q1 q2 (((q1, q2), x, Suc k) # t' # p')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
t = ((q1, q2), x, Suc k)
is_least_r_d_k_path M q1 q2 (((q1, q2), x, Suc k) # t' # p')

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
have "x \<in> (inputs M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> FSM.inputs M
[PROOF STEP]
using is_least_r_d_k_path_step_elim[OF \<open>is_least_r_d_k_path M q1 q2 (((q1,q2),x,Suc k)#t'#p')\<close>]
[PROOF STATE]
proof (prove)
using this:
(\<And>ka t1 t2. \<lbrakk>Suc k = Least (r_distinguishable_k M q1 q2); Suc ka = Least (r_distinguishable_k M q1 q2); x \<in> FSM.inputs M; \<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) ka; t1 \<in> FSM.transitions M; t2 \<in> FSM.transitions M; is_least_r_d_k_path M (t_target t1) (t_target t2) (t' # p'); t_source t1 = q1; t_source t2 = q2; t_input t1 = x; t_input t2 = x; t_output t1 = t_output t2\<rbrakk> \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. x \<in> FSM.inputs M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> FSM.inputs M

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> FSM.inputs M

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
have "(\<forall> t1 \<in> transitions M . \<forall> t2 \<in> transitions M . (t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2) \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k
[PROOF STEP]
using is_least_r_d_k_path_Suc_transitions[OF \<open>is_least_r_d_k_path M q1 q2 (((q1,q2),x,Suc k)#(t'#p'))\<close>]
[PROOF STATE]
proof (prove)
using this:
\<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k

goal (1 subgoal):
 1. \<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k
[PROOF STEP]
by assumption
[PROOF STATE]
proof (state)
this:
\<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<in> FSM.inputs M
\<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k
[PROOF STEP]
have "r_distinguishable_k M q1 q2 (Suc k)"
[PROOF STATE]
proof (prove)
using this:
x \<in> FSM.inputs M
\<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k

goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 (Suc k)
[PROOF STEP]
unfolding r_distinguishable_k.simps
[PROOF STATE]
proof (prove)
using this:
x \<in> FSM.inputs M
\<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k

goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 k \<or> (\<exists>x\<in>FSM.inputs M. \<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
r_distinguishable_k M q1 q2 (Suc k)

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r_distinguishable_k M q1 q2 (Suc k)

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
have "Suc k = (LEAST k' . r_distinguishable_k M q1 q2 k')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc k = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
using is_least_r_d_k_path_step_elim[OF \<open>is_least_r_d_k_path M q1 q2 (((q1,q2),x,Suc k)#t'#p')\<close>]
[PROOF STATE]
proof (prove)
using this:
(\<And>ka t1 t2. \<lbrakk>Suc k = Least (r_distinguishable_k M q1 q2); Suc ka = Least (r_distinguishable_k M q1 q2); x \<in> FSM.inputs M; \<forall>t1\<in>FSM.transitions M. \<forall>t2\<in>FSM.transitions M. t_source t1 = q1 \<and> t_source t2 = q2 \<and> t_input t1 = x \<and> t_input t2 = x \<and> t_output t1 = t_output t2 \<longrightarrow> r_distinguishable_k M (t_target t1) (t_target t2) ka; t1 \<in> FSM.transitions M; t2 \<in> FSM.transitions M; is_least_r_d_k_path M (t_target t1) (t_target t2) (t' # p'); t_source t1 = q1; t_source t2 = q2; t_input t1 = x; t_input t2 = x; t_output t1 = t_output t2\<rbrakk> \<Longrightarrow> ?P) \<Longrightarrow> ?P

goal (1 subgoal):
 1. Suc k = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Suc k = (LEAST k'. r_distinguishable_k M q1 q2 k')

goal (1 subgoal):
 1. \<And>a list. p = a # list \<Longrightarrow> r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r_distinguishable_k M q1 q2 (Suc k)
Suc k = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r_distinguishable_k M q1 q2 (Suc k)
Suc k = (LEAST k'. r_distinguishable_k M q1 q2 k')

goal (1 subgoal):
 1. r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')
[PROOF STEP]
by (metis \<open>t = ((q1, q2), x, Suc k)\<close> snd_conv)
[PROOF STATE]
proof (state)
this:
r_distinguishable_k M q1 q2 (snd (snd t)) \<and> snd (snd t) = (LEAST k'. r_distinguishable_k M q1 q2 k')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_default_Bernstein_coeffs: assumes "degree P \<le> p"
  shows "nth_default 0 (Bernstein_coeffs p c d P) i =
         inverse (p choose i) * coeff
         (reciprocal_poly p (P \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d-c:]) \<circ>\<^sub>p [:1, 1:]) (p-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default 0 (Bernstein_coeffs p c d P) i = inverse (real (p choose i)) * coeff (reciprocal_poly p (P \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d - c:]) \<circ>\<^sub>p [:1, 1:]) (p - i)
[PROOF STEP]
apply (cases "p = i")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. p = i \<Longrightarrow> nth_default 0 (Bernstein_coeffs p c d P) i = inverse (real (p choose i)) * coeff (reciprocal_poly p (P \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d - c:]) \<circ>\<^sub>p [:1, 1:]) (p - i)
 2. p \<noteq> i \<Longrightarrow> nth_default 0 (Bernstein_coeffs p c d P) i = inverse (real (p choose i)) * coeff (reciprocal_poly p (P \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d - c:]) \<circ>\<^sub>p [:1, 1:]) (p - i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
degree P \<le> p

goal (2 subgoals):
 1. p = i \<Longrightarrow> nth_default 0 (Bernstein_coeffs p c d P) i = inverse (real (p choose i)) * coeff (reciprocal_poly p (P \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d - c:]) \<circ>\<^sub>p [:1, 1:]) (p - i)
 2. p \<noteq> i \<Longrightarrow> nth_default 0 (Bernstein_coeffs p c d P) i = inverse (real (p choose i)) * coeff (reciprocal_poly p (P \<circ>\<^sub>p [:c, 1:] \<circ>\<^sub>p [:0, d - c:]) \<circ>\<^sub>p [:1, 1:]) (p - i)
[PROOF STEP]
by (auto simp: Bernstein_coeffs_def nth_default_append
                  nth_default_Cons Nitpick.case_nat_unfold binomial_eq_0)


[STATEMENT]
lemma image_affinity_cbox: fixes m::real
  fixes a b c :: "'a::euclidean_space"
  shows "(\<lambda>x. m *\<^sub>R x + c) ` cbox a b =
    (if cbox a b = {} then {}
     else (if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)
     else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
proof (cases "m = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
assume "\<forall>i\<in>Basis. x \<bullet> i \<le> c \<bullet> i" "\<forall>i\<in>Basis. c \<bullet> i \<le> x \<bullet> i"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. x \<bullet> i \<le> c \<bullet> i
\<forall>i\<in>Basis. c \<bullet> i \<le> x \<bullet> i

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. x \<bullet> i \<le> c \<bullet> i
\<forall>i\<in>Basis. c \<bullet> i \<le> x \<bullet> i
[PROOF STEP]
have "x = c"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. x \<bullet> i \<le> c \<bullet> i
\<forall>i\<in>Basis. c \<bullet> i \<le> x \<bullet> i

goal (1 subgoal):
 1. x = c
[PROOF STEP]
by (simp add: dual_order.antisym euclidean_eqI)
[PROOF STATE]
proof (state)
this:
x = c

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. ?x2 \<bullet> i \<le> c \<bullet> i; \<forall>i\<in>Basis. c \<bullet> i \<le> ?x2 \<bullet> i\<rbrakk> \<Longrightarrow> ?x2 = c

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. ?x2 \<bullet> i \<le> c \<bullet> i; \<forall>i\<in>Basis. c \<bullet> i \<le> ?x2 \<bullet> i\<rbrakk> \<Longrightarrow> ?x2 = c

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
have "c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> cbox (0 *\<^sub>R a + c) (0 *\<^sub>R b + c)
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
 2. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>i\<in>Basis. ?x2 \<bullet> i \<le> c \<bullet> i; \<forall>i\<in>Basis. c \<bullet> i \<le> ?x2 \<bullet> i\<rbrakk> \<Longrightarrow> ?x2 = c
c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>i\<in>Basis. ?x2 \<bullet> i \<le> c \<bullet> i; \<forall>i\<in>Basis. c \<bullet> i \<le> ?x2 \<bullet> i\<rbrakk> \<Longrightarrow> ?x2 = c
c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)

goal (1 subgoal):
 1. (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>i\<in>Basis. ?x2 \<bullet> i \<le> c \<bullet> i; \<forall>i\<in>Basis. c \<bullet> i \<le> ?x2 \<bullet> i\<rbrakk> \<Longrightarrow> ?x2 = c
c \<in> cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c)
m = 0

goal (1 subgoal):
 1. (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
by (auto simp: cbox_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
m \<noteq> 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
assume "\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i" "m > 0"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i
0 < m

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i
0 < m
[PROOF STEP]
have "\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i" and "\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i
0 < m

goal (1 subgoal):
 1. \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i &&& \<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i
[PROOF STEP]
by (auto simp: inner_distrib)
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i
\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
assume "\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i" "m < 0"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i
m < 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i
m < 0
[PROOF STEP]
have "\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i" and "\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. a \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> b \<bullet> i
m < 0

goal (1 subgoal):
 1. \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i &&& \<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
[PROOF STEP]
by (auto simp: mult_left_mono_neg inner_distrib)
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R y + c) \<bullet> i
\<forall>i\<in>Basis. (m *\<^sub>R y + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
assume "m > 0" and "\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i" and "\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i"
[PROOF STATE]
proof (state)
this:
0 < m
\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < m
\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i
[PROOF STEP]
have "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b"
[PROOF STATE]
proof (prove)
using this:
0 < m
\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
[PROOF STEP]
unfolding image_iff Bex_def mem_box
[PROOF STATE]
proof (prove)
using this:
0 < m
\<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i

goal (1 subgoal):
 1. \<exists>x. (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i) \<and> y = m *\<^sub>R x + c
[PROOF STEP]
apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> y \<bullet> i; \<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> (\<forall>i\<in>Basis. a \<bullet> i \<le> (1 / m) *\<^sub>R (y - c) \<bullet> i \<and> (1 / m) *\<^sub>R (y - c) \<bullet> i \<le> b \<bullet> i) \<and> y = m *\<^sub>R (1 / m) *\<^sub>R (y - c) + c
[PROOF STEP]
apply (auto simp: pos_le_divide_eq pos_divide_le_eq mult.commute inner_distrib inner_diff_left)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
assume "\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i" "\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i" "m < 0"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
m < 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
m < 0
[PROOF STEP]
have "y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
m < 0

goal (1 subgoal):
 1. y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
[PROOF STEP]
unfolding image_iff Bex_def mem_box
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i
\<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
m < 0

goal (1 subgoal):
 1. \<exists>x. (\<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i) \<and> y = m *\<^sub>R x + c
[PROOF STEP]
apply (intro exI[where x="(1 / m) *\<^sub>R (y - c)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> y \<bullet> i; \<forall>i\<in>Basis. y \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> (\<forall>i\<in>Basis. a \<bullet> i \<le> (1 / m) *\<^sub>R (y - c) \<bullet> i \<and> (1 / m) *\<^sub>R (y - c) \<bullet> i \<le> b \<bullet> i) \<and> y = m *\<^sub>R (1 / m) *\<^sub>R (y - c) + c
[PROOF STEP]
apply (auto simp: neg_le_divide_eq neg_divide_le_eq mult.commute inner_distrib inner_diff_left)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
y \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
\<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
\<lbrakk>\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
\<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
\<lbrakk>\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b

goal (1 subgoal):
 1. (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; 0 < m\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> (m *\<^sub>R ?y2 + c) \<bullet> i
\<lbrakk>\<forall>i\<in>Basis. a \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> b \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> \<forall>i\<in>Basis. (m *\<^sub>R ?y2 + c) \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i
\<lbrakk>0 < m; \<forall>i\<in>Basis. (m *\<^sub>R a + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R b + c) \<bullet> i\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
\<lbrakk>\<forall>i\<in>Basis. (m *\<^sub>R b + c) \<bullet> i \<le> ?y2 \<bullet> i; \<forall>i\<in>Basis. ?y2 \<bullet> i \<le> (m *\<^sub>R a + c) \<bullet> i; m < 0\<rbrakk> \<Longrightarrow> ?y2 \<in> (\<lambda>x. m *\<^sub>R x + c) ` cbox a b
m \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))
[PROOF STEP]
by (auto simp: cbox_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. m *\<^sub>R x + c) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + c) (m *\<^sub>R b + c) else cbox (m *\<^sub>R b + c) (m *\<^sub>R a + c))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem induced_hom_universal_property:
  "\<exists>!F. GroupHom G F \<and> (\<forall>s\<in>S. F (\<lceil>FreeGroup S|Abs_freeletter s|Q\<rceil>) = f s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!F. GroupHom (Group.quotient_group (FreeGroup S) \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) F \<and> (\<forall>s\<in>S. F (BinOpSetGroup.Abs_G_perm (FreeGroup S // Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S)) (+) (Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S) `` {Abs_freeletter s})) = f s)
[PROOF STEP]
using hom_induced_hom induced_hom_Abs_freeletter_equality
        uniqueness_of_induced_hom
[PROOF STATE]
proof (prove)
using this:
GroupHom (Group.quotient_group (FreeGroup S) \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) F
?s \<in> S \<Longrightarrow> F (BinOpSetGroup.Abs_G_perm (FreeGroup S // Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S)) (+) (Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S) `` {Abs_freeletter ?s})) = f ?s
\<lbrakk>GroupHom (Group.quotient_group (FreeGroup S) \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) ?T; \<forall>s\<in>S. ?T (BinOpSetGroup.Abs_G_perm (FreeGroup S // Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S)) (+) (Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S) `` {Abs_freeletter s})) = f s\<rbrakk> \<Longrightarrow> ?T = F

goal (1 subgoal):
 1. \<exists>!F. GroupHom (Group.quotient_group (FreeGroup S) \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) F \<and> (\<forall>s\<in>S. F (BinOpSetGroup.Abs_G_perm (FreeGroup S // Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S)) (+) (Restr (lcoset_rel \<langle>\<Union>g\<in>FreeGroup S. lconjby g ` P'\<rangle>) (FreeGroup S) `` {Abs_freeletter s})) = f s)
[PROOF STEP]
by    blast


[STATEMENT]
lemma cSup_eq:
  fixes c::"'a::conditionally_complete_lattice"
  assumes "\<forall>x \<in> X. x \<le> c" and "\<exists>x \<in> X. c \<le> x"
  shows "Sup X = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup X = c
[PROOF STEP]
by (metis assms cSup_eq_maximum order_class.order.antisym)


[STATEMENT]
lemma primroot_take_shortest: assumes "u \<noteq> \<epsilon>" shows "\<rho> u = (take (LEAST d. (\<exists> r. (u \<in> r*) \<and> \<^bold>|r\<^bold>| = d)) u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<rho> u = take (LEAST d. \<exists>r. u \<in> r* \<and> \<^bold>|r\<^bold>| = d) u
[PROOF STEP]
using primroot_take[OF assms, unfolded primroot_shortest_root[OF assms]]
[PROOF STATE]
proof (prove)
using this:
\<rho> u = take (LEAST d. \<exists>r. u \<in> r* \<and> \<^bold>|r\<^bold>| = d) u

goal (1 subgoal):
 1. \<rho> u = take (LEAST d. \<exists>r. u \<in> r* \<and> \<^bold>|r\<^bold>| = d) u
[PROOF STEP]
.


[STATEMENT]
lemma holds_sfilter:
  assumes "ev (holds Q) s" shows "holds P (sfilter Q s) \<longleftrightarrow> (not (holds Q) suntil (holds (Q aand P))) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. holds P (sfilter Q s) = ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. holds P (sfilter Q s) \<Longrightarrow> ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s
 2. ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s \<Longrightarrow> holds P (sfilter Q s)
[PROOF STEP]
assume "holds P (sfilter Q s)"
[PROOF STATE]
proof (state)
this:
holds P (sfilter Q s)

goal (2 subgoals):
 1. holds P (sfilter Q s) \<Longrightarrow> ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s
 2. ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s \<Longrightarrow> holds P (sfilter Q s)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
ev (holds Q) s
holds P (sfilter Q s)
[PROOF STEP]
show "(not (holds Q) suntil (holds (Q aand P))) s"
[PROOF STATE]
proof (prove)
using this:
ev (holds Q) s
holds P (sfilter Q s)

goal (1 subgoal):
 1. ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s
[PROOF STEP]
by (induct rule: ev_induct_strong) (auto intro: suntil.intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s

goal (1 subgoal):
 1. ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s \<Longrightarrow> holds P (sfilter Q s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s \<Longrightarrow> holds P (sfilter Q s)
[PROOF STEP]
assume "(not (holds Q) suntil (holds (Q aand P))) s"
[PROOF STATE]
proof (state)
this:
((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s

goal (1 subgoal):
 1. ((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s \<Longrightarrow> holds P (sfilter Q s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s
[PROOF STEP]
show "holds P (sfilter Q s)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>xs. \<not> holds Q xs) suntil holds (\<lambda>xs. Q xs \<and> P xs)) s

goal (1 subgoal):
 1. holds P (sfilter Q s)
[PROOF STEP]
by induct auto
[PROOF STATE]
proof (state)
this:
holds P (sfilter Q s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_chain_alt[chain_alts]: "finite_chain f Q \<longleftrightarrow> short_ch_by_ord f Q \<or> (finite Q \<and> local_long_ch_by_ord f Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_chain f Q = (short_ch_by_ord f Q \<or> finite Q \<and> local_long_ch_by_ord f Q)
[PROOF STEP]
unfolding chain_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite Q \<and> (Q = {f 0, f 1} \<and> (\<exists>Q. path Q (f 0) (f 1)) \<or> (infinite Q \<or> 3 \<le> card Q) \<and> local_ordering f betw Q)) = (Q = {f 0, f 1} \<and> (\<exists>Q. path Q (f 0) (f 1)) \<or> finite Q \<and> (infinite Q \<or> 3 \<le> card Q) \<and> local_ordering f betw Q)
[PROOF STEP]
by auto


[STATEMENT]
lemma [code]:
  "pmf (bind_pmf N f) = (\<lambda>i :: 'a. measure_pmf.expectation N (\<lambda>(x :: 'b ::enum). pmf (f x) i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (N \<bind> f) = (\<lambda>i. measure_pmf.expectation N (\<lambda>x. pmf (f x) i))
[PROOF STEP]
using Probability_Mass_Function.pmf_bind
[PROOF STATE]
proof (prove)
using this:
pmf (?N \<bind> ?f) ?i = measure_pmf.expectation ?N (\<lambda>x. pmf (?f x) ?i)

goal (1 subgoal):
 1. pmf (N \<bind> f) = (\<lambda>i. measure_pmf.expectation N (\<lambda>x. pmf (f x) i))
[PROOF STEP]
by fast


[STATEMENT]
lemma tendsto_enn2erealI [tendsto_intros]:
  assumes "(f \<longlongrightarrow> l) F"
  shows "((\<lambda>i. enn2ereal(f i)) \<longlongrightarrow> enn2ereal l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. enn2ereal (f i)) \<longlongrightarrow> enn2ereal l) F
[PROOF STEP]
using tendsto_enn2ereal_iff assms
[PROOF STATE]
proof (prove)
using this:
((\<lambda>i. enn2ereal (?f i)) \<longlongrightarrow> enn2ereal ?x) ?F = (?f \<longlongrightarrow> ?x) ?F
(f \<longlongrightarrow> l) F

goal (1 subgoal):
 1. ((\<lambda>i. enn2ereal (f i)) \<longlongrightarrow> enn2ereal l) F
[PROOF STEP]
by auto


[STATEMENT]
theorem swing_inv:
"swing w1 w2 \<Longrightarrow> (kauff_mat w1) = (kauff_mat w2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swing w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
unfolding swing_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swing_pos w1 w2 \<or> swing_neg w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
using swing_pos_inv swing_neg_inv
[PROOF STATE]
proof (prove)
using this:
swing_pos ?w1.0 ?w2.0 \<Longrightarrow> kauff_mat ?w1.0 = kauff_mat ?w2.0
swing_neg ?w1.0 ?w2.0 \<Longrightarrow> kauff_mat ?w1.0 = kauff_mat ?w2.0

goal (1 subgoal):
 1. swing_pos w1 w2 \<or> swing_neg w1 w2 \<Longrightarrow> kauff_mat w1 = kauff_mat w2
[PROOF STEP]
by auto


[STATEMENT]
lemma inverse_of_real_nat_of_rat_of_nat:
      "inverse (real_of_nat n) =  of_rat(inverse (of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (real n) = real_of_rat (inverse (rat_of_nat n))
[PROOF STEP]
by (metis Ratreal_def of_rat_of_nat_eq real_inverse_code)


[STATEMENT]
lemma vector_linorder_matrix:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  shows "matrix_bounded_idempotent_semiring.vector f \<longleftrightarrow> (\<forall>i j k . f (i,j) = f (i,k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_bounded_idempotent_semiring.vector f = (\<forall>i j k. f (i, j) = f (i, k))
[PROOF STEP]
using vector_linorder_matrix_1 vector_linorder_matrix_2
[PROOF STATE]
proof (prove)
using this:
matrix_bounded_idempotent_semiring.vector ?f \<Longrightarrow> ?f (?i, ?j) = ?f (?i, ?k)
\<forall>i j k. ?f (i, j) = ?f (i, k) \<Longrightarrow> matrix_bounded_idempotent_semiring.vector ?f

goal (1 subgoal):
 1. matrix_bounded_idempotent_semiring.vector f = (\<forall>i j k. f (i, j) = f (i, k))
[PROOF STEP]
by auto


[STATEMENT]
lemma eps: "eps > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < eps
[PROOF STEP]
unfolding eps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / 1000
[PROOF STEP]
by simp


[STATEMENT]
lemma ordinal_not_0_less [iff]: "(\<not> 0 < x) = (x = (0::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> 0 < x) = (x = 0)
[PROOF STEP]
by (simp add: linorder_not_less)


[STATEMENT]
lemma set_tries_eq_ran: "set_tries t = Union(set ` ran(lookup_trie t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_tries t = \<Union> (set ` ran (lookup_trie t))
[PROOF STEP]
apply(auto simp add: set_eq_iff set_tries_def lookup_tries_def ran_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa a uu_. \<lbrakk>\<forall>x. (x \<in> xa) = (\<exists>uu_. Some uu_ = lookup_trie t a \<and> x \<in> set uu_); Some uu_ = lookup_trie t a; x \<in> set uu_\<rbrakk> \<Longrightarrow> \<exists>xa. (\<exists>a. lookup_trie t a = Some xa) \<and> x \<in> set xa
 2. \<And>x xa a. \<lbrakk>x \<in> set xa; lookup_trie t a = Some xa\<rbrakk> \<Longrightarrow> \<exists>xa. (\<exists>a. \<forall>x. (x \<in> xa) = (\<exists>uu_. Some uu_ = lookup_trie t a \<and> x \<in> set uu_)) \<and> x \<in> xa
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa a. \<lbrakk>x \<in> set xa; lookup_trie t a = Some xa\<rbrakk> \<Longrightarrow> \<exists>xa. (\<exists>a. \<forall>x. (x \<in> xa) = (\<exists>uu_. Some uu_ = lookup_trie t a \<and> x \<in> set uu_)) \<and> x \<in> xa
[PROOF STEP]
by (metis option.inject)


[STATEMENT]
lemma (in encoding) full_abstraction_and_surjectivity_impl_SRel_iff_TRel_is_trans:
  fixes SRel :: "('procS \<times> 'procS) set"
    and TRel :: "('procT \<times> 'procT) set"
  assumes fullAbs: "fully_abstract SRel TRel"
      and surj:    "\<forall>T. \<exists>S. T = \<lbrakk>S\<rbrakk>"
  shows "trans SRel \<longleftrightarrow> trans TRel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans SRel = trans TRel
[PROOF STEP]
using fullAbs surj
            full_abstraction_impl_SRel_iff_TRel_is_trans[where SRel="SRel" and TRel="TRel"]
[PROOF STATE]
proof (prove)
using this:
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel)
\<forall>T. \<exists>S. T = \<lbrakk>S\<rbrakk>
\<forall>S1 S2. ((S1, S2) \<in> SRel) = ((\<lbrakk>S1\<rbrakk>, \<lbrakk>S2\<rbrakk>) \<in> TRel) \<Longrightarrow> trans SRel = trans (_Collect (T1, T2) (\<exists>S1 S2. T1 = \<lbrakk>S1\<rbrakk> \<and> T2 = \<lbrakk>S2\<rbrakk> \<and> (T1, T2) \<in> TRel))

goal (1 subgoal):
 1. trans SRel = trans TRel
[PROOF STEP]
by auto


[STATEMENT]
lemma up_join_eq_up[simp]: "up\<cdot>(n::'a::Finite_Join_cpo) \<squnion> up\<cdot>n' = up\<cdot>(n \<squnion> n')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. up\<cdot>n \<squnion> up\<cdot>n' = up\<cdot>(n \<squnion> n')
[PROOF STEP]
apply (rule lub_is_join)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {up\<cdot>n, up\<cdot>n'} <<| up\<cdot>(n \<squnion> n')
[PROOF STEP]
apply (auto simp add: is_lub_def )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. \<lbrakk>up\<cdot>n \<sqsubseteq> u; up\<cdot>n' \<sqsubseteq> u\<rbrakk> \<Longrightarrow> up\<cdot>(n \<squnion> n') \<sqsubseteq> u
[PROOF STEP]
apply (case_tac u)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>u. \<lbrakk>up\<cdot>n \<sqsubseteq> u; up\<cdot>n' \<sqsubseteq> u; u = \<bottom>\<rbrakk> \<Longrightarrow> up\<cdot>(n \<squnion> n') \<sqsubseteq> u
 2. \<And>u x. \<lbrakk>up\<cdot>n \<sqsubseteq> u; up\<cdot>n' \<sqsubseteq> u; u = up\<cdot>x\<rbrakk> \<Longrightarrow> up\<cdot>(n \<squnion> n') \<sqsubseteq> u
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma index_by_eq_Some_eq[simp]:
  assumes "distinct (map f l)"
  shows "index_by f l n = Some x \<longleftrightarrow> (x\<in>set l \<and> f x = n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (index_by f l n = Some x) = (x \<in> set l \<and> f x = n)
[PROOF STEP]
unfolding index_by_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_of (map (\<lambda>x. (f x, x)) l) n = Some x) = (x \<in> set l \<and> f x = n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct (map f l)

goal (1 subgoal):
 1. (map_of (map (\<lambda>x. (f x, x)) l) n = Some x) = (x \<in> set l \<and> f x = n)
[PROOF STEP]
by (auto simp: o_def)


[STATEMENT]
lemma (in product_prob_space) emeasure_PiM_emb':
  "J \<subseteq> I \<Longrightarrow> finite J \<Longrightarrow> X \<in> sets (PiM J M) \<Longrightarrow> emeasure (Pi\<^sub>M I M) (emb I J X) = PiM J M X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>J \<subseteq> I; finite J; X \<in> sets (Pi\<^sub>M J M)\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M I M) (emb I J X) = emeasure (Pi\<^sub>M J M) X
[PROOF STEP]
by (subst distr_PiM_restrict_finite[symmetric, of J])
     (auto intro!: emeasure_distr_restrict[symmetric])


[STATEMENT]
lemma parts_analz [simp]: "parts (analz H) = parts H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parts (analz H) = parts H
[PROOF STEP]
by (metis analz_increasing analz_subset_parts equalityI parts_mono parts_subset_iff)


[STATEMENT]
lemma sr_foldr_Disj: "\<forall>Q' \<in> set Qs. fv Q' = fv Q  \<Longrightarrow> sr (foldr Disj Qs Q) \<longleftrightarrow> (\<forall>Q \<in> set Qs. sr Q) \<and> sr Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>Q'\<in>set Qs. fv Q' = fv Q \<Longrightarrow> sr (foldr Disj Qs Q) = ((\<forall>Q\<in>set Qs. sr Q) \<and> sr Q)
[PROOF STEP]
by (induct Qs) (auto simp: sr_Disj)


[STATEMENT]
lemma partition_by_nth_greater:
  assumes "i < k" and "k < length zs" and "j < zs ! i"
    and "length xs = sum_list (take i zs) + j"
  shows "partition_by (xs @ y # ys) zs ! k =
    take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
have "partition_by (xs @ y # ys) zs ! k =
    take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < k
k < length zs
j < zs ! i
length xs = sum_list (take i zs) + j

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
[PROOF STEP]
by (auto simp: partition_by_nth)
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
have "sum_list (take k zs) > length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs < sum_list (take k zs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < k
k < length zs
j < zs ! i
length xs = sum_list (take i zs) + j

goal (1 subgoal):
 1. length xs < sum_list (take k zs)
[PROOF STEP]
by (auto simp: sum_list_take_eq)
[PROOF STATE]
proof (state)
this:
length xs < sum_list (take k zs)

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
length xs < sum_list (take k zs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
length xs < sum_list (take k zs)

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))
[PROOF STEP]
by (auto) (metis Suc_diff_Suc drop_Suc_Cons)
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs) - 1) (xs @ ys))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_interval_power: "real_interval (a ^ b) = real_interval a ^ b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_interval (a ^ b) = real_interval a ^ b
[PROOF STEP]
by (induction b arbitrary: a)
    (auto simp: real_interval_times real_interval_one)


[STATEMENT]
lemma fsymsPB_Un[simp]: "fsymsPB (\<Phi>1 \<union> \<Phi>2) = fsymsPB \<Phi>1 \<union> fsymsPB \<Phi>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fsymsPB (\<Phi>1 \<union> \<Phi>2) = fsymsPB \<Phi>1 \<union> fsymsPB \<Phi>2
[PROOF STEP]
unfolding fsymsPB_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {fsymsC c |c. c \<in> \<Phi>1 \<union> \<Phi>2} = \<Union> {fsymsC c |c. c \<in> \<Phi>1} \<union> \<Union> {fsymsC c |c. c \<in> \<Phi>2}
[PROOF STEP]
by auto