Let $M \subset \mathbb R^n$ a smooth submanifold. I've been said that for generic $p$ the function $f_p : x \mapsto \|x-p\|^2$ (euclidean norm) defines a Morse function on M.
Here's my attempt :
The differential of $f_p$ at $x$ is $h \mapsto \langle h, x-p \rangle$.
So $x \in M$ is critical iff the functionals $\langle \cdot , x \rangle$ and $\langle \cdot , p \rangle$ are equal on the tangent space $T_x M$.
If $\langle \cdot , p \rangle$ is a regular value of the map $g : x \mapsto \langle \cdot , x \rangle$, then the restriction of $dg(x)= d^2f_p(x)$ to $T_x M$ is surjective whenever $x$ is a critical point of $f_p$.
By Sard's theorem, the critical values of $g$ have measure zero.
Is this correct ?