
 Let $f: ℝ^n → ℝ$ be a continuously differentiable function. State a sufficient condition for
$$
H_f=f^{1}(0) ⊂ ℝ^n
$$
to be a submanifold of $ℝ^n$.
 If $H_f ⊂ ℝ^n$ is a submanifold, describe its tangent space at a point $p ∈ H_f$. Prove that the tangent space of $H_f$ at $p$ is contained in a space defined by the gradient of the function $f$ at $p$. State a precise characterisation of the tangent space of $H_f$ at $p$ in terms of this gradient.
 Suppose that $f, g: ℝ^n → ℝ$ are continuously differentiable functions such that both $H_f=f^{1}(0)$ and $H_g=g^{1}(0)$ are submanifolds of $ℝ^n$, with $H_f$ and $H_g$ disjoint. Assume further that $p ∈ H_f$ and $q ∈ H_g$ are such that
$$
{\pq\} ⩽{\xy\} \text { for all } x ∈ H_f, y ∈ H_g,
$$
where $\⋅\$ denotes Euclidean length in $ℝ^n$. Prove that the vector $pq ∈ ℝ^n$ is orthogonal to the tangent space of $H_f$ at $p$, as well as to the tangent space of $H_g$ at $q$.
 Let $n=2$, and the functions $f, g$ be given by
$$
f\left(x_1, x_2\right)=x_1^2+x_2^21
$$
and
$$
g\left(x_1, x_2\right)=x_1\frac{1}{2} x_2^2+2
$$Show that $H_f, H_g$ are submanifolds of $ℝ^2$. Find the smallest possible distance between points $p, q$ with $p ∈ H_f$ and $q ∈ H_g$. Sketch graphs of $H_f, H_g ⊂ ℝ^2$, indicating where nearest pairs of points lie.

 $H_f⊂ℝ^n$ is a submanifold if for every $p∈H_f$, $∇{f}_p≠0$ [or $\operatorname{rank}∇{f}_p=1$, or $\operatorname{rank}D{f}_p=1$].
 A tangent vector to $H_f$ at $p$ is $γ'(0)∈ℝ^n$ where $γ:(ϵ,ϵ)→H_f$ is a $C^1$function with $γ(0)=p$. The space of all tangent vectors is the tangent space $T_pH_f$ we have $T_pH_f=\ker(∇{f}_p)⊂ℝ^n$
Claim $T_pH_f⊂\ker(∇f_p)$
Proof As $γ(t)⊂H_f$, we have $f(γ(t))=0$, by Chain Rule, $0=D(f∘γ)(t)=Df(γ(t))γ'(t)$
So for $t=0,γ'(0)⊂\ker(∇{f}_p)$  As before, let $γ:(ϵ,ϵ)→H_f$ be a path, with $γ(0)=p$. Then the function $\left\γ(t)q\right\^2$ has extremum at $t=0$, by the stated inequality. So\[0=\frac{d}{dt}\left\γ(t)q\right^2\Big_{t=0}=2(γ(0)q)⋅γ'(0)=2(pq)⋅γ'(0)\]Hence $pq$ is orthogonal to every tangent vector at $p$ and thus to the whole tangent space. An identical argument show it is also orthogonal to $T_qH_g$.
 $∇H_{(x_1,x_2)}=(2x_1,2x_2)≠(0,0)$ unless $(x_1,x_2)=(0,0)$, not in $H_f$. So indeed $H_f⊂ℝ^2$ is a submanifold. $∇{g}_{(x_1,x_2)}=(1,x_2)≠(0,0)$, so indeed $H_g∈ℝ^2$ is also a submanifold.
To apply (b), we need to check $H_f∩H_g=∅$. But\[\left.\begin{aligned}x_1^2+x_2^2&=1\\x_1\frac{x_2^2}2&=2\end{aligned}\right\}⇒\frac{x_2^4}4x_2^2+3=0\text{ no real solution.}\]so $H_f∩H_g=∅$