This is somewhat of a reference request.
In several posts on the rank of products of matrices (e.g. Full-rank condition for product of two matrices), it is stated that
$$ \mathrm{rank}(AB) = \mathrm{rank}(B) - \dim \big(\mathrm{N}(A) \cap \mathrm{R}(B)\big)$$
It appears that this is a classic result, though I am not familiar with it. If anyone can point me to a textbook that discusses it and other rank inequalities, that would be much appreciated!