# Construct a continuous function in metric space

1. Apr 12, 2010

### complexnumber

1. The problem statement, all variables and given/known data

Let $$(X,d)$$ be a metric space, and let $$A,B \subset X$$ be disjoint closed subsets.

1. Construct a continuous function $$f : X \to [0,1]$$ such that $$A \subseteq f^{-1}({0})$$ and $$B \subseteq f^{-1}({1})$$. Hint: use the functions below.

2. Prove that there are disjoint sets $$U,V \subset X$$ such that $$A \subset U$$ and $$B \subset V$$.

2. Relevant equations

$$f(x) := d(x,A) = \inf \{ d(x,y) | y \in A \}$$ is uniformly continuous on $$X$$.

3. The attempt at a solution

1. I see that for points in $$A$$ the hint function will always return $$0$$. So the preimage of $$\{ 0 \}$$ is set $$A$$. But how can I make the maximum distance from any point to $$A$$ to $$1$$ and keep the function continuous? And also how should I make this function return $$1$$ for all points in $$B$$?

2. I don't understand this (second) part of the question. Is this related to part one? Otherwise it seems obviously true.

2. Apr 12, 2010

### Gregg

Why don't you try to raise to powers?

$$a^0 =1$$

You know how to make the function return 0 for x in B don't you, and you know that x in B will return a finite value d(x,A).

3. Apr 12, 2010

### lanedance

some ideas, though they haven't been fully worked...
- first try drawing the hint function on a 1 d interval
- then consider the minimum distance between A & B, as they're closed & disjoint, can you say anything about it?

for the 2nd part i think you can probably use your continuous function, how about considering the preimage under f on open sets.... that said as you say you can probably do it otherwise with just properties of open & closed sets

4. Apr 12, 2010

### Gregg

Oh I was thinking

$$d(x,A)^{d(x,B)}$$

Does this not work

5. Apr 12, 2010

### lanedance

nice function & that works in A & B, but what about outside them? might have to clip it to 1? (not that it effects the 2nd part of the question)