Understanding distance function on Riemannian Manifold We have the next definition. This is from the book "Classical and Modern Morse Theory with Applications" by Mercuri, Piccione and Tausk.
Let $f:M \to \mathbb{R}^{n+p}$ be an isometric immersion of an $n$-dimensional Riemannian manifold. Fix $q\in \mathbb{R}^{n+p}$. The $\textit{distance function from q}$ is the function
$$L_q : M \to \mathbb{R}, \; L_q (x) = \langle q-x, q-x \rangle.$$
I am not sure if on the definition it should be understood that
$L_q (x) = \langle q-f(x), q-f(x) \rangle$, since $x$ belongs to the manifold and $q$ belongs to an euclidean space, and it cannot be the riemannian metric since that is defined in the tangent space. Am I right?
And also, it continues on the book: (here, $\overline{\nabla}$ denotes the Levi-Civita connection of $\mathbb{R} ^{n+p}$, and $\nabla$ is the Levi-Civita connection of $M$.)
We study now the critical points of $L_q$. Set $\xi( x)=q-f(x)$. Identifying (locally) $M$ with $f(M)$, we have $\overline{\nabla} _X   \xi = -X, X_1 T_xM$. Hence:
$\bullet  dL_q (x) X = -2 \langle X , \xi \rangle. $ In particular, $x\in M$ is a critical point of $L_q$ if and only if $\xi (x) \in \nu _{n} M .$
$\bullet $ If $x$ is a critical point of $L_q$, we have:
$d^2 L_q (x) (X, Y) =-2Y \langle X , \xi \rangle =2 \langle (Id-A_{\xi} ) X , Y \rangle. $
I have recently been introduced to the concept of the Levi-Civita connection, and I know that it is defined as the only symmetric connection that is compatible with the metric, but I am still trying to understand how to work with it.
There are several things that I don't understand:
What does the expression  $\overline{\nabla} _X   \xi = -X, X_1 T_xM$ mean and why do we have that? (The text doesn't say who is $X_1$ and I am guessing it was written by mistake but I don't get what it means).
Also, on the first bullet I think there is a little mistake because it should appear $\nu _{x} M$ instead of $\nu _{n} M$, since on a previous section $\nu _{x} M$ denotes the normal space corresponding to $f$ at $x$, that is $df_x (T_x M ) ^{\perp} $.
But I don't really know how was the expression $ dL_q (x) X = -2 \langle X , \xi \rangle $ obtained.
On the second bullet I also don't know how to obtain that expression. There, $A_{\xi} X = -(\overline{\nabla}  _X \xi)^T $, where for $z\in T_{f(x)} \mathbb{R} ^{n+p}$, $z^T$ denotes the component of $z$ in $df_x (T_x M)$.
I would be really thankful for any comment and suggestion.
 A: *

*Yes, $L_q$ should be understood as $L_q (x) = \langle q-f(x), q-f(x) \rangle$. In the following they/we do not distinguish between $M$ and $f(M)$, $TM$ and $f_*(TM)$.


*Note that $\overline\nabla $ on $\mathbb R^{n+p}$ is nothing but coordinate-wise directional derivatives. Thus
$$\overline\nabla_X (q-f(x))= - \overline \nabla_X f(x)$$
By definition $X$ is really in $TM$, and the above calculation should give
$$-\overline\nabla _X f(x) = -f_*X.$$
But then they identify $X$ with $f_*X$, so
$$\overline\nabla_X \xi = -X.$$
I don't know what's $X_1 T_xM$


*Yes it should be $\nu_xM$.


*To calculate $dL_q(x) X$, we use product rule:
\begin{align}
dL_q(x) X &= X \langle \xi, \xi\rangle \\
&= 2 \langle \overline\nabla_X \xi, \xi\rangle \\
&=-2 \langle X, \xi\rangle. 
\end{align}


*$d^2 L_q(x)$ is the Hessian of $L_q$ at $x$ and should be calculated as (assume that $x$ is a critical point, $dL_q(x) = 0$)
\begin{align}
d^2 L_q(x) (X, Y) &= X(dL_q(Y)) - dL_q (\nabla_X Y) \\
&=-2 X \langle Y, \xi\rangle \ \ \ \ \ \ \ \ \ \qquad  \qquad  \ \ \ \ \ \ \text{ since } dL_q (x) = 0, \\
&=-2 \langle \overline\nabla _X Y, \xi\rangle -2 \langle Y, \overline \nabla_X\xi\rangle \\
&= -2\langle A(X, Y), \xi\rangle +2\langle X, Y\rangle  
\end{align}
here $A$ is the second fundamental form. We do not get what you suggested in the post. I don't think what you write is correct. Indeed, $\overline\nabla _X\xi$ is already tangential, there's no need to write $(\cdot)^T$.
