The Problem
Let $A,B \in M_n(\mathbb{R})$. Suppose that $\text{rank} A + \text{rank} B \le n$. Prove that there exists an invertible matrix $X \in M_n(\mathbb{R})$ such that $$ AXB = 0_n$$
I think I've completed this problem by regarding $AXB$ as a composition of three maps. However, I also want to try it with Gaussian Elimination. Is it possible?
What I have tried is as below.
First, the image of $B$ has rank $r \le n$. Also, $$\text{rank} A + \text{rank} B \le n \implies r := \text{rank} B \le n - \text{rank} A = \text{null} A =: s $$ Since $\text{ker}A$ is bigger than $\text{Im}B$ (Image of $B$), we can let $X$ be a map such that $X$ sends each basis of $\text{Im}B$ to a basis of $\ker{A}$. Then, every basis in $\text{Im}B$ "vanishes" after applying $X$ and $A$ consecutively.
Precisely, what I mean is to let $\mathcal{A}$ and $\mathcal{B}$ be a basis for $\text{ker}A$ and $\text{Im}B$, respectively, and extend them to $\tilde{\mathcal{A}}$ and $\tilde{\mathcal{B}}$ by: $$ \mathcal{B} = \{ b_1,\cdots,b_r \} $$ $$ \tilde{\mathcal{B}} = \{ b_1,\cdots,b_r,b_{r+1},\cdots,b_s,\cdots,b_n \} $$ $$ \mathcal{A} = \{ a_1,\cdots,a_r,a_{r+1},\cdots,a_s \} $$ $$ \tilde{\mathcal{A}} = \{ a_1,\cdots,a_r,a_{r+1},\cdots,a_s,\cdots,a_n \} $$ Define $X$ by sending $b_i \mapsto a_i$ for each $i=1,\cdots,n$. In other words, $X b_i = a_i$.
Now, for $y \in \mathbb{R}^n$, $B y \in \text{Im}B$, so $By = \beta_1 b_1 + \cdots + \beta_r b_r$ with some coefficients $\beta_i$. Then, $AXB y = A(X \sum_{i=1}^{r} \beta_i b_i) = A (\sum_{i=1}^{r} \beta_i a_i) = 0$ because $a_i \in \text{ker}A$.
Then, we have $AXB=0_n$.
The Question Part
I also tried to think with Gaussian Elimination. I know for a matrix $C \in M_n(\mathbb{R})$, there exists invertible $P,Q \in M_n(\mathbb{R})$ such that $PC$ is an upper triangular matrix and $CQ$ is a lower triangular matrix.
This is due to Gaussian Elimination, together thought with elementary matrices. A left multiplication of $P$ means row reducing $A$ and a right multiplication of $Q$ means column reducing $A$.
Here, I am stuck. Can I construct $P,Q$ so that $(AQ)(PB)$ becomes a product of a lower and upper triangular matrix and $(AQ)(PB)=0_n$? And thus, $QP=X$ is what I am looking for.
Instead of using only row reductions, you may also use column reductions to reduce $A$ and $B$ to diagonal matrices. Let $A=U_1(D_1\oplus0)V_1$ and $B=U_2(0\oplus D_2)V_2$ where $U_1,V_1,U_2,V_2$ are invertible and $D_1,D_2$ are two invertible diagonal submatrices. Pick $X=V_1^{-1}U_2^{-1}$ and we are done.