Equality in the rank-sum and nullity-product inequalities (source code)

= Equality in the rank-sum and nullity-product inequalities

For <endomorphisms> $S,T$ of a finite-dimensional space of <dimension> $d$, $r(S+T)\le r(S)+r(T)$ and $n(ST)\le n(S)+n(T)$. If both equalities hold, the first gives $r(S)+r(T)\le d$, while the second gives $2d-r(S)-r(T)\le d$. Thus the <rank> sum is $d$, $S+T$ is an <isomorphism>, and $ST=0$. Conversely, $ST=0$ implies $\operatorname{im}T\subseteq\ker S$ and hence <rank> sum at most $d$, whereas invertibility of $S+T$ gives <rank> sum at least $d$. This proves both equalities.