# Urysohn's lemma with Lipschitz functions

In a complete and separable metric space $(X,\mathrm{d})$ given an open set $U$ and a closed set $K\subset U$. Is it possible to find a Lipschitz function $f$ such that $f|_K=1$ and $f|_{X\setminus U}=0$?

By Urysohn's Lemma we know that a a complete metric space is normal (i.e. the closed sets are separable by neighbourhoods) and as such the closed sets are separable by continuous functions. So a continuous function exists but I don't see anything more than that.

If $d(K,X\backslash U) = 0$ then no uniformly continuous function $1$ on $K$ and$0$ on $X \backslash U$ exists. So you might want some compactness condition.

If $X$ is a subset of some $\mathbb{R}^n$ with the induced metric or a manifold with a Riemannian metric then one can find smooth functions $f$ satisfying the conditions. Smooth functions are locally Lipschitz.

For any metric space $X$ it's easy to write an explicit $f$:

$$f(x) = \frac{d (x, X \backslash U)}{ d(x,K) + d(x,X \backslash U)}$$

Assume that $d(K, X\backslash U) = \delta >0$. Now use the fact that the functions $x \mapsto d(x,K)$, $x \mapsto d(x,X \backslash U)$ are Lipschitz with constant $1$ and the fact that the function $(a,b) \mapsto \frac{a}{a+b}$ is Lipschitz on $\{ (a,b) \ | a,b \ge 0\ \textrm{and } a+ b \ge \delta \}$ to conclude that $f$ is Lipschitz. The Lipschitz constant turns out to be $1/\delta$, the best we can get.

More general, on any subset $A$ on which $d(x,K) + d(x,X \backslash U)$ is bounded below by $\eta>0$ the restriction of $f$ to $A$ is Lipschitz with constant $\eta$.

• I don't work in locally compact spaces right now so $K$ is just closed. And $\mathrm{d}(K,X\setminus U)>0$ if they are disjoint in a metric space because it is a normal space. Still I like you solution. – Lolman Sep 10 '14 at 12:17
• Just saw it. I just need to take the epigraph of $\frac{1}{x^2}$ for $x>0$ and for $x<0$ as the to sets. – Lolman Sep 10 '14 at 12:23
• yes. Note that in both the solutions the Lipschitz constant is exactly $1/d(K, X\backslash U)$, can't be smaller for sure – Orest Bucicovschi Sep 10 '14 at 12:27
• But even then a continuous function still exists. and your solution becomes locally Lipschitz. Still a good thing. In that case I would need a bounded function, but still a good thing. – Lolman Sep 10 '14 at 12:31

In general, this can not be done.

To see this, note that this would imply that for $x \in K$ and $y \in X \setminus U$, we have

$$1 = |f(x) - f(y)| \leq L \cdot d(x,y),$$

where $L$ is the Lipschitz-constant of $f$.

Hence $d(x,y) \geq 1/L$ for all $x \in K, y \in X\setminus U$, i.e. the distance $d(K,X\setminus U) \geq 1/L > 0$ is strictly positive. But there are examples of such sets with $d(K, X\setminus U) = 0$ (even in $\Bbb{R}^2$).

Now, assume that $\varepsilon := d(K,X \setminus U) > 0$. Set

$$f(x) := \min\{1 , d(x, X\setminus U)/\varepsilon\}.$$

It is an easy exercise to show that $f$ is Lipschitz with the desired properties.

• your solution is more elegant – Orest Bucicovschi Sep 10 '14 at 12:12
• and I feel good that both functions have the Lipschitz constant exactly $1/\epsilon$ – Orest Bucicovschi Sep 10 '14 at 12:24
• I see and understand, I assumed to work with a bounded open set for simplicity so I overlook the possibility to have problems. – Lolman Sep 10 '14 at 12:34