Documentation

VCVio.EvalDist.Defs.Instances

Monad Evaluation Semantics Instances #

This file defines various instances of evaluation semantics for different monads

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

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

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

    Equations
      @[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
      noncomputable instance PMF.instHasEvalPMF :

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

      Equations
        @[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 : α) :
        @[simp]
        theorem SPMF.probEvent_liftM {α : Type u} (p : PMF α) (e : αProp) :
        Pr[e | liftM p] = Pr[e | p]
        @[simp]
        theorem SPMF.probFailure_liftM {α : Type u} (p : PMF α) :
        noncomputable instance Id.instHasEvalPMF :

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

        Equations
          @[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} [DecidableEq α] (x : Id α) (p : αProp) [DecidablePred p] :
          Pr[p | x] = if p x.run then 1 else 0
          theorem Id.probFailure_eq_zero {α : Type u} (x : Id α) :
          Pr[⊥ | x] = 0