TITLE: The formula for a distance between two point on Riemannian manifold
QUESTION [7 upvotes]: Given a Riemannian (say, connected) manifold $(M,g)$  one can produce the metric via a formula $d(x,y)=\inf_{\gamma}l(\gamma)$ where $\gamma$ is piecewise smooth curve joining $x$ and $y$. My question is the following:
Why the definition uses  piecewise smooth curves and not only (genuine) smooth?

REPLY [6 votes]: You will get the same metric if you use smooth curves. This is mentioned in some differential geometry texts. 
The reason for piecewise smooth is that the join of two piecewise smooth paths is still piecewise smooth, while the join of two smooth paths is a priori only piecewise smooth.