Let $V$ be a non-empty open set of real numbers , then how to prove that there is a continuous function $f:\mathbb R\to \mathbb R$ such that $V=\{x\in \mathbb R:f(x)>0\}$
Asked
Active
Viewed 126 times
2
-
4Take $f(x)$ to be the distance of $x$ to the complement of $V$. – Etienne May 31 '14 at 08:16
-
1@Etienne Would it also work to take the convolution of the characteristic function of $V$ with a bump function? – Rudy the Reindeer May 31 '14 at 19:43
-
@MattN. I'm afraid your convolution will be positive at some points outside $V$. – Etienne May 31 '14 at 21:53
-
@Etienne Too bad : ) Thank you for your comment! – Rudy the Reindeer Jun 01 '14 at 05:26
1 Answers
1
Etienne's comment is a canonical construction of such a function: $$f(x) = \inf\{ |x-y| : y\in \mathbb R\setminus V\} $$ The key points are:
- $f(x)=0 $ when $x\notin V$ (easy)
- $f(x)>0$ when $x\in V$ (use the fact that $V$ contains a neighborhood of $x$ to give a lower bound for the set $\{ |x-y| : y\in \mathbb R\setminus V\}$
- $f(x) \le f(x')+ |x-x'|$ for all $x,x'\in \mathbb R$ (use the triangle inequality)
- $|f(x) - f(x')| \le |x-x'|$ (use item 3 twice)
As an aside: it is also possible to construct a smooth function $f$ with this property, see Every closed subset $E\subseteq \mathbb{R}^n$ is the zero point set of a smooth function.