The Riemann Integral and Measure Zero

Which Functions Can Be Integrated, and Exactly Why

Target Audience: Anyone who has computed integrals and wants to know what the integral actually is — and which functions have one.

Prerequisites: Limits, Continuity and Derivatives for continuity and the Mean Value Theorem, and suprema, infima and completeness — which is what every argument here ultimately rests on.

How to Read This Page

Most of calculus treats integration as a technique: find an antiderivative, evaluate it at two points. That is a way of computing integrals, not a definition of one, and it says nothing about which functions have an integral at all.

This page builds the definition from nothing — partitions, sums, a squeeze — and then asks the question that definition makes askable: which bounded functions are integrable? Sections 2 to 5 build the machinery and get a partial answer. Section 6 breaks the obvious guess. Sections 7 to 9 replace it with the exact answer, and Section 10 finally connects the integral to the derivative.

The explorer in Section 6 computes the Darboux sums in exact arithmetic and, separately, builds an explicit cover of each function’s discontinuity set. The two computations share no code. That they always agree is not a design decision — it is Lebesgue’s criterion, which the page proves later and the explorer tests first.

1. What an Integral Should Mean

The area under a curve is easy to describe and hard to define. Rectangles have areas; regions with a curved edge do not, until someone says what their area is.

The idea, before any notation

Trap the region between two things you can measure: a union of rectangles that fits inside, and one that contains it. If those two areas can be brought arbitrarily close together, the region has an area, and it is the number they close on. If they cannot, it does not.

The integral is not defined as an antiderivative

Nothing in what follows mentions differentiation. That \(\int_a^b f = G(b) - G(a)\) for an antiderivative \(G\) is a theorem, proved in Section 10, and it is surprising rather than definitional — which is why it is called fundamental.

2. Partitions and Darboux Sums

Partition

A finite set of points \(a = x_0 \lt x_1 \lt \cdots \lt x_n = b\) cutting \([a, b]\) into subintervals. The pieces need not be equal, and there is no limit involved yet — just a finite chopping-up.

Lower and upper sums

On the \(i\)-th piece let \(m_i = \inf f\) and \(M_i = \sup f\). Then

\[ L(f, P) = \sum_i m_i \,\Delta x_i, \qquad U(f, P) = \sum_i M_i \,\Delta x_i. \]

\(L\) is the inscribed rectangles, \(U\) the circumscribed ones, so \(L \leq \text{area} \leq U\) whatever the area turns out to be.

Why infimum and supremum, not minimum and maximum

A bounded function need not attain its bounds on a piece — only a continuous function on a closed interval is guaranteed that. Using \(\inf\) and \(\sup\) keeps the definition available for every bounded \(f\), which matters because the interesting cases in this material are precisely the badly behaved ones.

3. Refinement, and Why the Sums Close In

Refinement

\(Q\) refines \(P\) when \(P \subseteq Q\): every cut of \(P\) is also a cut of \(Q\).

Refining can only raise \(L\) and lower \(U\). Splitting one piece replaces a single infimum by two that are each at least as large, and a single supremum by two that are each no larger. So the gap never widens.

Every lower sum is below every upper sum

Not just for the same partition — for any two, \(L(f, P) \leq U(f, Q)\).

The trick is the common refinement \(P \cup Q\), which is finer than both: \(L(f, P) \leq L(f, P \cup Q) \leq U(f, P \cup Q) \leq U(f, Q)\). So the lower sums and the upper sums are separated as two entire families, and neither can reach past the other.

The upper and lower integrals

\[ \underline{\int_a^b} f = \sup_P L(f, P), \qquad \overline{\int_a^b} f = \inf_P U(f, P). \]

Both always exist for bounded \(f\), by the previous box plus completeness of \(\mathbb{R}\): each family is bounded by the other, so each has a supremum or infimum. \(f\) is integrable when the two agree, and \(\int_a^b f\) is that common value.

Refinement is not the same as “more pieces”

Going from \(4\) equal pieces to \(6\) is not a refinement — the cut at \(1/4\) does not survive — and the gap genuinely can grow. Only a divisibility chain (\(1, 2, 4, 8, \ldots\)) refines at every step, which is exactly what the explorer uses, and the harness behind it confirms a non-refining list really does break monotonicity.

4. The Riemann Criterion

The criterion

\(f\) is integrable if and only if for every \(\varepsilon \gt 0\) there is a partition \(P\) with

\[ U(f, P) - L(f, P) \lt \varepsilon. \]

Why this is the form you actually use

It never mentions the value of the integral. So you can establish that a function has an integral without computing anything — which is the only workable approach for a function with no closed-form antiderivative, and that is most of them.

Geometrically \(U - L\) is the total area of the fringe between the over- and under-estimates, and integrability says that fringe can be starved to nothing. For \(f(x) = x\) on \([0, 1]\) with \(n\) equal pieces, computed exactly, the gap is \(1/n\) — not approximately, exactly, at every \(n\).

5. Which Functions Are Integrable?

Continuous \(\Rightarrow\) integrable

Every continuous function on a closed bounded interval is integrable. Full proof →

Where the work actually happens

The proof is the Riemann criterion plus one imported fact: continuity on \([a, b]\) is uniform. That gives a single \(\delta\) that works everywhere at once, so once the mesh is below \(\delta\) every oscillation \(M_i - m_i\) is below \(\varepsilon/(b-a)\), and the fringe totals less than \(\varepsilon\).

Ordinary continuity would only give a \(\delta\) at each point, and those can shrink to nothing as you move along, with no single mesh fine enough everywhere. Compactness of \([a, b]\) is what rules that out, and dropping it breaks the theorem: \(1/x\) on \((0, 1]\) is continuous and unbounded.

Monotone \(\Rightarrow\) integrable

And this one uses no continuity at all. On the uniform partition the oscillations telescope, \(\sum (M_i - m_i) = f(b) - f(a)\), so

\[ U - L = \frac{\bigl(f(b) - f(a)\bigr)(b - a)}{n} \to 0. \]

A monotone function may have infinitely many jumps and is integrable regardless.

Finitely many discontinuities never matter

Each bad point can be quarantined inside a piece so narrow that its contribution to \(U - L\) is negligible — \(f\) is bounded, so the damage is a fixed height times a width you control.

A function that is not integrable

Dirichlet’s function: \(1\) at every rational, \(0\) at every irrational. Both sets are dense, so on every piece \(m_i = 0\) and \(M_i = 1\). Hence \(L = 0\) and \(U = 1\) for every partition whatsoever — the gap is exactly \(1\), and refining does nothing at all.

So the natural guess is that integrability fails when the discontinuities are spread densely through the interval. That guess is wrong, and the next section is the counterexample.

6. Two Dense Discontinuity Sets, Two Answers

Thomae’s function

\(f(p/q) = 1/q\) in lowest terms, and \(f(x) = 0\) at every irrational \(x\).

It is discontinuous at every rational — a dense set, exactly like Dirichlet’s. And it is integrable, with integral \(0\).

Why the sums close anyway

The infimum on any piece is \(0\), since the irrationals are dense. The supremum is \(1/q\) for the smallest denominator \(q\) occurring in that piece — and a narrow interval is forced to contain only fractions with large denominators. So the upper sum is small even though every piece contains infinitely many discontinuities.

So density is not the deciding property

Thomae and Dirichlet are both discontinuous on a dense set and they fall on opposite sides. Whatever separates them, it has nothing to do with how the discontinuities are spread out — and the honest position at this point is that we do not yet have the concept that decides it.

Interactive: The Integrability Explorer

Choose a function. The explorer computes the Darboux sums in exact rational arithmetic on partitions into \(1, 2, 4, \ldots, 1024\) pieces — a divisibility chain, so each one genuinely refines the last — and applies the Riemann criterion against four values of \(\varepsilon\). Separately, it builds an explicit cover of the function’s discontinuity set and reports the exact total length. The two computations share no code; that they agree is the theorem of Section 9.

The Riemann side: Darboux sums, computed exactly
    The Lebesgue side: an explicit cover of the discontinuities
      The two verdicts
        Checks the explorer runs on its own output

          Arithmetic is exact throughout, on arbitrary-precision integers: accumulating these sums pushes intermediate values past the ordinary 53-bit limit by \(n = 128\) for Thomae, and the excess would otherwise be dropped silently.

          7. Measure Zero

          Definition

          \(E \subseteq \mathbb{R}\) has measure zero when for every \(\varepsilon \gt 0\) there is a countable collection of open intervals covering \(E\) whose total length is less than \(\varepsilon\).

          Note what is being measured: not how spread out \(E\) is, but how cheaply it can be covered.

          Finite sets, and then countable ones

          Give each of \(k\) points an interval of width \(\varepsilon/(2k)\): total \(\varepsilon/2\), for any \(\varepsilon\) at all.

          For a countably infinite \(E = \{e_1, e_2, \ldots\}\), give \(e_j\) width \(\varepsilon/2^{\,j+1}\). The total is \(\varepsilon \sum_{j \geq 1} 2^{-(j+1)} = \varepsilon/2\) — a geometric series, which is why the infinite case costs no more than the finite one. Countability is the entire hypothesis.

          So the rationals have measure zero

          \(\mathbb{Q}\) is countable, so \(\mathbb{Q} \cap [0,1]\) has measure zero — despite being dense, and despite every interval containing infinitely many of its points. This is where density and size come apart for good.

          8. Heine–Borel, and Why an Interval Is Not Small

          The claim to beat

          \([0, 1]\) cannot be covered by open intervals of total length less than \(1\) — so it does not have measure zero. Full proof →

          Why this needs compactness

          For a finite cover the statement is an induction and causes no trouble. The difficulty is that the definition allows infinitely many intervals, and adding up infinitely many lengths is not something induction reaches.

          Heine–Borel closes the gap: every cover of \([0,1]\) by open intervals has a finite subcover. Compactness is exactly the tool that turns an infinite statement into a finite one, and it is doing the same job here that uniform continuity did in Section 5 — both are compactness wearing different clothes.

          A consequence worth noticing

          Countable unions of measure-zero sets are measure zero (cover \(E_n\) to total \(\varepsilon/2^{\,n+1}\) and add up). Combined with the above: \([0,1]\) is not a countable union of measure-zero sets, so it is uncountable — a second proof, quite unlike the diagonal argument.

          9. Lebesgue’s Criterion

          First, measuring discontinuity by a number

          The oscillation of \(f\) at \(x\) is \(\omega_f(x) = \lim_{\delta \to 0} \bigl(\sup_{|y-x| \lt \delta} f - \inf_{|y-x| \lt \delta} f\bigr)\), and \(f\) is continuous at \(x\) exactly when \(\omega_f(x) = 0\).

          Slicing by it, \(D_n = \{x : \omega_f(x) \geq 1/n\}\) is closed, and \(\operatorname{Disc}(f) = \bigcup_{n \geq 1} D_n\) — a countable union of closed sets, which is what makes the whole thing tractable.

          Lebesgue’s criterion

          A bounded \(f\) on \([a, b]\) is Riemann integrable if and only if \(\operatorname{Disc}(f)\) has measure zero. Full proof →

          This is the complete answer — not a sufficient condition, not a list of examples, but an exact characterisation. And it settles every case in this page at once:

          Function \(\operatorname{Disc}(f)\) Measure zero? Integrable?
          Continuous \(\emptyset\) yes yes
          Finitely many jumps a finite set yes yes
          Monotone at most countable yes yes
          Thomae \(\mathbb{Q}\) yes — countable yes
          Dirichlet \([0, 1]\) no no

          And there is the answer to Section 6

          Thomae’s discontinuity set is countable and Dirichlet’s is not. Countability is precisely what a measure-zero cover needs. Density was always a red herring; the question was how much of the interval the bad set really occupies.

          What it does not give you

          It answers existence only. It will not compute an integral, and it does not say an integrable function has few discontinuities in any everyday sense — Thomae has infinitely many, dense in the interval, and is integrable.

          10. The Fundamental Theorem

          Part 1

          If \(f\) is continuous on \([a,b]\) and \(F(x) = \int_a^x f(t)\,dt\), then \(F\) is differentiable and \(F^{\prime} = f\). Full proof →

          Part 2

          If \(f\) is integrable and \(G\) is any antiderivative of \(f\), then \(\int_a^b f = G(b) - G(a)\).

          The two proof shapes

          Part 1 is a squeeze. \(\dfrac{F(x+h) - F(x)}{h}\) is the average of \(f\) over \([x, x+h]\), which sits between the infimum and the supremum of \(f\) there; continuity collapses both onto \(f(x)\).

          Part 2 telescopes. On each piece the Mean Value Theorem supplies a point where \(G\) changes at exactly the average rate, so the sum collapses to \(G(b) - G(a)\) while sitting between \(L\) and \(U\).

          The two parts are different statements

          Part 1 needs \(f\) continuous; Part 2 needs \(f\) integrable and an antiderivative to exist. Neither implies the other without extra work, and the hypotheses are not interchangeable.

          Both joins are imperfect

          An integrable function need not have an antiderivative. A step function is integrable, but no function has it as a derivative — by Darboux’s theorem a derivative has the intermediate value property, and a jump does not. So Part 2 really does need its antiderivative as a hypothesis.

          And a derivative need not be integrable. Volterra’s function is differentiable with bounded \(F^{\prime}\) that is not Riemann integrable, built precisely so that \(\operatorname{Disc}(F^{\prime})\) fails to have measure zero. That is the cleanest argument that the Riemann integral is not the last word, and the reason the Lebesgue integral exists.

          11. Summary

          Where this sits in the plan

          This unit closes the Analysis arc: the four integration and measure proofs that Unit 14 deliberately left unlinked now have a tutorial to reach them from. Every result on this page rests on completeness of \(\mathbb{R}\) or compactness of \([a,b]\), which is why the material belongs to analysis rather than to calculus.

          12. Quick Reference

          Idea Statement What it depends on
          Darboux sums \(L = \sum m_i \Delta x_i\), \(U = \sum M_i \Delta x_i\) \(\inf\) and \(\sup\) exist — completeness
          Refinement \(L\) rises, \(U\) falls \(P \subseteq Q\), not merely more pieces
          Integrable \(\sup_P L = \inf_P U\) the two families are separated
          Riemann criterion \(\exists P: U - L \lt \varepsilon\) equivalent to the above
          Continuous \(\Rightarrow\) integrable on \([a,b]\) uniform continuity, i.e. compactness
          Monotone \(\Rightarrow\) integrable \(U - L = \dfrac{(f(b)-f(a))(b-a)}{n}\) telescoping — no continuity used
          Measure zero covers of total length \(\lt \varepsilon\) countability, and a geometric series
          \([0,1]\) is not measure zero every cover totals \(\geq 1\) Heine–Borel
          Lebesgue’s criterion integrable \(\iff\) \(\operatorname{Disc}(f)\) measure zero oscillation, and the \(D_n\) slicing
          FTC Part 1 \(F(x) = \int_a^x f \Rightarrow F^{\prime} = f\) \(f\) continuous; a squeeze
          FTC Part 2 \(\int_a^b f = G(b) - G(a)\) \(f\) integrable, \(G\) an antiderivative; the MVT

          Review Material for This Page