[STATEMENT]
theorem Tensor_Invariance:
 "(is_tangle_diagram ws1) \<and> (is_tangle_diagram ws2)
 \<Longrightarrow> (kauff_mat (ws1 \<otimes> ws2) = (kauff_mat ws1) \<otimes> (kauff_mat ws2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram ws1 \<and> is_tangle_diagram ws2 \<Longrightarrow> kauff_mat (ws1 \<otimes> ws2) = kauff_mat ws1 \<otimes> kauff_mat ws2
[PROOF STEP]
proof(induction rule:tensor.induct)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>x y. is_tangle_diagram (basic x) \<and> is_tangle_diagram (basic y) \<Longrightarrow> kauff_mat (basic x \<otimes> basic y) = kauff_mat (basic x) \<otimes> kauff_mat (basic y)
 2. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 3. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 4. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (basic x_) \<and> is_tangle_diagram (basic y_)

goal (4 subgoals):
 1. \<And>x y. is_tangle_diagram (basic x) \<and> is_tangle_diagram (basic y) \<Longrightarrow> kauff_mat (basic x \<otimes> basic y) = kauff_mat (basic x) \<otimes> kauff_mat (basic y)
 2. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 3. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 4. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (basic x_ \<otimes> basic y_) = kauff_mat (basic x_) \<otimes> kauff_mat (basic y_)
[PROOF STEP]
using kauff_mat_tensor_distrib
[PROOF STATE]
proof (prove)
using this:
\<forall>xs ys. kauff_mat (basic xs \<otimes> basic ys) = kauff_mat (basic xs) \<otimes> kauff_mat (basic ys)

goal (1 subgoal):
 1. kauff_mat (basic x_ \<otimes> basic y_) = kauff_mat (basic x_) \<otimes> kauff_mat (basic y_)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic x_ \<otimes> basic y_) = kauff_mat (basic x_) \<otimes> kauff_mat (basic y_)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
fix a b as bs
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
assume hyps:"  is_tangle_diagram as \<and> is_tangle_diagram bs
                \<Longrightarrow> (kauff_mat (as \<otimes> bs) = kauff_mat as \<otimes> kauff_mat bs)"
[PROOF STATE]
proof (state)
this:
is_tangle_diagram as \<and> is_tangle_diagram bs \<Longrightarrow> kauff_mat (as \<otimes> bs) = kauff_mat as \<otimes> kauff_mat bs

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
assume prems:" is_tangle_diagram (a*as) \<and> is_tangle_diagram (b*bs) "
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (a * as) \<and> is_tangle_diagram (b * bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
let ?case =  "kauff_mat (a * as \<otimes> b * bs)
                         = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have 0:"rat_poly.matrix_match
                         (blockmat a)
                         (kauff_mat as)
                         (blockmat b)
                         (kauff_mat bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat bs)
[PROOF STEP]
using prems is_tangle_diagram_matrix_match
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (a * as) \<and> is_tangle_diagram (b * bs)
\<lbrakk>is_tangle_diagram (?w1.0 * ?ws1.0); is_tangle_diagram (?w2.0 * ?ws2.0)\<rbrakk> \<Longrightarrow> rat_poly.matrix_match (blockmat ?w1.0) (kauff_mat ?ws1.0) (blockmat ?w2.0) (kauff_mat ?ws2.0)

goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat bs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have 1:"is_tangle_diagram as \<and> is_tangle_diagram bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram as \<and> is_tangle_diagram bs
[PROOF STEP]
using prems is_tangle_diagram.simps
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (a * as) \<and> is_tangle_diagram (b * bs)
is_tangle_diagram (basic ?x) = True
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)

goal (1 subgoal):
 1. is_tangle_diagram as \<and> is_tangle_diagram bs
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram as \<and> is_tangle_diagram bs

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have "kauff_mat ((a * as) \<otimes> (b * bs))
                          = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> b * bs) = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))
[PROOF STEP]
using tensor.simps
[PROOF STATE]
proof (prove)
using this:
basic ?x \<otimes> basic ?y = basic (?x \<otimes> ?y)
?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)))))
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))
?x * ?xs \<otimes> ?y * ?ys = (?x \<otimes> ?y) * (?xs \<otimes> ?ys)

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> b * bs) = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> b * bs) = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> b * bs) = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have "... = rat_poly.matrix_mult
                                   (blockmat (a \<otimes> b))
                                   (kauff_mat (as \<otimes> bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat ((a \<otimes> b) * (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs))
[PROOF STEP]
using kauff_mat.simps(2)
[PROOF STATE]
proof (prove)
using this:
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. kauff_mat ((a \<otimes> b) * (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat ((a \<otimes> b) * (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs))

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat ((a \<otimes> b) * (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs))

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have "... = rat_poly.matrix_mult
                             ((blockmat a) \<otimes> (blockmat b))
                             ((kauff_mat as) \<otimes> (kauff_mat bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs)
[PROOF STEP]
using hyps 1  kauff_mat_tensor_distrib
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram as \<and> is_tangle_diagram bs \<Longrightarrow> kauff_mat (as \<otimes> bs) = kauff_mat as \<otimes> kauff_mat bs
is_tangle_diagram as \<and> is_tangle_diagram bs
\<forall>xs ys. kauff_mat (basic xs \<otimes> basic ys) = kauff_mat (basic xs) \<otimes> kauff_mat (basic ys)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have "... =(rat_poly.matrix_mult (blockmat a) (kauff_mat as))
                         \<otimes> (rat_poly.matrix_mult (blockmat b) (kauff_mat bs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs)
[PROOF STEP]
using 0 rat_poly.distributivity
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat bs)
rat_poly.matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> rat_poly.matrix_mult ?A1.0 ?A2.0 \<otimes> rat_poly.matrix_mult ?B1.0 ?B2.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) (?A2.0 \<otimes> ?B2.0)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
have "... = kauff_mat (a*as) \<otimes> kauff_mat (b*bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs) = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs) = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)

goal (3 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
 3. \<And>x xs y ys. \<lbrakk>is_tangle_diagram xs \<and> is_tangle_diagram ys \<Longrightarrow> kauff_mat (xs \<otimes> ys) = kauff_mat xs \<otimes> kauff_mat ys; is_tangle_diagram (x * xs) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> y * ys) = kauff_mat (x * xs) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (a * as \<otimes> b * bs) = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))
kauff_mat ((a \<otimes> b) * (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs))
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs)
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs)
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs) = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
kauff_mat (a * as \<otimes> b * bs) = kauff_mat ((a \<otimes> b) * (as \<otimes> bs))
kauff_mat ((a \<otimes> b) * (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs))
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> bs)) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs)
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat bs) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs)
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat bs) = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> b * bs) = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> b * bs) = kauff_mat (a * as) \<otimes> kauff_mat (b * bs)

goal (2 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
fix a b as bs
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
assume hyps:"codomain_block b \<noteq> 0
            \<Longrightarrow> is_tangle_diagram as
               \<and> is_tangle_diagram
                      (basic (make_vert_block (nat (codomain_block b))))
            \<Longrightarrow> kauff_mat
                  (as \<otimes> basic (make_vert_block (nat (codomain_block b))))
                   = kauff_mat as
                      \<otimes> kauff_mat
                         (basic (make_vert_block (nat (codomain_block b))))"
[PROOF STATE]
proof (state)
this:
\<lbrakk>codomain_block b \<noteq> 0; is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))\<rbrakk> \<Longrightarrow> kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))

goal (2 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
assume prems:"is_tangle_diagram (a * as) \<and> is_tangle_diagram (basic b)"
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (a * as) \<and> is_tangle_diagram (basic b)

goal (2 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
let ?case = " kauff_mat (a * as \<otimes> basic b)
                  = kauff_mat (a * as) \<otimes> kauff_mat (basic b)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xs y. \<lbrakk>\<lbrakk>codomain_block y \<noteq> 0; is_tangle_diagram xs \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block y))))\<rbrakk> \<Longrightarrow> kauff_mat (xs \<otimes> basic (make_vert_block (nat (codomain_block y)))) = kauff_mat xs \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block y)))); is_tangle_diagram (x * xs) \<and> is_tangle_diagram (basic y)\<rbrakk> \<Longrightarrow> kauff_mat (x * xs \<otimes> basic y) = kauff_mat (x * xs) \<otimes> kauff_mat (basic y)
 2. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
proof(cases "codomain_block b = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
codomain_block b = 0

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have "((a * as) \<otimes> (basic b)) =  ((a \<otimes>b) *  as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * as \<otimes> basic b = (a \<otimes> b) * as
[PROOF STEP]
using tensor.simps True
[PROOF STATE]
proof (prove)
using this:
basic ?x \<otimes> basic ?y = basic (?x \<otimes> ?y)
?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)))))
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))
?x * ?xs \<otimes> ?y * ?ys = (?x \<otimes> ?y) * (?xs \<otimes> ?ys)
codomain_block b = 0

goal (1 subgoal):
 1. a * as \<otimes> basic b = (a \<otimes> b) * as
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * as \<otimes> basic b = (a \<otimes> b) * as

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * as \<otimes> basic b = (a \<otimes> b) * as
[PROOF STEP]
have "kauff_mat ((a * as) \<otimes> (basic b))
                           = kauff_mat ((a \<otimes>b) *  as)"
[PROOF STATE]
proof (prove)
using this:
a * as \<otimes> basic b = (a \<otimes> b) * as

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have "... =
                              rat_poly.matrix_mult
                                   (blockmat (a \<otimes> b))
                                   (kauff_mat as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat ((a \<otimes> b) * as) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat ((a \<otimes> b) * as) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat ((a \<otimes> b) * as) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have "... =
                           rat_poly.matrix_mult
                                     ((blockmat a) \<otimes> (blockmat b))
                                     (kauff_mat as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)
[PROOF STEP]
using  blockmat_tensor_distrib
[PROOF STATE]
proof (prove)
using this:
blockmat (?a \<otimes> ?b) = blockmat ?a \<otimes> blockmat ?b

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * as)
kauff_mat ((a \<otimes> b) * as) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as)
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)
[PROOF STEP]
have T1:
                     "kauff_mat ((a * as) \<otimes> (basic b))
                             = rat_poly.matrix_mult
                                     ((blockmat a) \<otimes> (blockmat b))
                               (kauff_mat as)"
[PROOF STATE]
proof (prove)
using this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * as)
kauff_mat ((a \<otimes> b) * as) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as)
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat as) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (a * as \<otimes> basic b) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)
[PROOF STEP]
have "weak_matrix_match
                            (blockmat a)
                            (kauff_mat as)
                            (blockmat b)"
[PROOF STATE]
proof (prove)
using this:
kauff_mat (a * as \<otimes> basic b) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)

goal (1 subgoal):
 1. weak_matrix_match (blockmat a) (kauff_mat as) (blockmat b)
[PROOF STEP]
using is_tangle_diagram_weak_matrix_match True prems
[PROOF STATE]
proof (prove)
using this:
kauff_mat (a * as \<otimes> basic b) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)
\<lbrakk>is_tangle_diagram (?w1.0 * ?ws1.0); codomain_block ?w2.0 = 0\<rbrakk> \<Longrightarrow> weak_matrix_match (blockmat ?w1.0) (kauff_mat ?ws1.0) (blockmat ?w2.0)
codomain_block b = 0
is_tangle_diagram (a * as) \<and> is_tangle_diagram (basic b)

goal (1 subgoal):
 1. weak_matrix_match (blockmat a) (kauff_mat as) (blockmat b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
weak_matrix_match (blockmat a) (kauff_mat as) (blockmat b)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
weak_matrix_match (blockmat a) (kauff_mat as) (blockmat b)
[PROOF STEP]
have "rat_poly.matrix_mult
                        ((blockmat a) \<otimes> (blockmat b))
                        (kauff_mat as)
                              = ((rat_poly.matrix_mult
                                           (blockmat a)
                                            (kauff_mat as))
                                  \<otimes> (blockmat b))"
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match (blockmat a) (kauff_mat as) (blockmat b)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
[PROOF STEP]
using weak_distributivity1
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match (blockmat a) (kauff_mat as) (blockmat b)
weak_matrix_match ?A1.0 ?A2.0 ?B1.0 \<Longrightarrow> rat_poly.matrix_mult ?A1.0 ?A2.0 \<otimes> ?B1.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) ?A2.0

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have "... = (kauff_mat (a*as)) \<otimes> (kauff_mat (basic b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
using T1
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
kauff_mat (a * as \<otimes> basic b) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as)

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
codomain_block b \<noteq> 0

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
let ?bs = "(basic (make_vert_block (nat (codomain_block b))))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have F0:"rat_poly.matrix_match
                                 (blockmat a)
                                 (kauff_mat as)
                                  (blockmat b)
                                   (kauff_mat ?bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
using prems is_tangle_diagram_vert_block
                 is_tangle_diagram_matrix_match
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (a * as) \<and> is_tangle_diagram (basic b)
is_tangle_diagram (?b * basic (make_vert_block (nat (codomain_block ?b))))
\<lbrakk>is_tangle_diagram (?w1.0 * ?ws1.0); is_tangle_diagram (?w2.0 * ?ws2.0)\<rbrakk> \<Longrightarrow> rat_poly.matrix_match (blockmat ?w1.0) (kauff_mat ?ws1.0) (blockmat ?w2.0) (kauff_mat ?ws2.0)

goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have F1:"codomain_block b \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block b \<noteq> 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
codomain_block b \<noteq> 0

goal (1 subgoal):
 1. codomain_block b \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomain_block b \<noteq> 0

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have F2:" is_tangle_diagram as
                     \<and> is_tangle_diagram ?bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
using is_tangle_diagram.simps prems
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (basic ?x) = True
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)
is_tangle_diagram (a * as) \<and> is_tangle_diagram (basic b)

goal (1 subgoal):
 1. is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
have F3:"kauff_mat
                         (as\<otimes>basic (make_vert_block (nat (codomain_block b)))) =
                                     kauff_mat as \<otimes> kauff_mat ?bs"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
using F1 hyps
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
codomain_block b \<noteq> 0
\<lbrakk>codomain_block b \<noteq> 0; is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))\<rbrakk> \<Longrightarrow> kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
have "((a*as) \<otimes> (basic b)) = (a \<otimes> b) * (as \<otimes> ?bs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
using False tensor.simps
[PROOF STATE]
proof (prove)
using this:
codomain_block b \<noteq> 0
basic ?x \<otimes> basic ?y = basic (?x \<otimes> ?y)
?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)))))
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))
?x * ?xs \<otimes> ?y * ?ys = (?x \<otimes> ?y) * (?xs \<otimes> ?ys)

goal (1 subgoal):
 1. a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
have "kauff_mat ((a*as) \<otimes> (basic b))
                                     = kauff_mat((a \<otimes> b) * (as \<otimes> ?bs))"
[PROOF STATE]
proof (prove)
using this:
a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
have "... = rat_poly.matrix_mult
                                             (blockmat (a \<otimes> b))
                                             (kauff_mat (as \<otimes> ?bs))"
[PROOF STATE]
proof (prove)
using this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
using kauff_mat.simps
[PROOF STATE]
proof (prove)
using this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
kauff_mat (basic ?w) = blockmat ?w
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
have "... = rat_poly.matrix_mult
                                            ((blockmat a)\<otimes>(blockmat b))
                                            ((kauff_mat as)\<otimes>(kauff_mat ?bs))"
[PROOF STATE]
proof (prove)
using this:
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
using F3  blockmat_tensor_distrib
[PROOF STATE]
proof (prove)
using this:
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))
blockmat (?a \<otimes> ?b) = blockmat ?a \<otimes> blockmat ?b

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
have
               "...
                    = (rat_poly.matrix_mult (blockmat a) (kauff_mat as))
                       \<otimes> (rat_poly.matrix_mult (blockmat b) (kauff_mat ?bs))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
using rat_poly.distributivity F0
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> rat_poly.matrix_mult ?A1.0 ?A2.0 \<otimes> rat_poly.matrix_mult ?B1.0 ?B2.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) (?A2.0 \<otimes> ?B2.0)
rat_poly.matrix_match (blockmat a) (kauff_mat as) (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
[PROOF STEP]
have "...
                                  =  (rat_poly.matrix_mult
                                             (blockmat a)
                                             (kauff_mat as))
                                       \<otimes> (blockmat b)"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
[PROOF STEP]
using mat1_vert_block
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat ?b) (blockmat (make_vert_block (nat (codomain_block ?b)))) = blockmat ?b

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
[PROOF STEP]
have "... = (kauff_mat (a*as))
                                           \<otimes> (kauff_mat (basic b))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
using kauff_mat.simps
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
kauff_mat (basic ?w) = blockmat ?w
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))
a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))) = kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))
a * as \<otimes> basic b = (a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))
kauff_mat (a * as \<otimes> basic b) = kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
kauff_mat ((a \<otimes> b) * (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat (a \<otimes> b)) (kauff_mat (as \<otimes> basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat a \<otimes> blockmat b) (kauff_mat as \<otimes> kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))))
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) = rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b
rat_poly.matrix_mult (blockmat a) (kauff_mat as) \<otimes> blockmat b = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal (1 subgoal):
 1. kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
kauff_mat (a * as \<otimes> basic b) = kauff_mat (a * as) \<otimes> kauff_mat (basic b)

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
fix a b as bs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
assume hyps:
       "codomain_block b \<noteq> 0
          \<Longrightarrow>  is_tangle_diagram
                       (basic (make_vert_block (nat (codomain_block b))))
                 \<and>(is_tangle_diagram as)
          \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block b)))\<otimes> as)
            =  kauff_mat (basic (make_vert_block (nat (codomain_block b))))
         \<otimes> kauff_mat as "
[PROOF STATE]
proof (state)
this:
\<lbrakk>codomain_block b \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block b)))) \<and> is_tangle_diagram as\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
assume prems:"is_tangle_diagram (basic b) \<and> is_tangle_diagram (a * as) "
[PROOF STATE]
proof (state)
this:
is_tangle_diagram (basic b) \<and> is_tangle_diagram (a * as)

goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
let ?case = " kauff_mat ( (basic b) \<otimes>  (a * as))
                       = kauff_mat (basic b) \<otimes>  kauff_mat (a * as)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y ys. \<lbrakk>\<lbrakk>codomain_block x \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block x)))) \<and> is_tangle_diagram ys\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block x))) \<otimes> ys) = kauff_mat (basic (make_vert_block (nat (codomain_block x)))) \<otimes> kauff_mat ys; is_tangle_diagram (basic x) \<and> is_tangle_diagram (y * ys)\<rbrakk> \<Longrightarrow> kauff_mat (basic x \<otimes> y * ys) = kauff_mat (basic x) \<otimes> kauff_mat (y * ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
proof(cases "codomain_block b = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
codomain_block b = 0

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have "((basic b) \<otimes> (a * as)) =  ((b \<otimes> a) *  as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basic b \<otimes> a * as = (b \<otimes> a) * as
[PROOF STEP]
using tensor.simps True
[PROOF STATE]
proof (prove)
using this:
basic ?x \<otimes> basic ?y = basic (?x \<otimes> ?y)
?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)))))
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))
?x * ?xs \<otimes> ?y * ?ys = (?x \<otimes> ?y) * (?xs \<otimes> ?ys)
codomain_block b = 0

goal (1 subgoal):
 1. basic b \<otimes> a * as = (b \<otimes> a) * as
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
basic b \<otimes> a * as = (b \<otimes> a) * as

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
basic b \<otimes> a * as = (b \<otimes> a) * as
[PROOF STEP]
have "kauff_mat ((basic b) \<otimes> (a * as))
                           = kauff_mat ((b \<otimes>a ) *  as)"
[PROOF STATE]
proof (prove)
using this:
basic b \<otimes> a * as = (b \<otimes> a) * as

goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have "... = rat_poly.matrix_mult
                                      (blockmat (b \<otimes> a))
                                      (kauff_mat as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kauff_mat ((b \<otimes> a) * as) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat ((b \<otimes> a) * as) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat ((b \<otimes> a) * as) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have "... = rat_poly.matrix_mult
                                         ((blockmat b) \<otimes> (blockmat a))
                                         (kauff_mat as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)
[PROOF STEP]
using  blockmat_tensor_distrib
[PROOF STATE]
proof (prove)
using this:
blockmat (?a \<otimes> ?b) = blockmat ?a \<otimes> blockmat ?b

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * as)
kauff_mat ((b \<otimes> a) * as) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as)
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)
[PROOF STEP]
have T1:"kauff_mat ((basic b) \<otimes> (a*as))
                                     = rat_poly.matrix_mult
                                          ((blockmat b) \<otimes> (blockmat a))
                                          (kauff_mat as)"
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * as)
kauff_mat ((b \<otimes> a) * as) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as)
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (basic b \<otimes> a * as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)
[PROOF STEP]
have "weak_matrix_match2
                              (blockmat b)
                               (blockmat a)
                               (kauff_mat as)"
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic b \<otimes> a * as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. weak_matrix_match2 (blockmat b) (blockmat a) (kauff_mat as)
[PROOF STEP]
using is_tangle_diagram_weak_matrix_match2
               True prems
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic b \<otimes> a * as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)
\<lbrakk>is_tangle_diagram (?w2.0 * ?ws2.0); codomain_block ?w1.0 = 0\<rbrakk> \<Longrightarrow> weak_matrix_match2 (blockmat ?w1.0) (blockmat ?w2.0) (kauff_mat ?ws2.0)
codomain_block b = 0
is_tangle_diagram (basic b) \<and> is_tangle_diagram (a * as)

goal (1 subgoal):
 1. weak_matrix_match2 (blockmat b) (blockmat a) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
weak_matrix_match2 (blockmat b) (blockmat a) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
weak_matrix_match2 (blockmat b) (blockmat a) (kauff_mat as)
[PROOF STEP]
have "rat_poly.matrix_mult
                                ((blockmat b) \<otimes> (blockmat a))
                                (kauff_mat as)
                     = (blockmat b)
                        \<otimes> (rat_poly.matrix_mult (blockmat a)(kauff_mat as))"
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match2 (blockmat b) (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
using weak_distributivity2
[PROOF STATE]
proof (prove)
using this:
weak_matrix_match2 (blockmat b) (blockmat a) (kauff_mat as)
weak_matrix_match2 ?A1.0 ?B1.0 ?B2.0 \<Longrightarrow> ?A1.0 \<otimes> rat_poly.matrix_mult ?B1.0 ?B2.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) ?B2.0

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have "... = (kauff_mat (basic b)) \<otimes> (kauff_mat (a*as)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal (2 subgoals):
 1. codomain_block b = 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
 2. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
using T1
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
kauff_mat (basic b \<otimes> a * as) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
codomain_block b \<noteq> 0

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
let ?bs = "(basic (make_vert_block (nat (codomain_block b))))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have F0:"rat_poly.matrix_match
                                   (blockmat b)
                                   (kauff_mat ?bs)
                                   (blockmat a)
                                   (kauff_mat as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) (blockmat a) (kauff_mat as)
[PROOF STEP]
using prems is_tangle_diagram_vert_block
              is_tangle_diagram_matrix_match
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (basic b) \<and> is_tangle_diagram (a * as)
is_tangle_diagram (?b * basic (make_vert_block (nat (codomain_block ?b))))
\<lbrakk>is_tangle_diagram (?w1.0 * ?ws1.0); is_tangle_diagram (?w2.0 * ?ws2.0)\<rbrakk> \<Longrightarrow> rat_poly.matrix_match (blockmat ?w1.0) (kauff_mat ?ws1.0) (blockmat ?w2.0) (kauff_mat ?ws2.0)

goal (1 subgoal):
 1. rat_poly.matrix_match (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) (blockmat a) (kauff_mat as)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_match (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have F1:"codomain_block b \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. codomain_block b \<noteq> 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
codomain_block b \<noteq> 0

goal (1 subgoal):
 1. codomain_block b \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
codomain_block b \<noteq> 0

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have F2:" is_tangle_diagram as
                     \<and> is_tangle_diagram ?bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
using is_tangle_diagram.simps prems
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram (basic ?x) = True
is_tangle_diagram (?x * ?xs) = (if is_tangle_diagram ?xs then codomain_block ?x = domain_wall ?xs else False)
is_tangle_diagram (basic b) \<and> is_tangle_diagram (a * as)

goal (1 subgoal):
 1. is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
[PROOF STEP]
have F3:"kauff_mat (?bs \<otimes> as) = kauff_mat ?bs \<otimes> kauff_mat as"
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))

goal (1 subgoal):
 1. kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as
[PROOF STEP]
using F1 hyps
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram as \<and> is_tangle_diagram (basic (make_vert_block (nat (codomain_block b))))
codomain_block b \<noteq> 0
\<lbrakk>codomain_block b \<noteq> 0; is_tangle_diagram (basic (make_vert_block (nat (codomain_block b)))) \<and> is_tangle_diagram as\<rbrakk> \<Longrightarrow> kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as

goal (1 subgoal):
 1. kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
have "((basic b) \<otimes> (a*as)) = (b \<otimes> a) * (?bs \<otimes> as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)
[PROOF STEP]
using False tensor.simps
[PROOF STATE]
proof (prove)
using this:
codomain_block b \<noteq> 0
basic ?x \<otimes> basic ?y = basic (?x \<otimes> ?y)
?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)))))
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))
?x * ?xs \<otimes> ?y * ?ys = (?x \<otimes> ?y) * (?xs \<otimes> ?ys)

goal (1 subgoal):
 1. basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)
[PROOF STEP]
have
                    "kauff_mat ((basic b) \<otimes> (a*as))
                                    = kauff_mat((b \<otimes> a) * (?bs \<otimes> as))"
[PROOF STATE]
proof (prove)
using this:
basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)

goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
[PROOF STEP]
have "...
                                 = rat_poly.matrix_mult
                                               (blockmat (b \<otimes> a))
                                               (kauff_mat (?bs \<otimes> as))"
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))

goal (1 subgoal):
 1. kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
[PROOF STEP]
using kauff_mat.simps
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
kauff_mat (basic ?w) = blockmat ?w
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
[PROOF STEP]
have "...
                          = rat_poly.matrix_mult
                                    ((blockmat b)\<otimes>(blockmat a))
                                    ((kauff_mat ?bs)\<otimes>(kauff_mat as))"
[PROOF STATE]
proof (prove)
using this:
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)
[PROOF STEP]
using F3
[PROOF STATE]
proof (prove)
using this:
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)
[PROOF STEP]
by (metis blockmat_tensor_distrib)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)
[PROOF STEP]
have "...
                                 = (rat_poly.matrix_mult
                                          (blockmat b)
                                          (kauff_mat ?bs))
                          \<otimes> (rat_poly.matrix_mult
                                              (blockmat a)
                                              (kauff_mat as))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
using rat_poly.distributivity F0
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)
rat_poly.matrix_match ?A1.0 ?A2.0 ?B1.0 ?B2.0 \<Longrightarrow> rat_poly.matrix_mult ?A1.0 ?A2.0 \<otimes> rat_poly.matrix_mult ?B1.0 ?B2.0 = rat_poly.matrix_mult (?A1.0 \<otimes> ?B1.0) (?A2.0 \<otimes> ?B2.0)
rat_poly.matrix_match (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
have "... = (blockmat b)
                                      \<otimes> (rat_poly.matrix_mult
                                                   (blockmat a)
                                                   (kauff_mat as))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
using mat1_vert_block
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
rat_poly.matrix_mult (blockmat ?b) (blockmat (make_vert_block (nat (codomain_block ?b)))) = blockmat ?b

goal (1 subgoal):
 1. rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
[PROOF STEP]
have "... = (kauff_mat (basic b))
                                           \<otimes> (kauff_mat (a*as))"
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)

goal (1 subgoal):
 1. blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
using kauff_mat.simps
[PROOF STATE]
proof (prove)
using this:
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
kauff_mat (basic ?w) = blockmat ?w
kauff_mat (?w * ?ws) = rat_poly.matrix_mult (blockmat ?w) (kauff_mat ?ws)

goal (1 subgoal):
 1. blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal (1 subgoal):
 1. codomain_block b \<noteq> 0 \<Longrightarrow> kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as
basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as) = kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as
basic b \<otimes> a * as = (b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)
kauff_mat (basic b \<otimes> a * as) = kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
kauff_mat ((b \<otimes> a) * (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as))
rat_poly.matrix_mult (blockmat (b \<otimes> a)) (kauff_mat (basic (make_vert_block (nat (codomain_block b))) \<otimes> as)) = rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as)
rat_poly.matrix_mult (blockmat b \<otimes> blockmat a) (kauff_mat (basic (make_vert_block (nat (codomain_block b)))) \<otimes> kauff_mat as) = rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
rat_poly.matrix_mult (blockmat b) (kauff_mat (basic (make_vert_block (nat (codomain_block b))))) \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as)
blockmat b \<otimes> rat_poly.matrix_mult (blockmat a) (kauff_mat as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal (1 subgoal):
 1. kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
kauff_mat (basic b \<otimes> a * as) = kauff_mat (basic b) \<otimes> kauff_mat (a * as)

goal:
No subgoals!
[PROOF STEP]
qed