[STATEMENT]
lemma kernel_four_block_0_mat:
  assumes Adef: "(A :: 'a::field mat) = four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D"
  and B: "B \<in> carrier_mat n n"
  and D: "D \<in> carrier_mat m m"
  shows "kernel.dim (n + m) A = kernel.dim n B + kernel.dim m D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) (n + m)\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (module_vec TYPE('a) m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) (n + m)\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (module_vec TYPE('a) m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
have [simp]: "n + m = m + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + m = m + n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + m = m + n

goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) (n + m)\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (module_vec TYPE('a) m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
have A: "A \<in> carrier_mat (n+m) (n+m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (n + m) (n + m)
[PROOF STEP]
using Adef four_block_carrier_mat[OF B D]
[PROOF STATE]
proof (prove)
using this:
A = four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D
four_block_mat B ?B ?C D \<in> carrier_mat (n + m) (n + m)

goal (1 subgoal):
 1. A \<in> carrier_mat (n + m) (n + m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (n + m) (n + m)

goal (1 subgoal):
 1. vectorspace.dim class_ring (module_vec TYPE('a) (n + m)\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (module_vec TYPE('a) n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (module_vec TYPE('a) m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
interpret vardim "TYPE('a)"
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace.dim class_ring (M (n + m)\<lparr>carrier := mat_kernel A\<rparr>) = vectorspace.dim class_ring (M n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (M m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
interpret MN: vectorspace class_ring "M (n+m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (M (n + m))
[PROOF STEP]
using vec_vs
[PROOF STATE]
proof (prove)
using this:
vectorspace class_ring (module_vec TYPE(?'a) ?n)

goal (1 subgoal):
 1. vectorspace class_ring (M (n + m))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace.dim class_ring (MN.vs (mat_kernel A)) = vectorspace.dim class_ring (M n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (M m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
interpret KA: kernel "n+m" "n+m" A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Kernel.kernel (n + m) (n + m) A
[PROOF STEP]
by (unfold_locales, rule A)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. KA.dim = vectorspace.dim class_ring (M n\<lparr>carrier := mat_kernel B\<rparr>) + vectorspace.dim class_ring (M m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
interpret KB: kernel n n B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Kernel.kernel n n B
[PROOF STEP]
by (unfold_locales, rule B)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. KA.dim = KB.dim + vectorspace.dim class_ring (M m\<lparr>carrier := mat_kernel D\<rparr>)
[PROOF STEP]
interpret KD: kernel m m D
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Kernel.kernel m m D
[PROOF STEP]
by (unfold_locales, rule D)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
note [simp] = module_vec_simps
[PROOF STATE]
proof (state)
this:
(\<oplus>\<^bsub>module_vec ?ty ?n\<^esub>) = (+)
\<zero>\<^bsub>module_vec ?ty ?n\<^esub> = 0\<^sub>v ?n
carrier (module_vec ?ty ?n) = carrier_vec ?n
(\<odot>\<^bsub>module_vec ?ty ?n\<^esub>) = (\<cdot>\<^sub>v)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
from kernel_basis_exists[OF B]
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. finite B \<and> KB.basis B
[PROOF STEP]
obtain baseB where fin_bB: "finite baseB" and bB: "KB.basis baseB"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. finite B \<and> KB.basis B

goal (1 subgoal):
 1. (\<And>baseB. \<lbrakk>finite baseB; KB.basis baseB\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite baseB
KB.basis baseB

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
hence bBkB: "baseB \<subseteq> mat_kernel B"
[PROOF STATE]
proof (prove)
using this:
finite baseB
KB.basis baseB

goal (1 subgoal):
 1. baseB \<subseteq> mat_kernel B
[PROOF STEP]
unfolding KB.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
finite baseB
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. baseB \<subseteq> mat_kernel B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
hence bBc: "baseB \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. baseB \<subseteq> carrier_vec n
[PROOF STEP]
using mat_kernel_carrier[OF B]
[PROOF STATE]
proof (prove)
using this:
baseB \<subseteq> mat_kernel B
mat_kernel B \<subseteq> carrier_vec n

goal (1 subgoal):
 1. baseB \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
baseB \<subseteq> carrier_vec n

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have bB0: "0\<^sub>v n \<notin> baseB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v n \<notin> baseB
[PROOF STEP]
using bB
[PROOF STATE]
proof (prove)
using this:
KB.basis baseB

goal (1 subgoal):
 1. 0\<^sub>v n \<notin> baseB
[PROOF STEP]
unfolding KB.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. 0\<^sub>v n \<notin> baseB
[PROOF STEP]
using KB.Ker.vs_zero_lin_dep[OF bBkB]
[PROOF STATE]
proof (prove)
using this:
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B
KB.lin_indpt baseB \<Longrightarrow> 0\<^sub>v n \<notin> baseB

goal (1 subgoal):
 1. 0\<^sub>v n \<notin> baseB
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v n \<notin> baseB

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have bBkA: "padr m ` baseB \<subseteq> mat_kernel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<subseteq> mat_kernel A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
assume "a : padr m ` baseB"
[PROOF STATE]
proof (state)
this:
a \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB
[PROOF STEP]
obtain b where ab: "a = padr m b" and "b : baseB"
[PROOF STATE]
proof (prove)
using this:
a \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>a = b @\<^sub>v 0\<^sub>v m; b \<in> baseB\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = b @\<^sub>v 0\<^sub>v m
b \<in> baseB

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
hence "b : mat_kernel B"
[PROOF STATE]
proof (prove)
using this:
a = b @\<^sub>v 0\<^sub>v m
b \<in> baseB

goal (1 subgoal):
 1. b \<in> mat_kernel B
[PROOF STEP]
using bB
[PROOF STATE]
proof (prove)
using this:
a = b @\<^sub>v 0\<^sub>v m
b \<in> baseB
KB.basis baseB

goal (1 subgoal):
 1. b \<in> mat_kernel B
[PROOF STEP]
unfolding KB.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
a = b @\<^sub>v 0\<^sub>v m
b \<in> baseB
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. b \<in> mat_kernel B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> mat_kernel B

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
hence "padr m b : mat_kernel A"
[PROOF STATE]
proof (prove)
using this:
b \<in> mat_kernel B

goal (1 subgoal):
 1. b @\<^sub>v 0\<^sub>v m \<in> mat_kernel A
[PROOF STEP]
unfolding Adef
[PROOF STATE]
proof (prove)
using this:
b \<in> mat_kernel B

goal (1 subgoal):
 1. b @\<^sub>v 0\<^sub>v m \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D)
[PROOF STEP]
using kernel_padr[OF _ B _ D]
[PROOF STATE]
proof (prove)
using this:
b \<in> mat_kernel B
\<lbrakk>?a \<in> mat_kernel B; ?B \<in> carrier_mat n m\<rbrakk> \<Longrightarrow> ?a @\<^sub>v 0\<^sub>v m \<in> mat_kernel (four_block_mat B ?B (0\<^sub>m m n) D)

goal (1 subgoal):
 1. b @\<^sub>v 0\<^sub>v m \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b @\<^sub>v 0\<^sub>v m \<in> mat_kernel A

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
thus "a : mat_kernel A"
[PROOF STATE]
proof (prove)
using this:
b @\<^sub>v 0\<^sub>v m \<in> mat_kernel A

goal (1 subgoal):
 1. a \<in> mat_kernel A
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
b @\<^sub>v 0\<^sub>v m \<in> mat_kernel A
a = b @\<^sub>v 0\<^sub>v m

goal (1 subgoal):
 1. a \<in> mat_kernel A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> mat_kernel A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<subseteq> mat_kernel A

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
from kernel_basis_exists[OF D]
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. finite B \<and> KD.basis B
[PROOF STEP]
obtain baseD where fin_bD: "finite baseD" and bD: "KD.basis baseD"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. finite B \<and> KD.basis B

goal (1 subgoal):
 1. (\<And>baseD. \<lbrakk>finite baseD; KD.basis baseD\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite baseD
KD.basis baseD

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
hence bDkD: "baseD \<subseteq> mat_kernel D"
[PROOF STATE]
proof (prove)
using this:
finite baseD
KD.basis baseD

goal (1 subgoal):
 1. baseD \<subseteq> mat_kernel D
[PROOF STEP]
unfolding KD.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
finite baseD
KD.lin_indpt baseD \<and> KD.span baseD = mat_kernel D \<and> baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. baseD \<subseteq> mat_kernel D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
hence bDc: "baseD \<subseteq> carrier_vec m"
[PROOF STATE]
proof (prove)
using this:
baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. baseD \<subseteq> carrier_vec m
[PROOF STEP]
using mat_kernel_carrier[OF D]
[PROOF STATE]
proof (prove)
using this:
baseD \<subseteq> mat_kernel D
mat_kernel D \<subseteq> carrier_vec m

goal (1 subgoal):
 1. baseD \<subseteq> carrier_vec m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
baseD \<subseteq> carrier_vec m

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have bDkA: "padl n ` baseD \<subseteq> mat_kernel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
assume "a : padl n ` baseD"
[PROOF STATE]
proof (state)
this:
a \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. \<And>x. x \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD
[PROOF STEP]
obtain d where ad: "a = padl n d" and "d : baseD"
[PROOF STATE]
proof (prove)
using this:
a \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>a = 0\<^sub>v n @\<^sub>v d; d \<in> baseD\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = 0\<^sub>v n @\<^sub>v d
d \<in> baseD

goal (1 subgoal):
 1. \<And>x. x \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
hence "d : mat_kernel D"
[PROOF STATE]
proof (prove)
using this:
a = 0\<^sub>v n @\<^sub>v d
d \<in> baseD

goal (1 subgoal):
 1. d \<in> mat_kernel D
[PROOF STEP]
using bD
[PROOF STATE]
proof (prove)
using this:
a = 0\<^sub>v n @\<^sub>v d
d \<in> baseD
KD.basis baseD

goal (1 subgoal):
 1. d \<in> mat_kernel D
[PROOF STEP]
unfolding KD.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
a = 0\<^sub>v n @\<^sub>v d
d \<in> baseD
KD.lin_indpt baseD \<and> KD.span baseD = mat_kernel D \<and> baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. d \<in> mat_kernel D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d \<in> mat_kernel D

goal (1 subgoal):
 1. \<And>x. x \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
hence "padl n d : mat_kernel A"
[PROOF STATE]
proof (prove)
using this:
d \<in> mat_kernel D

goal (1 subgoal):
 1. 0\<^sub>v n @\<^sub>v d \<in> mat_kernel A
[PROOF STEP]
unfolding Adef
[PROOF STATE]
proof (prove)
using this:
d \<in> mat_kernel D

goal (1 subgoal):
 1. 0\<^sub>v n @\<^sub>v d \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D)
[PROOF STEP]
using kernel_padl[OF _ B _ D]
[PROOF STATE]
proof (prove)
using this:
d \<in> mat_kernel D
\<lbrakk>?d \<in> mat_kernel D; ?C \<in> carrier_mat m n\<rbrakk> \<Longrightarrow> 0\<^sub>v n @\<^sub>v ?d \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) ?C D)

goal (1 subgoal):
 1. 0\<^sub>v n @\<^sub>v d \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v n @\<^sub>v d \<in> mat_kernel A

goal (1 subgoal):
 1. \<And>x. x \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> mat_kernel A
[PROOF STEP]
thus "a : mat_kernel A"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v n @\<^sub>v d \<in> mat_kernel A

goal (1 subgoal):
 1. a \<in> mat_kernel A
[PROOF STEP]
using ad
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v n @\<^sub>v d \<in> mat_kernel A
a = 0\<^sub>v n @\<^sub>v d

goal (1 subgoal):
 1. a \<in> mat_kernel A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> mat_kernel A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
let ?BD = "(padr m ` baseB \<union> padl n ` baseD)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have finBD: "finite ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using fin_bB fin_bD
[PROOF STATE]
proof (prove)
using this:
finite baseB
finite baseD

goal (1 subgoal):
 1. finite ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have "KA.basis  ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KA.basis ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
unfolding KA.Ker.basis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<and> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) = mat_kernel A \<and> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A
[PROOF STEP]
proof (intro conjI Set.equalityI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 2. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
 3. mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 4. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A
[PROOF STEP]
show BDk: "?BD \<subseteq> mat_kernel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A
[PROOF STEP]
using bBkA bDkA
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<subseteq> mat_kernel A
(@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A

goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A

goal (3 subgoals):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 2. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
 3. mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> mat_kernel A

goal (3 subgoals):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 2. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
 3. mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "mat_kernel A \<subseteq> carrier_vec (m+n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_kernel A \<subseteq> carrier_vec (m + n)
[PROOF STEP]
using mat_kernel_carrier A
[PROOF STATE]
proof (prove)
using this:
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> mat_kernel ?A \<subseteq> carrier_vec ?nc
A \<in> carrier_mat (n + m) (n + m)

goal (1 subgoal):
 1. mat_kernel A \<subseteq> carrier_vec (m + n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_kernel A \<subseteq> carrier_vec (m + n)

goal (3 subgoals):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 2. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
 3. mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier_vec (m + n)
[PROOF STEP]
have BD: "?BD \<subseteq> carrier (M (n + m))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier_vec (m + n)

goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier KA.NC.V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier KA.NC.V

goal (3 subgoals):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 2. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
 3. mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
show "mat_kernel A \<subseteq> KA.Ker.span ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
unfolding KA.span_same[OF BDk]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_kernel A \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have BD: "?BD \<subseteq> carrier_vec (n+m)" (is "_ \<subseteq> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier_vec (n + m)
[PROOF STEP]
proof(rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
assume "v : ?BD"
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
assume "v : padr m ` baseB"
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB
[PROOF STEP]
obtain b where "b : baseB" and vb: "v = padr m b"
[PROOF STATE]
proof (prove)
using this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> baseB; v = b @\<^sub>v 0\<^sub>v m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> baseB
v = b @\<^sub>v 0\<^sub>v m

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
hence "b : carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
b \<in> baseB
v = b @\<^sub>v 0\<^sub>v m

goal (1 subgoal):
 1. b \<in> carrier_vec n
[PROOF STEP]
using bBc
[PROOF STATE]
proof (prove)
using this:
b \<in> baseB
v = b @\<^sub>v 0\<^sub>v m
baseB \<subseteq> carrier_vec n

goal (1 subgoal):
 1. b \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
hence "v : ?R"
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec n

goal (1 subgoal):
 1. v \<in> carrier_vec (n + m)
[PROOF STEP]
unfolding vb
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec n

goal (1 subgoal):
 1. b @\<^sub>v 0\<^sub>v m \<in> carrier_vec (n + m)
[PROOF STEP]
apply(subst append_carrier_vec)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. b \<in> carrier_vec n \<Longrightarrow> b \<in> carrier_vec n
 2. b \<in> carrier_vec n \<Longrightarrow> 0\<^sub>v m \<in> carrier_vec m
 3. b \<in> carrier_vec n \<Longrightarrow> True
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
assume "v : padl n ` baseD"
[PROOF STATE]
proof (state)
this:
v \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD
[PROOF STEP]
obtain d where "d : baseD" and vd: "v = padl n d"
[PROOF STATE]
proof (prove)
using this:
v \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>d \<in> baseD; v = 0\<^sub>v n @\<^sub>v d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d \<in> baseD
v = 0\<^sub>v n @\<^sub>v d

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
hence "d : carrier_vec m"
[PROOF STATE]
proof (prove)
using this:
d \<in> baseD
v = 0\<^sub>v n @\<^sub>v d

goal (1 subgoal):
 1. d \<in> carrier_vec m
[PROOF STEP]
using bDc
[PROOF STATE]
proof (prove)
using this:
d \<in> baseD
v = 0\<^sub>v n @\<^sub>v d
baseD \<subseteq> carrier_vec m

goal (1 subgoal):
 1. d \<in> carrier_vec m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d \<in> carrier_vec m

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
hence "v : ?R"
[PROOF STATE]
proof (prove)
using this:
d \<in> carrier_vec m

goal (1 subgoal):
 1. v \<in> carrier_vec (n + m)
[PROOF STEP]
unfolding vd
[PROOF STATE]
proof (prove)
using this:
d \<in> carrier_vec m

goal (1 subgoal):
 1. 0\<^sub>v n @\<^sub>v d \<in> carrier_vec (n + m)
[PROOF STEP]
apply(subst append_carrier_vec)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. d \<in> carrier_vec m \<Longrightarrow> 0\<^sub>v n \<in> carrier_vec n
 2. d \<in> carrier_vec m \<Longrightarrow> d \<in> carrier_vec m
 3. d \<in> carrier_vec m \<Longrightarrow> True
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
v \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> x \<in> carrier_vec (n + m)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> v \<in> carrier_vec (n + m)
v \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> v \<in> carrier_vec (n + m)
[PROOF STEP]
show "v: ?R"
[PROOF STATE]
proof (prove)
using this:
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD
v \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<Longrightarrow> v \<in> carrier_vec (n + m)
v \<in> (@\<^sub>v) (0\<^sub>v n) ` baseD \<Longrightarrow> v \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. v \<in> carrier_vec (n + m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (n + m)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
assume a: "a : mat_kernel A"
[PROOF STATE]
proof (state)
this:
a \<in> mat_kernel A

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
hence "a : carrier_vec (n+m)"
[PROOF STATE]
proof (prove)
using this:
a \<in> mat_kernel A

goal (1 subgoal):
 1. a \<in> carrier_vec (n + m)
[PROOF STEP]
using a mat_kernel_carrier[OF A]
[PROOF STATE]
proof (prove)
using this:
a \<in> mat_kernel A
a \<in> mat_kernel A
mat_kernel A \<subseteq> carrier_vec (n + m)

goal (1 subgoal):
 1. a \<in> carrier_vec (n + m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
hence "a = vec_first a n @\<^sub>v vec_last a m" (is "_ = ?b @\<^sub>v ?d")
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec (n + m)

goal (1 subgoal):
 1. a = vec_first a n @\<^sub>v vec_last a m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = vec_first a n @\<^sub>v vec_last a m

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a = vec_first a n @\<^sub>v vec_last a m

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "... = padr m ?b + padl n ?d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first a n @\<^sub>v vec_last a m = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first a n @\<^sub>v vec_last a m = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)
[PROOF STEP]
have 1: "a = padr m ?b + padl n ?d"
[PROOF STATE]
proof (prove)
using this:
a = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)

goal (1 subgoal):
 1. a = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have subkernel: "?b : mat_kernel B" "?d : mat_kernel D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first a n \<in> mat_kernel B &&& vec_last a m \<in> mat_kernel D
[PROOF STEP]
using mat_kernel_split[OF B D] a Adef
[PROOF STATE]
proof (prove)
using this:
?k \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D) \<Longrightarrow> vec_first ?k n \<in> mat_kernel B
?k \<in> mat_kernel (four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D) \<Longrightarrow> vec_last ?k m \<in> mat_kernel D
a \<in> mat_kernel A
A = four_block_mat B (0\<^sub>m n m) (0\<^sub>m m n) D

goal (1 subgoal):
 1. vec_first a n \<in> mat_kernel B &&& vec_last a m \<in> mat_kernel D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
hence "?b : span n baseB"
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D

goal (1 subgoal):
 1. vec_first a n \<in> KB.NC.span baseB
[PROOF STEP]
using bB
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D
KB.basis baseB

goal (1 subgoal):
 1. vec_first a n \<in> KB.NC.span baseB
[PROOF STEP]
unfolding KB.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. vec_first a n \<in> KB.NC.span baseB
[PROOF STEP]
using KB.span_same
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B
?S \<subseteq> mat_kernel B \<Longrightarrow> KB.span ?S = KB.NC.span ?S

goal (1 subgoal):
 1. vec_first a n \<in> KB.NC.span baseB
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first a n \<in> KB.NC.span baseB

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
hence "padr m ?b : padr m ` span n baseB"
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> KB.NC.span baseB

goal (1 subgoal):
 1. vec_first a n @\<^sub>v 0\<^sub>v m \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first a n @\<^sub>v 0\<^sub>v m \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_first a n @\<^sub>v 0\<^sub>v m \<in> (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "padr m ` span n baseB = span (n+m) (padr m ` baseB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB = MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB)
[PROOF STEP]
using span_pad[OF bBc]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v ?m) ` KB.NC.span baseB = LinearCombinations.module.span class_ring (M (n + ?m)) ((\<lambda>v. v @\<^sub>v 0\<^sub>v ?m) ` baseB)
(@\<^sub>v) (0\<^sub>v ?m) ` KB.NC.span baseB = LinearCombinations.module.span class_ring (M (n + ?m)) ((@\<^sub>v) (0\<^sub>v ?m) ` baseB)

goal (1 subgoal):
 1. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB = MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB = MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` KB.NC.span baseB = MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "... \<subseteq> span (n+m) ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using MN.span_is_monotone
[PROOF STATE]
proof (prove)
using this:
?S \<subseteq> ?T \<Longrightarrow> MN.span ?S \<subseteq> MN.span ?T

goal (1 subgoal):
 1. MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
vec_first a n @\<^sub>v 0\<^sub>v m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have 2: "padr m ?b : span (n+m) ?BD"
[PROOF STATE]
proof (prove)
using this:
vec_first a n @\<^sub>v 0\<^sub>v m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. vec_first a n @\<^sub>v 0\<^sub>v m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
vec_first a n @\<^sub>v 0\<^sub>v m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "?d : span m baseD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last a m \<in> KD.NC.span baseD
[PROOF STEP]
using subkernel bD
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D
KD.basis baseD

goal (1 subgoal):
 1. vec_last a m \<in> KD.NC.span baseD
[PROOF STEP]
unfolding KD.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D
KD.lin_indpt baseD \<and> KD.span baseD = mat_kernel D \<and> baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. vec_last a m \<in> KD.NC.span baseD
[PROOF STEP]
using KD.span_same
[PROOF STATE]
proof (prove)
using this:
vec_first a n \<in> mat_kernel B
vec_last a m \<in> mat_kernel D
KD.lin_indpt baseD \<and> KD.span baseD = mat_kernel D \<and> baseD \<subseteq> mat_kernel D
?S \<subseteq> mat_kernel D \<Longrightarrow> KD.span ?S = KD.NC.span ?S

goal (1 subgoal):
 1. vec_last a m \<in> KD.NC.span baseD
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_last a m \<in> KD.NC.span baseD

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
hence "padl n ?d : padl n ` span m baseD"
[PROOF STATE]
proof (prove)
using this:
vec_last a m \<in> KD.NC.span baseD

goal (1 subgoal):
 1. 0\<^sub>v n @\<^sub>v vec_last a m \<in> (@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v n @\<^sub>v vec_last a m \<in> (@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>v n @\<^sub>v vec_last a m \<in> (@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "padl n ` span m baseD = span (n+m) (padl n ` baseD)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD = MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using span_pad[OF bDc]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v ?m) ` KD.NC.span baseD = LinearCombinations.module.span class_ring (M (m + ?m)) ((\<lambda>v. v @\<^sub>v 0\<^sub>v ?m) ` baseD)
(@\<^sub>v) (0\<^sub>v ?m) ` KD.NC.span baseD = LinearCombinations.module.span class_ring (M (m + ?m)) ((@\<^sub>v) (0\<^sub>v ?m) ` baseD)

goal (1 subgoal):
 1. (@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD = MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD = MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(@\<^sub>v) (0\<^sub>v n) ` KD.NC.span baseD = MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "... \<subseteq> span (n+m) ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using MN.span_is_monotone
[PROOF STATE]
proof (prove)
using this:
?S \<subseteq> ?T \<Longrightarrow> MN.span ?S \<subseteq> MN.span ?T

goal (1 subgoal):
 1. MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
MN.span ((@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0\<^sub>v n @\<^sub>v vec_last a m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have 3: "padl n ?d : span (n+m) ?BD"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v n @\<^sub>v vec_last a m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. 0\<^sub>v n @\<^sub>v vec_last a m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0\<^sub>v n @\<^sub>v vec_last a m \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have "padr m ?b + padl n ?d : span (n+m) ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m) \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using MN.span_add1[OF _ 2 3] BD
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier KA.NC.V \<Longrightarrow> vec_first a n @\<^sub>v 0\<^sub>v m \<oplus>\<^bsub>KA.NC.V\<^esub> (0\<^sub>v n @\<^sub>v vec_last a m) \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD \<subseteq> carrier_vec (n + m)

goal (1 subgoal):
 1. vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m) \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m) \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. \<And>x. x \<in> mat_kernel A \<Longrightarrow> x \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
thus "a \<in> span (n+m) ?BD"
[PROOF STATE]
proof (prove)
using this:
vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m) \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. a \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m) \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
a = vec_first a n @\<^sub>v 0\<^sub>v m + (0\<^sub>v n @\<^sub>v vec_last a m)

goal (1 subgoal):
 1. a \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> MN.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
mat_kernel A \<subseteq> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (2 subgoals):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
 2. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
[PROOF STEP]
show "KA.Ker.span ?BD \<subseteq> mat_kernel A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
[PROOF STEP]
using KA.Ker.span_closed[OF BDk]
[PROOF STATE]
proof (prove)
using this:
?v \<in> KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<Longrightarrow> ?v \<in> mat_kernel A

goal (1 subgoal):
 1. KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
KA.span ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<subseteq> mat_kernel A

goal (1 subgoal):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
have li: "~ lin_dep n baseB" "~ lin_dep m baseD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KB.NC.lin_indpt baseB &&& KD.NC.lin_indpt baseD
[PROOF STEP]
using bB[unfolded KB.Ker.basis_def]
[PROOF STATE]
proof (prove)
using this:
KB.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. KB.NC.lin_indpt baseB &&& KD.NC.lin_indpt baseD
[PROOF STEP]
unfolding KB.lindep_same[OF bBkB]
[PROOF STATE]
proof (prove)
using this:
KB.NC.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B

goal (1 subgoal):
 1. KB.NC.lin_indpt baseB &&& KD.NC.lin_indpt baseD
[PROOF STEP]
using bD[unfolded KD.Ker.basis_def]
[PROOF STATE]
proof (prove)
using this:
KB.NC.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B
KD.lin_indpt baseD \<and> KD.span baseD = mat_kernel D \<and> baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. KB.NC.lin_indpt baseB &&& KD.NC.lin_indpt baseD
[PROOF STEP]
unfolding KD.lindep_same[OF bDkD]
[PROOF STATE]
proof (prove)
using this:
KB.NC.lin_indpt baseB \<and> KB.span baseB = mat_kernel B \<and> baseB \<subseteq> mat_kernel B
KD.NC.lin_indpt baseD \<and> KD.span baseD = mat_kernel D \<and> baseD \<subseteq> mat_kernel D

goal (1 subgoal):
 1. KB.NC.lin_indpt baseB &&& KD.NC.lin_indpt baseD
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
KB.NC.lin_indpt baseB
KD.NC.lin_indpt baseD

goal (1 subgoal):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
show "~ KA.Ker.lin_dep ?BD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
unfolding KA.lindep_same[OF BDk]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MN.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
apply(rule padr_padl_lindep)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. baseB \<subseteq> carrier_vec n
 2. KB.NC.lin_indpt baseB
 3. baseD \<subseteq> carrier_vec m
 4. KD.NC.lin_indpt baseD
[PROOF STEP]
using bBc bDc li
[PROOF STATE]
proof (prove)
using this:
baseB \<subseteq> carrier_vec n
baseD \<subseteq> carrier_vec m
KB.NC.lin_indpt baseB
KD.NC.lin_indpt baseD

goal (4 subgoals):
 1. baseB \<subseteq> carrier_vec n
 2. KB.NC.lin_indpt baseB
 3. baseD \<subseteq> carrier_vec m
 4. KD.NC.lin_indpt baseD
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
KA.lin_indpt ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
KA.basis ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
hence "KA.dim = card ?BD"
[PROOF STATE]
proof (prove)
using this:
KA.basis ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
using KA.Ker.dim_basis[OF finBD]
[PROOF STATE]
proof (prove)
using this:
KA.basis ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
KA.basis ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) \<Longrightarrow> KA.dim = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
KA.dim = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
KA.dim = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have "card ?BD = card (padr m ` baseB) + card (padl n ` baseD)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD)
[PROOF STEP]
apply(rule card_Un_disjoint)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB)
 2. finite ((@\<^sub>v) (0\<^sub>v n) ` baseD)
 3. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<inter> (@\<^sub>v) (0\<^sub>v n) ` baseD = {}
[PROOF STEP]
using pad_disjoint[OF bBc bB0 bDc] fin_bB fin_bD
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<inter> (@\<^sub>v) (0\<^sub>v n) ` baseD = {}
finite baseB
finite baseD

goal (3 subgoals):
 1. finite ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB)
 2. finite ((@\<^sub>v) (0\<^sub>v n) ` baseD)
 3. (\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<inter> (@\<^sub>v) (0\<^sub>v n) ` baseD = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB \<union> (@\<^sub>v) (0\<^sub>v n) ` baseD) = card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD)

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have "... = card baseB + card baseD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD) = card baseB + card baseD
[PROOF STEP]
using card_image[OF subset_inj_on[OF padr_inj]]
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> carrier_vec ?n2 \<Longrightarrow> card ((\<lambda>v. v @\<^sub>v 0\<^sub>v ?m2) ` ?A) = card ?A

goal (1 subgoal):
 1. card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD) = card baseB + card baseD
[PROOF STEP]
using card_image[OF subset_inj_on[OF padl_inj]] bBc bDc
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> carrier_vec ?n2 \<Longrightarrow> card ((\<lambda>v. v @\<^sub>v 0\<^sub>v ?m2) ` ?A) = card ?A
?A \<subseteq> carrier_vec ?n2 \<Longrightarrow> card ((@\<^sub>v) (0\<^sub>v ?m2) ` ?A) = card ?A
baseB \<subseteq> carrier_vec n
baseD \<subseteq> carrier_vec m

goal (1 subgoal):
 1. card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD) = card baseB + card baseD
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD) = card baseB + card baseD

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card ((\<lambda>v. v @\<^sub>v 0\<^sub>v m) ` baseB) + card ((@\<^sub>v) (0\<^sub>v n) ` baseD) = card baseB + card baseD

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have "card baseB = KB.dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card baseB = KB.dim
[PROOF STEP]
using KB.Ker.dim_basis[OF fin_bB] bB
[PROOF STATE]
proof (prove)
using this:
KB.basis baseB \<Longrightarrow> KB.dim = card baseB
KB.basis baseB

goal (1 subgoal):
 1. card baseB = KB.dim
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card baseB = KB.dim

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card baseB = KB.dim

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
have "card baseD = KD.dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card baseD = KD.dim
[PROOF STEP]
using KD.Ker.dim_basis[OF fin_bD] bD
[PROOF STATE]
proof (prove)
using this:
KD.basis baseD \<Longrightarrow> KD.dim = card baseD
KD.basis baseD

goal (1 subgoal):
 1. card baseD = KD.dim
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card baseD = KD.dim

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
KA.dim = KB.dim + KD.dim
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
KA.dim = KB.dim + KD.dim

goal (1 subgoal):
 1. KA.dim = KB.dim + KD.dim
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
KA.dim = KB.dim + KD.dim

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_hypergeo_rec:
  "fps_hypergeo as bs c $ Suc n = ((foldl (\<lambda>r a. r* (a + of_nat n)) c as) /
    (foldl (\<lambda>r b. r * (b + of_nat n)) (of_nat (Suc n)) bs )) * fps_hypergeo as bs c $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_hypergeo as bs c $ Suc n = foldl (\<lambda>r a. r * (a + of_nat n)) c as / foldl (\<lambda>r b. r * (b + of_nat n)) (of_nat (Suc n)) bs * fps_hypergeo as bs c $ n
[PROOF STEP]
apply (simp add: foldl_mult_start del: of_nat_Suc of_nat_add fact_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>r a. r * pochhammer a (Suc n)) (c * c ^ n) as / foldl (\<lambda>r b. r * pochhammer b (Suc n)) (fact (Suc n)) bs = foldl (\<lambda>r a. r * (a + of_nat n)) (c * foldl (\<lambda>r a. r * pochhammer a n) (c ^ n) as) as / foldl (\<lambda>r b. r * (b + of_nat n)) (of_nat (Suc n) * foldl (\<lambda>r b. r * pochhammer b n) (fact n) bs) bs
[PROOF STEP]
unfolding foldl_prod_prod[unfolded foldl_mult_start] pochhammer_Suc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>r a. r * (pochhammer a n * (a + of_nat n))) (c * c ^ n) as / foldl (\<lambda>r b. r * (pochhammer b n * (b + of_nat n))) (fact (Suc n)) bs = foldl (\<lambda>r a. r * (a + of_nat n) * pochhammer a n) (c * c ^ n) as / foldl (\<lambda>r b. r * (b + of_nat n) * pochhammer b n) (of_nat (Suc n) * fact n) bs
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma max_reg_Minus: "max_reg (Minus a1 a2) = max (max_reg a1) (max_reg a2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max_reg (Minus a1 a2) = max (max_reg a1) (max_reg a2)
[PROOF STEP]
apply (simp add: max_reg_def Let_def max_absorb2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enumerate_regs a1 \<noteq> {} \<longrightarrow> enumerate_regs a2 \<noteq> {} \<longrightarrow> Some (Max (enumerate_regs a1 \<union> enumerate_regs a2)) = max (Some (Max (enumerate_regs a1))) (Some (Max (enumerate_regs a2)))
[PROOF STEP]
by (metis Max.union bot_option_def finite_enumerate_regs max_bot2 sup_Some sup_max)


[STATEMENT]
lemma sin_minus_pi [simp]: "sin (x - pi) = - (sin x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (x - pi) = - sin x
[PROOF STEP]
by (simp add: sin_diff)


[STATEMENT]
lemma exp_cf2_pos: "exp_cf2 x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < exp_cf2 x
[PROOF STEP]
unfolding exp_cf2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (x\<^sup>2 + 6 * x + 12) / (x\<^sup>2 - 6 * x + 12)
[PROOF STEP]
by (auto simp add: divide_simps denom_cf2_pos numer_cf2_pos)


[STATEMENT]
lemma convex_contains_open_segment:
  "convex s \<longleftrightarrow> (\<forall>a\<in>s. \<forall>b\<in>s. open_segment a b \<subseteq> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex s = (\<forall>a\<in>s. \<forall>b\<in>s. open_segment a b \<subseteq> s)
[PROOF STEP]
by (simp add: convex_contains_segment closed_segment_eq_open)


[STATEMENT]
lemma smult_eq_0_iff [simp]: "smult a p = 0 \<longleftrightarrow> a = 0 \<or> p = 0"
  for a :: "'a::{comm_semiring_0,semiring_no_zero_divisors}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (smult a p = 0) = (a = (0::'a) \<or> p = 0)
[PROOF STEP]
by (simp add: poly_eq_iff)


[STATEMENT]
lemma finiteSummands:
  fixes P :: pi

  shows "finite(summands P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (summands P)
[PROOF STEP]
by(induct P rule: pi.induct) auto


[STATEMENT]
lemma infnorm_eq_1_2:
  fixes x :: "real^2"
  shows "infnorm x = 1 \<longleftrightarrow>
    \<bar>x$1\<bar> \<le> 1 \<and> \<bar>x$2\<bar> \<le> 1 \<and> (x$1 = -1 \<or> x$1 = 1 \<or> x$2 = -1 \<or> x$2 = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (infnorm x = 1) = (\<bar>x $ 1\<bar> \<le> 1 \<and> \<bar>x $ 2\<bar> \<le> 1 \<and> (x $ 1 = - 1 \<or> x $ 1 = 1 \<or> x $ 2 = - 1 \<or> x $ 2 = 1))
[PROOF STEP]
unfolding infnorm_2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (max \<bar>x $ 1\<bar> \<bar>x $ 2\<bar> = 1) = (\<bar>x $ 1\<bar> \<le> 1 \<and> \<bar>x $ 2\<bar> \<le> 1 \<and> (x $ 1 = - 1 \<or> x $ 1 = 1 \<or> x $ 2 = - 1 \<or> x $ 2 = 1))
[PROOF STEP]
by auto


[STATEMENT]
lemma [code]: "prod_mset (mset xs) = fold times xs 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>\<^sub># (mset xs) = fold (*) xs (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Prod>\<^sub># (mset xs) = fold (*) xs (1::'a)
[PROOF STEP]
have "\<And>x. fold times xs x = prod_mset (mset xs) * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. fold (*) xs x = \<Prod>\<^sub># (mset xs) * x
[PROOF STEP]
by (induct xs) (simp_all add: ac_simps)
[PROOF STATE]
proof (state)
this:
fold (*) xs ?x = \<Prod>\<^sub># (mset xs) * ?x

goal (1 subgoal):
 1. \<Prod>\<^sub># (mset xs) = fold (*) xs (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fold (*) xs ?x = \<Prod>\<^sub># (mset xs) * ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fold (*) xs ?x = \<Prod>\<^sub># (mset xs) * ?x

goal (1 subgoal):
 1. \<Prod>\<^sub># (mset xs) = fold (*) xs (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Prod>\<^sub># (mset xs) = fold (*) xs (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SourcesS6_L2:  "Sources level2 sS6 = {sS2, sS4, sS5}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
have DSourcesS6:"DSources level2 sS6 = {sS2, sS5}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DSources level2 sS6 = {sS2, sS5}
[PROOF STEP]
by (simp add: DSources_def AbstrLevel2, auto)
[PROOF STATE]
proof (state)
this:
DSources level2 sS6 = {sS2, sS5}

goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
have SourcesS2:"Sources level2 sS2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources level2 sS2 = {}
[PROOF STEP]
by (rule SourcesS2_L2)
[PROOF STATE]
proof (state)
this:
Sources level2 sS2 = {}

goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
have "Sources level2 sS5 = {sS2, sS4}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sources level2 sS5 = {sS2, sS4}
[PROOF STEP]
by (rule SourcesS5_L2)
[PROOF STATE]
proof (state)
this:
Sources level2 sS5 = {sS2, sS4}

goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
with  SourcesS2 DSourcesS6
[PROOF STATE]
proof (chain)
picking this:
Sources level2 sS2 = {}
DSources level2 sS6 = {sS2, sS5}
Sources level2 sS5 = {sS2, sS4}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sources level2 sS2 = {}
DSources level2 sS6 = {sS2, sS5}
Sources level2 sS5 = {sS2, sS4}

goal (1 subgoal):
 1. Sources level2 sS6 = {sS2, sS4, sS5}
[PROOF STEP]
by (simp add: Sources_2DSources, auto)
[PROOF STATE]
proof (state)
this:
Sources level2 sS6 = {sS2, sS4, sS5}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_approx_polynomial_function:
    fixes g :: "real \<Rightarrow> 'b::euclidean_space"
    assumes "path g" "0 < e"
    obtains p where "polynomial_function p" "pathstart p = pathstart g" "pathfinish p = pathfinish g"
                    "\<And>t. t \<in> {0..1} \<Longrightarrow> norm(p t - g t) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>polynomial_function p; pathstart p = pathstart g; pathfinish p = pathfinish g; \<And>t. t \<in> {0..1} \<Longrightarrow> norm (p t - g t) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>polynomial_function p; pathstart p = pathstart g; pathfinish p = pathfinish g; \<And>t. t \<in> {0..1} \<Longrightarrow> norm (p t - g t) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain q where poq: "polynomial_function q" and noq: "\<And>x. x \<in> {0..1} \<Longrightarrow> norm (g x - q x) < e/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>q. \<lbrakk>polynomial_function q; \<And>x. x \<in> {0..1} \<Longrightarrow> norm (g x - q x) < e / 4\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Stone_Weierstrass_polynomial_function [of "{0..1}" g "e/4"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>compact {0..1}; continuous_on {0..1} g; 0 < e / 4\<rbrakk> \<Longrightarrow> \<exists>ga. polynomial_function ga \<and> (\<forall>x\<in>{0..1}. norm (g x - ga x) < e / 4)
path g
0 < e

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>polynomial_function q; \<And>x. x \<in> {0..1} \<Longrightarrow> norm (g x - q x) < e / 4\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: path_def)
[PROOF STATE]
proof (state)
this:
polynomial_function q
?x \<in> {0..1} \<Longrightarrow> norm (g ?x - q ?x) < e / 4

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>polynomial_function p; pathstart p = pathstart g; pathfinish p = pathfinish g; \<And>t. t \<in> {0..1} \<Longrightarrow> norm (p t - g t) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define pf where "pf \<equiv> \<lambda>t. q t + (g 0 - q 0) + t *\<^sub>R (g 1 - q 1 - (g 0 - q 0))"
[PROOF STATE]
proof (state)
this:
pf \<equiv> \<lambda>t. q t + (g 0 - q 0) + t *\<^sub>R (g 1 - q 1 - (g 0 - q 0))

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>polynomial_function p; pathstart p = pathstart g; pathfinish p = pathfinish g; \<And>t. t \<in> {0..1} \<Longrightarrow> norm (p t - g t) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. polynomial_function ?p
 2. pathstart ?p = pathstart g
 3. pathfinish ?p = pathfinish g
 4. \<And>t. t \<in> {0..1} \<Longrightarrow> norm (?p t - g t) < e
[PROOF STEP]
show "polynomial_function pf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polynomial_function pf
[PROOF STEP]
by (force simp add: poq pf_def)
[PROOF STATE]
proof (state)
this:
polynomial_function pf

goal (3 subgoals):
 1. pathstart pf = pathstart g
 2. pathfinish pf = pathfinish g
 3. \<And>t. t \<in> {0..1} \<Longrightarrow> norm (pf t - g t) < e
[PROOF STEP]
show "norm (pf t - g t) < e"
      if "t \<in> {0..1}" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (pf t - g t) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (pf t - g t) < e
[PROOF STEP]
have *: "norm (((q t - g t) + (g 0 - q 0)) + (t *\<^sub>R (g 1 - q 1) + t *\<^sub>R (q 0 - g 0))) < (e/4 + e/4) + (e/4+e/4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (q t - g t + (g 0 - q 0) + (t *\<^sub>R (g 1 - q 1) + t *\<^sub>R (q 0 - g 0))) < e / 4 + e / 4 + (e / 4 + e / 4)
[PROOF STEP]
proof (intro Real_Vector_Spaces.norm_add_less)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. norm (q t - g t) < e / 4
 2. norm (g 0 - q 0) < e / 4
 3. norm (t *\<^sub>R (g 1 - q 1)) < e / 4
 4. norm (t *\<^sub>R (q 0 - g 0)) < e / 4
[PROOF STEP]
show "norm (q t - g t) < e / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (q t - g t) < e / 4
[PROOF STEP]
by (metis noq norm_minus_commute that)
[PROOF STATE]
proof (state)
this:
norm (q t - g t) < e / 4

goal (3 subgoals):
 1. norm (g 0 - q 0) < e / 4
 2. norm (t *\<^sub>R (g 1 - q 1)) < e / 4
 3. norm (t *\<^sub>R (q 0 - g 0)) < e / 4
[PROOF STEP]
show "norm (t *\<^sub>R (g 1 - q 1)) < e / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (t *\<^sub>R (g 1 - q 1)) < e / 4
[PROOF STEP]
using noq that le_less_trans [OF mult_left_le_one_le noq]
[PROOF STATE]
proof (prove)
using this:
?x \<in> {0..1} \<Longrightarrow> norm (g ?x - q ?x) < e / 4
t \<in> {0..1}
\<lbrakk>0 \<le> norm (g ?x1 - q ?x1); 0 \<le> ?y2; ?y2 \<le> 1; ?x1 \<in> {0..1}\<rbrakk> \<Longrightarrow> ?y2 * norm (g ?x1 - q ?x1) < e / 4

goal (1 subgoal):
 1. norm (t *\<^sub>R (g 1 - q 1)) < e / 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
norm (t *\<^sub>R (g 1 - q 1)) < e / 4

goal (2 subgoals):
 1. norm (g 0 - q 0) < e / 4
 2. norm (t *\<^sub>R (q 0 - g 0)) < e / 4
[PROOF STEP]
show "norm (t *\<^sub>R (q 0 - g 0)) < e / 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (t *\<^sub>R (q 0 - g 0)) < e / 4
[PROOF STEP]
using noq that le_less_trans [OF mult_left_le_one_le noq]
[PROOF STATE]
proof (prove)
using this:
?x \<in> {0..1} \<Longrightarrow> norm (g ?x - q ?x) < e / 4
t \<in> {0..1}
\<lbrakk>0 \<le> norm (g ?x1 - q ?x1); 0 \<le> ?y2; ?y2 \<le> 1; ?x1 \<in> {0..1}\<rbrakk> \<Longrightarrow> ?y2 * norm (g ?x1 - q ?x1) < e / 4

goal (1 subgoal):
 1. norm (t *\<^sub>R (q 0 - g 0)) < e / 4
[PROOF STEP]
by simp (metis norm_minus_commute order_refl zero_le_one)
[PROOF STATE]
proof (state)
this:
norm (t *\<^sub>R (q 0 - g 0)) < e / 4

goal (1 subgoal):
 1. norm (g 0 - q 0) < e / 4
[PROOF STEP]
qed (use noq norm_minus_commute that in auto)
[PROOF STATE]
proof (state)
this:
norm (q t - g t + (g 0 - q 0) + (t *\<^sub>R (g 1 - q 1) + t *\<^sub>R (q 0 - g 0))) < e / 4 + e / 4 + (e / 4 + e / 4)

goal (1 subgoal):
 1. norm (pf t - g t) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (q t - g t + (g 0 - q 0) + (t *\<^sub>R (g 1 - q 1) + t *\<^sub>R (q 0 - g 0))) < e / 4 + e / 4 + (e / 4 + e / 4)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (q t - g t + (g 0 - q 0) + (t *\<^sub>R (g 1 - q 1) + t *\<^sub>R (q 0 - g 0))) < e / 4 + e / 4 + (e / 4 + e / 4)

goal (1 subgoal):
 1. norm (pf t - g t) < e
[PROOF STEP]
by (auto simp add: algebra_simps pf_def)
[PROOF STATE]
proof (state)
this:
norm (pf t - g t) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?t \<in> {0..1} \<Longrightarrow> norm (pf ?t - g ?t) < e

goal (2 subgoals):
 1. pathstart pf = pathstart g
 2. pathfinish pf = pathfinish g
[PROOF STEP]
qed (auto simp add: path_defs pf_def)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infinite_sphere:
  fixes a :: complex
  assumes "r > 0"
  shows "infinite (sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (sphere a r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (sphere a r)
[PROOF STEP]
have "uncountable (path_image (circlepath a r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable (path_image (circlepath a r))
[PROOF STEP]
apply (rule simple_path_image_uncountable)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_path (circlepath a r)
[PROOF STEP]
using simple_path_circlepath assms
[PROOF STATE]
proof (prove)
using this:
simple_path (circlepath ?z ?r) = (?r \<noteq> 0)
0 < r

goal (1 subgoal):
 1. simple_path (circlepath a r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
uncountable (path_image (circlepath a r))

goal (1 subgoal):
 1. infinite (sphere a r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
uncountable (path_image (circlepath a r))
[PROOF STEP]
have "uncountable (sphere a r)"
[PROOF STATE]
proof (prove)
using this:
uncountable (path_image (circlepath a r))

goal (1 subgoal):
 1. uncountable (sphere a r)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uncountable (path_image (circlepath a r))
0 < r

goal (1 subgoal):
 1. uncountable (sphere a r)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
uncountable (sphere a r)

goal (1 subgoal):
 1. infinite (sphere a r)
[PROOF STEP]
from uncountable_infinite[OF this]
[PROOF STATE]
proof (chain)
picking this:
infinite (sphere a r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (sphere a r)

goal (1 subgoal):
 1. infinite (sphere a r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
infinite (sphere a r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_add_ereal_general2:
  fixes x y :: ereal
  assumes x: "\<bar>x\<bar> \<noteq> \<infinity>"
      and f: "(f \<longlongrightarrow> x) F" and g: "(g \<longlongrightarrow> y) F"
  shows "((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F
[PROOF STEP]
have "((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F
[PROOF STEP]
using tendsto_add_ereal_general1[OF x, OF g, OF f] add.commute[of "y", of "x"]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. g x + f x) \<longlongrightarrow> y + x) F
y + x = x + y

goal (1 subgoal):
 1. ((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F

goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F

goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F
[PROOF STEP]
have "\<And>x. g x + f x = f x + g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. g x + f x = f x + g x
[PROOF STEP]
using add.commute
[PROOF STATE]
proof (prove)
using this:
?a + ?b = ?b + ?a

goal (1 subgoal):
 1. \<And>x. g x + f x = f x + g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ?x + f ?x = f ?x + g ?x

goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F
g ?x + f ?x = f ?x + g ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. g x + f x) \<longlongrightarrow> x + y) F
g ?x + f ?x = f ?x + g ?x

goal (1 subgoal):
 1. ((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x + g x) \<longlongrightarrow> x + y) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reciprocal_of_complex [simp]:
  assumes "z \<noteq> 0"
  shows "reciprocal (of_complex z) = of_complex (1 / z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reciprocal (of_complex z) = of_complex (1 / z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0

goal (1 subgoal):
 1. reciprocal (of_complex z) = of_complex (1 / z)
[PROOF STEP]
by (transfer, transfer, simp)


[STATEMENT]
lemma is_constant_seq_imp_closed:
  assumes "is_constant_seq R s"
  shows "s \<in> closed_seqs R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> carrier R\<^bsup>\<omega>\<^esup>
[PROOF STEP]
apply(rule closed_seqs_memI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. s k \<in> carrier R
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_constant_seq R s

goal (1 subgoal):
 1. \<And>k. s k \<in> carrier R
[PROOF STEP]
unfolding is_constant_seq_def constant_function_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier R. s = (\<lambda>xa\<in>UNIV. x)

goal (1 subgoal):
 1. \<And>k. s k \<in> carrier R
[PROOF STEP]
by auto


[STATEMENT]
lemma signed_take_bit_numeral_bit1 [simp]:
  \<open>signed_take_bit (numeral l) (numeral (Num.Bit1 k)) = signed_take_bit (pred_numeral l) (numeral k) * 2 + (1 :: int)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit (numeral l) (numeral (num.Bit1 k)) = signed_take_bit (pred_numeral l) (numeral k) * 2 + 1
[PROOF STEP]
by (simp add: signed_take_bit_rec)


[STATEMENT]
lemma (in inj_semiring_hom) map_vector_0: "(map_vector hom v = 0) = (v = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_vector hom v = 0) = (v = 0)
[PROOF STEP]
unfolding vec_eq_iff map_vector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. (\<chi>i. hom (v $h i)) $h i = 0 $h i) = (\<forall>i. v $h i = 0 $h i)
[PROOF STEP]
by auto


[STATEMENT]
lemma index_of_nth:
  assumes "distinct xs"
  assumes "i < length xs"
  shows "index_of (xs ! i) xs = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index_of (xs ! i) xs = i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct xs
i < length xs

goal (1 subgoal):
 1. index_of (xs ! i) xs = i
[PROOF STEP]
by (metis gr_implies_not_zero index_of_bound index_of_correct length_0_conv nth_eq_iff_index_eq nth_mem)


[STATEMENT]
lemma mahler_measure_dvd: assumes "f \<noteq> 0" and "h dvd f"
  shows "mahler_measure h \<le> mahler_measure f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mahler_measure h \<le> mahler_measure f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mahler_measure h \<le> mahler_measure f
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> 0
h dvd f
[PROOF STEP]
obtain g where f: "f = g * h"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
h dvd f

goal (1 subgoal):
 1. (\<And>g. f = g * h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
\<exists>k. f = h * k

goal (1 subgoal):
 1. (\<And>g. f = g * h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = g * h

goal (1 subgoal):
 1. mahler_measure h \<le> mahler_measure f
[PROOF STEP]
from f assms
[PROOF STATE]
proof (chain)
picking this:
f = g * h
f \<noteq> 0
h dvd f
[PROOF STEP]
have g0: "g \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f = g * h
f \<noteq> 0
h dvd f

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

goal (1 subgoal):
 1. mahler_measure h \<le> mahler_measure f
[PROOF STEP]
hence mg: "mahler_measure g \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
g \<noteq> 0

goal (1 subgoal):
 1. 1 \<le> mahler_measure g
[PROOF STEP]
by (rule mahler_measure_poly_ge_1)
[PROOF STATE]
proof (state)
this:
1 \<le> mahler_measure g

goal (1 subgoal):
 1. mahler_measure h \<le> mahler_measure f
[PROOF STEP]
have "1 * mahler_measure h \<le> mahler_measure f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * mahler_measure h \<le> mahler_measure f
[PROOF STEP]
unfolding mahler_measure_def f measure_eq_prod
      of_int_poly_hom.hom_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * mahler_measure_poly (of_int_poly h) \<le> mahler_measure_poly (of_int_poly g) * mahler_measure_poly (of_int_poly h)
[PROOF STEP]
unfolding mahler_measure_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * mahler_measure h \<le> mahler_measure g * mahler_measure h
[PROOF STEP]
by (rule mult_right_mono[OF mg mahler_measure_ge_0])
[PROOF STATE]
proof (state)
this:
1 * mahler_measure h \<le> mahler_measure f

goal (1 subgoal):
 1. mahler_measure h \<le> mahler_measure f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
1 * mahler_measure h \<le> mahler_measure f

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_left_invertible_independent_columns:
  fixes A :: "'a::{field}^'n^'m"
  shows "(\<exists>(B::'a ^'m^'n). B ** A = mat 1) \<longleftrightarrow>
      (\<forall>c. sum (\<lambda>i. c i *s column i A) (UNIV :: 'n set) = 0 \<longrightarrow> (\<forall>i. c i = 0))"
    (is "?lhs \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
let ?U = "UNIV :: 'n set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
assume k: "\<forall>x. A *v x = 0 \<longrightarrow> x = 0"
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
fix c i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
assume c: "sum (\<lambda>i. c i *s column i A) ?U = 0" and i: "i \<in> ?U"
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. c i *s column i A) = 0
i \<in> UNIV

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
let ?x = "\<chi> i. c i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
have th0:"A *v ?x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v (\<chi>i. c i) = 0
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. c i *s column i A) = 0

goal (1 subgoal):
 1. A *v (\<chi>i. c i) = 0
[PROOF STEP]
by (vector matrix_mult_sum)
[PROOF STATE]
proof (state)
this:
A *v (\<chi>i. c i) = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
from k[rule_format, OF th0] i
[PROOF STATE]
proof (chain)
picking this:
(\<chi>i. c i) = 0
i \<in> UNIV
[PROOF STEP]
have "c i = 0"
[PROOF STATE]
proof (prove)
using this:
(\<chi>i. c i) = 0
i \<in> UNIV

goal (1 subgoal):
 1. c i = (0::'a)
[PROOF STEP]
by (vector vec_eq_iff)
[PROOF STATE]
proof (state)
this:
c i = (0::'a)

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<Sum>i\<in>UNIV. ?c2 i *s column i A) = 0; ?i2 \<in> UNIV\<rbrakk> \<Longrightarrow> ?c2 ?i2 = (0::'a)

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
hence ?rhs
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<Sum>i\<in>UNIV. ?c2 i *s column i A) = 0; ?i2 \<in> UNIV\<rbrakk> \<Longrightarrow> ?c2 ?i2 = (0::'a)

goal (1 subgoal):
 1. \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0 \<Longrightarrow> \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0 \<Longrightarrow> \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0 \<Longrightarrow> \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
assume H: ?rhs
[PROOF STATE]
proof (state)
this:
\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
assume x: "A *v x = 0"
[PROOF STATE]
proof (state)
this:
A *v x = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
let ?c = "\<lambda>i. ((x$i ):: 'a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
from H[rule_format, of ?c, unfolded matrix_mult_sum[symmetric], OF x]
[PROOF STATE]
proof (chain)
picking this:
x $ ?i = (0::'a)
[PROOF STEP]
have "x = 0"
[PROOF STATE]
proof (prove)
using this:
x $ ?i = (0::'a)

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

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
A *v ?x2 = 0 \<Longrightarrow> ?x2 = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)); A *v ?x2 = 0\<rbrakk> \<Longrightarrow> ?x2 = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0 \<Longrightarrow> \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))
\<lbrakk>\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)); A *v ?x2 = 0\<rbrakk> \<Longrightarrow> ?x2 = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0 \<Longrightarrow> \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))
\<lbrakk>\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)); A *v ?x2 = 0\<rbrakk> \<Longrightarrow> ?x2 = 0

goal (1 subgoal):
 1. (\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
unfolding matrix_left_invertible_ker
[PROOF STATE]
proof (prove)
using this:
\<forall>x. A *v x = 0 \<longrightarrow> x = 0 \<Longrightarrow> \<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a))
\<lbrakk>\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)); A *v ?x2 = 0\<rbrakk> \<Longrightarrow> ?x2 = 0

goal (1 subgoal):
 1. (\<forall>x. A *v x = 0 \<longrightarrow> x = 0) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>B. B ** A = mat (1::'a)) = (\<forall>c. (\<Sum>i\<in>UNIV. c i *s column i A) = 0 \<longrightarrow> (\<forall>i. c i = (0::'a)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smap_union_mono: "\<lbrakk> ve1 \<subseteq>. ve1'; ve2 \<subseteq>. ve2' \<rbrakk> \<Longrightarrow> ve1 \<union>. ve2 \<subseteq>. ve1' \<union>. ve2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ve1 \<subseteq>. ve1'; ve2 \<subseteq>. ve2'\<rbrakk> \<Longrightarrow> ve1 \<union>. ve2 \<subseteq>. ve1' \<union>. ve2'
[PROOF STEP]
by (auto simp add:smap_less_def smap_union_def)


[STATEMENT]
lemma lincomb_scalar_prod_right: assumes "W \<subseteq> carrier_vec n" "v \<in> carrier_vec n"
  shows "v \<bullet> lincomb a W = (\<Sum>w\<in>W. a w * (v \<bullet> w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<bullet> lincomb a W = (\<Sum>w\<in>W. a w * (v \<bullet> w))
[PROOF STEP]
unfolding lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<bullet> (\<Oplus>\<^bsub>V\<^esub>v\<in>W. a v \<cdot>\<^sub>v v) = (\<Sum>w\<in>W. a w * (v \<bullet> w))
[PROOF STEP]
by (subst finsum_scalar_prod_sum', insert assms, auto intro!: sum.cong)


[STATEMENT]
lemma is_moebius_similarity':
  assumes "a \<noteq> 0\<^sub>h" and "a \<noteq> \<infinity>\<^sub>h" and "b \<noteq> \<infinity>\<^sub>h"
  shows "(\<lambda> z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))
[PROOF STEP]
obtain ka kb where *: "a = of_complex ka"  "ka \<noteq> 0" "b = of_complex kb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ka kb. \<lbrakk>a = of_complex ka; ka \<noteq> 0; b = of_complex kb\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0\<^sub>h
a \<noteq> \<infinity>\<^sub>h
b \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. (\<And>ka kb. \<lbrakk>a = of_complex ka; ka \<noteq> 0; b = of_complex kb\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex[of a]  inf_or_of_complex[of b]
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0\<^sub>h
a \<noteq> \<infinity>\<^sub>h
b \<noteq> \<infinity>\<^sub>h
a = \<infinity>\<^sub>h \<or> (\<exists>x. a = of_complex x)
b = \<infinity>\<^sub>h \<or> (\<exists>x. b = of_complex x)

goal (1 subgoal):
 1. (\<And>ka kb. \<lbrakk>a = of_complex ka; ka \<noteq> 0; b = of_complex kb\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = of_complex ka
ka \<noteq> 0
b = of_complex kb

goal (1 subgoal):
 1. (\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a = of_complex ka
ka \<noteq> 0
b = of_complex kb

goal (1 subgoal):
 1. (\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))
[PROOF STEP]
unfolding is_moebius_def
[PROOF STATE]
proof (prove)
using this:
a = of_complex ka
ka \<noteq> 0
b = of_complex kb

goal (1 subgoal):
 1. (\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))
[PROOF STEP]
using moebius_pt_moebius_similarity'[of ka kb]
[PROOF STATE]
proof (prove)
using this:
a = of_complex ka
ka \<noteq> 0
b = of_complex kb
ka \<noteq> 0 \<Longrightarrow> moebius_pt (moebius_similarity ka kb) = (\<lambda>z. of_complex ka *\<^sub>h z +\<^sub>h of_complex kb)

goal (1 subgoal):
 1. (\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>z. a *\<^sub>h z +\<^sub>h b) = moebius_pt (moebius_similarity (to_complex a) (to_complex b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIM_const_eq: "(\<lambda>x. k) \<midarrow>a\<rightarrow> L \<Longrightarrow> k = L"
  for a :: "'a::perfect_space" and k L :: "'b::t2_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. k) \<midarrow>a\<rightarrow> L \<Longrightarrow> k = L
[PROOF STEP]
by (simp add: tendsto_const_iff)


[STATEMENT]
lemma bigtheta_real_nat_transfer:
  "(f :: real \<Rightarrow> real) \<in> \<Theta>(g) \<Longrightarrow> (\<lambda>x::nat. f (real x)) \<in> \<Theta>(\<lambda>x. g (real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Theta>(g) \<Longrightarrow> (\<lambda>x. f (real x)) \<in> \<Theta>(\<lambda>x. g (real x))
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> O(g) \<inter> \<Omega>(g) \<Longrightarrow> (\<lambda>x. f (real x)) \<in> O(\<lambda>x. g (real x)) \<inter> \<Omega>(\<lambda>x. g (real x))
[PROOF STEP]
using bigo_real_nat_transfer bigomega_real_nat_transfer
[PROOF STATE]
proof (prove)
using this:
?f \<in> O(?g) \<Longrightarrow> (\<lambda>x. ?f (real x)) \<in> O(\<lambda>x. ?g (real x))
?f \<in> \<Omega>(?g) \<Longrightarrow> (\<lambda>x. ?f (real x)) \<in> \<Omega>(\<lambda>x. ?g (real x))

goal (1 subgoal):
 1. f \<in> O(g) \<inter> \<Omega>(g) \<Longrightarrow> (\<lambda>x. f (real x)) \<in> O(\<lambda>x. g (real x)) \<inter> \<Omega>(\<lambda>x. g (real x))
[PROOF STEP]
by blast


[STATEMENT]
lemma unitary_diagD:
  assumes "unitary_diag A B U"
  shows "similar_mat_wit A B U (Complex_Matrix.adjoint U)"
    "diagonal_mat B" "unitary U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) &&& diagonal_mat B &&& Complex_Matrix.unitary U
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitary_diag A B U

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) &&& diagonal_mat B &&& Complex_Matrix.unitary U
[PROOF STEP]
unfolding unitary_diag_def unitarily_equiv_def
[PROOF STATE]
proof (prove)
using this:
(Complex_Matrix.unitary U \<and> similar_mat_wit A B U (Complex_Matrix.adjoint U)) \<and> diagonal_mat B

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U) &&& diagonal_mat B &&& Complex_Matrix.unitary U
[PROOF STEP]
by simp+


[STATEMENT]
lemma iMin_lessThan: "0 < n \<Longrightarrow> iMin {..<(n::nat)} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> iMin {..<n} = 0
[PROOF STEP]
by (rule iMin_equality, simp_all)


[STATEMENT]
lemma val_mult:
  assumes "x \<in> carrier Q\<^sub>p"
  assumes "y \<in> carrier Q\<^sub>p"
  shows "(val (x \<otimes> y)) = (val x) + (val y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (x \<otimes> y) = val x + val y
[PROOF STEP]
apply(cases "x = \<zero> \<or> y = \<zero>")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x = \<zero> \<or> y = \<zero> \<Longrightarrow> val (x \<otimes> y) = val x + val y
 2. \<not> (x = \<zero> \<or> y = \<zero>) \<Longrightarrow> val (x \<otimes> y) = val x + val y
[PROOF STEP]
using assms local.val_zero
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier Q\<^sub>p
y \<in> carrier Q\<^sub>p
val \<zero> = \<infinity>

goal (2 subgoals):
 1. x = \<zero> \<or> y = \<zero> \<Longrightarrow> val (x \<otimes> y) = val x + val y
 2. \<not> (x = \<zero> \<or> y = \<zero>) \<Longrightarrow> val (x \<otimes> y) = val x + val y
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (x = \<zero> \<or> y = \<zero>) \<Longrightarrow> val (x \<otimes> y) = val x + val y
[PROOF STEP]
by (meson assms(1) assms(2) not_nonzero_Qp val_mult0)