Suppose there is a compact metric space $(X,\rho)$ and a Euclidean space $\mathbb{R}^n$.

There is a sequence of unequal points $\{x_1,...x_N\}$ in $X$ such that all metrics $\rho(x_i,x_j)$ are known and $f(x_i)=a_i$ for some $a_i$ in $\mathbb{R}^n$ whereas:

$$ \forall x_i,x_j \in \{x_1,...x_N\} . ||a_i-a_j|| \leq L \cdot \rho(x_i, x_j) $$

for a fixed $L$.

Suppose also that $\{x_1,...x_N\}$ form a finite cover of $X$ by balls of some suitable (known) radius.

If $X$ were just a compact interval, $\{x_1,...x_N\}$ its partition, and $n$ were $1$, we could certainly construct a piecewise-linear function $f:X \rightarrow \mathbb{R}^n$ such that:

$$ f(x_i)=a_i \\ \forall x,y \in X . ||f(x)-f(y)|| \leq L \cdot \rho(x, y) $$

with a slope controlled by $L$.

It should be also possible in certain cases if $X \subset \mathbb{R}^m$.

**Is it possible to construct such a function for a general compact metric space? And if $X$ is a subset of a Euclidean space?**