2.3  Definition by Recursion

Since school we have defined powers by two clauses: u0=1, and un+1=unu. Sums a1+⋯+an, factorials and many sequences are defined the same way: a starting value, and a rule that produces the next value from the last. Logic and Proof, Chapter 4 used induction to prove facts about such objects, such as 3n≥2n+1 in Logic and Proof, Example (An inequality by induction). But induction proves facts about a function that already exists, and here the function is what we want to obtain. This section proves that two such clauses always define exactly one function on N, and then uses the theorem to define sums, products and powers properly and to prove their first laws.

2.3.1. Definitions that define something

Logic and Proof, Chapter 4 met the same question for formulas. A recursive definition on formulas gives a value for each atom and a rule for each way of building a compound formula, and Logic and Proof, Theorem 4.3.4 showed that such clauses define exactly one function, because unique readability leaves no choice of clause. On N the clauses are simpler: one starting value at 0, and one rule for passing from n to n+1. What we want to prove is this.

A starting value and a rule for the next value determine exactly one sequence.

Theorem 2.3.1 (Recursion Theorem)

Let X be a set, let a∈X, and let g:N×X→X be a function. Then there is exactly one function f:N→X such that f(0)=aandf(n+1)=g(n,f(n))  for every n∈N.

In words: a is the starting value, and g is the rule that turns the stage n and the current value f(n) into the next value. The rule may look at n as well as at f(n): the factorial needs this, since (n+1)!=(n+1)⋅n! is g(n,x)=(n+1)x at x=n!. The hypothesis that g maps into X is what lets the rule be applied again at the next stage. The conclusion has two halves: existence (some f obeys the two equations) and uniqueness (no two different functions do).

Idea. Uniqueness is an ordinary induction: two solutions agree at 0, and if they agree at n, the second equation makes them agree at n+1. Existence is harder, because induction cannot produce f; it can only prove statements. So we prove by induction a statement about finite pieces of f. The roadmap:

① Uniqueness, by induction on n.

② Claim: for every n∈N there is exactly one function on {0,…,n} obeying the two equations wherever they make sense (a partial solution). Its graph is the graph of the previous one with one pair added.

③ Glue: collect the graphs of all partial solutions in one set S and take the union. The partial solutions agree where they overlap, so the union is the graph of a function on all of N, and that function obeys the equations.

Before reading on: self-explain the Claim’s inductive step.

Proof. For n∈N, the set {0,…,n}={k∈N:k≤n} of Section 2.1 contains 0, since 0≤n by Lemma 2.1.1 (a). Call a function h:{0,…,n}→X a partial solution up to n if h(0)=a and h(k+1)=g(k,h(k)) for every k∈N with k+1≤n. (For such k, both k and k+1 lie in {0,…,n}, so the equation makes sense.)

Step 1 (uniqueness). Let f,f′:N→X both satisfy the two equations, and let P(n) be “f(n)=f′(n)”. P(0) holds, since f(0)=a=f′(0). If P(n) holds, then f(n+1)=g(n,f(n))=g(n,f′(n))=f′(n+1), so P(n+1) holds. By Logic and Proof, Axiom 4.2.1, f(n)=f′(n) for every n∈N. The two functions have the same domain and the same codomain, so f=f′ by Proposition 1.5.1.

Step 2.

Claim. For every n∈N there is exactly one partial solution up to n.

Proof of Claim. We use Logic and Proof, Axiom 4.2.1 on n.

Base case. By Lemma 2.1.1 (a), every k∈N has k≥0, so k≤0 holds only for k=0, and {0,…,0}={0}. The graph {(0,a)} with codomain X is a function on {0}, since a∈X: the input 0 has the one output a. It is a partial solution up to 0: its value at 0 is a, and the second condition is vacuous, because k+1≥1>0 for every k∈N. Any partial solution up to 0 has value a at 0, so it equals this one by Proposition 1.5.1.

Inductive step. Let n∈N, and suppose there is exactly one partial solution up to n; call it fn, with graph Gn. Let Gn+1:=Gn∪{(n+1, g(n,fn(n)))}. First, {0,…,n+1}={0,…,n}∪{n+1}: a natural number k≤n+1 is either n+1 or less than n+1, and then k≤n, since no natural number lies strictly between n and n+1 (Lemma 2.1.1 (e)). Also n+1∉{0,…,n}, since n+1>n.

We check the clauses of Definition 1.5.1 for Gn+1 on {0,…,n+1} with codomain X. Every pair of Gn+1 lies in {0,…,n+1}×X, because g takes values in X. (Fn1): an input k≤n has the output fn(k) in Gn, and the input n+1 has the output g(n,fn(n)). (Fn2): the pairs with first coordinate k≤n all lie in Gn, since the added pair has first coordinate n+1≠k, and Gn satisfies (Fn2); the only pair with first coordinate n+1 is the added one, since the first coordinates in Gn are at most n. So fn+1:=(Gn+1,X) is a function on {0,…,n+1}, and it agrees with fn on {0,…,n}.

It is a partial solution up to n+1. Its value at 0 is fn(0)=a. Let k∈N with k+1≤n+1, so k≤n. If k<n, then k+1≤n by Lemma 2.1.1 (e), and fn+1(k+1)=fn(k+1)=g(k,fn(k))=g(k,fn+1(k)), because fn is a partial solution. If k=n, then fn+1(n+1)=g(n,fn(n))=g(n,fn+1(n)) by the choice of the added pair.

It is the only one. Let h be a partial solution up to n+1. Its restriction h|{0,…,n} (Section 1.5) is a partial solution up to n, because the conditions on it are among the conditions on h. By the induction hypothesis it is fn. So h(k)=fn(k)=fn+1(k) for k≤n, and h(n+1)=g(n,h(n))=g(n,fn(n))=fn+1(n+1). By Proposition 1.5.1, h=fn+1. This proves the claim.

For each n∈N, let fn be the partial solution up to n, and Gn its graph. If m≤n, then {0,…,m}⊆{0,…,n}, and the restriction of fn to {0,…,m} is a partial solution up to m, so by the claim it is fm. In terms of graphs, Gm=Gn∩({0,…,m}×X)⊆Gn(m≤n).

Step 3 (existence). Let S:={G∈P(N×X):G is the graph of a partial solution up to some n∈N}, a set by Definition 1.2.3 and Definition 1.3.2. By the claim, the elements of S are exactly the graphs Gn. Let F:=⋃S (Definition 1.3.4), so a pair lies in F if and only if it lies in some Gn; in particular F⊆N×X. We check the clauses of Definition 1.5.1 for F.

(Fn1): for n∈N, the pair (n,fn(n)) lies in Gn∈S, hence in F.

(Fn2): let (k,y)∈F and (k,y′)∈F, say (k,y)∈Gm and (k,y′)∈Gn. If m≤n, then Gm⊆Gn, so both pairs lie in Gn, and y=y′ because Gn satisfies (Fn2). If n<m, the same argument with m and n exchanged gives y=y′.

So f:=(F,X) is a function N→X. For m≥n, the pair (n,fm(n)) lies in Gm⊆F, so f(n)=fm(n). Hence f(0)=f0(0)=a, and for every n∈N, f(n+1)=fn+1(n+1)=g(n,fn+1(n))=g(n,f(n)), where the middle equation holds because fn+1 is a partial solution. This proves existence, and with Step 1, the theorem.

The starting value was used in both halves: Step 1 needs f(0)=f′(0) as its base case, and Step 2 needs it to fix the first partial solution. The set S is cut out of a power set by a condition, so no family n↦fn had to be formed before the union was taken. No choice is made anywhere: at every stage the claim leaves exactly one candidate. From now on, a definition of the form “f(0):=a, f(n+1):=g(n,f(n))” is legitimate whenever a∈X and g is a function N×X→X, and we say that f is defined by recursion.

Remark. Because the rule may depend on n, the theorem also covers constructions in which the step uses outside data indexed by n. Analysis on the Real Line, Chapter 1 builds closed intervals In+1 from In and the (n+1)-st number of a given list in exactly this way, with no choice principle involved. The values may be sets as well as numbers. With X=P(N), A0:=N and An+1:=An∖{n} define a sequence of sets of the kind Section 1.3 promised, and an induction that follows the same two clauses shows An={k∈N:k≥n}: the base is Lemma 2.1.1 (a), and the step removes n from {k:k≥n}, leaving {k:k>n}={k:k≥n+1} by Lemma 2.1.1 (e).

Quick check. Name X, a and g for the sequence 1,3,7,15,…, in which each term is twice the previous one plus one.

Solution. X=N (or R), a=1 and g(n,x)=2x+1; the rule does not use n. Since 2x+1∈N for x∈N (Lemma 2.1.1 (b)), g is a function N×X→X, so Theorem 2.3.1 applies. The clauses give f(1)=2⋅1+1=3, f(2)=7, f(3)=15, as listed.

2.3.2. Starting elsewhere, looking two steps back

Two variants come up constantly. Sequences are often indexed from 1, as in Section 1.5, and some recursions use the two previous values. Both reduce to the theorem.

Corollary 2.3.2 (Recursion from a Base)

Let n0 be an integer, D:={n∈Z:n≥n0}, X a set, a∈X, and g:D×X→X a function. Then there is exactly one function f:D→X with f(n0)=a and f(n+1)=g(n,f(n)) for every n∈D.

Idea. Rename the index: k=n−n0 turns D into N and the recursion on D into one on N, where Theorem 2.3.1 applies.

Proof. For k∈N, the number n0+k is an integer (Proposition 2.1.2 (a)) and n0+k≥n0 (Lemma 2.1.1 (a)), so it lies in D. Conversely, for n∈D, n−n0 is an integer (Proposition 2.1.2 (a)) and ≥0, so n−n0∈N by Proposition 2.1.2 (b). Define g′:N×X→X by g′(k,x):=g(n0+k,x). By Theorem 2.3.1 there is exactly one f′:N→X with f′(0)=a and f′(k+1)=g(n0+k,f′(k)) for every k∈N.

Existence. Let t:D→N, t(n):=n−n0, and f:=f′∘t (Definition 1.5.2). Then f(n0)=f′(0)=a, and for n∈D, with k=n−n0, f(n+1)=f′(k+1)=g(n0+k,f′(k))=g(n,f(n)).

Uniqueness. If f~:D→X also satisfies both equations, then k↦f~(n0+k) satisfies the equations that define f′, so it is f′ by the uniqueness in Theorem 2.3.1. Hence f~(n)=f′(n−n0)=f(n) for every n∈D, and f~=f by Proposition 1.5.1.

The renaming is the move that gave induction from a base (Theorem 2.2.1). The corollary covers every sequence (an)n≥1 given by a first term and a rule, and Analysis on the Real Line, Chapter 1’s intervals, which are listed from 1.

Corollary 2.3.3 (Two-Step Recursion)

Let X be a set, a,b∈X, and h:N×(X×X)→X a function (Definition 1.4.2); write h(n,x,y) for h(n,(x,y)). Then there is exactly one function f:N→X with f(0)=a,f(1)=b,f(n+2)=h(n,f(n),f(n+1))  for every n∈N.

Idea. A rule that looks two steps back is a rule that looks one step back at pairs. Carry the pair (f(n),f(n+1)) along: the next pair is (f(n+1),f(n+2)), and both of its entries are computed from the current pair.

Proof. Define G:N×(X×X)→X×X by G(n,(x,y)):=(y,h(n,x,y)). By Theorem 2.3.1 with the set X×X and the starting value (a,b), there is exactly one p:N→X×X with p(0)=(a,b) and p(n+1)=G(n,p(n)). Write p(n)=(p1(n),p2(n)). The equation p(n+1)=(p2(n),h(n,p1(n),p2(n))) gives, by the characteristic property of pairs (Definition 1.4.1), p1(n+1)=p2(n),p2(n+1)=h(n,p1(n),p2(n)). Let f(n):=p1(n). Then f(0)=a, f(1)=p2(0)=b, and f(n+2)=p2(n+1)=h(n,p1(n),p2(n))=h(n,f(n),f(n+1)). For uniqueness, let f′ satisfy the three equations, and let p′(n):=(f′(n),f′(n+1)). Then p′(0)=(a,b) and p′(n+1)=(f′(n+1), h(n,f′(n),f′(n+1)))=G(n,p′(n)), so p′=p by the uniqueness in Theorem 2.3.1, and f′(n)=p1(n)=f(n) for every n. By Proposition 1.5.1, f′=f.

Quick check. Do a0=1, a1=1 and an+2=an+1an define a sequence of reals? What is it?

Solution. Yes, by Corollary 2.3.3 with X=R and h(n,x,y)=yx, a function N×(R×R)→R. Every term is 1: induct on the pair statement “an=1 and an+1=1”, as in the two-step example below, after Definition 2.3.2. It holds at n=0, and if it holds at n, then an+2=1⋅1=1, so it holds at n+1.

2.3.3. Sums, products and powers

The symbols ∑ and ∏ are recursive definitions, and so are powers. Writing them as instances of Theorem 2.3.1 settles what they mean at the edges: the empty sum, the empty product and u0.

Definition 2.3.1 (Finite Sums and Products)

Let (ak)k≥1 be a sequence of real numbers. The sums ∑k=1nak and products ∏k=1nak, for n∈N, are defined by recursion: ∑k=10ak:=0,∑k=1n+1ak:=∑k=1nak+an+1,∏k=10ak:=1,∏k=1n+1ak:=(∏k=1nak)an+1. The factorial of n∈N is n!:=∏k=1nk. For integers m≤n+1 and reals ak given for every integer k≥m, ∑k=mnak:=∑i=1n−m+1am−1+i,∏k=mnak:=∏i=1n−m+1am−1+i.

In words: a sum starts at 0 and adds one term at each stage; a product starts at 1 and multiplies by one term at each stage. The sum is Theorem 2.3.1 with X=R, a=0 and g(n,x)=x+an+1, a function N×R→R because n+1≥1 is an index of the sequence (Lemma 2.1.1 (a), (NS)); the product is a=1, g(n,x)=xan+1. The letter k is a dummy: ∑k=1nak and ∑j=1naj are the same number. In the general form, n−m+1 is an integer ≥0, hence in N (Proposition 2.1.2 (b)), and the terms am−1+i, for i≥1, run through am,am+1,…; when m=1 it gives the first form back.

The edge cases are the point of the definition. The empty sum is 0 and the empty product is 1: ∑k=mm−1ak=0 and 0!=1. These are the only values that make the recursive clause true at the first stage for every sequence, since ∑k=11ak should be a1 and ∏k=11ak should be a1. So 1!=1, 2!=2, 3!=6, 4!=24.

Three consequences are used constantly, and each is a short check from the definition.

  • Finite lists. ∑k=1nak depends only on a1,…,an. Precisely: if two sequences agree at 1,…,N, their sums up to n agree for every n≤N. Induct on n with the property “if n≤N, the two sums up to n are equal”. The base is 0=0. In the step, n+1≤N gives n≤N, so the sums up to n agree, and the added terms an+1 agree because 1≤n+1≤N. So a finite list a1,…,aN is summed by extending it in any way, say by ak:=0 for k>N, and the result does not depend on the extension. The same holds for products, and for the general bounds with am,…,an.
  • Shifting the index. For every integer p, ∑k=mnak=∑k=m+pn+pak−p, because both sides unfold to ∑i=1n−m+1am−1+i. Analysis on the Real Line, Chapter 1’s estimate of yk−xk uses the shift p=1.
  • Splitting off the last term. For m≤n+1, ∑k=mn+1ak=∑k=mnak+an+1. Unfold the left side to ∑i=1n−m+2am−1+i and apply the recursive clause; its last term is am−1+(n−m+2)=an+1.
Definition 2.3.2 (Powers)

Let u∈R. The powers un, for n∈N, are defined by recursion: u0:=1,un+1:=unu.

This is Theorem 2.3.1 with X=R, a=1 and g(n,x)=xu. So u1=u0u=u, and u2=uu. The definition gives 00=1, in line with the empty product: un=∏k=1nu, since both sides obey the same two clauses and so agree by the uniqueness in Theorem 2.3.1. Only exponents in N are defined here; roots a1/n come in Analysis on the Real Line, Chapter 1.

A sequence that approaches 2. Let X:=(0,∞) and g(n,x):=12(x+2/x). Before writing a recursion, check that g maps X into X: for x>0, 2/x is defined and positive, so x+2/x>0, and half of it is positive. By Theorem 2.3.1, a0:=2 and an+1:=12(an+2/an) define a sequence in (0,∞). Because the check was made on g, no separate induction is needed to show an>0 before dividing by it. The first values are a0=2,a1=12(2+1)=32,a2=12(32+43)=1712, and (17/12)2=289/144, which exceeds 2 by 1/144. That the sequence converges to 2 is a question for Analysis on the Real Line, Chapter 2, where recursively defined sequences become objects of study.

A two-step example. By Corollary 2.3.3, a0=2, a1=3 and an+2=3an+1−2an define a unique sequence of reals (X=R, h(n,x,y)=3y−2x), and its first values are 2,3,5,9,17. These are 2n+1. To prove it, induct on the pair statement Q(n): “an=2n+1 and an+1=2n+1+1”. Q(0) is 2=1+1 and 3=2+1. If Q(n) holds, its second half is the first half of Q(n+1), and an+2=3(2n+1+1)−2(2n+1)=2⋅2n+1+1=2n+2+1, where 2⋅2n=2n⋅2=2n+1 and 2⋅2n+1=2n+1⋅2=2n+2 by Definition 2.3.2 (and commutativity). So Logic and Proof, Axiom 4.2.1 gives Q(n) for every n, and in particular an=2n+1. The induction carries a pair because the recursion does: the proof follows the clauses of the definition.

Warning. A recursion needs its starting values, and its rule must stay inside X. “an+2=an+1+an” alone defines nothing: 0,1,1,2,… and 2,1,3,4,… both obey it, and Corollary 2.3.3 asks for a0 and a1. And “a0=2, an+1=1/(an−1)” is not a definition by recursion: a1=1, and then a2 would be 1/0. The rule x↦1/(x−1) is not a function from any set X containing 2 into X, since X would have to contain its value 1, where the rule is undefined.

Quick check. Compute ∏k=14(1+1k), and say why the answer is so simple.

Solution. Each factor is 1+1k=k+1k, so the product is 21⋅32⋅43⋅54=5. Each numerator cancels the next denominator: the product telescopes. In general ∏k=1nk+1k=n+1, by induction on n: the empty product is 1=0+1, and (n+1)⋅n+2n+1=n+2.

2.3.4. Recursion, then induction

A function defined by recursion is studied by induction, and the induction follows the clauses of the definition: the base case uses the starting value, the step uses the rule. The laws of powers are the first example. In the terms of Example (Method: finding P(n) inside P(n+1)), the recursion says where P(n) sits inside P(n+1): in the last term split off, or the last factor.

Proposition 2.3.4 (Laws of Powers)

Let u,v∈R and m,n∈N.

  • (a) um+n=umun.
  • (b) (um)n=umn.
  • (c) (uv)n=unvn.
  • (d) If u∈Z, then un∈Z; if u∈N, then un∈N.
  • (e) If u>0, then un>0. If u>1 and m<n, then um<un.

Idea. Each part is an induction on n from 0, with m fixed. The base case is u0=1 in some form, and the step peels one factor off with un+1=unu and applies the induction hypothesis to un. For the second half of (e), write n=m+j with j≥1 and use (a).

Proof.

  • (a) Fix m and induct on n. For n=0: um+0=um=um⋅1=umu0. Suppose um+n=umun. Since m+n∈N (Lemma 2.1.1 (b)), Definition 2.3.2 applies at m+n, and um+(n+1)=u(m+n)+1=um+nu=umunu=umun+1, where the third equation is the induction hypothesis and the last is Definition 2.3.2. By Logic and Proof, Axiom 4.2.1, (a) holds for every n.

  • (b) Fix m. For n=0: (um)0=1=u0=um⋅0. If (um)n=umn, then (um)n+1=(um)num=umnum=umn+m=um(n+1), using (a) with the exponents mn,m∈N (Lemma 2.1.1 (b)).

  • (c) (uv)0=1=1⋅1=u0v0. If (uv)n=unvn, then (uv)n+1=(uv)nuv=unvnuv=(unu)(vnv)=un+1vn+1.

  • (d) u0=1=0+1 lies in N by (( )0) and (NS), and N⊆Z. If un∈Z and u∈Z, then un+1=unu∈Z by Proposition 2.1.2 (a). For u∈N the same induction works with Lemma 2.1.1 (b) in place of Proposition 2.1.2.

  • (e) Let u>0. Then u0=1>0, and if un>0, then un+1=unu>0 as a product of positive numbers. Now let u>1. First, uj>1 for every integer j≥1 (such j lies in N by Proposition 2.1.2 (b), so uj is defined), by Theorem 2.2.1 with base 1: u1=u>1, and if uj>1, then uj+1=uju>1⋅u>1, multiplying uj>1 by u>0. Let m<n. Then j:=n−m∈N by Lemma 2.1.1 (d), and j≠0, so j≥1 by Lemma 2.1.1 (a). By (a), un=um+j=umuj>um, multiplying uj>1 by um>0.

Some instances that earlier chapters used on trust: (t2)2=t4 is (b) with m=n=2; 2s+t=2s2t is (a); n↦2n is strictly increasing on N by (e); and an integer power of an integer is an integer by (d). For (−1)n: by (b), (−1)2k=((−1)2)k=1k=1, where 1k=1 by the induction 1k+1=1k⋅1; and (−1)2k+1=(−1)2k(−1)=−1. Every n∈N is 2k+r with k∈Z and r∈{0,1} (Theorem 2.2.3 with divisor 2, and Proposition 2.1.2 (c) for r≤1), and k≥0: if k<0, then k≤−1 (Proposition 2.1.2 (c)), so n=2k+r≤−2+1<0, contradicting n≥0 (Lemma 2.1.1 (a)). So k∈N by Proposition 2.1.2 (b), n is 2k or 2k+1, and (−1)n is 1 for even n and −1 for odd n.

The next two formulas are proved the same way; each is a recursion (the sum) followed by an induction whose step splits off the last term.

Proposition 2.3.5 (Sum of the First Natural Numbers)

For every n∈N, ∑k=1nk=n(n+1)2.

Proof. For n=0, both sides are 0: the left by the empty sum, the right since 0⋅1=0. If the formula holds for n, then by Definition 2.3.1 ∑k=1n+1k=n(n+1)2+(n+1)=(n+1)(n+2)2, which is the formula for n+1. By Logic and Proof, Axiom 4.2.1 it holds for every n∈N.

Proposition 2.3.6 (Geometric Sum)

Let r∈R with r≠1. For every n∈N, ∑k=1nrk−1=1−rn1−r.

Proof. The terms are defined: for k≥1, k−1∈N by Lemma 2.1.1 (c), so rk−1 is given by Definition 2.3.2, and the term added at stage n+1 is r(n+1)−1=rn. The right side is defined because 1−r≠0. For n=0, both sides are 0, since r0=1. If the formula holds for n, then, by Definition 2.3.1 and the induction hypothesis, ∑k=1n+1rk−1=1−rn1−r+rn=1−rn+rn−rn+11−r=1−rn+11−r, where rn(1−r)=rn−rn+1 by Definition 2.3.2. By Logic and Proof, Axiom 4.2.1 the formula holds for every n∈N.

For r=1 the sum is n, since every term is 1; that is the case the hypothesis excludes, where the right side would divide by 0.

The next inequality is the most used estimate of a power in analysis. Its proof shows a hypothesis doing exactly one job.

Theorem 2.3.7 (Bernoulli’s Inequality)

Let x∈R with x≥−1. Then (1+x)n≥1+nx for every n∈N.

Idea. Induct on n. To pass from n to n+1, multiply the induction hypothesis by 1+x; the product (1+nx)(1+x)=1+(n+1)x+nx2 is at least 1+(n+1)x, because the extra term nx2 is non-negative. Multiplying an inequality by 1+x keeps its direction only if 1+x≥0, and that is what x≥−1 says. (This is the method of Example (Method: finding P(n) inside P(n+1)): (1+x)n is the first factor of (1+x)n+1.)

Proof. For n=0: (1+x)0=1≥1=1+0⋅x. Suppose (1+x)n≥1+nx. Since x≥−1, we have 1+x≥0, and multiplying the induction hypothesis by 1+x gives (1+x)n+1=(1+x)n(1+x)≥(1+nx)(1+x)=1+(n+1)x+nx2≥1+(n+1)x, where the first equation is Definition 2.3.2 and the last step uses nx2≥0, true because n≥0 (Lemma 2.1.1 (a)) and x2≥0. By Logic and Proof, Axiom 4.2.1 the inequality holds for every n∈N.

The hypothesis x≥−1 appears in the proof once, in the sentence “since x≥−1, we have 1+x≥0”, and it cannot simply be dropped: for x=−4 and n=3, (1+x)3=(−3)3=−27, while 1+3x=−11, and −27<−11. Exercise C2 below shows that the statement can survive at some x<−1 even though the proof does not.

Quick check. Check Bernoulli’s inequality at x=−12, n=3, and say which line of the proof uses x≥−1.

Solution. (1−12)3=18, and 1+3⋅(−12)=−12; indeed 18≥−12. The hypothesis is used in the line “since x≥−1, we have 1+x≥0”: multiplying the induction hypothesis by 1+x keeps the direction of the inequality only because 1+x≥0.

The last result of this subsection is not about a recursive definition, but its induction runs over lists, and it is the fact Analysis on the Real Line, Chapter 1 needs about finite sets. A maximum of a set A⊆R is a greatest element of A in the sense of Section 2.1, and a minimum is a least element. For reals x1,…,xn, we write {x1,…,xn}:={xk:k∈{1,…,n}}.

Proposition 2.3.8 (Finite Sets Have a Maximum)

For every integer n≥1 and all reals x1,…,xn, the set {x1,…,xn} has a maximum and a minimum.

Idea. Add the elements one at a time. The maximum of the longer list is the old maximum or the new element, whichever is larger, and comparing the two is all the step needs.

Proof. Let P(n) be “for all reals x1,…,xn, the set {x1,…,xn} has a maximum”. We prove P(n) for every n≥1 by Theorem 2.2.1 with base 1.

Base case. {x1} has the maximum x1.

Inductive step. Let n≥1, suppose P(n), and let x1,…,xn+1 be reals. Since {1,…,n+1}={1,…,n}∪{n+1} (Lemma 2.1.1 (e), as in the proof of Theorem 2.3.1), the set B:={x1,…,xn+1} is A∪{xn+1}, where A:={x1,…,xn}. By P(n), applied to the list x1,…,xn, the set A has a maximum M. By trichotomy, xn+1≤M or M<xn+1.

Case 1: xn+1≤M. Then M∈A⊆B, and every element of B is an element a∈A, with a≤M, or is xn+1≤M. So M is a maximum of B.

Case 2: M<xn+1. Then xn+1∈B, and every a∈A satisfies a≤M<xn+1. So xn+1 is a maximum of B.

In both cases P(n+1) holds. By Theorem 2.2.1, P(n) holds for every n≥1.

For the minimum, apply the result to −x1,…,−xn: if −xj is a maximum of {−x1,…,−xn}, then −xk≤−xj, that is xj≤xk, for every k, so xj is a minimum of {x1,…,xn}.

The base is 1, not 0: for n=0 the set is ∅, which has neither a maximum nor a minimum, since both must be elements. The proof used only order properties of ≤: any two elements are comparable (trichotomy), ≤ is reflexive and transitive, and x↦−x reverses ≤. All of these hold in any ordered field, so the proof works word for word there; that is the setting in which Analysis on the Real Line, Chapter 1 uses it. Passing from a finite set to a list x1,…,xn that enumerates it is what “finite” means in Section 2.5.

2.3.5. When the claim is too weak to carry its step

Sometimes the statement we want is true, but it cannot be proved by induction as it stands: its inductive step does not go through. The cure looks paradoxical. We prove more. Logic and Proof met this cure (Logic and Proof, Example (Prove more to prove less)) with a sum that telescopes, where the stronger claim was an exact formula; here the sum has no closed form, and the stronger claim is an inequality with a margin.

Example (Proving more to prove anything)

Prove that ∑k=1n1k2<2 for every integer n≥1.

Solution. The direct attempt fails. Let Sn:=∑k=1n1/k2, so Sn+1=Sn+1/(n+1)2 by Definition 2.3.1. The base S1=1<2 holds. For the step, all we may assume is Sn<2, and that is too little: it allows Sn=2−12(n+1)2, and then Sn+1(n+1)2>2. The values of Sn never come so close to 2, but the induction hypothesis cannot know that.

Prove more. We prove P(n): “Sn≤2−1n” for every n≥1, by Theorem 2.2.1 with base 1. It implies the claim, since 2−1n<2.

Base case. S1=1=2−11.

Inductive step. Let n≥1 and suppose Sn≤2−1n. Then Sn+1=Sn+1(n+1)2≤2−1n+1(n+1)2. It remains to show −1n+1(n+1)2≤−1n+1, that is, 1(n+1)2≤1n−1n+1=1n(n+1). Both denominators are positive, and n(n+1)≤(n+1)2 because n≤n+1 and n+1>0; so the inequality holds. Hence Sn+1≤2−1n+1, which is P(n+1).

By Theorem 2.2.1, Sn≤2−1n<2 for every n≥1.

The stronger statement carries its own step because its hypothesis says how far below 2 the sum is, and that margin pays for the next term. When a step fails, ask what the hypothesis would need to say, and prove that instead. Exercise C3 below uses it twice over, proving two identities together because neither carries its own one-step induction.

Quick check. Would “Sn≤2−1n+1” also carry its own step?

Solution. No, although the statement is true (it is weaker than Sn≤2−1n). The hypothesis allows Sn=2−1n+1, and then Sn+1=2−1n+1+1(n+1)2>2−1n+2, because 1(n+1)2>1(n+1)(n+2)=1n+1−1n+2 (as (n+1)2<(n+1)(n+2)). A stronger claim works only if its margin pays for the next term; this margin is too small.

2.3.6. Exercises

A. Check your understanding

Exercise (A1)

These questions are about the proof of Theorem 2.3.1.

  • (a) Why does uniqueness need only an induction, while existence needs the claim about partial solutions?
  • (b) In Step 3, which property of the graphs Gn makes ⋃S satisfy (Fn2), and which part of the proof supplies it?
  • (c) Run the construction for X=R, a=1 and g(n,x)=(n+1)x: write the graphs G0, G1, G2. Which familiar function is f?
  • (d) State the idea of the proof in two sentences.
  • (e) Write ∑k=1nak and n! as instances of Theorem 2.3.1: name X, a and g for each.

Solution.

  • (a) Uniqueness is a statement about two functions that are given: it compares their values, and comparing values at n+1 through the values at n is an induction. Existence asks for a function that is not given. Induction proves statements and does not build objects, so the proof proves a statement (the claim) whose content is that the finite pieces exist and are unique, and then builds f from them as a union.

  • (b) The graphs agree where they overlap: Gm⊆Gn for m≤n, more precisely Gm=Gn∩({0,…,m}×X). This comes from the uniqueness half of the claim: the restriction of fn to {0,…,m} is a partial solution up to m, so it is fm. With it, two pairs (k,y)∈Gm and (k,y′)∈Gn lie in the larger graph, whose (Fn2) gives y=y′. So it verifies (Fn2) of Definition 1.5.1 for ⋃S.

  • (c) G0={(0,1)}. Then g(0,1)=1⋅1=1, so G1={(0,1),(1,1)}. Then g(1,1)=2⋅1=2, so G2={(0,1),(1,1),(2,2)}. The function f is n↦n!: by Definition 2.3.1, 0!=1 and (n+1)!=n!(n+1)=g(n,n!), so n↦n! satisfies both equations, and by the uniqueness in Theorem 2.3.1 it is f.

  • (d) For each n, induction shows that there is exactly one function on {0,…,n} obeying the equations, and these pieces extend one another. Their union is the required function, and an induction on n shows there is no other.

  • (e) The sum: X=R, a=0, g(n,x)=x+an+1. The factorial: X=R (or N), a=1, g(n,x)=(n+1)x, as in (c).

B. Practice

Exercise (B1: Sum of cubes)

Prove that ∑k=1nk3=(n(n+1)2)2 for every n∈N.

Solution. For n=0, both sides are 0 (the empty sum, and 02=0). Suppose the formula holds for n. By Definition 2.3.1 and the induction hypothesis, ∑k=1n+1k3=n2(n+1)24+(n+1)3=(n+1)2n2+4n+44=(n+1)2(n+2)24=((n+1)(n+2)2)2, which is the formula for n+1. By Logic and Proof, Axiom 4.2.1 the formula holds for every n∈N. (Compare Proposition 2.3.5: the sum of the first n cubes is the square of the sum of the first n numbers.)

Exercise (B2: Starting at the right place)

Logic and Proof, Chapter 4 observed, in the warning after Logic and Proof, Example (An inequality by induction), that “2n≥n2” fails at n=3 and holds again from n=4 on. Prove that 2n≥n2 for every integer n≥4, using Theorem 2.2.1. Say why the base must be 4 and not 3.

Solution. Let P(n) be “2n≥n2”; we use Theorem 2.2.1 with n0=4.

Base case. 24=16≥16=42.

Inductive step. Let n≥4 and suppose 2n≥n2. Then 2n+1=2⋅2n≥2n2 by Definition 2.3.2 and the hypothesis. Moreover 2n2≥(n+1)2, because 2n2−(n+1)2=n2−2n−1=(n−1)2−2, and (n−1)2≥9>2 for n≥4. Hence 2n+1≥(n+1)2.

By Theorem 2.2.1, 2n≥n2 for every n≥4.

The base cannot be 3, because P(3) is false: 23=8<9=32. The step is valid from n=3 on, since (n−1)2−2≥2 for n≥3, but it is useless at 3, where its hypothesis is false. At n=2 the step fails ((2−1)2−2=−1), which is why the true P(2) does not lead to P(3).

Exercise (B3: A closed form)

The sequence a0:=0, an+1:=2an+1 is defined by Theorem 2.3.1. Compute its first five values, guess a formula for an, and prove it.

Solution. The values are 0,1,3,7,15: one less than 1,2,4,8,16. We prove an=2n−1 for every n∈N. For n=0: a0=0=20−1. If an=2n−1, then an+1=2(2n−1)+1=2n+1−1, using 2⋅2n=2n+1 (Definition 2.3.2). By Logic and Proof, Axiom 4.2.1, an=2n−1 for every n∈N. The induction follows the two clauses of the definition: the base case is the starting value, the step is the rule.

C. Going deeper

Exercise (C1: Powers of two)

Prove that every n∈Z>0 can be written as 2kq with k∈N and q odd (that is, q=2j+1 for an integer j). Below, the proof is started; the second half is blank. Name the move, then complete it.

Suppose not. Then the set F of n∈Z>0 that cannot be written in this form is non-empty, and F⊆N; let m be its least element. Then m≥1, and m is not odd, since otherwise m=20m would be of the required form. ―

Why is the statement made for n≥1 only?

Solution. The move is the smallest counterexample of Section 2.2: suppose the claim fails, take the least failure by well-ordering (Theorem 2.1.3), and produce a smaller failure.

Completion. By Theorem 2.2.3 with divisor 2, every integer is even or odd; m is not odd, so m=2m′ for an integer m′. Since m>0, m′=m/2>0, so m′∈Z>0 (Proposition 2.1.2 (b)), and m′<2m′=m. As m is the least element of F, m′∉F, so m′=2kq with k∈N and q odd. Then m=2⋅2kq=2k+1q by Definition 2.3.2, and k+1∈N by (NS). So m has the required form, contradicting m∈F. Hence F=∅, and every n∈Z>0 is 2kq with q odd.

The restriction to n≥1 is needed: 0=2kq forces q=0, since 2k>0 (Proposition 2.3.4 (e)), and 0=2⋅0 is even, not odd (Theorem 2.2.3: not both). So 0 is a genuine counterexample, and in the proof it is excluded by taking m∈Z>0, which is what makes m′>0.

Marking scheme. (10 points) - 2: names the move (smallest counterexample) and says that the least element m exists by well-ordering (Theorem 2.1.3). - 2: from “m is not odd” concludes m=2m′ with m′∈Z, citing even-or-odd. - 3: shows m′∈Z>0 and m′<m, so m′∉F. - 2: writes m=2k+1q with k+1∈N and reaches the contradiction. - 1: explains why n=0 is excluded. Fatal errors (0 for the step): concluding m′∉F (or applying the induction hypothesis to m′) without having shown both m′<m and m′≥1; missing either one is fatal. A reader who restarts by Theorem 2.2.2 with base 1 earns the points for the other steps (the induction hypothesis at m′ replaces “m′∉F”), but not the 2 points for naming the move.

Exercise (C2: Bernoulli beyond its hypothesis)
  • (a) Show that (1+x)n≥1+nx holds for x=−2 and every n∈N.
  • (b) Say which line of the proof of Theorem 2.3.7 fails at x=−2, and why the statement survives anyway.
  • (c) At x=−4, find the first n where the inequality fails, and the first n where the step “P(n)⇒P(n+1)” fails.

Solution.

  • (a) At x=−2 the claim is (−1)n≥1−2n. By the remark after Proposition 2.3.4, (−1)n is 1 or −1. For n=0 the claim reads 1≥1. For n≥1, 1−2n≤−1≤(−1)n.

  • (b) The line “multiplying the induction hypothesis by 1+x” fails. At x=−2 the multiplier is 1+x=−1<0, and multiplying (1+x)n≥1+nx by a negative number reverses it: we get (1+x)n+1≤(1+nx)(1+x), the wrong direction. The rest of the proof (nx2≥0) still holds. The statement survives because (a) proves it by a different argument, which uses the special values (−1)n=±1. A proof that fails does not make its conclusion false.

  • (c) At x=−4: n=0 gives 1≥1; n=1 gives −3≥−3; n=2 gives 9≥−7; n=3 gives −27≥−11, false. So the first failure is n=3. The step P(n)⇒P(n+1) holds for n=0 and n=1 (both sides are true) and fails at n=2, where P(2) is true and P(3) false.

Exercise (C3: Two identities at once)

Use Corollary 2.3.3 to define the sequence F0:=0, F1:=1, Fn+2:=Fn+1+Fn; name X, a, b and h. Then prove, for every n∈N, the statement P(n): F2n+1=Fn2+Fn+12andF2n+2=Fn+1(Fn+Fn+2). Check P(0), P(1) and P(2) numerically first.

Solution (Hint 1). Neither identity carries its own one-step inductive step: passing from F2n+1 to F2n+3 needs F2n+2, which is the other identity. Prove both together, and use Fn+Fn+1=Fn+2 to merge terms.

Solution (Hint 2). In the step, start with F2n+3=F2n+2+F2n+1 and substitute both halves of P(n).

Solution. The definition. Corollary 2.3.3 with X=R, a=0, b=1 and h(n,x,y)=x+y gives exactly one sequence with F0=0, F1=1 and Fn+2=Fn+Fn+1. Its first values are 0,1,1,2,3,5,8.

Small cases. P(0): F1=1=02+12 and F2=1=1⋅(0+1). P(1): F3=2=12+12 and F4=3=1⋅(1+2). P(2): F5=5=12+22 and F6=8=2⋅(1+3).

Proof. We use Logic and Proof, Axiom 4.2.1. P(0) was checked. Suppose P(n). Using the recursion and then both halves of P(n), F2n+3=F2n+2+F2n+1=Fn+1Fn+Fn+1Fn+2+Fn2+Fn+12=Fn(Fn+Fn+1)+Fn+1Fn+2+Fn+12=Fn+2(Fn+Fn+1)+Fn+12=Fn+22+Fn+12, where the last two lines use Fn+Fn+1=Fn+2 twice. This is the first half of P(n+1). For the second half, F2n+4=F2n+3+F2n+2=Fn+12+Fn+22+Fn+1Fn+Fn+1Fn+2=Fn+1(Fn+1+Fn)+Fn+22+Fn+1Fn+2=Fn+2(2Fn+1+Fn+2)=Fn+2(Fn+1+Fn+3), using the first half of P(n+1) just proved, the second half of P(n), Fn+1+Fn=Fn+2, and finally Fn+1+Fn+2=Fn+3. So P(n+1) holds, and by Logic and Proof, Axiom 4.2.1 P(n) holds for every n∈N.

The second identity is written with Fn+2 rather than in the form F2n=Fn(Fn−1+Fn+1), so that both identities make sense on all of N and no F−1 is needed. The two identities hold together, and together they carry a one-step induction that neither carries alone: this is “prove more” (Example (Proving more to prove anything)) in the form of a pair, as in the two-step example after Definition 2.3.2. (A two-step induction can prove the first identity alone; see the marking scheme.)

Marking scheme. (10 points) - 2: defines the sequence by Corollary 2.3.3, naming X, a, b and h. - 1: checks the base case P(0), both halves. - 3: proves the first identity at n+1 (or for all n): F2n+3=Fn+12+Fn+22. - 3: proves the second identity at n+1 (or for all n): F2n+4=Fn+2(Fn+1+Fn+3). - 1: concludes by induction (one-step or two-step), with a hypothesis that covers every value the step uses. Alternative route: 3 for proving F2n+1=Fn2+Fn+12 alone by a two-step induction (via Fk+2=3Fk−Fk−2 for k≥2 and the matching recursion for Fn2+Fn+12, with both bases n=0,1 checked), and 3 for deriving the second identity as F2n+2=F2n+3−F2n+1=Fn+22−Fn2=Fn+1(Fn+Fn+2). Fatal errors (0 for the step): inducting on one identity alone while using the other at n unproved; using the identities at n+1 to prove themselves.