Suppose that $X$ is an $n \times k$ matrix with $n>k$ and $\text{rank}(X)=\ell < k$. Consider a non-singular $k \times k$ matrix $R=[R_1, R_2]$ where $R_1$ is $k \times \ell$ and $R_2$ is $k \times (k-\ell)$ that satisfies
$\text{rank}(XR_1)=\ell$ and $XR_2=0.$
How can I find such an $R$ matrix? Are there explicit solution for $R$?
Hint:
Consider SVD decomposition. $$X=U\begin{bmatrix}D & 0 \\ 0 & 0 \end{bmatrix}V^T$$
$D \in \mathbb{R}^{l \times l}$ is diagonal and has decreasing singular values, and both $U \in \mathbb{R}^{n \times n}$ and $V \in \mathbb{R}^{k \times k}$ are orthogonal matrix.
You should be be able to construct $R$ from there.