This is an exercise problem from the book Riemannian Geometry, Peter Peterson, Problem 10 (Page 150.
Let $N\subset M$ be a submanifold of a Riemannian manifold $(M,g)$. The distance from $N$ to $x\in M$ is defined as $$d(x,N):=\inf \{d(x,p):p\in N\}.$$ A unit speed curve $\sigma:[a,b]\to M$ with $\sigma(a)\in N$, $\sigma(b)=x$, and $ l(\sigma)\left(=\int_a^b\|\sigma'(t)\|~dt\right) =d(x,N) $ is called a segment from $x$ to $N$. Show that $\sigma$ is also a segment form $N$ to any $\sigma(t)$, $t<b$. Show that $\sigma'(a)$ is perpendicular to $N$.
I am unable to start this. Any hint will be helpful.
A simple geometric proof:
Since $\sigma$ is a segment from $x$ to $N$, a geodesic ball with center at $x$ and radius $b-a$ touches $N$ at $\sigma (a)$. Assume that $\sigma$ is not a segment to $N$ from a point $\sigma(t), t\lt b$. Then, a geodesic ball with center at $\sigma(t)$ and radius $t-a$ touches $N$ at $ p\in N(\ne\sigma (a))$ which is a cntradition. Thus, $\sigma$ is a segment to $N$ from a point $\sigma(t), t\lt b$.