If i have two orthonormal sets $\{e_n\}$ and $\{f_n\}$ in a hilbert space H, we can have the following operator in $B(H)$ such that \begin{equation*} Tx = \sum_{n=1}^{\infty} \alpha_n (x,e_n)f_n. \end{equation*} if $\alpha_n \to 0$ we have that $T$ is compact with dense non-closed image in $H$. So, i would like to know why do we need $H$ to be separable to have the following result
If $H$ is separable then there exists a compact operator on $H$ whose image is dense in $H$ but not equal to $H$.
In general, can we have a compact operator with dense image on a non-separable hilbert space? It seems to me that the operator $T$ defined above is an affirmative answer to ths question or where does the condition of being separable comes to play.
Any help would be appreciated and thank you in advance.