Trace of Product of Matrices

Theorem
Let $\struct {R, +, \circ}$ be a commutative ring.

Let $\mathbf A = \sqbrk a_{m n}$ be an $m \times n$ matrix over $R$.

Let $\mathbf B = \sqbrk b_{n m}$ be an $n \times m$ matrix over $R$.

Then:
 * $\map \tr {\mathbf A \mathbf B} = \map \tr {\mathbf B \mathbf A}$

where $\map \tr {\mathbf A}$ denotes the trace of $\mathbf A$.

Proof
Let $\mathbf A \mathbf B = \mathbf C = \sqbrk c_m$.

Let $\mathbf B \mathbf A = \mathbf D = \sqbrk d_n$.

Then by definition of matrix products:

Therefore: