# Every closed subset $E\subseteq \mathbb{R}^n$ is the zero point set of a smooth function

In Walter Rudin's Principles of mathematical analysis Exercise 5.21, it is proved that for any closed subset $E\subseteq \mathbb{R}$, there exists a smooth function $f$ on $\mathbb{R}$ such that $E=\{x\in \mathbb{R}\mid f(x)=0\}$.

Since $E^c$ is open in $\mathbb{R}$, $E^c$ is a countable disjoint union of open intervals $(a_i,b_i)$. On an interval $(a,b)$, if we let $f(x)=\exp(\frac{1}{(x-a)(x-b)})$, $x\in(a,b)$; $f(x)=0$, $x\notin(a,b)$, ($f(x)=\exp(\frac{1}{(x-a)})$ or $f(x)=\exp(\frac{1}{(x-b)})$ on $(a,\infty)$ and $(-\infty,b)$ resp.), then $f$ is smooth. Hence we can get a smooth function on $\mathbb{R}$ such that $E$ is the zero point sets of $f$.

(1). How about a closed subset $E$ of $\mathbb{R}^n$? is it true that for any closed subset $E\subseteq \mathbb{R}^n$, there exists a smooth function $f$ on $\mathbb{R}^n$ such that $E=\{x\in \mathbb{R}^n\mid f(x)=0\}$?

An open set in $\mathbb{R}^n$ cannot be written as a disjoint union of countable open balls hence the proof above is not valid. The partition of unity only claims that for an open set $U$, there exists open $V$ in $U$ such that $\bar V\subseteq U$ and a smooth function $f$ on $\mathbb{R}^n$ such that $supp f\subseteq U$, $f|_V=1$.

(2). The taylor series of $f(x)=\exp(\frac{1}{(x-a)(x-b)})$ does not converge around points $a,b$ hence $f$ is not analytic at $a,b$. Is it true that for any closed subset $E\subseteq \mathbb{R}$, there exists an analytic function $f$ on $\mathbb{R}$ such that $E=\{x\in \mathbb{R}\mid f(x)=0\}$?

1) Let $\{B_{r_j}(a_j)\}$ be a countable collection of open balls (radius $r_j$, centre $a_j$) whose union is the complement of $E$. Take $f(x) = \sum_j c_j g(\|x - a_j\|/r_j)$ for some smooth function $g$ which is nonzero on $[0,1)$ and $0$ on $[1,\infty)$ and a suitable sequence of positive numbers $c_j$.
• You don't need it to be locally finite: just choose the $c_j$ decaying rapidly enough that, with $f_j (x) = g(\|x - a_j\|/r_j)$, $|c_j | \|f_j^{(k)}\|_\infty < 2^{-j}$ for $k \le j$. – Robert Israel Apr 27 '15 at 5:19
• Don't we need the function composed by $g$ to be smooth for $f$ to be smooth ? For that we can squared the function, right ? – Subhadip Majumder Mar 13 '17 at 15:44
• @RobertIsrael why do you demand that $|c_j|||f_j^{(k)}||_\infty<2^{-j}$? What is that for? – rmdmc89 Feb 1 '19 at 22:13