PhyslibSearch

QuantumInfo.ClassicalInfo.Distribution

39 declarations

definition

Probability distribution on a finite set α\alpha

#ProbDistribution

Let α\alpha be a finite set. A probability distribution on α\alpha is defined as a function f:αProbf: \alpha \to \text{Prob} such that the sum of the probabilities over all elements in α\alpha equals 1, i.e., iαf(i)=1\sum_{i \in \alpha} f(i) = 1. Here Prob\text{Prob} denotes the subtype of real numbers in the unit interval [0,1][0, 1].

definition

Construction of a probability distribution from a normalized non-negative function f:αRf: \alpha \to \mathbb{R}

#mk'

Given a finite set α\alpha and a function f:αRf: \alpha \to \mathbb{R}, if f(i)0f(i) \ge 0 for all iαi \in \alpha and iαf(i)=1\sum_{i \in \alpha} f(i) = 1, then ff defines a probability distribution on α\alpha. The construction automatically derives that f(i)1f(i) \le 1 for all iαi \in \alpha from the given conditions.

instance

Function-like coercion for `ProbDistribution` to α[0,1]\alpha \to [0, 1]

#instFunLikeProb

Let α\alpha be a finite set. A probability distribution dProbDistribution(α)d \in \text{ProbDistribution}(\alpha) can be treated as a function d:αProbd: \alpha \to \text{Prob}, where Prob\text{Prob} is the interval [0,1]R[0, 1] \subset \mathbb{R}. For any element aαa \in \alpha, the value d(a)d(a) represents the probability assigned to aa. The mapping is injective, meaning a probability distribution is uniquely determined by the values it assigns to each element in α\alpha.

theorem

The sum of probabilities in a `ProbDistribution` is 1

#normalized

Let α\alpha be a finite type. For any probability distribution dd on α\alpha, the sum of the probabilities assigned to each element iαi \in \alpha is equal to 11, i.e., iαd(i)=1\sum_{i \in \alpha} d(i) = 1.

abbrev

The underlying function of a probability distribution d:α[0,1]d: \alpha \to [0, 1]

#prob

Let α\alpha be a finite set. Given a probability distribution dd on α\alpha, this function retrieves the underlying mapping d:αProbd: \alpha \to \text{Prob}, which assigns to each element xαx \in \alpha a probability value in the unit interval [0,1][0, 1].

theorem

The underlying value of a `ProbDistribution` dd equals dd as a function.

#fun_eq_val

Let α\alpha be a finite set and dd be a probability distribution on α\alpha. The value of the underlying function associated with the distribution is equal to the distribution itself under the function-like coercion.

theorem

Evaluation of a Probability Distribution d,h\langle d, h \rangle at xx equals d(x)d(x)

#funlike_apply

Let α\alpha be a finite set and Prob\text{Prob} be the closed unit interval [0,1]R[0, 1] \subset \mathbb{R}. For any function d:αProbd: \alpha \to \text{Prob} and a proof hh that dd satisfies the probability distribution property (i.e., iαd(i)=1\sum_{i \in \alpha} d(i) = 1), the value of the probability distribution d,h\langle d, h \rangle evaluated at xαx \in \alpha is equal to d(x)d(x).

theorem

Extensionality of probability distributions on finite sets

#ext

Let α\alpha be a finite set and let pp and qq be probability distributions on α\alpha. If for every xαx \in \alpha, the probability assigned by pp to xx is equal to the probability assigned by qq to xx (i.e., p(x)=q(x)p(x) = q(x) for all xαx \in \alpha), then the probability distributions pp and qq are equal.

theorem

The existence of a probability distribution on α\alpha implies α\alpha is non-empty.

#nonempty

Let α\alpha be a finite set. If there exists a probability distribution dd on α\alpha, then the set α\alpha is non-empty.

definition

Point mass distribution at xx

#constant

Given a finite set α\alpha and an element xαx \in \alpha, the constant distribution at xx is the probability distribution f:αProbf: \alpha \to \text{Prob} defined by the Kronecker delta function: f(y)=δxy={1if y=x0if yxf(y) = \delta_{xy} = \begin{cases} 1 & \text{if } y = x \\ 0 & \text{if } y \neq x \end{cases} where Prob\text{Prob} is the interval [0,1][0, 1]. This is also referred to as a delta function or point mass distribution at xx.

theorem

Definition of the Constant Probability Distribution `constant x`

#constant_def

For any element xx in a finite set α\alpha, the probability distribution defined by `constant x` is equal to the function that assigns the probability 11 to an element yαy \in \alpha if x=yx = y, and the probability 00 otherwise.

theorem

The distribution `constant x` evaluated at yy equals 11 if x=yx = y and 00 otherwise

#constant_eq

Let α\alpha be a finite set. For any element xαx \in \alpha, the constant probability distribution (Dirac distribution) centered at xx, denoted by constant x\text{constant } x, evaluates at any yαy \in \alpha as follows: (constant x)(y)={1if x=y0if xy(\text{constant } x)(y) = \begin{cases} 1 & \text{if } x = y \\ 0 & \text{if } x \neq y \end{cases} where 11 and 00 are elements of the probability type Prob[0,1]\text{Prob} \subseteq [0, 1].

theorem

The point mass distribution constant x\text{constant } x evaluated at yy is 1 if x=yx=y and 0 otherwise

#constant_def'

Let α\alpha be a finite set and x,yαx, y \in \alpha. Let constant x\text{constant } x be the probability distribution on α\alpha concentrated at xx. The probability assigned by constant x\text{constant } x to the element yy is equal to 11 if x=yx = y and 00 otherwise.

theorem

If D(x)=1D(x) = 1, then DD is the constant distribution at xx

#constant_of_exists_one

Let α\alpha be a finite set. If DD is a probability distribution on α\alpha such that for some element xαx \in \alpha, the probability D(x)D(x) is equal to 11, then DD is the constant distribution at xx (the Dirac distribution centered at xx), which assigns probability 11 to xx and 00 to all other elements.

definition

Uniform probability distribution on a finite set α\alpha

#uniform

Let α\alpha be a non-empty finite set. The uniform distribution on α\alpha is the probability distribution f:αProbf: \alpha \to \text{Prob} defined by f(x)=1αf(x) = \frac{1}{|\alpha|} for every xαx \in \alpha, where α|\alpha| denotes the cardinality of the set α\alpha.

theorem

The uniform distribution on α\alpha satisfies d(y)=1/αd(y) = 1/|\alpha|

#uniform_def

Let α\alpha be a finite, nonempty set. For any element yαy \in \alpha, the value of the uniform probability distribution on α\alpha at yy, when cast to a real number, is equal to 1/α1 / |\alpha|, where α|\alpha| denotes the cardinality of the set α\alpha.

definition

Product of two probability distributions d1×d2d_1 \times d_2

#prod

Given two probability distributions d1d_1 on a finite set α\alpha and d2d_2 on a finite set β\beta, their product distribution d1×d2d_1 \times d_2 is the probability distribution on the Cartesian product α×β\alpha \times \beta defined by the mapping (x,y)d1(x)d2(y)(x, y) \mapsto d_1(x) \cdot d_2(y) for all xαx \in \alpha and yβy \in \beta.

theorem

The product distribution satisfies (d1d2)(x,y)=d1(x)d2(y)(d_1 \otimes d_2)(x, y) = d_1(x) \cdot d_2(y)

#prod_def

Let α\alpha and β\beta be finite types, and let d1d_1 and d2d_2 be probability distributions on α\alpha and β\beta respectively. For any xαx \in \alpha and yβy \in \beta, the probability assigned to the pair (x,y)(x, y) by the product distribution d1d2d_1 \otimes d_2 is equal to the product of the individual probabilities d1(x)d_1(x) and d2(y)d_2(y).

definition

Extend a probability distribution dd to αβ\alpha \oplus \beta by zero on β\beta

#extend_right

Given a probability distribution dd on a finite set α\alpha, we define its extension to the disjoint union α⨿β\alpha \amalg \beta. The resulting distribution assigns the probability d(x)d(x) to each element xαx \in \alpha and assigns the probability 00 to every element yβy \in \beta.

definition

Extension of a distribution dd to βα\beta \oplus \alpha with zero support on β\beta

#extend_left

Given a probability distribution dd on a finite set α\alpha and another set β\beta, we define a new probability distribution on the disjoint union βα\beta \oplus \alpha. For any element xβαx \in \beta \oplus \alpha, the probability mass is assigned as follows: - If xαx \in \alpha, the value is d(x)d(x). - If xβx \in \beta, the value is 00.

instance

The set of probability distributions on a finite set α\alpha is `Mixable` into αR\alpha \to \mathbb{R}

#instMixable

Let α\alpha be a finite set. The type ProbDistribution α\text{ProbDistribution } \alpha of probability distributions on α\alpha is a `Mixable` type into the function space αR\alpha \to \mathbb{R}. For any two distributions d1,d2ProbDistribution αd_1, d_2 \in \text{ProbDistribution } \alpha and non-negative real numbers a,bRa, b \in \mathbb{R} with a+b=1a + b = 1, their convex mixture ad1+bd2a d_1 + b d_2 is also a probability distribution on α\alpha. This is established by utilizing the fact that the subspace of functions whose values sum to 11 is convex within the vector space of real-valued functions on α\alpha.

definition

Relabeling of a probability distribution dd via βα\beta \simeq \alpha

#relabel

Given a probability distribution dd on a finite set α\alpha and an equivalence (bijection) σ:βα\sigma: \beta \simeq \alpha from another set β\beta to α\alpha, the function returns a new probability distribution on β\beta. For any element bβb \in \beta, the probability assigned is defined by d(σ(b))d(\sigma(b)). The sum of these values over β\beta is equal to 1 because σ\sigma is a bijection, ensuring the result is a valid probability distribution.

definition

Equivalence of probability distributions induced by αβ\alpha \simeq \beta

#congr

Given an equivalence (bijection) σ:αβ\sigma : \alpha \simeq \beta between two finite sets α\alpha and β\beta, there exists an induced equivalence between the sets of probability distributions P(α)P(\alpha) and P(β)P(\beta). Specifically, a distribution dP(α)d \in P(\alpha) is mapped to a distribution in P(β)P(\beta) by relabeling the elements according to the inverse bijection σ1\sigma^{-1}.

theorem

Valuation of Induced Probability Distribution congr(σ)(d)(j)=d(σ1(j))\text{congr}(\sigma)(d)(j) = d(\sigma^{-1}(j))

#congr_apply

Let α\alpha and β\beta be finite sets and σ:αβ\sigma : \alpha \simeq \beta be a bijection. For any probability distribution dd on α\alpha and any element jβj \in \beta, the value of the induced distribution congr(σ)(d)\text{congr}(\sigma)(d) at jj is given by d(σ1(j))d(\sigma^{-1}(j)).

theorem

(congr σ)1=congr σ1(\text{congr } \sigma)^{-1} = \text{congr } \sigma^{-1}

#congr_symm_apply

Let α\alpha and β\beta be finite types and let σ:αβ\sigma : \alpha \simeq \beta be an equivalence (bijection) between them. Let congr(σ):ProbDistribution(α)ProbDistribution(β)\text{congr}(\sigma) : \text{ProbDistribution}(\alpha) \simeq \text{ProbDistribution}(\beta) be the induced equivalence between the spaces of probability distributions. Then the inverse of this induced equivalence is equal to the equivalence induced by the inverse of σ\sigma. That is, (congr(σ))1=congr(σ1)(\text{congr}(\sigma))^{-1} = \text{congr}(\sigma^{-1}).

definition

Bernoulli distribution with parameter pp on {0,1}\{0, 1\}

#coin

Given a probability p[0,1]p \in [0, 1], the function `coin p` defines a probability distribution on the finite set {0,1}\{0, 1\} (represented as `Fin 2`). The distribution assigns the probability pp to the element 00 and the probability 1p1 - p to the element 11.

theorem

The probability of outcome 00 in coin(p)\text{coin}(p) is pp

#coin_val_zero

Let p[0,1]p \in [0, 1] be a probability. For the Bernoulli distribution coin(p)\text{coin}(p) defined on the set {0,1}\{0, 1\}, the probability assigned to the outcome 00 is equal to pp, i.e., coin(p)(0)=p\text{coin}(p)(0) = p.

theorem

ProbDistribution.coin_val_one

#coin_val_one

(p : Prob) : coin p 1 = 1 - p

theorem

Every distribution on {0,1}\{0, 1\} is a coin distribution uniquely determined by d(0)d(0)

#fin_two_eq_coin

Let dd be a probability distribution on the finite set {0,1}\{0, 1\}. Then dd is equal to the coin distribution uniquely determined by the probability assigned to the first element, d(0)d(0). That is, d=coin(d(0))d = \text{coin}(d(0)), where coin(p)\text{coin}(p) is the distribution on {0,1}\{0, 1\} assigning probability pp to 00 and 1p1-p to 11.

theorem

`coin p = f` if and only if `p = f 0`

#coin_eq_iff

Let ff be a probability distribution on the finite set {0,1}\{0, 1\} (represented by the type `Fin 2`), and let p[0,1]p \in [0, 1] be a probability. The distribution ff is equal to the coin distribution parameterised by pp (denoted as `coin p`) if and only if the probability ff assigns to the element 00 is equal to pp.

instance

Functor instance for RandVarα\text{RandVar}_\alpha

#instFunctor

For a finite set α\alpha, let RandVarα\text{RandVar}_\alpha be the type of random variables (probability distributions) over α\alpha. The functor instance for RandVarα\text{RandVar}_\alpha defines the mapping operation such that for any function f:ABf: A \to B and a random variable XRandVarαAX \in \text{RandVar}_\alpha A represented by a pair (e,p)(e, p), the mapped random variable map f X\text{map}\ f\ X is given by (fe,p)(f \circ e, p).

instance

`RandVar α` is a Lawful Functor

#instLawfulFunctor

The functor instance for the type of random variables `RandVar α` (defined as probability distributions over a finite set α\alpha) is a lawful functor. This means it satisfies the functor laws: it preserves identity morphisms, map id=id\text{map}\ \text{id} = \text{id}, and it is compositional, map (gf)=map gmap f\text{map}\ (g \circ f) = \text{map}\ g \circ \text{map}\ f.

definition

Expectation value of a random variable XX

#expect_val

Let α\alpha be a finite set and TT be a type equipped with a `Mixable` instance (representing a structure that allows convex combinations, such as a convex subset of a vector space). Given a random variable XX over α\alpha with values in TT—where XX consists of a probability distribution PP on α\alpha and a mapping f:αTf: \alpha \to T—the expectation value E[X]TE[X] \in T is defined as the convex combination of the values of ff weighted by the distribution PP: E[X]=iαP(i)f(i)E[X] = \sum_{i \in \alpha} P(i) f(i) The definition ensures that because iαP(i)=1\sum_{i \in \alpha} P(i) = 1 and P(i)0P(i) \ge 0, the resulting sum remains within the set TT.

theorem

Expectation over `Fin 2` is a Binary Mix with Weight d(0)d(0)

#expect_val_eq_mixable_mix

Let dd be a probability distribution on the finite set {0,1}\{0, 1\} (represented by `Fin 2`). Let x1,x2x_1, x_2 be elements of a type TT that is `Mixable`. Let XX be a random variable mapping 0x10 \mapsto x_1 and 1x21 \mapsto x_2 (denoted by the matrix notation ![x1,x2]![x_1, x_2]). Then the expectation value of XX with respect to dd is equal to the convex combination (mix) of x1x_1 and x2x_2 weighted by the probability d(0)d(0), such that E[X]=d(0)x1+d(1)x2=Mixable.mix(d(0),x1,x2)E[X] = d(0)x_1 + d(1)x_2 = \text{Mixable.mix}(d(0), x_1, x_2).

theorem

Expectation Value of a Constant Distribution at xx is f(x)f(x)

#expect_val_constant

Let α\alpha be a finite set and TT be a type (typically representing a vector space or a mixable space). For any element xαx \in \alpha and any random variable f:αTf: \alpha \to T, the expectation value of ff with respect to the constant probability distribution at xx—denoted by constant x\text{constant } x, which assigns probability 1 to xx and 0 otherwise—is equal to f(x)f(x).

theorem

Non-negativity of the expectation value for non-negative random variables

#zero_le_expect_val

Let α\alpha be a finite type and dd be a probability distribution on α\alpha. Let f:αRf: \alpha \to \mathbb{R} be a real-valued random variable such that ff is non-negative, i.e., f(a)0f(a) \ge 0 for all aαa \in \alpha. Then the expectation value of ff with respect to dd, denoted by Ed[f]\mathbb{E}_d[f], is also non-negative, satisfying 0Ed[f]0 \le \mathbb{E}_d[f].

definition

Equivalence of random variables XX induced by αβ\alpha \simeq \beta

#congrRandVar

Given an equivalence σ:αβ\sigma : \alpha \simeq \beta between two finite sets, there exists an induced equivalence between the types of TT-valued random variables RandVar α T\text{RandVar } \alpha\ T and RandVar β T\text{RandVar } \beta\ T. Specifically, a random variable XX on α\alpha is mapped to a random variable on β\beta whose outcome function is X.varσ1X.\text{var} \circ \sigma^{-1} and whose probability distribution is the push-forward of X.distrX.\text{distr} along σ\sigma.

definition

Mapping over a random variable commutes with equivalence-based reindexing: f(σX)=σ(fX)f_*(\sigma^* X) = \sigma^*(f_* X)

#map_congr_eq_congr_map

Let α\alpha and β\beta be finite sets and T,ST, S be types. Given an equivalence (bijection) σ:αβ\sigma: \alpha \simeq \beta, a random variable X:αTX: \alpha \to T, and a function f:TSf: T \to S, the operation of mapping ff over the random variable commutes with the reindexing of the random variable by σ\sigma. That is, f(Xσ1)=(fX)σ1f \circ (X \circ \sigma^{-1}) = (f \circ X) \circ \sigma^{-1}, where f\langle f \rangle denotes the functorial map (fmap) and `congrRandVar` σ\sigma denotes the change of variables via the equivalence.

theorem

Expectation value is invariant under equivalence of random variables: E[σX]=E[X]E[\sigma^* X] = E[X]

#expect_val_congr_eq_expect_val

Let α\alpha and β\beta be finite sets and TT be a type. Given an equivalence (bijection) σ:αβ\sigma : \alpha \simeq \beta and a TT-valued random variable XX defined on α\alpha, the expectation value of the random variable induced on β\beta via σ\sigma (denoted by congrRandVar σX\text{congrRandVar } \sigma X) is equal to the expectation value of the original random variable XX. That is, E[σX]=E[X]E[\sigma^* X] = E[X].