The quantum Hamming bound is a sphere-packing inequality for a quantum error-correcting code. Let be the dimension of the code
subspace in
quantum systems of local dimension
, and let
be its minimum distance. The bound is
where
and
is the floor function. The sum is the size of a
radius-
Hamming ball over an alphabet of
symbols. For a nondegenerate code, the errors of weight
at most
send the code into mutually orthogonal subspaces of dimension
, so their dimensions sum to at most
(Nielsen and Chuang 2000). For a degenerate code, different
errors can act identically on the code, so this counting argument requires the nondegeneracy
hypothesis.
Zhang and Chen (2026a) proved the bound for exact binary quantum subspace codes with , including degenerate and nonadditive codes. They
compared overlaps of quaternary Hamming balls with
quantities obtained from Krawtchouk polynomials,
using the length inequality
from Rains (1999). Zhang and Chen (2026b) give a
separate proof for
and
.
Sugui (2026) formalized the binary overlap inequality and the deduction of the dimension bound from normalized Shor-Laflamme weight enumerators,
, and
. The all-radius Lean result
assumes the Rains length bound. For
, a separate Lean result
derives the inequality from the enumerator, dimension, and distance hypotheses alone.
Sugui reports AI assistance with the formalization and verification.