I understand that the definition of compactness varies. I am wanting to prove the set $[a,b]$ is compact the following [way](https://math.stackexchange.com/questions/368108/how-to-prove-every-closed-interval-in-r-is-compact) just like Julien did here for an answer. This proof is also similarly set up on p. 42 of Royden (second edition) for Real Analysis. There are many proofs of this result which all use the same trick which I am having a difficult time with.

I am going to start to the proof and explain where I am getting hung up. 

$\textbf{Proof:}$ Let $[a,b]$ be a set of real numbers where we will assume $a<b$. Let $\lbrace U\_i\rbrace\_{i\in I}$ be an arbitrary collection of open sets that is an arbitrary open cover of $[a, b]$. Then, by definition, we know $[a,b]\subseteq \bigcup\_{i\in I} U\_i$. Now, we need to show there exists a finite collection $\lbrace U\_1, U\_2, ..., U\_k\rbrace$ (i.e. a finite collection whose objects are open sets in the set $\lbrace U\_i\rbrace\_{i\in I}$) such that $[a,b]\subseteq \bigcup\_{j=1}^kU\_j$. 

What I am confused on now is why does everyone define the set $S=\lbrace x\in [a,b]|[a,x]\subseteq \bigcup\_{\text{C is a finite subset of I}} \lbrace U\_c \rbrace\_{c\in C}\rbrace$ after this part? 

I do not see how the set $S$ here resembles a finite collection of open sets $\lbrace U\_1, U\_2, ..., U\_k\rbrace$ like I was trying to show with the whole subset thing. Why do we want to show $LUB(S)=b$ (i.e. the least upper bound of the set $S$) do? I get lost at this part in the proof as to what we are trying to show.