Solution (source code)

= Solution

If $w\perp X$, then $\langle w,(I-U)g\rangle=0$ for all $g$. The adjoint identity gives $(I-U^*)w=0$, so $U^*w=w$. Multiplying by $U$ gives
$$
\boxed{Uw=w.}
$$
Since $X\subseteq V=\overline X$, $w\perp V$ implies $w\perp X$ and yields the same result. Conversely a fixed vector is perpendicular to $X$ by this calculation, identifying $V^\perp$ as the fixed subspace.