Intuitive explanation of the Dirichlet function and rationality

2.6k Views Asked by At

The Dirichlet function is defined by $f(x)=\begin{cases} c &\text{ if } x\in \mathbb{Q}\\d &\text{ if } x\notin \mathbb{Q}.\end{cases}, c\neq d$

See MathWorld's page for the full definition.

One of the properties of the Dirichlet function is that it is discontinuous everywhere, which means that its graph would look like this: enter image description here

If I understand correctly, then it would imply the following:

If $x$ is rational, then $\lim_{h\to0} x+h$ would be irrational. And conversely, if $x$ is irrational, then $\lim_{h\to0} x+h$ would be rational.

I'm having an extremely hard time grasping this concept.

For example, if $x$ cannot be written as $\frac{a}{b}$, then why can $\lim_{h\to0} x+h$ be written as $\frac{a}{b}$ ?

If someone could intuitively explain this, then it would be much appreciated. Also, if I do not understand the Dirichlet function correctly, then please also explain why.

EDIT Another example: If there are two rational numbers arbitrarily close together, wouldn't there be another rational number in between them? And if so, wouldn't it make the Dirichlet function continuous at that point?

2

There are 2 best solutions below

2
On

$\mathbb{Q}$ is dense in $\mathbb{R}$, which means in this case that:

$$ \forall x,y \in \mathbb{R} \hspace{2mm} \text{with} \hspace{2mm} x < y \hspace{2mm} \exists r \in \mathbb{Q}: x < r < y $$

So, for two real (particularly irrational) numbers, there is always a rational number in between, no matter how close the two reals are to each other. So the Dirichlet function jumps from $c$ to $d$ and vice versa for every (arbitrarily small) iteration of $x$.

Here you can see a plot for $c=1$ and $d=0$: German Wikipedia

EDIT: Changes made, thanks to comment of LJL.

4
On

It may be easier to see if you use the sequence approach to continuity:

Pick an $p\in \mathbb Q$ and from each neighborhood $B_{1/n}(p)$ choose an irrational number $x_{n}$. Then you get a sequence with the property that

$x_{n}\to p$ and $f(x_{n})=d\quad \forall n\in \mathbb N$.

Since $f(p)=c\neq d$, $f$ is not continuous at $p$.

Simlarly, if $x\in \mathbb P$, you can find a sequence of rationals $p_{n}$ converging to $x$, such that $f(p_{n})=c$ and then since $f(x)=d$, $f$ is not contiuous at $x$.