How to prove that $\sum_{n=1}^{\infty} | \phi_n \rangle \langle \phi_n | = \hat {I}$? Imagine discrete orthonormal basis made of infinite set of kets $|\phi_1\rangle , ..., |\phi_n\rangle,...$
Completeness or closure of the basis is given by:
$\sum_{n=1}^{\infty} | \phi_n \rangle \langle \phi_n | = \hat {I}$
(From Zetilli's Quantum mechanics book)
So what I did manage is that the eigenvalues of the operator $|\phi_m\rangle\langle\phi_m|$ are all zeros except one which is the square of norm of $|\phi_m\rangle$. That means the matrix can be diagonalized but I don't really understand how you diagonalize matrices like this. Since the norm is 1, all entries should be zero except the $(n,n)$ one?
Also doesn't diagonalizing a matrix change it? I'm a bit confused, please guide me.
 A: You can see that an operator of this type behaves as the identity in $\Bbb R^3$ with a basis $\{|i\rangle\}$:
$$\left(\sum_{i=1}^3|i\rangle\langle i|\right)|v\rangle=\sum_{i=1}^3|i\rangle\left(\langle i|v\rangle\right)=\sum_{i=1}^3|i\rangle v_i=\sum_{i=1}^3 v_i|i\rangle=|v\rangle \tag{1},$$
the generalisation to infinite dimensions means replacing the finite sum with an infinite one. In each term $\langle i|v\rangle$ gives the $i$th component of the vector $|v\rangle$. Going even further we can make a similar definition that occurs frequently in quantum mechanics:
$$\int dx\text{ }|x\rangle\langle x|\psi\rangle=\int dx\text{ }\psi(x)|x\rangle=|\psi\rangle. \tag{2}$$
In which $|x\rangle$ are the eigenstates of the position operator and $\psi(x)$ is the associated wavefunction of $|\psi\rangle$, therefore: $$\sum_{i=1}^3|i\rangle\langle i|=\Bbb I\quad \text{and}\quad \int dx\text{ }|x\rangle\langle x|=\Bbb I \tag{3},$$ in which $\Bbb I$ is the identity operator on the respective vector spaces.
