# Inverse of a matrix and its transpose

I'm trying to figure out why the calculation below works. I do know that $(A^T)^{-1} = (A^{-1})^T$.

The matrix A = $\begin{pmatrix} 1 & -1 & 0 \\ 1 & 1 & -1\\ 1 & 2 & -1 \end{pmatrix}$ has the inverse $\begin{pmatrix} 1 & -1 & 1 \\ 0 & -1 & 1\\ 1 & -3 & 2 \end{pmatrix}$

Another matrix B = $\begin{pmatrix} 1 & 1 & 1 & 0 \\ -1 & 1 & 2 & 0 \\ 0 & -1 & -1 & 0 \\ 0 & 0 & 0 & 4 \end{pmatrix}$ which has the transpose of matrix A embedded within it has the inverse $\begin{pmatrix} 1 & 0 & 1 & 0 \\ -1 & -1 & -3 & 0 \\ 1 & 1 & 2 & 0 \\ 0 & 0 & 0 & 1/4 \end{pmatrix}$.

Clearly, the inverse of B can be worked out quicker by using the result of the inverse of A and then changing 4 to its inverse (1/4). Does anyone know the actual rules that have been applied here? Is this a special case because the newly added row 4 and column 4 all have zeroes apart from 4? I just want to know why this works and in what context can I apply this trick?

Thanks

If $B \in \mathbb R^{(m+n)\times(m+n)}$ is of the form $$B = \pmatrix{B_{11}&0\\0&B_{22}}$$ with $B_{11}\in\mathbb R^{m\times m}$ and $B_{22}\in\mathbb R^{n\times n}$ both invertible, then $B$ is invertible with $$B^{-1} = \pmatrix{B_{11}^{-1}&0\\0&B_{22}^{-1}}$$
To prove it, note that $$\pmatrix{A_{11}&0\\0&A_{22}}\pmatrix{B_{11}&0\\0&B_{22}}=\pmatrix{A_{11}B_{11}&0\\0&A_{22}B_{22}}$$