Rank bounds for a sum of linear maps (source code)

= Rank bounds for a sum of linear maps
{title2=$|\operatorname{rank}A-\operatorname{rank}B|\leq\operatorname{rank}(A+B)\leq\operatorname{rank}A+\operatorname{rank}B$}

Let $A,B:U\to V$ be <linear maps> of finite <rank of a linear map>. Their sum satisfies
$$
|\operatorname{rank}A-\operatorname{rank}B|\leq\operatorname{rank}(A+B)\leq\operatorname{rank}A+\operatorname{rank}B.
$$
The <image of a linear map> $A+B$ lies in $\operatorname{im}A+\operatorname{im}B$, so the <dimension formula for a sum of subspaces> proves the <upper bound>. Apply that bound to $A=(A+B)-B$ and to $B=(A+B)-A$ to obtain the <lower bound>. Finite <rank> ensures that subtraction in the displayed inequality is defined.

Both extremes occur for square <matrices>. For prescribed ranks $r\geq s$, take $A=\operatorname{diag}(I_r,0)$ and $B=-\operatorname{diag}(I_s,0)$ to obtain <matrix rank> $r-s$. For the largest possible <matrix rank>, use diagonal supports whose union has size $\min(n,r+s)$ and assign positive real diagonal entries, obtaining that <matrix rank> without cancellation.