What does “almost surely” mean?
Toss a fair coin forever and record the proportion of heads after tosses. In 1909 Émile Borel proved that this proportion tends to "with probability one". What can that mean? The sequence HHHH… is a perfectly possible outcome, and so are uncountably many other sequences whose proportion of heads tends to , or oscillates forever. The claim is that all these exceptional sequences together form an event of probability zero — not an empty event, but a negligible one.
To say this we need a probability on the space of all infinite toss sequences, an uncountable set on which every single sequence has probability . The event "the proportion converges to " is built from infinitely many tosses by countably many unions and intersections, so the probability must be countably additive. This is precisely measure theory.
A second puzzle concerns conditioning on events of probability zero. Choose a point uniformly on the Earth's surface and condition on its lying on the Greenwich meridian (an event of probability ). Is its latitude then uniformly distributed? Computed as a limit of thin longitude wedges the answer is "no, it has density proportional to "; computed with thin bands of constant width around the meridian, "yes". This is the Borel–Kolmogorov paradox. Kolmogorov's way out (1933) was to condition not on single events but on σ-algebras — on information — and to define the conditional expectation as a random variable, determined up to null sets by the Radon–Nikodym theorem. This lesson builds that theory and proves with it the three pillars of classical probability: the strong law of large numbers, the martingale convergence theorem and the central limit theorem.
A dictionary, and σ-algebras as information
Kolmogorov's Grundbegriffe der Wahrscheinlichkeitsrechnung (1933) is a translation table. Every probabilistic notion is a measure-theoretic one with a new name — and the probabilist's interest lies in the questions the new names suggest.
| Probability | Measure theory |
|---|---|
| sample space , events | a set with a σ-algebra |
| probability | a measure with |
| random variable | a measurable function |
| law (distribution) of | the pushforward measure on |
| expectation | the integral |
| independence | product measure |
| almost surely (a.s.) | almost everywhere |
| conditional expectation | a Radon–Nikodym derivative; an orthogonal projection in |
The genuinely new idea is to read a sub-σ-algebra as information: the events whose occurrence an observer can decide. A random variable is -measurable when the observer can compute its value. As time passes, information grows: a filtration . The conditional expectation is the observer's best guess of — itself a random quantity, because it depends on what the observer has seen.
Definitions
Definition— probability space, random variable, law
A probability space is a measure space with . A random variable is a measurable ; its law is the Borel probability measure and its distribution function is . The expectation of an integrable is , and for Borel with integrable, (change of variables).
Definition— independence
Sub-σ-algebras are independent if for all ; an infinite family is independent if every finite subfamily is. Random variables are independent if the σ-algebras are; events are independent if their indicators are. By Dynkin's π–λ theorem it suffices to check the product rule on generating π-systems, so are independent if and only if , i.e. if and only if their joint law is the product measure .
Definition— modes of convergence
Let be random variables. Then
- almost surely if ;
- in probability if for every ;
- in () if ;
- in distribution (or weakly) if for every bounded continuous ; equivalently, at every point where is continuous.
The first three need the variables to live on one probability space; convergence in distribution is a statement about the laws only.
Definition— characteristic function
The characteristic function of is for — the Fourier transform of its law, defined for every random variable since .
Definition— conditional expectation
Let be integrable and a sub-σ-algebra. A conditional expectation of given is a random variable such that
- is -measurable and integrable, and
- for every .
It exists and is unique up to almost-sure equality (theorem below); we write , and . Conditional probability is .
Definition— filtration, martingale, stopping time
A filtration is an increasing sequence . A process is adapted if each is -measurable. An adapted process of integrable variables is a martingale if a.s. for all , a supermartingale if , and a submartingale if . A stopping time is a random variable with for every : whether to stop now can be decided from the information available now. A process is predictable if each is -measurable.
By the tower property (below), the martingale condition for one step implies for all ; this is Mathlib's definition.
Examples and counterexamples
Example— Infinitely many coin tosses are Lebesgue measure
Let with Lebesgue measure and let be the -th binary digit of (choosing the expansion not ending in s). The event is a dyadic interval of length , so : the digits are independent fair coin tosses. So the infinite product of fair coins exists, and Borel's theorem says that almost every real number has asymptotically half its binary digits equal to . (In general, infinite products of probability spaces exist by the Kolmogorov extension theorem.)
Example— The modes of convergence are different
On with Lebesgue measure:
- almost surely (at every point) but not in : .
- The "typewriter" indicators of tend to in and in probability, but converge at no point.
- If is standard normal and , then in distribution (they have the same law) but does not tend to .
A cleaner probabilistic example of convergence in probability without almost-sure convergence uses independence: if are independent with , then in probability, but by the second Borel–Cantelli lemma (below) infinitely many occur almost surely, so a.s.
Example— Conditioning on a partition
Let be generated by a partition with . Every -measurable function is constant on each , and condition 2 with forces the constant:
the elementary conditional expectations "glued together". For two fair dice , : a random variable, equal to on the event . With a joint density , where wherever the denominator is positive; changing on a -null set changes nothing. That freedom is exactly what dissolves the Borel–Kolmogorov paradox: conditioning on the null event is meaningful only through the whole family , which depends on the σ-algebra (the variable ), not on the event alone.
Example— Martingales
- Sums. If are independent and integrable with mean , and , then is a martingale: . If moreover , then is a martingale.
- Products. If are independent with , then is a martingale (likelihood ratios in statistics are of this form).
- Doob martingales. For integrable and any filtration, is a martingale — the sequence of ever better guesses of .
- Pólya's urn. An urn holds one red and one blue ball; repeatedly draw a ball and return it together with another of the same colour. If is the number of red balls after draws, the fraction satisfies : a martingale.
Borel–Cantelli, the zero–one law and the laws of large numbers
For events , the event "infinitely many occur" is .
Theorem— First Borel–Cantelli lemma
If , then : almost surely only finitely many of the occur.
Proof
For every , , so by countable subadditivity . The right side is the tail of a convergent series and tends to as .
∎
Theorem— Second Borel–Cantelli lemma
If the events are independent and , then .
Proof
It suffices to show for each , since the complement of is . The complements are independent too, so for , using ,
By continuity from above, .
∎
Independence cannot be dropped: if for a single event with , the sum diverges but . In the second lemma, is a tail event: it does not depend on any finitely many of the . That its probability is or is no accident.
Theorem— Kolmogorov's zero–one law
Let be independent σ-algebras and the tail σ-algebra. Then for every .
Proof
For each , is independent of . Hence is independent of the union , a π-system generating , and by the π–λ theorem of the whole of . So is independent of itself: .
∎
For independent the events " converges" and " converges" are tail events, so each has probability or ; the laws of large numbers say which.
Theorem— Relations between the modes of convergence
(a) Almost-sure convergence implies convergence in probability. (b) Convergence in probability implies almost-sure convergence of a subsequence. (c) Convergence in implies convergence in probability. (d) Convergence in probability implies convergence in distribution.
Proof
(a) Fix and let . These decrease to a subset of , which is null; by continuity from above .
(b) Choose with . By the first Borel–Cantelli lemma, almost surely for all large , so a.s.
(c) Markov's inequality: .
(d) Let be bounded and continuous, and suppose ; pass to a subsequence along which . By (b) a further subsequence converges a.s., so a.s. along it, and dominated convergence (with the bound ) gives — a contradiction.
∎
Theorem— Weak law of large numbers (Chebyshev)
Let be pairwise independent with and , and . Then , so in probability.
Proof
Pairwise independent square-integrable variables are uncorrelated, so and . Chebyshev's inequality (Markov applied to ) finishes the proof.
∎
Theorem— Strong law of large numbers (fourth-moment version)
Let be independent and identically distributed with and . Then almost surely.
Proof
Replacing by we may assume . Expand . By independence and , every term in which some index appears exactly once vanishes. What remains are the terms and, for each of the pairs , the arrangements of :
where is finite (note ). By Markov's inequality applied to ,
which is summable. By the first Borel–Cantelli lemma, almost surely for all large . Intersecting these almost-sure events over gives almost surely.
∎
The fourth moment is a convenience, not a necessity. Kolmogorov (1930) proved the strong law for i.i.d. integrable variables, and Etemadi (1981) found a short proof that needs only pairwise independence: truncate at level , prove convergence along the geometric subsequence with Chebyshev and Borel–Cantelli, and interpolate using (Durrett, §2.4). Integrability is necessary: if , then , so by the second Borel–Cantelli lemma infinitely often and diverges almost surely. Mathlib proves Etemadi's version (see the formal section).
Conditional expectation
Theorem— Existence and uniqueness of conditional expectation
For every integrable and every sub-σ-algebra there is a conditional expectation , and any two agree almost surely.
Proof
Existence. First let . On the measurable space define for . It is a finite measure (countable additivity is monotone convergence), and it is absolutely continuous with respect to the restriction : if then . By the Radon–Nikodym theorem on there is a -measurable with for all , and . For general apply this to and and subtract.
Uniqueness. Let both satisfy the definition and . Then , so and . By symmetry a.s.
∎
The point of the construction is that is the density of the measure " restricted to the information " — it is measurable with respect to , not , which is why the Radon–Nikodym theorem is applied on the smaller σ-algebra.
Theorem— Properties of conditional expectation
Let be integrable and sub-σ-algebras. Almost surely:
- (linearity) ;
- (positivity) if then ; hence ;
- , and if is -measurable;
- (tower) if then ;
- (taking out what is known) if is -measurable and is integrable, then ;
- (independence) if is independent of , then ;
- (conditional Jensen) if is convex and is integrable, then .
Proof
Each identity is proved by checking that the right side is measurable for the right σ-algebra and has the right integrals, and then invoking uniqueness.
(1) The right side is -measurable and its integral over is . (2) If and , then , so . (3) Take ; and itself satisfies the definition when it is -measurable.
(4) The left side is -measurable, and for : .
(5) For with and any : , since . By linearity the identity holds for simple -measurable . For and take simple and use monotone convergence on both sides (the conditional version follows from the defining integrals); the general case follows by splitting and into positive and negative parts.
(6) The constant is -measurable, and for , independence gives .
(7) A convex is the supremum of countably many affine functions with . By (1) and (2), almost surely for each ; take the supremum over the countably many .
∎
Theorem— Conditional expectation is an orthogonal projection
If , then is the orthogonal projection of onto the closed subspace . In particular it minimises over all -measurable square-integrable , and
Proof
Let . By conditional Jensen with , , so and . (That subspace is closed because is complete by Riesz–Fischer.) For bounded -measurable , by (3) and (5),
Bounded functions are dense in , so : is the orthogonal projection, and for any Pythagoras gives . Taking (a constant) gives , and by (3).
∎
This is in fact how Mathlib constructs conditional expectation: first as the orthogonal projection on , then extended by continuity to — the Radon–Nikodym route and the Hilbert-space route give the same object.
Martingales: stopping and convergence
Fix a filtration . For a martingale and a predictable process , the martingale transform is
Think of as the outcome of the -th fair game and as the stake, chosen with the information available before the game.
Theorem— You cannot beat a fair game
If is a martingale and is predictable and bounded, then is a martingale; in particular . If is a supermartingale and , then is a supermartingale and .
Proof
is adapted and integrable (as is bounded). Taking out what is known, , which is for a martingale and for a supermartingale with .
∎
A martingale has constant expectation, (take expectations in ). Can a cleverly chosen random time do better?
Theorem— Optional stopping theorem (bounded stopping times)
If is a martingale and is a stopping time with for a constant , then . For a supermartingale, .
Proof
Write . The stake is -measurable because is a stopping time. So has expectation (respectively ) by the previous theorem.
∎
Example— Gambler's ruin
A simple symmetric random walk starts at and stops at the first time it hits or . Both and are martingales. One checks (from any state, consecutive steps up end the game, so ). Apply optional stopping at the bounded times and let : allows dominated convergence, and allows monotone convergence. From we get , and from we get . Without some such control, optional stopping fails: the walk started at and stopped when it first hits stops almost surely, at — but .
Now let and let be the number of upcrossings of completed by : the number of times the path passes from below to above .
Theorem— Doob's upcrossing inequality
If is a supermartingale, then .
Proof
Use the strategy "buy when the price drops below , hold until it rises above , then sell": and . It is predictable with values in . Each completed upcrossing earns at least , and the last, possibly incomplete, holding period loses at most . So
Since for a supermartingale, the inequality follows.
∎
Theorem— Doob's martingale convergence theorem
If is a supermartingale (in particular, a martingale) with , then converges almost surely to a finite limit with .
Proof
For rationals , , and by monotone convergence and the upcrossing inequality
so almost surely. On the event the path crosses upwards infinitely often, so this event is null. The union over the countably many rational pairs is null, hence almost surely: the limit exists in . By Fatou's lemma , so is finite a.s.
∎
Three remarks. First, a non-negative supermartingale is automatically -bounded (), so it always converges. Second, convergence need not hold in : if are independent with , the product martingale is from the first zero onwards, so a.s., while . convergence holds exactly when the martingale is uniformly integrable, and then . Third, Lévy's upward theorem: for integrable , almost surely and in , where .
Example— Pólya's urn converges to a uniform limit
The urn fraction is a bounded martingale, so it converges almost surely to some . Its law is uniform on : by induction, for , because . So is uniform on , and the almost-sure limit (hence the limit in distribution) is uniform. The limit is genuinely random: each urn settles down, but different urns settle at different values.
Example— Random signs
Let be independent fair signs. Then is a martingale with , hence -bounded (Cauchy–Schwarz). So the random harmonic series converges almost surely — although diverges.
Characteristic functions and the central limit theorem
Characteristic functions have the following properties (Durrett, §3.3): , and is uniformly continuous; ; if and are independent, (because and are independent); determines the law of (an inversion formula recovers ); and if then is times continuously differentiable with . For a standard Gaussian , : differentiating under the integral and integrating by parts gives with .
Theorem— Lévy's continuity theorem
Random variables converge in distribution to if and only if for every .
"Only if" is immediate, since is bounded and continuous. For "if", one shows that the laws are tight (the behaviour of near controls ), extracts weakly convergent subsequences by Prokhorov's theorem, and identifies every subsequential limit through its characteristic function (Durrett, §3.3; Billingsley, §26). We use the theorem without proof here; Mathlib proves it (formal section).
Theorem— Lemma (Taylor bounds)
For real : . And for complex numbers with : .
Proof
Integrating by parts, , whose modulus is at most . With this gives the bound . With , , so . For the products, induct on : , and every factor outside the brackets has modulus at most .
∎
Theorem— Central limit theorem
Let be independent and identically distributed with and . Then in distribution, where is standard normal: for every .
Proof
Let . By the lemma with , taking expectations,
As the random variable inside the last expectation tends to and is dominated by , which is integrable; so by dominated convergence . (This uses only a finite second moment.)
By independence . Fix and take , so that . The product lemma gives
and . By Lévy's continuity theorem in distribution. Since is continuous, the distribution functions converge at every .
∎
For general mean and variance , apply the theorem to . The Lindeberg–Feller theorem drops identical distribution: for independent triangular arrays it suffices that no single summand carries a non-negligible share of the variance (Lindeberg's condition). The Berry–Esseen theorem quantifies the speed: with an absolute constant (Shevtsova, 2011); for fair steps the rate is attained (see the computation below).
Probability in Lean and Mathlib
Mathlib's probability library is built exactly on Kolmogorov's dictionary: a probability space is a MeasureSpace with IsProbabilityMeasure, a random variable is a measurable function, μ[X] is the integral, and independence (iIndepFun, X ⟂ᵢ[μ] Y) is phrased through σ-algebras. Our first theorem mirrors the human proof of the first Borel–Cantelli lemma line by line — limsup inside a tail union, subadditivity, tails of a convergent series tend to :
/-- **First Borel–Cantelli lemma.** If `∑ P(Aₙ) < ∞`, then almost surely only finitely many of
the events `Aₙ` occur: `P(limsup Aₙ) = 0`. No independence is needed. Proof (as in the lesson):
for every `n`, the event "infinitely many `Aₖ` occur" lies inside `⋃ₖ A_{k+n}`, whose probability
is at most the tail `∑ₖ P(A_{k+n})` of a convergent series, and the tails tend to `0`
(`ENNReal.tendsto_sum_nat_add`). Mathlib's version is `measure_limsup_atTop_eq_zero`. -/
theorem borel_cantelli_first {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) {A : ℕ → Set Ω}
(hA : ∑' n, μ (A n) ≠ ∞) : μ (limsup A atTop) = 0 := by
-- `limsup A = ⋂ n, ⋃ k, A (k + n)`, so it lies in each tail union.
have hsub : ∀ n, limsup A atTop ⊆ ⋃ k, A (k + n) := fun n => by
rw [limsup_eq_iInf_iSup_of_nat']
exact iInf_le (fun n => ⋃ k, A (k + n)) n
-- Each tail union has probability at most the tail of the series.
have hle : ∀ n, μ (limsup A atTop) ≤ ∑' k, μ (A (k + n)) := fun n =>
(measure_mono (hsub n)).trans (measure_iUnion_le _)
-- The tails of a convergent series tend to zero.
exact le_antisymm (ge_of_tendsto' (ENNReal.tendsto_sum_nat_add _ hA) hle) (by simp)The second lemma and Kolmogorov's zero–one law are Mathlib theorems. Note how the hypotheses mirror the statements above: iIndepSet for independence of the events, iIndep for independence of σ-algebras, and MeasurableSet[limsup 𝓕 atTop] T for membership in the tail σ-algebra.
/-- **Second Borel–Cantelli lemma.** If the events `Aₙ` are independent and `∑ P(Aₙ) = ∞`,
then almost surely infinitely many of them occur: `P(limsup Aₙ) = 1`. Independence cannot be
dropped (take `Aₙ = A` for one event with `0 < P(A) < 1`). This is Mathlib's
`ProbabilityTheory.measure_limsup_eq_one`. -/
theorem borel_cantelli_second {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω}
{A : ℕ → Set Ω} (hmeas : ∀ n, MeasurableSet (A n)) (hindep : iIndepSet A μ)
(hdiv : ∑' n, μ (A n) = ∞) : μ (limsup A atTop) = 1 :=
measure_limsup_eq_one hmeas hindep hdiv/-- **Kolmogorov's zero–one law.** If `(𝓕ₙ)` is an independent sequence of sub-σ-algebras, every
event in the tail σ-algebra `limsup 𝓕ₙ = ⋂ₙ σ(𝓕ₙ, 𝓕ₙ₊₁, …)` has probability `0` or `1`. The event
"the sample means converge" is such a tail event. This is Mathlib's
`ProbabilityTheory.measure_zero_or_one_of_measurableSet_limsup_atTop`. -/
theorem zero_one_law {Ω : Type*} [m0 : MeasurableSpace Ω] {μ : Measure Ω}
{𝓕 : ℕ → MeasurableSpace Ω} (hle : ∀ n, 𝓕 n ≤ m0) (hindep : iIndep 𝓕 μ) {T : Set Ω}
(htail : MeasurableSet[limsup 𝓕 atTop] T) : μ T = 0 ∨ μ T = 1 :=
measure_zero_or_one_of_measurableSet_limsup_atTop hle hindep htailThe weak law with Chebyshev's explicit rate is proved here from two library facts — the variance of a sum of pairwise independent variables is the sum of the variances, and Chebyshev's inequality — exactly as in the human proof. Etemadi's strong law is a large Mathlib development (truncation, geometric subsequences, interpolation); we cite it for real-valued variables:
/-- **Weak law of large numbers, with Chebyshev's rate.** Let `X₀, X₁, …` be pairwise independent
square-integrable random variables with common variance `σ²`, and let `Ȳₙ = (X₀ + ⋯ + X_{n-1})/n`.
Then `P(|Ȳₙ − E Ȳₙ| ≥ ε) ≤ σ² / (n ε²)`. Proof: by pairwise independence the variance of the sum
is the sum of the variances (`IndepFun.variance_sum`), so `Var Ȳₙ = n σ² / n² = σ²/n`; then apply
Chebyshev's inequality (`meas_ge_le_variance_div_sq`). The bound tends to `0` as `n → ∞`, which is
convergence in probability. -/
theorem weak_law {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ]
{X : ℕ → Ω → ℝ} (hL2 : ∀ i, MemLp (X i) 2 μ) (hindep : Pairwise fun i j => X i ⟂ᵢ[μ] X j)
{σ2 : ℝ} (hvar : ∀ i, Var[X i; μ] = σ2) {n : ℕ} (hn : 0 < n) {ε : ℝ} (hε : 0 < ε) :
μ {ω | ε ≤ |(n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω -
μ[fun ω => (n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω]|}
≤ ENNReal.ofReal (σ2 / (n * ε ^ 2)) := by
have hsum : MemLp (∑ i ∈ Finset.range n, X i) 2 μ := memLp_finsetSum' _ fun i _ => hL2 i
have hY : MemLp (fun ω => (n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω) 2 μ := by
have := hsum.const_mul (n : ℝ)⁻¹
convert this using 2 with ω
simp [Finset.sum_apply]
have hvarY : Var[fun ω => (n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω; μ] = σ2 / n := by
have heq : (fun ω => (n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω)
= fun ω => (n : ℝ)⁻¹ * (∑ i ∈ Finset.range n, X i) ω := by
ext ω
simp [Finset.sum_apply]
rw [heq, variance_const_mul,
IndepFun.variance_sum (fun i _ => hL2 i) (fun i _ j _ hij => hindep hij)]
simp only [hvar, Finset.sum_const, Finset.card_range, nsmul_eq_mul]
have hn' : (n : ℝ) ≠ 0 := by positivity
field_simp
calc _ ≤ ENNReal.ofReal (Var[fun ω => (n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω; μ] / ε ^ 2) :=
meas_ge_le_variance_div_sq hY hε
_ = ENNReal.ofReal (σ2 / (n * ε ^ 2)) := by
rw [hvarY, div_div]/-- **Strong law of large numbers** (Etemadi's version: pairwise independence suffices). If the
`Xᵢ` are pairwise independent, identically distributed and integrable, then almost surely the
sample means `(X₀ + ⋯ + X_{n-1})/n` converge to `E[X₀]`. This is Mathlib's
`ProbabilityTheory.strong_law_ae`, specialised to real-valued variables. -/
theorem strong_law {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hint : Integrable (X 0) μ) (hindep : Pairwise fun i j => X i ⟂ᵢ[μ] X j)
(hident : ∀ i, IdentDistrib (X i) (X 0) μ μ) :
∀ᵐ ω ∂μ, Tendsto (fun n : ℕ => (n : ℝ)⁻¹ * ∑ i ∈ Finset.range n, X i ω) atTop
(𝓝 μ[X 0]) := by
simpa [smul_eq_mul] using strong_law_ae X hint hindep hidentMathlib writes μ[X | 𝒢] for the conditional expectation. It is a function Ω → ℝ, not a number, and identities between conditional expectations hold =ᵐ[μ], almost everywhere — the formal statements cannot fall into the misconception that a conditional expectation is a number. The defining property, the tower property, taking out what is known, and independence:
/-- **The defining property of conditional expectation.** For a sub-σ-algebra `𝒢 ≤ 𝓕` and an
integrable `X`, the random variable `μ[X | 𝒢]` (it is a function on `Ω`, not a number) is
`𝒢`-measurable and has the same integral as `X` over every `𝒢`-measurable set. Mathlib
constructs it by extending the orthogonal projection of `L²` onto `L²(𝒢)` to `L¹`, and proves
this property as `setIntegral_condExp`. -/
theorem cond_exp_set_integral {Ω : Type*} {𝒢 m0 : MeasurableSpace Ω} {μ : Measure Ω}
[IsFiniteMeasure μ] (h𝒢 : 𝒢 ≤ m0) {X : Ω → ℝ} (hX : Integrable X μ) {G : Set Ω}
(hG : MeasurableSet[𝒢] G) : ∫ ω in G, (μ[X | 𝒢]) ω ∂μ = ∫ ω in G, X ω ∂μ :=
setIntegral_condExp h𝒢 hX hG/-- **Tower property.** Conditioning first on the finer σ-algebra `𝒢₂` and then on the coarser
`𝒢₁ ≤ 𝒢₂` is the same as conditioning on `𝒢₁` directly (almost surely). This is Mathlib's
`condExp_condExp_of_le`. -/
theorem cond_exp_tower {Ω : Type*} {𝒢₁ 𝒢₂ m0 : MeasurableSpace Ω} {μ : Measure Ω}
[IsFiniteMeasure μ] (h₁₂ : 𝒢₁ ≤ 𝒢₂) (h₂ : 𝒢₂ ≤ m0) (X : Ω → ℝ) :
μ[μ[X | 𝒢₂] | 𝒢₁] =ᵐ[μ] μ[X | 𝒢₁] :=
condExp_condExp_of_le h₁₂ h₂/-- **Taking out what is known.** If `Z` is `𝒢`-measurable and `Z · X` and `X` are integrable,
then `E[Z X | 𝒢] = Z · E[X | 𝒢]` almost surely. This is Mathlib's
`condExp_mul_of_stronglyMeasurable_left`. -/
theorem cond_exp_pull_out {Ω : Type*} {𝒢 m0 : MeasurableSpace Ω} {μ : Measure Ω}
{Z X : Ω → ℝ} (hZ : StronglyMeasurable[𝒢] Z) (hZX : Integrable (Z * X) μ)
(hX : Integrable X μ) : μ[Z * X | 𝒢] =ᵐ[μ] Z * μ[X | 𝒢] :=
condExp_mul_of_stronglyMeasurable_left hZ hZX hX/-- **Independent information is useless.** If `X` is measurable with respect to a σ-algebra
`𝓗` that is independent of `𝒢`, then `E[X | 𝒢] = E[X]`, a constant, almost surely. This is
Mathlib's `ProbabilityTheory.condExp_indep_eq`. -/
theorem cond_exp_indep {Ω : Type*} {𝓗 𝒢 m0 : MeasurableSpace Ω} {μ : Measure Ω}
[IsProbabilityMeasure μ] (h𝓗 : 𝓗 ≤ m0) (h𝒢 : 𝒢 ≤ m0) {X : Ω → ℝ}
(hX : StronglyMeasurable[𝓗] X) (hindep : Indep 𝓗 𝒢 μ) :
μ[X | 𝒢] =ᵐ[μ] fun _ => μ[X] :=
condExp_indep_eq h𝓗 h𝒢 hX hindepA martingale (Martingale M 𝓕 μ: adapted, and μ[M j | 𝓕 i] =ᵐ[μ] M i for i ≤ j) has constant expectation; the proof integrates the defining identity. Doob's convergence theorem, proved in Mathlib through the upcrossing inequality as above, is then cited:
/-- **A martingale has constant expectation.** If `(Mₙ)` is a martingale for the filtration
`(𝓕ₙ)` and `i ≤ j`, then `E[Mⱼ] = E[Mᵢ]`. Proof: integrating the conditional expectation does not
change the integral (`integral_condExp`, the defining property with `G = Ω`), and the martingale
property says `E[Mⱼ | 𝓕ᵢ] = Mᵢ` almost surely. -/
theorem martingale_integral_eq {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω}
[IsFiniteMeasure μ] {𝓕 : Filtration ℕ m0} {M : ℕ → Ω → ℝ} (hM : Martingale M 𝓕 μ)
{i j : ℕ} (hij : i ≤ j) : ∫ ω, M j ω ∂μ = ∫ ω, M i ω ∂μ :=
calc ∫ ω, M j ω ∂μ = ∫ ω, (μ[M j | 𝓕 i]) ω ∂μ := (integral_condExp (𝓕.le i)).symm
_ = ∫ ω, M i ω ∂μ := integral_congr_ae (hM.condExp_ae_eq hij)/-- **Doob's martingale convergence theorem.** An `L¹`-bounded martingale (`E|Mₙ| ≤ R` for all
`n`) converges almost surely; its limit is the `limitProcess`, measurable with respect to
`⋁ₙ 𝓕ₙ`. The proof goes through Doob's upcrossing inequality. This is Mathlib's
`Submartingale.ae_tendsto_limitProcess` (every martingale is a submartingale). -/
theorem martingale_convergence {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω}
[IsFiniteMeasure μ] {𝓕 : Filtration ℕ m0} {M : ℕ → Ω → ℝ} {R : ℝ≥0}
(hM : Martingale M 𝓕 μ) (hbdd : ∀ n, eLpNorm (M n) 1 μ ≤ R) :
∀ᵐ ω ∂μ, Tendsto (fun n => M n ω) atTop (𝓝 (𝓕.limitProcess M μ ω)) :=
hM.submartingale.ae_tendsto_limitProcess hbddFinally Lévy's continuity theorem and the central limit theorem, both recent additions to Mathlib. The CLT's proof in Mathlib follows the lesson's: charFun_inv_sqrt_mul_sum computes the characteristic function of the normalised sum as , a second-order Taylor expansion of gives the limit , and Lévy's theorem concludes.
/-- **Lévy's continuity theorem.** Probability measures on `ℝᵈ` converge weakly if and only if
their characteristic functions `φ(t) = ∫ e^{i⟨t, x⟩} dμ(x)` converge at every `t`. This is
Mathlib's `ProbabilityMeasure.tendsto_iff_tendsto_charFun`. -/
theorem levy_continuity {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
[FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] {μ : ℕ → ProbabilityMeasure E}
{μ₀ : ProbabilityMeasure E} :
Tendsto μ atTop (𝓝 μ₀) ↔
∀ t : E, Tendsto (fun n => charFun (μ n : Measure E) t) atTop
(𝓝 (charFun (μ₀ : Measure E) t)) :=
ProbabilityMeasure.tendsto_iff_tendsto_charFun/-- **Central limit theorem.** If `X₀, X₁, …` are independent and identically distributed with
mean `0` and variance `1`, then `(X₀ + ⋯ + X_{n-1})/√n` converges in distribution to a standard
Gaussian `Y`. Mathlib proves it as in the lesson: the characteristic function of the normalised
sum is `φ(t/√n)ⁿ`, which tends to `e^{-t²/2}` by the second-order Taylor expansion of `φ`, and
Lévy's continuity theorem concludes. This is
`ProbabilityTheory.tendstoInDistribution_inv_sqrt_mul_sum`. -/
theorem central_limit {Ω Ω' : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] {P : Measure Ω}
{P' : Measure Ω'} [IsProbabilityMeasure P] [IsProbabilityMeasure P'] {X : ℕ → Ω → ℝ}
{Y : Ω' → ℝ} (hY : HasLaw Y (gaussianReal 0 1) P') (h0 : P[X 0] = 0)
(h1 : P[X 0 ^ 2] = 1) (hindep : iIndepFun X P)
(hident : ∀ i, IdentDistrib (X i) (X 0) P P) :
TendstoInDistribution (fun (n : ℕ) ω => (√n)⁻¹ * ∑ k ∈ Finset.range n, X k ω) atTop Y
(fun _ => P) P' :=
tendstoInDistribution_inv_sqrt_mul_sum hY h0 h1 hindep hidentNot formalised here: the fourth-moment proof of the strong law (we cite Mathlib's stronger theorem instead), the Radon–Nikodym construction of conditional expectation (Mathlib uses the -projection route), optional stopping and the upcrossing inequality (in Mathlib as Submartingale.expected_stoppedValue_mono and Submartingale.mul_integral_upcrossingsBefore_le_integral_pos_part), and the Taylor-bound lemma.
Experiments: Borel–Cantelli, Pólya's urn and the CLT
The first experiment compares independent events with and . The expected number of occurrences in each dyadic block is computed exactly: about for the , forever, and a geometrically shrinking amount for the . Seeded simulations up to show the still occurring at large while the stop after a few indices — the two Borel–Cantelli lemmas side by side.
"""Borel-Cantelli in action: convergence in probability without a.s. convergence.
Take independent events A_n with P(A_n) = 1/n, and independent events B_n with
P(B_n) = 1/n^2. Both indicator sequences tend to 0 in probability. The second
Borel-Cantelli lemma says infinitely many A_n occur almost surely (the sum of
1/n diverges), while the first says only finitely many B_n occur (the sum of
1/n^2 converges). We compute the exact expected number of occurrences in each
dyadic block [2^k, 2^(k+1)), and simulate a few seeded runs to watch the A_n
keep happening in late blocks while the B_n stop early.
"""
import random
from fractions import Fraction
def block_expectation(k, power):
"""Exact sum of 1/n^power over the dyadic block 2^k <= n < 2^(k+1)."""
if k < 0 or power < 1:
raise ValueError("need k >= 0 and power >= 1")
return sum(Fraction(1, n ** power) for n in range(2 ** k, 2 ** (k + 1)))
def simulate(power, n_max, rng):
"""Indices n <= n_max at which the event with P = 1/n^power occurs."""
return [n for n in range(1, n_max + 1) if rng.random() < 1.0 / n ** power]
def block_counts(hits, k_max):
"""How many hits fall in each block [2^k, 2^(k+1)) for k = 0..k_max."""
counts = [0] * (k_max + 1)
for n in hits:
k = n.bit_length() - 1
if k <= k_max:
counts[k] += 1
return counts
def main():
k_max = 15
print("Exact expected number of occurrences in the block [2^k, 2^(k+1)):")
print(" k P(A_n) = 1/n P(B_n) = 1/n^2")
for k in [0, 1, 2, 4, 6, 8]:
a = float(block_expectation(k, 1))
b = float(block_expectation(k, 2))
print(f" {k:>2} {a:.6f} {b:.3e}")
print("The 1/n blocks decrease to ln 2 = 0.693147, so the series diverges;")
print("the 1/n^2 blocks shrink like 2^-(k+1), so that series converges.")
print()
rng = random.Random(1933)
n_max = 2 ** (k_max + 1) - 1
print(f"Five seeded runs up to n = {n_max}:")
for run in range(5):
a_hits = simulate(1, n_max, rng)
b_hits = simulate(2, n_max, rng)
late = sum(block_counts(a_hits, k_max)[10:])
print(f" run {run + 1}: {late} of the A_n with n >= 1024 occur,"
f" last at n = {a_hits[-1]}; last B_n at n = {b_hits[-1]}")
print("About ln 2 of the A_n are expected in every dyadic block, forever;")
print("the B_n stop after a few indices. Yet P(A_n) -> 0: the indicators")
print("of A_n tend to 0 in probability but not almost surely.")
print()
print("Epistemic status: the block expectations are exact rational")
print("arithmetic. The runs are seeded pseudo-random simulations of a")
print("finite horizon: they illustrate, but cannot prove, the almost-sure")
print("statements, which are the two Borel-Cantelli lemmas.")
if __name__ == "__main__":
main()The second computes the law of Pólya's urn exactly with fractions (uniform, as proved above), checks the martingale identity for every state up to , and simulates urns: each settles, at a different random level.
"""Polya's urn: a martingale that converges to a random limit.
An urn starts with one red and one blue ball. At each step draw a ball,
return it, and add another of the same colour. The fraction of red balls
M_n = R_n / (n + 2) is a martingale. We verify exactly (with fractions) that
the martingale property holds and that after n draws the number of red balls
is uniformly distributed on {1, ..., n + 1}; so the almost-sure limit of M_n,
which exists by Doob's convergence theorem, is uniform on [0, 1]. A seeded
simulation shows individual urns settling down at different values.
"""
import random
from fractions import Fraction
def red_distribution(n):
"""Exact law of the number of red balls after n draws, as {red: prob}."""
if n < 0:
raise ValueError("n must be non-negative")
dist = {1: Fraction(1)}
for step in range(n):
total = step + 2
new = {}
for red, p in dist.items():
up = p * Fraction(red, total)
new[red + 1] = new.get(red + 1, 0) + up
new[red] = new.get(red, 0) + p - up
dist = new
return dist
def martingale_defect(n, red):
"""E[M_(n+1) | R_n = red] - M_n, exactly (it should be 0)."""
total = n + 2
p_up = Fraction(red, total)
expected = (p_up * Fraction(red + 1, total + 1)
+ (1 - p_up) * Fraction(red, total + 1))
return expected - Fraction(red, total)
def run_urn(steps, rng):
"""Fractions of red balls after each of the given number of draws."""
red, total, path = 1, 2, []
for _ in range(steps):
if rng.random() < red / total:
red += 1
total += 1
path.append(red / total)
return path
def main():
print("Exact law of R_n (number of red balls) after n draws:")
for n in [1, 2, 3, 10]:
dist = red_distribution(n)
values = ", ".join(str(v) for v in sorted(set(dist.values())))
print(f" n = {n:>2}: R_n takes each value 1..{n + 1} with prob. {values}")
worst = max(abs(martingale_defect(n, r))
for n in range(31) for r in range(1, n + 2))
print("max |E[M_(n+1) | R_n] - M_n| over n <= 30, all r:", worst)
print()
rng = random.Random(1923)
print("Six urns, fraction of red after 10, 100, 1000, 4000 draws:")
for i in range(6):
path = run_urn(4000, rng)
cells = " ".join(f"{path[k - 1]:.3f}" for k in [10, 100, 1000, 4000])
print(f" urn {i + 1}: {cells}")
limits = [run_urn(300, rng)[-1] for _ in range(1000)]
deciles = [0] * 10
for x in limits:
deciles[min(int(x * 10), 9)] += 1
print("1000 urns after 300 draws, counts per tenth of [0, 1]:")
print(" ", deciles, "(uniform: about 100 each)")
print()
print("Epistemic status: the uniform law and the martingale identity are")
print("exact computations for n <= 30 (the lesson proves them for all n).")
print("The urn runs are seeded simulations: statistical illustration of")
print("Doob's theorem (almost-sure convergence), not a proof of it.")
if __name__ == "__main__":
main()The third measures how fast , the characteristic function of a normalised sum of fair steps, approaches : the error is about , as the Taylor expansion predicts. The distribution functions converge more slowly, at the Berry–Esseen rate , because is lattice-valued.
"""The central limit theorem seen through characteristic functions.
For a fair +-1 coin X, the characteristic function is E[exp(itX)] = cos t, so
the normalised sum S_n / sqrt(n) of n independent coins has characteristic
function cos(t / sqrt(n))^n. We measure how fast it approaches exp(-t^2 / 2),
the characteristic function of the standard normal law, on [-3, 3]; the
error behaves like t^4 exp(-t^2/2) / (12 n). Then we compare the exact
binomial distribution function with the normal one (the Berry-Esseen rate is
1/sqrt(n), slower because the distribution of S_n has jumps).
"""
import math
def charfun_sum(t, n):
"""Characteristic function of S_n / sqrt(n) for fair +-1 steps."""
if n < 1:
raise ValueError("n must be positive")
return math.cos(t / math.sqrt(n)) ** n
def max_charfun_error(n, t_max=3.0, points=601):
"""max over a grid of |phi_n(t) - exp(-t^2/2)| for |t| <= t_max."""
ts = [-t_max + 2 * t_max * k / (points - 1) for k in range(points)]
return max(abs(charfun_sum(t, n) - math.exp(-t * t / 2)) for t in ts)
def normal_cdf(x):
"""Standard normal distribution function."""
return 0.5 * (1 + math.erf(x / math.sqrt(2)))
def binomial_cdf_error(n):
"""sup over the jump points of |P(S_n/sqrt(n) <= x) - Phi(x)|."""
worst, cum = 0.0, 0.0
for k in range(n + 1):
x = (2 * k - n) / math.sqrt(n)
left = cum
cum += math.exp(math.lgamma(n + 1) - math.lgamma(k + 1)
- math.lgamma(n - k + 1) - n * math.log(2))
phi = normal_cdf(x)
worst = max(worst, abs(left - phi), abs(cum - phi))
return worst
def main():
print("Characteristic function of S_n/sqrt(n) versus exp(-t^2/2):")
print(" n max error on [-3,3] n * error")
for n in [1, 2, 5, 10, 100, 1000, 10000]:
err = max_charfun_error(n)
print(f" {n:>5} {err:.3e} {n * err:.4f}")
print("n * error settles at max t^4 exp(-t^2/2)/12 = 16/(12 e^2) = 0.1804")
print("(at t = 2): the characteristic functions converge at rate 1/n.")
print()
print("Exact binomial CDF versus the normal CDF (sup over x):")
print(" n sup error sqrt(n) * error")
for n in [10, 100, 1000, 4000]:
err = binomial_cdf_error(n)
print(f" {n:>5} {err:.5f} {math.sqrt(n) * err:.4f}")
print("sqrt(n) * error tends to 1/sqrt(2 pi) = 0.3989: the CDFs converge")
print("only like 1/sqrt(n), because S_n has jumps of size about")
print("sqrt(2/(pi n)) at 0 (the Berry-Esseen rate is sharp here).")
print()
print("Epistemic status: floating-point evaluation on finite grids and for")
print("finitely many n. It illustrates the rates; the convergence itself is")
print("the central limit theorem, proved in the lesson from Levy's")
print("continuity theorem.")
if __name__ == "__main__":
main()All three are evidence, not proof: exact arithmetic on finitely many cases, seeded simulations of finite horizons, and floating-point evaluation on finite grids.
Watching the limit theorems
Move the slider: the curve is the characteristic function of for fair steps, and the dashed comparison is . Pointwise convergence of these curves is, by Lévy's theorem, the central limit theorem. Notice that for small the curve is periodic — the law of lives on a lattice — and that the period runs off to infinity.
Characteristic functions converge: the CLT through Fourier eyes
Move the sliders and trace along the curves to read off values.
- φₙ(t) = cos(t/√n)ⁿ
- e^(−t²/2)
- φₙ(t) = cos(t/√n)ⁿ: y = 0.578
- e^(−t²/2): y = 0.6065
The strong law along one path, and the central limit theorem as a histogram: the running proportion of heads settles at (each run is one ), and the Galton board's binomial counts take the normal shape.
The strong law and the central limit theorem
Flip a fair coin again and again: the proportion of heads settles towards 1/2. This is the law of large numbers.
- this run
- exact probability 1/2
- 1/2 ± 1/√n (about 95% of runs)
968 heads in 2,000 flips: proportion
Simulated0.484
Exact1/2 = 0.5
Simulation of 2,000 flips: 968 heads, proportion 0.484. The exact probability is 1/2.
Evidence, not proofThis is a simulation of 2,000 flips (run 1) using a seeded random number generator. It is evidence, not proof: the exact values come from mathematics, and a new run gives slightly different numbers.
The proportion settles down, but the difference between the number of heads and n/2 typically grows like √n: the law of large numbers is about proportions, not counts.
Exercises
1. Measure-theoretic probability
Warm-upHumanLet be random variables on one probability space. Which implications hold in general? Select all that apply.
2. Measure-theoretic probability
Warm-upHumanLet be independent fair dice (values ). The conditional expectation is a random variable. What value does it take on the event ?
3. Measure-theoretic probability
CoreHumanLet be events with . Nothing is assumed about independence. Which statement is true?
4. Measure-theoretic probability
CoreHumanThe proof of the second Borel–Cantelli lemma runs: (1) the complement of is ; (2) ; (3) ; (4) continuity from above. Which step uses the independence of the events?
5. Measure-theoretic probability
CoreHumanOn with Lebesgue measure let and let be the σ-algebra generated by and . What is ?
6. Measure-theoretic probability
CoreFormalIn Mathlib, Martingale M 𝓕 μ means: M is adapted and μ[M j | 𝓕 i] =ᵐ[μ] M i whenever i ≤ j. Which Lean statement correctly expresses a martingale has constant expectation (with [IsFiniteMeasure μ] and hM : Martingale M 𝓕 μ, hij : i ≤ j)?
7. Measure-theoretic probability
CoreHumanLet be independent fair signs, , and . Compute using the expansion from the proof of the strong law.
8. Measure-theoretic probability
StretchHumanA simple symmetric random walk starts at and stops at the first time it reaches or . Using optional stopping for the martingales and , compute .
9. Measure-theoretic probability
StretchHumanLet be independent with and . Then is a non-negative martingale with , and almost surely. Why does this not contradict ?
10. Measure-theoretic probability
CoreComputationalA finite probability space has outcomes with probabilities probs, a random variable given by the list X, and a σ-algebra generated by a partition blocks (a list of lists of outcomes). Write conditional_expectation(probs, X, blocks) returning the list whose -th entry is . Assume every block has positive probability. Use Fraction so the answers are exact.
Common misconceptions
Misconception
"Convergence in probability and almost-sure convergence are the same thing." Almost-sure convergence is about individual sample paths: for almost every , the sequence of numbers converges. Convergence in probability is about the sequence of numbers , and says nothing about any single path. Independent events with give indicators tending to in probability, yet almost every path has infinitely many s (second Borel–Cantelli lemma). Almost-sure convergence implies convergence in probability, and convergence in probability implies almost-sure convergence along a subsequence — no more.
Misconception
"A conditional expectation is a number." for an event with is a number, but is a -measurable random variable, defined only up to null sets: for two dice. Treating it as a number leads to errors such as instead of , and to paradoxes when conditioning on events of probability zero.
Misconception
"A martingale that converges almost surely converges in mean." The product martingale of independent converges to almost surely while for every . Uniform integrability is exactly what is missing. Likewise " for every stopping time" is false: the simple random walk stopped at its first visit to has .
Misconception
"Pairwise independent means independent." Toss two fair coins and let be the event that they agree. The events , , are pairwise independent, but any two of them determine the third. Chebyshev's weak law and Etemadi's strong law need only pairwise independence; the second Borel–Cantelli lemma as proved here and Kolmogorov's zero–one law need full independence.
Misconception
"Convergence in distribution means the random variables get close." It is a statement about laws only: converges in distribution to a standard normal without ever getting close to it. When the limit is a constant , however, convergence in distribution does imply convergence in probability to .
Many ways of seeing
Geometry— Conditioning is projecting
On , a Hilbert space, is the orthogonal projection onto the closed subspace of -measurable functions; constants form the line onto which projects, and the variance is a squared distance. The law of total variance is Pythagoras' theorem, the tower property says that projecting onto a subspace and then onto a smaller one equals projecting onto the smaller one, and a martingale with bounded is a sequence of projections of one vector onto growing subspaces — whose increments are orthogonal, so . Least-squares regression and the Kalman filter are this geometry in practice. See functional analysis.
Analysis— Fourier transforms and differentiation theorems
The characteristic function is the Fourier transform of a measure, and the proof of the central limit theorem is Fourier analysis: convolution of laws becomes multiplication, and the Gaussian solves the fixed-point equation of the normalised convolution square, and among laws with finite variance the centred Gaussians are the only solutions. Martingales, in turn, prove theorems of real analysis. Take and let be generated by the dyadic intervals of length . Then is the average of over the dyadic interval containing , a martingale; by Lévy's upward theorem it converges to almost everywhere. That is a dyadic Lebesgue differentiation theorem, and Doob's maximal inequality is a dyadic Hardy–Littlewood maximal inequality — the start of a long dialogue with harmonic analysis.
Topology— The space of probability measures
Convergence in distribution is convergence in a topology: the weak (narrow) topology on the set of Borel probability measures on a metric space , in which when for all bounded continuous . The portmanteau theorem gives equivalent forms: for closed , or for open . On a separable metric space this topology is metrised by the Lévy–Prokhorov metric, and Prokhorov's theorem (1956) says that on a Polish space a family of probability measures is relatively compact if and only if it is tight. When is compact, is itself compact: by the Riesz representation theorem it is a weak-* closed subset of the unit ball of , compact by Banach–Alaoglu. Lévy's continuity theorem is proved exactly by this compactness, and Skorokhod's representation theorem turns weak convergence on a Polish space back into almost-sure convergence of suitably chosen random variables.
Number theory— Normal numbers and the Gaussian law of prime factors
Read the binary digits of a uniformly random as coin tosses: the strong law says that almost every real number has asymptotically equal frequencies of s and s, and applying it to blocks of digits in every base gives Borel's normal number theorem (1909) — almost every real number is normal in every base. Yet no one has proved that , or is normal in any base: "almost all" is not "this one".
Integers behave like random variables too. Let be the number of distinct prime factors of . Hardy and Ramanujan (1917) showed that is usually close to , and Turán (1934) reproved it by a Chebyshev-type variance bound, treating divisibility by different primes as nearly independent events. The Erdős–Kac theorem (1940) is a central limit theorem: for chosen uniformly from , converges in distribution to a standard normal as . See analytic number theory.
Logic— Zero–one laws, randomness and the limits of measure
"Probability zero" is not "impossible" — HHHH… is a possible outcome — but logic can say which individual sequences deserve to be called random. Martin-Löf (1966) defined a binary sequence to be random if it avoids every effectively null set (every set covered by a uniformly computable sequence of open sets of measure at most ). Each Martin-Löf random sequence satisfies the strong law of large numbers, the law of the iterated logarithm and every other almost-sure law whose exceptional set is effectively null, although no computable sequence is random.
Logic also shows why probability is defined on a σ-algebra rather than on all subsets. Vitali's construction (using the axiom of choice) gives a subset of with no translation-invariant probability. Even without invariance, Banach and Kuratowski (1929) showed under the continuum hypothesis that no countably additive probability on all subsets of vanishes on points, and Ulam (1930) showed that such a measure would force to be at least a weakly inaccessible (real-valued measurable) cardinal — so ZFC cannot prove it exists. See the axiom of choice.
Wonder Trails
History and context
- Gerolamo Cardano's Liber de ludo aleae (written in the 16th century, printed 1663) and the correspondence of Blaise Pascal and Pierre de Fermat (1654) began the mathematics of chance; Christiaan Huygens (1657) introduced expectation.
- Jacob Bernoulli's Ars Conjectandi (1713) proved the first weak law of large numbers; Abraham de Moivre (1733) found the normal approximation to the binomial, and Pierre-Simon Laplace (1812) extended it. Pafnuty Chebyshev (1867) proved his inequality and a general weak law; his students Andrey Markov and Aleksandr Lyapunov developed dependent chains and, with characteristic functions, a general central limit theorem (Lyapunov, 1901).
- Émile Borel (1909) proved the strong law for coin tossing and the normal number theorem; Francesco Paolo Cantelli (1917) proved the lemma now bearing both names, and a strong law under fourth moments. Jarl Waldemar Lindeberg (1922) proved his general central limit theorem; Paul Lévy (1925) developed characteristic functions and the continuity theorem, and studied martingale-like sums in the 1930s.
- Johann Radon (1913) and Otto Nikodym (1930) proved the theorem behind conditional expectation. Andrey Kolmogorov's Grundbegriffe (1933) gave the axioms, the extension theorem, the definition of conditional expectation and the zero–one law; he had proved the strong law for i.i.d. integrable variables in 1930. Aleksandr Khinchin proved the law of the iterated logarithm (1924) and, with Kolmogorov, convergence criteria for random series.
- Jean Ville (1939) named martingales, after a betting strategy; Joseph Doob developed their theory, including the upcrossing inequality and the convergence and optional stopping theorems, in Stochastic Processes (1953). Paul Erdős and Mark Kac (1940) brought the central limit theorem into number theory; Yuri Prokhorov (1956) and Anatoliy Skorokhod (1956) laid the foundations of weak convergence; Nasrollah Etemadi (1981) gave the elementary proof of the strong law under pairwise independence.
Further reading
- David Williams, Probability with Martingales (1991) — the shortest route from measure theory to martingales; the upcrossing proof above follows it.
- Rick Durrett, Probability: Theory and Examples (5th ed., 2019) — the standard graduate text: laws of large numbers, CLT, martingales, Brownian motion.
- Patrick Billingsley, Probability and Measure (3rd ed., 1995) — measure theory and probability developed together, with weak convergence in depth.
- Olav Kallenberg, Foundations of Modern Probability (2nd ed., 2002) — a comprehensive, concise reference.
- Geoffrey Grimmett and David Stirzaker, Probability and Random Processes (3rd ed., 2001) — many worked examples and exercises.
- A. N. Kolmogorov, Foundations of the Theory of Probability (1933; English translation 1950) — short and still readable.
- Mark Kac, Statistical Independence in Probability, Analysis and Number Theory (1959) — Rademacher functions, normal numbers and the Erdős–Kac theorem.