∫Analysis, Built

Book III · Functional Analysis

Part 9 of 10

Distributions and the Fourier Transform

Graduatestarts at this level29 min of film14 chaptersprerequisites: Part 6, Part 7, Part 8

How can every function be differentiated, even one with jumps, and what does the Fourier transform do to the result?

The part opens with Dirac's delta, which no function can be, and with narrowing bumps that return phi(0) when integrated against a smooth phi: ask what delta does, not what it is. Test functions are built from the flat function of Part 2, distributions are the continuous functionals on them, and the derivative is defined by moving it onto the test function, so the sign function's derivative is two delta and the sawtooth's series may be differentiated term by term. Locally every distribution is a derivative of a continuous function, and convolution with a bump turns it back into a smooth one. The second half is the Fourier transform in Rudin's convention: box to sinc, inversion with Gibbs' overshoot, Plancherel, the Schwartz space on which the transform is a quarter turn, tempered distributions and Poisson summation. Then what it buys: Paley-Wiener reads support as growth in the complex plane, Sobolev norms read smoothness as decay, and fundamental solutions are found by shifting the inversion contour past the zeros of the symbol (Malgrange-Ehrenpreis). It ends with Wiener's Tauberian theorem and the prime number theorem.

What you need. Integration by parts and Fourier series; for chapters 9 and 11, Cauchy's theorem (Part 7); for the topology of the test functions, Frechet spaces (Part 8).

What you will be able to do

Undergraduate

  • Differentiate functions with corners and jumps as distributions, and check the answer by pairing with a test function.
  • Compute the Fourier transforms of a box, a triangle and a Gaussian, and use the rules for shifts and derivatives.

Graduate

  • Define distributions, their order, support and derivatives, and prove that a convergent sequence of distributions may be differentiated term by term.
  • Prove the inversion theorem and Plancherel's theorem, extend the transform to tempered distributions, and derive Poisson summation.

Qualifying exam

  • State and prove one direction of the Paley-Wiener theorem by shifting the contour, and prove Sobolev's lemma for s greater than n/2.
  • Outline the proof of Malgrange-Ehrenpreis, and explain how Wiener's Tauberian theorem with the non-vanishing of zeta on the line Re s = 1 gives the prime number theorem.

Applications

  • Find a fundamental solution of a constant-coefficient operator and use convolution with it to solve the equation for any right-hand side.
  • Predict the decay of a transform from the smoothness of the function, and say when a truncated inversion will show Gibbs' overshoot.

Contents

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

  1. 0Differentiating anythingUndergraduate2 min
  2. 1Test functionsGraduate1 min
  3. 2DistributionsGraduate2 min
  4. 3Calculus with distributionsUndergraduate2 min
  5. 4Supports and local structureGraduate1 min
  6. 5Convolution and mollifiersGraduate1 min
  7. 6The Fourier transformUndergraduate2 min
  8. 7Inversion and PlancherelApplications1 min
  9. 8Tempered distributionsGraduate3 min
  10. 9Paley-WienerQualifying exam3 min
  11. 10Sobolev spacesGraduate2 min
  12. 11Fundamental solutionsApplications3 min
  13. 12Wiener and the primesQualifying exam4 min
  14. The ninth 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.

Differentiating anythingUndergraduate2 min

Eight rows of the ledger are filled. Part 9 builds the spaces in which every function can be differentiated, and in which the Fourier transform becomes a perfect symmetry.

Physicists used Dirac's delta for twenty years before mathematicians could say what it was: a function that is zero everywhere except at one point, with integral one. No such function exists: an integral can't see a single point. But look at what the narrowing bumps do. Each has area one; their heights blow up. Integrated against a fixed smooth function phi, they return phi of zero, more and more exactly. So stop asking what delta is, and ask what it does: it takes a test function and returns its value at zero. That's a perfectly good linear functional.

Heaviside, solving circuit equations in the 1890s, wrote that the derivative of a step is delta. Smooth the step slightly: the smoothed steps have honest derivatives, and they're exactly the narrowing bumps. The move that makes this rigorous, made by Sobolev and then Laurent Schwartz, is to define everything by its action on smooth test functions. Then every function, and much more, has derivatives of every order.

Here's the plan, following chapters six to nine of Functional Analysis. First the test functions and the distributions, their calculus and their structure. Then the Fourier transform, from L one to the tempered distributions, where it becomes a symmetry. Then what it buys: Paley-Wiener, Sobolev spaces, fundamental solutions of partial differential equations, and finally Wiener's theorem and the prime numbers.

1Test functionsGraduate1 min

Test functions must be smooth, and vanish outside a bounded set. Do any exist? Part 2's flat function says yes. Glue e to the minus one over one minus x squared into the interval from minus one to one, and zero outside. It's infinitely differentiable, even at the two gluing points: every derivative goes to zero there, faster than any power. The tenth derivative, a thousandth from the edge, is about ten to the minus one hundred sixty. No analytic function can vanish on an interval without vanishing everywhere, as Part 7 showed. Test functions are smooth, but deliberately not analytic.

The test functions on a region form the space D. A sequence converges there when all the supports stay inside one compact set, and every derivative converges uniformly. These blue functions add a fast wiggle of size one over n squared. The wiggle shrinks in the sup norm and in the first derivative, but its second derivative stays the same size and higher ones grow, so the sequence does not converge in D. On each compact set this is a Fréchet space, from Part 8, and D glues them together, which is why Rudin needed topological vector spaces.

2DistributionsGraduate2 min

Distributions, the continuous linear functionals on test functions. A distribution is a continuous linear functional on the test functions. Every locally integrable function is one: it acts by integrating against phi. Delta is one: it reads off the value at zero. So is delta prime, which reads off minus the slope at zero. Continuity means: on each compact set, the action is bounded by finitely many sup norms of derivatives. The number of derivatives needed is the order: zero for functions and delta, one for delta prime.

A subtler distribution: one over x. It isn't integrable near zero, so integrating it against phi makes no sense. But cut out a symmetric window around zero. The right half pulls up, the left half pulls down, each by about the log of epsilon, and they cancel. As the window shrinks, the truncated integrals converge: here to 2.036324. That limit is the principal value of one over x: a distribution of order one, which no function or measure gives.

One more, which will keep coming back: the Dirac comb, a delta at every multiple of two pi. It acts on a test function by summing its values on the lattice. It's the derivative of the sawtooth, up to a constant, and its Fourier transform is again a comb, as we'll see.

3Calculus with distributionsUndergraduate2 min

Differentiating distributions, by integrating by parts. For a smooth function f, integration by parts moves the derivative onto the test function, with a minus sign, and no boundary terms, because phi vanishes near the edge. For a distribution, make that the definition: the derivative of T acts on phi as minus T acting on phi prime. Since phi can be differentiated forever, so can every distribution, and mixed partials always commute. And the swap of limits that cost so much in Part 3 is now free: if distributions converge, so do their derivatives.

Now corners and jumps are no obstacle. The absolute value has derivative the sign function. The sign function jumps by two, so its derivative is two delta. Check it on a test function: minus the integral of the sign times phi prime is exactly twice phi of zero. The log of the absolute value has derivative the principal value of one over x, and the product rule survives for smooth multipliers.

Here's the Fourier thread. The sawtooth is the sum of sine n x over n. Its derivative is minus a half between the jumps, and at each jump, up by pi, a spike: pi times delta. Now differentiate the series term by term: the sum of cos n x. At every point that series diverges. But test it against a smooth phi, and the partial sums converge, fast, to the action of the sawtooth's derivative. Term-by-term differentiation of a Fourier series, the move that started all of this, is simply correct, in the space of distributions.

4Supports and local structureGraduate1 min

Where a distribution lives, and what it's made of. A distribution vanishes on an open set if it gives zero on every test function living there. Remove all such sets, and what's left is the support: where the distribution is awake. Delta prime at minus 0.9, plus the indicator of an interval, has support the point and the interval. And a distribution supported at a single point can only be a finite combination of delta and its derivatives. There's nothing else that small.

Here's the deepest structure theorem. Take this continuous function F, with a few kinks. Differentiate it five times, as a distribution. Each kink sharpens step by step into a jump, then a delta, then derivatives of delta: the fifth derivative is delta triple prime at 0.3, plus twice delta prime at minus 0.4, plus a step. Tested against a Gaussian, both sides agree to every digit shown. And it works in general: on each compact set, every distribution is some derivative of a continuous function. The whole space is just continuous functions, differentiated.

5Convolution and mollifiersGraduate1 min

Convolution, which turns any distribution into a smooth function. Convolving a distribution with a test function gives an honest smooth function. With delta prime, it's the derivative of the bump itself: a dipole, up on one side and down on the other. As the bump narrows, the dipole grows: its height scales like one over epsilon squared, exactly, because one power comes from the bump and one from the derivative. And as epsilon goes to zero, the smooth functions converge to delta prime, as distributions. Every distribution is a limit of test functions.

Smooth the Cantor measure from Part 6, by averaging over windows. Each narrower window shows more of the fractal structure, and the largest density grows by a factor of one and a half each time the window shrinks by three. That factor is three to the one minus d, where d, the log of two over the log of three, is the dimension of the Cantor set. Smoothing at every scale reveals the geometry of where the measure lives.

6The Fourier transformUndergraduate2 min

The Fourier transform measures how much of each frequency a function contains. We fix Rudin's convention, with one over root two pi in front, for the rest of the series. A box becomes a sinc: sharp edges need many frequencies, so the transform decays slowly, like one over t. A Gaussian becomes the same Gaussian. A triangle, which is a box convolved with itself, becomes the sinc squared, decaying like one over t squared. Each formula is checked against direct quadrature.

The transform turns one kind of operation into another. Shifting a function multiplies its transform by a phase, and multiplying by a phase shifts the transform. Differentiation becomes multiplication by i t, which is why the transform turns differential equations into algebra. Convolution becomes multiplication. And for an integrable function, the transform is continuous and dies at infinity: the Riemann-Lebesgue lemma again.

Why is the Gaussian its own transform? Both it and its transform solve the same differential equation, u prime equals minus x u, with the same starting value. Now squeeze it. A narrower Gaussian in space has a wider transform, and the product of the two widths stays fixed. That's the uncertainty principle, the same one the quantum video met as position against momentum.

7Inversion and PlancherelApplications1 min

Getting the function back, and the transform as a rotation of L two. The inversion theorem: the same integral, with the opposite sign in the exponent, gives the function back. Rudin's proof inserts a damping factor in frequency, e to the minus lambda times the size of t. In space that's the Poisson kernel, an approximate identity, and as lambda shrinks it closes in on the function. For the box, the transform isn't integrable, so cut it off at plus and minus T. As T grows the reconstruction hugs the box, converging in L two, but near each jump it overshoots, and the overshoot tends to Gibbs' 8.95 percent, the same as for Fourier series in Part 3.

Plancherel's theorem: the transform preserves the L two norm. Here's a random wave packet and the size of its transform; their norms agree to ten digits, and so do those of twenty other random functions. So the transform extends from the nice functions to all of L two, as a unitary map: it's an orthogonal change of basis, from positions to frequencies, in an infinite-dimensional Hilbert space.

8Tempered distributionsGraduate3 min

The space where the Fourier transform is perfect, and its dual. Test functions with compact support are too few for the Fourier transform, because the transform of a bump never has compact support. So Schwartz enlarged the space: smooth functions that, with all their derivatives, decay faster than every power of x. The Gaussian qualifies: multiply it by x to any power and it stays bounded, with sup exactly k over e, to the power k over two. One over one plus x squared is smooth and integrable, but x squared times it never decays, so it's out. Countably many seminorms again: the Schwartz space is a Fréchet space.

On this space the transform is perfect. Multiplying by x becomes differentiating, and differentiating becomes multiplying, so decay and smoothness trade places, and the Schwartz space maps onto itself. Watch a lopsided function go around. Its transform is complex. Transform again, and you get the function reflected. Four times, and you're back: the Fourier transform is a quarter turn. So its only eigenvalues are the fourth roots of unity, and the eigenvectors are the Hermite functions, the quantum oscillator's states.

The dual of the Schwartz space is the space of tempered distributions: everything that doesn't grow faster than a polynomial. Its transform is defined by passing the hat to the test function, which is legal because the integral of f hat times g equals the integral of f times g hat; here, for a Gaussian and a box, both sides agree. Now squeeze a unit mass toward delta. Its transform flattens out, to the constant one over root two pi. So delta's transform is a constant, a constant's is a delta, and powers of x go to derivatives of delta.

The Dirac comb, a delta at every multiple of root two pi, is tempered. Smooth it slightly and window it, and transform: the result is the same comb. In the limit the comb is exactly its own transform. Tested against a function, that's Poisson summation: the sum of the samples of f equals the sum of the samples of f hat. With a Gaussian, it's Jacobi's identity for the theta function: the two sides, as curves, coincide, and at every t they agree to twelve digits. It's the identity behind the functional equation of the zeta function, in the Riemann video.

9Paley-WienerQualifying exam3 min

The Paley-Wiener theorem, where support in space becomes growth in the complex plane. Take the bump, supported on minus one to one. Its transform is an integral over a bounded interval, so it makes sense for complex t as well, and it's an entire function. Here it is, colored by phase, with brightness rising with size. Along the real axis it oscillates and dies, with its zeros where all the colors meet. Vertically, it grows: the exponential has size e to the x times the imaginary part, at most e to the absolute value of the imaginary part, because x stays within one. On the imaginary axis the growth rate creeps up toward exactly one, the half-width of the support. And along the real axis it decays faster than any power.

The Paley-Wiener theorem says this is a characterization: a smooth function is supported in minus A to A exactly when its transform is entire, decays on horizontal lines, and grows no faster than e to the A times the imaginary part. Here's the converse. Write the inversion integral along a horizontal line, and push the line up. By Cauchy's theorem the answer doesn't change: at x equal to one half, inside the support, every height gives the same value of the bump. But at x equal to one and a half, the factor e to the i x z shrinks like e to the minus x y, faster than the transform grows. As the line rises, the bound goes to zero, so the function is zero there. Support in space is growth in the complex plane.

This is the honest end of Part 2's function e to the minus one over x squared. A bump is smooth but can't be analytic, because it's flat at the edges of its support. How does that show? In the derivatives. Computed exactly up to order twenty, the largest derivative, divided by n factorial, to the one over n, grows without bound, so no analytic bound holds. Divided by n factorial squared instead, it stays bounded: the bump lives in the class with bounds like n factorial squared. The Denjoy-Carleman theorem says exactly which classes contain a bump: those whose sum of ratios converges. For n factorial it diverges, no bumps, the analytic world; for n factorial squared it converges, and bumps exist.

10Sobolev spacesGraduate2 min

Sobolev spaces, where smoothness is measured by the transform. Differentiating multiplies the transform by i t, so smoothness in space is decay in frequency. On a log-log plot: a box, which jumps, has a transform decaying like one over t. A triangle, which only has kinks, decays like one over t squared. And the smooth bump plunges faster than any power. The Sobolev norm turns this into a scale: weight the transform by one plus t squared to the power s. The box has finite norm exactly for s below one half, the triangle for s below three halves, the bump for every s. And s needn't be a whole number.

When does a finite Sobolev norm force a function to be continuous? The inversion formula bounds f by the integral of the size of f hat. Split the integrand into a weight and the rest, and apply Cauchy-Schwarz, in frequency. The Sobolev norm appears, times the integral of the weight. That integral is finite only when s is more than a half. Watch it as the cutoff T runs out: at s equal to 0.4 it grows without bound, at one half it grows like a logarithm, and at 0.6 it settles. So in one dimension, H s functions are continuous once s passes one half. In n dimensions the weight's integral needs two s bigger than n, and each extra Sobolev derivative buys one more continuous derivative.

The Fourier thread once more. The sawtooth's coefficients are one over n, so its Sobolev norm is this sum. Summed to a million terms: at s equal to 0.3 and 0.45 the sums level off, each decade adding a fixed fraction of the last one; at one half, every decade adds exactly the log of ten; above one half, the gains grow. So the sawtooth is in H s exactly for s below one half. And that's sharp, because above one half, Sobolev's lemma would make it continuous, and it jumps.

11Fundamental solutionsApplications3 min

Fundamental solutions, which solve a differential equation for every right-hand side at once. A fundamental solution of a differential operator is a distribution E with P of D applied to E equal to delta: the response to a single point source. Then E convolved with f solves the equation with right-hand side f, because derivatives pass through the convolution, and delta convolved with f is f. For u double prime plus u, the oscillator, here are two sources of opposite sign, and two responses: the symmetric one, and the causal one, which is zero before the sources and rings after them. Both satisfy the equation, checked by finite differences.

The heat equation's fundamental solution is the heat kernel: a point of heat at time zero spreading into a Gaussian, whose total stays exactly one. Here's the table of classics: the step for the first derivative, half of sine of the absolute value for the oscillator, the logarithm in the plane and minus one over four pi r in space for the Laplacian: the potential of a point charge. Each is checked as a distribution: minus one over four pi r, tested against the Laplacian of a Gaussian, gives phi of zero to ten digits.

Where do fundamental solutions come from? Transform the equation: one minus t squared times E hat must be constant. But one minus t squared vanishes at plus and minus one, and one over it isn't integrable there. So leave the real line. Write the inversion integral along a line just below the zeros, in the complex plane. Computed numerically, it gives H of x times sine x, the causal solution, and any lower line gives the same, by Cauchy's theorem. Move the line above the zeros, and you get a different fundamental solution, minus H of minus x times sine x. Crossing the poles adds their residues, sine x, which solves the homogeneous equation. Average the two, and you get the symmetric one, half of sine of the absolute value.

The Malgrange-Ehrenpreis theorem says this always works: every nonzero linear operator with constant coefficients has a fundamental solution. Rudin's proof is the same idea in n variables. The symbol has zeros, so move one variable into the complex plane, along shifts by points of the unit circle, and average. A lemma on polynomials bounds one over P on average, Paley-Wiener bounds control the test functions, and Cauchy's theorem shows that the averaged functional really inverts P of D. In our example, the shifted lines sweep a strip; half pass below the zeros and half above, and the average is the symmetric solution. And for elliptic operators like the Laplacian, every solution with a smooth right side is smooth itself.

12Wiener and the primesQualifying exam4 min

Wiener's Tauberian theorem, and the prime number theorem. Here's a question that sounds like linear algebra. Take one integrable kernel k. Can sums of its translates approximate every integrable function? Try a target with frequencies near five. With a narrow Gaussian kernel, two hundred forty-one translates reproduce it to rounding error. With sine x over x, squared, the best fit misses by 99.93 percent. The frequency side says why. Transforming a sum of translates multiplies the kernel's transform by a trigonometric sum, so it's zero wherever the kernel's transform is. The squared sinc has a triangle for its transform, zero beyond two, exactly where the target lives, and the computed error is the best possible. Wiener's theorem is the converse: if the kernel's transform never vanishes, the translates fill everything.

Why is it true? Integrable functions under convolution form an algebra, with the L one norm of a convolution at most the product of the norms, and the transform turns convolution into multiplication. The homomorphisms from this algebra to the complex numbers are exactly the evaluations of the transform at a point t. So the real line is the space of maximal ideals, and a kernel lies in one exactly where its transform vanishes. The squared sinc lies in all the ideals beyond two. A kernel whose transform never vanishes lies in none of them, and that is what makes its translates span. This is the first glimpse of Gelfand's theory, which is Part 10.

The road to the primes needs one fact about the zeta function from the Riemann video: it has no zeros on the line where the real part is one. On that line, over this stretch, its size never drops below 0.32, while on the critical line it touches zero again and again. The proof is a trigonometric inequality: three plus four cos theta plus cos two theta is twice a square, so it's never negative. Feed it into the Euler product, and the product of zeta at sigma cubed, zeta at sigma plus i t to the fourth, and zeta at sigma plus two i t, is always at least one. If zeta vanished at one plus i t, the fourth power would beat the cube of the pole, and the product would go to zero. It doesn't.

Wiener's theorem then gives the prime number theorem. The non-vanishing of zeta on the line says that a certain kernel's transform has no zeros. Wiener's Tauberian theorem moves a known average from that kernel to every other kernel, and that unlocks Chebyshev's function psi, the sum of log p over prime powers, which is asymptotic to x. Partial summation converts that into the count of primes. Up to ten to the eight, counted exactly: psi of x over x is within two parts in a hundred thousand of one; pi of x over x over log x is still six percent high, closing in slowly; and the logarithmic integral fits to about one part in ten thousand. That's the analytic engine behind the Riemann video's second chapter.

The ninth row of the ledgerAll tracks2 min

Let's take stock. Test functions gave us a way to ask what an object does instead of what it is, and the answer was distributions, which can all be differentiated, as often as we like. Locally they're all derivatives of continuous functions, and smoothing turns them back into functions. The Fourier transform became a unitary map of L two, a quarter turn of the Schwartz space, and an operation on tempered distributions. Paley-Wiener read support as growth, Sobolev read smoothness as decay, fundamental solutions dodged the zeros of symbols, and Wiener's algebra led all the way to the primes.

The ledger's ninth row. The spaces: test functions, Schwartz functions, and their duals. Completeness comes in Fréchet pieces, and compactness from weak-star limits of bounded sets. The interchange is finally free: differentiation commutes with every limit. And the Fourier answer is the most generous yet: every trigonometric series with coefficients of polynomial size converges, as a distribution.

Next time, in Part 10: operators, and their spectra. Part 8's Volterra operator, integration from zero, has norm two over pi. Its powers shrink, and the n-th root of the norm of the n-th power goes to zero. It has no eigenvalues at all, yet it has a spectrum: the single point zero. Gelfand's spectral radius formula, built from Part 7's complex analysis, explains why. And then the spectral theorem: how to diagonalize an operator that has no eigenvectors.

This part followed chapter nine of Real and Complex Analysis and chapters six through nine of Functional Analysis. Thanks for watching, and see you in Part 10.

Where it goes next. The convolution algebra L^1 and its maximal ideals are the first case of Gelfand's theory in Part 10, where Wiener's 1/f theorem gets a three-line proof and Plancherel's theorem becomes the spectral theorem for the momentum operator.

Key results

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

Derivative of a distribution\(\displaystyle \langle D^\alpha T,\phi\rangle=(-1)^{|\alpha|}\langle T,D^\alpha\phi\rangle;\qquad\allowbreak H'=\delta,\quad\allowbreak (\operatorname{sgn})'=2\delta\)
Fourier transform and Plancherel\(\displaystyle \hat f(t)=\frac{1}{\sqrt{2\pi}}\int f(x)e^{-ixt}\,dx,\qquad\allowbreak \|\hat f\|_2=\|f\|_2\)
Tempered distributions and Poisson summation\(\displaystyle \langle\hat u,\phi\rangle=\langle u,\hat\phi\rangle,\quad\allowbreak \hat\delta=\tfrac{1}{\sqrt{2\pi}},\quad\allowbreak \sum_{n}\phi\bigl(n\sqrt{2\pi}\bigr)=\sum_{n}\hat\phi\bigl(n\sqrt{2\pi}\bigr)\)
Paley-Wiener, for smooth functions and every N\(\displaystyle \operatorname{supp}\phi\subset[-A,A]\iff \hat\phi \text{ entire},\ |\hat\phi(z)|\le \gamma_N(1+|z|)^{-N}e^{A|\operatorname{Im}z|}\)
Sobolev's lemma\(\displaystyle \int(1+|t|^2)^s|\hat f(t)|^2\,dt<\infty,\ \ s>\tfrac n2\implies f \text{ is }\allowbreak \text{continuous}\)
Fundamental solutions\(\displaystyle P(D)E=\delta\implies P(D)(E*f)=f;\quad\allowbreak E \text{ exists }\allowbreak \text{for }\allowbreak \text{every } P\ne 0\)

Try it

Lab 9 · A divergent series that converges as a distribution

The sawtooth sum sin(nx)/n has derivative -1/2 + pi*delta near 0. Differentiate the series term by term, pair the partial sums of cos(nx) with a random smooth test function, and compare with -1/2 int phi + pi phi(0); then check Plancherel and Poisson summation numerically.

Figure produced by Lab 9: A divergent series that converges as a distribution
Produced by the lab below, seed 0, in 0.4 s.
python -m videos.analysis.labs 9 needs numpy, scipy, matplotlib · download lab09.py · source on GitHub
test function                                        bump on [-2.455, 2.455] times (1 + -0.230 x), phi(0) = 1
-1/2 int phi + pi phi(0)                             1.6598554624
-<sawtooth, phi'>  (the definition)                  1.6598554585
<sum_{n<=N} cos(nx), phi>, N = 5, 20, 60, 200        1.68497559  1.65950894  1.65985539  1.65985546
sum_{n<=N} cos(n) at the point x = 1, same N         -1.236  +0.540  -1.255  -1.056
Plancherel: |f|^2 and |f^|^2 for a random packet     4.7362910812  4.7362910812
Jacobi's identity, worst relative gap at 5 random t  2.2e-16

The series sum cos(nx) diverges at every point, yet against a smooth test function its partial sums converge faster than any power of 1/N to the action of the sawtooth's derivative, -1/2 + pi delta: term-by-term differentiation is correct in the space of distributions.
The code (87 lines; it asserts its own result)
"""Lab 9: differentiate the sawtooth's Fourier series term by term, and test it as a distribution."""

import numpy as np

from videos.coursekit import labs

TITLE = "A divergent series that converges as a distribution"
GOAL = ("The sawtooth sum sin(nx)/n has derivative -1/2 + pi*delta near 0. Differentiate the series term by term, "
        "pair the partial sums of cos(nx) with a random smooth test function, and compare with -1/2 int phi + pi phi(0); "
        "then check Plancherel and Poisson summation numerically.")
TASKS = [
    "Differentiate once more: pair -sum n sin(nx) with phi. The limit is the action of pi*delta', which is -pi phi'(0).",
    "Replace the smooth bump by the tent max(0, 1 - |x|/a). How fast does the pairing converge now, and why?",
    "In the Plancherel check, use the box on [-1, 1]: how far out must the frequency grid reach for 3 digits?",
]


def bump(u):
    """The test function exp(-1 / (1 - u^2)) on (-1, 1), 0 outside: smooth, compactly supported."""
    out = np.zeros_like(u)
    inside = np.abs(u) < 1
    out[inside] = np.exp(-1 / (1 - u[inside] ** 2))
    return out


def run(seed=0):
    rng = np.random.default_rng(seed)
    lab = labs.Lab()

    # 1. A random test function supported in [-a, a], a < 2 pi, so only the jump at 0 is inside its support.
    a, tilt = rng.uniform(1.5, 3.0), rng.uniform(-0.5, 0.5)
    x = np.linspace(-a, a, 40001)
    dx = x[1] - x[0]
    phi = bump(x / a) * (1 + tilt * x) * np.e  # phi(0) = 1
    limit = -0.5 * np.sum(phi) * dx + np.pi * 1.0  # <-1/2 + pi delta, phi>
    Ns = np.arange(1, 201)
    pair_n = np.array([np.sum(np.cos(n * x) * phi) * dx for n in Ns])  # <cos(nx), phi>
    pairing = np.cumsum(pair_n)
    err = np.abs(pairing - limit)
    # pointwise the series has no limit: at x = 1 the partial sums keep oscillating
    pointwise = np.cumsum(np.cos(Ns * 1.0))
    assert err[-1] < 1e-8 and err[59] < 1e-4, "the differentiated series converges to -1/2 + pi delta on test functions"
    assert np.ptp(pointwise[100:]) > 1.5, "but its partial sums at a point never settle"
    # the definition of the derivative: <S', phi> = -<S, phi'>, with S the sawtooth (pi - x)/2 on (0, 2 pi), odd
    saw = np.where(x > 0, (np.pi - x) / 2, np.where(x < 0, (-np.pi - x) / 2, 0.0))
    by_definition = -np.sum(saw * np.gradient(phi, dx)) * dx
    assert abs(by_definition - limit) < 1e-6, "-<sawtooth, phi'> is the same number"
    lab.row("test function", f"bump on [-{a:.3f}, {a:.3f}] times (1 + {tilt:+.3f} x), phi(0) = 1")
    lab.row("-1/2 int phi + pi phi(0)", f"{limit:.10f}")
    lab.row("-<sawtooth, phi'>  (the definition)", f"{by_definition:.10f}")
    lab.row("<sum_{n<=N} cos(nx), phi>, N = 5, 20, 60, 200", "  ".join(f"{pairing[n - 1]:.8f}" for n in (5, 20, 60, 200)))
    lab.row("sum_{n<=N} cos(n) at the point x = 1, same N", "  ".join(f"{pointwise[n - 1]:+.3f}" for n in (5, 20, 60, 200)))

    # 2. Plancherel, in Rudin's convention f^(t) = (2 pi)^(-1/2) int f(x) e^(-ixt) dx: a random wave packet.
    xs = np.linspace(-12, 12, 2401)
    ts = np.linspace(-14, 14, 2801)
    packet = sum(rng.normal() * np.exp(-((xs - rng.uniform(-3, 3)) ** 2) / (2 * rng.uniform(0.5, 1.5) ** 2))
                 * np.cos(rng.uniform(0, 5) * xs) for _ in range(4))
    hat = (np.exp(-1j * np.outer(ts, xs)) @ packet) * (xs[1] - xs[0]) / np.sqrt(2 * np.pi)
    n_x, n_t = np.sum(packet**2) * (xs[1] - xs[0]), np.sum(np.abs(hat) ** 2) * (ts[1] - ts[0])
    assert abs(n_x - n_t) < 1e-8 * n_x, "Plancherel: the transform preserves the L2 norm"
    lab.row("Plancherel: |f|^2 and |f^|^2 for a random packet", f"{n_x:.10f}  {n_t:.10f}")

    # 3. Poisson summation for the Gaussian: Jacobi's identity for the theta function, at random t.
    n = np.arange(-60, 61)
    t = rng.uniform(0.2, 3.0, 5)
    left = np.array([np.sum(np.exp(-np.pi * n**2 * s)) for s in t])
    right = np.array([np.sum(np.exp(-np.pi * n**2 / s)) / np.sqrt(s) for s in t])
    assert np.abs(left / right - 1).max() < 1e-12, "sum e^(-pi n^2 t) = t^(-1/2) sum e^(-pi n^2 / t)"
    lab.row("Jacobi's identity, worst relative gap at 5 random t", f"{np.abs(left / right - 1).max():.1e}")
    lab.note = ("The series sum cos(nx) diverges at every point, yet against a smooth test function its partial sums "
                "converge faster than any power of 1/N to the action of the sawtooth's derivative, -1/2 + pi delta: "
                "term-by-term differentiation is correct in the space of distributions.")

    fig, ax = labs.figure(2, size=(11, 4.2))
    xx = np.linspace(-a, a, 1500)
    ax[0].plot(xx, sum(np.cos(k * xx) for k in range(1, 21)), color=labs.BLUE, lw=1, label="sum of cos(nx), n <= 20")
    ax[0].plot(xx, 8 * bump(xx / a) * (1 + tilt * xx) * np.e, color=labs.GOLD, label="test function phi (8 times)")
    ax[0].axhline(-0.5, color=labs.MUTED, ls="--", lw=1, label="-1/2")
    ax[0].set(title="The differentiated series: a spike at 0 over -1/2", xlabel="x")
    ax[0].legend(loc="upper right")
    ax[1].semilogy(Ns, err + 1e-17, color=labs.GREEN, label="|<partial sum, phi> - limit|")
    ax[1].semilogy(Ns, np.abs(pointwise + 0.5) + 1e-17, color=labs.RED, lw=0.8, alpha=0.8, label="|partial sum at x = 1, plus 1/2|")
    ax[1].set(title="Converges on test functions, not at points", xlabel="terms N", ylim=(1e-16, 30))
    ax[1].legend(loc="lower left")
    lab.fig = fig
    return lab

Now change it

  1. Differentiate once more: pair -sum n sin(nx) with phi. The limit is the action of pi*delta', which is -pi phi'(0).
  2. Replace the smooth bump by the tent max(0, 1 - |x|/a). How fast does the pairing converge now, and why?
  3. In the Plancherel check, use the box on [-1, 1]: how far out must the frequency grid reach for 3 digits?

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 9 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 6-9 of Functional Analysis and chapter 9 of Real and Complex Analysis, in a hook, 12 chapters and an outro.

Test functions and distributions, derivatives of anything (and the sawtooth's series differentiated term by term), supports and the local structure theorem, convolution and mollifiers, the Fourier transform on L^1 and L^2 (inversion with Gibbs, Plancherel), the Schwartz space as a quarter turn, tempered distributions and Poisson summation, Paley-Wiener with a domain-colored transform and contour-shifted inversion, Denjoy-Carleman, Sobolev spaces, fundamental solutions built by shifting contours (Malgrange-Ehrenpreis), and Wiener's Tauberian theorem with the prime number theorem.

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
delta narrowing bumps tested against 10 functions -> phi(0); smoothed steps' derivatives have integral 1
mollifier the C-infinity bump exp(-1/(1 - x^2)): derivatives to order 10 vanish at the edge (sympy)
pv <p.v. 1/x, phi> by symmetric truncation at eps = 10^-k, against the odd-part integral
sawcomb the sawtooth's series differentiated term by term, tested against a bump -> -1/2 int phi + pi phi(0)
structure delta''' + delta' as the 5th derivative of a continuous function, tested against phi
mollify mollified delta' blows up like eps^-2; the mollified Cantor measure like eps^(log2/log3 - 1)
pairs box <-> sinc, Gaussian <-> Gaussian, triangle <-> sinc^2: FFT against closed forms
plancherel Plancherel for random functions; inversion of the box: L^2 convergence with Gibbs' overshoot
poisson Poisson summation: sum e^(-pi n^2 t) = t^(-1/2) sum e^(-pi n^2 / t) paleywiener the transform of a bump on a complex grid: growth like e^(
sobolev the sawtooth's H^s norms: finite exactly for s < 1/2 fundamental the heat kernel; the Newtonian potential tested against phi; u'' + u = delta with E = sin
wiener translates of a Gaussian approximate a function; translates of sinc^2 stop at the band-limit bound
contour u'' + u = delta by shifting the inversion contour past the zeros of 1 - t^2; u = E * f checked
decay the transforms of a box, a triangle and a bump: 1/t, 1/t^2, faster than every power
pwshift the bump's transform inverted along Im z = y: the same b(x) inside the support, 0 outside
gevrey sup
zeta the 3-4-1 inequality for zeta, and
primes pi(x) against x / log x and li(x), and Chebyshev's psi(x) / x, up to 10^8, four points per decade
Chapter notes
# Scene Chapter
0 Hook Differentiating anything
1 TestFunctions 1. Test functions
2 Distributions 2. Distributions
3 Calculus 3. Calculus with distributions
4 Structure 4. Supports and local structure
5 Convolution 5. Convolution and mollifiers
6 FourierL1 6. The Fourier transform
7 Plancherel 7. Inversion and Plancherel
8 Schwartz 8. Tempered distributions
9 PaleyWiener 9. Paley-Wiener
10 Sobolev 10. Sobolev spaces
11 Fundamental 11. Fundamental solutions
12 Wiener 12. Wiener and the primes
13 Outro The ninth row of the ledger

Build the film

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

Scenes: videos/analysis/analysis9. 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.analysis9.compute                # once: every computed item (cached in .cache/analysis9)
python tools/build.py analysis9 -q k --fps 60     # the full-quality cut: 2160p60 + subtitles + chapters -> renders/analysis9_2160p.mp4
python tools/build.py analysis9                   # 1080p30 -> renders/analysis9.mp4
python tools/build.py analysis9 -q l              # fast 480p preview
python tools/export_script.py analysis9           # regenerate SCRIPT.md from the code
python tools/check_narration.py analysis9         # 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.