Skip to content

Z4-Linearity of Binary Codes

A binary code represented as the distance-preserving Gray image of a linear code over the integers modulo four.

Version
v1 · 2026-11-14 · History
Domain-specific #
15002
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomains
Coding Theory, Algebra → Mathematics

Core Idea

Some binary error-correcting codes can be described as the images of linear codes over the ring \(\mathbb Z_4=\{0,1,2,3\}\) under a coordinatewise Gray map. The ring code is closed under addition modulo four and multiplication by ring elements. Its binary image need not be a linear subspace over \(\mathbb F_2\), even though its distances and weight distribution can be studied through the \(\mathbb Z_4\) representation.[1]

This construction reveals structure in families including Kerdock and modified Preparata-type codes. It does not say that every nonlinear binary code has such a representation, or that every image is nonlinear.

How would you explain it like I'm…

The Four-Number Clock Trick

To send messages that can be fixed if they get a little smudged, people use special lists of 0s and 1s. Some of these lists look like they don't follow a neat pattern. But if you translate them into a counting clock that only has the numbers 0, 1, 2 and 3, some of them turn out to follow a neat adding rule after all.

Hidden Order in Binary Codes

Error-correcting codes are sets of strings of 0s and 1s chosen so that mistakes in sending a message can be caught or fixed. Some good codes don't follow the usual neat adding rule for 0s and 1s. Z4-Linearity of Binary Codes is the discovery that some of these can be built from codes made of the numbers 0, 1, 2 and 3, where you add like on a clock with four hours. A translation rule called the Gray map turns each 0-to-3 number into a pair of 0s and 1s. The four-number code follows a neat rule even though its 0-and-1 version doesn't have to. This trick helps explain some famous codes, but it doesn't work for every messy code.

Gray Images of Z4-Linear Codes

Z4-Linearity of Binary Codes describes binary error-correcting codes that can be obtained as images of linear codes over Z4, the integers 0, 1, 2, 3 with arithmetic modulo four, under the coordinatewise Gray map, which sends each Z4 symbol to a pair of bits. The Z4 code is closed under addition mod 4 and under multiplication by elements of Z4, so it is 'linear' in the ring sense. Its binary image, however, doesn't have to be a linear subspace over the two-element field, meaning adding two codewords bit by bit might not give another codeword. Even so, its distances and weight distribution can be studied through the Z4 version. This approach reveals hidden structure in families such as Kerdock and modified Preparata-type codes. It doesn't claim that every nonlinear binary code has such a description, or that every image is nonlinear.

 

A binary code is Z4-linear if it is the image of a linear code over Z4 = {0,1,2,3}, that is, a Z4-submodule of Z4^n closed under addition mod 4 and multiplication by ring elements, under the coordinatewise Gray map, which sends each symbol of Z4 to a pair of bits. Distances and weight distributions of the binary image can be studied through the Z4 code, even though the image need not be a linear subspace over F2. This framework explains structure in notable nonlinear binary families, including Kerdock and modified Preparata-type codes, as Gray images of Z4-linear codes. It does not imply that every nonlinear binary code admits a Z4-linear representation, nor that every Gray image is nonlinear.

The Gray Map and Distance

Use the map

\[0\mapsto 00,\qquad 1\mapsto 01,\qquad 2\mapsto 11,\qquad 3\mapsto 10.\]

The Lee weights of $0,1,2,3$ are respectively $0,1,2,1$. Lee distance is the Lee weight of the coordinatewise difference modulo four; binary Hamming distance counts differing bits. Extending the map coordinate by coordinate sends \(\mathbb Z_4^n\) to binary words of length $2n$ and preserves distances: Lee distance before mapping equals Hamming distance afterward.[1]

Distance preservation is not preservation of addition. For example, \(\phi(1)+\phi(1)=00\) under bitwise addition, whereas \(\phi(1+1)=\phi(2)=11\). A linear code over \(\mathbb Z_4\) is therefore not automatically a binary linear code. Some images are binary linear, and others are not. This Gray map is a specific symbol map; a Gray-code ordering is a related one-bit-adjacency idea, not the same object as an error-correcting code.

Preparata and Kerdock Families

Preparata's original 1968 construction gives nonlinear double-error-correcting binary codes by adjoining selected cosets to a linear kernel.[2] This classical construction must be distinguished from a later Preparata-like family obtained as the Gray image of a linear \(\mathbb Z_4\) code. The modified family has the same parameters and weight distribution as the classical family in the comparison, but the constructions are not generally equivalent; their coincidence in a small special case must not be generalized.[3][1]

In the \(\mathbb Z_4\) construction, the code used for the Kerdock family and the code used for the modified Preparata family are dual under the ring inner product. Their binary images have formally dual weight distributions: the MacWilliams transform connects the enumerators. This is a statement about enumerators of images; it does not assert that a nonlinear binary image has an ordinary binary linear orthogonal dual equal to the other image.[1]

At binary length 16, the Kerdock and Preparata constructions meet in the Nordstrom–Robinson code. It has 256 words and minimum Hamming distance six, and is the Gray image of the self-dual length-eight \(\mathbb Z_4\) octacode.[1]

Use and Limits

The ring representation can give compact descriptions and decoding methods that are less apparent in a nonlinear binary presentation. Hammons and colleagues also treat related Goethals and Delsarte–Goethals families, with the modifications specified in their constructions.[1]

Some prominent families have more codewords than comparable binary linear codes known to the authors. That comparison is a property of particular families and parameter ranges, not a guarantee for every \(\mathbb Z_4\)-linear code. Minimum distance, code size, ring duality and equivalence of binary codes must each be checked for the specific construction.

Relationships to Other Abstractions

Local relationship map for Z4-Linearity of Binary CodesParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Z4-Linearityof Binary CodesDOMAINPrime abstraction: Linearity — presupposesLinearityPRIME

Current abstraction Z4-Linearity of Binary Codes Domain-specific

Parents (1) — outgoing typed relations

  • Z4-Linearity of Binary Codes presupposes Linearity Prime

    The underlying Z4 submodule has a linear inclusion into the ambient module.

Hierarchy path (1) — routes to 1 parentless root

  • Z4-Linearity of Binary Codes → presupposes Linearity

Neighborhood in Abstraction Space

Z4-Linearity of Binary Codes sits in a sparse region of the domain-specific corpus (88th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Unclustered & Miscellaneous (3155 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] A. Roger Hammons Jr., P. Vijay Kumar, A. R. Calderbank, N. J. A. Sloane and Patrick Solé, “The Z₄-Linearity of Kerdock, Preparata, Goethals and Related Codes”, IEEE Transactions on Information Theory 40 (1994), 301–319; authors' related manuscript. registry ↩a ↩b ↩c ↩d ↩e ↩f

[2] Franco P. Preparata, “A Class of Optimum Nonlinear Double-Error-Correcting Codes”, Information and Control 13 (1968), 378–400, publisher abstract. registry ↩

[3] William M. Kantor and Michael E. Williams, “Symplectic Semifield Planes and Z₄-Linear Codes”, Transactions of the American Mathematical Society 356 (2004), 895–938; author-hosted text. registry ↩