# Which Matrix Equality is always true?

Let $A_{r\times m}$and $B_{m\times r}$ be full matrices, $C_{r\times r}$is a diagonal matrix, and $D_{r\times r}$is an identity matrix. Which of the following is always true?

1. $AB=(AB)^{T}$
2. $ABD = DAB$
3. $BC = CB$
4. $A^{T}C=CA^{T}$

I don't think it would be $1$ because the $A^{T}$ and $B$ would not take into account the diagonal and identity matrix, and I do not think that it would be $3$ either. Any help with this one?

(1) is false

$$\begin{pmatrix} 1 & 2\\ 3 & 4 \end{pmatrix}\begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix}\ne \left(\begin{pmatrix} 1 & 2\\ 3 & 4 \end{pmatrix}\begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix}\right)^T$$

(3) is false

$$\begin{pmatrix} 1 & 2\\ 3 & 4 \end{pmatrix}\begin{pmatrix} 2 & 0\\ 0 & 1 \end{pmatrix}\ne \begin{pmatrix} 2 & 0\\ 0 & 1 \end{pmatrix}\begin{pmatrix} 1 & 2\\ 3 & 4 \end{pmatrix}$$

Moreover, note that we need $m= r.$

(4) is false

$$\begin{pmatrix} 1 & 3\\ 3 & 4 \end{pmatrix}^T\begin{pmatrix} 2 & 0\\ 0 & 1 \end{pmatrix}\ne \begin{pmatrix} 2 & 0\\ 0 & 1 \end{pmatrix}\begin{pmatrix} 1 & 3\\ 2 & 4 \end{pmatrix}^T$$

Moreover, note that we need $m= r.$

(2) is true

Since $D$ is the identity matrix one has that $MD=DM=M.$ Thus

$$ABD=(AB)D=(AB)=D(AB)=DAB.$$

Since $D$ is the identity matrix,

$$ABD=AB=DAB.$$

Remark:

You should construct counter examples for the rests as an exercise.

and I do not think that it would be 3 either.

Lets proof this by an easy example, let matrices B and C (diagonal) be:

$B=\begin{bmatrix} 3 &-7 & 4 \\ -1 & 13 & -15 \\ 1 & 9 & -8 \end{bmatrix}$

$C=\begin{bmatrix} -13 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & -3 \end{bmatrix}$

What will happen when you calculate $B\cdot C$? Each row of $B$ gets multiplied by the diagonal of $C$. Row1 = $-3.13 - 7.5 - 4.3$ and for Row2 and 3 is the same.

What will happen when you calculate $C\cdot B$? $i_{th}$ diagonal element of $C$ will multiply $i_{th}$ row of $B$. This is, first diagonal element of $C$ by all the elements of the first row of $B$ and so on. Row1 = $-13.3 + 13.7 -13.4$

Then the $4th$ point is also false, since as we have seen, multiplying a diagonal matrix by the left and the right doesn't give the same result.

Actually, as Siong has said, the only one that holds is $3rd$ since every matrix multiplied by the identity by the left or right (doesn't matter) will always give you the matrix. This means that Identity Matrix commutes with $A$ and $B$ so it doesn't matter where do you place it in multiplication:

$AD = DA = A \Rightarrow BD = DB = B \Rightarrow A(BD) = A(DB) = (AD)B = DAB$