1

It is possible to define a bump function in terms of (possibly fractional) powers and exponentials (see https://math.stackexchange.com/a/4385498/408562). Is it similarly possible to define a function that is flat in some interval $[a,b]$ but grows outside this region (monotonically decreasing for $x<a$ and increasing for $x>b$)?


If this is not possible I would of course be interested in a proof of that.


I would also be interested whether some weaker statement is possible that we can make the function in the interval $[a,b]$ in some sense arbitrarily flat (compared to the rest of the function). For example, for simplicity assume $a<0$ and $b>0$, then does a function $f_{s,h}(x)$ exist such that it is monotonically decreasing for $x<0$, increasing for $x>0$ and $f(a),f(b)<s$ but $f(2a),f(2b)> h s$. Where $s$ can be taken small (perhaps arbitrarily so) and $h$ can be taken to be big (perhaps arbitrarily so).

Kvothe
  • 233
  • 1
  • 12
  • 2
    I think the first comment in the question you link to says the answer to this question is "no": If by "isn't piecewise" you mean that you want some "nice formula" involving the usual functions sin,cos,tan,arctan,exp,ln etc, then unfortunately, this is not possible, because such functions are analytic (locally expressible as power series). If an analytic function vanishes on a non-trivial open subset of the real line, then it must vanish identically (uniqueness of analytic continuation). – Ethan Bolker Sep 05 '23 at 15:39
  • @Ethan, I did not say the function has to be analytic. Bump functions evade the same problem by being non-analytic if I understand correctly. See also the answer that I linked. (I actually also didn't mention smoothness but it would be nice. If smoothness is impossible I would also be interested in function that gives up differentiability only at a finite number of points.) – Kvothe Sep 05 '23 at 15:49
  • Being right what is mentioned by @EthanBolker, maybe something like $f(x)=\exp\left(-\dfrac{1}{(x-2)^2}\right)$ could be adapted to fulfill your requirements... This is the kind of answer you are looking for? – Joako Sep 05 '23 at 16:35
  • @Kvothe If you don't need analyticity but you insist on using just powers and exponentials, which are analytic, then you should [edit] the question to tell us just what you allow for gluing those functions together. – Ethan Bolker Sep 05 '23 at 17:00
  • @Ethan, things like $\exp(-1/x^2)$ are not analytic despite being made from an exponential because it's taylor series at 0 does not converge to that function (despite the function being infinitely differentiable), right? It is exactly this kind of thing that bump functions usually make use off. See also the linked question. Whether the answer is "no" in this case where we want the flatness in a finite domain I don't know. You might want to look at the linked answer as it is a counter example to your previous comment. – Kvothe Sep 06 '23 at 09:01
  • @Kvothe The function $\frac{\sqrt{x^2}+x}{2}$ is equal to $x$ for $x\geq 0$ and $0$ elsewhere. So certainly if you allow that, then you could multiply by $e^{-\frac{1}{x^2}}$ to make it smooth, (call that $g(x)$), then let $f(x)=g(x-b)+g(a-x)$. But you might consider that cheating, if so, you need to specify what the rules are further. – M W Sep 06 '23 at 11:12
  • @MW, thanks. I think the observation that the Heaviside step function can be written as $\frac{\sqrt{x^2}+x}{2}$ indeed trivially answers my original question and I would accept it. (Feel free to write it or I can write it myself.) – Kvothe Sep 06 '23 at 12:04
  • I would still be interested in an "arbitrarily flat" function as specified in my edited question build from only integer powers and exponentials of integer powers but I feel like it might at this point be cleaner to ask that as a separate question. – Kvothe Sep 06 '23 at 12:05
  • @Kvothe I think Jam’s answer probably has it covered but if that’s not what you had in mind I’m fine with you answering based on my comment. – M W Sep 06 '23 at 12:30

1 Answers1

3

Here is a general method for constructing piecewise functions in a language of elementary functions. It is not clear what you mean by "non-piecewise", so I will answer the question of expressibility of a function with pieces that is not given as a casewise expression. A separate, reasonable interpretation would be smoothness in some sense (eg. analyticity) and avoiding corners/pieces. Let us consider the elementary functions to include all polynomials and roots.

Observe that the minimum/maximum of two real variables (which can be more generally substituted by functions) is expressible in terms of the absolute value function. Namely, $\max(a,b)=\frac{a+b+|a-b|}{2}$ and $\min(a,b)=\frac{a+b-|a-b|}{2}$. This can be understood as taking the terms' mean $\frac{a+b}2$ (which lies one half-difference between each term) and either adding that remaining half-difference $\frac{|a-b|}{2}$, to reach the larger number, or subtracting it for the smaller. But the absolute function is in turn elementary since $|x|=\sqrt{x^2}$. Hence, $\min/\max$ are (perhaps surprisingly) elementary.

Now, to construct a piece of the desired piecewise function, take each piece as defined generally and use min/max to bound it to a certain region of the plane. This allows all pieces to be summed together.

For your desired function, take its flat section equal to zero for simplicity. Then, construct your increasing parts by taking appropriate lines bounded to one half-plane (their min/max against zero). Hence they will only contribute to a sum over its support (ie, in the parts of the domain where they are nonzero). Lastly, sum all these together for an elementary function that satisfies your criteria.

$$ \begin{cases}\text{increasing}&x<0\\0&\text{else}\end{cases} +\underbrace{0}_{\text{flat section over $[0,1]$}} +\begin{cases}\text{increasing}&1<x\\0&\text{else}\end{cases} \\ =\min\left(x,0\right)+0+\max\left(x-1,0\right) \\ =\frac{x-\left|x\right|}{2}+\frac{x-1+\left|x-1\right|}{2} \\ =\frac{x-\sqrt{x^{2}}}{2}+\frac{x-1+\sqrt{\left(x-1\right)^{2}}}{2} \\ =x+\frac{\sqrt{\left(x-1\right)^{2}}-\sqrt{x^{2}}-1}{2} $$

(Desmos link).

We can continue with the above method to express elementary discontinuous functions, using appropriate rational functions. Moreover, a smooth version of your desired (with removable discontinuities) can be found (using appropriate indicator functions with $e^{-1/x}$). For instance, $\frac{1}{x\left(1-x\right)}$ is limited to the plane as $\ge 4(>1)$ or $<0$ respectively inside and outside the interval $(0,1)$. This allows you to construct an elementary indicator function for intervals, which can be used to construct arbitrary piecewise functions (but not defined at their endpoints). (Desmos link). Similarly, the rational function $x+\frac1x$ can be used for an indicator of an upper/lower part of the real line (for a signum function).

Jam
  • 10,325