Is the result $|\text{rank(AB)}-\text{rank(BA)}| \le \text{min}(\text{rank}(A),\text{rank}(B))$

Is the result $$|\text{rank(AB)}-\text{rank(BA)}| \le \text{min}(\text{rank}(A),\text{rank}(B))$$ true for all $$n*n$$ matrices $$A,B$$. I only know the result that $$\text{rank(AB)} \le \text{min(rank(A),rank(B))}$$

Yes. Your desired inequality is a consequence of the one you mentioned. In other words, it follows from the fact that the ranks of both $$AB$$ and $$BA$$ are non-negative integers at most equal to that minimum.