existence of closest point on boundary of domain to a point outside domain Let $D \subset \mathbb{R}^n$ (or $\mathbb{C}^n$) be a domain with $C^2$ boundary.  Why is there a neighborhood U of $\partial D$ such that for every $z \in U$, there is a unique point of $\partial D$ that is closest to $z$?
 A: If you draw a line from a point outside the domain to a closest point on $\partial\Omega$, the line will meet $\partial\Omega$ orthogonally.
If it didn't, you could slightly turn the line to find a boundary point closer to the outside point.
In particular, if there are two or more closest points, then the corresponding normals will intersect at the outside point.
Therefore it is enough to prove the following:

For any $x\in\partial\Omega$, let $N_x$ be the line through $x$ normal to $\partial\Omega$.
  Any point on $\partial\Omega$ has a neighborhood where the the normals $N_x$ of boundary points in that neighborhood are disjoint.

Let's prove this, then.
Let $\nu_x$ be the unit normal at $x\in\partial\Omega$, so that $N_x=x+\nu_x\mathbb R$.
Take a point $x_0\in\partial\Omega$.
Assume for simplicity that $\nu_{x_0}=(0,\dots,0,1)$.
The boundary is $C^2$, so it can be locally written as a graph:
There is an open set $U\in\mathbb R^{n-1}$ and a $C^2$ function $u\colon U\to\mathbb R$ so that $\{(y,u(y));y\in U\}=V\cap\partial\Omega$ for some neighborhood $V$ of $x_0$.
Let us denote $\psi(y)=(y,u(y))\in\mathbb R\times\mathbb R^{n-1}=\mathbb R^n$.
We may assume $\psi(0)=x_0$.

Alternatively, you can use a boundary defining function or a manifold structure of $\partial\Omega$ and the proof will be similar; it depends on how you define a boundary being $C^2$.
Define $f\colon U\times\mathbb R\to\mathbb R^n$ so that $f(z,t)=\psi(z)+t\nu_{\psi(z)}$.
Notice that the normal $N_{\psi(z)}$ is the image $f(\{z\}\times\mathbb R)$.
Therefore injectivity of $f$ is in fact equivalent with disjointness of the normals.
We get the local disjointness we need by showing local injectivity.
Let us the calculate the differential of $f$ at $0$.
We have
$$
D\psi(0)
=
\begin{pmatrix}
I_{n-1}&\nabla u(0)^T
\end{pmatrix},
$$
so
$$
Df(0,0)
=
\begin{pmatrix}
I_{n-1}&\nabla u(0)^T\\
0&1
\end{pmatrix}.
$$
Here I used the block structure corresponding to $\mathbb R\times\mathbb R^{n-1}=\mathbb R^n$.
The derivative of $\nu_{\psi(z)}$ does not appear since it gets multiplied by $t=0$.
The derivative is relevant, though.
Since the boundary is $C^2$, the normal direction depends $C^1$-smoothly on the point; you always lose one derivative.
Therefore $f$ is a $C^1$ function.
Now $f$ is $C^1$ and its differential is bijective.
By the inverse function theorem $f$ is locally bijective.
This concludes the proof.
Two remarks:


*

*The function $f$ gives something called "boundary normal coordinates".
The proof that boundary normal coordinates really coordinates near a given boundary point is essentially the one I gave above.

*It was not important that $\partial\Omega$ was a boundary of a domain.
Any $C^2$ hypersurface would have worked just as well.
(Also lower dimensional surfaces or curves would work, but then the proof needs to be adjusted a little.)
A: This follows from the tubular neighbourhood theorem. Pick $U$ as a tubular neighbourhood of $\partial D$. Let $z \in U$, and let $p \in \partial D$ be a point which minimizes distance from $z$. It is easy to see that the segment joining $p$ and $z$ must be normal to $\partial D$, and thus the point $z$ corresponds to $(p,v)$, where $v=z-p$, on the normal bundle. If there were more than one point which minimize distance, it would follow that there was $(p',v')$, with $p' \neq p$, such that $z$ corresponds also to $(p',v')$, an absurd with the tubular neighbourhood being bijectively corresponding to a neighbourhood of the $0$-section of the normal bundle.
