Heden 2007
Heden 2007
(2008) 46:45–56
DOI 10.1007/s10623-007-9133-y
Olof Heden
Abstract Let p be a prime number and assume p ≥ 5. We will use a result of L. Redéi
to prove, that every perfect 1-error correcting code C of length p + 1 over an alphabet of
cardinality p, such that C has a rank equal to p and a kernel of dimension p − 2, will be
equivalent to some Hamming code H . Further, C can be obtained from H , by the permutation
of the symbols, in just one coordinate position.
1 Introduction
I was introduced to perfect codes in 1965 by my father (G. Heden, private communication),
who showed me the following example:
1 1 1 x x x 2 2 2
1 x 2 1 x 2 1 x 2
1 x 2 x 2 1 2 1 x
1 x 2 2 1 x x 2 1
The columns in the above example have the property, that any possible column in the three
symbols 1, x, 2 differs, in at most one position, from a unique column in the set above. And
thus, it will be an example of a perfect 1-error correcting ternary code of length four.
A general definition of a perfect code is the following.
O. Heden (B)
Department of Mathematics, KTH, Stockholm 100 44, Sweden
e-mail: [email protected]
123
46 O. Heden
Let A be a finite set of q symbols. A perfect e-error correcting q-ary code of length n is
a subset C of words of the direct product An
C ⊆ A × A × · · · × A = An ,
such that any word x̄ of length n, differs in at most e positions from a unique code word c̄ of
C. A code C is a perfect code if C is a perfect e-error correcting q-ary code of length n for
some parameters e, q and n.
In the example above, A = {1, x, 2}, and so q = 3, and further n = 4 and e = 1. It is also
rather easy to check, that if you allow permutations of the coordinate set and permutations
of the set of symbols in some of the positions, then any perfect code with these parameters
will be unique.
More precisely and more general, we define C and C to be equivalent, if we can obtain
C from C, by a sequence of the following two operations:
(i) a permutation π of the set of n coordinate positions.
(ii) permutations τi of the set of symbols in position i, for i = 1, 2, . . . , n.
The first perfect codes were found by Hamming [5]. He found a rather big class of per-
fect 1-error correcting binary codes. In 1948 Golay [4] found one perfect 2-error correcting
3-ary code of length 11 and one perfect 3-error correcting binary code of length 23. In 1973,
Tietäväinen [18] and independently Leontiev and Zinoviev [10], showed that for no other
parameters, in the prime power case, there will be perfect e-error correcting codes with e ≥ 2.
Let us also mention, that the case of perfect q-ary codes, where q is not a power of a prime
number, was considered by Best, who showed that there are no unknown perfect e-error
correcting codes over arbitrary alphabets for e distinct from 1, 2, 6, 8, see [1]. The case when
e = 1 and q not a prime power is known to be extremely difficult.
Perfect 1-error correcting binary codes have been extensively studied. There are many
constructions leading to distinct equivalence classes of such codes. Important contributors
are here Vasil’ev, Zinoviev, Solov’eva, Phelps, Hergert and Avgustinovich, see for example
the book On Perfect Codes and Related Topics [17] by Solov’eva for references, as well as
for elementary definitions and facts on perfect codes.
Perfect 1-error correcting q-ary codes, where q = 2 is a prime number or a power of a
prime number, have been less studied. Constructions are given e.g. by Schönheim [16], Lind-
ström [11], Phelps [12] and Etzion [3]. Further, there are some recent classification results
by Phelps, Villanueva and Rifà, see [13] and [14].
It can by rather easy combinatorial arguments be shown, that the shortest possibly length,
for which there exists a non trivial perfect 1-error correcting q-ary code, is q + 1. This par-
ticular case is not at all covered by the results of Phelps, Rifà and Villanueva [14,15]. The
purpose of this study, is to give a small result in this case, showing that a particular class of
these codes are equivalent to the linear perfect codes, that we now describe.
We will need a description of a linear perfect 1-error correcting q-ary code of length q +1.
Let Fq be a finite field with the q elements
Fq = {0, α1 , α2 , . . . , αq−1 }.
123
On perfect p-ary codes of length p + 1 47
The code H , so constructed in the above proposition, will here be called a Hamming code,
although we are aware of the fact that by a Hamming code in general, is meant any linear
perfect code.
To describe the results of this paper, we need the concepts of rank and kernel.
We consider Fqn as a n-dimensional vector space over the finite field Fq . The linear span
of the code words of a code C, will be a subspace C of Fqn . The dimension of this subspace
will be the rank of C:
rank(C) = dim(C).
A period of a q-ary code C of length n, is a word p̄ ∈ Fqn satisfying
p̄ + c̄ ∈ C for all words c̄ ∈ C.
If q = p a prime number, then the set of all periods of a perfect code will be a subspace of
Fpn . This subspace will be the kernel of C, denoted by ker(C). In case q = p t , with t > 1,
the definition will necessarily be different, see e.g., [14]. If the all zero word 0̄ belongs to C,
as we will always assume below, then ker(C) is a subset of C.
We now give an example of a perfect 1-error correcting 5-ary code of length 6, which has
rank 5 a kernel of dimension 3 and which is equivalent to a Hamming code.
Hence, dim(C) ≤ 5, and as C is non linear and contains 54 elements, the only possibility
will be that the rank of C equals 5.
It must be remarked that in the binary case, equivalent perfect codes have kernels of the
same dimension and they have also the same rank, if both codes contain the all zero word.
The purpose of this paper is to show the following theorem:
Theorem 1 Let p be a prime number and assume p ≥ 5. Any perfect 1-error correcting
p-ary code C of length p + 1, rank p and with a kernel of dimension p − 2 is equivalent to
a linear perfect code.
It is easy to see, and must be remarked, that every perfect 1-error correcting ternary code
of length four and containing the all zero word will be linear and equivalent to the code in our
first example. Let us also remark that in case q = p t is a prime power, with t ≥ 2 and q ≥ 9,
perfect 1-error correcting codes of length q + 1, that are not equivalent to any linear codes,
123
48 O. Heden
but group codes, were found by Lindström in 1969, see [11]. Such codes, including the case
q = 8, were also constructed by Phelps et al. [14]. Indeed, it would be very interesting to
find an example of a perfect code of length q + 1 that is not equivalent to any group code.
We have not yet found any direct proof of Theorem 1. In our proof we will use the tech-
nique with super duals of codes. This method has been shown to be useful to find and prove
results concerning perfect 1-error correcting binary codes, see e.g., [7] and [8]. When using
the super dual method, it turned out that the following result of L. Redéi was useful:
Theorem 2 (Redéi [12, Satz 24’, p. 237]) If p is a prime number, then for any non linear
function f : Fp → Fp , the number of distinct differential quotients
f (x) − f (y)
, x, y ∈ Fq and x = y,
x−y
will be at least (p + 3)/2.
In fact, by using the super dual property, and the above theorem, the proof of Theorem 1
is close to a triviality. So one further purpose of this paper is to demonstrate how the super
dual method can be used to, rather easy, obtain results also on perfect q-ary codes.
2 A group algebra
The results in this section concern codes in Fpn where p is a prime number and n is arbitrarily
chosen. We will use the fact that Fp = Z/pZ, and the notation
Fp = {0, 1, 2, 3, . . . , p − 1}.
Let C [x1 , . . . , xn ] denote the set of all linear combinations, over the complex number field
C , of all monomials
Let S1 (0̄) denote the set of words at distance at most one from the all zero word. For example
we thus get that
n
p−1
S1 (0̄)(x̄) = 1 − n + (1 + xi + xi2 + · · · + xi ). (2)
i=1
The following lemma follows immediately from the definition of multiplication in C [x1 ,
. . . , xn ]. It must be remarked that this lemma and the following two lemmas were already
proved in [6].
123
On perfect p-ary codes of length p + 1 49
1
n
(1 + ϑ −ti xi + ϑ −2ti xi2 + ϑ −3ti xi3 + · · · + ϑ −(p−1)ti xi
(p−1)
yt¯(x̄) = ).
pn
i=1
The following lemma is easy to verify, see e.g., [6]:
Lemma 2 The set C [x1 , . . . , xn ] is a vector space of dimension p n over the complex number
field and the set of vectors yt¯(x̄), for t¯ ∈ Fpn , constitutes a set of base vectors for this vector
space.
Hence any element C(x̄) can in a unique way be expanded
C(x̄) = At¯(C)yt¯(x̄), (3)
t¯∈Fpn
for some coefficients At¯(C) ∈ C . In accordance with the following lemma, these coefficients
will be called the Fourier coefficients of C.
Lemma 3 For any two words t¯ and t¯ of Fpn ,
yt¯(x̄) if t¯ = t¯
yt¯(x̄)yt¯ (x̄) =
0 else
Proof Straightforward verifications, see e.g. [6].
For any subset C of Fpn , the Fourier coefficients At¯(C) of C may be calculated by a
substitution:
At¯(C) = C(ϑ t1 , ϑ t2 , . . . , ϑ tn ). (4)
We will need the following proposition. Note that in this proposition, n will be equal to p + 1.
p+1
Proposition 2 For any perfect 1-error correcting code C in Fp
At¯(C) = 0 and t¯ = 0̄ ⇒ w(t¯) = p.
Proof We first note that
p if si = ti
1 + ϑ −ti ϑ si + ϑ −2ti ϑ 2si + · · · + ϑ −(p−1)ti ϑ (p−1)si =
0 else
From Lemma 1 and the definition of a perfect code, we get that
S1 (0̄)(x̄)C(x̄) = p n y0̄ (x̄).
Hence, from Lemma 3 and Eq. 3 we thus get that
At¯(C) = 0 and t¯ = 0̄ ⇒ At¯(S1 (0̄)) = 0.
By using the relation (4) and Eq. 2, we deduce in this case that
At¯(S1 (0̄)) = 1 − (p + 1) + (p + 1 − w(t¯))p = (p − w(t¯))p,
and the proposition is proved.
123
50 O. Heden
In the next proposition, we need the definition of the dual space D ⊥ of a subspace D of
the vector space Fpn :
123
On perfect p-ary codes of length p + 1 51
For any code C and any t¯ ∈ ker(C)⊥ we let f¯t¯(C) denote the following vector:
We observe that for any word t¯ ∈ ker(C)⊥ , the vector f¯t¯(C) = (f0 , f1 , . . . , ft ) is indepen-
dent of the choice of coset representatives of the kernel of C.
Further, the dot product is linear, and hence
Hence, from Eq. 6 we may thus deduce that we get all non-zero fourier coefficients At¯(C)
of C and thus also all information of C, by considering the vectors f¯t¯(C) for a set of base
vectors t¯ for the dual space of the kernel of C.
Proof As ϑ is a p:th root of unity distinct from 1, we get that ϑ is a zero of the polynomial
x p−1 + x p−2 + · · · + x + 1.
As p is a prime number, it will follow from [19, p. 177] (or [9, p. 204]), that this polynomial
is irreducible in the polynomial ring Q[x], where Q is the field of quotients.
The next proposition concerns perfect p-ary codes of length p + 1 and with a kernel of
dimension p−2. The number of words of C will in this case be p p−1 and hence the number of
cosets in C of the kernel will be exactly p. Thus, if 0̄ belongs to C, we may conclude that for
any t¯ ∈ ker(C)⊥ , f¯t¯(C) = (0, f1 , . . . , fp−1 ), for some sequence of integers f1 , . . . , fp−1 ,
such that 0 ≤ fi ≤ p − 1, i = 1, 2, . . . , p − 1.
p+1
Proposition 4 Assume that C is a perfect code in Fp containing the all zero word and
that the dimension of the kernel of C equals p − 2.
For any f¯t¯(C) = (0, f1 , . . . , fp−1 ) the following is true:
Proof If w(t¯) = p and t¯ = 0̄ then, by Proposition 2, the Fourier coefficient At¯(C) must be
equal to zero. Hence, if further t¯ ∈ ker(C)⊥ we will get by Eq. 6, that
t
ϑ ḡi ·t¯ = 0.
i=0
The proposition now follows from Lemma 5, as we may assume that ḡ0 = 0̄.
123
52 O. Heden
It will be convenient to consider a concatenated matrix associated to every perfect code. This
concatenated matrix will here be called the super dual matrix of the code. For the binary case,
this concept was introduced in [7].
Let t¯1 , t¯2 , . . . , t¯κ be any set of base vectors for the dual space of the kernel of C and let
f¯t¯(C) have the same meaning, as in the previous section. A generator matrix for the super
dual of the perfect code C or a super dual matrix of C will be the matrix:
⎡ ⎤
t¯1 f¯t¯1 (C)
⎢ t¯2 f¯t¯ (C) ⎥
⎢ 2 ⎥
(T |F ) = ⎢ . .. ⎥ .
⎣ .. . ⎦
¯tκ f¯t¯κ (C)
The super dual of C is defined to be the row space of this matrix.
Let col(F ) denote the set of columns of the matrix F .
Lemma 6 If C is a perfect code in Fpn , with a super dual matrix (T |F ), then
4 Proof of Theorem 1
p+1
In this section, we will assume that C is a perfect code in Fp of rank p and with a kernel
of dimension p − 2. We also assume that the all zero word belongs to C.
p+1
As the vector space Fp has dimension p + 1 over the finite field Fp , we get that
dim(ker(C)⊥ ) = 3.
By Proposition 3, there are words t¯, s̄ and ū, that constitute a set of base vectors for ker(C)⊥
and such that
At¯(C) = 0, As̄ (C) = 0, Aū (C) = 0.
Trivially, any vector in the dual space of C will belong to the dual space of ker(C). We
may thus also assume that e.g., t¯ ∈ C⊥ . This implies that
f¯t¯(C) = (0, 0, 0, . . . , 0).
123
On perfect p-ary codes of length p + 1 53
Theorem 3 (Redéi [12, Satz 24", p. 241]) If p is a prime number, then for any two maps f
and g from Fp to Fp such that the following three conditions are true
We now prove that the functions f and g, defined in Eq. (9) and with f (0) = 0 and
g(0) = 0, will satisfy the conditions of the above theorem.
As the rank of the code C is greater than p − 1, we may conclude, that for some elements i
and j , f (i) = 0 and g(j ) = 0. Else, the vectors f¯s̄ and f¯ū would not be linearly independent.
Hence the condition (i) of the theorem is satisfied.
From Eq. 6 and Lemma 5, as both As̄ (C) and Aū (C) are non zero, follows that the
condition (ii) of the theorem is satisfied.
Finally also the condition (iii) must be satisfied, as for any two distinct coset representa-
tives ḡi and ḡj of ker(C) in C in Eq. 5,
T ḡiT = T ḡjT ,
compare Eq. 8.
123
54 O. Heden
As the condition (ii) of the Redéi Theorem is satisfied, it follows from Proposition 4, that
w(s̄) = p and w(ū) = p, and further, that the same must be true if we add multiples of the
vector t¯. Hence
This implies that the generator matrix of the super dual of C, after a suitable permutation of
the set of coordinate positions, can be written
⎡ ⎤
0 1 1 1 ··· 1 0 0 0 ··· 0
⎣1 0 1 2 · · · p − 1 0 f (1) f (2) · · · f (p − 1) ⎦ .
α π(0) π(1) π(2) · · · π(p − 1) 0 g(1) g(2) · · · g(p − 1)
We now are able to prove that π must be a linear function. Assume that the function π is
not a linear function. Let denote the set of elements µ such that
π(ξ ) − π(η)
−µ = , for some ξ, η ∈ Fp , such that ξ = η.
ξ −η
Then, as p is a prime number, by the other theorem of Redéi, Theorem 2,
| | ≥ (p + 3)/2.
and let
v̄ = s̄ + µ0 ū − γ0 t¯.
123
On perfect p-ary codes of length p + 1 55
From Eq. 11, we get that w(v̄) ≤ p − 1. From the fact that π is assumed to be non linear,
we get that v̄ = 0̄. Further, from Eq. 10 we get that
{0} ∪ {f (ξ ) + µ0 g(ξ ) − γ0 · 0 | ξ ∈ Fp } = Fp ,
and consequently, by Lemma 5, we may conclude that Av̄ (C) = 0. We have thus proved that
if π is non linear, then there is an element v̄ such that
This contradicts Proposition 2 and we may thus conclude that π has to be linear.
As the function π now is proved to be linear, we can, by using a sequence of suitable ele-
mentary row operations, achieve a generator matrix for the super dual of C of the following
shape: ⎡ ⎤
0 1 1 1 1 ... 1 0 0 0 0 0 0
(T |F ) = ⎣ 0 0 1 2 3 . . . p − 1 0 α1 α2 α3 . . . αp−1 ⎦ . (12)
1 0 0 0 0 ... 0 0 β1 β2 β3 . . . βp−1
It follows from Proposition 4, as the weights of the second and third row, of the matrix T in
the above Eq. 12, are not equal to p, that
If C is nonlinear, then we get from the super dual property that the kernel of C equals the
null space N (T ) of the matrix T . Further we get that
Let
0 1 1 1 1 ··· 1
H = .
1 0 1 2 3 ··· p − 1
We then get that the null space of T satisfies
p+1 0
N (T ) = x̄ = (0, x2 , x3 , . . . , xp+1 ) ∈ Fp | H x̄ T = .
0
By Lemma 6 and especially Eq. 8, we then get that C is the union of the null space N (T )
of the matrix T and cosets of N (T ) with coset representatives ḡi such that
⎡ ⎤
0
T ḡi = ⎣ αi ⎦ ,
βi
By this operation, the perfect code C is transformed into a perfect code χ(C) equivalent to
C and the set of coset representatives ḡi , i = 1, 2, . . . , p − 1, is mapped onto the set of non
p+1
zero words of a subspace of Zp . This implies that χ(C) is the Hamming code, as defined
in Proposition 1.
Theorem 1 is proved.
123
56 O. Heden
5 Remarks
The corresponding problem for binary codes is almost trivial. In F2n , if a set C ⊆ F2n is a
union of a linear subspace L of F2n and a coset of L, then also C will be a linear subspace.
We have used rather deep results, the Redéi Theorem and a result about irreducible poly-
nomials over Q[x], to prove a rather weak result, that all perfect codes of length p + 1, rank
p and with a kernel of dimension p − 2 are equivalent to linear perfect codes. Indeed, it
would be interesting to find a direct proof, avoiding these results.
Another more interesting, and actually a most interesting problem, would be to find and
analyze a perfect code of length p, rank p and with a kernel of dimension p − 2.
Acknowledgments I am grateful to my father Göran Heden, who introduced me to the beautiful subject of
perfect codes, and to my thesis supervisor Bernt Lindström, who convinced me in 1973, that perfect codes is
a serious mathematical field, by letting me know about the result of Tietäväinen [18].
References
1. Best M.R.: Perfect codes hardly exist. IEEE Trans. Inform. Theory 29(3), 349–351 (1983).
2. Blokhuis A., Lam C.W.H.: More coverings by rook domains. J. Combin. Theory Ser. A 36, 240–244
(1984).
3. Etzion T.: Nonequivalent q-ary perfect codes. SIAM J. Discrete Math. 9(3), 413–423 (1996).
4. Golay M.J.E.: Notes on digital coding. Proc. IRE 37 (1949), Correspondence 657.
5. Hamming, Error detecting and error correcting codes. Bell Syst. Tech. J. 29, 147–160 (1950).
6. Heden O.: A generalised Lloyd Theorem and mixed perfect codes. Math. Scand. 37, 13–26 (1975).
7. Heden O.: Perfect codes from the dual point of view I. submitted to Discrete Math.
8. Heden O.: A full rank perfect code of length 31. Des. Codes Cryptogr. 38, 125–129 (2006).
9. Lang S.: Algebra. Addison-Wesley Publishing Company, Reading (1965).
10. Leontiev V.K., Zinoviev V.A.: Nonexistence of perfect codes over galois fields. Problems Inform. Theory
2(2), 123–132 (1973).
11. Lindström B.: On group and nongroup perfect codes in q symbols. Math. Scand. 25, 149–158 (1969).
12. Phelps K.T.: A general product construction of perfect codes. SIAM J. Algebra Discrete Method. 4,
224–228 (1983).
13. Phelps K.T., Villanueva M.: Ranks of q-ary 1-perfect codes. Des. Codes Cryptogr. 27(1–2), 139–144
(2002).
14. Phelps K.T., Rifà J., Villanueva M.: Kernels and p-kernels of p r -ary 1-perfect codes. Des. Codes Cryptogr.
37(2), 243–261 (2005).
15. Rédei L.: Lückenhafte Polynome über endlischen Körpern. Birkhäuser verlag Basel und Stuttgart (1970).
16. Schönheim J.: On linear and nonlinear single-error-correcting q-ary perfect codes. Inform. Control 12,
23–26 (1968).
17. Solov’eva F.I.: On Perfect Codes and Related Topics. Com2 Mac Lecture Note Series 13, Pohang (2004).
18. Tietäväinen A.: On the nonexistence of perfect codes over finite fields. SIAM J. Appl. Math. 24, 88–96
(1973).
19. van der Waerden B.L.: Algebra, Erster Teil, Siebte Auflage der Modernen Algebra. Springer-Verlag,
Berlin (1966).
123