About the fact that $\mathbb Q$ has gaps In my book there are two theorems:


*

*$1.$ The number $\sqrt 2$ is irrational because if we put $\sqrt 2 = \frac pq$ for some integers  $p, q$ where $p, q$ have no common factors, then we get a contradiction.

*$2.$ The set $A = \mathbb Q \cap (0, \sqrt 2)$ has no largest number and $B = \mathbb Q \cap (\sqrt 2, \infty)$ has no smallest number.
Are the two theorems above saying the same thing or are they mutually exclusive? The reason I ask is because in a math book (AFAIK) the same statement is not usually reproven again after it's proven the first time without an explicit mention. So I was wonderig if there's some subtle difference between the two theorems above.
The technical part of the second theorem is not difficult, but I am having some uneasy time linking the fact that $A, B$ have no largest/smallest numbers with the fact that $\mathbb Q$ has gaps. Is the theorem saying that $\sqrt 2 \not \in A$ and $\sqrt 2 \not \in B$? But isn't that by very definition of $A, B$?
Thanks.
 A: Theorem $(1)$ would have been used in theorem $(2)$ if the open intervals were closed  at the $\sqrt 2$ side.
However taht  is not the whole core of theorem $(2)$
Theorem $(2)$ is about the idea of the difference between the maximum element of a set and its least upper bound or supremum.
While the set $A$ does not have a maximum, it does have a supremum,namely $\sqrt 2$ which is not in the set. 
Similarly the set $B$ which does not have a minimum but it does have an infimum which does not belong to $B$ 
A: Yeah, it would be more noteworthy for the book to say that $ \mathbb Q \cap (0, \sqrt 2]$ has no largest number and $\mathbb Q \cap [\sqrt 2, \infty)$ has no smallest number.  Or, to say it without using the real numbers, that the set $D=\{x\in\mathbb Q^+\mid x^2<2\}$ has neither a largest member nor a least upper bound in the rationals.  
So, in a nutshell, the distressing thing about the gaps in the rationals is that $D$ is a connected subset of the rationals that we still cannot express in interval format.
A: HINT.- If $s$ is the largest number of $A=\{x\in\mathbb Q: 0\lt x\lt\sqrt2\}$ then the non-empty interval $(s,\sqrt2)$ does not contain a rational (it is non-empty because we know $s$ is supossed rational). This is contrary to the known fact that $\mathbb Q$ is dense in $\mathbb R$. (There are other ways to prove this). Similarly with the other questions. The answer to your questions concerning the definition of $A$ and $B$ is negative.
It is known otherwise because $\mathbb Q$ is a set whose structure of order is not "well orderer"(contrary to the integers).
A: This is one of my favorite examples and IMHO it is the simplest way to see the difference between an algebraic argument and an analytical argument.
The first result is algebraic and is equivalent to

Theorem 1: There is no rational number whose square equals $2$.

The proof is commonly available in many textbooks and on this website. The key component in the proof is basic properties of integers related to divisibility.
The second result you mention belongs more properly to analysis and builds up on theorem 1 and is on a very different level. Since no rational number has its square equal to $2$, it is obvious that square of any rational number is either less than or greater than $2$ and it makes sense to divide the rationals into two subsets $A, B$ where $A$ contains those rationals whose squares are less than $2$ and $B$ contains those rationals whose squares are greater than $2$. Since $(-x) ^2=x^2$ it is simpler and sufficient to consider only the positive rationals and accordingly let $$A=\{x\mid x\in\mathbb {Q}, x>0,x^2<2\} $$ and $$B=\{x\mid x\in\mathbb {Q}, x>0,x^2>2\}$$ And then we have striking / surprising result

Theorem 2: The set $A$ described above has no maximum and the set $B$ has no minimum.

The proof is far from being trivial and one should try it out while remaining within the system of rationals.
Why is the result surprising? To answer this let's modify $A$ and add zero and negative rationals to it so that $$A=\{x\mid x\in\mathbb {Q}, x>0,x^2<2\}\cup\{x\mid x\in\mathbb {Q}, x\leq 0\} $$ Theorem $2$ holds with this modification but now we have few more things available here. Observe that $A\cap B=\emptyset, A\cup B=\mathbb {Q}$ and further if $a\in A, b\in B$ then $a<b$.
If we observe this on number line, it appears that the whole rational line is cut into two parts. The surprise is that both the parts after the cut have no ends. To put it formally there is no rational which makes this cut. It's like if we are moving on number line from left to right taking every rational into account then we move magically from $A$ to $B$ without reaching the end of $A$ or the start of $B$. This is what one usually calls a gap in the rational line. And Dedekind was the first to think of gaps in rationals in this particular manner. And he decided to fix this by inventing real number system based on such a procedure of division of rationals into two sets.
BTW the theorem $2$ holds if sets $A, B$ are modified to use inequalities $x^2<1,x^2>1$. But then the trouble is that the division of rationals into two sets is not complete as number $1$ lies neither in $A$ nor in $B$. Adding $1$ to any of sets $A, B$ gives them an end (maximum/minimum element) and completes the division.

Note: The use of symbol $\sqrt {2}$ destroys the whole beauty and excitement here. The gaps in rationals needs to be understood by remaining within the rational number system itself. 
A: For any dense set of reals
$\mathbb{D}$
and any real
$r \not\in \mathbb{D}$,
the set $A = \mathbb D \cap (0, r)$ has no largest number and $B = \mathbb D \cap (r, \infty)$ has no smallest number.
For example,
you could take
$\mathbb D$
to be the set of dyadic rationals
(rationals of the form
$\dfrac{2n+1}{2^m}$)
and
$r = \dfrac13$.
