Solution (source code)

= Solution

Put $M=\mathcal N(K)^\perp$ for a <bounded linear operator> between <Hilbert spaces>. Its restriction $K|_M:M\to\mathcal R(K)$ is bijective. Define the <Moore–Penrose inverse of an operator> by
$$
\boxed{\mathcal D(K^\dagger)=\mathcal R(K)\oplus\mathcal R(K)^\perp,\qquad K^\dagger f=(K|_M)^{-1}P_{\overline{\mathcal R(K)}}f.}
$$
The inverse vanishes on $\mathcal R(K)^\perp$. For each datum in this domain, $K^\dagger f$ is the <minimum-norm least-squares solution>; all <least-squares solutions> are $K^\dagger f+\mathcal N(K)$. On their natural domains,
$$
K^\dagger K=P_M,\qquad KK^\dagger=P_{\overline{\mathcal R(K)}}.
$$
The equivalent continuity condition is
$$
\boxed{K^\dagger\text{ is continuous in the ambient norms}\iff\mathcal R(K)\text{ is closed}.}
$$
If the range is closed, the inverse restriction is bounded by the <bounded inverse theorem>. Conversely, if $\|K^\dagger f\|\leq C\|f\|$ on its domain and $Ku_n$ converges, replace $u_n$ by $P_Mu_n$. The inequality makes these preimages a <Cauchy sequence>, whose limit maps to the limiting datum; the range is therefore closed. Boundedness here uses the data <norm>, not a graph <norm> that would conceal instability.