[STATEMENT]
lemma \<omega>_sum_take_drop: "\<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)
[PROOF STEP]
proof (induction k arbitrary: \<alpha>s)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)
 2. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)
 2. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take 0 \<alpha>s) + \<omega>_sum (drop 0 \<alpha>s)

goal (1 subgoal):
 1. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
\<omega>_sum ?\<alpha>s = \<omega>_sum (take k ?\<alpha>s) + \<omega>_sum (drop k ?\<alpha>s)

goal (1 subgoal):
 1. \<And>k \<alpha>s. (\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s)) \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<omega>_sum ?\<alpha>s = \<omega>_sum (take k ?\<alpha>s) + \<omega>_sum (drop k ?\<alpha>s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<omega>_sum ?\<alpha>s = \<omega>_sum (take k ?\<alpha>s) + \<omega>_sum (drop k ?\<alpha>s)

goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
proof (cases "\<alpha>s")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = []\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
 2. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<alpha>s = []

goal (2 subgoals):
 1. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = []\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
 2. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha>s = []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha>s = []

goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)

goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
case (Cons a list)
[PROOF STATE]
proof (state)
this:
\<alpha>s = a # list

goal (1 subgoal):
 1. \<And>a list. \<lbrakk>\<And>\<alpha>s. \<omega>_sum \<alpha>s = \<omega>_sum (take k \<alpha>s) + \<omega>_sum (drop k \<alpha>s); \<alpha>s = a # list\<rbrakk> \<Longrightarrow> \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
with Suc.prems
[PROOF STATE]
proof (chain)
picking this:
\<alpha>s = a # list
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<alpha>s = a # list

goal (1 subgoal):
 1. \<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)
[PROOF STEP]
by (simp add: add.assoc flip: Suc.IH)
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<omega>_sum \<alpha>s = \<omega>_sum (take (Suc k) \<alpha>s) + \<omega>_sum (drop (Suc k) \<alpha>s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_map_identity [simp]:
  "inverse_map (identity S) S S = identity S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_map (identity S) S S = identity S
[PROOF STEP]
by (metis Id_compose compose_id_inv_into image_ident image_restrict_eq inv_into_funcset inverse_map_def restrict_extensional)


[STATEMENT]
lemma find_outside_node:
  assumes "(u,v)\<in>E\<^sup>*"
  assumes "(u,v)\<notin>(E\<inter>U\<times>U)\<^sup>*"
  assumes "u\<in>U" "v\<in>U"
  shows "\<exists>u'. u'\<notin>U \<and> (u,u')\<in>E\<^sup>* \<and> (u',v)\<in>E\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', v) \<in> E\<^sup>*
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> E\<^sup>*
(u, v) \<notin> (Restr E U)\<^sup>*
u \<in> U
v \<in> U

goal (1 subgoal):
 1. \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', v) \<in> E\<^sup>*
[PROOF STEP]
apply (induction)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(u, u) \<notin> (Restr E U)\<^sup>*; u \<in> U; u \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', u) \<in> E\<^sup>*
 2. \<And>y z. \<lbrakk>(u, y) \<in> E\<^sup>*; (y, z) \<in> E; \<lbrakk>(u, y) \<notin> (Restr E U)\<^sup>*; u \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', y) \<in> E\<^sup>*; (u, z) \<notin> (Restr E U)\<^sup>*; u \<in> U; z \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', z) \<in> E\<^sup>*
[PROOF STEP]
apply auto []
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(u, y) \<in> E\<^sup>*; (y, z) \<in> E; \<lbrakk>(u, y) \<notin> (Restr E U)\<^sup>*; u \<in> U; y \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', y) \<in> E\<^sup>*; (u, z) \<notin> (Restr E U)\<^sup>*; u \<in> U; z \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', z) \<in> E\<^sup>*
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(u, y) \<in> E\<^sup>*; (y, z) \<in> E; \<lbrakk>(u, y) \<notin> (Restr E U)\<^sup>*; y \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', y) \<in> E\<^sup>*; (u, z) \<notin> (Restr E U)\<^sup>*; u \<in> U; z \<in> U\<rbrakk> \<Longrightarrow> \<exists>u'. u' \<notin> U \<and> (u, u') \<in> E\<^sup>* \<and> (u', z) \<in> E\<^sup>*
[PROOF STEP]
by (metis IntI mem_Sigma_iff rtrancl.simps)


[STATEMENT]
lemma formulaTrueSubset:
  fixes formula :: Formula and formula' :: Formula and valuation :: Valuation
  assumes
  formulaTrue: "formulaTrue formula valuation" and
  subset: "\<forall> (clause::Clause). clause el formula' \<longrightarrow> clause el formula"
  shows "formulaTrue formula' valuation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
fix clause :: Clause
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
assume "clause el formula'"
[PROOF STATE]
proof (state)
this:
clause el formula'

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
with formulaTrue subset
[PROOF STATE]
proof (chain)
picking this:
formulaTrue formula valuation
\<forall>clause. clause el formula' \<longrightarrow> clause el formula
clause el formula'
[PROOF STEP]
have "clauseTrue clause valuation"
[PROOF STATE]
proof (prove)
using this:
formulaTrue formula valuation
\<forall>clause. clause el formula' \<longrightarrow> clause el formula
clause el formula'

goal (1 subgoal):
 1. clauseTrue clause valuation
[PROOF STEP]
by (simp add:formulaTrueIffAllClausesAreTrue)
[PROOF STATE]
proof (state)
this:
clauseTrue clause valuation

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?clause2 el formula' \<Longrightarrow> clauseTrue ?clause2 valuation

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?clause2 el formula' \<Longrightarrow> clauseTrue ?clause2 valuation

goal (1 subgoal):
 1. formulaTrue formula' valuation
[PROOF STEP]
by (simp add:formulaTrueIffAllClausesAreTrue)
[PROOF STATE]
proof (state)
this:
formulaTrue formula' valuation

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma natural_eqI:
  "nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n
[PROOF STEP]
using natural_eq_iff [of m n]
[PROOF STATE]
proof (prove)
using this:
(m = n) = (nat_of_natural m = nat_of_natural n)

goal (1 subgoal):
 1. nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n
[PROOF STEP]
by simp


[STATEMENT]
lemma expands_to_uminus:
  "basis_wf basis \<Longrightarrow> (f expands_to F) basis \<Longrightarrow> ((\<lambda>x. -f x) expands_to -F) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>basis_wf basis; (f expands_to F) basis\<rbrakk> \<Longrightarrow> ((\<lambda>x. - f x) expands_to - F) basis
[PROOF STEP]
by (auto simp: expands_to.simps is_expansion_uminus)


[STATEMENT]
lemma rev_compower [simp]: "rev ` (A ^^ n) = (rev ` A) ^^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev ` (A ^^ n) = rev ` A ^^ n
[PROOF STEP]
by (induction n) (simp_all add: conc_pow_comm)


[STATEMENT]
lemma ec_sup: "ec \<phi> \<Longrightarrow> ec \<psi> \<Longrightarrow> \<phi> \<sqinter> \<psi> \<noteq> bot \<Longrightarrow> ec (\<phi> \<squnion> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ec \<phi>; ec \<psi>; \<phi> \<sqinter> \<psi> \<noteq> \<bottom>\<rbrakk> \<Longrightarrow> ec (\<phi> \<squnion> \<psi>)
[PROOF STEP]
by (simp add: ec_def sc_supI closed_mdpc_supI)


[STATEMENT]
lemma tensor_domain_wall_additivity:
 "domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
proof(cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. xs = basic x1 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. xs = basic x1 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume A:"xs = basic x"
[PROOF STATE]
proof (state)
this:
xs = basic x

goal (2 subgoals):
 1. \<And>x1. xs = basic x1 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs = basic x
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys"
[PROOF STATE]
proof (prove)
using this:
xs = basic x

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
proof(cases ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = basic x; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = basic x; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume B:"ys = basic y"
[PROOF STATE]
proof (state)
this:
ys = basic y

goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = basic x; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_block (x \<otimes> y) = domain_block x + domain_block y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_block (x \<otimes> y) = domain_block x + domain_block y
[PROOF STEP]
using domain_additive
[PROOF STATE]
proof (prove)
using this:
domain_block (?x \<otimes> ?y) = domain_block ?x + domain_block ?y

goal (1 subgoal):
 1. domain_block (x \<otimes> y) = domain_block x + domain_block y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_block (x \<otimes> y) = domain_block x + domain_block y

goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = basic x; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
domain_block (x \<otimes> y) = domain_block x + domain_block y
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys"
[PROOF STATE]
proof (prove)
using this:
domain_block (x \<otimes> y) = domain_block x + domain_block y

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
using tensor.simps(1) A B
[PROOF STATE]
proof (prove)
using this:
domain_block (x \<otimes> y) = domain_block x + domain_block y
basic ?x \<otimes> basic ?y = basic (?x \<otimes> ?y)
xs = basic x
ys = basic y

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = basic x; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
fix z zs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume C:"ys = (z*zs)"
[PROOF STATE]
proof (state)
this:
ys = z * zs

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
proof(cases "(codomain_block x) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume "codomain_block x = 0"
[PROOF STATE]
proof (state)
this:
codomain_block x = 0

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
codomain_block x = 0
[PROOF STEP]
have "(xs \<otimes> ys) = (x \<otimes> z)*zs"
[PROOF STATE]
proof (prove)
using this:
codomain_block x = 0

goal (1 subgoal):
 1. xs \<otimes> ys = (x \<otimes> z) * zs
[PROOF STEP]
using A C tensor.simps(4)
[PROOF STATE]
proof (prove)
using this:
codomain_block x = 0
xs = basic x
ys = z * zs
?x * ?xs \<otimes> ?y * ?ys = (?x \<otimes> ?y) * (?xs \<otimes> ?ys)

goal (1 subgoal):
 1. xs \<otimes> ys = (x \<otimes> z) * zs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<otimes> ys = (x \<otimes> z) * zs

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<otimes> ys = (x \<otimes> z) * zs
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)"
[PROOF STATE]
proof (prove)
using this:
xs \<otimes> ys = (x \<otimes> z) * zs

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall ys = domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall ys = domain_block z
[PROOF STEP]
unfolding domain_wall_def C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (z * zs) = domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block z

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block z

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall xs = domain_block x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall xs = domain_block x
[PROOF STEP]
unfolding domain_wall_def A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (basic x) = domain_block x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block x

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block x

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_block (x \<otimes> z) = domain_block x + domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_block (x \<otimes> z) = domain_block x + domain_block z
[PROOF STEP]
using domain_additive
[PROOF STATE]
proof (prove)
using this:
domain_block (?x \<otimes> ?y) = domain_block ?x + domain_block ?y

goal (1 subgoal):
 1. domain_block (x \<otimes> z) = domain_block x + domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_block (x \<otimes> z) = domain_block x + domain_block z

goal (2 subgoals):
 1. codomain_block x = 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)
domain_wall ys = domain_block z
domain_wall xs = domain_block x
domain_block (x \<otimes> z) = domain_block x + domain_block z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)
domain_wall ys = domain_block z
domain_wall xs = domain_block x
domain_block (x \<otimes> z) = domain_block x + domain_block z

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume "codomain_block x \<noteq> 0"
[PROOF STATE]
proof (state)
this:
codomain_block x \<noteq> 0

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "(xs \<otimes> ys)
                 = (x \<otimes> z)
                    *((basic (make_vert_block (nat (codomain_block x))))\<otimes> zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<otimes> ys = (x \<otimes> z) * (basic (make_vert_block (nat (codomain_block x))) \<otimes> zs)
[PROOF STEP]
using tensor.simps(3) A C \<open>codomain_block x \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
basic ?x \<otimes> ?y * ?ys = (if codomain_block ?x = 0 then (?x \<otimes> ?y) * ?ys else (?x \<otimes> ?y) * (basic (make_vert_block (nat (codomain_block ?x))) \<otimes> ?ys))
xs = basic x
ys = z * zs
codomain_block x \<noteq> 0

goal (1 subgoal):
 1. xs \<otimes> ys = (x \<otimes> z) * (basic (make_vert_block (nat (codomain_block x))) \<otimes> zs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<otimes> ys = (x \<otimes> z) * (basic (make_vert_block (nat (codomain_block x))) \<otimes> zs)

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<otimes> ys = (x \<otimes> z) * (basic (make_vert_block (nat (codomain_block x))) \<otimes> zs)
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)"
[PROOF STATE]
proof (prove)
using this:
xs \<otimes> ys = (x \<otimes> z) * (basic (make_vert_block (nat (codomain_block x))) \<otimes> zs)

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall ys = domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall ys = domain_block z
[PROOF STEP]
unfolding domain_wall_def C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (z * zs) = domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block z

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block z

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall xs = domain_block x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall xs = domain_block x
[PROOF STEP]
unfolding domain_wall_def A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (basic x) = domain_block x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block x

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block x

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_block (x \<otimes> z) = domain_block x + domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_block (x \<otimes> z) = domain_block x + domain_block z
[PROOF STEP]
using domain_additive
[PROOF STATE]
proof (prove)
using this:
domain_block (?x \<otimes> ?y) = domain_block ?x + domain_block ?y

goal (1 subgoal):
 1. domain_block (x \<otimes> z) = domain_block x + domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_block (x \<otimes> z) = domain_block x + domain_block z

goal (1 subgoal):
 1. codomain_block x \<noteq> 0 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)
domain_wall ys = domain_block z
domain_wall xs = domain_block x
domain_block (x \<otimes> z) = domain_block x + domain_block z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_block (x \<otimes> z)
domain_wall ys = domain_block z
domain_wall xs = domain_block x
domain_block (x \<otimes> z) = domain_block x + domain_block z

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = basic x; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (2 subgoals):
 1. \<And>x1. xs = basic x1 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
fix z zs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume D:"xs = z * zs"
[PROOF STATE]
proof (state)
this:
xs = z * zs

goal (1 subgoal):
 1. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs = z * zs
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys"
[PROOF STATE]
proof (prove)
using this:
xs = z * zs

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
proof(cases ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = z * zs; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = z * zs; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume E:"ys = basic y"
[PROOF STATE]
proof (state)
this:
ys = basic y

goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = z * zs; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ys = basic y
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys"
[PROOF STATE]
proof (prove)
using this:
ys = basic y

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
proof(cases "codomain_block y = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume "codomain_block y = 0"
[PROOF STATE]
proof (state)
this:
codomain_block y = 0

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "(xs \<otimes> ys) = (z \<otimes> y)*zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<otimes> ys = (z \<otimes> y) * zs
[PROOF STEP]
using tensor.simps(2)  D E \<open>codomain_block y = 0\<close>
[PROOF STATE]
proof (prove)
using this:
?x * ?xs \<otimes> basic ?y = (if codomain_block ?y = 0 then (?x \<otimes> ?y) * ?xs else (?x \<otimes> ?y) * (?xs \<otimes> basic (make_vert_block (nat (codomain_block ?y)))))
xs = z * zs
ys = basic y
codomain_block y = 0

goal (1 subgoal):
 1. xs \<otimes> ys = (z \<otimes> y) * zs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<otimes> ys = (z \<otimes> y) * zs

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<otimes> ys = (z \<otimes> y) * zs
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
xs \<otimes> ys = (z \<otimes> y) * zs

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall xs = domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall xs = domain_block z
[PROOF STEP]
unfolding domain_wall_def D
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (z * zs) = domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block z

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block z

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall ys = domain_block y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall ys = domain_block y
[PROOF STEP]
unfolding domain_wall_def E
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (basic y) = domain_block y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block y

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block y

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_block (z \<otimes> y) = domain_block z + domain_block y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_block (z \<otimes> y) = domain_block z + domain_block y
[PROOF STEP]
using domain_additive
[PROOF STATE]
proof (prove)
using this:
domain_block (?x \<otimes> ?y) = domain_block ?x + domain_block ?y

goal (1 subgoal):
 1. domain_block (z \<otimes> y) = domain_block z + domain_block y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_block (z \<otimes> y) = domain_block z + domain_block y

goal (2 subgoals):
 1. \<lbrakk>ys = basic y; codomain_block y = 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)
domain_wall xs = domain_block z
domain_wall ys = domain_block y
domain_block (z \<otimes> y) = domain_block z + domain_block y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)
domain_wall xs = domain_block z
domain_wall ys = domain_block y
domain_block (z \<otimes> y) = domain_block z + domain_block y

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume "codomain_block y \<noteq> 0"
[PROOF STATE]
proof (state)
this:
codomain_block y \<noteq> 0

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "(xs \<otimes> ys)
               =
                (z \<otimes> y)
                  *(zs\<otimes>(basic (make_vert_block (nat (codomain_block y)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<otimes> ys = (z \<otimes> y) * (zs \<otimes> basic (make_vert_block (nat (codomain_block y))))
[PROOF STEP]
using tensor.simps(3) D E \<open>codomain_block y \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
basic ?x \<otimes> ?y * ?ys = (if codomain_block ?x = 0 then (?x \<otimes> ?y) * ?ys else (?x \<otimes> ?y) * (basic (make_vert_block (nat (codomain_block ?x))) \<otimes> ?ys))
xs = z * zs
ys = basic y
codomain_block y \<noteq> 0

goal (1 subgoal):
 1. xs \<otimes> ys = (z \<otimes> y) * (zs \<otimes> basic (make_vert_block (nat (codomain_block y))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<otimes> ys = (z \<otimes> y) * (zs \<otimes> basic (make_vert_block (nat (codomain_block y))))

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<otimes> ys = (z \<otimes> y) * (zs \<otimes> basic (make_vert_block (nat (codomain_block y))))
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
xs \<otimes> ys = (z \<otimes> y) * (zs \<otimes> basic (make_vert_block (nat (codomain_block y))))

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall ys = domain_block y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall ys = domain_block y
[PROOF STEP]
unfolding domain_wall_def E
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (basic y) = domain_block y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block y

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block y

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall xs = domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall xs = domain_block z
[PROOF STEP]
unfolding domain_wall_def D
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (z * zs) = domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block z

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block z

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_block (z \<otimes> y) = domain_block z + domain_block y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_block (z \<otimes> y) = domain_block z + domain_block y
[PROOF STEP]
using domain_additive
[PROOF STATE]
proof (prove)
using this:
domain_block (?x \<otimes> ?y) = domain_block ?x + domain_block ?y

goal (1 subgoal):
 1. domain_block (z \<otimes> y) = domain_block z + domain_block y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_block (z \<otimes> y) = domain_block z + domain_block y

goal (1 subgoal):
 1. \<lbrakk>ys = basic y; codomain_block y \<noteq> 0\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)
domain_wall ys = domain_block y
domain_wall xs = domain_block z
domain_block (z \<otimes> y) = domain_block z + domain_block y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> y)
domain_wall ys = domain_block y
domain_wall xs = domain_block z
domain_block (z \<otimes> y) = domain_block z + domain_block y

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (2 subgoals):
 1. \<And>x1. \<lbrakk>xs = z * zs; ys = basic x1\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
 2. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
fix w ws
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
assume F:"ys = w*ws"
[PROOF STATE]
proof (state)
this:
ys = w * ws

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "(xs \<otimes> ys) = (z \<otimes> w) * (zs \<otimes> ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<otimes> ys = (z \<otimes> w) * (zs \<otimes> ws)
[PROOF STEP]
using D F
[PROOF STATE]
proof (prove)
using this:
xs = z * zs
ys = w * ws

goal (1 subgoal):
 1. xs \<otimes> ys = (z \<otimes> w) * (zs \<otimes> ws)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xs \<otimes> ys = (z \<otimes> w) * (zs \<otimes> ws)

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
xs \<otimes> ys = (z \<otimes> w) * (zs \<otimes> ws)
[PROOF STEP]
have "domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> w)"
[PROOF STATE]
proof (prove)
using this:
xs \<otimes> ys = (z \<otimes> w) * (zs \<otimes> ws)

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> w)

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> w)

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall ys = domain_block w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall ys = domain_block w
[PROOF STEP]
unfolding domain_wall_def F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (w * ws) = domain_block w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block w

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall ys = domain_block w

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_wall xs = domain_block z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_wall xs = domain_block z
[PROOF STEP]
unfolding domain_wall_def D
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_wall domain_block (\<lambda>x ys ysa. domain_block x) (z * zs) = domain_block z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block z

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
domain_wall xs = domain_block z

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
have "domain_block (z \<otimes> w) = domain_block z + domain_block w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. domain_block (z \<otimes> w) = domain_block z + domain_block w
[PROOF STEP]
using domain_additive
[PROOF STATE]
proof (prove)
using this:
domain_block (?x \<otimes> ?y) = domain_block ?x + domain_block ?y

goal (1 subgoal):
 1. domain_block (z \<otimes> w) = domain_block z + domain_block w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_block (z \<otimes> w) = domain_block z + domain_block w

goal (1 subgoal):
 1. \<And>x21 x22. \<lbrakk>xs = z * zs; ys = x21 * x22\<rbrakk> \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> w)
domain_wall ys = domain_block w
domain_wall xs = domain_block z
domain_block (z \<otimes> w) = domain_block z + domain_block w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_block (z \<otimes> w)
domain_wall ys = domain_block w
domain_wall xs = domain_block z
domain_block (z \<otimes> w) = domain_block z + domain_block w

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. \<And>x21 x22. xs = x21 * x22 \<Longrightarrow> domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal (1 subgoal):
 1. domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
domain_wall (xs \<otimes> ys) = domain_wall xs + domain_wall ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_vec_eq[simp]:
  assumes i: "i < n"
  shows "(unit_vec n i = unit_vec n j) = (i = j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (unit_vec n i = unit_vec n j) = (i = j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (unit_vec n i = unit_vec n j) = (i = j)
[PROOF STEP]
have "i \<noteq> j \<Longrightarrow> unit_vec n i $ i \<noteq> unit_vec n j $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> unit_vec n i $ i \<noteq> unit_vec n j $ i
[PROOF STEP]
unfolding unit_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> vec n (\<lambda>j. if j = i then 1::'b else (0::'b)) $ i \<noteq> vec n (\<lambda>ja. if ja = j then 1::'b else (0::'b)) $ i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> vec n (\<lambda>j. if j = i then 1::'b else (0::'b)) $ i \<noteq> vec n (\<lambda>ja. if ja = j then 1::'b else (0::'b)) $ i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<noteq> j \<Longrightarrow> unit_vec n i $ i \<noteq> unit_vec n j $ i

goal (1 subgoal):
 1. (unit_vec n i = unit_vec n j) = (i = j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> j \<Longrightarrow> unit_vec n i $ i \<noteq> unit_vec n j $ i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j \<Longrightarrow> unit_vec n i $ i \<noteq> unit_vec n j $ i

goal (1 subgoal):
 1. (unit_vec n i = unit_vec n j) = (i = j)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(unit_vec n i = unit_vec n j) = (i = j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem assumes ms: "measure_space M" and A: "A \<in> measurable_sets M"
  shows char_rv: "\<chi> A \<in> rv M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> A \<in> rv M
[PROOF STEP]
using ms A
[PROOF STATE]
proof (prove)
using this:
measure_space M
A \<in> measurable_sets M

goal (1 subgoal):
 1. \<chi> A \<in> rv M
[PROOF STEP]
by (auto simp only: measure_space_def char_measurable rv_def)


[STATEMENT]
lemma changes_poly_at_0[simp]:
  "changes_poly_at [] a =0"
  "changes_poly_at [p] a=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes_poly_at [] a = 0 &&& changes_poly_at [p] a = 0
[PROOF STEP]
unfolding changes_poly_at_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. changes (map (\<lambda>p. poly p a) []) = 0 &&& changes (map (\<lambda>p. poly p a) [p]) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma sums_divide: "f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums a \<Longrightarrow> (\<lambda>n. f n / c) sums (a / c)
[PROOF STEP]
by (rule bounded_linear.sums [OF bounded_linear_divide])


[STATEMENT]
lemma tff_3: assumes dx: "dim_vec x = 3"
  and be: "x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = False"
  shows "ceros_of_boolean_input x = {1,2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {1, 2}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = False

goal (1 subgoal):
 1. ceros_of_boolean_input x = {1, 2}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = False

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {1, 2}
[PROOF STEP]
using less_3_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = False \<and> x $ 2 = False
?n < 3 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {1, 2}
[PROOF STEP]
by auto


[STATEMENT]
lemma child_ix: "d < length p \<Longrightarrow> ix (child p dir d) d = 2 * ix p d + sgn dir"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d < length p \<Longrightarrow> ix (child p dir d) d = 2 * ix p d + Grid_Point.sgn dir
[PROOF STEP]
unfolding child_def ix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d < length p \<Longrightarrow> snd (p[d := (lv p d + 1, 2 * snd (p ! d) + Grid_Point.sgn dir)] ! d) = 2 * snd (p ! d) + Grid_Point.sgn dir
[PROOF STEP]
by simp


[STATEMENT]
lemma lincomb_obtain_same_length_Rcoeffs :
  "set rs \<subseteq> R \<Longrightarrow> set ms \<subseteq> M
        \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ms
          \<and> take (length rs) ss = take (length ms) rs \<and> rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set rs \<subseteq> R; set ms \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ms \<and> take (length rs) ss = take (length ms) rs \<and> rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms
[PROOF STEP]
proof (induct rs ms rule: list_induct2')
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>set [] \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length []) ss = take (length []) [] \<and> [] \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 2. \<And>x xs. \<lbrakk>set (x # xs) \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x # xs)) ss = take (length []) (x # xs) \<and> (x # xs) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 3. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 4. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> R
set [] \<subseteq> M

goal (4 subgoals):
 1. \<lbrakk>set [] \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length []) ss = take (length []) [] \<and> [] \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 2. \<And>x xs. \<lbrakk>set (x # xs) \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x # xs)) ss = take (length []) (x # xs) \<and> (x # xs) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 3. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 4. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length []) ss = take (length []) [] \<and> [] \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
[PROOF STEP]
using lincomb_Nil
[PROOF STATE]
proof (prove)
using this:
?rs = [] \<or> ?ms = [] \<Longrightarrow> ?rs \<bullet>\<cdot> ?ms = (0::'m)

goal (1 subgoal):
 1. \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length []) ss = take (length []) [] \<and> [] \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length []) ss = take (length []) [] \<and> [] \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []

goal (3 subgoals):
 1. \<And>x xs. \<lbrakk>set (x # xs) \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x # xs)) ss = take (length []) (x # xs) \<and> (x # xs) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 2. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 3. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xs. \<lbrakk>set (x # xs) \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x # xs)) ss = take (length []) (x # xs) \<and> (x # xs) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 2. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 3. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
set (x_ # xs_) \<subseteq> R
set [] \<subseteq> M

goal (3 subgoals):
 1. \<And>x xs. \<lbrakk>set (x # xs) \<subseteq> R; set [] \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x # xs)) ss = take (length []) (x # xs) \<and> (x # xs) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
 2. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 3. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set (x_ # xs_) \<subseteq> R
set [] \<subseteq> M

goal (1 subgoal):
 1. \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x_ # xs_)) ss = take (length []) (x_ # xs_) \<and> (x_ # xs_) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
[PROOF STEP]
using lincomb_Nil
[PROOF STATE]
proof (prove)
using this:
set (x_ # xs_) \<subseteq> R
set [] \<subseteq> M
?rs = [] \<or> ?ms = [] \<Longrightarrow> ?rs \<bullet>\<cdot> ?ms = (0::'m)

goal (1 subgoal):
 1. \<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x_ # xs_)) ss = take (length []) (x_ # xs_) \<and> (x_ # xs_) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>ss. set ss \<subseteq> R \<and> length ss = length [] \<and> take (length (x_ # xs_)) ss = take (length []) (x_ # xs_) \<and> (x_ # xs_) \<bullet>\<cdot> [] = ss \<bullet>\<cdot> []

goal (2 subgoals):
 1. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 2. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 2. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
case (3 m ms)
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> R
set (m # ms) \<subseteq> M

goal (2 subgoals):
 1. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 2. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
define ss where "ss = replicate (Suc (length ms)) (0::'r)"
[PROOF STATE]
proof (state)
this:
ss = replicate (Suc (length ms)) (0::'r)

goal (2 subgoals):
 1. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 2. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
from 3(2) ss_def
[PROOF STATE]
proof (chain)
picking this:
set (m # ms) \<subseteq> M
ss = replicate (Suc (length ms)) (0::'r)
[PROOF STEP]
have  "set ss \<subseteq> R" "length ss = length (m#ms)" "[] \<bullet>\<cdot> (m#ms) = ss \<bullet>\<cdot> (m#ms)"
[PROOF STATE]
proof (prove)
using this:
set (m # ms) \<subseteq> M
ss = replicate (Suc (length ms)) (0::'r)

goal (1 subgoal):
 1. set ss \<subseteq> R &&& length ss = length (m # ms) &&& [] \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)
[PROOF STEP]
using R_scalars.zero_closed lincomb_Nil
          lincomb_replicate0_left[of "m#ms" "Suc (length ms)"]
[PROOF STATE]
proof (prove)
using this:
set (m # ms) \<subseteq> M
ss = replicate (Suc (length ms)) (0::'r)
(0::'r) \<in> R
?rs = [] \<or> ?ms = [] \<Longrightarrow> ?rs \<bullet>\<cdot> ?ms = (0::'m)
set (m # ms) \<subseteq> M \<Longrightarrow> replicate (Suc (length ms)) (0::'r) \<bullet>\<cdot> (m # ms) = (0::'m)

goal (1 subgoal):
 1. set ss \<subseteq> R &&& length ss = length (m # ms) &&& [] \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
set ss \<subseteq> R
length ss = length (m # ms)
[] \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)

goal (2 subgoals):
 1. \<And>y ys. \<lbrakk>set [] \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length []) ss = take (length (y # ys)) [] \<and> [] \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
 2. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set ss \<subseteq> R
length ss = length (m # ms)
[] \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)

goal (1 subgoal):
 1. \<exists>ss. set ss \<subseteq> R \<and> length ss = length (m # ms) \<and> take (length []) ss = take (length (m # ms)) [] \<and> [] \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ss. set ss \<subseteq> R \<and> length ss = length (m # ms) \<and> take (length []) ss = take (length (m # ms)) [] \<and> [] \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
case (4 r rs m ms)
[PROOF STATE]
proof (state)
this:
\<lbrakk>set rs \<subseteq> R; set ms \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ms \<and> take (length rs) ss = take (length ms) rs \<and> rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms
set (r # rs) \<subseteq> R
set (m # ms) \<subseteq> M

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set rs \<subseteq> R; set ms \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ms \<and> take (length rs) ss = take (length ms) rs \<and> rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms
set (r # rs) \<subseteq> R
set (m # ms) \<subseteq> M
[PROOF STEP]
obtain ss
    where ss: "set ss \<subseteq> R" "length ss = length ms"
              "take (length rs) ss = take (length ms) rs" "rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set rs \<subseteq> R; set ms \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ms \<and> take (length rs) ss = take (length ms) rs \<and> rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms
set (r # rs) \<subseteq> R
set (m # ms) \<subseteq> M

goal (1 subgoal):
 1. (\<And>ss. \<lbrakk>set ss \<subseteq> R; length ss = length ms; take (length rs) ss = take (length ms) rs; rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by  auto
[PROOF STATE]
proof (state)
this:
set ss \<subseteq> R
length ss = length ms
take (length rs) ss = take (length ms) rs
rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
from 4(2) ss
[PROOF STATE]
proof (chain)
picking this:
set (r # rs) \<subseteq> R
set ss \<subseteq> R
length ss = length ms
take (length rs) ss = take (length ms) rs
rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms
[PROOF STEP]
have
    "set (r#ss) \<subseteq> R" "length (r#ss) = length (m#ms)"
    "take (length (r#rs)) (r#ss) = take (length (m#ms)) (r#rs)"
    "(r#rs) \<bullet>\<cdot> (m#ms) = (r#ss) \<bullet>\<cdot> (m#ms)"
[PROOF STATE]
proof (prove)
using this:
set (r # rs) \<subseteq> R
set ss \<subseteq> R
length ss = length ms
take (length rs) ss = take (length ms) rs
rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms

goal (1 subgoal):
 1. (set (r # ss) \<subseteq> R &&& length (r # ss) = length (m # ms)) &&& take (length (r # rs)) (r # ss) = take (length (m # ms)) (r # rs) &&& (r # rs) \<bullet>\<cdot> (m # ms) = (r # ss) \<bullet>\<cdot> (m # ms)
[PROOF STEP]
using lincomb_Cons
[PROOF STATE]
proof (prove)
using this:
set (r # rs) \<subseteq> R
set ss \<subseteq> R
length ss = length ms
take (length rs) ss = take (length ms) rs
rs \<bullet>\<cdot> ms = ss \<bullet>\<cdot> ms
(?r # ?rs) \<bullet>\<cdot> (?m # ?ms) = ?r \<cdot> ?m + ?rs \<bullet>\<cdot> ?ms

goal (1 subgoal):
 1. (set (r # ss) \<subseteq> R &&& length (r # ss) = length (m # ms)) &&& take (length (r # rs)) (r # ss) = take (length (m # ms)) (r # rs) &&& (r # rs) \<bullet>\<cdot> (m # ms) = (r # ss) \<bullet>\<cdot> (m # ms)
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
set (r # ss) \<subseteq> R
length (r # ss) = length (m # ms)
take (length (r # rs)) (r # ss) = take (length (m # ms)) (r # rs)
(r # rs) \<bullet>\<cdot> (m # ms) = (r # ss) \<bullet>\<cdot> (m # ms)

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>\<lbrakk>set xs \<subseteq> R; set ys \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length ys \<and> take (length xs) ss = take (length ys) xs \<and> xs \<bullet>\<cdot> ys = ss \<bullet>\<cdot> ys; set (x # xs) \<subseteq> R; set (y # ys) \<subseteq> M\<rbrakk> \<Longrightarrow> \<exists>ss. set ss \<subseteq> R \<and> length ss = length (y # ys) \<and> take (length (x # xs)) ss = take (length (y # ys)) (x # xs) \<and> (x # xs) \<bullet>\<cdot> (y # ys) = ss \<bullet>\<cdot> (y # ys)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set (r # ss) \<subseteq> R
length (r # ss) = length (m # ms)
take (length (r # rs)) (r # ss) = take (length (m # ms)) (r # rs)
(r # rs) \<bullet>\<cdot> (m # ms) = (r # ss) \<bullet>\<cdot> (m # ms)

goal (1 subgoal):
 1. \<exists>ss. set ss \<subseteq> R \<and> length ss = length (m # ms) \<and> take (length (r # rs)) ss = take (length (m # ms)) (r # rs) \<and> (r # rs) \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>ss. set ss \<subseteq> R \<and> length ss = length (m # ms) \<and> take (length (r # rs)) ss = take (length (m # ms)) (r # rs) \<and> (r # rs) \<bullet>\<cdot> (m # ms) = ss \<bullet>\<cdot> (m # ms)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_plus_list [simp]:
  fixes xs :: "'a::plus list"
  assumes "i < length xs" "i < length ys"
  shows "(xs+ys)!i = xs!i + ys!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs + ys) ! i = xs ! i + ys ! i
[PROOF STEP]
by (simp add: plus_list_def assms)


[STATEMENT]
lemma tl_subset:
  "xs \<noteq> [] \<Longrightarrow> set xs \<subseteq> A \<Longrightarrow> set (tl xs) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> set (tl xs) \<subseteq> A
[PROOF STEP]
by (metis in_set_tlD rev_subsetD subsetI)


[STATEMENT]
lemma dist_pos_lt: "x \<noteq> y \<Longrightarrow> 0 < dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> 0 < dist x y
[PROOF STEP]
by (simp add: zero_less_dist_iff)


[STATEMENT]
lemma atLeastLessThan_less_eq2:
assumes "inj_on f {0..<(m::nat)} \<and> f ` {0..<m} \<le> {0..<n}"
shows "m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on f {0..<m} \<and> f ` {0..<m} \<subseteq> {0..<n}

goal (1 subgoal):
 1. m \<le> n
[PROOF STEP]
using finite_atLeastLessThan[of m] finite_atLeastLessThan[of n]
      card_atLeastLessThan[of m] card_atLeastLessThan[of n]
      card_inj_on_le[of f "{0 ..< m}" "{0 ..< n}"]
[PROOF STATE]
proof (prove)
using this:
inj_on f {0..<m} \<and> f ` {0..<m} \<subseteq> {0..<n}
finite {m..<?u}
finite {n..<?u}
card {m..<?u} = ?u - m
card {n..<?u} = ?u - n
\<lbrakk>inj_on f {0..<m}; f ` {0..<m} \<subseteq> {0..<n}; finite {0..<n}\<rbrakk> \<Longrightarrow> card {0..<m} \<le> card {0..<n}

goal (1 subgoal):
 1. m \<le> n
[PROOF STEP]
by fastforce


[STATEMENT]
lemma wf_less_interval:"
  wf { (x,y). x \<in> (I::nat set) \<and> y \<in> I \<and> x < y }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(x, y). x \<in> I \<and> y \<in> I \<and> x < y}
[PROOF STEP]
apply (rule wf_subset[where
  p="{ (x,y). x \<in> I \<and> y \<in> I \<and> x < y }" and
  r="{(x,y). x < y}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wf {(x, y). x < y}
 2. {(x, y). x \<in> I \<and> y \<in> I \<and> x < y} \<subseteq> {(x, y). x < y}
[PROOF STEP]
apply (rule wf_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). x \<in> I \<and> y \<in> I \<and> x < y} \<subseteq> {(x, y). x < y}
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma local_lipschitz_compact_bicomposeE:
  assumes ll: "local_lipschitz T X f"
  assumes cf: "\<And>x. x \<in> X \<Longrightarrow> continuous_on I (\<lambda>t. f t x)"
  assumes cI: "compact I"
  assumes "I \<subseteq> T"
  assumes cv: "continuous_on I v"
  assumes cw: "continuous_on I w"
  assumes v: "v ` I \<subseteq> X"
  assumes w: "w ` I \<subseteq> X"
  obtains L where "L > 0" "\<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from v w
[PROOF STATE]
proof (chain)
picking this:
v ` I \<subseteq> X
w ` I \<subseteq> X
[PROOF STEP]
have "v ` I \<union> w ` I \<subseteq> X"
[PROOF STATE]
proof (prove)
using this:
v ` I \<subseteq> X
w ` I \<subseteq> X

goal (1 subgoal):
 1. v ` I \<union> w ` I \<subseteq> X
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v ` I \<union> w ` I \<subseteq> X

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with ll \<open>I \<subseteq> T\<close>
[PROOF STATE]
proof (chain)
picking this:
local_lipschitz T X f
I \<subseteq> T
v ` I \<union> w ` I \<subseteq> X
[PROOF STEP]
have llI:"local_lipschitz I (v ` I \<union> w ` I) f"
[PROOF STATE]
proof (prove)
using this:
local_lipschitz T X f
I \<subseteq> T
v ` I \<union> w ` I \<subseteq> X

goal (1 subgoal):
 1. local_lipschitz I (v ` I \<union> w ` I) f
[PROOF STEP]
by (rule local_lipschitz_subset)
[PROOF STATE]
proof (state)
this:
local_lipschitz I (v ` I \<union> w ` I) f

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have cvwI: "compact (v ` I \<union> w ` I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (v ` I \<union> w ` I)
[PROOF STEP]
by (auto intro!: compact_continuous_image cv cw cI)
[PROOF STATE]
proof (state)
this:
compact (v ` I \<union> w ` I)

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from local_lipschitz_compact_implies_lipschitz[OF llI cvwI \<open>compact I\<close> cf]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x. x \<in> v ` I \<union> w ` I \<Longrightarrow> x \<in> X; \<And>L. (\<And>t. t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f t)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
obtain L where L: "\<And>t. t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f t)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> v ` I \<union> w ` I \<Longrightarrow> x \<in> X; \<And>L. (\<And>t. t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f t)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>L. (\<And>t. t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f t)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using v w
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> v ` I \<union> w ` I \<Longrightarrow> x \<in> X; \<And>L. (\<And>t. t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f t)) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
v ` I \<subseteq> X
w ` I \<subseteq> X

goal (1 subgoal):
 1. (\<And>L. (\<And>t. t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f t)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f ?t)

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define L' where "L' = max L 1"
[PROOF STATE]
proof (state)
this:
L' = max L 1

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
?t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f ?t)
L' = max L 1
[PROOF STEP]
have "L' > 0" "\<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L' * dist (v x) (w x)"
[PROOF STATE]
proof (prove)
using this:
?t \<in> I \<Longrightarrow> L-lipschitz_on (v ` I \<union> w ` I) (f ?t)
L' = max L 1

goal (1 subgoal):
 1. 0 < L' &&& (\<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L' * dist (v x) (w x))
[PROOF STEP]
apply (auto simp: lipschitz_on_def L'_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> I; \<And>t. t \<in> I \<Longrightarrow> 0 \<le> L \<and> (\<forall>x\<in>v ` I \<union> w ` I. \<forall>y\<in>v ` I \<union> w ` I. dist (f t x) (f t y) \<le> L * dist x y)\<rbrakk> \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> max L 1 * dist (v x) (w x)
[PROOF STEP]
by (smt Un_iff image_eqI mult_right_mono zero_le_dist)
[PROOF STATE]
proof (state)
this:
0 < L'
?x \<in> I \<Longrightarrow> dist (f ?x (v ?x)) (f ?x (w ?x)) \<le> L' * dist (v ?x) (w ?x)

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>0 < L; \<And>x. x \<in> I \<Longrightarrow> dist (f x (v x)) (f x (w x)) \<le> L * dist (v x) (w x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < L'
?x \<in> I \<Longrightarrow> dist (f ?x (v ?x)) (f ?x (w ?x)) \<le> L' * dist (v ?x) (w ?x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < L'
?x \<in> I \<Longrightarrow> dist (f ?x (v ?x)) (f ?x (w ?x)) \<le> L' * dist (v ?x) (w ?x)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma member_inter [simp]:
  "member (inter (t1 :: 'a set_rbt) t2) = (\<lambda>x. member t1 x \<and> member t2 x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. member (RBT_Set2.inter t1 t2) = (\<lambda>x. member t1 x \<and> member t2 x)
[PROOF STEP]
by(auto simp add: member_lookup fun_eq_iff lookup_meet[OF ID_ccompare_neq_None] split: option.split)


[STATEMENT]
lemma Ord_mem_iff_less_TC: "Ord l \<Longrightarrow> k \<in> elts l \<longleftrightarrow> k \<sqsubset> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord l \<Longrightarrow> (k \<in> elts l) = (k \<sqsubset> l)
[PROOF STEP]
by (simp add: Ord_def less_TC_def)


[STATEMENT]
lemma linear_matrix_vector_mul_eq:
  "Vector_Spaces.linear (*s) (*s) f \<longleftrightarrow> linear (f :: real^'n \<Rightarrow> real ^'m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Vector_Spaces.linear (*s) (*s) f = linear f
[PROOF STEP]
by (simp add: scalar_mult_eq_scaleR linear_def)


[STATEMENT]
lemma fls_right_inverse_idempotent_ring1:
  fixes   f :: "'a::ring_1 fls"
  assumes "f $$ fls_subdegree f * x = 1" "x * y = 1"
  \<comment> \<open>These assumptions imply y equals f $$ fls_subdegree f, but no need to assume that.\<close>
  shows   "fls_right_inverse (fls_right_inverse f x) y = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_right_inverse (fls_right_inverse f x) y = f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_right_inverse (fls_right_inverse f x) y = f
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
f $$ fls_subdegree f * x = (1::'a)
[PROOF STEP]
have
    "f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) =
      fls_right_inverse (fls_right_inverse f x) y"
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * x = (1::'a)

goal (1 subgoal):
 1. f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) = fls_right_inverse (fls_right_inverse f x) y
[PROOF STEP]
using fls_right_inverse [of f]
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * x = (1::'a)
f $$ fls_subdegree f * ?y = (1::'a) \<Longrightarrow> f * fls_right_inverse f ?y = 1

goal (1 subgoal):
 1. f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) = fls_right_inverse (fls_right_inverse f x) y
[PROOF STEP]
by (simp add: mult.assoc[symmetric])
[PROOF STATE]
proof (state)
this:
f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) = fls_right_inverse (fls_right_inverse f x) y

goal (1 subgoal):
 1. fls_right_inverse (fls_right_inverse f x) y = f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) = fls_right_inverse (fls_right_inverse f x) y

goal (1 subgoal):
 1. fls_right_inverse (fls_right_inverse f x) y = f
[PROOF STEP]
have
    "fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y = 1
[PROOF STEP]
using assms fls_lr_inverse_subdegree(2)[of x f] fls_lr_inverse_base(2)[of f x]
[PROOF STATE]
proof (prove)
using this:
f $$ fls_subdegree f * x = (1::'a)
x * y = (1::'a)
x \<noteq> (0::'a) \<Longrightarrow> fls_subdegree (fls_right_inverse f x) = - fls_subdegree f
fls_right_inverse f x $$ - fls_subdegree f = x

goal (1 subgoal):
 1. fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y = 1
[PROOF STEP]
by    (fastforce intro: fls_right_inverse)
[PROOF STATE]
proof (state)
this:
fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y = 1

goal (1 subgoal):
 1. fls_right_inverse (fls_right_inverse f x) y = f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) = fls_right_inverse (fls_right_inverse f x) y
fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f * (fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y) = fls_right_inverse (fls_right_inverse f x) y
fls_right_inverse f x * fls_right_inverse (fls_right_inverse f x) y = 1

goal (1 subgoal):
 1. fls_right_inverse (fls_right_inverse f x) y = f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_right_inverse (fls_right_inverse f x) y = f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remove_vertex_V: "V\<^bsub>remove_vertex x\<^esub> = V - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V\<^bsub>remove_vertex x\<^esub> = V - {x}
[PROOF STEP]
unfolding remove_vertex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V\<^bsub>G\<lparr>verts := V - {x}, arcs := Restr E (V - {x})\<rparr>\<^esub> = V - {x}
[PROOF STEP]
by auto


[STATEMENT]
lemma List_rec_unfold_lemma:
     "(\<lambda>M. List_rec M c d) \<equiv>
      wfrec (pred_sexp\<^sup>+) (\<lambda>g. List_case c (\<lambda>x y. d x y (g y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lambda>M. List_rec M c d \<equiv> wfrec (pred_sexp\<^sup>+) (\<lambda>g. List_case c (\<lambda>x y. d x y (g y)))
[PROOF STEP]
by (simp add: List_rec_def)


[STATEMENT]
lemma nat_take_bit_eq:
  \<open>nat (take_bit n k) = take_bit n (nat k)\<close>
  if \<open>k \<ge> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (take_bit n k) = take_bit n (nat k)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 \<le> k

goal (1 subgoal):
 1. nat (take_bit n k) = take_bit n (nat k)
[PROOF STEP]
by (simp add: take_bit_eq_mod nat_mod_distrib nat_power_eq)


[STATEMENT]
lemma lookup_pp_of_exps:
  "lookup_pp (fst (rep_nat_term (of_exps a b i))) = (\<lambda>x. if x = 0 then a else if x = 1 then b else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup_pp (fst (rep_nat_term (of_exps a b i))) = (\<lambda>x. if x = 0 then a else if x = 1 then b else 0)
[PROOF STEP]
unfolding rep_nat_term_of_exps fst_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup_pp (pp_of_fun (\<lambda>x. if x = 0 then a else if x = 1 then b else 0)) = (\<lambda>x. if x = 0 then a else if x = 1 then b else 0)
[PROOF STEP]
proof (rule lookup_pp_of_fun)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {x. (if x = 0 then a else if x = 1 then b else 0) \<noteq> 0}
[PROOF STEP]
have "{x. (if x = 0 then a else if x = 1 then b else 0) \<noteq> 0} \<subseteq> {0, 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. (if x = (0::'b) then a else if x = (1::'b) then b else 0) \<noteq> 0} \<subseteq> {0::'b, 1::'b}
[PROOF STEP]
by (rule, simp split: if_split_asm)
[PROOF STATE]
proof (state)
this:
{x. (if x = (0::?'b1) then a else if x = (1::?'b1) then b else 0) \<noteq> 0} \<subseteq> {0::?'b1, 1::?'b1}

goal (1 subgoal):
 1. finite {x. (if x = 0 then a else if x = 1 then b else 0) \<noteq> 0}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x. (if x = (0::?'b1) then a else if x = (1::?'b1) then b else 0) \<noteq> 0} \<subseteq> {0::?'b1, 1::?'b1}

goal (1 subgoal):
 1. finite {x. (if x = 0 then a else if x = 1 then b else 0) \<noteq> 0}
[PROOF STEP]
have "finite ..."
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {0::'b, 1::'b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {0::?'b2, 1::?'b2}

goal (1 subgoal):
 1. finite {x. (if x = 0 then a else if x = 1 then b else 0) \<noteq> 0}
[PROOF STEP]
finally(finite_subset)
[PROOF STATE]
proof (chain)
picking this:
finite {x. (if x = (0::?'b3) then a else if x = (1::?'b3) then b else 0) \<noteq> 0}
[PROOF STEP]
show "finite {x. (if x = 0 then a else if x = 1 then b else 0) \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
finite {x. (if x = (0::?'b3) then a else if x = (1::?'b3) then b else 0) \<noteq> 0}

goal (1 subgoal):
 1. finite {x. (if x = (0::'b) then a else if x = (1::'b) then b else 0) \<noteq> 0}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite {x. (if x = (0::?'b3) then a else if x = (1::?'b3) then b else 0) \<noteq> 0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma analz_trans: "\<lbrakk> X\<in> analz G;  G \<subseteq> analz H \<rbrakk> \<Longrightarrow> X\<in> analz H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> analz G; G \<subseteq> analz H\<rbrakk> \<Longrightarrow> X \<in> analz H
[PROOF STEP]
by (drule analz_mono, blast)


[STATEMENT]
lemma list_updates_list_of_eucl_of_env[simp]:
  assumes [simp]: "length xs = DIM('a::executable_euclidean_space)" "distinct xs"
  shows "list_updates xs (list_of_eucl (eucl_of_env xs vs::'a)) vs = vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_updates xs (list_of_eucl (eucl_of_env xs vs)) vs = vs
[PROOF STEP]
by (auto intro!: nth_equalityI simp: list_updates_nth nth_list_update eucl_of_env_def)