Documentation

VCVio.EvalDist.Defs.Instances

Monad Evaluation Semantics Instances #

This file defines various instances of evaluation semantics for different monads

@[implicit_reducible]

Enable support notation for SetM (note the need for the monadic instance and not Set).

@[simp]
theorem SetM.support_eq_run {α : Type u} (s : SetM α) :
@[implicit_reducible]

Enable probability notation for SPMF, using identity as the SPMF embedding.

@[simp]
theorem SPMF.evalDist_def {α : Type u} (p : SPMF α) :
theorem SPMF.support_eq_support {α : Type u} (p : SPMF α) :
theorem SPMF.probOutput_eq_apply {α : Type u} (p : SPMF α) (x : α) :
Pr[= x | p] = p x
theorem SPMF.evalDist_eq_iff {α : Type u} {m : Type u → Type u_1} [Monad m] [HasEvalSPMF m] (mx : m α) (p : SPMF α) :
evalDist mx = p ∀ (x : α), Pr[= x | mx] = p x
@[implicit_reducible]
noncomputable instance PMF.instHasEvalPMF :

Enable probability notation for PMF, using liftM as the SPMF embedding.

@[simp]
theorem PMF.evalDist_eq {α : Type u} (p : PMF α) :
@[simp]
theorem PMF.probOutput_eq_apply {α : Type u} (p : PMF α) (x : α) :
Pr[= x | p] = p x
@[simp]
theorem SPMF.evalDist_liftM {α : Type u} (p : PMF α) :
@[simp]
theorem SPMF.probOutput_liftM {α : Type u} (p : PMF α) (x : α) :
Pr[= x | liftM p] = Pr[= x | p]
@[simp]
theorem SPMF.probEvent_liftM {α : Type u} (p : PMF α) (e : αProp) :
@[simp]
theorem SPMF.probFailure_liftM {α : Type u} (p : PMF α) :
@[implicit_reducible]
noncomputable instance Id.instHasEvalPMF :

The support of a computation in Id is the result being returned.

@[implicit_reducible]
@[simp]
theorem Id.support_eq_singleton {α : Type u} (x : Id α) :
@[simp]
theorem Id.finSupport_eq_singleton {α : Type u} [DecidableEq α] (x : Id α) :
@[simp]
theorem Id.probOutput_eq_ite {α : Type u} [DecidableEq α] (x : Id α) (y : α) :
Pr[= y | x] = if y = x.run then 1 else 0
@[simp]
theorem Id.probEvent_eq_ite {α : Type u} (x : Id α) (p : αProp) [DecidablePred p] :
probEvent x p = if p x.run then 1 else 0
theorem Id.probFailure_eq_zero {α : Type u} (x : Id α) :
Pr[⊥ | x] = 0