Discarding the none part of an option-valued measure #
Measure.dropNone turns a measure on Option α into the submeasure of successful values on
α. It is the effect-preserving boundary needed by OptionT and by finite observations of a
possibly nonterminating computation: the none mass is discarded instead of being confused with
an ordinary result.
The definition uses the Giry bind. The coproduct measurable structure makes the success/failure
case split measurable without requiring α itself to be discrete. dropNone μ is μ.comap some
(dropNone_eq_comap_some), the form an upstream version would use directly; VCVio's proofs
unfold the bind.
Keep the mass at some x as mass at x, and discard the mass at none.
Equations
Instances For
The measure family used by dropNone is measurable for every measurable result space.
The optional measure kernel is measurable in its eliminator form.
Discarding the none branch varies measurably with the input measure.
The mass retained by dropNone on a measurable set is the mass of its image under some.
Discarding none is Mathlib's measure pullback along the measurable embedding some.
Embedding every outcome as a successful value and discarding failure preserves the measure.
Mapping successful values commutes with discarding the absent outcomes.
Discarding failure after an optional bind is the bind of the successful input mass with the discarded successful mass of each continuation.
The success mass at x is the original mass at some x.
This is the computation rule that carries a pointwise mass statement across dropNone.
Discarding none cannot increase the total mass.
Discarding the absent outcomes of a subprobability measure preserves its mass bound.
Integrating against dropNone μ integrates against μ with the none outcome discarded.
Completing a subprobability measure with an explicit failure outcome #
Turn a subprobability measure into a measure on Option α by mapping successful outcomes
through some and assigning all missing mass to none.
The definition is meaningful for every measure. Its probability-measure law requires the
subprobability bound μ univ ≤ 1, supplied explicitly or inferred from
IsSubprobabilityMeasure μ.
Equations
Instances For
Completing a subprobability measure assigns total mass one.
The failure completion of a subprobability measure is a probability measure.
Completing a subprobability measure with its missing mass is a probability measure.
The mass of the explicit failure outcome is exactly the missing mass.
Failure completion preserves the mass of every successful singleton.
Discarding the failure outcome of a completion recovers the completed measure.
A probability measure on optional values is the completion of its present outcomes. Together
with dropNone_withFailure, completion and discarding none are inverse bijections between
subprobability measures on α and probability measures on Option α.
Finite selector fibers of optional outputs have total mass at most the mass of present outputs. Only the fibers need be measurable; the selector's target needs no measurable space.