# Existence of a smooth function with a given kernel

Let $K\subset \mathbb{R}^n$ be a closed set, then is there existing a smooth function $f\in C^{\infty}(\mathbb{R}^n,\mathbb{R})$, such that $$(1)\quad f\ge 0,$$ $$(2) \quad f^{-1}(0)=K.$$

-
 Yes: first deal with the case where $K$ is the complement of an open ball, then jump to the general case writing $K$ as a countable union of such sets. – Davide Giraudo Oct 12 '12 at 14:21 @DavideGiraudo: Did you mean countable intersection? – Harald Hanche-Olsen Oct 12 '12 at 15:23 @HaraldHanche-Olsen Yes (now I can't edit the commnet anymore). – Davide Giraudo Oct 12 '12 at 15:29