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:
 * $\left({\mathbf A \mathbf B}\right)^\intercal = \mathbf B^\intercal \mathbf A^\intercal$

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

Proof
Let $\mathbf A = \left[{a}\right]_{m n}$, $\mathbf B = \left[{b}\right]_{n p}$

Let $\mathbf A \mathbf B = \left[{c}\right]_{m p}$.

Then from the definition of matrix product:
 * $\displaystyle \forall i \in \left[{1 \,.\,.\, m}\right], j \in \left[{1 \,.\,.\, p}\right]: c_{i j} = \sum_{k \mathop = 1}^n a_{i k} \circ b_{k j}$

So, let $\left({\mathbf A \mathbf B}\right)^\intercal = \left[{r}\right]_{p m}$.

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

Thus:
 * $\displaystyle \forall j \in \left[{1 \,.\,.\, p}\right], i \in \left[{1 \,.\,.\, m}\right]: r_{j i} = \sum_{k \mathop = 1}^n a_{i k} \circ b_{k j}$

Now, let $\mathbf B^\intercal \mathbf A^\intercal = \left[{s}\right]_{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:
 * $\displaystyle \forall j \in \left[{1 \,.\,.\, p}\right], i \in \left[{1 \,.\,.\, m}\right]: 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