$A$ is complex matrix and $A^3=A$. Show that $rk(A)=tr(A^2)$ $A$ is complex matrix and $A^3=A$. Show that $rk(A)=tr(A^2)$
I'm more concerned with how I can derive the prove of this question. before I ask this question, I fail to prove that whit jordan canonical form
 A: If $A^3=A$ then we have


*

*$A^3-A = A(A^2-I)= A(A-I)(A+I)=0 \rightarrow$ the eigenvalues of $A$ can only be $0,1,-1$

*$rk(A) =rk(A^3) \leq rk(A^2) \leq rk(A) \rightarrow rk(A) = rk(A^2)$

*the eigenvalues of $A^2$ can only be $0,1$ and $tr(A^2)= rk(A^2)$ is the (algebraic) multiplicity of the eigenvalue 1. (think of the Jordan form of $A$ and $A^2$)

*$\rightarrow rk(A) = tr(A^2)$

A: Since $A^3-A=0$, the minimal polynomial of $A$ divides $(t-1)(t+1)t$. Hence the minimal polynomial can be factorized in distinct linear factors. This implies that all Jordan blocks of $A$ have size $1$, hence $A$ is diagonalizable. 
The rank of $A$ is the number of non-zero eigenvalues of $A$, which is equal to the number of non-zero eigenvalues of $A^2$ by diagonalizability, which is equal to $tr(A^2)$ as the only non-zero eigenvalue of $A^2$ is $1$.
A: Since $A^3 - A = 0$, it follows that $p(A) =0$, with $p(t) = t^3 - t = t(t+1)(t-1)$. 
It is well-known that the minimal polynomial $\varphi(t)$ of $A$, which is the unique monic polynomial of minimal degree that annihilates $A$, must divide every polynomial that annihilates $A$. Thus, if $p(A) = 0$ and $\varphi$ is the minimal polynomial of $A$, then there is a polynomial $\psi$ such that $p = \varphi \psi$.
In the example above, this leaves the following possibilities:
\begin{align}
\varphi(t) &= t \\
\varphi(t) &= t+1 \\
\varphi(t) &= t- 1 \\
\varphi(t) &= t(t+1) \\
\varphi(t) &= t(t-1) \\
\varphi(t) &= (t+1)(t-1) \\
\varphi(t) &= t(t+1)(t-1).
\end{align}
One can examine each case individually. For instance, if $\varphi(t) = t(t+1)(t-1)$, then the eigenvalues of $A$ are $\lambda_1 = 1$ with multiplicity $m_1 \ge 1$; $\lambda_2 = -1$ with multiplicity $m_2 \ge 1$; and $\lambda_3 = 1$ with multiplicity $m_3 \ge 1$. In this case, $\text{rank}(A) = m_1 + m_2$ and since the eigenvalues of $A^2$ are $\lambda_1$, with multiplicity $m_1+m_2$, and $\lambda_3$, with multiplicity $m_3$, it follows that $\text{tr}(A^2) = m_1 + m_2$ (see observations below).

Observation 1. If $\lambda$ is an eigenvalue of $A$ with eigenvector $v$, then $A^nv=\lambda^n v$ for every positive integer $n.$ 
Observation 2. If $A$ is an $n$-by-$n$ matrix with eigenvalues $\lambda_1,\dots,\lambda_n$ (multiplicities included), then $\text{tr}(A) = \sum_{i=1}^n \lambda_1$.

