Probability Distributions on Potentially Failing Computations #
This file gives OptionT finite-support and legacy probability lemmas in terms of
the underlying m (Option α). Its support comes from PolyFun's MonadAttach instance.
Peel the leading sample off the support of an OptionT.mk'd bind: any element of the
support of OptionT.mk (sample >>= body) factors through a sample a in the support of
sample, with the element in the support of OptionT.mk (body a).
Lift a HasEvalFinset instance to OptionT. by just taking preimage under some.
Lift a MonadLiftT m SPMF instance to MonadLiftT (OptionT m) SPMF. Failure in OptionT
contributes to the failure mass of the resulting SPMF.
The native support of OptionT m (preimage of support mx.run under some) agrees with the
SPMF-lift (the OptionT.mapM' bind into SPMF) on outputs, given EvalDistCompatible m.
Bridge lemma: when two OptionT computations have underlying runs related by an
Option.map of a function f, their probabilities for the events P and P ∘ f agree.