If you ask a random passerby to give you an orthonormal basis for , they will probably respond with , . There is a lot to like about this exponential basis: most importantly, it diagonalizes the operator: . This property makes the exponential basis indispensable in the studies of differential equations. However, I prefer to describe the Walsh basis, which has several advantages:

- the basis functions take just two values , which simplifies the computation of coefficients
- the proof of the basis property is easier than for the exponential basis
- there is a strong connection to probability: the Walsh expansion can be seen as conditional expectation, and the partial sums form a Doob martingale
- partial sums converge a.e. for any function, which is not the case for the exponential basis.

First, introduce the Rademacher functions , (The enumeration is slightly different from what I used in class.) These are :

Alternatively, one can define as the function which takes the values alternatively on the *dyadic intervals* .

To define the th Walsh function , express the index as the sum of powers of 2, i.e., and let . For example, because . Since the binary representation is unique, the definition makes sense. We also have because the product of an empty set of numbers is 1.

In class I checked that the set is orthonormal. Also, for any integer the linear span of is the space of all functions that are constant on the dyadic intervals of length . This follows by observing that and that the dimension of is .

To prove that the Walsh basis is indeed a basis, suppose that is orthogonal to all . Since for all , the integral of over any dyadic interval is zero (note that the characteristic function of any dyadic interval belongs to some ). But any subinterval can be written as a disjoint countable union of dyadic intervals: just take all dyadic intervals that are contained in . (You don't necessarily get the right type of endpoints, but as long as we work with integrals, the difference between open and closed intervals is immaterial.) Thus, the integral of over **any ** subinterval of is zero. By the Lebesgue differentiation theorem, for a.e. we have . Thus as required.

The proof is even simpler if we use the non-centered form of the Lebesgue differentiation theorem: for a.e. the average approaches as in such a way that . Armed with this theorem, we can consider the sequence of dyadic intervals containing , and immediately obtain a.e.

Having proved that is a basis, let’s expand something in it. For example, this moderately ugly function :

I used Maple to compute the coefficients and plotted the partial sums for :

Such partials sums (those that use basis functions) are particularly nice: they are obtained simply by averaging over each dyadic interval of length . In probability theory this is known as *conditional expectation*. The conditional expectation is a contraction in any space, including which gives so much trouble to the exponential basis. The highly oscillatory parts of are killed by the dyadic averaging; in contrast, when integrated against the exponentials, they may cleverly accumulate and destroy the convergence of partial sums.

“If you ask a random passerby to give you an orthonormal basis for L^2…”

We might have different definitions of “random”!