TITLE: Invariant subspace in infinite dimensions
QUESTION [5 upvotes]: Let $A(t)$ be a family of skew self-adjoint operator defined on some Hilbert space $H$ with common domain $D(A).$
The dependence on $t$ is in the strongly continuous sense, i.e. for all $x \in D(A)$ the map $t \mapsto A(t)x$ is continuous.
Consider the initial value problem 
$$\varphi'(t)=A(t)\varphi(t)$$
with $\varphi(0)=\varphi_0.$
Assume that there is a dense subspace $X$ in $H$ that is contained in the domain of $A(t)$ for all $t$ and $A(t)X \subset X.$
I ask:
Let $\varphi_0 \in X$. Does this imply that $\varphi(t) \in X$ for all $t>0?$
This sounds very natural but I do not have any tools/ideas to show this at the moment.

REPLY [5 votes]: In general, the answer is "no" even in the autonomous case, i.e. in the case where $A := A(t)$ does not depend on $t$.
First note that if $A$ generates a $C_0$-semigroup on $H$, if $X$ is a dense subspace of $H$ and if $X$ is invariant under this $C_0$-semigroup, then $X$ is even dense in $D(A)$ (which we endow with the graph norm); see for instance [Engel and Nagel: One-Parameter Semigroups for Linear Evolution Equations, Springer (2000), Proposition II.1.7].
Now let $H = L^2((0,1))$ and let $B$ be the Laplace operator on $H$ with periodic boundary conditions, i.e.
\begin{align*}
  D(B) & = \{u \in H^2((0,1)): \, u(0) = u(1) \text{ and } u'(0) = u'(1)\}, \\
  Bu & = u''.
\end{align*}
Note that $B$ is self-adjoint. Set $A := iB$ and let $X$ be the space of test functions on $(0,1)$. Then $AX \subseteq X$, but $X$ is not dense in $D(A)$ with respect to the graph norm; thus, $X$ is not invariant under the semigroup $(e^{tA})_{t \ge 0}$ generated by $A$.