Multivariate piecewise linear interpolation Let $f:X\rightarrow E$ be a uniformly continuous function into some Banach space $E$ ($\dim(E)\geq 1$) from a (non-empty) compact subset $X\subseteq \mathbb{R}^n$ where $n\geq 1$.
Why, for every $\epsilon>0$, is it true that there exists a piecewise linear function $\hat{f}$ satisfying
$$
\sup_{x\in X} \|f(x)-\hat{f}(x)\|_E<\epsilon?
$$
I was thinking of doing the following:

*

*Since $K$ is compact then $K\subseteq [-diam(K),diam(K)]^n$

*Pick an equally spaced mesh of points $\{k_n\}_{n\leq N}$ such that $\cup_{n}\operatorname{Ball}(k_n,\delta)$ covers $[-diam(K),diam(K)]^n$; which we know must exist by compactness of $[-diam(K),diam(K)]^n$ (for any given $\delta>0$).

*Pick $\delta$ so that $\omega_f(\delta)\leq \epsilon$; where $\omega_f$ is the modulus of continuity of $f$; which we can do since $\omega_f$ is right continuous (or we may wlog assume it so),

Now here is where I get stuck:
How do we then prove that there is a function which linearity interpolates the points
$\{f(x_n)\}_n$?
If we can do that; then by the convexity of the norm $\|\cdot\|_E$ we can infer the existence of $\hat{f}$; no?
Follow-up: This problem seems like it must be covered by some literature (it's too natural not too be).  Does anyone know any good references where I can read about this problem (with Banach co-domain)?
 A: I would try a little different strategy: As $X$ is compact and $f$ is continuous it follows that $f$ is uniformly continuous. Let's $\varepsilon >0$. As $f$ is  uniformly continuous there exists $\delta$ such that $\lVert f\left(x\right)-f\left(y\right)\rVert_E\lt\varepsilon/2$ whenever $\lvert x- y\rvert\lt\delta$. Let $T=\left\{t_{i_1,i_2,\dots i_n}\right\}$ be equaly spaced mesh of points in $X$  indexed with "coordinates" $(i_1, i_2,\dots, i_n)\in\mathbb N^n$ such that $\lvert t_{i_1,i_2,\dots,i_n} - t_{i'_1,i'_2,\dots,i'_n}\rvert\lt \delta$ for any $t_{i_1,i_2,\dots,i_n} ,t_{i'_1,i'_2,\dots,i'_n}\in T$ such that $\max\left\{\lvert i_1-i'_1\rvert,\lvert i_2-i'_2\rvert,\cdots,\lvert i_n-i'_n\rvert\right\}\le 1$. (in other words, distance between two "neighborhood" points is less then $\delta$, including "diagonal neighborhood").
Let $C_{i_1,i_2,\dots,i_n}$ be $n$-dimensional cube with vertices $\{t_{i_1+p,i_2+p,\dots,i_n+p}\}$ where $p\in\{0,1\}$
Lets define linear function $f_{i_1,i_2,\dots,i_n}$ in following way $$f_{i_1,i_2,\dots,i_n}(x)=f_{i_1,i_2,\dots,i_n}(x_1,x_2,\dots,x_n)=\begin{cases} \Lambda(x)  & x\in C_{i_1,i_2,\dots,i_n} \\ 0 & x\not\in C_{i_1,i_2,\dots,i_n}\end{cases}$$ where $\Lambda$ is linear function that agrees with $f$ on verices of cube $C_{i_1,i_2,\dots,i_n}$. More on this bellow...
Now set $$\hat f\left(x\right)=\sum_{i_1,i_2,\dots,i_n} f_{i_1,i_2,\dots,i_n}\left(x\right).$$ For every $x\in X$ we have
$$\left\lVert f\left(x\right)-\hat f\left(x\right)\right\rVert_E=\left\lVert f\left(x\right)-f_{i_1,i_2,\dots,i_n}\left(x\right)\right\rVert_E$$ where $(i_1,i_2,\dots,i_n)$ is such that $x\in C_{i_1,i_2,\dots,i_n}$ and $$\left\lVert f\left(x\right)-f_{i_1,i_2,\dots,i_n}\left(x\right)\right\rVert_E\le\left\lVert f\left(x\right)-f\left(x_{i_1,i_2,\dots,i_n}\right)\right\rVert_E+\left\lVert f\left(x_{i_1,i_2,\dots,i_n}\right)-f_{i_1,i_2,\dots,i_n}\left(x\right)\right\rVert_E\lt \frac{\varepsilon}{2}+\frac{\varepsilon}{2}=\varepsilon.$$ That proves that $$ \sup_{x\in X} \|f(x)-\hat{f}(x)\|_E\lt\varepsilon$$

So how can we construct $\Lambda$? Well, it would be very ugly expression if I try to write it down, but you can get it easily with induction on dimension $n$.
Fer example, lets find a linear function $\Lambda\left(x,y\right)$ such that $\Lambda\left(0,0\right)=A_{00}$, $\Lambda\left(1,0\right)=A_{10}$, $\Lambda\left(0,1\right)=A_{01}$ and $\Lambda\left(1,1\right)=A_{11}$. This will work: $$ \Lambda\left(x,y\right) = A_{11}xy+A_{01}\left(1-x\right)y+A_{10}x\left(1-y\right)+A_{00}\left(1-x\right)\left(1-y\right).$$
Lets consturct $\overline{\Lambda}\left(x,y\right)$ such that $\overline\Lambda\left(0,0\right)=B_{00}$, $\overline\Lambda\left(1,0\right)=B_{10}$, $\overline\Lambda\left(0,1\right)=B_{01}$ and $\overline\Lambda\left(1,1\right)=B_{11}$. Now if we set $$\Psi\left(x,y,z\right)=\left(1-z\right)\Lambda\left(x,y\right)+z\overline\Lambda\left(x,y\right)$$ we will get function such that $\Psi\left(0,0,0\right)=A_{00}$, $\Psi\left(0,0,1\right)=B_{00}$, $\Psi\left(1,0,0\right)=A_{10}$, and so on, and so on....
