Linear map, prove that $T^2 = T$ is equivalent to existence of certain matrix representation I'm trying to prove that if for a linear map $T$ from a finite vector $V$ space to itself we have $T^2 = T$ iff there exists a basis of $V$ such that the matrix representation $A$ of $T$ with regard to that basis looks like:
$$
\begin{pmatrix}
  I & 0 \\
  0 & 0
\end{pmatrix}
$$
Proving that the latter implies the former is easy, but I'm not sure about the other direction. I have tried the following:
Let $\lambda$ be an Eigenvalue of $A$ with corresponding eigenvector $v$, then we have $Av = \lambda v$ and $A^2v = A(Av) = A(\lambda v) = \lambda (Av) = \lambda^2 v$. And since $A^2 = A$ this means that $\lambda^2 = \lambda \implies \lambda \in \{0, 1\}$. That means that all the diagonal elements of $A$ must be zero or one, but how do I show that they are consecutive?
EDIT: Further attempts, is this correct?
Assume $A$ has dimension $n \times n$ and k eigenvalues are one, the rest zero. Then for a Jordan normal form $J$ of $A$, it must be true that $\operatorname{rank} J = k$ and thus $\dim \ker J = \dim \ker{A} = \dim E(0) = n - k$ and $\dim \ker{J -I} = \dim \ker{A - I} = \dim E(1) = k$. Thus the algebraic and geometric multiplicities of the eigenvalues match and $A$ is diagonalisable.
 A: You don't need eigenvalues and eigenvectors and Jordan forms.
Let $u_1,\dots,u_q$ be a basis of $\ker T$ and $w_1,\dots,w_p$ be a basis of $\operatorname{im} T$.
Then the matrix of $T$ with respect to the basis $w_1,\dots,w_p,u_1,\dots,u_q$ is of the desired form because $Tw_i = T^2 v_i = T v_i = w_i$.
A: You're definitely on the right track. Once you know that the eigenvalues are $0$ or $1$, you know you can write the matrix with respect to some basis in Jordan normal form so the diagonal elements are $0$ or $1$ (if you try to diagonalize the matrix and the $1$s and $0$s are in the wrong order, you can just swap the orders of your basis elements). So, the only thing left to show is that the matrix can be made diagonal.
For this, say you have a transformation that has ones and zeroes along the diagonal in Jordan normal form but isn't diagonal. Can it satisfy $T^2=T$?
A: Specifically the eigenspace for $\lambda=0$ is the kernel of $T$, and the eigenspace for $\lambda=1$ is the range.
Observe also that $x=Tx+(Tx-x)$ with $(Tx-x)\in\ker T$ and that $Tx=x$ if $x$ is in the range of $T$.
A: Any vector $v$ can be expressed as $(v-T(v))+T(v)$.
Note that $T(v-T(v))=T(v)-T^2(v)=0$ and so $v-T(v)$ is zero or an eigenvector for value $0$.
Whereas $T(T(v))=T^2(v)=T(v)$ and so $T(v)$ is zero or an eigenvector for value $1$.
Hence the eigenvectors span the space and the matrix has the form you require.
