Looking at [these slides](http://sites.stat.psu.edu/~jiali/course/stat597e/notes2/lreg.pdf), I've found the following:

$X=UDV^T$, where $U$ and $V$ are orthogonal matrices, $V$ is a square matrix, and $D$ contains the singular values of $X$.

The author then writes

$$X(X^TX + \lambda I)^{−1}X^Ty$$
$$=UD(D^2 + \lambda I)^{−1}DU^Ty.$$

Why does that equality hold? I've tried substituting $X=UDV^T$, have got

$$UDV^T(VD^2V^T+\lambda I)^{-1}VDU^Ty.$$

If there wasn't the $+\lambda I$ term, then, as $V$ is a square matrix, we would have
$$UDV^T V^{-T}D^{-1}D^{-1}V^{-1} VDU^Ty$$
$$=UU^Ty.$$

However, it's not the case that there isn't the $+\lambda I$ term, so I don't know how to proceed.