A question about the proof of closed and bounded $\Rightarrow$ compactness A subset $S$ of $\mathbb{R}$ is compact iff it is bounded and closed. I am going over the proof of this theorem. To show that bounded and closed implies compactness, the argument follows the following strategy:

*

*Let $\mathcal{F}$ be an open cover of $S$.

*Define $S_x = S \cap (-\infty, x]$

*$B = \{ x : S_x \text{ is covered by a finite subcover of } \mathcal{F} \}$

*If $B$ is bounded, then it will yield a contradiction

*Therefore, $B$ is not bounded and it follows that $S$ is compact.

My question is why $B$ not being bounded implies that $S$ is compact.
My guess is that if $x \in B$, then $S_x$ is covered by a finite subcover of $\mathcal{F}$. $S \subset S_x$ if $x > \sup S$, so if $B$ is not bounded then all the points of $S$ are covered by a finite subcover of $\mathcal{F}$, which implies that $S$ is also covered by a finite subcover of $\mathcal{F}$. One thing that is unsatisfactory with my observation is that according to this view, it would be enough to show there exists $y$ such that $\sup S < y$ and $y \in B$.
 A: This is an interesting proof outline that I haven't seen before, but the argument would go as follows.
Let $S \subseteq \mathbb{R}$ be closed and bounded. Assume for contradiction that $B$ is bounded above. Then $q:= \sup B< \infty$.
Case 1: $q \notin S$. Since $S$ is closed, its complement is open and we can pick $r>0$ such that $S$ doesn't intersect the interval $(q-r,q+r)$. By definition of supremum, $S \cap (- \infty, q-r/2]$ is covered by a finite subcover of $\mathcal{F}$. But then the same must be true of $S \cap (- \infty, q+r/2]$, which contradicts that $q$ is the supremum.
Case 2: $q \in S$. Then there is an open set $Q \in \mathcal{F}$ and $r>0$ such that $(q-r,q+r) \subseteq Q$. By definition of supremum, $S \cap (- \infty, q-r/2]$ is covered by a finite subcover of $\mathcal{F}$. But then that same subcover with $Q$ included if not already must cover $S \cap (- \infty, q+r/2]$, which contradicts that $q$ is the supremum.
In either case, we have a contradiction, so we conclude that $B$ isn't bounded above. Since $S$ is bounded, there is $N \in \mathbb{R}$ such that $S \cap (- \infty,N]=S$. Pick $M \in B$ such that $M \geq N$. Then we have a finite subcover of $S \cap (- \infty,M]=S$.
While it seems we didn't use that $S$ is bounded below, this is in fact needed to show that $B$ is nonempty, before the argument above can be used
