[STATEMENT]
lemma det_four_block_mat_upper_right_zero: fixes A1 :: "'a :: idom mat"
  assumes A1: "A1 \<in> carrier_mat n n"
  and A20: "A2 = (0\<^sub>m n m)" and A3: "A3 \<in> carrier_mat m n"
  and A4: "A4 \<in> carrier_mat m m"
shows "det (four_block_mat A1 A2 A3 A4) = det A1 * det A4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
using assms(2-)
[PROOF STATE]
proof (prove)
using this:
A2 = 0\<^sub>m n m
A3 \<in> carrier_mat m n
A4 \<in> carrier_mat m m

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
proof (induct m arbitrary: A2 A3 A4)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n 0; A3 \<in> carrier_mat 0 n; A4 \<in> carrier_mat 0 0\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
 2. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
case (0 A2 A3 A4)
[PROOF STATE]
proof (state)
this:
A2 = 0\<^sub>m n 0
A3 \<in> carrier_mat 0 n
A4 \<in> carrier_mat 0 0

goal (2 subgoals):
 1. \<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n 0; A3 \<in> carrier_mat 0 n; A4 \<in> carrier_mat 0 0\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
 2. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
hence *: "four_block_mat A1 A2 A3 A4 = A1"
[PROOF STATE]
proof (prove)
using this:
A2 = 0\<^sub>m n 0
A3 \<in> carrier_mat 0 n
A4 \<in> carrier_mat 0 0

goal (1 subgoal):
 1. four_block_mat A1 A2 A3 A4 = A1
[PROOF STEP]
using A1
[PROOF STATE]
proof (prove)
using this:
A2 = 0\<^sub>m n 0
A3 \<in> carrier_mat 0 n
A4 \<in> carrier_mat 0 0
A1 \<in> carrier_mat n n

goal (1 subgoal):
 1. four_block_mat A1 A2 A3 A4 = A1
[PROOF STEP]
by (intro eq_matI, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 A3 A4 = A1

goal (2 subgoals):
 1. \<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n 0; A3 \<in> carrier_mat 0 n; A4 \<in> carrier_mat 0 0\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
 2. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from 0
[PROOF STATE]
proof (chain)
picking this:
A2 = 0\<^sub>m n 0
A3 \<in> carrier_mat 0 n
A4 \<in> carrier_mat 0 0
[PROOF STEP]
have 4: "A4 = 1\<^sub>m 0"
[PROOF STATE]
proof (prove)
using this:
A2 = 0\<^sub>m n 0
A3 \<in> carrier_mat 0 n
A4 \<in> carrier_mat 0 0

goal (1 subgoal):
 1. A4 = 1\<^sub>m 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A4 = 1\<^sub>m 0

goal (2 subgoals):
 1. \<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n 0; A3 \<in> carrier_mat 0 n; A4 \<in> carrier_mat 0 0\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
 2. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A1 = det A1 * det A4
[PROOF STEP]
unfolding 4
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A1 = det A1 * det (1\<^sub>m 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 A3 A4) = det A1 * det A4

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
case (Suc m A2 A3 A4)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?A2.0 = 0\<^sub>m n m; ?A3.0 \<in> carrier_mat m n; ?A4.0 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 ?A2.0 ?A3.0 ?A4.0) = det A1 * det ?A4.0
A2 = 0\<^sub>m n (Suc m)
A3 \<in> carrier_mat (Suc m) n
A4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?m = "Suc m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?A2.0 = 0\<^sub>m n m; ?A3.0 \<in> carrier_mat m n; ?A4.0 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 ?A2.0 ?A3.0 ?A4.0) = det A1 * det ?A4.0
A2 = 0\<^sub>m n (Suc m)
A3 \<in> carrier_mat (Suc m) n
A4 \<in> carrier_mat (Suc m) (Suc m)
[PROOF STEP]
have A2: "A2 \<in> carrier_mat n ?m"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A2.0 = 0\<^sub>m n m; ?A3.0 \<in> carrier_mat m n; ?A4.0 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 ?A2.0 ?A3.0 ?A4.0) = det A1 * det ?A4.0
A2 = 0\<^sub>m n (Suc m)
A3 \<in> carrier_mat (Suc m) n
A4 \<in> carrier_mat (Suc m) (Suc m)

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

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
note A20 = Suc(2)
[PROOF STATE]
proof (state)
this:
A2 = 0\<^sub>m n (Suc m)

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
note A34 = Suc(3-4)
[PROOF STATE]
proof (state)
this:
A3 \<in> carrier_mat (Suc m) n
A4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?A = "four_block_mat A1 A2 A3 A4"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?P = "\<lambda> B3 B4 v k. v \<noteq> 0 \<and> v * det ?A = det (four_block_mat A1 A2 B3 B4)
    \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat ?m n \<and> B4 \<in> carrier_mat ?m ?m \<and> (\<forall> i < k. B4 $$ (i,m) = 0)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "k \<le> m \<Longrightarrow> \<exists> B3 B4 v. ?P B3 B4 v k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. B4 $$ (i, m) = (0::'a))
 2. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 \<le> m

goal (2 subgoals):
 1. 0 \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. B4 $$ (i, m) = (0::'a))
 2. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "?P A3 A4 1 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) \<noteq> (0::'a) \<and> (1::'a) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 A3 A4) \<and> (1::'a) * det A4 = det A4 \<and> A3 \<in> carrier_mat (Suc m) n \<and> A4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. A4 $$ (i, m) = (0::'a))
[PROOF STEP]
using A34
[PROOF STATE]
proof (prove)
using this:
A3 \<in> carrier_mat (Suc m) n
A4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. (1::'a) \<noteq> (0::'a) \<and> (1::'a) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 A3 A4) \<and> (1::'a) * det A4 = det A4 \<and> A3 \<in> carrier_mat (Suc m) n \<and> A4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. A4 $$ (i, m) = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) \<noteq> (0::'a) \<and> (1::'a) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 A3 A4) \<and> (1::'a) * det A4 = det A4 \<and> A3 \<in> carrier_mat (Suc m) n \<and> A4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. A4 $$ (i, m) = (0::'a))

goal (2 subgoals):
 1. 0 \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. B4 $$ (i, m) = (0::'a))
 2. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(1::'a) \<noteq> (0::'a) \<and> (1::'a) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 A3 A4) \<and> (1::'a) * det A4 = det A4 \<and> A3 \<in> carrier_mat (Suc m) n \<and> A4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. A4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<0. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a))
Suc k \<le> m

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a))
Suc k \<le> m
[PROOF STEP]
obtain B3 B4 v where v: "v \<noteq> 0" and det: "v * det ?A =
      det (four_block_mat A1 A2 B3 B4)" "v * det A4 = det B4"
     and B3: "B3 \<in> carrier_mat ?m n" and B4: "B4 \<in> carrier_mat ?m ?m"  and 0: "\<forall> i < k. B4 $$ (i,m) = 0"
[PROOF STATE]
proof (prove)
using this:
k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a))
Suc k \<le> m

goal (1 subgoal):
 1. (\<And>v B3 B4. \<lbrakk>v \<noteq> (0::'a); v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4); v * det A4 = det B4; B3 \<in> carrier_mat (Suc m) n; B4 \<in> carrier_mat (Suc m) (Suc m); \<forall>i<k. B4 $$ (i, m) = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> (0::'a)
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
\<forall>i<k. B4 $$ (i, m) = (0::'a)

goal (1 subgoal):
 1. \<And>k. \<lbrakk>k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<k. B4 $$ (i, m) = (0::'a)); Suc k \<le> m\<rbrakk> \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
proof (cases "B4 $$ (k,m) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B4 $$ (k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
B4 $$ (k, m) = (0::'a)

goal (2 subgoals):
 1. B4 $$ (k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
with 0
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<k. B4 $$ (i, m) = (0::'a)
B4 $$ (k, m) = (0::'a)
[PROOF STEP]
have 0: "\<forall> i < Suc k. B4 $$ (i,m) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<k. B4 $$ (i, m) = (0::'a)
B4 $$ (k, m) = (0::'a)

goal (1 subgoal):
 1. \<forall>i<Suc k. B4 $$ (i, m) = (0::'a)
[PROOF STEP]
using less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>i<k. B4 $$ (i, m) = (0::'a)
B4 $$ (k, m) = (0::'a)
(?m < Suc ?n) = (?m < ?n \<or> ?m = ?n)

goal (1 subgoal):
 1. \<forall>i<Suc k. B4 $$ (i, m) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<Suc k. B4 $$ (i, m) = (0::'a)

goal (2 subgoals):
 1. B4 $$ (k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
with v det B3 B4
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> (0::'a)
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
\<forall>i<Suc k. B4 $$ (i, m) = (0::'a)
[PROOF STEP]
have "?P B3 B4 v (Suc k)"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> (0::'a)
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
\<forall>i<Suc k. B4 $$ (i, m) = (0::'a)

goal (1 subgoal):
 1. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal (2 subgoals):
 1. B4 $$ (k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
case Bk: False
[PROOF STATE]
proof (state)
this:
B4 $$ (k, m) \<noteq> (0::'a)

goal (1 subgoal):
 1. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?k = "Suc k"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from Suc(2)
[PROOF STATE]
proof (chain)
picking this:
Suc k \<le> m
[PROOF STEP]
have k: "k < ?m" "Suc k < ?m" "k \<noteq> Suc k"
[PROOF STATE]
proof (prove)
using this:
Suc k \<le> m

goal (1 subgoal):
 1. k < Suc m &&& Suc k < Suc m &&& k \<noteq> Suc k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k < Suc m
Suc k < Suc m
k \<noteq> Suc k

goal (1 subgoal):
 1. B4 $$ (k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
proof (cases "B4 $$ (?k,m) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
B4 $$ (Suc k, m) = (0::'a)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B4 = "swaprows k (Suc k) B4"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B3 = "swaprows k (Suc k) B3"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B = "four_block_mat A1 A2 ?B3 ?B4"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?v = "-v"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from det_swaprows[OF k B4] det
[PROOF STATE]
proof (chain)
picking this:
det (swaprows k (Suc k) B4) = - det B4
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4
[PROOF STEP]
have det1: "?v * det A4 = det ?B4"
[PROOF STATE]
proof (prove)
using this:
det (swaprows k (Suc k) B4) = - det B4
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4

goal (1 subgoal):
 1. - v * det A4 = det (swaprows k (Suc k) B4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- v * det A4 = det (swaprows k (Suc k) B4)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from v
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> (0::'a)
[PROOF STEP]
have v: "?v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> (0::'a)

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

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from B3
[PROOF STATE]
proof (chain)
picking this:
B3 \<in> carrier_mat (Suc m) n
[PROOF STEP]
have B3': "?B3 \<in> carrier_mat ?m n"
[PROOF STATE]
proof (prove)
using this:
B3 \<in> carrier_mat (Suc m) n

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

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from B4
[PROOF STATE]
proof (chain)
picking this:
B4 \<in> carrier_mat (Suc m) (Suc m)
[PROOF STEP]
have B4': "?B4 \<in> carrier_mat ?m ?m"
[PROOF STATE]
proof (prove)
using this:
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "?v * det ?A = - det (four_block_mat A1 A2 B3 B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - v * det (four_block_mat A1 A2 A3 A4) = - det (four_block_mat A1 A2 B3 B4)
[PROOF STEP]
using det
[PROOF STATE]
proof (prove)
using this:
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4

goal (1 subgoal):
 1. - v * det (four_block_mat A1 A2 A3 A4) = - det (four_block_mat A1 A2 B3 B4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- v * det (four_block_mat A1 A2 A3 A4) = - det (four_block_mat A1 A2 B3 B4)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- v * det (four_block_mat A1 A2 A3 A4) = - det (four_block_mat A1 A2 B3 B4)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "\<dots> = det (swaprows (n + k) (n + ?k) (four_block_mat A1 A2 B3 B4))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - det (four_block_mat A1 A2 B3 B4) = det (swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4))
[PROOF STEP]
by (rule sym, rule det_swaprows[of _ "n + ?m"], insert A1 A2 B3 B4 k, auto)
[PROOF STATE]
proof (state)
this:
- det (four_block_mat A1 A2 B3 B4) = det (swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4))

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- det (four_block_mat A1 A2 B3 B4) = det (swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4))

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "swaprows (n + k) (n + ?k) (four_block_mat A1 A2 B3 B4) = ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4)
[PROOF STEP]
proof (rule eq_matI, unfold index_mat_four_block index_mat_swaprows, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + dim_row B4; j < dim_col A1 + dim_col B4\<rbrakk> \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + dim_row B4
 3. dim_col A1 + dim_col B4 = dim_col A1 + dim_col B4
[PROOF STEP]
case (1 i j)
[PROOF STATE]
proof (state)
this:
i < dim_row A1 + dim_row B4
j < dim_col A1 + dim_col B4

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + dim_row B4; j < dim_col A1 + dim_col B4\<rbrakk> \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + dim_row B4
 3. dim_col A1 + dim_col B4 = dim_col A1 + dim_col B4
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
proof (cases "i < n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
 2. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < n

goal (2 subgoals):
 1. i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
 2. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
using 1(2) A1 A2 B3 B4
[PROOF STATE]
proof (prove)
using this:
i < n
j < dim_col A1 + dim_col B4
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < n

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
hence "i = n + (i - n)"
[PROOF STATE]
proof (prove)
using this:
\<not> i < n

goal (1 subgoal):
 1. i = n + (i - n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = n + (i - n)

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = n + (i - n)
[PROOF STEP]
obtain d where "i = n + d"
[PROOF STATE]
proof (prove)
using this:
i = n + (i - n)

goal (1 subgoal):
 1. (\<And>d. i = n + d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i = n + d

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = n + d

goal (1 subgoal):
 1. swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
using 1 A1 A2 B3 B4 k(2)
[PROOF STATE]
proof (prove)
using this:
i = n + d
i < dim_row A1 + dim_row B4
j < dim_col A1 + dim_col B4
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
Suc k < Suc m

goal (1 subgoal):
 1. swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) $$ (i, j) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4) $$ (i, j)

goal (2 subgoals):
 1. dim_row A1 + dim_row B4 = dim_row A1 + dim_row B4
 2. dim_col A1 + dim_col B4 = dim_col A1 + dim_col B4
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
swaprows (n + k) (n + Suc k) (four_block_mat A1 A2 B3 B4) = four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4))
[PROOF STEP]
have det2: "?v * det ?A = det ?B"
[PROOF STATE]
proof (prove)
using this:
- v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4))

goal (1 subgoal):
 1. - v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
- v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4))

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from True 0 B4 k(2)
[PROOF STATE]
proof (chain)
picking this:
B4 $$ (Suc k, m) = (0::'a)
\<forall>i<k. B4 $$ (i, m) = (0::'a)
B4 \<in> carrier_mat (Suc m) (Suc m)
Suc k < Suc m
[PROOF STEP]
have "\<forall> i < Suc k. ?B4 $$ (i,m) = 0"
[PROOF STATE]
proof (prove)
using this:
B4 $$ (Suc k, m) = (0::'a)
\<forall>i<k. B4 $$ (i, m) = (0::'a)
B4 \<in> carrier_mat (Suc m) (Suc m)
Suc k < Suc m

goal (1 subgoal):
 1. \<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a)
[PROOF STEP]
unfolding less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
B4 $$ (Suc k, m) = (0::'a)
\<forall>i<k. B4 $$ (i, m) = (0::'a)
B4 \<in> carrier_mat (Suc m) (Suc m)
Suc k < m \<or> Suc k = m

goal (1 subgoal):
 1. \<forall>i. i < k \<or> i = k \<longrightarrow> swaprows k (Suc k) B4 $$ (i, m) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a)

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
with det1 det2 B3' B4' v
[PROOF STATE]
proof (chain)
picking this:
- v * det A4 = det (swaprows k (Suc k) B4)
- v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4))
swaprows k (Suc k) B3 \<in> carrier_mat (Suc m) n
swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m)
- v \<noteq> (0::'a)
\<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a)
[PROOF STEP]
have "?P ?B3 ?B4 ?v (Suc k)"
[PROOF STATE]
proof (prove)
using this:
- v * det A4 = det (swaprows k (Suc k) B4)
- v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4))
swaprows k (Suc k) B3 \<in> carrier_mat (Suc m) n
swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m)
- v \<noteq> (0::'a)
\<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a)

goal (1 subgoal):
 1. - v \<noteq> (0::'a) \<and> - v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4)) \<and> - v * det A4 = det (swaprows k (Suc k) B4) \<and> swaprows k (Suc k) B3 \<in> carrier_mat (Suc m) n \<and> swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- v \<noteq> (0::'a) \<and> - v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4)) \<and> - v * det A4 = det (swaprows k (Suc k) B4) \<and> swaprows k (Suc k) B3 \<in> carrier_mat (Suc m) n \<and> swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a))

goal (2 subgoals):
 1. B4 $$ (Suc k, m) = (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
 2. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
- v \<noteq> (0::'a) \<and> - v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (swaprows k (Suc k) B3) (swaprows k (Suc k) B4)) \<and> - v * det A4 = det (swaprows k (Suc k) B4) \<and> swaprows k (Suc k) B3 \<in> carrier_mat (Suc m) n \<and> swaprows k (Suc k) B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. swaprows k (Suc k) B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
B4 $$ (Suc k, m) \<noteq> (0::'a)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?bk = "B4 $$ (?k,m)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?b = "B4 $$ (k,m)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?v = "v * ?bk"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B3 = "addrow (- ?b) k ?k (multrow k ?bk B3)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B4 = "addrow (- ?b) k ?k (multrow k ?bk B4)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have *: "det ?B4 = ?bk * det B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) = B4 $$ (Suc k, m) * det B4
[PROOF STEP]
by (subst det_addrow[OF k(2-3)], force simp: B4, rule det_multrow[OF k(1) B4])
[PROOF STATE]
proof (state)
this:
det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) = B4 $$ (Suc k, m) * det B4

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
with det(2)[symmetric]
[PROOF STATE]
proof (chain)
picking this:
det B4 = v * det A4
det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) = B4 $$ (Suc k, m) * det B4
[PROOF STEP]
have det2: "?v * det A4 = det ?B4"
[PROOF STATE]
proof (prove)
using this:
det B4 = v * det A4
det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) = B4 $$ (Suc k, m) * det B4

goal (1 subgoal):
 1. v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))
[PROOF STEP]
by (auto simp: ac_simps)
[PROOF STATE]
proof (state)
this:
v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from 0 k(2) B4
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<k. B4 $$ (i, m) = (0::'a)
Suc k < Suc m
B4 \<in> carrier_mat (Suc m) (Suc m)
[PROOF STEP]
have 0: "\<forall> i < Suc k. ?B4 $$ (i,m) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<k. B4 $$ (i, m) = (0::'a)
Suc k < Suc m
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. \<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a)
[PROOF STEP]
unfolding less_Suc_eq
[PROOF STATE]
proof (prove)
using this:
\<forall>i<k. B4 $$ (i, m) = (0::'a)
Suc k < m \<or> Suc k = m
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. \<forall>i. i < k \<or> i = k \<longrightarrow> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from False v
[PROOF STATE]
proof (chain)
picking this:
B4 $$ (Suc k, m) \<noteq> (0::'a)
v \<noteq> (0::'a)
[PROOF STEP]
have v: "?v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
B4 $$ (Suc k, m) \<noteq> (0::'a)
v \<noteq> (0::'a)

goal (1 subgoal):
 1. v * B4 $$ (Suc k, m) \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v * B4 $$ (Suc k, m) \<noteq> (0::'a)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from B3
[PROOF STATE]
proof (chain)
picking this:
B3 \<in> carrier_mat (Suc m) n
[PROOF STEP]
have B3': "?B3 \<in> carrier_mat ?m n"
[PROOF STATE]
proof (prove)
using this:
B3 \<in> carrier_mat (Suc m) n

goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from B4
[PROOF STATE]
proof (chain)
picking this:
B4 \<in> carrier_mat (Suc m) (Suc m)
[PROOF STEP]
have B4': "?B4 \<in> carrier_mat ?m ?m"
[PROOF STATE]
proof (prove)
using this:
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B' = "multrow (n + k) ?bk (four_block_mat A1 A2 B3 B4)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have B': "?B' \<in> carrier_mat (n + ?m) (n + ?m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4) \<in> carrier_mat (n + Suc m) (n + Suc m)
[PROOF STEP]
using A1 A2 B3 B4 k
[PROOF STATE]
proof (prove)
using this:
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
k < Suc m
Suc k < Suc m
k \<noteq> Suc k

goal (1 subgoal):
 1. multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4) \<in> carrier_mat (n + Suc m) (n + Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4) \<in> carrier_mat (n + Suc m) (n + Suc m)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
let ?B = "four_block_mat A1 A2 ?B3 ?B4"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "?v * det ?A = ?bk * det (four_block_mat A1 A2 B3 B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4)
[PROOF STEP]
using det
[PROOF STATE]
proof (prove)
using this:
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4

goal (1 subgoal):
 1. v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4)

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "\<dots> = det (addrow (- ?b) (n + k) (n + ?k) ?B')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4) = det (addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)))
[PROOF STEP]
by (subst det_addrow[OF _ _ B'], insert k(2), force, force, rule sym, rule det_multrow[of _ "n + ?m"],
          insert A1 A2 B3 B4 k, auto)
[PROOF STATE]
proof (state)
this:
B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4) = det (addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B4 $$ (Suc k, m) * det (four_block_mat A1 A2 B3 B4) = det (addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have "addrow (- ?b) (n + k) (n + ?k) ?B' = ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))
[PROOF STEP]
proof (rule eq_matI, unfold index_mat_four_block index_mat_multrow index_mat_addrow, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + dim_row B4; j < dim_col A1 + dim_col B4\<rbrakk> \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + dim_row B4
 3. dim_col A1 + dim_col B4 = dim_col A1 + dim_col B4
[PROOF STEP]
case (1 i j)
[PROOF STATE]
proof (state)
this:
i < dim_row A1 + dim_row B4
j < dim_col A1 + dim_col B4

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + dim_row B4; j < dim_col A1 + dim_col B4\<rbrakk> \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + dim_row B4
 3. dim_col A1 + dim_col B4 = dim_col A1 + dim_col B4
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
proof (cases "i < n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
 2. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < n

goal (2 subgoals):
 1. i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
 2. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
using 1(2) A1 A2 B3 B4
[PROOF STATE]
proof (prove)
using this:
i < n
j < dim_col A1 + dim_col B4
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < n

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
hence "i = n + (i - n)"
[PROOF STATE]
proof (prove)
using this:
\<not> i < n

goal (1 subgoal):
 1. i = n + (i - n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i = n + (i - n)

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = n + (i - n)
[PROOF STEP]
obtain d where "i = n + d"
[PROOF STATE]
proof (prove)
using this:
i = n + (i - n)

goal (1 subgoal):
 1. (\<And>d. i = n + d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i = n + d

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = n + d

goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
using 1 A1 A2 B3 B4 k(2)
[PROOF STATE]
proof (prove)
using this:
i = n + d
i < dim_row A1 + dim_row B4
j < dim_col A1 + dim_col B4
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
Suc k < Suc m

goal (1 subgoal):
 1. addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) $$ (i, j) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) $$ (i, j)

goal (2 subgoals):
 1. dim_row A1 + dim_row B4 = dim_row A1 + dim_row B4
 2. dim_col A1 + dim_col B4 = dim_col A1 + dim_col B4
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
addrow (- B4 $$ (k, m)) (n + k) (n + Suc k) (multrow (n + k) (B4 $$ (Suc k, m)) (four_block_mat A1 A2 B3 B4)) = four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)))
[PROOF STEP]
have det1: "?v * det ?A = det ?B"
[PROOF STATE]
proof (prove)
using this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)))

goal (1 subgoal):
 1. v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
from det1 det2 B3' B4' v 0
[PROOF STATE]
proof (chain)
picking this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)))
v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))
addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n
addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m)
v * B4 $$ (Suc k, m) \<noteq> (0::'a)
\<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a)
[PROOF STEP]
have "?P ?B3 ?B4 ?v (Suc k)"
[PROOF STATE]
proof (prove)
using this:
v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)))
v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))
addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n
addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m)
v * B4 $$ (Suc k, m) \<noteq> (0::'a)
\<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a)

goal (1 subgoal):
 1. v * B4 $$ (Suc k, m) \<noteq> (0::'a) \<and> v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))) \<and> v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) \<and> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n \<and> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v * B4 $$ (Suc k, m) \<noteq> (0::'a) \<and> v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))) \<and> v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) \<and> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n \<and> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. B4 $$ (Suc k, m) \<noteq> (0::'a) \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v * B4 $$ (Suc k, m) \<noteq> (0::'a) \<and> v * B4 $$ (Suc k, m) * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3)) (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4))) \<and> v * B4 $$ (Suc k, m) * det A4 = det (addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4)) \<and> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B3) \<in> carrier_mat (Suc m) n \<and> addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. addrow (- B4 $$ (k, m)) k (Suc k) (multrow k (B4 $$ (Suc k, m)) B4) $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<Suc k. B4 $$ (i, m) = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?k \<le> m \<Longrightarrow> \<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<?k. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from this[OF le_refl]
[PROOF STATE]
proof (chain)
picking this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<m. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
obtain B3 B4 v where P: "?P B3 B4 v m"
[PROOF STATE]
proof (prove)
using this:
\<exists>B3 B4 v. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<m. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. (\<And>v B3 B4. v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<m. B4 $$ (i, m) = (0::'a)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<m. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?B = "four_block_mat A1 A2 B3 B4"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from P
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<m. B4 $$ (i, m) = (0::'a))
[PROOF STEP]
have v: "v \<noteq> 0" and det: "v * det ?A = det ?B" "v * det A4 = det B4"
    and B3: "B3 \<in> carrier_mat ?m n" and B4: "B4 \<in> carrier_mat ?m ?m" and 0: "\<And> i. i < m \<Longrightarrow> B4 $$ (i, m) = 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> (0::'a) \<and> v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) \<and> v * det A4 = det B4 \<and> B3 \<in> carrier_mat (Suc m) n \<and> B4 \<in> carrier_mat (Suc m) (Suc m) \<and> (\<forall>i<m. B4 $$ (i, m) = (0::'a))

goal (1 subgoal):
 1. (v \<noteq> (0::'a) &&& v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4) &&& v * det A4 = det B4) &&& B3 \<in> carrier_mat (Suc m) n &&& B4 \<in> carrier_mat (Suc m) (Suc m) &&& (\<And>i. i < m \<Longrightarrow> B4 $$ (i, m) = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> (0::'a)
v * det (four_block_mat A1 A2 A3 A4) = det (four_block_mat A1 A2 B3 B4)
v * det A4 = det B4
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)
?i < m \<Longrightarrow> B4 $$ (?i, m) = (0::'a)

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?A2 = "0\<^sub>m n m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?A3 = "mat m n (\<lambda> ij. B3 $$ ij)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?A4 = "mat m m (\<lambda> ij. B4 $$ ij)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?B1 = "four_block_mat A1 ?A2 ?A3 ?A4"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?B2 = "0\<^sub>m (n + m) 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?B3 = "mat 1 (n + m) (\<lambda> (i,j). if j < n then B3 $$ (m,j) else B4 $$ (m,j - n))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
let ?B4 = "mat 1 1 (\<lambda> _. B4 $$ (m,m))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have B44: "B4 = four_block_mat ?A4 (0\<^sub>m m 1) (mat 1 m (\<lambda> (i,j). B4 $$ (m,j))) ?B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B4 = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))
[PROOF STEP]
proof (rule eq_matI, unfold index_mat_four_block dim_col_mat dim_row_mat, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < m + 1; j < m + 1\<rbrakk> \<Longrightarrow> B4 $$ (i, j) = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. dim_row B4 = m + 1
 3. dim_col B4 = m + 1
[PROOF STEP]
case (1 i j)
[PROOF STATE]
proof (state)
this:
i < m + 1
j < m + 1

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < m + 1; j < m + 1\<rbrakk> \<Longrightarrow> B4 $$ (i, j) = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. dim_row B4 = m + 1
 3. dim_col B4 = m + 1
[PROOF STEP]
hence [simp]: "\<not> i < m \<Longrightarrow> i = m" "\<not> j < m \<Longrightarrow> j = m"
[PROOF STATE]
proof (prove)
using this:
i < m + 1
j < m + 1

goal (1 subgoal):
 1. (\<not> i < m \<Longrightarrow> i = m) &&& (\<not> j < m \<Longrightarrow> j = m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> i < m \<Longrightarrow> i = m
\<not> j < m \<Longrightarrow> j = m

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < m + 1; j < m + 1\<rbrakk> \<Longrightarrow> B4 $$ (i, j) = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. dim_row B4 = m + 1
 3. dim_col B4 = m + 1
[PROOF STEP]
from 1
[PROOF STATE]
proof (chain)
picking this:
i < m + 1
j < m + 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < m + 1
j < m + 1

goal (1 subgoal):
 1. B4 $$ (i, j) = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
using B4 0
[PROOF STATE]
proof (prove)
using this:
i < m + 1
j < m + 1
B4 \<in> carrier_mat (Suc m) (Suc m)
?i < m \<Longrightarrow> B4 $$ (?i, m) = (0::'a)

goal (1 subgoal):
 1. B4 $$ (i, j) = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B4 $$ (i, j) = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)

goal (2 subgoals):
 1. dim_row B4 = m + 1
 2. dim_col B4 = m + 1
[PROOF STEP]
qed (insert B4, auto)
[PROOF STATE]
proof (state)
this:
B4 = four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "?B = four_block_mat ?B1 ?B2 ?B3 ?B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))
[PROOF STEP]
proof (rule eq_matI, unfold index_mat_four_block dim_col_mat dim_row_mat, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + m + 1; j < dim_col A1 + m + 1\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + m + 1
 3. dim_col A1 + dim_col B4 = dim_col A1 + m + 1
[PROOF STEP]
case (1 i j)
[PROOF STATE]
proof (state)
this:
i < dim_row A1 + m + 1
j < dim_col A1 + m + 1

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + m + 1; j < dim_col A1 + m + 1\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + m + 1
 3. dim_col A1 + dim_col B4 = dim_col A1 + m + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row A1 + m + 1
j < dim_col A1 + m + 1
[PROOF STEP]
consider (UL) "i < n + m" "j < n + m" | (UR) "i < n + m" "j = n + m"
        | (LL) "i = n + m" "j < n + m" | (LR) "i = n + m" "j = n + m"
[PROOF STATE]
proof (prove)
using this:
i < dim_row A1 + m + 1
j < dim_col A1 + m + 1

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using A1
[PROOF STATE]
proof (prove)
using this:
i < dim_row A1 + m + 1
j < dim_col A1 + m + 1
A1 \<in> carrier_mat n n

goal (1 subgoal):
 1. \<lbrakk>\<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> thesis; \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by auto linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> ?thesis2; \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> ?thesis2; \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> ?thesis2; \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> ?thesis2\<rbrakk> \<Longrightarrow> ?thesis2

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row A1 + m + 1; j < dim_col A1 + m + 1\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. dim_row A1 + dim_row B4 = dim_row A1 + m + 1
 3. dim_col A1 + dim_col B4 = dim_col A1 + m + 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> ?thesis2; \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> ?thesis2; \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> ?thesis2; \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> ?thesis2\<rbrakk> \<Longrightarrow> ?thesis2

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 4. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
case UL
[PROOF STATE]
proof (state)
this:
i < n + m
j < n + m

goal (4 subgoals):
 1. \<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 4. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
hence [simp]: "\<not> i < n \<Longrightarrow> i - n < m"
         "\<not> j < n \<Longrightarrow> j - n < m" "\<not> j < n \<Longrightarrow> j - n < Suc m"
[PROOF STATE]
proof (prove)
using this:
i < n + m
j < n + m

goal (1 subgoal):
 1. (\<not> i < n \<Longrightarrow> i - n < m) &&& (\<not> j < n \<Longrightarrow> j - n < m) &&& (\<not> j < n \<Longrightarrow> j - n < Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> i < n \<Longrightarrow> i - n < m
\<not> j < n \<Longrightarrow> j - n < m
\<not> j < n \<Longrightarrow> j - n < Suc m

goal (4 subgoals):
 1. \<lbrakk>i < n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 4. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
from UL
[PROOF STATE]
proof (chain)
picking this:
i < n + m
j < n + m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < n + m
j < n + m

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
using A1 A20 B3 B4
[PROOF STATE]
proof (prove)
using this:
i < n + m
j < n + m
A1 \<in> carrier_mat n n
A2 = 0\<^sub>m n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)

goal (3 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
case LL
[PROOF STATE]
proof (state)
this:
i = n + m
j < n + m

goal (3 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
hence [simp]: "\<not> j < n \<Longrightarrow> j - n < m" "\<not> j < n \<Longrightarrow> j - n < Suc m"
[PROOF STATE]
proof (prove)
using this:
i = n + m
j < n + m

goal (1 subgoal):
 1. (\<not> j < n \<Longrightarrow> j - n < m) &&& (\<not> j < n \<Longrightarrow> j - n < Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> j < n \<Longrightarrow> j - n < m
\<not> j < n \<Longrightarrow> j - n < Suc m

goal (3 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j < n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 3. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
from LL
[PROOF STATE]
proof (chain)
picking this:
i = n + m
j < n + m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = n + m
j < n + m

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
using A1 A2 B3 B4
[PROOF STATE]
proof (prove)
using this:
i = n + m
j < n + m
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)

goal (2 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
case LR
[PROOF STATE]
proof (state)
this:
i = n + m
j = n + m

goal (2 subgoals):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
 2. \<lbrakk>i = n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i = n + m
j = n + m

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
using A1 A2 B3 B4
[PROOF STATE]
proof (prove)
using this:
i = n + m
j = n + m
A1 \<in> carrier_mat n n
A2 \<in> carrier_mat n (Suc m)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)

goal (1 subgoal):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
case UR
[PROOF STATE]
proof (state)
this:
i < n + m
j = n + m

goal (1 subgoal):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
hence [simp]: "\<not> i < n \<Longrightarrow> i - n < m"
[PROOF STATE]
proof (prove)
using this:
i < n + m
j = n + m

goal (1 subgoal):
 1. \<not> i < n \<Longrightarrow> i - n < m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> i < n \<Longrightarrow> i - n < m

goal (1 subgoal):
 1. \<lbrakk>i < n + m; j = n + m\<rbrakk> \<Longrightarrow> four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
from UR
[PROOF STATE]
proof (chain)
picking this:
i < n + m
j = n + m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < n + m
j = n + m

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
using A1 A20 0 B3 B4
[PROOF STATE]
proof (prove)
using this:
i < n + m
j = n + m
A1 \<in> carrier_mat n n
A2 = 0\<^sub>m n (Suc m)
?i < m \<Longrightarrow> B4 $$ (?i, m) = (0::'a)
B3 \<in> carrier_mat (Suc m) n
B4 \<in> carrier_mat (Suc m) (Suc m)

goal (1 subgoal):
 1. four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 B3 B4 $$ (i, j) = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))) $$ (i, j)

goal (2 subgoals):
 1. dim_row A1 + dim_row B4 = dim_row A1 + m + 1
 2. dim_col A1 + dim_col B4 = dim_col A1 + m + 1
[PROOF STEP]
qed (insert B4, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A1 A2 B3 B4 = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
hence "det ?B = det (four_block_mat ?B1 ?B2 ?B3 ?B4)"
[PROOF STATE]
proof (prove)
using this:
four_block_mat A1 A2 B3 B4 = four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))

goal (1 subgoal):
 1. det (four_block_mat A1 A2 B3 B4) = det (four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 B3 B4) = det (four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 B3 B4) = det (four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "\<dots> = det ?B1 * det ?B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))) = det (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m)))
[PROOF STEP]
by (rule det_four_block_mat_upper_right_zero_col[of _ "n + m"], insert A1 A2 B3 B4, auto)
[PROOF STATE]
proof (state)
this:
det (four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))) = det (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m)))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) (0\<^sub>m (n + m) 1) (mat 1 (n + m) (\<lambda>(i, j). if j < n then B3 $$ (m, j) else B4 $$ (m, j - n))) (mat 1 1 (\<lambda>_. B4 $$ (m, m)))) = det (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m)))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "det ?B1 = det A1 * det (mat m m (($$) B4))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) = det A1 * det (mat m m (($$) B4))
[PROOF STEP]
by (rule Suc(1), insert B3 B4, auto)
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) = det A1 * det (mat m m (($$) B4))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 (0\<^sub>m n m) (mat m n (($$) B3)) (mat m m (($$) B4))) = det A1 * det (mat m m (($$) B4))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "\<dots> * det ?B4 = det A1 * (det (mat m m (($$) B4)) * det ?B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A1 * det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))) = det A1 * (det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det A1 * det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))) = det A1 * (det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det A1 * det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))) = det A1 * (det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))))

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
have "det (mat m m (($$) B4)) * det ?B4 = det B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))) = det B4
[PROOF STEP]
unfolding arg_cong[OF B44, of det]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))) = det (four_block_mat (mat m m (($$) B4)) (0\<^sub>m m 1) (mat 1 m (\<lambda>(i, j). B4 $$ (m, j))) (mat 1 1 (\<lambda>_. B4 $$ (m, m))))
[PROOF STEP]
by (subst det_four_block_mat_upper_right_zero_col[OF _ refl], auto)
[PROOF STATE]
proof (state)
this:
det (mat m m (($$) B4)) * det (mat 1 1 (\<lambda>_. B4 $$ (m, m))) = det B4

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (four_block_mat A1 A2 B3 B4) = det A1 * det B4
[PROOF STEP]
have id: "det ?B = det A1 * det B4"
[PROOF STATE]
proof (prove)
using this:
det (four_block_mat A1 A2 B3 B4) = det A1 * det B4

goal (1 subgoal):
 1. det (four_block_mat A1 A2 B3 B4) = det A1 * det B4
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 B3 B4) = det A1 * det B4

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
from this[folded det]
[PROOF STATE]
proof (chain)
picking this:
v * det (four_block_mat A1 A2 A3 A4) = det A1 * (v * det A4)
[PROOF STEP]
have "v * det ?A = v * (det A1 * det A4)"
[PROOF STATE]
proof (prove)
using this:
v * det (four_block_mat A1 A2 A3 A4) = det A1 * (v * det A4)

goal (1 subgoal):
 1. v * det (four_block_mat A1 A2 A3 A4) = v * (det A1 * det A4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v * det (four_block_mat A1 A2 A3 A4) = v * (det A1 * det A4)

goal (1 subgoal):
 1. \<And>m A2 A3 A4. \<lbrakk>\<And>A2 A3 A4. \<lbrakk>A2 = 0\<^sub>m n m; A3 \<in> carrier_mat m n; A4 \<in> carrier_mat m m\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4; A2 = 0\<^sub>m n (Suc m); A3 \<in> carrier_mat (Suc m) n; A4 \<in> carrier_mat (Suc m) (Suc m)\<rbrakk> \<Longrightarrow> det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
with v
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> (0::'a)
v * det (four_block_mat A1 A2 A3 A4) = v * (det A1 * det A4)
[PROOF STEP]
show "det ?A = det A1 * det A4"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> (0::'a)
v * det (four_block_mat A1 A2 A3 A4) = v * (det A1 * det A4)

goal (1 subgoal):
 1. det (four_block_mat A1 A2 A3 A4) = det A1 * det A4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (four_block_mat A1 A2 A3 A4) = det A1 * det A4

goal:
No subgoals!
[PROOF STEP]
qed