Mathlib theorem · Existing formal mathematics

Existing in Mathlib · Probability

Bayes' Theorem

For two measurable events under a finite measure, the probability of t conditioned on s can be recovered from the reverse conditional probability, weighted by the measure of t and scaled by the inverse measure of s.

Exact theorem

Exact Mathlib statement

theorem ProbabilityTheory.cond_eq_inv_mul_cond_mul {Ω : Type*} {m : MeasurableSpace Ω} {s t : Set Ω} (hms : MeasurableSet s) (hmt : MeasurableSet t) (μ : Measure Ω) [IsFiniteMeasure μ] : μ[t | s] = (μ s)⁻¹ * μ[s | t] * μ t

The theorem at a glance

Bayes' theorem at a glance

A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.

Both conditioning directions pass through the same intersection mass, yielding Mathlib's finite-measure form of Bayes' theorem. Explanatory diagram.
Detailed visual description

The poster foregrounds μ[t | s] = (μ s)⁻¹ · μ[s | t] · μ t for measurable s and t under a finite measure. Cobalt s and terracotta t contours overlap around one gold measure-mass core; paired measure-weight chambers emphasize the two conditioning directions without identifying measure with geometric area. The lower route converts reverse conditional mass to μ(t ∩ s), commutes the intersection, and unfolds conditioning on s.

Statement structure

Statement and scope

Statement map for Bayes' TheoremThe two conditional directions are related through the same measurable intersection mass. Claim boundary: This page indexes Mathlib's finite-measure, measurable-set form of Bayes' theorem. For measurable s and t, μ[t | s] equals (μ s)⁻¹ times μ[s | t] times μ t. The selected declaration does not add a nonzero condition on μ s or μ t, require μ to be a probability measure, assert independence or causation, or specialize to a finite or discrete sample space. The pinned upstream declaration is ProbabilityTheory.cond_eq_inv_mul_cond_mul. The complete formal statement is available in the Exact Mathlib statement section.Mathematical readingThe two conditionaldirections are relatedthrough the samemeasurable intersectionmass.Claim boundaryThis page indexesMathlib'sfinite-measure,measurable-set form ofBayes' theorem. Formeasurable s and t, μ[t| s] equals (μ s)⁻¹times μ[s | t] times μt. The selecteddeclaration does not adda nonzero condition on μs or μ t, require μ tobe a probabilitymeasure, assertindependence orcausation, or specializeto a finite or discretesample space.Pinned declarationmathlib ·ProbabilityTheory.cond_eq_inv_mul_cond_mulStatement map for Bayes' TheoremThe two conditional directions are related through the same measurable intersection mass. Claim boundary: This page indexes Mathlib's finite-measure, measurable-set form of Bayes' theorem. For measurable s and t, μ[t | s] equals (μ s)⁻¹ times μ[s | t] times μ t. The selected declaration does not add a nonzero condition on μ s or μ t, require μ to be a probability measure, assert independence or causation, or specialize to a finite or discrete sample space. The pinned upstream declaration is ProbabilityTheory.cond_eq_inv_mul_cond_mul. The complete formal statement is available in the Exact Mathlib statement section.Mathematical readingThe two conditionaldirections are relatedthrough the samemeasurable intersectionmass.Claim boundaryThis page indexesMathlib'sfinite-measure,measurable-set form ofBayes' theorem. Formeasurable s and t, μ[t| s] equals (μ s)⁻¹times μ[s | t] times μt. The selecteddeclaration does not adda nonzero condition on μs or μ t, require μ tobe a probabilitymeasure, assertindependence orcausation, or specializeto a finite or discretesample space.Pinned declarationmathlib ·ProbabilityTheory.cond_eq_inv_mul_cond_mul

Read the exact Mathlib declaration

This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.

Two conditioning directions isolate the same shared kernel and balance against their event-mass tokens. Explanatory scientific diagram.
Detailed visual description

A warm-ivory diagram contains asymmetric overlapping blue and terracotta chambers filled with differently hatched measure tokens. Their gold overlap has its own token family, two curved paths point into it from opposite sides, and a three-pan balance below compares blue, gold, and terracotta token collections.

Why it matters

A mathematical landmark

Bayes' theorem is one of the central identities of probability. Mathlib's selected declaration is especially instructive because it presents the identity at the level of measurable sets and finite measures: both conditioning directions reduce to the measure of the same intersection.

ProofAtlas record

What has been checked

Upstream indexedPinned source bytes verified locally
Locally reproducedExact upstream declaration replayed
Reviewed pageCurrent public presentation reviewed
Accepted Atlas resultNot recorded for the preferred artifact

Mathlib is the source of the theorem; the local Lean replay and page review are separate.

Claim boundary

No new theorem is claimed

This page indexes Mathlib's finite-measure, measurable-set form of Bayes' theorem. For measurable s and t, μ[t | s] equals (μ s)⁻¹ times μ[s | t] times μ t. The selected declaration does not add a nonzero condition on μ s or μ t, require μ to be a probability measure, assert independence or causation, or specialize to a finite or discrete sample space.

Source and local evidence

Where the theorem comes from

Existing declaration
ProbabilityTheory.cond_eq_inv_mul_cond_mul in mathlib
Relationship
The checked artifact is the upstream declaration itself
Local Lean evidence
artifact.library.mathlib.bayes-theorem.v001
Source
Open the pinned upstream reference