If A is an $n\times n$ square matrix such that $A^3=A$ , then show that $\operatorname{rank}(A) + \operatorname{tr}(A)$ is even

linear algebramatrix-rank

If $A$ is an $n\times n$ square matrix such that $A^3=A$ , then show that $\operatorname{rank}(A) + \operatorname{tr}(A)$ is even.

$\mathbf {My \ attempt}:$ Actually, I have been trying over this problem which was posed as a multiple choice question in an exam .
First of all to show that $\operatorname{rank}(A) ≥ \operatorname{tr}(A)$ .
Consider, the rank factorization of $A$, $A= PQ$ where $P$ and $Q$ are $n\times r$ and $r \times n$ matrices respectively for $r=\operatorname{rank} (A$) , and as $P$ and $Q$ are left and right invertible, then $$\operatorname{tr}((QP)^2)=\operatorname{rank} A\geq \operatorname{tr}(QP)=\operatorname{tr}(PQ)=tr(A). $$
But, I can't approach for the part stated in the question .
Any help is appreciated .

Best Answer

Since $A^3=A$, the eigenvalues of $A$ are from $\{0,+1,-1\}$. In addition, the $A$ is diagonalizable, as the minimal polynomial of $A$ divides $t^3-t=(t-1)(t+1)t$, hence it factors into linear factors.

Let me denote there algebraic multiplicities by $n_0,n_+,n_-$, respectively. Then the rank of $A$ is equal to $$ rank(A)=n_++n_-, $$ while the trace is (the sum of the eigenvalues) $$ tr(A) = n_+-n_-. $$ So $$ rank(A) + tr(A) = n_++n_-+n_+-n_- = 2n_+, $$ which is even.