# Distance of a point from a compact set in ##\Bbb{R}##

• Terrell
K\}\\&\Leftrightarrow \vert c-a\vert\leq\inf\{\vert c-x\vert : x\in K\}\vert\,\,\vert c-x_n\vert\leq\inf\{\vert c-x\vert : x\in K\}\vert\,\,\vert c-x_n+1\vert\\&\Leftrightarrow \vert c-a\vert\leq\inf\{\vert c-x\vert : x\inf

## Homework Statement

Let ##K\neq\emptyset## be a compact set in ##\Bbb{R}## and let ##c\in\Bbb{R}##. Then ##\exists a\in K## such that ##\vert c-a\vert=\inf\{\vert c-x\vert : x\in K\}##.

2. Relevant results
Any set ##K## is compact in ##\Bbb{R}## if and only if every sequence in ##K## has a subsequence that converges to a point in ##K##.

## The Attempt at a Solution

I was hinted that ##\inf\{|c-x|\mid x\in K\} \leq |c-x_n|\lt \inf\{|c-x|\mid x\in K\}+\frac{1}{n}##. Now it became clearer that if I was to set ##\vert c-a\vert=\inf\{|c-x|\mid x\in K\}##, then that means there exist as sequence ##(x_n)## in ##K## such that it converges to ##a\in\Bbb{R}##. Since ##K## is compact then it must contain ##a##. However, I think this argument is too informal. Please help me improve on it. Thank you.

## Homework Statement

Let ##K\neq\emptyset## be a compact set in ##\Bbb{R}## and let ##c\in\Bbb{R}##. Then ##\exists a\in K## such that ##\vert c-a\vert=\inf\{\vert c-x\vert : x\in K\}##.

2. Relevant results
Any set ##K## is compact in ##\Bbb{R}## if and only if every sequence in ##K## has a subsequence that converges to a point in ##K##.

## The Attempt at a Solution

I was hinted that ##\inf\{|c-x|\mid x\in K\} \leq |c-x_n|\lt \inf\{|c-x|\mid x\in K\}+\frac{1}{n}##. Now it became clearer that if I was to set ##\vert c-a\vert=\inf\{|c-x|\mid x\in K\}##, then that means there exist as sequence ##(x_n)## in ##K## such that it converges to ##a\in\Bbb{R}##. Since ##K## is compact then it must contain ##a##. However, I think this argument is too informal. Please help me improve on it. Thank you.
Try a proof by contradiction. Use a sequence like the one you have written in your attempted solution and suppose ##a \notin K##.

• Terrell
Are you allowed to use the least upper bound property? If so the proof is easy by considering the subset of elements of K that are less than c and the subset of elements of K that are greater than c.

If you are not allowed to use that property you could use the proof that is provided in the link. But that in turn depends on what facts about the reals, or about compact sets in general, you are allowed to use.

As fresh points out, you have not used 'compact' correctly. The statement you make there is correct for 'closed' or 'complete' but to be compact the set also has to be bounded. Indeed a common characterisation of compact in metric spaces is 'closed and bounded'.

• Terrell
Are you allowed to use the least upper bound property? If so the proof is easy by considering the subset of elements of K that are less than c and the subset of elements of K that are greater than c.
My initial intuition is pointing me towards a similar direction, but the hint seems to be pointing at another direction..? Anyway, I'll try to see what I can come up with. Thanks!

As fresh points out, you have not used 'compact' correctly. The statement you make there is correct for 'closed' or 'complete' but to be compact the set also has to be bounded. Indeed a common characterisation of compact in metric spaces is 'closed and bounded'.
I'm actually quite loss at what I am doing using the hint given. I hope you could point out exactly what I am doing wrong. Thank you again.

I'm actually quite loss at what I am doing using the hint given. I hope you could point out exactly what I am doing wrong. Thank you again.
The hint doesn't make any sense to me. It refers to a variable ##x_n## which is presumably part of some series, but it doesn't say what that series is.

BTW I think I should have said 'complete and bounded', not 'closed and bounded' above as equivalent to compact. I think the subset ##(\sqrt 2,\sqrt 3)## of ##\mathbb Q## is closed in ##\mathbb Q##, but it is not complete.

Are you allowed to use the least upper bound property? If so the proof is easy by considering the subset of elements of K that are less than c and the subset of elements of K that are greater than c.
I apologize if I placed a lot of unnecessary sentences as I've written everything in my scratchpad. Also, I haven't shown the g.l.b. is in ##K## since I might as well get my work checked before proceeding to the final step.

Assuming ##c\in K## and ##K## is closed, then ##c## is not a point of closure of ##K##; that is ##\exists\epsilon\gt 0## such that ##\forall N\in\Bbb{N}##, ##\exists m\gt N##, ##\vert c-x_m\vert\gt\epsilon##. Considering all elements ##q_1\in K## such that ##c\lt q_1##, we note that any sequence ##(q_n)## of ##K## such that ##\forall n\in\Bbb{N}##, ##c\lt q_n##, ##(q_n)## is bounded below by ##c## and by the Axiom of Completeness, they have a greatest lower bound, say ##\lambda##; we have ##\lambda\lt\dots\lt q_i\lt\cdots\lt q_j\lt\cdots##. So we have
\begin{align}
c\lt\lambda\leq\cdots\lt q_i\lt\cdots\lt q_j\lt\cdots\\
&\Leftrightarrow -\lambda\geq\dots\gt -q_i\gt\cdots\gt -q_j\gt\cdots\\
&\Leftrightarrow -(c-\lambda)\leq\cdots\lt-(c-q_i)\lt\cdots -(c-q_j)\lt\cdots\\
&\Leftrightarrow \vert c-\lambda\vert\leq\cdots\lt\vert c-q_i\vert\lt\dots\lt \vert c-q_j\vert\lt\cdots\\
\end{align}
Now we want to show that ##\inf\{\vert c-x\vert : x\in K\}=\vert c-\lambda \vert##. Suppose that it isn't, then ##\exists\lambda_1\in\Bbb{R}## such that ##\vert c-\lambda\vert \lt \vert c-\lambda_1\vert \leq \vert c-q_k\vert## for all ##q_k\in K##. But that implies ##\lambda \lt \lambda_1 \leq q_k, \forall q_k\in K## which means ##\lambda## is not the greatest lower bound of ##K##, a contradiction.

Last edited:
Assuming ##c\in K## and ##K## is closed
Did you mean ##c\notin K##? Otherwise the rest of the sentence doesn't follow.

... then ... ##\exists\epsilon\gt 0## such that ##\forall N\in\Bbb{N}##, ##\exists m\gt N##, ##\vert c-x_m\vert\gt\epsilon##.
##x_m## has not been defined, and needs to be.

Fortunately, you don't need either of the above, and the remainder of your writing doesn't seem to rely on it.
by the Axiom of Completeness
There are a number of different notions of completeness, not all of which are equivalent. See here. I will presume by how you are using it that you mean the least upper bound property, which we note is strictly stronger than Cauchy Completeness.

Considering all elements ##q_1\in K## such that ##c\lt q_1##, we note that any sequence ##(q_n)## of ##K## ...
There should be no need to introduce sequences, and doing so creates unnecessary difficulties. It may require us to use the Axiom of Choice, which should not be necessary to complete the proof. Just use the fact that the set of all numbers in K that are greater (less) than c must have a lower (an upper) bound a (b). Then focus on whichever of those is closest to c and deduce a contradiction from an assumption that it does not equal c.

What definition of compact have you been given? The standard definition is that any open cover of the set has a finite sub-cover. If so you should be able to prove for both of a or b that if it is not in K then there exists an open cover of K that has no finite subcover, thereby contradicting the assumption that K is compact. Thinking of one may be a bit tricky if you are not used to doing proofs involving sub-covers. I'd have to try to think of a hint that was helpful without giving the whole game away. On the other hand if you've been given a different definition of compact, an easier approach may be possible.

Last edited:
• Terrell
Then focus on whichever of those is closest to c
Is this what I did on post#7 ##(9), (10), (11), (12)##? Is that method problematic?
deduce a contradiction from an assumption that it does not equal c.
If you should be able to prove for both of a or b that if it is not in K then there exists an open cover of K that has no finite subcover, thereby contradicting the assumption that K is compact
I do have an idea how and I think it's something like the open cover of ##(0,1)## that is ##\bigcup_{n=1}^{\infty}(\frac{1}{n},1-\frac{1}{n})##?

Last edited:
Did you mean c∉Kc∉Kc\notin K? Otherwise the rest of the sentence doesn't follow.
Yes. It's a typo and I flipped a lot of "less than" signs. I just corrected them now. Thanks!

I do have an idea how and I think it's something like the open cover of ##(0,1)## that is ##\bigcup_{n=1}^{\infty}(\frac{1}{n},1-\frac{1}{n})##?
Yes that should work, with your open sets (open in K) being the intersection of those intervals with K. But you only need the 1/n buffer at one end of each interval - the end that's closest to a (or b). You can leave the other end unbounded (to ##\infty## or ##-\infty##).

• Terrell
es that should work, with your open sets (open in K) being the intersection of those intervals with K. But you only need the 1/n buffer at one end of each interval - the end that's closest to a (or b). You can leave the other end unbounded (to ∞∞\infty or −∞−∞-\infty).
Okay. I'll give this one a shot. :)

Yes that should work, with your open sets (open in K) being the intersection of those intervals with K. But you only need the 1/n buffer at one end of each interval - the end that's closest to a (or b). You can leave the other end unbounded (to ##\infty## or ##-\infty##).

It took me a while to stop thinking about this in sequences, though I still did use the idea of convergence of a sequence, but I hope this is in sync with what you have in mind :)

Suppose ##\vert c-\lambda\vert##= ##\inf\{\vert c-x\vert : x\in K\}## then consider ##\bigcup_{n=1}^{\infty}(\lambda+\frac{1}{n},\lambda+n)## and ##\mathscr{O}_{k}=(\lambda+\frac{1}{k},\lambda+k)##. Since the sequence ##(\lambda+\frac{1}{j})## converges to the value ##\lambda##, then ##\forall\epsilon\gt 0, \exists j\in\Bbb{N}## such that ##\lambda+\frac{1}{j}\in (\lambda-\epsilon,\lambda+\epsilon)## and more explicitly ##\exists q_j\in K## such that ##\lambda\lt q_j\leq \lambda+\frac{1}{j}\lt \lambda+\epsilon## because ##\forall j\in\Bbb{N}##, ##\lambda+\frac{1}{j}## is not the greatest lower bound. Thus, this implies that the ##\forall\epsilon\gt 0, \exists q_k\in K## such that ##q_k\in (\lambda-\epsilon,\lambda+\epsilon)##. Hence, ##\lambda## is a point of closure of ##K## and must be in ##K##, since ##K## is compact which means it contains all its points of closure.

The broad strategy looks good. There's still a bit of confusion over the use of inf and greatest lower bound. In the third line it seems to assume that ##\lambda## is an infimum of something. But that's not what has been assumed. Rather, the assumption (in your first line) was that ##\lambda## is a value of ##x## that delivers an infimum of a certain set of functions of ##x##. Either the nature of that assumption needs to be changed, so that ##\lambda## itself is actually a sup or inf of some set - and you may need to consider each of those separately, or the way that the inf is used needs to be changed to reflect what is actually an inf of what. The former sounds easier to me, even though it does require two cases. We can just do one of them, and then say do the other case the other way around.

• Terrell
Either the nature of that assumption needs to be changed, so that λλ\lambda itself is actually a sup or inf of some set - and you may need to consider each of those separately, or the way that the inf is used needs to be changed to reflect what is actually an inf of what. The former sounds easier to me
Yes, the former sounds easier for me too and actually I also meant to assume that ##\lambda## is an ##\inf## of all elements of ##K## greater than ##c##. Thanks!