[STATEMENT]
lemma closed_segment_line_hyperplanes:
  "{a -- b} = range (\<lambda>u. a + u *\<^sub>R (b - a)) \<inter> {x. a \<bullet> (b - a) \<le> x \<bullet> (b - a) \<and> x \<bullet> (b - a) \<le> b \<bullet> (b - a)}"
  if "a \<noteq> b"
  for a b::"'a::euclidean_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a--b} = range (\<lambda>u. a + u *\<^sub>R (b - a)) \<inter> {x. a \<bullet> (b - a) \<le> x \<bullet> (b - a) \<and> x \<bullet> (b - a) \<le> b \<bullet> (b - a)}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 3. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 4. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 3. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 4. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
assume x: "x \<in> {a--b}"
[PROOF STATE]
proof (state)
this:
x \<in> {a--b}

goal (4 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 3. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 4. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {a--b}
[PROOF STEP]
obtain u where u: "0 \<le> u" "u \<le> 1" and x_eq: "x = a + u *\<^sub>R (b - a)"
[PROOF STATE]
proof (prove)
using this:
x \<in> {a--b}

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>0 \<le> u; u \<le> 1; x = a + u *\<^sub>R (b - a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: in_segment algebra_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1
x = a + u *\<^sub>R (b - a)

goal (4 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 3. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 4. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
show "x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))
[PROOF STEP]
using x_eq
[PROOF STATE]
proof (prove)
using this:
x = a + u *\<^sub>R (b - a)

goal (1 subgoal):
 1. x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> range (\<lambda>u. a + u *\<^sub>R (b - a))

goal (3 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 3. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
have "2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b
[PROOF STEP]
by (rule inner_quad_ge)
[PROOF STATE]
proof (state)
this:
2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b

goal (3 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 3. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b
[PROOF STEP]
have "u * (2 * (a \<bullet> b) - a \<bullet> a - b \<bullet> b) \<le> 0"
    "0 \<le> (1 - u) * (a \<bullet> a + b \<bullet> b - a \<bullet> b * 2)"
[PROOF STATE]
proof (prove)
using this:
2 * (a \<bullet> b) \<le> a \<bullet> a + b \<bullet> b

goal (1 subgoal):
 1. u * (2 * (a \<bullet> b) - a \<bullet> a - b \<bullet> b) \<le> 0 &&& 0 \<le> (1 - u) * (a \<bullet> a + b \<bullet> b - a \<bullet> b * 2)
[PROOF STEP]
by (simp_all add: mult_le_0_iff u)
[PROOF STATE]
proof (state)
this:
u * (2 * (a \<bullet> b) - a \<bullet> a - b \<bullet> b) \<le> 0
0 \<le> (1 - u) * (a \<bullet> a + b \<bullet> b - a \<bullet> b * 2)

goal (3 subgoals):
 1. \<And>x. x \<in> {a--b} \<Longrightarrow> a \<bullet> (b - a) \<le> x \<bullet> (b - a)
 2. \<And>x. x \<in> {a--b} \<Longrightarrow> x \<bullet> (b - a) \<le> b \<bullet> (b - a)
 3. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u * (2 * (a \<bullet> b) - a \<bullet> a - b \<bullet> b) \<le> 0
0 \<le> (1 - u) * (a \<bullet> a + b \<bullet> b - a \<bullet> b * 2)
[PROOF STEP]
show " a \<bullet> (b - a) \<le> x \<bullet> (b - a)" "x \<bullet> (b - a) \<le> b \<bullet> (b - a)"
[PROOF STATE]
proof (prove)
using this:
u * (2 * (a \<bullet> b) - a \<bullet> a - b \<bullet> b) \<le> 0
0 \<le> (1 - u) * (a \<bullet> a + b \<bullet> b - a \<bullet> b * 2)

goal (1 subgoal):
 1. a \<bullet> (b - a) \<le> x \<bullet> (b - a) &&& x \<bullet> (b - a) \<le> b \<bullet> (b - a)
[PROOF STEP]
by (auto simp: x_eq algebra_simps power2_eq_square inner_commute)
[PROOF STATE]
proof (state)
this:
a \<bullet> (b - a) \<le> x \<bullet> (b - a)
x \<bullet> (b - a) \<le> b \<bullet> (b - a)

goal (1 subgoal):
 1. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
assume
    "a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a)"
    "(a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)"
[PROOF STATE]
proof (state)
this:
a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a)
(a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)

goal (1 subgoal):
 1. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a)
(a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)
[PROOF STEP]
have "0 \<le> u * ((b - a) \<bullet> (b - a))" "0 \<le> (1 - u) * ((b - a) \<bullet> (b - a))"
[PROOF STATE]
proof (prove)
using this:
a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a)
(a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)

goal (1 subgoal):
 1. 0 \<le> u * ((b - a) \<bullet> (b - a)) &&& 0 \<le> (1 - u) * ((b - a) \<bullet> (b - a))
[PROOF STEP]
by (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
0 \<le> u * ((b - a) \<bullet> (b - a))
0 \<le> (1 - u) * ((b - a) \<bullet> (b - a))

goal (1 subgoal):
 1. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> u * ((b - a) \<bullet> (b - a))
0 \<le> (1 - u) * ((b - a) \<bullet> (b - a))
[PROOF STEP]
have "0 \<le> u" "u \<le> 1"
[PROOF STATE]
proof (prove)
using this:
0 \<le> u * ((b - a) \<bullet> (b - a))
0 \<le> (1 - u) * ((b - a) \<bullet> (b - a))

goal (1 subgoal):
 1. 0 \<le> u &&& u \<le> 1
[PROOF STEP]
using inner_ge_zero[of "(b - a)"] that
[PROOF STATE]
proof (prove)
using this:
0 \<le> u * ((b - a) \<bullet> (b - a))
0 \<le> (1 - u) * ((b - a) \<bullet> (b - a))
0 \<le> (b - a) \<bullet> (b - a)
a \<noteq> b

goal (1 subgoal):
 1. 0 \<le> u &&& u \<le> 1
[PROOF STEP]
by (auto simp add: zero_le_mult_iff)
[PROOF STATE]
proof (state)
this:
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. \<And>x u. \<lbrakk>u \<in> UNIV; a \<bullet> (b - a) \<le> (a + u *\<^sub>R (b - a)) \<bullet> (b - a); (a + u *\<^sub>R (b - a)) \<bullet> (b - a) \<le> b \<bullet> (b - a)\<rbrakk> \<Longrightarrow> a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> u
u \<le> 1
[PROOF STEP]
show "a + u *\<^sub>R (b - a) \<in> {a--b}"
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. a + u *\<^sub>R (b - a) \<in> {a--b}
[PROOF STEP]
by (auto simp: in_segment algebra_simps)
[PROOF STATE]
proof (state)
this:
a + u *\<^sub>R (b - a) \<in> {a--b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma point_abscissa_add [simp]:
  "abscissa (A + B) = abscissa A + abscissa B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abscissa (A + B) = abscissa A + abscissa B
[PROOF STEP]
by (simp add: point_add_def)


[STATEMENT]
lemma qGoodEnv_iff:
"qGoodEnv rho =
 ((\<forall> xs. liftAll qGood (rho xs)) \<and>
  (\<forall> ys. |{y. rho ys y \<noteq> None}| <o |UNIV :: 'var set| ) \<and>
  |{X. \<exists> ys y. rho ys y = Some X}| <o |UNIV :: 'var set| )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qGoodEnv rho = ((\<forall>xs. liftAll qGood (rho xs)) \<and> (\<forall>ys. |{y. rho ys y \<noteq> None}| <o |UNIV|) \<and> |{X. \<exists>ys y. rho ys y = Some X}| <o |UNIV|)
[PROOF STEP]
unfolding qGoodEnv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>xs. liftAll qGood (rho xs)) \<and> (\<forall>ys. |{y. rho ys y \<noteq> None}| <o |UNIV|)) = ((\<forall>xs. liftAll qGood (rho xs)) \<and> (\<forall>ys. |{y. rho ys y \<noteq> None}| <o |UNIV|) \<and> |{X. \<exists>ys y. rho ys y = Some X}| <o |UNIV|)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>xs. liftAll qGood (rho xs); \<forall>ys. |{y. \<exists>ya. rho ys y = Some ya}| <o |UNIV|\<rbrakk> \<Longrightarrow> |{X. \<exists>ys y. rho ys y = Some X}| <o |UNIV|
[PROOF STEP]
apply(rule qGoodEnv_imp_card_of_qTerm2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>xs. liftAll qGood (rho xs); \<forall>ys. |{y. \<exists>ya. rho ys y = Some ya}| <o |UNIV|\<rbrakk> \<Longrightarrow> qGoodEnv rho
[PROOF STEP]
unfolding qGoodEnv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>xs. liftAll qGood (rho xs); \<forall>ys. |{y. \<exists>ya. rho ys y = Some ya}| <o |UNIV|\<rbrakk> \<Longrightarrow> (\<forall>xs. liftAll qGood (rho xs)) \<and> (\<forall>ys. |{y. rho ys y \<noteq> None}| <o |UNIV|)
[PROOF STEP]
by simp


[STATEMENT]
lemma the_real_step_augment:
  assumes  steph : "\<And>xs var L F \<Gamma>. length xs = var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (step var L F) (xs @ x # \<Gamma>))"
  shows "(\<exists>xs. (length xs = amount \<and> eval (list_disj (map(\<lambda>(L,F,n). ExN n (list_conj (map fm.Atom L @ F))) F))  (xs @ \<Gamma>))) = (eval (the_real_step_augment step amount F)  \<Gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>
[PROOF STEP]
proof(induction amount arbitrary: F \<Gamma>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>F \<Gamma>. (\<exists>xs. length xs = 0 \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step 0 F) \<Gamma>
 2. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>F \<Gamma>. (\<exists>xs. length xs = 0 \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step 0 F) \<Gamma>
 2. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = 0 \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step 0 F) \<Gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>xs. length xs = 0 \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step 0 F) \<Gamma>

goal (1 subgoal):
 1. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
case (Suc amount)
[PROOF STATE]
proof (state)
this:
(\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) ?F)) (xs @ ?\<Gamma>)) = eval (the_real_step_augment step amount ?F) ?\<Gamma>

goal (1 subgoal):
 1. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
have h1 : "\<And>F. (\<exists>x xs. length xs = amount \<and> F (xs @ x # \<Gamma>)) = (\<exists>xs. length xs = Suc amount \<and> F (xs @  \<Gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>F. (\<exists>x xs. length xs = amount \<and> F (xs @ x # \<Gamma>)) = (\<exists>xs. length xs = Suc amount \<and> F (xs @ \<Gamma>))
[PROOF STEP]
by (smt (z3) Suc_inject append.assoc append_Cons append_Nil2 append_eq_conv_conj length_append_singleton lessI self_append_conv2 take_hd_drop)
[PROOF STATE]
proof (state)
this:
(\<exists>x xs. length xs = amount \<and> ?F (xs @ x # \<Gamma>)) = (\<exists>xs. length xs = Suc amount \<and> ?F (xs @ \<Gamma>))

goal (1 subgoal):
 1. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
have h2: "\<And>X x \<Gamma>. (\<exists>f\<in>set (dnf_modified X).
         eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>)) = (\<exists>(al, fl, n)\<in>set (dnf_modified X). \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ (x @ \<Gamma>))) \<and> (\<forall>f\<in>set fl. eval f (L @ (x @ \<Gamma>))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X x \<Gamma>. (\<exists>f\<in>set (dnf_modified X). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>)) = (\<exists>(al, fl, n)\<in>set (dnf_modified X). \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ x @ \<Gamma>)))
[PROOF STEP]
subgoal for X x \<Gamma>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f\<in>set (dnf_modified X). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>)) = (\<exists>(al, fl, n)\<in>set (dnf_modified X). \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ x @ \<Gamma>)))
[PROOF STEP]
apply(rule bex_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set (dnf_modified X) = set (dnf_modified X)
 2. \<And>f. f \<in> set (dnf_modified X) \<Longrightarrow> eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>) = (case f of (al, fl, n) \<Rightarrow> \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ x @ \<Gamma>)))
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. f \<in> set (dnf_modified X) \<Longrightarrow> eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>) = (case f of (al, fl, n) \<Rightarrow> \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ x @ \<Gamma>)))
[PROOF STEP]
subgoal for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> set (dnf_modified X) \<Longrightarrow> eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>) = (case f of (al, fl, n) \<Rightarrow> \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ x @ \<Gamma>)))
[PROOF STEP]
apply(cases f)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>f \<in> set (dnf_modified X); f = (a, b, c)\<rbrakk> \<Longrightarrow> eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (x @ \<Gamma>) = (case f of (al, fl, n) \<Rightarrow> \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ x @ \<Gamma>)))
[PROOF STEP]
apply(auto simp add:eval_list_conj)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b l. \<lbrakk>(a, b, length l) \<in> set (dnf_modified X); f = (a, b, length l); \<forall>f\<in>fm.Atom ` set a \<union> set b. eval f (l @ x @ \<Gamma>)\<rbrakk> \<Longrightarrow> \<exists>L. length L = length l \<and> (\<forall>a\<in>set a. aEval a (L @ x @ \<Gamma>)) \<and> (\<forall>f\<in>set b. eval f (L @ x @ \<Gamma>))
[PROOF STEP]
by (metis Un_iff eval.simps(1) imageI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<exists>f\<in>set (dnf_modified ?X). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (?x @ ?\<Gamma>)) = (\<exists>(al, fl, n)\<in>set (dnf_modified ?X). \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ ?x @ ?\<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ ?x @ ?\<Gamma>)))

goal (1 subgoal):
 1. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
have h3 : "\<And>G. (\<exists>x. \<exists>f\<in>set F. G x f) = (\<exists>f\<in>set F. \<exists>x. G x f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>G. (\<exists>x. \<exists>f\<in>set F. G x f) = (\<exists>f\<in>set F. \<exists>x. G x f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<exists>x. \<exists>f\<in>set F. ?G x f) = (\<exists>f\<in>set F. \<exists>x. ?G x f)

goal (1 subgoal):
 1. \<And>amount F \<Gamma>. (\<And>F \<Gamma>. (\<exists>xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step amount F) \<Gamma>) \<Longrightarrow> (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = (\<exists>x. eval (the_real_step_augment step amount (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F))))))))) (x # \<Gamma>))
[PROOF STEP]
unfolding Suc[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = (\<exists>x xs. length xs = amount \<and> eval (list_disj (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))))) (xs @ x # \<Gamma>))
[PROOF STEP]
unfolding eval_list_disj
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = Suc amount \<and> (\<exists>f\<in>set (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) F). eval f (xs @ \<Gamma>))) = (\<exists>x xs. length xs = amount \<and> (\<exists>f\<in>set (map (\<lambda>(L, F, n). ExN n (list_conj (map fm.Atom L @ F))) (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F))))))))). eval f (xs @ x # \<Gamma>)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs. length xs = Suc amount \<and> (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ \<Gamma>))) = (\<exists>x xs. length xs = amount \<and> (\<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding h1[symmetric, of "\<lambda>x. (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) x)"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x xs. length xs = amount \<and> (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (\<exists>x xs. length xs = amount \<and> (\<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding HOL.ex_comm[of "\<lambda>x xs. length xs = amount \<and> (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs x. length xs = amount \<and> (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (\<exists>x xs. length xs = amount \<and> (\<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding HOL.ex_comm[of "\<lambda>x xs. length xs = amount \<and>
        (\<exists>f\<in>set (dnf_modified (push_forall
                     (nnf (unpower 0
                            (groupQuantifiers
                              (clearQuantifiers(list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))).
            eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>xs x. length xs = amount \<and> (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (\<exists>xs x. length xs = amount \<and> (\<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
apply(rule ex_cong1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. (\<exists>x. length xs = amount \<and> (\<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (\<exists>x. length xs = amount \<and> (\<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
subgoal for xs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding h2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. \<exists>(al, fl, n)\<in>set (dnf_modified (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)))))))). \<exists>L. length L = n \<and> (\<forall>a\<in>set al. aEval a (L @ xs @ x # \<Gamma>)) \<and> (\<forall>f\<in>set fl. eval f (L @ xs @ x # \<Gamma>))))
[PROOF STEP]
unfolding dnf_modified_eval
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. eval (push_forall (nnf (unpower 0 (groupQuantifiers (clearQuantifiers (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F))))))) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding opt'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. eval (list_disj (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F)) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding eval_list_disj
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set (map (\<lambda>(L, F, n). ExN n (step (n + amount) L F)) F). eval f (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding List.set_map Set.bex_simps(7)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>x. \<exists>f\<in>set F. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>x. \<exists>xa\<in>set F. eval (case xa of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>)))
[PROOF STEP]
unfolding h3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length xs = amount \<and> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>)))
[PROOF STEP]
apply(cases "length xs = amount")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length xs = amount \<Longrightarrow> (length xs = amount \<and> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>)))
 2. length xs \<noteq> amount \<Longrightarrow> (length xs = amount \<and> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>))) = (length xs = amount \<and> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>)))
[PROOF STEP]
apply (simp_all add:opt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = amount \<Longrightarrow> (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)) = (\<exists>f\<in>set F. \<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>))
[PROOF STEP]
apply(rule bex_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length xs = amount \<Longrightarrow> set F = set F
 2. \<And>f. \<lbrakk>length xs = amount; f \<in> set F\<rbrakk> \<Longrightarrow> (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)) = (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>))
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>length xs = amount; f \<in> set F\<rbrakk> \<Longrightarrow> (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)) = (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>))
[PROOF STEP]
subgoal for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = amount; f \<in> set F\<rbrakk> \<Longrightarrow> (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)) = (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>))
[PROOF STEP]
apply(cases f)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>length xs = amount; f \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) (xs @ x # \<Gamma>)) = (\<exists>x. eval (case f of (L, F, n) \<Rightarrow> ExN n (step (n + amount) L F)) (xs @ x # \<Gamma>))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (\<exists>x l. length l = c \<and> eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>x l. length l = c \<and> eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
subgoal for a b c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (\<exists>x l. length l = c \<and> eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>x l. length l = c \<and> eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
unfolding HOL.ex_comm[of "\<lambda>x l. length l = c \<and> eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (\<exists>l x. length l = c \<and> eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>x l. length l = c \<and> eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
unfolding HOL.ex_comm[of "\<lambda>x l. length l = c \<and> eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>)"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (\<exists>l x. length l = c \<and> eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>l x. length l = c \<and> eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
apply(rule ex_cong1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (\<exists>x. length l = c \<and> eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>x. length l = c \<and> eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (length l = c \<and> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>))) = (length l = c \<and> (\<exists>x. eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>)))
[PROOF STEP]
subgoal for l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c)\<rbrakk> \<Longrightarrow> (length l = c \<and> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>))) = (length l = c \<and> (\<exists>x. eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>)))
[PROOF STEP]
apply(cases "length l = c")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c); length l = c\<rbrakk> \<Longrightarrow> (length l = c \<and> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>))) = (length l = c \<and> (\<exists>x. eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>)))
 2. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c); length l \<noteq> c\<rbrakk> \<Longrightarrow> (length l = c \<and> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>))) = (length l = c \<and> (\<exists>x. eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>)))
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c); length l = c\<rbrakk> \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>x. eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
using steph[of "l @ xs" "c + amount" a b \<Gamma>]
[PROOF STATE]
proof (prove)
using this:
length (l @ xs) = c + amount \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) ((l @ xs) @ x # \<Gamma>)) = (\<exists>x. eval (step (c + amount) a b) ((l @ xs) @ x # \<Gamma>))

goal (1 subgoal):
 1. \<lbrakk>length xs = amount; (a, b, c) \<in> set F; f = (a, b, c); length l = c\<rbrakk> \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom a @ b)) (l @ xs @ x # \<Gamma>)) = (\<exists>x. eval (step (c + amount) a b) (l @ xs @ x # \<Gamma>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<exists>xs. length xs = Suc amount \<and> eval (list_disj (map (\<lambda>a. case a of (L, F, n) \<Rightarrow> ExN n (list_conj (map fm.Atom L @ F))) F)) (xs @ \<Gamma>)) = eval (the_real_step_augment step (Suc amount) F) \<Gamma>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lim_0: "K.lim_stream (t, s) = distr (K.lim_stream (0, s)) T (smap (\<lambda>(t', s). (t' + t, s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K.lim_stream (t, s) = distr (K.lim_stream (0, s)) (stream_space S) (smap (\<lambda>(t', s). (t' + t, s)))
[PROOF STEP]
using lim_shift[of 0 t s]
[PROOF STATE]
proof (prove)
using this:
K.lim_stream (0 + t, s) = distr (K.lim_stream (0, s)) (stream_space S) (smap (\<lambda>(ta, s). (ta + t, s)))

goal (1 subgoal):
 1. K.lim_stream (t, s) = distr (K.lim_stream (0, s)) (stream_space S) (smap (\<lambda>(t', s). (t' + t, s)))
[PROOF STEP]
by simp


[STATEMENT]
lemma imp_disjCL: "(P|Q \<longrightarrow> R) = ((P \<longrightarrow> R) \<and> (~P \<longrightarrow> Q \<longrightarrow> R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> Q \<longrightarrow> R) = ((P \<longrightarrow> R) \<and> (\<not> P \<longrightarrow> Q \<longrightarrow> R))
[PROOF STEP]
by blast


[STATEMENT]
lemma simplex_convex_hull:
   "\<not> affine_dependent C \<and> int(card C) = n + 1 \<Longrightarrow> n simplex (convex hull C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> affine_dependent C \<and> int (card C) = n + 1 \<Longrightarrow> n simplex convex hull C
[PROOF STEP]
by (auto simp add: simplex_def)


[STATEMENT]
lemma (in normal_set) ordering_oLimit:
"ordering A (oLimit f) = oLimit (\<lambda>n. ordering A (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. OrdinalVeblen.ordering A (oLimit f) = oLimit (\<lambda>n. OrdinalVeblen.ordering A (f n))
[PROOF STEP]
apply (rule normal.oLimit)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal (OrdinalVeblen.ordering A)
[PROOF STEP]
apply (rule normal_ordering)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma 15: \<open>\<turnstile> (\<sim> p \<rightarrow> q) \<rightarrow> (q \<rightarrow> p) \<rightarrow> p\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (\<sim> p \<rightarrow> q) \<rightarrow> (q \<rightarrow> p) \<rightarrow> p
[PROOF STEP]
using MP 14 02
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<turnstile> ?p \<rightarrow> ?q; \<turnstile> ?p\<rbrakk> \<Longrightarrow> \<turnstile> ?q
\<turnstile> ((?t \<rightarrow> (?q \<rightarrow> ?p) \<rightarrow> ?p) \<rightarrow> ?r) \<rightarrow> (\<sim> ?p \<rightarrow> ?q) \<rightarrow> ?r
\<turnstile> (\<sim> ?p \<rightarrow> ?p) \<rightarrow> ?p

goal (1 subgoal):
 1. \<turnstile> (\<sim> p \<rightarrow> q) \<rightarrow> (q \<rightarrow> p) \<rightarrow> p
[PROOF STEP]
.


[STATEMENT]
lemma finfun_to_list_const:
  "finfun_to_list ((K$ c) :: ('a :: {linorder} \<Rightarrow>f 'b)) =
  (if \<not> finite (UNIV :: 'a set) \<or> c = undefined then [] else THE xs. set xs = UNIV \<and> sorted xs \<and> distinct xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finfun_to_list (K$ c) = (if infinite UNIV \<or> c = undefined then [] else THE xs. set xs = UNIV \<and> sorted xs \<and> distinct xs)
[PROOF STEP]
by(auto simp add: finfun_to_list_def finfun_const_False_conv_bot finfun_const_True_conv_top finfun_dom_const)


[STATEMENT]
theorem fusion_lfp_leq:
  assumes monoH: "mono H"
  and distribF: "dist_over_sup F"
  and comp_leq: "\<And>x. ((F \<circ> G) x \<sqsubseteq> (H \<circ> F) x)"
  shows "F (lfp G) \<sqsubseteq> (lfp H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
have "((F \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> lfp H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<circ> F\<^sup>#) (lfp H) \<sqsubseteq> lfp H
variables:
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using distribF u_cancellation
[PROOF STATE]
proof (prove)
using this:
dist_over_sup (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)
dist_over_sup (?F::?'a::refinement_lattice \<Rightarrow> ?'a::refinement_lattice) \<Longrightarrow> (?F \<circ> ?F\<^sup>#) (?x::?'a::refinement_lattice) \<sqsubseteq> ?x

goal (1 subgoal):
 1. (F \<circ> F\<^sup>#) (lfp H) \<sqsubseteq> lfp H
variables:
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> lfp H

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> lfp H
[PROOF STEP]
have "H ((F \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)"
[PROOF STATE]
proof (prove)
using this:
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> lfp H

goal (1 subgoal):
 1. H ((F \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)
variables:
F, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (simp add: monoD monoH)
[PROOF STATE]
proof (state)
this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)
[PROOF STEP]
have "F ((G \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)"
[PROOF STATE]
proof (prove)
using this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)

goal (1 subgoal):
 1. F ((G \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using comp_leq
[PROOF STATE]
proof (prove)
using this:
(H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)
((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) (?x::'a::refinement_lattice) \<sqsubseteq> ((H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F) ?x

goal (1 subgoal):
 1. F ((G \<circ> F\<^sup>#) (lfp H)) \<sqsubseteq> H (lfp H)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis comp_def refine_trans)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))) \<sqsubseteq> H (lfp H)

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))) \<sqsubseteq> H (lfp H)
[PROOF STEP]
have "(G \<circ> F\<^sup>#) (lfp H) \<sqsubseteq> (F\<^sup>#) (H (lfp H))"
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))) \<sqsubseteq> H (lfp H)

goal (1 subgoal):
 1. (G \<circ> F\<^sup>#) (lfp H) \<sqsubseteq> (F\<^sup>#) (H (lfp H))
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using distribF
[PROOF STATE]
proof (prove)
using this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> F\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))) \<sqsubseteq> H (lfp H)
dist_over_sup (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. (G \<circ> F\<^sup>#) (lfp H) \<sqsubseteq> (F\<^sup>#) (H (lfp H))
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis (mono_tags) u_galois_connection)
[PROOF STATE]
proof (state)
this:
((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> (F\<^sup>#) (H (lfp H))

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> (F\<^sup>#) (H (lfp H))
[PROOF STEP]
have "(lfp G) \<sqsubseteq> (F\<^sup>#) (lfp H)"
[PROOF STATE]
proof (prove)
using this:
((G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<circ> (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> (F\<^sup>#) (H (lfp H))

goal (1 subgoal):
 1. lfp G \<sqsubseteq> (F\<^sup>#) (lfp H)
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis comp_def def_lfp_unfold lfp_lowerbound monoH)
[PROOF STATE]
proof (state)
this:
lfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
thus "F (lfp G) \<sqsubseteq> (lfp H)"
[PROOF STATE]
proof (prove)
using this:
lfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
using distribF
[PROOF STATE]
proof (prove)
using this:
lfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) \<sqsubseteq> ((F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)\<^sup>#) (lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice))
dist_over_sup (F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal (1 subgoal):
 1. F (lfp G) \<sqsubseteq> lfp H
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis (mono_tags) u_galois_connection)
[PROOF STATE]
proof (state)
this:
(F::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice) (lfp (G::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)) \<sqsubseteq> lfp (H::'a::refinement_lattice \<Rightarrow> 'a::refinement_lattice)

goal:
No subgoals!
variables:
F, G, H :: 'a \<Rightarrow> 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
qed


[STATEMENT]
lemma countably_compactI:
  assumes "\<And>C. \<forall>t\<in>C. open t \<Longrightarrow> s \<subseteq> \<Union>C \<Longrightarrow> countable C \<Longrightarrow> (\<exists>C'\<subseteq>C. finite C' \<and> s \<subseteq> \<Union>C')"
  shows "countably_compact s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countably_compact s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>t\<in>?C. open t; s \<subseteq> \<Union> ?C; countable ?C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>?C. finite C' \<and> s \<subseteq> \<Union> C'

goal (1 subgoal):
 1. countably_compact s
[PROOF STEP]
unfolding countably_compact_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>t\<in>?C. open t; s \<subseteq> \<Union> ?C; countable ?C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>?C. finite C' \<and> s \<subseteq> \<Union> C'

goal (1 subgoal):
 1. \<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> s \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> s \<subseteq> \<Union> T)
[PROOF STEP]
by metis


[STATEMENT]
lemma nn_integral_embed_spmf_eq_1:
  "(\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV) = 1"
  (is "?lhs = _" is "(\<integral>\<^sup>+ x. ?f x \<partial>?M) = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
have "?lhs = \<integral>\<^sup>+ x. ?f x * indicator {None} x + ?f x * indicator (range Some) x \<partial>?M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator {None} x + ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator (range Some) x \<partial>count_space UNIV
[PROOF STEP]
by(rule nn_integral_cong)(auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator {None} x + ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator (range Some) x \<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator {None} x + ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator (range Some) x \<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
have "\<dots> = (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + \<integral>\<^sup>+ x. ?f x * indicator (range Some) x \<partial>?M"
    (is "_ = ?None + ?Some")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator {None} x + ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator (range Some) x \<partial>count_space UNIV = ennreal (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + (\<integral>\<^sup>+x\<in>range Some. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))\<partial>count_space UNIV)
[PROOF STEP]
by(subst nn_integral_add)(simp_all add: AE_count_space max_def le_diff_eq real_le_ereal_iff one_ereal_def[symmetric] prob split: option.split)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator {None} x + ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator (range Some) x \<partial>count_space UNIV = ennreal (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + (\<integral>\<^sup>+x\<in>range Some. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator {None} x + ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) * indicator (range Some) x \<partial>count_space UNIV = ennreal (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + (\<integral>\<^sup>+x\<in>range Some. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))\<partial>count_space UNIV)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
have "?Some = \<integral>\<^sup>+ x. ?f x \<partial>count_space (range Some)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>range Some. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))\<partial>count_space UNIV = \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space (range Some)
[PROOF STEP]
by(simp add: nn_integral_count_space_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>range Some. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))\<partial>count_space UNIV = \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space (range Some)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>range Some. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x'))\<partial>count_space UNIV = \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space (range Some)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
have "count_space (range Some) = embed_measure (count_space UNIV) Some"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count_space (range Some) = embed_measure (count_space UNIV) Some
[PROOF STEP]
by(simp add: embed_measure_count_space)
[PROOF STATE]
proof (state)
this:
count_space (range Some) = embed_measure (count_space UNIV) Some

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count_space (range Some) = embed_measure (count_space UNIV) Some

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ?f x \<partial>\<dots>) = \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>embed_measure (count_space UNIV) Some = \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV
[PROOF STEP]
by(subst nn_integral_embed_measure)(simp_all add: measurable_embed_measure1)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>embed_measure (count_space UNIV) Some = \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>embed_measure (count_space UNIV) Some = \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
have "?None + \<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV = 1
[PROOF STEP]
using prob
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV \<le> 1

goal (1 subgoal):
 1. ennreal (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV = 1
[PROOF STEP]
by(auto simp add: ennreal_minus[symmetric] ennreal_1[symmetric] ennreal_enn2real_if top_unique simp del: ennreal_1)(simp add: diff_add_self_ennreal)
[PROOF STATE]
proof (state)
this:
ennreal (1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV)) + \<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV = 1

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (case x of None \<Rightarrow> 1 - enn2real (\<integral>\<^sup>+ x. ennreal (f x) \<partial>count_space UNIV) | Some x' \<Rightarrow> max 0 (f x')) \<partial>count_space UNIV = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cblinfun_compose_sum_left: \<open>(\<Sum>i\<in>S. g i) o\<^sub>C\<^sub>L x = (\<Sum>i\<in>S. g i o\<^sub>C\<^sub>L x)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g S o\<^sub>C\<^sub>L x = (\<Sum>i\<in>S. g i o\<^sub>C\<^sub>L x)
[PROOF STEP]
apply (induction S rule:infinite_finite_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> sum g A o\<^sub>C\<^sub>L x = (\<Sum>i\<in>A. g i o\<^sub>C\<^sub>L x)
 2. sum g {} o\<^sub>C\<^sub>L x = (\<Sum>i\<in>{}. g i o\<^sub>C\<^sub>L x)
 3. \<And>xa F. \<lbrakk>finite F; xa \<notin> F; sum g F o\<^sub>C\<^sub>L x = (\<Sum>i\<in>F. g i o\<^sub>C\<^sub>L x)\<rbrakk> \<Longrightarrow> sum g (insert xa F) o\<^sub>C\<^sub>L x = (\<Sum>i\<in>insert xa F. g i o\<^sub>C\<^sub>L x)
[PROOF STEP]
by (auto simp: cblinfun_compose_add_left)


[STATEMENT]
lemma (in Semilat) le_iff_plus_unchanged: "\<lbrakk> x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow> (x \<sqsubseteq>\<^sub>r y) = (x \<squnion>\<^sub>f y = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x \<sqsubseteq>\<^bsub>r\<^esub> y) = (x \<squnion>\<^bsub>f\<^esub> y = y)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> A; y \<in> A; x \<sqsubseteq>\<^bsub>r\<^esub> y\<rbrakk> \<Longrightarrow> x \<squnion>\<^bsub>f\<^esub> y = y
 2. \<lbrakk>x \<in> A; y \<in> A; x \<squnion>\<^bsub>f\<^esub> y = y\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y
[PROOF STEP]
apply (blast intro: antisym_r lub ub2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; x \<squnion>\<^bsub>f\<^esub> y = y\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> y
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> x \<sqsubseteq>\<^bsub>r\<^esub> x \<squnion>\<^bsub>f\<^esub> y
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem build_ip_partition_same_fw_min: "A \<in> set (build_ip_partition c rs) \<Longrightarrow> B \<in> set (build_ip_partition c rs) \<Longrightarrow>
                                A \<noteq> B \<Longrightarrow>
                                \<forall>ip1::'i::len word \<in> wordinterval_to_set A.
                                \<forall>ip2::'i::len word \<in> wordinterval_to_set B.
                                \<not> same_fw_behaviour_one ip1 ip2 c rs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> set (build_ip_partition c rs); B \<in> set (build_ip_partition c rs); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>ip1\<in>wordinterval_to_set A. \<forall>ip2\<in>wordinterval_to_set B. \<not> same_fw_behaviour_one ip1 ip2 c rs
[PROOF STEP]
apply(simp add: build_ip_partition_def groupWIs3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> (\<lambda>xs. wordinterval_sort (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval))) ` set (groupWIs c rs); B \<in> (\<lambda>xs. wordinterval_sort (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval))) ` set (groupWIs c rs); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>ip1\<in>wordinterval_to_set A. \<forall>ip2\<in>wordinterval_to_set B. \<not> same_fw_behaviour_one ip1 ip2 c rs
[PROOF STEP]
using  groupWIs_same_fw_not2 wordinterval_list_to_set_compressed wordinterval_sort
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> set (groupWIs ?c ?rs); ?B \<in> set (groupWIs ?c ?rs); ?A \<noteq> ?B\<rbrakk> \<Longrightarrow> \<forall>ip1\<in>wordinterval_list_to_set ?A. \<forall>ip2\<in>wordinterval_list_to_set ?B. \<not> same_fw_behaviour_one ip1 ip2 ?c ?rs
wordinterval_to_set (wordinterval_compress (foldr wordinterval_union ?xs Empty_WordInterval)) = wordinterval_list_to_set ?xs
wordinterval_to_set (wordinterval_sort ?w) = wordinterval_to_set ?w

goal (1 subgoal):
 1. \<lbrakk>A \<in> (\<lambda>xs. wordinterval_sort (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval))) ` set (groupWIs c rs); B \<in> (\<lambda>xs. wordinterval_sort (wordinterval_compress (foldr wordinterval_union xs Empty_WordInterval))) ` set (groupWIs c rs); A \<noteq> B\<rbrakk> \<Longrightarrow> \<forall>ip1\<in>wordinterval_to_set A. \<forall>ip2\<in>wordinterval_to_set B. \<not> same_fw_behaviour_one ip1 ip2 c rs
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_fv_fo_term_set: "finite (fv_fo_term_set t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (fv_fo_term_set t)
[PROOF STEP]
by (cases t) auto


[STATEMENT]
lemma min_coin_setD: "p \<in> \<CC>\<^sub>m g h \<Longrightarrow> g (fst p) =\<^sub>m h (snd p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> \<CC>\<^sub>m g h \<Longrightarrow> g fst p =\<^sub>m h snd p
[PROOF STEP]
unfolding min_coincidence_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> {(r, s). g r =\<^sub>m h s} \<Longrightarrow> g fst p =\<^sub>m h snd p
[PROOF STEP]
by force


[STATEMENT]
lemma arg_rcis_cis: assumes n: "n > 0" shows "Arg (rcis n x) = Arg (cis x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arg (rcis n x) = Arg (cis x)
[PROOF STEP]
using Arg_bounded cis_Arg_unique cis_Arg complex_mod_rcis n rcis_def sgn_eq
[PROOF STATE]
proof (prove)
using this:
- pi < Arg ?z \<and> Arg ?z \<le> pi
\<lbrakk>sgn ?z = cis ?x; - pi < ?x; ?x \<le> pi\<rbrakk> \<Longrightarrow> Arg ?z = ?x
?z \<noteq> 0 \<Longrightarrow> cis (Arg ?z) = sgn ?z
cmod (rcis ?r ?a) = \<bar>?r\<bar>
0 < n
rcis ?r ?a = complex_of_real ?r * cis ?a
sgn ?z = ?z / complex_of_real (cmod ?z)

goal (1 subgoal):
 1. Arg (rcis n x) = Arg (cis x)
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_to_IP_mult_closed:
  assumes "a \<in> indexed_pset I (carrier R)"
  shows "set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> indexed_pset I (carrier R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
proof(induction m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set_mset {#} \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R {#} \<in> carrier R [\<X>\<^bsub>I\<^esub>]
 2. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
set_mset {#} \<subseteq> I

goal (2 subgoals):
 1. set_mset {#} \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R {#} \<in> carrier R [\<X>\<^bsub>I\<^esub>]
 2. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_mset {#} \<subseteq> I
[PROOF STEP]
have "mset_to_IP R {#} = indexed_const \<one>"
[PROOF STATE]
proof (prove)
using this:
set_mset {#} \<subseteq> I

goal (1 subgoal):
 1. mset_to_IP R {#} = indexed_const \<one>
[PROOF STEP]
unfolding mset_to_IP_def indexed_const_def
[PROOF STATE]
proof (prove)
using this:
set_mset {#} \<subseteq> I

goal (1 subgoal):
 1. (\<lambda>n. if n = {#} then \<one> else \<zero>) = (\<lambda>m. if m = {#} then \<one> else \<zero>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset_to_IP R {#} = indexed_const \<one>

goal (2 subgoals):
 1. set_mset {#} \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R {#} \<in> carrier R [\<X>\<^bsub>I\<^esub>]
 2. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mset_to_IP R {#} = indexed_const \<one>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
mset_to_IP R {#} = indexed_const \<one>

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R {#} \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
by (simp add: \<open>mset_to_IP R {#} = indexed_const \<one>\<close> assms indexed_const_P_mult_closed)
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R {#} \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
case (add x m)
[PROOF STATE]
proof (state)
this:
set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]
set_mset (add_mset x m) \<subseteq> I

goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
fix m :: "'c monomial"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
assume A: "set_mset (add_mset x m) \<subseteq> I"
[PROOF STATE]
proof (state)
this:
set_mset (add_mset x m) \<subseteq> I

goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
assume B: "set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> (carrier R [\<X>\<^bsub>I\<^esub>])"
[PROOF STATE]
proof (state)
this:
set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal (1 subgoal):
 1. \<And>x m. \<lbrakk>set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]; set_mset (add_mset x m) \<subseteq> I\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
show " a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> (carrier R [\<X>\<^bsub>I\<^esub>])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
have 0: "x \<in> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> I
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
set_mset (add_mset x m) \<subseteq> I

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

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
have 1: "set_mset m \<subseteq> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset m \<subseteq> I
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
set_mset (add_mset x m) \<subseteq> I

goal (1 subgoal):
 1. set_mset m \<subseteq> I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_mset m \<subseteq> I

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
have 2: " a \<Otimes>\<^sub>p mset_to_IP R m \<in> (carrier R [\<X>\<^bsub>I\<^esub>])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
using "1" B
[PROOF STATE]
proof (prove)
using this:
set_mset m \<subseteq> I
set_mset m \<subseteq> I \<Longrightarrow> a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
have 3: " a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = (a \<Otimes>\<^sub>p mset_to_IP R m) \<Otimes> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x
[PROOF STEP]
have 30: " a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)
[PROOF STEP]
using monom_add_mset[of x m]
[PROOF STATE]
proof (prove)
using this:
mset_to_IP R (add_mset x m) = mset_to_IP R m \<Otimes> x

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x
[PROOF STEP]
have 31: "(a \<Otimes>\<^sub>p mset_to_IP R m) \<Otimes> x = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) x = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) x = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) x
[PROOF STEP]
show "(a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
have 310: "(a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}) y
[PROOF STEP]
using poly_index_mult "0" "2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier R [\<X>\<^bsub>?I\<^esub>]; ?i \<in> ?I\<rbrakk> \<Longrightarrow> ?a \<Otimes> ?i = ?a \<Otimes>\<^sub>p mset_to_IP R {#?i#}
x \<in> I
a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}) y
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}) y

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
have 311: " (mset_to_IP R m \<Otimes> x) = mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_to_IP R m \<Otimes> x = mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}
[PROOF STEP]
using  "0" "2"
[PROOF STATE]
proof (prove)
using this:
x \<in> I
a \<Otimes>\<^sub>p mset_to_IP R m \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal (1 subgoal):
 1. mset_to_IP R m \<Otimes> x = mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}
[PROOF STEP]
by (metis add_mset_add_single monom_add_mset monom_mult)
[PROOF STATE]
proof (state)
this:
mset_to_IP R m \<Otimes> x = mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
have 312: "carrier_coeff a "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier_coeff a
[PROOF STEP]
using assms indexed_pset_in_carrier
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R [\<X>\<^bsub>I\<^esub>]
\<lbrakk>?K \<subseteq> carrier R; ?P \<in> ?K [\<X>\<^bsub>?I\<^esub>]\<rbrakk> \<Longrightarrow> carrier_coeff ?P

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

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
have 313: "carrier_coeff (mset_to_IP R m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier_coeff (mset_to_IP R m)
[PROOF STEP]
by (simp add: carrier_coeff_def mset_to_IP_def)
[PROOF STATE]
proof (state)
this:
carrier_coeff (mset_to_IP R m)

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
have 314: "carrier_coeff (mset_to_IP R {#x#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier_coeff (mset_to_IP R {#x#})
[PROOF STEP]
by (metis carrier_coeff_def mset_to_IP_def one_closed zero_closed)
[PROOF STATE]
proof (state)
this:
carrier_coeff (mset_to_IP R {#x#})

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
using 310 311 312 313 314
                  P_ring_mult_assoc[of a "mset_to_IP R m" "mset_to_IP R {#x#}"]
[PROOF STATE]
proof (prove)
using this:
(a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}) y
mset_to_IP R m \<Otimes> x = mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}
carrier_coeff a
carrier_coeff (mset_to_IP R m)
carrier_coeff (mset_to_IP R {#x#})
\<lbrakk>carrier_coeff a; carrier_coeff (mset_to_IP R m); carrier_coeff (mset_to_IP R {#x#})\<rbrakk> \<Longrightarrow> a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes>\<^sub>p mset_to_IP R {#x#}

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x) y = (a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)) y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x = a \<Otimes>\<^sub>p (mset_to_IP R m \<Otimes> x)

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x
[PROOF STEP]
by (simp add: monom_add_mset)
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) = a \<Otimes>\<^sub>p mset_to_IP R m \<Otimes> x

goal (1 subgoal):
 1. a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]
[PROOF STEP]
by (simp add: "0" "1" B indexed_pset.indexed_pmult)
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<Otimes>\<^sub>p mset_to_IP R (add_mset x m) \<in> carrier R [\<X>\<^bsub>I\<^esub>]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comm_semiring_0_cancel_ow:
  "class.comm_semiring_0_cancel = comm_semiring_0_cancel_ow UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.comm_semiring_0_cancel = comm_semiring_0_cancel_ow UNIV
[PROOF STEP]
unfolding
    class.comm_semiring_0_cancel_def comm_semiring_0_cancel_ow_def
    cancel_comm_monoid_add_ow comm_semiring_ow
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>plus minus zero times. cancel_comm_monoid_add_ow UNIV plus minus zero \<and> comm_semiring_ow UNIV plus times) = (\<lambda>plus minus zero times. comm_semiring_ow UNIV plus times \<and> cancel_comm_monoid_add_ow UNIV plus minus zero)
[PROOF STEP]
by (simp add: conj_commute)


[STATEMENT]
lemma adj_inj_inv:
  fixes f :: "'a::preorder \<Rightarrow> 'b::order"
  shows "f \<stileturn> g \<Longrightarrow> ((inj f) = (g \<circ> f = id))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> inj f = (g \<circ> f = id)
[PROOF STEP]
by (metis adj_cancel_eq1 eq_id_iff inj_def o_apply)


[STATEMENT]
lemma nullable_PLUS:
  "nullable (PLUS xs) = (\<exists>r \<in> set xs. nullable r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nullable (PLUS xs) = (\<exists>r\<in>set xs. nullable r)
[PROOF STEP]
by (induction xs rule: list_singleton_induct) auto


[STATEMENT]
lemma Fr_der_def2: "\<F>\<^sub>D \<D> = (\<lambda>A. (A \<^bold>\<or> \<D>(A)) \<^bold>\<and> (\<^bold>\<midarrow>A \<^bold>\<or> \<D>(\<^bold>\<midarrow>A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<F>\<^sub>D \<D> = (\<lambda>A. (A \<^bold>\<or> \<D> A) \<^bold>\<and> (\<^bold>\<midarrow>A \<^bold>\<or> \<D> (\<^bold>\<midarrow>A)))
[PROOF STEP]
unfolding Fr_der_def dual_def conn
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>A w. A w \<and> \<not> \<not> \<D> (\<lambda>w. \<not> A w) w \<or> \<D> A w \<and> \<not> A w) = (\<lambda>A w. (A w \<or> \<D> A w) \<and> (\<not> A w \<or> \<D> (\<lambda>w. \<not> A w) w))
[PROOF STEP]
by auto


[STATEMENT]
lemma iMOD_inext_nth_diff: "
  ([r, mod m] \<rightarrow> a) - ([r, mod m] \<rightarrow> b) = (a - b) * m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r, mod m ] \<rightarrow> a) - ([ r, mod m ] \<rightarrow> b) = (a - b) * m
[PROOF STEP]
by (simp add: iMOD_inext_nth diff_mult_distrib mult.commute[of m])


[STATEMENT]
theorem thm_2_3_7_Dube:
  assumes "finite X" and "set fs \<subseteq> P[X]"
  shows "1 \<in> ideal (set fs) \<longleftrightarrow>
          1 \<in> set (punit.Macaulay_list (deg_shifts X (Dube (Suc (card X)) (maxdeg (set fs))) fs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<in> ideal (set fs)) = (1 \<in> set (punit.Macaulay_list (deg_shifts X (Dube (Suc (card X)) (maxdeg (set fs))) fs)))
[PROOF STEP]
using assms Dube_is_GB_cofactor_bound
[PROOF STATE]
proof (prove)
using this:
finite X
set fs \<subseteq> P[X]
\<lbrakk>finite ?X; finite ?F; ?F \<subseteq> P[?X]\<rbrakk> \<Longrightarrow> is_GB_cofactor_bound ?F (Dube (Suc (card ?X)) (maxdeg ?F))

goal (1 subgoal):
 1. (1 \<in> ideal (set fs)) = (1 \<in> set (punit.Macaulay_list (deg_shifts X (Dube (Suc (card X)) (maxdeg (set fs))) fs)))
[PROOF STEP]
by (rule thm_2_3_7) (simp_all add: assms)


[STATEMENT]
lemma UP_sum_is_Zp_continuous:
  assumes "a \<in> carrier Zp_x"
  assumes "b \<in> carrier Zp_x"
  assumes "is_Zp_continuous (to_fun a)"
  assumes "is_Zp_continuous (to_fun b)"
  shows "is_Zp_continuous (to_fun (a \<oplus>\<^bsub>Zp_x\<^esub> b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Zp_continuous (to_fun (a \<oplus>\<^bsub>UP Zp\<^esub> b))
[PROOF STEP]
using sum_of_cont_is_cont assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_Zp_continuous ?f; is_Zp_continuous ?g\<rbrakk> \<Longrightarrow> is_Zp_continuous (?f \<oplus>\<^bsub>function_ring (carrier Zp) Zp\<^esub> ?g)
a \<in> carrier (UP Zp)
b \<in> carrier (UP Zp)
is_Zp_continuous (to_fun a)
is_Zp_continuous (to_fun b)

goal (1 subgoal):
 1. is_Zp_continuous (to_fun (a \<oplus>\<^bsub>UP Zp\<^esub> b))
[PROOF STEP]
by (simp add: to_fun_Fun_add)