Let a be a real number and let $S = \{ x \in Q : x <a \}.$ prove that $a = sup S.$
I know the proof of the theorem given below, which I feel very similar to the proof of the required problem:
But exactly how will they differ, could any one tell me How?
My attempt is: It is obvious that the set $S$ is a nonempty set that is bounded above by $a$, so by the completeness axiom it has a least upper bound, say $s$. Suppose to the contrary that $a \neq s$ then there exists $y \in S$ such that $x \leq y$ for all $x \in S$ and $y < a$. but after this how can I complete? could anyone help me please?

You can use the density of Rationals in Real Numbers to prove your result.
To prove that $a$ is the supremum of the given, set we shall exploit its property that any number less than $a$ cannot be an upper bound for the set.
Therefore, take $\epsilon > 0$ (arbitrarily). Then consider the number $a - \epsilon$. Clearly, $a - \epsilon < a$ is a real number. Now, by density of rationals in real numbers, $\exists q \in \mathbb{Q}$ such that $a - \epsilon < q < a$. Since $q < a$, we have $q \in S$ and also $q > a - \epsilon$ and hence $a - \epsilon$ is not an upper bound for $S$. Since this is true for all $\epsilon$, we can conclude that $a$ is the supremum of $S$.