Linear AlgebraMatrix Algebra9 of 9
Matrix Algebra · 9

Block Matrices

Multiplying large matrices entry by entry takes a lot of arithmetic, especially when large parts of the matrices are just zeros or identity matrices.

1

Multiplying blocks like single numbers

Suppose we want to multiply these two 4×44 \times 4 matrices:

[2100340010120151][1230412021111302]\displaystyle \begin{bmatrix} 2 & 1 & 0 & 0 \\ 3 & 4 & 0 & 0 \\ 1 & 0 & 1 & 2 \\ 0 & 1 & 5 & 1 \end{bmatrix} \begin{bmatrix} 1 & 2 & 3 & 0 \\ 4 & 1 & 2 & 0 \\ 2 & 1 & 1 & 1 \\ 1 & 3 & 0 & 2 \end{bmatrix}

Instead of computing sixteen separate 44-number dot products, we can slice both matrices into 2×22 \times 2 pieces and multiply the pieces together.

Why Block Multiplication Works
22110000
33440000
11001122
00115511
11223300
44112200
22111111
11330022
==

This works because each entry of a matrix product is just a sum of products. Grouping that sum into parts is the same as multiplying the blocks like single symbols and adding the results:

[ABCD][EFGH]=[AE+BGAF+BHCE+DGCF+DH]\displaystyle \left[\begin{array}{c|c} \sliceone{A} & \slicetwo{B} \\ \hline \sliceone{C} & \slicetwo{D} \end{array}\right] \left[\begin{array}{c|c} \sliceone{E} & \sliceone{F} \\ \hline \slicetwo{G} & \slicetwo{H} \end{array}\right] = \left[\begin{array}{c|c} \sliceone{AE} + \slicetwo{BG} & \sliceone{AF} + \slicetwo{BH} \\ \hline \sliceone{CE} + \slicetwo{DG} & \sliceone{CF} + \slicetwo{DH} \end{array}\right]

Because matrix multiplication is not commutative (in general AE≠EAAE \neq EA), every block from the left matrix must stay on the left of its product, and every block from the right matrix must stay on the right.

2

Which cuts are allowed?

We don't have to slice matrices into even 2×22 \times 2 squares. Let's see which horizontal and vertical cuts let all the smaller block multiplications work.

The Golden Rule for Slicing Matrices
a\htmlClass{lc-green}{a}b\htmlClass{lc-green}{b}c\htmlClass{lc-green}{c}d\htmlClass{lc-pink}{d}
ww
xx
yy
zz
??
3\htmlClass{lc-blue}{3}
2\htmlClass{lc-blue}{2}
×\times
3\htmlClass{lc-blue}{3}
2\htmlClass{lc-blue}{2}
2\htmlClass{lc-orange}{2}
1\htmlClass{lc-orange}{1}
1\htmlClass{lc-orange}{1}
3\htmlClass{lc-orange}{3}
==
2\htmlClass{lc-orange}{2}
1\htmlClass{lc-orange}{1}
2×12{\times}1
2×32{\times}3
1×11{\times}1
1×31{\times}3
LeftmatrixRightmatrixProductblocks(rowheights 2,1)×(rowheights 3,2)=(rowheights 2,1)(columnwidths 3,2)(columnwidths 1,3)(columnwidths 1,3)\displaystyle \begin{array}{ccccc} \begin{gathered}\text{Left} \\[-3pt] \text{matrix}\end{gathered} & & \begin{gathered}\text{Right} \\[-3pt] \text{matrix}\end{gathered} & & \begin{gathered}\text{Product} \\[-3pt] \text{blocks}\end{gathered} \\[10pt] \begin{gathered}(\outercut{\text{row}} \\[-3pt] \outercut{\text{heights }} \\[-3pt] \outercut{2, 1})\end{gathered} & \times & \begin{gathered}(\innercut{\text{row}} \\[-3pt] \innercut{\text{heights }} \\[-3pt] \innercut{3, 2})\end{gathered} & = & \begin{gathered}(\outercut{\text{row}} \\[-3pt] \outercut{\text{heights }} \\[-3pt] \outercut{2, 1})\end{gathered} \\[18pt] \begin{gathered}(\innercut{\text{column}} \\[-3pt] \innercut{\text{widths }} \\[-3pt] \innercut{3, 2})\end{gathered} & & \begin{gathered}(\outercut{\text{column}} \\[-3pt] \outercut{\text{widths }} \\[-3pt] \outercut{1, 3})\end{gathered} & & \begin{gathered}(\outercut{\text{column}} \\[-3pt] \outercut{\text{widths }} \\[-3pt] \outercut{1, 3})\end{gathered} \end{array}

All the smaller block products work as long as the column widths of the left matrix\innercut{\text{column widths of the left matrix}} match the row heights of the right matrix\innercut{\text{row heights of the right matrix}}. Changing the outer cuts\outercut{\text{outer cuts}} only changes how the final answer is divided into blocks, never its entries.

Block multiplication works whenever the left column cuts match the right row cuts, while the outer cuts only change the shapes of the blocks in the answer.
3

Multiplying with zero and identity blocks

Now let's return to our 4×44 \times 4 product and use 2×22 \times 2 blocks to compute it:

[2100340010120151][1230412021111302]\displaystyle \begin{bmatrix} 2 & 1 & 0 & 0 \\ 3 & 4 & 0 & 0 \\ 1 & 0 & 1 & 2 \\ 0 & 1 & 5 & 1 \end{bmatrix} \begin{bmatrix} 1 & 2 & 3 & 0 \\ 4 & 1 & 2 & 0 \\ 2 & 1 & 1 & 1 \\ 1 & 3 & 0 & 2 \end{bmatrix}
Multiplying with Zero and Identity Blocks
22110000
33440000
11001122
00115511
11223300
44112200
22111111
11330022
A\htmlClass{lc-green}{A}0\htmlClass{lc-pink}{0}
I\htmlClass{lc-green}{I}D\htmlClass{lc-pink}{D}
E\htmlClass{lc-green}{E}F\htmlClass{lc-green}{F}
G\htmlClass{lc-pink}{G}H\htmlClass{lc-pink}{H}
=?= {?}
Text solution
1. Slice to isolate the zero and identity blocksCutting both matrices after row 2 and column 2 makes the top-right block of the left matrix 0\slicetwo{0} and the bottom-left block I\sliceone{I}, which eliminates G\slicetwo{G} and H\slicetwo{H} from the top row of the product.
[2100340010120151][1230412021111302]=[A0ID][EFGH]=[AE+0GAF+0HIE+DGIF+DH]=[AEAFE+DGF+DH]\displaystyle \begin{aligned} & \left[\begin{array}{cc|cc} 2 & 1 & 0 & 0 \\ 3 & 4 & 0 & 0 \\ \hline 1 & 0 & 1 & 2 \\ 0 & 1 & 5 & 1 \end{array}\right] \\ &\quad \left[\begin{array}{cc|cc} 1 & 2 & 3 & 0 \\ 4 & 1 & 2 & 0 \\ \hline 2 & 1 & 1 & 1 \\ 1 & 3 & 0 & 2 \end{array}\right] \\[6pt] &= \begin{bmatrix} \sliceone{A} & \slicetwo{0} \\ \sliceone{I} & \slicetwo{D} \end{bmatrix} \begin{bmatrix} \sliceone{E} & \sliceone{F} \\ \slicetwo{G} & \slicetwo{H} \end{bmatrix} \\[6pt] &= \begin{bmatrix} \sliceone{AE} + \slicetwo{0G} & \sliceone{AF} + \slicetwo{0H} \\ \sliceone{IE} + \slicetwo{DG} & \sliceone{IF} + \slicetwo{DH} \end{bmatrix} \\[6pt] &= \begin{bmatrix} \sliceone{AE} & \sliceone{AF} \\ \sliceone{E} + \slicetwo{DG} & \sliceone{F} + \slicetwo{DH} \end{bmatrix} \end{aligned}
2. Compute the four 2×22 \times 2 blocksInstead of sixteen 44-number dot products, we only need four 2×22 \times 2 products and two 2×22 \times 2 additions.
AE=[2134][1241]=[651910]AF=[2134][3020]=[80170]E+DG=[1241]+[1251][2113]=[1241]+[47118]=[59159]F+DH=[3020]+[1251][1102]=[3020]+[1557]=[4577]\displaystyle \begin{aligned} & \sliceone{AE} = \begin{bmatrix} 2 & 1 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 4 & 1 \end{bmatrix} \\ &\quad = \begin{bmatrix} 6 & 5 \\ 19 & 10 \end{bmatrix} \\[6pt] & \sliceone{AF} = \begin{bmatrix} 2 & 1 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 3 & 0 \\ 2 & 0 \end{bmatrix} \\ &\quad = \begin{bmatrix} 8 & 0 \\ 17 & 0 \end{bmatrix} \\[6pt] & \sliceone{E} + \slicetwo{DG} = \begin{bmatrix} 1 & 2 \\ 4 & 1 \end{bmatrix} \\ &\quad + \begin{bmatrix} 1 & 2 \\ 5 & 1 \end{bmatrix} \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix} \\ &\quad = \begin{bmatrix} 1 & 2 \\ 4 & 1 \end{bmatrix} + \begin{bmatrix} 4 & 7 \\ 11 & 8 \end{bmatrix} \\ &\quad = \begin{bmatrix} 5 & 9 \\ 15 & 9 \end{bmatrix} \\[6pt] & \sliceone{F} + \slicetwo{DH} = \begin{bmatrix} 3 & 0 \\ 2 & 0 \end{bmatrix} \\ &\quad + \begin{bmatrix} 1 & 2 \\ 5 & 1 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 0 & 2 \end{bmatrix} \\ &\quad = \begin{bmatrix} 3 & 0 \\ 2 & 0 \end{bmatrix} + \begin{bmatrix} 1 & 5 \\ 5 & 7 \end{bmatrix} \\ &\quad = \begin{bmatrix} 4 & 5 \\ 7 & 7 \end{bmatrix} \end{aligned}
3. Assemble the 4×44 \times 4 productPlacing the four 2×22 \times 2 results into their positions gives the complete answer.
[AEAFE+DGF+DH]=[65801910170594515977]=[65801910170594515977]\displaystyle \begin{bmatrix} \sliceone{AE} & \sliceone{AF} \\ \sliceone{E} + \slicetwo{DG} & \sliceone{F} + \slicetwo{DH} \end{bmatrix} = \left[\begin{array}{cc|cc} 6 & 5 & 8 & 0 \\ 19 & 10 & 17 & 0 \\ \hline 5 & 9 & 4 & 5 \\ 15 & 9 & 7 & 7 \end{array}\right] = \begin{bmatrix} 6 & 5 & 8 & 0 \\ 19 & 10 & 17 & 0 \\ 5 & 9 & 4 & 5 \\ 15 & 9 & 7 & 7 \end{bmatrix}
4

Multiplying blocks of different sizes

When the matrices aren't 4×44 \times 4, or when the identity blocks sit in different corners, our cuts can create rectangular blocks of several different shapes. Let's multiply these two 3×33 \times 3 matrices:

[102013004][510601123]\displaystyle \begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \\ 0 & 0 & 4 \end{bmatrix} \begin{bmatrix} 5 & 1 & 0 \\ 6 & 0 & 1 \\ 1 & 2 & 3 \end{bmatrix}
Multiplying Blocks of Different Sizes
110022
001133
000044
551100
660011
112233
=?= {?}
Text solution
1. Slice to isolate II and 00 while matching the inner cutsCutting the left matrix into row heights 2,1\outercut{\text{row heights } 2, 1} and column widths 2,1\innercut{\text{column widths } 2, 1} isolates its II and 00 blocks, which forces the right matrix into row heights 2,1\innercut{\text{row heights } 2, 1} while we cut its columns into widths 1,2\outercut{\text{widths } 1, 2} to isolate its top-right II.
[102013004][510601123]=[IB0D][EIGH]=[IE+BGII+BH0E+DG0I+DH]=[E+BGI+BHDGDH]\displaystyle \begin{aligned} & \left[\begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 3 \\ \hline 0 & 0 & 4 \end{array}\right] \left[\begin{array}{c|cc} 5 & 1 & 0 \\ 6 & 0 & 1 \\ \hline 1 & 2 & 3 \end{array}\right] \\[6pt] &= \begin{bmatrix} \sliceone{I} & \slicetwo{B} \\ \sliceone{0} & \slicetwo{D} \end{bmatrix} \begin{bmatrix} \sliceone{E} & \sliceone{I} \\ \slicetwo{G} & \slicetwo{H} \end{bmatrix} \\[6pt] &= \begin{bmatrix} \sliceone{IE} + \slicetwo{BG} & \sliceone{II} + \slicetwo{BH} \\ \sliceone{0E} + \slicetwo{DG} & \sliceone{0I} + \slicetwo{DH} \end{bmatrix} \\[6pt] &= \begin{bmatrix} \sliceone{E} + \slicetwo{BG} & \sliceone{I} + \slicetwo{BH} \\ \slicetwo{DG} & \slicetwo{DH} \end{bmatrix} \end{aligned}
2. Multiply and add the rectangular blocksThe outer cuts\outercut{\text{outer cuts}} (heights 2,1\outercut{2, 1} and widths 1,2\outercut{1, 2}) tell us that the four blocks in the answer have sizes 2×12 \times 1, 2×22 \times 2, 1×11 \times 1, and 1×21 \times 2.
E+BG=[56]+[23][1]=[56]+[23]=[79]I+BH=[1001]+[23][23]=[1001]+[4669]=[56610]DG=[4][1]=[4]DH=[4][23]=[812]\displaystyle \begin{aligned} \sliceone{E} + \slicetwo{BG} &= \begin{bmatrix} 5 \\ 6 \end{bmatrix} + \begin{bmatrix} 2 \\ 3 \end{bmatrix} \begin{bmatrix} 1 \end{bmatrix} \\ &= \begin{bmatrix} 5 \\ 6 \end{bmatrix} + \begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 7 \\ 9 \end{bmatrix} \\[6pt] \sliceone{I} + \slicetwo{BH} &= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + \begin{bmatrix} 2 \\ 3 \end{bmatrix} \begin{bmatrix} 2 & 3 \end{bmatrix} \\ &= \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} + \begin{bmatrix} 4 & 6 \\ 6 & 9 \end{bmatrix} \\ &= \begin{bmatrix} 5 & 6 \\ 6 & 10 \end{bmatrix} \\[6pt] \slicetwo{DG} &= \begin{bmatrix} 4 \end{bmatrix} \begin{bmatrix} 1 \end{bmatrix} = \begin{bmatrix} 4 \end{bmatrix} \\[6pt] \slicetwo{DH} &= \begin{bmatrix} 4 \end{bmatrix} \begin{bmatrix} 2 & 3 \end{bmatrix} = \begin{bmatrix} 8 & 12 \end{bmatrix} \end{aligned}
3. Fit the rectangular blocks into the 3×33 \times 3 productPutting each block into its position gives the final 3×33 \times 3 matrix.
[E+BGI+BHDGDH]=[75696104812]=[75696104812]\displaystyle \begin{bmatrix} \sliceone{E} + \slicetwo{BG} & \sliceone{I} + \slicetwo{BH} \\ \slicetwo{DG} & \slicetwo{DH} \end{bmatrix} = \left[\begin{array}{c|cc} 7 & 5 & 6 \\ 9 & 6 & 10 \\ \hline 4 & 8 & 12 \end{array}\right] = \begin{bmatrix} 7 & 5 & 6 \\ 9 & 6 & 10 \\ 4 & 8 & 12 \end{bmatrix}

Notice that in BH=[23][23]\slicetwo{BH} = \begin{bmatrix} 2 \\ 3 \end{bmatrix} \begin{bmatrix} 2 & 3 \end{bmatrix}, a 2×12 \times 1 column multiplies a 1×21 \times 2 row to produce a 2×22 \times 2 matrix, which matches the 2×22 \times 2 identity matrix I\sliceone{I} it gets added to.

5

Inverting block matrices

Block multiplication also lets us solve for unknown blocks to invert a large matrix in pieces.

First, suppose we want to invert a block-diagonal matrix, a matrix with invertible square blocks AA and DD on the main diagonal and 00 blocks off the diagonal:

[A00D]−1= ?\displaystyle \begin{bmatrix} A & 0 \\ 0 & D \end{bmatrix}^{-1} = \, ?
Inverting a Block-Diagonal Matrix
[A00D]−1=  ?\displaystyle \begin{bmatrix} A & 0 \\ 0 & D \end{bmatrix}^{-1} = \;?

Setting the matrix times four unknown blocks equal to the identity matrix,

[A00D][WXYZ]=[AWAXDYDZ]=[I00I]\displaystyle \begin{bmatrix} A & 0 \\ 0 & D \end{bmatrix} \begin{bmatrix} \invblock{W} & \invblock{X} \\ \invblock{Y} & \invblock{Z} \end{bmatrix} = \begin{bmatrix} A\invblock{W} & A\invblock{X} \\ D\invblock{Y} & D\invblock{Z} \end{bmatrix} = \begin{bmatrix} I & 0 \\ 0 & I \end{bmatrix}

shows that the off-diagonal blocks stay zero and each diagonal block is inverted in its own spot:

[A00D]−1=[A−100D−1]\displaystyle \begin{bmatrix} A & 0 \\ 0 & D \end{bmatrix}^{-1} = \begin{bmatrix} \invblock{A^{-1}} & 0 \\ 0 & \invblock{D^{-1}} \end{bmatrix}

Now suppose there is a non-zero block BB in the top-right corner, forming a block upper-triangular matrix:

[AB0D]−1= ?\displaystyle \begin{bmatrix} A & B \\ 0 & D \end{bmatrix}^{-1} = \, ?

Here AA and DD are invertible square blocks, so if they have different sizes, BB is rectangular and B−1\nofit{B^{-1}} does not even exist.

Inverting a Block Upper-Triangular Matrix
[AB0D]−1=?\begin{bmatrix} A & B \\ 0 & D \end{bmatrix}^{-1} = {?}
33
33
AA
22
22
DD
BB

Setting up the same block equation and substituting Y=0\invblock{Y} = 0, W=A−1\invblock{W} = \invblock{A^{-1}}, and Z=D−1\invblock{Z} = \invblock{D^{-1}} leaves the top-right equation for X\invblock{X}:

AX+BD−1=0AX=−BD−1X=−A−1BD−1\displaystyle \begin{aligned} A\invblock{X} + B\invblock{D^{-1}} &= 0 \\ A\invblock{X} &= -B\invblock{D^{-1}} \\ \invblock{X} &= -\invblock{A^{-1}}B\invblock{D^{-1}} \end{aligned}

Because AA multiplies X\invblock{X} on the left, we multiply by A−1\invblock{A^{-1}} on the left, giving the block upper-triangular inverse formula:

[AB0D]−1=[A−1−A−1BD−10D−1]\displaystyle \boxed{\begin{bmatrix} A & B \\ 0 & D \end{bmatrix}^{-1} = \begin{bmatrix} \invblock{A^{-1}} & -\invblock{A^{-1}}B\invblock{D^{-1}} \\ 0 & \invblock{D^{-1}} \end{bmatrix}}

When the diagonal blocks are already identity matrices (A=IA = I and D=ID = I), this simplifies right away to changing the sign of BB:

[IB0I]−1=[I−B0I]\displaystyle \begin{bmatrix} I & B \\ 0 & I \end{bmatrix}^{-1} = \begin{bmatrix} I & -B \\ 0 & I \end{bmatrix}
6

Column and row multiplication as extreme slicing

Other familiar ways of multiplying two matrices ABAB are really just extreme cases of block slicing.

Column and Row Multiplication as Block Slicing
AA
BB

Leaving AA uncut (0\innercut{0} vertical cuts) and slicing BB into columns (0\innercut{0} horizontal cuts) multiplies AA by one column of BB at a time:

A[b1b2b3]=[Ab1Ab2Ab3]\displaystyle A \left[\begin{array}{c|c|c} b_1 & b_2 & b_3 \end{array}\right] = \left[\begin{array}{c|c|c} Ab_1 & Ab_2 & Ab_3 \end{array}\right]

Slicing AA into individual columns (widths 1,1,1\innercut{\text{widths } 1, 1, 1}) and BB into individual rows (heights 1,1,1\innercut{\text{heights } 1, 1, 1}) writes ABAB as a sum of column-times-row matrices:

[c1c2c3][r1r2r3]=c1r1+c2r2+c3r3\displaystyle \left[\begin{array}{c|c|c} \sliceone{c_1} & \slicetwo{c_2} & \slicethree{c_3} \end{array}\right] \left[\begin{array}{c} \sliceone{r_1} \\ \hline \slicetwo{r_2} \\ \hline \slicethree{r_3} \end{array}\right] = \sliceone{c_1 r_1} + \slicetwo{c_2 r_2} + \slicethree{c_3 r_3}

Key concepts

Block slicing is worth using whenever a matrix has visible 00 or II blocks, triangular structure, or column-row structure. (If a small matrix has no 00 or II blocks and no special pattern, standard row-by-column dot products are just as fast.)

Matching the cuts

The column widths of the left matrix\innercut{\text{column widths of the left matrix}} must match the row heights of the right matrix\innercut{\text{row heights of the right matrix}}, while the outer cuts\outercut{\text{outer cuts}} set the block sizes of the answer. For example, if AA has row heights 2,1\outercut{\text{row heights } 2, 1} and column widths 2,1\innercut{\text{column widths } 2, 1}, then BB must have row heights 2,1\innercut{\text{row heights } 2, 1}.

Isolating 00 and II blocks

Cut around blocks of zeros and identity blocks first, and keep left blocks on the left and right blocks on the right:

[A0ID][EFGH]=[AEAFE+DGF+DH]\displaystyle \begin{bmatrix} \sliceone{A} & \slicetwo{0} \\ \sliceone{I} & \slicetwo{D} \end{bmatrix} \begin{bmatrix} \sliceone{E} & \sliceone{F} \\ \slicetwo{G} & \slicetwo{H} \end{bmatrix} = \begin{bmatrix} \sliceone{AE} & \sliceone{AF} \\ \sliceone{E} + \slicetwo{DG} & \sliceone{F} + \slicetwo{DH} \end{bmatrix}

Inverting block-triangular matrices

Invert the square diagonal blocks in their own spots and solve for the off-diagonal block without ever inverting BB:

[AB0D]−1=[A−1−A−1BD−10D−1],[IB0I]−1=[I−B0I]\displaystyle \begin{aligned} \begin{bmatrix} A & B \\ 0 & D \end{bmatrix}^{-1} &= \begin{bmatrix} \invblock{A^{-1}} & -\invblock{A^{-1}}B\invblock{D^{-1}} \\ 0 & \invblock{D^{-1}} \end{bmatrix}, \\[6pt] \begin{bmatrix} I & B \\ 0 & I \end{bmatrix}^{-1} &= \begin{bmatrix} I & -B \\ 0 & I \end{bmatrix} \end{aligned}

Columns times rows

Slicing the left matrix into columns and the right matrix into rows turns ABAB into a sum of column-times-row matrices (also called outer products), c1r1+c2r2+⋯+cnrn\sliceone{c_1 r_1} + \slicetwo{c_2 r_2} + \dots + c_n r_n, where each column-times-row term is a full matrix of the final product's size.

7

Practice

1

A 5×65 \times 6 matrix AA is sliced into blocks by cutting its rows into heights of 22 and 33, and its columns into widths of 44 and 22. It multiplies a 6×46 \times 4 matrix BB whose columns are cut into widths of 11 and 33. How must the rows of BB be sliced for block multiplication to work, and what are the sizes of the four blocks in the product ABAB?

Which cuts are the inner cuts that meet in the middle of ABAB, and which cuts are the outer cuts?

To match the column widths 4 and 2\innercut{\text{column widths } 4 \text{ and } 2} of AA, the rows of BB must be sliced into heights of 4 and 2\innercut{\text{heights of } 4 \text{ and } 2}. (Be careful not to reverse them to 22 and 44, or try to match AA's row heights 2\outercut{2} and 3\outercut{3}.) The outer cuts\outercut{\text{outer cuts}} (row heights 2,3\outercut{2, 3} on AA and column widths 1,3\outercut{1, 3} on BB) give the sizes of the four blocks in ABAB (watch out not to use the inner numbers 4\innercut{4} and 2\innercut{2}, which would give 4×14 \times 1 and 2×32 \times 3): Top-left 2×12 \times 1, top-right 2×32 \times 3, bottom-left 3×13 \times 1, and bottom-right 3×33 \times 3.
2

Slice these two 4×44 \times 4 matrices into 2×22 \times 2 blocks and multiply them using the zero and identity blocks:

[1210310100210013][2112033141001200]\displaystyle \begin{aligned} & \begin{bmatrix} 1 & 2 & 1 & 0 \\ 3 & 1 & 0 & 1 \\ 0 & 0 & 2 & 1 \\ 0 & 0 & 1 & 3 \end{bmatrix} \\ &\quad \begin{bmatrix} 2 & 1 & 1 & 2 \\ 0 & 3 & 3 & 1 \\ 4 & 1 & 0 & 0 \\ 1 & 2 & 0 & 0 \end{bmatrix} \end{aligned}

Label the 2×22 \times 2 blocks and simplify the four block formulas using 00 and II before multiplying any numbers.

Slicing after row 2 and column 2 gives:
[AI0D][EFG0]=[AE+GAFDG0]\displaystyle \begin{bmatrix} \sliceone{A} & \slicetwo{I} \\ \sliceone{0} & \slicetwo{D} \end{bmatrix} \begin{bmatrix} \sliceone{E} & \sliceone{F} \\ \slicetwo{G} & \slicetwo{0} \end{bmatrix} = \begin{bmatrix} \sliceone{AE} + \slicetwo{G} & \sliceone{AF} \\ \slicetwo{DG} & 0 \end{bmatrix}
Keep the left blocks on the left when multiplying (reversing DG\slicetwo{DG} into GDGD gives [9747]\begin{bmatrix} 9 & 7 \\ 4 & 7 \end{bmatrix} instead of [9477]\begin{bmatrix} 9 & 4 \\ 7 & 7 \end{bmatrix}):
AE+G=[1231][2103]+[4112]=[2766]+[4112]=[6878]AF=[1231][1231]=[7467]DG=[2113][4112]=[9477]\displaystyle \begin{aligned} \sliceone{AE} + \slicetwo{G} &= \begin{bmatrix} 1 & 2 \\ 3 & 1 \end{bmatrix} \begin{bmatrix} 2 & 1 \\ 0 & 3 \end{bmatrix} + \begin{bmatrix} 4 & 1 \\ 1 & 2 \end{bmatrix} \\ &= \begin{bmatrix} 2 & 7 \\ 6 & 6 \end{bmatrix} + \begin{bmatrix} 4 & 1 \\ 1 & 2 \end{bmatrix} \\ &= \begin{bmatrix} 6 & 8 \\ 7 & 8 \end{bmatrix} \\[6pt] \sliceone{AF} &= \begin{bmatrix} 1 & 2 \\ 3 & 1 \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 3 & 1 \end{bmatrix} = \begin{bmatrix} 7 & 4 \\ 6 & 7 \end{bmatrix} \\[6pt] \slicetwo{DG} &= \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix} \begin{bmatrix} 4 & 1 \\ 1 & 2 \end{bmatrix} = \begin{bmatrix} 9 & 4 \\ 7 & 7 \end{bmatrix} \end{aligned}
Putting the blocks together gives:
[6874786794007700]\displaystyle \begin{bmatrix} 6 & 8 & 7 & 4 \\ 7 & 8 & 6 & 7 \\ 9 & 4 & 0 & 0 \\ 7 & 7 & 0 & 0 \end{bmatrix}
3

Choose uneven cuts on these two 3×33 \times 3 matrices to isolate their identity and zero blocks, then multiply them in blocks:

[300110201][214102013]\displaystyle \begin{bmatrix} 3 & 0 & 0 \\ 1 & 1 & 0 \\ 2 & 0 & 1 \end{bmatrix} \begin{bmatrix} 2 & 1 & 4 \\ 1 & 0 & 2 \\ 0 & 1 & 3 \end{bmatrix}

Where does the 2×22 \times 2 identity block sit in each matrix, and what cut on the left columns sets the cut on the right rows?

Cut the left matrix after row 1 and column 1 into [A0CI]\begin{bmatrix} \sliceone{A} & \slicetwo{0} \\ \sliceone{C} & \slicetwo{I} \end{bmatrix}, and cut the right matrix after row 1 (to match the left column widths 1,2\innercut{1, 2}) and after column 2 (to isolate its bottom-left 2×22 \times 2 identity block) into [EFIH]\begin{bmatrix} \sliceone{E} & \sliceone{F} \\ \slicetwo{I} & \slicetwo{H} \end{bmatrix}:
[300110201][214102013]=[A0CI][EFIH]=[AEAFCE+ICF+H]\displaystyle \left[\begin{array}{c|cc} 3 & 0 & 0 \\ \hline 1 & 1 & 0 \\ 2 & 0 & 1 \end{array}\right] \left[\begin{array}{cc|c} 2 & 1 & 4 \\ \hline 1 & 0 & 2 \\ 0 & 1 & 3 \end{array}\right] = \begin{bmatrix} \sliceone{A} & \slicetwo{0} \\ \sliceone{C} & \slicetwo{I} \end{bmatrix} \begin{bmatrix} \sliceone{E} & \sliceone{F} \\ \slicetwo{I} & \slicetwo{H} \end{bmatrix} = \begin{bmatrix} \sliceone{AE} & \sliceone{AF} \\ \sliceone{CE} + \slicetwo{I} & \sliceone{CF} + \slicetwo{H} \end{bmatrix}
In the bottom-left block CE+I\sliceone{CE} + \slicetwo{I}, remember that I\slicetwo{I} is the 2×22 \times 2 identity matrix [1001]\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} (adding 11 to every entry of CE\sliceone{CE} instead of adding II only on the diagonal gives [3253]\begin{bmatrix} 3 & 2 \\ 5 & 3 \end{bmatrix}):
AE=[3][21]=[63],AF=[3][4]=[12]CE+I=[12][21]+[1001]=[2142]+[1001]=[3143]CF+H=[12][4]+[23]=[48]+[23]=[611]\displaystyle \begin{aligned} \sliceone{AE} &= \begin{bmatrix} 3 \end{bmatrix} \begin{bmatrix} 2 & 1 \end{bmatrix} = \begin{bmatrix} 6 & 3 \end{bmatrix}, \\[6pt] \sliceone{AF} &= \begin{bmatrix} 3 \end{bmatrix} \begin{bmatrix} 4 \end{bmatrix} = \begin{bmatrix} 12 \end{bmatrix} \\[6pt] \sliceone{CE} + \slicetwo{I} &= \begin{bmatrix} 1 \\ 2 \end{bmatrix} \begin{bmatrix} 2 & 1 \end{bmatrix} + \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \\ &= \begin{bmatrix} 2 & 1 \\ 4 & 2 \end{bmatrix} + \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \\ &= \begin{bmatrix} 3 & 1 \\ 4 & 3 \end{bmatrix} \\[6pt] \sliceone{CF} + \slicetwo{H} &= \begin{bmatrix} 1 \\ 2 \end{bmatrix} \begin{bmatrix} 4 \end{bmatrix} + \begin{bmatrix} 2 \\ 3 \end{bmatrix} \\ &= \begin{bmatrix} 4 \\ 8 \end{bmatrix} + \begin{bmatrix} 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 6 \\ 11 \end{bmatrix} \end{aligned}
Assembling the blocks gives:
[63123164311]\displaystyle \begin{bmatrix} 6 & 3 & 12 \\ 3 & 1 & 6 \\ 4 & 3 & 11 \end{bmatrix}
4

Slice the left matrix into individual columns and the right matrix into individual rows to write

[1320−12][2101−12]\displaystyle \begin{bmatrix} 1 & 3 \\ 2 & 0 \\ -1 & 2 \end{bmatrix} \begin{bmatrix} 2 & 1 & 0 \\ 1 & -1 & 2 \end{bmatrix}

as a sum of column-times-row matrices, then find the final 3×33 \times 3 product.

A 3×13 \times 1 column times a 1×31 \times 3 row produces what size matrix?

Pairing each column of the left matrix with the matching row of the right matrix gives:
[12−1][210]+[302][1−12]\displaystyle \sliceone{\begin{bmatrix} 1 \\ 2 \\ -1 \end{bmatrix}} \sliceone{\begin{bmatrix} 2 & 1 & 0 \end{bmatrix}} + \slicetwo{\begin{bmatrix} 3 \\ 0 \\ 2 \end{bmatrix}} \slicetwo{\begin{bmatrix} 1 & -1 & 2 \end{bmatrix}}
Each 3×13 \times 1 column times a 1×31 \times 3 row forms a full 3×33 \times 3 matrix (don't take a dot product to get a single number like 4+7=114 + 7 = 11):
[210420−2−10]+[3−360002−24]=[5−264200−34]\displaystyle \sliceone{\begin{bmatrix} 2 & 1 & 0 \\ 4 & 2 & 0 \\ -2 & -1 & 0 \end{bmatrix}} + \slicetwo{\begin{bmatrix} 3 & -3 & 6 \\ 0 & 0 & 0 \\ 2 & -2 & 4 \end{bmatrix}} = \begin{bmatrix} 5 & -2 & 6 \\ 4 & 2 & 0 \\ 0 & -3 & 4 \end{bmatrix}
5

Slice

[1210012100130001]\displaystyle \begin{bmatrix} 1 & 2 & 1 & 0 \\ 0 & 1 & 2 & 1 \\ 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 1 \end{bmatrix}

into four 2×22 \times 2 blocks [AB0D]\begin{bmatrix} A & B \\ 0 & D \end{bmatrix} and find its inverse.

Look at the 1×11 \times 1 blocks inside AA and DD: how does the rule [Ib0I]−1=[I−b0I]\begin{bmatrix} I & b \\ 0 & I \end{bmatrix}^{-1} = \begin{bmatrix} I & -b \\ 0 & I \end{bmatrix} give A−1A^{-1} and D−1D^{-1} right away?

Using [1b01]−1=[1−b01]\begin{bmatrix} 1 & b \\ 0 & 1 \end{bmatrix}^{-1} = \begin{bmatrix} 1 & -b \\ 0 & 1 \end{bmatrix} on the 2×22 \times 2 diagonal blocks gives:
A−1=[1−201],D−1=[1−301]\displaystyle \invblock{A^{-1}} = \begin{bmatrix} 1 & -2 \\ 0 & 1 \end{bmatrix}, \qquad \invblock{D^{-1}} = \begin{bmatrix} 1 & -3 \\ 0 & 1 \end{bmatrix}
For the top-right block, compute −A−1BD−1-\invblock{A^{-1}}B\invblock{D^{-1}} (don't just write −B=[−10−2−1]-B = \begin{bmatrix} -1 & 0 \\ -2 & -1 \end{bmatrix}, since AA and DD are not II, and don't drop the minus sign in front, which would give [−372−5]\begin{bmatrix} -3 & 7 \\ 2 & -5 \end{bmatrix}):
−A−1BD−1=−[1−201][1021][1−301]=−[−3−221][1−301]=[3−7−25]\displaystyle \begin{aligned} & -\invblock{A^{-1}}B\invblock{D^{-1}} \\ & = -\begin{bmatrix} 1 & -2 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix} \begin{bmatrix} 1 & -3 \\ 0 & 1 \end{bmatrix} \\ & = -\begin{bmatrix} -3 & -2 \\ 2 & 1 \end{bmatrix} \begin{bmatrix} 1 & -3 \\ 0 & 1 \end{bmatrix} \\ & = \begin{bmatrix} 3 & -7 \\ -2 & 5 \end{bmatrix} \end{aligned}
Putting the four 2×22 \times 2 blocks together gives the inverse:
[1−23−701−25001−30001]\displaystyle \begin{bmatrix} 1 & -2 & 3 & -7 \\ 0 & 1 & -2 & 5 \\ 0 & 0 & 1 & -3 \\ 0 & 0 & 0 & 1 \end{bmatrix}
6

Suppose AA is an invertible 3×33 \times 3 block, DD is an invertible 2×22 \times 2 block, and CC is a 2×32 \times 3 block in the block lower-triangular matrix [A0CD]\begin{bmatrix} A & 0 \\ C & D \end{bmatrix}. Set up [A0CD][WXYZ]=[I00I]\begin{bmatrix} A & 0 \\ C & D \end{bmatrix} \begin{bmatrix} \invblock{W} & \invblock{X} \\ \invblock{Y} & \invblock{Z} \end{bmatrix} = \begin{bmatrix} I & 0 \\ 0 & I \end{bmatrix} to find the four blocks of [A0CD]−1\begin{bmatrix} A & 0 \\ C & D \end{bmatrix}^{-1}, and explain why the bottom-left block cannot be written in the order −A−1CD−1\nofit{-A^{-1}CD^{-1}}.

Multiply out the bottom-left block equation CW+DY=0C\invblock{W} + D\invblock{Y} = 0 and look at which side of Y\invblock{Y} the matrix DD sits on.

Multiplying out the left side gives:
[AWAXCW+DYCX+DZ]=[I00I]\displaystyle \begin{bmatrix} A\invblock{W} & A\invblock{X} \\ C\invblock{W} + D\invblock{Y} & C\invblock{X} + D\invblock{Z} \end{bmatrix} = \begin{bmatrix} I & 0 \\ 0 & I \end{bmatrix}
From the top row, AW=I  ⟹  W=A−1A\invblock{W} = I \implies \invblock{W} = \invblock{A^{-1}} and AX=0  ⟹  X=0A\invblock{X} = 0 \implies \invblock{X} = 0. In the bottom row, X=0\invblock{X} = 0 leaves DZ=I  ⟹  Z=D−1D\invblock{Z} = I \implies \invblock{Z} = \invblock{D^{-1}}, and substituting W=A−1\invblock{W} = \invblock{A^{-1}} into CW+DY=0C\invblock{W} + D\invblock{Y} = 0 gives:
CA−1+DY\displaystyle C\invblock{A^{-1}} + D\invblock{Y} =0  ⟹  DY\displaystyle = 0 \implies D\invblock{Y} =−CA−1\displaystyle = -C\invblock{A^{-1}}
Because DD multiplies Y\invblock{Y} on the left, we must multiply on the left by D−1\invblock{D^{-1}} to get Y=−D−1CA−1\invblock{Y} = -\invblock{D^{-1}}C\invblock{A^{-1}} (writing −A−1CD−1\nofit{-A^{-1}CD^{-1}} to copy the upper-triangular formula doesn't work because DD sits on the left of Y\invblock{Y}, and the sizes 3×33 \times 3, 2×32 \times 3, and 2×22 \times 2 cannot even be multiplied in the order A−1CD−1\nofit{A^{-1}CD^{-1}}):
[A0CD]−1=[A−10−D−1CA−1D−1]\displaystyle \begin{bmatrix} A & 0 \\ C & D \end{bmatrix}^{-1} = \begin{bmatrix} \invblock{A^{-1}} & 0 \\ -\invblock{D^{-1}}C\invblock{A^{-1}} & \invblock{D^{-1}} \end{bmatrix}