I am interested in a linear mapping of the form $$ T(A) = A M - M A, \ \ A \in V $$ where $V = M^{n,n}$.
First, we suppose $n = 2$ and consider a simple numerical problem.
I was solving the problem to find a basis for the kernel of $T$, where $$ M = \left[ \begin{array}{cc} 1 & 2 \\ 0 & 3 \\ \end{array} \right] $$
So, we take $$ A = \left[ \begin{array}{cc} a & b \\ c & d \\ \end{array} \right] $$
We solve the equation $$ A M - M A = 0 $$
After simplification, we get $$ \left[ \begin{array}{cc} -c & a + b - d \\ -c & c \end{array} \right] = \left[ \begin{array}{cc} 0 & 0 \\ 0 & 0 \\ \end{array} \right] $$ which reduces to two linear equations $$ a + b = d, \ \ c = 0 $$
Hence, a basis for $\mbox{Ker}(T)$ is given by $$ \mathcal{B} = \left\{ \left[ \begin{array}{cc} 1 & 0 \\ 0 & 1 \\ \end{array} \right], \left[ \begin{array}{cc} 1 & -1 \\ 0 & 0 \\ \end{array} \right] \right\} $$
Thus, for this example, nullity of $T$ = $2$.
In general, is there any relation between the nullity of $T$ and the rank of $M$ for the mapping (this looks like the Lie bracket) $$ T(A) = A M - M A, \ \ A \in V = \mathcal{M}^{n,n} $$