Given an observable $Â$, any state can always be written as a linear combination of its eigenvectors, in other words its eigenvectors form a basis of the Hilbert space of all possible states.
I know that in finite dimension, this comes from the spectral theorem (for hermitian operators). But for infinite dimension, this theorem only applies on compact operators.
But, for example, the Hamiltonian is not always compact (for the particle in a box or the quantum harmonic oscillator, the energy can be arbitrarily large). So how do we know that its eigenvectors always form a basis ?