For a linear bounded operator $T$ on a Hilbert space $H$ that admits an invariant subspace $V$ (meaning: $TV\subset V$), the fact that $T\overline{V}\subset\overline{V}$, where $\overline{V}$ denotes the closure of $V$ in $H$, is a direct consequence of the continuity of $T$.
Now I'm wondering up to which extent this can be generalised to unbounded $T$.
Explicitly, I'm asking whether it is true in general that
- if $T$ is a closed, densely defined, unbounded, linear operator $T$ on $H$, with domain $\mathrm{dom}(T)$,
- and if $V\subset\mathrm{dom}(T)\subset H$ is a subspace such that $TV\subset V$,
then also $$ T ( \mathrm{dom}(T) \cap \overline{V}) \subset \overline{V}$$
or if instead there are counterexamples to that.
It should be false. Let $H=\ell^2(\Bbb N)$ (with Hilbert basis $e_n$) and define an operator $A$ via
$$A(e_n)=\begin{cases}2^n\,e_n& n>0 \\ 0 & n=0 \end{cases}$$
the domain of this operator is all elements of $\ell^2(\Bbb N)$ that are eventually majorised by $c\,2^{-n}$ for some $c$. Note that $A$ is a closed operator, but its not the operator we are interested in for a counter-example. We will modify it a bit.
Let $x$ be any sequence not majorised by $c\,2^{-n}$ and not having an $e_0$ component, for example $x=\sum_{n>0} \frac1{n^2} \,e_n$. Now let $D(T)= D(A)+\Bbb C\cdot x$ and let $T(x)=e_0$, $T\lvert_{D(A)}=A$.
As the space $V$ we will take the finite linear combinations of the basis vectors $e_n$ for $n>0$. Note that $\overline{V}$ is equal to the orthogonal complement of $e_0$. Next note that $T(V)\subseteq V$, while $x\in \overline{V}$ and $T(x)=e_0\notin\overline V$. That gives you $T(\overline V\cap D(T))\not\subseteq \overline V$. Hence the operator $T$ does not satisfy the conclusion you are looking for, lets see if it satisfies the condition of being closed.
Let $y_n+\lambda_n x$ be a convergent sequence in $D(T)$ so that $T(y_n+\lambda_n x)$ also converges (here $y_n\in D(A)$). What we need to check is that the limit of $y_n+\lambda_n x$ is in $D(T)$ and that $\lim_n T(y_n+\lambda_n x) = T(\lim_n y_n + \lambda_n x)$. We split into 3 cases, first if $\lambda_n\to0$, second if $\lambda_n$ converges to something non-zero, and third when $\lambda_n$ does not converge.
The first and second case both reduce to the closedness of $A$, while the third case is impossible. This is so, since if $\lambda_n$ converges then convergence of $y_n+\lambda_n x$ is equivalent to convergence of $y_n$ and convergence of $T(y_n+\lambda_n x) = A(y_n)+\lambda_n e_0$ is equivalence to convergence of $A(y_n)$. While if $\lambda_n$ does not converge then (while $y_n+\lambda_n x$ certainly can converge) $T(y_n+\lambda_n x)= A(y_n)+\lambda_n e_0$ has no chance of convering since $A(y_n)\perp e_0$.