Documentation

Linglib.Core.FinitePMF

Finite Probability Mass Functions #

FinitePMF W bundles a rational-valued mass function with non-negativity and normalization proofs, eliminating the need to thread hNN/hNorm hypotheses through probabilistic theorems.

Relationship to Other Distribution Types #

TypeNumber systemNormalized?Usage
FinitePMF WYes (bundled)Probabilistic answerhood, questions, Bayesian semantics
RSAConfigDataNoRSA unnormalized weights
RSAConfigNoRSA mathematical proofs
W → ℝHypothesizedEntropy / information theory

FinitePMF is the canonical type for probabilistic semantics where exact normalized distributions are needed. RSA priors are deliberately unnormalized and should NOT use FinitePMF.

structure Core.FinitePMF (W : Type u_1) [Fintype W] :
Type u_1

A normalized, non-negative probability distribution over a finite type, using exact rational arithmetic.

  • mass : W

    Probability mass function

  • mass_nonneg (w : W) : 0 self.mass w

    All masses are non-negative

  • mass_sum_one : w : W, self.mass w = 1

    Masses sum to 1

Instances For
    instance Core.FinitePMF.instCoeFunForallRat {W : Type u_1} [Fintype W] :
    CoeFun (FinitePMF W) fun (x : FinitePMF W) => W
    Equations
    instance Core.FinitePMF.instCoeForallRat {W : Type u_1} [Fintype W] :
    Coe (FinitePMF W) (W)

    Coercion to bare function type, for passing to modules that take W → ℚ (e.g., DTS's condProb, bayesFactor).

    Equations
    @[simp]
    theorem Core.FinitePMF.coe_def {W : Type u_1} [Fintype W] (d : FinitePMF W) (w : W) :
    d.mass w = d.mass w

    Uniform distribution over a nonempty finite type.

    Equations
    Instances For
      def Core.FinitePMF.pure {W : Type u_1} [Fintype W] [DecidableEq W] (w₀ : W) :

      Point mass at a single value

      Equations
      Instances For
        def Core.FinitePMF.expect {W : Type u_1} [Fintype W] (pmf : FinitePMF W) (f : W) :

        Expected value of a function under this distribution

        Equations
        Instances For
          def Core.FinitePMF.prob {W : Type u_1} [Fintype W] (pmf : FinitePMF W) (event : WBool) :

          Expected value of an indicator (probability of event)

          Equations
          Instances For
            theorem Core.FinitePMF.expect_pure {W : Type u_1} [Fintype W] [DecidableEq W] (w₀ : W) (f : W) :
            (pure w₀).expect f = f w₀

            Expected value of pure distribution is the value at that point