[STATEMENT]
lemma open_Inter [continuous_intros, intro]: "finite S \<Longrightarrow> \<forall>T\<in>S. open T \<Longrightarrow> open (\<Inter>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; Ball S open\<rbrakk> \<Longrightarrow> open (\<Inter> S)
[PROOF STEP]
by (induction set: finite) auto


[STATEMENT]
lemma tiling_domino_0_1:
  "t \<in> tiling domino ==> card(whites \<inter> t) = card(blacks \<inter> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> tiling domino \<Longrightarrow> card (whites \<inter> t) = card (blacks \<inter> t)
[PROOF STEP]
apply (induct set: tiling)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. card (whites \<inter> {}) = card (blacks \<inter> {})
 2. \<And>a t. \<lbrakk>a \<in> domino; t \<in> tiling domino; card (whites \<inter> t) = card (blacks \<inter> t); a \<inter> t = {}\<rbrakk> \<Longrightarrow> card (whites \<inter> (a \<union> t)) = card (blacks \<inter> (a \<union> t))
[PROOF STEP]
apply (drule_tac [2] domino_singletons)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. card (whites \<inter> {}) = card (blacks \<inter> {})
 2. \<And>a t. \<lbrakk>t \<in> tiling domino; card (whites \<inter> t) = card (blacks \<inter> t); a \<inter> t = {}; (\<exists>i j. whites \<inter> a = {(i, j)}) \<and> (\<exists>m n. blacks \<inter> a = {(m, n)})\<rbrakk> \<Longrightarrow> card (whites \<inter> (a \<union> t)) = card (blacks \<inter> (a \<union> t))
[PROOF STEP]
apply (auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a t i m j n. \<lbrakk>t \<in> tiling domino; card (whites \<inter> t) = card (blacks \<inter> t); a \<inter> t = {}; whites \<inter> a = {(i, j)}; blacks \<inter> a = {(m, n)}\<rbrakk> \<Longrightarrow> card (insert (i, j) (whites \<inter> t)) = card (insert (m, n) (blacks \<inter> t))
[PROOF STEP]
apply (subgoal_tac "\<forall>p C. C \<inter> a = {p} --> p \<notin> t")
  \<comment> \<open>this lemma tells us that both ``inserts'' are non-trivial\<close>
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a t i m j n. \<lbrakk>t \<in> tiling domino; card (whites \<inter> t) = card (blacks \<inter> t); a \<inter> t = {}; whites \<inter> a = {(i, j)}; blacks \<inter> a = {(m, n)}; \<forall>p C. C \<inter> a = {p} \<longrightarrow> p \<notin> t\<rbrakk> \<Longrightarrow> card (insert (i, j) (whites \<inter> t)) = card (insert (m, n) (blacks \<inter> t))
 2. \<And>a t i m j n. \<lbrakk>t \<in> tiling domino; card (whites \<inter> t) = card (blacks \<inter> t); a \<inter> t = {}; whites \<inter> a = {(i, j)}; blacks \<inter> a = {(m, n)}\<rbrakk> \<Longrightarrow> \<forall>p C. C \<inter> a = {p} \<longrightarrow> p \<notin> t
[PROOF STEP]
apply (simp (no_asm_simp))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a t i m j n. \<lbrakk>t \<in> tiling domino; card (whites \<inter> t) = card (blacks \<inter> t); a \<inter> t = {}; whites \<inter> a = {(i, j)}; blacks \<inter> a = {(m, n)}\<rbrakk> \<Longrightarrow> \<forall>p C. C \<inter> a = {p} \<longrightarrow> p \<notin> t
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma measure_range_Some_eq_weight:
  "measure (measure_pmf p) (range Some) = weight_spmf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob p (range Some) = weight_spmf p
[PROOF STEP]
by (simp add: measure_measure_spmf_conv_measure_pmf space_measure_spmf)


[STATEMENT]
lemma compact_X1: "compact X1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact X1
[PROOF STEP]
using bounded_X1 closed_X1
[PROOF STATE]
proof (prove)
using this:
bounded X1
closed X1

goal (1 subgoal):
 1. compact X1
[PROOF STEP]
by (simp add: compact_eq_bounded_closed)


[STATEMENT]
lemma mod_ring_is_cring:
  assumes n_ge_1: "n > 1"
  shows "cring (mod_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
have n_ge_0: "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using n_ge_1
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
interpret cring "ZFact (int n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring (ZFact (int n))
[PROOF STEP]
using ZFact_is_cring
[PROOF STATE]
proof (prove)
using this:
cring (ZFact ?k)

goal (1 subgoal):
 1. cring (ZFact (int n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
have "cring ((mod_ring n) \<lparr> zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub> \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring (mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr>)
[PROOF STEP]
by (rule ring_iso_imp_img_cring[OF zfact_iso_inv_is_ring_iso[OF n_ge_1]])
[PROOF STATE]
proof (state)
this:
cring (mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr>)

goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cring (mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr>)

goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
have
    "(mod_ring n) \<lparr> zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub> \<rparr> = mod_ring n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr> = mod_ring n
[PROOF STEP]
using zfact_iso_inv_0[OF n_ge_0]
[PROOF STATE]
proof (prove)
using this:
zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub> = 0

goal (1 subgoal):
 1. mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr> = mod_ring n
[PROOF STEP]
by (simp add:mod_ring_def)
[PROOF STATE]
proof (state)
this:
mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr> = mod_ring n

goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cring (mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr>)
mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr> = mod_ring n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cring (mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr>)
mod_ring n\<lparr>zero := zfact_iso_inv n \<zero>\<^bsub>ZFact (int n)\<^esub>\<rparr> = mod_ring n

goal (1 subgoal):
 1. cring (mod_ring n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cring (mod_ring n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma val_ineq_cancel_leq':
  assumes "a \<in> nonzero Q\<^sub>p"
  assumes "b \<in> carrier Q\<^sub>p"
  assumes "c \<in> carrier Q\<^sub>p"
  assumes "val b \<le> val c"
  shows "val (a \<otimes> b) \<le> val (a \<otimes> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (a \<otimes> b) \<le> val (a \<otimes> c)
[PROOF STEP]
apply(rule val_ineq_cancel_leq[of "inv a" "a \<otimes> b" "a \<otimes> c"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. inv a \<in> nonzero Q\<^sub>p
 2. a \<otimes> b \<in> carrier Q\<^sub>p
 3. a \<otimes> c \<in> carrier Q\<^sub>p
 4. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
using assms(1) nonzero_inverse_Qp
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
?u \<in> nonzero Q\<^sub>p \<Longrightarrow> inv ?u \<in> nonzero Q\<^sub>p

goal (4 subgoals):
 1. inv a \<in> nonzero Q\<^sub>p
 2. a \<otimes> b \<in> carrier Q\<^sub>p
 3. a \<otimes> c \<in> carrier Q\<^sub>p
 4. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. a \<otimes> b \<in> carrier Q\<^sub>p
 2. a \<otimes> c \<in> carrier Q\<^sub>p
 3. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
using Qp.nonzero_closed assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
a \<in> nonzero Q\<^sub>p
b \<in> carrier Q\<^sub>p

goal (3 subgoals):
 1. a \<otimes> b \<in> carrier Q\<^sub>p
 2. a \<otimes> c \<in> carrier Q\<^sub>p
 3. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<otimes> c \<in> carrier Q\<^sub>p
 2. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
using Qp.nonzero_closed assms assms(2)
[PROOF STATE]
proof (prove)
using this:
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
a \<in> nonzero Q\<^sub>p
b \<in> carrier Q\<^sub>p
c \<in> carrier Q\<^sub>p
val b \<le> val c
b \<in> carrier Q\<^sub>p

goal (2 subgoals):
 1. a \<otimes> c \<in> carrier Q\<^sub>p
 2. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (inv a \<otimes> (a \<otimes> b)) \<le> val (inv a \<otimes> (a \<otimes> c))
[PROOF STEP]
by (metis Qp.inv_cancelR(1) Qp.m_closed Qp.nonzero_closed Units_eq_nonzero assms(1) assms(2) assms(3) assms(4))


[STATEMENT]
lemma (in ACeD) foldD_Un_disjoint:
  "\<lbrakk>finite A; finite B; A Int B = {}; A \<subseteq> D; B \<subseteq> D\<rbrakk> \<Longrightarrow>
    foldD D f e (A Un B) = foldD D f e A \<cdot> foldD D f e B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; A \<inter> B = {}; A \<subseteq> D; B \<subseteq> D\<rbrakk> \<Longrightarrow> foldD D (\<cdot>) e (A \<union> B) = foldD D (\<cdot>) e A \<cdot> foldD D (\<cdot>) e B
[PROOF STEP]
by (simp add: foldD_Un_Int
    left_commute LCD.foldD_closed [OF LCD.intro [of D]])


[STATEMENT]
lemma optim_instrs_not_Nil: "optim_instrs F ret pc \<Sigma>i xs = Some (\<Sigma>o, ys) \<Longrightarrow> xs \<noteq> [] \<longleftrightarrow> ys \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. optim_instrs F ret pc \<Sigma>i xs = Some (\<Sigma>o, ys) \<Longrightarrow> (xs \<noteq> []) = (ys \<noteq> [])
[PROOF STEP]
using optim_instrs_length
[PROOF STATE]
proof (prove)
using this:
optim_instrs ?F ?ret ?pc ?\<Sigma>i ?xs = Some (?\<Sigma>o, ?ys) \<Longrightarrow> length ?xs = length ?ys

goal (1 subgoal):
 1. optim_instrs F ret pc \<Sigma>i xs = Some (\<Sigma>o, ys) \<Longrightarrow> (xs \<noteq> []) = (ys \<noteq> [])
[PROOF STEP]
by fastforce


[STATEMENT]
lemma Invariants_of_foT:
  fixes f::"'a \<Rightarrow> real"
  assumes [measurable]: "integrable M f"
  shows "AE x in M. real_cond_exp M Invariants f x = real_cond_exp M Invariants (f o T) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = real_cond_exp M Invariants (f \<circ> T) x
[PROOF STEP]
using Invariants_of_foTn[OF assms, where ?n = 1]
[PROOF STATE]
proof (prove)
using this:
AE x in M. real_cond_exp M Invariants (f \<circ> T ^^ 1) x = real_cond_exp M Invariants f x

goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = real_cond_exp M Invariants (f \<circ> T) x
[PROOF STEP]
by auto


[STATEMENT]
lemma power_distrib:
  assumes "h \<in> carrier G"
  shows "\<^bold>g [^] (e :: nat) \<otimes> h [^] e = (\<^bold>g \<otimes> h ) [^] e"
(is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
obtain x :: nat where x: "h = \<^bold>g [^] x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. h = \<^bold>g [^] x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms generatorE
[PROOF STATE]
proof (prove)
using this:
h \<in> carrier G
\<lbrakk>?x \<in> carrier G; \<And>n. ?x = \<^bold>g [^] n \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>x. h = \<^bold>g [^] x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h = \<^bold>g [^] x

goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
hence "?lhs = \<^bold>g [^] (e * (1 + x))"
[PROOF STATE]
proof (prove)
using this:
h = \<^bold>g [^] x

goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = \<^bold>g [^] (e * (1 + x))
[PROOF STEP]
by (simp add: nat_pow_mult mult.commute nat_pow_pow)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] e \<otimes> h [^] e = \<^bold>g [^] (e * (1 + x))

goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] e \<otimes> h [^] e = \<^bold>g [^] (e * (1 + x))

goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
have "... = (\<^bold>g [^] (1 + x)) [^] e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] (e * (1 + x)) = (\<^bold>g [^] (1 + x)) [^] e
[PROOF STEP]
by (metis generator_closed mult.commute nat_pow_pow)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] (e * (1 + x)) = (\<^bold>g [^] (1 + x)) [^] e

goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] e \<otimes> h [^] e = \<^bold>g [^] (e * (1 + x))
\<^bold>g [^] (e * (1 + x)) = (\<^bold>g [^] (1 + x)) [^] e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] e \<otimes> h [^] e = \<^bold>g [^] (e * (1 + x))
\<^bold>g [^] (e * (1 + x)) = (\<^bold>g [^] (1 + x)) [^] e

goal (1 subgoal):
 1. \<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e
[PROOF STEP]
by (metis x One_nat_def generator_closed l_one monoid.nat_pow_Suc monoid_axioms nat_pow_0 nat_pow_mult)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] e \<otimes> h [^] e = (\<^bold>g \<otimes> h) [^] e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_graph_iff_finite_dom[simp]: "finite (graph m) = finite (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (graph m) = finite (dom m)
[PROOF STEP]
by (metis graph_eq_to_snd_dom finite_imageI fst_graph_eq_dom)


[STATEMENT]
lemma PosOrd_order:
  shows "class.order (\<lambda>v1 v2. v1 :\<sqsubseteq>val v2) (\<lambda> v1 v2. v1 :\<sqsubset>val v2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.order PosOrd_ex_eq PosOrd_ex
[PROOF STEP]
using PosOrd_ordering
[PROOF STATE]
proof (prove)
using this:
ordering PosOrd_ex_eq PosOrd_ex

goal (1 subgoal):
 1. class.order PosOrd_ex_eq PosOrd_ex
[PROOF STEP]
apply(simp add: class.order_def class.preorder_def class.order_axioms_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordering PosOrd_ex_eq PosOrd_ex \<Longrightarrow> (\<forall>x y. x :\<sqsubset>val y = (x :\<sqsubseteq>val y \<and> \<not> y :\<sqsubseteq>val x)) \<and> (\<forall>x. x :\<sqsubseteq>val x) \<and> (\<forall>x y. x :\<sqsubseteq>val y \<longrightarrow> (\<forall>z. y :\<sqsubseteq>val z \<longrightarrow> x :\<sqsubseteq>val z)) \<and> (\<forall>x y. x :\<sqsubseteq>val y \<longrightarrow> y :\<sqsubseteq>val x \<longrightarrow> x = y)
[PROOF STEP]
by (smt (verit) PosOrd_ex_eq_def PosOrd_irrefl PosOrd_trans)


[STATEMENT]
lemma Plus_idem_assoc: "Plus r (Plus r s) = Plus r s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Plus r (Plus r s) = Plus r s
[PROOF STEP]
by (metis Plus_assoc Plus_idem)


[STATEMENT]
lemma closure_of_openin_Int_closure_of:
  assumes "openin X S"
  shows "X closure_of (S \<inter> X closure_of T) = X closure_of (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X closure_of (S \<inter> X closure_of T) = X closure_of (S \<inter> T)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. X closure_of (S \<inter> X closure_of T) \<subseteq> X closure_of (S \<inter> T)
 2. X closure_of (S \<inter> T) \<subseteq> X closure_of (S \<inter> X closure_of T)
[PROOF STEP]
show "X closure_of (S \<inter> X closure_of T) \<subseteq> X closure_of (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X closure_of (S \<inter> X closure_of T) \<subseteq> X closure_of (S \<inter> T)
[PROOF STEP]
by (simp add: assms closure_of_minimal openin_Int_closure_of_subset)
[PROOF STATE]
proof (state)
this:
X closure_of (S \<inter> X closure_of T) \<subseteq> X closure_of (S \<inter> T)

goal (1 subgoal):
 1. X closure_of (S \<inter> T) \<subseteq> X closure_of (S \<inter> X closure_of T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X closure_of (S \<inter> T) \<subseteq> X closure_of (S \<inter> X closure_of T)
[PROOF STEP]
show "X closure_of (S \<inter> T) \<subseteq> X closure_of (S \<inter> X closure_of T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X closure_of (S \<inter> T) \<subseteq> X closure_of (S \<inter> X closure_of T)
[PROOF STEP]
by (metis Int_lower1 Int_subset_iff assms closedin_closure_of closure_of_minimal_eq closure_of_mono inf_le2 le_infI1 openin_subset)
[PROOF STATE]
proof (state)
this:
X closure_of (S \<inter> T) \<subseteq> X closure_of (S \<inter> X closure_of T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma funcset_mem: "f \<in> A \<rightarrow> B \<Longrightarrow> x \<in> A \<Longrightarrow> f x \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; x \<in> A\<rbrakk> \<Longrightarrow> f x \<in> B
[PROOF STEP]
by (simp add: Pi_def)


[STATEMENT]
lemma signed_take_bit_code [code]:
  \<open>signed_take_bit n a =
  (let l = take_bit (Suc n) a
   in if bit l n then l + push_bit (Suc n) (- 1) else l)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit n a = (let l = take_bit (Suc n) a in if bit l n then l + push_bit (Suc n) (- (1::'a)) else l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. signed_take_bit n a = (let l = take_bit (Suc n) a in if bit l n then l + push_bit (Suc n) (- (1::'a)) else l)
[PROOF STEP]
have *: \<open>take_bit (Suc n) a + push_bit n (- 2) =
    take_bit (Suc n) a OR NOT (mask (Suc n))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (Suc n) a + push_bit n (- (2::'a)) = take_bit (Suc n) a OR NOT (mask (Suc n))
[PROOF STEP]
by (auto simp add: bit_take_bit_iff bit_push_bit_iff bit_not_iff bit_mask_iff disjunctive_add
       simp flip: push_bit_minus_one_eq_not_mask)
[PROOF STATE]
proof (state)
this:
take_bit (Suc n) a + push_bit n (- (2::'a)) = take_bit (Suc n) a OR NOT (mask (Suc n))

goal (1 subgoal):
 1. signed_take_bit n a = (let l = take_bit (Suc n) a in if bit l n then l + push_bit (Suc n) (- (1::'a)) else l)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit n a = (let l = take_bit (Suc n) a in if bit l n then l + push_bit (Suc n) (- (1::'a)) else l)
[PROOF STEP]
by (rule bit_eqI)
      (auto simp add: Let_def * bit_signed_take_bit_iff bit_take_bit_iff min_def less_Suc_eq bit_not_iff
        bit_mask_iff bit_or_iff simp del: push_bit_minus_one_eq_not_mask)
[PROOF STATE]
proof (state)
this:
signed_take_bit n a = (let l = take_bit (Suc n) a in if bit l n then l + push_bit (Suc n) (- (1::'a)) else l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fis_singleton_code [code]: "fis_singleton s = (size s = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fis_singleton s = (size s = 1)
[PROOF STEP]
apply (simp add: fis_singleton_def is_singleton_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. fset s = {x}) = (card (fset s) = Suc 0)
[PROOF STEP]
by (simp add: card_Suc_eq)


[STATEMENT]
lemma homologous_rel_singular_chain:
  "homologous_rel p X S a b \<Longrightarrow> (singular_chain p X a \<longleftrightarrow> singular_chain p X b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homologous_rel p X S a b \<Longrightarrow> singular_chain p X a = singular_chain p X b
[PROOF STEP]
unfolding homologous_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_relboundary p X S (a - b) \<Longrightarrow> singular_chain p X a = singular_chain p X b
[PROOF STEP]
using singular_chain_diff singular_chain_add
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>singular_chain ?p ?X ?a; singular_chain ?p ?X ?b\<rbrakk> \<Longrightarrow> singular_chain ?p ?X (?a - ?b)
\<lbrakk>singular_chain ?p ?X ?a; singular_chain ?p ?X ?b\<rbrakk> \<Longrightarrow> singular_chain ?p ?X (?a + ?b)

goal (1 subgoal):
 1. singular_relboundary p X S (a - b) \<Longrightarrow> singular_chain p X a = singular_chain p X b
[PROOF STEP]
by (fastforce dest: singular_relboundary_imp_chain)


[STATEMENT]
lemma index_less_size: "x \<in> set xs \<Longrightarrow> index xs x < size xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set xs \<Longrightarrow> index xs x < length xs
[PROOF STEP]
by (simp add: index_def find_index_less_size)


[STATEMENT]
lemma indis_trans[trans]: "\<lbrakk>s \<approx> s'; s' \<approx> s''\<rbrakk> \<Longrightarrow> s \<approx> s''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>s \<approx> s'; s' \<approx> s''\<rbrakk> \<Longrightarrow> s \<approx> s''
[PROOF STEP]
using trans_indis
[PROOF STATE]
proof (prove)
using this:
trans indis

goal (1 subgoal):
 1. \<lbrakk>s \<approx> s'; s' \<approx> s''\<rbrakk> \<Longrightarrow> s \<approx> s''
[PROOF STEP]
unfolding trans_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y z. x \<approx> y \<longrightarrow> y \<approx> z \<longrightarrow> x \<approx> z

goal (1 subgoal):
 1. \<lbrakk>s \<approx> s'; s' \<approx> s''\<rbrakk> \<Longrightarrow> s \<approx> s''
[PROOF STEP]
by blast


[STATEMENT]
lemma matrix_equation_main_step_R:
  fixes p:: "real poly"
  fixes qs:: "real poly list"
  fixes I:: "nat list*nat list"
  fixes signs:: "rat list list"
  assumes nonzero: "p\<noteq>0"
  assumes distinct_signs: "distinct signs"
  assumes all_info: "set (characterize_consistent_signs_at_roots p qs) \<subseteq> set(signs)"
  assumes welldefined1: "list_constr (fst I) (length qs)"
  assumes welldefined2: "list_constr (snd I) (length qs)"
  shows "(vec_of_list (mtx_row_R signs I) \<bullet>
          (construct_lhs_vector_R p qs signs)) =
    construct_NofI_R p (retrieve_polys qs (fst I)) (retrieve_polys qs (snd I))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = construct_NofI_R p (retrieve_polys qs (fst I)) (retrieve_polys qs (snd I))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = construct_NofI_R p (retrieve_polys qs (fst I)) (retrieve_polys qs (snd I))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = construct_NofI_R p (retrieve_polys qs (fst I)) (retrieve_polys qs (snd I))
[PROOF STEP]
unfolding construct_NofI_prop_R[OF nonzero]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = rat_of_int (int (card {x. poly p x = 0 \<and> (\<forall>q\<in>set (retrieve_polys qs (fst I)). poly q x = 0) \<and> 0 < poly (prod_list (retrieve_polys qs (snd I))) x}) - int (card {x. poly p x = 0 \<and> (\<forall>q\<in>set (retrieve_polys qs (fst I)). poly q x = 0) \<and> poly (prod_list (retrieve_polys qs (snd I))) x < 0}))
[PROOF STEP]
using matrix_equation_helper_step_R[OF assms]
[PROOF STATE]
proof (prove)
using this:
vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = rat_of_int (int (card {x. poly p x = 0 \<and> (\<forall>p\<in>set (retrieve_polys qs (fst I)). poly p x = 0) \<and> 0 < poly (prod_list (retrieve_polys qs (snd I))) x})) - rat_of_int (int (card {x. poly p x = 0 \<and> (\<forall>p\<in>set (retrieve_polys qs (fst I)). poly p x = 0) \<and> poly (prod_list (retrieve_polys qs (snd I))) x < 0}))

goal (1 subgoal):
 1. vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = rat_of_int (int (card {x. poly p x = 0 \<and> (\<forall>q\<in>set (retrieve_polys qs (fst I)). poly q x = 0) \<and> 0 < poly (prod_list (retrieve_polys qs (snd I))) x}) - int (card {x. poly p x = 0 \<and> (\<forall>q\<in>set (retrieve_polys qs (fst I)). poly q x = 0) \<and> poly (prod_list (retrieve_polys qs (snd I))) x < 0}))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
vec_of_list (mtx_row_R signs I) \<bullet> construct_lhs_vector_R p qs signs = construct_NofI_R p (retrieve_polys qs (fst I)) (retrieve_polys qs (snd I))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inc_of_nat:
"(\<iota> ([(n::nat)]\<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)) = [n]\<cdot>\<^bsub>Q\<^sub>p\<^esub>\<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<iota> ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) = [n] \<cdot> \<one>
[PROOF STEP]
unfolding Q\<^sub>p_def \<iota>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Frac_inc Z\<^sub>p ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) = [n] \<cdot>\<^bsub>Frac Z\<^sub>p\<^esub> \<one>\<^bsub>Frac Z\<^sub>p\<^esub>
[PROOF STEP]
using  frac_inc_of_nat[of n]
[PROOF STATE]
proof (prove)
using this:
Frac_inc Z\<^sub>p ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) = [n] \<cdot>\<^bsub>Frac Z\<^sub>p\<^esub> \<one>\<^bsub>Frac Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. Frac_inc Z\<^sub>p ([n] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) = [n] \<cdot>\<^bsub>Frac Z\<^sub>p\<^esub> \<one>\<^bsub>Frac Z\<^sub>p\<^esub>
[PROOF STEP]
by auto


[STATEMENT]
theorem sum_array_gridI [sep_heap_rules]:
  "< gridI a v * gridI b w > sum_array a b < \<lambda>r. gridI a (sum_vector v w) * gridI b w >"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. <gridI a v * gridI b w> sum_array a b <\<lambda>r. gridI a (sum_vector v w) * gridI b w>
[PROOF STEP]
unfolding gridI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. <(\<exists>\<^sub>Axs. a \<mapsto>\<^sub>a xs * \<up> ((\<forall>p\<in>sparsegrid dm lm. v p = real_of_rat (xs ! pm p)) \<and> length xs = card (sparsegrid dm lm))) * (\<exists>\<^sub>Axs. b \<mapsto>\<^sub>a xs * \<up> ((\<forall>p\<in>sparsegrid dm lm. w p = real_of_rat (xs ! pm p)) \<and> length xs = card (sparsegrid dm lm)))> sum_array a b <\<lambda>r. (\<exists>\<^sub>Axs. a \<mapsto>\<^sub>a xs * \<up> ((\<forall>p\<in>sparsegrid dm lm. sum_vector v w p = real_of_rat (xs ! pm p)) \<and> length xs = card (sparsegrid dm lm))) * (\<exists>\<^sub>Axs. b \<mapsto>\<^sub>a xs * \<up> ((\<forall>p\<in>sparsegrid dm lm. w p = real_of_rat (xs ! pm p)) \<and> length xs = card (sparsegrid dm lm)))>
[PROOF STEP]
by (sep_auto simp: sum_vector_def nth_map linearizationD of_rat_add)


[STATEMENT]
lemma continuous_openin_preimage_eq:
   "continuous_on S f \<longleftrightarrow> (\<forall>T. open T \<longrightarrow> openin (top_of_set S) (S \<inter> f -` T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f = (\<forall>T. open T \<longrightarrow> openin (top_of_set S) (S \<inter> f -` T))
[PROOF STEP]
by (metis Int_commute continuous_on_open_invariant open_openin openin_subtopology)


[STATEMENT]
lemma pairwise_disjoint_path_components_of:
     "pairwise disjnt (path_components_of X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint (path_components_of X)
[PROOF STEP]
by (auto simp: path_components_of_def pairwise_def path_component_of_disjoint path_component_of_equiv)


[STATEMENT]
lemma bigo_const4: "(c::'a::linordered_field) \<noteq> 0 \<Longrightarrow> O(\<lambda>x. 1) \<subseteq> O(\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> O(\<lambda>x. 1::'a) \<subseteq> O(\<lambda>x. c)
[PROOF STEP]
by (metis bigo_elt_subset bigo_const3)


[STATEMENT]
theorem wls_single_non_freshAbs_ordLess_var:
"wlsAbs (us,s) A \<Longrightarrow> |{x. \<not> freshAbs xs x A}| <o |UNIV :: 'var set|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wlsAbs (us, s) A \<Longrightarrow> |{x. \<not> freshAbs xs x A}| <o |UNIV|
[PROOF STEP]
by(simp add: single_non_freshAbs_ordLess_var)


[STATEMENT]
lemma repeat_mset_prod: "repeat_mset (m * n) A = (((+) (repeat_mset n A)) ^^ m) {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_mset (m * n) A = ((+) (repeat_mset n A) ^^ m) {#}
[PROOF STEP]
by (induction m) (auto simp: repeat_mset_distrib)


[STATEMENT]
lemma length_drop [simp]: "length (drop n xs) = (length xs - n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (drop n xs) = length xs - n
[PROOF STEP]
by (induct n arbitrary: xs) (auto, case_tac xs, auto)


[STATEMENT]
lemma inner_Basis_INF_left: "i \<in> Basis \<Longrightarrow> (INF x\<in>X. f x) \<bullet> i = (INF x\<in>X. f x \<bullet> i)"
  and inner_Basis_SUP_left: "i \<in> Basis \<Longrightarrow> (SUP x\<in>X. f x) \<bullet> i = (SUP x\<in>X. f x \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> Basis \<Longrightarrow> Inf (f ` X) \<bullet> i = (INF x\<in>X. f x \<bullet> i)) &&& (i \<in> Basis \<Longrightarrow> Sup (f ` X) \<bullet> i = (SUP x\<in>X. f x \<bullet> i))
[PROOF STEP]
using eucl_Sup [of "f ` X"] eucl_Inf [of "f ` X"]
[PROOF STATE]
proof (prove)
using this:
Sup (f ` X) = (\<Sum>i\<in>Basis. (SUP x\<in>f ` X. x \<bullet> i) *\<^sub>R i)
Inf (f ` X) = (\<Sum>i\<in>Basis. (INF x\<in>f ` X. x \<bullet> i) *\<^sub>R i)

goal (1 subgoal):
 1. (i \<in> Basis \<Longrightarrow> Inf (f ` X) \<bullet> i = (INF x\<in>X. f x \<bullet> i)) &&& (i \<in> Basis \<Longrightarrow> Sup (f ` X) \<bullet> i = (SUP x\<in>X. f x \<bullet> i))
[PROOF STEP]
by (simp_all add: image_comp)


[STATEMENT]
lemma row_length_vect_mat:
 "row_length (vec_mat_Tensor v m)  = length v*(row_length m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_length (vec_mat_Tensor v m) = length v * row_length m
[PROOF STEP]
proof(induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
 2. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
 2. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
have "row_length [] = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_length [] = 0
[PROOF STEP]
using row_length_Nil
[PROOF STATE]
proof (prove)
using this:
row_length [] = 0

goal (1 subgoal):
 1. row_length [] = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row_length [] = 0

goal (2 subgoals):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
 2. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
row_length [] = 0

goal (2 subgoals):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
 2. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
have "vec_mat_Tensor v [] = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_mat_Tensor v [] = []
[PROOF STEP]
using vec_mat_Tensor.simps(1)
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor ?xs [] = []

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

goal (2 subgoals):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
 2. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
row_length [] = 0
vec_mat_Tensor v [] = []
[PROOF STEP]
have
   "row_length (vec_mat_Tensor v [])  = length v*(row_length [])"
[PROOF STATE]
proof (prove)
using this:
row_length [] = 0
vec_mat_Tensor v [] = []

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
[PROOF STEP]
using mult_0_right
[PROOF STATE]
proof (prove)
using this:
row_length [] = 0
vec_mat_Tensor v [] = []
?m * 0 = 0

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
[PROOF STEP]
by (metis )
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v []) = length v * row_length []

goal (2 subgoals):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
 2. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
row_length (vec_mat_Tensor v []) = length v * row_length []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
row_length (vec_mat_Tensor v []) = length v * row_length []

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v []) = length v * row_length []
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v []) = length v * row_length []

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
fix a m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
assume A:"row_length (vec_mat_Tensor v m) = length v * row_length m"
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v m) = length v * row_length m

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
let ?case =
         "row_length (vec_mat_Tensor v (a#m)) = (length v)*(row_length (a#m))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
have A:"row_length (a # m) = length a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_length (a # m) = length a
[PROOF STEP]
using row_length_def   list.distinct(1)
[PROOF STATE]
proof (prove)
using this:
row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)
[] \<noteq> ?x21.0 # ?x22.0

goal (1 subgoal):
 1. row_length (a # m) = length a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length (a # m) = length a

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
have "(vec_mat_Tensor v  (a#m)) = (vec_vec_Tensor v a)#(vec_mat_Tensor v m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_mat_Tensor v (a # m) = vec_vec_Tensor v a # vec_mat_Tensor v m
[PROOF STEP]
using vec_mat_Tensor_def vec_mat_Tensor.simps(2)
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor \<equiv> \<lambda>uu uua. rec_list (\<lambda>xs. []) (\<lambda>ys yss yssa xs. vec_vec_Tensor xs ys # yssa xs) uua uu
vec_mat_Tensor ?xs (?ys # ?yss) = vec_vec_Tensor ?xs ?ys # vec_mat_Tensor ?xs ?yss

goal (1 subgoal):
 1. vec_mat_Tensor v (a # m) = vec_vec_Tensor v a # vec_mat_Tensor v m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_mat_Tensor v (a # m) = vec_vec_Tensor v a # vec_mat_Tensor v m

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
vec_mat_Tensor v (a # m) = vec_vec_Tensor v a # vec_mat_Tensor v m
[PROOF STEP]
have
       "row_length (vec_mat_Tensor v (a#m)) = length (vec_vec_Tensor v a)"
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor v (a # m) = vec_vec_Tensor v a # vec_mat_Tensor v m

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v (a # m)) = length (vec_vec_Tensor v a)
[PROOF STEP]
using row_length_def   list.distinct(1)  vec_mat_Tensor.simps(2)
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor v (a # m) = vec_vec_Tensor v a # vec_mat_Tensor v m
row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)
[] \<noteq> ?x21.0 # ?x22.0
vec_mat_Tensor ?xs (?ys # ?yss) = vec_vec_Tensor ?xs ?ys # vec_mat_Tensor ?xs ?yss

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v (a # m)) = length (vec_vec_Tensor v a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v (a # m)) = length (vec_vec_Tensor v a)

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
from this and vec_vec_Tensor_length
[PROOF STATE]
proof (chain)
picking this:
row_length (vec_mat_Tensor v (a # m)) = length (vec_vec_Tensor v a)
length (vec_vec_Tensor ?x ?y) = length ?x * length ?y
[PROOF STEP]
have
          "row_length (vec_mat_Tensor v (a#m)) = (length v)*(length a)"
[PROOF STATE]
proof (prove)
using this:
row_length (vec_mat_Tensor v (a # m)) = length (vec_vec_Tensor v a)
length (vec_vec_Tensor ?x ?y) = length ?x * length ?y

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v (a # m)) = length v * length a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v (a # m)) = length v * length a

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
from this and A
[PROOF STATE]
proof (chain)
picking this:
row_length (vec_mat_Tensor v (a # m)) = length v * length a
row_length (a # m) = length a
[PROOF STEP]
have
         "row_length (vec_mat_Tensor v (a#m)) = (length v)*(row_length (a#m))"
[PROOF STATE]
proof (prove)
using this:
row_length (vec_mat_Tensor v (a # m)) = length v * length a
row_length (a # m) = length a

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)

goal (1 subgoal):
 1. \<And>a m. row_length (vec_mat_Tensor v m) = length v * row_length m \<Longrightarrow> row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)

goal (1 subgoal):
 1. row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length (vec_mat_Tensor v (a # m)) = length v * row_length (a # m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sets_completionE:
  assumes "A \<in> sets (completion M)"
  obtains S N N' where "A = S \<union> N" "N \<subseteq> N'" "N' \<in> null_sets M" "S \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S N N'. \<lbrakk>A = S \<union> N; N \<subseteq> N'; N' \<in> null_sets M; S \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (completion M)

goal (1 subgoal):
 1. (\<And>S N N'. \<lbrakk>A = S \<union> N; N \<subseteq> N'; N' \<in> null_sets M; S \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding sets_completion
[PROOF STATE]
proof (prove)
using this:
A \<in> {uu_. \<exists>S N N'. uu_ = S \<union> N \<and> S \<in> sets M \<and> N' \<in> null_sets M \<and> N \<subseteq> N'}

goal (1 subgoal):
 1. (\<And>S N N'. \<lbrakk>A = S \<union> N; N \<subseteq> N'; N' \<in> null_sets M; S \<in> sets M\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma neq_left_right_of: "ccw' a b c \<Longrightarrow> ccw' a c d \<Longrightarrow> b \<noteq> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ccw' a b c; ccw' a c d\<rbrakk> \<Longrightarrow> b \<noteq> d
[PROOF STEP]
by (auto simp: ccw'_def det3_def' algebra_simps)


[STATEMENT]
lemma eq_dff_trans[trans]: "x =dff y \<Longrightarrow> y =dff z \<Longrightarrow> x =dff z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x =dff y; y =dff z\<rbrakk> \<Longrightarrow> x =dff z
[PROOF STEP]
unfolding eq_dff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>divides_ff x y \<and> divides_ff y x; divides_ff y z \<and> divides_ff z y\<rbrakk> \<Longrightarrow> divides_ff x z \<and> divides_ff z x
[PROOF STEP]
using divides_ff_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>divides_ff ?x ?y; divides_ff ?y ?z\<rbrakk> \<Longrightarrow> divides_ff ?x ?z

goal (1 subgoal):
 1. \<lbrakk>divides_ff x y \<and> divides_ff y x; divides_ff y z \<and> divides_ff z y\<rbrakk> \<Longrightarrow> divides_ff x z \<and> divides_ff z x
[PROOF STEP]
by auto


[STATEMENT]
lemma MM_Rel_MV_Rel_row: "MM_Rel A B \<Longrightarrow> i < dim_row A \<Longrightarrow> MV_Rel (row A i) (row B i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>MM_Rel A B; i < dim_row A\<rbrakk> \<Longrightarrow> MV_Rel (row A i) (row B i)
[PROOF STEP]
unfolding MM_Rel_def MV_Rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.mat_mod A = to_int_mat B; i < dim_row A\<rbrakk> \<Longrightarrow> vec_mod (row A i) = to_int_vec (row B i)
[PROOF STEP]
by (metis index_map_mat(2) mat_mod_dim(1) mat_mod_vec_mod_row row_map_mat)


[STATEMENT]
lemma dual_dual_ord: "(\<partial> x \<le> \<partial> y) = (y \<le> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<partial> x \<le> \<partial> y) = (y \<le> x)
[PROOF STEP]
by (metis dual_iff ord_dual)


[STATEMENT]
lemma powreal_surj2:
    "\<lbrakk> 0 < a; a < 1; x > 0 \<rbrakk> \<Longrightarrow> \<exists>y. a pow\<^sub>\<real> y = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a < 1; 0 < x\<rbrakk> \<Longrightarrow> \<exists>y. a pow\<^sub>\<real> y = x
[PROOF STEP]
using powreal_minus_base_ge_one powreal_surj real_inverse_gt_one_lemma
[PROOF STATE]
proof (prove)
using this:
?a pow\<^sub>\<real> - ?x = inverse ?a pow\<^sub>\<real> ?x
\<lbrakk>1 < ?a; 0 < ?x\<rbrakk> \<Longrightarrow> \<exists>y. ?a pow\<^sub>\<real> y = ?x
\<lbrakk>0 < ?a; ?a < 1\<rbrakk> \<Longrightarrow> 1 < inverse ?a

goal (1 subgoal):
 1. \<lbrakk>0 < a; a < 1; 0 < x\<rbrakk> \<Longrightarrow> \<exists>y. a pow\<^sub>\<real> y = x
[PROOF STEP]
by blast


[STATEMENT]
lemma bindK_assoc:
  "bindK\<cdot>(bindK\<cdot>f\<cdot>g)\<cdot>h = bindK\<cdot>f\<cdot>(\<Lambda> v. bindK\<cdot>(g\<cdot>v)\<cdot>h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bindK\<cdot>(bindK\<cdot>f\<cdot>g)\<cdot>h = bindK\<cdot>f\<cdot>(\<Lambda> v. bindK\<cdot>(g\<cdot>v)\<cdot>h)
[PROOF STEP]
unfolding bindK_def unitK_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Lambda> m k c. m\<cdot>(\<Lambda> a. k\<cdot>a\<cdot>c))\<cdot>((\<Lambda> m k c. m\<cdot>(\<Lambda> a. k\<cdot>a\<cdot>c))\<cdot>f\<cdot>g)\<cdot>h = (\<Lambda> m k c. m\<cdot>(\<Lambda> a. k\<cdot>a\<cdot>c))\<cdot>f\<cdot>(\<Lambda> v. (\<Lambda> m k c. m\<cdot>(\<Lambda> a. k\<cdot>a\<cdot>c))\<cdot>(g\<cdot>v)\<cdot>h)
[PROOF STEP]
by simp


[STATEMENT]
lemma pconj_assoc:
  "\<lbrakk> 0 \<le> a; a \<le> 1; 0 \<le> b; b \<le> 1; 0 \<le> c; c \<le> 1 \<rbrakk> \<Longrightarrow>
   a .& (b .& c) = (a .& b) .& c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; a \<le> 1; 0 \<le> b; b \<le> 1; 0 \<le> c; c \<le> 1\<rbrakk> \<Longrightarrow> a .& (b .& c) = a .& b .& c
[PROOF STEP]
unfolding pconj_def tminus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; a \<le> 1; 0 \<le> b; b \<le> 1; 0 \<le> c; c \<le> 1\<rbrakk> \<Longrightarrow> max (a + max (b + c - 1) 0 - 1) 0 = max (max (a + b - 1) 0 + c - 1) 0
[PROOF STEP]
by(simp)


[STATEMENT]
lemma small_finite_categories_vsubset_Vset:
  "set {\<CC>. finite_category \<alpha> \<CC>} \<subseteq>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZFC_in_HOL.set {\<CC>. finite_category \<alpha> \<CC>} \<subseteq>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
by (rule vsubsetI) (simp_all add: finite_category.fin_cat_in_Vset)


[STATEMENT]
theorem th_rec: "\<lbrakk> g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; (\<forall> x y. \<alpha> y x \<le> y); (\<forall> x. (f 0 x) = (g x)); (\<forall> x y. (f (Suc y) x) = h y (f (\<alpha> y x) x) x) \<rbrakk> \<Longrightarrow> f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume g_is_pr: "g \<in> PrimRec1"
[PROOF STATE]
proof (state)
this:
g \<in> PrimRec1

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume a_is_pr: "\<alpha> \<in> PrimRec2"
[PROOF STATE]
proof (state)
this:
\<alpha> \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume h_is_pr: "h \<in> PrimRec3"
[PROOF STATE]
proof (state)
this:
h \<in> PrimRec3

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume a_le: "(\<forall> x y. \<alpha> y x \<le> y)"
[PROOF STATE]
proof (state)
this:
\<forall>x y. \<alpha> y x \<le> y

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume f_0: "\<forall> x. f 0 x = g x"
[PROOF STATE]
proof (state)
this:
\<forall>x. f 0 x = g x

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
assume f_1: "\<forall> x y. (f (Suc y) x) = h y (f (\<alpha> y x) x) x"
[PROOF STATE]
proof (state)
this:
\<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
let ?g' = "\<lambda> x. c_cons (g x) 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
let ?h' = "\<lambda> a b c. c_cons (h a (c_nth b (a - (\<alpha> a c))) c) b"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
let ?r = "c_f_list f"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
from g_is_pr c_cons_is_pr
[PROOF STATE]
proof (chain)
picking this:
g \<in> PrimRec1
c_cons \<in> PrimRec2
[PROOF STEP]
have g'_is_pr: "?g' \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
g \<in> PrimRec1
c_cons \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>x. c_cons (g x) 0) \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c_cons (g x) 0) \<in> PrimRec1

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
from h_is_pr c_cons_is_pr c_nth_is_pr a_is_pr
[PROOF STATE]
proof (chain)
picking this:
h \<in> PrimRec3
c_cons \<in> PrimRec2
c_nth \<in> PrimRec2
\<alpha> \<in> PrimRec2
[PROOF STEP]
have h'_is_pr: "?h' \<in> PrimRec3"
[PROOF STATE]
proof (prove)
using this:
h \<in> PrimRec3
c_cons \<in> PrimRec2
c_nth \<in> PrimRec2
\<alpha> \<in> PrimRec2

goal (1 subgoal):
 1. (\<lambda>a b c. c_cons (h a (c_nth b (a - \<alpha> a c)) c) b) \<in> PrimRec3
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>a b c. c_cons (h a (c_nth b (a - \<alpha> a c)) c) b) \<in> PrimRec3

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
have S1: "\<forall> x. ?r 0 x = ?g' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
have "?r 0 x = c_cons (f 0 x) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_f_list f 0 x = c_cons (f 0 x) 0
[PROOF STEP]
by (rule c_f_list_at_0)
[PROOF STATE]
proof (state)
this:
c_f_list f 0 x = c_cons (f 0 x) 0

goal (1 subgoal):
 1. \<And>x. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
with f_0
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. f 0 x = g x
c_f_list f 0 x = c_cons (f 0 x) 0
[PROOF STEP]
have "?r 0 x = c_cons (g x) 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. f 0 x = g x
c_f_list f 0 x = c_cons (f 0 x) 0

goal (1 subgoal):
 1. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_f_list f 0 x = c_cons (g x) 0

goal (1 subgoal):
 1. \<And>x. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
show "?r 0 x = ?g' x"
[PROOF STATE]
proof (prove)
using this:
c_f_list f 0 x = c_cons (g x) 0

goal (1 subgoal):
 1. c_f_list f 0 x = c_cons (g x) 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_f_list f 0 x = c_cons (g x) 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x. c_f_list f 0 x = c_cons (g x) 0

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
have S2: "\<forall> x y. ?r (Suc y) x = ?h' y (?r y x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
proof (rule allI, rule allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
show "?r (Suc y) x = ?h' y (?r y x) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
have S2_1: "?r (Suc y) x = c_cons (f (Suc y) x) (?r y x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (f (Suc y) x) (c_f_list f y x)
[PROOF STEP]
by (rule c_f_list_at_Suc)
[PROOF STATE]
proof (state)
this:
c_f_list f (Suc y) x = c_cons (f (Suc y) x) (c_f_list f y x)

goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
with f_1
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x
c_f_list f (Suc y) x = c_cons (f (Suc y) x) (c_f_list f y x)
[PROOF STEP]
have S2_2: "f (Suc y) x = h y (f (\<alpha> y x) x) x"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x
c_f_list f (Suc y) x = c_cons (f (Suc y) x) (c_f_list f y x)

goal (1 subgoal):
 1. f (Suc y) x = h y (f (\<alpha> y x) x) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f (Suc y) x = h y (f (\<alpha> y x) x) x

goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
from a_le
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. \<alpha> y x \<le> y
[PROOF STEP]
have S2_3: "\<alpha> y x \<le> y"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. \<alpha> y x \<le> y

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

goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> y x \<le> y
[PROOF STEP]
have S2_4: "f (\<alpha> y x) x = c_nth (?r y x) (y-(\<alpha> y x))"
[PROOF STATE]
proof (prove)
using this:
\<alpha> y x \<le> y

goal (1 subgoal):
 1. f (\<alpha> y x) x = c_nth (c_f_list f y x) (y - \<alpha> y x)
[PROOF STEP]
by (simp add: c_f_list_nth)
[PROOF STATE]
proof (state)
this:
f (\<alpha> y x) x = c_nth (c_f_list f y x) (y - \<alpha> y x)

goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
from S2_1 S2_2 S2_4
[PROOF STATE]
proof (chain)
picking this:
c_f_list f (Suc y) x = c_cons (f (Suc y) x) (c_f_list f y x)
f (Suc y) x = h y (f (\<alpha> y x) x) x
f (\<alpha> y x) x = c_nth (c_f_list f y x) (y - \<alpha> y x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_f_list f (Suc y) x = c_cons (f (Suc y) x) (c_f_list f y x)
f (Suc y) x = h y (f (\<alpha> y x) x) x
f (\<alpha> y x) x = c_nth (c_f_list f y x) (y - \<alpha> y x)

goal (1 subgoal):
 1. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x y. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
from g'_is_pr h'_is_pr S1 S2
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. c_cons (g x) 0) \<in> PrimRec1
(\<lambda>a b c. c_cons (h a (c_nth b (a - \<alpha> a c)) c) b) \<in> PrimRec3
\<forall>x. c_f_list f 0 x = c_cons (g x) 0
\<forall>x y. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)
[PROOF STEP]
have S3: "?r \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. c_cons (g x) 0) \<in> PrimRec1
(\<lambda>a b c. c_cons (h a (c_nth b (a - \<alpha> a c)) c) b) \<in> PrimRec3
\<forall>x. c_f_list f 0 x = c_cons (g x) 0
\<forall>x y. c_f_list f (Suc y) x = c_cons (h y (c_nth (c_f_list f y x) (y - \<alpha> y x)) x) (c_f_list f y x)

goal (1 subgoal):
 1. c_f_list f \<in> PrimRec2
[PROOF STEP]
by (rule th_pr_rec)
[PROOF STATE]
proof (state)
this:
c_f_list f \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>g \<in> PrimRec1; \<alpha> \<in> PrimRec2; h \<in> PrimRec3; \<forall>x y. \<alpha> y x \<le> y; \<forall>x. f 0 x = g x; \<forall>x y. f (Suc y) x = h y (f (\<alpha> y x) x) x\<rbrakk> \<Longrightarrow> f \<in> PrimRec2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c_f_list f \<in> PrimRec2
[PROOF STEP]
show "f \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
c_f_list f \<in> PrimRec2

goal (1 subgoal):
 1. f \<in> PrimRec2
[PROOF STEP]
by (rule c_f_list_f_is_pr)
[PROOF STATE]
proof (state)
this:
f \<in> PrimRec2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integer_of_char_code [code]:
  "integer_of_char (Char b0 b1 b2 b3 b4 b5 b6 b7) =
    ((((((of_bool b7 * 2 + of_bool b6) * 2 +
      of_bool b5) * 2 + of_bool b4) * 2 +
        of_bool b3) * 2 + of_bool b2) * 2 +
          of_bool b1) * 2 + of_bool b0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_char (Char b0 b1 b2 b3 b4 b5 b6 b7) = ((((((of_bool b7 * 2 + of_bool b6) * 2 + of_bool b5) * 2 + of_bool b4) * 2 + of_bool b3) * 2 + of_bool b2) * 2 + of_bool b1) * 2 + of_bool b0
[PROOF STEP]
by (simp add: integer_of_char_def of_char_def)


[STATEMENT]
theorem Seq_ZObisT_ZObis[simp]:
assumes "c1 \<approx>01T d1" and "c2 \<approx>01 d2"
shows "c1 ;; c2 \<approx>01 d1 ;; d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 ;; c2 \<approx>01 d1 ;; d2
[PROOF STEP]
using assms thetaSeqZO_ZObis
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>01T d1
c2 \<approx>01 d2
thetaSeqZO \<subseteq> ZObis

goal (1 subgoal):
 1. c1 ;; c2 \<approx>01 d1 ;; d2
[PROOF STEP]
unfolding thetaSeqZO_def
[PROOF STATE]
proof (prove)
using this:
c1 \<approx>01T d1
c2 \<approx>01 d2
{(c1 ;; c2, d1 ;; d2) |c1 c2 d1 d2. c1 \<approx>01T d1 \<and> c2 \<approx>01 d2} \<subseteq> ZObis

goal (1 subgoal):
 1. c1 ;; c2 \<approx>01 d1 ;; d2
[PROOF STEP]
by blast


[STATEMENT]
lemma repeat_zmset_distrib2[simp]:
  "repeat_zmset n (A + B) = repeat_zmset n A + repeat_zmset n B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. repeat_zmset n (A + B) = repeat_zmset n A + repeat_zmset n B
[PROOF STEP]
by (auto simp: zmultiset_eq_iff add_mult_distrib2 int_distrib(2))


[STATEMENT]
lemma fmrel_on_fset_updateI:
  assumes "fmrel_on_fset S P m n" "P v\<^sub>1 v\<^sub>2"
  shows "fmrel_on_fset (finsert k S) P (fmupd k v\<^sub>1 m) (fmupd k v\<^sub>2 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrel_on_fset (finsert k S) P (fmupd k v\<^sub>1 m) (fmupd k v\<^sub>2 n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fmrel_on_fset S P m n
P v\<^sub>1 v\<^sub>2

goal (1 subgoal):
 1. fmrel_on_fset (finsert k S) P (fmupd k v\<^sub>1 m) (fmupd k v\<^sub>2 n)
[PROOF STEP]
unfolding fmrel_on_fset_alt_def
[PROOF STATE]
proof (prove)
using this:
fBall S (\<lambda>x. rel_option P (fmlookup m x) (fmlookup n x))
P v\<^sub>1 v\<^sub>2

goal (1 subgoal):
 1. fBall (finsert k S) (\<lambda>x. rel_option P (fmlookup (fmupd k v\<^sub>1 m) x) (fmlookup (fmupd k v\<^sub>2 n) x))
[PROOF STEP]
by auto


[STATEMENT]
lemma step_size_ok_1: "\<lbrakk>
    invar (States dir big small);
    step (States dir big small) = States dir' big' small';
    size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small
\<rbrakk> \<Longrightarrow> size_new big' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new small'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir big small) = States dir' big' small'; size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small\<rbrakk> \<Longrightarrow> size_new big' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new small'
[PROOF STEP]
using step_size_new_small step_size_new_big remaining_steps_decline
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>invar (States ?dir ?big ?small); step (States ?dir ?big ?small) = States ?dir' ?big' ?small'\<rbrakk> \<Longrightarrow> size_new ?small' = size_new ?small
\<lbrakk>invar (States ?dir ?big ?small); step (States ?dir ?big ?small) = States ?dir' ?big' ?small'\<rbrakk> \<Longrightarrow> size_new ?big' = size_new ?big
invar ?states \<Longrightarrow> remaining_steps (step ?states) \<le> remaining_steps ?states

goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir big small) = States dir' big' small'; size_new big + remaining_steps (States dir big small) + 2 \<le> 3 * size_new small\<rbrakk> \<Longrightarrow> size_new big' + remaining_steps (States dir' big' small') + 2 \<le> 3 * size_new small'
[PROOF STEP]
by (smt (verit, ccfv_SIG) add.commute le_trans nat_add_left_cancel_le)


[STATEMENT]
lemma content_split:
  fixes a :: "'a::euclidean_space"
  assumes "k \<in> Basis"
  shows "content (cbox a b) = content(cbox a b \<inter> {x. x\<bullet>k \<le> c}) + content(cbox a b \<inter> {x. x\<bullet>k \<ge> c})"
  \<comment> \<open>Prove using measure theory\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
proof (cases "\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
have 1: "\<And>X Y Z. (\<Prod>i\<in>Basis. Z i (if i = k then X else Y i)) = Z k X * (\<Prod>i\<in>Basis-{k}. Z i (Y i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X Y Z. (\<Prod>i\<in>Basis. Z i (if i = k then X else Y i)) = Z k X * (\<Prod>i\<in>Basis - {k}. Z i (Y i))
[PROOF STEP]
by (simp add: if_distrib prod.delta_remove assms)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>Basis. ?Z i (if i = k then ?X else ?Y i)) = ?Z k ?X * (\<Prod>i\<in>Basis - {k}. ?Z i (?Y i))

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
note simps = interval_split[OF assms] content_cbox_cases
[PROOF STATE]
proof (state)
this:
cbox ?a ?b \<inter> {x. x \<bullet> k \<le> ?c} = cbox ?a (\<Sum>i\<in>Basis. (if i = k then min (?b \<bullet> k) ?c else ?b \<bullet> i) *\<^sub>R i)
cbox ?a ?b \<inter> {x. ?c \<le> x \<bullet> k} = cbox (\<Sum>i\<in>Basis. (if i = k then max (?a \<bullet> k) ?c else ?a \<bullet> i) *\<^sub>R i) ?b
content (cbox ?a ?b) = (if \<forall>i\<in>Basis. ?a \<bullet> i \<le> ?b \<bullet> i then \<Prod>i\<in>Basis. ?b \<bullet> i - ?a \<bullet> i else 0)

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
have 2: "(\<Prod>i\<in>Basis. b\<bullet>i - a\<bullet>i) = (\<Prod>i\<in>Basis-{k}. b\<bullet>i - a\<bullet>i) * (b\<bullet>k - a\<bullet>k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i) = (\<Prod>i\<in>Basis - {k}. b \<bullet> i - a \<bullet> i) * (b \<bullet> k - a \<bullet> k)
[PROOF STEP]
by (metis (no_types, lifting) assms finite_Basis mult.commute prod.remove)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i) = (\<Prod>i\<in>Basis - {k}. b \<bullet> i - a \<bullet> i) * (b \<bullet> k - a \<bullet> k)

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
have "\<And>x. min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow>
    x * (b\<bullet>k - a\<bullet>k) = x * (max (a \<bullet> k) c - a \<bullet> k) + x * (b \<bullet> k - max (a \<bullet> k) c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> x * (b \<bullet> k - a \<bullet> k) = x * (max (a \<bullet> k) c - a \<bullet> k) + x * (b \<bullet> k - max (a \<bullet> k) c)
[PROOF STEP]
by  (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> ?x1 * (b \<bullet> k - a \<bullet> k) = ?x1 * (max (a \<bullet> k) c - a \<bullet> k) + ?x1 * (b \<bullet> k - max (a \<bullet> k) c)

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> ?x1 * (b \<bullet> k - a \<bullet> k) = ?x1 * (max (a \<bullet> k) c - a \<bullet> k) + ?x1 * (b \<bullet> k - max (a \<bullet> k) c)

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
have **: "(\<Prod>i\<in>Basis. ((\<Sum>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) *\<^sub>R i) \<bullet> i - a \<bullet> i)) =
      (\<Prod>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) - a \<bullet> i)"
    "(\<Prod>i\<in>Basis. b \<bullet> i - ((\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) \<bullet> i)) =
      (\<Prod>i\<in>Basis. b \<bullet> i - (if i = k then max (a \<bullet> k) c else a \<bullet> i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>Basis. (\<Sum>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) *\<^sub>R i) \<bullet> i - a \<bullet> i) = (\<Prod>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) - a \<bullet> i) &&& (\<Prod>i\<in>Basis. b \<bullet> i - (\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) \<bullet> i) = (\<Prod>i\<in>Basis. b \<bullet> i - (if i = k then max (a \<bullet> k) c else a \<bullet> i))
[PROOF STEP]
by (auto intro!: prod.cong)
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>Basis. (\<Sum>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) *\<^sub>R i) \<bullet> i - a \<bullet> i) = (\<Prod>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) - a \<bullet> i)
(\<Prod>i\<in>Basis. b \<bullet> i - (\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) \<bullet> i) = (\<Prod>i\<in>Basis. b \<bullet> i - (if i = k then max (a \<bullet> k) c else a \<bullet> i))

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
have "\<not> a \<bullet> k \<le> c \<Longrightarrow> \<not> c \<le> b \<bullet> k \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> a \<bullet> k \<le> c; \<not> c \<le> b \<bullet> k\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
unfolding not_le
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c < a \<bullet> k; b \<bullet> k < c\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
using True assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i
k \<in> Basis

goal (1 subgoal):
 1. \<lbrakk>c < a \<bullet> k; b \<bullet> k < c\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> a \<bullet> k \<le> c; \<not> c \<le> b \<bullet> k\<rbrakk> \<Longrightarrow> False

goal (2 subgoals):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
 2. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> ?x1 * (b \<bullet> k - a \<bullet> k) = ?x1 * (max (a \<bullet> k) c - a \<bullet> k) + ?x1 * (b \<bullet> k - max (a \<bullet> k) c)
\<lbrakk>\<not> a \<bullet> k \<le> c; \<not> c \<le> b \<bullet> k\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> ?x1 * (b \<bullet> k - a \<bullet> k) = ?x1 * (max (a \<bullet> k) c - a \<bullet> k) + ?x1 * (b \<bullet> k - max (a \<bullet> k) c)
\<lbrakk>\<not> a \<bullet> k \<le> c; \<not> c \<le> b \<bullet> k\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> ?x1 * (b \<bullet> k - a \<bullet> k) = ?x1 * (max (a \<bullet> k) c - a \<bullet> k) + ?x1 * (b \<bullet> k - max (a \<bullet> k) c)
\<lbrakk>\<not> a \<bullet> k \<le> c; \<not> c \<le> b \<bullet> k\<rbrakk> \<Longrightarrow> False
k \<in> Basis

goal (1 subgoal):
 1. content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
unfolding simps ** 1[of "\<lambda>i x. b\<bullet>i - x"] 1[of "\<lambda>i x. x - a\<bullet>i"] 2
[PROOF STATE]
proof (prove)
using this:
min (b \<bullet> k) c = max (a \<bullet> k) c \<Longrightarrow> ?x1 * (b \<bullet> k - a \<bullet> k) = ?x1 * (max (a \<bullet> k) c - a \<bullet> k) + ?x1 * (b \<bullet> k - max (a \<bullet> k) c)
\<lbrakk>\<not> a \<bullet> k \<le> c; \<not> c \<le> b \<bullet> k\<rbrakk> \<Longrightarrow> False
k \<in> Basis

goal (1 subgoal):
 1. (if \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i then (\<Prod>i\<in>Basis - {k}. b \<bullet> i - a \<bullet> i) * (b \<bullet> k - a \<bullet> k) else 0) = (if \<forall>i\<in>Basis. a \<bullet> i \<le> (\<Sum>i\<in>Basis. (if i = k then min (b \<bullet> k) c else b \<bullet> i) *\<^sub>R i) \<bullet> i then (min (b \<bullet> k) c - a \<bullet> k) * (\<Prod>i\<in>Basis - {k}. b \<bullet> i - a \<bullet> i) else 0) + (if \<forall>i\<in>Basis. (\<Sum>i\<in>Basis. (if i = k then max (a \<bullet> k) c else a \<bullet> i) *\<^sub>R i) \<bullet> i \<le> b \<bullet> i then (b \<bullet> k - max (a \<bullet> k) c) * (\<Prod>i\<in>Basis - {k}. b \<bullet> i - a \<bullet> i) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)
[PROOF STEP]
have "cbox a b = {}"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)

goal (1 subgoal):
 1. cbox a b = {}
[PROOF STEP]
unfolding box_eq_empty
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i)

goal (1 subgoal):
 1. \<exists>i\<in>Basis. b \<bullet> i < a \<bullet> i
[PROOF STEP]
by (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
cbox a b = {}

goal (1 subgoal):
 1. \<not> (\<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i) \<Longrightarrow> content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cbox a b = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cbox a b = {}

goal (1 subgoal):
 1. content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})
[PROOF STEP]
by (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
content (cbox a b) = content (cbox a b \<inter> {x. x \<bullet> k \<le> c}) + content (cbox a b \<inter> {x. c \<le> x \<bullet> k})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_at_right:
  "filterlim f (at_right a) F \<longleftrightarrow> eventually (\<lambda>x. f x > a) F \<and> filterlim f (nhds a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f (at_right a) F = ((\<forall>\<^sub>F x in F. a < f x) \<and> (f \<longlongrightarrow> a) F)
[PROOF STEP]
by (subst filterlim_at) (auto elim!: eventually_mono)


[STATEMENT]
lemma uniformly_continuous_on_cmul_left[continuous_intros]:
  fixes f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_algebra"
  assumes "uniformly_continuous_on s f"
    shows "uniformly_continuous_on s (\<lambda>x. c * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on s (\<lambda>x. c * f x)
[PROOF STEP]
by (metis assms bounded_linear.uniformly_continuous_on bounded_linear_mult_right)


[STATEMENT]
lemma cos_int_times_real: "cos (of_int m * of_real x) = of_real (cos (of_int m * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (of_int m * of_real x) = of_real (cos (real_of_int m * x))
[PROOF STEP]
by (metis cos_of_real of_real_mult of_real_of_int_eq)


[STATEMENT]
lemma mult_isol_equiv_subdistl:
  "(\<forall>x y z. x \<le> y \<longrightarrow> z \<cdot> x \<le> z \<cdot> y) \<longleftrightarrow> (\<forall>x y z. z \<cdot> x \<le> z \<cdot> (x + y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y z. x \<le> y \<longrightarrow> z \<cdot> x \<le> z \<cdot> y) = (\<forall>x y z. z \<cdot> x \<le> z \<cdot> (x + y))
[PROOF STEP]
by (metis local.join.sup_absorb2 local.join.sup_ge1)


[STATEMENT]
theorem quadratic_sub_fm :
  assumes lLength : "length L > var"
  assumes nonzero : "Dv \<noteq> 0"
  assumes detGreater0 : "Cv \<ge> 0"
  assumes freeC : "var \<notin> vars c"
  assumes ha : "\<forall>x. insertion (nth_default 0 (list_update L var x)) (a::real mpoly) = (Av :: real)"
  assumes hb : "\<forall>x. insertion (nth_default 0 (list_update L var x)) (b::real mpoly) = (Bv :: real)"
  assumes hc : "\<forall>x. insertion (nth_default 0 (list_update L var x)) (c::real mpoly) = (Cv :: real)"
  assumes hd : "\<forall>x. insertion (nth_default 0 (list_update L var x)) (d::real mpoly) = (Dv :: real)"
  shows "eval F (list_update L var ((Av+Bv*sqrt(Cv))/Dv)) = eval (quadratic_sub_fm var a b c d F) (list_update L var (sqrt Cv))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (L[var := (Av + Bv * sqrt Cv) / Dv]) = eval (quadratic_sub_fm var a b c d F) (L[var := sqrt Cv])
[PROOF STEP]
unfolding quadratic_sub_fm.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F (L[var := (Av + Bv * sqrt Cv) / Dv]) = eval (quadratic_sub_fm_helper var a b c d F 0) (L[var := sqrt Cv])
[PROOF STEP]
using quadratic_sub_fm_helper[OF assms(2) assms(3) assms(4), of 0 L a Av b Bv d F] assms(1) assms(5) assms(6) assms(7) assms(8)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>var + 0 < length L; \<forall>x. insertion (nth_default 0 ((drop 0 L)[var := x])) a = Av; \<forall>x. insertion (nth_default 0 ((drop 0 L)[var := x])) b = Bv; \<forall>x. insertion (nth_default 0 ((drop 0 L)[var := x])) c = Cv; \<forall>x. insertion (nth_default 0 ((drop 0 L)[var := x])) d = Dv\<rbrakk> \<Longrightarrow> eval F (L[var + 0 := (Av + Bv * sqrt Cv) / Dv]) = eval (quadratic_sub_fm_helper var a b c d F 0) (L[var + 0 := sqrt Cv])
var < length L
\<forall>x. insertion (nth_default 0 (L[var := x])) a = Av
\<forall>x. insertion (nth_default 0 (L[var := x])) b = Bv
\<forall>x. insertion (nth_default 0 (L[var := x])) c = Cv
\<forall>x. insertion (nth_default 0 (L[var := x])) d = Dv

goal (1 subgoal):
 1. eval F (L[var := (Av + Bv * sqrt Cv) / Dv]) = eval (quadratic_sub_fm_helper var a b c d F 0) (L[var := sqrt Cv])
[PROOF STEP]
by (simp add: lLength)


[STATEMENT]
lemma card_fcs_aa'_le: "card {G.face_cycle_set a, G.face_cycle_set a'} \<le> card G.face_cycle_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {G.face_cycle_set a, G.face_cycle_set a'} \<le> card G.face_cycle_sets
[PROOF STEP]
using a_in
[PROOF STATE]
proof (prove)
using this:
a \<in> arcs G

goal (1 subgoal):
 1. card {G.face_cycle_set a, G.face_cycle_set a'} \<le> card G.face_cycle_sets
[PROOF STEP]
by (intro card_mono) (auto simp: G.face_cycle_sets_def)


[STATEMENT]
lemma frontier_Un_subset: "frontier(S \<union> T) \<subseteq> frontier S \<union> frontier T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier (S \<union> T) \<subseteq> frontier S \<union> frontier T
[PROOF STEP]
by (metis compl_sup frontier_Int_subset frontier_complement)


[STATEMENT]
lemma WbisT_raw_coind2:
assumes "theta \<subseteq> WretrT theta" and
"theta ^-1 \<subseteq> WretrT (theta ^-1)"
shows "theta \<subseteq> WbisT"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. theta \<subseteq> WbisT
[PROOF STEP]
using assms mono_Retr bis_raw_coind2
[PROOF STATE]
proof (prove)
using this:
theta \<subseteq> WretrT theta
theta\<inverse> \<subseteq> WretrT (theta\<inverse>)
Bisim.mono Sretr
Bisim.mono ZOretr
Bisim.mono ZOretrT
Bisim.mono Wretr
Bisim.mono WretrT
Bisim.mono RetrT
\<lbrakk>Bisim.mono ?Retr; ?theta \<subseteq> ?Retr ?theta; ?theta\<inverse> \<subseteq> ?Retr (?theta\<inverse>)\<rbrakk> \<Longrightarrow> ?theta \<subseteq> bis ?Retr

goal (1 subgoal):
 1. theta \<subseteq> WbisT
[PROOF STEP]
unfolding WbisT_def
[PROOF STATE]
proof (prove)
using this:
theta \<subseteq> WretrT theta
theta\<inverse> \<subseteq> WretrT (theta\<inverse>)
Bisim.mono Sretr
Bisim.mono ZOretr
Bisim.mono ZOretrT
Bisim.mono Wretr
Bisim.mono WretrT
Bisim.mono RetrT
\<lbrakk>Bisim.mono ?Retr; ?theta \<subseteq> ?Retr ?theta; ?theta\<inverse> \<subseteq> ?Retr (?theta\<inverse>)\<rbrakk> \<Longrightarrow> ?theta \<subseteq> bis ?Retr

goal (1 subgoal):
 1. theta \<subseteq> bis WretrT
[PROOF STEP]
by blast