Rank of linear transformation $\phi(X)=AXA$ Let $\phi:\mathbb{M}_n(\mathbb{R})\rightarrow\mathbb{M}_n(\mathbb{R})$ such that $\phi(X)=AXA$ with given $A\in\mathbb{M}_n$ and $\operatorname{rank}A=r<n$.
What can we say about $\operatorname{rank}\phi$? Can we determine it solely from $A$?
 A: Let's look for the dimension of the Ker of $\phi$.
$X\in\ker(\phi)\leftrightarrow X*Im(A)\subseteq Ker(A)$
But since $\;dim(Ker(A))=n-r\;$, and $\;dim(Im(A))=r\;$, you're looking for all the matrices that send $r$ fixed linearly indipendent vectors into $n-r$ fixed linearly indipendent vectors.
If you take $e_1,e_2,\dots,e_n$ a canonical base of $\mathbb{R}^n$, you have to send $Span\{e_1,e_2,\dots,e_r\}$ into $Span\{e_1,e_2,\dots,e_{n-r}\}$, and the matrices doing this work are exactly
$$
X=\begin{pmatrix}*&*\\0&*\end{pmatrix}
$$
Where the "$0$" is a $r\times r$ block. This means that $\;dim(Ker(\phi))=n^2-r^2\;$, and so $\;rank(\phi)=r^2\;$
A: More generally, let $\psi:X\rightarrow AXB$ where $rank(A)=r,rank(B)=s$. If we stack row by row, then $\psi=A\bigotimes B^T$ (cf. Kronecker product http://en.wikipedia.org/wiki/Kronecker_product ). The non zero singular values of $A$ are $(\sigma_i)_{i\leq r}$, of $B$ are $(\tau_j)_{j\leq s}$. Then, the non zero singular values of $\psi$ are $(\sigma_i\tau_j)_{i,j}$ and $rank(\psi)=rs$. 
A: A partial idea: Any matrix $X$ whose columns consist entirely of elements of the nullspace of $A$ will be sent to zero by $\phi$. So if $r = n-1$, the rank of $\phi$ is at most $n^2 - n$ (pick a particular nonzero nullvector and put it in each of the $n$ columns, one at a time, with all other columns zero to show that the nullity is at least $n$). With smaller $r$, you can presumably do more complex combinations. And you get to use combinations of row-nullvectors as well, but I don't see offhand an easy way to count the eventual dimension. 
