Hamming Bound #
This file establishes the Hamming bound (also called the sphere-packing bound): for a code
C of block-length n and minimum distance d over a q-ary alphabet α,
|C| · Vol(n, ⌊(d-1)/2⌋) ≤ |α|^n,
where Vol(n, t) = Σ_{i=0}^{t} C(n,i) · (|α|-1)^i is the volume of a Hamming ball of
radius t.
Main Results #
hamming_ball_size: the exact volume formula for Hamming balls.hamming_ball_non_intersect: balls of radius⌊(d-1)/2⌋around distinct codewords of a code with minimum distancedare disjoint.hamming_bound: the Hamming (sphere-packing) bound.
Volume formula: the Hamming ball of radius l centred at any codeword has exactly
Σ_{i=0}^{l} C(n,i) · (|α|-1)^i elements.
Hamming balls of radius ⌊(d-1)/2⌋ around distinct codewords of a code with minimum
distance d are disjoint: no point can lie within that radius of two distinct codewords.
Helper: Hamming balls of radius ⌊(d-1)/2⌋ around distinct codewords are pairwise
disjoint as Finsets.
Hamming bound (sphere-packing bound): a code C of block-length n and minimum
distance d over an alphabet α with |α| > 1 satisfies
|C| ≤ |α|^n / Vol(n, ⌊(d-1)/2⌋).