2

Show that for any closed subset $A\subset \Bbb R,$ there exists a continons function $f$ on $\Bbb R$ which vanishes exactly on $A.$

I thought taking the function $f:\Bbb R\to\Bbb R$ such that $f(x)=\inf\{|x-a|:a\in A\}$ (where, $A\subset \Bbb R,$) would do the job.

This is because, the for any $a_0\in A$ we have, $f(a_0)=0$ (, which follows from the definition of $f$ ). But I am having a hard time showing that $f$ defined like this, is continuous on $\Bbb R.$ The problem precisely arises because I don't have an idea on how to use, the $\epsilon-\delta$ definition of continuity to show this.

In order to show that, $f$ is continuous at $c\in \Bbb R$ it will, suffice, to show that $\lim_{x\to c}f(x)=f(c).$ This, means, we need to show that $\forall \epsilon\gt 0,$ $\exists \delta \gt 0$ such that if $|x-c|\lt\delta$ then $|f(x)-f(c)|\lt \epsilon.$

Now, I tried to work with the expression $|f(x)-f(c)|.$ I noted that $,\forall a_1,a_2\in A$ we have, $||x-a_1|-|c-a_2||\leq |(x-a_1)-(c-a_2|=|(x-c)+(a_2-a_1)|\leq |x-c|+|a_2-a_1|.$

If I could show, that, $||x-a_1|-|c-a_2||\leq |x-c|$ then, I could claim that, $|f(x)-f(c)|\leq |x-c|.$ Finally, if, $|x-c|\lt\epsilon$ then, $|f(x)-f(c)|\leq |x-c|\lt\epsilon,$ and we are done.

  • But the question is, can I ever claim, $||x-a_1|-|c-a_2||\leq |x-c|.$

  • Also, if possible, say we are able to establish the above claim then, can we say directly, that, $|f(x)-f(c)|\leq |x-c|$ ? The confusion is because of the definition of $f,$ i.e $f(x)=\inf\{|x-a|:a\in A\},$ i.e because of the infimum thing. If I could write, $\min$ in place of $\inf$ I think things would have been simpler, but then again, I don't know whether we can.

Any help regarding this, will be highly appreciated.

2 Answers2

2

you are very close, this function is actually known as the distance of $x$ to the set $A$. A much stronger result hold (which you have predicted) in fact this function is Lipschitz. First note that:

$$f(x) \leq |x-a| \leq |x-y| + |y-a| $$

holds for all $a \in A$, hence taking infimums over $a \in A$ on both sides yields $f(x) - f(y) \leq |x-y| $ , by symmetry it follows that $f(y) - f(x) \leq |x-y| $, hence $|f(x) -f(y)| \leq |x-y|$.

  • @SamuelManasseh I have just one silly question: Is it a valid step to take the infimum on both sides of the inequality, i.e $f(x)\leq |x-y|+|y-a|$ ? I surely think it is, but why? How is this step justified? – Thomas Finley Oct 15 '23 at 04:45
  • well this is why you need that inequality to hold for all $a$, you have something of the form $f(x) \leq g(x,a)$, the left side $f(x)$ is not a function on $a$ hence it does not depend on it, so we can then minimize the right hand side (as the expression holds for all $a$) , i.e take an infimum. More generally this would also hold if $f$ depended on $a$ via the same idea – Samael Manasseh Oct 15 '23 at 04:50
  • Well, but the thing is, although $f(x)\leq |x-y|+|y-a|$ holds for all $a\in A,$ we aren't sure that it holds when $|y-a|$ is replaced by $f(y)$ because there might not exist an $a'\in A$ such that $f(y)=\inf{|y-a|:a\in A}=|y-a'|$. This is the part which makes the thing complicated. – Thomas Finley Oct 15 '23 at 04:58
  • we dont actually even need that. We have $f(x)\leq |x-y|+|y-a|$ for all $a$, then as the lhs does not depend of $a$ $$f(x) \leq \inf_{a \in A } ( | x - y| +|y-a| )$$ , but the first term does not depend of $a$ so $$f(x) \leq | x - y| +\inf_{a \in A } |y-a| = | x - y| + f(y) $$ – Samael Manasseh Oct 15 '23 at 05:03
  • I don't get the reasoning in your last comment. It appears that it is a vebatim of your claim(, which I know is correct but cannot prove). I think it would be better if you consider elaborating a bit. – Thomas Finley Oct 15 '23 at 05:24
0

Fix $A$, and consider any Cauchy sequence $\{x_i\}_{i\geq 1} \subseteq \mathbb{R}$. For each $i$ we also choose $z_i\in\overline{A}$ such that $|x_i - z_i| = f(x_i)$ (such a choice is not necessarily unique, but exists by definition of $f$).

Given $\epsilon > 0$, let $N$ be large enough so that $|x_i - x_j|< \epsilon$ whenever $i,j\geq N$. By the triangle inequality,

$$\begin{align*} f(x_i) &=|x_i - z_i|\\ &\leq |x_i - z_j|\\ &\leq |x_i - x_j|+|x_j - z_j| \\ &< \epsilon + f(x_j) \end{align*}$$

Likewise $f(x_j) < \epsilon + f(x_i)$ by symmetry, so combining these two facts, we get $$|f(x_i) - f(x_j)| < \epsilon$$

Hence $\{f(x_i)\}_{i\geq 1}$ is Cauchy as well, so $f$ is continuous.