In Thomae's Function:

$$ \begin{align} t(x) = \begin{cases} 0 & \text{if $x$ is irrational}\\ \frac{1}{n} & \text{if $x = \frac{m}{n}$ where $\gcd(m,n) = 1$} \end{cases} \end{align} $$

I can prove the discontinuity at rational $b$ by taking a sequence of irrationals $x_n$ which converge to $b$.

But while going through an argument for continuity at irrationals. I found this in a book.

On the other hand if $b$ is an irrational number and $\epsilon > 0$ then there is a natural number $n_0$ such that $1/n_0 < \epsilon$. There are only finite number of rationals with denominator less than $n_0$ in the interval $(b-1,b+1)$. Hence we can find a $\delta > 0$ such that $\delta$ neighbourhood of $b$ contains no rational with denominator less than $n_0$.

I understand the rest of the proof. But I am unable to prove the emphasized text. Although I find it intuitive.


Let $m=n_0-1$, so we want to consider rationals with denominators $1,\cdots,m$ in the interval $(b-1,b+1)$. Since consecutive rationals with denominator k differ by $1/k$ and the interval $(b-1,b+1)$ has length 2, there are at most 2k rationals with denominator k in $(b-1,b+1)$.

Therefore there are at most $2\cdot1+2\cdot2+\cdots+2m$ rationals in $(b-1,b+1)$ with denominator less than $n_0$, so we can choose a $\delta$ with $0<\delta<|b-r|$, where r is the rational with denominator less than $n_0$ in $(b-1,b+1)$ which is closest to b.

  • $\begingroup$ what if we take $b = 1$ and $k = 4$? You see the "consecutive" rationals with denominator $k$ are $1/4$, $3/4$, $5/4$, and $7/4$, which are at a distance of $2/4 = 1/2$. So don't you think your argument breaks down? $\endgroup$ – Saaqib Mahmood Mar 30 '17 at 17:36
  • $\begingroup$ @SaaqibMahmuud In your example, I am arguing that there are at most 8 rationals of the form $\frac{m}{4}$ in the interval $(0,2)$, since the distance between $\frac{m}{4}$ and $\frac{m+1}{4}$ is $\frac{1}{4}$ for each $m$. $\endgroup$ – user84413 Apr 1 '17 at 19:13

Let $b \in \mathbb{R} \setminus \mathbb{Q}$. Given $\epsilon > 0$ let $K = \left \lceil \frac{1}{\epsilon} \right \rceil$. Thus, $\frac{1}{K} < \epsilon$.

Note that $K$ is a finite number and the number of integers less than $K$ is also finite. This means the number of rationals of the form $\frac{1}{q} > \frac{1}{K}$ is also finite.

Shrink the interval $(b-1, b+1)$ down to $(b-q, b+q)$ such that all these $\frac{1}{q}$ are tossed out, leaving only rationals $\frac{1}{q} < \frac{1}{K} < \epsilon$.

It follows that if $|x -b| < \delta$ then $|f(x) - f(b) | = |f(x)| \leq \frac{1}{K} < \epsilon$.

  • $\begingroup$ Will this be a good approach to shrink the interval ? $Let E_{n}:=\{x \in Q | f(x) \geq 1/n\}$ now $n\{E_{n}\} \leq \frac{n(n+1)}{2} = m \; (say)$ clearly m $\in$ $N$ $E_{n}=\{b_{1},b_{2} \ldots b_{m}\}$ let $ q=inf\{|b-b_{i}|i=1,2 \ldots m\}$ then if $|x-b|<q$ $ \Rightarrow$ $|f(x)-f(b)|=|f(x)|=f(x) <1/n< \epsilon$ $\endgroup$ – Vishweshwar Tyagi Nov 2 '17 at 14:36

The natural extension of Thomae's function to the hyperreals is defined by the same formula: $$ \begin{align} t(x) = \begin{cases} \frac{1}{n} & \text{if $x = \frac{m}{n}$ where $m,n\in{}^\ast\mathbb N$ and $\gcd(m,n) = 1$} \\ 0 & \text{otherwise.}\\ \end{cases} \end{align} $$ To show that $t(x)$ is continuous at $c\in\mathbb R\setminus \mathbb Q$, suppose $q$ is a hyperrational infinitely close to $c$. Clearly $q\not\in\mathbb R$. Since $q$ is appreciable (i.e., finite but not infinitesimal), its denominator $n$ is necessarily an infinite hyperinteger. Hence $t(q)=\frac{1}{n}\approx 0$ where $\approx$ is the relation of infinite proximity. Thus $t(x)$ is infinitesimal at all points infinitely close to $c$, proving the continuity of $t(x)$ at $c$.


Let $\frac{m}{n}$ be a rational number such that $$b-1 \leq \frac{m}{n} \leq b+1,$$ where $m$ and $n$ are integers such that $n> 0$ and $\gcd (m, n) = 1$.

Then we see that $$n ( b-1) \leq m < \leq n(b+1).$$ Thus, $$ m \in \mathbb{Z} \cap \left[ \ n(b-1), \ n(b+1) \ \right].$$ Therefore, $$m \in \left\{ \ \lceil n(b-1) \rceil, \ldots, \lfloor n(b+1) \rfloor \ \right\},$$ where $\lfloor 2.5 \rfloor = 2$ and $\lceil 2.5 \rceil = 3$, and $\lfloor 2 \rfloor = 2 = \lceil 2 \rceil$.

Hence, for each natural number $n$, there are at most $$N \colon= \lfloor n(b+1) \rfloor - \lceil n(b-1) \rceil$$ rational numbers with denominator $n$ in the closed interval $[b-1, b+1]$ and hence in the open interval $(b-1, b+1)$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.