Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For each closed set $A\subseteq\mathbb{R}$, is it possible to construct a real continuous function $f$ such that the zero set, $f^{-1}(0)$, of $f$ is precisely $A$, and $f$ is infinitely differentiable on all of $\mathbb{R}$?


share|cite|improve this question
Corresponding question on MathOverflow: – Jonas Meyer Jan 12 '12 at 21:24

In fact it's true for an closed subset $A$ of $\mathbb R^d$. If $A=\complement_{\mathbb R^d}B(x_0,r)$, then we put $f(x)=\mathbf 1_{B(x_0,r)}\exp\left(\frac 1{||x-x_0||^2-r^2}\right)$. For the general case, $A$ is a countable intersection of complement of open balls, namely $A=\bigcap_{n\in\mathbb N}A_n$. Let $f_n$ which works for all $n$. Since $f_n\geq 0$, putting $f=\sum_{n\in\mathbb N}a_nf_n$ we just have to choose $a_n>0$ such that the series (and its derivatives) converges for the topology of $C^{\infty}(\mathbb R^d)$. We put $$a_n=\begin{cases} \frac 1{2^k}\left(\sum_{|\alpha|\leq n}\sup_{|x|\leq n}|\partial^{\alpha}f_n(x)|\right)^{-1}&\mbox{ if }\sum_{|\alpha|\leq n}\sup_{|x|\leq n}|\partial^{\alpha}f_n(x)|\neq 0;\\\ \frac 1{2^k}&\mbox{otherwise.}\end{cases}$$ We can check that for all compact $K$ of $\mathbb R^d$ and $\alpha\in\mathbb N^d$ the sequence $\sum_n a_nf_n$ is convergent. Take $N$ such that $K\subset B(0,N)$ and $|\alpha|\leq N$ \begin{align*} \sup_{x\in K}\left|\partial^{\alpha}\left(\sum_{j=0}^{n+m}a_jf_j-\sum_{j=0}^na_jf_j\right)\right|&=\sup_{x\in K}\left|\sum_{j=n+1}^{n+m}a_j\partial^{\alpha}f_j\right|\\ &\leq \sum_{j=n+1}^{n+m}a_j\sup_{|x|\leq N}|\partial^{\alpha}f_j|, \end{align*} and $a_j\sup_{|x|\leq N}|\partial^{\alpha}f_j|\leq 2^{-j}$ so we can conclude.

share|cite|improve this answer
+1 the coefficients $a_n$ were the hard, and apparently interesting, part. Any reference? – Alex Youcis Jan 12 '12 at 21:43
A closed set is the countable intersection of complements of open balls, not a countable union of such. – Greg Martin Jan 12 '12 at 22:48
@greg Oh yes, it was what I meant but not what I wrote. Thanks for pointing it out. – Davide Giraudo Jan 13 '12 at 12:48
My point is, unless I'm misunderstanding something, that the sum that defines your $f$ will be nonvanishing on the union of the complements of open balls, which is not the set you want. You should work through your proof in the case where $A$ is just a single point; I don't think it works. – Greg Martin Jan 13 '12 at 19:46
Each function $f_n$ is non-vanishing on an open ball, so the sum $f$ is non-vanishing on a countable union of open balls. And the complementary of $A$ is a countable union of open balls. It might have been clearer to look for a function which is non-vanishing only on an arbitrary non-empty open set $U$, and put $A=U^c$ at the end. – D. Thomine Jan 13 '12 at 20:06

Yes, you can read a proof on page 43 of these notes: (Lemma IV.1.2).

However, that proof is for the more general case of a smooth function $f:\mathbb{R}^n\to \mathbb{R}$, so maybe someone can suggest a more elementary proof for $n=1$.

share|cite|improve this answer
Thanks! It looks a little over my head, so I would appreciate the more elementary proof if anyone knows of one. – Natasha Jan 12 '12 at 21:39

The open set ${\mathbb R} \backslash A$ is the union of at most countably many intervals $J_k$, of which at most two are unbounded. Let $f_k$ be a $C^\infty$ "bump" function that is positive on $J_k$ and $0$ everywhere else. If $J_k$ is unbounded, I'll require also that $f_k$ is constant outside some bounded interval. Take $f(x) = \sum_k c_k f_k(x)$ where $c_k > 0$ is small enough so that $|c_k f_k^{(j)}(x)| < 2^{-k}$ for $0 \le j \le k$ and all $x$. Then each series $\sum_k c_k f_k^{(j)}(x)$ converges absolutely and uniformly for all $x$, so that its sum is $f^{(j)}(x)$ and $f$ is $C^\infty$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.