Topologically equivalence of a metric on matrices 
Define a function on the set of $n\times n$ matrices by $\rho(A,B)=\operatorname{rank}(A-B).$  Prove that $\rho$ is a metric that is topologically equivalent to the discrete metric.

 A: Let $M$ be the set of $n\times n$ matrices. Clearly $\rho(A,B)\in\{0,1,\dots,n\}$ for all $A,B\in M$. It follows immediately that if $\rho$ is a metric at all, it’s topologically equivalent to the discrete metric on $M$. To see this, let $A\in M$ and consider $B_\rho(A,1)$, the open $\rho$-ball of radius $1$ centred at $A$. For each $B\in M$, $B\in B_\rho(A,1)$ if and only if $\rho(A,B)<1$, i.e., if and only if $\rho(A,B)=0$ and hence $B=A$. In other words, $B_\rho(A,1)=\{A\}$, and $\rho$ generates the discrete topology on $M$: every subset of $M$ is open.
Thus, you need only prove that $\rho$ actually is a metric on $M$. That entails proving that it satisfies the following conditions:


*

*$\rho(A,A)=0$ for all $A\in M$. This is easy.

*If $A,B\in M$ and $A\ne B$, then $\rho(A,B)>0$. Also easy.

*$\rho(A,B)=\rho(B,A)$ for all $A,B\in M$. This too is easy.

*For any $A,B,C\in M$, $\rho(A,C)\le\rho(A,B)+\rho(B,C)$. In other words, you need to show that for any three $n\times n$ matrices $A,B$, and $C$, $$\operatorname{rank}(A-C)\le\operatorname{rank}(A-B)+\operatorname{rank}(B-C)\;.$$ This would follow easily if you could show that for any $n\times n$ matrices $A$ and $B$, $$\operatorname{rank}(A+B)\le\operatorname{rank}(A)+\operatorname{rank}(B)\;.$$ One way to see this is to view it as a statement about the dimensions of the ranges (or images) of the matrix transformations $A,B$, and $A+B$.
