# Is this an iff condition in idempotent and involutory matrices

I know that the possible eigenvalues of an idempotent or involutory matrix are $0$, $1$ and $-1$, $1$ respectively.

My question is: can I extend this condition as both necessary and sufficient condition?

That is, can I say that if a matrix has only $0$ or $1$ ($-1$ and $1$) as its eigenvalues then the matrix is idempotent (involutory)?

If not please supply a counter example.

• The example by lisyarus is good; but you might have found the answer yourself by thinking to the fact that if the conditions are also sufficient, then a matrix having only $1$ as eigenvalue should be both idempotent and involutory, that is, the identity. Oct 16, 2017 at 12:38

Another necessary condition has to be stated that a matrix has a basis of eigenvectors, which is equivalent to saying it is diagonalizable. Without it, a matrix such as

$$A = \begin{pmatrix}1 & 1 \\ 0 & 1\end{pmatrix}$$

provides a counterexample: it's only eigenvalue is $1$, but it is neither involutary nor idempotent:

$$A^2 = \begin{pmatrix}1 & 2 \\ 0 & 1\end{pmatrix}$$

If, however, a matrix is diagonalizable, and all eigenvalues are $0$ and $1$, then in eivenvector basis it looks like

$$\begin{pmatrix} 1 & 0 & 0 & \dots & 0 \\ 0 & 0 & 0 & \dots & 0 \\ 0 & 0 & 1 & \dots & 0 \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \dots & 0 \end{pmatrix}$$

with only $1$s and $0$s on the diagonal, so it is clearly idempotent.

A similar argument holds for $\lambda \in \{-1,1\}$ and involutary matrices.