Let H be a real algebraic group acting equivariantly with finitely many orbits on a real algebraic manifold X and a real algebraic bundle $${\mathcal {E}}$$ on X. Let $$\mathfrak {h}$$ be the Lie algebra of H. Let $$\mathcal {S}(X,{\mathcal {E}})$$ be the space of Schwartz sections of $${\mathcal {E}}$$ . We prove that $$\mathfrak {h}\mathcal {S}(X,{\mathcal {E}})$$ is a closed subspace of $$\mathcal {S}(X,{\mathcal {E}})$$ of finite codimension. We give an application of this result in the case when H is a real spherical subgroup of a real reductive group G. We deduce an equivalence of two old conjectures due to Casselman: the automatic continuity and the comparison conjecture for zero homology. Namely, let $$\pi $$ be a Casselman–Wallach representation of G and V be the corresponding Harish–Chandra module. Then the natural morphism of coinvariants $$V_{\mathfrak {h}}\rightarrow \pi _{\mathfrak {h}}$$ is an isomorphism if and only if any linear $$\mathfrak {h}$$ -invariant functional on V is continuous in the topology induced from $$\pi $$ . The latter statement is known to hold in two important special cases: if H includes a symmetric subgroup, and if H includes the nilradical of a minimal parabolic subgroup of G.