Lower bound for $\|A-B\|$ when $\operatorname{rank}(A)\neq \operatorname{rank}(B)$, both $A$ and $B$ are idempotent Let's first focus on $k$-by-$k$ matrices. We know that rank is a continuous function for idempotent matrices, so when we have, say, $\operatorname{rank}(A)>\operatorname{rank}(B)+1$, the two matrices cannot be close in norm topology.
But I wonder whether there is an explicit lower bound of the distance between two idempotent matrices in terms of their difference in their ranks. 
Thanks!
 A: martini's example is the first that come to mind, and it shows that rank is not continuous. One possible criticism is that the norms are small, so maybe there's a "normalized" version that works. But it's not the case: consider
$$
A=\begin{bmatrix}1&0\\ 0&0\end{bmatrix}, \ \ \ \
B=\begin{bmatrix}1&0\\ 0&\varepsilon\end{bmatrix}
$$
Then $\text{rank}(A)=1$, $\text{rank}(B)=2$, $\|A\|=1$, $\|B\|=1+\varepsilon$, and $\|A-B\|=\varepsilon$. 
A: The rank of an idempotent matrix is its trace, and $|\text{Tr}(A-B)| \le k \|A-B\|$, so if 
$\|A-B\| < 1/k$ they must have the same rank.
EDIT: Actually if $\|A - B\| < 1$ (where $\|\cdot\|$ is an operator norm) they must have the same rank.  Suppose $\text{rank}(A) < \text{rank}(B)$ and $B$ is idempotent.
Let $V = \text{Ran}(A)$ and $W = \text{Ran}(B)$. Then the restriction of $A$ to $W$ maps $W$ into $V$.  Since $W$ has higher dimension than $V$, this map can't be one-to-one, so there is some nonzero $w \in W$ such that $Aw = 0$.  But $Bw = w$, so $(B-A)w = w$ and $\|B-A\| \ge 1$.  
A: Here is a generalization of a special case, namely the case of self-adjoint idempotents.  
Suppose that $p$ and $q$ are self-adjoint idempotents (projections) in a C*-algebra $A$.  If $\|p-q\|<1$, then there is a continuous path of projections in $A$ from $p$ to $q$.  If $A$ is unital, this implies that $p$ and $q$ are unitarily equivalent.  In general, it implies that there is a partial isometry $v\in A$ such that $v^*v=p$ and $vv^*=q$. This is shown in Chapter 2 of Rørdam et al.'s An introduction to K-Theory for C*-algebras
In the case where $A=M_n(\mathbb C)$, this tells us that $\|p-q\|<1$ implies that $\mathrm{rank}(p)=\mathrm{Tr}(v^*v)=\mathrm{Tr}(vv^*)=\mathrm{rank}(q)$, a special case of Robert Israel's answer.  
On a related note, it isn't too hard to show that if $p$ and $q$ are arbitrary projections in a C*-algebra, then $\|p-q\|\leq 1$.  More generally, if $a\geq 0 $ and $b\geq 0$ in a C*-algebra, then $\|a-b\|\leq \max\{\|a\|,\|b\|\}$.  In particular, if $p$ and $q$ are self-adjoint idempotent matrices of different ranks, then $\|p-q\|=1$.
