<s>[INST] Inverse of a $2 \times 2$ block matrix Let
$$S := \pmatrix{A&B\\C&D}$$
If $A^{-1}$ or $D^{-1}$ exist, we know that matrix $S$ can be inverted.
$$S^{-1} = \pmatrix{A^{-1}+A^{-1}B(D-CA^{-1}B)^{-1}CA^{-1}&-A^{-1}B(D-CA^{-1}B)^{-1}\\-(D-CA^{-1}B)^{-1}CA^{-1}&(D-CA^{-1}B)^{-1}}$$
But, what if $A^{-1}$ and $D^{-1}$ do not exist? Can we invert matrix $S$?
For example,
$$S = \pmatrix{0&1\\1&0}$$
or
$$S = \pmatrix{2&3&1&1\\4&6&1&2\\1&1&3&1\\4&1&12&4}$$
both their $A^{-1}$ and $D^{-1}$ don't exist, but $S^{-1}$ exists.
 [/INST] One good reference is the Handbook Matrix Mathematics Theory, Facts and Formulas by Dennis S. Bernstein. Let $\mathbb{F}$ equal to $\mathbb{R}$ or  $\mathbb{C}$.

Proposition 3.9.7. Let $A \in \mathbb{F}^{n \times n}, B \in \mathbb{F}^{n \times m}, C \in \mathbb{F}^{m \times n}$, and $D \in \mathbb{P}^{m \times m}$. If $A$ and $D-C A^{-1} B$ are nonsingular, then
$$
\left[\begin{array}{ll}
A & B \\
C & D
\end{array}\right]^{-1}=\left[\begin{array}{rr}
A^{-1}+A^{-1} B\left(D-C A^{-1} B\right)^{-1} C A^{-1} & -A^{-1} B\left(D-C A^{-1} B\right)^{-1} \\
-\left(D-C A^{-1} B\right)^{-1} C A^{-1} & \left(D-C A^{-1} B\right)^{-1}
\end{array}\right]
$$

There are three more cases to consider in addition to the above proposition.

*

*If $D$ and $A-B D^{-1} C$ are nonsingular;

*If $B$ and $C-D B^{-1} A$ are nonsingular;

*If $C$ and $B-A C^{-1} D$ are nonsingular;

For the sake of illustration we will prove only the case where $C$ and $B-A C^{-1} D$ are nonsingular;
To prove these cases it is enough to use the matrix $J=\left[\begin{array}{cc}  0 & I \\ I & 0 \end{array} \right]$ to reduce them to the same case as the proposition above. Observe that
$
\left[\begin{array}{cc}  0 & I \\ I & 0 \end{array} \right]^{-1}
=
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\mbox{ once } 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\cdot 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
=
\left[ \begin{array}{cc} I & 0 \\ 0 & I \end{array} \right].
$
Another important thing to note is that
$$
\;(\ast)\;\;\qquad \left[ \begin{array}{cc} U & V \\ X & Y \end{array} \right]
=
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\cdot 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\cdot
\left[ \begin{array}{cc} U & V \\ X & Y \end{array} \right]
=
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\cdot
\left[ \begin{array}{cc} X & Y \\ U & V \end{array} \right].
$$
and
$$
(\ast\ast)\qquad \left[ \begin{array}{cc} U & V \\ X & Y \end{array} \right]
=
\left[ \begin{array}{cc} U & V \\ X & Y \end{array} \right]
\cdot 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\cdot 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
=
\left[ \begin{array}{cc} V & U \\ Y & X \end{array} \right]
\cdot 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
$$
Suppose there exists the inverse $C^{-1}$ of $C$ and there exists the inverse $(B -AC^{-1}D)^{-1}$ of $(B -AC^{-1}D)$.  What can we say about the inverse of $\left[ \begin{array}{cc} C & D \\ A & B \end{array} \right]$? By proposition above we have
$$
\left[ \begin{array}{cc} C & D \\ A & B \end{array} \right]^{-1}
=\left[\begin{array}{rr}
 C^{-1}+C^{-1} D\left(B-A C^{-1} D\right)^{-1} A C^{-1} & -C^{-1} D\left(B-A C^{-1} D\right)^{-1}  \\
-\left(B-A C^{-1} D\right)^{-1} A C^{-1} & \left(B-A C^{-1} D\right)^{-1} 
\end{array}\right]
$$
And more, by $(\ast)$ and $(\ast\ast)$ we have
\begin{align}
\left[ \begin{array}{cc} A & B \\ C & D \end{array} \right]^{-1}
&=
\left( 
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\cdot
\left[ \begin{array}{cc} C & D \\ A & B \end{array} \right]
\right)^{-1}
\\
&=
\left[ \begin{array}{cc} C & D \\ A & B \end{array} \right]^{-1}
\cdot
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]^{-1}
\\
&=
\left[ \begin{array}{cc} C & D \\ A & B \end{array} \right]^{-1}
\cdot
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\\
&=
\left[\begin{array}{rr}
 C^{-1}+C^{-1} D\left(B-A C^{-1} D\right)^{-1} A C^{-1} & -C^{-1} D\left(B-A C^{-1} D\right)^{-1}  \\
-\left(B-A C^{-1} D\right)^{-1} A C^{-1} & \left(B-A C^{-1} D\right)^{-1} 
\end{array}\right]
\cdot
\left[ \begin{array}{cc} 0 & I \\ I & 0 \end{array} \right]
\\
&=
\left[\begin{array}{rr}
-C^{-1} D\left(B-A C^{-1} D\right)^{-1} & C^{-1}+C^{-1} D\left(B-A C^{-1} D\right)^{-1} A C^{-1} \\
\left(B-A C^{-1} D\right)^{-1} & -\left(B-A C^{-1} D\right)^{-1} A C^{-1}
\end{array}\right]
\end{align}
</s>