4.2 Convergence, completeness and the contraction mapping theorem
A space is complete when every sequence whose terms bunch together has a limit in the space. A map that shrinks every distance by a fixed factor below 1, run again and again in a complete space, always settles on exactly one fixed point. That is how cos x = x, Newton's method, PageRank and reinforcement-learning value iteration all work.
Beyond the courseRudin, Principles of Mathematical Analysis, ch. 3 (Cauchy sequences), ch. 7 (uniform convergence) and ch. 9 (contraction principle)Abbott, Understanding Analysis, ch. 2 and ch. 6Banach, Fundamenta Mathematicae 3 (1922), pp. 133 to 181
Chapter 1.2 ended on a fact about the real line: a sequence of real numbers converges if and only if its terms bunch together (the Cauchy criterion). The fact is what lets us prove a limit exists without knowing its value. Does it hold in other metric spaces? In Q it fails, and in the space of continuous functions it holds. The spaces where it holds are called complete, and they are where equations get solved. The method is to start with any guess, improve it by a rule that brings every pair of points closer together by a fixed factor, and let the sequence of guesses run. The guesses bunch, completeness gives them somewhere to land, and the landing point solves the equation.
Quick checkWhich sequence of rational numbers has terms that bunch together (is Cauchy) but has no limit in Q?
The terms agree to more and more decimal places, so they bunch together. Their limit in R is 2, which is not rational. The other two sequences are not Cauchy: the terms of the second drift apart and the third keeps jumping by 2.Review: the Cauchy criterion
Quick checkIn the sup metric on C[0,1], what does d(f,g)<0.1 say about the graphs?
The sup metric is the largest vertical gap. A largest gap below 0.1 means every vertical gap is below 0.1. Areas and single points are different ways to measure closeness.Review: the sup metric
Quick checkFor 0≤q<1, what is 1+q+q2+q3+⋯?
This is the geometric series of 1.6. We will meet it again as the total length of the steps of an iteration that shrinks by the factor q at each step.Review: the geometric series
The picture: the staircase that closes in
We want a number x with cosx=x. Nobody has a formula, but here is a method: start anywhere, press the cosine key on a calculator, and press it again on the answer, over and over. The picture shows what happens. The curve is y=cosx and the dashed line is y=x. A solution is a point where they cross. Going up or down from the dashed line to the curve applies the map. Going sideways back to the dashed line copies the output into the next input. The red and green segments form a staircase (a cobweb) that closes in on the crossing point. Three things to do:
Run the cosine preset from several starting points. The staircase always lands on the same point, x∗≈0.7390851.
Switch to “Newton for x² − 2”. The curve is almost flat where it crosses the line, and the path lands on 2 in two or three rounds.
Switch to “−1.5x + 1.25”. There is still a crossing, but the staircase spirals outward. The map pushes points apart instead of together. The difference between the two behaviours is whether the slope at the crossing has size below 1.
n
xn
error ∣xn−x∗∣
0
1
0.2609
1
0.5403
0.1988
2
0.8576
0.1185
3
0.6543
0.0848
5
0.7014
0.0377
10
0.7442
0.0052
The error drops by a factor of about 0.67 per step, which is the size of the slope of the cosine curve at the crossing, ∣sin0.739∣≈0.674.
Where this came from· Picard's iteration, Banach's abstraction
Émile Picard’s memoir of 1890 on partial differential equations used the method of successive approximations: to solve an equation, start from a guess, plug it into the right-hand side to get a better guess, and repeat. In 1893 he applied the same method to ordinary differential equations and showed that the guesses converge. Stefan Banach’s doctoral work in Lwów (written around 1920, published in 1922 in Fundamenta Mathematicae, volume 3, under the title Sur les opérations dans les ensembles abstraits et leur application aux équations intégrales) set the idea in abstract spaces and proved the fixed point theorem of this chapter. The abstract version isolates exactly what the iteration needs: a space where bunching sequences have limits, and a map that shrinks every distance by a fixed factor. Picard’s theorem for differential equations and the theorems for integral equations became applications of one result, which is why it carries Banach’s name.
The idea, in words
Three ideas, each one a line in the picture.
Why· Convergence, completeness, contraction
Convergence in a metric space is the game of 1.2 with the distance d in place of ∣x−y∣: xn→x means d(xn,x) goes to 0.
Completeness says there are no holes. If the terms of a sequence bunch together, there is a point at the place where they are bunching. R has this; Q does not (the truncations of 2 bunch at a hole), and neither does (0,1] (the sequence n1 bunches at 0, which is not in the space).
A contraction is a map T with d(Tx,Ty)≤qd(x,y) for a fixed q<1: it brings every pair of points closer together by the same factor. Applying it again and again, the steps d(xn+1,xn) shrink geometrically, so their sum is finite and the sequence bunches. Completeness provides the limit, and the limit is fixed by T because T is continuous. Two different fixed points are impossible, because a contraction would bring them closer together, yet each stays put.
Definitions and theorems: convergence
Definition B
Convergent sequence in a metric space
Let (xn) be a sequence of points in a metric space (X,d). It converges to x∈X, written xn→x, if
∀ε>0∃N∀n>N:d(xn,x)<ε.
Equivalently, every open ball B(x,ε) contains all but finitely many terms. For X=R with d=∣x−y∣ this is the definition of 1.2.
In one linexn→x if the distance d(xn,x) tends to 0: for every ε>0, all terms after some index lie in the ball B(x,ε).
Why it existsIt is the ε-N game of 1.2 with the distance of the space in place of ∣an−L∣, so every theorem about limits can be re-proved with only (M1) to (M3).
Theorem BRudin ch. 3; Abbott Sec. 2.2
Limits in a metric space are unique
If xn→x and xn→y in a metric space, then x=y.
In one lineA sequence in a metric space converges to at most one point.
Why it is trueGive each limit half the budget: eventually the terms are within ε/2 of both, so the two limits are within ε of each other, and (M1) turns 'within every ε' into 'equal'.
ProofAbbott Sec. 2.2
The idea: The same ε/2 proof as in 1.2, using only (M1) to (M3).
Let ε>0.
Arbitrary tolerance.
Choose N with d(xn,x)<2ε and d(xn,y)<2ε for n>N.
Convergence to x and to y, each with tolerance ε/2; take the later of the two starting indices.
For such n: d(x,y)≤d(x,xn)+d(xn,y)<ε.
(M3) through xn, and (M2) to turn d(x,xn) into d(xn,x).
So d(x,y)=0 and x=y. ■
A non-negative number below every positive ε is 0, and (M1): d(x,y)=0 means x=y.
Theorem Bstandard; Apostol Sec. 8.4
Convergence in R^n is coordinatewise
Let x(k)=(x1(k),…,xn(k))∈Rn and x=(x1,…,xn). Then x(k)→x in d1, or in d2, or in d∞, if and only if xi(k)→xi for every i.
In one lineA sequence of vectors converges in Rn (for any of the 1-, 2- or max-distances) if and only if each coordinate converges as a sequence of real numbers.
Why it is trueBy the comparison theorem of 4.1 the three norms are within factors of n of each other and of the size of any single coordinate, so 'the vector is within ε' and 'every coordinate is within about ε' are the same statement.
Proofstandard
The idea: Sandwich each coordinate gap between norms: one coordinate is at most the max-norm, which is at most the 2-norm, at most the 1-norm; and the 1-norm is at most n times the max-norm.
For every i: ∣xi(k)−xi∣≤∥x(k)−x∥∞≤∥x(k)−x∥2≤∥x(k)−x∥1.
By the comparison theorem of 4.1 (the 1-, 2- and max-norms), applied to the vector x(k)−x.
(⇒) If x(k)→x in one of the three distances, every coordinate converges.
Each coordinate gap is at most each of the three norms, by the chain. If one of those three tends to 0 (whichever distance we assumed), the coordinate gap, which is non-negative and below it, is squeezed to 0.
(⇐) Let ε>0. There is N with ∣xi(k)−xi∣<nε for all i and all k>N.
Each coordinate converges, so each has its own starting index for tolerance ε/n; take the largest of the n indices.
So ∥x(k)−x∥∞≤∥x(k)−x∥2≤∥x(k)−x∥1<ε. All three distances are below ε. ■
For such k, ∥x(k)−x∥∞<nε. Then ∥⋅∥1≤n∥⋅∥∞ from 4.1, and ∥⋅∥∞≤∥⋅∥2≤∥⋅∥1.
Theorem BRudin ch. 7; Abbott Sec. 6.2
Convergence in the sup metric is uniform convergence
Let fn,f∈C[a,b]. Then fn→f in the sup metric if and only if fn→f uniformly on [a,b].
In one lineFor continuous fn and f on [a,b]: d∞(fn,f)→0 if and only if fn→f uniformly on [a,b].
Why it is trueThe sup metric is the largest vertical gap, and 'the largest gap is below ε' says the same as 'every gap is below ε'. The N that works for all x at once is the N that makes the largest gap small.
ProofAbbott Sec. 6.2
The idea: Unpack both definitions side by side. They differ only by 'max of the gap is below ε' versus 'every gap is below ε', and these are equivalent because the maximum is one of the gaps.
Sup metric: ∀ε∃N∀n>N:maxx∈[a,b]∣fn(x)−f(x)∣<ε.
The definition of convergence in a metric space, with d∞(fn,f)=maxx∣fn(x)−f(x)∣.
Uniform: ∀ε∃N∀n>N∀x∈[a,b]:∣fn(x)−f(x)∣<ε.
The definition of uniform convergence in 1.6: one N for all x at once.
So the first implies the second for the same N.
If the maximum of the gaps is below ε, every gap is, since each is at most the maximum.
If every gap is below ε, the maximum is a gap, so it is below ε. Hence the second implies the first. ■
The maximum is attained at some point (extreme value theorem, 1.3), and at that point the gap is below ε.
In the picture of 1.6, the open ball B(f,ε) in the sup metric is the tube of half-height ε around the graph of f: a function g is in the ball exactly when its whole graph fits in the tube. Convergence in the sup metric is the graphs fn fitting into every tube eventually.
Theorem BRudin ch. 3; Abbott Sec. 3.2
Closed sets and limits of sequences
In a metric space: (a) x∈A iff there are points an∈A with an→x. (b) A is closed iff (an∈A and an→x imply x∈A).
In one lineA point lies in the closure of A if and only if some sequence in A converges to it. Hence A is closed if and only if the limit of every convergent sequence of points of A lies in A.
Why it is trueA point in the closure has a point of A in each ball B(x,n1), and those points converge to x; conversely a sequence in A tending to x puts points of A in every ball around x.
ProofAbbott Sec. 3.2
The idea: (a) Choose a_n in the ball of radius 1/n, for the forward direction; use a ball containing late terms for the backward. (b) A closed iff A equals its closure, and (a) describes the closure.
(a, ⇒) Let x∈A. For each n, pick an∈A∩B(x,n1).
By the definition of the closure in 4.1, every ball around x meets A.
Then an→x.
d(an,x)<n1→0.
(a, ⇐) If an∈A and an→x, every ball B(x,r) contains some an∈A, so x∈A.
Convergence: given r>0, all late terms are in B(x,r), and they are points of A.
(b) A is closed iff A⊆A iff every limit of a sequence in A is in A, by (a). ■
The theorem on interior, closure and boundary in 4.1, part (b): A is closed iff A=A, and always A⊆A.
Definitions and theorems: Cauchy sequences and completeness
Definition B
Cauchy sequence in a metric space
A sequence (xn) in a metric space is Cauchy if ∀ε>0∃N∀m,n>N:d(xm,xn)<ε. (For R this is the Cauchy sequence of 1.2.)
In one lineA sequence whose terms eventually stay close to each other: for every ε>0 there is N with d(xm,xn)<ε for all m,n>N.
Why it existsIt describes bunching without naming a limit, so we can prove a limit exists when we cannot find it.
Theorem BRudin Thm 3.11(a)
Convergent sequences are Cauchy
Every convergent sequence in a metric space is a Cauchy sequence.
In one lineIf xn→x in a metric space, then (xn) is Cauchy.
Why it is trueTerms close to x are close to each other: split d(xm,xn) through x with ε/2 each.
ProofRudin 3.11
The idea: Triangle inequality through the limit.
Let ε>0 and choose N with d(xn,x)<2ε for n>N.
Arbitrary tolerance, and half of it for each term.
For m,n>N: d(xm,xn)≤d(xm,x)+d(x,xn)<2ε+2ε=ε. ■
(M3) and (M2).
The converse is what fails in some spaces and holds in others, and that difference is the next definition.
Definition B
Complete metric space
A metric space X is complete if every Cauchy sequence in X converges to a point of X.
In one lineA metric space in which every Cauchy sequence converges to a point of the space.
Why it existsIt is the 'no holes' property. It lets us construct solutions as limits of approximations without knowing the solution in advance.
Worked example
Decide whether each space is complete: R, Q, (0,1], [0,1], and a set with the discrete metric.
Solution.
R is complete. Every Cauchy sequence of reals converges. That is the Cauchy criterion of 1.2, which rests on the completeness axiom of 1.1.
Q is not. The truncations 1,1.4,1.41,1.414,… of 2 are rational and Cauchy, but their only limit in R is 2∈/Q, and limits are unique. The Cauchy sequence bunches at a hole of Q, which we know by uniqueness of limits.
(0,1] is not. The sequence xn=n1 is Cauchy (it converges in R), but its limit 0 is not in (0,1]. The point missing from the space is the endpoint 0. No point of (0,1] can serve as a limit, since the limit in R is unique.
[0,1] is complete. A Cauchy sequence in [0,1] converges in R to some x, and 0≤xn≤1 passes to the limit, so x∈[0,1]. Closed subsets keep their limits. This is the idea of the theorem on closed subsets below.
A set with the discrete metric is complete. For ε=21, d(xm,xn)<21 forces d(xm,xn)=0, that is, xm=xn, for all m,n>N. So a Cauchy sequence is constant from some point, and it converges to that constant. The metric takes only the values 0 and 1, so “close” means “equal”.
Answer. Complete: R, [0,1], discrete spaces. Not complete: Q, (0,1]. ■
Quick checkWhich of these is a complete metric space with the usual distance ∣x−y∣?
(0,1] misses 0, where n1 bunches. Q∩[0,1] misses the irrational points where rational sequences bunch (such as 22). [0,1] is closed in R and contains all its limits.
Theorem BRudin Thm 3.11(c); Apostol Sec. 8.4
R^n is complete
Every Cauchy sequence in Rn (with d1, d2 or d∞) converges.
In one lineRn with the 1-, 2- or max-distance is complete.
Why it is trueA Cauchy sequence of vectors has Cauchy coordinates, each coordinate sequence converges in the complete line R, and convergence is coordinatewise.
ProofRudin 3.11
The idea: Cauchy in the vector implies Cauchy in each coordinate (a coordinate gap is at most the norm), so each coordinate converges by completeness of R, and then the vector converges by the coordinatewise theorem.
Let (x(k)) be Cauchy. Then, for each coordinate i, the real sequence (xi(k))k is Cauchy.
The first link of the chain in the coordinatewise proof: ∣xi(k)−xi(l)∣≤∥x(k)−x(l)∥∞≤∥x(k)−x(l)∥2≤∥x(k)−x(l)∥1.
So xi(k)→xi for some real number xi, for each i.
R is complete (1.2).
Put x=(x1,…,xn). Then x(k)→x in the vector distance. ■
The theorem that convergence in R^n is coordinatewise, proved above.
The space of continuous functions is complete
This is the theorem where 1.6 and this unit meet. A Cauchy sequence of continuous functions is a sequence of graphs that bunch together in the tube sense. We must produce a limit function that is itself continuous.
Theorem BRudin ch. 7; Abbott Sec. 6.2
C[a, b] with the sup metric is complete
The metric space C[a,b] with d∞(f,g)=max[a,b]∣f−g∣ is complete.
In one lineEvery Cauchy sequence of continuous functions on [a,b], in the sup metric, converges uniformly to a continuous function.
Why it is trueFix x: the numbers fn(x) are a Cauchy sequence of reals, so they converge. That defines a limit function. The Cauchy condition gives the same N for every x, so the convergence is uniform, and a uniform limit of continuous functions is continuous.
ProofRudin ch. 7
The idea: Build the limit function point by point using completeness of R, show the convergence is uniform because the Cauchy N does not depend on x, and then show the limit is continuous with the 3-epsilon argument (the theorem of 1.6, written out again here).
Let (fn) be a Cauchy sequence in C[a,b] for d∞.
By hypothesis: ∀ε∃N∀m,n>N:maxx∣fn(x)−fm(x)∣<ε.
Fix x∈[a,b]. The real sequence (fn(x))n is Cauchy.
For one fixed x, ∣fn(x)−fm(x)∣≤d∞(fn,fm), because the maximum is at least the value at x.Where the idea comes from: evaluate at a point, and the sup metric becomes a plain distance in R.
So it converges. Define f(x)=limnfn(x) for each x∈[a,b]. This is the pointwise limit, a function on [a,b] that we do not yet know is continuous.
R is complete (1.2, Cauchy criterion).
Let ε>0 and choose N with d∞(fn,fm)<2ε for all m,n>N.
Arbitrary tolerance; use half of it for the Cauchy condition.
For all x∈[a,b] and all n>N: ∣fn(x)−f(x)∣≤2ε<ε.
Fix any x and any n>N. For every m>N, ∣fn(x)−fm(x)∣<2ε. Let m→∞: fm(x)→f(x), and a bound that holds along a convergent sequence holds in the limit, in the non-strict form.This is the key step: N was chosen before x, so the same N serves every point.
So fn→f uniformly on [a,b].
This is the definition of uniform convergence in 1.6: one N for all x at once.
Let c∈[a,b] and ε>0. By uniform convergence, pick one index n with ∣fn(x)−f(x)∣<3ε for every x∈[a,b].
We must show the pointwise limit f is continuous at an arbitrary point c∈[a,b]: for every ε a δ with ∣f(x)−f(c)∣<ε when ∣x−c∣<δ. We have no formula for f, so we compare it with a function we do understand, one fn.This is the 3-epsilon argument, the same one as in the theorem of 1.6 that a uniform limit of continuous functions is continuous.
Choose δ>0 with ∣fn(x)−fn(c)∣<3ε whenever ∣x−c∣<δ.
fn is continuous at c (it is in C[a,b]), so there is δ>0 that keeps fn(x) within 3ε of fn(c).
For ∣x−c∣<δ: ∣f(x)−f(c)∣≤∣f(x)−fn(x)∣+∣fn(x)−fn(c)∣+∣fn(c)−f(c)∣<3ε+3ε+3ε=ε.
Go from f(x) to f(c) by way of fn(x) and fn(c): three pieces, each below 3ε. The two outer pieces are the uniform estimate, used at the two points x and c with the same n. The middle piece is the continuity of fn.The uniformity matters: the same n works at both x and c. With only pointwise convergence the n needed at x could be different from the one needed at c, and the argument fails.
Therefore f is continuous, so f∈C[a,b].
c was arbitrary, so f is continuous at every point of [a,b].
Hence fn→f in d∞, and the Cauchy sequence converges in C[a,b]. ■
The theorem above that convergence in the sup metric is uniform convergence: uniform convergence of continuous functions is convergence in d∞.
In the picture: the graphs fn and fm for large n,m lie in a tube around each other; at each x the values fn(x) pile up at a number, which we call f(x); and the tube around f then contains fn for large n. The tube of the visualizer above is that tube.
Proof workshopRebuild the proof that C[a, b] is complete
Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.
Let (fn) be Cauchy in d∞. For each fixed x, (fn(x)) is a Cauchy sequence of real numbers.
So fn(x) converges. Define f(x)=limfn(x).
Given ε, choose N with d∞(fn,fm)<ε/2 for m,n>N.
For every x and n>N: ∣fn(x)−f(x)∣≤ε/2.
So fn→f uniformly on [a,b].
Fix c and ε. Pick n with ∣fn−f∣<ε/3 everywhere, then δ with ∣fn(x)−fn(c)∣<ε/3 for ∣x−c∣<δ. Then ∣f(x)−f(c)∣<ε.
So f is continuous at every c.
Hence f∈C[a,b] and d∞(fn,f)→0.
Theorem Bstandard
Closed subsets of complete spaces are complete
Let X be a complete metric space and A⊆X, with the distance of X. Then A is complete if and only if A is closed in X.
In one lineInside a complete space, a subset with the same distance is complete if and only if it is closed.
Why it is trueA Cauchy sequence in the subset has a limit in the big space; being closed keeps that limit in the subset. Conversely, a subset that is complete already contains the limit of any sequence of its points that converges in the big space.
Proofstandard
The idea: (⇐) A Cauchy sequence in A is Cauchy in X, so it converges to some x in X, and closedness puts x in A. (⇒) A convergent sequence of points of A is Cauchy, so it has a limit inside A, and limits are unique.
(⇐) Let A be closed and (an) a Cauchy sequence in A. It is Cauchy in X.
The distance is the same, so the Cauchy condition does not change.
So an→x for some x∈X.
X is complete.
Since A is closed, x∈A. So A is complete.
The theorem above on closed sets and limits of sequences, part (b).
(⇒) Let A be complete and an∈A with an→x∈X. Then (an) is Cauchy.
Convergent sequences are Cauchy.
So an→a∈A, and a=x. Hence x∈A, and A is closed by the same theorem. ■
A is complete, so an→a for some a∈A. Limits are unique in X.
Worked example
Show that the set Δ of probability vectors in Rn (entries ≥0 adding to 1) is complete.
Solution.
Rn is complete. With the 1-distance, say. The theorem above, which holds for each of the three distances.
Δ is closed. Let x(k)∈Δ with x(k)→x. By the coordinatewise theorem, each xi(k)→xi. Each xi(k)≥0, so xi≥0 (limits preserve non-strict inequalities). And ∑ixi(k)=1, so ∑ixi=1 by the sum law of 1.2. Closed means limits of sequences in the set stay in the set. Inequalities with "≥" and equations survive limits.
Apply the closed-subset theorem.Δ is closed in a complete space, hence complete. This is the space on which PageRank is iterated, as we see below.
Answer.Δ is complete. The same argument shows any set defined by non-strict inequalities and equations on coordinates is complete. ■
Quick checkIn the proof that C[a,b] is complete, what does the sup metric give us that makes the limit function continuous?
The sup metric controls the largest gap, so the same N serves all points. That uniform control is what lets us conclude the limit is continuous. (Each fn is continuous by assumption, and completeness of the reals is used for a different job: to get the pointwise limit at each fixed x.) With a weaker metric such as the 2-metric, the space C[0,1] is not complete: continuous ramps can converge to a step function, which is not continuous.
Definitions and theorems: contractions
Definition B
Contraction
A map T:X→X from a metric space to itself is a contraction if there is a number q with 0≤q<1 such that
d(Tx,Ty)≤qd(x,y)for all x,y∈X.
The number q is a contraction constant. It must be the same for all pairs, and it must be less than 1.
In one lineA map T:X→X that brings every pair of points closer together by a fixed factor q<1: d(Tx,Ty)≤qd(x,y).
Why it existsIt is the map whose repeated application squeezes the whole space, which is what makes iteration converge.
Definition B
Fixed point
A fixed point of T:X→X is a point x∗∈X with Tx∗=x∗. In the cobweb picture it is a point where the curve y=T(x) crosses the line y=x.
In one lineA point x∗ that T leaves where it is: Tx∗=x∗.
Why it existsSolving an equation x=T(x) is the same as finding a fixed point of T. Many equations can be put in that form.
Worked example
Which of these are contractions of R? T1(x)=3x+5, T2(x)=2x, T3(x)=sinx, T4(x)=2∣x∣.
Solution. For each map, compute ∣Tx−Ty∣ in terms of ∣x−y∣.
T1.∣T1x−T1y∣=31∣x−y∣. The constant 5 cancels. So T1 is a contraction with q=31. The fixed point solves x=3x+5, giving x∗=7.5.
T2.∣T2x−T2y∣=2∣x−y∣. The factor is 2, which is not below 1: it expands. Not a contraction.
T3. For x and y close to 0, sinx−siny≈x−y, so the ratio ∣x−y∣∣sinx−siny∣ gets arbitrarily close to 1. No q<1 works for all pairs. The mean value theorem gives ratio ∣cosc∣ for some c between x and y, whose supremum over c is 1. So T3 shrinks distances but not by a uniform factor, so it is not a contraction on R.
T4. By the reverse triangle inequality (the worked example in 4.1, with z=0), ∣∣x∣−∣y∣∣≤∣x−y∣, so ∣T4x−T4y∣≤21∣x−y∣. Absolute value does not expand distances, and the factor 21 does the rest. So q=21, and the fixed point is 0.
Answer.T1 and T4 are contractions; T2 and T3 are not. ■
When a map is differentiable, a bound on the slope settles it. This is the mean value theorem of 1.4 at work.
Theorem Bstandard (mean value theorem)
Derivative test for a contraction
Let I be an interval, g:I→R differentiable with ∣g′(x)∣≤q for all x∈I, where q<1. Then ∣g(x)−g(y)∣≤q∣x−y∣ for all x,y∈I. If also g(I)⊆I and I is closed, g is a contraction of the complete space I.
In one lineIf g is differentiable on an interval I and ∣g′(x)∣≤q<1 for every x∈I, then ∣g(x)−g(y)∣≤q∣x−y∣ for all x,y∈I.
Why it is trueBetween two points the mean value theorem says the average slope equals the derivative somewhere in between, and that derivative has size at most q.
Proofstandard
The idea: The mean value theorem turns the difference g(x) − g(y) into g'(c)(x − y), and |g'(c)| ≤ q.
Let x=y in I. There is c between x and y with g(x)−g(y)=g′(c)(x−y).
Nothing to prove for x=y. Otherwise the mean value theorem (1.4) applies on the interval between them, inside I, where g is differentiable.
So ∣g(x)−g(y)∣=∣g′(c)∣∣x−y∣≤q∣x−y∣. ■
c∈I, where ∣g′∣≤q.
(A closed interval I is a closed subset of the complete space R, so it is complete by the closed-subset theorem. This is why the derivative test comes with ”g(I)⊆I and I closed”.)
Quick checkIs T(x)=x+x1 on [1,∞) a contraction? (It satisfies ∣Tx−Ty∣<∣x−y∣ whenever x=y.)
T(x)−T(y)=(x−y)(1−xy1), so distances do shrink, but by a factor that tends to 1 as x,y→∞. A contraction needs one q<1 for all pairs. Tx=x would need x1=0, so there is no fixed point, even though [1,∞) is complete.
The Banach fixed point theorem
Theorem BBanach 1922; Rudin ch. 9
Banach fixed point theorem
Let (X,d) be a non-empty complete metric space and T:X→X a contraction with constant q, 0≤q<1. Then:
(a) T has exactly one fixed point x∗.
(b) For every x0∈X, the sequence xn+1=Txn converges to x∗.
(c) A priori bound:d(xn,x∗)≤1−qqnd(x1,x0) for every n≥0.
(d) A posteriori bound:d(xn,x∗)≤1−qqd(xn,xn−1) for every n≥1.
In one lineA contraction T of a non-empty complete metric space has exactly one fixed point x∗; from any start x0 the iterates xn+1=Txn converge to x∗, with d(xn,x∗)≤1−qqnd(x1,x0).
Why it is trueThe steps d(xn+1,xn) shrink by the factor q each time, so the total distance still to travel is a geometric series. That makes the sequence Cauchy; completeness gives the limit; continuity of T makes it fixed; and two fixed points would be pulled together, which is impossible.
ProofRudin ch. 9; Banach 1922
The idea: Step 1: each step is at most q times the previous, so steps shrink geometrically. Step 2: add the steps from n on with the triangle inequality; the geometric sum is finite and small, so the sequence is Cauchy. Step 3: completeness gives a limit. Step 4: the limit is fixed. Step 5: uniqueness by pulling two fixed points together. Steps 6 and 7: let m go to infinity in the Step 2 bound.
Let x0∈X and xn+1=Txn. Then d(xn+1,xn)=d(Txn,Txn−1)≤qd(xn,xn−1).
Pick any starting point and define the iterates. Apply the contraction inequality with x=xn and y=xn−1.Where the idea comes from: it is the contractive sequence of 1.2's stretch problem, now in any metric space.
So d(xn+1,xn)≤qnd(x1,x0) for all n≥0.
Induction on n: the case n=0 is an equality, and each step multiplies the bound by q.
For m>n: d(xm,xn)≤∑k=nm−1d(xk+1,xk)≤d(x1,x0)∑k=nm−1qk.
For m>n, the triangle inequality (M3) applied repeatedly along xn,xn+1,…,xm: the distance is at most the total length of the journey in small steps.The detour through intermediate points is where the triangle inequality is used to the full.
So d(xm,xn)≤1−qqnd(x1,x0) for all m>n.
The finite geometric sum is below the infinite one: ∑k≥nqk=1−qqn (1.6).
The right side tends to 0 as n→∞, so (xn) is Cauchy.
qn→0 because 0≤q<1 (1.6, geometric sequence). Given ε, choose N with 1−qqNd(x1,x0)<ε; then every m>n>N has d(xm,xn)<ε.
So xn→x∗ for some x∗∈X. This proves (b).
X is complete: this is the only place the hypothesis is used.No formula for x* is needed. Completeness is what promises that x* is there.
Now d(Tx∗,x∗)≤d(Tx∗,xn+1)+d(xn+1,x∗)≤qd(x∗,xn)+d(xn+1,x∗).
The contraction inequality with x=x∗ and y=xn gives d(Tx∗,xn+1)≤qd(x∗,xn), because xn+1=Txn. This is the proof that a contraction is continuous: if xn→x∗ then Txn→Tx∗, since d(Txn,Tx∗)≤qd(xn,x∗).Having a limit is not yet having a fixed point. We must still show that T does not move the limit, and this is the place where T being continuous is used.
So d(Tx∗,x∗)=0, that is, Tx∗=x∗. This shows a fixed point exists.
Both terms on the right tend to 0 because xn→x∗. A non-negative number below every ε is 0, and (M1).
Subtract: (1−q)d(x,y)≤0. Since 1−q>0 and d≥0, d(x,y)=0, so x=y. This proves (a).
Uniqueness. If Tx=x and Ty=y, then d(x,y)=d(Tx,Ty)≤qd(x,y).
Hence d(x∗,xn)≤1−qqnd(x1,x0). This proves (c).
For fixed n, let m→∞ in d(xm,xn)≤1−qqnd(x1,x0). We have xm→x∗, and the reverse triangle inequality gives ∣d(xm,xn)−d(x∗,xn)∣≤d(xm,x∗)→0, so d(xm,xn)→d(x∗,xn).
Then d(xn,x∗)≤1−qqd(xn,xn−1). This proves (d). ■
Apply (c) to the iteration that starts at xn−1: its first step is xn, its zeroth is xn−1, and its limit is the same x∗ by uniqueness. Take the exponent 1 in (c).
In the picture: the red and green staircase has steps that shrink by the factor q at each round. A path with geometrically shrinking steps has finite total length, so it cannot wander forever. It settles at a point, and that point must lie on the diagonal (Tx=x) because the last step before settling has length 0.
Proof workshopRebuild the proof of the Banach fixed point theorem
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
Each step is at most q times the previous one: apply the contraction inequality to the pair xn,xn−1, and repeat.
The triangle inequality along the journey, then the geometric sum.
This adds the steps, so the bound on each step must come first.
The bound on d(xm,xn) does not depend on m and tends to 0.
You need the bound on d(xm,xn) for all m>n first.
Completeness is the hypothesis that turns a Cauchy sequence into a point.
Completeness applies to a Cauchy sequence, so Cauchy must already be shown.
The triangle inequality through xn+1=Txn, then the contraction inequality; both terms tend to 0.
This uses the limit point x∗, so it comes after completeness has produced it.
Two fixed points would be pulled closer by the factor q, which is possible only at distance 0.
Uniqueness is the last claim: it uses the contraction inequality on the two fixed points.
Why· Where each hypothesis was used, and what fails without it
Completeness (step “so xn→x∗”). Without it there can be no fixed point. T(x)=2x on X=(0,1] is a contraction with q=21, and the iterates 21,41,81,… bunch at 0, a hole. T has no fixed point in X.
q<1, uniformly. For T(x)=x+x1 on [1,∞) distances shrink but the factor tends to 1; there is no fixed point although [1,∞) is complete.
T maps X into X.T(x)=2x+1 is a contraction of R with fixed point 2, but it sends [0,1] out of [0,1] (it sends 1 to 1.5). Restricted to [0,1] the iteration leaves the space, and there is no fixed point in [0,1].
Non-empty. The theorem says “there is exactly one”, which needs a point to start from.
Why· The two error bounds are for different jobs
The a priori bound (c) tells you before you start how many steps you need. Given q and the first step d(x1,x0), you can solve 1−qqnd(x1,x0)<tolerance for n. The a posteriori bound (d) says that once you have computed two consecutive iterates, the remaining error is at most 1−qq times their gap. That is a safe stopping rule: for q=21, stop when two successive guesses differ by less than the tolerance, because then the error is at most the gap. For q near 1 the factor 1−qq is large, and a small gap does not guarantee a small error. The bounds are usually pessimistic, because q is a worst case over all pairs of points.
Quick checkIn the Banach fixed point theorem, which step is the ONLY one that uses completeness of X?
The bounds on the steps and the uniqueness use only the contraction inequality and the triangle inequality. Completeness is needed to get a limit that lies in X.
Quick checkA map has a fixed point x∗ and T has slope −1.5 there (as in the last preset of the cobweb). What happens to iterates started near x∗?
Near x∗ the distance is multiplied by about ∣T′(x∗)∣=1.5>1 each step. A fixed point exists but the iteration cannot find it. (One could iterate the inverse map instead, whose slope is −1.51.)
Examples: solving equations by iteration
Worked example
Solve cosx=x by iteration, with a guaranteed error bound.
Solution.
Put the equation in the form x=g(x).g(x)=cosx. A solution of cosx=x is exactly a fixed point of g.
Choose a complete space that g maps into itself.X=[0,1]. On [0,1], cos is decreasing, so g([0,1])=[cos1,1]=[0.5403,1]⊆[0,1]. [0,1] is a closed subset of R, hence complete. And g must map X into X, or the iteration could leave the space.
Bound the slope.g′(x)=−sinx, and on [0,1], sin is increasing, so ∣g′(x)∣≤sin1≈0.8415=:q<1. The derivative test (mean value theorem) turns this into ∣g(x)−g(y)∣≤q∣x−y∣.
Apply Banach. There is exactly one solution of cosx=x in [0,1], and the iterates converge to it from any start in [0,1]. There are no other solutions anywhere: if cosx=x then x=cosx∈[−1,1] and cosx>0 there, so x∈(0,1].
Compute. Start at x0=1: x1=cos1=0.5403, x2=0.8576, x3=0.6543, and so on. Here d(x1,x0)=0.4597. One step to find the number the a priori bound needs.
Number of steps. The bound is 1−qqnd(x1,x0)=2.90(0.8415)n. For error below 10−6 we need n≥87. 0.841587×2.90≈8.7×10−7.
Compare with reality. The error is already below 10−6 at n=32. The bound used the worst slope on all of [0,1], namely sin1=0.84. Near the solution the slope is sin(0.739)=0.674, so the true rate is 0.674 per step. The bound is a guarantee, not an estimate.
Answer. The unique solution is x∗≈0.7390851 (the “Dottie number”); 87 steps are guaranteed to give six correct decimals, and 32 suffice in practice. ■
Your answerStarting at x0=1 and iterating xn+1=cosxn (in radians), what is x2? (Three decimals.)
Compute cos1 first, then take the cosine of that.
x1=cos1=0.540302. Then x2=cos0.540302=0.857553.
Your answerFor cosx=x with q=sin1≈0.8415 and d(x1,x0)≈0.4597, find the smallest n with 1−qqnd(x1,x0)≤10−6.
Take logarithms and divide by lnq, which is negative, so the inequality flips.
Solve qn≤10−6(1−q)/0.4597, i.e. n≥ln(10−6⋅0.1585/0.4597)/ln0.8415≈86.8, so n=87.
Python labFixed-point iteration for cos x = x: the guarantee against the truth
import mathg = math.cos # the map: we solve cos(x) = xx0 = 1.0 # starting guessq = math.sin(1) # contraction constant of cos on [0, 1]: max |sin x| = sin 1# find the fixed point to machine accuracyxs = [x0]for _ in range(200): xs.append(g(xs[-1]))xstar = xs[-1]d10 = abs(xs[1] - xs[0])print("fixed point x* =", xstar)print(" n x_n true error a priori bound")for n in [1, 2, 3, 5, 10, 20, 32, 40]: err = abs(xs[n] - xstar) bound = q**n / (1 - q) * d10 print(f"{n:2d} {xs[n]:.7f} {err:.2e} {bound:.2e}")tol = 1e-6n_guaranteed = math.ceil(math.log(tol * (1 - q) / d10) / math.log(q))n_actual = next(n for n in range(len(xs)) if abs(xs[n] - xstar) < tol)print("steps guaranteed by the bound:", n_guaranteed, " steps actually needed:", n_actual)
Try this.The bound is above the true error in every row, as the theorem promises. Now solve x=e−x instead: change the map to g = lambda x: math.exp(-x), the start to x0 = 0.5, and the constant to q = math.exp(-0.4) (valid on [0.4,0.7]), and delete the rows with n above 20. You should see 32 steps guaranteed and 20 actually needed. Which map has the larger gap between guarantee and truth, and why? (The constant q is the worst slope on the whole interval; the true rate is the slope at the fixed point.)
Newton’s method is a contraction near a root
Newton’s method for f(x)=0 iterates N(x)=x−f′(x)f(x). A root r is a fixed point of N. Why does it converge so fast?
Theorem Bstandard
Newton's method is a local contraction
Let f be twice continuously differentiable near r with f(r)=0 and f′(r)=0. Then there is δ>0 such that N(x)=x−f(x)/f′(x) maps I=[r−δ,r+δ] into I and satisfies ∣N(x)−N(y)∣≤21∣x−y∣ on I. Hence for every x0∈I, the Newton iterates converge to r, and r is the only root in I.
In one lineIf f has a continuous second derivative, f(r)=0 and f′(r)=0, then for some δ>0 Newton's map N is a contraction of [r−δ,r+δ] with constant 21, so Newton's method converges to r from every start in that interval.
Why it is trueN′(x)=f(x)f′′(x)/f′(x)2, which is 0 at the root. A derivative that is 0 at r and continuous is small on a small interval around r.
Proofstandard
The idea: Differentiate N, see that N'(r) = 0, use continuity to keep |N'| ≤ 1/2 on a small interval, and check N maps the interval into itself.
Quotient rule on f/f′: (f′f)′=f′2f′2−ff′′. We need f′′ to exist for this, and f′=0 near r (by continuity of f′ from f′(r)=0).
So N′(r)=0.
f(r)=0.This is the whole secret of Newton's method: the map is flat at the fixed point.
Choose δ>0 with f′=0 and ∣N′(x)∣≤21 for all x∈I.
N′ is continuous near r (since f,f′,f′′ are continuous and f′=0), and N′(r)=0, so for small enough δ we have ∣N′(x)∣≤21 on I. Continuity of N′ at r with value 0 means: for the tolerance 21 there is a δ that works.
Then ∣N(x)−N(y)∣≤21∣x−y∣ on I.
The derivative test: mean value theorem.
N maps I into I. As I is closed in R, it is complete, so Banach applies. ■
N(r)=r because f(r)=0, so ∣N(x)−r∣=∣N(x)−N(r)∣≤21∣x−r∣≤δ for x∈I.
Worked example
Newton's method for x2=2: find an interval where N is a contraction and bound the error.
Solution.
The map.f(x)=x2−2, N(x)=x−2xx2−2=2x+x1. This is the Babylonian method of 1.2.
The slope.N′(x)=21−x21, which is 0 at x=2. The root is a fixed point where the slope vanishes.
Choose an interval. Take I=[1.2,1.6]. N′ is increasing, with N′(1.2)=0.5−0.694=−0.194 and N′(1.6)=0.5−0.391=0.109. So ∣N′∣≤0.195 on I; take q=0.2. An increasing function has its extreme values at the ends of the interval.
Check that N maps I into I.N is convex (N′′(x)=2/x3>0), so its largest value on I is at an end: N(1.2)=1.4333, N(1.6)=1.425. And N(x)≥2=1.4142 for all x>0 (arithmetic-geometric mean). So N(I)⊆[1.4142,1.4333]⊆I. The map must send the space into itself.
Run it from x0=1.5.x1=1217=1.416667, so d(x1,x0)=0.0833. The a priori bound gives d(xn,2)≤0.80.2n(0.0833)=0.104(0.2)n. Apply Banach with q=0.2.
Compare with the true errors.x1−2=2.5×10−3, x2−2=2.1×10−6, x3−2=1.6×10−12. The bound allows 0.0208,0.0042,0.0008. The bound is true but loose. The true error is roughly squared at each step, which is faster than any fixed factor q: a map whose slope is 0 at the fixed point has a better contraction constant on every smaller interval.
Answer. On [1.2,1.6], N is a contraction with q=0.2; the iterates converge to 2 from any start there. ■
Your answerNewton's method for x2=2 is N(x)=2x+x1. Starting at x0=1.5, what is x1? (Give a fraction.)
Solve the linear system x=Ax+b by iteration, with A=[0.50.10.20.3] and b=(1,2).
Solution. We use the max-distance on R2, the complete space of 4.1.
Write the map.T(x)=Ax+b. A solution of the system is a fixed point of T. The system (I−A)x=b is the same equation as x=Ax+b.
Compute the contraction constant.T(x)−T(y)=A(x−y). For any vector z, ∥Az∥∞=maxi∣∑jAijzj∣≤maxi∑j∣Aij∣∥z∥∞. The row sums of ∣A∣ are 0.7 and 0.4, so ∥Az∥∞≤0.7∥z∥∞. Each entry of z has size at most ∥z∥∞, and the largest row sum is the worst case. This is the operator norm of 3.5 for the max-distance.
Apply Banach.T is a contraction of the complete space (R2,d∞) with q=0.7. There is exactly one solution and the iteration converges from any start. R2 is complete, by the theorem above.
Iterate from x0=(0,0).x1=(1,2), x2=(1.9,2.7), x3=(2.49,3.0), x4=(2.845,3.149). Each step is one matrix-vector product plus b.
Compare with the exact solution. Solving (I−A)x=b by elimination gives x∗=(310,310). The errors in max-distance are 3.33,2.33,1.43,0.84,0.49, shrinking by about 0.58 to 0.7 per step. The a priori bound 0.30.7n(2) gives 4.67,3.27,2.29,1.60 for n=1,2,3,4. Every error is below its bound, as the theorem promises.
Answer.x∗=(10/3,10/3). The method needs only matrix-vector products, which is why iterative solvers for huge sparse systems use it. ■
Worked example
Picard iteration for y′=y, y(0)=1: the contraction on a space of functions.
Solution. We solve the differential equation by finding a fixed point of an operator that acts on functions.
Turn the equation into an integral equation.y′=y with y(0)=1 holds exactly when y(t)=1+∫0ty(s)ds. The fundamental theorem of calculus (1.5) in both directions.
Define the operator. On the space X=C[0,a] with the sup metric, let (Ty)(t)=1+∫0ty(s)ds. A fixed point Ty=y is a solution. T sends continuous functions to continuous functions (an integral is continuous in its upper limit). The “points” of the space are now functions, and T is a map from the space to itself.
Show it is a contraction. For y,z∈X and t∈[0,a]: ∣(Ty)(t)−(Tz)(t)∣=∫0t(y−z)ds≤∫0t∣y(s)−z(s)∣ds≤td∞(y,z)≤ad∞(y,z). Taking the maximum over t, d∞(Ty,Tz)≤ad∞(y,z). The integral of a function bounded by d∞(y,z) over an interval of length t is at most td∞(y,z). So q=a, which is below 1 for a<1.
Apply Banach with a=21.C[0,21] is complete, so there is exactly one solution on [0,21], found by iterating from any starting function. Completeness of C[a,b] is the theorem of this chapter.
Run the iteration from y0=1.y1=1+t, y2=1+t+2t2, y3=1+t+2t2+6t3, in general yn=∑k=0nk!tk. Each application of T integrates the previous polynomial and adds 1.
Recognise the limit.yn→et uniformly on [0,21]: the partial sums of the exponential series of 1.6. The theorem promised convergence in the sup metric; here we see it concretely.
Error bound.d∞(y1,y0)=max[0,1/2]t=21, so d∞(yn,et)≤1/2(1/2)n⋅21=2−n. For n=3 the bound is 0.125, and the true error is e0.5−4879≈0.0029. Again a guarantee that is far from tight. The factor a is the worst case over the interval.
Answer. The unique solution on [0,21] is y=et. Restarting the argument at t=21 with the new initial value e1/2 extends it to [0,1], and so on, so it exists for all t≥0. ■
Your answerIn Picard iteration for y′=y, y(0)=1, the third iterate is y3(t)=1+t+2t2+6t3. What is y3(21)? (Give a fraction.)
Put every term over the denominator 48.
1+21+81+481=4848+24+6+1=4879≈1.6458, compared with e0.5≈1.6487.
A preview· Preview: chapter 7.1, the existence and uniqueness theorem for ODEs
The example above had f(t,y)=y. For a general equation y′=f(t,y) with y(0)=y0, the operator is (Ty)(t)=y0+∫0tf(s,y(s))ds on C[0,a]. If f satisfies a Lipschitz condition ∣f(t,y)−f(t,z)∣≤L∣y−z∣, the same estimate gives d∞(Ty,Tz)≤Lad∞(y,z). So T is a contraction when a<L1. This is the Picard–Lindelöf theorem of MATH 376, and chapter 7.1 is this page with f in place of y.
Where it is used
Used inside maths· Inside maths: existence theorems and the real numbers themselves
The contraction mapping theorem is how analysts prove that equations have solutions without finding them: the existence and uniqueness of solutions of ODEs (7.1), the inverse function theorem (Rudin’s ch. 9 proves it by contraction), and the implicit function theorem in Unit 5. Completeness also underlies the real numbers: R is what you get by adding to Q the limit of every Cauchy sequence, a construction due to Cantor and others around 1870. And it explains 1.6: a series converges when its partial sums are Cauchy, and on a closed interval inside its radius of convergence the partial sums of a power series are a Cauchy sequence in C[a,b], so the sum is a continuous function.
Used in the real world· PageRank is a contraction in the 1-norm
In 2.11 the Google matrix G=dP+n1−d11T ranks web pages: the power method xk+1=Gxk converges to the stationary vector π. We can read this as a contraction. Take X=Δ, the set of probability vectors, which is complete (above), with the 1-distance ∥x−y∥1. For x,y∈Δ, the difference z=x−y has entries adding to 0, so 1Tz=0 and the teleportation term vanishes:
Gx−Gy=dP(x−y)+n1−d1(1Tz)=dPz.
In 2.11 we proved that a stochastic matrix never increases the 1-norm: ∥Pz∥1≤∥z∥1. Hence
∥Gx−Gy∥1≤d∥x−y∥1.
Also G maps Δ into Δ: for a probability vector x, Gx=dPx+n1−d1 has non-negative entries that add to d+(1−d)=1 (the theorem “A stochastic matrix keeps probability vectors” of 2.11 gives that Px adds to 1). So G is a contraction of Δ with constant q=d=0.85. Banach gives, at once and without the Perron–Frobenius theorem: a unique stationary distribution, convergence from every starting vector, and ∥xk−π∥1≤dk∥x0−π∥1≤2dk (two probability vectors are at 1-distance at most 2). This recovers the bound of 2.11. To guarantee a 1-distance below 10−8 takes k=118 steps, because 2×0.85118≈9.4×10−9. Page, Brin, Motwani and Winograd’s 1998 report says that for a web of 322 million links the iteration converged in about 52 steps (the figure quoted in 2.11), so the guarantee is cautious and the actual rate is set by the second eigenvalue.
Worked example 2.11; computed
Run the PageRank contraction on the four-page web of 2.11 with d=0.85, from x0=(1,0,0,0).
Solution.
The matrix. Page 1 links to pages 2, 3, 4; page 2 to 3 and 4; page 3 to page 1; page 4 to pages 1 and 3. The columns of P are (0,31,31,31), (0,0,21,21), (1,0,0,0), (21,0,21,0), and G=0.85P+40.1511T. This is the web of 2.11. Every entry of G is at least 0.0375.
The fixed point. Solving Gπ=π gives π≈(0.3682,0.1418,0.2880,0.2021). Page 1 ranks highest: two pages link to it, and one of them is page 3 which sends all its weight there.
Iterate and measure. The 1-distance to π at steps k=0,1,2,3,4,5,6 is 1.264,0.661,0.223,0.085,0.058,0.028,0.008. The guarantee dk∥x0−π∥1 is 1.264,1.074,0.913,0.776,0.660,0.561,0.477. The error is below the guarantee at every step, and much below it: the actual rate is about 0.46, the second-largest eigenvalue size of G (0.85×0.547, using the ∣λ2∣≈0.547 of 2.11).
Steps for 10−8. The guarantee needs k=118; this web reaches 10−8 at k=25. The contraction constant d is a worst case over all webs. The real rate depends on the web’s own eigenvalues, as the power method theorem of 2.11 said.
Answer.π≈(0.368,0.142,0.288,0.202) is the unique PageRank vector. Banach turns “does it converge, and how fast” into one line: q=d. ■
Your answerBy the guarantee 2dk with d=0.85, what is the smallest number of PageRank iterations k that ensures a 1-distance below 10−8 to the PageRank vector?
Take logarithms: kln0.85<ln(5×10−9), and divide by the negative number ln0.85.
We need 2×0.85k<10−8, so k>ln(5×10−9)/ln(0.85)≈117.6, hence k=118. (In practice the iteration converges much faster, since the second eigenvalue of G is well below 0.85.)
Used in the real world· Reinforcement learning: value iteration converges because the Bellman operator is a $\gamma$-contraction
An agent in a world with states s chooses actions a, collects rewards r(s,a), and moves to a next state s′ with probability P(s′∣s,a). A discount γ∈[0,1) makes later rewards worth less. The value V(s) is the best total discounted reward from state s. The Bellman operator maps a table of values V∈R∣S∣ to a new table:
(TV)(s)=amax[r(s,a)+γs′∑P(s′∣s,a)V(s′)].
The optimal value V∗ is a fixed point of T. Claim:T is a contraction of (R∣S∣,d∞) with q=γ. Proof. Fix s and a and write ua and wa for the bracket evaluated at V and at W. Then ∣ua−wa∣=γ∑s′P(s′∣s,a)(V(s′)−W(s′))≤γ∥V−W∥∞, because the probabilities are non-negative and add to 1. Also ∣maxaua−maxawa∣≤maxa∣ua−wa∣ (if the larger maximum is ua∗, then maxu−maxw≤ua∗−wa∗). Hence ∥TV−TW∥∞≤γ∥V−W∥∞. ■ Since R∣S∣ with the max-distance is complete, Banach gives a unique V∗, value iteration Vk+1=TVk converges to it from any start, and ∥Vk−V∗∥∞≤γk∥V0−V∗∥∞. Richard Bellman developed dynamic programming in the 1950s (his book Dynamic Programming appeared in 1957); this is the standard proof that its main algorithm works, found in any reinforcement-learning text (Sutton and Barto’s, for example).
Worked example
Value iteration on a two-state world with γ=0.9.
Solution. States A and B, two actions each. In A: stay gives reward 1 and keeps you in A; go gives reward 0 and moves you to B. In B: stay gives reward 2; go gives reward 0 and moves you to A. All moves are certain (so P is 0 or 1).
The Bellman operator.(TV)(A)=max(1+0.9V(A),0+0.9V(B)) and (TV)(B)=max(2+0.9V(B),0+0.9V(A)). The maximum is over the two actions available in each state.
Contraction.q=γ=0.9 in the max-distance on R2. By the claim above. So one fixed point, reached from any start.
Iterate from V0=(0,0).V1=(1,2). V2=(max(1.9,1.8),max(3.8,0.9))=(1.9,3.8). V3=(max(2.71,3.42),max(5.42,1.71))=(3.42,5.42). At step 3 the best move from A switches from “stay” to “go”: it is better to walk to the richer state B.
Find the fixed point by hand. In B staying forever is best: V∗(B)=1−0.92=20. In A, going to B gives 0.9×20=18, which beats staying (1+0.9×18=17.2), so V∗(A)=18. Check: T(18,20)=(max(17.2,18),max(20,16.2))=(18,20).
The errors.∥Vk−V∗∥∞=20,18,16.2,14.58 for k=0,1,2,3, which is exactly 20×0.9k. The bound γk∥V0−V∗∥∞ is attained here: the worst-case rate γ really happens.
Steps to accuracy 0.01.20×0.9k<0.01 needs k≥73. 20×0.973=0.0091, while 0.972×20=0.0102.
Answer.V∗=(18,20), and value iteration reaches error below 0.01 after 73 steps. With γ close to 1 (an agent that cares about the far future) the contraction constant is near 1 and convergence is slow. ■
Your answerIn the two-state world, value iteration from V0=(0,0) gives V1=(1,2). What is V2(A)=max(1+0.9V1(A),0.9V1(B))?
Compute both options and take the larger.
1+0.9×1=1.9 and 0.9×2=1.8. The maximum is 1.9 (staying is still slightly better at this step).
Traps
Watch out· Distances shrinking is not the same as contracting
A map with d(Tx,Ty)<d(x,y) for all x=y need not be a contraction and need not have a fixed point (x+x1 on [1,∞)). The constant q<1 must be the same for all pairs. Also sinx shrinks distances on R but has q=1 in the supremum.
Watch out· The map must send the space into itself
For cosine, [0,1] works because cos[0,1]⊆[0,1]. On [0,2] it would not: cos2<0. Always check T(X)⊆X and that X is complete (closed, for a subset of Rn) before using the theorem. Forgetting the first check is the most common error.
Watch out· Open intervals are not complete
(0,1) with the usual distance is not complete. A contraction of (0,1) into itself can fail to have a fixed point. The reason to work on a closed interval is not decoration. It is the hypothesis.
Watch out· A small step does not prove the iteration has converged
The a posteriori bound 1−qqd(xn,xn−1) needs the contraction constant. For q=0.99 the factor is 99: two successive guesses differing by 10−6 only guarantee an error of 10−4. And without a contraction (like n in 1.2, whose neighbouring terms get arbitrarily close) a small step proves nothing at all.
Watch out· Slope below 1 at the fixed point is local; the theorem needs it on the whole space
For T(x)=x2 the slope at the fixed point 0 is 0, yet iterating from x0=2 runs off to infinity. The contraction holds only on a small interval such as [0,31]. When the slope bound holds only near the fixed point, Banach applies to a small closed interval around it, and you must start inside.
Watch out· Completeness belongs to the metric, not only to the shape of the set
R with d(x,y)=∣arctanx−arctany∣ is a metric space with the same notion of “nearby” as before, but it is not complete: the sequence xn=n is Cauchy and has no limit. Completeness is a property of the distance, which is why changing the norm on a function space (sup norm to 2-norm) can destroy it.
Problems
check
Which of these maps of R are contractions, and with what constant: (a) T(x)=0.4x−3; (b) T(x)=x+0.1; (c) T(x)=21cosx; (d) T(x)=−x?
Solution
(a) Yes, q=0.4. (b) No: T preserves distances (q=1) and has no fixed point. (c) Yes: ∣T′(x)∣=21∣sinx∣≤21, so q=21 by the derivative test. (d) No: ∣Tx−Ty∣=∣x−y∣, so q=1. (It has the fixed point 0 but is not a contraction: iterates bounce between x and −x.)
check
For T(x)=3x+5, find the fixed point, and starting at x0=0 compare the true error ∣xn−x∗∣ with the a priori bound.
Solution
Fixed point: x=3x+5 gives x∗=7.5. Iterates: x1=5, so d(x1,x0)=5 and q=31. The bound is 2/3(1/3)n⋅5=7.5(1/3)n. The true error: T(x)−7.5=31(x−7.5), so ∣xn−7.5∣=7.5(1/3)n. The bound is exactly the true error: it cannot be improved, because here the slope is 31 everywhere.
check
What does a Cauchy sequence look like in the discrete metric? Is a sequence of bit strings under the Hamming distance, in which consecutive terms differ in at most one bit, always Cauchy?
Solution
In the discrete metric a Cauchy sequence is eventually constant (take ε=21). In the Hamming distance the same holds, because the distance takes whole-number values: take ε=1 to get eventually constant. A sequence that changes one bit at every step is not Cauchy, since dH(xn+1,xn)=1<1 for all n.
check
Is (0,1) complete with the distance ∣x−y∣? Give a Cauchy sequence that shows your answer, and say which point is missing.
Solution
No. The sequence xn=n1 is Cauchy in (0,1) (it converges in R) but its limit 0 is not in (0,1). The missing point is 0. The same space with the extra endpoint, [0,1], is complete.
use
Show that the iteration xn+1=e−xn converges to the unique solution of x=e−x from any starting point in [0.4,0.7]. Starting at x0=0.5, how many steps does the a priori bound guarantee for error below 10−6?
Solution
Let g(x)=e−x on X=[0.4,0.7], a closed interval, hence complete. g is decreasing, so g(X)=[e−0.7,e−0.4]=[0.4966,0.6703]⊆X. And ∣g′(x)∣=e−x≤e−0.4=0.6703=:q<1. By the derivative test and Banach there is a unique fixed point (about 0.5671) and convergence. With x0=0.5: x1=e−0.5=0.6065, d(x1,x0)=0.1065. The bound 0.32970.6703n(0.1065)≤10−6 needs n≥32. (In practice 20 steps suffice.)
use
Show that xn+1=1+xn1 converges to the golden ratio 21+5 from any start in [1.5,2], and give the contraction constant.
Solution
Let g(x)=1+x1 on X=[1.5,2]. g is decreasing, with g(1.5)=35≈1.667 and g(2)=1.5, so g(X)=[1.5,1.667]⊆X. ∣g′(x)∣=x21≤2.251=94=:q on X. Banach gives a unique fixed point in X. A fixed point satisfies x=1+x1, i.e. x2−x−1=0, whose positive root is 21+5≈1.618. The iterates from 1.5 are 1.667,1.6,1.625,1.615,… (ratios of consecutive Fibonacci numbers).
use
For A=[0.20.10.30.4] and b=(1,2), show that x↦Ax+b is a contraction in the max-distance, find q, and compute x1,x2,x3 from x0=(0,0). The exact solution is (38,934).
Solution
Row sums of the entries’ absolute values: 0.5 and 0.5, so ∥Az∥∞≤0.5∥z∥∞ and q=0.5. Iterates: x1=(1,2), x2=(0.2+0.6+1,0.1+0.8+2)=(1.8,2.9), x3=(0.36+0.87+1,0.18+1.16+2)=(2.23,3.34). The exact solution is (2.667,3.778), and the max-error at x3 is 0.438, which is below the a priori bound 0.50.53(2)=0.5.
use
Show that T(x)=x2 is a contraction of [0,31], find q, and say what the theorem predicts for the iteration from x0=31.
Solution
T maps [0,31] into [0,91]⊆[0,31]. ∣T′(x)∣=2x≤32=:q. By Banach there is a unique fixed point in [0,31]; it is 0 (the other solution of x2=x is 1, outside the interval). From x0=31: x1=91, d(x1,x0)=92, so d(xn,0)≤1/3(2/3)n⋅92=32(32)n. (The true error is (31)2n, much smaller: the slope is 0 at the fixed point.)
prove
Prove that every Cauchy sequence in a metric space is bounded: there are a point p and a number M with d(xn,p)≤M for all n.
Solution
Plan. After some index all terms are within 1 of one term; the finitely many earlier terms are at finite distance.
Take ε=1: there is N with d(xm,xn)<1 for m,n>N. Let p=xN+1. Then d(xn,p)<1 for all n>N. Let M=max(1,d(x1,p),…,d(xN,p)), a maximum of finitely many numbers. Then d(xn,p)≤M for every n. ■
prove
Prove that a Cauchy sequence in a metric space that has a convergent subsequence converges (to the same limit).
Solution
Plan. This is the last step of the Cauchy criterion proof in 1.2: split the distance through a late term of the subsequence.
Let (xn) be Cauchy and xnk→x. Let ε>0. Choose N with d(xm,xn)<2ε for m,n>N. Choose k with nk>N and d(xnk,x)<2ε. For n>N: d(xn,x)≤d(xn,xnk)+d(xnk,x)<ε. So xn→x. ■
prove
Prove the a posteriori bound: if T is a contraction with constant q on a complete space, then d(xn,x∗)≤1−qqd(xn,xn−1).
Solution
Plan. Compare xn with x∗ through xn+1 and use the contraction on the pair (xn,x∗).
d(xn,x∗)≤d(xn,xn+1)+d(xn+1,x∗). Now xn+1=Txn and x∗=Tx∗, so d(xn+1,x∗)≤qd(xn,x∗). Also d(xn,xn+1)≤qd(xn−1,xn). Hence d(xn,x∗)(1−q)≤qd(xn,xn−1), and dividing by 1−q>0 gives the claim. ■
prove
Prove: if A is an n×n matrix whose largest absolute row sum maxi∑j∣Aij∣ is q<1, then for every b the equation x=Ax+b has exactly one solution in Rn, and xk+1=Axk+b converges to it from any start.
Solution
Plan. Show Tx=Ax+b is a contraction of the complete space (Rn,d∞), then apply Banach.
Rn with d∞ is complete (theorem above). For x,y put z=x−y. Then Tx−Ty=Az, and for each i, ∣(Az)i∣=∑jAijzj≤∑j∣Aij∣∣zj∣≤(∑j∣Aij∣)∥z∥∞≤q∥z∥∞. Taking the maximum over i, d∞(Tx,Ty)≤qd∞(x,y). The Banach fixed point theorem gives the unique solution and the convergence. ■ (Consequently I−A is invertible.)
prove
Prove that a contraction on any metric space (complete or not) has at most one fixed point, and that it is continuous.
Solution
Plan. Uniqueness is the pull-together argument; continuity follows from the contraction inequality directly.
If Tx=x and Ty=y, then d(x,y)=d(Tx,Ty)≤qd(x,y), so (1−q)d(x,y)≤0, so d(x,y)=0 and x=y. For continuity: given ε>0 take δ=ε. If d(x,y)<δ, then d(Tx,Ty)≤qd(x,y)≤d(x,y)<ε, because q<1. So T is continuous (even uniformly). ■
stretch
Suppose T:X→X on a non-empty complete metric space is such that some power S=Tm (apply Tm times) is a contraction. Prove that T has exactly one fixed point. (This is how Picard iteration works on all of [0,∞) at once: for the operator of the y′=y example, repeating the integral estimate m times gives ∣(Tmy)(t)−(Tmz)(t)∣≤m!tmd∞(y,z), so Tm has constant am/m! on [0,a], which is below 1 for large m however large a is.)
Solution
Plan. Use Banach for S, then show the fixed point of S is also fixed by T.
By Banach, S has a unique fixed point x∗. Then S(Tx∗)=T(Sx∗)=Tx∗ (because S=Tm commutes with T), so Tx∗ is also a fixed point of S. By uniqueness, Tx∗=x∗. Any fixed point of T is a fixed point of S, so it equals x∗. ■
stretch
Show that d(x,y)=∣arctanx−arctany∣ is a metric on R and that (R,d) is not complete, although R with ∣x−y∣ is.
Solution
Plan. A metric pulled back through an injective function; then find a Cauchy sequence escaping to infinity.
(M1): d≥0, and d=0 iff arctanx=arctany iff x=y (arctan is strictly increasing, so injective). (M2) is clear. (M3): ∣arctanx−arctanz∣≤∣arctanx−arctany∣+∣arctany−arctanz∣ is the triangle inequality for real numbers. Now take xn=n. Since arctann→2π, the real sequence (arctann) is Cauchy, so d(xm,xn)=∣arctanm−arctann∣→0 as m,n→∞: the sequence is Cauchy. It has no limit: for any real x, d(xn,x)=∣arctann−arctanx∣→2π−arctanx>0. So (R,d) is not complete. A Cauchy sequence escapes to a point at infinity that this metric does not contain.
Summary
xn→x in a metric space means d(xn,x)→0. In Rn it is coordinatewise convergence; in C[a,b] with the sup metric it is uniform convergence.
A set is closed iff it contains the limits of all convergent sequences of its points. A closed subset of a complete space is complete, and a complete subset is closed.
A space is complete when every Cauchy sequence converges in it. R, Rn and C[a,b] with the sup metric are complete; Q and (0,1] are not. The C[a,b] proof builds the limit pointwise, gets a uniform N from the sup metric, and uses that a uniform limit of continuous functions is continuous.
A contraction shrinks every distance by one fixed factor q<1. The Banach fixed point theorem: on a non-empty complete space a contraction has exactly one fixed point, iteration from any start converges to it, and d(xn,x∗)≤1−qqnd(x1,x0).
Using it takes four checks: T maps a complete set into itself, and ∣Tx−Ty∣≤q∣x−y∣ for one q<1 (for a differentiable T, ∣T′∣≤q). Then say what q is and what the bound promises.
Applications: cosx=x (q=sin1); Newton’s method (slope 0 at the root, so q can be made as small as you like near it); linear systems x=Ax+b (row sums below 1); Picard iteration for ODEs (the integral operator on C[0,a], preview of 7.1).
PageRank is a contraction of the probability vectors in the 1-norm with q=d; value iteration in reinforcement learning is a contraction in the max-norm with q=γ.
MATH 376: Picard iteration for $y' = f(t, y)$ is the contraction mapping theorem applied to the integral operator $(Ty)(t) = y_0 + \int_0^t f(s, y(s))\,ds$ on a space of continuous functions with the sup metric. The existence and uniqueness theorem of 376 is exactly this chapter plus a Lipschitz estimate.
MATH 521: 521 proves that $C[a, b]$ is complete, the Banach fixed point theorem, and then uses it for the inverse function theorem and for ODEs. This chapter is that sequence of results.
CS 240 / numerical methods: Every iterative algorithm that stops when successive iterates are close ('converged to tolerance') relies on a contraction or on completeness. The a posteriori error bound below is the stopping rule.
CS 532 / AI: Value iteration in reinforcement learning, and the fixed-point equations behind Q-learning, converge because the Bellman operator is a contraction in the sup norm.