Measure-valued evaluation and discrete compatibility #
This module reexports VCVio.EvalDist.Defs.Measure.Core and supplies the discrete
compatibility adapters. An
EvalDistSemantics m interprets m α as a Mathlib Measure α with total mass at most one.
Missing mass represents failure or nontermination. In particular, the output distribution itself
does not introduce an Option outcome.
Measurable spaces are explicit arguments to the semantics. There is deliberately no blanket measurable-space instance for finite types: discrete adapters state their countability and measurability assumptions at the boundary where they are used.
LawfulPureEvalDistSemantics records the Giry pure law without imposing conditions on effects.
LawfulEvalDistSemantics adds the bind law, keeping measurability of the continuation visible;
evalDist_bind_of_discrete is the usual cryptographic specialization.
Read an SPMF as the measure of its successful outputs. This is the explicit compatibility
bridge from the finite executable backend to the primary measure API.
Instances For
Failure carries no successful-output mass.
Integrating a measurable function against the successful-output measure is the
mass-weighted sum over successful outputs, with the mass on the left as in
bind_apply_eq_tsum. This is the one place where the transitional option-valued backend meets
Lebesgue integration; every singleton, event and expectation bridge derives from it, and it is
the glue that disappears once the façade is defined from 𝒟[…] directly.
The successful-output measure of a measurable set is the sum of the point masses it contains.
The successful-output measure retains the complete SPMF.
Failure mass is determined by the successful masses, so dropping the explicit none outcome does
not lose information.
The successful-output measure commutes with measurable maps.
Successful-output measures commute with SPMF bind whenever the measure-valued
continuation is measurable.
On a discrete source type every measure-valued continuation is measurable.
Compatibility semantics for monads that still expose an SPMF lift.
The low priority lets a direct measure interpretation, such as the free-monad fold in
PFunctorMeasure, win whenever both are available.
Convert a countable discrete subprobability measure to the compatibility SPMF backend.
The missing mass is first made explicit as none; the resulting probability measure can then use
Mathlib's Measure.toPMF bridge.
Instances For
Converting a discrete subprobability measure to SPMF and back preserves the measure.
Converting an SPMF to its successful-output measure and back preserves the SPMF.