# How does rank of PSD symmetric matrix being equal to number of nonzero eigenvalues follow from SVD?

I understand that the rank of a positive semi-definite matrix is equal to the number of non-zero singular values of the matrix.

$$\operatorname{rank}(M) = \{ \sigma \mid \sigma \ne 0 \}$$

This is somehow related to the spectral decomposition (or singular value decomposition, as some call it), but I cannot figure out how.

This question touches on that, but I cannot figure out the relationship:

Relation between rank of a symmetric positive semi-definite matrix and its number of non-zero eigen values (or singular values)

How does the rank of a PSD matrix being equal to number of nonzero eigenvalues, follow from the spectral decomposition?

• Multiplying a matrix on the left or right by an invertible matrix doesn't change its rank. – Qiaochu Yuan Sep 2 '17 at 19:12
• Sorry, but how does that help me understand this problem? – Sother Sep 3 '17 at 3:02
• If $M$ has SVD $M = U \Sigma V^T$, then multiply $M$ by $U^{-1}$ on the left, then by $V$ on the right. If you really want to reduce to the quoted fact about PSD matrices, show that $M$ has the same rank as $M^T M$. (Throughout I'm assuming real matrices; if complex, replace transposes with conjugate transposes.) – Qiaochu Yuan Sep 3 '17 at 3:12
• This is true for any matrix - not just PSD matrices – Hunle Oct 9 '17 at 5:51