Manuscript Offprint
arXiv:2610.30809An integer determinant approach to the length of Type II codes and the weights of shadows
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
It is well known that the length of a binary Type II code is divisible by 8. The classical proof relies on Gleason's theorem on weight enumerators. Motivated by a question of Vera Pless, we give elementary proofs of this fact that avoid invariant theory. Our main tool is a congruence modulo 8 for the determinant of the integer Gram matrix of a binary orthogonal matrix , obtained directly from the Leibniz expansion. It gives a short proof of a theorem of Janusz: the number of rows of weight congruent to 3 (mod 4) in a binary orthogonal matrix is divisible by 4. From this single statement we derive both the length restriction for Type II codes and the theorem of Conway and Sloane that every vector in the shadow of a binary self-dual code of length has weight congruent to (mod 4). We also give two short character-theoretic proofs of the length restriction and explain how all of these arguments detect the Arf invariant of a quadratic form.
1 Introduction
A binary linear code is self-dual if . It is doubly-even if every codeword has weight divisible by 4. A binary doubly-even self-dual code is called a Type II code.
Theorem 1.1 ([6]). If is a binary Type II code of length , then .
Theorem 1.1 is the basic arithmetic constraint in the theory of Type II codes. The condition is also sufficient: the extended Hamming code is a Type II code, and so is the direct sum of copies of for every . Thus Type II codes exist precisely at the lengths divisible by 8, and the main results on Type II codes are stated for these lengths.
Examples are the mass formula for the number of Type II codes of length n [11, Section 2] and the classification for small lengths: there are 1, 2, 9 and 85 inequivalent Type II codes of lengths 8, 16, 24 and 32, respectively [11, Table I], and 94343 of length 40 [2].
Another is the Mallows–Sloane bound on the minimum distance [11, Theorem 26]. Extremal Type II codes of length 24m, such as the [24, 12, 8] extended Golay code, have the further property that their codewords of each fixed weight form 5-designs [11, Theorem 36]. Finally, Type II codes are closely tied to even unimodular lattices through Construction A; for example, gives the lattice (see Section 6).
Corresponding author
The standard proof of Theorem 1.1 goes through Gleason's theorem [6]: the weight enumerator of a Type II code is a polynomial in the weight enumerators of the [8, 4, 4] extended Hamming code and the [24, 12, 8] extended Golay code, which are homogeneous of degrees 8 and 24. This argument determines the whole ring of possible weight enumerators, which is much more than the length restriction requires. In the early 2000s, Vera Pless used to ask the second author whether there was an elementary way to prove Theorem 1.1 (personal communication). This question motivates the present paper.
Our main observation is that Theorem 1.1 follows from an elementary congruence for integer Gram matrices (Sections 2). Let be a binary orthogonal matrix, regarded as a 0/1 integer matrix. Modulo 8, the Leibniz expansion of reduces to the identity and the transpositions, and the total entry sum of is controlled by the column weights of . Comparing the result with gives a short proof of a theorem of Janusz [8]: the number of rows of of weight is divisible by 4 (Proposition 2.2). Applied to a generator matrix of a self-dual code, this single statement yields Theorem 1.1. It also yields the theorem of Conway and Sloane [4] that every vector in the shadow of a self-dual code of length has weight (Theorem 5.1); here the shadow has an explicit representative read off from the rows of .
For comparison, we also give two character-theoretic proofs of Theorem 1.1, one via a Gauss sum (Section 3) and one via the MacWilliams identity [9] evaluated at a single point (Section 4). All of these arguments detect the same obstruction, namely the Arf invariant of the quadratic form on the even-weight vectors (Remark 3.1). Some other arguments that avoid Gleason's polynomials can be found in the literature (see Section 1.1), but they rely on other machinery, such as spinor groups, the Witt–Arf theory of quadratic forms, or group-order computations in the orthogonal group. Our contribution is an elementary and unified route to these results. Section 6 contains concluding remarks.
In the survey of Rains and Sloane [11, Section 6], the Molien series of Gleason's group of order 192 is computed as . The authors remark that this alone already shows that the length of a doubly-even self-dual code is a multiple of 8. Elkies [5] gives a shorter version of this idea. Gleason's group contains the scalar matrices for all 8th roots of unity . Hence every homogeneous invariant has degree divisible by 8. Our third proof is a one-point form of this argument; see Section 6.
Wood [13, Corollary 3.24] proves Theorem 1.1 by identifying doubly-even self-orthogonal codes with elementary abelian 2-subgroups of Spin(n). In coding terms, he uses the quadratic form wt(x)/2 mod 2 on the even-weight vectors, which is our form q in Section 3. By the theorems of Witt and Arf, all maximal totally singular subspaces have the same dimension. Wood computes this dimension from explicit examples. It equals n/2, for even n, only when . Rains and Sloane [11, Section 2] likewise view a Type II code as a maximal totally singular subspace of an orthogonal geometry of dimension n - 2. Our second proof replaces the Witt–Arf theory by a single Gauss sum.
Janusz [8] studies the group of orthogonal matrices over . He also studies its subgroup of matrices all of whose rows have weight . By computing the index and explicit coset representatives, he proves the following [8, Corollary 5]. For every , the number of rows of of weight is a multiple of 4. Applied to a generator matrix , this gives Theorem 1.1 [8, Corollaries 6 and 7]. Our first proof starts from the same reduction to an orthogonal matrix A. It then proves the needed case by a determinant computation instead of a group-order computation. The same computation also gives Janusz's general statement (Proposition 2.2); this is a different proof of a known result, not a new theorem.
In their proof that Type II codes lift to self-dual codes over with all norms divisible by 8 [11, Theorem 3(b)], Rains and Sloane use a -lift of the matrix in a generator matrix . They use the congruence , where . That argument concerns the lifting problem, not the length of the code. However, it uses the same kind of determinant computation modulo 8 as our first proof.
1.2 Notation and preliminaries
Throughout, denotes the standard inner product. We write for the intersection of the supports of and , and for the all-ones vector. For ,
Let be a Type II code of length . Since , we have , so is even and . Every codeword has even weight, so for all . Hence .
Lemma 1.2. For a subspace C of and ,
Proof. If , every term equals 1. If , the map is a surjective linear map . Hence it takes each of the values 0 and 1 exactly times, and the sum is 0.
2 First proof: an integer Gram determinant
This proof uses only a generator matrix, an integer Gram matrix B, its determinant modulo 8, and the total sum of its entries. As in [8], we first reduce to a statement about an orthogonal matrix over .
Proof of Theorem 1.1. Put . The following steps prove the theorem.
Step 0: is even. We have , since every codeword has even weight and is self-dual (Section 1.2). Hence .
Step 1: The integer Gram matrix. After a coordinate permutation, has a generator matrix . Self-duality gives over . Row of the generator has weight , where is row of . So the doubly-even condition implies .
Regard A as a 0/1 integer matrix and put . Then
Since A is invertible modulo 2, det A is odd. Hence
Step 2: Leibniz expansion for the determinant modulo 8. Write
In the term of , a fixed index contributes an odd diagonal factor . A moved index contributes an even off-diagonal factor . So the number of even factors equals the number of indices moved by .
• If moves at least three indices, its term is divisible by and vanishes modulo 8.
• No permutation moves exactly one index.
• What remains is the identity, contributing , and the transpositions .
Since , each transposition corresponds to one unordered pair, which we index by . Its sign is -1, and by symmetry its term is
Write . Then it is easy to see that , since . Moreover, a multiple of 4 is unchanged modulo 8 by an odd factor, because . Hence, since is odd we have , and
Step 3: The all-ones vector. We compute through the columns of , working in . Let be the weight of column of , so that . Then
The last congruence holds because every is odd. Indeed, over the square matrix satisfies , so . The entry of is , so is odd. For an odd we have , since is even.
On the other hand, summing the entries of over all ordered pairs and using gives . Substituting into Equation (3) gives
Step 4: Evaluate with all diagonal entries equal to 3. Let with all . Replacing one by changes the product by and the sum by 4. So is unchanged, and we may take every :
Combining this with Equations (2) and (5), and using for even (Step 0), we get
Hence , so and .
4
☐
Remark 2.1. Step 0 cannot be dropped: also satisfies , since .
Steps 1–4 show that if every row of has weight , then . The same determinant computation proves the following general statement, due to Janusz [8, Corollary 5]. We do not claim it as a new result. We include it to give a direct determinant proof in place of the group-order computation of [8].
Proposition 2.2 (Janusz [8, Corollary 5]). Let , i.e. with . Then the number of rows of of weight is a multiple of 4.
Proof. Regard as a 0/1 integer matrix and put , as in Step 1. Steps 2 and 3 use only three facts: the diagonal entries of are odd, its off-diagonal entries are even, and the columns of have odd weight. All three hold for every . Hence (2), (4) and (5) remain valid:
Write with and . Then is the number of rows of weight .
First we show that is even. Since , every off-diagonal entry is even, and is symmetric, we have
Hence , so is even.
Second, we show that . As in Step 4, replacing an odd by changes by and by 4. So is unchanged, and we may take :
Substituting into (5) and using since is even,
Hence , that is, . This completes the proof.
Example 2.3. Let and , where is the all-ones matrix, so that generates the extended Hamming code. Every row and column of has weight 3, and two distinct rows share two coordinates. Hence has diagonal entries 3 and off-diagonal entries 2:
The 24 permutations of , grouped by type, contribute as follows.
| Type | Number | Moved | Term | Mod 8 |
|---|---|---|---|---|
| identity e | 1 | 0 | 1 | |
| transp., e.g. (12) | 6 | 2 | 4 | |
| 3-cycle, e.g. (123) | 8 | 3 | 0 | |
| double transp., e.g. (12)(34) | 3 | 4 | 0 | |
| 4-cycle, e.g. (1234) | 6 | 4 | 0 |
• Full sum:
• Terms moving at least three indices: .
- Identity and transpositions only: , which agrees with .
• Removing the odd factor: for (12), , and .
- Total entry sum: column weights give . Adding the entries of directly gives as well.
• Formula (5): .
3 Second proof: a quadratic form and a Gauss sum
Let
be the space of even-weight vectors. Every codeword of C has even weight, so .
The quadratic form. For define . By Equation (1), for ,
Thus is a quadratic form on whose polar form is the standard inner product. The doubly-even condition says precisely that . Moreover, by definition, .
The Gauss sum. Consider
(a) Computation via the code. Write as the disjoint union of the cosets . Since for , identity (6) gives
By Lemma 1.2, this equals if , and 0 otherwise. Hence the only coset that contributes is itself. Taking , we have , so
(b) Direct computation. There are vectors of weight w, so by the binomial theorem
Here we used that is purely imaginary for odd , and that .
Conclusion. Comparing (a) and (b) gives . Hence , which is equivalent to . This proves Theorem 1.1.
Remark 3.1. Since is even, and . Also , so , and therefore descends to . This is a nondegenerate quadratic form on a space of dimension . For a nondegenerate quadratic form on a -dimensional space over , the Arf invariant [1], [3] is characterized by
The subspace is totally singular of dimension , i.e., a totally singular Lagrangian. In characteristic 2 this is stronger than being Lagrangian for the polar form, since the polar form is alternating.
If a totally singular Lagrangian exists, then the Arf invariant of the form is 0: this is exactly the coset argument in (a), which shows that the Gauss sum is positive. (The converse also holds, but we do not need it.) On the other hand, for the Arf invariant of is . Indeed, for we have . So the sum over is twice the corresponding sum over , and by (b) the latter equals .
4 Third proof: the MacWilliams identity at one point
Let
be the weight enumerator of C. The MacWilliams identity [9] states
Since and ,
Now we substitute into Equation (7).
Left-hand side. Every satisfies , so , and hence
Right-hand side. is homogeneous of degree n, and . Therefore
Since , we have , so the right-hand side equals
Conclusion. We obtain . Since , it follows that , and therefore . This proves Theorem 1.1.
5 An application: the shadow of a self-dual code
In this section is a binary self-dual code of length that need not be doubly-even. For we have , so by (6) the map , , is linear. Its kernel is the doubly-even subcode of . Following Conway and Sloane [4], the shadow of is
see also [11]. It is classical that every vector of has weight [4], [11]. The usual proof uses the shadow weight enumerator . We give a proof based on an explicit representative of the shadow and on Proposition 2.2.
Theorem 5.1 ([4]). Let C be a binary self-dual code of length n. Then every vector of has weight congruent to .
Proof. Put . After a coordinate permutation, has a generator matrix with rows , and . Each is odd, and . Define by if and if , and put .
Step 1: . We have for every . Both sides are linear on , so for all . If is doubly-even, then and . Otherwise , so has index 2 in and . Since , we have , and also . As , it follows that , hence .
Step 2: . Let be the number of rows of of weight . Then , and by Proposition 2.2.
Step 3: all shadow vectors. For we have , so . By (1),
This proves the theorem.
Remark 5.2. If is a Type II code, then and , and Theorem 5.1 says . This is Theorem 1.1 again. In contrast to the proof of Theorem 1.1 in Section 2, Theorem 5.1 needs Proposition 2.2 for an arbitrary number of rows of weight .
The residue in Theorem 5.1 gives the classical construction of Type II neighbours [11, Section 5].
Corollary 5.3. Let be a binary self-dual code of length that is not doubly-even, and let be as in the proof of Theorem 5.1. Then and , for any , are two distinct Type II codes of length .
Proof. Let . Then , so by Theorem 5.1, and in particular . Also . Hence is self-orthogonal and is spanned by vectors of weight divisible by 4, so it is doubly-even by (1). Its dimension is , since ; so it is self-dual. Since , each of the two codes meets exactly in . If they were equal, this code would contain and , hence , a contradiction. So the two codes are distinct.
6 Concluding remarks
The first proof uses neither characters nor weight enumerators. Its modulo-8 information comes from the fact that det B is an odd square. The proof then evaluates det B modulo 8 using only the diagonal entries and the total entry sum of B. Compared with [8], it replaces the computation of by this determinant congruence. Compared with [11, Theorem 3(b)], the lift of A is the plain 0/1 lift, which is not corrected to be orthogonal modulo 4. The second proof interprets the length restriction through the Arf invariant, whereas the first detects it directly through an integer determinant congruence. The obstruction is the Arf invariant of the quadratic form q on , which must vanish for a Type II code to exist.
Part (a) of the second proof is exactly the argument that proves the MacWilliams identity, namely Lemma 1.2, carried out at a single point. So the second and third proofs are essentially the same computation, written with and without the weight enumerator.
Gleason's theorem rests on the invariance of under the group of order 192 generated by
The third proof uses and once each, at one point, rather than the whole group. A direct computation gives . Since is homogeneous of degree , invariance under this scalar matrix also forces ; see [5] and [10, Ch. 19].
Construction A sends a Type II code of length n to a positive definite even unimodular lattice of rank n. Theorem 1.1 is therefore the coding analogue of the fact that the rank of an even unimodular lattice is divisible by 8 [12]. The standard proofs of the lattice statement, via theta series or via signatures, are less elementary than the proofs above.
Acknowledgement
This research (J.-L. Kim) was supported in part by the BK21 FOUR (Fostering Outstanding Universities for Research) funded by the Ministry of Education (MOE, Korea), National Research Foundation of Korea (NRF) under Grant No. 4120240415042, Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Science and ICT under Grant No. RS-2025-24534992 and Global - Learning & Academic research institution for Master's-PhD students, and Postdocs(LAMP) Program of the National Research Foundation of Korea(NRF) grant funded by the Ministry of Education(No. RS-2024-00441954).
Use of Generative-AI tools declaration
The author(s) declare(s) they have used Artificial Intelligence (AI) tools in the creation of this article. AI tools used: Claude Opus 5.5(Anthropic). The tool was used to help draft parts of the text and proofs, and to perform numerical checks of the statements. All mathematical contents were verified by the authors, who take full responsibility for it.
References
[1] C. Arf, Untersuchungen über quadratische Formen in Körpern der Charakteristik 2, I, J. Reine Angew. Math. 183 (1941), 148–167.
[2] K. Betsumiya, M. Harada, and A. Munemasa, A complete classification of doubly even self-dual codes of length 40, Electronic Journal of Combinatorics 19(3) (2012), #P18.
[3] D. Cimasoni and G. Simian, On Arf invariants of colored links, Glasgow Mathematical Journal 68 (2026), 147--163.
[4] J. H. Conway and N. J. A. Sloane, A new upper bound on the minimal distance of self-dual codes, IEEE Trans. Inform. Theory 36 (1990), 1319–1333.
[5] N. D. Elkies, Lattices, linear codes, and invariants, Part II, Notices Amer. Math. Soc. 47 (2000), 1382–1391.
[6] A. M. Gleason, Weight polynomials of self-dual codes and the MacWilliams identities, in: Actes du Congrès International des Mathématiciens (Nice, 1970), Tome 3, Gauthier-Villars, Paris, 1971, pp. 211–215.
[7] W. C. Huffman and V. Pless, Fundamentals of Error-Correcting Codes, Cambridge University Press, Cambridge, 2003.
[8] G. J. Janusz, Parametrization of self-dual codes by orthogonal matrices, Finite Fields Appl. 13 (2007), 450–491.
[9] F. J. MacWilliams, A theorem on the distribution of weights in a systematic code, Bell System Tech. J. 42 (1963), 79–94.
[10] F. J. MacWilliams and N. J. A. Sloane, The Theory of Error-Correcting Codes, North-Holland, Amsterdam, 1977.
[11] E. M. Rains and N. J. A. Sloane, Self-dual codes, in: V. S. Pless and W. C. Huffman (eds.), Handbook of Coding Theory, Elsevier, Amsterdam, 1998, pp. 177–294.
[12] J.-P. Serre, A Course in Arithmetic, Graduate Texts in Mathematics 7, Springer, New York, 1973.
[13] J. A. Wood, Spinor groups and algebraic coding theory, J. Combin. Theory Ser. A 51 (1989), 277–313.