1 Introduction

A \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code C is a binary image of a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code \({\mathcal {C}}\) that is an additive subgroup of \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_4^\beta \). We say that C (and also \({\mathcal {C}}\)) has parameters \((\alpha , \beta )\). \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes were first introduced in [15] as abelian translation-invariant propelinear codes. Later, in [5], a comprehensive description of \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes appeared. In [5], the duality of such codes was studied, an appropriate inner product was defined and it was stated that the \(\mathbb {Z}_2\mathbb {Z}_4\)-dual code is not the same as the standard orthogonal code, that is, using the standard inner product of binary vectors.

Recently, \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes with parameters \((\alpha ,\beta )\) have been introduced in [3]. They are binary images of \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive codes, which are submodules of the ring \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \), where \(u^2=0\). These codes have some similarities with \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes. However, there is a key difference: every \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code is also \(\mathbb {Z}_2\)-linear, which is not true, in general, for \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes. In this paper, when we refer to the parameters of a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear or \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code, we mean the values of \((\alpha , \beta )\).

The aim of this paper is to clarify the relation among all these classes. Specifically, we prove that a \(\mathbb {Z}_2\)-linear code is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear if and only if its automorphism group has even order. We also show that for a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code, its \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-dual code is exactly its \(\mathbb {Z}_2\)-dual code, that is, its standard binary dual code. This, in turn, implies directly that the dual weight distributions are related by the MacWilliams identity. This fact was proved in [3]. By using these properties, we find \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structures for all binary linear perfect codes. In particular, for any binary linear perfect code C, we compute the possible values of \(\alpha \) and \(\beta \) such that C is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha ,\beta )\). We also show that in the case of a binary Hamming code, its extended code, its dual code (that is a simplex code) and the dual of its extended code (that is a Hadamard code) are also \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes. All binary perfect codes are optimal codes since they have the maximum possible number of codewords for their length and minimum distance. Therefore, we have a family of \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes that are optimal. Computationally, and considering the characterization of \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes given in this paper, a large number of the best known linear codes of length n and dimension k in the database of Magma [7], \(C_B(n,k)\), are also \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes. We also give some examples of codes \(C_B(n,k)\) that are not \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes.

If C is a \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code with parameters \((\alpha ,\beta )\) which is also \(\mathbb {Z}_2\)-linear, then we prove that C has a \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structure with the same parameters \((\alpha ,\beta )\). In addition, we give an example showing that there are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes which are not \(\mathbb {Z}_2\mathbb {Z}_4\)-linear.

The paper is organized as follows. In the next section, we give basic definitions and concepts. In Sect. 3, we prove that for a given \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code C, its \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-dual code is exactly \(C^\perp \), i.e. the standard binary orthogonal code. In Sect. 4, we study the conditions for a \(\mathbb {Z}_2\)-linear code to be \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear. Moreover, we characterize \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes as \(\mathbb {Z}_2\)-linear codes with automorphism group of even order. In Sect. 5, we prove that all \(\mathbb {Z}_2\)-linear perfect codes are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear with parameters \((\alpha ,\beta )\), where \(\beta > 0\). In addition, we compute the possible values of \(\alpha \) and \(\beta \). In Sect. 6, we analyze the relation to \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes. In particular, we prove that if C is \(\mathbb {Z}_2\)-linear and \(\mathbb {Z}_2\mathbb {Z}_4\)-linear with parameters \((\alpha ,\beta )\), then C is also a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with the same parameters \((\alpha ,\beta )\). We note that the converse statement is not true. Finally, in Sect. 7, we give some conclusions about the meaningfulness of \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes and we point out some possible further research on the topic.

2 Preliminaries

Denote by \({\mathbb {Z}}_2\) and \({\mathbb {Z}}_4\) the rings of integers modulo 2 and modulo 4, respectively. A binary code of length n is any non-empty subset C of \({\mathbb {Z}}_2^n\). If that subset is a vector space then we say that it is a \(\mathbb {Z}_2\)-linear code (or binary linear code). Any non-empty subset \({\mathcal {C}}\) of \({\mathbb {Z}}_4^n\) is a quaternary code of length n, and an additive subgroup of \({\mathbb {Z}}_4^n\) is called a quaternary linear code. The elements of a code are called codewords.

For any binary code C, an automorphism of C is a coordinate permutation that leaves C invariant. The automorphism group of C, denoted Aut(C), is the group of all automorphisms of C.

The classical Gray map \(\phi :\;\mathbb {Z}_4\;\longrightarrow \;\mathbb {Z}_2^{2}\) is defined by

$$\begin{aligned} \phi (0)=(0,0),\;\;\phi (1)=(0,1),\;\;\phi (2)=(1,1),\;\;\phi (3)=(1,0). \end{aligned}$$

If \(a=(a_1,\ldots ,a_m)\in \mathbb {Z}_4^m\), then the Gray map of a is the coordinate-wise extended map \(\phi (a)=(\phi (a_1),\ldots ,\phi (a_m))\). We naturally extend the Gray map for vectors \(\mathbf{x}=(x\mid x')\in {\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \) so that \(\varPhi (\mathbf{x}) = (x\mid \phi (x'))\).

Denote by \(wt_H(x)\) the Hamming weight of \(x \in \mathbb {Z}_2^{\alpha }\) and by \(wt_L(x')\) the Lee weight of \(x' \in \mathbb {Z}_4^{\beta }\). For a vector \(\mathbf{x}=(x\mid x')\in \mathbb {Z}_2^{\alpha }\times \mathbb {Z}_4^{\beta }\), define the weight of \(\mathbf{x}\), denoted by \(wt(\mathbf{x})\), as \(wt_H(x)+wt_L(x')\). Clearly, \(wt(\mathbf{x})=wt_H\left( \varPhi (\mathbf{x})\right) \).

Definition 1

A \(\mathbb {Z}_2{\mathbb {Z}}_4\)-additive code \({\mathcal {C}}\) with parameters \((\alpha ,\beta )\) is an additive subgroup of \({\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \).

Such codes are extensively studied in [5]. Alternatively, we can define a \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-additive code as a \(\mathbb {Z}_4\)-submodule of \({\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \), where the scalar product \(\lambda \mathbf{x}\) , for \(\lambda \in \mathbb {Z}_4\), \(\mathbf{x}\in {\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \), is defined as \(\mathbf{x}+\cdots +\mathbf{x}\), \(\lambda \) times (of course, if \(\lambda =0\), then \(\lambda \mathbf{x}=0\)).

If \({\mathcal {C}}\) is a \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-additive code with parameters \((\alpha ,\beta )\), then the binary image \(C=\varPhi ({\mathcal {C}})\) is called a \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-linear code with parameters \((\alpha ,\beta )\). Note that C is a binary code of length \(n=\alpha +2\beta \) but C is not \(\mathbb {Z}_2\)-linear, in general [5]. If \(\alpha =0\), then C is called a \(\mathbb {Z}_4\)-linear code. If \(\beta =0\), then C is simply a \(\mathbb {Z}_2\)-linear code.

The standard inner product in \({\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \), defined in [5], can be written as

$$\begin{aligned} \mathbf u \cdot \mathbf v = 2\left( \sum _{i=1}^{\alpha }u_iv_i\right) +\sum _{j=1}^{\beta }u'_jv'_j\in {\mathbb {Z}}_4, \end{aligned}$$

where the computations are made taking the zeros and ones in the \(\alpha \) binary coordinates as quaternary zeros and ones, respectively. The dual code of a \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-additive code \({\mathcal {C}}\) is defined in the standard way by

$$\begin{aligned} {\mathcal {C}}^\perp =\{\mathbf{v } \in {\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \mid \mathbf{u } \cdot \mathbf{v }=0, \text{ for } \text{ all } \mathbf{u }\in {\mathcal {C}}\}. \end{aligned}$$

The \(\mathbb {Z}_2\mathbb {Z}_4\)-dual of \(C=\varPhi ({\mathcal {C}})\) is the code \(\varPhi ({\mathcal {C}}^\perp )\).

Consider the ring \(\mathbb {Z}_2[u]=\mathbb {Z}_2 + u\mathbb {Z}_2=\{0,1,u,1+u\}\), where \(u^2=0\). Note that \((\mathbb {Z}_2[u],+)\) is group-isomorphic to the Klein group \((\mathbb {Z}_2^2,+)\). With the product operation, \((\mathbb {Z}_2[u],\cdot )\) is monoid-isomorphic to \((\mathbb {Z}_4,\cdot )\). Define the map \(\pi :\;\mathbb {Z}_2[u]\;\longrightarrow \;\mathbb {Z}_2\), such that \(\pi (0)=\pi (u)=0\) and \(\pi (1)=\pi (1+u)=1\). Then, for \(\lambda \in \mathbb {Z}_2[u]\) and \(\mathbf{x}=(x_1,\ldots ,x_\alpha \mid x'_1,\ldots ,x'_\beta )\in \mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \), we can consider the scalar product

$$\begin{aligned} \lambda \mathbf{x}= (\pi (\lambda )x_1,\ldots ,\pi (\lambda )x_\alpha \mid \lambda x'_1,\ldots ,\lambda x'_\beta )\in \mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta . \end{aligned}$$

With this operation, \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \) is a \(\mathbb {Z}_2[u]\)-module. Note that, a \(\mathbb {Z}_2[u]\)-submodule of \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \) is not the same as a subgroup of \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \).

Definition 2

([3]) A \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code \({\mathcal {C}}\) with parameters \((\alpha ,\beta )\) is a \(\mathbb {Z}_2[u]\)-submodule of \({\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_2[u]^\beta \).

The following straightforward equivalence can be used as an alternative definition.

Lemma 1

A code \({\mathcal {C}}\subseteq {\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_2[u]^\beta \) is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive if and only if

$$\begin{aligned}&u \mathbf{z}\in {\mathcal {C}}\;\;\;\forall \mathbf{z}\in {\mathcal {C}}, \text{ and } \\&\mathbf{x}+\mathbf{y}\in {\mathcal {C}}\;\;\;\forall \mathbf{x}, \mathbf{y}\in {\mathcal {C}}. \end{aligned}$$

As for \({\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_4^\beta \), we can also define a Gray-like map. Let \(\psi :\;\mathbb {Z}_2[u]\;\longrightarrow \;\mathbb {Z}_2^{2}\) be defined as

$$\begin{aligned} \psi (0)=(0,0),\;\;\psi (1)=(0,1),\;\;\psi (u)=(1,1),\;\;\psi (1+u)=(1,0). \end{aligned}$$

If \(a=(a_1,\ldots ,a_m)\in \mathbb {Z}_2[u]^m\), then the coordinate-wise extension of \(\psi \) is \(\psi (a)=(\psi (a_1),\ldots ,\psi (a_m))\). Now, we define the Gray-like map for elements \(\mathbf{x}=(x\mid x')\in {{\mathbb {Z}}}_2^\alpha \times {{\mathbb {Z}}}_2[u]^\beta \) so that \(\varPsi (\mathbf{x}) = (x\mid \psi (x'))\).

The Lee weight of the elements \(0,1,u,1+u \in Z_2[u]\) are 0, 1, 2, 1, respectively. Denote by \(wt_L(x')\) the Lee weight of \(x'\in \mathbb {Z}_2[u]^{\beta }\), which is the rational sum of the Lee weights of the coordinates of \(x'\). For a vector \(\mathbf{x}=(x\mid x')\in \mathbb {Z}_2^{\alpha }\times \mathbb {Z}_2[u]^{\beta }\), define the weight of \(\mathbf{x}\) as \(wt(\mathbf{x})=wt_H(x)+wt_L(x')\). Clearly, \(wt(\mathbf{x})=wt_H\left( \varPsi (\mathbf{x})\right) \).

If \({\mathcal {C}}\) is a \({\mathbb {Z}}_2{\mathbb {Z}}_2[u]\)-additive code with parameters \((\alpha ,\beta )\), then the binary image \(C=\varPsi ({\mathcal {C}})\) is called a \({\mathbb {Z}}_2{\mathbb {Z}}_2[u]\)-linear code with parameters \((\alpha ,\beta )\). Note that, unlike for \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes, C is a \(\mathbb {Z}_2\)-linear code of length \(n=\alpha +2\beta \). This fact is clear since for any pair of elements \(\mathbf{x},\mathbf{y}\in {\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_2[u]^\beta \), we have that \(\varPsi (\mathbf{x}) +\varPsi (\mathbf{y})=\varPsi (\mathbf{x} + \mathbf{y})\).

The inner product in \({\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_2[u]^\beta \), defined in [3], can be written as

$$\begin{aligned} \mathbf u \cdot \mathbf v = u\left( \sum _{i=1}^{\alpha }u_iv_i\right) +\sum _{j=1}^{\beta }u'_jv'_j\in {\mathbb {Z}}_2[u], \end{aligned}$$

where the computations are made taking the zeros and ones in the \(\alpha \) binary coordinates as zeros and ones in \(\mathbb {Z}_2[u]\), respectively. The dual code of a \({\mathbb {Z}}_2{\mathbb {Z}}_2[u]\)-additive code \({\mathcal {C}}\) is defined in the standard way by

$$\begin{aligned} {\mathcal {C}}^{\perp }{=}{\{} {\mathbf{v}} {\in } {\mathbb {Z}}_2^\alpha \times {\mathbb {Z}}_2[u]^\beta \mid \mathbf{u }\cdot \mathbf{v }=0, \text{ for } \text{ all } \mathbf{u }\in {\mathcal {C}}\}. \end{aligned}$$

The \({\mathbb {Z}}_2{\mathbb {Z}}_2[u]\)-dual code of \(C=\varPsi ({\mathcal {C}})\) is the code \(\varPsi ({\mathcal {C}}^\perp )\).

The weight distributions of a binary linear code C and its dual \(C^\perp \) are related to each other by the MacWilliams identity [14]. If C and D are two binary codes, not necessarily linear, such that their weight enumerators are related by the MacWilliams identity, then we say that C and D are formally dual.

If \({\mathcal {C}}\) is a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code, then the codes \(\varPhi ({\mathcal {C}})\) and \(\varPhi ({\mathcal {C}}^\perp )\) are not necessarily linear, so they are not dual in the binary linear sense, in general. However, the weight enumerator polynomial of \(\varPhi ({\mathcal {C}}^\perp )\) is the MacWilliams transform of the weight enumerator polynomial of \(\varPhi ({\mathcal {C}})\) [9] and therefore they are formally dual. We will see in the following section that a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code \(\varPsi ({\mathcal {C}})\) and its \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-dual code \(\varPsi ({\mathcal {C}}^\perp )\) are not only formally dual, as it was proved in [3], but also dual in the binary usual sense, i.e. \(\varPsi ({\mathcal {C}})^\perp =\varPsi ({\mathcal {C}}^\perp )\).

3 Duality of \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes

It is readily verified that if \(a,b\in \mathbb {Z}_2[u]\), then \(\psi (a)\cdot \psi (b) =1\) if and only if \(ab\in \{1,u\}\). This property can be easily generalized for elements in \(\mathbb {Z}_2[u]^\beta \).

Lemma 2

If \(x',y'\in \mathbb {Z}_2[u]^\beta \), then \(\psi (x')\cdot \psi (y') =1\) if and only if \(x'\cdot y'\in \{1,u\}\).

Proof

We have that \(x'\cdot y'=\sum _{i=1}^\beta x'_i y'_i\). Therefore, in order to calculate \(x'\cdot y'\) we can omit all addends such that \(x'_i y'_i= 0\) that also implies \(\psi (x'_i)\cdot \psi (y'_i)=0\). Moreover, if \(x'_i y'_i=x'_j y'_j\), for some \(i\ne j\), then \(x'_i y'_i+x'_j y'_j=0\) and it is easy to check that \(\psi (x'_i)\cdot \psi (y'_i)+\psi (x'_j)\cdot \psi (y'_j)=0\). Hence, we can cancel pairs of addends that are equal in \(x\cdot y\). With these reductions, we have that the set S of the remaining addends in \(x'\cdot y'\) is

  1. (i)

    \(S=\{1,u,1+u\}\) or \(S=\emptyset \), if \(x'\cdot y'=0\).

  2. (ii)

    \(S=\{1\}\) or S=\(\{u, 1+u\}\), if \(x'\cdot y'=1\).

  3. (iii)

    \(S=\{u\}\) or \(S=\{1, 1+u\}\), if \(x'\cdot y'=u\).

  4. (iv)

    \(S=\{1+u\}\) or \(S=\{1, u\}\), if \(x'\cdot y'=1+u\).

Since \(\psi (x_i')\cdot \psi (y_i') =1\) if and only if \(x'_i y'_i\in \{1,u\}\), we only have to consider the elements 1 and u in each possible set S. Clearly, cases (i) and (iv) give \(\psi (x')\cdot \psi (y')=0\), whereas cases (ii) and (iii) give \(\psi (x')\cdot \psi (y')=1\). \(\square \)

Proposition 1

Let \(\mathbf{x},\mathbf{y}\in \mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \).

  1. (i)

    If \(\mathbf{x}\cdot \mathbf{y}=0\), then \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{y})=0\).

  2. (ii)

    If \(\mathbf{x}\cdot \mathbf{y}\ne 0\) and \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{y})=0\), then \(\varPsi (\mathbf{x})\cdot \varPsi ((1+u)\mathbf{y})=1\).

Proof

Let \(\mathbf{x}=(x\mid x')\) and \(\mathbf{y}=(y\mid y')\) be elements in \(\mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \). We can write the inner product of \(\mathbf{x}\) and \(\mathbf{y}\) as \(\mathbf{x}\cdot \mathbf{y} = u(x\cdot y) + (x'\cdot y')\).

  1. (i)

    If \(\mathbf{x}\cdot \mathbf{y}=0\), then either (a) \(x\cdot y=x' \cdot y'=0\), or (b) \(x\cdot y =1\) and \(x'\cdot y'=u\).

    1. (a)

      By Lemma 2, we have that \(\psi (x')\cdot \psi (y')=0\) and hence \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{y})=0\).

    2. (b)

      Again, by Lemma 2, we obtain \(\psi (x')\cdot \psi (y')=1\) and then \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{y})=0\).

  2. (ii)

    If \(\mathbf{x}\cdot \mathbf{y}\ne 0\), then either (a) \(x\cdot y=0\) and \(x'\cdot y'\ne 0\), or (b) \(x\cdot y=1\) and \(x'\cdot y'\ne u\).

    1. (a)

      In this case \(x'\cdot y'\in \{1,u,1+u\}\). Since \(x\cdot y=0\) and \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{y})=0\), we have that \(\psi (x')\cdot \psi (y')=0\) and hence, by Lemma 2, the only possible case is that \(x'\cdot y'= 1+u\). Therefore, \(x'\cdot ((1+u)y')=1\) and \(\psi (x')\cdot \psi ((1+u)y')=1\), again by Lemma 2. Thus, \(\varPsi (\mathbf{x})\cdot \varPsi ((1+u)\mathbf{y})=1\).

    2. (b)

      We have \(x'\cdot y'\in \{0,1,1+u\}\). Since \(x\cdot y=1\) and \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{y})=0\), we obtain \(\psi (x')\cdot \psi (y')=1\). By Lemma 2, the only possibility is \(x'\cdot y'=1\). Hence, \(x'\cdot ((1+u)y')=1+u\) and \(\psi (x')\cdot \psi ((1+u)y')=0\). We conclude \(\varPsi (\mathbf{x})\cdot \varPsi ((1+u)\mathbf{y})=1\).

\(\square \)

Theorem 1

Let \({\mathcal {C}}\) be a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code and let \(C=\varPsi ({\mathcal {C}})\) be the corresponding binary \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code. Then, \(\varPsi ({\mathcal {C}}^\perp )=C^\perp \).

Proof

If \(\mathbf{x}\in {\mathcal {C}}^\perp \), then \(\mathbf{x}\cdot \mathbf{c}=0\), for all \(\mathbf{c}\in {\mathcal {C}}\). Hence, by Proposition 1(i), we have that \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{c})=0\), for all \(\mathbf{c}\in {\mathcal {C}}\), implying that \(\varPsi (\mathbf{x})\in C^\perp \). We have proved \(\varPsi ({\mathcal {C}}^\perp )\subseteq C^\perp \).

If \(\mathbf{x}\notin {\mathcal {C}}^\perp \), then \(\mathbf{x}\cdot \mathbf{c}\ne 0\), for some \(\mathbf{c}\in {\mathcal {C}}\). Now, by Proposition 1(ii), we have that \(\varPsi (\mathbf{x})\cdot \varPsi (\mathbf{c})\ne 0\) or \(\varPsi (\mathbf{x})\cdot \varPsi ((1+u)\mathbf{c})\ne 0\). It follows that \(\varPsi (\mathbf{x})\notin C^\perp \) and therefore \(C^\perp \subseteq \varPsi ({\mathcal {C}}^\perp )\). \(\square \)

Let \({\mathcal {C}}\) be a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code. Then, the following diagram commutes:

Obviously, this immediately implies that the weight distributions of \({\mathcal {C}}\) and \({\mathcal {C}}^\perp \) are related by the MacWilliams relations, as it was proved in [3].

To finish this section, we prove that the dual of a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code is also \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear with the same parameters \((\alpha ,\beta )\).

Proposition 2

A binary code C is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear with parameters \((\alpha ,\beta )\) if and only if \(C^\perp \) is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear with the same parameters \((\alpha ,\beta )\).

Proof

Assume that C is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha ,\beta )\). Let \({\mathcal {C}}^\perp =\varPsi ^{-1}(C^\perp )\). By linearity of \(C^\perp \) and Lemma 1, we only need to proof that \(u \varPsi ^{-1}(c)\in {\mathcal {C}}^\perp \), for all \(c\in C^\perp \). For any codeword \(\mathbf{x}\in {\mathcal {C}}\), we have \(\left( u\varPsi ^{-1}(c)\right) \cdot \mathbf{x}=u\left( \varPsi ^{-1}(c)\cdot \mathbf{x}\right) =u0=0\), which implies \(u\varPsi ^{-1}(c)\in {\mathcal {C}}^\perp \). The converse follows from the fact that \((C^\perp )^\perp =C\). \(\square \)

4 Characterization of \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes

Given a \(\mathbb {Z}_2\)-linear code C of length n, a natural question is if we can choose a set of \(\beta \) pairs of coordinates such that C is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((n-2\beta ,\beta )\). The next lemma and corollary show us that it is enough to answer the question for a generator matrix of C.

Lemma 3

Let \(S=\{\mathbf{x}_1, \ldots , \mathbf{x}_r\}\subset {{\mathbb {Z}}}_2^\alpha \times {{\mathbb {Z}}}_2[u]^\beta \) and let C be the \(\mathbb {Z}_2\)-linear code generated by the binary image vectors of S, \(C=\langle \varPsi (S)\rangle \). Then, C is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha ,\beta )\) if and only if \(\varPsi (u \mathbf{x}_i)\in C\), for all \(i\in \{1,\ldots ,r\}\).

Proof

Let \({\mathcal {C}}=\varPsi ^{-1}(C)\subset {{\mathbb {Z}}}_2^\alpha \times {{\mathbb {Z}}}_2[u]^\beta \). Then, C is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear if and only if \({\mathcal {C}}\) is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive. Clearly, for all \(\mathbf{x},\mathbf{y}\in {\mathcal {C}}\), \(\varPsi (\mathbf{x}+\mathbf{y})=\varPsi (\mathbf{x})+\varPsi (\mathbf{y})\in C\) and hence \(\mathbf{x}+\mathbf{y}\in {\mathcal {C}}\). Therefore, applying Lemma 1, we have that \({\mathcal {C}}\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code if and only \(u\mathbf{x}\in {\mathcal {C}}\), for all \(\mathbf{x}\in {\mathcal {C}}\). For \(\mathbf{x}\in {\mathcal {C}}\), we have that \(\varPsi (\mathbf{x})=\sum _{i=1}^{r}\lambda _i\varPsi (\mathbf{x}_i)=\varPsi (\sum _{i=1}^{r}\lambda _i\mathbf{x}_i)\), for some \(\lambda _1,\ldots ,\lambda _r\in {\mathbb {Z}}_2\). Thus \(\mathbf{x}=\sum _{i=1}^{r}\lambda _i\mathbf{x}_i\) and \(u\mathbf{x}= \sum _{i=1}^{r}\lambda _i u\mathbf{x}_i\). Hence, \(u\mathbf{x}\in {\mathcal {C}}\), for all \(\mathbf{x}\in {\mathcal {C}}\), if and only if \(u\mathbf{x_i} \in {\mathcal {C}}\), for all \(i=1,\ldots ,r\). \(\square \)

Corollary 1

Let C be a \(\mathbb {Z}_2\)-linear code of length \(n=\alpha +2\beta \), for some \(\alpha \ge 0\) and \(\beta > 0\). Let

$$\begin{aligned} G=\left( \begin{array}{c} v_1\\ \vdots \\ v_r\\ \end{array}\right) \end{aligned}$$

be a generator matrix of C. Then, C is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha ,\beta )\) if and only if \(\varPsi \left( u\varPsi ^{-1}(v_i)\right) \in C\) for all \(i=1,\dots ,r\).

Now, we give a necessary and sufficient condition for a \(\mathbb {Z}_2\)-linear code to be \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear.

Proposition 3

Let C be a \(\mathbb {Z}_2\)-linear code. Then, C is permutation-equivalent to a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha , \beta )\), where \(\beta > 0\), if and only if there exists an involution \(\sigma \in Aut(C)\) fixing \(\alpha \) coordinates.

Proof

Assume that C is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with \(\beta > 0\) and let \({\mathcal {C}}=\varPsi ^{-1}(C)\). For any codeword \(\mathbf{x}=(x_1,\ldots ,x_\alpha \mid x'_1,\ldots ,x'_\beta )\in {\mathcal {C}}\), we write its binary image as \(x=(x_1,\ldots ,x_\alpha \mid y_1,\ldots ,y_{2\beta })\), where \(\psi (x'_i)=(y_{2i-1},y_{2i})\), for \(i=1,\ldots ,\beta \). Let \(\sigma \) be the involution that transposes \(y_{2i-1}\) and \(y_{2i}\), for all \(i=1,\ldots ,\beta \). Clearly, \(\varPsi \left( (1+u)\mathbf{x}\right) =\sigma (x)\). Since \((1+u)\mathbf{x}\in {\mathcal {C}}\), we have that \(\sigma \in Aut(C)\).

Conversely, if \(\sigma \in Aut(C)\) has order 2, then \(\sigma \) is a product of disjoint transpositions. We can assume that the \(\alpha \) coordinates fixed by \(\sigma \) are the first ones, and the pairs of coordinates that \(\sigma \) transposes are consecutive. Then, considering the pairs of coordinates that \(\sigma \) transposes as the images of \(\mathbb {Z}_2[u]\) coordinates, we obtain that \(\sigma (x)=\varPsi \left( (1+u)\varPsi ^{-1}(x)\right) \), for any codeword \(x\in C\). Since \(\sigma (x)\in C\), we have that \((1+u)\mathbf{x}\in {\mathcal {C}}=\varPsi ^{-1}(C)\), for any \(\mathbf{x}\in {\mathcal {C}}\). But this condition implies that \({\mathcal {C}}\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code since \((1+u)\mathbf{x}=\mathbf{x} + u\mathbf{x}\) and thus \(u\mathbf{x}\in {\mathcal {C}}\). For all \(\mathbf{x},\mathbf{y}\in {\mathcal {C}}\), \(\varPsi (\mathbf{x}+\mathbf{y})=\varPsi (\mathbf{x})+\varPsi (\mathbf{y})\in C\) and hence \(\mathbf{x}+\mathbf{y}\in {\mathcal {C}}\). Then, the result follows applying Lemma 1. \(\square \)

Theorem 2

A \(\mathbb {Z}_2\)-linear code C is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear with parameters \((\alpha , \beta )\), where \(\beta > 0\), if and only if Aut(C) has even order.

Proof

From Sylow theorems, the group Aut(C) has even order if and only if Aut(C) contains an involution. The statement then follows by Proposition 3. \(\square \)

Remark 1

Note that for different involutions in Aut(C), we have different \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structures and, possibly, with different parameters. Moreover, according to Proposition 3, for each \(\sigma _i\in Aut(C)\) fixing \(\alpha _i\) coordinates, we have a \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structure of C with parameters \((\alpha _i,\beta _i)\), where \(\alpha _i+2\beta _i\) is the length of C.

Example 1

Consider the code C with generator matrix

$$\begin{aligned} \left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 0 \\ 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 1 \\ \end{array} \right) . \end{aligned}$$

As it is pointed out in [14, Problem (32), p. 230], Aut(C) is trivial, i.e. it only contains the identity permutation. Therefore, C is not \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear for \(\beta > 0\).

It is natural to ask if there are interesting linear codes which are not \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes and whether the automorphism group is always trivial or not in these cases. Denote by \(C_B(n,k)\) the best known linear code of length n and dimension k in the database of Magma [7]. The automorphism group of these codes can be obtained using Magma software and a large number of linear codes have automorphism group of even order and, therefore, they are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear. However, several best known linear codes have been found with automorphism group of odd order. We have obtained some linear codes with trivial automorphism group, for example, \(C_B(20,10)\), \(C_B(32,12)\), \(C_B(135,38)\), etc., and also other codes with nontrivial and odd order automorphism group, for example, \(C_B(78,8)\), \(C_B(81,20)\), \(C_B(128,14)\) or \(C_B(89,11)\) with automorphism groups of order 3, 27, 889 and 979, respectively.

In the next section we see several examples of well-known codes with a \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structure.

5 \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear perfect codes

A binary repetition code \(C=\{(0,\ldots , 0), (1,\ldots , 1)\}\) of odd length n is a trivial perfect code. Its dual code is the even code which contains all vectors of length n and even weight (i.e. with an even number of nonzero coordinates). Clearly, these codes can be considered as \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes with parameters \((n-2\beta ,\beta )\), for all \(\beta \in \{0,\ldots , (n-1)/2\}\).

It is well known that the binary linear perfect codes with more than two codewords are:

  1. (1)

    The binary Hamming 1-perfect codes of length \(n=2^t-1\) (\(t\ge 3\)), dimension \(k=2^t-t-1\) and minimum distance \(d=3\).

  2. (2)

    The binary Golay 3-perfect code of length \(n=23\), dimension \(k=12\) and minimum distance \(d=7\).

In this section we prove that all binary linear perfect codes are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes.

Let \(H_t\) be a Hamming code of length \(n=2^t-1\), where \(t\ge 3\). The dual code \(H_t^\perp \) is known as the simplex code. It is a constant-weight code with all nonzero codewords of weight \(2^{t-1}\). A parity-check matrix \(M_t\) for \(H_t\) (which is a generator matrix for \(H_t^\perp \)) contains all nonzero column vectors of length t.

Theorem 3

Let \(H_t\) be a Hamming code of length \(n=2^t-1\). Then, \(H_t\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((2^r-1,2^{t-1}-2^{r-1})\), for all r such that \(t/2 \le r\le t\).

Proof

The case \(r=t\) corresponds to the trivial case \((\alpha ,\beta )\)=(n, 0). In [10], it is shown that \(Aut(H_t)\) contains involutions fixing \(2^r-1\) points for \(t/2 \le r\le t\). Thus, the statement follows by Proposition 3. \(\square \)

Example 2

A parity-check matrix for \(H_3\) is

$$\begin{aligned} M_3=\left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 \\ 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 1 \\ 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 \\ \end{array} \right) . \end{aligned}$$

We can take the pairs of coordinates (4, 5) and (6, 7) as \(\mathbb {Z}_2[u]\) coordinates and consider the \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code \({\mathcal {C}}\) generated by

$$\begin{aligned} G_3=\left( \begin{array}{c@{\quad }c@{\quad }c|c@{\quad }c} 0 &{} 0 &{} 0 &{} u &{} u \\ 0 &{} 1 &{} 1 &{} 0 &{} u \\ 1 &{} 0 &{} 1 &{} 1 &{} 1 \\ \end{array} \right) . \end{aligned}$$

Note that multiplying any row in \(G_3\) by u we obtain a vector in \(\varPsi ^{-1}(H_3^\perp )\). By Corollary 1 and Proposition 2, \(H_3\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters (3, 2). We remark that \(H_3\) is also a \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code with the same parameters but, according to [6], \(H_t\) is not \(\mathbb {Z}_2\mathbb {Z}_4\)-linear for \(\beta >0\) and \(t>3\).

Example 3

Consider the parity-check matrix for \(H_4\)

$$\begin{aligned} M_4=\left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 \\ 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 1 \\ 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 \\ 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 \\ \end{array} \right) . \end{aligned}$$

Again, we can take the pairs of coordinates (8, 9), (10, 11), (12, 13) and (14, 15) as \(\mathbb {Z}_2[u]\) coordinates. Let \({\mathcal {C}}\) be the \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code generated by

$$\begin{aligned} G_4=\left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c|c@{\quad }c@{\quad }c@{\quad }c} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} u &{} u &{} u &{} u \\ 0 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} u &{} 0 &{} u \\ 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1 \\ 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} u &{} u \\ \end{array} \right) . \end{aligned}$$

Multiplying any row in \(G_4\) by u we obtain a vector in \(\varPsi ^{-1}(H_4^\perp )\). By Corollary 1 and Proposition 2, \(H_4\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters (7, 4). Note that, taking the same pairs of coordinates as quaternary coordinates, it is also true that \(H_4^\perp \) is a \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code, but the \(\mathbb {Z}_2\mathbb {Z}_4\)-dual code is not a Hamming code. For example, the vector \(v=(0,0,0,1,0,0,0,0,0,0,0,0,1,0,1)\) is not orthogonal to the third row of \(M_4\). However, v is in the \(\mathbb {Z}_2\mathbb {Z}_4\)-dual of \(H^\perp _4\).

After a permutation of columns, the matrix \(M_4\) can be written as

$$\begin{aligned} \left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 \\ 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 &{} 1 &{} 0 &{} 1 &{} 1 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 \\ 1 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 &{} 1 &{} 1 &{} 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 0 \\ 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 0 &{} 0 &{} 1 &{} 1 &{} 1 &{} 0 &{} 1 &{} 1 &{} 0 \\ \end{array} \right) . \end{aligned}$$

Now, taking the pairs of coordinates \((i,i+1)\) for \(i=4,\ldots , 14\) as \(\mathbb {Z}_2[u]\) coordinates, we also have that \(H_4^\perp \) is the binary image of the code generated by

$$\begin{aligned} \left( \begin{array}{c@{\quad }c@{\quad }c|c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 1 &{} 1 &{} 0 &{} 1 &{} 1 &{} u &{} 1+u &{} 1 &{} 0 \\ 0 &{} 1 &{} 1 &{} 0 &{} 1 &{} 1 &{} u &{} 1+u &{} 1 \\ 1 &{} 1 &{} 0 &{} 1+u &{} 1+u &{} u &{} 1 &{} 1+u &{} 0 \\ 1 &{} 0 &{} 1 &{} 0 &{} 1+u &{} 1 &{} u &{} 1 &{} 1+u \\ \end{array} \right) . \end{aligned}$$

Therefore, \(H_4\) is also a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters (3, 6).

Corollary 2

Let \(t\ge 3\). The extended Hamming code \(H'_t\), the dual of a Hamming code \(H_t^\perp \) (simplex code), and the dual of an extended Hamming code \((H'_t)^\perp \) (linear Hadamard code) are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes with parameters \((2^r,2^{t-1}-2^{r-1})\), \((2^r-1,2^{t-1}-2^{r-1})\), and \((2^r,2^{t-1}-2^{r-1})\), respectively, for all r such that \(t/2 \le r\le t\).

Proof

On the one hand, extending a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha , \beta )\) trivially results in a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((\alpha +1, \beta )\). Thus, by Theorem 3, \(H'_t\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((2^r,2^{t-1}-2^{r-1})\).

On the other hand, by Proposition 2, the dual code has the same parameters. Therefore, \(H_t^\perp \) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((2^r-1,2^{t-1}-2^{r-1})\) and \((H'_t)^\perp \) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear code with parameters \((2^r,2^{t-1}-2^{r-1})\). \(\square \)

Theorem 4

The binary Golay code \(G_{23}\) and the extended binary Golay code \(G_{24}\) are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes with parameters \((\alpha ,\beta )\). For \(\beta > 0\), the parameters are:

  1. (i)

    (0, 12) or (8, 8), for \(G_{24}\).

  2. (ii)

    (7, 8), for \(G_{23}\).

Proof

It is well known that the automorphism groups of \(G_{23}\) and \(G_{24}\) are the Mathieu groups \(M_{23}\) and \(M_{24}\), respectively [14]. According to [8], the number of fixed points by the involutions of \(M_{24}\) is 0 or 8. For \(M_{23}\) we have that all involutions fix 7 points. Therefore, the result holds by Proposition 3. \(\square \)

Remark 2

In [12], it is stated that \(M_{24}\) has 43470 fixed-point-free involutions. The remaining involutions of \(M_{24}\) are 11,385 involutions fixing 8 points. Therefore, by Proposition 3, \(G_{24}\) has 43,470 \(\mathbb {Z}_2\mathbb {Z}_2[u]\) different structures with parameters (0, 12) and 11,385 with parameters (8, 8). For the case of \(M_{23}\), it has 3795 involutions, all of them fixing 7 points. Therefore, \(G_{23}\) has 3795 \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structures with parameters (7, 8).

6 \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear and \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes

In this section, we prove that any \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code with parameters \((\alpha ,\beta )\) which is also \(\mathbb {Z}_2\)-linear has a \(\mathbb {Z}_2\mathbb {Z}_2[u]\) structure with the same parameters. It is not difficult to see this property using Theorem 2. However, we give here an independent proof in order to better clarify the relation between both classes of codes.

The following property was stated in [13] for vectors over \(\mathbb {Z}_4\). Its generalization for vectors over \(\mathbb {Z}_2\times \mathbb {Z}_4\) is easy and it was established in [11].

Lemma 4

Let \(\mathbf{x}, \mathbf{y}\in \mathbb {Z}_2^\alpha \times \mathbb {Z}_4^\beta \). The following identity holds:

$$\begin{aligned} \varPhi (\mathbf{x}) + \varPhi (\mathbf{y})=\varPhi (\mathbf{x}+\mathbf{y}) + \varPhi \left( 2(\mathbf{x}\star \mathbf{y})\right) , \end{aligned}$$

where \(\star \) stands for the coordinate-wise product.

The next lemma [11] is a direct consequence.

Lemma 5

If \({\mathcal {C}}\) is a \({\mathbb {Z}}_2{\mathbb {Z}}_4\)-additive code, then its binary image \(C=\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear if and only if \(2(\mathbf{x}\star \mathbf{y})\in {\mathcal {C}}\), for all \(\mathbf{x}, \mathbf{y}\in {\mathcal {C}}\).

Define the map \(\theta :\;\mathbb {Z}_2^\alpha \times \mathbb {Z}_4^\beta \;\longrightarrow \;\mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u] ^\beta \) such that, for every element \((x_1,\ldots ,x_\alpha \mid y_1,\ldots ,y_\beta )\in \mathbb {Z}_2^\alpha \times \mathbb {Z}_4^\beta \),

$$\begin{aligned} \theta (x_1,\ldots ,x_\alpha \mid y_1,\ldots ,y_\beta )=(x_1,\ldots ,x_\alpha \mid \vartheta (y_1),\ldots ,\vartheta (y_\beta )), \end{aligned}$$

where \(\vartheta (0)=0;\;\;\vartheta (1)=1;\;\;\vartheta (2)=u;\;\;\vartheta (3)=1+u\). Note that \(\theta =\varPsi ^{-1}\varPhi \).

Theorem 5

If \({\mathcal {C}}\subseteq \mathbb {Z}_2^\alpha \times \mathbb {Z}_4^\beta \) is a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code such that \(\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear, then \({\mathcal {C}}'=\theta ({\mathcal {C}})\subseteq \mathbb {Z}_2^\alpha \times \mathbb {Z}_2[u]^\beta \) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code.

Proof

We use the characterization of Lemma 1 to prove the statement.

First, given \(\mathbf{x}\in {\mathcal {C}}'\), we need to prove that \(u \mathbf{x}\in {\mathcal {C}}'\). Note that \(u\mathbf{x}=\theta (2\theta ^{-1}(\mathbf{x}))\) which is in \({\mathcal {C}}'\).

Next, we want to prove that \(\mathbf{x}+\mathbf{y}\in {\mathcal {C}}'\), for all \(\mathbf{x}, \mathbf{y}\in {\mathcal {C}}'\). Clearly,

$$\begin{aligned} \mathbf{x}+\mathbf{y} = \varPsi ^{-1}\left( \varPsi (\mathbf{x})+\varPsi (\mathbf{y})\right) . \end{aligned}$$
(1)

By Lemma 4, we have

$$\begin{aligned} \varPsi (\mathbf{x})+\varPsi (\mathbf{y})=\varPhi \left( \varPhi ^{-1}\left( \varPsi (\mathbf{x})\right) + \varPhi ^{-1}\left( \varPsi (\mathbf{y})\right) + 2\left( \varPhi ^{-1}\left( \varPsi (\mathbf{x})\right) \star \varPhi ^{-1}\left( \varPsi (\mathbf{y})\right) \right) \right) . \end{aligned}$$
(2)

Combining Eqs. (1) and (2), we obtain

$$\begin{aligned} \mathbf{x}+\mathbf{y}=\theta \left( \theta ^{-1}(\mathbf{x})+\theta ^{-1}(\mathbf{y})+2(\theta ^{-1}(\mathbf{x})\star \theta ^{-1}(\mathbf{y}))\right) . \end{aligned}$$

Since \(\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear, we have that \(2\left( \theta ^{-1}(\mathbf{x})\star \theta ^{-1}(\mathbf{y})\right) \in {\mathcal {C}}\), by Lemma 5. It follows that \(\mathbf{x}+\mathbf{y}\in {\mathcal {C}}'\). \(\square \)

The following corollary gives the minimum \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code containing the image under the map \(\theta \) of a fixed \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code.

Corollary 3

Let \({\mathcal {C}}\) be a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code and let G be a generator matrix of \({\mathcal {C}}\). Let \(\{u_i\}_{i=1}^{\gamma }\) be the rows of order two and \(\{v_j\}_{j=1}^{\delta }\) the rows of order four in G. Then, the code \({\mathcal {C}}'\) generated by \(\{\theta (u_i)\}_{i=1}^{\gamma }\), \(\{\theta (v_j),\theta (2v_j)\}_{j=1}^{\delta }\) and \(\{\theta (2v_j * v_k)\}_{1\le j<k\le \delta }\) is the minimum \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code containing \(\theta ({\mathcal {C}})\).

Proof

By [11], we have that the minimum \(\mathbb {Z}_2\)-linear code containing \(\varPhi ({\mathcal {C}})\) is \(\langle \varPhi ({\mathcal {C}}) \rangle \) that is generated by \(\{\varPhi (u_i)\}_{i=1}^{\gamma }\), \(\{\varPhi (v_j),\varPhi (2v_j)\}_{j=1}^{\delta }\) and \(\{\varPhi (2v_j * v_k)\}_{1\le j<k\le \delta }\). Since \(\theta =\varPsi ^{-1}\varPhi \), \({\mathcal {C}}'=\langle \{\theta (u_i)\}_{i=1}^{\gamma },\{\theta (v_j),\theta (2v_j)\}_{j=1}^{\delta },\{ \theta (2v_j *v_k)\}_{1\le j<k\le \delta }\rangle \) is the minimum \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code containing \(\theta ({\mathcal {C}})\). \(\square \)

Let \({\mathcal {C}}\) be a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code and let \({\mathcal {C}}'=\theta ({\mathcal {C}})\). We have that for all \(\mathbf{x}\in {\mathcal {C}}'\), \(u\mathbf{x}=\theta (\theta ^{-1}(u\mathbf{x}))=\theta (2\theta ^{-1}(\mathbf{x}))\in {\mathcal {C}}\) because \(2\theta ^{-1}(\mathbf{x})\in {\mathcal {C}}\). Therefore, for any \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code \({\mathcal {C}}\) and \({\mathcal {C}}'=\theta ({\mathcal {C}})\) the first condition of Lemma 1 is always satisfied. From the last theorem, if \(\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear, then \(\theta ({\mathcal {C}})\) is a \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive code. However, it is not true when \(\varPhi ({\mathcal {C}})\) is not \(\mathbb {Z}_2\)-linear. Hence, the second condition of Lemma 1 is satisfied for \({\mathcal {C}}'=\theta ({\mathcal {C}})\) if and only if \(\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear. The next example will show that the second condition is not satisfied in \({\mathcal {C}}'=\theta ({\mathcal {C}})\) for a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code \({\mathcal {C}}\) whose image is not linear under the Gray map.

Example 4

Let \({\mathcal {C}}\) be a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code generated by

$$\begin{aligned} \left( \begin{array}{c@{\quad }c@{\quad }c@{\quad }|@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 1 &{} 0 &{} 1 &{} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 1 &{} 1 &{} 0 &{} 2 &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 1 &{} 0 &{} 1 &{} 0 \\ 0 &{} 0 &{} 1 &{} 1 &{} 0 &{} 0 &{} 1 \\ \end{array} \right) . \end{aligned}$$

Note that \(\varPhi ({\mathcal {C}})\) is not \(\mathbb {Z}_2\)-linear by Lemma 5 due to the fact that \(2(0,0,0\mid 1,0,1,0)\star (0,0,1\mid 1,0,0,1)=(0,0,0\mid 2,0,0,0)\) which is not in \({\mathcal {C}}\).

Now, \(\theta (0,0,0\mid 1,0,1,0)+\theta (0,0,1\mid 1,0,0,1)=(0,0,1\mid 0,0,1,1)\not \in {\mathcal {C}}'\) because \(\theta ^{-1}(0,0,1\mid 0,0,1,1)=(0,0,1\mid 0,0,1,1)\not \in {\mathcal {C}}\). Hence the second condition of Lemma 1 is not satisfied.

There are \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes which are not \(\mathbb {Z}_2\mathbb {Z}_4\)-linear, as we can see in the following example.

Example 5

Let \({\mathcal {D}}\subset \mathbb {Z}_2[u]^4\) be the code generated by \(\mathbf{x}=(1,1,1,u)\) and \(\mathbf{y}=(1,u,1,1)\). We can see that

$$\begin{aligned} \theta \left( \theta ^{-1}(\mathbf{x}) + \theta ^{-1}(\mathbf{y})\right) =\theta (2,3,2,3)=(u,1+u,u,1+u). \end{aligned}$$

It is easy to check that the equation \(\lambda \mathbf{x}+\mu \mathbf{y}= (u,1+u,u,1+u)\) has no solution for \(\lambda ,\mu \in \mathbb {Z}_2[u]\). Therefore \({\mathcal {C}}=\theta ^{-1}({\mathcal {D}})\) is not a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code.

Remark 3

Note that Proposition 3 and Theorem 2 apply also to \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes but only in one direction. I.e., if C is a \(\mathbb {Z}_2\mathbb {Z}_4\)-linear code, then Aut(C) has even order. But the converse is not true, in general. In the previous example, the code \(D=\varPsi ({\mathcal {D}})\) is \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear and hence Aut(D) is of even order, but D is not \(\mathbb {Z}_2\mathbb {Z}_4\)-linear.

It is worth noting that if \({\mathcal {C}}\) is a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code such that \(\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear, it is not yet true that \(\varPhi ({\mathcal {C}}^\perp )=\varPhi ({\mathcal {C}})^\perp \) as we can see in the next example.

Example 6

Let \({\mathcal {C}}\subset \mathbb {Z}_4^3\) be the code generated by \(\mathbf{x}=(1,1,1)\) and \(\mathbf{y}=(0,2,3)\). It can be easily verified that \(\varPhi ({\mathcal {C}})\) is \(\mathbb {Z}_2\)-linear. However, we have that \((1,1,2)\in {\mathcal {C}}^\perp \), but \(\varPhi (1,1,2)=(0,1,0,1,1,1)\notin \varPhi ({\mathcal {C}})^\perp \).

Therefore, we have that if \({\mathcal {C}}\) is a \(\mathbb {Z}_2\mathbb {Z}_4\)-additive code, whose binary image is \(\mathbb {Z}_2\)-linear, and \({\mathcal {C}}'=\theta ({\mathcal {C}})\), then \(\varPhi ({\mathcal {C}})\) and \(\varPhi ({\mathcal {C}}^\perp )\) are formally dual whereas \(\varPsi ({\mathcal {C}})\) and \(\varPsi ({\mathcal {C}}^\perp )\) are dual (Theorem 1). The relations among these codes are illustrated in Fig. 1.

Fig. 1
figure 1

Relations among \(\mathbb {Z}_2\mathbb {Z}_4\)-additive codes (whose binary images are \(\mathbb {Z}_2\)-linear), \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-additive codes, their binary images and their duals

7 Conclusions

From Theorem 2, \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes form a wide class of \(\mathbb {Z}_2\)-linear codes. Moreover, the equivalence between \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-duality and \(\mathbb {Z}_2\)-duality (Theorem 1), suggests that \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes have no meaningful additional properties to those of \(\mathbb {Z}_2\)-linear codes. However, the partition of the coordinate set into two subsets (the \(\mathbb {Z}_2\) and the \(\mathbb {Z}_2[u]\) coordinates) like in the case of \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes, open some possible lines of research. In particular, cyclic \(\mathbb {Z}_2\mathbb {Z}_2[u]\)-linear codes are studied in [2, 16] as well as cyclic \(\mathbb {Z}_2\mathbb {Z}_4\)-linear codes were studied in [1, 4].