Let $A$ be a $n \times n$ matrix with $\operatorname{rank}A=2$. Then there exist two $n \times 2$ matrices, $X$ and $Y^T$, such that $$A=XY^T$$
I have a proof, but I don't understand the following step. It uses the $n \times n $ matrix $$\overline{A}=\begin{pmatrix} 1 & 0 & 0 &\dots & 0 \\ 0 & 1 & 0 &\dots & 0 \\ 0 & 0 & 0 &\dots & 0 \\ 0 & 0 & 0 &\dots & 0 \\ \vdots \\ 0 & 0 & 0 &\dots & 0 \end{pmatrix}$$ and then uses the fact that there are two $n \times n$ invertible matrices $P,Q$ such that $A=P\overline{A}Q$.
Why is this true?
Outline:
Multiply $A\;$on the left by successive elementary matrices $E_1,...,E_k,\;$so as to transform $A\;$to row-reduced echelon form.
Let $P' = E_k\cdots E_1\;$be the product of those elementary matrices.
Then $P'\;$is invertible, and $P'A\;$is in row-reduced echelon form, with rank $2$.
Use a permutation matrix $Q'\;$to permute the columns of $P'A,\;$so as to yield$\;\overline{A}=P'AQ'$.
Then $A=P\overline{A}Q,\;$where $P=(P')^{-1}\;$and$\;Q=(Q')^{-1}$.