If for a nonzero eigenvector, then . Since , : every eigenvalue is zero or one. Let be the number of ones, counted with algebraic multiplicity. The trace is and the determinant is the product of these eigenvalues. Therefore
Every output is fixed by a second application:
The image of a linear map is thus the eigenspace for the eigenvalue one. To establish its dimension without assuming diagonalizability, decompose every input as
The first term lies in the image of a linear map and the second in its kernel. Their intersection is zero, because a vector in the image is fixed by whereas a vector in the kernel is killed by . Thus the space is their direct sum, and an adapted basis puts into the form , where . Comparing traces gives :
This is an idempotent linear map, and trace of an idempotent equals its rank. If , no nonzero output exists. The dimension in the question refers to the image subspace, including its zero vector.
By the spectral theorem, the Hermitian matrix has a complete orthonormal eigenbasis. If , idempotence gives , so every eigenvalue is zero or one. Since , at least one is zero. Therefore
The trace of an idempotent equals its rank; here Hermiticity further identifies as an orthogonal projection matrix.
A complex inner product is conjugate-linear in its first argument, linear in its second, conjugate symmetric and positive definite: and for nonzero . An orthonormal basis is a spanning linearly independent family with . The associated norm is .
For two distinct basis elements , their orthogonality and unit norms give . Hence their distance is ; if the same element is selected twice, it is zero.
Finally, for , the scalar quadratic form obeys , proving is real.