Lévy's generalized Borel–Cantelli lemma
ProvedFamousTheorems.levy_borel_cantelliLévy's extension of the Borel–Cantelli lemma. Let be a filtration on a finite measure space, and let be events with . Then, almost everywhere,
Almost every point lies in infinitely many exactly on the event where the sum of the conditional probabilities diverges. For independent events and the trivial filtration this gives both halves of the Borel–Cantelli lemma. The general form is proved with martingale convergence and is used for events with dependence.
Formalization note. Mathlib's MeasureTheory.ae_mem_limsup_atTop_iff. Filtration ℕ m0 is a filtration, and the adaptedness hypothesis says that s n is measurable for the -algebra ℱ n. The conditional probability is the conditional expectation μ[(s (k + 1)).indicator 1 | ℱ k], and divergence of the series means that its partial sums tend to (Tendsto … atTop atTop).
import Mathlib
namespace FamousTheorems
open MeasureTheory
theorem levy_borel_cantelli {Ω : Type*} {m0 : MeasurableSpace Ω} {ℱ : Filtration ℕ m0} (μ : Measure Ω) [IsFiniteMeasure μ]
{s : ℕ → Set Ω} (hs : ∀ n, @MeasurableSet Ω (ℱ n) (s n)) :
∀ᵐ ω ∂μ, ω ∈ Filter.limsup s Filter.atTop ↔
Filter.Tendsto (fun n => ∑ k ∈ Finset.range n, (μ[(s (k + 1)).indicator (1 : Ω → ℝ) | ℱ k]) ω)
Filter.atTop Filter.atTop := by sorry
end FamousTheorems