19. Adv: Cauchy sequences and Bolzano–Weierstrass
§7.0's definition of convergence, a_n\to L, requires already knowing the candidate limit L to test against. That's frequently the hardest part — plenty of sequences are worth knowing converge before their limit is identifiable in closed form. This lesson builds a test that needs no candidate limit at all: checking only whether the sequence's own terms crowd together, using §15.0's completeness axiom to guarantee that crowding is enough.
Cauchy sequences
A sequence (a_n) is Cauchy if, for every \varepsilon>0, there exists N such that
|a_n-a_m|<\varepsilon\qquad\text{for all }n,m>N
Every pair of terms beyond N must be close together — not just consecutive terms, and not against some external target, but against each other, for every possible pairing simultaneously.
This is a genuinely stronger condition than "consecutive terms get close." Consecutive differences shrinking to zero, a_{n+1}-a_n\to0, is necessary for a Cauchy sequence but not sufficient — the classic counterexample is the harmonic partial sums, worked out below, where consecutive terms \frac1{n+1}\to0 yet the sequence is very much not Cauchy.
The Cauchy criterion
A sequence of real numbers converges if and only if it is Cauchy.
One direction is easy: if a_n\to L, then for large n,m both are within \frac\varepsilon2 of L, so |a_n-a_m|\le|a_n-L|+|L-a_m|<\varepsilon by the triangle inequality — convergent sequences are automatically Cauchy.
The other direction is where completeness (§15.0) does the real work: a Cauchy sequence is automatically bounded (its terms eventually huddle within a fixed small distance of each other), and completeness guarantees a bounded set has a supremum to converge toward — the technical argument (via Bolzano-Weierstrass, below) constructs the actual limit from that supremum. This is exactly why the Cauchy criterion is useful: it certifies convergence — and therefore that some real number the sequence is approaching genuinely exists — without ever needing to name that number first.
A sequence that is not Cauchy: re-proving harmonic divergence
Let S_n be the harmonic partial sums (§7.2, §7.5). Compare S_{2n} to S_n:
S_{2n}-S_n=\frac1{n+1}+\frac1{n+2}+\cdots+\frac1{2n}
This sum has exactly n terms, each at least \frac1{2n} (the smallest term in the sum), so:
S_{2n}-S_n\ge n\cdot\frac1{2n}=\frac12
for every n, no matter how large. So for \varepsilon=\frac14, no N can ever satisfy the Cauchy condition — taking n=N+1 and m=2n always produces a gap of at least \frac12>\frac14. The harmonic sequence fails to be Cauchy, and by the Cauchy criterion, it diverges — an entirely different proof from §7.5's Oresme grouping argument, reaching the identical conclusion.
Bolzano–Weierstrass
Every bounded sequence of real numbers has a convergent subsequence.
The idea (bisection): given a bounded sequence trapped in an interval, repeatedly bisect the interval in half; at least one half must contain infinitely many terms of the sequence (else the whole interval couldn't). Keep bisecting the half that always contains infinitely many terms — the intervals shrink toward a single point (via completeness, §15.0, guaranteeing that shrinking nested intervals pin down a real number), and picking one term from the sequence inside each successive interval builds a convergent subsequence targeting that point.
This theorem is the missing piece in the Cauchy criterion's proof: a bounded sequence's Bolzano-Weierstrass subsequence converges to some L, and the full Cauchy condition (every pair of terms eventually close) then forces the entire original sequence to converge to that same L, not just the subsequence.
Doing it in Python
Confirming the harmonic partial sums fail the Cauchy criterion — the gap S_{2n}-S_n never shrinks below \frac12:
from fractions import Fraction
def partial_sum(n):
return sum(Fraction(1, k) for k in range(1, n + 1))
print(f"{'n':>5} {'S_2n - S_n':>12}")
for n in (10, 50, 100):
gap = partial_sum(2*n) - partial_sum(n)
print(f"{n:>5} {float(gap):>12.6f}")
print("\nstays comfortably above 0.5 -- never shrinks -- not Cauchy -- diverges")
Confirming a genuinely convergent sequence (partial sums of a geometric series) is Cauchy — the gap between distant terms shrinks toward zero:
from fractions import Fraction
def geometric_partial_sum(n):
return sum(Fraction(1, 2**k) for k in range(1, n + 1))
print(f"{'n':>5} {'m':>5} {'|S_m - S_n|':>14}")
for n, m in ((5, 10), (10, 20), (20, 40)):
gap = abs(geometric_partial_sum(m) - geometric_partial_sum(n))
print(f"{n:>5} {m:>5} {float(gap):>14.10f}")
print("\nshrinks toward 0 -- Cauchy -- converges (to 1, as section 7.2 showed)")
A numerical sketch of the Bolzano-Weierstrass bisection idea, extracting a convergent subsequence from a bounded (but not itself convergent) sequence:
import math
def a(n):
return math.sin(n) # bounded in [-1,1], but the full sequence never converges
# search for terms landing close together, near a candidate limit
target = 1.0 # sin(n) gets arbitrarily close to 1 infinitely often
close_terms = [(n, a(n)) for n in range(1, 2000) if abs(a(n) - target) < 0.01]
print(f"terms with sin(n) within 0.01 of 1: {close_terms[:5]}")
print("infinitely many such terms exist -- a convergent subsequence targeting 1")
Worked example
Show that the harmonic partial sums S_n=\sum_{k=1}^n\frac1k fail to be a Cauchy sequence, and conclude the harmonic series diverges.
Consider S_{2n}-S_n for arbitrary n:
S_{2n}-S_n=\sum_{k=n+1}^{2n}\frac1k
This sum has exactly 2n-n=n terms. Every term in the sum satisfies \frac1k\ge\frac1{2n}, since k\le2n throughout the range.
S_{2n}-S_n\ge\underbrace{\frac1{2n}+\frac1{2n}+\cdots+\frac1{2n}}_{n\text{ terms}}=n\cdot\frac1{2n}=\frac12
This lower bound of \frac12 holds for every n, with no dependence on how large n is.
\boxed{S_{2n}-S_n\ge\frac12\text{ for all }n\ \Longrightarrow\ (S_n)\text{ is not Cauchy}\ \Longrightarrow\ (S_n)\text{ diverges}}
Sanity check. Taking \varepsilon=\frac14 in the Cauchy definition: no matter what N is proposed, choosing n=N+1 and m=2n (both certainly >N) produces |S_m-S_n|\ge\frac12>\frac14=\varepsilon — directly violating the Cauchy condition, confirming the failure rigorously rather than just numerically. This matches §7.5's Oresme argument's conclusion exactly, and is genuinely a different proof — Oresme grouped terms into clusters each summing to at least \frac12; this argument instead shows two specific partial sums, arbitrarily far out, always differ by at least \frac12. Two independent routes to the identical fact. ✓
Your turn
1. For the sequence a_n=(-1)^n (from §7.0, known to diverge by oscillation), show directly that it fails to be Cauchy — find a single \varepsilon for which no N works.
2. Explain why "consecutive terms get close," a_{n+1}-a_n\to0, is not enough to conclude a sequence is Cauchy, using the harmonic sequence as the counterexample.
3. True or false: Bolzano-Weierstrass guarantees that every bounded sequence itself converges (not just some subsequence of it).
Solutions
1. Take \varepsilon=1. For any N, choose n=N+1: if n is odd, a_n=-1; take m=n+1 (even), so a_m=1. Then |a_n-a_m|=|-1-1|=2>1=\varepsilon — the condition fails for this pair, for any proposed N.
\boxed{(-1)^n\text{ is not Cauchy, confirming it diverges}}
2. For the harmonic sequence, consecutive differences S_{n+1}-S_n=\frac1{n+1}\to0 — this condition is satisfied. Yet the worked example just showed S_{2n}-S_n\ge\frac12 forever, violating the actual Cauchy requirement (which demands every pair beyond N be close, not just adjacent ones). Consecutive closeness only rules out the most obvious kind of divergence; a sequence can still wander arbitrarily far over a long enough stretch, one tiny step at a time, exactly as the slowly-diverging harmonic partial sums do.
3. False. Bolzano-Weierstrass only guarantees a convergent subsequence exists — the full sequence itself need not converge. The oscillating sequence a_n=(-1)^n is bounded (between -1 and 1) and has plenty of convergent subsequences (all the even-indexed terms converge to 1; all the odd-indexed terms converge to -1), but the full sequence diverges by oscillation, exactly as problem 1 confirmed via the Cauchy criterion directly.
Check yourself in code
Compute S_{2n}-S_n for the harmonic partial sums at n=10,50,100, confirming the gap never shrinks below 0.5.
Print exactly this:
n=10, gap=0.668771
n=50, gap=0.688172
n=100, gap=0.690653
from fractions import Fraction
def partial_sum(n):
return sum(Fraction(1, k) for k in range(1, n + 1))
for n in (10, 50, 100):
gap = partial_sum(2*n) - partial_sum(n)
print(f"n={n}, gap=...")
from fractions import Fraction
def partial_sum(n):
return sum(Fraction(1, k) for k in range(1, n + 1))
for n in (10, 50, 100):
gap = partial_sum(2*n) - partial_sum(n)
print(f"n={n}, gap={float(gap):.6f}")
A Cauchy sequence has terms that crowd arbitrarily close to each other — a strictly stronger condition than consecutive terms merely shrinking apart, as the harmonic partial sums demonstrate by having S_{2n}-S_n\ge\frac12 forever despite S_{n+1}-S_n\to0. The Cauchy criterion (convergent \iff Cauchy) certifies convergence without naming a limit, resting on completeness (§15.0) for its hard direction, and Bolzano-Weierstrass — every bounded sequence has a convergent subsequence, via repeated bisection — supplies the missing piece that lets a Cauchy sequence's convergence target actually be constructed.
Next: putting completeness and the Bolzano-Weierstrass theorem to work proving, rigorously, the limit laws and derivative rules this course has used since Module 1 and Module 2 without ever formally justifying them.