PhyslibSearch

QuantumInfo.ClassicalInfo.Prob

77 declarations

definition

The type of probabilities p[0,1]p \in [0, 1]

#Prob

`Prob` is the type of real numbers pRp \in \mathbb{R} such that 0p10 \le p \le 1. It is defined as a subtype of the real numbers consisting of all elements in the closed unit interval [0,1][0, 1].

instance

Coercion from `Prob` to R\mathbb{R}

#instCoeReal

There is a natural coercion from the type of probabilities `Prob` (the unit interval [0,1][0, 1]) to the real numbers R\mathbb{R}, which maps a probability pp to its underlying real value.

instance

Real numbers in [0,1][0, 1] can be lifted to `Prob`

#canLift

Any real number rr such that 0r10 \le r \le 1 can be lifted to (or identified as) an element of the type `Prob`. Here, `Prob` represents the subtype of real numbers in the unit interval [0,1][0, 1].

instance

The value 00 as a probability p[0,1]p \in [0, 1]

#instZero

The type `Prob`, representing real numbers in the interval [0,1][0, 1], has an additive identity element (zero), defined as the real number 00.

instance

The value 11 as a probability p[0,1]p \in [0, 1]

#instOne

The type `Prob`, representing real numbers in the unit interval [0,1][0, 1], has a multiplicative identity element (one), defined as the real number 11.

instance

Multiplication of probabilities in [0,1][0, 1]

#instMul

The multiplication operation on the type `Prob` (the closed interval [0,1]R[0, 1] \subseteq \mathbb{R}) is defined by the multiplication of the underlying real numbers. For any two probabilities p,q[0,1]p, q \in [0, 1], their product pqp \cdot q is also in the interval [0,1][0, 1].

theorem

The value of 0Prob0 \in \text{Prob} is 00

#coe_zero

Let Prob\text{Prob} be the type representing real numbers in the interval [0,1][0, 1]. The numerical value of the probability constant 0Prob0 \in \text{Prob} is equal to the real number 00.

theorem

(1:Prob).val=1(1 : \text{Prob}).\text{val} = 1

#coe_one

The numerical value of the identity element 11 in the type Prob\text{Prob} is equal to the real number 11. Here, Prob\text{Prob} represents the interval [0,1]R[0, 1] \subseteq \mathbb{R}, and val\text{val} denotes the mapping from Prob\text{Prob} to the real numbers.

theorem

(xy).val=x.valy.val(x \cdot y).\text{val} = x.\text{val} \cdot y.\text{val}

#coe_mul

For any two probability values x,yProbx, y \in \text{Prob}, the numerical value of their product is equal to the product of their individual numerical values, یعنی (xy).val=x.valy.val(x \cdot y).\text{val} = x.\text{val} \cdot y.\text{val}. Here, Prob\text{Prob} denotes the interval [0,1]R[0, 1] \subseteq \mathbb{R}.

theorem

(xy).val=x.valy.val(x \sqcap y).\text{val} = x.\text{val} \sqcap y.\text{val}

#coe_inf

For any two probabilities x,yProbx, y \in \text{Prob}, the numerical value of their infimum (minimum) is equal to the infimum of their individual numerical values, expressed as (xy).val=x.valy.val(x \sqcap y).\text{val} = x.\text{val} \sqcap y.\text{val}. Here, Prob\text{Prob} is the type of real numbers in the interval [0,1][0, 1], and val\text{val} denotes the coercion or map from Prob\text{Prob} to the real numbers R\mathbb{R}.

theorem

(xy).val=x.valy.val(x \sqcup y).\text{val} = x.val \sqcup y.val

#coe_sup

For any two probabilities x,yProbx, y \in \text{Prob}, the numerical value of their supremum (maximum) is equal to the supremum of their individual numerical values, which is expressed as (xy).val=x.valy.val(x \sqcup y).\text{val} = x.\text{val} \sqcup y.\text{val}. Here, Prob\text{Prob} denotes the type of real numbers in the interval [0,1][0, 1], and val\text{val} represents the coercion or map from Prob\text{Prob} to the real numbers R\mathbb{R}.

instance

The interval [0,1][0, 1] is a commutative monoid with zero under multiplication

#instCommMonoidWithZero

The type Prob\text{Prob}, representing the interval [0,1]R[0, 1] \subseteq \mathbb{R}, forms a commutative monoid with zero under multiplication. Specifically, this structure provides: 1. An identity element 1[0,1]1 \in [0, 1]. 2. A zero element 0[0,1]0 \in [0, 1]. 3. A multiplication operation that is associative (a(bc)=(ab)ca \cdot (b \cdot c) = (a \cdot b) \cdot c), commutative (ab=baa \cdot b = b \cdot a), satisfies identity laws (1a=a1 \cdot a = a), and acts as an annihilator for zero (0a=00 \cdot a = 0).

instance

The interval [0,1][0, 1] is Densely Ordered

#instDenselyOrdered

The type `Prob`, representing the closed unit interval [0,1]R[0, 1] \subseteq \mathbb{R}, is a densely ordered set. This means that for any two probabilities p,qProbp, q \in \text{Prob} such that p<qp < q, there exists a probability rProbr \in \text{Prob} such that p<r<qp < r < q.

instance

Complete linear order structure of `Prob`

#instCompleteLinearOrder

The type `Prob`, representing the interval [0,1]R[0, 1] \subseteq \mathbb{R}, forms a complete linear order. This means that for every subset SProbS \subseteq \text{Prob}, there exists a supremum supS\sup S and an infimum infS\inf S within the interval [0,1][0, 1]. Furthermore, for any two elements p,qProbp, q \in \text{Prob}, the relation pqp \le q or qpq \le p always holds, consistent with the standard ordering of real numbers.

instance

Default probability 0Prob0 \in \text{Prob}

#instInhabited

The type `Prob`, representing real numbers in the unit interval [0,1][0, 1], is provided with a default element, which is the probability 00.

instance

Linear ordered commutative monoid with zero structure of `Prob`

#instLinearOrderedCommMonoidWithZero

The type `Prob`, representing real numbers in the unit interval [0,1][0, 1], forms a linearly ordered commutative monoid with zero. This structure inherits the standard multiplication from real numbers as the monoid operation, ensuring that for any a,b,c[0,1]a, b, c \in [0, 1], if a<ba < b and 0<c0 < c, then ca<cbca < cb. The order is the standard \le relation on the real numbers restricted to the interval [0,1][0, 1], where the zero element 00 is the least element.

theorem

0p0 \le p for any pProbp \in \text{Prob}

#zero_le_coe

For any probability pProbp \in \text{Prob}, where Prob\text{Prob} denotes the set of real numbers in the unit interval [0,1][0, 1], its representation as a real number satisfies 0p0 \le p.

theorem

p1p \leq 1 for any pProbp \in \text{Prob}

#coe_le_one

For any probability pProbp \in \text{Prob}, its representation as a real number satisfies p1p \leq 1.

theorem

0p0 \leq p for any pProbp \in \text{Prob}

#zero_le

For any probability pp in the interval [0,1][0, 1], it holds that 0p0 \leq p.

theorem

p1p \leq 1 for any pProbp \in \text{Prob}

#le_one

Let pp be an element of the type `Prob`, which represents the interval of real numbers [0,1][0, 1]. Then pp is less than or equal to 11, i.e., p1p \leq 1.

theorem

The equality of probabilities is determined by the equality of their real values

#ext

For any two probabilities n,m[0,1]n, m \in [0, 1], if their underlying real-number representations are equal, then nn and mm are equal as elements of the `Prob` type.

theorem

xyx \neq y as real numbers     xy\iff x \neq y as probabilities

#ne_iff

Let xx and yy be probabilities in the unit interval [0,1][0, 1]. The underlying real numbers represented by xx and yy are unequal if and only if xx and yy are unequal as elements of the type `Prob`.

theorem

(xy)R=xRyR(x \cdot y)_{\mathbb{R}} = x_{\mathbb{R}} \cdot y_{\mathbb{R}} for x,y[0,1]x, y \in [0, 1]

#toReal_mul

Let xx and yy be elements of the type `Prob`, which represents real numbers in the closed interval [0,1][0, 1]. The real value of the product of xx and yy within the `Prob` type is equal to the product of their corresponding real values: (xy)R=xRyR(x \cdot y)_{\mathbb{R}} = x_{\mathbb{R}} \cdot y_{\mathbb{R}}.

definition

Coercion of a probability p[0,1]p \in [0, 1] to a non-negative real R0\mathbb{R}_{\ge 0}

#toNNReal

Let `Prob` denote the type of real numbers in the interval [0,1][0, 1]. The function `toNNReal` maps an element p[0,1]p \in [0, 1] to its corresponding value in the set of non-negative real numbers R0\mathbb{R}_{\ge 0}. Specifically, for p=(x,0x1)p = (x, 0 \le x \le 1), the function returns the non-negative real number xx.

theorem

The Value of `toNNReal` for a Probability xx is xx viewed as a Non-negative Real

#toNNReal_mk

Let xx be a real number and hxh_x be the proof that 0x10 \le x \le 1. For the probability value p={val:=x,property:=hx}p = \{ \text{val} := x, \text{property} := h_x \} in the interval [0,1][0, 1], its conversion to a non-negative real number (R0\mathbb{R}_{\ge 0}) is equal to the non-negative real number {val:=x,property:=x0}\{ \text{val} := x, \text{property} := x \ge 0 \}. In other words, the mapping from `Prob` to `NNReal` preserves the underlying value xx while simplifying the property constraint from 0x10 \le x \le 1 to x0x \ge 0.

instance

Coercion from `Prob` to R0\mathbb{R}_{\ge 0}

#instCoeNNReal

There exists a natural coercion from the type of probabilities `Prob` (the interval [0,1][0, 1]) to the type of non-negative real numbers R0\mathbb{R}_{\ge 0}, defined by mapping each probability pp to its underlying value in R0\mathbb{R}_{\ge 0}.

instance

Condition for Lifting R0\mathbb{R}_{\geq 0} to `Prob` is r1r \leq 1

#canLiftNN

A non-negative real number rR0r \in \mathbb{R}_{\geq 0} can be lifted to the type of probabilities `Prob` (the interval [0,1][0, 1]) if and only if r1r \leq 1. Here, the lifting is defined relative to the coercion (or projection) `toNNReal` from `Prob` to R0\mathbb{R}_{\geq 0}.

theorem

The `toNNReal` map sends 00 to 00

#toNNReal_zero

The representation of the probability 0[0,1]0 \in [0, 1] as a non-negative real number is equal to 0R00 \in \mathbb{R}_{\geq 0}.

theorem

The probability 11 equals 11 in R0\mathbb{R}_{\ge 0}

#toNNReal_one

The representation of the probability 1[0,1]1 \in [0, 1] as a non-negative real number is equal to the non-negative real number 1R01 \in \mathbb{R}_{\ge 0}.

theorem

The extended non-negative real representation of a probability pp is consistent across R0\mathbb{R}_{\ge 0} and R\mathbb{R} pathways.

#ofNNReal_toNNReal

For any probability p[0,1]p \in [0, 1], let toNNReal(p)\text{toNNReal}(p) be its representation as a non-negative real number. The conversion of this non-negative real value to an extended non-negative real number (R0\overline{\mathbb{R}}_{\ge 0}) is equal to the conversion of the probability pp, viewed as a real number, directly to an extended non-negative real number. That is, ENNReal.ofNNReal(toNNReal(p))=ENNReal.ofReal(p)\text{ENNReal.ofNNReal}(\text{toNNReal}(p)) = \text{ENNReal.ofReal}(p).

definition

Construction of a probability from pR0p \in \mathbb{R}_{\geq 0} where p1p \leq 1

#asProb

Given a non-negative real number pR0p \in \mathbb{R}_{\geq 0} and a proof hphp that p1p \leq 1, this function constructs an element of the type `Prob`, representing the value pp as a probability in the closed interval [0,1]R[0, 1] \subset \mathbb{R}.

definition

Construction of pProbp \in \text{Prob} from pR0p \in \mathbb{R}_{\geq 0} such that p1p \leq 1

#asProb'

Given a non-negative real number pR0p \in \mathbb{R}_{\geq 0} and a condition hphp that its underlying value (as a real number) is less than or equal to 11, this function constructs an element of the type `Prob`. This represents the value pp as a probability within the closed interval [0,1][0, 1].

theorem

If p0p \neq 0 for pProbp \in \text{Prob}, then 0<p0 < p

#zero_lt_coe

Let pp be a probability, defined as a real number in the interval [0,1]R[0, 1] \subset \mathbb{R}. If pp is not equal to 00, then pp is strictly greater than 00 when treated as a real number.

instance

Truncated subtraction on `Prob`

#instSub

Subtraction on the type `Prob` (the set of real numbers in the unit interval [0,1][0, 1]) is defined for any two probabilities p,q[0,1]p, q \in [0, 1] as pq=max(pq,0)p - q = \max(p - q, 0). This operation ensures the result remains within the interval [0,1][0, 1] by truncating negative results to 00.

theorem

The real value of pqp - q for probabilities p,qp, q is (pq)0(p - q) \sqcup 0

#coe_sub

Let pp and qq be probabilities, represented as real numbers in the interval [0,1][0, 1]. The real value of the difference pqp - q (defined within the space of probabilities) is equal to the maximum of pqp - q and 00 in the real numbers, denoted as (pq)0(p - q) \sqcup 0.

theorem

The real value of 1p1 - p for a probability pp is 1pR1 - p_{\mathbb{R}}

#coe_one_minus

Let pp be a probability, defined as a real number in the interval [0,1][0, 1]. Then the real-valued representation of the complement 1p1 - p (where subtraction is defined within the space of probabilities) is equal to 1p1 - p calculated in the real numbers R\mathbb{R}.

theorem

p+(1p)=1p + (1 - p) = 1 for any probability pp

#add_one_minus

Let pp be a probability, defined as a real number in the unit interval [0,1][0, 1]. Let p.valp.val denote its representation as a real number R\mathbb{R}. Then the sum of pp and its complement 1p1 - p (where subtraction is defined within the space of probabilities) satisfies p.val+(1p).val=1p.val + (1 - p).val = 1.

theorem

1(1p)=p1 - (1 - p) = p for any probability pp

#one_minus_inv

Let pp be a probability, defined as a real number in the interval [0,1][0, 1]. Then the complement of its complement is itself, i.e., 1(1p)=p1 - (1 - p) = p, where the subtraction is defined within the space of probabilities.

instance

The type of probabilities `Prob` has an Order Topology

#instOrderTopology

The type `Prob`, representing the interval [0,1]R[0, 1] \subseteq \mathbb{R}, is equipped with the order topology. This means the topology on `Prob` is generated by the open intervals (a,b)(a, b), [0,a)[0, a), and (a,1](a, 1] for all a,bProba, b \in \text{Prob}.

theorem

The infimum in Prob\text{Prob} commutes with the coercion to R\mathbb{R}

#coe_iInf

Let Prob\text{Prob} be the type of probabilities represented by the closed unit interval [0,1]R[0, 1] \subseteq \mathbb{R}. For any non-empty index type ι\iota and any function f:ιProbf: \iota \to \text{Prob}, the coercion of the infimum of ff in Prob\text{Prob} to the real numbers is equal to the infimum of the coerced values in R\mathbb{R}. That is, (inftιf(t))R=inftι(f(t)R) \left( \inf_{t \in \iota} f(t) \right)_{\mathbb{R}} = \inf_{t \in \iota} (f(t)_{\mathbb{R}}) where ()R(\cdot)_{\mathbb{R}} denotes the natural embedding from [0,1][0, 1] into R\mathbb{R}.

instance

The type of probabilities `Prob` is nontrivial (Prob\text{Prob} is nontrivial)

#instNontrivial

The type `Prob`, which represents the closed interval [0,1]R[0, 1] \subseteq \mathbb{R}, is nontrivial. That is, it contains at least two distinct elements. Specifically, since `Prob` possesses both a zero element (00) and a one element (11) as defined by its instances, this theorem implies 010 \neq 1 within the space of probabilities.

theorem

=1\top = 1 in Prob\text{Prob}

#top_eq_one

In the space of probabilities Prob\text{Prob} (defined as the interval [0,1]R[0, 1] \subset \mathbb{R}), the greatest element \top under the canonical linear order is equal to 11.

theorem

p0=pp - 0 = p for any pProbp \in \text{Prob}

#sub_zero

For any probability p[0,1]p \in [0, 1], subtracting the zero probability from pp results in pp itself, where the subtraction on the type `Prob` is defined such that for p,q[0,1]p, q \in [0, 1], pq=max(pvalqval,0)p - q = \max(p_{val} - q_{val}, 0).

theorem

The Map from `Prob` to R0\mathbb{R}_{\ge 0} is Continuous

#toNNReal_Continuous

The function toNNReal:ProbR0\text{toNNReal} : \text{Prob} \to \mathbb{R}_{\ge 0}, which maps a probability pp (a real number in the interval [0,1][0, 1]) to its representation as a non-negative real number, is a continuous function.

theorem

pq=1    p=1 and q=1p \cdot q = 1 \iff p = 1 \text{ and } q = 1 for p,q[0,1]p, q \in [0, 1]

#mul_eq_one_iff

Let pp and qq be probabilities, defined as real numbers in the interval [0,1][0, 1]. Then the product pqp \cdot q is equal to 11 if and only if both p=1p = 1 and q=1q = 1.

definition

Convex combination of x1,x2Tx_1, x_2 \in T with weights a,ba, b where a+b=1a+b=1

#mix_ab

Given a type TT that satisfies the `Mixable` property relative to a type UU, for any two elements x1,x2Tx_1, x_2 \in T and any real numbers a,bRa, b \in \mathbb{R} such that a0a \ge 0, b0b \ge 0, and a+b=1a + b = 1, the function mix_ab\text{mix\_ab} returns an element in TT representing the convex combination of x1x_1 and x2x_2 with weights aa and bb.

definition

Convex combination of x1,x2Tx_1, x_2 \in T with probability pp

#mix

Let TT be a type equipped with a `Mixable` instance and p[0,1]p \in [0, 1] be a probability. The function `Mixable.mix` defines the convex combination of two elements x1,x2Tx_1, x_2 \in T weighted by pp. Specifically, it is defined as the convex combination ax1+bx2a x_1 + b x_2 where a=pa = p and b=1pb = 1 - p, satisfying the conditions a,b0a, b \ge 0 and a+b=1a + b = 1.

theorem

to_U(mkT(u))=u\text{to\_U} (\text{mkT}(u)) = u

#to_U_of_mkT

Let TT be a type that is `Mixable` with respect to a type UU. For any element uUu \in U and a proof hh that uu satisfies the property required to be an element of TT, let (x,h)(x, h') be the result of the constructor mkT\text{mkT} applied to uu. Then, the mapping of xx back to the type UU via the `to_U` function is equal to the original element uu.

definition

Notation p[x1x2]p [x_1 \leftrightarrow x_2] for the convex combination `mix p x₁ x₂`

#term_[_↔_]

Let pp be an element of type `Prob` (representing a value in the interval [0,1][0, 1]) and let x1,x2x_1, x_2 be elements of a type TT equipped with a `Mixable` instance. The notation p[x1x2]p [x_1 \leftrightarrow x_2] denotes the convex combination of x1x_1 and x2x_2 weighted by pp, which is defined as `mix p x₁ x₂`. This corresponds to the mathematical expression px1+(1p)x2p x_1 + (1 - p) x_2.

definition

Notation for Convex Mix p[x1x2:M]p[x_1 \leftrightarrow x_2 : M]

#term_[_↔_:_]

This definition introduces a notation for the convex combination (mixing) of two elements x1x_1 and x2x_2 in a type equipped with a `Mixable` instance MM. Given a probability p[0,1]p \in [0, 1], the expression p[x1x2:M]p[x_1 \leftrightarrow x_2 : M] represents the result px1+(1p)x2p \cdot x_1 + (1 - p) \cdot x_2 as defined by the mixing operation in MM.

theorem

The convex combination of x1,x2x_1, x_2 with p=0p=0 is x2x_2

#mix_zero

Let TT be a type equipped with a `Mixable` instance. For any two elements x1,x2Tx_1, x_2 \in T, the convex combination of x1x_1 and x2x_2 with probability 00 is equal to x2x_2. That is, 0x1+(10)x2=x20 \cdot x_1 + (1 - 0) \cdot x_2 = x_2.

instance

`Mixable` instance for a real module TT over itself

#instUniv

Let TT be an additive commutative monoid that is also a module over the real numbers R\mathbb{R}. There exists an instance of the `Mixable` typeclass for TT where the underlying vector space representation of an element is the element itself (via the identity map). In this instance, the set of representable elements is the entire space TT, which is convex. For any two elements x1,x2Tx_1, x_2 \in T and a probability p[0,1]p \in [0, 1], the mixing operation is defined as the convex combination px1+(1p)x2p \cdot x_1 + (1 - p) \cdot x_2.

theorem

Construction of `Mixable` elements in the universal instance `instUniv` for a real module TT equals t,rfl\langle t, \text{rfl} \rangle

#mkT_instUniv

Let TT be an additive commutative monoid that is also a module over the real numbers R\mathbb{R}. For any element tTt \in T, if there exists an element tt' in the subtype defined by the universal `Mixable` instance such that its representation in the vector space is tt, then the result of constructing an element of the `Mixable` type from this witness hh is simply the pair consisting of tt and the trivial proof of its representation.

theorem

The representation to_U\text{to\_U} for `instUniv` is the identity map

#to_U_instUniv

Let TT be an additive commutative monoid that is also a module over the real numbers R\mathbb{R}. For the `Mixable` instance where TT represents itself (via `instUniv`), the underlying vector space representation to_U\text{to\_U} of any element tTt \in T is equal to the element tt itself.

theorem

Pointwise Existence of Pre-images in Product Mixable Types

#lem_1

Let DD be a type, and for each iDi \in D, let TiT_i and UiU_i be types such that UiU_i is a real vector space (specifically, an additive commutative monoid and a module over R\mathbb{R}) and there is a `Mixable` instance between UiU_i and TiT_i. Let uu be a dependent function mapping each iDi \in D to an element u(i)Uiu(i) \in U_i. If there exists a dependent function tt mapping each iDi \in D to an element t(i)Tit(i) \in T_i such that the projection of t(i)t(i) to the universal type UiU_i (denoted to_U(t(i))\text{to\_U}(t(i))) equals u(i)u(i) for all ii, then for any specific dDd \in D, there exists an element tdTdt_d \in T_d such that to_U(td)=u(d)\text{to\_U}(t_d) = u(d).

instance

Pointwise `Mixable` instance for Pi types iDTi\prod_{i \in D} T_i into iDUi\prod_{i \in D} U_i

#instPi

Let DD be an index set, and for each iDi \in D, let TiT_i and UiU_i be types such that UiU_i is a real vector space (specifically, an additive commutative monoid and an R\mathbb{R}-module) and TiT_i is "mixable" into UiU_i. The definition provides a `Mixable` instance for the product types (Pi types), mapping the dependent function type iDTi\prod_{i \in D} T_i into the function space iDUi\prod_{i \in D} U_i. Specifically, the mapping to_Uto\_U is defined pointwise by (to_Uf)(d)=to_U(f(d))(to\_U f)(d) = to\_U(f(d)). Under this mapping, the image of Ti\prod T_i in Ui\prod U_i is shown to be convex, meaning that for any f1,f2Tif_1, f_2 \in \prod T_i and any probabilities a,b0a, b \ge 0 with a+b=1a + b = 1, the convex combination ato_U(f1)+bto_U(f2)a \cdot to\_U(f_1) + b \cdot to\_U(f_2) corresponds to an element in the product of the mixable types.

theorem

Pointwise evaluation of lifted functions in `Mixable` function spaces

#val_mkT_instPi

Let TT and UU be types such that TT is mixable into UU (denoted by the instance `Mixable U T`), where UU is a real vector space. Consider the function space DUD \to U for some type DD, which inherits a mixable structure from the pointwise mixability of UU. For any function u:DUu: D \to U that is in the image of the mapping from DTD \to T (i.e., there exists some t:DTt: D \to T such that to_Ut=uto\_U \circ t = u), let mkT(h)mkT(h) denote the lifting of uu to the subtype of mixable elements in the function space. Then, for every dDd \in D, the value of this lifted function at dd is equal to the result of lifting the local value u(d)u(d) to TT using the pointwise mixability instance.

theorem

The Map to UU for Functions is Defined Pointwise

#to_U_instPi

Let DD be a type, and let TT and UU be types such that TT is mixable into UU (via an instance of the `Mixable` typeclass). For any function t:DTt: D \to T, the representation of tt in the function space DUD \to U is given by the pointwise application of the representation map to each value t(d)t(d). That is, (to_UinstPit)(d)=to_Uinst(t(d))(\text{to\_U}_{\text{instPi}} \, t)(d) = \text{to\_U}_{\text{inst}}(t(d)) for all dDd \in D.

definition

Subtype of a `Mixable` type is `Mixable` if the predicate PP is closed under convex combinations

#instSubtype

Let UU be a type and TT be a type that is `Mixable` into UU. Let P:TPropP: T \to \text{Prop} be a predicate on TT. If the subset defined by PP is convex under the mixing operation of TT—that is, for any x,yTx, y \in T such that P(x)P(x) and P(y)P(y) hold, and for any non-negative real numbers a,bRa, b \in \mathbb{R} with a+b=1a + b = 1, the convex combination mix_ab(a,b,x,y)\text{mix\_ab}(a, b, x, y) also satisfies PP—then the subtype {tTP(t)}\{t \in T \mid P(t)\} is also `Mixable` into UU. The `Mixable` structure on the subtype is inherited from TT, where the representation in UU is given by the composition of the subtype inclusion and the original mapping from TT to UU.

instance

`Prob` is `Mixable` over R\mathbb{R}

#instMixable

The type `Prob`, representing real numbers in the interval [0,1][0, 1], is equipped with an instance of the `Mixable` typeclass over the real numbers R\mathbb{R}. This is defined by taking the underlying real value of a probability (the inclusion map into R\mathbb{R}), ensuring this mapping is injective via the extensionality of probabilities, and proving that the set [0,1][0, 1] is convex. Specifically, for any x,y[0,1]x, y \in [0, 1] and non-negative a,bRa, b \in \mathbb{R} such that a+b=1a + b = 1, the convex combination ax+byax + by also belongs to [0,1][0, 1].

theorem

`Mixable.to_U` of tt \in `Prob` equals t.valt.\text{val}

#to_U_mixable

Let `Prob` denote the type of real numbers in the interval [0,1][0, 1]. For any element tProbt \in \text{Prob}, the value obtained by applying the `Mixable.to_U` projection (associated with the `Mixable` instance for real numbers) to tt is equal to the underlying real value t.valt.\text{val}.

theorem

Mixable.mkT\text{Mixable.mkT} for ProbProb preserves the underlying value uu

#mkT_mixable

Let ProbProb be the type of real numbers in the interval [0,1][0, 1]. For any uRu \in \mathbb{R}, if there exists a probability tProbt \in Prob such that its underlying value Mixable.to_U(t)\text{Mixable.to\_U}(t) is equal to uu, then the constructed mixable element Mixable.mkT(h)\text{Mixable.mkT}(h) (where hh is the proof of existence) is equal to a term whose value is uu and whose membership proof in the interval [0,1][0, 1] is derived from tt.

abbrev

Convex combination of x1,x2Tx_1, x_2 \in T weighted by probability pp

#mix

Let ProbProb be the type of real numbers in the interval [0,1][0, 1]. For a type TT that satisfies the `Mixable` property with respect to a real vector space UU, the function `Prob.mix` takes a probability p[0,1]p \in [0, 1] and two elements x1,x2Tx_1, x_2 \in T, and returns their convex combination, denoted as px1+(1p)x2p \cdot x_1 + (1 - p) \cdot x_2. This is an alias for `Mixable.mix` provided to enable dot notation on probability values.

definition

Negative logarithm of a probability p[0,1]p \in [0, 1] as an extended non-negative real R0\overline{\mathbb{R}}_{\geq 0}

#negLog

Let ProbProb be the type of real numbers in the interval [0,1][0, 1]. The function `negLog` maps a probability p[0,1]p \in [0, 1] to an extended non-negative real number R0\overline{\mathbb{R}}_{\geq 0} defined by: \[ \text{negLog}(p) = \begin{cases} \infty & \text{if } p = 0 \\ -\log(p) & \text{if } p > 0 \end{cases} \] where log\log denotes the natural logarithm. For p>0p > 0, since p(0,1]p \in (0, 1], the value log(p)-\log(p) is guaranteed to be non-negative, allowing it to be cast into the extended non-negative real numbers.

definition

Notation `—log` for the negative logarithm of a probability

#term—log

A scoped notation used within the `Prob` namespace where the prefix symbol `—log` denotes the negative logarithm function `negLog`, which maps a probability p[0,1]p \in [0, 1] to its corresponding value in the extended non-negative real numbers R0\overline{\mathbb{R}}_{\geq 0}.

theorem

The negative logarithm of a probability is antitone

#negLog_Antitone

The function log:ProbR0-\log : \text{Prob} \to \overline{\mathbb{R}}_{\ge 0}, which assigns a probability p[0,1]p \in [0, 1] to its negative logarithm (information content) in the extended non-negative real numbers, is antitone. That is, for any probabilities p,q[0,1]p, q \in [0, 1], if pqp \le q, then log(p)log(q)-\log(p) \ge -\log(q).

theorem

log(0)=-\log(0) = \infty

#negLog_zero

The negative logarithm of the probability 00 is equal to infinity (\infty), where the probability is treated as an element of the closed unit interval [0,1][0, 1] and the result is in the extended non-negative real numbers R0\overline{\mathbb{R}}_{\ge 0}.

theorem

log1=0-\log 1 = 0 for probabilities

#negLog_one

The negative logarithm of the probability 1[0,1]1 \in [0, 1] is equal to 00. Let negLog\text{negLog} be the function mapping a probability p[0,1]p \in [0, 1] to the extended non-negative real numbers R0\overline{\mathbb{R}}_{\geq 0}, then negLog(1)=0\text{negLog}(1) = 0.

theorem

logp=    p=0-\log p = \infty \iff p = 0

#negLog_eq_top_iff

For any probability p[0,1]p \in [0, 1], the negative logarithm logp-\log p is equal to \infty (top) if and only if p=0p = 0.

theorem

Calculation of logp-\log p for p0p \neq 0 as an extended non-negative real number

#negLog_pos_ENNReal

Let pp be a probability, defined as a real number in the interval [0,1][0, 1]. If p0p \neq 0, then the negative logarithm of pp, denoted as logp-\log p and taking values in the extended non-negative real numbers R0\overline{\mathbb{R}}_{\ge 0}, is equal to the non-negative real number lnp-\ln p (where ln\ln is the natural logarithm).

theorem

The real part of —log p\text{—log } p equals logp-\log p

#negLog_pos_Real

Let p[0,1]p \in [0, 1] be a probability. The real-valued part of its negative logarithm in the extended non-negative real numbers, denoted as (—log p).toReal(\text{—log } p).\text{toReal}, is equal to the negative of the natural logarithm of pp, denoted as logp-\log p.

theorem

pexp \le e^{-x} implies xlogpx \le —\log p

#le_negLog_of_le_exp

Let pp be a probability, represented as a real number in the interval [0,1][0, 1]. For any real number xRx \in \mathbb{R}, if pexp \le e^{-x}, then the expression of xx as an extended non-negative real number is less than or equal to the negative logarithm of pp (denoted as logp—\log p).

theorem

The negative log of a positive probability p>0p > 0 is not infinite (\neq \infty).

#negLog_ne_top

Let pp be a probability, defined as a real number in the interval [0,1][0, 1], and let its value be denoted by p.valp.val. If p.val>0p.val > 0, then its negative logarithm (denoted as logp—\log p) is not equal to infinity (\infty) in the extended non-negative real numbers (R0\overline{\mathbb{R}}_{\geq 0}).

theorem

logp=ENNReal.log p-\log p = -\text{ENNReal.log } p for pProbp \in \text{Prob}

#negLog_eq_neg_ENNReal_log

For any probability p[0,1]p \in [0, 1], its negative logarithm logp-\log p (defined as an extended non-negative real internal to the `Prob` namespace) is equal to the negative of the logarithm of pp as defined for extended non-negative reals, denoted by ENNReal.log(p)-\text{ENNReal.log}(p).

theorem

logp=ofReal(logp)-\log p = \text{ofReal}(-\log p) for p>0p > 0

#negLog_eq_ofReal_neg_log

Let pp be a probability, defined as a real number in the interval [0,1][0, 1]. If p>0p > 0, then the negative logarithm of pp in the extended non-negative real numbers (denoted as logp-\log p) is equal to the representation of the real number log(p)-\log(p) in the extended non-negative real numbers via the map ENNReal.ofReal\text{ENNReal.ofReal}.

theorem

logp>0    p1-\log p > 0 \iff p \neq 1 for p[0,1]p \in [0, 1]

#zero_lt_negLog

For any probability p[0,1]p \in [0, 1], the negative logarithm of pp (denoted as logp-\log p) is strictly greater than 00 if and only if pp is not equal to 11. Here, the negative logarithm maps from the interval [0,1][0, 1] to the extended non-negative real numbers R0\overline{\mathbb{R}}_{\ge 0}.

theorem

The Negative Logarithm of a Probability is Continuous

#Continuous_negLog

The function log:ProbENNReal-\log : \text{Prob} \to \text{ENNReal}, which maps a probability p[0,1]p \in [0, 1] to its negative logarithm (information content) in the extended non-negative real numbers, is continuous.