Probability theory begins with events and random variables, but its general results depend on measure theory. Distributions with atoms and continuous components, almost-sure statements, independent sequences, convergence theorems and couplings all require a common language for measurable sets and integrals. Kenneth W. Shum's textbook Measure-Theoretic Probability: With Applications to Statistics, Finance, and Engineering develops that language for a second course in probability. Its Lean formalisation, developed by Shuo Deng with collaborators, is an ongoing, AI-assisted companion to the book.
This proposal concerns the existing Lean material from Chapters 1–8: from Riemann–Stieltjes integration through probability spaces, measurable functions, statistical independence, Lebesgue integration, convergence and coupling. The associated research report, From Lecture Notes to Lean: Formalizing a Textbook on Probability Theory, describes the project and the problem of relating textbook-level formulations to Mathlib's more general interfaces. The intended contribution is a source-faithful, reusable Prove2Me dependency graph for this part of the textbook.
A probability space consists of a sample space , a sigma-algebra of events and a probability measure with . A random variable is a measurable function into a measurable state space. The distribution of assigns a probability to each measurable subset of by measuring its inverse image under .
The first chapters also study Riemann–Stieltjes integration, which integrates a function with respect to increments of another function. Later, Lebesgue–Stieltjes measures associate measures with distribution-like functions on the real line. This provides a common treatment of discrete, continuous and singular distributions. Measurable transformations, independence and expectation are then developed using the measure-theoretic representations.
For a sequence of events , denotes the event that infinitely many of the occur. For measurable functions , almost-everywhere convergence means convergence outside a measure-zero set. A coupling of two probability laws is a joint probability measure whose marginals are those laws. These notions support the later convergence and product-measure results.
The source development treats the construction and manipulation of probability spaces, Borel sets, measurable maps, distribution functions and measures induced by them. Its earlier Riemann–Stieltjes material supplies a bridge between classical integrals and the measure-theoretic formulation. Individual targets retain their exact source statements, including hypotheses on intervals, monotonicity, integrability and measurability.
Representative results include the first Borel–Cantelli conclusion: if events satisfy
Convergence results include Fatou-type inequalities and dominated convergence. In the real-valued integrable setting, an illustrative dominated-convergence statement is
The exact Lean theorem types, domains and auxiliary assumptions are fixed by the source rather than inferred from these display formulae.
The later chapters develop product measures, integration over product spaces, coupling constructions and total-variation comparisons. A representative nonnegative Fubini–Tonelli identity is
for measurable under the usual measure-space hypotheses. The mission's final milestones will be the exact source-named Chapter 8 results and their dependencies, rather than an invented theorem combining the chapters.
The individual results provide an interconnected body of mathematics underlying modern probability, including rigorous expectations, independence arguments, limit interchange and comparison of distributions. Their formal definitions and bridge lemmas can be reused in later work on laws of large numbers, stochastic processes and mathematical statistics, as discussed in the formalisation report.
This is an import of a partially formalised textbook companion. Existing upstream proofs and their source correspondence are the starting point. Prove2Me must independently accept every published solution. Source theorems involving admitted proof placeholders or unresolved imported prerequisites remain Open obligations. The mission will distinguish source-proved results, platform-verified results and Open dependencies in its milestone graph.
The textbook often presents objects at a concrete level while Mathlib provides higher-level formulations. The mathematical challenge is ensuring that the hypotheses and conclusions of a bridge lemma really identify the two representations. Examples include Riemann–Stieltjes versus measure integrals, distribution functions versus generated measures, and independence expressed through random variables or sigma-algebras. The source already contains specialised bridging modules, and these must remain logically explicit.
The import creates a second technical challenge: a Lean declaration can rely on namespace scopes, instances, private helpers and transitive imports that do not appear in its theorem statement. Preserving source proof dependencies is especially important where a definition incorporates a theorem as a value-level dependency. A theorem that compiles under an admitted proof placeholder is still conditional. Splitting declarations into individual platform files therefore requires source-based dependency evidence and exact verification of the resulting types and axioms.
The scope is the substantive Lean material from the pinned upstream ProbabilityTheory repository, Chapters 1–8. The original repository uses Lean 4.31.0. The proposed Prove2Me environment is Lean 4.33.1 with Mathlib revision 0df444a360eaa60ab8c11dca51a86af692955474; compatibility changes must preserve the original mathematical claims. Vacuous hypotheses, artificially restricted finite examples and declarations that assume the desired conclusion are excluded as substitutes for the source statements.
The staged source package currently contains 462 generated Lean files: 172 Definition bundles, 145 theorem stubs and 145 corresponding solution candidates. The source work has a wider module inventory than this generated graph. The draft is therefore a staging description: some upstream modules and their dependencies still require resolution before full-source import certification. Neither a generated file nor a local compiler receipt means that a Prove2Me theorem is published or Proved.
The proposed mission is public-intended, but the Draft itself remains unpublished until the owner submits it for review and Prove2Me approves it. The exact main theorem, dependency-ordered milestones, references to any already-published equivalent declarations and the Open obligations will be attached after the platform payloads and coverage ledger are reconciled. No axiom, placeholder or missing dependency may be presented as an accepted proof.
theorem thm_8_7
{α : Type*} [MeasurableSpace α] {P Q : Measure α}
[IsProbabilityMeasure P] [IsProbabilityMeasure Q]
(π : Coupling P Q) :
totalVariationDistance P Q ≤ π.μ.real {ω : π.Ω | π.X ω ≠ π.Y ω} := by sorry
For any coupling of two probability measures P and Q on the same measurable space, the total variation distance between P and Q is bounded by the probability that the two coupled random variables disagree.
No open leaves. Every sub-goal is proved or awaiting decomposition.