Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
    
Use functions of the form $f_S(x):=\inf_{x\in S} d(x,y)$. –  Davide Giraudo Feb 25 '12 at 15:40

2 Answers 2

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.