# Prove that idempotency is a necessary and sufficient condition for a densiy matrix to be N-representable

As I understand, a necessary and sufficient condition for a density matrix $$P$$ to be represented by a wavefunction $$|\Psi\rangle$$ is that it is idempotent, i.e. $$P^2=P$$. It is easy to see that if $$P=|\Psi\rangle\langle \Psi|$$ then $$P$$ is idempotent: $$P^2=|\Psi\rangle\langle \Psi|\Psi\rangle\langle \Psi|=|\Psi\rangle\langle \Psi|$$ since by normalization $$\langle \Psi|\Psi\rangle=1$$. However, I have had trouble with the other direction - how can I show that if $$P^2=P$$ then $$P=|\Psi\rangle\langle\Psi|$$ for some $$\Psi$$?

I have been able to demonstrate that if $$P^2=P$$ then $$P=\sum_{j} |\Psi_j\rangle\langle\Psi_j|$$ where the sum over $$j$$ has no more terms than the dimension of the density matrix $$P$$. My argument was analogous to the one found here. I suspect that I'm almost there - I think it's just a change of basis that I haven't seen yet. How can I complete this proof?

A density matrix $$D$$ is positive semidefinite, hermitian, and has trace one. Because of hermiticity we may assume that it is diagonal. Let's denote the eigenvalues with $$\lambda_i$$ . Because it is positive semidefinite, we have $$0 \leq \lambda_i \leq 1$$.
The matrix $$D^2$$ has eigenvalues $$\lambda_i^2$$. Since it is idempotent ($$D = D^2$$) and has trace one, we may write: $$\sum_i \lambda_i = \sum_i \lambda_i^2 = 1$$ The only possibility for this to be true is, if there is one and only one $$j$$ for which $$\lambda_j = 1$$.
So $$D$$ has one $$1$$ in the diagonal at the $$j$$-th column and all other values in the matrix are zero. You can easily represent this matrix with: $$e_j e_j^T$$. ($$e_j$$ being the $$j$$-th unit vector.)
If you transform back to you original nondiagonal form, you obtain your $$\Psi$$.