Book 2A

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

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

The Natural Numbers

Five axioms, what each one rules out, and how induction and recursion build all of arithmetic.

87 min read · Updated Oct 20, 2026

Read with Tao, Analysis I, chapter "Starting at the beginning: the natural numbers". Tao's appendix on mathematical logic can be read alongside; this chapter teaches the logic it uses as it goes.

In this chapter · 14 sections
  1. 1.1Why build what everyone already knows
  2. 1.2The minimum logic for this chapter
  3. 1.3Zero and the next number
  4. 1.4Two axioms that keep the chain from looping
  5. 1.5Induction: the axiom that says there is nothing else
  6. 1.5.1What an induction proof looks like
  7. 1.5.2Two ways to get induction wrong
  8. 1.6Recursion: defining things one step at a time
  9. 1.6.1The recursion theorem, done properly
  10. 1.7Addition
  11. 1.8Order
  12. 1.8.1Strong induction and the well-ordering principle
  13. 1.9Multiplication
  14. 1.10Division and powers
  15. 1.11Writing induction proofs
  16. 1.11.1Where the inductive step comes from
  17. 1.11.2Inequalities
  18. 1.12Strong induction at work
  19. 1.13Before the axioms: where this came from
  20. 1.14Exercises
  21. ↗Free resources

Every course in this guidebook ends at the same place: a theorem about the shape of three-dimensional space, proved by a flow on curvature. This one starts somewhere that seems absurdly far away: with the question of what the numbers 0,1,2,3,…0, 1, 2, 3, \dots actually are.

There are two reasons to start this far back, and neither is pedantry. The first is that the most important proof technique in this guidebook, induction, is not a trick for proving formulas about sums. It is a statement about what the natural numbers are, and you can only see that once the natural numbers have been written down precisely. The second reason is practical. When you prove something, you should know exactly which facts you are using, because the day one of them fails, the proof fails with it. That sounds abstract until you meet a number system where some familiar fact is false. You have used such systems every day of your life: the integers inside every computer are one.

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

  • state the five axioms for the natural numbers, and for each one, name a real system that satisfies the other four but not that one;
  • write a proof by induction, and explain why the method is valid;
  • define a sequence by recursion, and explain why the definition makes sense;
  • prove the laws of arithmetic (commutativity, associativity, cancellation) and of order from the axioms;
  • use strong induction and the well-ordering principle, and recognise them in a termination proof;
  • find an induction proof for a statement you haven't seen before: locate the inductive step, choose the base cases, and write it up.

Why build what everyone already knows

Children learn to count before they can read, and the natural numbers feel like the one part of mathematics that needs no explanation. So it is worth seeing, concretely, what goes wrong when a system that looks like the natural numbers is missing one of their properties.

In the world Data The integer that ran out of room

A computer stores a whole number in a fixed number of binary digits. A signed 32-bit integer can hold every whole number from −231=−2,147,483,648-2^{31} = -2{,}147{,}483{,}648 up to 231−1=2,147,483,6472^{31} - 1 = 2{,}147{,}483{,}647, and no others. Ask the machine for 2,147,483,647+12{,}147{,}483{,}647 + 1 and, in the usual two's-complement arithmetic, the answer comes back as −2,147,483,648-2{,}147{,}483{,}648. Counting up, the machine has wrapped round to the most negative value.

This is not a curiosity. In December 2014 the music video for "Gangnam Style" passed 2,147,483,647 views on YouTube, and YouTube announced that it had already moved its view counter to 64-bit integers because it had never expected a video to be watched more times than a 32-bit integer can count. In 2015 the US Federal Aviation Administration issued an airworthiness directive (AD 2015-09-07) for the Boeing 787: an aircraft left powered continuously for 248 days could lose all AC electrical power, because a software counter inside the generator control units would overflow. Until new software was installed, operators had to switch the power off and on again periodically. And many computer systems still count time as a signed 32-bit number of seconds since 1 January 1970. That count runs out at 03:14:07 UTC on 19 January 2038, the "year 2038 problem".

Figure 1.1. A signed 32-bit counter is a circle, not a line. Counting up from 00 eventually reaches 231−12^{31}-1, and one more step lands on −231-2^{31}. Keep counting and you come back to 00.

In each case the machine's numbers behave exactly like the natural numbers for a very long time, and then one property silently fails. For a 32-bit counter, the property "adding one always gives a new number, never one you've seen before" fails after about two billion steps.

So here is the plan for this chapter. Write down a short list of properties of the natural numbers, so short that every other fact about them can be proved from it. Then, for each property on the list, look at a system that has all the others but not that one. That shows what each property is for. It also shows the real moral of the 32-bit counter: a proof is valid for a system only if the system satisfies every property the proof used.

Where this goes Where this goes

The technique this chapter is really about, induction, proves infinitely many statements with one argument. That is exactly what is needed later in the route. In Hamilton's theory of Ricci flow, bounds on the curvature give bounds on its first derivative, those give bounds on its second derivative, and so on, one derivative at a time. The result, Shi's derivative estimates (11A.4 Short-Time Existence and Uniqueness), is an infinite family of inequalities, one for each kk, and it is proved by induction on kk. Regularity theory for the heat equation (6A.6 Weak Solutions and Elliptic Regularity) climbs the same kind of ladder, and the proof that Ricci flow with surgery can be continued for all time (12B.13 Ricci Flow with Surgery for All Time) counts surgeries one at a time. All of it rests on the axiom you'll meet in Axiom 1.5.

The minimum logic for this chapter

This section collects the handful of logical ideas used in this chapter. Quantifiers and their negations, which matter enormously once limits appear, get a full chapter of their own later (2A.5 Quantifiers and the Shape of a Proof), placed just before the first ε–N arguments.

A statement is a sentence that is either true or false: "33 is a natural number", "every natural number is even". Sentences such as "nn is even" are not yet statements, because their truth depends on nn. We call them properties of nn and write P(n)P(n). Once you plug in a particular nn, you get a statement P(3)P(3), P(7)P(7), …, each true or false.

Implication. "If PP, then QQ", written P  ⟹  QP \implies Q, is false in exactly one situation: when PP is true and QQ is false. In every other case it is true. In particular, an implication with a false hypothesis is automatically true ("vacuously true"). That convention may feel odd, but it is the only one that makes statements like "for every natural number nn, if n>5n > 5 then n>3n > 3" true, which they obviously should be: for n=2n = 2 the hypothesis fails, and the implication must not count as false just because of that.

Contrapositive versus converse. The statement P  ⟹  QP \implies Q has the same truth value as its contrapositive, not Q  ⟹  not P\text{not } Q \implies \text{not } P, so proving one proves the other. It does not have the same truth value as its converse, Q  ⟹  PQ \implies P. "If it rained, the street is wet" is true; its converse "if the street is wet, it rained" is not (a water main may have burst); its contrapositive "if the street is dry, it didn't rain" is true.

For every. "For every natural number nn, P(n)P(n)" is true when each of the statements P(0),P(1),P(2),…P(0), P(1), P(2), \dots is true. To show it is false, it is enough to find one nn for which P(n)P(n) is false: a counterexample.

Proof by contradiction. To prove a statement SS, assume that SS is false and deduce something impossible, for instance a statement and its negation. Since a correct argument from a true assumption cannot reach an impossibility, the assumption must have been false, so SS is true. Many proofs in this chapter are short arguments by contradiction.

That is all the logic needed now.

Zero and the next number

Here is the idea we want to capture. The natural numbers are what you get by starting at 00 and repeatedly taking "the next one": 00, the next one after 00, the next one after that, and so on. Everything about them should follow from those two ingredients: a starting point, and a way to step forward.

We write n++n{+}{+} for "the next number after nn", also called the successor of nn.1 The notation n++n{+}{+} is borrowed from programming languages, where it means "increase nn by one". It is the notation in Tao's Analysis I, which this book accompanies. Many logic books write S(n)S(n) for the successor instead. It is important that n++n{+}{+} is not defined as n+1n + 1. Addition hasn't been defined yet. In fact we'll define addition using the successor, later in this chapter, and only then prove that n++=n+1n{+}{+} = n + 1.

Axiom 1.1 Zero

00 is a natural number.

Axiom 1.2 Successor

If nn is a natural number, then n++n{+}{+} is also a natural number.

These two axioms already produce infinitely many natural numbers: 00; then 0++0{+}{+}; then (0++)++(0{+}{+}){+}{+}; and so on. To talk about them conveniently, we give them names.

Definition 1.1 Numerals

We write 11 for 0++0{+}{+}, 22 for 1++1{+}{+}, 33 for 2++2{+}{+}, and so on. So 33 is shorthand for ((0++)++)++((0{+}{+}){+}{+}){+}{+}.

Figure 1.2. The picture the axioms are trying to capture: a single chain that starts at 00 and in which every number points to the next one.

With only Axiom 1.1 and Axiom 1.2 we can prove that 33 is a natural number. By Axiom 1.1, 00 is a natural number. Applying Axiom 1.2 to it, 1=0++1 = 0{+}{+} is a natural number. Applying Axiom 1.2 again, 22 is, and once more, 33 is.

That is a genuine proof, from the axioms, of something everybody knows. The point of doing it is to notice what we cannot yet prove. We can't prove that 3≠03 \neq 0, and we can't prove that the chain in Figure 1.2 never loops back on itself. Nothing in the two axioms forbids it.

In the world In use A counter that refuses to step

Some programming languages make running out of room an error rather than a wrap-around. In Ada, an arithmetic result outside the range of its type raises Constraint_Error. In Rust, integer overflow stops a program built in debug mode with a "panic". A counter of this kind is the set {0,1,2,…,N}\{0, 1, 2, \dots, N\} in which N++N{+}{+} simply does not exist.

The loss of Ariane 5 on its first flight, on 4 June 1996, came from the same phenomenon in a different place. A horizontal-velocity value in the inertial reference software was converted from a 64-bit floating-point number to a 16-bit signed integer. On the new rocket's trajectory the value was larger than any 16-bit integer, the unprotected conversion raised an operand error, and the guidance system shut down. The result had no representation in the type, and the system had no way to continue. (The inquiry board's report is a model of clear failure analysis and is worth reading.)

A checked counter of this kind violates Axiom 1.2, and nothing else on our eventual list. Axiom 1.2 is the axiom that says: there is always a next one. No finite machine can satisfy it, which is one reason mathematics needs the natural numbers as an idealisation.

Two axioms that keep the chain from looping

The 32-bit counter of Figure 1.1 satisfies both axioms so far: it has a 00, and every value has a successor. So does the clock on a wall, if we call twelve o'clock "00". What goes wrong in those systems is that counting forward eventually brings you back to a number you have already met. Two more axioms rule that out. First, the chain can't loop back to its start:

Axiom 1.3 Zero is not a successor

00 is not the successor of any natural number. That is, n++≠0n{+}{+} \neq 0 for every natural number nn.

Now we can prove that 3≠03 \neq 0: since 3=2++3 = 2{+}{+} is a successor, Axiom 1.3 says it can't equal 00. But we still can't prove 4≠14 \neq 1. Nothing stops the chain from looping back to some later point, forming a shape like the letter ρ, with 3++=13{+}{+} = 1, say. The fourth axiom rules out every such merging:

Axiom 1.4 Different numbers have different successors

If nn and mm are natural numbers and n≠mn \neq m, then n++≠m++n{+}{+} \neq m{+}{+}. Equivalently, by the contrapositive: if n++=m++n{+}{+} = m{+}{+}, then n=mn = m.

Now 4≠14 \neq 1: if 4=14 = 1 then 3++=0++3{+}{+} = 0{+}{+}, so by Axiom 1.4 3=03 = 0, contradicting what we just proved. The same argument shows that any two numerals with different names are different numbers. That is, 0,1,2,3,…0, 1, 2, 3, \dots are all distinct (see Exercise 1.31).

In the world In use Two ways to run out of room

Each of these two axioms fails in a real piece of engineering.

Wrap-around arithmetic fails Axiom 1.3. In an 8-bit unsigned counter {0,1,…,255}\{0, 1, \dots, 255\}, 255++=0255{+}{+} = 0. A mechanical car odometer showing 999,999999{,}999 rolls over to 000,000000{,}000. A clock face does the same with 11++=011{+}{+} = 0. In each, 00 is a successor.

Saturating arithmetic fails Axiom 1.4. Here a value that would overflow simply stays at the maximum, so in an 8-bit saturating counter 255++=255255{+}{+} = 255. Saturation is used deliberately where wrapping round would be a disaster. If a very bright pixel's brightness wrapped from 255255 to 00, a highlight would turn black; saturating keeps it white. Audio processing saturates rather than wrapping for the same reason, and processors have dedicated instructions for it (the x86 instruction PADDUSB, "add packed unsigned integers with unsigned saturation", is one). In a saturating counter 254++=255=255++254{+}{+} = 255 = 255{+}{+}: two different numbers with the same successor.

Figure 1.3. Four systems that are almost the natural numbers. Each satisfies every axiom in this chapter except one, which shows what that axiom is for. Axiom 1.5, the one the last panel breaks, is the subject of the next section.

With four axioms we have a chain that starts at 00, never ends, never loops back to 00, and never merges into itself. Is that enough? Not yet, and the reason is the most interesting part of the chapter.

Induction: the axiom that says there is nothing else

Here is a system that satisfies all four axioms so far, but is still not the natural numbers. Take the usual numbers 0,1,2,3,…0, 1, 2, 3, \dots, and add the half-integers 12,112,212,…\tfrac12, 1\tfrac12, 2\tfrac12, \dots, with the successor of xx defined to be x+1x + 1 in both rows (bottom-right panel of Figure 1.3). There is a 00 (Axiom 1.1). Everything has a successor (Axiom 1.2). Nothing has 00 as its successor (Axiom 1.3): the successor of a half-integer is a half-integer, and the successor of a whole number is at least 11. And different elements have different successors (Axiom 1.4).

The half-integers are intruders. They are never reached by counting from 00. We need an axiom saying that every natural number can be reached from 00 by repeatedly taking successors. But "can be reached by repeatedly taking successors" is circular as it stands, because "repeatedly" already involves counting. The way out is to say it indirectly, through properties.

Axiom 1.5 The principle of mathematical induction

Let P(n)P(n) be any property of natural numbers. Suppose that P(0)P(0) is true, and that whenever P(n)P(n) is true, P(n++)P(n{+}{+}) is also true. Then P(n)P(n) is true for every natural number nn.

To see why this axiom excludes the intruders, apply it to the property

P(x):x is a whole number (not a half-integer).P(x): \quad x \text{ is a whole number (not a half-integer).}

In the system above, P(0)P(0) is true, and the successor of a whole number is a whole number, so P(x)  ⟹  P(x++)P(x) \implies P(x{+}{+}). If the system satisfied Axiom 1.5, then every element would be a whole number. But 12\tfrac12 isn't. So the system fails Axiom 1.5.

The same argument works for any intruders. Take P(x)P(x) to be "xx is one of 0,0++,(0++)++,…0, 0{+}{+}, (0{+}{+}){+}{+}, \dots". Then P(0)P(0) holds and PP is passed from each element to its successor, so Axiom 1.5 forces every element to have the property. Induction is exactly the axiom that says: there is nothing in the system except what counting from 00 produces.

Note On "any property"

It matters what counts as a "property" in Axiom 1.5. Here, as in Tao, it means any statement about nn whatsoever. With that reading, the five axioms pin down the natural numbers completely: any two systems satisfying them are the same up to renaming their elements, a result of Dedekind (Remark 1.30). Logicians also study a weaker version in which "property" is limited to statements that can be written in a particular formal language. That version allows strange "nonstandard" systems with extra elements beyond all the ordinary numbers. The history section at the end of this chapter returns to this.

What an induction proof looks like

Axiom 1.5 turns into a method of proof. To prove that a property holds for every natural number, you do two things:

  1. Base case. Prove P(0)P(0).
  2. Inductive step. Prove that for every natural number nn, if P(n)P(n) is true then P(n++)P(n{+}{+}) is true. In this step you assume P(n)P(n) (the inductive hypothesis) and use it to prove P(n++)P(n{+}{+}).

Then Axiom 1.5 gives P(n)P(n) for every nn.

Figure 1.4. The anatomy of a proof by induction. The base case is one statement, proved directly. The inductive step is a single argument, valid for an arbitrary nn, so it proves every arrow at once.

The inductive step is a single argument that works for an arbitrary nn, not an infinite list of arguments. That is the whole power of the method: one finite argument settles infinitely many statements.

Here is a first example, a fact so basic it is easy to overlook, proved carefully.

Proposition 1.2 Every number is zero or a successor

Every natural number nn is either 00 or the successor of some natural number.

Proof. Let P(n)P(n) be the property "n=0n = 0, or n=m++n = m{+}{+} for some natural number mm".

Base case. P(0)P(0) is true, because 0=00 = 0.

Inductive step. Let nn be a natural number and suppose P(n)P(n) is true. We must show P(n++)P(n{+}{+}), that is, that n++n{+}{+} is either 00 or a successor. But n++n{+}{+} is the successor of nn, so the second option holds with m=nm = n.

By Axiom 1.5, P(n)P(n) is true for every natural number nn.

Notice that the inductive step didn't actually use the inductive hypothesis. That's unusual but perfectly legitimate. Notice too what the proposition says about the intruders of Figure 1.3: 12\tfrac12 is neither 00 nor the successor of anything in that system, so the proposition fails there. This confirms again that the intruders violate induction.

Combining Proposition 1.2 with Axiom 1.4: every nonzero natural number is the successor of exactly one natural number, called its predecessor.

Two ways to get induction wrong

Every proof by induction has two parts, and leaving out either one gives nonsense.

Omitting the base case. Consider the property "n++=nn{+}{+} = n". If it held for some nn, then applying ++++ to both sides would give (n++)++=n++(n{+}{+}){+}{+} = n{+}{+}, so it would hold for n++n{+}{+} too: the inductive step goes through. But the property is false for every nn (Exercise 1.33). The base case fails, and with it the whole proof. The saturating counter is a telling contrast: there 255++=255255{+}{+} = 255 really does hold, but only because that system breaks Axiom 1.4.

An inductive step that secretly doesn't work for every nn. The classic example is the "proof" that in any group of horses, all horses have the same colour. The base case is a single horse, which trivially has the same colour as itself. For the "inductive step", take a group of n++n{+}{+} horses, remove one horse, and by hypothesis the remaining nn have the same colour. Put it back, remove a different horse, and again the remaining nn share a colour. Since the two groups overlap, all n++n{+}{+} horses share a colour.

The overlap argument needs the two groups of nn horses to have a horse in common. When n++=2n{+}{+} = 2 the two groups are {horse A}\{\text{horse } A\} and {horse B}\{\text{horse } B\}, which have no horse in common. The step from 11 to 22 fails, and every later step depends on it. The lesson: an inductive step must be valid for every nn, including the smallest ones, and those are exactly where hidden assumptions break.

Recursion: defining things one step at a time

Induction proves statements about every natural number. Its twin, recursion, defines things for every natural number: give the value at 00, and give a rule for the value at n++n{+}{+} in terms of the value at nn.

In the world Model A loan, one month at a time

A bank lends you an amount B0B_0 at a monthly interest rate rr, and you repay PP each month. The balance after n++n{+}{+} months is determined by the balance after nn months:

Bn++=(1+r) Bn−P.B_{n{+}{+}} = (1 + r)\,B_n - P.

Every amortisation schedule ever printed is this definition, evaluated line by line. The value at 00 is given, and the rule produces the next value from the current one. The same shape describes a drug that is taken at a fixed dose and decays by a fixed fraction between doses, a population counted once per generation, and the iterates of Newton's method (2A.4 The Real Numbers).

It seems obvious that a recursive definition defines something. It is worth seeing that it needs every one of the axioms, because each failure is instructive.

Proposition 1.3 Recursive definitions

Suppose that for each natural number nn we are given a function fnf_n from the natural numbers to the natural numbers, and let cc be a natural number. Then there is exactly one way to assign a natural number ana_n to each natural number nn such that

a0=candan++=fn(an) for every natural number n.a_0 = c \qquad\text{and}\qquad a_{n{+}{+}} = f_n(a_n) \text{ for every natural number } n.

Proof. There is at most one such assignment. Suppose aa and bb both satisfy the two conditions. We show by induction that an=bna_n = b_n for every nn. The base case: a0=c=b0a_0 = c = b_0. The inductive step: if an=bna_n = b_n, then an++=fn(an)=fn(bn)=bn++a_{n{+}{+}} = f_n(a_n) = f_n(b_n) = b_{n{+}{+}}.

There is at least one. Informally, we set a0=ca_0 = c, then a1=f0(a0)a_1 = f_0(a_0), then a2=f1(a1)a_2 = f_1(a_1), and so on. What has to be checked is that this procedure never tries to give the same number two different values. Could it? The value a0a_0 is assigned only once, at the start, because by Axiom 1.3 the number 00 is never reached again as a successor. And each value ama_{m} with m≠0m \neq 0 is assigned only when we step from its predecessor, which is unique by Axiom 1.4 and Proposition 1.2. Finally, every natural number is eventually assigned a value: that is a statement about every nn, proved by induction on nn (it holds for 00, and if ana_n has been assigned, then so has an++=fn(an)a_{n{+}{+}} = f_n(a_n)).

This half of the argument is informal in one respect: "assigning values step by step" hasn't been defined. A fully formal proof builds the assignment as a set of pairs (n,an)(n, a_n), which needs the language of sets from 2A.2 Sets, Functions and Equivalence. The axioms used are exactly the ones named here.

The proof is short, but each axiom is visibly doing work, and each almost-system of Figure 1.3 shows what goes wrong without it.

  • Without Axiom 1.3 (the wrap-around counter): try to define "the total number of ticks so far" on a clock face by a0=0a_0 = 0 and an++=an+1a_{n{+}{+}} = a_n + 1. Going round once, a11=11a_{11} = 11 and then a0=a11++=12a_0 = a_{11{+}{+}} = 12. But a0a_0 was already 00. The definition contradicts itself. That is why a clock reading alone can't tell you how much time has passed, and why calendars and timestamps count something more.
  • Without Axiom 1.4 (the saturating counter): in an 8-bit saturating counter, 255++=255255{+}{+} = 255, so the same rule would require a255=a255+1a_{255} = a_{255} + 1, which is impossible.
  • Without Axiom 1.5 (the intruders): the rule defines ana_n for n=0,1,2,…n = 0, 1, 2, \dots, but says nothing at 12\tfrac12. The "sequence" is undefined at some elements.

The recursion theorem, done properly

The "at least one" half of Proposition 1.3 above was informal. This subsection gives the complete argument. It uses one idea from the next chapter, a set of pairs (n,x)(n, x) of natural numbers, and you can skip it on a first reading and come back after 2A.2 Sets, Functions and Equivalence. It is worth reading at some point, because it shows exactly where each axiom is used, and because "take the smallest set closed under some rules" is a construction you will meet again.

Call a set RR of pairs of natural numbers closed if it satisfies two rules:

  1. the pair (0,c)(0, c) is in RR;
  2. whenever (n,x)(n, x) is in RR, the pair (n++,fn(x))(n{+}{+}, f_n(x)) is in RR too.

The set of all pairs is closed, so closed sets exist. Let RR be the intersection of all closed sets: the pairs that belong to every closed set. Then RR is itself closed (each rule holds in every closed set, so it holds in their common part), and RR is contained in every closed set. It is the smallest closed set. Think of RR as "the pairs that the two rules force on you, and nothing more".

The aim is to show that for every nn there is exactly one xx with (n,x)∈R(n, x) \in R. Then we can define ana_n to be that xx.

The case n=0n = 0. By rule 1, (0,c)∈R(0, c) \in R. Suppose (0,y)∈R(0, y) \in R for some y≠cy \neq c, and let R′R' be RR with the pair (0,y)(0, y) removed. Then R′R' still contains (0,c)(0, c). And R′R' obeys rule 2: if (n,x)∈R′(n, x) \in R', then (n++,fn(x))∈R(n{+}{+}, f_n(x)) \in R, and this pair is not (0,y)(0, y) because n++≠0n{+}{+} \neq 0 (Axiom 1.3). So R′R' is closed and strictly smaller than RR, which is impossible. Hence cc is the only partner of 00.

From nn to n++n{+}{+}. Suppose xnx_n is the only number with (n,xn)∈R(n, x_n) \in R. By rule 2, (n++,fn(xn))∈R(n{+}{+}, f_n(x_n)) \in R, so n++n{+}{+} has at least one partner. Suppose it also had a partner y≠fn(xn)y \neq f_n(x_n), and remove the pair (n++,y)(n{+}{+}, y) to get R′R'. Rule 1 still holds in R′R', because (0,c)≠(n++,y)(0, c) \neq (n{+}{+}, y) (Axiom 1.3 again). For rule 2, take any (m,x)∈R′(m, x) \in R'. The pair (m++,fm(x))(m{+}{+}, f_m(x)) is in RR, and it could only have been removed if m++=n++m{+}{+} = n{+}{+} and fm(x)=yf_m(x) = y. But m++=n++m{+}{+} = n{+}{+} forces m=nm = n (Axiom 1.4), then x=xnx = x_n (the only partner of nn), and then fm(x)=fn(xn)≠yf_m(x) = f_n(x_n) \neq y. So nothing needed was removed, R′R' is closed and smaller than RR, which is impossible.

By Axiom 1.5, every nn has exactly one partner ana_n. Now a0=ca_0 = c, and since (n,an)∈R(n, a_n) \in R, rule 2 puts (n++,fn(an))(n{+}{+}, f_n(a_n)) in RR, so an++=fn(an)a_{n{+}{+}} = f_n(a_n). That is the recursion, and the proof is complete.

Read the proof again with Figure 1.3 in mind. The step "n++≠0n{+}{+} \neq 0" is Axiom 1.3, which the wrap-around counter breaks. The step "m++=n++m{+}{+} = n{+}{+} forces m=nm = n" is Axiom 1.4, which the saturating counter breaks. And the conclusion "for every nn" is Axiom 1.5, which the intruders break.

In the world In use Loop invariants, and the bug in binary search

Programmers prove loops correct with induction. To show that a loop does what it should, one states an invariant, a property of the program's variables, and shows that it holds before the first iteration (the base case) and that each iteration preserves it (the inductive step). Then it holds after any number of iterations.

Binary search finds a value in a sorted array by repeatedly halving a range [low, high], keeping the invariant "if the value is in the array at all, it is in this range". The invariant argument is correct. Yet in 2006 Joshua Bloch reported that the standard binary search in the Java library, and in many textbooks, contained a bug that had gone unnoticed for about nine years. The midpoint was computed as (low + high) / 2, and for arrays of more than about a billion elements the sum low + high exceeds 231−12^{31} - 1 and wraps round to a negative number, exactly as in Figure 1.1. The proof's logic was fine. Its arithmetic assumed that int behaves like the natural numbers, and that assumption was false. The fix was low + (high - low) / 2, which never exceeds high.

Addition

Now we can define addition. The definition is a recursion in the first argument: adding 00 does nothing, and adding the successor of nn means adding nn and then taking one more step.

Definition 1.4 Addition

Let mm be a natural number. Define 0+m:=m0 + m := m, and, for every natural number nn, define (n++)+m:=(n+m)++(n{+}{+}) + m := (n + m){+}{+}.

For each fixed mm, this is a recursive definition of the sequence an=n+ma_n = n + m, with a0=ma_0 = m and an++=(an)++a_{n{+}{+}} = (a_n){+}{+}, so Proposition 1.3 guarantees it defines n+mn + m for every nn. Concretely, n+mn + m is what you reach from mm after taking nn successor steps.

Figure 1.5. By Definition 1.4, n+mn + m means "start at mm and step forward nn times". So 3+23 + 2 unwinds to three successors applied to 22.

Everything you know about addition must now be proved. That is less tedious than it sounds, and it is the best possible practice in writing induction proofs, because the statements are so simple that all the attention goes to the structure of the argument. The definition treats the two arguments differently (0+m=m0 + m = m is a definition, but m+0=mm + 0 = m is not), so even that needs a proof.

Lemma 1.5 Adding zero on the right

For every natural number nn, n+0=nn + 0 = n.

Proof. Induction on nn. Base case: 0+0=00 + 0 = 0 by Definition 1.4 (with m=0m = 0). Inductive step: suppose n+0=nn + 0 = n. Then (n++)+0=(n+0)++=n++(n{+}{+}) + 0 = (n + 0){+}{+} = n{+}{+}, using the definition and then the hypothesis.

Lemma 1.6 Adding a successor on the right

For all natural numbers nn and mm, n+(m++)=(n+m)++n + (m{+}{+}) = (n + m){+}{+}.

Proof. Fix mm, and induct on nn. Base case: 0+(m++)=m++0 + (m{+}{+}) = m{+}{+} and (0+m)++=m++(0 + m){+}{+} = m{+}{+}, both by the definition, so they are equal. Inductive step: suppose n+(m++)=(n+m)++n + (m{+}{+}) = (n + m){+}{+}. Then

(n++)+(m++)=(n+(m++))++=((n+m)++)++=((n++)+m)++,(n{+}{+}) + (m{+}{+}) = \big(n + (m{+}{+})\big){+}{+} = \big((n + m){+}{+}\big){+}{+} = \big((n{+}{+}) + m\big){+}{+},

using the definition, then the hypothesis, then the definition again (read backwards).

As a first payoff: taking m=0m = 0 in Lemma 1.6 and using Lemma 1.5, n+1=n+(0++)=(n+0)++=n++n + 1 = n + (0{+}{+}) = (n + 0){+}{+} = n{+}{+}. The successor of nn is n+1n + 1, now as a theorem rather than an assumption.

Proposition 1.7 Addition is commutative

For all natural numbers nn and mm, n+m=m+nn + m = m + n.

Proof. Fix mm, and induct on nn. Base case: 0+m=m0 + m = m by definition, and m+0=mm + 0 = m by Lemma 1.5, so 0+m=m+00 + m = m + 0. Inductive step: suppose n+m=m+nn + m = m + n. We need (n++)+m=m+(n++)(n{+}{+}) + m = m + (n{+}{+}). The left side is (n+m)++(n + m){+}{+} by definition. The right side is (m+n)++(m + n){+}{+} by Lemma 1.6. These are equal by the hypothesis.

Proposition 1.8 Addition is associative

For all natural numbers a,b,ca, b, c, (a+b)+c=a+(b+c)(a + b) + c = a + (b + c).

The proof is Exercise 1.34: induct on aa, keeping bb and cc fixed. Once addition is commutative and associative, brackets and order in a sum can be dropped, and we will do so from now on.

The next fact is where Axiom 1.4 enters arithmetic.

Proposition 1.9 Cancellation

For all natural numbers a,b,ca, b, c: if a+b=a+ca + b = a + c, then b=cb = c.

Proof. Induction on aa. Base case: if 0+b=0+c0 + b = 0 + c then b=cb = c by the definition of addition. Inductive step: suppose the statement holds for aa, and suppose (a++)+b=(a++)+c(a{+}{+}) + b = (a{+}{+}) + c. By the definition, this says (a+b)++=(a+c)++(a + b){+}{+} = (a + c){+}{+}. By Axiom 1.4, a+b=a+ca + b = a + c, and by the inductive hypothesis, b=cb = c.

In the saturating counter, cancellation fails: 1+255=255=0+2551 + 255 = 255 = 0 + 255 there, yet 1≠01 \neq 0. A saturated sensor reading tells you that the true value was at least the maximum, but not what it was. That is a real problem in measurement, and it is exactly the failure of Proposition 1.9.

Definition 1.10 Positive

A natural number nn is positive if n≠0n \neq 0.

Proposition 1.11 Sums of naturals

If aa is positive and bb is any natural number, then a+ba + b is positive. Consequently, if a+b=0a + b = 0, then a=0a = 0 and b=0b = 0.

Proof. Since a≠0a \neq 0, by Proposition 1.2 a=n++a = n{+}{+} for some nn. Then a+b=(n+b)++a + b = (n + b){+}{+}, which is a successor and therefore not 00, by Axiom 1.3. For the second claim: if aa were positive then a+ba + b would be positive, not 00; so a=0a = 0, and then b=0+b=a+b=0b = 0 + b = a + b = 0.

Order

Order can be defined in terms of addition: nn is at least mm when you can get from mm to nn by adding something.

Definition 1.12 Order

For natural numbers nn and mm, write n≥mn \geq m (or m≤nm \leq n) if n=m+an = m + a for some natural number aa. Write n>mn > m (or m<nm < n) if n≥mn \geq m and n≠mn \neq m.

So 5≥35 \geq 3 because 5=3+25 = 3 + 2. The basic properties all follow from the facts already proved:

Proposition 1.13 Properties of order

For all natural numbers a,b,ca, b, c:

  1. (Reflexivity) a≥aa \geq a.
  2. (Transitivity) If a≥ba \geq b and b≥cb \geq c, then a≥ca \geq c.
  3. (Antisymmetry) If a≥ba \geq b and b≥ab \geq a, then a=ba = b.
  4. (Addition preserves order) a≥ba \geq b if and only if a+c≥b+ca + c \geq b + c.
  5. a<ba < b if and only if a++≤ba{+}{+} \leq b.
  6. a<ba < b if and only if b=a+db = a + d for some positive dd.

Proof. (1): a=a+0a = a + 0. (2): if a=b+xa = b + x and b=c+yb = c + y, then a=c+(y+x)a = c + (y + x), by associativity. (3): if a=b+xa = b + x and b=a+yb = a + y, then a=a+(y+x)a = a + (y + x), so a+0=a+(y+x)a + 0 = a + (y + x) and by Proposition 1.9 y+x=0y + x = 0. By Proposition 1.11 x=y=0x = y = 0, so a=ba = b. (4): a=b+xa = b + x if and only if a+c=(b+c)+xa + c = (b + c) + x; the "if" direction uses Proposition 1.9. (6): if b=a+db = a + d with dd positive, then b≥ab \geq a; and b≠ab \neq a, since a+d=a+0a + d = a + 0 would give d=0d = 0 by cancellation. Conversely if a<ba < b then b=a+db = a + d for some dd, and d≠0d \neq 0 since b≠ab \neq a. (5): by (6), a<ba < b means b=a+db = a + d with dd positive. Writing d=e++d = e{+}{+} (by Proposition 1.2), b=a+(e++)=(a++)+eb = a + (e{+}{+}) = (a{+}{+}) + e, which says b≥a++b \geq a{+}{+}. The converse reverses these steps.

The most important property of order is that any two numbers can be compared. Its proof is a good model of an induction in which the inductive step splits into cases.

Proposition 1.14 Trichotomy

For any natural numbers aa and bb, exactly one of the following is true: a<ba < b, a=ba = b, or a>ba > b.

Proof. At most one holds. If a<ba < b then a≠ba \neq b by definition, and similarly for a>ba > b. If both a<ba < b and a>ba > b, then a≤ba \leq b and a≥ba \geq b, so a=ba = b by antisymmetry, a contradiction.

At least one holds. Fix bb and induct on aa. Base case: 0≤b0 \leq b, because b=0+bb = 0 + b. So either 0=b0 = b or 0<b0 < b. Inductive step: suppose one of a<ba < b, a=ba = b, a>ba > b holds; we show one holds for a++a{+}{+}.

  • If a>ba > b, then a++>ba{+}{+} > b, since a++=a+1≥aa{+}{+} = a + 1 \geq a, transitivity gives a++≥ba{+}{+} \geq b, and a++=ba{+}{+} = b would give a<ba < b, which is impossible.
  • If a=ba = b, then a++>ba{+}{+} > b, by part (6) of Proposition 1.13 with d=1d = 1.
  • If a<ba < b, then a++≤ba{+}{+} \leq b by part (5) of Proposition 1.13, so either a++=ba{+}{+} = b or a++<ba{+}{+} < b.

In every case one of the three relations holds for a++a{+}{+}.

Strong induction and the well-ordering principle

Sometimes the inductive step needs more than the immediately preceding case. To prove something about nn you may want to know it for all smaller numbers. Factorising a number into primes is a typical example: nn factors as a×ba \times b with a,ba, b smaller than nn, and you want to know the result for both aa and bb, not just for n−1n - 1.

Proposition 1.15 Strong induction

Let m0m_0 be a natural number and P(m)P(m) a property. Suppose that for every m≥m0m \geq m_0: if P(m′)P(m') is true for every m′m' with m0≤m′<mm_0 \leq m' < m, then P(m)P(m) is true. Then P(m)P(m) is true for every m≥m0m \geq m_0.

Proof. Ordinary induction, applied to a stronger property. Let Q(n)Q(n) be "P(m)P(m) is true for every mm with m0≤m<nm_0 \leq m < n". We prove Q(n)Q(n) for every nn by induction on nn.

Base case. Q(0)Q(0) is vacuously true, since there is no mm with m<0m < 0.

Inductive step. Suppose Q(n)Q(n). We must show P(m)P(m) for every mm with m0≤m<n++m_0 \leq m < n{+}{+}. By part (5) of Proposition 1.13 and trichotomy, m<n++m < n{+}{+} means m≤nm \leq n, so either m<nm < n (and P(m)P(m) holds by Q(n)Q(n)), or m=nm = n. In the second case, if n≥m0n \geq m_0 then Q(n)Q(n) says that P(m′)P(m') holds for every m′m' with m0≤m′<nm_0 \leq m' < n, and so the hypothesis of the proposition gives P(n)P(n).

So Q(n)Q(n) holds for every nn. Given any m≥m0m \geq m_0, apply Q(m++)Q(m{+}{+}) to get P(m)P(m).

The trick in this proof deserves a name, because you will use it many times: to prove PP by induction, prove a stronger statement QQ by induction instead. Here P(n)P(n) on its own gave too weak an inductive hypothesis, so we carried along "PP holds for everything below nn", which is more to prove but also more to assume.

Ordinary induction can also start at a number other than 00. Many statements are false for small nn and true from some point on, and this is the form you use for them.

Corollary 1.16 Induction from a starting point

Let m0m_0 be a natural number and P(m)P(m) a property. Suppose P(m0)P(m_0) is true, and that for every n≥m0n \geq m_0, if P(n)P(n) is true then P(n++)P(n{+}{+}) is true. Then P(m)P(m) is true for every m≥m0m \geq m_0.

Proof. We check the hypothesis of Proposition 1.15. Let m≥m0m \geq m_0, and suppose P(m′)P(m') holds for every m′m' with m0≤m′<mm_0 \leq m' < m. If m=m0m = m_0, then P(m)P(m) is given. Otherwise m>m0m > m_0, so m0++≤mm_0{+}{+} \leq m by part (5) of Proposition 1.13. In particular m≠0m \neq 0, so m=k++m = k{+}{+} for some kk (Proposition 1.2), and m0++≤k++m_0{+}{+} \leq k{+}{+} gives m0≤km_0 \leq k by part (4) of Proposition 1.13 (cancel the 11). Since also k<mk < m, the assumption gives P(k)P(k), and then the hypothesis of the corollary gives P(k++)=P(m)P(k{+}{+}) = P(m). By Proposition 1.15, P(m)P(m) holds for every m≥m0m \geq m_0.

Strong induction has an equivalent form that is often more convenient. It speaks about sets rather than properties.

Theorem 1.17 The well-ordering principle

Every nonempty set of natural numbers has a least element: an element mm of the set with m≤xm \leq x for every xx in the set.

Proof. By contradiction. Suppose SS is a set of natural numbers with no least element. We show that SS is empty. Let P(m)P(m) be "mm is not in SS". We verify the hypothesis of strong induction (with m0=0m_0 = 0). Suppose P(m′)P(m') holds for every m′<mm' < m, that is, no number smaller than mm lies in SS. If mm were in SS, then by trichotomy m≤xm \leq x for every xx in SS, so mm would be a least element of SS, which doesn't exist. So mm is not in SS, which is P(m)P(m). By strong induction, no natural number is in SS.

The well-ordering principle has a vivid contrapositive form: there is no infinite strictly decreasing sequence of natural numbers. (Its values would form a nonempty set with no least element.) Fermat used this as a method of proof, calling it infinite descent: to show that no example of something exists, show that from any example you could build a strictly smaller one. You will use it in 2A.3 Integers and Rationals to prove that 2\sqrt 2 is irrational.

In the world In use Why an algorithm stops

How do you know a program terminates? A standard method in program verification is to find a variant (also called a ranking function): a natural number, computed from the program's state, that strictly decreases on every pass through a loop. By the well-ordering principle, it can't decrease forever, so the loop runs only finitely many times. Tools that prove programs correct look for exactly such functions.

Euclid's algorithm for the greatest common divisor is the oldest example, from Book VII of the Elements. To find gcd⁡(1071,462)\gcd(1071, 462), divide and keep the remainder: 1071=2⋅462+1471071 = 2 \cdot 462 + 147, then 462=3⋅147+21462 = 3 \cdot 147 + 21, then 147=7⋅21+0147 = 7 \cdot 21 + 0. The remainders 147,21,0147, 21, 0 strictly decrease, so the algorithm must stop, and the last nonzero remainder, 2121, is the greatest common divisor.

Figure 1.6. Euclid's algorithm on 10711071 and 462462. The remainders form a strictly decreasing sequence of natural numbers, which can't go on forever. The last nonzero remainder, 2121, is the greatest common divisor.

Multiplication

Multiplication is repeated addition, defined by recursion just as addition was repeated succession.

Definition 1.18 Multiplication

Let mm be a natural number. Define 0×m:=00 \times m := 0, and (n++)×m:=(n×m)+m(n{+}{+}) \times m := (n \times m) + m.

So n×mn \times m is "mm added to itself nn times": 3×m=((0+m)+m)+m3 \times m = ((0 + m) + m) + m. As with addition, the definition treats the two arguments differently. It says what happens when the left argument is 00 or a successor, and nothing directly about the right argument. So the first job is two lemmas about the right argument, exactly parallel to Lemma 1.5 and Lemma 1.6.

Lemma 1.19 Multiplying by zero on the right

For every natural number nn, n×0=0n \times 0 = 0.

Proof. Induction on nn. Base case: 0×0=00 \times 0 = 0 by Definition 1.18. Inductive step: if n×0=0n \times 0 = 0, then (n++)×0=(n×0)+0=0+0=0(n{+}{+}) \times 0 = (n \times 0) + 0 = 0 + 0 = 0.

Lemma 1.20 Multiplying by a successor on the right

For all natural numbers nn and mm, n×(m++)=(n×m)+nn \times (m{+}{+}) = (n \times m) + n.

Proof. Fix mm and induct on nn. Base case: 0×(m++)=00 \times (m{+}{+}) = 0, and (0×m)+0=0+0=0(0 \times m) + 0 = 0 + 0 = 0. Inductive step: suppose n×(m++)=(n×m)+nn \times (m{+}{+}) = (n \times m) + n. Then

(n++)×(m++)=n×(m++)+(m++)=(n×m)+n+(m++),(n{+}{+}) \times (m{+}{+}) = n \times (m{+}{+}) + (m{+}{+}) = (n \times m) + n + (m{+}{+}),

by the definition and then the hypothesis. On the other side,

((n++)×m)+(n++)=(n×m)+m+(n++).\big((n{+}{+}) \times m\big) + (n{+}{+}) = (n \times m) + m + (n{+}{+}).

Both are (n×m)+n+m(n \times m) + n + m followed by one more successor (by Lemma 1.6, x+(y++)=(x+y)++x + (y{+}{+}) = (x + y){+}{+}), so they are equal.

All the familiar laws now follow by induction, each proof shaped like the corresponding one for addition. Here they are together; the proofs follow.

Proposition 1.21 Laws of multiplication

For all natural numbers a,b,ca, b, c:

  1. a×b=b×aa \times b = b \times a (commutativity);
  2. a×(b+c)=a×b+a×ca \times (b + c) = a \times b + a \times c (distributivity);
  3. (a×b)×c=a×(b×c)(a \times b) \times c = a \times (b \times c) (associativity);
  4. a×b=0a \times b = 0 if and only if a=0a = 0 or b=0b = 0 (no zero divisors);
  5. if a<ba < b and cc is positive, then a×c<b×ca \times c < b \times c;
  6. if a×c=b×ca \times c = b \times c and cc is positive, then a=ba = b (cancellation).

The order of the proofs matters, because each one uses the ones before it: commutativity first, then distributivity, then associativity, then parts (4)–(6).

Proof (Commutativity). Fix mm and induct on nn. Base case: 0×m=00 \times m = 0 by definition, and m×0=0m \times 0 = 0 by Lemma 1.19. Inductive step: suppose n×m=m×nn \times m = m \times n. Then (n++)×m=(n×m)+m(n{+}{+}) \times m = (n \times m) + m by definition, and m×(n++)=(m×n)+mm \times (n{+}{+}) = (m \times n) + m by Lemma 1.20. These are equal by the hypothesis.

Proof (Distributivity). By commutativity it suffices to prove (b+c)×a=b×a+c×a(b + c) \times a = b \times a + c \times a. Fix aa and cc, and induct on bb. Base case: (0+c)×a=c×a=0+c×a=0×a+c×a(0 + c) \times a = c \times a = 0 + c \times a = 0 \times a + c \times a. Inductive step: suppose (b+c)×a=b×a+c×a(b + c) \times a = b \times a + c \times a. Then, using (b++)+c=(b+c)++(b{+}{+}) + c = (b + c){+}{+},

((b++)+c)×a=((b+c)++)×a=(b+c)×a+a=b×a+c×a+a,\big((b{+}{+}) + c\big) \times a = \big((b + c){+}{+}\big) \times a = (b + c)\times a + a = b \times a + c \times a + a,

while (b++)×a+c×a=b×a+a+c×a(b{+}{+}) \times a + c \times a = b \times a + a + c \times a. The two agree, by commutativity and associativity of addition.

Proof (Associativity). Fix bb and cc and induct on aa. Base case: (0×b)×c=0×c=0(0 \times b) \times c = 0 \times c = 0, and 0×(b×c)=00 \times (b \times c) = 0. Inductive step: suppose (a×b)×c=a×(b×c)(a \times b) \times c = a \times (b \times c). Then

((a++)×b)×c=((a×b)+b)×c=(a×b)×c+b×c=a×(b×c)+b×c=(a++)×(b×c),\big((a{+}{+}) \times b\big) \times c = \big((a \times b) + b\big) \times c = (a \times b) \times c + b \times c = a \times (b \times c) + b \times c = (a{+}{+}) \times (b \times c),

using the definition, distributivity (with the sum on the left, which is the form we proved), the hypothesis, and the definition read backwards.

Proof (Parts 4 to 6). (4) If a=0a = 0 or b=0b = 0, then a×b=0a \times b = 0 by the definition or by Lemma 1.19. Conversely, suppose both are positive. Write a=x++a = x{+}{+}. Then a×b=(x×b)+ba \times b = (x \times b) + b, which is positive by Proposition 1.11 since bb is positive (and addition is commutative). So a product of two positive numbers is positive, and a zero product needs a zero factor.

(5) If a<ba < b, then b=a+db = a + d with dd positive (part (6) of Proposition 1.13). By distributivity b×c=a×c+d×cb \times c = a \times c + d \times c, and d×cd \times c is positive by part (4). So a×c<b×ca \times c < b \times c, by part (6) of Proposition 1.13 again.

(6) Suppose a×c=b×ca \times c = b \times c with cc positive. By trichotomy (Proposition 1.14), a<ba < b, a=ba = b or a>ba > b. If a<ba < b, part (5) gives a×c<b×ca \times c < b \times c, which contradicts the equality; a>ba > b is ruled out the same way. So a=ba = b.

Proof (6) is a pattern worth noticing: to prove an equality between two things that can be compared, rule out both strict inequalities. Trichotomy then leaves only equality. You will see this pattern constantly in analysis, usually in the form "x≤yx \leq y and y≤xy \leq x, so x=yx = y".

Division and powers

Part (6) of Proposition 1.21 is what allows dividing both sides of an equation by a positive number. It doesn't yet give division as an operation, because 77 divided by 22 is not a natural number. What the natural numbers do have is division with remainder.

Theorem 1.22 Euclidean division

Let nn be a natural number and qq a positive natural number. Then there are natural numbers mm and rr with 0≤r<q0 \leq r < q and n=m×q+rn = m \times q + r.

Proof. Fix qq and induct on nn. Base case: 0=0×q+00 = 0 \times q + 0, with r=0<qr = 0 < q. Inductive step: suppose n=m×q+rn = m \times q + r with 0≤r<q0 \leq r < q. Then n++=m×q+(r++)n{+}{+} = m \times q + (r{+}{+}). By part (5) of Proposition 1.13, r<qr < q gives r++≤qr{+}{+} \leq q. If r++<qr{+}{+} < q, the pair (m,r++)(m, r{+}{+}) works for n++n{+}{+}. If r++=qr{+}{+} = q, then n++=m×q+q=(m++)×q+0n{+}{+} = m \times q + q = (m{+}{+}) \times q + 0, and the pair (m++,0)(m{+}{+}, 0) works.

The numbers mm and rr are in fact unique (Exercise 1.35); they are the quotient and the remainder.

Example 1.23 The 248 days, by division

Euclidean division is how a count of small units becomes a readable time: seconds become minutes and hours by repeated division with remainder. The FAA directive for the Boeing 787 gives 248 days, without describing the counter. A widely discussed explanation is that the units counted hundredths of a second in a signed 32-bit integer, which can hold at most 231−12^{31} - 1. That is an inference, not something the directive states, but its arithmetic is easy to check. The count overflows on reaching 231=2,147,483,6482^{31} = 2{,}147{,}483{,}648 hundredths of a second, which is 21,474,836.4821{,}474{,}836.48 seconds. Dividing by the 86,40086{,}400 seconds in a day, 21,474,836=248×86,400+47,63621{,}474{,}836 = 248 \times 86{,}400 + 47{,}636. Dividing the remainder by 36003600 seconds per hour, 47,636=13×3600+83647{,}636 = 13 \times 3600 + 836, and 836=13×60+56836 = 13 \times 60 + 56. So the overflow comes after 248 days, 13 hours, 13 minutes and about 56 seconds of continuous counting, consistent with the 248 days in the directive.

Exponentiation is defined by one more recursion.

Definition 1.24 Powers

Let mm be a natural number. Define m0:=1m^0 := 1 and mn++:=mn×mm^{n{+}{+}} := m^n \times m.

So 23=22×2=(21×2)×2=((1×2)×2)×2=82^3 = 2^2 \times 2 = (2^1 \times 2) \times 2 = ((1 \times 2) \times 2) \times 2 = 8. The usual laws ma+b=ma×mbm^{a + b} = m^a \times m^b and (ma)b=ma×b(m^a)^b = m^{a \times b} are proved by induction on bb (Exercise 1.36). The pattern is now clear: successor builds addition, addition builds multiplication, multiplication builds powers, each by a single recursion, and every law about them is a theorem proved by induction.

From here on we use ordinary arithmetic notation freely: n+1n + 1 for n++n{+}{+}, 2n2n for 2×n2 \times n, and so on. Everything in that notation has now been built from the axioms.

Writing induction proofs

The proofs so far have been about the axioms themselves. This section and the next are about induction as a tool, which is how you will use it from now on. Understanding why induction is valid is one skill; finding an induction proof for a statement you have never seen is another, and it is learned by watching it done slowly. Each example below shows the scratch work first, and then the finished proof.

Where the inductive step comes from

The base case is usually a direct check. The inductive step is where the thinking happens, and there is one question that finds it almost every time:

Write down P(n+1)P(n + 1). Where is P(n)P(n) hiding inside it?

You are allowed to assume P(n)P(n). So the task is to rearrange P(n+1)P(n + 1) until a piece of it is exactly the thing P(n)P(n) tells you about, replace that piece, and see whether what is left is true.

Example 1.25 The sum of the first n numbers

Let Sn=0+1+2+⋯+nS_n = 0 + 1 + 2 + \cdots + n. To be precise, define it by recursion: S0=0S_0 = 0 and Sn+1=Sn+(n+1)S_{n+1} = S_n + (n + 1). We prove that

2Sn=n(n+1)for every natural number n.2 S_n = n(n + 1) \quad \text{for every natural number } n.

(We prove the doubled form because we have no division yet.)

Scratch work. P(n)P(n) is "2Sn=n(n+1)2S_n = n(n+1)". Write down P(n+1)P(n+1): it says 2Sn+1=(n+1)(n+2)2 S_{n+1} = (n + 1)(n + 2). Where is P(n)P(n) inside the left side? By the definition, Sn+1=Sn+(n+1)S_{n+1} = S_n + (n + 1), so 2Sn+1=2Sn+2(n+1)2 S_{n+1} = 2 S_n + 2(n + 1). The piece 2Sn2 S_n is exactly what P(n)P(n) describes, so replace it by n(n+1)n(n+1):

2Sn+1=n(n+1)+2(n+1)=(n+2)(n+1).2 S_{n+1} = n(n + 1) + 2(n + 1) = (n + 2)(n + 1).

That is the right side of P(n+1)P(n+1). The step works.

The proof. Base case: 2S0=0=0×12 S_0 = 0 = 0 \times 1. Inductive step: let nn be a natural number with 2Sn=n(n+1)2 S_n = n(n+1). Then 2Sn+1=2Sn+2(n+1)=n(n+1)+2(n+1)=(n+1)(n+2)2 S_{n+1} = 2 S_n + 2(n+1) = n(n+1) + 2(n+1) = (n+1)(n+2), by the definition of Sn+1S_{n+1}, the inductive hypothesis, and distributivity. By induction, 2Sn=n(n+1)2 S_n = n(n+1) for every nn.

Check a case to make sure the formula is right: S4=0+1+2+3+4=10S_4 = 0 + 1 + 2 + 3 + 4 = 10, and 4×5=20=2×104 \times 5 = 20 = 2 \times 10.

The finished proof is much shorter than the scratch work, and that is normal. The scratch work is how you found it; the proof is what you write down. When you read a proof in a book and can't see where it came from, it usually helps to reconstruct the scratch work yourself.

Note A template for writing up an induction proof
  1. Say what you are inducting on, and state the property P(n)P(n) in words or symbols. If there are other variables, say which are fixed.
  2. Base case. Check P(0)P(0) (or P(m0)P(m_0)), showing the computation.
  3. Inductive step. Begin "Let nn be a natural number (with n≥m0n \geq m_0) and suppose P(n)P(n)." Then prove P(n+1)P(n+1), and point out the exact line where the hypothesis is used.
  4. Conclude: "By induction, P(n)P(n) holds for every nn (with n≥m0n \geq m_0)."

If you can't point to the line where the hypothesis is used, either you didn't need induction, as in Proposition 1.2, or the proof has a gap.

Inequalities

Induction proofs of inequalities need one more skill: in the inductive step you usually can't make P(n+1)P(n+1) appear exactly, so you aim to show that what you have is at least what you need. Two small facts about order are used constantly, and both are in Proposition 1.13 and Proposition 1.21: you may add the same number to both sides of an inequality, and you may multiply both sides by the same positive number.

Example 1.26 Powers of two grow at least linearly

Claim: 2n≥n+12^n \geq n + 1 for every natural number nn.

Scratch work. P(n+1)P(n+1) says 2n+1≥n+22^{n+1} \geq n + 2. The left side is 2n×22^n \times 2, and P(n)P(n) is about 2n2^n. Using 2n≥n+12^n \geq n + 1 and multiplying by 22: 2n+1≥2(n+1)=2n+22^{n+1} \geq 2(n + 1) = 2n + 2. Is 2n+2≥n+22n + 2 \geq n + 2? Yes, since 2n+2=(n+2)+n2n + 2 = (n + 2) + n.

The proof. Base case: 20=1≥0+12^0 = 1 \geq 0 + 1. Inductive step: suppose 2n≥n+12^n \geq n + 1. Then 2n+1=2×2n≥2(n+1)=(n+2)+n≥n+22^{n+1} = 2 \times 2^n \geq 2(n+1) = (n + 2) + n \geq n + 2. By induction, 2n≥n+12^n \geq n + 1 for every nn.

The next example shows why the base case is not a formality, and why induction can start somewhere other than 00.

Example 1.27 Exponential beats quadratic, eventually

Is 2n>n22^n > n^2? A table of small cases:

nn 0 1 2 3 4 5 6
2n2^n 1 2 4 8 16 32 64
n2n^2 0 1 4 9 16 25 36

It holds for n=0,1n = 0, 1, fails for n=2,3,4n = 2, 3, 4, and holds from n=5n = 5 on, as far as the table goes. We prove that it holds for every n≥5n \geq 5.

Scratch work. Suppose 2n>n22^n > n^2. Then 2n+1=2×2n>2n22^{n+1} = 2 \times 2^n > 2n^2. We need 2n+1>(n+1)2=n2+2n+12^{n+1} > (n+1)^2 = n^2 + 2n + 1, so it is enough that 2n2≥n2+2n+12n^2 \geq n^2 + 2n + 1, that is, n2≥2n+1n^2 \geq 2n + 1. When is that true? For n≥3n \geq 3: n2=n×n≥3n=2n+n≥2n+3>2n+1n^2 = n \times n \geq 3n = 2n + n \geq 2n + 3 > 2n + 1. So the inductive step works for every n≥3n \geq 3.

Notice what this means. The step from 33 to 44 is perfectly valid: if 23>92^3 > 9 were true, then 24>162^4 > 16 would follow. But 23>92^3 > 9 is false, so the step proves nothing there. A valid step needs a true statement to start from, and the first true one with a valid step after it is n=5n = 5.

The proof. Base case: 25=32>25=522^5 = 32 > 25 = 5^2. Inductive step: let n≥5n \geq 5 and suppose 2n>n22^n > n^2. Since n≥3n \geq 3, n2≥3n≥2n+3>2n+1n^2 \geq 3n \geq 2n + 3 > 2n + 1. So

2n+1=2×2n>2n2=n2+n2>n2+2n+1=(n+1)2.2^{n+1} = 2 \times 2^n > 2n^2 = n^2 + n^2 > n^2 + 2n + 1 = (n+1)^2.

By induction from m0=5m_0 = 5 (Corollary 1.16), 2n>n22^n > n^2 for every n≥5n \geq 5.

Careful Check that the inductive step is valid for every n you claim

The scratch work for Example 1.27 found a condition, n≥3n \geq 3, under which the step works. A common mistake is to find such a condition and then forget it, writing "n2≥2n+1n^2 \geq 2n + 1" as though it held for all nn. It fails at n=0,1,2n = 0, 1, 2. Every inequality you use in the inductive step must hold for every nn the step is applied to.

Strong induction at work

Ordinary induction steps from nn to n+1n + 1. Some problems don't break down that way: knowing the answer for nn tells you nothing about n+1n + 1, but it would help to know the answer for some smaller number, which one depending on nn. That is what strong induction (Proposition 1.15) is for.

Example 1.28 Every number from 2 on is a product of primes

Call a natural number n≥2n \geq 2 prime if the only ways to write n=a×bn = a \times b have a=1a = 1 or b=1b = 1. Claim: every n≥2n \geq 2 is a product of one or more primes.

Why ordinary induction doesn't help. Knowing that 1111 is a product of primes says nothing about 1212. But 12=3×412 = 3 \times 4, and knowing the claim for 33 and for 44 would settle it. We need the claim for smaller numbers, not just the previous one.

The proof. Strong induction with m0=2m_0 = 2. Let n≥2n \geq 2, and suppose that every mm with 2≤m<n2 \leq m < n is a product of primes.

  • If nn is prime, it is a product of one prime.
  • If nn is not prime, then n=a×bn = a \times b with a≠1a \neq 1 and b≠1b \neq 1. Neither aa nor bb is 00 (otherwise n=0n = 0), so a≥2a \geq 2 and b≥2b \geq 2. Then n=a×b≥2a=a+a>an = a \times b \geq 2a = a + a > a, and similarly n>bn > b. So 2≤a<n2 \leq a < n and 2≤b<n2 \leq b < n, and by the hypothesis both aa and bb are products of primes. Putting the two products together writes nn as a product of primes.

By strong induction (Proposition 1.15), every n≥2n \geq 2 is a product of primes.

Notice that strong induction needed no separate base case here. For n=2n = 2 the hypothesis is vacuous (there is no mm with 2≤m<22 \leq m < 2), and the argument handles n=2n = 2 anyway, because 22 is prime. The first bullet is the base case, built into the step.

Example 1.29 Stamps of 3 and 5

Which postage amounts can be made exactly from 3-cent and 5-cent stamps? The amounts 3,5,6,8,9,103, 5, 6, 8, 9, 10 can, but 1,2,41, 2, 4 and 77 cannot (check 77: 7−5=27 - 5 = 2 and 7−3=47 - 3 = 4 and 7−6=17 - 6 = 1, none a multiple of 33). Claim: every n≥8n \geq 8 can be written n=3a+5bn = 3a + 5b with natural numbers a,ba, b.

Scratch work. If n−3n - 3 can be made, then so can nn: add one more 3-cent stamp. So the step goes back three places, not one. That means three base cases are needed, one to start each of the three chains 8,11,14,…8, 11, 14, \dots; 9,12,15,…9, 12, 15, \dots; and 10,13,16,…10, 13, 16, \dots.

The proof. Strong induction with m0=8m_0 = 8. Let n≥8n \geq 8, and suppose every mm with 8≤m<n8 \leq m < n can be made.

  • If n=8n = 8, 99 or 1010: 8=3+58 = 3 + 5, 9=3×39 = 3 \times 3, 10=5×210 = 5 \times 2.
  • If n≥11n \geq 11: write n=m+3n = m + 3. Then m≥8m \geq 8 and m<nm < n, so m=3a+5bm = 3a + 5b by hypothesis, and n=3(a+1)+5bn = 3(a + 1) + 5b.
Careful The number of base cases depends on the step

In Example 1.29 the step reaches back three places, so three base cases are needed. With only 88 as a base case, the step would give 11,14,17,…11, 14, 17, \dots and nothing else. A strong induction whose step uses P(n−k)P(n - k) needs kk consecutive base cases, and a step that uses P(n−1)P(n - 1) and P(n−2)P(n - 2), as for the Fibonacci numbers in Exercise 1.43, needs two.

Where this goes Induction in the rest of the route

You will rarely see induction written out in full from here on. It becomes invisible: "by induction" or "repeating the argument" or "iterating". But it is there. The Cauchy-sequence estimates of 2A.6 Sequences and the contraction mapping argument of 2B.2 Completeness and Contraction bound the nn-th step by a geometric quantity, which is an induction like Example 1.26. The "bootstrapping" of regularity theory (6A.6 Weak Solutions and Elliptic Regularity) is a strong induction on the number of derivatives. The termination argument for Ricci flow with surgery (12B.13 Ricci Flow with Surgery for All Time) is a well-ordering argument: each surgery removes at least a fixed amount of volume, and volume can't decrease forever.

Recall Where we stand

Five axioms (Axiom 1.1 to Axiom 1.5) and nothing else. From them we have built addition, order, multiplication, division with remainder and powers. We have proved every familiar law by induction, and the well-ordering principle that makes termination arguments work. The next chapter (2A.2 Sets, Functions and Equivalence) supplies the language of sets and functions, including the notion of an equivalence relation, which is the tool for building the integers and the rationals from the natural numbers (2A.3 Integers and Rationals).

Before the axioms: where this came from

History What did mathematicians do before axioms?

For most of history, arithmetic needed no axioms at all. Babylonian scribes computed with large numbers, square roots and interest four thousand years ago, and Euclid's Elements (around 300 BCE) devotes three books (VII–IX) to the theory of numbers, including the algorithm in Figure 1.6 and the infinitude of primes. Euclid listed explicit postulates for geometry, but for numbers he gave only definitions and took the basic properties for granted, as everyone did.

What changed was calculus. Through the 17th and 18th centuries calculus grew enormously powerful while its foundations stayed vague: what exactly is an infinitely small quantity? In the 19th century Cauchy, Weierstrass and others rebuilt analysis on precise definitions of limits. Those definitions rested on the real numbers, and so the question moved back a step: what are the real numbers? Answering it (Dedekind and Cantor, in the 1870s; see 2A.4 The Real Numbers) reduced it to the rationals, and those reduce to the natural numbers (2A.3 Integers and Rationals). So the foundations of analysis ended up resting on a precise account of counting.

That account was assembled in three steps. In his Lehrbuch der Arithmetik (1861), Hermann Grassmann defined addition and multiplication recursively and proved their laws by induction, much as this chapter does. In Was sind und was sollen die Zahlen? ("What are numbers and what should they be?", 1888), Richard Dedekind proved that recursive definitions work, the content of Proposition 1.3, and that the system described by the axioms is unique up to renaming. In Arithmetices principia, nova methodo exposita (1889), Giuseppe Peano stated the axioms in a compact symbolic form, acknowledging in his preface that he had relied on Grassmann for the proofs and found Dedekind's work very useful. The axioms carry Peano's name, and some historians prefer "Dedekind–Peano axioms".

The story has a 20th-century sequel that bears directly on the "extra numbers" question. In 1933–34 Thoralf Skolem showed that if induction is only required for properties that can be written in first-order logic, a precise but limited formal language, then there are systems satisfying all the axioms that contain "nonstandard" elements beyond every ordinary number. With induction for all properties, as in Axiom 1.5, Dedekind's argument shows there is only one system up to renaming. Which reading of "property" is the right one is a question for mathematical logic. For the analysis in this guidebook, the natural numbers are the unique system of Remark 1.30.

Remark 1.30 The natural numbers are unique

Suppose two systems, (N,0,++)(\mathbb{N}, 0, {+}{+}) and (N′,0′,++′)(\mathbb{N}', 0', {+}{+}'), both satisfy all five axioms. Define ϕ:N→N′\phi: \mathbb{N} \to \mathbb{N}' by recursion: ϕ(0)=0′\phi(0) = 0' and ϕ(n++)=ϕ(n)++′\phi(n{+}{+}) = \phi(n){+}{+}'. One can prove by induction that ϕ\phi matches the two systems up perfectly. It is a one-to-one correspondence carrying 00 to 0′0' and successors to successors. In this sense the axioms describe exactly one thing, and it is legitimate to speak of the natural numbers, written N\mathbb{N}. That they exist at all is taken as given here, as in Tao; in set theory it is the content of the axiom of infinity.

Proof. We check that ϕ\phi is one-to-one and that every element of N′\mathbb{N}' is reached. Each part is an induction, and each uses the axioms of one of the two systems.

Every element of N′\mathbb{N}' is ϕ\phi of something. Induct in N′\mathbb{N}' (its own Axiom 1.5) on the property "y=ϕ(n)y = \phi(n) for some nn". It holds for 0′=ϕ(0)0' = \phi(0). If y=ϕ(n)y = \phi(n), then y++′=ϕ(n)++′=ϕ(n++)y{+}{+}' = \phi(n){+}{+}' = \phi(n{+}{+}).

Different numbers go to different places. Induct in N\mathbb{N} on nn, with the property "for every mm, if ϕ(m)=ϕ(n)\phi(m) = \phi(n) then m=nm = n". For n=0n = 0: if m≠0m \neq 0, then m=k++m = k{+}{+} and ϕ(m)=ϕ(k)++′\phi(m) = \phi(k){+}{+}', which is not 0′0' by Axiom 1.3 in N′\mathbb{N}'; so ϕ(m)=ϕ(0)\phi(m) = \phi(0) forces m=0m = 0. For the step, suppose the property holds for nn, and ϕ(m)=ϕ(n++)=ϕ(n)++′\phi(m) = \phi(n{+}{+}) = \phi(n){+}{+}'. Then ϕ(m)≠0′\phi(m) \neq 0', so m≠0m \neq 0, and m=k++m = k{+}{+} for some kk. Now ϕ(k)++′=ϕ(n)++′\phi(k){+}{+}' = \phi(n){+}{+}', so ϕ(k)=ϕ(n)\phi(k) = \phi(n) by Axiom 1.4 in N′\mathbb{N}', so k=nk = n by the hypothesis, and m=n++m = n{+}{+}.

Finally, ϕ\phi respects arithmetic: ϕ(n+m)=ϕ(n)+′ϕ(m)\phi(n + m) = \phi(n) +' \phi(m) and ϕ(n×m)=ϕ(n)×′ϕ(m)\phi(n \times m) = \phi(n) \times' \phi(m), each by induction on nn, because both sides satisfy the same recursion. So the two systems are the same up to the renaming ϕ\phi, operations included.

Exercises

The exercises are part of the chapter. The first group makes the axioms concrete, the second practises induction, and the last rehearses an argument from much later in the route. Try each one before opening its hint.

Exercise 1.31 Numerals are distinct

Prove from the axioms that 0,1,2,3,40, 1, 2, 3, 4 are five different natural numbers. Then explain why the same method shows that any two numerals with different names are different.

Hint

Every pair involving 00 is handled by Axiom 1.3. For a pair like 44 and 22, apply Axiom 1.4 repeatedly to strip off successors until one side is 00.

Solution

1,2,3,41, 2, 3, 4 are successors, so none equals 00 (Axiom 1.3). If 4=24 = 2, then 3++=1++3{+}{+} = 1{+}{+}, so 3=13 = 1 by Axiom 1.4, so 2=02 = 0 by Axiom 1.4 again, contradicting Axiom 1.3. Every pair is handled the same way: if numerals with kk and jj successor symbols (k>jk > j) were equal, removing jj successors from both sides with Axiom 1.4 would make a successor equal to 00.

Exercise 1.32 Checking the almost-systems

For each of the four systems in Figure 1.3, verify carefully that it satisfies every axiom except the one indicated. Pay particular attention to induction in the wrap-around counter: why does Axiom 1.5 hold there, even though Axiom 1.3 fails?

Solution

In the wrap-around counter {0,…,5}\{0, \dots, 5\}, suppose P(0)P(0) holds and P(x)  ⟹  P(x++)P(x) \implies P(x{+}{+}) for all xx. Then P(1),…,P(5)P(1), \dots, P(5) follow one at a time, and those are all the elements. So Axiom 1.5 holds, because every element is reached from 00; the system merely comes back to 00 as well. In the saturating counter {0,…,3}\{0, \dots, 3\} with 3++=33{+}{+} = 3, 00 is not a successor and every element is reached from 00, but 2++=3++2{+}{+} = 3{+}{+}. In the checked counter, 3++3{+}{+} doesn't exist, so Axiom 1.2 fails, while the other conditions hold for every element where they make sense. In the system with intruders, see the discussion after Axiom 1.5.

Exercise 1.33 No number is its own successor

Prove that n++≠nn{+}{+} \neq n for every natural number nn. Which axioms does your proof use? Check your answer against the saturating counter, where 255++=255255{+}{+} = 255.

Solution

Induction on nn. Base case: 0++≠00{+}{+} \neq 0 by Axiom 1.3. Inductive step: suppose n++≠nn{+}{+} \neq n. If (n++)++=n++(n{+}{+}){+}{+} = n{+}{+}, then by Axiom 1.4 n++=nn{+}{+} = n, contradicting the hypothesis. The proof uses Axiom 1.3, Axiom 1.4 and Axiom 1.5, and the saturating counter breaks Axiom 1.4.

Exercise 1.34 Associativity

Prove Proposition 1.8: (a+b)+c=a+(b+c)(a + b) + c = a + (b + c) for all natural numbers a,b,ca, b, c.

Hint

Fix bb and cc and induct on aa. The definition of addition peels successors off the left argument, so that is the one to induct on.

Solution

Base case: (0+b)+c=b+c=0+(b+c)(0 + b) + c = b + c = 0 + (b + c). Inductive step: if (a+b)+c=a+(b+c)(a + b) + c = a + (b + c), then ((a++)+b)+c=((a+b)++)+c=((a+b)+c)++=(a+(b+c))++=(a++)+(b+c)((a{+}{+}) + b) + c = ((a + b){+}{+}) + c = ((a + b) + c){+}{+} = (a + (b + c)){+}{+} = (a{+}{+}) + (b + c), using the definition three times and the hypothesis once.

Exercise 1.35 Uniqueness in division

Show that the mm and rr in Theorem 1.22 are unique. Then compute the quotient and remainder of 2312^{31} divided by 86,40086{,}400, and check the figure in Example 1.23.

Hint

If mq+r=m′q+r′m q + r = m' q + r' with r,r′<qr, r' < q and, say, m<m′m < m', then m′=m+dm' = m + d with d≥1d \geq 1. Show that this forces r≥qr \geq q.

Solution

Suppose mq+r=m′q+r′m q + r = m' q + r' with r,r′<qr, r' < q. If m<m′m < m', write m′=m+dm' = m + d with d≥1d \geq 1. Then mq+r=mq+dq+r′m q + r = m q + d q + r', and cancelling mqmq (Proposition 1.9) gives r=dq+r′≥qr = d q + r' \geq q, contradicting r<qr < q. Similarly m>m′m > m' is impossible, so m=m′m = m' by trichotomy, and then r=r′r = r' by cancellation.

For the computation, 231=2,147,483,648=24,855×86,400+11,6482^{31} = 2{,}147{,}483{,}648 = 24{,}855 \times 86{,}400 + 11{,}648. So 2312^{31} seconds is 24,85524{,}855 days and a little over three hours, about 6868 years: that is why a signed 32-bit count of seconds from 1970 runs out in 2038. For the 787, the count is in hundredths of a second, so divide 2312^{31} by the 8,640,0008{,}640{,}000 hundredths in a day: 231=248×8,640,000+4,763,6482^{31} = 248 \times 8{,}640{,}000 + 4{,}763{,}648. The remainder is 47,636.4847{,}636.48 seconds, matching Example 1.23.

Exercise 1.36 Laws of powers

Prove that ma+b=ma×mbm^{a + b} = m^a \times m^b for all natural numbers m,a,bm, a, b, by induction on bb. Then prove (ma)b=ma×b(m^a)^b = m^{a \times b}.

Solution

First law, by induction on bb with mm and aa fixed. Base case: ma+0=ma=ma×1=ma×m0m^{a + 0} = m^a = m^a \times 1 = m^a \times m^0. Inductive step: if ma+b=ma×mbm^{a+b} = m^a \times m^b, then

ma+(b+1)=m(a+b)+1=ma+b×m=(ma×mb)×m=ma×(mb×m)=ma×mb+1,m^{a + (b+1)} = m^{(a + b) + 1} = m^{a+b} \times m = (m^a \times m^b) \times m = m^a \times (m^b \times m) = m^a \times m^{b+1},

using associativity of addition, the definition of powers, the hypothesis, associativity of multiplication, and the definition again.

Second law, by induction on bb. Base case: (ma)0=1=m0=ma×0(m^a)^0 = 1 = m^0 = m^{a \times 0}. Inductive step: if (ma)b=ma×b(m^a)^b = m^{a \times b}, then (ma)b+1=(ma)b×ma=ma×b×ma=ma×b+a=ma×(b+1)(m^a)^{b+1} = (m^a)^b \times m^a = m^{a \times b} \times m^a = m^{a \times b + a} = m^{a \times (b+1)}, using the first law and Lemma 1.20.

Exercise 1.37 Three forms of induction

You have seen that ordinary induction implies strong induction (Proposition 1.15) and that strong induction implies well-ordering (Theorem 1.17). Prove that the well-ordering principle implies ordinary induction, so all three are equivalent given the other axioms.

Hint

Suppose P(0)P(0) holds and P(n)  ⟹  P(n++)P(n) \implies P(n{+}{+}), but PP fails somewhere. Apply well-ordering to the set of numbers where PP fails. Its least element can't be 00, so it is a successor n++n{+}{+}. What do you know about nn?

Solution

Suppose P(0)P(0) holds and P(n)P(n) implies P(n++)P(n{+}{+}) for every nn, and let SS be the set of nn for which P(n)P(n) is false. If SS is nonempty, it has a least element mm by the well-ordering principle. Since P(0)P(0) is true, m≠0m \neq 0, so m=n++m = n{+}{+} for some nn (Proposition 1.2). Then n<mn < m, so nn is not in SS (otherwise mm would not be least), so P(n)P(n) is true. By the hypothesis P(n++)=P(m)P(n{+}{+}) = P(m) is true, so mm is not in SS: a contradiction. Hence SS is empty and P(n)P(n) holds for every nn.

Exercise 1.38 Where exactly does it break?

Here is a "proof" by strong induction that every natural number is 00. Base case: 0=00 = 0. Inductive step: let nn be positive and suppose every m<nm < n equals 00. Write n=a+bn = a + b with a<na < n and b<nb < n. By the hypothesis a=0a = 0 and b=0b = 0, so n=0+0=0n = 0 + 0 = 0.

Find the first nn for which the inductive step is invalid, and say exactly which sentence fails there.

Solution

The step fails at n=1n = 1. The only ways to write 1=a+b1 = a + b are 0+10 + 1 and 1+01 + 0, and in each, one of the summands is not smaller than nn. The sentence "write n=a+bn = a + b with a<na < n and b<nb < n" is false for n=1n = 1. For n≥2n \geq 2 it is possible (n=1+(n−1)n = 1 + (n - 1)), but that is too late: the chain from 00 to every other number passes through 11. Like the horses, the flaw sits at the smallest case.

Exercise 1.39 One is neutral

Prove from the definitions that 1×n=n1 \times n = n and n×1=nn \times 1 = n for every natural number nn.

Solution

1×n=(0++)×n=(0×n)+n=0+n=n1 \times n = (0{+}{+}) \times n = (0 \times n) + n = 0 + n = n, directly from Definition 1.18 and Definition 1.4. Then n×1=1×n=nn \times 1 = 1 \times n = n by commutativity. (Without commutativity: n×(0++)=(n×0)+n=0+n=nn \times (0{+}{+}) = (n \times 0) + n = 0 + n = n by Lemma 1.20 and Lemma 1.19.)

Exercise 1.40 Adding inequalities

Prove that if a≤ba \leq b and c≤dc \leq d, then a+c≤b+da + c \leq b + d. Prove that if a<ba < b and c≤dc \leq d, then a+c<b+da + c < b + d.

Solution

Write b=a+xb = a + x and d=c+yd = c + y. Then b+d=(a+c)+(x+y)b + d = (a + c) + (x + y), so a+c≤b+da + c \leq b + d. If moreover a<ba < b, then xx is positive (part (6) of Proposition 1.13), so x+yx + y is positive (Proposition 1.11), and a+c<b+da + c < b + d by part (6) again.

Exercise 1.41 Sums of odd numbers

Define T0=0T_0 = 0 and Tn+1=Tn+(2n+1)T_{n+1} = T_n + (2n + 1), so Tn=1+3+5+⋯+(2n−1)T_n = 1 + 3 + 5 + \cdots + (2n - 1) is the sum of the first nn odd numbers. Compute T1,…,T5T_1, \dots, T_5, guess a formula, and prove it by induction.

Solution

T1=1T_1 = 1, T2=4T_2 = 4, T3=9T_3 = 9, T4=16T_4 = 16, T5=25T_5 = 25: the guess is Tn=n2T_n = n^2. Base case: T0=0=02T_0 = 0 = 0^2. Inductive step: if Tn=n2T_n = n^2, then Tn+1=n2+2n+1=(n+1)2T_{n+1} = n^2 + 2n + 1 = (n + 1)^2. (Picture: an (n+1)×(n+1)(n+1) \times (n+1) square of dots is an n×nn \times n square with an L-shaped border of 2n+12n + 1 dots.)

Exercise 1.42 The largest number a counter can hold

Define G0=0G_0 = 0 and Gn+1=Gn+2nG_{n+1} = G_n + 2^n, so Gn=1+2+4+⋯+2n−1G_n = 1 + 2 + 4 + \cdots + 2^{n-1}. Prove that Gn+1=2nG_n + 1 = 2^n for every nn. Explain why this shows that the largest number an unsigned nn-bit counter can hold is 2n−12^n - 1, and why an 8-bit unsigned counter stops at 255255.

Solution

Base case: G0+1=1=20G_0 + 1 = 1 = 2^0. Inductive step: if Gn+1=2nG_n + 1 = 2^n, then Gn+1+1=Gn+1+2n=2n+2n=2n+1G_{n+1} + 1 = G_n + 1 + 2^n = 2^n + 2^n = 2^{n+1}. An nn-bit counter holds b0+2b1+4b2+⋯+2n−1bn−1b_0 + 2b_1 + 4b_2 + \cdots + 2^{n-1}b_{n-1} with each digit bkb_k equal to 00 or 11; the largest value has every digit 11, which is Gn=2n−1G_n = 2^n - 1. For n=8n = 8 that is 255255.

Exercise 1.43 Fibonacci numbers grow at most exponentially

The Fibonacci numbers are defined by F0=0F_0 = 0, F1=1F_1 = 1 and Fn+2=Fn+1+FnF_{n+2} = F_{n+1} + F_n. Prove by strong induction that Fn<2nF_n < 2^n for every nn. How many base cases do you need, and why?

Hint

The step for n≥2n \geq 2 uses the claim for both n−1n - 1 and n−2n - 2, so the base cases must cover n=0n = 0 and n=1n = 1.

Solution

Base cases: F0=0<1=20F_0 = 0 < 1 = 2^0 and F1=1<2=21F_1 = 1 < 2 = 2^1. Step: let n≥2n \geq 2 and suppose Fm<2mF_m < 2^m for all m<nm < n. Then Fn=Fn−1+Fn−2<2n−1+2n−2<2n−1+2n−1=2nF_n = F_{n-1} + F_{n-2} < 2^{n-1} + 2^{n-2} < 2^{n-1} + 2^{n-1} = 2^n. Two base cases are needed because the step reaches back two places; with only F0F_0 checked, the step for n=1n = 1 would refer to F−1F_{-1}, which doesn't exist (the recursion only defines FnF_n from n=2n = 2 on).

Exercise 1.44 Find the flaw

Here is a "proof" that n+1≤nn + 1 \leq n for every nn. Suppose n+1≤nn + 1 \leq n. Adding 11 to both sides, n+2≤n+1n + 2 \leq n + 1, which is the statement for n+1n + 1. So by induction the claim holds for every nn. What is wrong? Which axiom tells you that the claim is in fact false for every nn?

Solution

The inductive step is valid, but there is no base case, and the base case is false: 0+1≤00 + 1 \leq 0 would mean 0=1+a0 = 1 + a for some aa, which is a successor, contradicting Axiom 1.3. In fact n+1≤nn + 1 \leq n fails for every nn: it would combine with n≤n+1n \leq n + 1 would give n=n+1n = n + 1 by antisymmetry, contradicting Exercise 1.33. This is the same trap as "n++=nn{+}{+} = n" in the section on getting induction wrong.

Exercise 1.45 Rehearsal: bounds one derivative at a time

This exercise is a toy version of how Shi's estimates for Ricci flow (11A.4 Short-Time Existence and Uniqueness) are organised. Suppose a sequence of numbers C0,C1,C2,…C_0, C_1, C_2, \dots satisfies C0≤MC_0 \leq M and, for every kk,

Ck++≤(k+1) Ck.C_{k{+}{+}} \leq (k + 1)\, C_k.

(Think of CkC_k as a bound on the kk-th derivative of some quantity, and of the inequality as an estimate that bounds each derivative in terms of the previous one.) Prove by induction that Ck≤k! MC_k \leq k! \, M for every kk, where k!k! is defined recursively by 0!=10! = 1 and (k++)!=(k+1)×k!(k{+}{+})! = (k + 1) \times k!.

What would go wrong if you only knew Ck++≤(k+1) CkC_{k{+}{+}} \leq (k + 1)\,C_k for k≥1k \geq 1, and nothing about C1C_1?

Solution

Base case: C0≤M=0! MC_0 \leq M = 0!\,M. Inductive step: if Ck≤k! MC_k \leq k!\,M, then Ck++≤(k+1) Ck≤(k+1) k! M=(k++)! MC_{k{+}{+}} \leq (k+1)\,C_k \leq (k+1)\,k!\,M = (k{+}{+})!\,M. Without an estimate linking C1C_1 to C0C_0, the chain of inequalities has nowhere to start: the conclusion holds for k≥1k \geq 1 only if C1C_1 is controlled some other way. The base case of the derivative ladder matters as much as the step. In Shi's estimates the base case is the curvature bound itself, and the step is a maximum-principle argument, which you will meet in 6A.7 Parabolic Regularity.

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.