6

In a complete and separable metric space $(X,\mathrm{d})$, let an open set $U$ and a closed set $K\subset U$ be given. 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 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.

311411
  • 3,576
Lolman
  • 1,818

3 Answers3

4

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.

PhoemueX
  • 36,211
4

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$.

orangeskid
  • 56,630
  • 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 – orangeskid 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
  • 1
    You can also use a much simpler function as $$ f_\varepsilon(x) = \max{1 - \varepsilon^{-1} d(x,K) ; 0 } $$ with $0<\varepsilon \leq \delta$. – user590533 Apr 07 '22 at 14:27
  • @user590533: Why not putting turning this idea in an answer-- it would be of real interest! – orangeskid Apr 19 '22 at 10:43
1

In the answer given by @orangeskid it is possible to use a much simpler function as $$ f_\varepsilon(x) = \max\{1-\varepsilon^{-1}d(x,K);0 \} $$ with $0<\varepsilon\leq \delta$