Artificial intelligent assistant

Find $X$ so that $MX^\top$ is ortho-projector onto $\mathrm{span}(M)$. Given a matrix $M\in\Bbb R^{n\times m}$ with $n>m$. What is the fastes way to see (and shortest to write down) that there exists a matrix $X\in\Bbb R^{m\times n}$ so that $M X^\top$ is th ortho-projector onto $\mathrm{span}(M)$. I know how to do it if $M$ is of full column-rank. Then the columns of $M$ are a basis of $\mathrm{span}(M)$ and we choose the columns of $X$ as the dual basis. But what if $\mathrm{rank}(M)<m\,$?

Just take $X^T=M^+$, the Moore-Penrose pseudoinverse of $M$.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 51dc791c28ce9f9df6917a553b0a169e