Characterization of $\mathrm{rank}(g)\leq \mathrm{rank}(f)$ Let $E$ and $F$ two finite-dimensional spaces and $f,g\in\mathcal{L}(E,F)$. The question is to prove that:

$\mathrm{rank}(g)\leq \mathrm{rank}(f)$ iff there's $h\in GL(F)$ and $k\in\mathcal{L}(E)$ such that $h\circ g=f\circ k$

It's pretty easy to prove the sufficient condition but I'm stuck on the necessary condition. Thanks for any help.
 A: Suppose $\mathrm{rank}\, g \leq \mathrm{rank}\, f$. Because of this condition, one can easily construct $h \in GL(F)$ such that $h(g(E)) \subset f(E)$ by taking bases. In other words, $\tilde{g} = h \circ g$ gives a linear map $E \to f(E)$.
Let $S$ be a subspace of $E$ such that $E = S \oplus \ker f$, and consider the restriction $\overline{f} = f|_S$. Then the map $\overline{f}\colon S \to f(E)$ is an isomorphism (this is a special case of the first factorization theorem).
It is straightforward to check that $k = {\overline{f}}^{-1} \circ \tilde{g}$, trivially extended from a map $E \to S$ to an endomorphism $E \to E$, provides a good choice. Indeed, since $k(E) \subset S$ one has
$$f \circ k = \overline{f}\circ{\overline{f}}^{-1} \circ \tilde{g} = \tilde{g} = h \circ g.$$
A: You already saw that if $h\circ g=f\circ k$ then $\def\rk{\operatorname{rk}}\rk(g)=\rk(h\circ g)=\rk(f\circ k)\leq\rk(f)$. For the converse suppose $\rk(g)\leq\rk(f)$. Choose a basis $(e_1,\ldots,e_r)$ of the image of$~g$, and a linearly independent family $(e'_1,\ldots,e'_r)$ in the image of$~f$ (which is possible because of the rank inequality). Let $(b_1,\ldots,b_r)$ be a family of preimages by$~g$ of $(e_1,\ldots,e_r)$, and $(b'_1,\ldots,b'_r)$ a family of preimages by$~f$ of $(e'_1,\ldots,e'_r)$; both these are linearly independent families, as any linear dependency would give rise through $g$ respectively $f$ to a linear dependency between $(e_1,\ldots,e_r)$ respectively $(e'_1,\ldots,e'_r)$, which dependencies do not exist. By the same argument $\langle b_1,\ldots,b_r\rangle\cap\ker(g)=\{0\}$, so the sum of $\langle b_1,\ldots,b_r\rangle$ and $\ker(g)$ is direct, and has dimension $\dim E$ by the rank nullity theorem. So we can extend $b_1,\ldots,b_r$ by a basis of $\ker(g)$ to a basis $(b_1,\ldots,b_{\dim E})$of $E$.
Now extend the three remaining families to bases of $F$ (for the $e$ and $e'$) respectively of $E$ (for $b'$) in an arbitrary way. Define $h\in GL(f)$ by the requirement $h(e_i)=e'_i$ for $i=1,\ldots,\dim F$, and $k\in\cal L(E)$ by $k(b_i)=b'_i$ for $i=1,\ldots,r$ and $k(b_i)=0$ for $r<i\leq\dim E$. Checking $h\circ g=f\circ k$ is a formality: both sides map $b_i\mapsto e'_i$ for $i=1,\ldots,r$ and $b_i\mapsto0$ for $r<i\leq\dim E$.
