Inverse of Diagonal Matrix

Theorem
Let:


 * $\mathbf D = \begin{bmatrix}

a_{11} & 0 & \cdots & 0 \\ 0 & a_{22} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{nn} \\ \end{bmatrix}$

be an $n \times n$ diagonal matrix.

Then its inverse is given by:


 * $\mathbf {D^{-1}} = \begin{bmatrix}

\frac{1}{a_{11}} & 0 & \cdots & 0 \\ 0 & \frac{1}{a_{22}} & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \frac{1}{a_{nn}} \\ \end{bmatrix}$

provided that none of the diagonal elements are zero.

If any of the diagonal elements are zero, $\mathbf D$ is not invertible.

Proof
WLOG, consider the right inverse of $\mathbf{D}$.

Suppose none of the diagonal elements are zero.

Then by the definition of inverse, our assertion is that the matrix product of the two matrices in question is the identity matrix of order $n$.

Now, observe that:

Now suppose one of the diagonal elements is zero.

For the right inverse to exist, then the dot product of the row $i$ containing the zero diagonal entry, and the corresponding column $j$ in $\mathbf{D^{-1}}$ would have to yield $1$ in the $ij$th entry of the identity matrix.

But by definition of a diagonal matrix, row $i$ in such a case would be the zero vector, and we would be seeking a solution to:


 * $\mathbf{0}\cdot\mathbf{x} =1$

where $\mathbf{x}$ is the $j$th column vector of $\mathbf{D^{-1}}$.

But this equation has no solution, and so $\mathbf{D}$ cannot admit an inverse.