# Spivak Thomae's Function proof explanation

1. Dec 19, 2015

### Alpharup

I am using Spivak calculus. Now Iam in the chapter limits. In pages 97-98, he has given the example of Thomaes function. What he intends to do is prove that the limit exists.
He goes on to define the thomae's function as
f(x)=1/q, if x is rational in interval 0<x<1
here x is of the form p/q where p and q are integers and q>0
f(x)=0, if x is irrational
He proves that the limit of f(x) as x tends to a(it is between 0 and 1) is 0
a can be either rational or irrational
He starts the arguement like this. He assumes a natural number n so large such that (1/n)<=€, ie..(1/n) is lesser than or equal to epsilon.
Since, L =0 ( The assertion he gives on value of this limit),
he writes that |f(x)-L| or |f(x)-0|<€,
He says that the numbers x which dont satisfy this inequality are...
1/2,
2/3
1/4,
3/4,
1/5,..
and he also includes
1/n....(n-1)/n..
My doubt is how?
Why dont these numbers satisy/ why is it false?
For example, consider x=1/n
so, f(x)=1/n
|1/n|<€. Is it not true? Isn't the inequality true?

Where have I gone wrong?

Last edited: Dec 19, 2015
2. Dec 19, 2015

### mathwonk

you have a misprint in your question. rather f(x) = 1/q, if x = p/q is in lowest terms. then the point is that no matter what a is, at all nearby irrationals f has value zero, and also at all sufficiently nearby rationals different from a, f has value 1/n for arbitrarily large n. hence in both cases the value of f(x) is as small as you like for x near a but x≠a.

i.e. given e>0, there are only a finite number of points x where f(x) > e. so just get x closer to a than any of these points, and then you will have |f(x) - 0| < e. and this is usually called dirichlet's function i thought. ok now i see a web reference calling it also thomae, and also little riemann. never heard of that beofre.

Last edited: Dec 19, 2015
3. Dec 19, 2015

### Alpharup

yes got it corrected

4. Dec 19, 2015

### Alpharup

oh, do you mean to say that n can be 2,3,4,5....ie...(smaller ones) rather than say n=1,000,000( very large)?

5. Dec 19, 2015

### Samy_A

I think the "arbitrarily small n" is a typo. What @mathwonk meant is that at all sufficiently nearby rationals different from a, f has value 1/n with arbitrarily small 1/n (or arbitrarily large n, if you prefer).

6. Dec 19, 2015

### mathwonk

thanks! fixed.

7. Dec 20, 2015

### Alpharup

now i get it....n is so large....a rational number nearest to 'a' maybe some d/n...here d<n....d is also an integer.
the value of f at d/n is 1/n( by definition)
The points other than than rational numbers are irrational.
We have proved that |f(x)-0|<€ for irrational ponts....Now our concern is delta arguement on these irrational points. We have to prove that there is a ¿(delta) for which 0<|x-a|<¿....
To prove that, we have to invoke a rational number p/q closest to a...
2 cases...
1...a is irrational, |(p/q)-a| =¿(let us assume).
in between a and p/q, there are only irrational numbers. If there were rational numbers, then p/q is not the closest rational( a contradiction)
2. If a is rational, let the closest rational be p/q....let us assume |(p/q)-a |=¿ ..there are only irrationals between (p/q) and a( otherwise a contradiction).
For any number x not equal to either a or p/q, and inbetween them,
can be written as 0<|x-a|<¿.
x is defintely irrational.
For irrationals, ¿ > 0 can be found
Thus, limit exists.
Is this right?

8. Dec 20, 2015

### Samy_A

No. There is no such thing as a closest rational to an irrational number. Also, each non-empty interval in $\mathbb R$ contains infinitely many rational numbers and infinitely many irrational numbers

You have to prove that given an $\epsilon>0$, there exists a $\delta>0$ such that when $0<|x-a|<\delta$, $|f(x)|<\epsilon$.
Now take $n \in \mathbb N, \ n>=1/\epsilon$. Only the rational numbers $y$ with a denominator (meant is the lowest possible positive denominator) smaller than or equal to $n$ can have $f(y)>=\epsilon$. But there are only finitely many such rational numbers.
So now take $\delta>0$ smaller than the shortest distance between $a$ and one of those rational numbers $y$ with $f(y)>=\epsilon$. This insures that any rational number $x$ satisfying $0<|x-a|<\delta$ will be equal to some p/q, with q>n (where again q is the lowest possible positive denominator).

Finally, with this choice of $\delta$:
If $0<|x-a|<\delta$, we then have $|f(x)|<\epsilon$:
for irrational $x, \ f(x)=0<\epsilon$,
and for rational $x=p/q,\ f(x)=1/q<\epsilon$.

Last edited: Dec 20, 2015
9. Dec 20, 2015

### Alpharup

oh....i get it....the condition f(x)>€ for 1/2,
2/3 ....and 1/n, (n-1)/n
for which |f(x)| is denominator of such numbers. This condition condition |f(x)|> €fails for rational numbers with denominator n+1. Because n is finite, the rational numbers between 0 and 1 is finite. Is this right?

10. Dec 20, 2015

### Samy_A

No.
There are only finitely many rational numbers with lowest possible positive denominator smaller then n.

Last edited: Dec 20, 2015
11. Dec 20, 2015

### Alpharup

what about those greater than n? do they exist?

12. Dec 20, 2015

### Samy_A

Of course, infinitely many of them, but for these $f(x)$ will be smaller than the chosen $\epsilon$.

13. Dec 20, 2015

### Svein

14. Dec 21, 2015

### Alpharup

Shouldn't the proof involve induction( Just wondering)? Like proving for n+1 though we proved for n?

15. Dec 21, 2015

### Samy_A

No.
We didn't "prove it for n".

As in a typical $\epsilon \ \delta$ proof, we proved it for every $\epsilon>0$.
Once we picked one specific $\epsilon>0$, the $n$ was conveniently chosen so that it satisfies $n >=1/\epsilon$. Whatever $\epsilon>0$ is, such an $n \in \mathbb N$ always exists.

16. Dec 21, 2015

### Svein

The axiom of Archimedes (just thought I should mention it, because it is not that trivial).

17. Dec 23, 2015

### Alpharup

Now I get it. The condition that n exists whenever €> 0 and n>=(1/£) is always true for whatever value of £ may be. £ can be 0.1 or 0.000001, so accordingly n varies.

18. Dec 23, 2015

### Samy_A

Yes, that's correct. (assuming £=€=ε :) )

19. Dec 23, 2015

### mathwonk

Svein, i t depends on your point of view, doesn't it? I.e. if you take the usual lub-complete ordered field axioms for the reals as your starting point, then the axiom of archimedes is a pretty easy corollary, maybe not entirely trivial, as you say, but if you take as definition of the reals the set of infinite decimals, with the usual equivalence relation, which is the perspective of most calculus books, then archimedes' axiom is quite trivial. come to think of it though, you are right that in the context of spivak's treatment, he starts from the axioms. of course he also proves archimedes' axiom as a theorem. in his appendix however he constructs the reals as decimals. just a remark.

20. Dec 23, 2015

### WWGD

My take on it is that for every n, you will have n copies of 1/n in [0,1], so that you can always make an interval $(x- \delta, x+ \delta)$ around your number small-enough to avoid having copies of 1/n inside of the interval for $n=1,2,...,k$ for fixed k. Think of using $n!$ to construct your interval. i.e., for x=p/q , for fixed value of $\epsilon$ , you first find (using Archimedean Principle to guarantee this, as pointed out by someone) $n_0$ large -enough so that $1/n_0 < \epsilon$ . Then there are only finitely-many numbers $1/1,1/2,....,1/(n_0-1)$ ( basically 1/1,1/2,2/2, 1/3,2/3,....are all mapped into 1/1,1/2,1/3 , etc.) , so that you can find an interval around p/q which will exclude all of these values , so that every other value p'/q' that falls inside of your interval will be less than $f(p/q)=1/q < \epsilon$ .

Take , say $x= 0.5, \epsilon =0.015$ , and find $\delta$ to create an interval $((1/2) - \delta, (1/2)+ \delta)$ where $f(x) < \epsilon = 0.015$ . You first find $n: 1/n < 0.015$. n=70 works. Now you want to find $\delta$ to construct an interval $((1/2)-\delta, (1/2)+ \delta)$ so that all values {f(x)} in the interval are less than $0.015$ . Well, there are only finitely-many values {1/n: n < 70 } in the interval, so you can find a way of avoiding them all by making your interval small-enough.

Last edited: Dec 23, 2015