An irreducible subrepresentation detected by a compact operator
Let $G$ be a group equipped with a topology, $\mathcal H$ a complex Hilbert space, and $\rho:G\to\operatorname{GL}(\mathcal H)$ a unitary representation whose orbit maps $g\mapsto\rho(g)v$ are continuous. Let $W\subseteq\mathcal H$ be a closed invariant subspace, and let $A$ be a nonzero compact complex-linear operator. Suppose $$AP_W=A,$$ and, for every closed invariant subspace $Y\subseteq W$, $$AP_Y=P_YA,$$ where $P_Y$ denotes orthogonal projection. Then $W$ contains a nonzero closed invariant subspace with no proper nonzero closed invariant subspace.