# Affine Cartesian codes with complementary duals

A linear code C with the property that C ∩ C^ = {0 } is said to be a linear complementary dual, or LCD, code. In this paper, we consider generalized affine Cartesian codes which are LCD. Generalized affine Cartesian codes arise naturally as the duals of affine Cartesian codes in the same way that generalized Reed-Solomon codes arise as duals of Reed-Solomon codes. Generalized affine Cartesian codes are evaluation codes constructed by evaluating multivariate polynomials of bounded degree at points in m-dimensional Cartesian set over a finite field K and scaling the coordinates. The LCD property depends on the scalars used. Because Reed-Solomon codes are a special case, we obtain a characterization of those generalized Reed-Solomon codes which are LCD along with the more general result for generalized affine Cartesian codes.

## Authors

• 13 publications
• 4 publications
• 7 publications
06/04/2022

### Affine Symplectic Grassmann codes

In this manuscript, we introduce a new class of linear codes, called aff...
05/15/2020

### Batch Codes from Affine Cartesian Codes and Quotient Spaces

Affine Cartesian codes are defined by evaluating multivariate polynomial...
10/18/2021

### Affine Hermitian Grassmann Codes

The Grassmannian is an important object in Algebraic Geometry. One of th...
12/22/2019

### Johnson Graph Codes

We define a Johnson graph code as a subspace of labelings of the vertice...
10/20/2020

### Decoding of Lifted Affine-Invariant Codes

Lifted Reed-Solomon codes, a subclass of lifted affine-invariant codes, ...
06/29/2021

### A remark on 𝔽_q^n-Linear MRD codes

In this note, we provide a description of the elements of minimum rank o...
06/09/2020

### Hermitian-Lifted Codes

In this paper, we construct codes for local recovery of erasures with hi...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

In this paper, we consider linear codes which are linear complementary dual (LCD), a property introduced by Massey in 1992 [22]. An LCD code is a linear code that has only the zero word in common with its dual. Recall that a linear code is an -subspace of , where is a finite field. Given such a code , its dual is . Hence, if is LCD, then and ; of course, if is not finite and instead has characteristic , then this naturally holds.

In 2015, Carlet and Guilley [4] demonstrated how LCD codes provide countermeasures to side-channel and fault-injection attacks. They use the observation (made by Massey) that a generator matrix of an LCD code has the property that is nonsingular; certainly, the same holds for a parity-check matrix of an LCD code , meaning is nonsingular. Suppose that data is masked as where . Since , there exists with

 z=x′G+yH.

Then

 zGT(GGT)−1=x′GGT(GGT)−1+yHGT(GGT)−10=x′

and

 zHT(HHT)−1=x′GHT(HHT)−10+yHHT(HHT)−1=y.

According to Carlet and Guilley, the countermeasure is degree secure where is the minimum distance of , and the greater the degree of the countermeasure, the harder it is to pass a successful SCA. To consider a fault injection attack, suppose is modified into where . Then for some . Detection amounts to distinguishing from . We have that

 z+ϵ=(x′+e)G+(y+f)H.

Then

 (z+ϵ)HT(HHT)−1=(x′+e)GHT(HHT)−1+(y+f)HHT(HHT)−1=y+f.

Notice that if and only if if and only if . Thus, fault not detected if . If , where is the minimum distance of , then fault is detected. Both of these applications motivate the need for LCD codes with large minimum distance.

Recently, it was shown that every linear code over with is equivalent to an LCD code, as demonstrated by Carlet, Mesnager, Tang, Qi, and Pellikaan [5]. However, explicit constructions of LCD codes remain elusive. There have been results on the characterizations of LCD codes from particular families. Among them, there are some results for algebraic geometry codes, a particular family of evaluation code [23], cyclic codes [29], quasi-cyclic codes [14], and generalized Reed-Solomon codes [10].

In this paper, we consider LCD codes which are a special type of evaluation code, called a generalized affine Cartesian code. Generalized Reed-Solomon codes are a special case. Our results on generalized Reed-Solomon codes differ from those in [10]

in that we provide a characterization of which generalized Reed-Solomon codes are LCD and give explicit constructions, as opposed to determining the existence of such codes with a particular set of parameters; our results apply to codes over fields of any characteristic (as opposed to odd prime powers) as well.

A generalized affine Cartesian code is defined as follows. Let be a finite field with elements, and let be non-empty subsets of Set . Define the Cartesian product set

 A:=A1×⋯×Am⊆Km.

Let be a polynomial ring, let be the points of , and let be the

-vector space of all polynomials of

of degree less than where is a non-negative integer. Fix , and set . The evaluation map

 evk:S

defines a linear map of -vector spaces. The image of , denoted by , defines a linear code, called the generalized affine Cartesian evaluation code (Cartesian code for short) of degree associated to and The dimension and the length of are given by (dimension as -vector space) and respectively. The minimum distance of is given by

 d(Ck(A,v)):=min{∥evk(f)∥:evk(f)≠0;f∈S≤k},

where is the number of non-zero entries of . Generalized affine Cartesian codes arise naturally as duals of affine Cartesian codes; this is seen in the computation by Beelen and Datta [3], though the codes are not mentioned by name. In this paper, we investigate them more fully.

Cartesian codes are special types of affine Reed-Muller codes in the sense of [26, p. 37] and a type of affine variety codes, which were defined in [15]. Cartesian codes are a generalization of -ary Reed-Muller codes, which are Cartesian codes with

Cartesian codes have been studied in different works when the vector of ones: they appeared first time in [16] and then independently in [20]. In [16], the authors study the basic parameters of Cartesian codes, they determine optimal weights for the case when is the product of two sets, and then present two list decoding algorithms. In [20] the authors study the vanishing ideal and then, using commutative algebra tools, for instance regularity, degree, Hilbert function, the authors determine the basic parameters of Cartesian codes in terms of the sizes of the components of the Cartesian set. In [6], the author shows some results on higher Hamming weights of Cartesian codes and gives a different proof for the minimum distance using the concepts of Gröbner basis and footprint of an ideal. In [7] the authors find several values for the second least weight of codewords, also known as the next-to-minimal Hamming weight. In [3] the authors find the generalized Hamming weights and the dual of Cartesian codes.

This paper is organized as follows. Section 2 details properties of generalized affine Cartesian codes, hereafter referred to as Cartesian codes. In Section 3, we provide a characterization of Cartesian codes which are LCD. Examples are found in Section 4, and our results are summarized in Section 5.

For all unexplained terminology and additional information, we refer to [11, 13, 27] for commutative algebra and the theory of Hilbert functions, [21, 26] for the theory of linear codes, and [8, 9, 12, 17, 19, 24, 25] for other families of evaluation codes, including several variations of Reed-Muller codes and projective versions of the Cartesian codes.

## 2 Properties of generalized affine Cartesian codes

In what follows, , the cardinality of for . An important characteristic for Cartesian codes and evaluation codes in general is the fact that we can use commutative algebra methods to study them. The reason is because the kernel of the evaluation map is precisely , where is the vanishing ideal of consisting of all polynomials of that vanish on . Thus, the algebra of is related to the basic parameters of . Observe the kernel of the evaluation map is independent of because every entry of is non-zero. In fact, the vanishing ideal of is given by [20, Lemma 2.3].

A monomial matrix is a square matrix with exactly one nonzero entry in each row and column. A monomial matrix can be written either in the form or the form , where is a diagonal matrix with nonzero entries at the diagonal and is a permutation matrix. Let and be codes of the same length over the field , and let be a generator matrix for Then and are monomially equivalent provided there is a monomial matrix over the same field so that is a generator matrix of . Monomially equivalent codes have the same length, dimension and minimum distance. For more properties of monomially equivalent codes, see [18] and references there.

Using properties of monomially equivalent codes along with [20, Theorems  3.1 and  3.8], we have the following result.

###### Theorem 2.1.

Let be a Cartesian code.

1. The length of is

2. The dimension of is (i.e.  is surjective) if , and

 dim(Ck(A,v))=m∑j=0(−1)j∑1≤i1<⋯

otherwise.

3. The minimum distance of is 1 if , and for we have

 d(Ck(A,v))=(ns+1−ℓ)m∏i=s+2ni,

where and are uniquely defined by with (if we understand that , and if then we set and ).

In light of Theorem 2.1, from now on we assume that .

The rest of this section is devoted to prove that the dual of the Cartesian code is where and is as described below. The dual of the Cartesian code the case when is the vector of ones, was previously found in [3].

Given a positive integer we define Let be the graded-lexicographic order on the set of monomials of This order is defined in the following way: if and only if or and the leftmost nonzero entry in is positive. From now on we fix the order . Denote the variables by For each define the polynomial

 Li(Xi):=∏ai∈Ai(Xi−ai). (2.1)

Then, according to [20, Lemma 2.3], and [11, Proposition 4], is a Gröbner basis of

Notice that for evaluation purposes we can assume that for meaning

 Ck(A,v)={evk(f(X)):f(X)∈S

Indeed, if , then there exists such that By the division algorithm in [1, Theorem 1.5.9], there are in such that

 f(X)=m∑i=1fi(X)Li(X)+r(X),

where for and Then and Given this, moving forward, we make the assumption that .

Next we point out that the map is injective when for It is easy to see that for all implies However, and for forces for . As a result, meaning .

For each element of , define the polynomial

 La(X):=L1(X1)(X1−a1)⋯Lm(Xm)(Xm−am)∈S. (2.2)

For , it is straightforward to check that if and only if In addition, where denotes the formal derivative of Writing in terms of the derivatives is convenient at times for computational purposes.

Given there exists a polynomial in such that and for Define the polynomial

 fc(X):=∑a∈ALa(X)La(a)ca.

Then and By definition of we have for Based on the injectivity of when we restrict to polynomials with , is the unique polynomial in such that and for

Using these ideas we are almost ready to find the dual of a Cartesian code. Just one more result.

Let . Then

###### Proof.

Observe that the dimension of given in Theorem 2.1 (2) is the number of integer solutions of the following inequality

 x1+⋯+xm≤k−1, where 0≤xi≤ni−1 for i∈[m]. (2.3)

The number of integer solutions of the inequality

 x1+⋯+xm>k−1, where 0≤xi≤ni−1 for i∈[m], (2.4)

is the same that the number of integer solutions of the inequality

 x1+⋯+xm

which is the dimension of As the total number of integer solutions of (2.3) plus the total number of integer solutions of (2.4) is we obtain the result. ∎

We come to the main result of this section.

###### Theorem 2.3.

Let be points of the Cartesian set The dual of is

 Ck(A,v)⊥=Ck′(A,v′),

where and is given by

###### Proof.

Let be an element of such that for and let be an element of such that for By the division algorithm in [1, Theorem 1.5.9], there are in such that

 f(X)g(X)=m∑i=1fi(X)Li(Xi)+r(X),

where for and

 deg(r(X))≤deg((fg)(X))≤m∑i=1(ni−1)−1. (2.5)

Observe that for all Then

 r(X)=∑a∈ALa(X)La(a)(fg)(a). (2.6)

The coefficient of the monomial of degree on the right-hand side of (2.6) is given by:

 ∑a∈A(fg)(a)La(a)=∑a∈Af(a)g(a)La(a)=∑a∈Avaf(a)g(a)vaLa(a)= (2.7) =(va1f(a1),…,vanf(an))⋅(g(a1)va1La1(a1),…,g(an)vanLan(an)). (2.8)

By (2.5) so the coefficient of the monomial of degree on the left-side of (2.6) is Thus the dot product shown on (2.8) is As the left-hand side of the dot product given in (2.6) is an arbitrary element of , and right-hand side of the dot product of Equation (2.6) is an arbitrary element of , the proof is complete because where the last equality follows from Lemma 2.2. ∎

## 3 Finding LCD codes from Cartesian codes

In this section, we determine which Cartesian codes , where , are LCD. As a result, a number of explicit constructions for LCD codes are found.

### 3.1 Generalized Reed-Solomon codes (i.e., the case m=1)

We start with the case when , meaning , so Observe that in this case the Cartesian code is the generalized Reed-Solomon code which is given by

 GRSk(A,v):={(v1f(a1),…,vnf(an))∣f(X)∈K[X],degf(X)

Recall and for each element By (2.3),

 Ck(A,v)⊥ ={(g(a1)v1La1(a1),…,g(an)vnLan(an))∣g(X)∈K[X],degg(X)

We are interested in finding conditions on and such that is LCD. Observe that the Cartesian code is not LCD if and only if there are nonzero polynomials and such that , and

 (v1f(a1),…,vnf(an))=(g(a1)v1La1(a1),…,g(an)vnLan(an)).

This holds if and only if

 v2iLai(ai)f(ai)=g(ai), for all ai∈A. (3.1)

Define the polynomial associated to by

 H(X):=∑ai∈Av2iLai(X). (3.2)

Notice that for all and . Moreover, and are coprime in . To see this, observe that if and only if whereas if . Since factors into linear terms over , and have no nonconstants common factors. Then we have the following result.

###### Proposition 3.1.

The Cartesian code is LCD if and only if for all nonzero polynomials with and we have

 H(X)f(X)−g(X)∉⟨L(X)⟩

where is defined in (3.2).

###### Proof.

Equation (3.1) holds if and only if divides . ∎

As and are coprime, by the Extended Euclidean Algorithm [28, Chapter 3], there exists a natural number , polynomials for and polynomials for such that

 g0=L, g1=H, h0=f1=1, h1=f0=0 gi−1=qigi+gi+1 where deggi+1

The following is the basis of our main results of this section.

###### Proposition 3.2.

Let be a Cartesian code and be the remainders from the Extended Euclidean Algorithm applied to polynomials and . Then, is LCD if and only if for all ,

 deg(gi−1(X))≤n−kordeg(gi(X))≥n−k.
###### Proof.

We prove both implications via the contrapositives.

() Assume there is such that Then by (3.3) and (3.4), there are and in such that and and By Proposition 3.1, is not LCD.

() Assume is not LCD. By Proposition 3.1, there are polynomials and in such that and

 L(X)h(X)+H(X)f(X)=g(X). (3.5)

Let be the remainder such that and Observe which means now we just need to prove

Combining (3.5) with (3.3), we obtain that

 L(X)(h(X)gi(X)−hi(X)g(X))+H(X)(f(X)gi(X)−fi(X)g(X))=0.

Because and are coprime, Moreover it holds that

 deg((fgi)(X)) =deg(f(X))+deg(gi(X))≤deg(f(X))+deg(g(X))

Then

 f(X)gi(X)=fi(X)g(X),

which implies Then by (3.4)

 deg(gi−1(X))=n−deg(fi(X))=n−deg(f(X))−deg(gi(X))+deg(g(X))>n−k,

which completes the proof.

The following theorem is the main result of this section and a corollary of Proposition 3.2.

###### Theorem 3.3.

Let be a Cartesian code and be the remainders from the Extended Euclidean Algorithm applied to polynomials and . Then, is LCD if and only if

 n−k∈{n−1,n−2,…,deg(g1(X)),deg(g2(X)),…,deg(gt+1(X))}.

### 3.2 Affine Cartesian codes on m>1 components

Let be the points of the Cartesian set Now we are ready to determine whether a Cartesian code is LCD. By (2.3), the dual of is given by

 Ck(A,v)⊥=Ck′(A,v′),

where and is defined by Thus the Cartesian code is not LCD if and only if there are nonzero polynomials and such that

 (v1f(a1),…,vnf(an))=(g(a1)v1La1(a1),…,g(an)vnLan(an)). (3.6)

Equation (3.6) holds if and only if

 v2iLai(ai)f(ai)=g(ai), for all ai∈A. (3.7)

The polynomial associated to is defined by

 H(X):=∑ai∈Av2iLai(X). (3.8)

Notice that

1. for all and

2. for all .

Moreover, if is an element of that satisfies 1. and 2., then We have the following characterization for LCD codes.

###### Proposition 3.4.

The Cartesian code is LCD if and only if for all nonzero polynomials with and we have

 H(X)f(X)−g(X)∉I(A),

where is the polynomial associated to defined in (3.8)

###### Proof.

Equation (3.7) holds if and only if

Next, we focus on a special family of Cartesian codes.

###### Definition 3.5.

For , write and let . The Cartesian vector is defined as a vector of length with

 (v1×⋯×vm)a:=v1j1⋯vmjm where a=