Analysis

A limit can jump at every fraction

A sequence of continuous functions can settle, point by point, on a function that is discontinuous at every rational number. It cannot settle on one that is discontinuous everywhere — the indicator of the rationals needs two limits in a row, and Riemann's integral cannot follow the second. The line between the two is Baire's theorem, and it measures smallness by gaps rather than by length.

Worth reading first: A limit that forgets to be continuous · Countable, and everywhere.

The functions x,x2,x3,x, x^2, x^3, \ldots are each as smooth as a function can be, and at every point of the interval they settle — on 0 to the left of 1 and on 1 at 1. The limit has a jump. One jump at one point, created by a sequence with none, was the first sign that a pointwise limit does not inherit continuity.

The obvious next question is how many jumps a limit can have. One is possible. A function with a jump at every fraction would be far worse, and a function discontinuous at every point worse still. Both can be written down. Only one of them can be reached by a single limit of continuous functions.

Thomae's function as a limit of tents, at n = 3 and 8. Continuous functions built from narrow triangles over the fractions, drawn at two stages, with the limit shown as a dot at height 1/q over every fraction p/q: a function continuous at the irrationals and discontinuous at the rationals.
Fig. 1 Continuous functions made of tents: over each fraction p/qp/q with qq up to nn, a triangle of height 1/q1/q, narrowing as nn grows. At every fraction the values settle on 1/q1/q and at every irrational on 00; the dots are the limit, drawn at the fractions with denominator up to 2424.

The limit here is Thomae’s function. It is 1/q1/q at the fraction p/qp/q in lowest terms and 00 at every irrational number. It is discontinuous at every fraction — the value there is 1/q1/q, while arbitrarily close by there are irrationals where it is 00 — and continuous at every irrational. It jumps on a set that is dense, meeting every interval however short, and it is nevertheless a pointwise limit of continuous functions.

Building it out of tents

The approximating functions are built from nothing but triangles. For each nn, put a tent over every fraction p/qp/q with qnq \le n: height 1/q1/q at the fraction, falling linearly to 00 at distance 1/(nq2)1/(nq^2) on either side. The nn-th function takes, at each point, the height of the tallest tent over it. It is continuous, since it is the largest of finitely many continuous functions.

Two things have to be checked, and the figure checks both before drawing. At a fraction p/qp/q, once nn has reached qq, the tent over p/qp/q gives the value 1/q1/q, and no other tent reaches that point. Another fraction a/ba/b lies at least 1/(qb)1/(qb) away — two different fractions cannot be closer than one over the product of their denominators — while its tent is only 1/(nb2)1/(nb^2) wide, which is smaller whenever nqn \ge q. So from that stage on the value at p/qp/q is exactly 1/q1/q, and the limit there is 1/q1/q.

At an irrational point xx the limit is 00. Fix a threshold 1/k1/k. Only finitely many fractions have denominator at most kk, and xx is some positive distance from all of them; once nn is large, their tents have shrunk out of reach of xx, and every other tent that could reach xx has height below 1/k1/k. So eventually the values at xx are below 1/k1/k, for every kk.

The picture shows the price. At n=3n = 3 the tents are wide and there are five of them; at n=8n = 8 there are twenty-three, the tall ones narrow and the short ones narrower. The convergence is as far from uniform as it could be. Every function has height 11 at 00 and 11, and near every fraction there is a tent that has not yet become thin enough.

Measuring a jump

The tool that separates the possible from the impossible is the size of the jump at a point. The oscillation of ff at xx is how much ff varies on small intervals around xx — the gap between its largest and smallest values there, in the limit as the interval shrinks. It is 00 exactly where ff is continuous. At a fraction p/qp/q Thomae’s function has oscillation 1/q1/q; at an irrational, 00.

Where each function jumps by at least 1/5. Two panels. Left, Thomae's function with the fractions of denominator at most 5 marked as the only points where it jumps by that much. Right, the indicator of the rationals, which jumps by 1 everywhere, with the whole interval marked.
Fig. 2 Left: Thomae’s function, with the points where it jumps by at least 1/51/5 marked. They are the 1111 fractions with denominator at most 55, finitely many with gaps between them. Right: the function that is 11 at every fraction and 00 elsewhere jumps by 11 at every point, so the set where it jumps by at least any threshold is the whole interval.

For any threshold 1/k1/k, the set where the oscillation is at least 1/k1/k is always closed: if points jumping by that much crowd towards a point, the jumping crowds towards it too. What varies is how large the set is. For Thomae’s function it is finite — the fractions with denominator at most kk — and so it is closed and contains no interval. The whole discontinuity set is the union of these, one for each kk: a countable union of closed sets with no interval inside any of them.

For the indicator of the rationals the picture on the right is the opposite extreme. Every interval contains fractions, where the function is 11, and irrationals, where it is 00, so the oscillation is 11 at every point. The set where it jumps by at least a half is the whole interval.

That difference is exactly what Baire’s theorem is about.

Baire’s theorem, and why it has to hold

René Baire proved in his thesis of 1899 that for a pointwise limit of continuous functions, the set where the oscillation is at least 1/k1/k contains no interval, for any kk. Consequently the discontinuity set is a countable union of closed sets with no interval in them, and — by a second theorem also named after Baire — such a union cannot fill any interval. So a pointwise limit of continuous functions is continuous at a dense set of points.

The proof is a squeeze, and the step that matters is the one where continuity of the approximants is used. Suppose the limit ff had oscillation at least 1/k1/k at every point of some interval II. Fix a small ε\varepsilon and, for each NN, collect the points of II where all the members from NN onwards stay within ε\varepsilon of one another. Each of these collections is closed, because the members are continuous. And together they cover II, because at every point the sequence settles. A closed interval cannot be a countable union of closed sets with no interval in them — that is the category theorem, proved by nesting intervals — so one of the collections contains an interval JJ.

On JJ, then, ff stays within ε\varepsilon of the single continuous function fNf_N. A continuous function varies by less than ε\varepsilon on a small enough subinterval, so ff varies by less than 3ε3\varepsilon there. With ε\varepsilon below 1/(3k)1/(3k), that contradicts the oscillation being at least 1/k1/k everywhere on II.

Thomae’s function passes the test, since its sets are finite. The indicator of the rationals fails it at the first threshold. So no sequence of continuous functions converges at every point to the indicator of the rationals. Nor could any sequence converge to a function continuous exactly at the rationals and nowhere else. Its continuity points would be the fractions, a countable set, and the proof shows that the continuity points of a limit are what remains after removing countably many closed sets with no interval in them — a set that no countable list can exhaust, by the same nesting of intervals that shows a countable set can be everywhere and still leave almost everything out. The rationals can be where a limit jumps; they cannot be where it is continuous.

The theorem has a consequence for a subject that seems to have nothing to do with sequences. Every derivative is a pointwise limit of continuous functions. If FF is differentiable, its derivative at xx is the limit of the difference quotients n(F(x+1/n)F(x))n\,(F(x + 1/n) - F(x)), and each of those is continuous in xx because FF is. So every derivative is continuous at a dense set of points, however wild it is elsewhere. A derivative can exist everywhere and be discontinuous at many points — the standard example is built from x2sin(1/x)x^2 \sin(1/x) — but no function differentiable everywhere has a derivative that jumps at every point, and in particular the indicator of the rationals is nobody’s derivative. The restriction was proved by looking at a derivative as the end of a sequence rather than as a slope.

Thin is not the same as short

Baire’s theorem says a limit’s discontinuities are thin. It is tempting to read that as small in length, and that reading is wrong.

A set with no interval in it, half the line long, and continuous functions falling to it. The fat Cantor set after several rounds of cutting drawn as bars below the axis, with continuous tent-like functions that equal 1 on the set and fall steeply off it, converging to its indicator.
Fig. 3 The set left after 44 rounds of removing ever-smaller middle pieces: 1616 pieces, total length 0.5310.531, heading for a half with no interval left inside the limit. Continuous functions equal to 11 on the set and falling steeply off it converge to its indicator, which jumps at every point of the set.

Remove the middle quarter of the interval, then the middle sixteenth of each of the two pieces left, then the middle sixty-fourth of each of the four after that, and so on. The total removed is 14+216+464+=12\tfrac14 + \tfrac{2}{16} + \tfrac{4}{64} + \cdots = \tfrac12, so the set that remains has length one half. Yet it contains no interval, since every interval eventually has a middle piece removed from it.

Its indicator — 11 on the set, 00 off it — is a pointwise limit of continuous functions: take max(0,1kd(x))\max(0, 1 - k\,d(x)), where d(x)d(x) is the distance from xx to the set. On the set these are all 11; at a point off it the distance is positive, and for large kk the value is 00. And the indicator is discontinuous at every point of the set, because every point of the set has points off it arbitrarily close.

So a pointwise limit of continuous functions can be discontinuous on a set of positive length — here half the interval. What Baire’s theorem forbids is a discontinuity set that is thick in the sense of containing intervals within every threshold’s set, and the fat Cantor set, for all its length, contains none. Length and category are independent measures of size, and a set can be large by one and small by the other.

The same function is the standard example in the essay on which functions can be added up: its discontinuities have positive length, so Riemann’s integral cannot handle it. Riemann’s integral cares about length; Baire’s theorem cares about gaps. One function sits on opposite sides of the two lines.

Two limits in a row

The indicator of the rationals is not a single limit of continuous functions, but it is a limit of limits.

A limit of limits: cos(m!πx) to the power 2n, for m = 2 and 3. Panels for m = 2, 3 each showing the functions cos(m!πx)^(2n) at several n, narrowing onto spikes at the multiples of 1/m!, which are marked. As m increases the spikes fill in the rationals.
Fig. 4 cos(m!πx)\cos(m!\pi x) raised to the power 2n2n, for n=1n = 1, 66 and 6060, one panel for each mm. As nn grows it keeps the value 11 only at the multiples of 1/m!1/m!, which are marked. Each panel’s limit has finitely many spikes; as mm grows the spikes arrive at every fraction.

Fix mm. The function cos(m!πx)\cos(m!\pi x) is ±1\pm 1 exactly where m!xm!\,x is a whole number, and strictly between 1-1 and 11 everywhere else. Raise it to a high even power: the value 11 survives at those points and everything else collapses towards 00. So as nn grows, cos2n(m!πx)\cos^{2n}(m!\pi x) converges at every point to the function that is 11 at the multiples of 1/m!1/m! and 00 elsewhere — a function with finitely many spikes, three at m=2m = 2 and seven at m=3m = 3.

Now let mm grow. Every fraction p/qp/q is a multiple of 1/m!1/m! as soon as mqm \ge q, because qq divides m!m!, and once it is, it stays one. An irrational number is never a multiple of anything of the form 1/m!1/m!. So the spike functions converge, at every point, to 11 on the rationals and 00 on the irrationals.

This is the start of Baire’s hierarchy. The continuous functions are class zero; their pointwise limits are class one, which includes Thomae’s function and the fat Cantor indicator; limits of class-one functions are class two, which includes the indicator of the rationals; and so on. Henri Lebesgue showed in 1905 that the hierarchy never stops: every level, through every countable stage, contains functions that the levels below it do not.

Where Riemann’s integral loses track

The double limit has a consequence for integration that was one of the historical reasons for replacing Riemann’s integral.

Upper sums of the spike functions, and of their limit. Upper Riemann sums against the number of equal pieces for the spike functions at m = 2, 3, 4, falling towards zero, and for the indicator of the rationals, fixed at 1 with the lower sum fixed at 0.
Fig. 5 Upper sums on NN equal pieces, for NN up to 200200. For the spike functions at m=2m = 2, 33 and 44 they fall towards 00, so each has integral 00. For the indicator of the rationals every piece contains a fraction and an irrational, so the upper sum is 11 and the lower sum 00 on every partition.

Each spike function is zero except at finitely many points, and a function like that has upper and lower sums closing on zero: the pieces containing a spike number at most twice the spikes, each of width 1/N1/N, so the upper sum is at most a fixed number divided by NN. The curves in the figure are jagged — the upper sum jumps when a spike lands on the boundary between two pieces and is counted in both — but all three fall to 00. Every spike function has Riemann integral 00.

The spike functions increase towards the indicator of the rationals, each one 11 at every point where the previous one was. It would be natural for the limit’s integral to be the limit of the integrals, 00. But the limit has no Riemann integral at all. Every piece of every partition contains a rational and an irrational, so its upper sum is always 11 and its lower sum always 00, and the two never meet.

Lebesgue’s integral repairs exactly this. For an increasing sequence of functions its monotone convergence theorem guarantees that the integral of the limit is the limit of the integrals, and the rationals have length zero, so the indicator of the rationals has Lebesgue integral 00 as it should. Riemann’s integral was not wrong about any function it could handle; it was unable to follow a limit that stays inside the functions it could handle at every stage and leaves them only at the end.

What the pictures cannot show

Every figure here is drawn on a finite grid. Thomae’s function is shown as dots at the fractions with denominator up to 24, which is a sample of a function defined at uncountably many points and nonzero at countably many. The indicator of the rationals is drawn as two dashed levels, because it cannot be drawn at all: at the resolution of any picture it looks like a filled band, and the band is misleading, since the set of points at the top has length zero.

The figure of the double limit shows two values of mm, and the second limit is the whole content of the claim. Nothing drawn establishes what happens at m=100m = 100; the argument that it converges to the indicator of the rationals is the sentence about qq dividing m!m!.

Nor can a picture show category. That the fat Cantor set contains no interval is visible after four rounds only as small gaps, and the set after four rounds does contain intervals — sixteen of them. The claim is about the limit of the construction, and it is proved by noting that each remaining piece has a middle removed at the next round, not by looking. The ordinary middle-thirds set would look the same at this resolution and has length zero, so the drawing cannot even distinguish the two measures of size the section on thin sets separates.

The question it leaves: what one limit still guarantees

A single pointwise limit of continuous functions can be badly discontinuous, but not arbitrarily so; the discontinuities are thin in Baire’s sense and may still be long. That leaves the other half of the question the first picture of xnx^n raised. The convergence there failed to be uniform on a strip next to 1, and the strip could be taken as short as anyone liked.

Is that general? Egorov’s theorem says it is, on any interval: pointwise convergence of continuous functions — indeed of any measurable ones — is uniform once a set of arbitrarily small length is removed. And Lusin’s theorem says the analogous thing about a single function, that even the indicator of the rationals becomes continuous once a small enough set is thrown away. Both are about length rather than category, the other measure of smallness, and both are drawn in the essay on convergence that is uniform except on a small set.

The two answers are complementary rather than competing. Baire’s theorem says the bad set of a limit is thin in category and can be long; Egorov’s says the set where the convergence fails to be uniform can be made short and, as the fat Cantor set suggests, need not be thin. Neither measure of size is the right one in general. Which one a proof needs depends on whether it is about continuity — gaps — or about integrals, where only length counts. The guarantee that a bounded family with a shared bound on its steepness has a convergent subsequence is a third kind of answer, where the smallness is built into the hypothesis rather than extracted from the conclusion.

Two measures of small

The theme of this page is that a pointwise limit is controlled, and the control is of a particular kind. The jumps of a limit of continuous functions can be at every fraction, dense in the interval, and they can fill half its length. What they cannot do is fill an interval at any fixed size of jump, and that restriction is sharp: the indicator of the rationals violates it at every point, and needs a second limit to be reached.

The cost of that second limit is visible in the integral. Riemann’s integral follows the first limit and loses the second. Lebesgue’s follows both, because it measures sets by length and the rationals have none. Each extra limit the hierarchy allows makes a strictly larger class of functions, and the whole structure rests on the argument about oscillation, where continuity of the approximants turned a covering by closed sets into an interval on which the limit could not jump.

It is worth setting that beside the rest of the subject. Uniform convergence is the strong hypothesis under which continuity passes to the limit, and a curve with a corner at every point is built as a uniform limit so that it is continuous for free. Reading a power series at the edge of its interval needs continuity up to the boundary, and Abel’s theorem supplies it. Here the hypothesis is only pointwise, and continuity does not pass — but a large set of continuity points survives anyway, which is the most that could be hoped for from a hypothesis this weak and exactly what Baire proved.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Baire categoryCantor setContinuityCounterexampleNowhere denseOscillationPointwise convergenceRational numberRiemann sumUniform convergence