## Every idempotent matrix over a field is diagonalizable

Let $A$ be an $n \times n$ matrix over a field $F$. Show that if $A^2 = A$, then $A$ is similar to a diagonal matrix whose diagonal entries are either 0 or 1.

(Compare to this previous exercise.)

Short Proof that I Thought Of Seconds after Publishing the Long Proof:

The minimal polynomial of $A$ divides $x^2-x = x(x-1)$. By Corollary 25 in D&F, $A$ is diagonalizable. Moreover, the elementary divisors of $A$ are all either $x$ or $x-1$, so the diagonal entries of the Jordan canonical form of $A$ are either 0 or 1.

Long Proof that Missed the Point of the Whole Chapter but to which I am Too Attached to Delete Wholesale:

Let $A$ be such a matrix, and let $J$ be the Jordan canonical form of $A$; say $P^{-1}AP = J$. Now $J^2 = (P^{-1}AP)^2$ $= P^{-1}APP^{-1}AP$ $= P^{-1}A^2P$ $= P^{-1}AP = J$, so that $J$ is also idempotent. Note also that $J$ is upper triangular, with all entries above the first superdiagonal equal to 0. That is, if $J = [t_{i,j}]$, then $t_{i,j} = 0$ if $j \neq i$ or $j \neq i+i$ and $t_{i,j} \in \{0,1\}$ if $j = i+1$. (The diagonal entries of $J$ are unknown at this time.) Since $J^2 = J$, we have $\sum_k t_{i,k}t_{k,j} = t_{i,j}$ for each pair $(i,j)$.

Fix $i$. Now $t_{i,i} = \sum_k t_{i,k}t_{k,i}$ $= t_{i,i}t_{i,i} + \sum_{k \neq i} t_{i,k}t_{k,i}$ $= t_{i,i}t_{i,i}$. That is, $t_{i,i}^2 = t_{i,i}$, so that $t_{i,i}$ is a root of $x^2-x = x(x-1) = 0$. So $t_{i,i}$ (i.e. an arbitrary diagonal entry) is either 1 or 0.

Now fix $i$ and let $j = i+1$. Now $t_{i,j} = \sum_k t_{i,k}t_{k,i+1}$ $= t_{i,i}t_{i,i+1} + t_{i,i+1}t_{i+1,i+1} + \sum_{k \neq i,i+1} t_{i,k}t_{k,i+1}$ $= t_{i,i}t_{i,i+1} + t_{i,i+1}t_{i+1,i+1}$. Note that if $t_{i,i+1} = 1$, then we must have $t_{i,i} = t_{i+1,i+1}$, since these entries are in the same Jordan block of $J$. Now $1 = 2t_{i,i}$, and we have $1 = 0$, a contradiction. Thus \$latex $t_{i,i+1} = 0$ for all appropriate $i$. That is, $J$ is diagonal.