Convergence has at least four meanings in probability: almost surely, in probability, in Lᵖ and in distribution. Study their relationships and counterexamples, the Borel–Cantelli lemmas, uniform integrability, Lévy's continuity theorem, Slutsky's lemma and continuous mapping: the language of limit theorems and convergence results for stochastic algorithms.
After this lesson you can
Define the four modes of convergence and prove the implications between them.
Construct counterexamples for every implication that does not hold.
Apply the Borel–Cantelli lemmas to decide whether an event occurs infinitely often.
Use uniform integrability to pass from convergence in probability to convergence of expectations.
Apply Slutsky's lemma, continuous mapping and Lévy's continuity theorem.
You train a model by stochastic gradient descent and write “the algorithm converges” in the report. In probability, this says nothing until you specify what convergence means, because the iterates θt are random variables and the phrase can mean at least four distinct, nonequivalent things:
Every run stabilizes. If you repeat training with different seeds, each curve eventually stays close to θ⋆. This is almost sure convergence.
At any given time, being far away is unlikely. For a fixed large t, the probability that θt is more than ε from θ⋆ is small. A particular run may still jump occasionally. This is convergence in probability.
The average error vanishes.E∥θt−θ⋆∥2→0. This is convergence in L2 (generally, in Lp).
The law of θt approaches a limiting distribution. With a constant step, SGD iterates often form a Markov chain that stabilizes in distribution: it keeps moving, with variance on the order of the step, and the distribution converges, not the point. This is convergence in distribution.
With decreasing steps and Robbins–Monro conditions one typically proves the first; with a constant step, only the last. An article saying “converges” without specifying which of the four completely changes what you have learned. The same holds for a Monte Carlo estimator (does its error vanish in every run or is it merely unlikely to be large?), a statistical estimator (“consistent” usually means in probability), and the limit theorems in the coming lessons: the weak law of large numbers is in probability, the strong law is almost sure, and the central limit theorem is in distribution. This lesson is the dictionary.
To see all four modes at once, the next figure draws many trajectories n↦Xn(ω) of sequences that approach 0 in very different ways, and measures in three panels the probability P(∣Xn∣>ε), the moment E∣Xn∣p and the fraction of trajectories that will never again leave the band. The lesson uses them to build all the counterexamples.
InteractiveZoo of convergence modes
Paths n↦Xn(ω) (logarithmic n axis)
P(∣Xn∣>ε)
E∣Xn∣1 (log-log: slope is the exponent)
fraction of stabilized paths
already stabilized path · estimate from 1000 paths
path that will still jump
theoretical value
band ∣x∣≤ε
Lp norm
n = 512
converges almost surelyyes
converges in probabilityyes
converges in L1no
converges in distribution to 0yes
P^(∣Xn∣>ε) at n=5120.001
E^∣Xn∣1 at n=5120.512
stabilized paths99.9 %
Almost surely: yes. Reason: a single U: U>0 almost surely, so U≥n−s eventually and the path ends at 0. In order 1 mean: no. Reason: E∣Xn∣p=nap−s=n0.00 is constant =1.
We simulate 1000 trajectories n↦Xn(ω) up to n=2048 and show up to n=512 (logarithmic axis; large positive values are drawn on a log10(1+x) scale). Top panel: 26 trajectories; the green band is ∣x∣≤ε. Blue indicates those that will never again leave the band over the remaining horizon; orange indicates those with a jump still ahead. Below, left to right: P(∣Xn∣>ε) (convergence in probability), E∣Xn∣p on a log-log scale (the slope is the exponent: convergence in Lp), and the fraction of stabilized trajectories (almost sure convergence: over an infinite horizon it would tend to 1). The dashed line is the theoretical value. Try the spike with one U (almost surely, in probability, but not in L1: its expectation is always 1), independent spikes with probability 1/n (in probability but not almost surely: the stabilized fraction remains low) and with 1/n2 (almost surely and in L1, but not in L2), and the typewriter (in Lp for every p, but no trajectory stabilizes). With the a and s sliders, na1{Un<n−s} converges in Lp if and only if ap<s. Moving ε changes little for spikes and much for the normal mean.
Before formalizing, three observations the figure reveals and the lesson will prove.
Almost sure and Lp convergence do not imply one another. The spike with one U converges almost surely but not in L1; the typewriter converges in every Lp but not almost surely.
Both are stronger than convergence in probability. In both cases the probability of being outside the band tends to 0. But that probability looks at one time n at a time; almost sure convergence looks at the entire tail{k≥n} at once, reflected in the fraction of stabilized trajectories.
The sum of probabilities decides. With independent spikes of probability 1/n, which do not converge almost surely, and of probability 1/n2, which do, the only change is whether ∑nP(An) converges. This is the Borel–Cantelli lemma, proved in one line.
The four modes of convergence
All variables in this section live on the same probability space (Ω,F,P): X1,X2,… and X are real random variables on it. (Convergence in distribution is the exception, as we will see.)
Two clarifications about the last definition. First, it depends only on the distributions: Xn and X can live on different probability spaces, and XndX is a statement about the sequence of laws PXn, also written PXn⇒PX or Fn⇒F. Second, the restriction to continuity points is necessary: Xn=1/n converges to X=0 in any reasonable sense, but Fn(0)=0 for every n and F(0)=1; equality fails only at the jump of F.
A useful characterization of almost sure convergence
The existence of a set of probability one cannot be seen in a simulation. Almost sure convergence can be handled using two reformulations involving only probabilities of events of the form “ever after n.”
Proof
(1 ⇔ 2) A real sequence ak fails to converge to 0 if and only if there is an m∈N with ∣ak∣>1/m for infinitely many k. Hence {Xn→X}=⋃m≥1{∣Xk−X∣>1/m i.o.}. A countable union of null sets is null, and each is contained in {Xn→X}: the union is null if and only if every term is.
(2 ⇔ 3) Let Bn=⋃k≥n{∣Xk−X∣>ε}={supk≥n∣Xk−X∣>ε}. This is a decreasing sequence of events whose intersection is {∣Xk−X∣>ε i.o.}. By continuity of probability from above (the measure is finite), P(Bn)↓P(⋂nBn). Thus this limit is 0 if and only if P(Bn)→0.
∎
Condition 3 says supk≥n∣Xk−X∣→0in probability. Almost sure convergence is therefore convergence in probability of the whole tail at once. The first implication follows immediately.
Basic implications
Proof
(1) {∣Xn−X∣>ε}⊂{supk≥n∣Xk−X∣>ε} and the probability of the second tends to 0 by the tail criterion.
(2) By Markov’s inequality applied to ∣Xn−X∣p: P(∣Xn−X∣>ε)≤E∣Xn−X∣p/εp→0. For q≤p, Jensen’s inequality (with concave function t↦tq/p) gives E∣Y∣q≤(E∣Y∣p)q/p; with Y=Xn−X the right-hand side tends to 0.
(3) Let x be a continuity point of F and ε>0. Since {X≤x−ε}⊂{Xn≤x}∪{∣Xn−X∣>ε} and {Xn≤x}⊂{X≤x+ε}∪{∣Xn−X∣>ε},
F(x−ε)−P(∣Xn−X∣>ε)≤Fn(x)≤F(x+ε)+P(∣Xn−X∣>ε).
Taking n→∞, F(x−ε)≤liminfFn(x)≤limsupFn(x)≤F(x+ε), and then taking ε→0 with F continuous at x, gives Fn(x)→F(x).
∎
This gives the hierarchy “almost surely ⇒ in probability ⇒ in distribution” and “Lp⇒ in probability”, with no other arrows. All others are false in general, and two questions organize the rest of the lesson: which counterexamples show this? and which extra assumption restores each arrow? The first is answered by the Borel–Cantelli lemmas and concrete sequences; the second by subsequences, uniform integrability and domination.
The Borel–Cantelli lemmas
Everything distinguishing “almost surely” from “in probability” is a question of how many times an event in an infinite list occurs. Given events A1,A2,…, the event “An occurs infinitely often” is
{An i.o.}=nlimsupAn=n≥1⋂k≥n⋃Ak
(i.o. means infinitely often): “for every n there is a k≥n with Ak”. Its probability, seemingly difficult, is determined in two extreme cases by a series of numbers: the sum of probabilities.
The key is the counterN=∑n1An, the number of events that occur. By monotone convergence, E[N]=∑nP(An). If the sum is finite, N is integrable and hence finite almost surely. That is the first half. The second says that if the sum diverges and events do not “clump together” (they are independent), N is infinite almost surely.
Proof
(I) For each n, {Ak i.o.}⊂⋃k≥nAk, so P(Ak i.o.)≤∑k≥nP(Ak). The right-hand side is the tail of a convergent series, and hence tends to 0 as n→∞.
(II) It suffices to show that, for every n, P(⋃k≥nAk)=1: a countable intersection of probability-one events has probability one. Its complement is ⋂k≥nAkc and, by independence and the inequality 1−x≤e−x, for m≥n:
because the series diverges. The infinite intersection is their decreasing limit, and its probability is 0.
∎
This is a “zero-one law”: for independent events there are only two possibilities, and the sum of probabilities says which. The figure shows this with P(An)=n−p: the sum converges if and only if p>1, and the threshold p=1 is that of the harmonic series.
InteractiveFinitely or infinitely often?
Where An occurs in each realization (logarithmic n axis; orange: n≥1000)
Fraction of rows with an event in each decade
Mean number of events up to n versus ∑k≤nP(Ak)
occurrence of An (n<1000)
occurrence with n≥1000
observed mean
theoretical value per decade
sum of probabilities
∑n≤104P(An)9.788
ζ(p)=∑n≥1n−p∞
mean events per row (observed)10.67
rows with at least one event at n≥100045 of 48
∑nn−p=∞ with independent events: by Borel–Cantelli II, almost surely infinitely many occur (on average about ln10≈2.3 per decade).
Each row is a realization of independent events An={Un<n−p}, n=1,…,104, and each point marks an n where An occurs (logarithmic axis). Orange points occur for n≥1000. With p≤1 they keep appearing in every decade, and with p>1 they stop: this is the Borel–Cantelli partition. The first lower panel counts, in each decade, the fraction of rows with at least one event (bars: observed across 48 rows; horizontal segments: theoretical value 1−∏(1−n−p)); with p=1 it is near 0.9 in every decade (in the first it is 1, since A1 always occurs), and with p=2 it falls to 0.001 in the last. The second compares the observed mean event count up to n with ∑k≤nP(Ak), its exact expected value. Turn off independence: with a single U per row the events are nested (occurring exactly for n<U−1/p), and although ∑P(An) diverges for p≤1, only finitely many occur. Without independence, (II) fails.
Two consequences for convergence
The tail criterion suggests looking at An={∣Xn−X∣>ε}: Xn→X almost surely means P(An i.o.)=0 for each ε. By (I), that probability is zero whenever P(An) are summable, even when the An are strongly correlated.
This is the rule behind every “sufficient speed implies almost surely.” By Markov, for example, ∑nE∣Xn−X∣p<∞ suffices. Figure 1 shows it: with probability n−s and s>1, the sum converges, and the sequence converges almost surely even with independent spikes.
A second consequence repairs the failure of “in probability ⇒ almost surely” at the cost of a subsequence.
Proof
(⇒) Given a subsequence, since it converges in probability we can choose indices k1<k2<⋯ with P(Xnkj−X>2−j)<2−j. These probabilities are summable, and by (I), almost surely Xnkj−X≤2−j for all sufficiently large j: the further subsequence converges almost surely.
(⇐) If XnPX, there are ε,δ>0 and a subsequence with P(∣Xnk−X∣>ε)≥δ for every k. A further subsequence converging almost surely would converge in probability, contradicting that inequality.
∎
This criterion has a conceptual corollary. In any topological space, if every subsequence of (xn) has a further subsequence converging to x, then xn→x (otherwise a neighborhood of x would exclude infinitely many xn, and that subsequence would have no further subsequence converging to x). Convergence in Lp and convergence in probability (which is metrizable) obey this. But the typewriter in the next section converges to 0 in probability, so every subsequence has a further subsequence converging to 0 almost surely; yet the whole sequence does not converge almost surely: almost sure convergence is not convergence in any topology. That is why so many proofs use the tail criterion instead of distances.
Counterexamples: the typewriter and escaping mass
The two sequences explaining almost all the failed arrows live on Ω=(0,1) with Lebesgue measure; U is the identity function (uniform) and 1A the indicator.
The typewriter. For n=2k+j with 0≤j<2k, let In=[j/2k,(j+1)/2k) and
Xn=1In(U).
The intervals traverse [0,1) left to right in ever finer levels, like a typewriter carriage. We have P(Xn=0)=∣In∣=2−k→0 and E∣Xn∣p=2−k for every p: Xn→0 in Lp for every p and in probability. But at every level k some j satisfies U(ω)∈I2k+j, that is, Xn(ω)=1 for at least one n per level: Xn(ω)=1infinitely often for every ω. The sequence Xn(ω) converges nowhere. Thus Lp⇒ almost surely, and P⇒ almost surely.
The escaping spike. Let
Xn=n1{U<1/n}.
It is a rectangle of height n and width 1/n that grows thinner and taller, with area 1 always. For every ω with U(ω)>0 (probability one), Xn(ω)=0 once n>1/U(ω): Xn→0almost surely, and hence in probability. But EXn=n⋅n1=1 for every n, so it does not converge to 0 in L1, or in Lp, p≥1 (EXnp=np−1). This is “escaping” mass: expectation lives on a set of vanishing probability, invisible to almost sure pointwise convergence. Thus almost surely ⇒L1 and in probability ⇒L1.
The table summarizes these and three more, drawn by the Figure 1 zoo’s sequence menu.
Sequence (Xn→0?)
a.s.
in probability
L1
L2
Typewriter
no
yes
yes
yes
n1{U<1/n}, one U
yes
yes
no (E=1)
no
n1{Un<1/n}, independent Un
no
yes
no (E=1)
no
n1{Un<1/n2}, independent Un
yes
yes
yes (E=1/n)
no (EXn2=1)
Mean of n standard normals Zˉn
yes
yes
yes
yes
The third row contrasts instructively with the second: the sameP(Xn=0)=1/n, but with independent Un instead of one U. Events An={Un<1/n} are independent and ∑1/n=∞: by (II), infinitely many occur almost surely, and the sequence does not converge almost surely, although it converges in probability. Each Xn has the same marginal probability as before, yet convergence changes completely because almost sure convergence depends on how the Xn relate to one another; the other modes (probability, Lp, distribution), when the limit is constant, look only at each Xn‘s law separately and cannot tell. The fourth row is the opposite: with s=2>1, Borel–Cantelli I gives almost sure convergence; it is in L1 (E=1/n) and not L2 (EXn2=n2/n2=1), showing also that L1 does not imply L2: the implication Lp⇒Lq only goes downward. Generally, for na1{Un<n−s}, E∣Xn∣p=nap−s tends to 0 if and only if ap<s: the axis of Figure 1’s sliders.
The last counterexample concerns convergence in distribution. Let Z∼N(0,1) and Xn=(−1)nZ. Each Xn has law N(0,1), so XndZ trivially. But ∣Xn−Z∣=2∣Z∣ for odd n: it does not converge in probability to Z (or any other variable). Convergence in distribution compares the laws of Xn and X, not the variables themselves. One exception works when the limit is constant: Xndc implies XnPc, because P(∣Xn−c∣>ε)≤1−Fn(c+ε/2)+Fn(c−ε/2)→1−1+0, since F is the step at c and c±ε/2 are continuity points.
Uniform integrability: the bridge between probability and L1
The escaping spike warns when limits and expectations cannot be exchanged after convergence in probability: Xn→0 in probability and EXn=1→0=E[limXn]. In real applications, such as the expected value of a loss converging in probability, an importance estimator with enormous weights or a martingale, the crucial question is: what stops mass from escaping to infinity? The answer has a name.
In words, the part of the expectation living in large values can be made small simultaneously for the whole family, by choosing sufficiently large K. Any single integrable variable satisfies this (dominated convergence); “uniform” adds that K does not depend on the family member. The escaping spike violates this plainly: E[Xn1{Xn>K}]=1 for every n>K.
Proof
(2) E[∣Xi∣1{∣Xi∣>K}]≤E[Y1{Y>K}], which tends to 0 by dominated convergence with dominator Y. (3) On {∣Xi∣>K}, ∣Xi∣≤∣Xi∣1+δ/Kδ, so E[∣Xi∣1{∣Xi∣>K}]≤K−δsupiE∣Xi∣1+δ→0. (4) E∣Xi∣≤K+E[∣Xi∣1{∣Xi∣>K}] and choose K so the last term is ≤1. (1) is a finite union of single-element families.
∎
Criterion (3) is used in practice: “the second moments are bounded, so the family is UI.” It saves na1{U<1/n} with a<1 (bounded in L1/a) from the counterexample, and fails when a=1. Now for the theorem justifying the name “bridge.”
Proof
(1 ⇒ 2) By (4), C=supnE∣Xn∣<∞. Since Xn→X in probability, a subsequence converges almost surely and Fatou’s lemma gives E∣X∣≤liminfE∣Xnk∣≤C: X∈L1. Fix ε>0 and let Bn={∣Xn−X∣>ε}, with P(Bn)→0. Then
E∣Xn−X∣≤ε+E[∣Xn∣1Bn]+E[∣X∣1Bn].
Given η>0, choose K with supnE[∣Xn∣1{∣Xn∣>K}]<η. Then E[∣Xn∣1Bn]≤KP(Bn)+η. Also E[∣X∣1Bn]→0, because X is integrable and P(Bn)→0 (absolute continuity of the integral: E[∣X∣1B] is small if P(B) is, by dominated convergence). Thus limsupE∣Xn−X∣≤ε+η, and ε,η are arbitrary.
(2 ⇒ 1) Since ∣Xn∣≤∣Xn−X∣+∣X∣, for any B we have E[∣Xn∣1B]≤E∣Xn−X∣+E[∣X∣1B]. Given η>0, choose n0 with E∣Xn−X∣<η for n≥n0, and δ>0 with E[∣X∣1B]<η if P(B)<δ. With B={∣Xn∣>K}, Markov gives P(B)≤E∣Xn∣/K≤C/K<δ for large K (C=supE∣Xn∣<∞ because it converges in L1). Then E[∣Xn∣1{∣Xn∣>K}]<2η for n≥n0, and the finitely many variables n<n0 are handled by criterion 1 above.
The Lp statement reduces to this one. If (∣Xn∣p) is UI, it is bounded in L1 and Fatou, as above, gives X∈Lp; since ∣Xn−X∣p≤2p−1(∣Xn∣p+∣X∣p), the family (∣Xn−X∣p) is also UI (a sum of two UI families is UI), and converges to 0 in probability; applying the p=1 case gives E∣Xn−X∣p→0. The converse is analogous, with ∣Xn∣p≤2p−1(∣Xn−X∣p+∣X∣p).
∎
Uniform integrability is exactly the required condition: not a superfluous technical assumption but a characterization. It also governs martingales (a martingale converges in L1 if and only if it is UI) and convergence of expectations of importance-weighted estimators. The next table lists ways to fix a broken arrow and the tool behind each assumption.
Failure
Sufficient addition
Why
in probability ⇒ almost surely
pass to a subsequence, or summable rate ∑P(∣Xn−X∣>ε)<∞
Borel–Cantelli I
in probability ⇒Lp
(∣Xn∣p) UI
Vitali
almost surely ⇒Lp
domination ∣Xn∣≤Y∈Lp
dominated convergence (a special case of Vitali)
Lp⇒ almost surely
∑E∣Xn−X∣p<∞
Markov and Borel–Cantelli I
in distribution ⇒ in probability
the limit is constant
the Fn concentrate at c
Convergence in distribution
Convergence in distribution is the least intuitive and most widely used, because it appears in the central limit theorem and generative models. It has several equivalent formulations (the Portmanteau theorem). To prove them, the key tool reduces convergence in distribution to almost sure convergence by changing probability space.
Proof
Let Qn(u)=inf{x:Fn(x)≥u} be the quantile function of Fn and Q that of F. If U is uniform on (0,1), Qn(U) has distribution function Fn (because Qn(u)≤x⇔u≤Fn(x)): this is inverse transform sampling. Take Yn=Qn(U) and Y=Q(U) and show Qn(u)→Q(u) at every u where Q is continuous. Since Q is monotone, it has at most countably many discontinuities, so the result holds almost surely.
Let u be a continuity point of Q and ε>0. Lower bound: choose a continuity point x of F with Q(u)−ε<x<Q(u) (continuity points are dense). Since x<Q(u), F(x)<u; then Fn(x)<u for large n and hence Qn(u)≥x>Q(u)−ε. Upper bound: continuity of Q at u gives u′∈(u,1) with Q(u′)<Q(u)+ε/2. Choose a continuity point x of F in (Q(u′),Q(u)+ε). Then F(x)≥F(Q(u′))≥u′>u, so Fn(x)>u for large n and Qn(u)≤x<Q(u)+ε.
∎
Skorokhod is a legitimate trick: replace the variables by others with the same laws for which convergence is almost sure; since convergence in distribution looks only at laws, we can prove it with those variables. The code figure below measures the speed of this quantile coupling.
Proof
(1 ⇒ 2) With Yn→Y almost surely from Skorokhod, f(Yn)→f(Y) almost surely, and since f is bounded, dominated convergence gives Ef(Xn)=Ef(Yn)→Ef(Y)=Ef(X). (2 ⇒ 3) is trivial. (3 ⇒ 4) Let C be closed and fk(x)=max(0,1−kdist(x,C)): it is bounded, k-Lipschitz, fk≥1C and fk↓1C. Then limsupnP(Xn∈C)≤limnEfk(Xn)=Efk(X), and the last term tends to P(X∈C) as k→∞. (4 ⇔ 5) follows by complements. (4, 5 ⇒ 6) Since P(X∈∂A)=0, P(X∈intA)=P(X∈A)=P(X∈Aˉ); and liminfP(Xn∈A)≥liminfP(Xn∈intA)≥P(X∈intA), whereas limsupP(Xn∈A)≤limsupP(Xn∈Aˉ)≤P(X∈Aˉ). (6 ⇒ 1) With A=(−∞,x], ∂A={x} and P(X=x)=0 if and only if x is a continuity point of F.
∎
Formulation 2 is useful because convergence in distribution is convergence of expectations of test functions. Writing “Ef(Xn)→Ef(X)” says Xn and X look alike to every bounded continuous observable. Formulation 6 shows in what sense it is weak: with Xn=1/n→0, the set A={0} gives P(Xn∈A)=0 for every n and P(X∈A)=1, without contradiction because ∂A={0} has positive probability under the limiting law and A is excluded. Point masses need not converge.
Lévy’s continuity theorem
Distribution functions cannot be added, multiplied or checked by eye for a sum of variables. The characteristic functionφn(t)=E[eitXn] can. The next theorem turns convergence in distribution into pointwise convergence of functions R→C, making the proof of the central limit theorem possible.
Proof
(1) cos(tx) and sin(tx) are bounded and continuous: apply formulation 2 of Portmanteau to each.
(2) Step 1: the sequence is tight (∀ε∃K with P(∣Xn∣>K)<ε for every n). Use the truncation inequality
P(∣X∣≥2/δ)≤δ1∫−δδ(1−φX(t))dt.
Indeed, δ1∫−δδ(1−eitx)dt=2(1−δxsinδx), which is always ≥0 and ≥1 if ∣δx∣≥2 (since ∣sinu/u∣≤1/2 for ∣u∣≥2); take expectations and apply Fubini. Since g(0)=1 and g is continuous at 0, for given ε there is δ with δ1∫−δδ(1−g)<ε/2. By dominated convergence (∣1−φn∣≤2), δ1∫−δδ(1−φn)→δ1∫−δδ(1−g)<ε/2, so P(∣Xn∣≥2/δ)<ε for n≥n0. Handle the finitely many variables n<n0 individually.
Step 2. By Helly’s selection theorem, every subsequence of (Fn) has a further subsequence converging at continuity points to a nondecreasing function G; tightness makes G a proper distribution function. By (1), the characteristic function of G is limφnk=g. All further subsequences have the same limit, since uniqueness says g determines the law. A number sequence (Fn(x)) for which every subsequence has a further subsequence with the same limit converges to that limit.
∎
There are two messages. First, continuity at 0 of the limit is not optional: if Xn∼N(0,n), then φn(t)=e−nt2/2→1{t=0}, discontinuous at 0, and indeed Xn converges in distribution to nothing (mass escapes to ±∞: there is no tightness). Second, in practice one uses direction (2): computing φn of a normalized sum is easy (multiply), and convergence to e−t2/2 suffices to conclude the limit is normal. The central limit theorem lesson does exactly that.
Continuous mapping and Slutsky’s lemma
Convergence in distribution would be useless if we could not operate with it. The continuous mapping theorem and Slutsky’s lemma make this possible.
Proof
Almost surely: on the probability-one set where Xn(ω)→X(ω) and X(ω)∈/Dg, g(Xn(ω))→g(X(ω)) by continuity at X(ω). Probability: let (g(Xnk)) be a subsequence; by the subsequence criterion, a further subsequence has Xnkj→X almost surely, so (previous case) g(Xnkj)→g(X) almost surely; the same criterion in the other direction gives g(Xn)→g(X) in probability. Distribution: by Skorokhod, Yn→Y almost surely and g(Yn)→g(Y) almost surely, so g(Yn)dg(Y); and g(Yn)=dg(Xn), g(Y)=dg(X).
∎
Three cautions: (i) the result is false in Lp (if Xn→0 in L1, Xn2 need not converge in L1: the spike with a=1/2); (ii) the assumption on Dg is necessary: g=1(0,∞) and Xn=1/n→0 give g(Xn)=1 but g(0)=0, and 0∈Dg has probability one; (iii) for random vectors the proof is the same, with Skorokhod’s theorem in Rd and “distribution” as weak convergence of measures.
The proof uses a lemma at the heart of the result: two sequences close in probability share their limit in distribution.
Proof
Lemma. If UndU and ∣Zn−Un∣P0, then ZndU. Indeed, let f be bounded by B and L-Lipschitz. For ε>0, ∣f(Zn)−f(Un)∣≤Lε+2B1{∣Zn−Un∣>ε}, so limsup∣Ef(Zn)−Ef(Un)∣≤Lε for every ε, meaning the difference tends to 0. Since Ef(Un)→Ef(U), also Ef(Zn)→Ef(U), and formulation 3 of Portmanteau concludes.
Sum.Un=Xn+cdX+c and ∣(Xn+Yn)−Un∣=∣Yn−c∣P0.
Product.Un=cXndcX and ∣XnYn−Un∣=∣Xn∣∣Yn−c∣. Given η>0, tightness of (Xn) gives K with P(∣Xn∣>K)<η for every n (every sequence converging in distribution is tight: take continuity points ±K0 of F with F(K0)−F(−K0)>1−η/2, so P(∣Xn∣>K0)<η for large n, and enlarge K0 to cover the finitely many remaining); then P(∣Xn∣∣Yn−c∣>ε)≤η+P(∣Yn−c∣>ε/K)→η, and η is arbitrary.
Quotient. By continuous mapping (g(y)=1/y is continuous at c=0, with convention 1/0=0), 1/YnP1/c, and apply the product result.
∎
Why “constant”: merely requiring YndY makes the conclusion false. With Xn=Z and Yn=−Z, Z∼N(0,1), both converge in distribution to N(0,1) but Xn+Yn=0, which is not N(0,2). For a pair we need the joint law, which the marginal laws do not determine (the copula is another piece of information). With Yn→c in probability, the joint limiting law is trivially the product X⊗δc.
Slutsky in action: the t statistic
The canonical example. Let Xi be iid with mean μ and variance σ2∈(0,∞). The central limit theorem says Tn=n(Xˉn−μ)/σdN(0,1), but requires knowing σ. In practice, use sample standard deviation Sn. By the strong law of large numbers (next lesson, applied to Xi and Xi2), Sn2=n−1n(X2n−Xˉn2)→σ2 almost surely, so Sn/σP1. By Slutsky,
tn=Snn(Xˉn−μ)=Tn⋅SnσdN(0,1)⋅1.
This justifies the confidence interval Xˉn±1.96Sn/nwithout knowing σ or assuming normal data. It is purely asymptotic: it says nothing about speed. The figure compares both formulations on the same samples.
InteractiveSlutsky in action
Tn=n(Xˉn−μ)/σ, with n=12
T_n
N(0, 1)
tn=n(Xˉn−μ)/Sn, with n=12
t_n
N(0, 1)
Kolmogorov distance to standard normal versus n (logarithmic scale)
T_n (σ known)
t_n (σ estimated)
Population
Kolmogorov distance from Tn to N(0,1)0.043
Kolmogorov distance from tn to N(0,1)0.093
P(tn<−1.96) (nominal 0.025)0.110
P(tn>1.96) (nominal 0.025)0.012
coverage of interval Xˉ±1.96Sn/n87.9 %
Sn/σ: mean and standard deviation0.940 and 0.366
Sn→σ in probability: the standard deviation of Sn/σ is 0.37 at n=12 and shrinks like 1/n. By Slutsky, tn and Tn share a limit but differ for finite n (population skewness: 2).
For each skewed population (or the symmetric uniform), we simulate 2500 replicates of a sample of size n and compute, on the same samples, Tn=n(Xˉn−μ)/σ (true σ, blue) and tn=n(Xˉn−μ)/Sn (estimated Sn, orange). The overlaid curve is the standard normal density. Below, the Kolmogorov distance supxF^(x)−Φ(x) of each against n (the Monte Carlo noise floor with 2500 replicates is about 0.017). Both approach N(0,1), but tn lags: with small Sn, tn shoots up and the tails are skewed (the 95% interval misses almost entirely on one side). The Sn/σ reading shows Slutsky's “in probability” part: its spread shrinks like 1/n. With the log-normal, the difference remains visible even at n=600.
The complete implication map
We now have all the pieces. The next interactive map shows implications that always hold, counterexamples to the others, and assumptions repairing each one. Click an arrow: green ones include a proof sketch, red ones an animated counterexample, and enabling an additional assumption turns the corresponding red arrow green.
InteractiveImplication map
valid implication
valid with the assumption enabled
does not hold in general
Counterexample
Typewriter: Xn=1In(U) with In the dyadic interval [j/2k,(j+1)/2k), n=2k+j. Since P(Xn=1)=2−k→0, it converges to 0 in probability (and in Lp). But each ω lies in an interval at every level k: Xn(ω)=1 for infinitely many n, so the sequence converges for no ω.
With an additional assumption
Enable «pass to a subsequence» or «summable rate: ∑nP(∣Xn−X∣>ε)<∞» to see when the implication holds.
Typewriter: interval In on Ω=[0,1). Drag ω.
Xk(ω) for k≤n: equals 1 on 6 occasions and does not stop
n = 63
selected arrowfails in general
P(Xn=1)=E∣Xn∣p at n=631/32 = 0.0313
Xn→X in probability ⇒ almost surely
Four modes of convergence and eight arrows. Click an arrow's circle for its proof or counterexample. In the counterexamples, drag ω over Ω=[0,1) and use the player to advance n: in the typewriter, the bottom row shows Xn(ω)=1 never stops; in the spike, each ω trajectory eventually reaches 0 but the rectangle's area is always 1; in the alternating sign, points jump between diagonal and antidiagonal with the same law. Switches add assumptions (uniform integrability, domination, constant limit, subsequence, summable rate) that turn broken arrows green.
The map reduces to one sentence per mode:
Almost surely controls each trajectory. This is what you want when running one algorithm.
In probability controls each instant. This is what you prove with only Chebyshev or Chernoff bounds.
Lp controls mean error. This is the natural mode for quadratic bounds and function norms.
In distribution controls only laws. This is the mode of limit theorems and asymptotic inference.
The arrows’ direction is consistent: what a whole trajectory says (a.s.) implies what an instant says (probability), which implies what the law says (distribution), while mean error (Lp) sits alongside, implying probability without a connection to a.s.
Skorokhod in general, and beyond. All of the above uses real Xn and X, but holds for random vectors in Rd and, with suitable modifications, in separable metric spaces (with PXn⇒PX defined via Portmanteau formulation 2). This underlies stochastic process theory, needed in the martingale and diffusion process modules, and results such as Donsker’s invariance principle, stated using weak convergence of laws on a space of continuous functions. A final note: convergence in distribution is not the only way to compare laws. Quantifying the difference using a distance (total variation or Wasserstein) or a divergence that is not a distance (Kullback–Leibler) requires going further; the lesson on distances between distributions and couplings covers these. Among other things, Scheffé’s theorem says that if densities converge pointwise, pn→p almost everywhere, then ∫∣pn−p∣→0, much more than convergence in distribution.
Implementation from scratch
Using NumPy, we build the five sequences in the table and a diagnostic measuring, for each, the three quantities in Figure 1: probability P^(∣Xn∣>ε), moment E^∣Xn∣ and fraction of trajectories stabilized from n (those with no exceedance between n and the horizon). Column j of the array corresponds to n=j+1.
[ ]Five sequences, three convergence measuresBrowser
import numpy as np
from scipy import stats
rng = np.random.default_rng(16)
M, N = 2000, 1024 # trayectorias y horizonte
n = np.arange(1, N + 1, dtype=float) # la columna j corresponde a n = j + 1
def maquina(M):
"X_n = 1{U en I_n}, con I_n = [j/2^k, (j+1)/2^k) y n = 2^k + j"
U = rng.random(M)[:, None]
w = 2.0 ** np.floor(np.log2(n))
return ((U >= (n - w) / w) & (U < (n - w + 1) / w)).astype(float)
def pico_unico(M):
"X_n = n 1{U < 1/n} con un solo U por trayectoria"
return n * (rng.random(M)[:, None] < 1 / n)
def picos_indep(M, s):
"X_n = n 1{U_n < n^-s} con U_n independientes"
return n * (rng.random((M, N)) < n ** (-float(s)))
def medias(M):
"X_n = media de n normales estándar"
return np.cumsum(rng.standard_normal((M, N)), axis=1) / n
def diagnostico(X, eps=0.25, p=1):
A = np.abs(X)
prob = (A > eps).mean(axis=0) # P(|X_n| > eps), una por columna
mom = (A ** p).mean(axis=0) # E|X_n|^p
exceso = A > eps
ultimo = np.where(exceso.any(axis=1), N - np.argmax(exceso[:, ::-1], axis=1), 0)
estab = lambda n0: np.mean(ultimo < n0) # fracción de trayectorias sin excesos desde n0
return prob, mom, estab
secuencias = {
"máquina de escribir": (maquina(M), 1 / 512),
"n·1{U<1/n}, un solo U": (pico_unico(M), 1.0),
"picos independientes, prob. 1/n": (picos_indep(M, 1), 1.0),
"picos independientes, prob. 1/n²": (picos_indep(M, 2), 1 / 512),
"media de normales": (medias(M), np.sqrt(2 / np.pi / 512)),
}
print(f"{'sucesión (n = 512)':34s} {'P(|X|>ε)':>9s} {'E|X| est.':>10s} {'E|X| teor.':>11s} {'estabilizadas':>14s}")
for nombre, (X, teo) in secuencias.items():
prob, mom, estab = diagnostico(X)
print(f"{nombre:34s} {prob[511]:9.4f} {mom[511]:10.3f} {teo:11.3f} {estab(512):14.3f}")
The table confirms the five rows. Probability P^(∣Xn∣>ε) is small in all (all five converge in probability). Observed means agree with theory: ≈1 for the two probability-1/n spikes (which do not converge in L1) and near 0 for the other three. Beware the first’s noise: at n=512 only about 4 of 2000 trajectories spike, and each contributes 512/2000≈0.26 to the mean; the same escaping mass now appears as huge Monte Carlo estimator variance. The key column is the last: the stabilized fraction is 0.998 for the one-U spike and the probability-1/n2 spikes, near 1, indicating “almost surely”; 0.497 for independent probability-1/n spikes (with horizon 1024, P(ninguˊn pico entre 512 y 1024)=∏(1−1/k)=511/1024, which is measured), and exactly 0 for the typewriter (each trajectory returns to 1 in the last complete level). These last two do not converge almost surely, although the first column says they do in probability. The phenomenon is the same as Figure 1, now measured in code.
Now verify Borel–Cantelli with a large simulation: for independent P(An)=n−p, compare the mean event count, the sum ∑P(An), and the fraction of realizations with another event after n=1000.
[ ]Borel–Cantelli: the sum of probabilities decidesBrowser
rng2 = np.random.default_rng(3)
R, NN = 4000, 10_000
k = np.arange(1, NN + 1, dtype=float)
print("p sum P(A_n) media observada filas con algún suceso n>=1000")
for p in (0.8, 1.0, 1.2, 2.0):
A = rng2.random((R, NN)) < k ** (-p)
print(f"{p:.1f} {np.sum(k ** (-p)):10.3f} {A.sum(axis=1).mean():15.3f} {np.mean(A[:, 999:].any(axis=1)):.3f}")
The observed mean agrees with the sum within Monte Carlo error (the identity E[N]=∑P(An)). With p=2 it is 1.65 (the sum is π2/6=1.645) and only 0.1% of rows have an event from n=1000 onward; with p=1 the sum is 9.79 up to 104, which is H104, and 90% of rows still have an event at n≥1000 (theory: 1−∏n=1000104(1−1/n)=1−999/104=0.90). The critical value is p=1, and this is not a boundary effect: these are the infinitely many occurrences of (II), spaced at ln10≈2.3 per decade.
Now the CLT with and without known σ, with Kolmogorov distance coded from scratch: D=supxF^n(x)−F(x), attained for an ordered sample at jumps of F^n.
[ ]Slutsky: T_n versus t_n for an exponential populationBrowser
def kolmogorov(x, F):
"sup |F_n - F| de la función de distribución empírica de x frente a F"
x = np.sort(x); m = len(x); f = F(x)
return max(np.max(np.arange(1, m + 1) / m - f), np.max(f - np.arange(0, m) / m))
rng3 = np.random.default_rng(5)
M3 = 10_000
print(" n D(T_n) D(t_n) P(t_n < -1.96) P(t_n > 1.96)")
for nn in (5, 30, 200):
X = rng3.exponential(1.0, size=(M3, nn)) # media 1, desviación típica 1
xbar, S = X.mean(axis=1), X.std(axis=1, ddof=1)
T = np.sqrt(nn) * (xbar - 1.0)
t = np.sqrt(nn) * (xbar - 1.0) / S
print(f"{nn:4d} {kolmogorov(T, stats.norm.cdf):7.4f} {kolmogorov(t, stats.norm.cdf):7.4f} {np.mean(t < -1.96):13.4f} {np.mean(t > 1.96):13.4f}")
With n=5, D(tn)=0.163 versus D(Tn)=0.063: using Sn instead of σmore than doubles normal approximation error, and the left tail of tn weighs 0.18 instead of the nominal 0.025: when Xˉn is low, Sn is also small and the ratio stretches. With n=200, D(Tn)=0.011 is already near the Monte Carlo noise floor (≈0.87/M=0.009 with M=104), while D(tn)=0.017 still doubles it and the left tail of tn weighs 0.038 instead of 0.025. Slutsky promises the same limit; the sample size at which it is reached is another question, refined by the Berry–Esseen theorem in the CLT lesson.
The library version
Tool
What it does
Note
scipy.stats.kstest(x, "norm")
Kolmogorov distance against a distribution
returns statistic and pvalue; statistic is D above
scipy.stats.ks_2samp(x, y)
distance between two empirical distribution functions
compares two samples without knowing F
scipy.stats.<ley>.ppf
quantile function Q
the quantile coupling piece of Skorokhod
numpy.maximum.accumulate
cumulative maxima
supremum tail supk≥n in one line (with dimension reversed)
scipy.stats.wasserstein_distance
W1 distance between samples
convergence in distribution with a metric (lesson on distances between distributions)
[ ]scipy: kstest and Skorokhod quantile couplingBrowser
print("D(t_n) con scipy.stats.kstest:", round(stats.kstest(t, "norm").statistic, 4), " y a mano:", round(kolmogorov(t, stats.norm.cdf), 4))
print("\nacoplamiento por cuantiles: sup |Q_n(u) - Q(u)| en u en [0.05, 0.95]")
u = np.linspace(0.05, 0.95, 181)
for nb in (10, 100, 1000, 10_000):
Qn = (stats.binom.ppf(u, nb, 0.5) - nb / 2) / (np.sqrt(nb) / 2) # cuantil de la binomial estandarizada
print(f" n = {nb:5d}: {np.max(np.abs(Qn - stats.norm.ppf(u))):.4f}")
The statistic of kstest agrees with the manual implementation (0.0173 with n=200). The second block draws Skorokhod’s theorem: with the same uniform u, the standardized binomial Qn(u) and normal Q(u) approach pointwise, with a uniform error decreasing as 1/n (0.333, 0.0996, 0.0304, 0.0099). The variables Yn=Qn(U) and Y=Q(U) are those of the theorem: Yn→Y almost surely (here even uniformly over the central range). This is a useful pattern: coupling two laws with a common uniform is the cheapest way to compare them, leading to Wasserstein distances.
Common mistakes
Exercises
ProofFrom almost surely to probability, and probability to a subsequence
Prove: Prove that (a) if Xn→X almost surely, then Xn→X in probability, and (b) if Xn→X in probability, there is a subsequence Xnk→X almost surely.
0
Use continuity of probability from above and the first Borel–Cantelli lemma.
Step 1 of 4. For (a), fix ε>0 and define Bn=⋃k≥n{∣Xk−X∣>ε}. What do you know about (Bn)?
ProofSlutsky for sums using distribution functions
Prove: Prove that if XndX and YnPc (constant), then Xn+YndX+c, using distribution functions directly.
0
Let F be the distribution function of X and x a continuity point of that of X+c, so x−c is a continuity point of F. Use ε>0 for which x−c±ε are also continuity points of F.
Step 1 of 4. What upper bound do you obtain for P(Xn+Yn≤x)?
QuizValues $n$ with probability $1/n$
Let X1,X2,… be independent, with Xn=n with probability 1/n and Xn=0 otherwise. Which statement about convergence to 0 is correct?
NumericExpected number of events with $\Pr(A_n) = 1/n^2$
Events An, n≥1, have P(An)=1/n2. Let N be the number of events that occur. What is E[N]?
NumericProbability that none occur
Events An, n≥2, are independent with P(An)=1/n2. What is the probability that none occur?
QuizFor which values of $a$ is it UI?
Let Xn=na1{U<1/n} with U uniform on (0,1) and a≥0. For which values of a is (Xn)n≥1 uniformly integrable?
QuizTwo limits in distribution do not add
Let Z∼N(0,1), Xn=Z and Yn=−Z for every n. Then XndN(0,1) and YndN(0,1). What is the distributional limit of Xn+Yn?
CodeAn empirical diagnostic: almost surely versus probability
Implement diagnose(X, eps, n0, tol=0.02). X is an array of shape (M, N) containing M simulated trajectories of a sequence compared with 0 (column j is n=j+1). Compute p_last, the fraction of trajectories with |X_N| > eps (last instant), and tail, the fraction with any exceedance |X_n| > eps with n >= n0 (up to the horizon). Return 'casi seguro' if tail <= tol; otherwise 'en probabilidad' if p_last <= tol; otherwise 'ninguno'. The tests use the typewriter, the single-U spike, independent spikes with probabilities 1/n and 1/n2, and iid noise.
import numpy as np
def diagnose(X, eps, n0, tol=0.02):
"""Clasifica la convergencia a 0 de las trayectorias X (M x N)."""
A = np.abs(np.asarray(X, dtype=float)) > eps
# tu codigo: p_last (ultima columna) y tail (algun exceso desde n = n0)
return "ninguno"
Shift+Enter to run
Summary
Key idea
“Converges” has four meanings. Almost surely: each trajectory converges. In probability: being far away at any given time is unlikely. In Lp: mean error vanishes. In distribution: only laws approach each other. The arrows are “almost surely ⇒ in probability ⇒ in distribution” and “Lp⇒ in probability”; no others hold without an added assumption: a subsequence or summable rate (Borel–Cantelli), uniform integrability (Vitali) or domination, and a constant limit.
Almost surely is equivalent to supk≥n∣Xk−X∣→0 in probability (tail criterion). It comes from no topology.
Borel–Cantelli: if ∑P(An)<∞, only finitely many An occur; if the sum diverges and An are independent, infinitely many occur almost surely. Without independence, the second half is false.
Convergence in probability ⇔ every subsequence has an almost surely convergent further subsequence. The typewriter (Lp and probability, not almost surely) and escaping spike (almost surely, not L1) are the two canonical counterexamples.
Uniform integrability: limKsupnE[∣Xn∣1{∣Xn∣>K}]=0; with convergence in probability it is equivalent to L1 (Vitali). It is guaranteed by bounded moments of order 1+δ or an integrable dominator.
In distribution: Fn→F at continuity points; Portmanteau reformulates it via test functions, closed and open sets. Skorokhod reduces it to almost sure convergence on another space (quantile coupling). Lévy: φn→g pointwise with g continuous at 0 implies convergence in distribution.
Continuous mapping (valid almost surely, in probability and in distribution, not in Lp) and Slutsky (XndX, YnPc constant: sums, products and quotients work) justify the t statistic and asymptotic inference with estimated variances.