Minimum Hamming distance #
The minimum distance of a set of words is the least Hamming distance between distinct
words, with value zero for a set containing at most one word. It agrees with Set.infsep
after transport to Mathlib's Hamming metric space. For an additive code it is also the
least weight of a nonzero word, so the same API applies to linear codes through their
underlying additive subgroups.
The coordinate type is finite; the alphabets may depend on the coordinate and need not be finite, nor does the code. The attained minimum and its lower-bound characterization support parameter computations for explicit codes, while invariance under distance-preserving maps handles changes of coordinates.
Use C.hammingMinDist, or Set.hammingMinDist C, for a set of words C.
Its defining equation is Set.hammingMinDist_def C.
The conventions follow Huffman and Pless, Fundamentals of Error-Correcting Codes,
§§1.2–1.6.
The unbundled minimum-distance design follows Cristina Dueñas Navarro's
Mathlib PR #38014.
This module generalizes its Fin n/Hamming-space interface to arbitrary finite coordinate
types and dependent alphabets, with hammingMinDist_eq_infsep providing the explicit bridge.
The least distance between distinct words of C, or zero if there are no such words.
Instances For
Minimum distance is the infimum of the Hamming distances between distinct codewords.
A code with at most one word has minimum distance zero.
The minimum distance is bounded by the distance between any two distinct codewords.
Every code with two distinct words attains its minimum distance.
Lower bounds for minimum distance are exactly lower bounds for all distinct pairs.
Minimum distance is positive exactly when the code contains two distinct words.
Minimum distance is zero exactly when the code contains at most one word.
The minimum distance never exceeds the number of coordinates.
Inclusion reverses minimum distance when the smaller code has two distinct words.
The natural-number minimum distance equals metric infimum separation in Hamming space.
The minimum distance of a two-word code is the distance between its words, including when the words coincide.
A map preserving distances between distinct codewords preserves minimum distance.
In a code containing the zero word, the weight of any nonzero codeword bounds the minimum distance. This applies in particular to additive and linear codes.
For an additive code, minimum distance is the least nonzero weight. For the zero code the indexing set is empty and both sides are zero.
A nonzero additive code attains its minimum distance at a nonzero codeword.
Weight lower bounds characterize the minimum distance of a nonzero additive code.