The aspect of the Heine-Borel Theorem I wish to prove is the following:
Proposition: Suppose $K\subset\mathbb{R}$ is a closed and bounded set and let {$O_{\lambda} : \lambda \in \Lambda$} be an open cover for $K$. Then there exists a finite subcover for $K$.
Below is my proof of the proposition and I have some doubt on whether the proof is correct. I also realise that the proof is rather lengthy so any ways to shorten it would also be very much appreciated. Thank you for reading :).
Proof. Since $K$ is closed and bounded, $a =$ inf $K$ and $b =$ sup $K$ both exist and $K$ contains them. Define the set S as follows: $S$ = { $x \in K : K \cap [a,x]$ has a finite subcover in { $O_{\lambda} : \lambda \in \Lambda$ } }. This set is clearly bounded as $S \subseteq K$ which is bounded while also being nonempty as $a \in S$. Therefore, $s=$ sup $S$ exists. Furthermore, as $S \subseteq K$, $a$ is a lower bound and $b$ is an upper bound for $S$ yielding that $a\leq s\leq b$.
Firstly, I show that $s \in S$. Since $s$ is the supremum of $S$, there exists a sequence in $S$ that converges to $s$. Since $S \subset K$, this sequence is in $K$ as well. $K$ is compact, so the sequence has a convergent subsequence which converges to a limit in $K$. But, this limit is $s$ so $s \in K$. Therefore, $\exists\lambda_0\in\Lambda:s\in O_{\lambda_0}$. $O_{\lambda_0}$ is open so $\exists\epsilon\gt0: V_{\epsilon}(s)\subseteq O_{\lambda_0}$. $s$ is the supremum meaning that $s-\epsilon$ is not an upperbound for $S$. So $\exists x \in S: s-\epsilon\lt x\leq s$. $K\cap[a,x]$ has a finite subcover {$O_{\lambda_1},...,O_{\lambda_n}$}. Then break up the intersection:
$$K\cap[a,s]=K\cap([a, s-\epsilon]\cup(s-\epsilon, s])=(K\cap[a,s-\epsilon])\cup(K\cap(s-\epsilon,s])$$
Certainly, $[a,s-\epsilon]\subseteq[a,x]$ so $K\cap[a,s-\epsilon]\subseteq K\cap[a,x]\subseteq\bigcup_{j=1}^n O_{\lambda_j}$. Also, $(K\cap(s-\epsilon,s])\subseteq(s-\epsilon, s]\subseteq(s-\epsilon, s+\epsilon)\subseteq O_{\lambda_0}$ which then implies
$$K\cap[a,s]\subseteq\left(\bigcup_{j=1}^n O_{\lambda_j}\right)\cup O_{\lambda_0}$$
so we have found a finite subcover for $K\cap[a,s]$ proving that $s\in S$.
Now I prove that $s=b$. Assume, for contradiction, that $a\leq s\lt b$. From above $s\in S$ so we may extract a finite subcover {$O_{\lambda_1},...,O_{\lambda_n}$} for $K\cap [a,s]$. Of course, $\exists j: s \in O_{\lambda_j}$. $O_{\lambda_j}$ is open so $\exists \epsilon_1\gt0:V_{\epsilon_1}(s)\subseteq O_{\lambda_j}$. Then set $\epsilon=$ min{$\epsilon_1, b-s$}.Then consider $K\cap\left[a, s+\frac{\epsilon}{2}\right]$:
$$ K\cap\left[a, s+\frac{\epsilon}{2}\right]=K\cap\left(\left[a,s-\frac{\epsilon}{2}\right]\cup\left(s-\frac{\epsilon}{2},s+\frac{\epsilon}{2}\right)\right)\\ K\cap\left[a, s+\frac{\epsilon}{2}\right]=\left(K\cap\left[a,s-\frac{\epsilon}{2}\right]\right)\cup\left(K\cap\left(s-\frac{\epsilon}{2},s+\frac{\epsilon}{2}\right)\right) $$
But $K\cap\left(s-\frac{\epsilon}{2},s+\frac{\epsilon}{2}\right)$ is a subset of $\left(s-\frac{\epsilon}{2},s+\frac{\epsilon}{2}\right)$ which is a subset of $(s-\epsilon,s+\epsilon)$ which is a subset of $O_{\lambda_j}$. Also, $K\cap\left[a,s-\frac{\epsilon}{2}\right]$ is a subset of $K\cap[a,s]$ which is covered by $O_{\lambda_1}\cup...\cup O_{\lambda_n}$. Therefore,
$$ K\cap\left[a, s+\frac{\epsilon}{2}\right]\subseteq(O_{\lambda_1}\cup...\cup O_{\lambda_n})\cup O_{\lambda_j} $$
But since $O_{\lambda_j}\in${${O_{\lambda_1},...,O_{\lambda_n}}$}, $(O_{\lambda_1}\cup...\cup O_{\lambda_n})\cup O_{\lambda_j}=O_{\lambda_1}\cup...\cup O_{\lambda_n}$. This forms a finite subcover for $K\cap\left[a, s+\frac{\epsilon}{2}\right]$. Then define $x_0=$ inf$\left(K\cap\left[s+\frac{\epsilon}{2},b\right]\right)$. $x_0$ is well-defined as the set is bounded and nonempty. To see this, observe: $$s+\frac{\epsilon}{2}\leq s+\frac{b-s}{2}=\frac{s+b}{2}\lt b$$ meaning that $s+\frac{\epsilon}{2}$ is not an upperbound for K. Therefore $\exists x \in K : s+\frac{\epsilon}{2} \lt x \leq b$ implying that $x \in K\cap\left[s+\frac{\epsilon}{2},b\right]$. Furthermore, this set in an intersection of closed and bounded sets implying that it itself is closed and bounded. Hence, $x_0 \in K\cap\left[s+\frac{\epsilon}{2},b\right]$. Note this also means $x_0$ is in $K$. Now, consider $K \cap [a, x_0]$. Breaking the intersection apart yields
$$ K \cap [a, x_0] = K \cap \left(\left[a, s+\frac{\epsilon}{2}\right]\cup\left[s+\frac{\epsilon}{2},x_0 \right]\right) = \left(K\cap\left[a, s+\frac{\epsilon}{2}\right]\right)\cup\left(K\cap\left[s+\frac{\epsilon}{2},x_0\right]\right) $$ Suppose $x\in K\cap\left[s+\frac{\epsilon}{2},x_0\right]$ which is nonempty as $x_0$ is an element. $x_0$ is a lower bound for $K\cap\left[s+\frac{\epsilon}{2},x_0\right]$ as it is the infimum for a set which contains it, namely, $K\cap\left[s+\frac{\epsilon}{2},b\right]$. So $x\geq x_0$. But also, by definition, $x\leq x_0$ so $x=x_0$. Thus, $K\cap\left[s+\frac{\epsilon}{2},x_0\right]$ is identically {$x_0$}. So, $$K \cap [a, x_0] = \left(K\cap\left[a, s+\frac{\epsilon}{2}\right]\right)\cup \{ x_0 \}.$$ $x_0 \in K$ so $\exists \lambda' \in \Lambda : x_0 \in O_{\lambda'}$. This unioned with the finite subcover we found above for $K\cap\left[a, s+\frac{\epsilon}{2}\right]$ forms a finite subcover for $K\cap[a, x_0]$. This means $x_0 \in S$. But $x_0\geq s+\frac{\epsilon}{2}\gt s$ which contradicts that $s$ is the supremum of $S$. Therefore, we may conclude $s=b$.
$b$ is therefore in $S$ implying that $K\cap[a,b]$ has a finite subcover. But this set is identically $K$ as every element of $K$ is in between $a$ and $b$ inclusive. So $K$ has a finite subcover as desired.