Let $A$ be a self-adjoint(unbounded) operator with domain $\mathcal{D}\subset \mathcal{H}$ and $B$ a bounded operator $\mathcal{H}\to\mathcal{H}$. Assume $B(\mathcal{D})\subset \mathcal{D}$ and $AB=BA$ on $\mathcal{D}$. Does if follow that the $\ker B\subset \mathcal{D}$?
I encountered this problem when I was trying to show that the Lefschetz decomposition of $L^2(\Lambda^nT_{\mathbb{C}}^*M)$ also decomposes $\mathcal{D}=$ the domain of $\Delta$, a self-adjoint extension of the Hodge-Laplacian on a Kaehler manifold $M$ of complex dimension $n$ with the property that $[\Delta, L]=0$.
(for simplicity, I will assume $H$ separable)
No. Fix an orthonormal basis $\{e_j\}$ and let be given by $Ae_j=j\,e_j$. Then $A$ is selfadjoint and $\mathcal D=\operatorname{span}\{e_j:\ j\}$. Let $B$ be the operator induced by $Be_j=\delta_{1j}e_1$. Then $B\mathcal D\subset \mathcal D$, $AB=BA=B$, and $$ \ker B=\left\{\sum_{k=2}^\infty a_ke_k:\ a\in\ell^2(\mathbb N)\right\}\not\subset\mathcal D $$ (since $\mathcal D$ only contains the elements corresponding to sequences with finitely many nonzero elements).