Non-existence of a ternary constant weight $(16, 5, 15; 2048)$ diameter perfect code

Ternary constant weight codes of length $n=2^m$, weight $n-1$, cardinality $2^n$ and distance $5$ are known to exist for every $m$ for which there exists an APN permutation of order $2^m$, that is, at least for all odd $m \geq 3$ and for $m=6$. We show the non-existence of such codes for $m=4$ and prove that any codes with the parameters above are diameter perfect.


Introduction
A ternary constant-weight code C of length n, weight w, and minimum distance at least d, or an (n, d, w; M) 3 code, is a set of M words (codewords) over the alphabet {0, 1, 2} with exactly n − w 0s such that every two distinct codewords differ in at least d coordinates. If w = n, then such a code is an unrestricted binary code over the alphabet {1, 2}. We consider the case w = n − 1, which is, as we will see, also connected to binary codes. For this reason, it is convenient to replace the alphabet {0, 1, 2} by { * , 0, 1} and consider words of length n that contain exactly one * ; the set of all such words is denoted by X n , and the set of all binary words of length n is denoted by F n .
The (Hamming) distance d(x, y) between two words x, y ∈ X n ∪ F n is the number of coordinates in which they differ. A word x ∈ X n will also be treated as a pair of binary words differing in exactly one coordinate, for example, 01 * 0 = {0100, 0110}. One of these words is an even-weight word (that is, the number of 1s is even) and the other is an odd-weight word; these are denoted by e(x) and o(x), respectively. Moreover, we define e(C) = {e(c) | c ∈ C} and o(C) = {o(c) | c ∈ C}.
We are here interested in the class of ternary constant weight codes with parameters (n = 2 m , 5, n−1; 2 n−1 /n) 3 . The first nontrivial example of such a code was an (8, 5, 7; 16) 3 code constructed from a Jacobsthal matrix [12,10]. As proved in [8] the existence of a so-called APN (almost perfect nonlinear) permutation {0, 1} m → {0, 1} m implies the existence of an (n = 2 m , 5, n − 1; 2 n−1 /n) 3 code C, where the codes e(C) and o(C) are cosets of binary extended Hamming codes. APN permutations exist for every odd m and for m = 6 (see [4]) and do not exist for m = 2, 4. The two exceptional values leave the existence of (4, 5, 3; 2) 3 and (16, 5, 15; 2048) 3 codes open. Non-existence is trivial in the former case. The latter case is the topic of the current note, where the following main result will be obtained. The paper is organized as follows. In Section 2 we describe a computational proof of Theorem 1. In Section 3 we define the concept of a diameter perfect code and prove that a diameter perfect ternary constant weight code of length n = 2 m , weight n−1 and minimum distance 5 must have cardinality 2 n−1 /n. Corollary 1. There are no diameter perfect ternary constant weight codes of length 16, weight 15 and minimum distance 5.
2 Non-existence of (16, 5, 15; 2048) 3 code Every ternary code of length n and weight n − 1 can be decomposed into binary even and odd codes, as described in the Introduction, but even and odd binary codes cannot in general be combined to get a ternary code. However, for the parameters in question they can, as the next lemma shows. An (n, M, d) code is a binary code of length n, size M and minimum distance d.
Lemma 1. For any even code C 0 and odd code C 1 , both (n = 2 m , 2 n−1 /n, 4) codes, there is an (n = 2 m , 3, n−1; 2 n−1 /n) 3 code C such that C 0 = e(C), C 1 = o(C). Proof. It suffices to show that for any x ∈ C 0 , there is unique y ∈ C 1 with d(x, y) = 1. For any y ∈ C 1 , the ball B(y) = {z ∈ F n | d(y, z) ≤ 1} contains n even words. For distinct words y, z ∈ C 1 , we have B(y) ∩ B(z) = ∅ as C 1 has minimum distance 4, so ∪ y∈C 1 B(y) has cardinality (2 n−1 /n) · n = 2 n−1 and thereby contains all even words of F n .
Therefore, for every even x ∈ F n , there is unique y ∈ C 1 with d(x, y) = 1. Obviously, this holds for x ∈ C 0 . Finally, it is easy to check the claimed minimum distance.
The (n = 2 m , 2 n−1 /n, 4) codes are known as extended 1-perfect binary codes. This construction only guarantees minimum distance 3. With an additional restriction we get minimum distance 5.
Lemma 2. Let n = 2 m . A set C ⊂ X n is an (n, 5, n − 1; 2 n−1 /n) 3 code if and only if the following two conditions holds.
(2) If x 1 , x 2 ∈ e(C) and y 1 , Proof. Lemma 1 takes care of all parts but the minimum distance and Condition (2). Two codewords in C either have the * in the same coordinate or in different coordinates. In the former case, the words in e(C) obtained from the codewords will be at distance at least 5 from each other, that is, at least 6 since the distance is even. Then the If part of Condition (2) is not fulfilled. In the latter case, x 1 − y 1 = x 2 − y 2 , since these differences give a word with a 1 in the coordinate of the * . These argument can be reversed, so equivalence holds.
However, for C 1 we were not able to utilize the classification, since we are not free to choose arbitrary equivalence class representatives, and iterating over all possible codes is not feasible. Instead we search for C 1 with a direct approach.
Let W 0 , W 1 consist of all even and odd weight words of F 16 , respectively. By the argument in the proof of Lemma 1, for each x ∈ W 0 there is a unique y ∈ C 1 , with d(x, y) = 1. We shall search for a set C 1 which satisfies this condition.
The search can be formulated as an instance of the exact cover problem. In the exact cover problem we have sets S and U and a relation R ⊂ S × U. The task is to find a subset Q ⊂ U such that for any x ∈ S there is unique We use Condition (2) from Lemma 2 to prune the search. Not only does this restrict the search and speed it up by many orders of magnitude, but it also guarantees that the results are relevant to the problem at hand.
For further improvement, we can attack this problem by first solving some of its subproblems. Given an instance of the exact cover problem with parameters S, U and R, consider a set S ′ ⊂ S, and let U ′ = {u ∈ U | (x, u) ∈ R for some x ∈ S ′ } and R ′ = R| S ′ ×U ′ . Now we can first find all solutions Q ′ of the instance with parameters S ′ , U ′ , R ′ , and then extend those in all possible ways to solutions Q ⊃ Q ′ of the original instance with parameters S, U, R. In particular, if the subproblem has no solutions, neither has the original instance.
We emphasize that the approach does not affect the solutions found, it only affects the performance of the algorithm. We are free to choose S ′ arbitrarily and may proceed via a sequence of subproblems, for S ′ ⊂ S ′′ ⊂ S ′′′ ⊂ · · · ⊂ S.
We choose S ′ = {0}. Let e i be the word of weight 1 with a 1 in the ith coordinate. There are clearly 16 solutions for the instance induced by S ′ , one for each possible word e i . Note, however, that it suffices to consider one solution from each orbit of the symmetry group of C 0 . Specifically, if there is a permutation π such that π(C 0 ) = C 0 and π(Q 1 ) = Q 2 for two solutions Q 1 and Q 2 , then one of the solutions can be ignored. This observation was not used for larger subproblems.
The subsequent subproblems are defined based on the solution of S ′ , e i . We let S ′′ = {x ∈ W 0 | d(x, e i ) = 3, x 1 = e i 1 }, where a subindex indicates the 1 Available at arXiv:0806.2513 and http://www.iki.fi/opottone/codes value of that particular coordinate. Finally, S ′′′ = {x ∈ W 0 | d(x, e i ) = 3}. A reader familiar with design theory may note that a solution for S ′′ is equivalent to a Steiner triple system of order n − 1, and a solution for S ′′′ is equivalent to a Steiner quadruple system of order n.
The following numerical values depend on the representatives of the equivalence classes of codes; the codes from http://www.iki.fi/opottone/codes were used here. Out of the 2165 codes C 0 , only 102 admit a solution to some of the exact cover instances induced by S ′′ . In no case is there a solution for the instances induced by S ′′′ . The computation took about 24 CPU hours on a modern laptop. The exact cover instances were solved with the libexact library [7]. The symmetries of codes were computed with bliss [6].

Diameter perfect codes
This section is devoted to proving the following result. First we need to define a diameter perfect code [1], the concept of which is based on the following generalized pigeonhole principle.
Lemma 3. Consider a set S and a system A of subsets of S of cardinality M with the property that every element of S belongs to a fixed (independent on the choice of the element) number of sets from A. Moreover, let C ⊂ S be a set that intersects any set from A in at most k elements. Then Proof. Assume that each element of S occurs in m subsets in A. Double counting the occurrences of the elements in S gives |S|m = M|A|. Similar double counting for the elements in C gives |C|m ≤ k|A|. The claim follows.
Let C ⊂ X n be a code with minimum distance d and let A ⊂ X n be a set of diameter d − 1 (that is, the mutual distances between its elements do not exceed d − 1). The set X n has a group of isometries that acts transitively on its elements, that is, for any x, y ∈ X n there is an isometry φ : X n → X n such that φ(x) = y. By applying all isometries to A we get a set system A of codes with diameter d − 1, and C intersects each set of A in at most one codeword. By Lemma 3, |C| · |A| ≤ |X n |.
If this bound holds with equality, then C is known as a diameter perfect code.
Then A and C have maximal cardinalities among codes of diameter d − 1 and minimum distance d, respectively. Next we present some auxiliary results.
Lemma 4. A code D ⊂ X n , n ≥ 16, with minimum distance 3 and diameter at most 4 (that is, only the distances 3 and 4 are allowed between two different words from D) has cardinality |D| ≤ n. Proof. Denote by D i the set of words in D with * in the ith coordinate. We shall first determine an upper bound on |D i |. We delete the ith coordinate and extend D i with a parity bit to obtain an equidistant binary code with length n and distance 4. We call the code trivial if each coordinate has |D i | or |D i | − 1 equal values, and nontrivial otherwise. Deza [5] showed that the size of an nontrivial equidistant binary code with distance 2k is at most k 2 + k + 2 (which is 8 for k = 2). The size of a trivial equidistant binary code is easily seen to be at most n/k, that is, n/2 here. Combining these two cases, we get the bound |D i | ≤ n/2 for n ≥ 16. If |D i | ≤ 1 for every i = 1, . . . , n, then obviously |D| = n i=1 |D i | ≤ n. The rest of the proof, where we assume that |D i | > 1 for at least one value of i, is divided into three subcases.
(1) For some i, three of the words in D i have mutual distances 4. Without loss of generality, i = 1 and the three codewords are * 110 · · · 0, * 00110 · · · 0 and * 0000110 · · · 0. By looking at the distances to these three words, we see that the only possible codewords of D \ D 1 have the form 000 · · · 0 * 0 · · · and 100 · · · 0 * 0 · · · . Moreover, a consideration of the mutual distances between those 2(n − 1) words reveals that no more than two can be taken into a set with mutual distances at least 3. So, |D| ≤ |D 1 | + 2 ≤ n/2 + 2 ≤ n for n ≥ 16.
(2) For some i, D i contains two words at distance 4 from each other but no three such words. Now |D i | ≤ 4, since with size greater than 4, there would be at least three words with the same parity in the binary part and these three words would have mutual distances 4.
It follows that a word in D \ D 1 is at distance 1 from at least one binary word having exactly two 1s in coordinates 2 to 5 and 0s in coordinates 6 to n. With two possible values in the first coordinate, the number of such binary words is 2 4 2 = 12. Since no two words in D \ D 1 can be at distance 1 from the same word, we have |D \ D 1 | ≤ 12, so |D| = |D \ D 1 | + |D 1 | ≤ 12 + 4 ≤ n.
(3) For every i, D i does not contain words at mutual distance 4. Now |D i | ≤ 2, and we may assume, without loss of generality, that |D 1 | = 2 and D 1 = { * 0000 · · · 0, * 1110 · · · 0}. Let No word in D ′ can have 1s in coordinates 5 to n, and no such word can have the values 000 and 111 in coordinates 2 to 4. There are then 12 possible values in the first four coordinates which come in six pairs of complements. Since the codewords of such a pair cannot belong to different sets D i (otherwise the mutual distance would be 4 + 2 = 6), we get that Proposition 1. If B ⊂ X n , n = 2 m ≥ 8, is a set of diameter at most 4, then |B| ≤ n 2 . The inequality is tight, that is, a set of diameter 4 and cardinality n 2 exists. Proof. The set B = {y ∈ X n | d(0, y) ≤ 2} (2) has diameter 4 and cardinality n 2 and thereby proves the existence part. For n = 8, an (8, 5, 7; 128) 3 code C exists [12,10]. With B given by (2), |C| · |B| = |X 8 |, so B has maximum cardinality in this case by (1). (Actually, this argument works for all m for which (n = 2 m , 5, n − 1; 2 n−1 /n) 3 codes are known to exist.) For n ≥ 16, let F be an (n = 2 m , 3, n − 1; 2 n−1 ) 3 code [12,11,13]. Form A by applying all isometries to F , whereby the sizes of the sets in A is M = 2 n−1 . By Lemma 4, an arbitrary set B ⊂ X n with diameter at most 4 intersects each set of A in at most k = n codewords. An application of Lemma 3 with C = B then gives that |B|/(n2 n−1 ) ≤ n/2 n−1 , that is, |B| ≤ n 2 . Now Theorem 2 is obvious: use (2) as the set A in the definition of diameter perfect codes. Then |C| = |X n |/|A| = 2 n−1 /n. In particular, a hypothetical diameter perfect code C in X 16 would meet |C| = 2 15 /16 = 2048. By Theorem 1, such a code does not exist, which proves Corollary 1.
Proposition 1 solves the so-called diametric problem for the metric space X n , n = 2 m ≥ 8 and diameter 4. For the Johnson space and the q-ary Hamming space, the diametric problem for an arbitrary diameter was completely solved in [2,3].