= Solution
A sufficient regular-level condition is $\nabla f(x)\ne0$ at every point with $f(x)=0$. The <implicit function theorem> then makes the zero level a two-dimensional <continuously differentiable> <submanifold>. Its <tangent space> is
$$
\boxed{T_xS_f=\ker Df_x=\{v:\nabla f(x)\cdot v=0\}.}
$$
For a minimizing pair $(a,b)$ and any <tangent vector> $v\in T_aS_f$, take a <differentiable> <surface> <curve> $x(s)$ with $x(0)=a$, $x'(0)=v$. The function $\|x(s)-b\|^2$ has a minimum at zero, so its <derivative> $2(a-b)\cdot v$ vanishes. Varying the other point similarly proves <orthogonality> to $T_bS_g$.
For the particular <surfaces>, minimize the distance from the origin to the second <surface> first. Put $u=x^2$, $v=y^2$, so $u,v\ge0$ and $z=(u-v-6)/2$. Then
$$
\|(x,y,z)\|^2=u+v+\frac{(u-v-6)^2}{4}.
$$
Let $s=u-v$. Since $u+v\ge|s|$, this is at least $|s|+(s-6)^2/4$, with equality when one of $u,v$ is zero. For $s\ge0$, this quadratic has its minimum at $s=4$, with value 5. For $s\le0$, it decreases up to zero and has minimum9 on that half-line. The <global minimum> is therefore5, attained at
$$
b=(2,0,-1)\quad\text{or}\quad(-2,0,-1).
$$
All points of this <surface> lie outside the <unit sphere>. For any such $b$, the distance to the sphere is $\|b\|-1$, attained at $a=b/\|b\|$ by the <triangle inequality>. Consequently
$$
\boxed{\operatorname{dist}(S_f,S_g)=\sqrt5-1,\qquad a=b/\sqrt5.}
$$
This is a global minimization, not merely a stationary-point calculation.
\Image[/past-exam-of-the-options-ii-course-of-the-university-of-oxford/2005-nearest-surfaces.png]
{title=Nearest points on the two surfaces in the section $y=0$}
Back to article page