QuantumInfo.ClassicalInfo.Distribution
39 declarations
Probability distribution on a finite set
#ProbDistributionLet be a finite set. A probability distribution on is defined as a function such that the sum of the probabilities over all elements in equals 1, i.e., . Here denotes the subtype of real numbers in the unit interval .
Construction of a probability distribution from a normalized non-negative function
#mk'Given a finite set and a function , if for all and , then defines a probability distribution on . The construction automatically derives that for all from the given conditions.
Function-like coercion for `ProbDistribution` to
#instFunLikeProbLet be a finite set. A probability distribution can be treated as a function , where is the interval . For any element , the value represents the probability assigned to . The mapping is injective, meaning a probability distribution is uniquely determined by the values it assigns to each element in .
The sum of probabilities in a `ProbDistribution` is 1
#normalizedLet be a finite type. For any probability distribution on , the sum of the probabilities assigned to each element is equal to , i.e., .
The underlying function of a probability distribution
#probLet be a finite set. Given a probability distribution on , this function retrieves the underlying mapping , which assigns to each element a probability value in the unit interval .
The underlying value of a `ProbDistribution` equals as a function.
#fun_eq_valLet be a finite set and be a probability distribution on . The value of the underlying function associated with the distribution is equal to the distribution itself under the function-like coercion.
Evaluation of a Probability Distribution at equals
#funlike_applyLet be a finite set and be the closed unit interval . For any function and a proof that satisfies the probability distribution property (i.e., ), the value of the probability distribution evaluated at is equal to .
Extensionality of probability distributions on finite sets
#extLet be a finite set and let and be probability distributions on . If for every , the probability assigned by to is equal to the probability assigned by to (i.e., for all ), then the probability distributions and are equal.
The existence of a probability distribution on implies is non-empty.
#nonemptyLet be a finite set. If there exists a probability distribution on , then the set is non-empty.
Point mass distribution at
#constantGiven a finite set and an element , the constant distribution at is the probability distribution defined by the Kronecker delta function: where is the interval . This is also referred to as a delta function or point mass distribution at .
Definition of the Constant Probability Distribution `constant x`
#constant_defFor any element in a finite set , the probability distribution defined by `constant x` is equal to the function that assigns the probability to an element if , and the probability otherwise.
The distribution `constant x` evaluated at equals if and otherwise
#constant_eqLet be a finite set. For any element , the constant probability distribution (Dirac distribution) centered at , denoted by , evaluates at any as follows: where and are elements of the probability type .
The point mass distribution evaluated at is 1 if and 0 otherwise
#constant_def'Let be a finite set and . Let be the probability distribution on concentrated at . The probability assigned by to the element is equal to if and otherwise.
If , then is the constant distribution at
#constant_of_exists_oneLet be a finite set. If is a probability distribution on such that for some element , the probability is equal to , then is the constant distribution at (the Dirac distribution centered at ), which assigns probability to and to all other elements.
Uniform probability distribution on a finite set
#uniformLet be a non-empty finite set. The uniform distribution on is the probability distribution defined by for every , where denotes the cardinality of the set .
The uniform distribution on satisfies
#uniform_defLet be a finite, nonempty set. For any element , the value of the uniform probability distribution on at , when cast to a real number, is equal to , where denotes the cardinality of the set .
Product of two probability distributions
#prodGiven two probability distributions on a finite set and on a finite set , their product distribution is the probability distribution on the Cartesian product defined by the mapping for all and .
The product distribution satisfies
#prod_defLet and be finite types, and let and be probability distributions on and respectively. For any and , the probability assigned to the pair by the product distribution is equal to the product of the individual probabilities and .
Extend a probability distribution to by zero on
#extend_rightGiven a probability distribution on a finite set , we define its extension to the disjoint union . The resulting distribution assigns the probability to each element and assigns the probability to every element .
Extension of a distribution to with zero support on
#extend_leftGiven a probability distribution on a finite set and another set , we define a new probability distribution on the disjoint union . For any element , the probability mass is assigned as follows: - If , the value is . - If , the value is .
The set of probability distributions on a finite set is `Mixable` into
#instMixableLet be a finite set. The type of probability distributions on is a `Mixable` type into the function space . For any two distributions and non-negative real numbers with , their convex mixture is also a probability distribution on . This is established by utilizing the fact that the subspace of functions whose values sum to is convex within the vector space of real-valued functions on .
Relabeling of a probability distribution via
#relabelGiven a probability distribution on a finite set and an equivalence (bijection) from another set to , the function returns a new probability distribution on . For any element , the probability assigned is defined by . The sum of these values over is equal to 1 because is a bijection, ensuring the result is a valid probability distribution.
Equivalence of probability distributions induced by
#congrGiven an equivalence (bijection) between two finite sets and , there exists an induced equivalence between the sets of probability distributions and . Specifically, a distribution is mapped to a distribution in by relabeling the elements according to the inverse bijection .
Valuation of Induced Probability Distribution
#congr_applyLet and be finite sets and be a bijection. For any probability distribution on and any element , the value of the induced distribution at is given by .
Let and be finite types and let be an equivalence (bijection) between them. Let 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 . That is, .
Bernoulli distribution with parameter on
#coinGiven a probability , the function `coin p` defines a probability distribution on the finite set (represented as `Fin 2`). The distribution assigns the probability to the element and the probability to the element .
The probability of outcome in is
#coin_val_zeroLet be a probability. For the Bernoulli distribution defined on the set , the probability assigned to the outcome is equal to , i.e., .
ProbDistribution.coin_val_one
#coin_val_one(p : Prob) : coin p 1 = 1 - p
Every distribution on is a coin distribution uniquely determined by
#fin_two_eq_coinLet be a probability distribution on the finite set . Then is equal to the coin distribution uniquely determined by the probability assigned to the first element, . That is, , where is the distribution on assigning probability to and to .
`coin p = f` if and only if `p = f 0`
#coin_eq_iffLet be a probability distribution on the finite set (represented by the type `Fin 2`), and let be a probability. The distribution is equal to the coin distribution parameterised by (denoted as `coin p`) if and only if the probability assigns to the element is equal to .
Functor instance for
#instFunctorFor a finite set , let be the type of random variables (probability distributions) over . The functor instance for defines the mapping operation such that for any function and a random variable represented by a pair , the mapped random variable is given by .
`RandVar α` is a Lawful Functor
#instLawfulFunctorThe functor instance for the type of random variables `RandVar α` (defined as probability distributions over a finite set ) is a lawful functor. This means it satisfies the functor laws: it preserves identity morphisms, , and it is compositional, .
Expectation value of a random variable
#expect_valLet be a finite set and 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 over with values in —where consists of a probability distribution on and a mapping —the expectation value is defined as the convex combination of the values of weighted by the distribution : The definition ensures that because and , the resulting sum remains within the set .
Expectation over `Fin 2` is a Binary Mix with Weight
#expect_val_eq_mixable_mixLet be a probability distribution on the finite set (represented by `Fin 2`). Let be elements of a type that is `Mixable`. Let be a random variable mapping and (denoted by the matrix notation ). Then the expectation value of with respect to is equal to the convex combination (mix) of and weighted by the probability , such that .
Expectation Value of a Constant Distribution at is
#expect_val_constantLet be a finite set and be a type (typically representing a vector space or a mixable space). For any element and any random variable , the expectation value of with respect to the constant probability distribution at —denoted by , which assigns probability 1 to and 0 otherwise—is equal to .
Non-negativity of the expectation value for non-negative random variables
#zero_le_expect_valLet be a finite type and be a probability distribution on . Let be a real-valued random variable such that is non-negative, i.e., for all . Then the expectation value of with respect to , denoted by , is also non-negative, satisfying .
Equivalence of random variables induced by
#congrRandVarGiven an equivalence between two finite sets, there exists an induced equivalence between the types of -valued random variables and . Specifically, a random variable on is mapped to a random variable on whose outcome function is and whose probability distribution is the push-forward of along .
Mapping over a random variable commutes with equivalence-based reindexing:
#map_congr_eq_congr_mapLet and be finite sets and be types. Given an equivalence (bijection) , a random variable , and a function , the operation of mapping over the random variable commutes with the reindexing of the random variable by . That is, , where denotes the functorial map (fmap) and `congrRandVar` denotes the change of variables via the equivalence.
Expectation value is invariant under equivalence of random variables:
#expect_val_congr_eq_expect_valLet and be finite sets and be a type. Given an equivalence (bijection) and a -valued random variable defined on , the expectation value of the random variable induced on via (denoted by ) is equal to the expectation value of the original random variable . That is, .
