Consider two $n \times n$ matrices $A, B$ such that $AB = 0$. Then the image of $B$ is a subspace of the kernel of $A$. However, in general they are not equal.
Under what conditions are they equal? In particular, does there exist an characterization purely in terms of the algebra of the matrices?
That is, I'm trying to avoid conditions based around properties of the associated vector spaces, such as their dimensions being equal.
$\operatorname{rank}A=\operatorname{nullity}B$, or equivalently $$\operatorname{rank}A+\operatorname{rank}B=n.$$