Let $A$ be an $m \times n$ matrix such that $\mathrm{rank}(A) < n$. If one were to set the equation
\begin{equation*} A Z = B A, \end{equation*}
what is the condition that matrix $Z$ needs to fulfill such that the above relation is even possible? $Z$ is an $n \times n$ matrix.
Thank you!
Presumably you want to solve this for the $m \times m$ matrix $B$. On the null space of $A$, the right side is $0$, so $Z$ must map the null space of $A$ into the null space of $A$. If $Z$ satisfies this condition, then you can take $B = A Z A^+$ where $A^+$ is the Moore-Penrose pseudoinverse of $A$. This works because $A^+A$ is the orthogonal projection on the orthogonal complement of the null space of $A$, so for $x$ in that orthogonal complement, $BAx = A Z A^+ A x = A Z x$.