3

$\mathrm{tr}(AB)=\sum\limits_{i=1}^n \sum\limits_{j=1}^n a_{ij}*b_{ji}$
$\mathrm{tr}(A)*\mathrm{tr}(B)=\sum\limits_{i=1}^n a_{ii}*\sum\limits_{i=1}^n b_{ii}$

Therefore $\mathrm{tr}(AB) \neq \mathrm{tr}(A)*\mathrm{tr}(B)$

Is the proof valid?

Ivo Terek
  • 80,301
gbox
  • 13,645

3 Answers3

36

It is false. Let's think small. Consider the identity matrix, of order $n > 1$. Then: $$n = \mathrm{tr}(I) = \mathrm{tr}(I \cdot I) \neq \mathrm{tr}(I)~ \mathrm{tr}(I) = n^2$$ It is important to try some silly cases and gain intuition about the affirmation before tackling summations, etc.

Ivo Terek
  • 80,301
7

You have not given a reason why those expressions are not identically equal. They will be equal in some special cases. The easiest way to prove that such an identity doesn't hold is to give a counterexample. Try 2-by-2 matrices.

Jonas Meyer
  • 55,715
1

Your proof for any $n\ge2$ is valid, since for any non-zero ring $R$, the two multivariate polynomials $$P_n:=\sum_{1\le i,j\le n}a_{i,j}b_{j,i},\quad Q_n:=\sum_{1\le i,j\le n}a_{i,i}b_{j,j}\in S:=R[a_{i,j},b_{i,j}]_{1\le i,j\le n}$$ are then obviously distinct, which means that the matrices $A=(a_{i,j}),B=(b_{i,j})\in M_n(S)$ are such that $$\operatorname{tr}(AB)\ne\operatorname{tr}(A)\operatorname{tr}(B).$$

Even worse: for any non-zero ring $S$, there exist matrices $A,B\in M_n(S)$ such that $\operatorname{tr}(AB)\ne\operatorname{tr}(AB)\operatorname{tr}(AB)$: for instance, $P_n$ contains the monomial $a_{1,2}b_{2,1}$, whereas $Q_n$ doesn't, which leads to the counterexample $A=\pmatrix{0&1&0&\dots&0\\0&0&0&\dots&0\\&&\dots&&\\0&&\dots&&0 },B=\pmatrix{0&0&0&\dots&0\\1&0&0&\dots&0\\&&\dots&&\\0&&\dots&&0 }\in M_n(S)$.

Anne Bauval
  • 49,005
  • 1
    Typically, a fact like "two multivariate polynomials are equal for all real inputs iff their coefficients are the same" is not "available" for use in a linear algebra proof. The motivation for the counterexample is nice, though – Ben Grossmann May 09 '25 at 14:52
  • Did you forget a "not" in the first sentence? – Michael Seifert May 09 '25 at 14:58
  • Ah, I see — I got it into my head that the OP was trying to prove that $\mathrm{tr}(A) \mathrm{tr}(B) =\mathrm{tr}(AB)$, not the reverse. I blame end-of-semester brain-fry. – Michael Seifert May 09 '25 at 15:04
  • 1
    @Anne Surely in the kinds of courses where this question arises, one is more concerned with statements over real (or complex) matrices and not with general polynomial identities, so I presumed we were working in that context. But yes, your interpretation is technically valid. And indeed, every ring has a $0$ and $1$. – Ben Grossmann May 09 '25 at 15:13
  • 1
    Essentially I mean that we shouldn't use this fact as the basis for a proof, but I think using it to motivate a counterexample is fine. Your "More explicitly"... reads to me as if it's meant to be incidental, but for the purposes of an undergraduate student answering this question, it is the "real proof". – Ben Grossmann May 09 '25 at 16:07