Let $f: [0;1] \rightarrow \mathbb{R}$ be a Lipschitz continuous function, with Lipschitz constant $L>0$ and $X$ be a random variable uniformly distributed on $[0;1]$. Let $X_n=2^{-n}\left\lfloor2^nX\right\rfloor,Y_n=2^n(f(X_n+\frac{1}{2^n})-f(X_n)), \mathcal{F}_n=\sigma(X_0,...,X_n)$ and $\mathcal{F}_{\infty}=\bigcap_{n \in \mathbb{N}}\sigma(\bigcup_{k \geq n}\sigma(X_k)).$
We can prove that $\mathcal{F}_n=\sigma(X_n),\mathcal{F}_{\infty}=\sigma(X)$ and that $(Y_n)_n$ is a martingale for the filtration $(\mathcal{F}_n)_n$ such that $|Y_n| \leq L,$ then $(Y_n)_n$ converges a.s and in $L^1$ to a random variable Y such that there exists a bounded measurable function $h:[0;1] \rightarrow \mathbb{R}$ such that $Y=h(X)$ a.s. We have $$Y_n=E[Y|\mathcal{F}_n]=E[h(X)|X_n]=2^n\int_{X_n}^{X_n+\frac{1}{2^n}}h(x)dx$$ so $$\forall x \in [0;1],f(x)=f(0)+\int_0^xh(y)dy$$
If the function $f$ was from $[0;1]^d$ to $\mathbb{R}$, how should we define $X_n$ and $Y_n$? We should take $X$ uniformly distributed on $[0,1]^d$?