Poof verification: if a set $K$ is compact, both $\sup K$ and $\inf K$ exist and are contained in $K$

Exercise 3.3.1 in Stephen Abott's book poses the following question.

Show that if $$K$$ is compact and non-empty, then $$\sup K$$ and $$\inf K$$ both exist and are elements of $$K$$.

I attempted to write a simple proof, and would like someone to verify, if the proof is technically correct and rigorous.

My Attempt.

Let $$K$$ be compact and non-empty. By the theorem on the characterization of compactness, $$K$$ is closed and bounded. Since $$K$$ is a bounded subset of $$\mathbf{R}$$, by AoC, $$K$$ has a supremum and an infimum. Let $$s = \sup K$$.

There is a trichotomy. Either (i) $$s \in int(K)$$ (ii) $$s \in \partial K$$ (iii) $$s \in ext(K)$$.

(i) Suppose $$s \in int(K)$$. Then, there exists an $$\epsilon$$ such that the open interval $$(s - \epsilon,s + \epsilon)$$ is contained in $$K$$. Consider $$s + \epsilon/2 \in (s, s+\epsilon) \cap K$$. $$s + \epsilon/2 > s$$. But, this implies that $$s$$ is not an upper bound for $$K$$, which is a contradiction. Hence, $$s \notin int(K)$$.

(ii) Suppose $$s \in ext(K)$$. Then, there exists an $$\epsilon > 0$$ such that the open interval $$(s - \epsilon,s + \epsilon)$$ is contained in $$K^C$$. Consider $$s - \epsilon/2 \in K \cap (s - \epsilon,s)$$. $$s - \epsilon/2 \ge x$$ for all $$x \in K$$, and $$s - \epsilon/2 < s$$. So, $$s$$ is not an upper bound for $$K$$, which is a contradiction. Hence, $$s \notin ext(K)$$.

(iii) If $$s \in \partial K$$, because $$K$$ is a closed set, $$\partial K \subseteq K$$. So, $$s \in K$$.

A similar argument can be made for $$\inf K$$.

This closes the proof.

• Sounds good to me. Another approach is to use the fact that if $s = \mathbf{sup} (X)$ then $s = \lim_n x_n$ for some $(x_n) \subset X$. In particular, when $X$ is closed we have $s \in X$. – guidoar Jan 24 at 8:51
• @guidoar, I wasn't entirely sure about that approach. For example, consider $K = [0,1] \cap \{2\}$. This is a closed and bounded set. So, it is compact. $\sup K = 2$, which is not a limit point. – Quasar Jan 24 at 8:54
• $2$ is still a limit point, it's just not an -accumulation point-. – John Samples Jan 24 at 8:55
• The sequence in that case is the constant sequence $2$, assuming you meant $[0,1] \cup \{2\}$ – guidoar Jan 24 at 8:55
• Proof of my claim: since $s$ is a supremum, for each $n \geq 1$ the exists $x_n \in S$ such that $s-1/n \leq x_n$. Then $0 \leq s-x_n \leq 1/n$. Now use take limit and use the "sandwhich" theorem (not that we may very well have $x_n = s$ for some or all $n$). – guidoar Jan 24 at 8:57

Everything's fine except #2. Just because it's not in the set doesn't mean it isn't an upper bound; indeed, if $$s > k$$ for every $$k \in K$$ then it's still an upper bound. Also, it may be that $$s$$ is between components of $$K$$, or it could be less than every element of $$K$$ . . . being in the exterior of $$K$$ doesn't give you any info about if it's an upper/lower bound or neither.
The argument should look more like "$$K$$ is compact so closed, so ext($$K$$) is open, so $$s$$ is contained in an interval that doesn't intersect $$K$$." Then if $$s$$ is supposed to be the sup, you should have elements (not necessarily distinct, as per your comment) of $$K$$ converging to $$s$$ from below. But that's impossible, since the interval you constructed doesn't intersect $$K$$.
• Hi, I agree that just because $s$ belongs $K^C$, doesn't mean it's an upper bound. But, we've already assume $s = \sup K$, so isn't it like implicit that $s > k$ for all $k \in K$? – Quasar Jan 24 at 9:07
• Well that's sort of what you're trying to show, tho ofc it might be $\geq$ rather than just >. If you are using the set-theoretic sup, what you'll wanna do is note that any other element in that interval not intersecting $K$ is ALSO greater, and it contains elements less than $s$. So $s$ can't be the limsup, since there are lesser numbers than $s$ that are also a sup. – John Samples Jan 24 at 9:10
• I think the issue John raises is that you need to justify your contradiction: yes, we have that $s \geq k$, but the contradiction is supposed to stem from the fact that $s$ is no longer the best upper bound. I.e. we should justify why $s- \varepsilon /2$ is still an upper bound. But I guess that's alright since the whole interval $(s-\varepsilon/2,s)$ is in the complement of $K$ and by definition of $s$ so is $(s,+\infty)$. Hence $K \subset (s-\varepsilon/2,+\infty)^c$ and $s-\varepsilon/2$ is an upper bound, a contradiction. – guidoar Jan 24 at 9:11