Solution (source code)

= Solution

A map $f:A\to\mathbb R$ is <Lipschitz continuous> with <Lipschitz constant> $L$ when
$$
|f(y)-f(z)|\leq Ld(y,z)
$$
for all $y,z\in A$.

Fix $y_0\in A$. The Lipschitz inequality and the <triangle inequality> imply
$$
f(y)+Ld(x,y)\geq f(y_0)-Ld(y,y_0)+Ld(x,y)
\geq f(y_0)-Ld(x,y_0),
$$
while choosing $y=y_0$ gives a finite upper bound. Hence the <infimum> defining $F(x)$ is a real number.

If $x\in A$, then $f(x)\leq f(y)+Ld(x,y)$ for every $y\in A$, while $y=x$ gives the reverse inequality after taking the infimum. Thus $F(x)=f(x)$. For arbitrary $x,z\in X$,
$$
f(y)+Ld(x,y)\leq f(y)+Ld(z,y)+Ld(x,z).
$$
Taking infima gives $F(x)\leq F(z)+Ld(x,z)$; interchanging $x,z$ gives
$$
\boxed{|F(x)-F(z)|\leq Ld(x,z).}
$$
This is the <McShane extension theorem>: \b[$F$ extends $f$ without increasing its Lipschitz constant.]