Suppose X is a self-adjoint $n\times n$-matrix. The resolvent of X is defined by $R(z)=(X-zI)^{-1}$, where $I$ denotes the identity matrix and z is a "true" complex number (meaning z has a non-zero imaginary part). First, why is this well-defined, i.e. why is $(X-zI)$ invertible? Second, by Spectral Theorem, we know $X=U\Lambda U^*$, where $U=(u_1,...,u_n)$ is a unitary matrix and $\Lambda$ is a diagonal matrix with the eigenvalues $\lambda_1,...,\lambda_n$ on the diagonal and, by rules for multiplication of blockmatrices, we should have
$X=(u_1,...,u_n)\Lambda\begin{pmatrix} u_1^* \\ \vdots \\ u_n^* \end{pmatrix}=\sum_{j=1}^n \lambda_j u_ju_j^*. $
But how can we derive $R(z)=\sum_{j=1}^n(\lambda_j-z)^{-1}u_ju_j^*$?