Typical sequences and the typical set (Definitions 14.2.2–14.2.3)
DefinitionWildeQIT_typicalSetThroughout 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.IsTypicalSeq p δ x is the predicate and WildeQIT.typicalSet p n δ : Finset (Fin n → α) the set (a Finset.filter of all sequences); mem_typicalSet unfolds membership. A sequence of probability zero has sample entropy in the book and is never typical; because Lean's Real.logb 2 0 = 0 would give it sample entropy , the definition requires explicitly. This replaces the retired WildeQIT_weakTypicalSet, which lacked that condition.
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)| ≤ δ }`.
A sequence of probability zero has sample entropy `+∞` in the book and is never typical; since
Lean's `Real.logb 2 0 = 0` would give it sample entropy `0`, the definition requires
`p_{Xⁿ}(xⁿ) > 0` explicitly. (Replaces the retired `WildeQIT_weakTypicalSet`.)
-/
namespace WildeQIT
variable {α : Type} [Fintype α]
/-- Definition 14.2.2. `x` is a `δ`-typical sequence for the source `p`: it has positive
probability and `|H̄(x) − H(X)| ≤ δ`. -/
def IsTypicalSeq (p : FinDist α) (δ : ℝ) {n : ℕ} (x : Fin n → α) : Prop :=
0 < (p.iid n).prob x ∧ |sampleEntropy p x - entropy p| ≤ δ
/-- Definition 14.2.3. The `δ`-typical set `T_δ^{Xⁿ}` of length-`n` sequences. -/
noncomputable def typicalSet (p : FinDist α) (n : ℕ) (δ : ℝ) : Finset (Fin n → α) :=
Finset.univ.filter fun x => 0 < (p.iid n).prob x ∧ |sampleEntropy p x - entropy p| ≤ δ
theorem mem_typicalSet {p : FinDist α} {n : ℕ} {δ : ℝ} {x : Fin n → α} :
x ∈ typicalSet p n δ ↔ 0 < (p.iid n).prob x ∧ |sampleEntropy p x - entropy p| ≤ δ := by
simp only [typicalSet, Finset.mem_filter, Finset.mem_univ, true_and]
end WildeQIT