math111_logo Composition and Matrix Multiplication


Exercise The trace trA of a square matrix is the sum of its diagonal entries. For example,

tr[ 1 2 ] = 1 + 4 = 5
3 4
tr[ 0 3 -4 ] = 0 + 5 - 3 = 2
2 5 7
0 4 -3

Prove the trace has the following properties

tr(A + B) = trA + trB, tr cA = c trA, trAT = trA, trAB = trBA.

Answer The first two properties mean that the trace is linear. The third property means the trace is not changed by the transpose. All are quite obvious.

In the property trAB = trBA, we do not need A and B to be square matrices. We will only assume A is an m by n matrix, and B is an n by m matrix.

The i-th diagonal entry of AB is ∑1≤jnaijbji = ai1b1i + ai2b2i + ... + ainbni. Thus

trAB = ∑1≤im(ai1b1i + ai2b2i + ... + ainbni) = ∑1≤im,1≤jnaijbji.

Exchanging B and A, we have

trBA = ∑1≤jn(bj1a1j + bj2a2j + ... + bjmamj) = ∑1≤jn,1≤imbijaji = ∑1≤im,1≤jnajibij = trAB.