Tile 4 | Two of a Kind?

f(x) = 0 when x is irrational
f(x) = 1q when x = pq
with gcd(p, q) = 1 and q > 0

How would you go about drawing the graph of this shattered function?

Solution

The complete graph of f eludes the stylus. We can, however, capture a fragment of it: fix any horizontal line above the x-axis, and within a given interval, say 0 ≤ x ≤ 1, every point of the graph that lies on or above the line can, in principle, be pinned down.

By definition, the rationals and the irrationals partition the real line: every real number belongs to one and is barred from the other. Consequently, one and only one branch of the piecewise definition governs each real number x.

The first branch leaves no room for doubt: when x is irrational, the ordered pair associated with x is (x, 0). When x is rational, it wears infinitely many guises: it can be written as pq for integers p and q with q ≠ 0. Of all these guises (for example, 12 = 24 = 48 = ⋯), only one such pq stands in lowest terms—where gcd(p, q) = 1 and q > 0.* To find the value of f at any rational number, we must first pare the number down to lowest terms; only then can we read off q and fix the ordered pair (x,1q).

For example, 34 already stands in lowest terms with q = 4, so f(34)=14; 24, by contrast, must first be stripped down to 12, so f(24)=12. And 0? In lowest terms, 0 resolves to 01 since, for q > 0, gcd(0, q) = 1 only when q = 1; so f(0) = 1.

Each real number x, however written, is thus tethered to a single value, so f is well defined.

Claim 1: Over every interval of positive length, however short, the graph haunts both the x-axis and the space above the x-axis.

Proof: Every interval of positive length harbors infinitely many rational numbers and infinitely many irrational numbers.* Every such interval therefore contains numbers where f(x) = 0 alongside numbers where f(x) = 1q > 0, and Claim 1 is proved.

More unsettling still, at every rational number the graph of f tears apart: the point standing over that number holds itself aloof from every point near it.

To see what such a rift means, let us dissect the portion of the graph around a single rational number, 12. Since 12 stands in lowest terms, f(12)=12, and the point (12,12) perches above the x-axis. Now choose a positive number δ, as small as you dare. The interval from 12 − δ to 12 + δ, however narrow, conceals an irrational number: for instance, x = 12 + 2n, where n is any whole number larger than 2δ. The number x inherits its irrationality from 2: if x were rational, then 2=n(x−12) would be rational too, yet 2 is irrational.* And x lies within δ of 12: the distance between them is 2n. Because 2 < 2 and n > 2δ, we have 2n < 2n < δ. Yet at that x, the graph lies on the x-axis since f(x) = 0, and

|f(x)−f(12)| = |0−12| = 12.

No matter how small δ is, some x within δ of 12 keeps f(x) a full 12 away from f(12). In the language of calculus, this rift means f is not continuous at 12.*

The same dissection succeeds around every rational number a = pq in lowest terms, with 1q in place of 12. Since every interval of positive length contains infinitely many rational numbers, every such interval is riddled with rifts. Over no interval, however short, does the graph hold together in one unbroken piece, and here lies the meaning of the word “shattered.”

A stylus traces a graph one unbroken piece at a time; the complete graph of f, torn across every interval, eludes it.

Return now to the fragment we promised to capture and fix the line y = 14.

Claim 2: Over 0 ≤ x ≤ 1, exactly seven points of the graph lie on or above the line y = 14.

Proof: No irrational number x can qualify since f(x) = 0; so let x = pq be a rational number in lowest terms with 0 ≤ x ≤ 1. The second branch pairs x with 1q, so the point (x,1q) lies on the graph. Now 1q ≥ 14 precisely when q is 1, 2, 3, or 4. In the interval 0 ≤ x ≤ 1, the fractions that stand in lowest terms with these denominators are

q = 1: 01 and 11
q = 2: 12
q = 3: 13 and 23
q = 4: 14 and 34.

Notice that 24 does not appear here because it is not in lowest terms; it reduces to 12, which is already listed under q = 2. For any other rational x in 0 ≤ x ≤ 1, the denominator q is at least 5, so f(x) = 1q < 14 and the point (x, f(x)) lies below y = 14. Thus exactly seven points of the graph lie on or above y = 14:

(0, 1), (1, 1), (12,12), (13,13), (23,13), (14,14), (34,14).

Claim 2 is proved, and these seven points can be pinned to the page.

The same reasoning extends to any horizontal line, however low, above the x-axis.

Claim 3: Given any positive number ε, however small, only finitely many points of the graph over 0 ≤ x ≤ 1 lie on or above the line y = ε.

Proof: If ε > 1, the line y = ε clears the entire graph since every value of f is at most 1; the count of points on or above the line is then 0, which is finite. So we may take ε ≤ 1.

Again, no irrational number x can qualify since f(x) = 0; so let x = pq be a rational number in lowest terms with 0 ≤ x ≤ 1. Suppose the point (x, f(x)) lies on or above the line y = ε; that is, 1q ≥ ε. Multiplying both sides by q > 0 yields 1 ≥ εq, and dividing by ε > 0 produces q ≤ 1ε.

Only finitely many positive integers q satisfy q ≤ 1ε; call the largest of them N. For each such q, the fractions pq with 0 ≤ pq ≤ 1 are those with p = 0, 1, …, q, so at most q + 1 points of the graph over 0 ≤ x ≤ 1 lie on the line y = 1q. Across q = 1, 2, …, N, the total number of points of the graph over 0 ≤ x ≤ 1 on or above y = ε is therefore at most

(1 + 1) + (2 + 1) + ⋯ + (N + 1).

For example, when ε = 14 we have N = 4, and the sum is 2 + 3 + 4 + 5 = 14; the true count, by Claim 2, is 7, because the sum also counts fractions such as 24 that are not in lowest terms. As a sum of finitely many whole numbers, the total is finite. Therefore only finitely many points of the graph over 0 ≤ x ≤ 1 lie on or above the line y = ε, and Claim 3 is proved.

Every one of these points can, in principle, be pinned down. When ε = 14, there are 7 points to plot, as in Claim 2; when ε = 1100, the condition is q ≤ 100, and there are 3,045 points.

What remains is an account of the points (x, 0) of the graph with x irrational. Unlike the points above the x-axis, these points are infinite in number and occur in every interval within 0 ≤ x ≤ 1, so they cannot be marked one at a time. No drawing can show them exactly. We mark the entire segment of the x-axis over 0 ≤ x ≤ 1 as an acceptable approximation since the points that should be missing, the points (x, 0) with x rational, have no width and would leave no visible gap. In fact, f is continuous at every irrational number and fails to be continuous only at the rational numbers.*

So far we have looked only at numbers x with 0 ≤ x ≤ 1. Take such a number and shift it along the x-axis by one unit, rightward to x + 1 or leftward to x − 1: does the value of f change?

Take x = 14, which stands in lowest terms, so f(14)=14. One unit to the right of x = 14 lies 14 + 1 = 54, still in lowest terms with denominator 4, so f(54)=14. One unit to the left of x = 14 lies 14 − 1 = −34. The minus sign moves to the numerator, without changing the value of the number, in keeping with the demand that a representation in lowest terms have a positive denominator: −34 = −34. Since gcd(−3, 4) = 1, the denominator in lowest terms is 4, and f(−34)=14.

Take x = 23, also in lowest terms, so f(23)=13. One unit to the right of x = 23 lies 23 + 1 = 53, and one unit to the left lies 23 − 1 = −13 = −13; both stand in lowest terms with denominator 3, so f(53)=13 and f(−13)=13.

In every case, shifting x one unit to the right or to the left kept the denominator intact and therefore kept the value of f intact. The same reasoning extends to every rational number x, and a shorter argument covers the irrational numbers.

Claim 4: For every real number x, f(x + 1) = f(x) and f(x − 1) = f(x).

Proof: Case 1: Let x be irrational. Could x + 1 be rational? Suppose, for contradiction, that x + 1 = mn for integers m and n with n ≠ 0. We begin with the indisputable equation x = (x + 1) − 1.

StepResulting equation
1Write mn in place of x + 1.x = mn − 1
2Write 1 as nn.x = mn − nn
3Subtract the fractions.x = m−nn

The integers are closed under subtraction, so m − n is an integer, and the last equation unmasks x as a rational number. Yet x is irrational, a contradiction. So x + 1 is irrational, and the first branch pairs x + 1 with 0 just as it pairs x with 0: f(x + 1) = 0 = f(x).

Case 2: Let x = pq be a rational number in lowest terms, so gcd(p, q) = 1 and q > 0. Watch what becomes of x + 1 = pq + 1.

StepResulting equation
1Write 1 as qq.x + 1 = pq + qq
2Add the fractions.x + 1 = p+qq

The number x + 1 now wears the guise p+qq, with the same positive denominator q. If that guise stands in lowest terms, then f(x + 1) = 1q = f(x); we must show that gcd(p + q, q) = 1. Suppose, for contradiction, that some integer d greater than 1 divides both p + q and q. By the definition of “divides,” p + q = d · s and q = d · t for some integers s and t. We lay the trap with the equation p = (p + q) − q.

StepResulting equation
1Write d · s in place of p + q and d · t in place of q.p = d · s − d · t
2Factor out d (distributive law).p = d · (s − t)

Since the integers are closed under subtraction, s − t is an integer, and d divides p. Thus d divides both p and q, yet p and q, standing in lowest terms, share no divisor greater than 1, a contradiction. So no integer greater than 1 divides both p + q and q, and gcd(p + q, q) = 1. The guise p+qq stands in lowest terms after all, and f(x + 1) = 1q = f(x).

Whatever x may be, then, a shift of one unit to the right leaves the value of f untouched: f(x + 1) = f(x). And a shift to the left? No new argument is needed: since f(y + 1) = f(y) for every real number y, setting y = x − 1 produces f(x) = f(x − 1). Claim 4 is proved.

What does the claim do for our picture? Take any point (x, f(x)) of the graph and slide it one unit to the right or to the left: by Claim 4, the point lands on the graph again. So the whole graph over 0 ≤ x ≤ 1 slides onto the graph over 1 ≤ x ≤ 2 and onto the graph over −1 ≤ x ≤ 0. Slide again, and again. Every stretch of the x-axis from n to n + 1, for any integer n, carries the same picture: one shattered pattern, repeated without end.

* To see proofs of the starred facts, please inquire about our longer calculus program.

Next
Next

Tile 3 | Two of a Kind?