Solution (source code)

= Solution

Take any positive definite <inner product> $\langle\ ,\ \rangle_0$ on $U$ and define the <inner product adapted to an idempotent linear map>
$$
\boxed{\langle u,v\rangle_{\phi}=\langle\phi u,\phi v\rangle_0+\langle(I-\phi)u,(I-\phi)v\rangle_0.}
$$
It is symmetric and bilinear. If its quadratic value at $u$ is zero, positive definiteness of the original <inner product> forces both $\phi u=0$ and $(I-\phi)u=0$, hence $u=0$. Thus it is positive definite.

Using $\phi^2=\phi$ and $(I-\phi)\phi=0$ gives
$$
\langle\phi u,v\rangle_{\phi}=\langle\phi u,\phi v\rangle_0=\langle u,\phi v\rangle_{\phi}.
$$
The map is therefore <self-adjoint> for this new <inner product> and remains idempotent, so \b[it is an orthogonal projection for the explicitly constructed inner product]. Geometrically the construction makes its complementary <kernel> and <image> orthogonal.