Transpose of Matrix Product

Theorem
Let $\mathbf A$ and $\mathbf B$ be matrices over a commutative ring such that $\mathbf A \mathbf B$ is defined.

Then $\mathbf B^\intercal \mathbf A^\intercal$ is defined, and:
 * $\paren {\mathbf A \mathbf B}^\intercal = \mathbf B^\intercal \mathbf A^\intercal$

where $\mathbf X^\intercal$ is the transpose of $\mathbf X$.

Proof
Let $\mathbf A = \sqbrk a_{m n}$, $\mathbf B = \sqbrk b_{n p}$

Let $\mathbf A \mathbf B = \sqbrk c_{m p}$.

Then from the definition of matrix product:
 * $\ds \forall i \in \closedint 1 m, j \in \closedint 1 p: c_{i j} = \sum_{k \mathop = 1}^n a_{i k} \circ b_{k j}$

So, let $\paren {\mathbf A \mathbf B}^\intercal = \sqbrk r_{p m}$.

The dimensions are correct, because $\mathbf A \mathbf B$ is an $m \times p$ matrix, thus making $\paren {\mathbf A \mathbf B}^\intercal$ a $p \times m$ matrix.

Thus:
 * $\ds \forall j \in \closedint 1 p, i \in \closedint 1 m: r_{j i} = \sum_{k \mathop = 1}^n a_{i k} \circ b_{k j}$

Now, let $\mathbf B^\intercal \mathbf A^\intercal = \sqbrk s_{p m}$

Again, the dimensions are correct because $\mathbf B^\intercal$ is a $p \times n$ matrix and $\mathbf A^\intercal$ is an $n \times m$ matrix.

Thus:
 * $\ds \forall j \in \closedint 1 p, i \in \closedint 1 m: s_{j i} = \sum_{k \mathop = 1}^n b_{k j} \circ a_{i k}$

As the underlying structure of $\mathbf A$ and $\mathbf B$ is a commutative ring, then $a_{i k} \circ b_{k j} = b_{k j} \circ a_{i k}$.

Note the order of the indices in the term in the summation sign on the of the above.

They are reverse what they would normally be because we are multiplying the transposes together.

Thus it can be seen that $r_{j i} = s_{j i}$ and the result follows.

Also see

 * Inverse of Matrix Product