Borel-Cantelli Lemma

lean4-proofprobabilityvisualization
n=1P(An)<P(An i.o.)=0\sum_{n=1}^\infty P(A_n) < \infty \Rightarrow P(A_n \text{ i.o.}) = 0

Statement

First Borel–Cantelli Lemma. Let (An)n1(A_n)_{n \geq 1} be a sequence of events in a probability space (Ω,F,P)(\Omega, \mathcal{F}, P). If

n=1P(An)<\sum_{n=1}^{\infty} P(A_n) < \infty

then P(An infinitely often)=0P(A_n \text{ infinitely often}) = 0, i.e., almost surely only finitely many AnA_n occur:

P ⁣(lim supnAn)=P ⁣(N=1nNAn)=0P\!\left(\limsup_{n \to \infty} A_n\right) = P\!\left(\bigcap_{N=1}^\infty \bigcup_{n \geq N} A_n\right) = 0

Second Borel–Cantelli Lemma. If the AnA_n are additionally independent and P(An)=\sum P(A_n) = \infty, then P(An i.o.)=1P(A_n \text{ i.o.}) = 1.

Visualization

Coin-flip example. Flip a coin on trial nn with probability pn=1/n2p_n = 1/n^2 of heads (AnA_n = "heads on trial nn").

nnpn=1/n2p_n = 1/n^2partial sum k=1npk\sum_{k=1}^n p_k
11.0001.000
20.2501.250
50.0401.464
100.0101.548
1000.00011.635
\inftyπ2/61.645\pi^2/6 \approx 1.645

Since pn=π2/6<\sum p_n = \pi^2/6 < \infty, the first Borel–Cantelli lemma says: almost surely, only finitely many trials yield heads. After some random time N(ω)N(\omega), all subsequent coins show tails.

Contrast: With pn=1/np_n = 1/n, pn=\sum p_n = \infty (harmonic series), and if the trials are independent, BC2 gives P(i.o.)=1P(\text{i.o.}) = 1.

Proof Sketch

  1. Measure of the limsup. P(lim supAn)=P ⁣(NnNAn)=limNP ⁣(nNAn)P(\limsup A_n) = P\!\left(\bigcap_N \bigcup_{n \geq N} A_n\right) = \lim_{N \to \infty} P\!\left(\bigcup_{n \geq N} A_n\right).
  2. Sub-additivity (union bound). P ⁣(nNAn)nNP(An)P\!\left(\bigcup_{n \geq N} A_n\right) \leq \sum_{n \geq N} P(A_n).
  3. Tail goes to 0. Because n=1P(An)<\sum_{n=1}^\infty P(A_n) < \infty, its tail nNP(An)0\sum_{n \geq N} P(A_n) \to 0 as NN \to \infty.
  4. Conclude. P(lim supAn)limNnNP(An)=0P(\limsup A_n) \leq \lim_{N \to \infty} \sum_{n \geq N} P(A_n) = 0.

Connections

Borel–Cantelli is the probabilistic cousin of Markov's InequalityMarkov's InequalityP(Xa)E[X]aP(X \geq a) \leq \frac{E[X]}{a}A non-negative random variable rarely exceeds a multiple of its expectationRead more →: both control tail probabilities. It is used heavily in the study of Iterated Function SystemsIterated Function SystemsA=i=1Nfi(A)A = \bigcup_{i=1}^{N} f_i(A)Constructing fractals via contractive affine transformationsRead more → (almost-sure convergence of random IFS orbits) and in proving the strong law of large numbers, which itself refines Chebyshev's InequalityChebyshev's InequalityP(Xμkσ)1k2P(|X - \mu| \geq k\sigma) \leq \frac{1}{k^2}A random variable rarely deviates from its mean by more than a few standard deviationsRead more →.

Lean4 Proof

Mathlib provides the first Borel–Cantelli lemma as MeasureTheory.measure_limsup_atTop_eq_zero in Mathlib.MeasureTheory.OuterMeasure.BorelCantelli.

measure_limsup_atTop_eq_zero is proved by the tail-sum argument: μ(lim supsn)nNμ(sn)0\mu(\limsup s_n) \leq \sum_{n \geq N} \mu(s_n) \to 0 via ENNReal.tendsto_tsum_compl_atTop_zero.

Lean4 Proof

import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli

namespace MoonMath

open MeasureTheory Filter

/-- **First Borel–Cantelli lemma**.
    If `Σ μ(sₙ) < ∞`, then `μ(limsup sₙ) = 0`.
    Here `limsup sₙ` along `atTop` is the set of points in infinitely many `sₙ`. -/
theorem borel_cantelli_first {α : Type*} {m : MeasurableSpace α}
    (μ : Measure α) {s :   Set α}
    (hs : ∑' n, μ (s n)  ∞) :
    μ (limsup s atTop) = 0 :=
  measure_limsup_atTop_eq_zero hs

end MoonMath