Suppose $a\in\mathbb{R}$ and $S$ is a nonempty subset of $\mathbb{R}$ such that $S=\{q\in\mathbb{Q}, q<a\}$. Prove that $\sup(S)=a$. Here is my proof.

we argue by contradiction. Suppose $\sup(S)\neq a$. Then there exists a supremum $a'$ (because $S$ is nonempty bounded above subset of $\mathbb{R}$.) such that $a'<a$. By density of rational numbers, there exists $q$ such that $a'<q<a$. But this contradicts the fact that $a'$ is an upper bound of set $S$.

Is this proof legit?

• Is $S$ seen as a subset of $\mathbb R$ or $\mathbb Q$ ? Because as a subset of $\mathbb Q$, the supremum doesn't exist. But otherwise, your proof is correct for the case where $\sup(S)>a$. Do the same for $\sup(S)<a$ and you'll be done :-) – Surb Mar 7 '18 at 7:58
• @Surb wait why wouldn't sup exist? Is it because he can't use density then? – Hawk Mar 7 '18 at 8:01
• @Hawk The sup wouldn't necessarily exist because $\Bbb Q$ doesn't have the least upper bound property. – Alex Ortiz Mar 7 '18 at 8:03
• @Surb It is a subset of $\mathbb{R}$ . And then why my proof is correct only for the case where $\sup(S)>a$? Doesn't by contradiction it immediately results that $\sup(S)=a$? – Ling Min Hao Mar 7 '18 at 8:04
• @LingMinHao: It's indeed not complicate to have a contradiction in the case where $\sup(S)<a$, but you must do it. Indeed, to suppose that $a\neq b$ mean "$a<b$ OR $a>b$", and not only $a>b$. – Surb Mar 7 '18 at 8:07

Yes, it is correct, the clue is that the following holds: $$a,b\in \mathbb{R}: a < b \Rightarrow \exists q \in \mathbb{Q}: a < q < b$$ Which follows by the fact that $\mathbb{Q} \subseteq \mathbb{R}$ is a dense subset and thus has a nonempty intersection with the open set $(a,b)$.