On the classic exercise “$f\in C^\infty(\mathbb{R})$ s.t. $\forall x \exists n\in\mathbb{N}: f^{(n)}(x)=0$ implies $f$ is a polynomial”

The title is pretty much self-explanatory;

Problem: Let $f\in C^\infty(\mathbb{R})$ such that for each $x\in\mathbb{R}$ there exists $n_x\in\mathbb{N}$ s.t. $f^{(n_x)}(x)=0$. Prove that $f$ is a polynomial.

There are great proofs of this, (some of theme here: https://mathoverflow.net/questions/34059/if-f-is-infinitely-differentiable-then-f-coincides-with-a-polynomial) but in my effort to solve it, I came across an interesting property but then got stuck; I'd like to see if anybody can pick it up from there.

Here is my progress. If you want you can skip the first part; the gist of it is that $f$ has to be piecewise polynomial on a countable union of disjoint open intervals, a union that is dense in $\mathbb{R}$.

Part 1 : The technicalities.

First I proved that the set $A:=\{x\in\mathbb{R}:$ there exist $n\in\mathbb{N}, \varepsilon>0$ such that $f^{(n)}\vert_{(x-\varepsilon,x+\varepsilon)}=0\}$ is open and dense in $\mathbb{R}$. It is trivial that it's open; for the density, simply pick a point $x$ and an arbitary small radius $r$ and apply Baire's theorem on the metric subspace $([x-r,x+r], |\cdot|)$ for the closed sets ${f^{(n)}}^{-1}(0)\cap[x-r,x+r]$. Now $A$ can be written as a cοuntable union of disjoint open intervals, namely $A=\bigcup_{n}I_n$. Let's save this for later on.

Lemma: Let $x,y\in A$ and $n_1,n_2$, $\varepsilon, \varepsilon'$ such that $f^{(n_1)}\vert_{(x-\varepsilon, x+\varepsilon)}=0$, $f^{(n_2)}\vert_{(y-\varepsilon', y+\varepsilon')}=0$ and $(x-\varepsilon,x+\varepsilon)\cap(y-\varepsilon',y+\varepsilon')\neq\emptyset$. Then, if $n_1\leq n_2$, we have $f^{(n_1)}\vert_{(y-\varepsilon', y+\varepsilon')}=0$.

This is quite easy to prove, just observe that $f$ is a polynomial of degree $\leq n_2-1$ on $(y-\varepsilon', y+\varepsilon')$, hence $f^{(n_1)}$ is a polynomial of degree $\leq n_2-n_1-1$, on this segment, but is $0$ on the subinterval $(x-\varepsilon,x+\varepsilon)\cap(y-\varepsilon',y+\varepsilon')$, a contradiction (way too many roots for a polynomial!)

Getting back to the fact that $A=\bigcup_{n}I_n$. Let $x,y\in I_k$ and $n_1,n_2$, $\varepsilon, \varepsilon'$ such that $f^{(n_1)}\vert_{(x-\varepsilon, x+\varepsilon)}=0$, $f^{(n_2)}\vert_{(y-\varepsilon', y+\varepsilon')}=0$. Without loss of generality, let $n_1\leq n_2$. We prove the same as in the lemma, that $f^{(n_1)}\vert_{(y-\varepsilon', y+\varepsilon')}=0$.

The proof is based on the compactness of $[x,y]\subset I_k\subset A$ and the lemma above. I'll skip the details, the open cover that gets reduced to a finite is the obvious $\{(z-\varepsilon_z, z+\varepsilon_z)\}_{z\in [x,y]}$.

Part 2: The unusual property.

Pick a random $k\in\mathbb{N}$ and let's assume that $f$ is the polynomial $a_0+\dots+a_{m_k}x^{m_k}$ on the open interval $I_k:=(c_k,d_k)$, where $a_{m_k}\neq 0$. We have $f^{(m_k)}=a_{m_k}$ on $I_k$ and this function is continuous on the endpoints $c_k, d_k$. Therefore, for $\varepsilon=|a_{m_k}|$ there exists $\delta>0$ such that if $|x-c_k|<\delta$ or $|x-d_k|<\delta$, then $|f^{(m_k)}(x)-a_{m_k}|<|a_{m_k}|$. Now the set $\mathbb{R}\setminus A$ has empty interior, therefore the segments $(c_k-\delta, c_k)$ and $(d_k, d_k+\delta)$ are intersected by some intervals of the collection ${I_j}$, let's name them $I_d, I_s$ respectively. Let's also set $m_d$ and $m_s$ the degree of $f$ on $I_d$ and $I_s$ respectively.

The "weird" thing is this: $m_s\geq m_k$ and $m_d\geq m_k$.

Indeed, if $m_s<m_k$, then $f^{(m_k)}\vert_{I_s}=0$, but if $y\in I_s\cap (d_k,d_k+\delta)$ one gets $|f^{(m_k)}(y)-a_{m_k}|=|a_{m_k}|<|a_{m_k}|$, a contradiction. Similarly for $m_d$.

Why I think this is a strong indication that $f$ must be a polynomial/ TLDR: we chose a random $k$ and we managed to show that if another interval of our collection intersects a specific $\delta$-enlargement of $I_k$, then the degree on $I_k$ is smaller. If we could somehow cover $\mathbb{R}$ with those proper enlargements, by induction we'd have that the random $k$ we chose corresponds to the minimum degree; therefore all polynomial-parts of $f$ are of the same degree. With that in hand, if $d$ is the common degree of all polynomial parts of $f$, the piecewise constant function $f^{(d)}$ is continuous and defined on a dense subset of $\mathbb{R}$. Therefore there's only one continuous extension of it, so each constant should be equal to each other. Therefore the coefficients of $x^d$ are all the same. Applying the same to $f-x^d$ and so on, we get that $f$ is a polynomial.

Any ideas, comments or hints are greatly appreciated. Sorry for the long post.

• This would be a lot easier if the $\forall x$ and $\exists n$ were swapped. – mr_e_man Apr 22 '18 at 2:53
• Lol because the first comment was (true and) a joke i guess? It is true: when an n-th derivative is identically 0, then your function is indeed a polynomial. @qbert exp^(-1/x^2) is not a counter-example of this – JustDroppedIn Apr 22 '18 at 3:03
• @TheGreatSplash perhaps I misunderstood what "swapped" meant. Of course if there is an $n$ such that the derivative vanishes identically, it is indeed a polynomial and you may indeed integrate to show this. – qbert Apr 22 '18 at 3:06