Solution (source code)

= Solution

For any <idempotent linear map> $\tau$, each vector decomposes as
$$
u=(u-\tau u)+\tau u,\qquad \tau(u-\tau u)=0,\qquad\tau u\in\operatorname{im}\tau.
$$
If $w\in\ker\tau\cap\operatorname{im}\tau$, write $w=\tau v$; then $0=\tau w=\tau^2v=\tau v=w$. Thus the <kernel of a linear map> and <image of a linear map> give a <direct sum>.

For the self-adjoint map in the question, $k\in\ker\tau$ and $w=\tau v$ satisfy $\langle k,w\rangle=\langle k,\tau v\rangle=\langle\tau k,v\rangle=0$. Hence the direct sum is an <orthogonal decomposition>:
$$
\boxed{U=\ker\tau\mathbin\oplus^{\perp}\operatorname{im}\tau.}
$$