# Limit Proof of an Esoteric Function from Spivak's Calculus

1. Jun 30, 2013

### middleCmusic

In Spivak's Calculus (4th ed.), on pg. 99, he claims/proves that the following function converges to 0 at every a in the interval (0, 1):

f(x) = 0, for x irrational
......= 1/q, for x rational, where x = p/q in lowest terms.

His proof goes as follows:

"For any number a, with 0 < a < 1, the function f approaches 0 at a. To prove this, consider any number ε > 0. Let n be a natural number so large that 1/n ≤ ε. Note that the only numbers x for which |f(x) - 0| < ε could be false are:

1/2; 1/3, 2/3; 1/4, 3/4; 1/5, 2/5, 3/5, 4/5; ...; 1/n, ..., (n-1)/n. (*)

(If a is rational, then a might be one of these numbers). However many of these numbers there may be, there are, at any rate, only finitely many. [emphasis mine] Therefore, of all these numbers, one is closest to a; that is, |p/q - a| is smallest for one p/q among these numbers. (If a happens to be one of these numbers, then consider only the values |p/q - a| for p/q ≠ a.) This closest distance may be chosen as the δ. For if 0 < |x - a| < δ, then x is not one of

1/2, ..., (n-1)/n

and therefore |f(x) - 0| < ε is true. This completes the proof."

* * *​

Here's my issue with the proof: isn't his list (*) missing a bunch of numbers? For example, let p be some number relatively prime to n+1. Shouldn't p/(n+1) be on the list? My understanding of his logic is that the list ends at n because any number smaller (e.g. n+1) doesn't need to be considered, since 1/(n+1) ≤ ε. But we don't know that p/(n+1) ≤ ε if p is large enough. So isn't the proof incorrect? Aren't there infinitely many numbers to worry about?

[Just to clarify, I'm not suggesting that the main assertion of it approaching 0 is wrong - just that the proof is flawed.]

EDIT: I haven't tried reproving it correctly yet, since I wanted to make sure the actual proof was wrong before I spent too much time doing that (especially if it's possible it doesn't approach 0 like it claims).

2. Jun 30, 2013

### tiny-tim

hi middleCmusic!
but f(p/n+1) = f(1//n+1)

3. Jun 30, 2013

### middleCmusic

I'm not suggesting they're equal. Rather, it's that his proof seems to ignore f(p/n+1), pretending as though we only need to consider f(1/(n+1)). If my explanation is still hard to understand, let me know - I'm famously bad at getting my thoughts across correctly. :) (And hello!)

4. Jul 6, 2013

### middleCmusic

Hey guys, I'm just bumping this thread because it fell into obscurity and so far no one has addressed the question in my post. I would really appreciate it if someone could take a stab at it, as I'm having trouble getting my mind to move on to the next thing without a resolution.

5. Jul 6, 2013

### jbunniii

Isn't $f(p/(n+1)) = 1/(n+1)$ if $p$ is relatively prime to $n+1$?

6. Jul 7, 2013

### middleCmusic

Yes, that's correct. But Spivak's point is about there being finitely many x-values that we must consider, not the f-values. [STRIKE]I'm going to think about it for a while to see if I can clarify my problem.[/STRIKE]

[Problem solved]

While your post didn't address the issue I was having, it did send me on the right path which led me to realize where I was going wrong, so thanks. I'll try to quickly explain what the proof is really saying, for anyone else's benefit, or for someone else to correct me if I'm misunderstanding it.

You're given some a and some ε. You find an N so that 1/N < ε. Since f(p/q [in least terms]) = 1/q, we just need to make sure that there are no p/q in the interval (a - δ, a + δ) for which 1/q > 1/N, since then they will not be bounded by ε. Because of the way that fractions are spaced on the number line, in order to get within 1/N of a, the denominator (before reduction) must be greater than N. It helped me to visualize this part as some old man drawing on a ruler. In order to draw a tick mark close enough to a given point, he needs a very thin brush. A thinner brush corresponds to a larger denominator.

The part that we need to worry about is whether there is some number with a denominator Q > N, which has a reduction p/q where q < n. But luckily, there are only finitely many fractions in least terms with a q < n. And one of them is closest to a. So we choose δ less than the distance between that fraction and a.

Last edited: Jul 7, 2013