Proof verification: Compact set has sup and inf I was reading this post compact set always contains its supremum and infimum

There was an answer reposted as follows:


  As $K$ is compact, we have that $K$ is bounded. So $\sup K$ and $\inf
 K$ exists. By definition $\sup K$, for every $n \in N$ exists $x_n \in
 K$ such that $\sup K- x_n&lt;1/n$ then $\sup K = \lim x_n$ with $x_n \in
 K$, as K is closed follows that $\sup K \in K$. To inf is analogous.
  Ps: Compact ⇒ closed and bounded.


This proof is quite attractive but I do not get the idea that just because $\sup K$ exists, therefore there exists a sequence approaching it. 

Can someone please explain this part to clarify why that $\sup K$ must exist for a compact set $K$?
Here is why there always exists a sequence in $K$ converging to $\sup K$, provided its existence (which is guaranteed by the fact that bounded sets always have a least upper bound in $\Bbb R$).

Let $A\subseteq \Bbb R$ and let $s=\sup A&lt;+\infty$.

If there were a $n&gt;0$ such that $\left(s-\frac1n,+\infty\right)\cap A=\emptyset$, then $s-\frac1{2n}$ would be an upper bound for $A$, which would contradict the fact that $s$ is the least upper bound of $A$. Therefore, for all $n$ there must exist $x_n\in A$ such that $x_n&gt; s-\frac1n$.

But since $s$ is an upper bound of $A$ and $x_n\in A$, it must hold $x_n\le s$ as well.

Therefore $s-\frac1n &lt; x_n\le s$. By the squeeze therem, $x_n\to s$.
Compact is equivalent to closed + bounded in R. Bounded sets in R have sup and inf.