# Approximating a discontinuous by a smooth function

The discontinuous function I want to approximate is defined as $x \mapsto g(x) : \mathbb{R}_+\mapsto \mathbb{R}_-$ with $g(x) := -x\mathbb{1}_{x < b}$ where $b > 0$ is some given real number.

I want to approximate this function on the whole nonnegative real line by a smooth function, $f$. $f$ has to satisfy $f(0,p) = 0$ for every $p$. Here $p$ is some real-valued parameter. So $f(\cdot,p)$ can be considered a family of functions indexed by $p$. This approximation should be such that for every $\varepsilon > 0$ I should be able to find a $p$ with $$\sup_{x\geq 0} \lvert f(x,p) - g(x)\rvert < \varepsilon$$

Can such an approximation exist? If yes, can someone give a few examples?

No. Such an approximation is impossible.

Consider the point $x = b$.

Let $\epsilon \in (0,b/8)$ be arbitrary. For every $p$, by continuity, there exists a $\delta \in (0,b/4)$ such that for every $y\in (b-\delta,b+\delta)$, we have

$$|f(b,p) - f(y,p)| < \frac{b}{8}$$

On the other hand, we have that

\begin{align} b - \delta/2 &= | g(b+\delta/2) - g(b-\delta/2) |\\ &\leq |g(b+\delta/2) - f(b+\delta/2,p)| + \\ &\qquad |f(b+\delta/2,p) - f(b-\delta/2,p)| + |f(b-\delta/2,p) - g(b-\delta/2)| \end{align}

by triangle inequality, which implies that

$$4 \epsilon < \frac{b}{2} < | g(b+\delta/2) - f(b+\delta/2,p) | + |f(b-\delta/2,p) - g(b-\delta/2)|$$

In fact, the proof above shows that for any continuous function $h$, the inequality $$\sup_{x\geq 0} |h(x) - g(x)| > \frac{b}{4} \tag{1}$$ always holds; and hence the inequality you want cannot be true.

Note, equation (1) is far from sharp. In fact, one can show that for any $\eta > 0$ there is an analogue of (1) with the right hand side replaced by $b/2 - \eta$.

• Related: the uniform limit theorem states that uniform limits of continuous functions are continuous; a consequence is therefore that it is not possible to approximate a discontinuous function in the topology of uniform convergence using continuous functions. The approximation is however possible if you instead use pointwise convergence. Sep 8, 2016 at 17:07
• Regarding the equality starting with $b+\delta/2$, shouldn't it be with $b-\delta/2$? Also, $g$ does not have a second argument. Sep 8, 2016 at 17:21
• @Calculon. Thanks for the corrections. Yes, in the first line you are right; I misread your original question. The typos are also fixed. Sep 8, 2016 at 17:50
• Thank you for your answer. Would you be able to give an example for a pointwise approximation of my function? Sep 8, 2016 at 18:50
• Take the convolution against any approximation to the identity. Alternatively, since you are in one dimensions and the two pieces are linear, you can do it by hand by modifying the definition of the concrete example of a mollifier given on the linked Wikipedia entry. Sep 8, 2016 at 19:04