Probability Distributions on Option return types #
Lemmas about evalSPMF and the associated probabilities for computations
returning an Option.
@[simp]
theorem
probOutput_some_map_none
{m : Type u → Type v}
{α : Type u}
[Monad m]
[LawfulMonad m]
[MonadLiftT m SPMF]
[LawfulMonadLiftT m SPMF]
(mx : m α)
:
theorem
probEvent_isSome_eq_tsum_probOutput_some
{m : Type u → Type v}
{α : Type u}
[MonadLiftT m SPMF]
(mx : m (Option α))
:
The probability of returning some is the total mass of all some
outputs, without requiring the computation to be failure-free.
theorem
sum_probEvent_option_map_eq_some_le_isSome
{m : Type u → Type v}
{α γ : Type u}
[MonadLiftT m SPMF]
(mx : m (Option α))
[Fintype γ]
(select : α → Option γ)
:
Selector fibers inside an optional output are disjoint, so their finite
sum is bounded by the probability of returning any some value.
@[simp]
theorem
probOutput_some_map_option_map
{m : Type u → Type v}
{α β : Type u}
[MonadLiftT m SPMF]
(mx : m (Option α))
[Monad m]
[LawfulMonad m]
[LawfulMonadLiftT m SPMF]
{f : α → β}
(hf : Function.Injective f)
(x : α)
:
@[simp]
theorem
probOutput_none_map_option_map
{m : Type u → Type v}
{α β : Type u}
[MonadLiftT m SPMF]
(mx : m (Option α))
[Monad m]
[LawfulMonad m]
[LawfulMonadLiftT m SPMF]
(f : α → β)
: