Let $M \subseteq \mathbb{R}^m$ be a smooth submanifold and assume the points $p \in \mathbb{R}^m$ and $p_0 \in M$ are such that $||p - p_0|| \leq ||p - q||$ for all $q \in M$.
How do I show that $p - p_0 \in (T_{p_0}M)^{\perp}$?
I tried showing that for any smooth curve $\alpha: I \to M, \alpha(0)=p_0$
$$\langle \alpha'(0),p - p_0\rangle = 0$$ but couldn't quite get this done.
Hint: The function $f(p)=\|p-p_0\|^2$ has an extrema at $p_0$ so its differential vanishes at this point.
If $c(t)$ is a differential curve on $M$ such that $c(0)=p_0$, the function $f(c(t))=\|c(t)-p_0\|^2$ has an extrema at $0$. The differential vanishes at $0$.