Typical sequences and the typical set (Definitions 14.2.2–14.2.3)
DefinitionWildeQIT_weakTypicalSetThroughout 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.2 (Typical sequence). A sequence is -typical if its sample entropy is -close to the entropy of the random variable that is the source of the sequence.
Definition 14.2.3 (Typical set). The -typical set is the set of all -typical sequences:
Formalization Note. WildeQIT.IsWeakTypical p δ x is the predicate and WildeQIT.weakTypicalSet p n δ : Finset (Fin n → α) the set (a Finset.filter of all sequences); mem_weakTypicalSet unfolds membership.
RETIRED (deprecated) 2026-09-07 03:35. This definition let sequences of probability zero be typical (their sample entropy is 0 under Lean's Real.logb 2 0 = 0, whereas the book's is +∞), so cardinality and equipartition properties stated with it are false. Replaced by WildeQIT_typicalSet (declarations WildeQIT.typicalSet, WildeQIT.IsTypicalSeq) which requires .
import Definitions.Def_WildeQIT_sampleEntropy
/-!
Wilde, *Quantum Information Theory* (2nd ed.), Definition 14.2.2 (Typical sequence) and
Definition 14.2.3 (Typical set): a sequence `xⁿ` is `δ`-typical if its sample entropy is
`δ`-close to `H(X)`; the `δ`-typical set is `T_δ^{Xⁿ} ≡ { xⁿ : |H̄(xⁿ) − H(X)| ≤ δ }`.
-/
namespace WildeQIT
variable {α : Type} [Fintype α]
/-- Definition 14.2.2. `x` is a `δ`-typical sequence for the source `p`: `|H̄(x) − H(X)| ≤ δ`. -/
def IsWeakTypical (p : FinDist α) (δ : ℝ) {n : ℕ} (x : Fin n → α) : Prop :=
|sampleEntropy p x - entropy p| ≤ δ
/-- Definition 14.2.3. The `δ`-typical set `T_δ^{Xⁿ}` of length-`n` sequences. -/
noncomputable def weakTypicalSet (p : FinDist α) (n : ℕ) (δ : ℝ) : Finset (Fin n → α) :=
Finset.univ.filter fun x => |sampleEntropy p x - entropy p| ≤ δ
theorem mem_weakTypicalSet {p : FinDist α} {n : ℕ} {δ : ℝ} {x : Fin n → α} :
x ∈ weakTypicalSet p n δ ↔ |sampleEntropy p x - entropy p| ≤ δ := by
simp [weakTypicalSet]
end WildeQIT