$\textbf{Definition:}$ Let $P$ be a matrix. We say is diagonalizable matrix iff
$\exists$ an invertible matrix $A$: $\exists$ a diagonal matrix $D$: $A^{-1}PA=D$.
I recently asked a question as to why the following proposition holds true:
$\textbf{Proposition:}$ Let $P$ be a $n\times n$ matrix.
If $P^2=P$, then $P$ is diagonalizable.
$\textbf{Question:}$ Let $v\in \mathbb{R}^n$. I am trying to better understand this proposition (see below):
$\textbf{Why}$ do we rewrite $v=v-Pv+Pv$? It strikes me as an obvious statement which holds true, but it is always rewritten for a particular reason. And $\textbf{what}$ is the general idea as to why eigenvalues are roots of the following expression, $Q(P):=P^2-P$? I thought the eigenvalues might have been associated with the Cayley-Hamilton theorem the way things are set up, but I could be wrong.
Roots for $Q(P)$,
$P^2-P=0\implies P(P-1)=0\implies 1 \text{ and } 0 \text{ are Eigenvalues}$.
I'll try to give some more details as an answer.
From the relation $\,P^2=P$, you obtain that $\;P(I-P)=0$, so $\operatorname{Im}(I-P)\subset \ker P$, and conversely, you can check $\ker P\subset \operatorname{Im}(I-P)$. Thus $\ker P=\operatorname{Im}(I-P)$, and if $P\ne I$, this image is non-zero so you have the eigenspace for the eigenvalue $0$.
Now $P^2-P$ corresponds to the polynomial $X^2-X$, which is the minimal polynomial of $P$ if $P\ne 0,I$. As the eigenvalues are the roots of the minimal polynomial, you know there are no other eigenvalue than $0$ and $1$.
Further, $\operatorname{Im}(P)=\ker(I-P)$ is clearly the eigenspace for the eigenvalue $1$.