∫Analysis, Built

Book II · Real and Complex Analysis

Part 6 of 10

Lᵖ, Hilbert Space and the Geometry of Functions

Graduatestarts at this level41 min of film17 chaptersprerequisites: Part 3, Part 5

Which distance between functions is the right one, and why is the square-integral distance special?

The part opens with three ways to measure a vector, the diamond, the circle and the square, and with continuous ramps that form a Cauchy sequence in the area distance and close in on a step that is not continuous: the hole that L^1 fills. Jensen's inequality and Young's two areas give Hoelder and Minkowski, so the p-norms are distances, and Riesz and Fischer's summable steps, run on the same ramps, show that L^p is complete. The turn is the parallelogram law: of all the L^p spaces only L^2 has angles, and with them come the nearest point of a closed convex set, functionals as inner products, and orthonormal bases with Bessel and Parseval. That answers the Fourier question in L^2, while Fejer's positive kernel gives uniform convergence for continuous functions. The second half applies the Hilbert space to measures: von Neumann's proof of Radon-Nikodym, the dual of L^p and of C(X), Lebesgue's differentiation theorem by the maximal function, and absolute continuity as the exact condition for the fundamental theorem of calculus, with the Cantor function as the failure. It ends with the change of variables formula and the Gaussian integral.

What you need. Linear algebra: inner products and orthogonal projection in R^n.

What you will be able to do

Undergraduate

  • Compute p-norms of vectors and of simple functions, and use the parallelogram law to test whether a norm comes from an inner product.
  • Project a function onto a finite-dimensional subspace of L^2 by the normal equations or by Gram-Schmidt, and check that the error is perpendicular to the subspace.

Graduate

  • Prove Hoelder and Minkowski from Young's inequality, and Riesz-Fischer from the limit theorems of Part 5.
  • Prove the projection theorem from the parallelogram law, and derive the Riesz representation and the equivalent forms of completeness of an orthonormal set (Parseval).

Qualifying exam

  • Prove Radon-Nikodym by von Neumann's Hilbert space argument and deduce that the dual of L^p is L^q for finite p.
  • Prove the Hardy-Littlewood maximal inequality from the covering lemma, deduce Lebesgue's differentiation theorem, and characterize absolutely continuous functions as integrals of their derivatives.

Applications

  • Compute a least-squares approximation in an orthonormal basis, and say why it beats a Taylor polynomial over an interval.
  • Choose between partial sums and Fejer means of a Fourier series, knowing which converges in which norm and which one overshoots at a jump.

Contents

Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 18 min · Graduate 34 min · Qualifying exam 41 min · Applications 22 min.

  1. 0Which distance between functions?Undergraduate3 min
  2. 1Convex functions and Jensen's inequalityUndergraduate2 min
  3. 2Young, Hoelder and MinkowskiUndergraduate3 min
  4. 3The spaces L^pGraduate2 min
  5. 4L^p is completeGraduate3 min
  6. 5Inner products and the parallelogram lawUndergraduate3 min
  7. 6The nearest pointUndergraduate3 min
  8. 7Every functional is an inner productGraduate3 min
  9. 8Orthonormal bases, Bessel and ParsevalUndergraduate3 min
  10. 9Fourier series in L^2, and FejerApplications3 min
  11. 10Complex measuresGraduate2 min
  12. 11The Radon-Nikodym theoremQualifying exam2 min
  13. 12The dual of L^pQualifying exam3 min
  14. 13Differentiating measuresQualifying exam2 min
  15. 14The fundamental theorem, for LebesgueGraduate2 min
  16. 15Change of variablesApplications2 min
  17. The sixth row of the ledgerAll tracks2 min

Also on this page: Lecture · Key results · Try it · Lab · Notes and sources · Build the film.

Lecture

The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.

Which distance between functions?Undergraduate3 min

Five rows of the ledger are filled. Part 5 built Lebesgue's integral. Part 6 uses it to measure distances between functions, and finds that one of those distances has the geometry of the plane: lengths, angles, and right triangles.

How long is a vector? In the plane we have a choice. Add the sizes of the coordinates, or take the square root of the sum of squares, or just the largest coordinate. The vectors of length one form a diamond, then a circle, then a square, and in between the p-norms, for every p from one to infinity. The same vector has three different lengths. Functions have the same choice. A tall spike and a flat line have the same area, but the spike has twice the L two size and four times the height. So which distance between functions is the right one? Each answers a different question, and this part is about all of them, and about one that's special.

Here's the problem that forces Lebesgue's integral on us. Measure the distance between two continuous functions by the area between their graphs. Steeper and steeper ramps: the area between a ramp and the step is one over four n. The ramps get closer to each other too, so they form a Cauchy sequence. On the camera, each function is one point, plotted by its integrals over the two halves, and the points close in. But on what? A limit would have to be at area distance zero from the step: zero on the left half, one on the right. No continuous function does that. The continuous functions, under this distance, have a hole. Filling it takes exactly the functions Lebesgue's integral can handle, and that's the space L one.

Here's the plan, following chapters three, four, six and seven of Rudin's Real and Complex Analysis. First the inequalities that make the p-norms into distances, and the theorem that the spaces are complete. Then the case p equals two, a Hilbert space, where we can project, find bases, and finally answer the Fourier question. Then measures that take signs and complex values, densities, dual spaces, and the fundamental theorem of calculus, rebuilt for Lebesgue's integral.

1Convex functions and Jensen's inequalityUndergraduate2 min

A function is convex if every chord lies above its graph: at each point between x and y, the straight line is at least as high as the function. Here's the exponential. Slide along the chord, and the red gap between chord and graph never goes negative. An equivalent form: take three points. The slopes of the three chords increase, from left to right. So at every point the graph is pinned between two chords, and a convex function on an open interval is automatically continuous.

Now put weights on several points of the curve, orange, adding up to one. Their center of mass is the yellow dot. It sits inside the shaded hull of the points, and so above the curve: the function of the average is at most the average of the function. Shift the weights around and the inequality holds every time. That's Jensen's inequality, and with a probability measure it reads: phi of the integral of f is at most the integral of phi of f. The proof is one picture: a straight line below phi, touching it at the average, integrated.

One corollary you know. Put the points log one, log eight and log twenty-seven on the exponential curve, with equal weights. The center of mass is at height twelve, the average of one, eight and twenty-seven. The curve below it is at height six, the cube root of their product. The geometric mean is at most the arithmetic mean, for any positive numbers. With unequal weights, one over p and one over q, the same line says: e to the s over p plus t over q is at most e to the s over p, plus e to the t over q. That single line is the engine of the next chapter.

2Young, Hoelder and MinkowskiUndergraduate3 min

Three inequalities, and the pictures that prove them. Pick conjugate exponents, p and q, with one over p plus one over q equal to one: here three and three halves. Young's inequality says a b is at most a to the p over p, plus b to the q over q. The proof is a picture. Draw y equals x to the p minus one. The orange area under it, up to a, is a to the p over p. The blue area to its left, up to height b, is b to the q over q, because the inverse function is y to the q minus one. Together the two areas cover the rectangle a by b, with something left over. Move b. The leftover shrinks to zero exactly when the corner of the rectangle sits on the curve, and then grows again on the other side. It never goes negative.

Hölder's inequality: the integral of f times g is at most the p-norm of f times the q-norm of g. With p equal to two, it's the Cauchy-Schwarz inequality. The proof is Young's inequality, applied at every point. First scale both functions so their norms are one. Then at each x, the product F G sits below the yellow curve, Young's right hand side. Integrate. The yellow curve has integral exactly one over p plus one over q, which is one, so the purple area is at most one: here 0.594. Scale back, and that's Hölder.

The third inequality makes the p-norm a distance: Minkowski's triangle inequality. Rudin derives it from Hölder in two lines, but here's what it means. Take two vectors on the unit sphere for p equal to three. The point halfway between them lies inside the ball. That's convexity of the ball, and it's the triangle inequality in disguise: f plus g, divided by the sum of the norms, is an average of two unit vectors, so it lies in the ball. For p below one, the formula still makes sense, but the ball caves in. The midpoint of these two unit vectors has size two, and the triangle inequality fails. That's why p runs from one to infinity.

3The spaces L^pGraduate2 min

The spaces L p, and what their points really are. The p-norm of a function is the p-th root of the integral of its absolute value to the p. The infinity norm is the essential supremum: the smallest bound that holds almost everywhere. Take f of x equals two x, but with one wild value: five, at the single point 0.3. As p grows, the p-norm rises: one, then 1.155, then on toward two. The integral gives more and more weight to where the function is largest. The limit is two, not five. The spike sits on a set of measure zero, and no integral can see it. So the essential supremum is two.

That spike raises an honest question: what is a point of L p? Change a function at nine points, or at any set of measure zero. Every integral stays the same, so the distance between the two is zero. Then the p-norm isn't quite a norm on functions: a function with norm zero is only zero almost everywhere. The fix is to call two functions the same when they agree almost everywhere. A point of L p is such a class, and on the classes the p-norm is a genuine norm. The price: an element of L p has no value at a single point. Chapter 13 will get values back, almost everywhere.

Which spaces contain which? Near zero, x to the minus a half has a finite integral, two, but its square, one over x, doesn't: the integrals grow like the log of one over epsilon. So it's in L one, not in L two. Tall spikes break the higher norms. Out at infinity it's the other way. One over x has infinite integral, but its square has integral one. Long tails break the lower norms. On the whole line, neither space contains the other. On a space of finite measure there are no long tails, and Hölder gives the inclusion: the higher p, the smaller the space.

4L^p is completeGraduate3 min

The theorem of Riesz and Fischer, from 1907. L p has no holes. Riesz-Fischer: L p is complete, for every p from one to infinity. Here's the plan of Rudin's proof. Start with a Cauchy sequence. Pick a subsequence so fast that the steps between its terms are smaller than one half, one quarter, one eighth, and so on. Add up the absolute values of those steps into one function g. By Minkowski, every partial sum has norm less than one, and monotone convergence passes to the whole sum. A function with finite norm is finite almost everywhere. So at almost every point the steps are summable, and the subsequence converges there, to a function f. Finally Fatou's lemma turns the Cauchy condition into convergence in norm. The only tools are the three limit theorems of Part 5, which is why Riemann's integral couldn't do this.

Let's run the proof on the ramps from the beginning of this part. The subsequence one, two, four, eight is fast enough: the step from ramp n to ramp two n has area one over eight n. Stack those steps on top of the first ramp. Each layer is a thin sliver near one half, and the stack grows toward a bounded function g. The areas of the layers form a geometric series, adding up to a quarter, so g has finite integral. So the telescoping series converges, at every point except one half, and its sum is the step. The hole from the hook is filled, by a function in L one.

The ramps show something else. Continuous functions with compact support are dense in L p, for every finite p: every function in L p is a limit of them, as the step is a limit of ramps. Infinity is the exception. In the sup norm, every ramp stays at distance one half from the step: the yellow tube of half-width one half. In fact any continuous function, near one half, can't be close to zero on the left and close to one on the right. And uniform limits of continuous functions are continuous, as Part 3 showed, so the continuous functions are a closed subspace of L infinity, not a dense one. Simple functions take over there.

5Inner products and the parallelogram lawUndergraduate3 min

Inner products, where distances come with angles. An inner product is a way to multiply two vectors and get a number: symmetric, after a complex conjugate, linear, and positive. On L two, it's the integral of f times the conjugate of g, and its norm is the square root of the inner product of f with itself. The Cauchy-Schwarz inequality comes straight from positivity. Take x equals e to the t and y equals t, on the unit interval. The squared distance from x to lambda times y is a quadratic in lambda, and it can never go below zero. Its minimum, at lambda equals three, is 0.1945. A quadratic that stays positive has a negative discriminant, and that's Cauchy-Schwarz. It also means the ratio of the inner product to the two lengths is a cosine. In L two, e to the t and t meet at an angle of 14.3 degrees.

Which norms come from an inner product? The test is a fact about parallelograms: the squares of the two diagonals add up to the squares of the four sides. With the ordinary length, turn the parallelogram any way you like and the two sides of the equation agree. Measure with the taxicab norm instead, and they don't. For functions: x and one minus x squared, in L p of the unit interval. For p equals one and three, the law fails; for p equals two it holds, to every digit. And the law is exactly the test: when it holds, the polarization formula defines an inner product that gives back the norm. So of all the L p spaces, only L two has angles.

A complete inner-product space is a Hilbert space, and almost all of the plane's geometry carries over. Dot products become integrals. Lengths become norms, and the space is complete. Pythagoras holds for perpendicular functions. And the next three chapters carry over three more facts: nearest points, functionals as vectors, and orthonormal bases. One thing does not survive. In L two of the unit interval, take e n equal to root two times sine of n pi x. Each has norm one and any two are perpendicular, so by Pythagoras they are all at distance root two from each other: no subsequence can converge, and the closed unit ball is not compact. Compactness is the price of infinitely many dimensions.

6The nearest pointUndergraduate3 min

Nearest points, the first theorem that needs both the angle and the completeness. The projection theorem. A closed convex set in a Hilbert space has exactly one point nearest to any given x. Let delta be the distance from x to the set. By definition there's a sequence of points in the set whose distances to x approach delta. Here's the key: the parallelogram law, applied to x minus y n and x minus y m. The midpoint of y n and y m lies in the set, because the set is convex, so it's at least delta from x. That squeezes the distance between y n and y m to zero: the minimizing sequence is Cauchy. The table shows each gap under its bound. Completeness gives a limit, and since the set is closed, the limit is in it. It's the nearest point, and the same inequality shows there's only one.

Uniqueness is where the inner product earns its keep. Grow a ball around the origin until it first touches a line. The round ball touches at one point. The diamond of the one-norm can arrive flat against the line, and then every point of a whole segment is nearest. The parallelogram law is what rules this out: it makes the ball strictly round.

When the convex set is a closed subspace, the nearest point is the orthogonal projection, and the error is perpendicular to the whole subspace. Project e to the x onto the quadratics, in L two of the unit interval. Perpendicular to one, x and x squared gives three linear equations, and their matrix is the Hilbert matrix of inner products of powers. The solution is the best quadratic in the mean-square sense, the yellow curve, almost on top of e to the x. Its error, magnified below, crosses zero three times, and its inner products with one, x and x squared vanish to rounding. For comparison, the Taylor quadratic is fifteen times worse in this norm. Taylor fits one point; projection fits the whole interval. Every vector splits uniquely into a piece in the subspace and a piece perpendicular to it.

7Every functional is an inner productGraduate3 min

In a Hilbert space, every bounded linear functional is an inner product with one fixed vector.

Start in the plane. A linear functional, two x one plus x two, is best drawn as a stack of parallel lines, its level sets, with the zero level, the kernel, in yellow. The value at a point counts how many lines you've crossed to get there. And there's a vector hiding in the stack: y equals two, one, perpendicular to the lines. At every point, the functional equals the inner product with y. The norm of the functional, its largest value on the unit circle, is the length of y, root five. Riesz's theorem says this picture holds in every Hilbert space.

The theorem: every bounded linear functional on a Hilbert space is the inner product with a unique vector y, and the norm of the functional is the length of y. The proof follows the picture. The kernel is a closed subspace. If it's not everything, the projection theorem gives a unit vector z perpendicular to it. For any x, this combination is in the kernel: apply lambda and it cancels. So it's perpendicular to z. Expand, and lambda of x is the inner product of x with the conjugate of lambda z, times z. The representing vector is the normal to the kernel, scaled.

Now a functional on L two of minus one to one: lambda of f is the integral of f times a hidden weight w. Can we find w just by testing lambda? Feed it the orthonormal Legendre polynomials, which chapter eight will build, and record the numbers lambda of e n. Then the sum of those numbers times e n converges to the representing vector. With two terms it's crude; with six it's close; with ten the largest error is ten to the minus five. And it's w, exactly as the theorem promised. The norm of the functional is the length of w, 1.7595.

Boundedness matters. Evaluating at zero isn't a bounded functional on L two. The tall thin bumps, root n on an interval of length one over n, all have norm one, but their values at zero grow like root n. No vector y can represent evaluation, which is no surprise: in L two, the value at a single point isn't even defined. On the continuous functions with the sup norm, evaluation is bounded, but that space has no inner product. Its functionals turn out to be measures, in chapter twelve.

8Orthonormal bases, Bessel and ParsevalUndergraduate3 min

Orthonormal bases, and Pythagoras with infinitely many sides. To make perpendicular vectors out of any independent ones, Gram-Schmidt subtracts shadows. Take the next vector, remove its projection onto what you already have, and what's left is perpendicular. Scale it to length one. Do it to the powers one, x, x squared and so on, in L two of minus one to one. The constant becomes one over root two. x is already perpendicular to it. x squared loses its shadow on the constant, a third, and becomes a multiple of three x squared minus one. Continue, and out come the Legendre polynomials, each one perpendicular to all the others. The computed functions agree with Legendre's formulas to twelve digits.

Now expand a function in an orthonormal set: the sign function, whose squared norm is two. Its coefficients are its inner products with the Legendre polynomials. The partial sum is the projection onto the first N of them, and the error is perpendicular to it. So we have a right triangle: f is the hypotenuse, the partial sum and the error are the legs. Pythagoras: the squares of the coefficients add up to the squared length of the partial sum, which can never exceed the hypotenuse, two. That's Bessel's inequality. Watch the bar fill: one and a half from the first coefficient, then 1.72, 1.85, 1.92, and 1.97 with forty polynomials. The red leftover is the squared error, and it keeps shrinking.

When does the bar fill completely? Rudin's theorem gives four equivalent answers. The orthonormal set is maximal, or its finite combinations are dense, or Parseval's identity holds for every vector, or inner products can be computed from coefficients. Then the Hilbert space is just a copy of the space of square-summable sequences. And the other direction is free: any square-summable coefficients define a vector, because the tails of the series have small norm, and the space is complete. Without maximality, Parseval fails. Remove e one from the Legendre polynomials, and the function x is perpendicular to everything left: all its coefficients are zero, but it isn't. Every Hilbert space has a maximal orthonormal set, by Hausdorff's maximality principle; that step is pure logic, with no picture. A separable one has a countable one, from Gram-Schmidt.

9Fourier series in L^2, and FejerApplications3 min

The exponentials e to the i n t are orthonormal in L two of the circle. Are they maximal? If so, the last chapter's theorem answers the Fourier question at once. Rudin's proof uses a bump made from a trigonometric polynomial: one plus cosine t, over two, to the power k, scaled to have average one. As k grows it narrows onto zero. Convolving a continuous function with it averages the function over a shrinking window, and the result is a trigonometric polynomial. On the absolute value, the largest error falls from 0.93 to 0.07. So trigonometric polynomials are uniformly dense in the continuous functions, and those are dense in L two. Nothing nonzero is perpendicular to every exponential: the system is maximal.

So Parseval holds for every square-integrable function, with nothing assumed about continuity or boundedness. Here's a function Riemann's integral can't handle: the absolute value of x, to the minus a quarter. It's unbounded at zero, but its square has finite integral. Its Fourier partial sums with four, sixteen and sixty-four terms climb toward the spike. The mean square error falls steadily: each fourfold increase in N multiplies it by 0.707. Slowly, but to zero. That's the Fourier thread's answer: for every function in L two, the partial sums converge to it in L two, and Parseval's identity holds. Conversely, every square-summable sequence of coefficients comes from a function. L two of the circle and little l two of the integers are the same Hilbert space.

In the uniform norm the story is different, and the kernels show why. The n-th partial sum is the convolution with Dirichlet's kernel, which has negative lobes, shaded red. Its absolute integral grows with N, and that's what allows Gibbs' overshoot and even divergence. Fejér averaged the partial sums. The average is a convolution with Fejér's kernel, which is never negative and has mass one, the same narrowing bump as before. On the sawtooth, the partial sums overshoot to 1.844, above pi over two. Fejér's means never do: an average with positive weights can't leave the range of the function. So the dashboard splits. Partial sums converge in L two for every square-integrable function. Fejér's means converge uniformly for every continuous one.

10Complex measuresGraduate2 min

Measures that take negative and complex values. A complex measure assigns a complex number to each measurable set, countably additively. Here's one with density one plus half cosine x, times e to the three i x. Follow the measure of zero to t, as t runs from zero to two pi: it traces a loop in the complex plane, and comes back to zero. The whole interval has measure zero. But the measure isn't small. Cut the interval into pieces and add the sizes of their measures: these are the sides of a polygon inscribed in the loop. Finer cuts give longer polygons: point six eight, four, five point six six, and on toward two pi. The supremum is the total variation, the length of the loop. Rudin proves that it's always a positive measure, and always finite.

A real measure is a special case: sine of five x, dx. Its total is zero. Hahn's theorem splits the space into a set A where the measure is positive, the orange humps, and its complement B, where it's negative. Jordan's decomposition writes the measure as the difference of two positive measures, each of total mass two, and the total variation is their sum, four.

How can one measure relate to another? Draw three measures on the unit interval through their distribution functions, the measure of zero to x. The first has a density, two x. It's absolutely continuous with respect to length: sets of length zero get measure zero. The second is a point mass at one half, a jump. It lives on a single point, a set of length zero: it's singular. The third is the Cantor measure, Part 1's staircase seen as a measure. Its mass sits on the Cantor set: the 2 to the n intervals of the n-th stage carry everything, while their total length, two thirds to the n, goes to zero. Singular, yet with no atoms at all. The next chapter shows these are the only possibilities.

11The Radon-Nikodym theoremQualifying exam2 min

Densities, and the Radon-Nikodym theorem, proved with a Hilbert space. Here's a measure lambda on the unit interval, drawn as orange mass. Does it have a density with respect to length? Pick a point and an interval around it, and divide the interval's lambda-mass by its length. Shrink the interval. The ratio settles. Do it at four points with radii from 0.2 down to a thousandth, and the ratios converge to the values of a function, one plus 0.8 sine four x. That function is the density, and lambda of any set is the integral of h over it.

The theorem says every measure splits into a part with a density and a singular part, uniquely. Take lambda to be the orange density plus an atom of mass 0.3 at 0.7. The atom lives on a single point, a set of length zero, so it's singular. Everything else has a density. Radon proved it in Euclidean space in 1913, and Nikodym in general in 1930. Rudin gives a proof by von Neumann, which uses a Hilbert space.

Von Neumann's trick: add the two measures, phi equals lambda plus mu. Integration against lambda is a bounded linear functional on L two of phi, by Cauchy-Schwarz. So by the Riesz theorem of chapter seven, it's an inner product with some function g, and g lies between zero and one. Here g is h over one plus h. Where g equals one, mu has no mass: that set carries the singular part. At the atom, g is exactly one. Everywhere else, the density is g over one minus g, and that's h again. A theorem about measures, proved by finding a vector in a Hilbert space.

12The dual of L^pQualifying exam3 min

The functionals on L p, and on the continuous functions. How big is a functional on L p? Start in the plane with the three-norm. The functional zero point eight x one plus a half x two has level lines. Slide one outward until it last touches the unit ball. The value there is the norm of the functional, and it's the three-halves norm of the vector g. The exponent flips to the conjugate one, q. The touching point comes from Hölder's equality case. In eight dimensions: twenty thousand random unit vectors never beat the q-norm of g, and the extremal vector hits it exactly.

The theorem: for finite p, every bounded functional on L p is integration against a function g in L q, and the norms match. The proof turns the functional into a measure. Feed it indicator functions of sets: that defines lambda of E. Lambda vanishes on null sets, so Radon-Nikodym gives a density g. Then phi of f is the integral of f g, first for simple functions, then for all. Countable additivity in step one is where p must be finite: the indicators of an increasing sequence of sets converge in L p, but not in L infinity. The dual of L infinity is bigger than L one, a story for Part 8.

On the continuous functions with the sup norm, functionals are something else. Here's one: half the value at 0.3, plus the integral of f against a weight w. Pretend we can only evaluate it. Probe it with a narrow tent at each point a, divided by the tent's area. As the tents narrow, the readings converge to the weight w, except at 0.3, where a spike grows like one over r: an atom of mass one half. That's the Riesz representation theorem: every bounded functional on the continuous functions is integration against a complex measure, and its norm is the total variation, here one and a half. The dual of C is a space of measures.

So the dictionary grows a column. In the plane and in Hilbert space, a functional is a vector. On L p, it's a function in the conjugate space. On the continuous functions, it's a measure. And on L infinity, something stranger, which needs the Hahn-Banach theorem.

13Differentiating measuresQualifying exam2 min

Averages over shrinking intervals, and the Lebesgue differentiation theorem. Average a function over a small interval around x. As the interval shrinks, do you get f of x back? Here's a step function with thirty random jumps. At a typical point, the yellow average becomes exactly f of x once the interval is inside one step. At a jump, the average tends to the midpoint of the jump instead. Over a thousand random points, the fraction that works climbs to 99.9 percent: the failures are the jumps, a set of measure zero. Lebesgue's theorem says this happens for every integrable function: almost every point is a Lebesgue point. In particular, the derivative of the integral is the function, almost everywhere.

The proof needs a way to control all the averages at once. The maximal function takes, at each point, the largest average over all intervals centered there. For the indicator of a short interval, it's one on the interval, and outside it decays like one over the distance. It's not integrable. But the set where it exceeds lambda is small, at most three times the integral of f over lambda. That's the Hardy-Littlewood maximal inequality, and the three comes from a covering lemma.

Here's the covering lemma, with sixty random intervals. Pick greedily: the longest interval, then the longest one disjoint from it, and so on. Every interval meets a chosen one at least as long, so it lies inside that one, enlarged three times. So the union, of measure 0.965, is at most three times the chosen total, 0.81. That gives the maximal inequality. Then approximate f by a continuous function, which has every point as a Lebesgue point. The error is small in L one, so by the maximal inequality, the set where things go wrong has measure as small as we like: zero.

14The fundamental theorem, for LebesgueGraduate2 min

Is a function the integral of its derivative? Here's Part 1's staircase, the Cantor function. It's continuous and increasing, and it rises from zero to one. On every removed interval it's flat, so its derivative is zero there, and the removed intervals have total length one. The derivative is zero almost everywhere. So the integral of the derivative is zero, but the function rose by one. The fundamental theorem fails, for a continuous increasing function. Something more than continuity is needed.

The missing condition is absolute continuity: for every epsilon there's a delta, so that any finite set of disjoint intervals with total length below delta has total rise below epsilon. The square root passes: with epsilon a tenth, delta a hundredth works, and the worst placement is one interval at zero, where the curve is steepest. Four thousand random placements never beat a tenth. The Cantor function fails: the 2 to the n intervals of the n-th stage have total length shrinking to zero, but the function rises by one across them. And that's the whole story. A function is absolutely continuous exactly when it's the integral of its derivative. The square root qualifies, even though its derivative is unbounded.

One more warning. x squared sine of one over x squared is differentiable at every point, including zero, where the derivative is zero. But near zero it wiggles so fast that its derivative isn't integrable: the integral of the absolute derivative from epsilon to one grows without bound, by about 2.93 for every factor of ten. So the function isn't absolutely continuous, and the Lebesgue integral of f prime doesn't exist. Rudin's theorem asks for both: a derivative at every point, and an integrable one.

15Change of variablesApplications2 min

A short one: changing variables in Lebesgue's integral. Polar coordinates map a rectangle of radii and angles onto a disk. Each little rectangle becomes a curved patch. Near the center the patches are small; far out they're large. The exact area of the image patch, divided by the area of the rectangle, is r zero plus half the step, and in the limit it's r: the determinant of the derivative, the area factor from Part 4. Rudin's change of variables theorem says this local factor is all that changes: integrate over the image, or integrate over the original region with the Jacobian factor, and you get the same Lebesgue integral.

The classic use. e to the minus x squared has no elementary antiderivative, but its square, the bell over the plane, is easy in polar coordinates. The factor r is exactly the derivative of minus a half e to the minus r squared, so the radial integral is one half, and the total is pi. By Fubini the double integral is the square of the single one, so the bell curve's integral is root pi. Checked numerically: on the square of side six, and on the disk of radius three with the factor r, both within a thousandth of pi.

The sixth row of the ledgerAll tracks2 min

Let's take stock. Convexity gave Jensen's inequality, and Young's two areas gave Hölder and Minkowski, so the p-norms really are distances. The spaces L p consist of classes of functions, and Riesz and Fischer showed they're complete. Among them, only L two has an inner product, and with it come nearest points, the representation of functionals by vectors, and orthonormal bases with Parseval's identity. That answered the Fourier question in L two, while Fejér's means converge uniformly. Then measures with signs and complex values, the Radon-Nikodym theorem, the duals of L p and of the continuous functions, Lebesgue's differentiation theorem, the fundamental theorem of calculus for absolutely continuous functions, and the change of variables formula.

The ledger's sixth row. The spaces: L p, and Hilbert space. Complete, by Riesz and Fischer's summable steps. Compactness still fails: the unit vectors stay root two apart. The limits we may swap: the derivative of the integral is the function, almost everywhere. And Fourier series converge in L two, for every square-integrable function, with Fejér's means converging uniformly.

Next time, in Part 7: complex analysis, the part the rest of analysis needs. Here's a rational function, colored by its phase, with brightness for size. Its three zeros are dark points where every color meets; its two poles are bright. A function that's differentiable once in the complex sense is differentiable infinitely often, equals its power series, and is determined inside a region by its values on the boundary. None of that is true on the real line, and finding out why is the next part.

This part followed chapters three, four, six and seven of Rudin's Real and Complex Analysis. Thanks for watching, and see you in Part 7.

Where it goes next. The dual of L^infinity and the Fourier series that diverges are left for Hahn-Banach and uniform boundedness in Part 8; Plancherel on the line and Sobolev spaces build on L^2 in Part 9; orthogonal projections are the bricks of the spectral theorem in Part 10, which Parseval's identity foreshadows.

Key results

The part's results in one place, for revision.

Hoelder and Minkowski\(\displaystyle \int |fg|\,d\mu \le \|f\|_p\,\|g\|_q,\quad\allowbreak \|f+g\|_p \le \|f\|_p+\|g\|_p\quad\allowbreak \bigl(\tfrac1p+\tfrac1q=1\bigr)\)
Riesz-Fischer\(\displaystyle L^p(\mu)\ \text{is }\allowbreak \text{complete }\allowbreak \text{for } 1\le p\le\infty\)
Parallelogram law and projection\(\displaystyle \|x+y\|^2+\|x-y\|^2 = 2\|x\|^2+2\|y\|^2;\quad\allowbreak x = Px + Qx,\ \ Qx\perp M\)
Riesz representation; Parseval for a maximal orthonormal set\(\displaystyle \Lambda x=\langle x,y\rangle,\ \ \|\Lambda\|=\|y\|;\quad\allowbreak \sum_\alpha |\langle x,u_\alpha\rangle|^2=\|x\|^2\)
Lebesgue-Radon-Nikodym\(\displaystyle \lambda=\lambda_a+\lambda_s,\quad\allowbreak \lambda_a(E)=\int_E h\,d\mu,\quad\allowbreak h\in L^1(\mu),\quad\allowbreak \lambda_s\perp\mu\)
Fundamental theorem of calculus\(\displaystyle f \text{ absolutely }\allowbreak \text{continuous}\iff f(x)-f(a)=\int_a^x f'(t)\,dt,\ \ f'\in L^1\)

Try it

Lab 6 · The nearest quadratic, and Pythagoras with many sides

Find the point of span{1, x, x^2} nearest to e^x in L^2[0, 1] from the normal equations and from an orthonormal basis, check that the error is perpendicular to the subspace and that no other quadratic is closer, then expand the sign function in Legendre polynomials and watch Bessel's sum climb toward 2.

Figure produced by Lab 6: The nearest quadratic, and Pythagoras with many sides
Produced by the lab below, seed 0, in 0.3 s.
python -m videos.analysis.labs 6 needs numpy, scipy, matplotlib · download lab06.py · source on GitHub
best quadratic                              1.0130 + 0.8511 x + 0.8392 x^2
<error, 1>, <error, x>, <error, x^2>        -5.3e-17  +1.6e-17  -1.4e-16
distance from e^x: projection               0.00528
distance from e^x: Taylor 1 + x + x^2/2     0.07968   (15.1 times the projection's)
nearest of 2,000 perturbed quadratics       0.00575   (never below 0.00528)
Bessel's sum for sign, 1 / 3 / 5 odd terms  1.500  1.805  1.879   (bound 2)
Bessel's sum with e_0 ... e_40              1.9686   squared error by integration 0.0314   sum 2.0000

The error of the projection is perpendicular to the subspace, so every other quadratic is farther by Pythagoras; for the sign function the same right triangle makes Bessel's sum plus the squared error equal 2, with the sum creeping up because the function has a jump.
The code (99 lines; it asserts its own result)
"""Lab 6: project e^x onto the quadratics in L^2[0, 1] two ways, and fill Bessel's bar for the sign function."""

import numpy as np
from scipy.special import eval_legendre

from videos.coursekit import labs

TITLE = "The nearest quadratic, and Pythagoras with many sides"
GOAL = ("Find the point of span{1, x, x^2} nearest to e^x in L^2[0, 1] from the normal equations and from an "
        "orthonormal basis, check that the error is perpendicular to the subspace and that no other quadratic is "
        "closer, then expand the sign function in Legendre polynomials and watch Bessel's sum climb toward 2.")
TASKS = [
    "Raise the degree from 2 to 8 and print the condition number of the Hilbert matrix beside the error of each method.",
    "Measure the distance in L^1 instead of L^2 (integrate |f - q|). Is the L^2 projection still the nearest quadratic?",
    "Drop e_1 from the Legendre basis and expand f(x) = x: every coefficient is 0. Which line of Parseval's proof fails?",
]

X, W = np.polynomial.legendre.leggauss(60)  # Gauss-Legendre nodes and weights on [-1, 1]
T, WT = (X + 1) / 2, W / 2  # ... and on [0, 1]


def inner(f, g):
    """The inner product of L^2[0, 1], for smooth f and g given as values at the nodes T."""
    return float(np.sum(WT * f * g))


def run(seed=0):
    rng = np.random.default_rng(seed)
    lab = labs.Lab()
    f = np.exp(T)
    powers = np.array([T**k for k in range(3)])

    # 1. The normal equations: the error is perpendicular to 1, x, x^2.  Their matrix is the Hilbert matrix.
    hilbert = np.array([[1 / (i + j + 1) for j in range(3)] for i in range(3)])
    rhs = np.array([np.e - 1, 1.0, np.e - 2])  # the integrals of e^x, x e^x, x^2 e^x over [0, 1]
    coef = np.linalg.solve(hilbert, rhs)
    proj = coef @ powers

    # 2. An orthonormal basis of the same subspace: the shifted Legendre polynomials.
    basis = np.array([np.sqrt(2 * n + 1) * eval_legendre(n, 2 * T - 1) for n in range(3)])
    c = np.array([inner(f, e) for e in basis])
    proj_on = c @ basis
    assert np.allclose(proj, proj_on, atol=1e-10), "the two constructions give the same point"

    err = proj - f
    perp = [inner(err, p) for p in powers]
    assert max(abs(v) for v in perp) < 1e-12, "the error is perpendicular to the subspace"
    dist = np.sqrt(inner(err, err))
    norm2 = (np.e**2 - 1) / 2
    assert abs(norm2 - (np.sum(c**2) + dist**2)) < 1e-12, "Pythagoras: |f|^2 = |Pf|^2 + |f - Pf|^2"

    # 3. Nearest: 2,000 other quadratics, and Taylor's, are all farther away.
    others = coef + rng.normal(0, 0.05, (2000, 3))
    d_others = np.sqrt(np.sum(WT * (others @ powers - f) ** 2, axis=1))
    taylor = 1 + T + T**2 / 2
    d_taylor = np.sqrt(inner(taylor - f, taylor - f))
    assert d_others.min() > dist and d_taylor > 10 * dist, "the projection is the nearest point"
    # each perturbed quadratic q = Pf + d obeys Pythagoras again: |q - f|^2 = |d|^2 + |Pf - f|^2
    d_pert = np.sqrt(np.sum(WT * ((others - coef) @ powers) ** 2, axis=1))
    assert np.allclose(d_others**2, d_pert**2 + dist**2, atol=1e-12)

    lab.row("best quadratic", f"{coef[0]:.4f} + {coef[1]:.4f} x + {coef[2]:.4f} x^2")
    lab.row("<error, 1>, <error, x>, <error, x^2>", "  ".join(f"{v:+.1e}" for v in perp))
    lab.row("distance from e^x: projection", f"{dist:.5f}")
    lab.row("distance from e^x: Taylor 1 + x + x^2/2", f"{d_taylor:.5f}   ({d_taylor / dist:.1f} times the projection's)")
    lab.row("nearest of 2,000 perturbed quadratics", f"{d_others.min():.5f}   (never below {dist:.5f})")

    # 4. Bessel: the sign function on [-1, 1] in the normalized Legendre polynomials e_n = sqrt((2n+1)/2) P_n.
    N = 41
    n = np.arange(N)
    # <sign, e_n> = 2 sqrt((2n+1)/2) int_0^1 P_n for odd n (0 for even n); int_0^1 P_n = (P_{n-1}(0) - P_{n+1}(0)) / (2n+1)
    half = np.where(n % 2 == 1, (eval_legendre(np.maximum(n - 1, 0), 0.0) - eval_legendre(n + 1, 0.0)) / (2 * n + 1), 0.0)
    b = 2 * np.sqrt((2 * n + 1) / 2) * half
    bessel = np.cumsum(b**2)
    grid = (np.arange(200000) + 0.5) / 100000 - 1  # midpoints: the squared error by direct integration
    s = sum(b[k] * np.sqrt((2 * k + 1) / 2) * eval_legendre(k, grid) for k in range(N) if b[k])
    err2 = float(np.mean((np.sign(grid) - s) ** 2) * 2)
    assert abs(b[1] ** 2 - 1.5) < 1e-12 and np.all(np.diff(bessel) >= 0) and bessel[-1] < 2, "Bessel's inequality"
    assert abs(bessel[-1] + err2 - 2) < 1e-3, "the leftover of Bessel's sum is the squared error"
    lab.row("Bessel's sum for sign, 1 / 3 / 5 odd terms", "  ".join(f"{bessel[k]:.3f}" for k in (1, 5, 9)) + "   (bound 2)")
    lab.row("Bessel's sum with e_0 ... e_40", f"{bessel[-1]:.4f}   squared error by integration {err2:.4f}   sum {bessel[-1] + err2:.4f}")
    lab.note = ("The error of the projection is perpendicular to the subspace, so every other quadratic is farther "
                "by Pythagoras; for the sign function the same right triangle makes Bessel's sum plus the squared "
                "error equal 2, with the sum creeping up because the function has a jump.")

    fig, ax = labs.figure(2, size=(11, 4.2))
    t = np.linspace(0, 1, 300)
    ax[0].axhline(0, color=labs.MUTED, lw=0.8)
    ax[0].plot(t, coef[0] + coef[1] * t + coef[2] * t**2 - np.exp(t), color=labs.GOLD, label=f"projection (L2 error {dist:.4f})")
    ax[0].plot(t, 1 + t + t**2 / 2 - np.exp(t), color=labs.RED, label=f"Taylor at 0 (L2 error {d_taylor:.4f})")
    ax[0].set(title="Quadratic minus e^x on [0, 1]", xlabel="x", ylabel="error", ylim=(-0.23, 0.05))
    ax[0].legend(loc="lower left")
    ax[1].step(n, bessel, where="post", color=labs.BLUE, label="sum of squared coefficients")
    ax[1].fill_between(n, bessel, 2, step="post", color=labs.RED, alpha=0.25, label="squared error of the partial sum")
    ax[1].axhline(2, color=labs.GOLD, ls="--", label="squared norm of sign: 2")
    ax[1].set(title="Bessel's bar for the sign function", xlabel="highest Legendre degree used", ylim=(0, 2.15))
    ax[1].legend(loc="lower right")
    lab.fig = fig
    return lab

Now change it

  1. Raise the degree from 2 to 8 and print the condition number of the Hilbert matrix beside the error of each method.
  2. Measure the distance in L^1 instead of L^2 (integrate |f - q|). Is the L^2 projection still the nearest quadratic?
  3. Drop e_1 from the Legendre basis and expand f(x) = x: every coefficient is 0. Which line of Parseval's proof fails?

Notes and sources

Sources

W. Rudin, Principles of Mathematical Analysis, 3rd ed. (1976); Real and Complex Analysis, 3rd ed. (1987); Functional Analysis, 2nd ed. (1991). Theorem numbers on screen are those editions'. Each part's credits scene lists the original authors and the companion texts.

About this partfrom its README

Part 6 of a ten-part series that builds mathematical analysis from the holes in the rational numbers to the spectral theorem, following the arc of Walter Rudin's three textbooks. This part covers chapters 3, 4, 6 and 7 of Real and Complex Analysis, in a hook, 15 chapters and an outro.

Convexity and Jensen, Young, Hölder and Minkowski as pictures, the L^p spaces and their completeness (Riesz-Fischer, run on the hook's ramps), inner products and the parallelogram law, nearest points and projections, the Riesz representation of functionals, orthonormal bases and Parseval, Fourier series in L^2 and Fejér, complex measures, Radon-Nikodym, the dual of L^p, differentiation of measures, absolute continuity and the change-of-variables formula.

Every number the narration states is computed in compute.py and asserted; most scenes also assert the specific values they display.

What is computed and builtComputations (compute.py)
Item What is computed and asserted
ramps continuous ramps converging in L^1 to a step (
jensen Jensen's inequality for exp on 10^4 random weightings
young Young's inequality as two areas; Hoelder and Minkowski on random vectors
parallel the parallelogram law in L^p[0, 1] for p = 1, 2, 3: equality only at p = 2
stacking Riesz-Fischer's proof run on the ramps: a subsequence with summable increments
projection e^x projected onto span{1, x, x^2} in L^2[0, 1]: normal equations vs orthonormal basis
rieszh the representer of f -> int f w found from an orthonormal basis
legendre Gram-Schmidt on 1, x, ..., x^6 in L^2[-1, 1] gives the normalized Legendre polynomials
fejer the Fejer kernel; s_N and sigma_N for the sawtooth (no overshoot) and for a continuous f
variation total variation of sin(5x) dx on [0, 2 pi]; the Cantor measure on a null set
radon the density d lambda / dm recovered as a limit of ratios, and von Neumann's g = h / (1 + h)
dual the dual norm of l^p is the l^q norm, with the extremal vector
lebdiff averages over shrinking intervals at 1000 random points; the Vitali covering lemma
cantorac the Cantor function: derivative 0 off the Cantor set, total rise 1; its covers of length (2/3)^n
holder Hoelder's proof run on two normalized functions:
lpnorms
bessel the sign function's Legendre coefficients: Bessel's partial sums filling up
trigdense Rudin's kernel c_k ((1 + cos t)/2)^k: trigonometric polynomials converging uniformly (4.24)
unbounded
cpath a complex measure as a closed path in C: mu(X) = 0,
probe a functional on C[0, 1] probed with narrowing bumps reveals its measure (density plus an atom)
maximal the maximal function of an indicator, and the weak-type estimate
ftc x^2 sin(1/x^2): differentiable everywhere, f' not integrable; sqrt(x): absolutely continuous
polar the Gaussian integral by polar coordinates: the Jacobian r, and int e^(-x^2) = sqrt(pi)
Chapter notes
0:00 Which distance between functions?
2:09 1. Convex functions and Jensen's inequality
3:59 2. Young, Hoelder and Minkowski
6:07 3. The spaces L^p
8:01 4. L^p is complete
10:14 5. Inner products and the parallelogram law
12:39 6. The nearest point
14:46 7. Every functional is an inner product
17:16 8. Orthonormal bases, Bessel and Parseval
19:46 9. Fourier series in L^2, and Fejer
22:21 10. Complex measures
24:21 11. The Radon-Nikodym theorem
26:04 12. The dual of L^p
28:27 13. Differentiating measures
30:21 14. The fundamental theorem, for Lebesgue
32:21 15. Change of variables
33:41 The sixth row of the ledger
Chapter notes
# Scene Chapter
0 Hook Which distance between functions?
1 Convexity 1. Convex functions and Jensen's inequality
2 Holder 2. Young, Hoelder and Minkowski
3 Lp 3. The spaces L^p
4 RieszFischer 4. L^p is complete
5 Hilbert 5. Inner products and the parallelogram law
6 Projection 6. The nearest point
7 RieszHilbert 7. Every functional is an inner product
8 Orthonormal 8. Orthonormal bases, Bessel and Parseval
9 FourierL2 9. Fourier series in L^2, and Fejer
10 ComplexMeasures 10. Complex measures
11 RadonNikodym 11. The Radon-Nikodym theorem
12 DualLp 12. The dual of L^p
13 Differentiation 13. Differentiating measures
14 AbsolutelyContinuous 14. The fundamental theorem, for Lebesgue
15 ChangeOfVariables 15. Change of variables
16 Outro The sixth row of the ledger

Build the film

python -m videos.analysis.analysis6.compute        # the part's numbers, into .cache/analysis6
python tools/build.py analysis6                  # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py analysis6 Hook   # one chapter, silent, with a contact sheet

Scenes: videos/analysis/analysis6. Setup: see the course page. Source of these notes: the README and the scenes' narration.

Build it

The finished video is not stored in the repository. From the repo root, after the one-time setup in the top-level README:

python -m videos.analysis.analysis6.compute                # once: every computed item (cached in .cache/analysis6)
python tools/build.py analysis6 -q k --fps 60     # the full-quality cut: 2160p60 + subtitles + chapters -> renders/analysis6_2160p.mp4
python tools/build.py analysis6                   # 1080p30 -> renders/analysis6.mp4
python tools/build.py analysis6 -q l              # fast 480p preview
python tools/export_script.py analysis6           # regenerate SCRIPT.md from the code
python tools/check_narration.py analysis6         # Whisper listen test of every narration line

The scenes share the series' instruments in explainer/analysis and helpers from earlier parts (see common.py). The full narration is in SCRIPT.md.