Example of a non-injective bounded linear operator whose range is not closed but dense.

What are some concrete examples of non-injective bounded linear operators defined on a Hilbert space whose kernels are infinite dimensional and whose ranges are not closed but dense?

Any help will be warmly appreciated.

Thanks for your time.


Fix a separable Hilbert space with orthonormal basis $\{e_n\}$.

To get an infinite-dimensional kernel, we split the basis in $\{e_{2n}\}$ and $\{e_{2n-1}\}$. Then we make $T$ act only on the "even", guaranteeing that $e_{2n-1}\in\ker T$ for all $n$.

If we were to define $Te_{2n}=e_n$, then $T$ would be a co-isometry, and it would be surjective. So we can define $$ Te_{2n}=\tfrac1n\,e_n. $$ Then the range of $T$ contains all $e_n$, so it is certainly dense. But it cannot be everything, since $T$ is compact. Or, explicitly, you can check that $$ x=\sum_n\tfrac1n\,e_n $$ is not in the range of $T$.

In the end, you can take $T$ as the linear operator induced by $$ Te_n=\begin{cases} \tfrac2n\,e_{n/2},&\ n\ \text{ even }\\[0.3cm] 0,&\ n\ \text{ odd} \end{cases} $$ The coefficients $2/n$ can be replaced by any sequence $\{\alpha_n\}$ of complex such that $\apha_n\to0$, and the example works the same.