[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 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)


[STATEMENT]
theorem dia_eq_fin_dia_if_strongly_con: "strongly_connected G \<Longrightarrow> diameter = fin_diameter"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strongly_connected G \<Longrightarrow> diameter = fin_diameter
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. strongly_connected G \<Longrightarrow> diameter x = fin_diameter x
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. strongly_connected G \<Longrightarrow> diameter x = fin_diameter x
[PROOF STEP]
assume strongly_con: "strongly_connected G"
[PROOF STATE]
proof (state)
this:
strongly_connected G

goal (1 subgoal):
 1. \<And>x. strongly_connected G \<Longrightarrow> diameter x = fin_diameter x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
strongly_connected G
[PROOF STEP]
have "\<infinity> \<notin> sp_costs f"
[PROOF STATE]
proof (prove)
using this:
strongly_connected G

goal (1 subgoal):
 1. \<infinity> \<notin> sp_costs f
[PROOF STEP]
unfolding sp_costs_def
[PROOF STATE]
proof (prove)
using this:
strongly_connected G

goal (1 subgoal):
 1. \<infinity> \<notin> {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c}
[PROOF STEP]
using \<mu>_reach_conv
[PROOF STATE]
proof (prove)
using this:
strongly_connected G
(\<mu> ?f ?u ?v < \<infinity>) = (?u \<rightarrow>\<^sup>* ?v)

goal (1 subgoal):
 1. \<infinity> \<notin> {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<infinity> \<notin> sp_costs f

goal (1 subgoal):
 1. \<And>x. strongly_connected G \<Longrightarrow> diameter x = fin_diameter x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<infinity> \<notin> sp_costs f
[PROOF STEP]
have "sp_costs f = fin_sp_costs f"
[PROOF STATE]
proof (prove)
using this:
\<infinity> \<notin> sp_costs f

goal (1 subgoal):
 1. sp_costs f = fin_sp_costs f
[PROOF STEP]
unfolding fin_sp_costs_def sp_costs_def
[PROOF STATE]
proof (prove)
using this:
\<infinity> \<notin> {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c}

goal (1 subgoal):
 1. {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c} = {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c \<and> c < \<infinity>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sp_costs f = fin_sp_costs f

goal (1 subgoal):
 1. \<And>x. strongly_connected G \<Longrightarrow> diameter x = fin_diameter x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sp_costs f = fin_sp_costs f
[PROOF STEP]
show "diameter f = fin_diameter f"
[PROOF STATE]
proof (prove)
using this:
sp_costs f = fin_sp_costs f

goal (1 subgoal):
 1. diameter f = fin_diameter f
[PROOF STEP]
unfolding diameter_def fin_diameter_def
[PROOF STATE]
proof (prove)
using this:
sp_costs f = fin_sp_costs f

goal (1 subgoal):
 1. Sup (sp_costs f) = Sup (fin_sp_costs f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diameter f = fin_diameter f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rcoset_replist_Hrep :
  assumes "Subgroup H" "is_rcoset_replist H gs"
  shows   "\<exists>g\<in>set gs. g \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g\<in>set gs. g \<in> H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g\<in>set gs. g \<in> H
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
is_rcoset_replist H gs
[PROOF STEP]
obtain g where g: "g \<in> set gs" "0 \<in> (rcoset_rel H)``{g}"
[PROOF STATE]
proof (prove)
using this:
is_rcoset_replist H gs

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g \<in> set gs; (0::'g) \<in> rcoset_rel H `` {g}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using zero_closed is_rcoset_replistD_cosets
[PROOF STATE]
proof (prove)
using this:
is_rcoset_replist H gs
(0::'g) \<in> G
is_rcoset_replist ?H ?gs \<Longrightarrow> G = (\<Union>g\<in>set ?gs. rcoset_rel ?H `` {g})

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g \<in> set gs; (0::'g) \<in> rcoset_rel H `` {g}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
g \<in> set gs
(0::'g) \<in> rcoset_rel H `` {g}

goal (1 subgoal):
 1. \<exists>g\<in>set gs. g \<in> H
[PROOF STEP]
from assms(1) g(2)
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
(0::'g) \<in> rcoset_rel H `` {g}
[PROOF STEP]
have "g \<in> (rcoset_rel H)``{0}"
[PROOF STATE]
proof (prove)
using this:
Subgroup H
(0::'g) \<in> rcoset_rel H `` {g}

goal (1 subgoal):
 1. g \<in> rcoset_rel H `` {0::'g}
[PROOF STEP]
using rcoset_equiv equivE sym_def[of "rcoset_rel H"]
[PROOF STATE]
proof (prove)
using this:
Subgroup H
(0::'g) \<in> rcoset_rel H `` {g}
Subgroup ?H \<Longrightarrow> equiv G (rcoset_rel ?H)
\<lbrakk>equiv ?A ?r; \<lbrakk>refl_on ?A ?r; sym ?r; trans ?r\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
sym (rcoset_rel H) = (\<forall>x y. (x, y) \<in> rcoset_rel H \<longrightarrow> (y, x) \<in> rcoset_rel H)

goal (1 subgoal):
 1. g \<in> rcoset_rel H `` {0::'g}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
g \<in> rcoset_rel H `` {0::'g}

goal (1 subgoal):
 1. \<exists>g\<in>set gs. g \<in> H
[PROOF STEP]
with assms(1) g
[PROOF STATE]
proof (chain)
picking this:
Subgroup H
g \<in> set gs
(0::'g) \<in> rcoset_rel H `` {g}
g \<in> rcoset_rel H `` {0::'g}
[PROOF STEP]
show "\<exists>g\<in>set gs. g \<in> H"
[PROOF STATE]
proof (prove)
using this:
Subgroup H
g \<in> set gs
(0::'g) \<in> rcoset_rel H `` {g}
g \<in> rcoset_rel H `` {0::'g}

goal (1 subgoal):
 1. \<exists>g\<in>set gs. g \<in> H
[PROOF STEP]
using rcoset0
[PROOF STATE]
proof (prove)
using this:
Subgroup H
g \<in> set gs
(0::'g) \<in> rcoset_rel H `` {g}
g \<in> rcoset_rel H `` {0::'g}
Subgroup ?H \<Longrightarrow> rcoset_rel ?H `` {0::'g} = ?H

goal (1 subgoal):
 1. \<exists>g\<in>set gs. g \<in> H
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>g\<in>set gs. g \<in> H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SbisL_intro[intro]:
assumes "length cl = length dl" and
"\<And> n. \<lbrakk>n < length cl; n < length dl\<rbrakk> \<Longrightarrow> cl ! n \<approx>s dl ! n"
shows "SbisL cl dl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SbisL cl dl
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length cl = length dl
\<lbrakk>?n1 < length cl; ?n1 < length dl\<rbrakk> \<Longrightarrow> cl ! ?n1 \<approx>s dl ! ?n1

goal (1 subgoal):
 1. SbisL cl dl
[PROOF STEP]
unfolding SbisL_def
[PROOF STATE]
proof (prove)
using this:
length cl = length dl
\<lbrakk>?n1 < length cl; ?n1 < length dl\<rbrakk> \<Longrightarrow> cl ! ?n1 \<approx>s dl ! ?n1

goal (1 subgoal):
 1. length cl = length dl \<and> (\<forall>n<length cl. cl ! n \<approx>s dl ! n)
[PROOF STEP]
by auto


[STATEMENT]
lemma fv_ik_subset_fv_sst'[simp]: "fv\<^sub>s\<^sub>e\<^sub>t (ik\<^sub>s\<^sub>s\<^sub>t S) \<subseteq> fv\<^sub>s\<^sub>s\<^sub>t S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv\<^sub>s\<^sub>e\<^sub>t (ik\<^sub>s\<^sub>s\<^sub>t S) \<subseteq> fv\<^sub>s\<^sub>s\<^sub>t S
[PROOF STEP]
unfolding ik\<^sub>s\<^sub>s\<^sub>t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv\<^sub>s\<^sub>e\<^sub>t {uu_. \<exists>t ts. uu_ = t \<and> receive\<langle>ts\<rangle> \<in> set S \<and> t \<in> set ts} \<subseteq> fv\<^sub>s\<^sub>s\<^sub>t S
[PROOF STEP]
by (induct S) auto


[STATEMENT]
lemma bfun_integral_bound:
  assumes "(v :: 'a \<Rightarrow> 'c :: {euclidean_space}) \<in> bfun"
  shows "(\<lambda>S. \<integral>x. v x \<partial>(S :: 'a pmf)) \<in> bfun"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> bfun
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> bfun
[PROOF STEP]
obtain b where bH: "\<forall>x. norm (v x) \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<forall>x. norm (v x) \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using bfun_norm_le_SUP_norm assms
[PROOF STATE]
proof (prove)
using this:
?f \<in> bfun \<Longrightarrow> norm (?f ?x) \<le> (\<Squnion>x. norm (?f x))
v \<in> bfun

goal (1 subgoal):
 1. (\<And>b. \<forall>x. norm (v x) \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>x. norm (v x) \<le> b

goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> bfun
[PROOF STEP]
have "(\<integral>x. norm (v x) \<partial>S) \<le> b" for S :: "'a pmf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation S (\<lambda>x. norm (v x)) \<le> b
[PROOF STEP]
using \<open>v \<in> bfun\<close> bfun_def bounded_norm_comp bH bfun_prob_space_integrable
[PROOF STATE]
proof (prove)
using this:
v \<in> bfun
bfun = {f. bounded (range f)}
bounded ((\<lambda>x. norm (?f x)) ` ?S) = bounded (?f ` ?S)
\<forall>x. norm (v x) \<le> b
\<lbrakk>prob_space ?S; ?v \<in> borel_measurable ?S; ?v \<in> bfun\<rbrakk> \<Longrightarrow> integrable ?S ?v

goal (1 subgoal):
 1. measure_pmf.expectation S (\<lambda>x. norm (v x)) \<le> b
[PROOF STEP]
by (fastforce intro!: prob_space.integral_le_const prob_space_measure_pmf simp: bfun_def)
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation ?S (\<lambda>x. norm (v x)) \<le> b

goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> bfun
[PROOF STEP]
hence "\<forall>S :: 'a pmf. norm (\<integral>x. (v x) \<partial>S) \<le> b"
[PROOF STATE]
proof (prove)
using this:
measure_pmf.expectation ?S (\<lambda>x. norm (v x)) \<le> b

goal (1 subgoal):
 1. \<forall>x. norm (measure_pmf.expectation x v) \<le> b
[PROOF STEP]
using integral_norm_bound order_trans
[PROOF STATE]
proof (prove)
using this:
measure_pmf.expectation ?S (\<lambda>x. norm (v x)) \<le> b
norm (integral\<^sup>L ?M ?f) \<le> LINT x|?M. norm (?f x)
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. \<forall>x. norm (measure_pmf.expectation x v) \<le> b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x. norm (measure_pmf.expectation x v) \<le> b

goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> bfun
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x. norm (measure_pmf.expectation x v) \<le> b

goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> bfun
[PROOF STEP]
unfolding bfun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x. norm (measure_pmf.expectation x v) \<le> b

goal (1 subgoal):
 1. (\<lambda>S. measure_pmf.expectation S v) \<in> {f. bounded (range f)}
[PROOF STEP]
by (auto intro: boundedI)
[PROOF STATE]
proof (state)
this:
(\<lambda>S. measure_pmf.expectation S v) \<in> bfun

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in subgroup) finite_imp_card_positive: "finite (carrier G) \<Longrightarrow> 0 < card H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> 0 < card H
[PROOF STEP]
using subset one_closed card_gt_0_iff finite_subset
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
\<one> \<in> H
(0 < card ?A) = (?A \<noteq> {} \<and> finite ?A)
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (carrier G) \<Longrightarrow> 0 < card H
[PROOF STEP]
by blast


[STATEMENT]
lemma group_card_in_type: "g \<in> \<G> \<Longrightarrow> \<exists> x . (card g, x) \<in> group_type \<and> x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> \<G> \<Longrightarrow> \<exists>x. (card g, x) \<in> group_type \<and> 1 \<le> x
[PROOF STEP]
unfolding group_type_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> \<G> \<Longrightarrow> \<exists>x. (card g, x) \<in> {(g, groups_of_size g) |g. g \<in> group_sizes} \<and> 1 \<le> x
[PROOF STEP]
using group_card_non_zero_groups_of_size_min
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?g \<in> \<G>; card ?g = ?a\<rbrakk> \<Longrightarrow> 1 \<le> groups_of_size ?a

goal (1 subgoal):
 1. g \<in> \<G> \<Longrightarrow> \<exists>x. (card g, x) \<in> {(g, groups_of_size g) |g. g \<in> group_sizes} \<and> 1 \<le> x
[PROOF STEP]
by (simp add: group_card_in_sizes)


[STATEMENT]
lemma (in inj_comm_ring_hom) poly_div_hom:
  "map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)
[PROOF STEP]
have zero: "\<forall>x. hom x = 0 \<longrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. hom x = (0::'b) \<longrightarrow> x = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x. hom x = (0::'b) \<longrightarrow> x = (0::'a)

goal (1 subgoal):
 1. map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)
[PROOF STEP]
interpret mh: map_poly_inj_comm_ring_hom
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly_inj_comm_ring_hom hom
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)
[PROOF STEP]
unfolding poly_div_def mh.resultant_hom[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant (map_poly (map_poly hom) (poly_x_mult_y p)) (map_poly (map_poly hom) (poly_lift q)) = resultant (poly_x_mult_y (map_poly hom p)) (poly_lift (map_poly hom q))
[PROOF STEP]
by (simp add: poly_x_mult_y_hom)
[PROOF STATE]
proof (state)
this:
map_poly hom (poly_div p q) = poly_div (map_poly hom p) (map_poly hom q)

goal:
No subgoals!
[PROOF STEP]
qed