0
$\begingroup$

This is a homework question in my analysis class:

Let $A$ and $B$ be two nonempty closed subsets of a metric space $X$ that do no intersect. Show that there is a continuous function $f:X\rightarrow [a,b]$ such that $f(x)=a$ for all $x\in A$ and $f(x)=b$ for all $x\in B$.

Can someone give me a hint?

  • 0
    Use functions of the form $f_S(x):=\inf_{x\in S} d(x,y)$.2012-02-25

2 Answers 2

1

Why don't you start by defining $g\in [0,1]^X$ by $g(x)\equiv \frac{d(x,A)}{d(x,A)+d(x,B)}$. This function is well defined since $A$ and $B$ are closed and the two sets do not intersect. Constructing your function is now trivial.

0

Well you have to deal with this function $g(x)=\frac{d(x,A)}{d(x,A)+d(x,B)}$ now you consider

$h(x)=(b-a)g(x)+a$.