Let $(M,g)$ be a smooth Riemannian manifold, and let $S \subseteq M$ be a compact submanifold.
Assume that for each $p \in M$, there exist a unique closest point on $S$, i.e a unique point $\tilde s(p) \in S$ such that $d(p,\tilde s (p))=d_S(p)$.
It is easy to see the map $\tilde s:M \to S$ is continuous.
Is it differentiable? (at which points)? If not, are there directional derivatives everywhere?
Does anything change if we assume every point has a uniqueunique minimizig geodesic to $S$? or that $M$ is complete? or both?
Edit: As shown in the example given by Willie Wong, when both conditions do not hold, $\tilde s$ does not have to be differentiable.