Solution (source code)

= Solution

Use an <inner product> linear in its first argument. The <adjoint operator> $\alpha^*$ is the unique <linear operator> such that
$$
\langle\alpha v,w\rangle=\langle v,\alpha^*w\rangle\quad\text{for all }v,w\in V.
$$
In a finite-dimensional <inner product space>, existence follows by choosing an <orthonormal basis>: the <matrix> of the adjoint is the conjugate transpose of the matrix of $\alpha$. Uniqueness follows from nondegeneracy of the <inner product>.

If $\alpha(W)\subseteq W$, then for $w\in W$ and $v\in W^\perp$,
$$
\langle w,\alpha^*v\rangle=\langle\alpha w,v\rangle=0.
$$
Thus $\alpha^*v\in W^\perp$. Conversely, if $\alpha^*(W^\perp)\subseteq W^\perp$, the same equality gives $\langle\alpha w,v\rangle=0$ for every $v\in W^\perp$, so $\alpha w\in(W^\perp)^\perp=W$. This proves the <adjoint criterion for an invariant orthogonal complement>.

The equality $(W^\perp)^\perp=W$ uses the finite-dimensional setting appropriate here. In a general <Hilbert space> it holds for closed subspaces, and an adjoint is assured for bounded operators. Without closedness the converse only implies invariance of the closure. For example in $\ell^2$, take $W$ to be the finite-support sequences and $\alpha v=\langle v,e_1\rangle(2^{-j})_{j\geq1}$. Then $W^\perp=\{0\}$ is automatically adjoint-invariant, but $\alpha e_1\notin W$. Thus the finite-dimensional or closed-subspace hypothesis cannot be omitted from an infinite-dimensional reading.