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. 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!