[step:Minimize the path energy by the distance between $x$ and $y$]
Because the theorem now assumes that $x$ and $y$ lie in the same connected component of the smooth manifold $M$, they can be joined by a piecewise $C^1$ curve. Let $\Gamma_{x,y}^{s,t}$ denote the nonempty set of all piecewise $C^1$ curves
\begin{align*}
\gamma: [s,t] &\to M
\end{align*}
with $\gamma(s)=x$ and $\gamma(t)=y$. For $\gamma \in \Gamma_{x,y}^{s,t}$, define its length $L_g(\gamma)$ and energy $E_g(\gamma)$ by
\begin{align*}
L_g(\gamma):=\int_s^t |\dot{\gamma}(\tau)|_g\,d\mathcal{L}^1(\tau).
\end{align*}
and
\begin{align*}
E_g(\gamma):=\int_s^t |\dot{\gamma}(\tau)|_g^2\,d\mathcal{L}^1(\tau).
\end{align*}
By the [Cauchy-Schwarz inequality](/theorems/432) applied to the functions $\tau \mapsto |\dot{\gamma}(\tau)|_g$ and $\tau \mapsto 1$ on $[s,t]$,
\begin{align*}
L_g(\gamma)^2
\leq
E_g(\gamma)(t-s).
\end{align*}
Since $d_g(x,y) \leq L_g(\gamma)$ by the definition of the Riemannian distance,
\begin{align*}
E_g(\gamma) \geq \frac{d_g(x,y)^2}{t-s}.
\end{align*}
Conversely, for every $\varepsilon>0$, the definition of $d_g(x,y)$ and the standard smoothing of piecewise $C^1$ curves give a regular piecewise $C^1$ curve $\sigma_\varepsilon:[0,1]\to M$ from $x$ to $y$ with
\begin{align*}
L_g(\sigma_\varepsilon) \leq d_g(x,y)+\varepsilon.
\end{align*}
Because $\sigma_\varepsilon$ is regular on each smooth segment, its arclength parameter is piecewise $C^1$ with piecewise $C^1$ inverse after subdividing at the break points. Reparametrize $\sigma_\varepsilon$ on $[s,t]$ proportional to arclength, obtaining a piecewise $C^1$ curve $\gamma_\varepsilon \in \Gamma_{x,y}^{s,t}$ with constant speed
\begin{align*}
|\dot{\gamma}_\varepsilon(\tau)|_g=\frac{L_g(\sigma_\varepsilon)}{t-s}
\end{align*}
for $\mathcal{L}^1$-a.e. $\tau \in [s,t]$. Therefore
\begin{align*}
E_g(\gamma_\varepsilon)=\int_s^t \frac{L_g(\sigma_\varepsilon)^2}{(t-s)^2}\,d\mathcal{L}^1(\tau)=\frac{L_g(\sigma_\varepsilon)^2}{t-s}\leq\frac{(d_g(x,y)+\varepsilon)^2}{t-s}.
\end{align*}
Letting $\varepsilon \downarrow 0$ yields
\begin{align*}
\inf_{\gamma \in \Gamma_{x,y}^{s,t}} E_g(\gamma)
=
\frac{d_g(x,y)^2}{t-s}.
\end{align*}
[/step]