Documentation

TCSlib.CodingTheory.Entropy

Entropy and Asymptotic Bounds #

This file establishes asymptotic bounds relating Hamming ball sizes to the q-ary entropy function, and provides the key binomial coefficient lower bound used in the Gilbert–Varshamov theorem.

Main Results #

theorem CodingTheory.Codeword.hamming_ball_size_asymptotic_upper_bound {α : Type u_1} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] (q n : ) (p : ) (hq : q = Fintype.card α) ( : Nontrivial α) (hp : 0 < p p 1 - 1 / q) (c : Codeword n α) :
(hamming_ball n * p⌋₊ c).card (↑q).rpow (qaryEntropy q p * n)

Asymptotic upper bound on ball size: for 0 < p ≤ 1 - 1/q, the Hamming ball of radius ⌊np⌋ has at most q^(H_q(p)·n) elements.

theorem CodingTheory.Codeword.q_pow_qary_entropy_simp {q : } {p : } (hq : 2 q) (hp : 0 < p p < 1) :
(↑q).rpow (qaryEntropy q p) = (q - 1) ^ p * p ^ (-p) * (1 - p) ^ (-(1 - p))

Simplification: q^(H_q(p)) = (q-1)^p · p^(-p) · (1-p)^(-(1-p)). Uses Real.rpow.

theorem CodingTheory.Codeword.q_pow_qary_entropy_simp' {q : } {p : } (hq : 2 q) (hp : 0 < p p < 1) :
q ^ qaryEntropy q p = (q - 1) ^ p * p ^ (-p) * (1 - p) ^ (-(1 - p))

Variant of q_pow_qary_entropy_simp using natural-number power (q ^ _).

Helper: √x - √⌊x⌋ ≤ 1 for x ≥ 0.

theorem CodingTheory.Codeword.binomial_coef_asymptotic_lower_bound' {q : } {p : } (hp : 0 < p p < 1) (hq : 2 q) :
∃ (ε : ), (ε =o[Filter.atTop] fun (n : ) => n) ∀ᶠ (n : ) in Filter.atTop, (n.choose n * p⌋₊) * (q - 1) ^ (p * n) (↑q).rpow (qaryEntropy q p * n - ε n)

Binomial lower bound: there exists ε = o(n) such that for all large n, C(n,⌊np⌋) · (q-1)^(pn) ≥ q^(H_q(p)·n - ε(n)). This is a key ingredient in the Gilbert–Varshamov bound.

theorem CodingTheory.Codeword.qary_entropy_pos {α : Type u_1} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] (q : ) (p : ) (hq : q = Fintype.card α) (hp : 0 < p p 1 - 1 / q) :
0 < p * Real.logb (↑q) (q - 1) - p * Real.logb (↑q) p - (1 - p) * Real.logb (↑q) (1 - p)

The q-ary entropy H_q(p) is strictly positive for 0 < p ≤ 1 - 1/q.