23. Adv: sequences of functions — pointwise vs. uniform convergence
§8.4 introduced pointwise and uniform convergence and leaned on the Weierstrass M-test to guarantee uniform convergence without proving, step by step, exactly why uniformity licenses swapping a limit with an integral or preserves continuity. This lesson supplies both proofs directly, using nothing beyond §1.9's \varepsilon-\delta machinery and §15.4's rigorous Riemann integral.
The definitions, restated precisely
(f_n) converges pointwise to f on D if, for every x\in D, f_n(x)\to f(x) as an ordinary sequence limit (§7.0) — the rate of convergence is allowed to depend on x.
(f_n) converges uniformly to f on D if
\sup_{x\in D}|f_n(x)-f(x)|\to0\qquad\text{as }n\to\infty
— using §15.0's supremum to capture the worst-case gap across the entire domain simultaneously, rather than checking convergence one point at a time. Equivalently: for every \varepsilon>0, there exists N such that |f_n(x)-f(x)|<\varepsilon for every x\in D at once, once n>N — one N working everywhere, mirroring exactly §15.3's "one \delta working everywhere" upgrade from ordinary to uniform continuity.
Revisiting §8.4's example with the supremum definition
For f_n(x)=x^n on [0,1], the pointwise limit is f(x)=0 for x<1 and f(1)=1. Compute the supremum directly:
\sup_{x\in[0,1]}|f_n(x)-f(x)|=\sup_{x\in[0,1)}|x^n-0|=\sup_{x\in[0,1)}x^n=1
(the supremum is 1, approached as x\to1^-, even though no x<1 actually reaches it — exactly §15.0's "supremum need not be attained" subtlety). This supremum is exactly 1 for every single n — it never shrinks toward 0 at all.
\boxed{\sup_{x\in[0,1]}|x^n-f(x)|=1\text{ for every }n\ \Longrightarrow\ \text{not uniform convergence}}
Contrast with g_n(x)=\dfrac{x^n}n on [0,1], which converges pointwise to 0 everywhere:
\sup_{x\in[0,1]}|g_n(x)-0|=\sup_{x\in[0,1]}\frac{x^n}n=\frac1n\ \xrightarrow{n\to\infty}\ 0
\boxed{g_n\to0\text{ uniformly on }[0,1]}
The difference between these two examples is the entire content of this lesson: x^n's worst-case gap gets pinned at 1 forever (concentrated near x=1, moving nowhere), while dividing by n shrinks that same worst-case gap uniformly, everywhere, to zero.
Uniform convergence preserves continuity — proven
If each f_n is continuous on D and f_n\to f uniformly, then f is continuous on D.
Proof. Fix a\in D and \varepsilon>0. By uniform convergence, choose N so that |f_N(x)-f(x)|<\frac\varepsilon3 for every x\in D. Since f_N is continuous at a, choose \delta>0 so that |f_N(x)-f_N(a)|<\frac\varepsilon3 whenever |x-a|<\delta. Then for such x:
|f(x)-f(a)|\le|f(x)-f_N(x)|+|f_N(x)-f_N(a)|+|f_N(a)-f(a)|<\frac\varepsilon3+\frac\varepsilon3+\frac\varepsilon3=\varepsilon
\blacksquare
This is a genuine "three-term triangle inequality" argument, the same pattern as §15.2's limit-law proofs, splitting \varepsilon into thirds instead of halves: one term controlled by the single fixed N uniform convergence supplies (working for every x at once — the step that would fail with only pointwise convergence), and the other two by f_N's own ordinary continuity.
Uniform convergence allows swapping limit and integral
If f_n\to f uniformly on [a,b] and each f_n is integrable (§15.4), then \displaystyle\lim_{n\to\infty}\int_a^bf_n=\int_a^bf.
Proof sketch. Uniform convergence gives, for large n, |f_n(x)-f(x)|<\varepsilon for every x\in[a,b] simultaneously. Then:
\left|\int_a^bf_n-\int_a^bf\right|=\left|\int_a^b(f_n-f)\right|\le\int_a^b|f_n-f|<\int_a^b\varepsilon\,dx=\varepsilon(b-a)
Since \varepsilon(b-a)\to0 as \varepsilon\to0, the integrals converge. \blacksquare
This is exactly the missing justification for §8's term-by-term integration of power series — inside the radius of convergence, §8.4's Weierstrass M-test guarantees uniform convergence, and this proof is what actually licenses swapping \sum\int for \int\sum, a step used without proof throughout Module 8.
Doing it in Python
Confirming x^n's supremum gap stays pinned at 1 (never shrinking), while \frac{x^n}n's shrinks to 0 — the numerical version of both proofs above:
def sup_gap_xn(n, samples=200000):
return max((i/samples)**n for i in range(samples))
def sup_gap_gn(n, samples=200000):
return max((i/samples)**n / n for i in range(samples))
print(f"{'n':>5} {'sup|x^n - f(x)|':>18} {'sup|x^n/n - 0|':>18}")
for n in (1, 10, 100):
print(f"{n:>5} {sup_gap_xn(n):>18.6f} {sup_gap_gn(n):>18.6f}")
print("\nfirst column stays near 1 forever -- not uniform")
print("second column shrinks toward 0 -- uniform")
Confirming the swap-limit-and-integral theorem directly for g_n(x)=\frac{x^n}n:
def g(n, x):
return x**n / n
def integrate(f, a, b, steps=10000):
w = (b - a) / steps
return sum(f(a + (i + 0.5)*w) for i in range(steps)) * w
print(f"{'n':>5} {'integral of g_n':>16}")
for n in (1, 5, 20, 100):
result = integrate(lambda x: g(n, x), 0, 1)
print(f"{n:>5} {result:>16.6f}")
print("\nintegral -> 0, matching integral of the limit function f=0 exactly")
Worked example
Show that f_n(x)=x^n does not converge uniformly on [0,1], while g_n(x)=\dfrac{x^n}n does — using the supremum definition directly.
For f_n: the pointwise limit is f(x)=0 for x\in[0,1), f(1)=1. For any n, and any \delta\in(0,1), pick x=1-\delta; as \delta\to0, x^n=(1-\delta)^n\to1 (for fixed n, letting x\to1^-). So:
\sup_{x\in[0,1)}|x^n-0|=\sup_{x\in[0,1)}x^n=1
This supremum equals 1 regardless of n — it never decreases at all.
\boxed{\text{not uniformly convergent}}
For g_n: on [0,1], 0\le x^n\le1, so 0\le\frac{x^n}n\le\frac1n, with equality at x=1.
\sup_{x\in[0,1]}\left|\frac{x^n}n-0\right|=\frac1n
\frac1n\xrightarrow{n\to\infty}0
\boxed{g_n\to0\text{ uniformly}}
Sanity check. The only algebraic difference between f_n and g_n is division by n — yet that single factor is the entire difference between failing and satisfying uniform convergence. This matches the "Doing it in Python" section's numerical confirmation precisely: the x^n column stayed near 1 across every tested n, while the x^n/n column shrank in exact lockstep with \frac1n. It also matches §8.4's original claim that x^n's discontinuous pointwise limit (0 jumping to 1 at x=1) is a red flag for non-uniform convergence — now justified rigorously, since the "uniform convergence preserves continuity" theorem's contrapositive says a discontinuous limit of continuous functions can never have come from a uniformly convergent sequence at all. ✓
Your turn
1. For h_n(x)=\dfrac{\sin(nx)}n on [0,2\pi], compute \sup_{x\in[0,2\pi]}|h_n(x)-0| and determine whether h_n\to0 uniformly.
2. Explain why the "uniform convergence preserves continuity" proof's three-way split genuinely needs uniform (not merely pointwise) convergence — specifically, which step would break down with only pointwise convergence.
3. True or false: if f_n\to f pointwise and every f_n is continuous, f must also be continuous.
Solutions
1. |\sin(nx)|\le1 always, so \left|\frac{\sin(nx)}n\right|\le\frac1n, with this bound achieved (approximately) whenever \sin(nx)=\pm1 occurs within [0,2\pi], which happens for every n\ge1.
\sup_{x\in[0,2\pi]}|h_n(x)|=\frac1n\ \xrightarrow{n\to\infty}\ 0
\boxed{\text{uniformly convergent}}
2. The proof needs to choose a single N that makes |f_N(x)-f(x)|<\frac\varepsilon3 hold for every x\in D simultaneously — that's precisely what uniform convergence supplies and pointwise convergence does not. With only pointwise convergence, the N needed to make |f_n(x)-f(x)| small could be different (and unboundedly larger) at different points x, so no single N could be fixed before choosing the specific point a being tested for continuity — the proof's very first step would have nothing to grab onto.
3. False. This is precisely f_n(x)=x^n on [0,1]: every f_n is a polynomial, hence continuous, and f_n\to f pointwise (to the 0-then-jump-to-1 function), yet f itself is discontinuous at x=1. Pointwise convergence alone is not enough to transfer continuity from the sequence to its limit — exactly the gap uniform convergence is built to close.
Check yourself in code
Compute \sup_{x\in[0,1]}|x^n-0| (approximately, via fine sampling) and \sup_{x\in[0,1]}\left|\frac{x^n}n-0\right| for n=1,10,100.
Print exactly this:
1 0.999995 0.999995
10 0.999950 0.099995
100 0.999500 0.009995
def sup_gap_xn(n, samples=200000):
return max((i/samples)**n for i in range(samples))
def sup_gap_gn(n, samples=200000):
return max((i/samples)**n / n for i in range(samples))
for n in (1, 10, 100):
a = sup_gap_xn(n)
b = sup_gap_gn(n)
print(f"{n:>5} {a:>19.6f} {b:>19.6f}")
def sup_gap_xn(n, samples=200000):
return max((i/samples)**n for i in range(samples))
def sup_gap_gn(n, samples=200000):
return max((i/samples)**n / n for i in range(samples))
for n in (1, 10, 100):
a = sup_gap_xn(n)
b = sup_gap_gn(n)
print(f"{n:>5} {a:>19.6f} {b:>19.6f}")
Uniform convergence, \sup_{x\in D}|f_n(x)-f(x)|\to0, is a genuinely stronger requirement than pointwise convergence, and this lesson proved directly (rather than citing) the two consequences §8.4 relied on: uniform convergence transfers continuity from every f_n to the limit f, via a three-way \varepsilon/3 triangle-inequality split, and it licenses swapping a limit with an integral, the exact justification underneath every term-by-term integration performed in Module 8. x^n and \frac{x^n}n on [0,1] remain the sharpest possible pair of examples — identical except for one factor of n, and on opposite sides of uniform convergence because of it.
Next: generalizing distance itself — metric spaces, where open, closed, compact, and complete get defined without any reference to real numbers at all.