Solution (source code)

= Solution

If $Ax=b$ and $h\in\ker A$, symmetry gives $b\cdot h=(Ax)\cdot h=x\cdot Ah=0$, proving necessity. Conversely, expand $b$ in the <orthonormal basis> from part (i), with $Ay_i=\lambda_i y_i$. The zero-<eigenvalue> vectors span the <kernel of a linear map>. If $b$ is <orthogonal> to that kernel, then $b\cdot y_i=0$ whenever $\lambda_i=0$, so the remaining coordinates can be solved independently.

For a nonzero <eigenvalue> and any associated nonzero <eigenvector> $v$, symmetry gives $b\cdot v=\lambda x\cdot v$. Thus \b[the component vector along $v$ is]
$$
\boxed{\operatorname{proj}_v x=\frac{b\cdot v}{\lambda\|v\|^2}v.}
$$
For the unit vectors $y_i$, this coefficient is $(b\cdot y_i)/\lambda_i$. Consequently \b[the general solution is]
$$
\boxed{x=\sum_{\lambda_i\ne0}\frac{b\cdot y_i}{\lambda_i}y_i
+\sum_{\lambda_i=0}c_i y_i,\qquad c_i\in\mathbb R.}
$$
This proves sufficiency as well as the claimed kernel criterion. If the compatibility condition fails, there is no solution; if it holds, the freedom is exactly an arbitrary kernel vector.