# Show that $rank(A)+rank(B) \leq n$, when $A,B$ are $2$ matrices of size $n \times n$, and $AB=0$

Question from homework in Linear Algebra:

Let $A,B$ be two matrices of size $n \times n$ such that $AB=0$.

Show that: $rank(A) + rank(B) \le n$ .

It probably has something to do with the dim of the null space or column space but I can't put things together from what we've learned...

-

Hint: show that $\operatorname{Im}(B)\subset \ker A$ and a well-known formula linking the rank and the dimension of the kernel of a matrix with the dimension of the underlying space.
Okay, thank you very much. Now I understand the way to the solution. lest say that column space of B is C(B) and null space of A is N(A) .For showing that $C(B) \subset N(A)$, Is it enough to just say that because $AB=0$, then for each vector $v \in C(B) : A∗v=0$, therefor foreach $v \in C(B) : v \in N(A)$, therefor $C(B) \subset N(A)$? @DavideGiraudo – Dor Shalom Dec 1 '12 at 13:47
One can also use the inequality $rank(AB) \geq rank(B)-nul(A)$ which is true for all square matrices A nad B. By the rank-nullity theorem, we have $nul(A)= n - rank(A)$, so
\begin{align} 0=rank(AB) &\geq rank(B)-nul(A)\\ &\geq rank(B)-n+rank(A) \end{align} Which after rearrangement gives the desired inequality.