5

My current knowledge is that a function is continuous at a point $x=a$ if and only if, for any $\epsilon>0$, there exists some $\delta>0$ such that $$ |x-a|<\delta \implies |f(x)-f(a)|<\varepsilon. $$ If I have a function $f: \mathbb{Q} \to \mathbb{R}$, say $f(x)=\log\left(\sqrt{x}\right)$, where the domain is all positive rationals, surely I can always find a $\delta$ for any $\varepsilon$?

However, I feel like I’ve heard that the rationals aren’t continuous. Is that false (that is, they are actually continuous), or is there an additional restriction to the definition of continuity?

Samuel Han
  • 77
  • 7
  • What do you mean by "the rationals aren't continuous"? – Bruno B May 16 '23 at 18:37
  • 6
    Continuity is a property of functions. The rationals are a set, not a function, so speaking of the rationals being "continuous" is not meaningful. I suspect you are misremembering what you heard, or that whoever said it was confused. Maybe you are thinking of the fact that the set of rationals isn't closed, or that the indicator function of the rationals (aka the Dirichlet function) isn't continuous? – Nate Eldredge May 16 '23 at 18:42
  • 1
    Sets (including $\mathbb{Q}$ and $\mathbb{R}$) can be “dense”, not “continuous” (which, as Nate said, is a concept that applies only to functions). – Dan May 16 '23 at 18:54
  • Or maybe you're thinking of the concept of a “continuous random variable”, whose value is taken from a dense set, as opposed to a “discrete” one like $\mathbb{Z}$. This is a different definition of the word “continuous” than the one in “continuous function”. – Dan May 16 '23 at 18:56
  • 3
    Hello and welcome to math.stackexchange. The answer to your question is YES. If you take a continuous function such as $f(x) = \log \sqrt{x}$ and restrict its domain, it reamins continuous. The rational numbers don't form a continuum, but that is a different matter and not relevant here. – Hans Engler May 16 '23 at 19:00
  • Maybe you meant, is the inclusion $\Bbb Q\hookrightarrow\Bbb R$ continuous? – FShrike May 16 '23 at 19:09
  • Nate’s suspicion is correct, and I did misremember what I heard. This makes a lot more sense now. – Samuel Han May 16 '23 at 19:29

4 Answers4

9

You seem to a bit confused on terminology. The epsilon-delta definition of “continuity” applies to functions. The rational numbers ($\mathbb{Q}$) are a set, not a function.

There are a couple of related concepts that do apply to sets:

  • A dense set has the property that between any two members of the set, there exists another member of the set. ($\forall x_1, x_2 \in S, x_1 < x_2: \exists x_3 \in S: x_1 < x_3 < x_2$)
    • Rationals ($\mathbb{Q}$) and reals ($\mathbb{R}$) are dense sets.
    • Complex numbers ($\mathbb{C}$) can also be called dense, using a more careful definition of “dense” that deals with the fact that the word “between” (and relational operators $<$, $\le$, $\ge$, and $>$) aren't defined between complex numbers.
    • Integers ($\mathbb{Z}$) are not dense, because, for example, there is no integer between 1 and 2.
  • A complete set is one for which every Cauchy sequence of members of the set converge to a limit that is also in the set. While $\mathbb{R}$ and $\mathbb{C}$ are complete sets, $\mathbb{Q}$ is not.

If you're done anything with probability or statistics, you may have heard of the idea of a “continuous random variable”, versus a “discrete random variable”. Roughly speaking, this is equivalent to a variable from a dense set versus a variable from a non-dense set. But this sense of the word “continuous” is different from the “continuous” in “continuous function”, which may be the source of your confusion.

It is however, meaningful to ask if a particular function with a domain of $\mathbb{Q}$ is continuous. For example, $f(x) = x^2$ is a continuous function, whether you define it on $\mathbb{Q} \to \mathbb{Q}$ or $\mathbb{R} \to \mathbb{R}$. Your example of $f(x) = \log(\sqrt{x})$ is also a continuous function for $x > 0$, whether it's defined on $\mathbb{R} \to \mathbb{R}$ or $\mathbb{Q} \to \mathbb{R}$ (but $\mathbb{Q} \to \mathbb{Q}$ doesn't work).

And then there's the Dirichlet function:

$$f(x \in \mathbb{R}) = \begin{cases} 1 && x \in \mathbb{Q}\\ 0 && x \notin \mathbb{Q} \end{cases}$$

This is nowhere continuous. But if you were to restrict its domain to the rationals, then you just get the constant function $f(x \in \mathbb{Q}) = 1$, which is everywhere continuous.

Dan
  • 14,978
4

Continuity is the property of a function and by saying that the Rationals are not continuous makes no sense.

4

An important point to note is that a function being continuous on the rationals does not necessarily mean it behaves how you would expect a continuous function on the reals to behave. For example, a step function which is 0 everywhere below some threshold and 1 above it is clearly discontinuous on the reals, but it can be continuous on the rationals:

$$f(x) = \begin{cases} 0 && x < \pi \\ 1 && x > \pi \end{cases}$$

For every $x \in \mathbb{Q}$ and $\epsilon > 0$, let $\delta$ be some rational number between 0 and $|x - \pi|$; such a $\delta$ exists because $|x - \pi| \ne 0$ for all rational $x$. Then $|f(x + a) - f(x)| = 0 < \epsilon$ for all $a \in (-\delta, \delta)$, and hence $f$ is continuous at $x$.

The analogous function on the reals is of course discontinuous at $x = \pi$, but continuous everywhere else. It's only continuous on the rationals because $\pi$ isn't rational. So in a sense, the rational numbers aren't a very useful domain to talk about continuity in, because they allow for "discontinuities" to hide in the irrational gaps.

This might be (casually, informally) summarised as "the rationals aren't continuous", but as explained by the other answers, this sentence is formally nonsense because continuity is a property of functions, not sets.

kaya3
  • 1,311
  • Interesting function. I seem to understand the math, but I'll probably need a few days to accept it's really continuous on the rationals. :) – Eric Duminil May 17 '23 at 07:34
1

What applies to rationals is not continuity, but rather "density". A subset $A \subset \mathbb{R}$ is said to be dense when : $\forall a < b \in \mathbb{R}, [a, b] \cap \mathbb{R} \neq \varnothing$.

This is strictly equivalent to the following definition: $\forall x \in \mathbb{R}, \exists (x_n) \in A^{\mathbb{N}}, x_n \longrightarrow x$.

$\mathbb{Q}$ is, indeed, dense in $\mathbb{R}$ (just as $\mathbb{R} \setminus \mathbb{Q}$ !)

This means that for any real number, you can find a sequence of rational numbers converging to it.

"Continuity" applies to functions, not subsets. And functions defined on $\mathbb{Q}$ can be continuous, as well as discontinuous.

Have a nice day