Solution (source code)

= Solution

<Rank-nullity theorem> gives $\operatorname{rank}T+\dim\ker T=n$. Equal nullities therefore give equal ranks.