# A nowhere locally constant smooth version of Urysohn's lemma for an empty interior closed set

Let $$K\subset \mathbb{R}^2$$ be a closed set with no interior points. Can we find an open set $$U\subset \mathbb{R}^2$$ containing $$K$$ and a smooth (or at least $$\mathcal{C}^1$$) function $$f:U\to \mathbb{R}$$ attaining the value $$0$$ such that

1. $$f^{-1}(0) = K$$;
2. $$f$$ is nowhere locally constant? (i.e. $$f$$ is not constant on any open neighborhood)

Notice that, since $$f$$ is at least $$\mathcal{C}^1$$, the nowhere locally constant condition is equivalent to say that the closed set $$(\nabla f)^{-1}(0)\subset \mathbb{R}^2$$ has no interior points. Here, $$\nabla f$$ denotes the gradient of $$f$$ and $$0$$ is of course the null vector in $$\mathbb{R}^2$$.

In John Lee's Introduction to Smooth Manifolds, we have a similar result, but without the stronger nowhere locally constant condition:

Theorem 2.29 (Level Sets of Smooth Functions). Let $$M$$ be a smooth manifold. If $$K$$ is any closed subset of $$M$$, there is a smooth nonnegative function $$f:M\to \mathbb{R}$$ such that $$f^{-1}(0)=K$$.

Naturally, I tried to make use of this result and here are some ideas.

In particular, since Lee's function is nonnegative, we have that all points in $$K$$ are global minima and hence $$\nabla f=0$$ on $$K$$. Denote $$\tilde{K}:=(\nabla f)^{-1}(0)$$. This set is closed (as already mentioned) and contains $$K$$.

If $$\tilde{K}$$ doesn't have interior points, we don't need to do anything. So let's suppose that the interior $$\tilde{K}^\circ$$ of $$\tilde{K}$$ is nonempty.

My idea is to find an open neighborhood $$U$$ containing $$K$$ with $$\tilde{K}^\circ\subset \mathbb{R}^2-U$$ and then take the restriction of $$f$$ to $$U$$.

Notice that no point of $$K$$ can be adherent to a connected component of $$\tilde{K}^\circ$$: if this happens for a point, say $$p\in K$$, then since $$f$$ is constant on that connected component, this constant must be the same as given by $$f(p)$$. But $$p\in K$$ gives $$f(p)=0$$. Since $$f^{-1}(0)=K$$, this open set must be contained in $$K$$, but this contradicts the fact that $$K$$ has no interior points, by hypothesis.

I draw attention to the fact that Lee's function is constructed (using a partition of unity argument) for any closed subset $$K$$, without the additional hypothesis of no interior points. Maybe we can forget Lee's result and make use of this additional information to construct an alternative nowhere locally constant version in that case?

In fact, a stronger result holds:

Theorem. Let $$C\subset \mathbb R^n$$ be a closed subset with the complement $$\Omega=\mathbb R^n\setminus C$$, $$f: \mathbb R^n\to \mathbb R$$ a function of class $$C^s$$ ($$0\le s\le \infty$$), $$\epsilon: \mathbb R^n\to \mathbb R$$ a continuous function vanishing on $$C$$ and strictly positive on $$\Omega$$. Then there is a $$C^s$$-smooth function $$F: \mathbb R^n\to \mathbb R$$ whose restriction to $$\Omega$$ is real-analytic and such that $$|f(x)-F(x)|\le \epsilon(x), x\in \mathbb R^n.$$ (Moreover, $$|D^\alpha(f)(x)-D^\alpha(F)(x)|\le \epsilon(x)$$ for all partial derivatives with multiindex $$\alpha$$, $$|\alpha|\le s$$, $$x\in \mathbb R^n$$.)

See Theorem III in

Whitney, Hassler, Analytic extensions of differentiable functions defined in closed sets, Trans. Am. Math. Soc. 36, 63-89 (1934). ZBL0008.24902.

(Actually, Whitney proves much more.)

Corollary. Let $$C\subset \mathbb R^n$$ be a closed subset with the complement $$\Omega=\mathbb R^n\setminus C$$. Then there exists a $$C^\infty$$-smooth function $$F: \mathbb R^n\to \mathbb R$$ whose restriction to $$\Omega$$ is real-analytic and such that $$C=F^{-1}(0)$$. In particular, $$F$$ is nonconstant on every nonempty open subset of $$\Omega$$.

Proof. Take the function $$f: \mathbb R^n\to \mathbb R$$ as in Theorem 2.29 in Lee's book: $$f^{-1}(0)=C$$, $$f(x)>0$$ for all $$x\in \Omega$$, $$f$$ is $$C^\infty$$-smooth. (In fact, Whitney was the first to prove the existence of such functions.)

Take $$\epsilon(x):= f(x)/2$$. Now apply Whitney's theorem and construct a function $$F$$ as in the theorem. By the choice of $$\epsilon(x)$$, we will have $$F(x)=0, x\in C, F(x)>0, x\notin C.$$ qed.

• In your first stated theorem, you say $F$ is continuous. Can we guarantee at least $\mathcal{C}^1$? Commented Jul 25 at 13:11
• @Derso: Yes, one just need to quote Whitney's theorem with stronger approximation property. I will do this later. Commented Jul 25 at 13:21