# Approximation rate of $L^2$ function by piecewise constant functions

Let $\{x_i\mid i\in \mathbb{Z}\}$ be a partition of $\mathbb{R}$ with equal distance $h>0$, and a given function $f\in L^2(\mathbb{R})$. I approximate $f$ by $P_hf$, the $L^2$ projection of $f$ on piecewise constant function defined as $$P_hf(x)=\sum_j a_j 1_{(x_j,x_{j+1}]}(x),\; x\in \mathbb{R},\quad a_j=\frac{1}{h}\int_{x_j}^{x_{j+1}}f(y)\,dy.$$

I have shown $h\to 0$, $\|P_hf-f\|_{L^2(\mathbb{R})}\to 0$. Moreover, if $f\in H^1(\mathbb{R})$, using Poincare inequality on each subinterval, I get a order 1 convergence. If I require $f$ has higher regularity, is it possible to get a convergence rate higher than 1?

I asked the same question on MSE. But I haven't got any response yet.

What I have tried:

By using Cauchy-schwartz on each subinterval and summizing them up (basically the proof of Poincare inequality), I get $$\|P_hf-f\|_{L^2(\mathbb{R})}\le h\|f\|_{H^1(\mathbb{R})},$$ but I am not sure whether this is the best approximation rate I can get. Is there any reference about this problem?

Additional smoothness will typically not improve the rate of convergence. If you have a well behaved smooth function with a derivative $f'$ that doesn't vary wildly on the intervals $I_j=(x_j,x_j+h)$, then $|f(x)-a|\gtrsim |f'(x_j)|h$ on a substantial portion of $I_j$, so this interval makes a contribution $\gtrsim |f'(x_j)|^2 h^3$ to $\|P_hf-f\|^2$.

Since (under our assumption that $f'$ doesn't vary much over $I_j$) $|f'(x_j)|^2 h \simeq \|f'\|^2_{L^2(I_j)}$, you also have a lower bound $\|P_hf-f\|_2\gtrsim h\|f'\|_2$ for such functions $f$.

If that sounds too abstract, then you can also work an example such as $f(x)=x$ (on $-1\le x\le 1$, say, and $f\in C_0^{\infty}$) to confirm that the rate of convergence need not improve with additional smoothness.

• I agree with the example by Christian Remling, only pointing out that $f \in C^\infty$, since $f(\pm 1) = \pm 1 \ne 0$. – D G Aug 11 '16 at 10:58
• @D G: What I was trying to say is that $f=x$ on $[-1,1]$, and outside this interval I define $f$ in such a way that $f\in C_0^{\infty}$. – Christian Remling Aug 11 '16 at 16:40

You are unlikely to find any better estimation, since you can take analytical functions designed specifically to break any $P_h$ you construct.

Your result so far is a natural consequence of the Sobolev embedding theorem (see Brézis' book). In dimension one, $H^1 ([a,b]) \subset \mathcal C([a,b])$. In this sense you have just proved the convergence of Riemann sums in the standard way.

• Sorry. Edited my answer. – D G Aug 11 '16 at 10:57