Solution (source code)

= Solution

For a bounded <linear operator> $A:X\to Y$ between <Hilbert spaces>, let $N=\ker A$ and $R=\operatorname{ran}A$. The <Moore–Penrose inverse of an operator> is defined on
$$
\mathcal D(A^\dagger)=R\oplus R^\perp.
$$
For $y=Ax+z$, with $z\in R^\perp$, define
$$
\boxed{A^\dagger y=P_{N^\perp}x.}
$$
This is independent of the chosen preimage $x$, since two preimages differ by a vector in $N$. Equivalently, it is the inverse of the restriction of $A$ to $N^\perp$, applied to the component of the data in $R$, and is zero on $R^\perp$.

The generalized solution $x^\dagger=A^\dagger y$ is the unique minimum-norm <least-squares solution>. Its residual is orthogonal to the range, giving the <operator normal equation>
$$
\boxed{A^*Ax^\dagger=A^*y,\qquad x^\dagger\in(\ker A)^\perp.}
$$
The <operator normal equation> alone leaves an arbitrary null-space component; the second condition fixes the minimum-norm representative. The identities $A^\dagger A=P_{N^\perp}$ and $AA^\dagger=P_{\overline R}$ hold on their appropriate domains.

For an infinite-rank <compact operator>, the range need not be closed, and $A^\dagger$ is generally unbounded. Data outside $R\oplus R^\perp$ need not have any <least-squares solution> at all, even though they can be approximated by range elements. This domain qualification is crucial in part (d); the Moore–Penrose notation does not turn an ill-posed inverse into an everywhere-defined bounded operator.