# If $A$ and $B$ are real matrices and $X,Y$ are are non-singular square matrices such that $XA=BY$

If $A$ and $B$ are real matrices and $X,Y$ are are non-singular square matrices with real entries such that $XA=BY$ then which of the following is true?

$1. \dim(X)=\dim(Y)$

$2. \dim(A)=\dim(B)$

$3.$If $X$ and $A$ commute then $B$ is square.

$4.$If $Y$ and $A$ commute then $B$ is square.

$5.$If $A$ is non-singular then $B$ is also non-singular.

My try: Here, dimension means order of matrix. So I suppose that $$\dim(X)=m\times m, \quad\dim(Y)=n\times n, \quad\dim(A)=m\times a, \quad\dim(B)=n\times b$$

Then I try to think about the options but it becomes difficult for me. Last option is obviously true and I think first two options are also true. What you think? What should be the answer?

Let $A$ be $m\times n$. Then $X$, being non singular, must be square so it has to be $m\times m$. Since $XA=BY$ and $Y$ is non singular (hence square), $B$ must be $m\times n$ too and $Y$ is $n\times n$.

If $X$ and $A$ commute, then $A$ must be $m\times m$ or $AX$ is undefined. Thus $m=n$ and $B$ is square. The same if $Y$ and $B$ commute.

If $A$ is non singular, then $B=XAY^{-1}$, so…

• If $Y$ and $A$ commute then? – user163993 Oct 25 '14 at 18:06
• @user163993 Where's the problem? Both $AY$ and $YA$ should be defined, so… – egreg Oct 25 '14 at 18:08
• then all options are true? – user163993 Oct 25 '14 at 18:10
• @user163993 No. Option 1 is clearly false: take $A$ any $2\times 3$ matrix, $X=I_2$ (the identity), $B=A$ and $Y=I_3$. – egreg Oct 25 '14 at 18:12

Notice that we say that two matrices $A$ and $B$ in $\mathcal M_{p,q}(\Bbb R)$ are equivalent if there's two invertible matrices $P\in \mathcal M_{p}(\Bbb R)$ and $Q\in \mathcal M_{q}(\Bbb R)$ such that $$A=PBQ$$ and in this case we prove easily that

$A$ and $B$ have the same rank if and only if $A$ and $B$ are equivalent.

You must have the dimensions of the products being the same. Let $\dim(X) = m \times m$ and $\dim(Y) = n \times n$. The products must be well-defined, so, let $\dim(A) = a_1 \times a_2$ and $\dim(B) = b_1 \times b_2$. Let's find out $a_1,a_2,b_1$ and $b_2$. Then: $$\dim(XA) = m \times a_2 \quad \mbox{and} \quad \dim(BY) = b_1 \times n.$$

Since $XA = YB$ implies $\dim(XA) = \dim(YB)$, we conclude that $b_1 = m$ and $a_2 = n$. Think a bit about possibilities for $a_1$ and $b_2$. If any of the matrices commute with each other (items $3$ and $4$, repeat this analysis). And for non-singularity, try to isolate $A$ and/or $B$, using the existence of $X^{-1}$ and $Y^{-1}$.