On extendibility of additive code isometries

For linear codes, the MacWilliams Extension Theorem states that each linear isometry of a linear code extends to a linear isometry of the whole space. But, in general, it is not the situation for nonlinear codes. In this paper it is proved, that if the length of an additive code is less than some threshold value, then an analogue of the MacWilliams Extension Theorem holds. One family of unextendible code isometries for the threshold value of code length is described.


Introduction
Error-correcting codes are used to reliably transmit data over a noisy communication channel. The noise in the channel can erase information in the message or change it. To protect it, the idea is to encode the message by adding additional information, which in case of corruption should help to recover it. This can be done by dividing data into parts and encoding each part into a codeword separately. The set of all possible codewords is called a block code, or simply a code. The codeword can be changed while transmitting and differ slightly from the original one. To recover the corrupted codeword, one has to find the most "similar" among all elements in the code. The distance between codewords, which equals the number of positions with different digits, is called the Hamming metric. A set of all possible codewords, along with all corrupted ones, is a space over the alphabet, usually considered to be a finite field. The code is a subset of the space with the Hamming metric.
While studying different codes, the most important aspects are their metric parameters: distribution of the distance between codewords, the smallest distance between elements in code, distance of codewords to zero, etc. These parameters determine how many errors the code can detect and correct. The description of code isometries is fundamental because it helps to identify codes with equal metric parameters. Moreover, results based on the properties of weight and distance enumerators, that one can find in [8,Ch.5,6], could be translated without any changes from a code to all isometric codes.
Besides the metric, codes can have additional algebraic structures, for example the structure of a vector space or a group. In terms of category theory, an isomorphism of a code is a map between codes that preserves the metric and its algebraic structure. The most developed are linear codes. A code is said to be linear if it is a space over the alphabet. There is a full description of linear code isomorphisms. The famous MacWilliams Extension Theorem claims that every linear code isomorphism extends to a linear isomorphism of the whole space. The proof of the MacWilliams Extension Theorem firstly appeared in the works of MacWilliams and it was later refined by several authors. Namely, Ward and Wood greatly simplified it, using a character theory approach (see [10]).
In the case where the linearity of a code is not required, the situation is more complicated. Unlike the linear codes, there are nonlinear codes with an isomorphism that does not extend to an isomorphism of the whole space. In general, the problem of description of code isomorphisms for the nonlinear case is difficult. Nevertheless, considering some classes of codes, it can be solved in particular cases.
For example, in [1], [9] and [6] authors describe a lot of code families that satisfy extendibility property. They also observe various classes that do not satisfy it. Among the studied families are some subclasses of codes that achieve the Singleton bound (MDS codes, see [8, p. 20]), some subclasses of codes with equal distance between codewords (equidistant codes) and some perfect codes (see [8,Ch. §11]).
In this paper we focus our attention on the class of additive codes and their isomorphisms. An isomorphism of an additive code is an isometry that preserves the additive structure of a code (is a group isomorphism). It allows us to use effectively methods of character theory. Going further, we also observe isomorphisms of sublinear codes (in other words, codes linear with respect to some proper subfield of the alphabet).
Nonlinear codes are not widely used in practice and are less developed, but it appears that additive codes (with additional requirement of a special kind of self-orthogonality) naturally describe quantum stabilizer codes that are used to protect quantum information (see [5]). The description of quantum code isometries greatly depends on the description of additive code isomorphisms.
The main result of this paper can be formulated in the following theorem.
Main Theorem. Let L be a finite field and let K be a proper subfield of L. Let m ≤ |K| and C be a K-linear code in L m . Then any code isomorphism extends to an isomorphism of the whole space, considered as K-space.
We determine the length threshold for which an analogue of the MacWilliams Extension Theorems for additive codes holds. The result of the Main Theorem cannot be improved by increasing the bound on the dimension of the space. We give an example of codes with an unextendible isomorphism for any fields L and K. The full description of the unextendible isomorphisms for codes with length equal to |K| + 1 is postponed to a forthcoming paper.

Basics of coding theory
In this section we briefly describe the basics of the coding theory and introduce its terminology. Let L be a finite field and let m be a positive integer. The Hamming weight is a function wt : L m → {0, . . . , m} that counts the number of nonzero coordinates in vector, wt(x) = |{i | x i = 0}|, for x ∈ L m . The Hamming distance is defined as ρ : L m × L m → {0, . . . , m}, ρ(x, y) = wt(x − y), and it is a metric. The space L m with the Hamming metric is called the Hamming space. In the theory of error-correcting codes a code C is a subset of the Hamming space L m . The finite field L is called the alphabet and the number m is called the length of code. The elements of C are called the codewords.
The procedure of error correction consists in finding the closest element in C for a given vector in L m . In general, it is equivalent to the exhaustive search in code. It may be simplified, if we additionally assume the code to be a linear subspace of L m . In this case, a code can be represented by its k × m generator matrix G over L, where k = dim L C. The linear structure allows us to use algebraic methods in finding and description of good codes.
The theory of nonlinear codes is not well developed because of the issues related to their practical usage. But, for example, additive codes, which we observe in this paper, are used in quantum coding theory. Since additive codes are linear in weaker sense (F p -linear for some prime p), some tools of linear algebra can be used.
Let K be a subfield of L. We observe codes in L m that are K-linear. When K = F p , for a prime p, a code is additive, and when K = L, a code is linear. In general, we call K-linear codes sublinear. Obviously, any sublinear code is automatically additive.
An isometry of C ⊆ L m is a map f : C → L m that preserves the Hamming distance. For the isometry f of C the image f (C) is also a code in L m . In case C is a K-space and f is K-linear map, the image f (C) is a K-space. If f is a K-linear map, then f is an isometry if and only if f preserves the Hamming weight.
In [4] there is presented a categorical approach to the notion of linear code isometries. By analogy, we can define the category of K-linear codes in L m (for some fixed K). The objects of the category are K-linear codes, and morphisms are K-linear contracting maps between codes (for every x ∈ C : wt(f (x)) ≤ wt(x)). The categorical isomorphisms of K-linear codes is a K-linear isometry between two codes.

Isomorphisms of space
As we noted above, the case of linear codes and linear isomorphisms has already been described. Here we briefly give the main results. Recall the following notions: for a field F and F -spaces U and V we denote by Hom F (U, V ) the space of all F -linear maps from U to V . Let Aut F (U) denote the group of all F -linear automorphisms of U.
Let F be a finite field. A map f : F m → F m is called monomial, if there exist π ∈ S m and c 1 , c 2 . . . , c m ∈ F \ {0} such that for all u ∈ F m : It is easy to see, that a monomial transformation is a linear isometry and, in the other direction, every linear isometry of the space F m is a monomial map. Now we can think about linear code isomorphisms as monomial maps. The description of linear code isomorphisms follows.
Theorem 1 (MacWilliams Extension Theorem, see [10]). Let C ⊆ F m be a linear code. Each linear isomorphism of C extends to a monomial map.
Considering the arguments above, the MacWilliams Extension Theorem claims that any linear isomorphism of a code can be extended to a linear isomorphism of the whole space.
Let L be a finite field and K be its subfield. We deal with K-linear isomorphisms of codes in L m and their extendibility. Hence, we have to describe all K-linear isomorphisms of the space L m , considered as K-space.
Definition 1 (General monomial transformation). A map f : L m → L m is called general monomial if there exist π ∈ S m and g 1 , . . . , g m ∈ Aut K (L) such that for all u ∈ L m : f (u) = f (u 1 , u 2 , . . . , u m ) = g 1 (u π(1) ), g 2 (u π(2) ), . . . , g m (u π(m) ) Proposition 1. A general monomial transformation is a K-linear isomorphism of the space L m . Moreover, any K-linear isomorphism of the space is a general monomial transformation.
Proof. From the definition of a general monomial transformation, it is a K-linear isometry and thus an isomorphism. In [3], it was proved that any isometry of the space is a composition of coordinate permutation and a tuple of permutations of the alphabet L, where i-th element in the tuple acts on i-th coordinate. Since K-linear permutations of L are exactly elements of Aut K (L) we get the statement of the proposition.
A general "monomial theorem" analogue of the MacWilliams Extension Theorem does not exist for nonlinear codes. This means that there is a nonlinear code and its isometry that does not extend to the isometry of the whole space. We have the same situation even if we look at a more narrow class -sublinear codes. The counterexample is following.
where x i ∈ K are all different and ω ∈ L \ K.
Define the K-linear map f : C 1 → C 2 on the generators of C 1 in the following way: f (v 1 ) = u 1 and f (v 2 ) = u 2 . Let αv 1 + βv 2 be an arbitrary element in C 1 \ {0}, where α, β ∈ K. If β = 0 then wt(αv 1 + βv 2 ) = m − 1. If β = 0 then the equation α + βx i = 0, where i ∈ {1, . . . , |K|}, has exactly one solution x i = −αβ −1 ∈ K and thus wt(αv 1 + βv 2 ) = m − 1. Therefore, all nonzero elements in C 1 have the weight equal to m − 1. From the other side, wt(αu 1 + βu 2 ) = m − 1, since α + βω = 0 does not hold for any α, β ∈ K, where αu 1 + βu 2 = 0. The map f maps nonzero elements of C 1 to nonzero elements of C 2 and hence is isometry. But, there is no general monomial transformation that acts on C 1 in the same ways as the map f . The first coordinates of all vectors in C 2 are always zero, but there is no such all-zero coordinate in C 1 .

Extendible isomorphisms
Let C be a K-linear code in L m . Denote by x 1 , . . . , x k ∈ L m a K-basis of C. The matrix A = (a ij ), i ∈ {1, . . . , k}, j ∈ {1, . . . , m} with entries from L, formed by k rows that correspond to vectors x 1 , . . . , x k , is called a generator matrix of C. For a field F , denote by M a×b (F ) the set of a × b matrices with the entries from F and denote by GL n (F ) the group of invertible matrices in M n×n (F ). Obviously, A ∈ M k×m (L). A generator matrix of the code is not unique. For two generator matrices A, A ′ of a code C there exists a matrix G ∈ GL k (K), that correspond to the change of basis in C, such that GA = A ′ . The generator matrix A naturally defines a map λ ∈ Hom where u ∈ K k . Conversely, any map λ ∈ Hom K (K k , L m ) with trivial kernel defines a generator matrix A for some K-linear code in L m . Evidently, λ(K k ) = C. We present λ in the form λ = (λ 1 , . . . , λ m ) ∈ Hom K (K k , L m ) where λ i (u) is a projection of λ(u) on ith coordinate, i ∈ {1, . . . , m}, u ∈ K k . Obviously λ i ∈ Hom K (K k , L), for i ∈ {1, . . . , m}, and it corresponds to the ith column of the generator matrix A.
Denote the degree of the extension [L : K] = n. Fix the basis b 1 , . . . , b n of L over K. This is equivalent to the establishment of an isomorphism L ∼ = K n of K-spaces. In the generator matrix A of C replace each entry a ij ∈ L by the corresponding vector-row a . . , m}. With the fixed K-basis of L, we can look on Aut K (L) as GL n (K). Observe the action of g ∈ Aut K (L) as the right multiplication by the corresponding matrix in GL n (K). The matrix It is known that M k×n (K) and Hom K (K k , K n ) are isomorphic as K-spaces. The isomorphism is M → σ, where σ(u) = u T M, u ∈ K k . In the same way, the map M → σ * , where σ * (b) = Mb, M ∈ M k×n (K), b ∈ K n induces an isomorphism M k×n and Hom K (K n , K k ). Thus the map σ → σ * (both correspond to the same matrix) induces an isomorphism Hom K (K k , K n ) → Hom K (K n , K k ).
For a fixed basis of L over K, the map λ i ∈ Hom K (K k , L), i ∈ {1, . . . , m} can be considered to be the map in Hom K (K k , K n ). It is easy to see that for all u ∈ K k : We are interested in the subspace V i = λ * i (K n ) ⊆ K k that also equals to the K-span of the B i 's columns. Any subspace V ⊆ K k with dim K V ≤ n determines a matrix M ∈ M k×n (K) (up to the change of basis), such that V is a K-span of M's columns. To each C with a K-generator matrix B correspond a tuple of the subspaces V 1 , . . . , V m ⊆ K k . Then the tuple V π(1) , . . . , V π(m) corresponds to the code h(C) with K-generator matrix B ′ .
Summarising, the tuple of subspaces V 1 , . . . , V m ⊆ K k with dimensions bounded by n uniquely determines a code, up to a general monomial transformation with trivial permutation. From the other side, for a given code C, the tuple of subspaces V 1 , . . . , V m ⊆ K k that correspond to C is unique up to the change of basis in K k . Since the column rank of matrix is equal to the row rank, the equality holds: k = dim K C = dim K (V 1 +· · ·+V m ), and thus K k = V 1 + · · · + V m .
The proof of the MacWilliams Extension Theorem is based on techniques from character theory, as for example in [10], and appears to be relatively simple. Recall the basic definitions (for more details see [7,Ch. 18 §2], [8, Ch. 5 §4] and [10]). For a finite abelian group V letV be the set of all homomorphisms from (V, +) to (C * , ·). There is defined a product of two homomorphisms: for g, h ∈V define (gh)(u) = g(u)h(u) for all u ∈ V . The setV with the defined product form a group and is called a group of characters. It is proved, that the groups (V, +) and (V , ·) are isomorphic (see [10]).
Let V be a K-space. Fix a K-basis in V and consider the euclidean form (·, ·) : ((u, v)), where, u, v ∈ V and π ∈K is a nontrivial character. The map ψ V is an isomorphism of groups (see [10]). We can define inV the operations of addition g + h = ψ V (ψ −1 V (g) + ψ −1 V (h)) and multiplication by scalar λg = ψ V (λψ −1 V (g)), where g, h ∈V , λ ∈ K, in such a way translating onV the structure of K-space. By construction, the map ψ V is an isomorphism of K-spaces.
Let f : C → L m be a K-linear injective map. Let λ ∈ Hom K (U, L m ) correspond to the generator matrix A, for all u ∈ U, λ(u) = u T A. The map µ = f λ ∈ Hom K (U, L m ) defines a generator matrix for the code f (C). The following diagram is commutative: Note that injectivity of f is necessary for injectivity of µ. Obviously, the map f is an additive isometry on C if, and only if wt(λ(u)) = wt(µ(u)) for all u ∈ U. Using weight representation in terms of character sums, we have that for all u ∈ U: To give more complete picture, we present here a sketch of the proof of the MacWilliams Extension Theorem, based on the character-theoretic techniques (see a full proof in [10]).
Sketch proof of the MacWilliams Extension Theorem. In this proof we use the previous notations with K = L and denote K = F . Since the map f is a linear isometry, the equality wt(λ(u)) = wt(µ(u)) holds for all u ∈ U. From eq. (2), this is equivalent Since characters inÛ are linearly independent, there exist i, j ∈ {1, . . . , m} and a, b ∈ F \ {0} such that χ b • λ i = χ a • µ j . The previously defined isomorphism ψ U : U → U , ψ(x) = χ x in our case has the property: χ x (y) = χ y (x) = χ xy (1), for x, y ∈ F . Consequently, considering the L-space structure onF , we have that for all u ∈ U, c ∈ F : cχ b (λ i (u)) = cχ a (µ j (u)) ⇐⇒ χ bλ i (u) (c) = χ aµ j (u) (c). The last equality is the equality of characters inÛ and thus ∀u ∈ U : bλ i (u) = aµ j (u). Also, for all c ∈ F , cbλ i = caµ j that implies χ cb • λ i = χ ca • µ j . Since for fixed b, a ∈ F \ {0}, the products cb, ca for c ∈ F run through F , all ith and jth terms could be eliminated from the equation. Repeating the procedure (with m reduced by one) several times, we get the statement of the theorem.
We use the ideas presented in the proof of the MacWilliams Extension Theorem to get a description of K-linear isomorphisms of codes in L m .
For the generator matrices of C and f (C), determined by maps λ and µ correspondingly, let V 1 , . . . , V m ⊆ K k be the tuple of subspaces that correspond to λ and U 1 , . . . , U m ⊆ K k be the tuple of subspaces that correspond to µ. Let X be a set and let A be its subset. An indicator function is a map ½ A : X → {0, 1}, such that ½ A (x) = 1 if x ∈ A and ½ A (x) = 0 -otherwise.
Proof. Transforming the sum in eq. (2), we get: By definition, the map f is an additive isometry if for all x ∈ C : wt(x) = wt(f (x)), or the same, for all u ∈ U : wt(λ(u)) = wt(µ(u)). Consequently, f is an isometry if and only if the following equality holds: Since different characters inÛ are linearly independent, the coefficients in the equation are equal for each π ∈Û . This is equivalent to: Proof. If the map f extends to a general monomial transformation h : L m → L m (with the permutation π ∈ S n ), then the tuples V 1 , . . . , V m and U π(1) , . . . , U π(m) are equal. In the other direction, let B and B ′ be the K-generator matrices that correspond to the tuples of subspaces V 1 , . . . , V m and U 1 , . . . , U m . Then there exist permutation π ∈ S m and matrices G i ∈ GL n (K), such that B = (B π(1) G 1 | . . . |B π(m) G m ) = (B ′ 1 | . . . |B ′ m ) = B ′ . This correspond to a general monomial transformation h : L m → L m , such that h = f on the code generated by B.
Note that the Proposition 3 and Proposition 2 are independent from each other. Combining them, we claim that a K-linear isomorphism extends to the isomorphism of the whole space, if and only if in the corresponding solution of eq. (3) the tuples V 1 , . . . , V m and U 1 , . . . , U m differs by a permutation of terms. We call such solutions trivial.
Regarding the study of the properties of eq. (3), we have the following lemmas. The solutions of the equation should satisfy specific requirements on the subspace coverings. Such coverings and related questions are discussed in [2] and are partially connected with our results. Lemma 1. Let V be a k-dimensional space over K with k > 1 and let U i ⊂ V for i ∈ {1, . . . , t} be proper subspaces of V . If V = t i=1 U i then t is greater then the cardinality of K.
Proof. Among the subspaces V 1 , . . . , V s , U 1 , . . . , U r choose one that is maximal by inclusion. It is either V i for some i ∈ {1, . . . , s}, or U j for some j ∈ {1, . . . , t}. In the first case Similarly, in the second case s > |K|.
Proof of the Main Theorem. From the Proposition 1, to prove the theorem, it is enough to show that: if there exists such K-linear code C ⊆ L m and K-linear isometry f : C → L m that does not extend to general monomial transformation, then m > q. Since f is an isometry, the Proposition 2 implies that eq. (3) holds. Let V 1 , . . . , V m be a tuple of subspaces of C and U 1 , . . . , U m be the corresponding tuple of subspaces of f (C). There is an alternative: the tuples of the subspaces V 1 , . . . , V m and U 1 , . . . , U m or coincide up to permutation of the elements, or not. In the first case, by the Proposition 3 and the Proposition 1, f extends to the isomorphism of the whole space L m . In the second case in eq. (3) group the equal terms from each side and eliminate the equal terms from the different sides. After cancelling and elimination there exists i ∈ {1, . . . , m} such that for all j ∈ {1, . . . , m} : V i = U j . So, we obtain the equation in form of eq. (4), where conditions of lemma 2 are satisfied. Therefore m ≥ max{r, s} > |K|.

Unextendible isomorphisms
The natural question is : "Can we improve the Main Theorem?" The answer is negative. In fact, for m = |K| + 1 there is an example of code isomorphism that does not extend to the isomorphism of the space (see Example 1). In this section we describe one family of such isomorphisms of K-linear codes with the length |K| + 1.
As we mentioned above, the solutions of eq. (3) are in correspondence with the Klinear code isomorphisms, up to a general monomial transformation (see the Proposition 2 and the Proposition 3). This means, that a nontrivial solution of eq. (3) corresponds to an unextendible K-linear code isomorphism. We say that a solution is trivial if the tuples of subspaces U 1 , . . . , U m and V 1 , . . . , V m in K k are equal up to permutation of elements. The following example illustrates one such nontrivial solution.
Example 2. Denote q = |K| and m = q + 1. Recall that in eq. (3) all spaces' dimensions are bounded by n. Let V = K k , where 2 ≤ k ≤ n, and let S ⊂ V be a subspace of dimension k − 2. For all i ∈ {1, . . . , q + 1} let U i be different proper subspaces of V , such that S is their common proper subspace. Such a tuple of subspaces U 1 , . . . , U q+1 exists and is the covering of V by hyperplanes (see [2]). For i ∈ {1, . . . , q} let V i = V and let V q+1 = S. It appears that V 1 , . . . , V q+1 , U 1 , . . . , U q+1 satisfy eq. (3). Since q+1 The covering presented in the example appears, when in Lemma 1 we want to know the solutions for t = q + 1. The following lemma gives the description.
Proof. Assume that there are at least two spaces, let them be U q and U q+1 , such that This contradicts the fact that q ≥ 2.
Assume that there exists a space, let it be U q+1 , such that dim Regrouping the terms we get 2q k−2 ≥ q k−1 +1, which is impossible for q ≥ 2. Considering the calculations above, we can refine the inequality: This implies that for all i ∈ {1, . . . , q + 1}, the set S = U i ∩Ū i is a k − 2-dimensional space. It is easy to see that the space S is the same for all i. By the construction, the spaces U i for i ∈ {1, . . . , q + 1} include all the spaces that are strictly between S and V .
3) can be rewritten in the following way: 1 . From the Lemma 3, considering the fact that the number of terms is less then q + 1, there exists the subspace, let it be V 2 , that equals V 1 . So, our equation can be reduced to: Repeating the procedure q − 2 more times we get that V i = V 1 for every i ∈ {1, . . . , q} and eq. (3) can be reduced Since all nontrivial solutions of eq. (3) correspond to K-linear isomorphisms of codes with length m = q+1, we automatically have a family of unextendible code isomorphisms. The following example gives the full description of the code isomorphisms, up to a general monomial transformation, that correspond to space covering presented in the Example 2.
Example 3. Let 2 ≤ k ≤ n and m = q + 1. Let subspaces V 1 , . . . , V m , U 1 , . . . , U m ⊆ U be from the Example 2, where V 1 = K k . We build two K-linear isomorphic codes λ(U) and µ(U) with an unextendible isomorphism, using this nontrivial solution of eq. (3). Let A 1 , . . . , A m and B 1 , . . . , B m be matrices from M k×n (K), such that the K-span of A i 's columns is V i and B i 's columns is U i , for i ∈ {1, . . . , m}. The matrix (A 1 | . . . |A m ) is a K-generator matrix of λ(U) and the corresponding (with respect to f ) K-generator matrix of µ(U) is (B 1 | . . . |B m ). Since we observe the codes up to general monomial transformations and the K-generator matrices of a code differ by the change of basis, the general form of the pair of K-generator matrices is: (GA π(1) H 1 | . . . |GA π(m) H m ) and (GB τ (1) T 1 | . . . |GB τ (m) T m ), where G ∈ GL k (K), π, τ ∈ S m and H i , T i ∈ GL n (K) for i ∈ {1, . . . , m}. Choosing a corresponding basis in U (transformation G) and general monomial transformations for both codes, the canonical form of the two generator matrices (that correspond to K-generators matrices) of the codes and the K-linear isometry are the following. Let x 1 , . . . , x q be different elements in K and ω, ω 1 , . . . , ω k−2 ∈ L are linear independent (as vectors of the K-space). Then, up to a general monomial transformation the specified K-linear isomorphism of codes can be presented in the following way Codes are generated by these two matrices (as the K-span of rows), the left matrix for λ(U) and the right for µ(U). The function f is defined on the rows of generator matrices: it maps the first row to the first row, the second row to second, and so on. Note that the last k − 2 rows in the first and second matrices correspond to the common subspaces V q+1 of the spaces V 1 , . . . , V q+1 , U 1 , . . . , U q+1 . Both codes have dimension k over K and length m, and the minimum distance between codewords is m − 1 = q. This isomorphism of K-linear codes cannot be extended to an isomorphism of L m . If k = 2 this is exactly Example 1.

Conclusions
After establishing the lower bound on the length of codes with unextendible isometries, we gave one family of additive codes and isometries that achieve that bound. In a forthcoming paper we will describe all K-linear unextendible isometries with m = |K|+1.
In [11] the author described the general ideas for finding K-linear isometries of codes that are automorphisms, i.e., translate a code to itself. The results of this paper show that for codes with small length all these automorphisms extend to general monomial maps. But the question is still open and will be covered in our future works for the edge case m = |K| + 1.
As we noted in the Introduction, the origins of this topic came form quantum codes and application of our present and future results in classical coding theory have to be translated to the language of quantum codes.