Let $M$ be smooth compact riemannian manifold with boundary and $\varphi_0: S^1\to M$ be a rectifiable curve (or a smooth one). I would like to find a reference to the following statement:

**Statement.** There exists a length decreasing homotopy $\varphi_t:S^1\to M$, $t\in [0,1]$, such that the curve $\varphi_1(S^1)$ is locally length minimizing (i.e. can not be *slightly* perturbed to a shorter curve.) 

*Remark.* In the case when $M$ has no boundary, of course, $\varphi_1(S^1)$ should be a closed geodesic.