Does Kirszbraum's theorem hold for general metric spaces? On a Chinese online forum, somebody posted a version of  Kirszbraum's theorem without giving a reference for the proof:

If $(M,d)$ is a metric space, $A\subset M$, $f$ is a real-valued function on $A$ with Lipschitz constant $K$. Then 
  $$F:M\to \Bbb R,\, x\mapsto \inf_{a\in A}(f(a)+Kd(x,a))$$
  is a $K$-lipschitz function on $M$ with $F|_A=f$

As I searched on Google,  most versions of this theorem only concern Hilbert spaces. The most generalised one deals with metric spaces with some special structures like "bounded curvature" etc and none of them seems to mention the validity of this theorem for general metric spaces. 
So is the above claim true for general metric spaces? If not, is there any obvious counterexample? I myself cannot find one. 
Best regards.
 A: I didn't know this was a theorem, but it is a standard exercise in real analysis: Let $x, y \in M$. Then for every $a\in A$, 
\begin{eqnarray}
F(x)&\leq& f(a)+Kd(x, a) \\
&\leq & f(a)+Kd(y,a)+ Kd(x, y). 
\end{eqnarray}
By taking infimum, we have $F(x)\leq F(y)+Kd(x,y)$. 
A: As tree detective pointed out, this is a relatively simple fact. It is sometimes called McShane's theorem or the McShane-Whitney extension theorem. (For example, see in Heinonen's book Lectures on Analysis on Metric Spaces.)
I would hesitate to call it a version of Kirszbraun's theorem. Kirszbraun's theorem applies to Hilbert space targets of arbitrary dimension (but only Hilbert space domain). McShane's theorem applies to $\mathbb{R}$ target but arbitrary metric domain. The proofs are correspondingly quite different.
Note that also McShane's theorem implies that if $X$ is a metric space, $E\subset X$, and $f:E\rightarrow \mathbb{R}^n$ is $K$-Lipschitz, then $f$ has an extension to a function on $X$ which is $K\sqrt{n}$-Lipschitz. (Apply McShane's theorem to each component of $f$.)
However, you can't preserve the Lipschitz constant of the extension for maps from general metric spaces to $\mathbb{R}^n$ targets.
