An Exercise in Peter Petersen My question is an exercise in Peter Petersen "Riemannian Geometry" Chapter 5 #10
Let $N \subset M$ be a submanifold of Riemannian manifold $(M,g)$.
(a) The distance from N to $x \in M$ is defined as $d(x,N) = \inf\{ d(x,y)\  |\ p \in N\}$.
    A unit speed curve $\sigma : [a,b] \to M$ with $\sigma(a) \in N,\sigma(a)$ and $l(\sigma) = d(x,N)$ is called a segment from $x$ to $N$. Show that $\sigma$ is also a segment from $N$ to any $\sigma(t),t<b$. Show that $\sigma'(a)$ is perpendicular to $N$.
(b) Show that if $N$ is a closed subspace of $M$ and $(M,g)$ is complete, then any point in $M$ can be joined to $N$ by segments.
(d) Show that $d(\dot \ ,N)$ is smooth on a neighborhood of $N$ and that the integral curves for its gradient are the geodesics that perpendicular to $N$.
Please give me a answer as complete as possible,. Thank you very much!
 A: a) Assume $\sigma_{[a,t]}$ is not a segment from $\sigma(t)$ to $N$ for some $a < t < b$. Then $d(\sigma(t),N) < l(\sigma_{[a,t]})$. Then there exists some point $q \in N$ such that $d(q,\sigma(t) < l(\sigma_{[a,t]})$. So 
$$l(\sigma) = d(\sigma(b),N) \leq d(\sigma(b),q) \leq d(q,\sigma(t)) + d(\sigma(t),\sigma(b)) < l(\sigma_{[a,t]}) + l(\sigma_{[t,b]}) = l(\sigma),$$ a contradiction. Assume $\sigma'$ is not perpendicular to $N$. Then there is a smooth curve $\alpha$ in $N$ having an angle strictly less than $\pi/2$ to $\sigma$. It follows from the first variation formula that $\sigma$ is not the shortest connection from $\sigma(t)$ to $\alpha$ for $t$ close to $a$.
b) Let $p \in M$ and $x_n$ be a sequence in $N$ such that $r := d(N,p) = \lim_{n \to \infty}d(x_n,p).$ Then $x_n \in \overline{B}_{r + 1}(p)$ for all $n \geq n_o$ and some $n_0$. Since closed balls are compact there exists some convergent subsequence, which will be called $x_n$ to. So let $x_n \to x$. Choose shortest arc length geodesics $\gamma_n$ from $p$ to $x_n$. Since $M$ is complete there exists a uniformly convergent subsequence $\gamma_{\tilde n} \to \gamma$ (one needs Hopf Rinow or Arzela Ascoli here). Since $l(\gamma) = \lim l(\gamma_n)$ this $\gamma$ will be a segment.
c) This needs one well known fact in order to be easy: For a smooth submanifold $N$ there exists a neighborhood $U$ of the zero section of the normal bundle such that the normal exponential map, i call it just $\exp$, is a diffeomorphism onto it's image. One may also assume that $M$ is complete since the questions are local. Now let $p \in U$ and $\gamma$ be a shortest connection from $p$ to $N$. Then this segment is perpendicular to $N$, so it is of the form $t \mapsto \exp(tv)$ for some vector normal to $N$. Since $\exp$ is injective this segment is unique. To figure out the gradient without calculation one can argue like this: For the gradient $X$ of a distance function $f$ one always has $||X|| = 1$. Since the level sets are the sets of constant distance one has $df(v) = 0$ for all $v$ tangent to a level set. And by the above one has $df(\dot \gamma (t)) = 1$ for an arc length segment $\gamma$. Since the level sets are of codimension $1$ we see that $\dot \gamma$ must equal the gradient. 
