Problem with proof from Pugh’s Analysis book on the presence of both rationals and irrationals in every interval

analysisproof-explanationproof-verificationreal-analysis

Here there is a theorem (Theorem 7, p.20) from Pugh's "Real Mathematical Analysis" with its proof.

My problem lies in the text in blue: I don't see why it comes that the mapping $T$ sends rationals to rationals and irrationals to irrationals.

Of course I know this is an homeomorphism, so it actually does, but I don't see how, without getting into the homeomorphism side, the proof proves that the mapping actually does what is stated.

Theorem: Every interval $(a,b)$, no matter how small, contains both rational and irrational numbers. In fact it contains infinitely many rational numbers and infinitely many irrational numbers.

Proof: Think of $a,b$ as cuts $a = A|A'$, $b = B|B'$. The fact that $a < b$ implies the set $B\setminus A$ is a nonempty set of rational numbers. Choose a rational $r \in B\setminus A$. Since $B$ has no largest element, there is a rational $s$ with $a < r < s < b$. Now consider the transformation
$$T :t \to r + (s−r)t.$$
It sends the interval $[0, 1]$ to the interval $[r, s]$. $\color{blue}{\text{Since }r \text{ and } {s {−} r} \text{ are rational, }T \text{ sends rationals to rationals and irrationals to irrationals.}}$ Clearly $[0,1]$ contains infinitely many rationals, say $\frac{1}{n}$ with $n \in \mathbb{N}$, so $[r, s]$ contains infinitely many rationals. Also
$[0, 1]$ contains infinitely many irrationals, say $\frac{1}{n\sqrt{2}}$ with $n \in \mathbb{N}$, so $[r, s]$ contains infinitely many irrationals. Since $[r, s]$ contains infinitely many rationals and infinitely many irrationals, the same is true of the larger interval $(a, b)$.

Any feedback will be greatly appreciated.
Thank you in advance for your time.

Best Answer

As $r$ and $s$ are rationals, for every rational $t$, $T(t)=r+(s-r)t$ is a rational, right ?

Now if $t$ is irrational, $T(t)=r+(s-r)t$ can't be rational. Otherwise, $$t=\frac{T(t)-r}{s-r}$$ would be a rational too, which is excluded.

Hence, $T$ maps rationals to rationals, and irrationals to irrationals.