Sample entropy (Definition 14.2.1)
DefinitionWildeQIT_sampleEntropyclassical-informationinformation-theorytypicalitywilde-qit
Throughout Chapter 14 an information source emits independent, identically distributed copies of a random variable with distribution on a finite alphabet ; a realization is a sequence (Lean: Fin n → α), with . Entropies are in bits.
Definition 14.2.1 (Sample entropy). The sample entropy of a sequence with respect to a probability distribution is
The sample entropy is the empirical counterpart of : by the law of large numbers it concentrates around , which is the origin of typicality.
Formalization Note. WildeQIT.sampleEntropy p x = -(1/n) * Real.logb 2 ((p.iid n).prob x); for Lean's makes it , and for a sequence of probability the value is (Real.logb 2 0 = 0) rather than .
Definition code
import Definitions.Def_WildeQIT_iid
import Definitions.Def_WildeQIT_entropy
/-!
Wilde, *Quantum Information Theory* (2nd ed.), Definition 14.2.1 (Sample entropy):
`H̄(xⁿ) ≡ -(1/n) log p_{Xⁿ}(xⁿ)`, where `p_{Xⁿ}(xⁿ) = ∏ᵢ p_X(xᵢ)`; logarithm base 2.
-/
namespace WildeQIT
/-- Definition 14.2.1. The sample entropy of the sequence `x` with respect to `p`:
`H̄(x) = -(1/n) log₂ (∏ᵢ p(xᵢ))`. -/
noncomputable def sampleEntropy {α : Type} [Fintype α] (p : FinDist α) {n : ℕ} (x : Fin n → α) : ℝ :=
-(1 / (n : ℝ)) * Real.logb 2 ((p.iid n).prob x)
end WildeQIT
Source
Wilde, Quantum Information Theory 2nd ed. (Cambridge 2017; arXiv:1106.1445v8), Definition 14.2.1, §Weak Typicality (roster-items.csv line 25003).