Problem 2

Exercise 10.2 (Separating functional in a metric space)   Let $X$ be a metric space and let $A$ and $B$ be disjoint closed subsets of $X$. There exists a continuous function $f : X\to[0,1]$ such that $f(A)=\{0\}$ and $f(B)=\{1\}$.

Proof. For any closed set $F$, define a distance function $d(\cdot,F) : X \to \mathbb{R}_{\geq 0}$.

$\displaystyle d(x,F) = \inf\{d(x,y) \;\vert\; y\in F\}$ (10.10)

The function $d(\cdot,F)$ can be argued to be continuous in a sequential fashion. Suppose $x_n\to x$. Then

$\displaystyle \lim_{n\to\infty} d(x_n, F)$ $\displaystyle = \lim_{n\to\infty} \inf_{f\in F} d(x_n, f)
= \inf_{n\geq 1} \sup...
...nf_{f\in F} d(x_m, f)
\leq \inf_{n\geq 1} \inf_{f\in F} \sup_{m\geq n} d(x_m,f)$ (10.11)
  $\displaystyle \leq \inf_{f\in F} \inf_{n\geq 1} \sup_{m\geq n} d(x_m,f) =
\inf_{f\in F} \lim_{n\to\infty} d(x_n,f)=
\inf_{f\in F} d(x,f)=d(x,F)$ (10.12)

To finish, the definition of infimum says $d(x,F)\leq d(x,f)$ for all $f\in F$, so $\lim d(x_n, F) = d(x, F)$, indicating $d(\cdot,F)$ is continuous.

Since $A$ and $B$ are disjoint closed sets and $X$ is a metric space, the following distances are nonzero for any $a\in A$ and $b\in B$.

$\displaystyle d(a,B) \quad d(b,A)$ (10.13)

This implies $d(x,A)+d(x,B)\neq 0$ for if the sum were zero, then both the summands would equal zero, which indicates $x\in A$ and $x\in B$, contradicting that $A$ and $B$ are disjoint.

Now we are free to define a continuous function

$\displaystyle f(x) := \frac{d(x,A)}{d(x,A) + d(x,B)}$ (10.14)

If $x\in A$, then $d(x, A)=0$, so $f(x)=0$. If $x\in B$, then $d(x,B)=0$, so $f(x)=d(x,A)/d(x,A)=1$. $\qedsymbol$