Let $A$, $B\in\mathbb{R}^{n\times n}$ be full-rank random matrices and define the Kronecker products $P=A\otimes B$ and $Q=B\otimes A$. Through example-based examination, I have found that


$\text{rank}(P-Q)=n^2-n$,


but I am struggling to formulate a proof of this. Thus far, I have focused on the fact that $P$ and $Q$ are permutation-similar such


$Q=ZPZ$,


where $Z=Z^T=Z^{-1}$. We know that $P$ and $Q$ have the same eigenvalues and that the eigenvectors, $\Phi\_P$ and $\Phi\_Q$, are related by $\Phi\_P=Z\Phi\_Q$. Furthermore,


$\Phi\_P-Z\Phi\_QZ=T=[T\_1 \ldots T\_{n^2}]$,


where $T\_i=0$ for $i \in \{1:n+1:n^2\}$. I presume that this somehow shows the rank condition, but I cannot figure out the coupling. I would like to ask whether I am on the right track; and if yes, can you provide some pointers on how I proceed to show the rank condition?



Rank of $A\otimes B - B\otimes A$
For generic $A,B$ the matrix $A$ is invertible and $B=CA$, where $C$ is also generic. We have $(A\otimes B-B\otimes A)(u\otimes v)=Au\otimes CAv-CAu\otimes Av$. The vectors $Au$ run over the whole $\mathbb{R}^n$, so the image of the operator $A\otimes B-B\otimes A$ is the same as the image of $I\otimes C-C\otimes I$ (where $I$ is the identity matrix). Choosing an eigenbasis for $C$ (it exists if $C$ is generic, possibly it is complex but the rank is the same over $\mathbb{R}$ and over $\mathbb{C}$), where $Ce\_i=\lambda\_i e\_i$, we get $$(I\otimes C-C\otimes I)(e\_i\otimes e\_j)=(\lambda\_j-\lambda\_i)e\_i\otimes e\_j.$$
So, $(e\_i\otimes e\_j)$ is an eigenbasis, and all but $n$ eigenvalues are non-zero.


