Measure-valued evaluation and its composition laws #
EvalDistSemantics denotes successful outputs by subprobability measures.
LawfulPureEvalDistSemantics supplies the Dirac equation independently of bind, while
LawfulEvalDistSemantics adds the measurable-bind equation.
Measurable spaces and continuations are explicit; discrete source spaces discharge
continuation measurability without constraining the result space.
A measure-valued subprobability semantics for a type constructor.
Interpret a computation as its measure of successful outputs.
Successful output mass is at most one.
Instances
The measure of successful outputs produced by mx.
Instances For
Denotation commutes with dependent conditional choice of a computation.
The mass of an event commutes with conditional choice of a computation.
Event mass commutes with dependent conditional choice of a computation.
Every computation denotation is a subprobability measure.
No event of a computation has mass above one.
A measure-valued semantics sends pure to a Dirac measure. This law is separate from the
bind law because a semantics can preserve pure even when continuous effects prevent a global
measurability proof for arbitrary bind continuations.
- denote_pure {Ξ± : Type u} [MeasurableSpace Ξ±] (x : Ξ±) : π[pure x] = MeasureTheory.Measure.dirac x
puredenotes a Dirac measure.
Instances
A measure-valued semantics also respects measurable bind in the Giry monad.
- denote_pure {Ξ± : Type u} [MeasurableSpace Ξ±] (x : Ξ±) : π[pure x] = MeasureTheory.Measure.dirac x
- denote_bind {Ξ± Ξ² : Type u} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] (mx : m Ξ±) (f : Ξ± β m Ξ²) (hf : Measurable fun (x : Ξ±) => π[f x]) : π[mx >>= f] = π[mx].bind fun (x : Ξ±) => π[f x]
Monadic bind denotes Giry bind whenever its measure-valued continuation is measurable.
Instances
On a discrete source type, every measure-valued continuation is measurable.
Almost-everywhere equal measurable continuation measures give equal composed measures.
Pointwise equality of continuation measures gives equality after a common bind. No measurable structure is required on the unobserved intermediate type: the common continuation measure supplies its observation's pullback measurable space.
Functor.map along a measurable function denotes the pushforward measure.
On a discrete source type, every Functor.map denotes a pushforward.
Independent sequential draws denote Mathlib's product measure.
A constant continuation scales the continuation's measure by the success mass
(Measure.bind_const); the measure form of probOutput_bind_const.
A constant map denotes the success mass at a point (Measure.map_const); the measure form
of probOutput_map_const.
An AE-measurable valuation of composed outputs satisfies the integral tower law.
Integrating a bind first integrates each measurable continuation, then its common draw.
For a discrete common draw, the tower law needs no continuation measurability proof.
An AE-measurable valuation of a measurable output map integrates the composed functional.
Integrating a measurable output map integrates the composed functional.
On discrete source and target spaces, output-map integration needs no measurability proofs.
Adding to a natural-valued observation adds the constant scaled by the successful output mass. The observed computation's intermediate result needs no measurable-space instance.
Adding a fixed natural to an observed count scales that increment by successful mass.
The curried addition form supplies a binder-free pattern for grind.
The success mass of a bind is the integral of its continuation's success mass.
A measurable map preserves the successful-output mass.
A pure Boolean result covered by either of two results has mass bounded by their sum.