Book 2A

© 2026 Neckpinch · www.neckpinch.com · All rights reserved.

Course 2Book 2A: Numbers, Limits and the IntegralChapter 3

Integers and Rationals

Building ℤ and ℚ as quotients of pairs, checking operations are well defined, and finding the gaps in ℚ.

57 min read · Updated Oct 20, 2026

Read with Tao, Analysis I, chapter "Integers and rationals" (the integers, the rationals, absolute value and exponentiation, gaps in the rational numbers).

In this chapter · 8 sections
  1. 3.1Why build the integers at all
  2. 3.2The integers as formal differences
  3. 3.2.1Arithmetic, and checking it is well defined
  4. 3.3The laws of integer arithmetic, proved
  5. 3.4The rationals as formal quotients
  6. 3.4.1The rational laws, proved
  7. 3.5Order and absolute value
  8. 3.6Between any two rationals, another
  9. 3.7A hole in the rationals
  10. 3.8Exercises
  11. ↗Free resources

The natural numbers can be added and multiplied, but not always subtracted: 3−53 - 5 has no answer in N\mathbb{N}. Adding a missing answer is a pattern that runs right through mathematics, and this chapter does it twice. First we add the answers to subtractions, which gives the integers Z\mathbb{Z}. Then we add the answers to divisions, which gives the rationals Q\mathbb{Q}. Both times the tool is the one from 2A.2 Sets, Functions and Equivalence: take pairs of numbers you already have, declare when two pairs should count as the same, and pass to the quotient.

The rationals look complete: between any two of them there is another, and they can be added, subtracted, multiplied and divided freely. Yet they have holes. The chapter ends by finding one, at 2\sqrt 2. Filling those holes is the job of the next chapter, and the reason analysis exists.

By the end of this chapter you will be able to:

  • construct Z\mathbb{Z} and Q\mathbb{Q} as quotients, and prove that their operations are well defined;
  • explain why every familiar law of arithmetic for Z\mathbb{Z} and Q\mathbb{Q} now follows from the laws for N\mathbb{N};
  • prove any law of arithmetic for Z\mathbb{Z} or Q\mathbb{Q} with one recipe: choose representatives, compute, and use the laws of the level below;
  • work with order, absolute value and distance on Q\mathbb{Q}, including the triangle inequality and the closeness estimates that the next chapters use;
  • prove that 2\sqrt 2 is irrational, and explain what that says about Q\mathbb{Q}.

Why build the integers at all

Negative numbers are older than any axiom. The Indian mathematician Brahmagupta stated rules for calculating with them in 628 CE, thinking of positive numbers as fortunes and negative numbers as debts. European mathematics resisted them for many centuries more.1 Even in the 17th century, some European mathematicians called negative solutions of equations "false" or "absurd". Today every bank statement, thermometer and altimeter uses them without comment. The question here is not whether negative numbers make sense. It is how to define them so that their laws (why is (−1)(−1)=1(-1)(-1) = 1?) become theorems, proved from what we already have, rather than rules to be memorised.

The obvious approach is to take N\mathbb{N} and add a new symbol −n-n for each positive nn. That can be made to work, but every definition and proof then splits into cases: positive plus positive, positive plus negative with the positive one larger, and so on. The construction below avoids all the cases by a single idea.

The integers as formal differences

An integer is going to be "what you get by subtracting one natural number from another". Since we can't subtract yet, we record the subtraction as a pair, and write it a—ba \mathbin{—} b (read "aa minus bb", but at this stage just a pair of naturals). Different pairs can describe the same intended number: 3—53 \mathbin{—} 5 and 10—1210 \mathbin{—} 12 should both be "−2-2". When should two pairs be the same? We'd like a−b=c−da - b = c - d, which, moving terms across, means a+d=c+ba + d = c + b, and that involves only addition of naturals.

Definition 3.1 Integers

An integer is an expression a—ba \mathbin{—} b where aa and bb are natural numbers. Two integers are equal, a—b=c—da \mathbin{—} b = c \mathbin{—} d, exactly when a+d=c+ba + d = c + b. Formally, the integers are the quotient of N×N\mathbb{N} \times \mathbb{N} by this equivalence relation, and we write Z\mathbb{Z} for the set of integers.

Figure 3.1. Each integer is a whole diagonal of pairs of naturals. The pairs (0,2)(0,2), (1,3)(1,3), (3,5)(3,5) and so on are all the integer −2-2.

Before this definition can be trusted, we must check that "==" really is an equivalence relation, because equality has to be reflexive, symmetric and transitive (2A.2 Sets, Functions and Equivalence).

Lemma 3.2 This is an equivalence relation

The relation a—b∼c—da \mathbin{—} b \sim c \mathbin{—} d if a+d=c+ba + d = c + b is reflexive, symmetric and transitive.

Proof. Reflexive: a+b=a+ba + b = a + b. Symmetric: a+d=c+ba + d = c + b gives c+b=a+dc + b = a + d. Transitive: suppose a+d=c+ba + d = c + b and c+f=e+dc + f = e + d. Adding these equations, a+d+c+f=c+b+e+da + d + c + f = c + b + e + d. Cancelling c+dc + d from both sides (the cancellation law of 2A.1 The Natural Numbers) leaves a+f=e+ba + f = e + b, which says a—b∼e—fa \mathbin{—} b \sim e \mathbin{—} f.

The proof of transitivity used cancellation, which in turn rested on Axiom 1.4 of 2A.1 The Natural Numbers. The axioms keep doing work long after they've been stated.

Arithmetic, and checking it is well defined

The definitions of the operations come from what we want: (a−b)+(c−d)=(a+c)−(b+d)(a - b) + (c - d) = (a + c) - (b + d) and (a−b)(c−d)=(ac+bd)−(ad+bc)(a - b)(c - d) = (ac + bd) - (ad + bc).

Definition 3.3 Operations on integers
(a—b)+(c—d):=(a+c)—(b+d),(a—b)×(c—d):=(ac+bd)—(ad+bc),(a \mathbin{—} b) + (c \mathbin{—} d) := (a + c) \mathbin{—} (b + d), \qquad (a \mathbin{—} b) \times (c \mathbin{—} d) := (ac + bd) \mathbin{—} (ad + bc),
−(a—b):=b—a.-(a \mathbin{—} b) := b \mathbin{—} a.

These are formulas in terms of representatives, so each one must be checked to be well defined: the answer must not depend on which pair we chose for each integer (2A.2 Sets, Functions and Equivalence). Here is the check for addition. The others are similar (Exercise 3.26).

Lemma 3.4 Addition is well defined

If a—b=a′—b′a \mathbin{—} b = a' \mathbin{—} b', then (a—b)+(c—d)=(a′—b′)+(c—d)(a \mathbin{—} b) + (c \mathbin{—} d) = (a' \mathbin{—} b') + (c \mathbin{—} d). (By symmetry the same holds when the second integer is replaced by an equal one.)

Proof. We are given a+b′=a′+ba + b' = a' + b, and must show (a+c)—(b+d)=(a′+c)—(b′+d)(a + c) \mathbin{—} (b + d) = (a' + c) \mathbin{—} (b' + d), that is, (a+c)+(b′+d)=(a′+c)+(b+d)(a + c) + (b' + d) = (a' + c) + (b + d). Rearranging (associativity and commutativity of addition in N\mathbb{N}), the left side is (a+b′)+(c+d)(a + b') + (c + d) and the right side is (a′+b)+(c+d)(a' + b) + (c + d), and these are equal because a+b′=a′+ba + b' = a' + b.

The naturals sit inside the integers. The natural number nn is identified with the integer n—0n \mathbin{—} 0. This is consistent with the operations: (n—0)+(m—0)=(n+m)—0(n \mathbin{—} 0) + (m \mathbin{—} 0) = (n + m) \mathbin{—} 0 and (n—0)×(m—0)=nm—0(n \mathbin{—} 0) \times (m \mathbin{—} 0) = nm \mathbin{—} 0. We may therefore write nn for n—0n \mathbin{—} 0, −n-n for 0—n0 \mathbin{—} n, and x−yx - y for x+(−y)x + (-y). Once this is done, the formal symbol —\mathbin{—} has served its purpose: a—ba \mathbin{—} b really is a−ba - b.

Example 3.5 Computing with formal differences

Take x=2—9x = 2 \mathbin{—} 9 (intended: −7-7) and y=4—1y = 4 \mathbin{—} 1 (intended: 33). By Definition 3.3,

x+y=(2+4)—(9+1)=6—10,x×y=(2⋅4+9⋅1)—(2⋅1+9⋅4)=17—38.x + y = (2 + 4) \mathbin{—} (9 + 1) = 6 \mathbin{—} 10, \qquad x \times y = (2 \cdot 4 + 9 \cdot 1) \mathbin{—} (2 \cdot 1 + 9 \cdot 4) = 17 \mathbin{—} 38.

And 6—10=0—46 \mathbin{—} 10 = 0 \mathbin{—} 4, which is −4=−7+3-4 = -7 + 3, while 17—38=0—2117 \mathbin{—} 38 = 0 \mathbin{—} 21, which is −21=(−7)×3-21 = (-7) \times 3. Now redo the computation with different representatives, x=0—7x = 0 \mathbin{—} 7 and y=3—0y = 3 \mathbin{—} 0: the product is (0+0)—(0+21)=0—21(0 + 0) \mathbin{—} (0 + 21) = 0 \mathbin{—} 21, the same integer. That is well-definedness in action: different names for the inputs, the same output.

Where did the multiplication formula come from? From wanting the distributive law to hold. If a−ba - b and c−dc - d are to be multiplied like ordinary numbers, then (a−b)(c−d)=ac−ad−bc+bd=(ac+bd)−(ad+bc)(a - b)(c - d) = ac - ad - bc + bd = (ac + bd) - (ad + bc). The definition simply records the answer this forces, in a form that uses only addition and multiplication of naturals.

Lemma 3.6 Trichotomy for integers

Every integer xx is exactly one of: a positive natural number nn; zero; or −n-n for a positive natural number nn.

Proof. Write x=a—bx = a \mathbin{—} b. By trichotomy in N\mathbb{N} (2A.1 The Natural Numbers), exactly one of a>ba > b, a=ba = b, a<ba < b holds. If a>ba > b, then a=b+na = b + n with nn positive, and x=(b+n)—b=n—0=nx = (b + n) \mathbin{—} b = n \mathbin{—} 0 = n. If a=ba = b, then x=0x = 0. If a<ba < b, then b=a+nb = a + n with nn positive, and x=0—n=−nx = 0 \mathbin{—} n = -n. These cases are mutually exclusive by 2A.1 The Natural Numbers's trichotomy, and the representation does not depend on the chosen pair, by Lemma 3.2.

So the quotient construction gives back exactly the picture everyone has of the integers, without our ever having to define them by cases.

Proposition 3.7 The integers form a commutative ring

For all integers x,y,zx, y, z: addition and multiplication are commutative and associative; x+0=xx + 0 = x and x×1=xx \times 1 = x; x+(−x)=0x + (-x) = 0; and multiplication distributes over addition, x(y+z)=xy+xzx(y + z) = xy + xz.

Each law is proved by writing xx, yy, zz as formal differences and using the corresponding laws in N\mathbb{N}. For example, (a—b)+(b—a)=(a+b)—(b+a)=0(a \mathbin{—} b) + (b \mathbin{—} a) = (a + b) \mathbin{—} (b + a) = 0, because (a+b)+0=0+(b+a)(a + b) + 0 = 0 + (b + a). In particular, (−1)(−1)=(0—1)(0—1)=(0+1)—(0+0)=1(-1)(-1) = (0 \mathbin{—} 1)(0 \mathbin{—} 1) = (0 + 1) \mathbin{—} (0 + 0) = 1. The sign rule that schoolchildren memorise is a two-line computation.

Proposition 3.8 No zero divisors; cancellation

If xy=0xy = 0 then x=0x = 0 or y=0y = 0. Consequently, if xz=yzxz = yz and z≠0z \neq 0, then x=yx = y.

The first statement follows from Lemma 3.6 and the corresponding fact for N\mathbb{N} (2A.1 The Natural Numbers), by checking signs. The second follows from the first applied to (x−y)z=0(x - y)z = 0.

Order. For integers, n≥mn \geq m means n−mn - m is a natural number, and n>mn > m means n−mn - m is a positive natural number. The order laws of 2A.1 The Natural Numbers carry over, with one important change: multiplying by a negative number reverses an inequality. If a>ba > b and c<0c < 0 then ac<bcac < bc (Exercise 3.27).

The laws of integer arithmetic, proved

The previous section stated the laws of the integers and proved one or two. This section proves the rest, because the method is the important thing: it is used again, unchanged, for the rationals below and for the real numbers in 2A.4 The Real Numbers. If you are happy to take the laws on trust, read the recipe and the first two proofs, and move on.

Note The recipe for proving a law in a quotient

To prove a law about integers (or, later, rationals or reals):

  1. Choose representatives. Write each integer in the law as a formal difference: x=a—bx = a \mathbin{—} b, y=c—dy = c \mathbin{—} d, and so on.
  2. Compute both sides using the definitions of the operations, until each side is a single formal difference of natural numbers.
  3. Compare using the definition of equality (p—q=r—sp \mathbin{—} q = r \mathbin{—} s when p+s=r+qp + s = r + q), and the laws of N\mathbb{N} proved in 2A.1 The Natural Numbers.

Step 1 is legitimate only because the operations are well defined. Without that, the answer might depend on the representatives chosen, and the computation in step 2 would prove nothing about the integers themselves.

Proof (Commutativity and associativity of addition; zero and negatives). With x=a—bx = a \mathbin{—} b, y=c—dy = c \mathbin{—} d, z=e—fz = e \mathbin{—} f:

  • x+y=(a+c)—(b+d)x + y = (a + c) \mathbin{—} (b + d) and y+x=(c+a)—(d+b)y + x = (c + a) \mathbin{—} (d + b). These are the same pair, by commutativity in N\mathbb{N}.
  • (x+y)+z(x + y) + z and x+(y+z)x + (y + z) both compute to (a+c+e)—(b+d+f)(a + c + e) \mathbin{—} (b + d + f), by associativity in N\mathbb{N}.
  • 0=0—00 = 0 \mathbin{—} 0, and x+0=(a+0)—(b+0)=a—b=xx + 0 = (a + 0) \mathbin{—} (b + 0) = a \mathbin{—} b = x.
  • x+(−x)=(a—b)+(b—a)=(a+b)—(b+a)x + (-x) = (a \mathbin{—} b) + (b \mathbin{—} a) = (a + b) \mathbin{—} (b + a), which equals 0—00 \mathbin{—} 0 because (a+b)+0=0+(b+a)(a + b) + 0 = 0 + (b + a).

Negation is well defined: if a—b=a′—b′a \mathbin{—} b = a' \mathbin{—} b', so a+b′=a′+ba + b' = a' + b, then b—a=b′—a′b \mathbin{—} a = b' \mathbin{—} a' requires b+a′=b′+ab + a' = b' + a, which is the same equation.

Proof (Commutativity of multiplication, the unit, and distributivity).

  • xy=(ac+bd)—(ad+bc)xy = (ac + bd) \mathbin{—} (ad + bc) and yx=(ca+db)—(cb+da)yx = (ca + db) \mathbin{—} (cb + da): the same pair, by commutativity of both operations in N\mathbb{N}.
  • 1=1—01 = 1 \mathbin{—} 0, and x×1=(a⋅1+b⋅0)—(a⋅0+b⋅1)=a—bx \times 1 = (a \cdot 1 + b \cdot 0) \mathbin{—} (a \cdot 0 + b \cdot 1) = a \mathbin{—} b.
  • For distributivity, y+z=(c+e)—(d+f)y + z = (c + e) \mathbin{—} (d + f), so
x(y+z)=(a(c+e)+b(d+f))—(a(d+f)+b(c+e))=(ac+ae+bd+bf)—(ad+af+bc+be).x(y + z) = \big(a(c + e) + b(d + f)\big) \mathbin{—} \big(a(d + f) + b(c + e)\big) = (ac + ae + bd + bf) \mathbin{—} (ad + af + bc + be).

On the other side, xy+xz=((ac+bd)—(ad+bc))+((ae+bf)—(af+be))=(ac+bd+ae+bf)—(ad+bc+af+be)xy + xz = \big((ac + bd) \mathbin{—} (ad + bc)\big) + \big((ae + bf) \mathbin{—} (af + be)\big) = (ac + bd + ae + bf) \mathbin{—} (ad + bc + af + be). The two pairs have the same entries in a different order, so they are equal.

Associativity of multiplication is the same kind of computation, with eight terms on each side (Exercise 3.28).

Two consequences are used constantly. First, (−x)y=−(xy)(-x)y = -(xy): with x=a—bx = a \mathbin{—} b, (−x)y=(b—a)(c—d)=(bc+ad)—(bd+ac)(-x)y = (b \mathbin{—} a)(c \mathbin{—} d) = (bc + ad) \mathbin{—} (bd + ac), which is −(xy)-(xy). Second, (−x)(−y)=xy(-x)(-y) = xy, by applying the first twice. That is the sign rule, in general.

Now the proof of Proposition 3.8, which was only sketched above.

Proof (No zero divisors, and cancellation). Suppose x≠0x \neq 0 and y≠0y \neq 0. By Lemma 3.6, x=nx = n or x=−nx = -n, and y=my = m or y=−my = -m, for positive natural numbers nn and mm. By the sign rules just proved, xyxy is nmnm or −(nm)-(nm). And nmnm is a positive natural number (2A.1 The Natural Numbers, no zero divisors), so xy≠0xy \neq 0. This proves the first statement, by contrapositive.

For cancellation, suppose xz=yzxz = yz with z≠0z \neq 0. Then (x−y)z=xz+(−y)z=xz−yz=0(x - y)z = xz + (-y)z = xz - yz = 0, using distributivity and (−y)z=−(yz)(-y)z = -(yz). By the first statement, x−y=0x - y = 0, so x=yx = y.

Proposition 3.9 Order on the integers

For all integers x,y,zx, y, z:

  1. (Trichotomy) exactly one of x<yx < y, x=yx = y, x>yx > y holds;
  2. (Transitivity) if x<yx < y and y<zy < z then x<zx < z;
  3. if x<yx < y then x+z<y+zx + z < y + z;
  4. if x<yx < y and z>0z > 0 then xz<yzxz < yz;
  5. if x<yx < y and z<0z < 0 then xz>yzxz > yz.

Proof. (1) Apply Lemma 3.6 to y−xy - x: it is a positive natural (x<yx < y), zero (x=yx = y), or the negative of a positive natural (y<xy < x, since then x−yx - y is positive). (2) z−x=(z−y)+(y−x)z - x = (z - y) + (y - x) is a sum of two positive naturals, so a positive natural. (3) (y+z)−(x+z)=y−x(y + z) - (x + z) = y - x. (4) yz−xz=(y−x)zyz - xz = (y - x)z is a product of two positive naturals. (5) Write z=−mz = -m with mm a positive natural. Then xz−yz=(y−x)mxz - yz = (y - x)m, a product of positive naturals, so xz>yzxz > yz.

Part (5) is the solution to Exercise 3.27; notice that the proof uses Lemma 3.6 to write a negative zz as −m-m.

The rationals as formal quotients

Now do the same for division. A rational number should be "aa divided by bb", with b≠0b \neq 0, recorded as a formal quotient a/ ⁣ ⁣/ba /\!\!/ b. When should a/ ⁣ ⁣/ba /\!\!/ b and c/ ⁣ ⁣/dc /\!\!/ d be equal? We'd like a/b=c/da/b = c/d, which means ad=cbad = cb, an equation in the integers alone.

Definition 3.10 Rationals

A rational number is an expression a/ ⁣ ⁣/ba /\!\!/ b with a,ba, b integers and b≠0b \neq 0. Two rationals are equal, a/ ⁣ ⁣/b=c/ ⁣ ⁣/da /\!\!/ b = c /\!\!/ d, exactly when ad=cbad = cb. The set of rationals is written Q\mathbb{Q}: the quotient of Z×(Z∖{0})\mathbb{Z} \times (\mathbb{Z} \setminus \{0\}) by this equivalence relation.

Figure 3.2. Each rational is a whole line through the origin. The pairs (2,1)(2,1), (4,2)(4,2) and (6,3)(6,3) (denominator, numerator) all lie on the line of slope 12\tfrac12, so 1/ ⁣ ⁣/2=2/ ⁣ ⁣/4=3/ ⁣ ⁣/61/\!\!/2 = 2/\!\!/4 = 3/\!\!/6.

Showing this is an equivalence relation needs one more ingredient than for the integers. Transitivity requires cancelling a nonzero factor: from ad=cbad = cb and cf=edcf = ed we get adf=cbf=ebdadf = cbf = ebd, so (af−eb)d=0(af - eb)d = 0, and since d≠0d \neq 0, Proposition 3.8 gives af=ebaf = eb.

Definition 3.11 Operations on rationals
ab+cd:=ad+bcbd,ab×cd:=acbd,−ab:=−ab,\frac{a}{b} + \frac{c}{d} := \frac{ad + bc}{bd}, \qquad \frac{a}{b} \times \frac{c}{d} := \frac{ac}{bd}, \qquad -\frac{a}{b} := \frac{-a}{b},

and, if a≠0a \neq 0, the reciprocal (a/b)−1:=b/a(a/b)^{-1} := b/a.

(Here and from now on we write ab\tfrac{a}{b} or a/ba/b for a/ ⁣ ⁣/ba /\!\!/ b.) The denominators bdbd are nonzero by Proposition 3.8.

Each of these is well defined. For multiplication: if a/b=a′/b′a/b = a'/b', that is, ab′=a′bab' = a'b, then (ac)(b′d)=(a′c)(bd)(ac)(b'd) = (a'c)(bd) (multiply both sides by cdcd and rearrange), which says acbd=a′cb′d\tfrac{ac}{bd} = \tfrac{a'c}{b'd}. The integer nn is identified with n/1n/1, and the operations agree with those of Z\mathbb{Z}.

Proposition 3.12 The rationals form a field

The rationals satisfy all the laws of Proposition 3.7, and in addition every nonzero rational xx has a reciprocal: x⋅x−1=1x \cdot x^{-1} = 1.

A set with an addition and multiplication satisfying these laws is called a field. The integers are not a field, because 22 has no integer reciprocal; the rationals are. We can now define division, x/y:=x×y−1x / y := x \times y^{-1} for y≠0y \neq 0, and powers with integer exponents, x−n:=(xn)−1x^{-n} := (x^n)^{-1}, with the usual laws (Exercise 3.30).

In the world In use Exact fractions in a computer

Floating-point numbers (the subject of 2A.4 The Real Numbers) can't represent 13\tfrac13 exactly, so programs that need exact answers, such as computer algebra systems, exact geometry and some financial calculations, use rationals instead. They store a fraction exactly as this chapter defines it: a pair of integers. To make equality easy to test, they keep one canonical representative of each class, with the numerator and denominator reduced to lowest terms and the denominator positive. Python's standard fractions.Fraction type does exactly this, so Fraction(2, 4) and Fraction(1, 2) are stored identically. Choosing a canonical representative for each equivalence class is a recurring trick: it turns a quotient back into a set of concrete objects.

The rational laws, proved

The proofs for Q\mathbb{Q} follow the same recipe as for Z\mathbb{Z}, one level up: choose representatives a/ba/b, compute, and use the laws of Z\mathbb{Z}. Two small facts make the computations short.

Lemma 3.13 Common factors and common denominators

For integers aa, cc and nonzero integers bb, kk:

  1. akbk=ab\dfrac{ak}{bk} = \dfrac{a}{b} (a common nonzero factor cancels);
  2. ab+cb=a+cb\dfrac{a}{b} + \dfrac{c}{b} = \dfrac{a + c}{b} (fractions with the same denominator add numerators);
  3. ab=0\dfrac{a}{b} = 0 exactly when a=0a = 0, and ab=−a−b\dfrac ab = \dfrac{-a}{-b}.

Proof. (1) By Definition 3.10 we need (ak)b=a(bk)(ak)b = a(bk), which holds in Z\mathbb{Z}. (2) By Definition 3.11, ab+cb=ab+bcb2=(a+c)bb⋅b\frac ab + \frac cb = \frac{ab + bc}{b^2} = \frac{(a + c)b}{b \cdot b}, which is a+cb\frac{a + c}{b} by part (1). (3) 00 is 0/10/1, and a/b=0/1a/b = 0/1 means a⋅1=0⋅b=0a \cdot 1 = 0 \cdot b = 0. And a(−b)=(−a)ba(-b) = (-a)b.

Proof (Addition and the reciprocal are well defined). Addition. Suppose a/b=a′/b′a/b = a'/b', that is, ab′=a′bab' = a'b. We need ad+bcbd=a′d+b′cb′d\frac{ad + bc}{bd} = \frac{a'd + b'c}{b'd}, that is,

(ad+bc)(b′d)=(a′d+b′c)(bd).(ad + bc)(b'd) = (a'd + b'c)(bd).

The left side is ab′d2+bb′cdab'd^2 + bb'cd and the right side is a′bd2+bb′cda'bd^2 + bb'cd. These are equal because ab′=a′bab' = a'b. Replacing the second summand by an equal one is the same computation.

Reciprocal. Suppose a/b=a′/b′a/b = a'/b' with a≠0a \neq 0. Then a′b=ab′≠0a'b = ab' \neq 0 (a product of nonzero integers), so a′≠0a' \neq 0 and b′/a′b'/a' makes sense. And b/a=b′/a′b/a = b'/a' requires ba′=b′aba' = b'a, which is the same equation as before.

Proof (The field laws). Write x=a/bx = a/b, y=c/dy = c/d, z=e/fz = e/f.

  • Additive inverse: x+(−x)=ab+−ab=a−ab=0b=0x + (-x) = \frac ab + \frac{-a}{b} = \frac{a - a}{b} = \frac 0b = 0, by Lemma 3.13.
  • Reciprocal: if x≠0x \neq 0 then a≠0a \neq 0, and x⋅x−1=ab⋅ba=abab=11=1x \cdot x^{-1} = \frac ab \cdot \frac ba = \frac{ab}{ab} = \frac 11 = 1, by part (1) of Lemma 3.13 with k=abk = ab.
  • Distributivity: y+z=cf+dedfy + z = \frac{cf + de}{df}, so x(y+z)=acf+adebdfx(y + z) = \frac{acf + ade}{bdf}. On the other side, xy+xz=acbd+aebf=acbf+bdaeb2df=(acf+ade) b(bdf) bxy + xz = \frac{ac}{bd} + \frac{ae}{bf} = \frac{acbf + bdae}{b^2 df} = \frac{(acf + ade)\,b}{(bdf)\,b}, which equals acf+adebdf\frac{acf + ade}{bdf} by Lemma 3.13.
  • Commutativity, associativity, 00 and 11: each is a short computation of the same kind, using the corresponding law in Z\mathbb{Z}. For example ab⋅11=ab\frac ab \cdot \frac 11 = \frac{a}{b}, and both (xy)z(xy)z and x(yz)x(yz) are acebdf\frac{ace}{bdf}.

Finally, the integers sit inside the rationals consistently: n1+m1=n+m1\frac n1 + \frac m1 = \frac{n + m}{1} and n1⋅m1=nm1\frac n1 \cdot \frac m1 = \frac{nm}{1}, so the identification n=n/1n = n/1 respects both operations.

Order and absolute value

Definition 3.14 Positive rationals; order

A rational xx is positive if x=a/bx = a/b for some positive integers a,ba, b, and negative if −x-x is positive. For rationals, x>yx > y means x−yx - y is positive.

Every rational is exactly one of positive, zero or negative, by the integer version of trichotomy. With this order Q\mathbb{Q} is an ordered field: sums and products of positive rationals are positive, and order is compatible with addition and with multiplication by positive numbers.

Both claims deserve a proof, because Definition 3.14 is phrased in terms of some representative, and a rational has many.

Lemma 3.15 Reading the sign of a fraction

Let a,ba, b be integers with b≠0b \neq 0. Then a/ba/b is positive exactly when aa and bb are both positive or both negative; it is zero exactly when a=0a = 0; and it is negative exactly when one of a,ba, b is positive and the other negative.

Proof. If a,ba, b are both negative, then a/b=(−a)/(−b)a/b = (-a)/(-b) with −a,−b-a, -b positive, so a/ba/b is positive. Conversely, suppose a/b=p/qa/b = p/q with p,qp, q positive integers, so aq=pbaq = pb. If b>0b > 0, then pb>0pb > 0, so aq>0aq > 0, and since q>0q > 0 this forces a>0a > 0 (if a≤0a \leq 0 then aq≤0aq \leq 0 by Proposition 3.9). If b<0b < 0, the same argument gives a<0a < 0. So a positive rational always has numerator and denominator of the same sign. The case a=0a = 0 is Lemma 3.13. Finally, a/ba/b is negative when −a/b-a/b is positive, that is, when −a-a and bb have the same sign, that is, when aa and bb have opposite signs.

So every rational can be written a/ba/b with b>0b > 0 (replace a/ba/b by (−a)/(−b)(-a)/(-b) if needed), and then its sign is simply the sign of aa. Trichotomy for Q\mathbb{Q} follows at once from trichotomy for Z\mathbb{Z}. If a/ba/b and c/dc/d are positive, written with a,b,c,d>0a, b, c, d > 0, then their sum ad+bcbd\frac{ad + bc}{bd} and product acbd\frac{ac}{bd} visibly have positive numerators and denominators. The order laws of Proposition 3.9 then hold for Q\mathbb{Q} with the same proofs, since those proofs used only "sums and products of positives are positive".

One more consequence is used constantly: if 0<x<y0 < x < y then 0<1/y<1/x0 < 1/y < 1/x. Indeed 1x−1y=y−xxy\frac1x - \frac1y = \frac{y - x}{xy}, a positive number divided by a positive number.

Definition 3.16 Absolute value and distance

The absolute value of a rational xx is ∣x∣=x|x| = x if x≥0x \geq 0 and ∣x∣=−x|x| = -x if x<0x < 0. The distance between xx and yy is d(x,y)=∣x−y∣d(x, y) = |x - y|.

Proposition 3.17 Properties of absolute value

For all rationals x,y,zx, y, z:

  1. ∣x∣≥0|x| \geq 0, with ∣x∣=0|x| = 0 exactly when x=0x = 0;
  2. ∣xy∣=∣x∣ ∣y∣|xy| = |x|\,|y|;
  3. (Triangle inequality) ∣x+y∣≤∣x∣+∣y∣|x + y| \leq |x| + |y|, and hence d(x,z)≤d(x,y)+d(y,z)d(x, z) \leq d(x, y) + d(y, z);
  4. ∣x∣≤y|x| \leq y if and only if −y≤x≤y-y \leq x \leq y.

Proof (Triangle inequality). By (4), −∣x∣≤x≤∣x∣-|x| \leq x \leq |x| and −∣y∣≤y≤∣y∣-|y| \leq y \leq |y|. Adding, −(∣x∣+∣y∣)≤x+y≤∣x∣+∣y∣-(|x| + |y|) \leq x + y \leq |x| + |y|, which by (4) again says ∣x+y∣≤∣x∣+∣y∣|x + y| \leq |x| + |y|. Applying this to x−yx - y and y−zy - z, whose sum is x−zx - z, gives the statement about distances.

Proof (Parts 1, 2 and 4). (1) If x≥0x \geq 0 then ∣x∣=x≥0|x| = x \geq 0; if x<0x < 0 then ∣x∣=−x>0|x| = -x > 0. In either case ∣x∣=0|x| = 0 forces x=0x = 0.

(2) In every case ∣x∣=±x|x| = \pm x and ∣y∣=±y|y| = \pm y, so ∣x∣ ∣y∣=±xy|x|\,|y| = \pm xy; likewise ∣xy∣=±xy|xy| = \pm xy. Both ∣x∣ ∣y∣|x|\,|y| and ∣xy∣|xy| are ≥0\geq 0. If xy=0xy = 0 both are 00. Otherwise exactly one of xyxy and −xy-xy is positive, and both quantities must equal that one.

(4) Suppose ∣x∣≤y|x| \leq y; then y≥0y \geq 0. If x≥0x \geq 0, then x=∣x∣≤yx = |x| \leq y and −y≤0≤x-y \leq 0 \leq x. If x<0x < 0, then −x≤y-x \leq y, so x≥−yx \geq -y, and x<0≤yx < 0 \leq y. Conversely, suppose −y≤x≤y-y \leq x \leq y. If x≥0x \geq 0 then ∣x∣=x≤y|x| = x \leq y; if x<0x < 0 then ∣x∣=−x≤y|x| = -x \leq y, from −y≤x-y \leq x.

The triangle inequality is the most-used inequality in analysis. Every argument of the form "these two things are close because each is close to a third" is an application of it, and in 2B.1 Metric Spaces it becomes the defining property of a distance.

Careful The triangle inequality goes one way

∣x+y∣≤∣x∣+∣y∣|x + y| \leq |x| + |y|, never "≥\geq" in general: ∣1+(−1)∣=0|1 + (-1)| = 0 while ∣1∣+∣−1∣=2|1| + |-1| = 2. Cancellation between terms can only make a sum smaller in size. A common slip is to write ∣x−y∣≤∣x∣−∣y∣|x - y| \leq |x| - |y|, which is false (x=0x = 0, y=1y = 1). The correct companion is the reverse triangle inequality of Exercise 3.31.

Definition 3.18 ε-closeness

Let ε>0\varepsilon > 0 be rational. Two rationals xx and yy are ε\varepsilon-close if d(x,y)≤εd(x, y) \leq \varepsilon.

This is a deliberately modest notion: it is about a single tolerance ε\varepsilon, not about limits. But the next chapter builds the real numbers entirely out of statements of the form "for every ε>0\varepsilon > 0, eventually, things are ε\varepsilon-close". The following estimates are the tools for that, and the third one deserves to be learned by heart.

Proposition 3.19 How closeness behaves under arithmetic

Let ε,δ>0\varepsilon, \delta > 0 be rationals, and x,y,z,wx, y, z, w rationals.

  1. If x,yx, y are ε\varepsilon-close and y,zy, z are δ\delta-close, then x,zx, z are (ε+δ)(\varepsilon + \delta)-close.
  2. If x,yx, y are ε\varepsilon-close and z,wz, w are δ\delta-close, then x+zx + z and y+wy + w are (ε+δ)(\varepsilon + \delta)-close, and so are x−zx - z and y−wy - w.
  3. If x,yx, y are ε\varepsilon-close and z,wz, w are δ\delta-close, then xzxz and ywyw are (ε∣z∣+δ∣x∣+εδ)(\varepsilon|z| + \delta|x| + \varepsilon\delta)-close.

Proof. (1) is the triangle inequality: ∣x−z∣≤∣x−y∣+∣y−z∣≤ε+δ|x - z| \leq |x - y| + |y - z| \leq \varepsilon + \delta.

(2) (y+w)−(x+z)=(y−x)+(w−z)(y + w) - (x + z) = (y - x) + (w - z), so by the triangle inequality ∣(y+w)−(x+z)∣≤∣y−x∣+∣w−z∣≤ε+δ|(y + w) - (x + z)| \leq |y - x| + |w - z| \leq \varepsilon + \delta. For differences, (y−w)−(x−z)=(y−x)−(w−z)(y - w) - (x - z) = (y - x) - (w - z), and the same estimate applies.

(3) Write y=x+ay = x + a and w=z+bw = z + b, where ∣a∣≤ε|a| \leq \varepsilon and ∣b∣≤δ|b| \leq \delta. Then

yw=(x+a)(z+b)=xz+az+xb+ab,yw = (x + a)(z + b) = xz + az + xb + ab,

so yw−xz=az+xb+abyw - xz = az + xb + ab, and by the triangle inequality and ∣uv∣=∣u∣ ∣v∣|uv| = |u|\,|v|,

∣yw−xz∣≤∣a∣ ∣z∣+∣x∣ ∣b∣+∣a∣ ∣b∣≤ε∣z∣+δ∣x∣+εδ.|yw - xz| \leq |a|\,|z| + |x|\,|b| + |a|\,|b| \leq \varepsilon|z| + \delta|x| + \varepsilon\delta.

The trick in (3), writing each perturbed quantity as "original plus small error" and expanding, is the single most common computation in analysis. Notice what the answer says: to make a product close, the errors must be small compared with the sizes of the factors. If ∣x∣|x| and ∣z∣|z| are huge, tiny errors in the factors can make a large error in the product. That is why, when the next chapters multiply sequences, they first prove that the sequences are bounded (2A.4 The Real Numbers, 2A.6 Sequences).

Example 3.20 How accurate must the factors be?

Suppose xx and zz are measured quantities with ∣x∣≤10|x| \leq 10 and ∣z∣≤10|z| \leq 10, and we want their product to within 0.0010.001. If each is measured to within ε\varepsilon, then by part (3) the product is within 10ε+10ε+ε2=20ε+ε210\varepsilon + 10\varepsilon + \varepsilon^2 = 20\varepsilon + \varepsilon^2. With ε=0.00004\varepsilon = 0.00004 this is 0.0008+0.0000000016<0.0010.0008 + 0.0000000016 < 0.001. So measuring each factor to within 4×10−54 \times 10^{-5} is enough. This is exactly the shape of an ε\varepsilon–NN argument: you are told the tolerance for the output, and you work backwards to a tolerance for the inputs.

Between any two rationals, another

The integers are spread out, one unit apart. The rationals are not: they crowd together everywhere. The first step is to show that the integers at least reach everywhere.

Proposition 3.21 Archimedean property and the integer part

For every rational xx there is a unique integer nn with n≤x<n+1n \leq x < n + 1. In particular, for every rational xx there is a natural number larger than xx.

Proof. Existence for x=a/bx = a/b with b>0b > 0: by Euclidean division in N\mathbb{N} (2A.1 The Natural Numbers), extended to integers aa in Exercise 3.29, write a=nb+ra = nb + r with 0≤r<b0 \leq r < b. Then x=n+r/bx = n + r/b with 0≤r/b<10 \leq r/b < 1. Uniqueness: if n≤x<n+1n \leq x < n + 1 and m≤x<m+1m \leq x < m + 1, then ∣n−m∣<1|n - m| < 1, and the only integer with absolute value less than 11 is 00.

The integer nn is written ⌊x⌋\lfloor x \rfloor, the integer part or floor of xx. The form of the Archimedean property used most often in analysis is about small numbers rather than large ones.

Corollary 3.22 Small reciprocals

For every rational ε>0\varepsilon > 0 there is a positive integer NN with 1/N<ε1/N < \varepsilon, and then 1/n<ε1/n < \varepsilon for every n≥Nn \geq N.

Proof. By Proposition 3.21 there is a natural number N>1/εN > 1/\varepsilon; then NN is positive, and Nε>1N\varepsilon > 1, so 1/N<ε1/N < \varepsilon (multiply by the positive number 1/N1/N). If n≥Nn \geq N, then 1/n≤1/N<ε1/n \leq 1/N < \varepsilon, by the reciprocal rule above.

This is the first time an "NN" is produced from an "ε\varepsilon". Every limit in the next chapters starts this way.

Proposition 3.23 The rationals are dense

If x<yx < y are rationals, then there is a rational zz with x<z<yx < z < y.

Proof. Take z=(x+y)/2z = (x + y)/2. Then z−x=(y−x)/2>0z - x = (y - x)/2 > 0 and y−z=(y−x)/2>0y - z = (y - x)/2 > 0.

Applying Proposition 3.23 again and again, there are infinitely many rationals between any two. A picture of the rationals between 00 and 11 suggests a continuum with no room left over.

Figure 3.3. Every fraction between 00 and 11 with denominator at most 1212, the taller ticks for smaller denominators. The rationals are dense: between any two there are infinitely many more. Yet, as the next section shows, the line still has holes.

A hole in the rationals

The square on a unit length has a diagonal of length dd with d2=12+12=2d^2 = 1^2 + 1^2 = 2, by Pythagoras. Is that length a rational number?

Theorem 3.24 2\sqrt 2 is irrational

There is no rational number xx with x2=2x^2 = 2.

Proof (By infinite descent). Suppose x2=2x^2 = 2 for some rational xx. Replacing xx by −x-x if necessary, x>0x > 0, so x=p/qx = p/q with pp and qq positive natural numbers. Then p2=2q2p^2 = 2q^2. So p2p^2 is even, and therefore pp is even, since the square of an odd number is odd ((2k+1)2=2(2k2+2k)+1(2k+1)^2 = 2(2k^2 + 2k) + 1). Write p=2p′p = 2p'. Then 4p′2=2q24p'^2 = 2q^2, so q2=2p′2q^2 = 2p'^2, and by the same argument qq is even, q=2q′q = 2q'. Now x=p/q=p′/q′x = p/q = p'/q', with 0<q′<q0 < q' < q.

We started from one representation x=p/qx = p/q with positive natural numbers and produced another with a strictly smaller denominator. Repeating forever would give an infinite strictly decreasing sequence of natural numbers q>q′>q′′>⋯q > q' > q'' > \cdots, which is impossible by the well-ordering principle of 2A.1 The Natural Numbers. So no such xx exists.

The proof uses exactly the descent form of well-ordering from 2A.1 The Natural Numbers. A shorter version takes qq to be the smallest possible denominator at the start, and reaches a contradiction in one step.

Figure 3.4. The diagonal of the unit square has length 2\sqrt 2, which is not rational. Rationals get as close to it as you like (32\tfrac32, 1712\tfrac{17}{12}, 577408\tfrac{577}{408}, …, from the divide-and-average method of 2A.4 The Real Numbers), but none lands on it.

So the rationals, though dense, are full of holes. There are rationals whose squares are as close to 22 as you please, from both sides, but none whose square is 22. The first half of that sentence also needs a proof, and the proof is a good example of induction and the Archimedean property working together.

Proposition 3.25 Rationals squeeze up to the hole

For every rational ε>0\varepsilon > 0 there is a rational x≥0x \geq 0 with x2<2<(x+ε)2x^2 < 2 < (x + \varepsilon)^2.

Proof. Suppose not, for some ε>0\varepsilon > 0. Then whenever x≥0x \geq 0 is rational with x2<2x^2 < 2, we must have (x+ε)2≤2(x + \varepsilon)^2 \leq 2, and since (x+ε)2=2(x + \varepsilon)^2 = 2 is impossible (Theorem 3.24), in fact (x+ε)2<2(x + \varepsilon)^2 < 2. Now 02<20^2 < 2, so by induction on nn, (nε)2<2(n\varepsilon)^2 < 2 for every natural number nn. But by Proposition 3.21 there is a natural number n>2/εn > 2/\varepsilon, and for it nε>2n\varepsilon > 2, so (nε)2>4>2(n\varepsilon)^2 > 4 > 2. This contradiction proves the proposition.

So the set of non-negative rationals whose square is less than 22 creeps up arbitrarily close to the hole, and has no largest element and no rational least upper bound (Exercise 3.35). Being bounded above and yet having no least upper bound is precisely the defect the real numbers are designed to cure (2A.4 The Real Numbers). Calculus needs every such gap filled. The intermediate value theorem (2A.9 Continuous Functions) would be false over Q\mathbb{Q}: the function x2−2x^2 - 2 is negative at 11 and positive at 22, yet has no rational zero. Filling the gaps is the construction of the real numbers.

In the world Data Why no tuning is perfect: the Pythagorean comma

The same kind of argument, about prime factors, explains a fact every musician lives with. Two notes a perfect fifth apart have frequencies in the ratio 3/23/2, and an octave is a ratio of 22. Twelve fifths are meant to span the same range as seven octaves, so you would hope (3/2)12=27(3/2)^{12} = 2^7, which means 312=2193^{12} = 2^{19}. That is impossible: 3123^{12} is odd and 2192^{19} is even. The actual ratio is

(3/2)1227=312219=531441524288≈1.01364,\frac{(3/2)^{12}}{2^7} = \frac{3^{12}}{2^{19}} = \frac{531441}{524288} \approx 1.01364,

about 23.46 cents, roughly a quarter of a semitone. This is the Pythagorean comma. Going round the circle of fifths from C doesn't return exactly to C. Equal temperament, the tuning of most modern keyboards, hides the comma by making every fifth very slightly narrow, by one twelfth of the comma (about 2 cents), so the circle closes.

Figure 3.5. Stacking perfect fifths (×32\times\tfrac32) and folding back into one octave, drawn as one turn of a circle. After twelve fifths you land just past the start: the gap is the Pythagorean comma. It can't be zero, because no power of 33 is a power of 22.
Where this goes Where this goes

Two ideas from this chapter run far ahead. The first is the quotient construction with a well-definedness check, which builds the reals next (2A.4 The Real Numbers) and much later the spaces on which Ricci flow acts (11A.4 Short-Time Existence and Uniqueness). The second is the triangle inequality. It defines a metric space in 2B.1 Metric Spaces, and in Riemannian geometry (9A.3 Geodesics and the Exponential Map) the distance between two points of a curved space is defined as the length of the shortest path between them, a definition chosen precisely so that the triangle inequality holds.

Recall Where we stand

From the natural numbers we have built the integers, a commutative ring with no zero divisors, and the rationals, an ordered field with an absolute value satisfying the triangle inequality. The rationals are dense but have gaps: x2=2x^2 = 2 has no rational solution. 2A.4 The Real Numbers fills the gaps and builds the real numbers.

Exercises

Exercise 3.26 Multiplication is well defined

Show that integer multiplication (Definition 3.3) is well defined: if a—b=a′—b′a \mathbin{—} b = a' \mathbin{—} b', then (a—b)(c—d)=(a′—b′)(c—d)(a \mathbin{—} b)(c \mathbin{—} d) = (a' \mathbin{—} b')(c \mathbin{—} d).

Hint

You are given a+b′=a′+ba + b' = a' + b. Multiply by cc and by dd, and add the results in the right combination.

Solution

We need (ac+bd)+(a′d+b′c)=(a′c+b′d)+(ad+bc)(ac + bd) + (a'd + b'c) = (a'c + b'd) + (ad + bc). Multiplying a+b′=a′+ba + b' = a' + b by cc gives ac+b′c=a′c+bcac + b'c = a'c + bc, and multiplying by dd (with the sides swapped) gives a′d+bd=ad+b′da'd + bd = ad + b'd. Adding these two equations gives exactly the required identity.

Exercise 3.27 Multiplying by a negative

Prove that if a>ba > b and c<0c < 0 are integers, then ac<bcac < bc. Where does the proof use Lemma 3.6?

Solution

This is part (5) of Proposition 3.9. Since c<0c < 0, Lemma 3.6 lets us write c=−mc = -m with mm a positive natural number. Then bc−ac=(a−b)mbc - ac = (a - b)m, a product of two positive naturals, so bc>acbc > ac.

Exercise 3.28 Associativity of integer multiplication

With x=a—bx = a \mathbin{—} b, y=c—dy = c \mathbin{—} d, z=e—fz = e \mathbin{—} f, show that (xy)z(xy)z and x(yz)x(yz) are equal.

Solution

xy=(ac+bd)—(ad+bc)xy = (ac + bd) \mathbin{—} (ad + bc), so

(xy)z=(ace+bde+adf+bcf)—(acf+bdf+ade+bce).(xy)z = (ace + bde + adf + bcf) \mathbin{—} (acf + bdf + ade + bce).

And yz=(ce+df)—(cf+de)yz = (ce + df) \mathbin{—} (cf + de), so

x(yz)=(ace+adf+bcf+bde)—(acf+ade+bce+bdf).x(yz) = (ace + adf + bcf + bde) \mathbin{—} (acf + ade + bce + bdf).

The two pairs have the same four terms in each entry, so they are equal.

Exercise 3.29 Euclidean division for integers

Extend Euclidean division to all integers: for every integer aa and positive integer bb there are unique integers nn and rr with a=nb+ra = nb + r and 0≤r<b0 \leq r < b. Then compute the integer part of −7/3-7/3.

Solution

For a≥0a \geq 0 this is 2A.1 The Natural Numbers. For a<0a < 0, divide −a-a: −a=mb+s-a = mb + s with 0≤s<b0 \leq s < b. If s=0s = 0 take n=−mn = -m, r=0r = 0. Otherwise a=−mb−s=(−m−1)b+(b−s)a = -mb - s = (-m - 1)b + (b - s), with 0<b−s<b0 < b - s < b. Uniqueness is as in 2A.1 The Natural Numbers. For −7/3-7/3: −7=(−3)⋅3+2-7 = (-3)\cdot 3 + 2, so the integer part is −3-3, not −2-2.

Exercise 3.30 Powers with integer exponents

Prove that xmxn=xm+nx^m x^n = x^{m + n} for every nonzero rational xx and all integers m,nm, n, using the definition x−n=(xn)−1x^{-n} = (x^n)^{-1} for natural nn. Then show that if 0<x<y0 < x < y and nn is a positive integer, then xn<ynx^n < y^n, but x−n>y−nx^{-n} > y^{-n}.

Solution

For natural exponents, the proof of 2A.1 The Natural Numbers works word for word in Q\mathbb{Q}. Two facts about reciprocals are needed: (uv)−1=u−1v−1(uv)^{-1} = u^{-1}v^{-1} (because uv⋅u−1v−1=1uv \cdot u^{-1}v^{-1} = 1) and (u−1)−1=u(u^{-1})^{-1} = u. Now split into cases, with p,qp, q natural.

  • m=−pm = -p, n=−qn = -q: x−px−q=(xp)−1(xq)−1=(xpxq)−1=(xp+q)−1=x−(p+q)x^{-p}x^{-q} = (x^p)^{-1}(x^q)^{-1} = (x^p x^q)^{-1} = (x^{p+q})^{-1} = x^{-(p+q)}.
  • m=pm = p, n=−qn = -q with p≥qp \geq q: xp=xp−qxqx^p = x^{p-q}x^q, so xpx−q=xp−q xq(xq)−1=xp−qx^p x^{-q} = x^{p-q}\,x^q (x^q)^{-1} = x^{p-q}.
  • m=pm = p, n=−qn = -q with p<qp < q: xq=xpxq−px^q = x^p x^{q-p}, so xp(xq)−1=xp(xp)−1(xq−p)−1=x−(q−p)=xp−qx^p (x^q)^{-1} = x^p (x^p)^{-1} (x^{q-p})^{-1} = x^{-(q-p)} = x^{p - q}.

For the inequalities, induct on nn: if xn<ynx^n < y^n, then xn+1=xnx<ynx<yny=yn+1x^{n+1} = x^n x < y^n x < y^n y = y^{n+1}, multiplying by the positive numbers xx and yny^n. Then x−n=1/xn>1/yn=y−nx^{-n} = 1/x^n > 1/y^n = y^{-n} by the reciprocal rule (0<u<v0 < u < v implies 1/u>1/v1/u > 1/v).

Exercise 3.31 The reverse triangle inequality

Prove that ∣∣x∣−∣y∣∣≤∣x−y∣\big||x| - |y|\big| \leq |x - y| for all rationals x,yx, y. Interpret it as a statement about distances to 00.

Solution

By the triangle inequality, ∣x∣=∣(x−y)+y∣≤∣x−y∣+∣y∣|x| = |(x - y) + y| \leq |x - y| + |y|, so ∣x∣−∣y∣≤∣x−y∣|x| - |y| \leq |x - y|. Swapping xx and yy, ∣y∣−∣x∣≤∣x−y∣|y| - |x| \leq |x - y|. Together these say ∣∣x∣−∣y∣∣≤∣x−y∣\big||x| - |y|\big| \leq |x - y|. In words: two points that are close have nearly equal distances from 00.

Exercise 3.32 Other square roots

Prove that 3\sqrt 3 is irrational, and more generally that if nn is a natural number that is not a perfect square, then n\sqrt n is irrational. Why does the descent argument fail for n=4n = 4?

Hint

For general nn, use unique factorisation: in p2=nq2p^2 = nq^2, each prime appears to an even power on the left. Or use the well-ordering principle directly: take the smallest qq with qnq\sqrt n an integer pp, and consider q′=p−⌊n⌋qq' = p - \lfloor\sqrt n\rfloor q.

Solution

For 3\sqrt 3. Suppose p2=3q2p^2 = 3q^2 with p,qp, q positive. If 33 did not divide pp, then p=3k+1p = 3k + 1 or p=3k+2p = 3k + 2, and p2=3(3k2+2k)+1p^2 = 3(3k^2 + 2k) + 1 or 3(3k2+4k+1)+13(3k^2 + 4k + 1) + 1, which leaves remainder 11, not 00. So p=3p′p = 3p', then 9p′2=3q29p'^2 = 3q^2, so q2=3p′2q^2 = 3p'^2, and in the same way q=3q′q = 3q'. Now p′/q′p'/q' is a representation with a smaller denominator, and descent gives a contradiction, exactly as for 2\sqrt 2.

For general nn, without factorisation. Suppose p2=nq2p^2 = nq^2 with p,qp, q positive, and choose qq as small as possible (well-ordering). Let k=⌊p/q⌋k = \lfloor p/q \rfloor, so kq≤p<(k+1)qkq \leq p < (k + 1)q. If kq=pkq = p then n=p2/q2=k2n = p^2/q^2 = k^2 is a perfect square, which is excluded; so 0<p−kq<q0 < p - kq < q. Put q′=p−kqq' = p - kq and p′=nq−kpp' = nq - kp. Then

p′2−nq′2=(nq−kp)2−n(p−kq)2=n2q2+k2p2−np2−nk2q2=(n−k2)(nq2−p2)=0,p'^2 - nq'^2 = (nq - kp)^2 - n(p - kq)^2 = n^2q^2 + k^2p^2 - np^2 - nk^2q^2 = (n - k^2)(nq^2 - p^2) = 0,

so p′2=nq′2p'^2 = nq'^2 with 0<q′<q0 < q' < q, contradicting the choice of qq. (Replace p′p' by ∣p′∣|p'| if it is negative.)

Why n=4n = 4 fails. Here p/q=2=kp/q = 2 = k exactly, so q′=p−kq=0q' = p - kq = 0: there is no smaller positive denominator to descend to. In the parity argument, p2=4q2p^2 = 4q^2 gives p=2p′p = 2p' and then p′2=q2p'^2 = q^2, which says nothing about qq being even.

Exercise 3.33 Rationals between rationals with small denominators

Find the rational with the smallest positive denominator lying strictly between 38\tfrac{3}{8} and 25\tfrac{2}{5}. (Look at Figure 3.3: rationals with small denominators are spread out, so the answer has a larger denominator than you might expect.)

Solution

Any rational strictly between them has denominator at least 1313. With denominator 1313, the candidates near 0.380.38–0.40.4 are 513≈0.3846\tfrac{5}{13} \approx 0.3846, which works, since 0.375<0.3846<0.40.375 < 0.3846 < 0.4. Checking denominators 11 to 1212 shows none works: for example 38=0.375\tfrac{3}{8} = 0.375 and 25=0.4\tfrac{2}{5} = 0.4 are adjacent among fractions with denominators up to 88, and the next fraction to appear between them is the mediant 3+28+5=513\tfrac{3 + 2}{8 + 5} = \tfrac{5}{13}.

Exercise 3.34 The mediant lies between

Let b,db, d be positive integers and ab<cd\frac ab < \frac cd. Prove that ab<a+cb+d<cd\frac ab < \frac{a + c}{b + d} < \frac cd. (This is how 513\tfrac{5}{13} arose in Exercise 3.33.)

Solution

ab<cd\frac ab < \frac cd with positive denominators means ad<bcad < bc (subtract and use Lemma 3.15). Then a+cb+d−ab=(a+c)b−a(b+d)(b+d)b=bc−ad(b+d)b>0\frac{a + c}{b + d} - \frac ab = \frac{(a + c)b - a(b + d)}{(b + d)b} = \frac{bc - ad}{(b + d)b} > 0, and similarly cd−a+cb+d=c(b+d)−(a+c)dd(b+d)=bc−add(b+d)>0\frac cd - \frac{a + c}{b + d} = \frac{c(b + d) - (a + c)d}{d(b + d)} = \frac{bc - ad}{d(b + d)} > 0.

Exercise 3.35 No rational least upper bound

Let E={x∈Q:x≥0 and x2<2}E = \{x \in \mathbb{Q} : x \geq 0 \text{ and } x^2 < 2\}. Show that EE is bounded above (by 22, say), that it has no largest element, and that no rational number is a least upper bound for it: for every rational upper bound uu there is a smaller rational upper bound.

Hint

If x∈Ex \in E, Proposition 3.25 doesn't directly give a larger element; instead, try x+hx + h for a small rational hh and estimate (x+h)2=x2+2xh+h2≤x2+h(2x+1)(x + h)^2 = x^2 + 2xh + h^2 \leq x^2 + h(2x + 1) for 0<h≤10 < h \leq 1. For an upper bound uu, first show u2>2u^2 > 2, then try u−hu - h.

Solution

Bounded: if x>2x > 2 then x2>4>2x^2 > 4 > 2, so every element of EE is at most 22. No largest element: let x∈Ex \in E and 0<h≤10 < h \leq 1. Then (x+h)2≤x2+h(2x+1)(x + h)^2 \leq x^2 + h(2x + 1), which is less than 22 as soon as h<(2−x2)/(2x+1)h < (2 - x^2)/(2x + 1). So x+h∈Ex + h \in E for a suitable rational hh. No least upper bound: let uu be a rational upper bound. Then u>0u > 0 (since 1∈E1 \in E), and u2≠2u^2 \neq 2 by Theorem 3.24. If u2<2u^2 < 2, then u∈Eu \in E and the previous step gives a larger element of EE, contradicting that uu is an upper bound. So u2>2u^2 > 2. Now for 0<h<u0 < h < u, (u−h)2≥u2−2uh(u - h)^2 \geq u^2 - 2uh, which is greater than 22 when h<(u2−2)/(2u)h < (u^2 - 2)/(2u). For such hh, u−hu - h is still an upper bound: if some x∈Ex \in E had x>u−h>0x > u - h > 0, then x2>(u−h)2>2x^2 > (u - h)^2 > 2, which is impossible.

Exercise 3.36 Closeness of products, in numbers

Let x=3x = 3, y=3.01y = 3.01, z=−2z = -2, w=−2.02w = -2.02. Compute ∣xz−yw∣|xz - yw| directly, and compare it with the bound ε∣z∣+δ∣x∣+εδ\varepsilon|z| + \delta|x| + \varepsilon\delta of Proposition 3.19 with ε=0.01\varepsilon = 0.01, δ=0.02\delta = 0.02.

Solution

xz=−6xz = -6 and yw=−6.0802yw = -6.0802, so ∣xz−yw∣=0.0802|xz - yw| = 0.0802. The bound is 0.01⋅2+0.02⋅3+0.01⋅0.02=0.02+0.06+0.0002=0.08020.01 \cdot 2 + 0.02 \cdot 3 + 0.01 \cdot 0.02 = 0.02 + 0.06 + 0.0002 = 0.0802. Here the bound is exact, because both errors push the product the same way: compare the proof, where the bound comes from the triangle inequality, which is an equality when all the terms have the same sign.

Exercise 3.37 Rehearsal: closeness is not transitive, but it adds up

Show that if xx is ε\varepsilon-close to yy and yy is ε\varepsilon-close to zz, then xx need not be ε\varepsilon-close to zz, but is always 2ε2\varepsilon-close to it. Compare with the "similar enough" relation in 2A.2 Sets, Functions and Equivalence. Much of analysis consists of carefully tracking how such small errors add up. In 2A.4 The Real Numbers they are made to vanish in the limit; in Ricci flow, a "ε\varepsilon-neck" (12B.3 The Structure of κ-Solutions) is a region that is ε\varepsilon-close to a model cylinder, and the proofs keep track of how the errors ε\varepsilon accumulate.

Solution

Take x=0x = 0, y=εy = \varepsilon, z=2εz = 2\varepsilon: x,yx, y are ε\varepsilon-close and y,zy, z are ε\varepsilon-close, but ∣x−z∣=2ε>ε|x - z| = 2\varepsilon > \varepsilon. In general, by the triangle inequality, ∣x−z∣≤∣x−y∣+∣y−z∣≤2ε|x - z| \leq |x - y| + |y - z| \leq 2\varepsilon (Proposition 3.19, part 1). So closeness is not transitive, but the error at most doubles at each step: after kk steps of ε\varepsilon-closeness, the ends are kεk\varepsilon-close. That is why proofs fix the number of steps first and then choose ε\varepsilon, as in the ε/2\varepsilon/2 trick of 2A.4 The Real Numbers.

Free resources for this chapter

Chosen for what this chapter covers, and all free to read or watch. Where a lecture covers more than this chapter, the minutes to watch are given, and the link starts there when it can. Links checked Nov 6, 2026.

Read

Watch 3 lectures and talks

© 2026 Neckpinch (www.neckpinch.com). All content in the guidebook (text, mathematics, figures and exercises) is protected by copyright. All rights reserved. No part may be copied, republished or redistributed without written permission.