Gilbert–Varshamov Bound #
This file proves the Gilbert–Varshamov (GV) existence bound: for any block-length n,
dimension k, and distance d over a q-ary alphabet α, if
k ≤ n − ⌈log_q Vol(n, d−1)⌉ − 1,
then there exists an n × k generator matrix G such that the linear code G·αᵏ has
minimum distance at least d.
The proof proceeds via a probabilistic argument:
prob_leq_ball_size: for any nonzero messagex, the probability that a random generator matrixGsendsxto a low-weight codeword is at mostVol(n,d−1)/|α|ⁿ.existence_bound: by a union bound over all nonzero messages, the number of "bad" generator matrices (those sending some nonzeroxto a codeword of weight <d) is at most(|α|ᵏ − 1) · |α|^(nk−n) · Vol(n, d−1).gv_bound: ifkis small enough (satisfying the GV condition), the number of bad matrices is strictly less than the total|α|^(nk), so at least one good matrix exists.
Main Results #
prob_leq_ball_size: probabilistic bound on low-weight outputs.existence_bound: union-bound count of bad generator matrices.gv_bound: existence of a good generator matrix satisfying the GV condition.
Probabilistic bound: for any nonzero message x ∈ αᵏ, the fraction of n×k matrices
G for which G·x has Hamming weight less than d is at most Vol(n,d−1)/|α|ⁿ.
Union bound: the number of n×k generator matrices G for which some nonzero message
x is sent to a codeword of weight less than d is at most
(|α|ᵏ − 1) · |α|^(nk−n) · Vol(n, d−1).
Gilbert–Varshamov bound: if k ≤ n − ⌈log_q Vol(n, d−1)⌉ − 1, then there exists
an n×k generator matrix G such that every nonzero message is mapped to a codeword
of Hamming weight at least d.