Let $A$ be an $m \times n$ matrix with rank$ (A)=r$. Use the spectral decomposition of $A'A$ to show that there exists an $n \times(n-r)$ matrix $X$ such that $AX=0$ and $X'X=I$, where $I$ is identity matrix $(n-r)\times (n-r)$.
I know that for a symmetric matrix $A=VDV'$, where $V$ are orthogonal matrices and $D$ is diagonal of corresponding eigenvalues.
I found the spectral decomposition of $A'A$ to be :$VDDV$, so $V(D^2)V$.
I am stuck at this point. I know rank $(A)$=rank $(A'A)=r$, but cannot how to apply SVD to this problem- my other idea was that $X=V$ since I think $V'V=I$ since they are orthogonal and if $V$ is an orthogonal then $AX=0$. But I don't think this would have the right rank...