[STATEMENT]
lemma lm017:
  "possible_allocations_rel G N \<supseteq>
   injectionsUniverse \<inter> {a. Domain a \<in> all_partitions G & Range a \<subseteq> N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injectionsUniverse \<inter> {a. Domain a \<in> all_partitions G \<and> Range a \<subseteq> N} \<subseteq> possible_allocations_rel G N
[PROOF STEP]
using injections_def
[PROOF STATE]
proof (prove)
using this:
injections ?X ?Y = {R. Domain R = ?X \<and> Range R \<subseteq> ?Y \<and> runiq R \<and> runiq (R\<inverse>)}

goal (1 subgoal):
 1. injectionsUniverse \<inter> {a. Domain a \<in> all_partitions G \<and> Range a \<subseteq> N} \<subseteq> possible_allocations_rel G N
[PROOF STEP]
by auto


[STATEMENT]
lemma f_nonneg: "x \<ge> x\<^sub>0 \<Longrightarrow> f x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sub>0 \<le> x \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
proof (induction x rule: akra_bazzi_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x\<^sub>0 \<le> x; x < x\<^sub>1\<rbrakk> \<Longrightarrow> 0 \<le> f x
 2. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
case (base x)
[PROOF STATE]
proof (state)
this:
x\<^sub>0 \<le> x
x < x\<^sub>1

goal (2 subgoals):
 1. \<And>x. \<lbrakk>x\<^sub>0 \<le> x; x < x\<^sub>1\<rbrakk> \<Longrightarrow> 0 \<le> f x
 2. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
with f_nonneg_base
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x\<^sub>0 \<le> ?x; ?x < x\<^sub>1\<rbrakk> \<Longrightarrow> 0 \<le> f ?x
x\<^sub>0 \<le> x
x < x\<^sub>1
[PROOF STEP]
show "f x \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x\<^sub>0 \<le> ?x; ?x < x\<^sub>1\<rbrakk> \<Longrightarrow> 0 \<le> f ?x
x\<^sub>0 \<le> x
x < x\<^sub>1

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

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
case (rec x)
[PROOF STATE]
proof (state)
this:
x\<^sub>1 \<le> x
?t \<in> set ts \<Longrightarrow> 0 \<le> f (?t x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
from rec.hyps
[PROOF STATE]
proof (chain)
picking this:
x\<^sub>1 \<le> x
[PROOF STEP]
have "g x \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
x\<^sub>1 \<le> x

goal (1 subgoal):
 1. 0 \<le> g x
[PROOF STEP]
by (intro g_nonneg) simp
[PROOF STATE]
proof (state)
this:
0 \<le> g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> g x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
have "(\<Sum>i<k. as!i*f ((ts!i) x)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (\<Sum>i<k. as ! i * f ((ts ! i) x))
[PROOF STEP]
using rec.hyps length_ts length_as
[PROOF STATE]
proof (prove)
using this:
x\<^sub>1 \<le> x
length ts = k
length as = k

goal (1 subgoal):
 1. 0 \<le> (\<Sum>i<k. as ! i * f ((ts ! i) x))
[PROOF STEP]
by (intro sum_nonneg ballI mult_nonneg_nonneg[OF a_ge_0 rec.IH]) simp_all
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>i<k. as ! i * f ((ts ! i) x))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x\<^sub>1 \<le> x; \<And>t. t \<in> set ts \<Longrightarrow> 0 \<le> f (t x)\<rbrakk> \<Longrightarrow> 0 \<le> f x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> g x
0 \<le> (\<Sum>i<k. as ! i * f ((ts ! i) x))
[PROOF STEP]
show "f x \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> g x
0 \<le> (\<Sum>i<k. as ! i * f ((ts ! i) x))

goal (1 subgoal):
 1. 0 \<le> f x
[PROOF STEP]
using rec.hyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> g x
0 \<le> (\<Sum>i<k. as ! i * f ((ts ! i) x))
x\<^sub>1 \<le> x

goal (1 subgoal):
 1. 0 \<le> f x
[PROOF STEP]
by (simp add: f_rec)
[PROOF STATE]
proof (state)
this:
0 \<le> f x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filtered_alt: "filtered X = (X \<noteq> {} \<and> (\<forall>x \<in> X. \<forall>y \<in> X. \<exists>z \<in> X. z \<le> x \<and> z \<le> y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtered X = (X \<noteq> {} \<and> (\<forall>x\<in>X. \<forall>y\<in>X. \<exists>z\<in>X. z \<le> x \<and> z \<le> y))
[PROOF STEP]
by (simp add: dual_filtered dual_preorder.directed_alt)


[STATEMENT]
lemma funcset_id [simp]: "(\<lambda>x. x) \<in> A \<rightarrow> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) \<in> A \<rightarrow> A
[PROOF STEP]
by auto


[STATEMENT]
theorem lift_preserves_beta': "r \<rightarrow>\<^sub>\<beta>\<^sup>* s ==> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift s i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<rightarrow>\<^sub>\<beta>\<^sup>* s \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift s i
[PROOF STEP]
apply (induct set: rtranclp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift r i
 2. \<And>y z. \<lbrakk>r \<rightarrow>\<^sub>\<beta>\<^sup>* y; y \<rightarrow>\<^sub>\<beta> z; lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift y i\<rbrakk> \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift z i
[PROOF STEP]
apply (rule rtranclp.rtrancl_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>r \<rightarrow>\<^sub>\<beta>\<^sup>* y; y \<rightarrow>\<^sub>\<beta> z; lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift y i\<rbrakk> \<Longrightarrow> lift r i \<rightarrow>\<^sub>\<beta>\<^sup>* lift z i
[PROOF STEP]
apply (erule rtranclp.rtrancl_into_rtrancl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>r \<rightarrow>\<^sub>\<beta>\<^sup>* y; y \<rightarrow>\<^sub>\<beta> z\<rbrakk> \<Longrightarrow> lift y i \<rightarrow>\<^sub>\<beta> lift z i
[PROOF STEP]
apply (erule lift_preserves_beta)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma split_rflow_incoming:
  "(\<Sum>v\<in>cf.E\<inverse>``{u}. f' (v,u)) = (\<Sum>v\<in>E``{u}. f'(v,u)) + (\<Sum>v\<in>E\<inverse>``{u}. f'(v,u))"
  (is "?LHS = ?RHS")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
from no_parallel_edge
[PROOF STATE]
proof (chain)
picking this:
\<forall>u v. (u, v) \<in> E \<longrightarrow> (v, u) \<notin> E
[PROOF STEP]
have DJ: "E``{u} \<inter> E\<inverse>``{u} = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>u v. (u, v) \<in> E \<longrightarrow> (v, u) \<notin> E

goal (1 subgoal):
 1. E `` {u} \<inter> E\<inverse> `` {u} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
E `` {u} \<inter> E\<inverse> `` {u} = {}

goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
have "?LHS = (\<Sum>v\<in>E``{u} \<union> E\<inverse>``{u}. f' (v,u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u} \<union> E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
apply (rule sum.mono_neutral_left)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (E `` {u} \<union> E\<inverse> `` {u})
 2. cf.E\<inverse> `` {u} \<subseteq> E `` {u} \<union> E\<inverse> `` {u}
 3. \<forall>i\<in>E `` {u} \<union> E\<inverse> `` {u} - cf.E\<inverse> `` {u}. f' (i, u) = (0::'capacity)
[PROOF STEP]
using cfE_ss_invE
[PROOF STATE]
proof (prove)
using this:
cf.E \<subseteq> E \<union> E\<inverse>

goal (3 subgoals):
 1. finite (E `` {u} \<union> E\<inverse> `` {u})
 2. cf.E\<inverse> `` {u} \<subseteq> E `` {u} \<union> E\<inverse> `` {u}
 3. \<forall>i\<in>E `` {u} \<union> E\<inverse> `` {u} - cf.E\<inverse> `` {u}. f' (i, u) = (0::'capacity)
[PROOF STEP]
by (auto intro: finite_Image)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u} \<union> E\<inverse> `` {u}. f' (v, u))

goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u} \<union> E\<inverse> `` {u}. f' (v, u))

goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
have "\<dots> = ?RHS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>E `` {u} \<union> E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
apply (subst sum.union_disjoint[OF _ _ DJ])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite (E `` {u})
 2. finite (E\<inverse> `` {u})
 3. (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
by (auto intro: finite_Image)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>E `` {u} \<union> E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))

goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
show "?LHS = ?RHS"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))

goal (1 subgoal):
 1. (\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>cf.E\<inverse> `` {u}. f' (v, u)) = (\<Sum>v\<in>E `` {u}. f' (v, u)) + (\<Sum>v\<in>E\<inverse> `` {u}. f' (v, u))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_poly_horner_expand:
  "(\<Sum>k<(numeral n::nat). f k * x^k) = f 0 + (\<Sum>k<pred_numeral n. f (k+1) * x^k) * x"
  "(\<Sum>k<Suc 0. f k * x^k) = (f 0 :: 'a :: semiring_1)"
  "(\<Sum>k<(0::nat). f k * x^k) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x &&& (\<Sum>k<Suc 0. f k * x ^ k) = f 0 &&& (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
fix m :: nat
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
have "(\<Sum>k<Suc m. f k * x^k) = f 0 + (\<Sum>k=Suc 0..<Suc m. f k * x^k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k = Suc 0..<Suc m. f k * x ^ k)
[PROOF STEP]
by (subst atLeast0LessThan [symmetric], subst sum.atLeast_Suc_lessThan) simp_all
[PROOF STATE]
proof (state)
this:
(\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k = Suc 0..<Suc m. f k * x ^ k)

goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k = Suc 0..<Suc m. f k * x ^ k)

goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
have "(\<Sum>k=Suc 0..<Suc m. f k * x^k) = (\<Sum>k<m. f (k+1) * x^k) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc 0..<Suc m. f k * x ^ k) = (\<Sum>k<m. f (k + 1) * x ^ k) * x
[PROOF STEP]
by (subst sum.shift_bounds_Suc_ivl)
         (simp add: sum_distrib_right algebra_simps atLeast0LessThan power_commutes)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 0..<Suc m. f k * x ^ k) = (\<Sum>k<m. f (k + 1) * x ^ k) * x

goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k<m. f (k + 1) * x ^ k) * x
[PROOF STEP]
have "(\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k<m. f (k + 1) * x ^ k) * x"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k<m. f (k + 1) * x ^ k) * x

goal (1 subgoal):
 1. (\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k<m. f (k + 1) * x ^ k) * x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k<Suc m. f k * x ^ k) = f 0 + (\<Sum>k<m. f (k + 1) * x ^ k) * x

goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<Sum>k<Suc ?m2. f k * x ^ k) = f 0 + (\<Sum>k<?m2. f (k + 1) * x ^ k) * x

goal (3 subgoals):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
 2. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 3. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
from this[of "pred_numeral n"]
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k<Suc (pred_numeral n). f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
[PROOF STEP]
show "(\<Sum>k<numeral n. f k * x^k) = f 0 + (\<Sum>k<pred_numeral n. f (k+1) * x^k) * x"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k<Suc (pred_numeral n). f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x

goal (1 subgoal):
 1. (\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x
[PROOF STEP]
by (simp add: numeral_eq_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>k<numeral n. f k * x ^ k) = f 0 + (\<Sum>k<pred_numeral n. f (k + 1) * x ^ k) * x

goal (2 subgoals):
 1. (\<Sum>k<Suc 0. f k * x ^ k) = f 0
 2. (\<Sum>k<0. f k * x ^ k) = (0::'a)
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma closed_sum_is_sup:
  fixes A B C:: \<open>('a::{complex_vector,topological_space}) set\<close>
  assumes \<open>closed_csubspace C\<close>
  assumes \<open>A \<subseteq> C\<close> and \<open>B \<subseteq> C\<close>
  shows \<open>(A +\<^sub>M B) \<subseteq> C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A +\<^sub>M B \<subseteq> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A +\<^sub>M B \<subseteq> C
[PROOF STEP]
have \<open>A + B \<subseteq> C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B \<subseteq> C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
closed_csubspace C
A \<subseteq> C
B \<subseteq> C

goal (1 subgoal):
 1. A + B \<subseteq> C
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
using this:
closed_csubspace C
A \<subseteq> C
B \<subseteq> C

goal (1 subgoal):
 1. {c. \<exists>a\<in>A. \<exists>b\<in>B. c = a + b} \<subseteq> C
[PROOF STEP]
using closed_csubspace.subspace complex_vector.subspace_add
[PROOF STATE]
proof (prove)
using this:
closed_csubspace C
A \<subseteq> C
B \<subseteq> C
closed_csubspace ?A \<Longrightarrow> csubspace ?A
\<lbrakk>csubspace ?S; ?x \<in> ?S; ?y \<in> ?S\<rbrakk> \<Longrightarrow> ?x + ?y \<in> ?S

goal (1 subgoal):
 1. {c. \<exists>a\<in>A. \<exists>b\<in>B. c = a + b} \<subseteq> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A + B \<subseteq> C

goal (1 subgoal):
 1. A +\<^sub>M B \<subseteq> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A + B \<subseteq> C
[PROOF STEP]
show \<open>(A +\<^sub>M B) \<subseteq> C\<close>
[PROOF STATE]
proof (prove)
using this:
A + B \<subseteq> C

goal (1 subgoal):
 1. A +\<^sub>M B \<subseteq> C
[PROOF STEP]
unfolding closed_sum_def
[PROOF STATE]
proof (prove)
using this:
A + B \<subseteq> C

goal (1 subgoal):
 1. closure (A + B) \<subseteq> C
[PROOF STEP]
using \<open>closed_csubspace C\<close>
[PROOF STATE]
proof (prove)
using this:
A + B \<subseteq> C
closed_csubspace C

goal (1 subgoal):
 1. closure (A + B) \<subseteq> C
[PROOF STEP]
by (simp add: closed_csubspace.closed closure_minimal)
[PROOF STATE]
proof (state)
this:
A +\<^sub>M B \<subseteq> C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Bernstein_coeffs_01_1: "Bernstein_coeffs_01 p 1 = replicate (p+1) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
have "Bernstein_coeffs_01 p 1 =
     map (\<lambda>j. inverse (real (p choose j)) *
     coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<(p+1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = map (\<lambda>j. inverse (real (p choose j)) * coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<p + 1]
[PROOF STEP]
by (auto simp: Bernstein_coeffs_01_def reciprocal_1 monom_altdef
        hom_distribs pcompose_pCons poly_0_coeff_0[symmetric] poly_binomial)
[PROOF STATE]
proof (state)
this:
Bernstein_coeffs_01 p 1 = map (\<lambda>j. inverse (real (p choose j)) * coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<p + 1]

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Bernstein_coeffs_01 p 1 = map (\<lambda>j. inverse (real (p choose j)) * coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<p + 1]

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
have "... = map (\<lambda>j. inverse (real (p choose j)) *
             real (p choose (p - j))) [0..<(p+1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>j. inverse (real (p choose j)) * coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<p + 1] = map (\<lambda>j. inverse (real (p choose j)) * real (p choose (p - j))) [0..<p + 1]
[PROOF STEP]
by (auto simp: monom_altdef[symmetric] coeff_sum binomial)
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. inverse (real (p choose j)) * coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<p + 1] = map (\<lambda>j. inverse (real (p choose j)) * real (p choose (p - j))) [0..<p + 1]

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. inverse (real (p choose j)) * coeff (\<Sum>k\<le>p. smult (real (p choose k)) ([:0, 1:] ^ k)) (p - j)) [0..<p + 1] = map (\<lambda>j. inverse (real (p choose j)) * real (p choose (p - j))) [0..<p + 1]

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
have "... = map (\<lambda>j. 1) [0..<(p+1)]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>j. inverse (real (p choose j)) * real (p choose (p - j))) [0..<p + 1] = map (\<lambda>j. 1) [0..<p + 1]
[PROOF STEP]
apply (rule map_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [0..<p + 1] = [0..<p + 1]
 2. \<And>x. x \<in> set [0..<p + 1] \<Longrightarrow> inverse (real (p choose x)) * real (p choose (p - x)) = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<p + 1] = [0..<p + 1]
[PROOF STEP]
by argo
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set [0..<p + 1] \<Longrightarrow> inverse (real (p choose x)) * real (p choose (p - x)) = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x_ \<in> set [0..<p + 1] \<Longrightarrow> inverse (real (p choose x_)) * real (p choose (p - x_)) = 1
[PROOF STEP]
apply (subst binomial_symmetric)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x_ \<in> set [0..<p + 1] \<Longrightarrow> x_ \<le> p
 2. x_ \<in> set [0..<p + 1] \<Longrightarrow> inverse (real (p choose (p - x_))) * real (p choose (p - x_)) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. inverse (real (p choose j)) * real (p choose (p - j))) [0..<p + 1] = map (\<lambda>j. 1) [0..<p + 1]

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. inverse (real (p choose j)) * real (p choose (p - j))) [0..<p + 1] = map (\<lambda>j. 1) [0..<p + 1]

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
have "... = replicate (p+1) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>j. 1) [0..<p + 1] = replicate (p + 1) 1
[PROOF STEP]
by (auto simp: map_replicate_trivial replicate_append_same)
[PROOF STATE]
proof (state)
this:
map (\<lambda>j. 1) [0..<p + 1] = replicate (p + 1) 1

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Bernstein_coeffs_01 p 1 = replicate (p + 1) 1

goal (1 subgoal):
 1. Bernstein_coeffs_01 p 1 = replicate (p + 1) 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Bernstein_coeffs_01 p 1 = replicate (p + 1) 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strict_subseq_transfer [transfer_rule]:
  assumes [transfer_rule]: "bi_unique A"
  shows   "(list_all2 A ===> list_all2 A ===> (=)) strict_subseq strict_subseq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (list_all2 A ===> list_all2 A ===> (=)) strict_subseq strict_subseq
[PROOF STEP]
unfolding strict_subseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (list_all2 A ===> list_all2 A ===> (=)) (\<lambda>xs ys. xs \<noteq> ys \<and> subseq xs ys) (\<lambda>xs ys. xs \<noteq> ys \<and> subseq xs ys)
[PROOF STEP]
by transfer_prover


[STATEMENT]
lemma algebraicE:
  assumes "algebraic x"
  obtains p where "\<And>i. coeff p i \<in> \<int>" "p \<noteq> 0" "poly p x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>\<And>i. coeff p i \<in> \<int>; p \<noteq> 0; poly p x = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
algebraic x

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>\<And>i. coeff p i \<in> \<int>; p \<noteq> 0; poly p x = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding algebraic_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p. (\<forall>i. coeff p i \<in> \<int>) \<and> p \<noteq> 0 \<and> poly p x = (0::'a)

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>\<And>i. coeff p i \<in> \<int>; p \<noteq> 0; poly p x = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma mset_subset_add_mset [simp]: "add_mset x N \<subset># add_mset x M \<longleftrightarrow> N \<subset># M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (add_mset x N \<subset># add_mset x M) = (N \<subset># M)
[PROOF STEP]
unfolding add_mset_add_single[of _ N] add_mset_add_single[of _ M]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (N + {#x#} \<subset># M + {#x#}) = (N \<subset># M)
[PROOF STEP]
by (fact subset_mset.add_less_cancel_right)


[STATEMENT]
lemma mult_smult_right [simp]: "p * smult a q = smult a (p * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * smult a q = smult a (p * q)
[PROOF STEP]
by (induct q) (simp_all add: mult_poly_0 smult_add_right)


[STATEMENT]
lemma index_uminus_mat[simp]:
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> (- A) $$ (i,j) = - (A $$ (i,j))"
  "dim_row (- A) = dim_row A" "dim_col (- A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> (- A) $$ (i, j) = - A $$ (i, j)) &&& dim_row (- A) = dim_row A &&& dim_col (- A) = dim_col A
[PROOF STEP]
unfolding uminus_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> mat (dim_row A) (dim_col A) (\<lambda>ij. - A $$ ij) $$ (i, j) = - A $$ (i, j)) &&& dim_row (mat (dim_row A) (dim_col A) (\<lambda>ij. - A $$ ij)) = dim_row A &&& dim_col (mat (dim_row A) (dim_col A) (\<lambda>ij. - A $$ ij)) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma LeadsTo_eq_leadsTo:
     "A LeadsTo B = {F. F \<in> (reachable F \<inter> A) leadsTo (reachable F \<inter> B)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<longmapsto>w B = {F. F \<in> reachable F \<inter> A \<longmapsto> reachable F \<inter> B}
[PROOF STEP]
apply (unfold LeadsTo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {F. F \<in> reachable F \<inter> A \<longmapsto> B} = {F. F \<in> reachable F \<inter> A \<longmapsto> reachable F \<inter> B}
[PROOF STEP]
apply (blast dest: psp_stable2 intro: leadsTo_weaken)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma product_open_generates_sets_PiF_single:
  assumes "I \<noteq> {}"
  assumes [simp]: "finite I"
  shows "sets (PiF {I} (\<lambda>_. borel::'b::second_countable_topology measure)) =
    sigma_sets (space (PiF {I} (\<lambda>_. borel))) {Pi' I F |F. (\<forall>i\<in>I. F i \<in> Collect open)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Pi\<^sub>F {I} (\<lambda>_. borel)) = sigma_sets (space (Pi\<^sub>F {I} (\<lambda>_. borel))) {Pi' I F |F. \<forall>i\<in>I. F i \<in> Collect open}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sets (Pi\<^sub>F {I} (\<lambda>_. borel)) = sigma_sets (space (Pi\<^sub>F {I} (\<lambda>_. borel))) {Pi' I F |F. \<forall>i\<in>I. F i \<in> Collect open}
[PROOF STEP]
from open_countable_basisE[OF open_UNIV]
[PROOF STATE]
proof (chain)
picking this:
(\<And>B'. \<lbrakk>B' \<subseteq> (SOME B. countable B \<and> topological_basis B); UNIV = \<Union> B'\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain S::"'b set set"
    where S: "S \<subseteq> (SOME B. countable B \<and> topological_basis B)" "UNIV = \<Union> S"
[PROOF STATE]
proof (prove)
using this:
(\<And>B'. \<lbrakk>B' \<subseteq> (SOME B. countable B \<and> topological_basis B); UNIV = \<Union> B'\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<subseteq> (SOME B. countable B \<and> topological_basis B); UNIV = \<Union> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> (SOME B. countable B \<and> topological_basis B)
UNIV = \<Union> S

goal (1 subgoal):
 1. sets (Pi\<^sub>F {I} (\<lambda>_. borel)) = sigma_sets (space (Pi\<^sub>F {I} (\<lambda>_. borel))) {Pi' I F |F. \<forall>i\<in>I. F i \<in> Collect open}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Pi\<^sub>F {I} (\<lambda>_. borel)) = sigma_sets (space (Pi\<^sub>F {I} (\<lambda>_. borel))) {Pi' I F |F. \<forall>i\<in>I. F i \<in> Collect open}
[PROOF STEP]
proof (rule sigma_fprod_algebra_sigma_eq)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. finite I
 2. I \<noteq> {}
 3. \<And>i. i \<in> I \<Longrightarrow> \<Union> (range (?S i)) = space borel
 4. \<And>i. i \<in> I \<Longrightarrow> range (?S i) \<subseteq> Collect open
 5. \<And>i. i \<in> I \<Longrightarrow> Collect open \<subseteq> Pow (space borel)
 6. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
show "finite I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite I

goal (5 subgoals):
 1. I \<noteq> {}
 2. \<And>i. i \<in> I \<Longrightarrow> \<Union> (range (?S i)) = space borel
 3. \<And>i. i \<in> I \<Longrightarrow> range (?S i) \<subseteq> Collect open
 4. \<And>i. i \<in> I \<Longrightarrow> Collect open \<subseteq> Pow (space borel)
 5. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
show "I \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {}
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
I \<noteq> {}

goal (4 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> \<Union> (range (?S i)) = space borel
 2. \<And>i. i \<in> I \<Longrightarrow> range (?S i) \<subseteq> Collect open
 3. \<And>i. i \<in> I \<Longrightarrow> Collect open \<subseteq> Pow (space borel)
 4. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
define S' where "S' = from_nat_into S"
[PROOF STATE]
proof (state)
this:
S' = from_nat_into S

goal (4 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> \<Union> (range (?S i)) = space borel
 2. \<And>i. i \<in> I \<Longrightarrow> range (?S i) \<subseteq> Collect open
 3. \<And>i. i \<in> I \<Longrightarrow> Collect open \<subseteq> Pow (space borel)
 4. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
show "(\<Union>j. S' j) = space borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range S') = space borel
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> (SOME B. countable B \<and> topological_basis B)
UNIV = \<Union> S

goal (1 subgoal):
 1. \<Union> (range S') = space borel
[PROOF STEP]
apply (auto simp add: from_nat_into countable_basis_proj S'_def basis_proj_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>S \<subseteq> (SOME B. countable B \<and> topological_basis B); UNIV = \<Union> S\<rbrakk> \<Longrightarrow> \<exists>xa. x \<in> from_nat_into S xa
[PROOF STEP]
apply (metis (lifting, mono_tags) UNIV_I UnionE basis_proj_def countable_basis_proj countable_subset from_nat_into_surj)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<Union> (range S') = space borel

goal (3 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> range (from_nat_into S) \<subseteq> Collect open
 2. \<And>i. i \<in> I \<Longrightarrow> Collect open \<subseteq> Pow (space borel)
 3. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
show "range S' \<subseteq> Collect open"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range S' \<subseteq> Collect open
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> (SOME B. countable B \<and> topological_basis B)
UNIV = \<Union> S

goal (1 subgoal):
 1. range S' \<subseteq> Collect open
[PROOF STEP]
apply (auto simp add: from_nat_into countable_basis_proj S'_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>S \<subseteq> (SOME B. countable B \<and> topological_basis B); UNIV = \<Union> S\<rbrakk> \<Longrightarrow> open (from_nat_into S xa)
[PROOF STEP]
apply (metis UNIV_not_empty Union_empty from_nat_into subsetD topological_basis_open[OF basis_proj] basis_proj_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
range S' \<subseteq> Collect open

goal (2 subgoals):
 1. \<And>i. i \<in> I \<Longrightarrow> Collect open \<subseteq> Pow (space borel)
 2. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
show "Collect open \<subseteq> Pow (space borel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Collect open \<subseteq> Pow (space borel)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Collect open \<subseteq> Pow (space borel)

goal (1 subgoal):
 1. \<And>i. i \<in> I \<Longrightarrow> sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
show "sets borel = sigma_sets (space borel) (Collect open)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets borel = sigma_sets (space borel) (Collect open)
[PROOF STEP]
by (simp add: borel_def)
[PROOF STATE]
proof (state)
this:
sets borel = sigma_sets (space borel) (Collect open)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sets (Pi\<^sub>F {I} (\<lambda>_. borel)) = sigma_sets (space (Pi\<^sub>F {I} (\<lambda>_. borel))) {Pi' I F |F. \<forall>i\<in>I. F i \<in> Collect open}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Gauss_Jordan_in_ij_iarrays_PA_def'[code]:
"Gauss_Jordan_in_ij_iarrays_PA A' i j =
(let  P = fst A'; A = snd A'; n = least_non_zero_position_of_vector_from_index (column_iarray j A) i;
  interchange_A = interchange_rows_iarray A i n; A' = mult_row_iarray interchange_A i (1 / interchange_A !! i !! j);
  interchange_P = interchange_rows_iarray P i n; P' = mult_row_iarray interchange_P i (1 / interchange_A !! i !! j)
 in (IArray.of_fun (\<lambda>s. if s = i then P' !! s else row_add_iarray P' s i (- interchange_A !! s !! j) !! s) (nrows_iarray A),
    (IArray.of_fun (\<lambda>s. if s = i then A' !! s else row_add_iarray A' s i (- interchange_A !! s !! j) !! s) (nrows_iarray A))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan_in_ij_iarrays_PA A' i j = (let P = fst A'; A = snd A'; n = least_non_zero_position_of_vector_from_index (column_iarray j A) i; interchange_A = interchange_rows_iarray A i n; A' = mult_row_iarray interchange_A i ((1::'a) / interchange_A !! i !! j); interchange_P = interchange_rows_iarray P i n; P' = mult_row_iarray interchange_P i ((1::'a) / interchange_A !! i !! j) in (IArray.of_fun (\<lambda>s. if s = i then P' !! s else row_add_iarray P' s i (- interchange_A !! s !! j) !! s) (nrows_iarray A), IArray.of_fun (\<lambda>s. if s = i then A' !! s else row_add_iarray A' s i (- interchange_A !! s !! j) !! s) (nrows_iarray A)))
[PROOF STEP]
unfolding Gauss_Jordan_in_ij_iarrays_PA_def Gauss_Jordan_in_ij_iarrays_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (IArray.of_fun (\<lambda>s. if s = i then mult_row_iarray (interchange_rows_iarray (fst A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j) !! s else row_add_iarray (mult_row_iarray (interchange_rows_iarray (fst A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j)) s i (- interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! s !! j) !! s) (nrows_iarray (snd A')), IArray.of_fun (\<lambda>s. if s = i then mult_row_iarray (interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j) !! s else row_add_iarray (mult_row_iarray (interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j)) s i (- interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! s !! j) !! s) (nrows_iarray (snd A'))) = (IArray.of_fun (\<lambda>s. if s = i then mult_row_iarray (interchange_rows_iarray (fst A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j) !! s else row_add_iarray (mult_row_iarray (interchange_rows_iarray (fst A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j)) s i (- interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! s !! j) !! s) (nrows_iarray (snd A')), IArray.of_fun (\<lambda>s. if s = i then mult_row_iarray (interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j) !! s else row_add_iarray (mult_row_iarray (interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i)) i ((1::'a) / interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! i !! j)) s i (- interchange_rows_iarray (snd A') i (least_non_zero_position_of_vector_from_index (column_iarray j (snd A')) i) !! s !! j) !! s) (nrows_iarray (snd A')))
[PROOF STEP]
..


[STATEMENT]
lemma single_non_qFreshAbs_ordLess_var:
assumes "qGoodAbs A"
shows "|{x. \<not> qFreshAbs xs x A}| <o |UNIV :: 'var set|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |{x. \<not> qFreshAbs xs x A}| <o |UNIV|
[PROOF STEP]
using qAFreshAll_imp_qFreshAll card_of_mono1 single_non_qAFreshAbs_ordLess_var
ordLeq_ordLess_trans
[PROOF STATE]
proof (prove)
using this:
(qAFresh ?xs ?x ?X \<longrightarrow> qFresh ?xs ?x ?X) \<and> (qAFreshAbs ?xs ?x ?A \<longrightarrow> qFreshAbs ?xs ?x ?A)
?A \<subseteq> ?B \<Longrightarrow> |?A| \<le>o |?B|
qGoodAbs ?A \<Longrightarrow> |{x. \<not> qAFreshAbs ?xs x ?A}| <o |UNIV|
\<lbrakk>?r \<le>o ?r'; ?r' <o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. |{x. \<not> qFreshAbs xs x A}| <o |UNIV|
[PROOF STEP]
by (metis Collect_mono assms)


[STATEMENT]
lemma invar_children:
  assumes "tree_invar ((Node e a r ts)::(('e, 'a::linorder) BinomialTree))"
  shows "queue_invar ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_invar ts
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
tree_invar (Node e a r ts)

goal (1 subgoal):
 1. queue_invar ts
[PROOF STEP]
unfolding queue_invar_def
[PROOF STATE]
proof (prove)
using this:
tree_invar (Node e a r ts)

goal (1 subgoal):
 1. \<forall>t\<in>set ts. tree_invar t
[PROOF STEP]
proof(induct r arbitrary: e a ts)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>e a ts. tree_invar (Node e a 0 ts) \<Longrightarrow> Ball (set ts) tree_invar
 2. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
tree_invar (Node e a 0 ts)

goal (2 subgoals):
 1. \<And>e a ts. tree_invar (Node e a 0 ts) \<Longrightarrow> Ball (set ts) tree_invar
 2. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
tree_invar (Node e a 0 ts)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
tree_invar (Node e a 0 ts)

goal (1 subgoal):
 1. \<forall>a\<in>set ts. tree_invar a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set ts. tree_invar a

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
case (Suc r)
[PROOF STATE]
proof (state)
this:
tree_invar (Node ?e ?a r ?ts) \<Longrightarrow> \<forall>a\<in>set ?ts. tree_invar a
tree_invar (Node e a (Suc r) ts)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
from Suc(2)
[PROOF STATE]
proof (chain)
picking this:
tree_invar (Node e a (Suc r) ts)
[PROOF STEP]
obtain e1 a1 ts1 e2 a2 ts2 where
    O: "tree_invar (Node e1 a1 r ts1)"  "tree_invar (Node e2 a2 r ts2)"
    "(Node e a (Suc r) ts) = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)"
[PROOF STATE]
proof (prove)
using this:
tree_invar (Node e a (Suc r) ts)

goal (1 subgoal):
 1. (\<And>e1 a1 ts1 e2 a2 ts2. \<lbrakk>tree_invar (Node e1 a1 r ts1); tree_invar (Node e2 a2 r ts2); Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp only: tree_invar.simps) blast
[PROOF STATE]
proof (state)
this:
tree_invar (Node e1 a1 r ts1)
tree_invar (Node e2 a2 r ts2)
Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
from Suc(1)[OF O(1)] O(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>set ts1. tree_invar a
tree_invar (Node e2 a2 r ts2)
[PROOF STEP]
have case1: "queue_invar ((Node e2 a2 r ts2) # ts1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set ts1. tree_invar a
tree_invar (Node e2 a2 r ts2)

goal (1 subgoal):
 1. queue_invar (Node e2 a2 r ts2 # ts1)
[PROOF STEP]
unfolding queue_invar_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set ts1. tree_invar a
tree_invar (Node e2 a2 r ts2)

goal (1 subgoal):
 1. \<forall>t\<in>set (Node e2 a2 r ts2 # ts1). tree_invar t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
queue_invar (Node e2 a2 r ts2 # ts1)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
from Suc(1)[OF O(2)] O(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>a\<in>set ts2. tree_invar a
tree_invar (Node e1 a1 r ts1)
[PROOF STEP]
have case2: "queue_invar ((Node e1 a1 r ts1) # ts2)"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set ts2. tree_invar a
tree_invar (Node e1 a1 r ts1)

goal (1 subgoal):
 1. queue_invar (Node e1 a1 r ts1 # ts2)
[PROOF STEP]
unfolding queue_invar_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set ts2. tree_invar a
tree_invar (Node e1 a1 r ts1)

goal (1 subgoal):
 1. \<forall>t\<in>set (Node e1 a1 r ts1 # ts2). tree_invar t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
queue_invar (Node e1 a1 r ts1 # ts2)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
from O(3)
[PROOF STATE]
proof (chain)
picking this:
Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)
[PROOF STEP]
have "ts = (if a1\<le>a2
    then (Node e2 a2 r ts2) # ts1
    else (Node e1 a1 r ts1) # ts2)"
[PROOF STATE]
proof (prove)
using this:
Node e a (Suc r) ts = link (Node e1 a1 r ts1) (Node e2 a2 r ts2)

goal (1 subgoal):
 1. ts = (if a1 \<le> a2 then Node e2 a2 r ts2 # ts1 else Node e1 a1 r ts1 # ts2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ts = (if a1 \<le> a2 then Node e2 a2 r ts2 # ts1 else Node e1 a1 r ts1 # ts2)

goal (1 subgoal):
 1. \<And>r e a ts. \<lbrakk>\<And>e a ts. tree_invar (Node e a r ts) \<Longrightarrow> Ball (set ts) tree_invar; tree_invar (Node e a (Suc r) ts)\<rbrakk> \<Longrightarrow> Ball (set ts) tree_invar
[PROOF STEP]
with case1 case2
[PROOF STATE]
proof (chain)
picking this:
queue_invar (Node e2 a2 r ts2 # ts1)
queue_invar (Node e1 a1 r ts1 # ts2)
ts = (if a1 \<le> a2 then Node e2 a2 r ts2 # ts1 else Node e1 a1 r ts1 # ts2)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
queue_invar (Node e2 a2 r ts2 # ts1)
queue_invar (Node e1 a1 r ts1 # ts2)
ts = (if a1 \<le> a2 then Node e2 a2 r ts2 # ts1 else Node e1 a1 r ts1 # ts2)

goal (1 subgoal):
 1. \<forall>a\<in>set ts. tree_invar a
[PROOF STEP]
unfolding queue_invar_def
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>set (Node e2 a2 r ts2 # ts1). tree_invar t
\<forall>t\<in>set (Node e1 a1 r ts1 # ts2). tree_invar t
ts = (if a1 \<le> a2 then Node e2 a2 r ts2 # ts1 else Node e1 a1 r ts1 # ts2)

goal (1 subgoal):
 1. \<forall>a\<in>set ts. tree_invar a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set ts. tree_invar a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iUntil_cong1: "
  \<box> t I. f t = g t \<Longrightarrow>
  (P (f t1) t1. t1 \<U> t2 I. Q t2) = (P (g t1) t1. t1 \<U> t2 I. Q t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box> t I. f t = g t \<Longrightarrow> (P (f t1) t1. t1 \<U> t2 I. Q t2) = (P (g t1) t1. t1 \<U> t2 I. Q t2)
[PROOF STEP]
apply (unfold iUntil_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box> t I. f t = g t \<Longrightarrow> (\<diamond> t I. Q t \<and> (\<box> t' I \<down>< t. P (f t') t')) = (\<diamond> t I. Q t \<and> (\<box> t' I \<down>< t. P (g t') t'))
[PROOF STEP]
apply (rule iEx_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box> t I. f t = g t \<Longrightarrow> \<box> t I. (Q t \<and> (\<box> t' I \<down>< t. P (f t') t')) = (Q t \<and> (\<box> t' I \<down>< t. P (g t') t'))
[PROOF STEP]
apply (rule iallI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>\<box> t I. f t = g t; t \<in> I\<rbrakk> \<Longrightarrow> (Q t \<and> (\<box> t' I \<down>< t. P (f t') t')) = (Q t \<and> (\<box> t' I \<down>< t. P (g t') t'))
[PROOF STEP]
apply (rule_tac f="\<lambda>x. (Q t \<and> x)" in arg_cong, rename_tac t)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>\<box> t I. f t = g t; t \<in> I\<rbrakk> \<Longrightarrow> (\<box> t' I \<down>< t. P (f t') t') = (\<box> t' I \<down>< t. P (g t') t')
[PROOF STEP]
apply (rule iAll_cong[OF iall_subset_imp_iall[OF _ cut_less_subset]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>\<box> t I. f t = g t; t \<in> I\<rbrakk> \<Longrightarrow> \<box> t' I. P (f t') t' = P (g t') t'
[PROOF STEP]
apply (rule iallI, rename_tac t')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t t'. \<lbrakk>\<box> t I. f t = g t; t \<in> I; t' \<in> I\<rbrakk> \<Longrightarrow> P (f t') t' = P (g t') t'
[PROOF STEP]
apply (drule_tac t=t' in ispec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t t'. \<lbrakk>t \<in> I; t' \<in> I\<rbrakk> \<Longrightarrow> t' \<in> I
 2. \<And>t t'. \<lbrakk>t \<in> I; t' \<in> I; f t' = g t'\<rbrakk> \<Longrightarrow> P (f t') t' = P (g t') t'
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Domain_Rel_cases:
  assumes "(x0,x1) \<in> Domain Rel_OR"
  shows "(\<exists> w0. (x0,w0) \<in> Rel0 \<and> x1 \<in> valid_pub1) \<or> (\<exists> w1. (x1,w1) \<in> Rel1 \<and> x0 \<in> valid_pub0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>w0. (x0, w0) \<in> Rel0 \<and> x1 \<in> valid_pub1) \<or> (\<exists>w1. (x1, w1) \<in> Rel1 \<and> x0 \<in> valid_pub0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(x0, x1) \<in> Domain Rel_OR

goal (1 subgoal):
 1. (\<exists>w0. (x0, w0) \<in> Rel0 \<and> x1 \<in> valid_pub1) \<or> (\<exists>w1. (x1, w1) \<in> Rel1 \<and> x0 \<in> valid_pub0)
[PROOF STEP]
by (meson DomainE Rel_OR.cases)


[STATEMENT]
lemma of_hypreal_eq_0_iff [simp]: "\<And>x. (of_hypreal x = 0) = (x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (of_hypreal x = 0) = (x = 0)
[PROOF STEP]
by transfer (rule of_real_eq_0_iff)


[STATEMENT]
lemma FrameStatEqImpCompose:
  fixes F :: "'b frame"
  and   G :: "'b frame"
  and   H :: "'b frame"
  and   I :: "'b frame"

  assumes "F \<simeq>\<^sub>F G"
  and     "G \<hookrightarrow>\<^sub>F H"
  and     "H \<simeq>\<^sub>F I"

  shows "F \<hookrightarrow>\<^sub>F I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<hookrightarrow>\<^sub>F I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
F \<simeq>\<^sub>F G
G \<hookrightarrow>\<^sub>F H
H \<simeq>\<^sub>F I

goal (1 subgoal):
 1. F \<hookrightarrow>\<^sub>F I
[PROOF STEP]
by(auto simp add: FrameStatEq_def) (blast intro: FrameStatImpTrans)


[STATEMENT]
lemma zero_rmod_eq [simp]:
  \<open>0 rmod k = 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 rmod k = 0
[PROOF STEP]
by (simp add: rounded_modulo_def)


[STATEMENT]
lemma isPath_tail2:
  "isPath u (p@[e]) v \<Longrightarrow> (p = [] \<or> (p \<noteq> [] \<and> snd (last p) = fst e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPath u (p @ [e]) v \<Longrightarrow> p = [] \<or> p \<noteq> [] \<and> snd (last p) = fst e
[PROOF STEP]
by (metis Graph.isPath_tail append_butlast_last_id)


[STATEMENT]
lemma lm058:
  "fst = (snd\<circ>flip)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst = snd \<circ> flip
[PROOF STEP]
using lm057
[PROOF STATE]
proof (prove)
using this:
fst ?pair = snd (flip ?pair) \<and> snd ?pair = fst (flip ?pair)

goal (1 subgoal):
 1. fst = snd \<circ> flip
[PROOF STEP]
by fastforce


[STATEMENT]
lemma abs_summable_Re: "f abs_summable_on A \<Longrightarrow> (\<lambda>x. Re (f x)) abs_summable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on A \<Longrightarrow> (\<lambda>x. Re (f x)) abs_summable_on A
[PROOF STEP]
by (simp add: abs_summable_on_def)


[STATEMENT]
lemma in_Reals_norm: "z \<in> \<real> \<Longrightarrow> norm z = \<bar>Re z\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> \<real> \<Longrightarrow> cmod z = \<bar>Re z\<bar>
[PROOF STEP]
by (simp add: complex_is_Real_iff norm_complex_def)


[STATEMENT]
lemma index_Cons[simp]: "index (x#xs) a = (if x=a then 0 else index xs a + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (x # xs) a = (if x = a then 0 else index xs a + 1)
[PROOF STEP]
by(simp add: index_def)


[STATEMENT]
lemma set_integrable_mult_left_iff [simp]:
  fixes a :: "'a::{real_normed_field, second_countable_topology}"
  assumes "a \<noteq> 0"
  shows "set_integrable M A (\<lambda>t. f t * a) \<longleftrightarrow> set_integrable M A f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M A (\<lambda>t. f t * a) = set_integrable M A f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. set_integrable M A (\<lambda>t. f t * a) = set_integrable M A f
[PROOF STEP]
by (subst set_integrable_mult_right_iff [symmetric]) (auto simp: mult.commute)


[STATEMENT]
lemma frequently_prime_cofinite: "frequently (prime :: nat \<Rightarrow> bool) cofinite"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf_many prime
[PROOF STEP]
unfolding INFM_nat_le
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m. \<exists>n\<ge>m. prime n
[PROOF STEP]
by (meson bigger_prime less_imp_le)


[STATEMENT]
lemma dom_glb_eq: "d x \<le> d y \<cdot> d z \<longleftrightarrow> d x \<le> d y \<and> d x \<le> d z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d x \<le> d y \<cdot> d z) = (d x \<le> d y \<and> d x \<le> d z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (d x \<le> d y \<cdot> d z) = (d x \<le> d y \<and> d x \<le> d z)
[PROOF STEP]
have "d x \<le> d z \<longrightarrow> d x \<le> d z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d x \<le> d z \<longrightarrow> d x \<le> d z
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
d x \<le> d z \<longrightarrow> d x \<le> d z

goal (1 subgoal):
 1. (d x \<le> d y \<cdot> d z) = (d x \<le> d y \<and> d x \<le> d z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
d x \<le> d z \<longrightarrow> d x \<le> d z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d x \<le> d z \<longrightarrow> d x \<le> d z

goal (1 subgoal):
 1. (d x \<le> d y \<cdot> d z) = (d x \<le> d y \<and> d x \<le> d z)
[PROOF STEP]
by (metis (no_types) dom_absorp_2 dom_glb dom_subid_aux2 local.dual_order.trans local.join.sup.coboundedI2)
[PROOF STATE]
proof (state)
this:
(d x \<le> d y \<cdot> d z) = (d x \<le> d y \<and> d x \<le> d z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quad_nextVertex_prevVertex:
 "|vertices f| = 4 \<Longrightarrow> a \<in> \<V> f \<Longrightarrow> distinct (vertices f) \<Longrightarrow>
  f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
assume "|vertices f| = 4"
[PROOF STATE]
proof (state)
this:
|vertices f| = 4

goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
|vertices f| = 4
[PROOF STEP]
obtain a1 a2 a3 a4 where "vertices f = [a1, a2, a3, a4]"
[PROOF STATE]
proof (prove)
using this:
|vertices f| = 4

goal (1 subgoal):
 1. (\<And>a1 a2 a3 a4. vertices f = [a1, a2, a3, a4] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest!: length4D)
[PROOF STATE]
proof (state)
this:
vertices f = [a1, a2, a3, a4]

goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vertices f = [a1, a2, a3, a4]

goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
assume "a \<in> \<V> f"
[PROOF STATE]
proof (state)
this:
a \<in> \<V> f

goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a \<in> \<V> f

goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
assume "distinct (vertices f)"
[PROOF STATE]
proof (state)
this:
distinct (vertices f)

goal (1 subgoal):
 1. \<lbrakk>|vertices f| = 4; a \<in> \<V> f; distinct (vertices f)\<rbrakk> \<Longrightarrow> f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vertices f = [a1, a2, a3, a4]
a \<in> \<V> f
distinct (vertices f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vertices f = [a1, a2, a3, a4]
a \<in> \<V> f
distinct (vertices f)

goal (1 subgoal):
 1. f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a
[PROOF STEP]
by (auto) (auto simp add: nextVertex_def prevVertex_def)
[PROOF STATE]
proof (state)
this:
f \<bullet> (f \<bullet> (f \<bullet> a)) = f\<^bsup>-1\<^esup> \<bullet> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma therm_dyn_down_real_arith:
  assumes "a > 0" and Thyps: "0 < Tmin" "Tmin \<le> T" "T \<le> Tmax"
    and thyps: "0 \<le> (\<tau>::real)" "\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> - (ln (Tmin / T) / a) "
  shows "Tmin \<le> exp (-a * \<tau>) * T" and "exp (-a * \<tau>) * T \<le> Tmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T &&& exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
 2. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
have "0 \<le> \<tau> \<and> \<tau> \<le> - (ln (Tmin / T) / a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<tau> \<and> \<tau> \<le> - (ln (Tmin / T) / a)
[PROOF STEP]
using thyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau>
\<forall>\<tau>\<in>{0..\<tau>}. \<tau> \<le> - (ln (Tmin / T) / a)

goal (1 subgoal):
 1. 0 \<le> \<tau> \<and> \<tau> \<le> - (ln (Tmin / T) / a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> \<tau> \<and> \<tau> \<le> - (ln (Tmin / T) / a)

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
 2. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
hence "ln (Tmin / T) \<le> - a * \<tau> \<and> - a * \<tau> \<le> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau> \<and> \<tau> \<le> - (ln (Tmin / T) / a)

goal (1 subgoal):
 1. ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0
[PROOF STEP]
using assms(1) divide_le_cancel
[PROOF STATE]
proof (prove)
using this:
0 \<le> \<tau> \<and> \<tau> \<le> - (ln (Tmin / T) / a)
0 < a
(?a / ?c \<le> ?b / ?c) = (((0::?'a) < ?c \<longrightarrow> ?a \<le> ?b) \<and> (?c < (0::?'a) \<longrightarrow> ?b \<le> ?a))

goal (1 subgoal):
 1. ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
 2. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
 2. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
have "Tmin / T > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Tmin / T
[PROOF STEP]
using Thyps
[PROOF STATE]
proof (prove)
using this:
0 < Tmin
Tmin \<le> T
T \<le> Tmax

goal (1 subgoal):
 1. 0 < Tmin / T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Tmin / T

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
 2. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0
0 < Tmin / T
[PROOF STEP]
have obs: "Tmin / T \<le> exp (-a * \<tau>)" "exp (-a * \<tau>) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0
0 < Tmin / T

goal (1 subgoal):
 1. Tmin / T \<le> exp (- a \<cdot> \<tau>) &&& exp (- a \<cdot> \<tau>) \<le> 1
[PROOF STEP]
using exp_ln exp_le_one_iff
[PROOF STATE]
proof (prove)
using this:
ln (Tmin / T) \<le> - a \<cdot> \<tau> \<and> - a \<cdot> \<tau> \<le> 0
0 < Tmin / T
0 < ?x \<Longrightarrow> exp (ln ?x) = ?x
(exp ?x \<le> 1) = (?x \<le> 0)

goal (1 subgoal):
 1. Tmin / T \<le> exp (- a \<cdot> \<tau>) &&& exp (- a \<cdot> \<tau>) \<le> 1
[PROOF STEP]
by (metis exp_less_cancel_iff not_less, simp)
[PROOF STATE]
proof (state)
this:
Tmin / T \<le> exp (- a \<cdot> \<tau>)
exp (- a \<cdot> \<tau>) \<le> 1

goal (2 subgoals):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
 2. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
thus "Tmin \<le> exp (-a * \<tau>) * T"
[PROOF STATE]
proof (prove)
using this:
Tmin / T \<le> exp (- a \<cdot> \<tau>)
exp (- a \<cdot> \<tau>) \<le> 1

goal (1 subgoal):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
[PROOF STEP]
using Thyps
[PROOF STATE]
proof (prove)
using this:
Tmin / T \<le> exp (- a \<cdot> \<tau>)
exp (- a \<cdot> \<tau>) \<le> 1
0 < Tmin
Tmin \<le> T
T \<le> Tmax

goal (1 subgoal):
 1. Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T
[PROOF STEP]
by (simp add: pos_divide_le_eq)
[PROOF STATE]
proof (state)
this:
Tmin \<le> exp (- a \<cdot> \<tau>) \<cdot> T

goal (1 subgoal):
 1. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
show "exp (-a * \<tau>) * T \<le> Tmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
using Thyps mult_left_le_one_le[OF _ exp_ge_zero obs(2), of T]
      less_eq_real_def order_trans_rules(23)
[PROOF STATE]
proof (prove)
using this:
0 < Tmin
Tmin \<le> T
T \<le> Tmax
0 \<le> T \<Longrightarrow> exp (- a \<cdot> \<tau>) \<cdot> T \<le> T
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
exp (- a \<cdot> \<tau>) \<cdot> T \<le> Tmax

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fcard_gt1_if_mdeg_gt_suc:
  "\<lbrakk>max_deg t2 > n; t1 \<in> fst ` fset (sucs t2); max_deg t1 \<le> n; n\<noteq>0\<rbrakk> \<Longrightarrow> fcard (sucs t2) > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < max_deg t2; t1 \<in> fst ` fset (sucs t2); max_deg t1 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> 1 < fcard (sucs t2)
[PROOF STEP]
using fcard_gt1_if_mdeg_gt_child[of n "root t2" "sucs t2"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n < max_deg (Node (dtree.root t2) (sucs t2)); ?t1.0 \<in> fst ` fset (sucs t2); max_deg ?t1.0 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> 1 < fcard (sucs t2)

goal (1 subgoal):
 1. \<lbrakk>n < max_deg t2; t1 \<in> fst ` fset (sucs t2); max_deg t1 \<le> n; n \<noteq> 0\<rbrakk> \<Longrightarrow> 1 < fcard (sucs t2)
[PROOF STEP]
by simp


[STATEMENT]
lemma minus_permutation_abs_eq:
  "bij f \<Longrightarrow> bij g \<Longrightarrow>
    Abs_permutation f - Abs_permutation g = Abs_permutation (f \<circ> the_inv g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bij f; bij g\<rbrakk> \<Longrightarrow> Abs_permutation f - Abs_permutation g = Abs_permutation (f \<circ> the_inv g)
[PROOF STEP]
by (simp add: minus_permutation.abs_eq eq_onp_same_args)


[STATEMENT]
lemma cong [fundef_cong]:
  assumes "A = B"
  assumes g_h: "\<And>x. x \<in> B \<Longrightarrow> g x = h x"
  shows "F g A = F h B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F g A = F h B
[PROOF STEP]
using g_h
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> B \<Longrightarrow> g ?x1 = h ?x1

goal (1 subgoal):
 1. F g A = F h B
[PROOF STEP]
unfolding \<open>A = B\<close>
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> B \<Longrightarrow> g ?x1 = h ?x1

goal (1 subgoal):
 1. F g B = F h B
[PROOF STEP]
by (induct B rule: infinite_finite_induct) auto


[STATEMENT]
lemma filter_snd_nth:
  "length ys = length xs \<Longrightarrow> n < length (filter p xs) \<Longrightarrow>
    snd (filter (p \<circ> snd) (zip ys xs) ! n) = filter p xs ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length ys = length xs; n < length (filter p xs)\<rbrakk> \<Longrightarrow> snd (filter (p \<circ> snd) (zip ys xs) ! n) = filter p xs ! n
[PROOF STEP]
by (induct ys xs arbitrary: n rule: list_induct2) (auto simp: o_def nth_Cons split: nat.split)


[STATEMENT]
lemma root1 [simp]:
  "root 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FFT.root 1 = 1
[PROOF STEP]
by (simp add: complex_eq_iff root_def)


[STATEMENT]
lemma closedin_subtopology_empty:
   "closedin (subtopology U {}) S \<longleftrightarrow> S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (subtopology U {}) S = (S = {})
[PROOF STEP]
by (metis Int_empty_right closedin_empty closedin_subtopology)


[STATEMENT]
lemma row_rank_def: "rank A = dim (rows A)" for A::"real^'n^'m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = dim (rows A)
[PROOF STEP]
by (auto simp: row_rank_def_gen dim_vec_eq)


[STATEMENT]
lemma app_invimageI[intro]:
  assumes "\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r" and "b \<in>\<^sub>\<circ> A"
  shows "a \<in>\<^sub>\<circ> r -`\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> r -`\<^sub>\<circ> A
[PROOF STEP]
using assms invimage_def
[PROOF STATE]
proof (prove)
using this:
\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r
b \<in>\<^sub>\<circ> A
invimage ?D = VLambda ?D (vsplit (\<lambda>r. (`\<^sub>\<circ>) (r\<inverse>\<^sub>\<circ>)))

goal (1 subgoal):
 1. a \<in>\<^sub>\<circ> r -`\<^sub>\<circ> A
[PROOF STEP]
by auto


[STATEMENT]
lemma cons_cluster_has_ne_slices:
  assumes "is_cons_cluster C" and "p\<in>C"
    and "Sl \<in> slices p"
  shows "Sl \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sl \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_cons_cluster C
p \<in> C
Sl \<in> slices p

goal (1 subgoal):
 1. Sl \<noteq> {}
[PROOF STEP]
unfolding is_cons_cluster_def quorum_of_set_def quorum_of_def quorum_def
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> W \<and> (\<forall>p\<in>C. \<exists>Q\<subseteq>C. (\<forall>p\<in>Q \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q) \<and> (p \<notin> W \<or> (\<exists>Sl\<in>slices p. Sl \<subseteq> Q))) \<and> (\<forall>Q Q'. (\<exists>p\<in>C. (\<forall>p\<in>Q \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q) \<and> (p \<notin> W \<or> (\<exists>Sl\<in>slices p. Sl \<subseteq> Q))) \<and> (\<exists>p\<in>C. (\<forall>p\<in>Q' \<inter> W. \<exists>Sl\<in>slices p. Sl \<subseteq> Q') \<and> (p \<notin> W \<or> (\<exists>Sl\<in>slices p. Sl \<subseteq> Q'))) \<longrightarrow> W \<inter> Q \<inter> Q' \<noteq> {})
p \<in> C
Sl \<in> slices p

goal (1 subgoal):
 1. Sl \<noteq> {}
[PROOF STEP]
by (metis empty_iff inf_bot_left inf_bot_right subset_refl)


[STATEMENT]
lemma word_rbl_mul_induct:
  "length xs \<le> size y \<Longrightarrow>
    rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y)))"
  for y :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y)))
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length [] \<le> size y \<Longrightarrow> rbl_mul [] (rev (to_bl y)) = take (length []) (rev (to_bl (of_bl (rev []) * y)))
 2. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
length [] \<le> size y

goal (2 subgoals):
 1. length [] \<le> size y \<Longrightarrow> rbl_mul [] (rev (to_bl y)) = take (length []) (rev (to_bl (of_bl (rev []) * y)))
 2. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbl_mul [] (rev (to_bl y)) = take (length []) (rev (to_bl (of_bl (rev []) * y)))
[PROOF STEP]
by (simp add: rbl_mul_simps)
[PROOF STATE]
proof (state)
this:
rbl_mul [] (rev (to_bl y)) = take (length []) (rev (to_bl (of_bl (rev []) * y)))

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
case (Cons z zs)
[PROOF STATE]
proof (state)
this:
length zs \<le> size y \<Longrightarrow> rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y)))
length (z # zs) \<le> size y

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
have rbl_word_plus': "to_bl (x + y) = rev (rbl_plus False (rev (to_bl x)) (rev (to_bl y)))"
    for x y :: "'a word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (x + y) = rev (rbl_plus False (rev (to_bl x)) (rev (to_bl y)))
[PROOF STEP]
by (simp add: rbl_word_plus[symmetric])
[PROOF STATE]
proof (state)
this:
to_bl (?x + ?y) = rev (rbl_plus False (rev (to_bl ?x)) (rev (to_bl ?y)))

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
have mult_bit: "to_bl (of_bl [z] * y) = map ((\<and>) z) (to_bl y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (of_bl [z] * y) = map ((\<and>) z) (to_bl y)
[PROOF STEP]
by (cases z) (simp cong: map_cong, simp add: map_replicate_const cong: map_cong)
[PROOF STATE]
proof (state)
this:
to_bl (of_bl [z] * y) = map ((\<and>) z) (to_bl y)

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
have shiftl: "of_bl xs * 2 * y = (of_bl xs * y) << 1" for xs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_bl xs * 2 * y = of_bl xs * y << 1
[PROOF STEP]
by (simp add: push_bit_eq_mult shiftl_def)
[PROOF STATE]
proof (state)
this:
of_bl ?xs * 2 * y = of_bl ?xs * y << 1

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
have zip_take_triv: "\<And>xs ys n. n = length ys \<Longrightarrow> zip (take n xs) ys = zip xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs ys n. n = length ys \<Longrightarrow> zip (take n xs) ys = zip xs ys
[PROOF STEP]
by (rule nth_equalityI) simp_all
[PROOF STATE]
proof (state)
this:
?n = length ?ys \<Longrightarrow> zip (take ?n ?xs) ?ys = zip ?xs ?ys

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>length xs \<le> size y \<Longrightarrow> rbl_mul xs (rev (to_bl y)) = take (length xs) (rev (to_bl (of_bl (rev xs) * y))); length (a # xs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_mul (a # xs) (rev (to_bl y)) = take (length (a # xs)) (rev (to_bl (of_bl (rev (a # xs)) * y)))
[PROOF STEP]
from Cons
[PROOF STATE]
proof (chain)
picking this:
length zs \<le> size y \<Longrightarrow> rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y)))
length (z # zs) \<le> size y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length zs \<le> size y \<Longrightarrow> rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y)))
length (z # zs) \<le> size y

goal (1 subgoal):
 1. rbl_mul (z # zs) (rev (to_bl y)) = take (length (z # zs)) (rev (to_bl (of_bl (rev (z # zs)) * y)))
[PROOF STEP]
apply (simp add: trans [OF of_bl_append add.commute]
        rbl_mul_simps rbl_word_plus' distrib_right mult_bit shiftl rbl_shiftl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y))); Suc (length zs) \<le> size y\<rbrakk> \<Longrightarrow> rbl_plus False (map ((\<and>) z) (rev (to_bl y))) (False # take (length zs) (rev (to_bl (of_bl (rev zs) * y)))) = take (Suc (length zs)) (rbl_plus False (rev (map ((\<and>) z) (to_bl y))) (rev (to_bl (of_bl (rev zs) * y * 2))))
[PROOF STEP]
apply (simp add: takefill_alt word_size rev_map take_rbl_plus min_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y))); Suc (length zs) \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> rbl_plus False (map ((\<and>) z) (rev (to_bl y))) (False # take (length zs) (rev (to_bl (of_bl (rev zs) * y)))) = rbl_plus False (take (Suc (length zs)) (map ((\<and>) z) (rev (to_bl y)))) (take (Suc (length zs)) (rev (to_bl (of_bl (rev zs) * y * 2))))
[PROOF STEP]
apply (simp add: rbl_plus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y))); Suc (length zs) \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (zip (map ((\<and>) z) (rev (to_bl y))) (False # take (length zs) (rev (to_bl (of_bl (rev zs) * y))))) (\<lambda>_. []) False = foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (zip (take (Suc (length zs)) (map ((\<and>) z) (rev (to_bl y)))) (take (Suc (length zs)) (rev (to_bl (of_bl (rev zs) * y * 2))))) (\<lambda>_. []) False
[PROOF STEP]
apply (simp add: zip_take_triv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y))); Suc (length zs) \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (zip (map ((\<and>) z) (rev (to_bl y))) (False # take (length zs) (rev (to_bl (of_bl (rev zs) * y))))) (\<lambda>_. []) False = foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (zip (map ((\<and>) z) (rev (to_bl y))) (take (Suc (length zs)) (rev (to_bl (of_bl (rev zs) * y * 2))))) (\<lambda>_. []) False
[PROOF STEP]
apply (simp only: mult.commute [of _ 2] to_bl_double_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbl_mul zs (rev (to_bl y)) = take (length zs) (rev (to_bl (of_bl (rev zs) * y))); Suc (length zs) \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (zip (map ((\<and>) z) (rev (to_bl y))) (False # take (length zs) (rev (to_bl (of_bl (rev zs) * y))))) (\<lambda>_. []) False = foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (zip (map ((\<and>) z) (rev (to_bl y))) (take (Suc (length zs)) (rev (tl (to_bl (of_bl (rev zs) * y)) @ [False])))) (\<lambda>_. []) False
[PROOF STEP]
apply (simp flip: butlast_rev add: take_butlast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
rbl_mul (z # zs) (rev (to_bl y)) = take (length (z # zs)) (rev (to_bl (of_bl (rev (z # zs)) * y)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_0_on_span:
  assumes f0: "\<And>x. x \<in> b \<Longrightarrow> f x = 0" and x: "x \<in> m1.span b" shows "f x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = (0::'c)
[PROOF STEP]
using m1.span_induct[OF x subspace_kernel] f0
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> b \<Longrightarrow> f x = (0::'c)) \<Longrightarrow> f x = (0::'c)
?x \<in> b \<Longrightarrow> f ?x = (0::'c)

goal (1 subgoal):
 1. f x = (0::'c)
[PROOF STEP]
by simp


[STATEMENT]
lemma length_concat_map: "length [f x r . x \<leftarrow> xs, r \<leftarrow> ys] = length ys * length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (concat (map (\<lambda>x. map (f x) ys) xs)) = length ys * length xs
[PROOF STEP]
by(induct xs arbitrary: ys) auto


[STATEMENT]
lemma disjE3:
  "\<lbrakk> A \<or> B \<or> C ; A \<Longrightarrow> P ; B \<Longrightarrow> P ; C \<Longrightarrow> P \<rbrakk> \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<or> B \<or> C; A \<Longrightarrow> P; B \<Longrightarrow> P; C \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by auto