Suppose that $A$ is a diagonalizable $n \times n$ matrix such that the characteristic polynomial of $A$ is $p(λ)=λ^k(1−λ)^{n−k}$, where $k$ is a positive integer such that $0≤k≤n$.
I want to prove $A^2=A$. I know that for this, I'll need to prove that for any eigenvector $v$, $A^2 v=Av$. I tried setting up my proof like this:
Since $A$ is diagonalizable, there exists an invertible matrix $P$ such that $A=P^{-1}DP$, where $D$ has all the eigenvalues of $A$ on its diagonal. But since every eigenvalue is either $0$ or $1$, $D= \lambda I$. From there, we get: $$A = P^{-1}DP = P^{-1}(\lambda I_n)P = (\lambda I_n)(P^{-1}P) = \lambda I_n$$ $$ \implies A \times A = (\lambda I_n) \times (\lambda I_n) = \lambda ^2$$
All I've succeeded in doing here is showing $A^2 = \lambda ^2$. How can I show also that $A^2 = A$? Any guidance is greatly appreciated!
Since $A$ is a diagonalizable $n \times n$ matrix and has only eigenvalues $0$ and $1$ it Jordan matrix is like: $$J =\pmatrix{O_k&0\\0&I_{n-k}}\implies J^2 = J$$ where $O_k$ is $k\times k$ zero matrix and $I_{n-k}$ is $n-k\times n-k$ identity matrix. Thus your matrix has the same property.