# Neighbors of Irrational Numbers on Real Number Line

I was looking at a post on MathOverflow about "What is your favorite 'strange' function?" One of the answers mentioned Thomae's function claiming that the function was "continuous at all irrationals and discontinuous at all rationals."

This got me to thinking, how are irrational and rational numbers related on the real number line? Is every irrational number "surrounded" by two rational number "neighbors?" For instance, can we think of the non-negative real number line as: Zero (rational), an irrational number infinitesimally close to zero, a rational number infinitesimally larger than the previous irrational number, an irrational number infinitesimally larger than the previous rational number, etc. ?

• Sadly we cannot think of the real numbers, rational or irrational, in terms of any finite number of neighbors. Being a "neighbor" is a relative property, which is why we torment first year calculus students with epsilon-delta definitions and proofs. – hardmath Oct 12 '15 at 2:54
• @hardmath to the extent that we do... – guest Oct 12 '15 at 2:55
• Can you clarify what you mean by "being a 'neighbor' is a relative property?" It seems to me that for every number x there is a set S of real numbers that are strictly greater than x. If we order the set S and then take the smallest number from the ordered set, isn't that real number the neighbor of x? It's been a while since I took Calculus so forgive me for not quite remembering the epsilon-delta definitions and proofs. – terminex9 Oct 12 '15 at 2:58
• Maybe this can help convince you otherwise: wikiwand.com/en/Archimedean_property Instead of arguing about what infinitesimal neighbor 0 has, the Archimedean property indicates that over $\mathbb{R}$ there exists no infinitesimal objects in the first place. Hence, the "next neighbor" is neither rational nor irrational as it doesn't exist. – Dair Oct 12 '15 at 3:13
• @terminex9 You may be confused by a memory of the greatest lower bound principle, which says that every (nonempty, bounded below) set of real numbers has a greatest lower bound. It does not say that every such set has a minimal element though! And indeed, that would be false. Given any real $r$, there is no "next real" - for any $s>r$ consider $r+{s-r\over 2}$. – Noah Schweber Oct 12 '15 at 3:27

For example, consider the set $S$ of numbers greater than $0.$ Take any $s\in S.$ Now, note that $\frac12s\in S,$ and is strictly smaller than $s$. Likewise, $\frac14s$ is an even smaller element of $S$, and so on. In fact, given any fixed $s_0\in S,$ there are uncountably-many $s\in S$ that are strictly less than $s_0$! This may seem rather astonishing, but is a fairly natural property of uncountable Archimedean ordered fields like the real numbers.
As for how the rationals and irrationals are arranged, the answer is: "densely." In particular, given any real $a,b$ with $a<b,$ there are countably-infinitely-many rational numbers in $(a,b)$ and uncountably-many irrationals in $(a,b).$