Binary Golay code 2026-10-14
The length- binary Golay code is the cyclic code over generated by
It has dimension , minimum Hamming distance , and its radius- Hamming balls partition . Its parity extension has length , dimension , and minimum Hamming distance .
// Target: algebra.bigb
Bounded-distance decoding 2026-10-14
For a code of minimum Hamming distance and radius with , bounded-distance decoding returns the unique codeword within Hamming distance of the received word, or reports failure if none exists. The disjointness of radius- Hamming balls gives uniqueness. It guarantees recovery when at most errors occurred, but a word produced by more errors can be nearer to a different codeword and be miscorrected.
This is the entropy in base of the distribution with one symbol of probability and each of the other symbols of probability . It increases on from zero to one, and governs the exponential volume of a Hamming ball. For it is the binary entropy function.
// Target: algebra.bigb
If a uniform index has possibilities and every proposed success neighbourhood contains at most possibilities, then any estimator has failure probability at least the displayed expression. Condition on its success indicator: conditional entropy is at most . Subtract this from to bound the mutual information and rearrange. A metric Hamming ball gives approximate recovery rather than exact index decoding.
For an -qubit quantum code with projector , the quantum code distance is
Here the weight counts nonidentity tensor factors. Thus every error supported on fewer than qubits is detectable, by the Pauli expansion of a quantum error. A scalar action on the code, including a nonidentity stabilizer, is harmless and does not reduce this distance. For a stabilizer code, the equivalent definition minimizes weight among Pauli operators which commute with every stabilizer generator but act nontrivially on the logical information. The Knill--Laflamme condition then guarantees correction of all errors of weight at most , since each pairwise product has weight at most .
Suppose the code encodes logical qubits and is nondegenerate for all errors through weight . There are
distinct Pauli errors modulo phase: choose the affected positions and choose or at each. Each error is unitary, so its image of the code has dimension . Nondegeneracy makes these images mutually orthogonal, equivalently the combined vectors are orthonormal. They all lie in the physical Hilbert space of dimension . Counting dimensions proves the quantum Hamming bound
This dimension argument requires nondegeneracy. For a degenerate code, different errors can share an image, as in the Shor code, and this counting proof cannot be applied unchanged.
For a binary classical code of words, the Hamming bound is : disjoint Hamming balls around the words must fit into all binary strings. The quantum factor is needed because at each erroneous qubit there are three linearly independent nonidentity Pauli operators, not just a classical bit flip. A phase flip is invisible to a computational-basis classical record but changes a quantum superposition. A error combines bit and phase effects, and the identity with spans every one-qubit operator. Quantum correction must protect amplitudes and coherences, and consequently count whole orthogonal logical subspaces rather than just classical words.
For parameters , , and
Thus a nondegenerate such code saturates the bound: the sixteen two-dimensional error images exhaust the physical space. It is a perfect quantum error-correcting code for single-qubit errors. It also has the smallest possible length for nondegenerate single-error protection of one logical qubit: for , the required inequality fails.
Here is an explicit realization and its five-qubit stabilizer syndrome table. Write tensor products without multiplication symbols and use
Each pair has an even number of anticommuting single-site factors, so the four stabilizer generators commute. Their binary Pauli labels are independent: no nonempty product has identity label. For example, the -support at site three fixes the exponent of in such a product to zero, site five then fixes that of , site one fixes that of , and site two fixes that of . Thus their group has sixteen elements and excludes . The common eigenspace has projector and dimension , since all nonidentity Pauli strings have zero trace.
Record a syndrome bit as one when an error anticommutes with the corresponding generator, in order . Direct local commutation gives
These are all fifteen nonzero four-bit error syndromes; the identity has . Distinct errors in this list have a product with nonzero syndrome, so it anticommutes with some . Inserting on both sides gives . The diagonal product is the identity. Hence the Knill--Laflamme condition is exactly , proving nondegenerate correction. Measure the four commuting checks, apply the unique indicated Pauli error again, and every logical state is recovered. The Pauli expansion of a quantum error extends this recovery to an arbitrary one-qubit noise channel, not just the fifteen discrete errors.
The table also proves that every Pauli operator of weight one or two has nonzero syndrome: a weight-two operator is the product of distinct single-site errors, whose syndromes differ. Therefore the distance is at least three. The operators and commute with all four generators and anticommute with each other. They are nontrivial logical Pauli operators. Multiplication of by gives , a weight-three operator with the same logical action; it cannot be scalar on the code because it anticommutes with the invertible logical operator . This proves exactly.
The code consequently detects every two-qubit error and corrects two known-location erasures by the quantum erasure correction criterion, but it cannot correct all two-qubit errors of unknown location. A nontrivial weight-three logical operator can be split into a weight-one and a weight-two error, whose pairwise product violates the correction condition. It also saturates the quantum Singleton bound, since . These properties distinguish single-error perfectness from unrestricted protection against larger errors.
A binary block code of length is a nonempty subset . Its size is , the number of distinct codewords. The Hamming distance counts coordinates at which two words differ. The code's minimum Hamming distance is when there are at least two words. No pairwise minimum exists for a singleton code; it can be assigned as a convention when needed.
A binary linear code is a vector subspace of . If its dimension is , a generator matrix has a basis of as its rows, giving
To match the coordinate-row convention, take a parity-check matrix of size , with independent columns, and define
The transpose is the usual parity-check matrix with one column per coordinate. By rank-nullity theorem, the displayed kernel has dimension . The two constructions agree when : the generator's row space lies in the parity-check kernel and has the same dimension, hence equals it. Conversely, for a given , choose the columns of as a basis of its dual code ; orthogonality and the dimension formula give exactly as the kernel.
For a nonzero linear code, is a nonzero codeword whenever are distinct codewords, and . Conversely compare any nonzero codeword with zero. Thus the minimum Hamming distance of a linear code is the least nonzero Hamming weight.
Write for the row associated with coordinate . A nonzero binary vector is a codeword exactly when
Its nonzero coordinate positions therefore index a linearly dependent set of rows. Conversely, a dependence among a set of rows has coefficients in , not all zero; putting these coefficients in the corresponding coordinates gives a nonzero codeword of weight no greater than the number of rows in that set. Taking minima in both directions proves the parity-check dependencies determine minimum distance criterion:
Rows here are indexed by positions: equal row vectors at different positions are two distinct members of the indexed family. In the usual matrix convention, the same result refers to columns of . For the zero code, neither a nonzero codeword nor a dependent coordinate set exists, so both minima can consistently be interpreted as .
For the Hamming code, let , set , and let the rows of be all nonzero vectors of , each once. These rows include the standard basis, so has rank and the code has dimension and size . There is no dependence involving one row, because no row is zero, or two rows, because no rows are equal. For , any two distinct nonzero vectors have a distinct nonzero sum , which is another row. These three rows sum to zero. Thus for .
The perfectness of a Hamming code also has a direct decoding proof. Given any received word , its syndrome is . A zero syndrome means . Otherwise it equals exactly one row . The vector then has syndrome zero and is the unique codeword obtainable by changing one coordinate. There is no other codeword at distance at most one: its necessary correction would have to have the same syndrome, and among zero and all single-coordinate errors the syndromes are precisely the distinct vectors of . Therefore the radius-one Hamming balls about codewords partition .
Equivalently, each ball contains words; disjointness and show that none are uncovered. Hence every nondegenerate binary Hamming code is a perfect single-error-correcting code. For , the construction is the singleton code , whose one radius-one ball is also the whole ambient space. This deals with the degenerate boundary without falsely claiming its minimum distance is three.
Work over the finite field , and write for row of the PDF's matrix. The first row has Hamming weight eleven; all other rows have Hamming weight seven. To check their intersections economically, index the last eleven columns modulo eleven. The last eleven rows, after deleting the first column, are the successive cyclic shifts of the set . Direct calculation gives
The intersection sizes for equal those for . Thus two different rows among meet in four positions, including their shared first coordinate, whereas meets each of these rows in six positions. All these intersection sizes are even numbers, while each row weight is an odd number. Consequently . The first row and column agree, and the entry of the last eleven-by-eleven block depends only on the sum of its row and column indices modulo eleven, because successive rows are left shifts. Thus is a symmetric matrix, so .
The generator matrix has rank twelve, and
Hence its linear code lies in its dual code . Both have dimension twelve, so : it is a self-dual code. Moreover , and is an invertible matrix, so this is another generator matrix for the same code. In the column parity-check matrix convention of the question,
The matrix has rank twelve, so its nullspace condition characterizes exactly.
To prove the minimum Hamming distance, first observe that the rows of have Hamming weights twelve and eight. For binary vectors,
Every partial sum of generator rows is orthogonal to every further generator row, by . Its intersection with that row therefore contains an even number of positions. Induction using this identity proves that every codeword has weight divisible by four: is a doubly even code.
The systematic-matrix proof of extended Golay distance now excludes weight four. Write a codeword as and put . If its total weight were four, . For , the right half is a row of and has weight seven or eleven. For , the right half is the sum of two distinct rows; the intersection counts above give weight or . For , the right half would be a unit vector, but then would be a row of , of weight seven or eleven. For , the right half would vanish, contradicting invertibility of . Thus no nonzero word has weight four. Every nonzero weight is consequently at least eight, and any generator row other than the first attains eight. Since the minimum Hamming distance of a linear code is its least nonzero weight,
Define the length- binary Golay code as the punctured code obtained by deleting the first coordinate of this extended binary Golay code. This puncturing is injective on , because a nonzero word in its kernel would have weight one. Thus , and deleting one coordinate gives . The sum of the first two generator rows has weight eight and first coordinate one, so its puncture has weight seven. Therefore . In fact any coordinate can be punctured: every left coordinate except the first occurs in a weight-eight generator row, the first occurs in the sum just used, and every right coordinate occurs in at least one of the weight-eight generator rows.
The radius-three Hamming balls around the words of are disjoint, since two centers in intersecting balls would have Hamming distance at most six. Each ball contains
words. Their combined size is , the size of the entire binary Hamming space. Hence
For decoding in , write the received word as , where is the unknown error in its two halves. Its syndrome is
Let denote the length-twelve unit vector. For bounded-distance decoding, the three-error syndrome decoding of extended Golay code is the following finite search, returning the first successful candidate error:
  • If , return .
  • Otherwise, if some satisfies , return .
  • Otherwise, compute ; if , return .
  • Otherwise, if some satisfies , return .
  • If no test succeeds, declare that no error of weight at most three has this syndrome.
Every returned candidate has total Hamming weight at most three and the required syndrome. Conversely, an error of total weight at most three has a half of weight zero or one. The tests exhaust respectively , , , and , so they find every such error. Two distinct successful candidates would differ by a nonzero codeword of weight at most six, contradicting . Thus the result is unique, and the decoded word is . The condition still allows the first test when the weight is exactly three; for larger syndrome weight begin with the second test. A large syndrome weight alone does not imply more than three errors.
The decoder corrects every error of weight at most three; failure means that the received word is outside all radius-three decoding balls. Unlike its puncture, is not a perfect code: its radius-three balls cover only words. Without the three-error assumption, a successful test identifies a nearby codeword but need not identify the transmitted word.
For an arbitrary received word, a complete minimum-distance decoding fallback is to enumerate and minimize . Every error with the observed syndrome has exactly the form , so a minimizer gives a nearest codeword . Report all minimizers if there is a tie. This also decodes outside the guaranteed radius in the nearest-word sense, while making no unsupported claim that the transmitted word is determined. Thus a syndrome of weight at least three alone is insufficient for guaranteed recovery; either the three-error hypothesis or a choice among nearest words is needed.
Write for the largest number of codewords in a binary length- code with minimum Hamming distance at least . The volume of a Hamming ball does not depend on its centre and is
For the Hamming bound, put . The radius- Hamming balls around distinct codewords are disjoint: a point belonging to two such balls would, by the triangle inequality for Hamming distance, put their centres at distance at most . Counting points in the binary cube therefore gives
For the Gilbert–Varshamov bound, choose a code maximal under inclusion among those with minimum Hamming distance at least , for example by successively adding any allowable word. Its radius- Hamming balls cover the cube. Otherwise an uncovered word would be at distance at least from every codeword and could be added, contradicting maximality. Thus
The lower bound is an existence assertion about a suitable code, while the upper bound holds for every such code. Together they give
Let be the binary entropy. For ,
The assumed Hamming ball volume exponent applies also to any integer radii with . Indeed, for each small these radii eventually lie between and . monotonicity of sandwiches its normalized logarithm between limits and ; continuity then lets tend to zero. Consequently the asymptotic Gilbert–Varshamov bound and asymptotic Hamming bound have respective exponential scales
Equivalently, the optimal code rate satisfies
These are bounds on the rate, not a claim that the optimal rate has a known limit or equals either endpoint.
To correct every pattern of errors by nearest-codeword decoding, it suffices to have minimum Hamming distance : the corresponding radius- Hamming balls are disjoint. For , the relative distance tends to , so the asymptotic Gilbert–Varshamov bound guarantees code rate at least in the limit. Therefore its immediate strict-rate guarantee is
The binary entropy is strictly increasing from zero to one on , since on . Let denote the inverse on this interval. The asymptotic condition becomes
There is also a finite-length boundary refinement for the precise requirement of correcting errors. If , then each weight for is at least . Expanding gives the entropy bound for a Hamming ball
The case follows directly from . Taking and using monotonicity of the binary entropy, the Gilbert–Varshamov bound yields
Thus the worst-case correction guarantee from the Gilbert–Varshamov bound even includes for the exact radius , with the number of messages rounded to an integer when necessary. No positive-rate guarantee of this form is obtained for ; one must not extend the increasing-entropy calculation past . Failure of this sufficient bound does not rule out better codes.
By contrast, the Shannon second coding theorem gives vanishing error probability on the binary symmetric channel whenever
The factor of two comes from demanding disjoint correction balls for every error pattern of a prescribed weight. This is a worst-case distance requirement, and the Gilbert–Varshamov bound is itself only a sufficient existence bound. The Shannon second coding theorem controls the probability of decoding failure for the random channel; rare bad patterns may remain.
Finally, the number of actual errors has binomial distribution with mean . Correcting exactly its mean does not itself imply error probability tending to zero. To get that conclusion from the distance construction when , choose with and , and correct errors. The weak law of large numbers then makes the probability of exceeding the correction radius tend to zero.
Figure 1.
Binary symmetric channel capacity and Gilbert–Varshamov worst-case correction rate
. Details.
Work over the finite field . The given factorization shows that divides , so it generates a length- cyclic code . Since , the vectors represented by
form a basis: their distinct leading degrees prove their linear independence, and every multiple of representing a polynomial of degree below has a multiplier of degree at most . Hence is a binary linear code of dimension , containing codewords. The generator has Hamming weight seven, so the minimum Hamming distance of a linear code satisfies .
The BCH bound used here is the following consecutive-root theorem. If a length- cyclic code over , with relatively prime to , has a generator polynomial of a cyclic code vanishing at for a primitive th root , then its minimum Hamming distance is at least .
Choose a root of in an algebraic closure of . The factorization implies , while in , so . As is prime, has order . The Frobenius endomorphism preserves the roots of a polynomial with coefficients in : . Thus every is a root. In particular, shows that
are roots of . These four consecutive roots give by the BCH bound. A further argument is needed to exclude weights five and six.
Put . Cancelling in the supplied factorization gives . In the quotient ring , is invertible and every cyclic shift of equals . Since ,
The coefficient of in this circular product is , the binary inner product of the coefficient vector of with a cyclic shift of itself. Every coefficient of is one. The circular autocorrelation of the binary Golay generator therefore implies that all pairs of basis rows , including equal rows, satisfy
Each has Hamming weight seven. Append its parity bit, which is one, and write . The extended rows have Hamming weight eight and satisfy . Their linear span is precisely the parity extension of , because the appended coordinate is the linear functional equal to the sum of all coordinates.
These extended generators produce a doubly even code. To prove this rather than assume it, use
All the extended generators have weights divisible by four. A sum of previous generators is orthogonal to the next generator, so the intersection size in this identity is even. Induction proves that every word in has Hamming weight divisible by four; this is the orthogonal generators of doubly even codes argument.
An original word of weight five acquires a parity bit and has extended weight six, while a word of weight six acquires a zero parity bit and still has extended weight six. Both contradict divisibility by four. Together with the BCH bound and the weight-seven generator, this completes the BCH and parity-extension proof of the binary Golay distance:
Its radius-three Hamming balls are disjoint, and their volume is
There are such balls, so they contain words, exactly the size of the ambient binary cube. They therefore cover the cube, with every word in exactly one ball. Hence
A binary block code is a subset ; its length is the common word length , its size is , and its minimum distance is the least Hamming distance between distinct words. There are words in a radius- Hamming ball, since one chooses the positions to change.
Put . Two radius- Hamming balls about different codewords cannot meet: otherwise the triangle inequality would make their centres at distance at most . Comparing their combined size with gives the Hamming bound
For the other direction, start with one word and repeatedly add any word at distance at least from every word already selected. Finiteness ensures that this process stops. At that point the radius- Hamming balls cover the entire cube; an uncovered word could otherwise be added. These balls may overlap, but their total size is at least . This gives the Gilbert–Varshamov bound
We give the bounds for an alphabet of size , including the binary case . Let be a length- code with codewords and minimum Hamming distance at least , where . Write for the maximum code size at a given distance and
for the number of words in a Hamming ball of radius . The th term chooses the changed coordinates and the alternative symbols in each.
For the Hamming bound, put . Balls of radius around distinct codewords are disjoint: a common point would, by the triangle inequality, make their distance at most . Counting those balls inside the ambient words proves
No linearity is needed. For a linear code of dimension over , replace by .
For the Gilbert–Varshamov bound, construct a code greedily, adding any word at distance at least from all previously selected words, until none remains. The process terminates because the space is finite. Its maximality implies that the radius- balls around its codewords cover the whole space: an uncovered word could have been added. These balls may overlap, but the size of their union is at most the sum of their sizes. Hence the constructed code has , proving the existence bound
One may take the ceiling on the right because code size is integral.
For completeness, the sharper linear version is the Varshamov bound for linear codes. When is a prime power and , an linear code exists provided
Set and choose columns of an parity-check matrix in order. When choosing column , exclude all combinations of at most earlier columns, including the zero combination. There are at most forbidden vectors, smaller than by the assumed inequality. A column can therefore be chosen. Inductively every set of at most chosen columns is independent: a relation involving the newest one would express it as a combination of at most earlier columns. The kernel has dimension at least and minimum Hamming distance at least , since a low-weight kernel vector would be such a column relation. If its dimension is larger than , take a -dimensional subspace. This proves the stated linear existence claim; it does not assume the greedy nonlinear code was linear.
To derive the asymptotic bounds, define the q-ary entropy
with the continuous endpoint conventions. Its derivative is , so it is increasing on and has maximum one at . Stirling's formula gives, uniformly for integer ,
The sum defining is between its largest summand and times that summand. For radius fractions tending to , monotonicity of makes the largest exponent tend to . Consequently the Hamming ball volume exponent is
For , the exponent is one: use a radius fraction just below for a lower bound and for an upper bound.
Set and define the asymptotic rate-distance function by
The code rate is and the relative minimum distance is . A limsup suffices; no unproved existence of a limit for optimal code sizes is required. The packing radii have fraction tending to , so the finite Hamming bound and the volume exponent give the asymptotic Hamming bound
The covering radii have fraction tending to , giving the asymptotic Gilbert–Varshamov bound
For larger , this covering argument gives only the trivial lower bound zero, not the expression obtained by extending the decreasing information entropy function beyond its maximum.
The asymptotic lower bound is also achievable by linear codes over a finite field. For and sufficiently large , take redundancy , so . The linear existence condition produces dimension at least ; its rate has liminf at least . At , use the whole space, of rate one. In particular, for binary codes the bounds reduce to
where is the binary entropy function.
Take the parity-check matrix
over . Its columns are all the nonzero vectors of . The Hamming code is . Since has rank three, is a binary linear code of length seven and dimension four. No nonzero codeword has weight one or two, since no column is zero and no two columns coincide. Columns give a codeword of weight three, so has parameters .
For a received vector , its syndrome is . A single error in position gives exactly column of , so the syndrome identifies that position uniquely; zero syndrome means no error under the one-error assumption. The radius-one Hamming balls around the codewords are disjoint and have total size , so this is also a perfect code.
There are weight-three codewords: every pair of columns determines the third, and each triple is counted three times. The all-ones vector is a codeword because the column sum is zero, so complementation gives seven weight-four codewords. Together with zero and the all-ones vector these account for all sixteen. The weight enumerator is therefore
Identify the hypercube graph with , joining two sets when their symmetric difference has size one. Write for the closed graph neighbourhood of , and for its radius- neighbourhood in Hamming distance. In the simplicial order on the discrete cube, smaller sets come first, with lexicographic order within each rank: the smallest differing coordinate belongs to the earlier set. Let be the first vertices in this order. Harper theorem is
Equivalently, minimizes the external vertex boundary at fixed size. We will also obtain for every integer .
Here is a complete proof by simplicial section compression. First note two properties of the simplicial order on the discrete cube. Its restriction to either face obtained by fixing one coordinate is the corresponding order on the smaller hypercube graph. Also, the closed graph neighbourhood of an initial segment is an initial segment. To verify the latter, a nonempty initial segment contains every level below its last level , and a lexicographic prefix at level . For , its closed graph neighbourhood contains every set of size at most , and its only further members are the upper shadow of . An -set lies in this upper shadow exactly when its lexicographically earliest -subset lies in . That earliest subset is obtained by deleting the largest element. These earliest subsets vary monotonically in lexicographic order, so the upper shadow is another lexicographic prefix. For , the closed graph neighbourhood of is the union of levels zero and one. The empty initial segment causes no exception.
Induct on , with immediate. Fix a coordinate and write the sections of as , deleting from the latter section. Replace them by the initial segments with , . The sections of the old closed graph neighbourhood are
By induction their sizes are at least and , respectively. These are exactly the sizes of the new sections, because both sets in each new union are initial segments and hence nested. Thus simplicial section compression preserves size and never enlarges the closed graph neighbourhood.
Repeatedly compress any section that is not already an initial segment. Every change strictly reduces the sum of the global simplicial positions of the included vertices. This nonnegative integer decreases only finitely often, so the process ends at a family whose sections in every coordinate are initial segments. If itself is an initial segment, the induction is complete. Otherwise choose the earliest absent vertex and the latest present vertex , with . They cannot agree in any coordinate: agreement would put them in one compressed section, where an earlier absent vertex cannot precede a later present one. Hence . Nor can a vertex lie between them: if is present, pairing it with would force ; if absent, pairing it with would force . Thus are consecutive, and is obtained from by replacing its last vertex with the next vertex .
There are only two possibilities for these terminal families for simplicial section compression. If , consecutiveness makes the last -set and the first -set. Complementarity forces , and . For , the corresponding contains all sets of size at most except , and additionally . Every -set has at least two -subsets, so at least one belongs to . The missing has a -subset in . Consequently contains every set of size at most , which is exactly .
If , then . Since are complementary, the smaller one contains coordinate . Consecutiveness forces to be the last -set containing , and the first -set avoiding :
The initial segment consists of all sets of size less than and all -sets containing . Its closed graph neighbourhood contains all sets of size at most and all -sets containing . For , each such -set has -subsets containing , so removing only leaves one in . All sets of size at most are still in , because all levels below belong to . Hence again . For , the two families are related by exchanging coordinates and both have the whole as their closed graph neighbourhood. These comparisons finish the induction and prove Harper theorem.
For the radius- version, repeatedly use the one-step result. At each step the comparison family remains an initial segment, and its closed graph neighbourhood is monotone in its size. If , applying Harper theorem to therefore gives . Induction on proves the asserted extension.
A Lévy family of graphs has vanishing concentration of measure functions after distances have been scaled by the graph diameter. More explicitly, for connected finite graphs of diameter , use normalized graph distance and uniform probability measure. For every fixed , require
For this normalization is normalized Hamming distance , since its diameter is .
If , the corresponding initial segment contains the Hamming ball about of radius . The radius- version of Harper theorem implies
Use the precise Hoeffding inequality for . One can also derive this estimate directly: the moment-generating function of is ; the exponential Markov inequality followed by minimization at gives the bound. With , we have . Thus, whenever ,
This proves that the hypercube graphs form a Lévy family of graphs. The stronger fixed-positive-mass formulation follows as well. For any , choose with . The Chebyshev inequality for , whose variance is , makes the Hamming ball of radius have fewer than vertices. An initial segment of size at least contains that ball. Enlarging by and using the same Hoeffding inequality gives a complement proportion tending to zero uniformly over all such . The normalization matters: with unscaled unit Hamming distance, cubes do not satisfy the metric version at every fixed radius; for a radius below one, a half-cube has no enlargement.
Equality in Harper theorem does not determine a down-set up to isomorphism. In , take
This is a down-set of size nine. Its closed graph neighbourhood contains every set of size at most two, because all singletons belong to . Every triple contains an edge of the four-cycle among the listed pairs, so every triple also belongs to . The four-element set does not. Hence .
The size-nine simplicial order on the discrete cube initial segment is all sets of size at most one together with the pairs . Every triple contains one of these pairs, and the four-element set is again absent from its closed graph neighbourhood. Its neighbourhood therefore also has size , proving extremality of . Nevertheless the induced graphs are not isomorphic: in , the empty set has degree four, the four singletons have degree three, and the four pairs have degree two. The initial segment has two vertices of degree four, namely and . Since a graph automorphism preserves induced degree of a vertex, no automorphism of the cube can carry one family to the other. This gives nonunique down-set extremizers for Harper theorem even under the stronger test of induced graph isomorphism.
For a block code, the minimum distance of a code is the minimum Hamming distance between distinct codewords, where Hamming distance counts positions in which two equal-length binary strings differ. We use equal-length codewords, so the fact that the codomain allows arbitrary finite strings creates no ambiguity. Minimum distance means every two distinct codewords differ in at least positions and some pair differs in exactly .
Changing at most bits cannot turn a codeword into another codeword. Testing membership therefore detects every such nonzero error. For , suppose a received word lies within distance of two codewords. The triangle inequality would put their mutual distance at most , a contradiction. Hence the radius- Hamming balls are disjoint and nearest-codeword decoding corrects all errors of weight at most .
For an alphabet of size , start with and the standard unit vectors in . Their minimum distance of a code is one. Repeat every coordinate times; every distance is multiplied by , so the resulting code has minimum distance of a code exactly . A one-letter alphabet has no pair of distinct codewords and therefore no finite minimum distance of a code under this definition; the construction concerns the usual nontrivial coding situation.
For , let be the binary matrix whose columns are all distinct nonzero vectors of . The binary Hamming code is . Its parity-check matrix has rank since its columns include the standard basis. Hence is linear of length and dimension .
No word of weight one or two lies in , since columns are nonzero and distinct; three columns sum to zero, so the minimum distance of a code is exactly three. The syndrome of a single-bit error is its column of , uniquely identifying the erroneous position. The possible syndromes correspond to no error or exactly one of single-bit errors. Alternatively, every radius-one Hamming ball has words and
Disjoint balls therefore cover the whole word space. This proves linearity, one-error correction and perfection. For , the parameters are , giving the 16 messages needed below.
In natural logarithms, Fano's inequality for a uniform index among alternatives states . The mutual information is at most the average Kullback-Leibler divergence to any fixed reference law. With the supplied packing, nearest-neighbour decoding turns partition error below half the separation into correct decoding. Thus the packing alone proves a bound at radius , with the unavoidable term. It does not automatically prove the much larger printed radius.
A list-decoding Fano inequality supplies the intended near-half error threshold. Assume , since otherwise that threshold is nonpositive and its event is automatic. Take a uniform prior on all unlabelled balanced partitions, and let . A Hamming ball of radius less than around any estimated partition contains at most such partitions. This follows by selecting the representative closer to the estimated group; each unlabelled partition contributes at most one such representative because . The entropy bound for a Hamming ball gives , where is the binary entropy function measured in natural logarithms. Its curvature gives . Also , so
Use the all- independent-edge law as a reference. Only the crossing pairs differ; the preceding Bernoulli distribution divergence estimate gives . Hence . Whenever the denominator is positive, the list-decoding Fano inequality proves the finite-sample answer
For , this is at least . If in addition , it implies the intended form with . This proves the claimed information-theoretic scale with its needed finite-sample qualifications.
As a uniform finite-sample assertion for every positive , the printed form is false. At every partition has the same data law, and a uniformly random balanced guess has a positive chance of being correct, giving error strictly below one. Such randomness can also be extracted from the finite graph sample: assign distinct graph outcomes to the finitely many balanced partitions; under the common law every selected outcome has positive probability. The worst error remains strictly below one for sufficiently small positive , by continuity. The printed lower bound tends to one as for any fixed universal , which contradicts this. The entropy correction cannot be dropped without an asymptotic or signal-size condition.
Let and let be the parity-check matrix whose columns are the distinct nonzero vectors of the finite field vector space . The binary Hamming code is
A perfect code has Hamming balls of radius about its codewords partitioning the whole ambient space, where is its minimum Hamming distance of a linear code.
No column of is zero and no two columns agree, so has no word of Hamming weight one or two. Three suitable columns sum to zero, so . For any received word , its syndrome is either zero or is the unique column of equal to that syndrome. In the first case ; in the second,
so is at Hamming distance one from a codeword. Uniqueness follows from . Thus the radius-one balls partition , and the code is perfect.
For , the dual code is the binary simplex code of length seven. Every nonzero dual word evaluates a nonzero linear functional on the seven nonzero vectors of , and exactly four of those evaluations are one. Hence every nonzero word of has weight
Perfect code 2026-10-03
A code of minimum distance is perfect if its Hamming balls of radius partition the ambient word space. Every word then has a unique nearest codeword within the code's error-correction radius.