Preface
This blog is based on my experience in PMATH 351: Real Analysis, taught by Blake Madill. Taking this course was a thrill and a rollercoaster of emotions. I was amazed by how intricate an introductory analysis course can be, and how much it can enlighten someone. This post shares one of the concepts that really stuck with me and shows how it connects to big ideas in modern mathematics and engineering.
Quick note: this is for readers who’ve already taken second-year calculus, but no prior analysis is required.
Definitions of dense
In day-to-day life, we think of density as a measure of compactness or “filled-ness.” You might picture a block of water and a block of steel having different densities based on how “close” the atoms of iron are compared to the molecules in water. That intuition actually carries over to math: it helps us think about functions, metric spaces, and other abstract settings we work with in mathematics.
When we say a family of functions is dense, we mean that, with enough patience, it can approximate anything we care about as closely as we want. But why is that?
A geometric picture (what “dense” feels like)
We’re in a metric space with a set . Pick any point and any zoom level ; the tiny neighborhood is the ball . If every time you zoom you still catch a point of (i.e. there exists , equivalently ), then is basically always on tap for approximating . That’s the vibe of density: no matter where you look or how hard you zoom, shows up inside .
Now the formal piece: the closure of is plus all the points you can approach using only points of . If every tiny neighborhood around contains some point of , then lies in the closure .
Formal definition(s)
Let be a metric space and . We say is dense in iff for every and every , the open ball meets ; equivalently,
For function spaces like with the sup norm , “dense” means: given any continuous and any , you can find in your family with .
Why polynomials are dense in
If you think polynomials can approximate any continuous function on a closed interval, you might point to the Taylor series you learned in first-year calculus. The statement below explains WHY approximation by polynomials works in general (not just at a point via derivatives). The proof uses basic calculus, sequences of functions, and one clever trick.
Weierstrass Approximation Theorem
For any continuous and any , there exists a polynomial such that
I’ll outline the proof informally here:
First, reduce to the interval using with , where and . This is an isometric isomorphism, so it preserves the sup norm and has an inverse.
Next, for , define with by .
Consider with chosen so that .
Using a basic inequality, one shows , hence .
Extend beyond by zero (consistent with the endpoints) and set
Let . By uniform continuity, choose so that whenever . Then, omitting routine steps,
This proves the result for , and by the isometric isomorphism we conclude that polynomials are dense in .
Alternatively, Stone–Weierstrass (conceptual). The set of polynomials is a subalgebra of that separates points and contains constants. On a compact space, such a subalgebra is uniformly dense. Here, “subalgebra” means closed under addition, scalar multiplication, and pointwise multiplication. “Separates points” is the functional analogue of injectivity: if your family contains a function that takes different values at two points, it separates them.
This matters because it explains why Taylor-style polynomial approximations of continuous functions actually work and converge uniformly on compact intervals.
Examples and applications
These are common examples you’ll find in first-year analysis books and they hint at how broadly “density” shows up.
Example 1: Need for separation of points
Let . Then is dense in but not dense in .
On every continuous function can be uniformly approximated by polynomials in . Because is continuous on , any polynomial in can be uniformly approximated by a polynomial in (compose with a polynomial approximation of on ), so is dense in .
On , every is even (). The odd function cannot be uniformly approximated by even functions, so fails to separate the points and and is not dense in .
Example 2: Using density to prove other topological phenomena
Since the rationals are countable and dense in , the set of polynomials with rational coefficients is countable and dense in the real polynomials. By Weierstrass, polynomials are dense in under . Hence the closure of a countable set (rational-coefficient polynomials) is all of , so is separable.
Example 3: Moment vanishing
Let satisfy for all . Prove .
Polynomials are dense in , so pick polynomials uniformly (meaning we can make as close to as we want). Then standard limit rules give uniformly.
Write a generic polynomial as . By the hypothesis for all , we get
Passing to the limit (uniform convergence on a compact interval lets us swap limit and integral),
Since and is continuous, the only way its integral can be is if , hence .
Connection to Fourier Analysis
Here’s a fun twist. We’ve shown, at least informally, that polynomials can approximate any continuous function on an interval. Can trigonometric functions do the same? It might seem unlikely at first, since they are periodic and a bit harder to tame. The punchline is yes, on the right domain, and the same density idea opens the door to Fourier analysis.
Trigonometric density (Fourier on the circle)
Let be the unit circle and let be the continuous (complex-valued) functions on with the sup norm. The trigonometric polynomials
are dense in . Equivalently, for every and there is with .
There’s a complex version of Stone–Weierstrass we won’t prove here. Roughly, you need a subalgebra that contains constants, separates points, and is closed under complex conjugation. It’s natural to work over because trigonometric functions align with complex exponentials.
Why this is true (the friendly sketch).
Look at the small algebra . On the circle, complex
conjugation sends to . Allowing conjugates gives negative powers:
Now check the three Stone–Weierstrass boxes on the compact space :
- Has constants. .
Separates points. The identity is injective on , so .
Closed under conjugation. If , then .
Stone–Weierstrass then says is dense in . This means any complex function can be approximated with trigonometric polynomials. That is exactly what Fourier series rely on.
If (equivalently, is a continuous -periodic real function of ), then for every there exist and real numbers such that
View as a -periodic function of . Density of gives a complex sum uniformly close to . Taking real and imaginary parts yields the stated sine–cosine form with real coefficients.
Define by and restrict the codomain to -periodic functions. Then is an isometry (distance-preserving). Under , elements of become finite sums of , the usual trigonometric polynomials on . So “dense on ” is the same as “dense among -periodic continuous functions.”
Takeaways
Polynomials are dense on (Weierstrass), so any continuous function on a closed interval can be uniformly approximated by polynomials. Trigonometric polynomials are dense on the unit circle (Stone–Weierstrass), so any continuous -periodic signal can be uniformly approximated by sines and cosines. Together, these results form the backbone of approximation theory and lead directly into Fourier analysis.