Binary entropy function (Definition 10.1.2)
DefinitionWildeQIT_binaryEntropyDefinition 10.1.2 (Binary entropy). The binary entropy of is
with the logarithm taken base and the convention , so that .
The binary entropy is the entropy of a Bernoulli random variable with parameter ; it is the function that appears in Fano's inequality (Theorem 10.7.3), in the Zhang–Audenaert continuity bound (Theorem 10.7.4), and throughout the rate expressions of classical and quantum Shannon theory.
Formalization Note. WildeQIT.binaryEntropy p is defined for every real by the same formula, , using Real.logb 2. Since Mathlib sets Real.logb 2 0 = 0, the endpoint values hold automatically; outside the formula returns a real number that carries no meaning (Mathlib's Real.log of a negative number is the log of its absolute value). Statements that use carry the hypothesis where it matters.
import Mathlib.Analysis.SpecialFunctions.Log.Base /-! Wilde, *Quantum Information Theory* (2nd ed.), Definition 10.1.2 (Binary entropy): `h₂(p) ≡ -p log p - (1-p) log(1-p)` for `p ∈ [0,1]`, logarithm base 2. -/ namespace WildeQIT /-- Definition 10.1.2. The binary entropy function `h₂(p) = -p log₂ p - (1-p) log₂ (1-p)`. Defined for every real `p` (Wilde: `p ∈ [0,1]`); at `p = 0` and `p = 1` the convention `0 log 0 = 0` is automatic since `Real.logb 2 0 = 0`. -/ noncomputable def binaryEntropy (p : ℝ) : ℝ := -(p * Real.logb 2 p) - (1 - p) * Real.logb 2 (1 - p) end WildeQIT