Mathematics RU

Part VIII · Foundations Chapter 53 of 60

Rigorous analysis

A continuous function without a single tangent, a function that can’t be drawn, a limit of continuous functions with a jump. A bestiary of the monsters that made analysis rigorous, and the tools that tamed them.

Years 1–2 75 minutes

Builds on: 52 · Infinities

You will learn

  • build the real numbers from fractions and derive the theorems on monotone and Cauchy sequences from the completeness axiom
  • prove the intermediate value theorem, the extreme value theorem and the theorem on uniform continuity rigorously
  • tell pointwise convergence from uniform convergence and know what depends on the difference

The last chapter ended with a confession. We compared infinities, counted fractions and proved that a segment has more points than there are natural numbers, but we never said what a single point, a single real number, is. For two hundred years analysis got by perfectly well without an answer. Newton, Leibniz and Euler relied on a visual certainty: a number is a point on a line, a function is a curve that can be drawn, and whatever is true of the picture is true of the numbers.

In the second half of the nineteenth century this certainty collapsed. One after another, functions appeared that behaved in ways that “can’t happen” and refuted statements that had been considered proved for decades. Henri Poincaré greeted them without enthusiasm:

Logic sometimes makes monsters. For half a century we have seen a mass of bizarre functions which appear to be forced to resemble as little as possible honest functions which serve some purpose.

Henri Poincaré, Science and Method, 1908

A few lines further on Poincaré calls the whole collection a teratological museum, a museum of freaks. We’ll choose an older genre. Medieval books about monsters were called bestiaries: for each beast they tell you where it lives, why it’s dangerous and how to overcome it. This chapter is built the same way. Each monster in the bestiary of analysis forced some notion to be made rigorous: the real number, continuity, convergence. Along the way we’ll pay the debts the course has been running up since the chapter on limits: theorems we called obvious or promised to prove later will get full proofs here.

Jagged all the way down

The Weierstrass function

Habitat: the whole number line.

Caught by: Karl Weierstrass, in a talk to the Berlin Academy of Sciences on 18 July 1872.

Refuted: “a continuous function has a derivative everywhere except at isolated points”.

Tamed: in the last section of the chapter.

Take a cosine wave, add to it a cosine wave three times as frequent and half as high, then another three times more frequent and half as high again, and so on without end:

The height of the $n$th wave. The number $a$ lies between zero and one, so the waves get lower and lower. The series converges at every point: its terms are no bigger in absolute value than the terms of the geometric series $a^n$ (the comparison test, chapter 30). The frequency of the $n$th wave: $b$ is an integer greater than one, and each next wave is $b$ times as frequent as the one before. Example: with $a = \frac12$, $b = 3$, all the cosines at zero equal one, and $W(0) = 1 + \frac12 + \frac14 + \ldots = 2$. At the point $\frac13$ the first cosine is $\cos\frac\pi3 = \frac12$, and the others are $\cos(3^{n-1}\pi) = -1$, because $3^{n-1}$ is odd. We get $W\bigl(\frac13\bigr) = \frac12 - \bigl(\frac12 + \frac14 + \ldots\bigr) = -\frac12$.

Each term is a smooth wave with a tangent at every point. Any finite sum of such waves is smooth too. But Weierstrass proved that the infinite sum, for odd $b$ and $ab > 1 + \frac{3\pi}{2}$, has no derivative at any point, though the function itself is continuous everywhere. In 1916 Godfrey Hardy weakened the condition to $ab \ge 1$, so the pair $a = \frac12$, $b = 3$ from the example will do too.

Why was this a blow? Intuition says a continuous curve can break only here and there, like a polygonal line, and is smooth between the breaks. In 1806 André-Marie Ampère published a “proof” that a continuous function has a derivative everywhere except at isolated points, and many nineteenth-century textbooks repeated the conclusion. In chapter 26 we saw how a smooth graph straightens into its tangent under strong magnification. Let’s see what the Weierstrass function does under the magnifying glass.

Tap the graph to choose a point, and zoom in. Compare the monster with the sum of its first four waves: at low magnification they hardly differ, but under the glass they behave quite differently. Below are the slopes of the secants through the centre of the window at each level of magnification.

However far you zoom, the picture never settles down: every window has as many jags as the whole graph. The key thing shows in the row of slopes. For a smooth function the slope of the secant almost stops changing and approaches the derivative. For the monster it jumps about and grows in absolute value, and it has no limit at all. And the derivative is exactly the limit of the slopes of secants.

Not everyone accepted such functions as lawful citizens of mathematics. Charles Hermite wrote to Thomas Stieltjes:

I turn away with fright and horror from this lamentable plague of continuous functions which have no derivatives.

Charles Hermite to Thomas Stieltjes, 20 May 1893

There was only one way to argue with the Weierstrass function: find a mistake in the proof. There was no mistake. The mistake was in the picture on which the earlier reasoning relied: continuity defined through limits (chapter 25) turned out to be much broader than “a curve without breaks and with tangents”. The lesson of the first monster is to trust definitions, not drawings. We’ll tame it at the end of the chapter: we’ll prove that it’s continuous, and prove that a close relative, whose calculations are shorter, is nowhere differentiable.

Each term of a series is a smooth function, and the series converges at every point. What follows for the sum?

The smoothness of the terms doesn’t pass to the sum of an infinite series, and even continuity doesn’t always pass. What has to be added to make it pass we’ll find out in the section on Cauchy’s mistake: it’s uniform convergence.

A function without a graph

The Dirichlet function

Habitat: everywhere and nowhere.

Caught by: Peter Gustav Lejeune Dirichlet, in a paper on Fourier series, 1829.

Refuted: “a function is a curve that can be drawn”.

Tamed: by defining a function as a rule. The next chapter will find its integral.

The Dirichlet function equals $1$ at every rational point and $0$ at every irrational one: $D\bigl(\frac pq\bigr) = 1$, $D(\sqrt2) = D(\pi) = 0$.

It can’t be drawn: any tiny segment contains both fractions and irrational numbers, so the “graph” is two seemingly solid bands at heights $0$ and $1$, and at no point can you say where it goes next. Dirichlet himself spoke of two arbitrary constants $c$ and $d$; one and zero are a later convention. For the eighteenth century this wasn’t a function at all: Euler understood a function as an expression made up of the variable and numbers. Dirichlet insisted on something else: a function is any rule assigning a number to each $x$, and it doesn’t matter whether the rule has a formula or a graph. That’s how it’s defined today (chapter 9).

The Dirichlet function is discontinuous at every point of the number line.

The idea: next to any point there are neighbours of both kinds, and their values differ by one.

Take any $a$ and play the Sceptic from chapter 25 with tolerance $\varepsilon = \frac12$. Whatever window $(a - \delta,\ a + \delta)$ we’re offered, it contains a rational number $r$, by the density theorem (chapter 6). It contains an irrational one too: take another fraction $r'$ between $r$ and $a + \delta$. The number $t = r + \frac{r' - r}{\sqrt2}$ lies between $r$ and $r'$, and it’s irrational: if $t$ were a fraction, then $\sqrt2 = \frac{r' - r}{t - r}$ would be a fraction too. At the two points found, $D$ equals $1$ and $0$. The value $D(a)$ can’t be within $\frac12$ of both numbers, so the window doesn’t win. The limit of $D$ at the point $a$ isn’t $D(a)$: a discontinuity.

The Dirichlet function is discontinuous everywhere because every point has equal numbers of neighbours of both kinds: infinitely many. What if the jumps at fractions are made smaller the larger the denominator?

Thomae’s function, or “popcorn”

Habitat: the rational points, one kernel above each fraction.

Caught by: Carl Johannes Thomae, in a textbook on definite integrals, 1875.

Refuted: “if a function is discontinuous on a dense set, it can’t have any points of continuity”.

Tamed: by the theorem below, and by the Riemann integral, which, unlike the Dirichlet function, it has.

Thomae’s function at a point $x = \frac pq$, written as a fraction in lowest terms with $q \ge 1$, equals $\frac1q$, and at irrational points it equals zero. For example, $T\bigl(\frac12\bigr) = \frac12$, $T\bigl(\frac{3}{8}\bigr) = \frac18$, $T(0) = T\bigl(\frac01\bigr) = 1$, $T(\sqrt2) = 0$.

A kernel has popped up above each fraction: above a half to a height of $\frac12$, above the thirds to $\frac13$, and the smaller the fraction’s pieces, the lower. The function is periodic with period $1$: shifting by an integer doesn’t change the denominator. So it’s enough to study it on the segment $[0, 1]$.

Thomae’s function is continuous at every irrational point and discontinuous at every rational one.

The trick is that only finitely many kernels rise above any level, and an irrational number can always be fenced off from finitely many points.

Mark the points $\bigl(\frac pq,\ \frac1q\bigr)$ over the segment $[0, 1]$: the smaller the denominator, the higher the point. All the irrational points lie on the axis, where $T = 0$. Let $x$ be irrational, and let the Sceptic name a tolerance $\varepsilon$. Only fractions with denominators $q \le \frac1\varepsilon$ rise above the level $\varepsilon$, and on the segment $[0, 1]$ there are finitely many such fractions: for each $q$ at most $q + 1$. The number $x$ coincides with none of them, since it’s irrational. The distances from $x$ to finitely many points are positive, and the smallest of them is positive too. Call it $\delta$. The window $(x - \delta,\ x + \delta)$ contains no tall kernel: irrational points give $0$, and fractions give values below $\varepsilon$. So $|T(y) - T(x)| = T(y) < \varepsilon$, and the game is won: $T$ is continuous at $x$. If $x = \frac pq$, then $T(x) = \frac1q > 0$, while any window around $x$ contains irrational points where $T = 0$. For the tolerance $\varepsilon = \frac1q$ there’s no window: at every rational point there’s a discontinuity.

It’s an amusing monster: it’s continuous where it “isn’t there” (on the axis) and breaks at every kernel. The reverse can’t happen: a theorem proved by Vito Volterra in 1881 implies that there’s no function continuous at every rational point and discontinuous at every irrational one. And popcorn does have an integral.

Thomae’s function is Riemann integrable on $[0, 1]$, and $\int_0^1 T(x)\,dx = 0$.

The same idea: there are finitely many tall kernels, and they can be hidden in narrow pieces of the partition. Let a tolerance $\varepsilon$ be named, and let $K$ be the number of points of the segment where $T \ge \varepsilon$. Take any partition of the segment into pieces shorter than $\delta = \frac{\varepsilon}{2K}$ and any points $\xi_i$ in the pieces. Each tall point lies in at most two pieces (two if it’s on their common boundary), so at most $2K$ pieces contain tall points. Their contribution to the Riemann sum is less than $2K \cdot \delta \cdot 1 = \varepsilon$, since $T \le 1$. On the other pieces $T < \varepsilon$, and their contribution is less than $\varepsilon \cdot 1$. So $0 \le \sum T(\xi_i)\,\Delta x_i < 2\varepsilon$ for any choice of points, and the sums approach zero (the definition of the integral, chapter 28).

“Continuity”: set $\varepsilon$ and drag the point $x$ along the axis; the window $\delta$ steers around the tall kernels. The buttons put $x$ at a fraction or at an irrational number. “Area”: the upper sums of popcorn melt away as the number of pieces grows, while for the Dirichlet function they’re stuck at one.

Holes between the fractions

The rational line $\mathbb Q$

Habitat: every calculator, which stores only fractions.

Caught by: the Pythagoreans, fifth century BC.

Refuted: “since every segment contains fractions, the line is filled with them”.

Tamed: by Dedekind cuts, 1872.

We saw the holes in the rational line in chapter 6, and now we can see how costly they are for analysis. If there were only as many numbers as there are fractions, three main theorems would collapse. The sequence $1,\ 1.4,\ 1.41,\ 1.414,\ \ldots$ increases and never exceeds $2$, but it has no limit among the fractions. The function $x^2 - 2$ on the fractions of the segment $[1, 2]$ is continuous and changes sign, yet it’s zero nowhere. The function $-(x^2 - 2)^2$ on the same fractions is continuous and bounded but has no largest value: it never takes the value zero, yet comes as close to zero as you like.

So the “no holes” property has to be stated explicitly, and for that we have to say what a real number is without appealing to a picture. The definition from chapter 6, a number as an infinite decimal, is awkward for this: it’s unclear how to add and multiply infinite expansions if carries come “from infinity”. Richard Dedekind, by his own account, found a way out on 24 November 1858, while preparing lectures at the Zurich Polytechnic: he was uncomfortable proving the basic theorems of analysis by appealing to geometric intuition. He published his solution only in 1872, in the booklet Continuity and Irrational Numbers.

Dedekind’s idea is this. Cut the line somewhere: all the points to the left of the cut are the lower class, to the right the upper class. The continuity of the line means that a cut always falls at a point. For fractions that’s not so: cut them by the rule “$r < 0$ or $r^2 < 2$”, with everything to the left of $\sqrt2$ below and everything to the right above. There’s no point at the place of the cut. Dedekind proposed not to look for a point for such a cut but to declare the cut itself a number.

A Dedekind cut is a set of fractions $A \subset \mathbb Q$ with three properties: $A$ isn’t empty and isn’t all of $\mathbb Q$; together with each fraction $A$ contains all smaller fractions; and $A$ has no largest element. The fractions outside $A$ form the upper class. A real number, according to Dedekind, is a cut.

Each fraction $r$ gives a cut $\{x \in \mathbb Q : x < r\}$; its upper class has a smallest element, $r$ itself. That’s how the fractions take their places in the new world. The cut $\sqrt2 = \{r \in \mathbb Q : r < 0 \text{ or } r^2 < 2\}$ is different: there’s no largest fraction in the lower class and no smallest in the upper. Check for yourself: try to name the largest fraction whose square is less than two.

Type a fraction and try to hit the edge of a class. For each fraction from below the machine answers with a larger fraction from the same class, for each from above with a smaller one. In the “$r < \frac32$” mode the upper class does have an edge: name it.

The machine uses one formula: $r \mapsto \frac{2r + 2}{r + 2}$. If $r > 0$ and $r^2 < 2$, the new fraction is larger: the difference is $\frac{2 - r^2}{r + 2} > 0$. And its square is still less than two: $\left(\frac{2r + 2}{r + 2}\right)^2 - 2 = \frac{2(r^2 - 2)}{(r + 2)^2} < 0$. For a fraction from the upper class the same calculation gives a smaller fraction whose square is still greater than two. Starting from one, the machine produces $\frac43$, $\frac75$, $\frac{24}{17}$, $\frac{41}{29}$, …, among them the convergents of $\sqrt2$ familiar from chapter 6.

Cuts are compared by inclusion: $A \le B$ if $A \subset B$. Any two cuts are comparable. If $A$ isn’t contained in $B$, take a fraction $a \in A$ outside $B$. Every fraction $b \in B$ is less than $a$: otherwise $a \le b$, and $a$ would lie in $B$ along with $b$. And since $b < a$, $b \in A$. So $B \subset A$. The sum is defined elementwise: $A + B = \{a + b : a \in A,\ b \in B\}$. Multiplication takes more fuss, as the signs have to be sorted out. Checking all the rules of arithmetic and inequalities for cuts is long and dull but honest; it’s done in full, for example, in the appendix to the first chapter of Walter Rudin’s Principles of Mathematical Analysis. The main property of cuts, though, takes three lines to check.

Let a non-empty family of cuts $A_i$ be bounded above: all the $A_i$ are contained in one cut $\Gamma$. Then their union $U = \bigcup_i A_i$ is a cut, and it’s the smallest of the cuts that are greater than or equal to all the $A_i$.

A cut is a ray of fractions extending to the left. A union of rays is again a ray, and none of them goes beyond it.

Draw the cuts $A_i$ as rays of fractions. In the picture their ends creep up on $\sqrt2$ from below, like the cuts $\{x < 1\}$, $\{x < 1.4\}$, $\{x < 1.41\}$, … They all lie inside the cut $\Gamma$: that’s the upper bound. Take their union: $U$ is all the fractions that belong to at least one $A_i$. $U$ is a cut. It isn’t empty, because it contains each $A_i$, and it isn’t all of $\mathbb Q$, because it lies inside $\Gamma$. If $u \in U$, then $u$ lies in some $A_i$; together with $u$ that $A_i$ contains all smaller fractions and some fraction larger than $u$ (there’s no largest in $A_i$). All of them fall into $U$, so $U$ contains everything smaller than $u$ and has no largest element. $U$ is an upper bound of the family: each $A_i \subset U$, that is, $A_i \le U$. And the smallest one: if a cut $\Gamma'$ is greater than or equal to all the $A_i$, then all $A_i \subset \Gamma'$, and so their union $U \subset \Gamma'$. In the picture the union of the rays reached exactly $\sqrt2$: the hole there was nothing to plug with among the fractions.

In the same year, 1872, Georg Cantor, and three years earlier Charles Méray, proposed another path: a number is a sequence of fractions that “converges in itself”, though it may have no limit among the fractions (below such sequences are called Cauchy sequences). Two such sequences are taken to be the same number if their difference tends to zero: that’s an equivalence relation from chapter 51, and a number is its class. Weierstrass too presented his own construction in his lectures. All the paths lead to the same result.

The completeness axiom

The scaffolding can come down. From now on we won’t need to remember what the real numbers are made of: the rules of arithmetic, the rules of inequalities and one property that distinguishes $\mathbb R$ from $\mathbb Q$ will be enough. Let’s state it without any cuts.

A number $M$ is an upper bound of a set $A$ if $a \le M$ for all $a \in A$. A set that has an upper bound is called bounded above. The least of the upper bounds is called the least upper bound, or supremum, and written $\sup A$. The lower bound and the greatest lower bound, or infimum, $\inf A$, are defined in the same way.

Every non-empty set of real numbers that’s bounded above has a least upper bound.

For cuts this isn’t an axiom but the theorem we’ve just proved: the union is the least upper bound. So by accepting the axiom we risk nothing: a model in which it holds has been built from fractions. For the fractions themselves it’s false: the set $\{r \in \mathbb Q : r^2 < 2\}$ has as many upper bounds among the fractions as you like, but no least one.

$s$ is an upper bound: no element of the set is above it. Nothing smaller will do: however far you lower the bar to $s - \varepsilon$, some element ends up above it. That’s what “least” means. Example: $A = \bigl\{1 - \frac1n : n \in \mathbb N\bigr\}$. All the elements are less than $1$, and for $\varepsilon = 0.01$ there’s the element $1 - \frac1{101} \approx 0.9901 > 0.99$; in general any $n > \frac1\varepsilon$ will do. So $\sup A = 1$, though $A$ has no largest element.

When a set has a largest element, that’s its least upper bound: $\sup [0, 1] = 1$. But the least upper bound is useful precisely when there’s no largest element: $\sup\,[0, 1) = 1$, and $1 \notin [0, 1)$. The first thing the axiom gives is a property we accepted without proof in chapter 25.

For every real number $x$ there’s a natural number $n > x$. As a consequence, $\frac1n \to 0$.

Suppose the contrary: all the natural numbers are at most $x$. Then $\mathbb N$ is bounded above, and by the completeness axiom it has a least upper bound $s$. The number $s - 1$ is less than $s$ and so isn’t an upper bound: there’s a natural $n > s - 1$. But then the natural number $n + 1 > s$, contrary to $s$ being an upper bound. The consequence: for a tolerance $\varepsilon$ choose a natural $N > \frac1\varepsilon$, and for $n > N$ we get $0 < \frac1n < \frac1N < \varepsilon$.

A set $A$ is bounded above, and $s = \sup A$. Which of these is always true?

That’s the second half of the definition: if $t < s$, then $t = s - \varepsilon$ with $\varepsilon = s - t > 0$, and some element is greater than $t$. The rest depends on the set.

Finding least upper bounds is a skill that will come in handy throughout what follows. The recipe is always the same: guess a candidate, check that it’s an upper bound, and show that elements come arbitrarily close to it.

Four faces of completeness

The axiom speaks about sets, while analysis speaks about sequences. The four theorems below translate it into the language of sequences, and each has its own role. The course has already used two of them as axioms: the nested intervals principle in chapter 25, and the theorem on monotone sequences in chapter 30. Now they’ll become theorems.

If a sequence is non-decreasing and bounded above, it converges, and its limit is the least upper bound of its terms.

There’s no need to search for the limit: the completeness axiom suggests it.

The terms $a_1 \le a_2 \le a_3 \le \ldots$ lie below some number, and by the completeness axiom the set of terms has a least upper bound $s$. The Sceptic names a tolerance $\varepsilon$. The number $s - \varepsilon$ is less than $s$ and so is no longer an upper bound: some term $a_N$ is greater than $s - \varepsilon$. The sequence doesn’t decrease, so all the terms after $a_N$ are also greater than $s - \varepsilon$. And no term rises above $s$. So for $n > N$ all the $a_n$ lie in the band $(s - \varepsilon,\ s]$, and $|a_n - s| < \varepsilon$. For every tolerance an index has been found: $a_n \to s$.

For a non-increasing sequence bounded below it’s the same with the greatest lower bound. The theorem pays the debt of chapter 12: the powers $2^{1.4} \approx 2.6390$, $2^{1.41} \approx 2.6574$, $2^{1.414} \approx 2.6647$, … grow with the exponents and don’t exceed $2^{1.5} \approx 2.8284$, so they have a limit. That limit, $2.66514\ldots$, is what’s called $2^{\sqrt2}$. The infinite decimals of chapter 30 get their values for the same reason.

If the segments $[a_1, b_1] \supset [a_2, b_2] \supset \ldots$ are nested inside one another, they have a common point. If moreover $b_n - a_n \to 0$, the common point is unique.

The idea: the common point will be given by the least upper bound of the left ends.

Nesting gives $a_1 \le a_2 \le \ldots$ and $b_1 \ge b_2 \ge \ldots$, and each left end is no further right than each right end: for $n \le m$ we have $a_n \le a_m \le b_m$, and for $n > m$ we have $a_n \le b_n \le b_m$. So each $b_m$ is an upper bound of the set of left ends, and that set has a least upper bound $c$. As an upper bound, $c \ge a_m$; as the least upper bound, $c \le b_m$. Altogether $c \in [a_m, b_m]$ for every $m$. If there were two common points, $c < c'$, all the segments would contain $[c, c']$, and their lengths couldn’t tend to zero: $b_n - a_n \ge c' - c > 0$.

Now the proof of the intermediate value theorem from chapter 25, which rested on this principle, is fully rigorous. The third face of completeness is about sequences that don’t tend anywhere.

A subsequence of a sequence $a_n$ is a sequence $a_{n_1}, a_{n_2}, a_{n_3}, \ldots$ with indices $n_1 < n_2 < n_3 < \ldots$: some terms have been struck out of the original, and the rest haven’t been rearranged.

Every bounded sequence has a convergent subsequence.

We’ll keep halving the segment the terms live in, each time keeping a half with infinitely many of them. The picture shows the sequence $a_n = \sin n$: it has no limit, and its terms turn up infinitely often in every little piece of the segment $[-1, 1]$, so either half will do; we stick with the one containing $0.3$.

The sequence is bounded, so all its terms lie in some segment $I_0$. Halve $I_0$. There are infinitely many indices $n$, so at least one half contains infinitely many terms $a_n$. Keep that one and call it $I_1$. Repeat with $I_1$, then with $I_2$, and so on. We get nested segments $I_0 \supset I_1 \supset I_2 \supset \ldots$, each half as long as the one before and with infinitely many terms. Choose a term in each: $a_{n_1} \in I_1$, then $a_{n_2} \in I_2$ with index $n_2 > n_1$ (there is one, since $I_2$ has infinitely many terms), then $a_{n_3} \in I_3$ with $n_3 > n_2$, and so on. By the nested intervals principle all the $I_k$ have a common point $x$. Both $a_{n_k}$ and $x$ lie in $I_k$, so $|a_{n_k} - x|$ is at most the length of $I_k$, which is the length of $I_0$ divided by $2^k$ and tends to zero. The subsequence converges to $x$.

The last face of completeness lets you learn that a limit exists without knowing what it is.

A sequence is called a Cauchy sequence if for every $\varepsilon > 0$ there’s an index $N$ such that $|a_m - a_n| < \varepsilon$ for all $m, n > N$: distant terms are arbitrarily close to one another.

A sequence of real numbers converges if and only if it’s a Cauchy sequence.

A convergent sequence is a Cauchy sequence. If $a_n \to a$, then for the tolerance $\frac\varepsilon2$ there’s an $N$ after which $|a_n - a| < \frac\varepsilon2$, and for $m, n > N$ the triangle inequality gives $|a_m - a_n| \le |a_m - a| + |a - a_n| < \varepsilon$.

Conversely, let the sequence be a Cauchy sequence. First, it’s bounded: for $\varepsilon = 1$ there’s an index $N_1$ after which all the terms differ from $a_{N_1 + 1}$ by less than $1$, and there are finitely many terms before it. By the Bolzano–Weierstrass theorem there’s a subsequence $a_{n_k} \to x$. Let’s show that the whole sequence tends to $x$. The Sceptic names $\varepsilon$; take $N$ from the Cauchy property for tolerance $\frac\varepsilon2$, and a term of the subsequence $a_{n_k}$ with index $n_k > N$ and $|a_{n_k} - x| < \frac\varepsilon2$. Then for $n > N$ we get $|a_n - x| \le |a_n - a_{n_k}| + |a_{n_k} - x| < \varepsilon$.

Cauchy’s criterion is the most portable form of completeness: it involves neither order nor least upper bounds, only distances. That’s why it’s taken as the definition of completeness where “greater” and “less” don’t exist: for complex numbers, vectors, functions (chapter 55). Among the fractions the sequence $1,\ 1.4,\ 1.41,\ \ldots$ is a Cauchy sequence but doesn’t converge: the same hole again.

Neighbouring terms of a sequence get closer: $a_{n+1} - a_n \to 0$. Does this mean the sequence converges?

Take the partial sums of the harmonic series $H_n = 1 + \frac12 + \ldots + \frac1n$ (chapter 30). Neighbours differ by $\frac1{n + 1} \to 0$, but $H_{2n} - H_n \ge n \cdot \frac1{2n} = \frac12$, and the sequence goes off to infinity. The steps get smaller, but the journey never ends.

Can it be done the other way round, with nested intervals as the axiom?

If an ordered field satisfies the Archimedean property and the nested intervals principle, it satisfies the completeness axiom too.

Let $A$ be non-empty and bounded above. Take an element $a_0 \in A$ and an upper bound $b_0$, and keep halving the segment $[a_0, b_0]$. If the midpoint is an upper bound of $A$, keep the left half; if not, the right half. This preserves two properties: the right end $b_k$ is an upper bound of $A$, and the segment $[a_k, b_k]$ contains an element of $A$ (in the first case the old one, in the second an element to the right of the midpoint). The lengths $\frac{b_0 - a_0}{2^k}$ tend to zero by the Archimedean property, and the segments have a unique common point $s$. If some $a \in A$ were greater than $s$, then once $b_k - a_k < a - s$ the right end $b_k \le s + (b_k - a_k) < a$ wouldn’t be an upper bound. And for any $\varepsilon > 0$, once $b_k - a_k < \varepsilon$, an element of $[a_k, b_k]$ is greater than $b_k - \varepsilon \ge s - \varepsilon$. So $s = \sup A$.

That’s why different textbooks state completeness differently, and they’re all right: nested intervals (with Archimedes), monotone sequences, Cauchy sequences (with Archimedes) and least upper bounds are one and the same property. Chapter 25 lost nothing by taking nested intervals as an axiom.

Paying the debts

Rigorous proofs were put off “until chapter 53” more than once in the course. Here’s the ledger of debts:

Where promisedWhat was promised
chapters 25, 38a rigorous proof of the intermediate value theorem
chapters 27, 28, 38the extreme value theorem
chapter 25the continuity of roots and logarithms
chapter 27l’Hôpital’s rule in its strong form
chapters 28, 32, 33uniform continuity and the integrability of continuous functions
chapters 30, 31, 33uniform convergence and term-by-term differentiation of series

Let’s start with the first row. In chapter 25 the intermediate value theorem was proved by halving, and that proof is now complete. Here’s a second one, in the spirit of this chapter: the root will be pointed out by a least upper bound.

If a function $f$ is continuous on a segment $[a, b]$ and $f(a) < 0 < f(b)$, there’s a point $c \in (a, b)$ with $f(c) = 0$.

Take the rightmost place up to which the function is still sometimes negative: the least upper bound of the set where $f < 0$.

The set $S = \{x \in [a, b] : f(x) < 0\}$ isn’t empty (it contains $a$) and is bounded above by $b$. Let $c = \sup S$; then $a \le c \le b$. Could $f(c) < 0$? Then $c \ne b$, and by continuity $f$ is negative on a whole window around $c$ (play the Sceptic with tolerance $|f(c)|$). The points of the window to the right of $c$ lie in $S$, but $c$ was an upper bound. Impossible. Could $f(c) > 0$? Then $c \ne a$, and $f$ is positive on a window $(c - \delta,\ c]$. There are no points of $S$ in it, and still fewer to the right of $c$. So $c - \delta$ is also an upper bound of $S$, smaller than $c$, contrary to $c$ being the least one. Impossible. What’s left is $f(c) = 0$. And $c$ lies inside the segment, because $f$ isn’t zero at the ends.

The root found this way is special: to the right of it the function is never negative again. The next debt requires the Bolzano–Weierstrass theorem and one simple observation: a continuous function maps convergent sequences to convergent ones. If $x_k \to c$ and $f$ is continuous at $c$, then for a tolerance $\varepsilon$ continuity gives a window $\delta$, the terms $x_k$ fall into it from some index on, and from then on $|f(x_k) - f(c)| < \varepsilon$. We’ll also need the fact that the limit of terms from a segment $[a, b]$ lies in the same segment: if $x_k \to c > b$, then for the tolerance $c - b$ the terms would end up to the right of $b$.

A function continuous on a segment $[a, b]$ is bounded on it and attains its largest and smallest values on it.

We’ll apply the Bolzano–Weierstrass theorem twice: first to prove that the values are bounded, then to find a point where their least upper bound is attained.

Suppose the values of $f$ aren’t bounded above. Then for each $n$ there’s an $x_n \in [a, b]$ with $f(x_n) > n$. The sequence $x_n$ is confined to the segment, and it has a subsequence $x_{n_k} \to c$, with $c \in [a, b]$. By continuity $f(x_{n_k}) \to f(c)$, that is, to a number. But $f(x_{n_k}) > n_k \ge k$, and the values grow without bound. A contradiction: $f$ is bounded above. So the set of values has a least upper bound $M$. For each $n$ the number $M - \frac1n$ is no longer an upper bound: there’s a $y_n$ with $M - \frac1n < f(y_n) \le M$. Again choose a subsequence $y_{n_k} \to d \in [a, b]$. By continuity $f(y_{n_k}) \to f(d)$, and by the squeeze theorem (chapter 25) $f(y_{n_k}) \to M$. A sequence has only one limit, so $f(d) = M$: the largest value is attained at the point $d$. The smallest value of $f$ is the largest value of $-f$ with a minus sign.

Both conditions are needed, and the examples from chapter 27 show what happens without them: $\frac1x$ on $(0, 1]$ has unbounded values, and $x$ on $[0, 1)$ has no largest value. You can see it in the proof: where there’s no closed segment, the limit $c$ can drop out of the domain. And chapter 38 needed the theorem for functions on a sphere.

A set $K$ in $\mathbb R^n$ is called closed if it contains the limits of all its convergent sequences of points. A segment, a circle, a sphere are closed; the interval $(0, 1)$ isn’t: $\frac1n \to 0$, and zero isn’t in it.

A function continuous on a closed bounded set $K \subset \mathbb R^n$ attains its largest and smallest values on it.

The proof above relied on only two facts: a bounded sequence of points has a convergent subsequence, and its limit doesn’t leave the domain. The second is the closedness of $K$. The first is the Bolzano–Weierstrass theorem in $\mathbb R^n$: in a bounded sequence of points all the coordinates are bounded. Choose a subsequence in which the first coordinates converge, from it a subsequence in which the second ones converge too, and so on $n$ times; at the end all the coordinates converge, and with them the points themselves, because the distance $\sqrt{(x_1 - y_1)^2 + \ldots + (x_n - y_n)^2}$ is small when the differences of the coordinates are small. From there the proof is repeated word for word. The unit sphere from chapter 38 is bounded and closed: if $\|\mathbf x_k\| = 1$ and $\mathbf x_k \to \mathbf x$, then $\|\mathbf x\| = 1$, since the length of a vector depends continuously on its coordinates.

The next debt is to roots and logarithms. Their continuity follows from a general fact about inverse functions.

Let $f$ be continuous and strictly increasing on $[a, b]$. Then it takes each value in $[f(a), f(b)]$ exactly once, and the inverse function $g$ is continuous on that segment.

The function maps a window on the $x$-axis to a window on the $y$-axis, and all that remains is to take a smaller window.

By the intermediate value theorem $f$ takes each value $y \in [f(a), f(b)]$, and since it’s strictly increasing, exactly once. So the inverse function $g$ is defined on the whole segment $[f(a), f(b)]$ and is increasing too. Take $y_0 = f(x_0)$ and a tolerance $\varepsilon$ for $g$: we want $g(y)$ to land in the window $(x_0 - \varepsilon,\ x_0 + \varepsilon)$. Suppose it fits in $[a, b]$; near the ends of the segment everything is the same with half a window. The function $f$ maps the ends of this window to points $f(x_0 - \varepsilon) < y_0 < f(x_0 + \varepsilon)$. Take $\delta$ to be the smaller of the distances from $y_0$ to them. If $|y - y_0| < \delta$, then $f(x_0 - \varepsilon) < y < f(x_0 + \varepsilon)$, and since $g$ is increasing, $x_0 - \varepsilon < g(y) < x_0 + \varepsilon$. A window has been found: $g$ is continuous at $y_0$.

The function $x^n$ is continuous and strictly increasing on any segment $[0, R]$, so the root $\sqrt[n]{y}$ is continuous on $[0, R^n]$, and hence on the whole ray $[0, +\infty)$. In the same way $\arcsin$ (the inverse of sine on $\bigl[-\frac\pi2, \frac\pi2\bigr]$) and $\arctan$ are continuous, and the logarithm is the inverse of the continuous exponential (chapter 29).

The debt of chapter 27 is l’Hôpital’s rule for the cases where derivatives at the point itself don’t help. We need a mean value theorem for two functions at once.

Let $f$ and $g$ be continuous on $[a, b]$, differentiable on $(a, b)$, with $g' \ne 0$ on $(a, b)$. Then there’s a $\xi \in (a, b)$ for which $\dfrac{f(b) - f(a)}{g(b) - g(a)} = \dfrac{f'(\xi)}{g'(\xi)}$.

Look at the pair of functions as a curve in the plane: then the left side of the equation is the slope of a chord, the right side the slope of a tangent, and the theorem says that somewhere they’re parallel.

Draw the curve $t \mapsto \bigl(g(t),\ f(t)\bigr)$ for $t \in [a, b]$. The chord between its ends has slope $\frac{f(b) - f(a)}{g(b) - g(a)}$; the denominator isn’t zero, otherwise by Rolle’s theorem (chapter 27) there’d be $g' = 0$ somewhere. The tangent at the point $t$ points along the vector $\bigl(g'(t),\ f'(t)\bigr)$ and has slope $\frac{f'(t)}{g'(t)}$. Consider $h(t) = \bigl(f(b) - f(a)\bigr)\bigl(g(t) - g(a)\bigr) - \bigl(g(b) - g(a)\bigr)\bigl(f(t) - f(a)\bigr)$. Up to a constant factor, this is the signed distance from a point of the curve to the line of the chord, and at the ends $h(a) = h(b) = 0$. The function $h$ is continuous on the segment and differentiable inside, and by Rolle’s theorem there’s a $\xi$ with $h'(\xi) = 0$. For example, where the curve is furthest from the chord. $h'(\xi) = \bigl(f(b) - f(a)\bigr)g'(\xi) - \bigl(g(b) - g(a)\bigr)f'(\xi) = 0$. Dividing by $g'(\xi)\bigl(g(b) - g(a)\bigr) \ne 0$, we get the required equation: the tangent at $\xi$ is parallel to the chord.

Let $f$ and $g$ be differentiable on an interval $(a, a + r)$, with $g' \ne 0$ on it, $f(x) \to 0$ and $g(x) \to 0$ as $x \to a + 0$, and suppose the ratio of the derivatives has a limit: $\frac{f'(x)}{g'(x)} \to L$. Then $\frac{f(x)}{g(x)} \to L$ too. The same holds as $x \to a - 0$, and hence for the two-sided limit.

The idea: by Cauchy’s theorem the ratio of the functions equals the ratio of the derivatives at some intermediate point. Extend the definition by $f(a) = g(a) = 0$; now both functions are continuous on every segment $[a, x]$ with $x < a + r$. By Cauchy’s mean value theorem $\frac{f(x)}{g(x)} = \frac{f(x) - f(a)}{g(x) - g(a)} = \frac{f'(\xi_x)}{g'(\xi_x)}$ for some $\xi_x \in (a, x)$. The Sceptic names $\varepsilon$; by hypothesis there’s a $\delta$ for which $\left|\frac{f'(t)}{g'(t)} - L\right| < \varepsilon$ for all $t \in (a, a + \delta)$. If $a < x < a + \delta$, then $\xi_x$ lies in this interval too, and $\left|\frac{f(x)}{g(x)} - L\right| < \varepsilon$.

The simple case in chapter 27 required $g'(a) \ne 0$. Now we can do this: $\lim\limits_{x \to 0}\frac{x - \sin x}{x^3}$. The ratio of derivatives $\frac{1 - \cos x}{3x^2}$ is “zero over zero” again, so apply the rule to it: $\frac{\sin x}{6x} \to \frac16$. So $\frac{1 - \cos x}{3x^2} \to \frac16$ too, and $\frac{x - \sin x}{x^3} \to \frac16$. A numerical check: at $x = 0.1$ the fraction equals $0.16658\ldots$

One δ for everyone

The function $\sin\frac1x$ on $(0, 1]$

Habitat: right next to zero, where it isn’t allowed in.

Refuted: “if a function is continuous at every point, one fine grid works for it everywhere at once”.

Tamed: by the Heine–Cantor theorem: on a segment with its ends this can’t happen.

In the game with the Sceptic from chapter 25 the window $\delta$ is chosen after $\varepsilon$ and after the point $x$, so it can depend on both. For $x^2$ at a point $x_0$ with tolerance $\varepsilon$ a window of about $\frac{\varepsilon}{2x_0}$ will do: the further right the point, the steeper the graph and the narrower the window. For $\sin\frac1x$ right next to zero the windows shrink to almost nothing. For many purposes that’s bad. To draw up a table of values with guaranteed accuracy, draw a graph or compute an integral, you need one grid step that works at all points at once.

A function $f$ is uniformly continuous on a set $D$ if for every $\varepsilon > 0$ there’s a $\delta > 0$ such that $|f(x) - f(y)| < \varepsilon$ for any $x, y \in D$ with $|x - y| < \delta$.

The window $\delta$ is chosen before the points are known: there’s one for the whole set. Any two points, wherever they are. In ordinary continuity the point $x$ is fixed first, and only then is a $\delta$ sought for it: the quantifiers come in a different order (chapter 25). Close points mean close values, equally throughout the domain. Example: $x^2$ on $[0, 2]$. For $x, y$ in the segment $|x^2 - y^2| = |x + y|\,|x - y| \le 4|x - y|$, and for tolerance $\varepsilon$ the window $\delta = \frac\varepsilon4$ works for all points at once: at $\varepsilon = 0.01$ that’s $\delta = 0.0025$. On the whole line it can’t be done: the points $n$ and $n + \frac1n$ are arbitrarily close, but their squares differ by $2 + \frac1{n^2} > 2$.
Above: the function, the band $\varepsilon$ and the widest window $\delta$ that works at the point $x_0$ (drag it). Below: that window for every point of the domain. Uniform continuity means the lower graph doesn’t sink to zero. Compare $\sqrt x$ with $\frac1x$: both are infinitely steep near zero, but only one of them is uniformly continuous.

The graph of $\sqrt x$ on $[0, 1]$ is vertical at zero, yet the function is uniformly continuous: $|\sqrt x - \sqrt y| \le \sqrt{|x - y|}$, and $\delta = \varepsilon^2$ will do. It’s not a matter of steepness but of whether the domain has its ends. That’s what the main theorem of this section says. Many textbooks call it the Heine–Cantor theorem, others simply Cantor’s theorem: Eduard Heine published it in 1872, and Dirichlet had proved it in lectures as early as 1854.

A function continuous on a segment $[a, b]$ is uniformly continuous on it.

If there were no single $\delta$, there would be pairs of points arbitrarily close to each other but with distant values. The Bolzano–Weierstrass theorem will herd them to one point, and continuity at that point won’t allow it.

Suppose there’s no single $\delta$. By the rule for negating quantifiers (chapter 51) this means: there’s a tolerance $\varepsilon > 0$ for which no $\delta$ works. For $\delta = \frac1n$ there are points $x_n, y_n$ with $|x_n - y_n| < \frac1n$ but $|f(x_n) - f(y_n)| \ge \varepsilon$. By the Bolzano–Weierstrass theorem there’s a subsequence $x_{n_k} \to c$, with $c \in [a, b]$. Then $y_{n_k} \to c$ too: $|y_{n_k} - c| \le |y_{n_k} - x_{n_k}| + |x_{n_k} - c|$, and both terms tend to zero. The function is continuous at $c$: for the tolerance $\frac\varepsilon2$ there’s a window around $c$ where the values differ from $f(c)$ by less than $\frac\varepsilon2$. For large $k$ both $x_{n_k}$ and $y_{n_k}$ fall into it. Then $|f(x_{n_k}) - f(y_{n_k})| \le |f(x_{n_k}) - f(c)| + |f(c) - f(y_{n_k})| < \varepsilon$, contrary to the choice of the pairs. A contradiction: one $\delta$ for the whole segment exists.

The proof breaks down exactly where the theorem does. For $\sin\frac1x$ on $(0, 1]$ the pairs of points are herded towards zero, but zero isn’t in the domain, and continuity there can’t be used. Now we can pay the debt of chapter 28.

A function continuous on a segment $[a, b]$ is Riemann integrable on it.

One $\delta$ for the whole segment lets us make all the columns of the gap between the lower and upper sums low at once.

The Sceptic names $\varepsilon$. By the Heine–Cantor theorem there’s a $\delta$ such that on any piece shorter than $\delta$ the values of $f$ differ from one another by less than $\varepsilon$. Take any partition into pieces shorter than $\delta$. On each piece, by the extreme value theorem, there’s a smallest value $m_i$ and a largest $M_i$, and $M_i - m_i < \varepsilon$. The lower sum $L = \sum m_i\,\Delta x_i$ and the upper sum $U = \sum M_i\,\Delta x_i$ squeeze every Riemann sum of this partition. The gap $U - L$ is columns along the graph of width $\Delta x_i$ and height less than $\varepsilon$. Together their area is less than $\varepsilon\,(b - a)$. Any lower sum is at most any upper sum: two partitions have a common refinement, and on refining the lower sum doesn’t decrease and the upper sum doesn’t increase (chapter 28). So the lower sums have a least upper bound $I$, and $L \le I \le U$ for any partition. The Riemann sum and $I$ lie in the same interval $[L, U]$ of length less than $\varepsilon\,(b - a)$ and differ by less than that amount, for every partition finer than $\delta$ and every choice of points. So $f$ is integrable and $\int_a^b f(x)\,dx = I$.

For continuous functions on a rectangle from chapter 32 the argument is the same: the Heine–Cantor theorem in $\mathbb R^2$ is proved in the same way, with the Bolzano–Weierstrass theorem for points of the plane, and cells take the place of pieces of a segment.

Cauchy’s mistake

The sequence $x^n$ on $[0, 1]$

Habitat: the right end of the segment.

Caught by: Niels Henrik Abel in 1826, in the guise of a series of sines.

Refuted: “a limit of continuous functions is continuous”, a theorem from Cauchy’s Cours d’analyse, 1821.

Tamed: by uniform convergence.

In his Cours d’analyse of 1821 Augustin Cauchy proved: if a series of continuous functions converges at every point, its sum is continuous. Five years later Abel, in a paper on the binomial series, cautiously remarked that the theorem seemed to have exceptions, and gave the series $\sin x - \frac12 \sin 2x + \frac13 \sin 3x - \ldots$: it converges for all $x$, its sum on the interval $(-\pi, \pi)$ is $\frac x2$, and at the point $\pi$ it’s zero. The sum of continuous sines jumps. A simpler example is to hand: the functions $x^n$ on $[0, 1]$ are continuous, but their limit is $0$ for $x < 1$ and $1$ at $x = 1$.

A sequence of functions $f_n$ converges pointwise to $f$ on a set $D$ if $f_n(x) \to f(x)$ at every point $x \in D$. It converges uniformly if for every $\varepsilon > 0$ there’s an index $N$ after which $|f_n(x) - f(x)| < \varepsilon$ at all points $x \in D$ at once.

The index is chosen before the point: one for the whole set. For pointwise convergence it’s different for each $x$. All the points of the domain at once. The graph of $f_n$ lies entirely inside a tube of width $2\varepsilon$ around the graph of $f$. Equivalently: $\sup_{x \in D}|f_n(x) - f(x)| \to 0$. Example: $x^n$ on $[0, 0.9]$ tends to zero uniformly: the largest deviation is $0.9^n$, and for $\varepsilon = 0.01$ the index $N = 43$ will do, since $0.9^{44} \approx 0.0097$. On $[0, 1)$ the convergence to zero is pointwise but not uniform: for any $n$ there’s an $x < 1$ with $x^n > \frac12$.
A tube of width $2\varepsilon$ around the limit, and the function $f_n$. Move $n$ and the right end of the domain. Look for where the function pokes out of the tube for every $n$. In “bump” mode watch the area: the functions tend to zero, but the area under them doesn’t.

If all the $f_n$ are continuous on $D$ and $f_n \to f$ uniformly on $D$, then $f$ is continuous on $D$.

Split the tolerance into three parts: two go on the distance from $f$ to $f_N$, one on the continuity of $f_N$ itself.

Take a point $x_0 \in D$ and a tolerance $\varepsilon$. By uniform convergence there’s an index $N$ for which the whole graph of $f$ lies inside a tube around $f_N$ of width $\frac\varepsilon3$ on each side: $|f(x) - f_N(x)| < \frac\varepsilon3$ for all $x$. The function $f_N$ is continuous at $x_0$: there’s a window $\delta$ in which $|f_N(x) - f_N(x_0)| < \frac\varepsilon3$. In this window the way from $f(x)$ to $f(x_0)$ is made up of three short ones: $|f(x) - f(x_0)| \le |f(x) - f_N(x)| + |f_N(x) - f_N(x_0)| + |f_N(x_0) - f(x_0)| < \frac\varepsilon3 + \frac\varepsilon3 + \frac\varepsilon3 = \varepsilon$. So $f$ is continuous at $x_0$.

This shows why $x^n$ on $[0, 1]$ can’t converge uniformly: the limit is discontinuous. In Cauchy’s proof the index $N$ was tacitly chosen once for all points, that is, uniform convergence was used, though it wasn’t in his hypothesis. Historians still argue about what exactly Cauchy meant; his “infinitely small” quantities can be read in different ways. But the notion that fixes everything was singled out in the 1840s by Weierstrass in an unpublished manuscript and, independently, by Philipp Seidel and George Stokes, and in Weierstrass’s lectures it became standard. Uniform convergence is conveniently checked with one test.

Let $|u_k(x)| \le M_k$ for all $x \in D$, and let the numerical series $\sum M_k$ converge. Then the series $\sum u_k(x)$ converges uniformly on $D$.

At each point $x$ the series $\sum |u_k(x)|$ converges by the comparison test, and so the series itself converges (chapter 30); write $S(x)$ for its sum and $S_n(x)$ for a partial sum. The remainder is estimated by the triangle inequality, which for infinite sums follows from the finite ones by passing to the limit: $|S(x) - S_n(x)| = \left|\sum_{k > n} u_k(x)\right| \le \sum_{k > n} M_k$. On the right is the remainder of a convergent numerical series: it tends to zero and doesn’t depend on $x$. So $\sup_x |S(x) - S_n(x)| \to 0$.

The first debt to the monster is paid: the terms of the Weierstrass series are at most $a^n$ in absolute value, the series $\sum a^n$ converges, and the function $W$ is the uniform limit of continuous partial sums, so it’s continuous. The steps in chapters 31 and 33, where the limit of successive approximations or of a Fourier series turned out to be a continuous function, are justified the same way. What remains is term-by-term differentiation, which we allowed ourselves without proof in chapter 30.

Let the functions $f_n$ have continuous derivatives on $[a, b]$, let the numbers $f_n(a)$ converge to $A$, and let the derivatives $f_n'$ converge to $g$ uniformly on $[a, b]$. Then the $f_n$ converge uniformly to the function $f(x) = A + \int_a^x g(t)\,dt$, and $f' = g$ on $(a, b)$.

The idea: pass from derivatives to integrals, for which uniform convergence settles everything. The function $g$ is continuous as a uniform limit of continuous $f_n'$, and so it’s integrable. By the Newton–Leibniz formula (chapter 28) $f_n(x) = f_n(a) + \int_a^x f_n'(t)\,dt$. Subtract $f(x)$ and estimate the integral of the difference by the monotonicity of the integral, replacing the integrand by its largest absolute value: $|f_n(x) - f(x)| \le |f_n(a) - A| + (b - a)\sup_{[a,\,b]}|f_n' - g|$. The right-hand side tends to zero and doesn’t depend on $x$: the convergence is uniform. Finally, $g$ is continuous, and by the fundamental theorem of calculus the derivative of the integral $\int_a^x g$ with respect to its upper limit is $g(x)$ inside the segment. So $f' = g$.

If the series $\sum c_k (x - x_0)^k$ converges for $|x - x_0| < R$, then on this interval its sum is differentiable, and its derivative is $\sum k\,c_k (x - x_0)^{k - 1}$.

Take a point $x$ with $|x - x_0| < R$ and numbers $\rho < r$ between $|x - x_0|$ and $R$. At the point $x_0 + r$ the series converges, so its terms tend to zero and are bounded: $|c_k|\,r^k \le C$. On the segment $[x_0 - \rho,\ x_0 + \rho]$ the terms of the series of derivatives are estimated like this: $|k\,c_k (t - x_0)^{k - 1}| \le k\,|c_k|\,\rho^{k-1} \le \frac C\rho\,k\,q^k$, where $q = \frac\rho r < 1$. The series $\sum k q^k$ converges by the ratio test: the ratio of neighbouring terms $\frac{k + 1}{k}\,q \to q < 1$. By the Weierstrass M-test the series of derivatives converges uniformly on the segment, while the partial sums of the original series are polynomials with continuous derivatives, and they converge at the point $x_0 - \rho$. By the previous theorem the sum is differentiable inside the segment, in particular at the point $x$, and its derivative is the sum of the series of derivatives.

The functions $f_n$ are differentiable and converge to $f$ uniformly. Must $f$ be differentiable?

Take $f_n(x) = \sqrt{x^2 + \frac1n}$. They’re smooth, and $0 \le f_n(x) - |x| = \frac{1/n}{\sqrt{x^2 + 1/n} + |x|} \le \frac{1}{\sqrt n}$ for all $x$, so $f_n \to |x|$ uniformly. But $|x|$ has a corner at zero. The derivatives $f_n'$ converge to the sign of $x$, and not uniformly: hence the corner.

Taming

Back to the first monster. We’ve already proved its continuity with the Weierstrass M-test. Proving that $W$ has no derivative at any point requires long estimates of cosines. Let’s do the same for a relative that has saw-teeth instead of cosines. It was devised by the Japanese mathematician Teiji Takagi in 1903.

A saw: $s(y)$ is the distance from $y$ to the nearest integer. Its teeth are line segments with slopes $\pm1$ and height $\frac12$; the teeth of $s(2^n x)$ are $2^n$ times narrower. Each next saw is half as high. On the graph of $\frac{s(2^n x)}{2^n}$ the teeth have width $\frac1{2^{n+1}}$ and slopes $\pm1$. Example: $T\bigl(\frac12\bigr) = \frac12 + 0 + 0 + \ldots = \frac12$, since $s$ of an integer is zero. At the point $\frac13$ the numbers $\frac{2^n}{3}$ are exactly $\frac13$ from the nearest integer, and $T\bigl(\frac13\bigr) = \frac13\bigl(1 + \frac12 + \frac14 + \ldots\bigr) = \frac23$. That’s the largest value of the function.

The terms of the series are at most $\frac{1}{2^{n+1}}$, so by the Weierstrass M-test $T$ is continuous. Its graph looks like an old-fashioned blancmange pudding, and English-language books call it the blancmange function. We’ll need one lemma about chords.

If $f$ has a derivative at the point $x$, the segments $[u_k, v_k]$ contain $x$, and their lengths tend to zero, then the slopes of the chords $\frac{f(v_k) - f(u_k)}{v_k - u_k}$ tend to $f'(x)$.

If $x$ coincides with an end of the segment, the slope of the chord is an ordinary difference quotient, and it tends to $f'(x)$ by the definition of the derivative. If $u_k < x < v_k$, write the slope of the chord as a weighted average of two difference quotients: $\frac{f(v_k) - f(u_k)}{v_k - u_k} = \lambda\,\frac{f(v_k) - f(x)}{v_k - x} + (1 - \lambda)\,\frac{f(x) - f(u_k)}{x - u_k}$, where $\lambda = \frac{v_k - x}{v_k - u_k}$ lies between zero and one. Each of the two quotients tends to $f'(x)$. Their weighted average differs from $f'(x)$ by no more than the larger of the two deviations, and so it tends to $f'(x)$ too.

The Takagi function is continuous on the whole line and has no derivative at any point.

Look at the chords over the dyadic segments containing the point $x$. Their slopes are integers, and neighbouring ones differ by exactly one, so they can’t approach a single number.

Take a point $x$ and for each $n$ the dyadic segment $[u_n, v_n] = \bigl[\frac{k}{2^n},\ \frac{k + 1}{2^n}\bigr]$ of length $\frac1{2^n}$ that contains it. The segments are nested and shrink to $x$. The terms with indices $m \ge n$ are zero at the ends of this segment: the numbers $2^m u_n$ and $2^m v_n$ are integers, and the saw vanishes at integers. They contribute nothing to the difference $T(v_n) - T(u_n)$. Each term with index $m < n$ is linear on the segment $[u_n, v_n]$ with slope $+1$ or $-1$: a tooth of width $\frac1{2^{m+1}}$ is also a dyadic segment, and our segment, being no longer, lies entirely on one of its slopes. So the slope of the chord $D_n = \frac{T(v_n) - T(u_n)}{v_n - u_n}$ is a sum of $n$ terms each equal to $\pm1$: an integer of the same parity as $n$. Passing to $n + 1$, the old slopes don’t change and exactly one new term is added: $D_{n+1} = D_n \pm 1$. A sequence whose neighbouring terms differ by one doesn’t converge. But if there were a derivative at the point $x$, the slopes of the chords squeezing $x$ would tend to it by the lemma. There’s no derivative, and so at every point.

The final blow to intuition was dealt in 1931 by Stefan Banach and Stefan Mazurkiewicz. They proved independently that, in a precise sense, “almost all” continuous functions are nowhere differentiable, and smooth ones are a rare exception. The monsters turned out to be the majority, and Poincaré’s honest functions a nature reserve. Their descendants live in physics too: the path of a Brownian particle has, with probability one, no derivative anywhere (Paley, Wiener and Zygmund, 1933), and in the chapter on fractals, where jaggedness at every scale isn’t a defect but the object of study.

Every monster struck at a picture, not at logic. To deal with them took precise definitions (of the real number, continuity, convergence) and a single completeness axiom, from which all the “obvious” theorems of analysis are derived.

Where next

Thomae’s function is integrable, with integral zero, while the Dirichlet function isn’t Riemann integrable at all: every piece of any partition contains both fractions and irrational numbers, and the Riemann sums jump between $0$ and $b - a$. Yet the difference between them doesn’t seem deep. Both equal zero at all irrational points, and the fractions, as we found in chapter 52, are “few”: their set is countable, while the set of points of a segment isn’t. If the set of fractions on a segment weighs nothing, the integral of the Dirichlet function ought to be zero. What is the “length” of the set of rational points of the segment $[0, 1]$? And of the irrational ones, or of the Cantor set? To answer, we’ll have to define length afresh, and on the way we’ll meet pieces that can’t be measured at all, a ball from which two identical balls are assembled, and the final answer to the question about the circle and the square. That’s chapter 54.