Exercise The trace trA of a square matrix is the sum of its diagonal entries. For example,
|tr[||1||2||] = 1 + 4 = 5|
|tr[||0||3||-4||] = 0 + 5 - 3 = 2|
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≤j≤naijbji = ai1b1i + ai2b2i + ... + ainbni. Thus
trAB = ∑1≤i≤m(ai1b1i + ai2b2i + ... + ainbni) = ∑1≤i≤m,1≤j≤naijbji.
Exchanging B and A, we have
trBA = ∑1≤j≤n(bj1a1j + bj2a2j + ... + bjmamj) = ∑1≤j≤n,1≤i≤mbijaji = ∑1≤i≤m,1≤j≤najibij = trAB.