# Calculate the rank of matrix $B-C$ while $AB=AC$ and $\operatorname{rank}(A) = r$?

$A$ is an $n\times n$ matrix and rank$(A)=r$.,$B,C$ are both $n \times n$ matrices and $AB=AC.$ Calculate the maximun possible rank of the matrix $(B-C)$.

This question is a part of my homework in Linear Algebra, and the title of the homework is "Vector spaces, Linear dependence, Span, and Basis". I have no clue/direction of how to approch this question.

Thank you!

-
Deal with the case $A=\operatorname{Diag}(\underbrace{1,\dots,1}_{r\mbox{ times }},\underbrace{0,\dots, 0}_{n-r\mbox{ times}})$. –  Davide Giraudo Dec 1 '12 at 12:06

$Im(B-C) \subset null(A)$ then $$\dim Im(B-C)+ \dim Im(A) \leq \dim Im(A) + \dim null (A) = n$$ $$\dim Im(B-C) \leq n -\dim Im(A)$$
@DorShalom Im =image space $dim Im(B-C) = rank(B-C)$ –  jim Dec 1 '12 at 12:30
Hint: Consider a vector $v$ in the column space of $B-C$. Then $v=(B-C)u$ for some vector $u$. Since $AB=AC$, we have $Av=0$. So, $v$ also lies inside the null space of $A$. Now, what is the relationship between the dimension of the column space of $B-C$ and $\mathrm{rank}(B-C)$? What is the dimension of the null space of $A$?