A family of codes with locality containing optimal codes
Bruno Andrade, Cícero Carvalho, Victor G.L. Neumann, Antônio C.P. Veiga
aa r X i v : . [ c s . I T ] J a n A family of codes with locality containingoptimal codes
Bruno Andrade , C´ıcero Carvalho , Victor G.L. Neumann andAntˆonio C.P. Veiga Faculdade de Matem´atica, Faculdade de Engenharia El´etricaUniversidade Federal de Uberlˆandia, Av. J. N. ´Avila 2121, 38.408-902Uberlˆandia – MG, Brazil
Keywords:
Linear codes, Block codes, Locally recoverable codes, codes withlocality.
MSC:
Abstract
Locally recoverable codes were introduced by Gopalan et al. in 2012, and in thesame year Prakash et al. introduced the concept of codes with locality, which area type of locally recoverable codes. In this work we introduce a new family ofcodes with locality, which are subcodes of a certain family of evaluation codes.We determine the dimension of these codes, and also bounds for the minimumdistance. We present the true values of the minimum distance in special cases,and also show that elements of this family are “optimal codes”, as defined byPrakash et al.
The class of locally recoverable codes was introduced in 2012 by Gopalanet al. (see [11]). The idea was to ensure reliable communication when usingdistributed storage systems. Thus the authors define a code as having locality r if an entry at position i of a codeword of length n may be recovered froma set (which may vary with i ) of at most r other entries, for all i = 1 , . . . , n .This would ensure the recovering of a codeword even in the presence of anerasure, due for example to a failure of some node in the network. In thatsame year Prakash et al. (see [13]) introduced the concept of codes withlocality ( r, δ ), also called ( r, δ )-locally recoverable codes, which are codes1f length n such that for every position i ∈ { , . . . , n } there is a subset S i ⊂ { , . . . , n } containing i and of size at most r + δ − i -th entry of a codeword may be recovered from any subset of r entries withpositions in S i \ { i } , so that we may recover any entry even with δ − r, δ )-locally recoverablecodes. We call this family quasi affine cartesian codes. We determine theirdimension (see Corollary 3.4 and Theorem 3.6) together with lower and upperbounds for the minimum distance (see Theorem 4.1). We list some caseswhere the codes are optimal (see Corollary 4.2) and we also determine theexact value of the minimum distance in some special cases of the code (seeTheorem 4.1, Theorem 5.8 and Corollary 5.9).In the next section we introduce the family of quasi affine cartesian codes,and prove that these codes are locally recoverable. In Section 3 we presentseveral results on the dimension of these codes, after recalling some facts fromGr¨obner basis theory which we will need. In the following section we presentlower and upper bounds for the minimum distance of quasi affine codes, anddetermine the exact values in some cases. We also prove that some of thecodes we introduced are optimal codes. In Section 5 we treat a special caseof quasi affine cartesian codes, for which we determine more values for theminimum distance. The paper ends with several numerical examples. Let F q be a finite field with q elements. Definition 2.1.
Let m, r, δ be positive integers, with δ ≥ and r + δ − ≤ m .We say that a (linear) code C ⊂ F mq is ( r, δ ) -locally recoverable if for every i ∈ { , . . . , m } there exists a subset S i ⊂ { , . . . , n } , containing i and ofcardinality at most r + δ − , such that the punctured code obtained by removingthe entries which are not in S i has minimum distance at least δ . The condition on the minimum distance in the above definition showsthat one cannot have two distinct codewords in the punctured code whichcoincide in (at least) r positions, so any r positions in the set S i determinethe remaining δ − K , . . . , K n be a collection of non-empty subsets of F q , and let X := K × · · · × K n := { ( α , . . . , α n ) | α i ∈ K i for all i } ⊂ F nq . d i := | K i | for i = 1 , . . . , n , so clearly |X | = Q ni =1 d i =: m , and let X = { α , . . . , α m } . It is not difficult to check that the ideal of polynomialsin F q [ X , . . . , X n ] which vanish on X is I X = Y α ∈ K ( X − α ) , . . . , Y α n ∈ K n ( X n − α n ) ! (see e.g. [12, Lemma 2.3] or [4, Lemma 3.11]). The evaluation morphismΨ : F q [ X , . . . , X n ] → F mq f ( f ( α ) , . . . , f ( α m ))is an F q -linear map and ker Ψ = I X . Actually, this is a surjective map becausefor each i ∈ { , . . . , m } there exists a polynomial f i such that f i ( α j ) is equalto 1, if j = i , or 0, if j = i .Let d be a nonnegative integer. In what follows we will denote by F q [ X , . . . , X n ] ≤ d the F q -vector space formed by all polynomials of degreeup to d , together with the zero polynomial. Definition 2.2.
Let d be a nonnegative integer. The affine cartesian code (of order d ) C X ( d ) defined over the sets K , . . . , K n is the image, by Ψ , ofthe polynomials in F q [ X , . . . , X n ] ≤ d . These codes appeared independently in [12] and [10] (in [10] in a gener-alized form). In the special case where K = · · · = K n = F q we have thewell-known generalized Reed-Muller code of order d . In [12] the authors provethat we may ignore, in the cartesian product, sets with just one element andmoreover may always assume that 2 ≤ d ≤ · · · ≤ d n . The dimension andthe minimum distance of these codes are known (see e.g. [12] or [10]).In what follows we construct ( r, δ )-locally recoverable codes which aresubcodes of affine cartesian codes. Definition 2.3.
Let d and δ be integers with d ≥ and δ ≥ , let s ∈{ , . . . , n } and let P ( δ,s ) d be the set of polynomials f ∈ F q [ X , . . . , X n ] ≤ d suchthat deg X s f < d s − δ + 1 , together with the zero polynomial. The ( δ, s )-quasiaffine cartesian code (of order d ) D ( δ,s ) X ( d ) defined over the sets K , . . . , K n is the image, by Ψ , of the set P ( δ,s ) d . Theorem 2.4.
Let K , . . . , K n be subsets of F q such that | K i | = d i ≥ forall i = 1 , . . . , n , with n ≥ , let δ ≥ be an integer such that d s − δ + 1 ≥ and let d be a nonnegative integer. For any s ∈ { , . . . , n } , the ( δ, s )-quasiaffine cartesian code (of order d ) D ( δ,s ) X ( d ) defined over the sets K , . . . , K n is locally recoverable with locality ( r, δ ) where r = d s − δ + 1 . roof. Let f ∈ P ( δ,s ) d , so ( f ( α ) , . . . , f ( α m )) ∈ D ( δ,s ) X ( d ). Let α = ( α , . . . , α n ) ∈X and let I α = { ( α , . . . α s − , β, α s +1 , . . . α n ) | β ∈ K s } , a set which has d s = r + δ − β , . . . , β r ∈ I α such that we know the values f ( β k ) =: c k , for k ∈ { , . . . , r } , we will provethat then we can deduce the value of f ( β ) for any β ∈ I α .Write f = P r − i =0 g i X is , where g , . . . , g r − are polynomials in the variables X , . . . , X s − , X s +1 , . . . , X n , and let b i := g i ( α , . . . α s − , α s +1 , . . . α n ) for i =0 , . . . , r −
1. Denoting by β k the s -th coordinate of β k , for k = 1 , . . . , r , fromthe assumption we get that c k = f ( β k ) = r − X i =0 b i β ik , for k ∈ { , . . . , r } . This system of equations can be rewritten as a matrix equation β β · · · β r − β β · · · β r − β β · · · β r − β r β r · · · β r − r b b b : b r − = c c c : c r , which has a unique solution ( b , b , . . . , b r − ), since the square r × r matrix isa Vandermonde matrix. This allow us to determine f ( β ) for any β ∈ I α . In this section we determine the dimension of ( δ, s )-quasi affine cartesiancodes, and we will need some facts about Gr¨obner basis which we recallbelow.Let ≺ be a monomial order in (the set of monomials of) F q [ X , . . . , X n ],i.e. ≺ is a total order, if M ≺ M then M M ≺ M M for all monomials M, M , M , and 1 is the least monomial. The greatest monomial appearingin a polynomial f is called the leading monomial of f and is denoted by LM ( f ). Definition 3.1.
Let J ⊂ F q [ X , . . . , X n ] be an ideal. A Gr¨obner basis (withrespect to a monomial order ≺ ) for J is a basis G for J such that the leadingmonomial of any polynomial in J is a multiple of the leading monomial of ome polynomial in G . The footprint of J (with respect to a monomial order ≺ ) is the set of monomials of F q [ X , . . . , X n ] which are not leading monomialsof any polynomials in J , and is denoted by ∆( J ) . B. Buchberger proved that, given a monomial order, any (nonzero) ideal J ⊂ F q [ X , . . . , X n ] admits a Gr¨obner basis (see [2] or [1, Sec. 1.7]). He alsoproved that a basis for F q [ X , . . . , X n ] /J as an F q -vector space is given bythe classes of the monomials in ∆( J ) (see e.g. [1, Prop. 2.1.6]). Definition 3.2.
Let ≺ be a monomial order in F q [ X , . . . , X n ] and let J ⊂ F q [ X , . . . , X n ] be an ideal. Let { g , . . . , g r } be a (not necessarily Gr¨obner)basis for J , we define ∆( LM ( g ) , . . . , LM ( g r )) as the set of monomials of F q [ X , . . . , X n ] which are not multiples of any of the leading monomials of g , . . . , g r . Clearly we have ∆( J ) ⊂ ∆( LM ( g ) , . . . , LM ( g r )) and, moreover, ∆( J ) =∆( LM ( g ) , . . . , LM ( g r )) if and only if { g , . . . , g r } is a Gr¨obner basis for J .In what follows we will use the graded-lexicographic order in F q [ X , . . . , X n ],with X n ≺ · · · ≺ X .For i = 1 , . . . , n let f i = Q α ∈ K i ( X i − α ), so that deg f i = d i and I X = h f , . . . , f n i . Since any two of the leading monomials of f , . . . , f n are coprimewe get that { f , . . . , f n } is a Gr¨obner basis for I X (see [9, Prop. 4, page 104])so ∆( I X ) = ∆( X d , . . . , X d n n ) = { X a · · · X a n n | ≤ a i < d i , ∀ i = 1 , . . . , n } . Let ∆( I X ) ≤ d = { M ∈ ∆( I X ) | deg( M ) ≤ d } , it is known (see e.g. [4, Prop.3.12]) that dim( C X ( d )) = | ∆( I X ) ≤ d | . This implies that if d ≥ P ni =1 ( d i − C X ( d )) = | ∆( I X ) ≤ d | = | ∆( I ) | = Q ni =1 d i , while if 0 ≤ d < Q ni =1 d i thendim( C X ( d )) = (cid:18) n + dd (cid:19) − n X i =1 (cid:18) n + d − d i d − d i (cid:19) + · · · +( − j X ≤ i < ···
Let ∆( I X ) ( δ,s ) ≤ d = { M ∈ ∆( I X ) ≤ d | deg X s M < d s − δ + 1 } ,then dim( D ( δ,s ) X ( d )) = | ∆( I X ) ( δ,s ) ≤ d | . roof. Given f ∈ P ( δ,s ) d let g ∈ F q [ X , . . . , X n ] be its remainder in the divisionby { f , . . . , f n } , then Ψ( f ) = Ψ( g ). From the division algorithm we knowthat any monomial which appear in g is not a multiple of LM ( f i ) = X d i i forall i = 1 , . . . , n , and also that deg g ≤ deg f and deg X s g < d s − δ + 1. Thus g ∈ P ( δ,s ) d and moreover, g is a linear combination of monomials in ∆( I X ) ( δ,s ) ≤ d .This shows that dim( D ( δ,s ) X ( d )) ≤ | ∆( I X ) ( δ,s ) ≤ d | . LetΨ : F q [ X , . . . , X n ] /I X → F mq be defined as Ψ( f + I X ) = Ψ( f ), we know that Ψ is an isomorphism andclearly D ( δ,s ) X ( d ) = { Ψ( h + I X ) | h ∈ h ∆( I X ) ( δ,s ) ≤ d i} , where h ∆( I X ) ( δ,s ) ≤ d i is the F q -vector space generated by the monomials in ∆( I X ) ( δ,s ) ≤ d . Since ∆( I X ) ( δ,s ) ≤ d ⊂ ∆( I X ) we know from Buchberger’s result that the classes in F q [ X , . . . , X n ] /I X of the monomials in ∆( I X ) ( δ,s ) ≤ d are linearly independent over F q , thus we getdim( D ( δ,s ) X ( d )) = | ∆( I X ) ( δ,s ) ≤ d | .Let ˜ d := n X i =1 i = s ( d i −
1) + d s − δ . Corollary 3.4. If d ≥ ˜ d then D ( δ,s ) X ( d ) = D ( δ,s ) X ( ˜ d ) , and dim( D ( δ,s ) X ( ˜ d )) = ( d s − δ + 1) n Y i =1 i = s d i . Also dim( D ( δ,s ) X ( ˜ d − D ( δ,s ) X ( ˜ d )) − .Proof. From the above proof we get that if M ∈ ∆( I X ) ( δ,s ) ≤ d then deg X s ( M ) For s ∈ { , . . . , n } we denote by X s the product X s = K × · · · × K s − × K s +1 × · · · × K n . Observe that we may define the affine cartesian code C X s ( d ) as in Def-inition 2.2, except that now C X s ( d ) is defined over the sets K , . . . , K s − ,K s +1 , . . . , K n . Theorem 3.6. Let s ∈ { , . . . , n } and let d be an integer such that ≤ d < ˜ d .If ≤ d < r = d s − δ + 1 then dim F q D ( δ,s ) X ( d ) = dim F q C X ( d ) , and if r ≤ d ≤ ˜ d then dim F q D ( δ,s ) X ( d ) = dim F q C X ( d ) − δ − X i =0 dim F q C X s ( d − r − i ) , (1) where dim F q C X s ( d − r − i ) = 0 if d − r − i < .Proof. If 1 ≤ d < r = d s − δ + 1 then from Definitions 2.2 and 2.3 we get thatdim F q D ( δ,s ) X ( d ) = dim F q C X ( d ), so we assume now that r ≤ d ≤ ˜ d . Define thefollowing sets:Ω d = { ( a , . . . , a n ) ∈ N n | ≤ a i < d i , for 1 ≤ i ≤ n, a + · · · + a n ≤ d } ;Ω ( δ,s ) d = { ( a , . . . , a n ) ∈ Ω d | a s ≤ d s − δ } . From previous considerations we get that dim F q C X ( d ) = | Ω d | and dim F q D ( δ,s ) X ( d ) = | Ω ( δ,s ) d | . For any ( a , . . . , a n ) ∈ Ω d we have that either a s ≤ d s − δ or a s = d s − δ + 1 + i for some i in the range 0 ≤ i ≤ δ − a s ≤ d s − a s = d s − δ + 1 + i = r + i then we have a + · · · + a s − + a s +1 + · · · + a n ≤ d − r − i, and for 0 ≤ i ≤ δ − (0) s,d − r − i = { ( a , . . . , a n ) ∈ Ω d − r − i | a s = 0 } , so that Ω (0) s,d − r − i = ∅ if i is such that d − r − i < 0. Thus we have | Ω d | = | Ω ( δ,s ) d | + δ − X i =0 | Ω (0) s,d − r − i | and since dim F q C X s ( d − r − i ) = | Ω (0) s,d − r − i | for all i ∈ { , . . . , δ − } the aboveequation implies equation (1) in the statement.7 Minimum distance and optimal codes In this section we relate the minimum distance of quasi affine cartesian codesto the minimum distance of affine cartesian codes. In what follows we denoteby W (1) ( C ) the minimum distance of a code C .Let d be an integer in the range 1 ≤ d < P ni =1 ( d i − k and ℓ be uniquely defined by writing d = P ki =1 ( d i − 1) + ℓ , with 0 < ℓ ≤ d k +1 − d < d − k = 0 and ℓ = d , if k + 1 = n then we understandthat Q ni = k +2 d i = 1). We recall that W (1) ( C X ( d )) = ( d k +1 − ℓ ) n Y i = k +2 d i (2)(see e.g. [12, Theorem 3.8]). Theorem 4.1. Let d = k X i =1 ( d i − ℓ where ≤ k < n and < ℓ ≤ d k +1 − .We have W (1) ( C X ( d )) ≤ W (1) ( D ( δ,s ) X ( d )) ≤ m − dim F q D ( δ,s ) X ( d ) − & dim F q D ( δ,s ) X ( d ) r ' − ! ( δ − 1) + 1 . (3) where m = Q ni =1 d i , r = d s − δ + 1 and for x ∈ R , ⌈ x ⌉ is the smallest integersuch that x ≤ ⌈ x ⌉ . If(i) k + 2 ≤ n and d k +2 ≤ d s , or(ii) d s ≤ d k +1 and ≤ d s − ( d k +1 − ℓ ) < r then we get W (1) ( D ( δ,s ) X ( d )) = W (1) ( C X ( d )) .Proof. Since D ( δ,s ) X ( d ) ⊂ C X ( d ), we have W (1) ( C X ( d )) ≤ W (1) ( D ( δ,s ) X ( d )). FromTheorem 2.4 we know that D ( δ,s ) X ( d ) is locally recoverable with locality ( r, δ ),so we may apply [13, Theorem 2] and we get the second inequality of (3).Assume that k + 2 ≤ n and d k +2 ≤ d s . We consider two cases, s ≥ k + 2and s < k + 2, let’s suppose first that s ≥ k + 2. Consider an element α = ( α , . . . , α n ) ∈ X , and consider distinct elements β , . . . , β ℓ ∈ K k +1 .Define the polynomial f = k Y i =1 Y α ∈ K i α = α i ( X i − α ) · ℓ Y i =1 ( X k +1 − β i ) . (4)8bserve that f ∈ P ( δ,s ) d so that Ψ( f ) ∈ D ( δ,s ) X ( d ). Denoting by w ( v ) the weightof a codeword v we have w (Ψ( f )) = W (1) ( C X ( d )), and we’re done. Assumenow that s < k +2, from d k +2 ≤ d s we must have K s = K k +1 = K k +2 . Clearly s ∈ { , . . . , k + 1 } so replacing K s by K k +2 in (4) we still have f ∈ P ( δ,s ) d and w (Ψ( f )) = W (1) ( C X ( d )).Finally suppose that ( ii ) is satisfied, i.e. s ≤ k +1 and 0 ≤ d s − ( d k +1 − ℓ ) The codes D ( δ,s ) X ( ˜ d ) and D ( δ,s ) X ( ˜ d − are optimal, and haveminimum distance equal to, respectively, δ and δ + 1 .Proof. We have ˜ d = n X i =1 i = s ( d i − 1) + d s − δ = n − X i =1 ( d i − 1) + d n − δ so from(2) we get W (1) ( C X ( ˜ d )) = d n − ( d n − δ ) = δ . On the other hand, fromCorollary 3.4 and the fact that r = d s − δ + 1 we get that the upper boundfor W (1) ( D ( δ,s ) X ( ˜ d )) in the above theorem is m − dim F q D ( δ,s ) X ( d ) − & dim F q D ( δ,s ) X ( d ) r ' − ! ( δ − 1) + 1 = n Y i =1 d i − ( d s − δ + 1) n Y i =1 i = s d i − n Y i =1 i = s d i − ( δ − 1) + 1 = δ so W (1) ( D ( δ,s ) X ( ˜ d )) = δ . In the same way one proves that W (1) ( D ( δ,s ) X ( ˜ d − δ + 1.One may check that if d s = d n and d ≤ ˜ d then either condition ( i ) orcondition ( ii ) of the above Proposition is satisfied, so we get W (1) ( D ( δ,s ) X ( d )) = W (1) ( C X ( d )). In the following section, among other results, we present somevalues for W (1) ( D ( δ,s ) X ( d )) when we have W (1) ( D ( δ,s ) X ( d )) > W (1) ( C X ( d )).9 Further results on the minimum distancein a special case In this section we assume that K , . . . , K n are fields such that K ⊂ K ⊂· · · ⊂ K n ⊂ F q .We write Aff( F nq ) for the affine group of F nq , i.e. the transformations of F nq of the type α A α + β , where A ∈ GL ( n, F q ) and β ∈ F nq . Definition 5.1. The affine group associated to X isAff ( X ) = { ϕ : X → X | ϕ = ψ | X with ψ ∈ Aff ( F nq ) and ψ ( X ) = X } . Let { e , . . . , e n } ⊂ F nq be the canonical basis of F nq , since e , . . . , e n ∈ X we get that for each ϕ ∈ Aff( X ) there exists only one ψ ∈ Aff( F nq ) such that ϕ = ψ | X . Lemma 5.2. Let ψ ∈ Aff ( F nq ) be given by α A α + β , where A = a · · · a n : . . . : a n · · · a nn and β = b : b n , and let ϕ = ψ | X . Then ϕ ∈ Aff ( X ) if and only if the following conditionsare satisfied:(i) for all i, j ∈ { , . . . , n } , a ij ∈ K i , b j ∈ K j and if K i $ K j then a ij = 0 ;(ii) for all i ≤ j ∈ { , . . . , n } such that K i − $ K i = K j $ K j +1 the squaresubmatrix formed by entries a uw with i ≤ u, w ≤ j is invertible.Proof. Let ψ : α A α + β ∈ Aff( F nq ) and suppose that ψ | X = ϕ ∈ Aff( X ).For α = 0 we get ϕ (0) = β ∈ X , which implies b j ∈ K j for all j ∈ { , . . . , n } .We also get that the transformation ψ : α A α ∈ Aff( F nq ) is such that ϕ = ψ | X ∈ Aff( X ).Let { e , . . . , e n } ⊂ F nq be the canonical basis of F nq . For any j ∈ { , . . . , n } we get ψ ( e j ) = a j a j : a nj ∈ X and so a ij ∈ K i for all i ∈ { , . . . , n } .10et i, j ∈ { , . . . , n } such that K i $ K j (so in particular j > i ) andchoose γ j ∈ K j \ K i . From γ j e j ∈ X we get ψ ( γ j e j ) = γ j a j γ j a j : γ j a nj ∈ X and, in particular, γ j a ij ∈ K i which is only possible if a ij = 0.Assume that K $ K n and let i , . . . , i t be integers such that 0 = i
0: : : : : ∗ ∗ ∗ ∗ B t where for all j = 1 , . . . , t the matrix B j is of size ( i j − i j − ) × ( i j − i j − ). Sincedet A = det B · det B · · · det B t and det A = 0 we get for all j = 1 , . . . , t that B j is invertible with coefficients in K i j . Conversely, if ( i ) and ( ii ) aresatisfied then it is easy to see that ϕ ∈ Aff( X ).The affine group Aff( X ) acts over the set of polynomials F q [ X , . . . , X n ]in the following way. Let f ∈ F q [ X , . . . , X n ], ϕ ∈ Aff( X ) and ψ ∈ Aff( F nq )such that ψ | X = ϕ . We define f ◦ ϕ ∈ F q [ X , . . . , X n ] as f ◦ ϕ ( X , . . . , X n ) = f ( ψ ( X , . . . , X n )), where ( X , . . . , X n ) is written as a column vector. Definition 5.3. We say that f, g ∈ F q [ X , . . . , X n ] are X -equivalent if thereexists ϕ ∈ Aff ( X ) such that f = g ◦ ϕ . In [8] affine cartesian codes were studied as images of polynomial functionsevaluated in the points of X , and two polynomials define the same functionif their difference belongs to I X . In the following result we rewrite [8, Thm.3.5] without using the function concept. Theorem 5.4. Let d = k X i =1 ( d i − 1) + ℓ , ≤ k < n and < ℓ ≤ d k +1 − ,the minimal weight codewords of C X ( d ) are of the form Ψ( f ) where f ∈ F q [ X , . . . , X n ] ≤ d is such that there exists g ∈ F q [ X , . . . , X n ] , with f − g ∈ I X and g is X -equivalent to a polynomial h = σ k +1 Y i =1 ,i = j ( X d i − i − d j − ( d k +1 − ℓ ) Y t =1 ( X j − α t ) , here j ∈ { , . . . , k + 1 } is such that d j − ( d k +1 − ℓ ) ≥ , σ ∈ F ∗ q and α , . . . , α d j − ( d k +1 − ℓ ) are distinct elements of K j (if d j − ( d k +1 − ℓ ) = 0 we takethe second product as being equal to 1). The following result describes a property of certain polynomials of degree1 which will be used in the next proposition. Lemma 5.5. Let p = γ X + · · · + γ h X h + η ∈ F q [ X , . . . , X n ] , where γ , . . . , γ h ∈ F q and γ h = 0 . Then there exists ϕ ∈ Aff ( X ) and j ∈ { , . . . , n } such that X j ◦ ϕ = p if and only if γ i ∈ K j for all i ∈ { , . . . , h } , η ∈ K j and K h = K j .Proof. Assume that there exists ϕ ∈ Aff( X ) such that X j ◦ ϕ = p for some j ∈ { , . . . , n } , and let ψ ∈ Aff( F nq ) be such that ϕ = ψ | X . If ψ is given by α A α + β , then the j -th line of A has to be ( γ , . . . , γ h , , . . . , γ i ∈ K j for all i ∈ { , . . . , h } , likewise the j -th entry of β has to be η , sothat η ∈ K j . From the general form of A , which was described in Lemma5.2 we get that K h = K j . The proof of the converse is simple and followsfrom Lemma 5.2. Definition 5.6. A linear form L = γ X + · · · + γ h X h , where γ h = 0 , γ i ∈ K j for all i ∈ { , . . . , h } and K h = K j will be called a X -linear form over K j . Proposition 5.7. Let f ∈ F q [ X , . . . X n ] be a polynomial of degree d = k X i =1 ( d i − 1) + ℓ, where ≤ k < n and < ℓ ≤ d k +1 − . Assume that no monomial in f is a multiple of X d i i , for all i = 1 , . . . , n . If w (Ψ( f )) = ( d k +1 − ℓ ) n Y i = k +2 d i then there exists a monomial in f of the form X d j − ( d k +1 − ℓ ) t j k +1 Y i =1 i = j X d i − t i for some ≤ j ≤ k + 1 such that d j ≥ d k +1 − ℓ , where t , . . . , t k +1 are distinct elementsof { , . . . , n } and K t i = K i for all i ∈ { , . . . , k + 1 } .Proof. From (2) we get that w (Ψ( f )) = W (1) ( C X ( d )) so from Theorem 5.4there exist j ∈ { , . . . , k + 1 } and a polynomial g = σ k +1 Y i =1 i = j (( L i − α i ) d i − − d j − ( d k +1 − ℓ ) Y s =1 ( L j − β s ) , σ ∈ F q , β , . . . , β d j − ( d k +1 − ℓ ) are distinct elements of K j , L i is a X -linearform over K i and α i ∈ K i for all i ∈ { , . . . , k + 1 } , the forms L , . . . , L k +1 are linearly independent over F q , and f − g ∈ I X . Since deg( g ) = d we get g ∈ F q [ X , . . . X n ] ≤ d and Ψ( g ) = Ψ( f ) ∈ C X ( d ).Assume, for a moment, that there are at least two factors in the firstproduct in the definition of g , i.e. assume that there exist u, w ∈ { , . . . , k +1 } with u < w and u, w = j . Observe that evaluating the polynomial(( L u − α u ) d u − − L w − α w ) d w − − X we get the value zero, except for those P ∈ X where L u ( P ) = α u and L w ( P ) = α w , and at these points we get 1. For any γ ∈ K w we get the same results evaluating the polynomial(( L u − α u ) d u − − L w − α w − γ ( L u − α u )) d w − − X . Thus we may replace, in the polynomial g , the factor( L w − α w ) d w − − L w − α w − γ ( L u − α u )) d w − − g such that Ψ(˜ g ) = Ψ( g ), and a fortiori ˜ g − g ∈ I X . Thisreasoning shows that we may perform a Gaussian elimination process in theset { L i − α i | i = 1 , . . . , k + 1 , i = j } , starting with the linear form with thegreatest index and proceeding to the linear form with the least index, and finda set of k integers 1 ≤ t < · · · < t j − < t j +1 < · · · < t k +1 ≤ n such that afterthe elimination process we may assume that L i = X t i + P w Assume that K , . . . , K n are fields such that K ⊂ K ⊂ · · · ⊂ K n ⊂ F q . Let d = k X i =1 ( d i − 1) + ℓ where ≤ k < n and < ℓ ≤ d k +1 − .If W (1) ( D ( δ,s ) X ( d )) = W (1) ( C X ( d )) then one of the following conditions musthold:(i) k + 2 ≤ n and d k +2 ≤ d s ;(ii) d s ≤ d k +1 and ≤ d s − ( d k +1 − ℓ ) < r .Proof. Suppose that condition ( i ) is not satisfied, then n = k +1 or d s < d k +2 ,which implies, in both cases, that d s ≤ d k +1 . If condition (ii) is also notsatisfied we must then have d s − ( d k +1 − ℓ ) < r ≤ d s − ( d k +1 − ℓ ). Thusif conditions (i) and (ii) are not satisfied, then n = k + 1 or d s < d k +2 , and d s − ( d k +1 − ℓ ) < d s − ( d k +1 − ℓ ) ≥ r .We assume that W (1) ( D ( δ,s ) X ( d )) = W (1) ( C X ( d )) holds, and let f ∈ P ( δ,s ) d be a polynomial of degree d such that w (Ψ( f )) = W (1) ( C X ( d )) . f of the form M j = X d j − ( d k +1 − ℓ ) t j k +1 Y i =1 i = j X d i − t i for some 1 ≤ j ≤ k + 1 such that d j ≥ d k +1 − ℓ , where t , . . . , t k +1 are distinctelements of { , . . . , n } and K t i = K i for all i ∈ { , . . . , k + 1 } .If n = k + 1 then { t , . . . , t k +1 } = { , . . . , k + 1 } , which implies that s = t i for some i ∈ { , . . . , k + 1 } . If deg X s M j = d s − X s M j ≥ d s − δ + 1,and if deg X s M j = d s − ( d k +1 − ℓ ) then we cannot have d s − ( d k +1 − ℓ ) < d s − ( d k +1 − ℓ ) ≥ r , which leads to a contradiction since wealso must have deg X s M j < d s − δ + 1 = r .Thus we suppose now that k + 1 < n and d s < d k +2 . Let u be the integersuch that s < u ≤ k + 2 and d u − < d u = d k +2 . From the definition of the set { t , . . . , t k +1 } we have, in particular, that K t i = K i for all i ∈ { , . . . , u − } ,so s = t i for some i ∈ { , . . . , u − } ⊂ { , . . . , k + 1 } . As above, analysingthe degree of M j we get f / ∈ P ( δ,s ) d , which finishes the proof.Thus, if conditions (i) and (ii) of the above theorem are not satisfied,then from Theorem 5.8 we get that W (1) ( D ( δ,s ) X ( d )) > W (1) ( C X ( d )). Since D ( δ,s ) X ( d ) ⊂ C X ( d ) we must have W (1) ( D ( δ,s ) X ( d )) ≥ W (2) ( C X ( d )) where W (2) ( C X ( d ))denotes the second lowest codeword weight in C X ( d ), also called next-to-minimal weight of C X ( d ). The values for W (2) ( C X ( d )) were determined inthe series of papers [3], [5] and [7]. These papers contain, in particular, thevalues for the special case where X = F nq , which had already been deter-mined by a combination of results by several authors – the reader may finda historical survey of these results in [6]. From these papers, we get that,writing d = k X i =1 ( d i − 1) + ℓ where 0 ≤ k < n and 0 < ℓ ≤ d k +1 − 1, the valuesfor W (2) ( C X ( d )) are as follows:1. if n = k + 1 then (see [3, Theorem 2.6]) W (2) ( C X ( d )) = d n − ℓ + 1;2. if 3 ≤ d ≤ · · · ≤ d n and either ℓ = 1 and d k +1 < d k +2 , or ℓ ≥ W (2) ( C X ( d )) = ( d k +1 − ℓ + 1)( d k +2 − n Y i = k +3 d i ;15. if 4 ≤ d i = q for all i ∈ { , . . . , n } and ℓ = 1 then (see e.g. [7, Theorem3.5]) W (2) ( C X ( d )) = q n − k ;4. For all other cases where d k +1 = d k +2 , ℓ = 1 and 3 ≤ d ≤ · · · ≤ d n then (see [7, Theorem 3.5]) W (2) ( C X ( d )) = ( d k +1 − n Y i = k +3 d i . Corollary 5.9. Assume that n = k +1 or ≤ d ≤ · · · ≤ d n , if the conditions ( i ) and ( ii ) of the above proposition are not satisfied and d s − ( d k +1 − ℓ ) = r then W (1) ( D ( δ,s ) X ( d )) = (cid:26) d n − ℓ + 1 if n = k + 1;( d k +1 − ℓ + 1)( d k +2 − Q ni = k +3 d i if n > k + 1 . Proof. If (i) and (ii) of Theorem 5.8 are not satisfied, then, as in the aboveproof we get that n = k + 1 or d s < d k +2 , and d s − ( d k +1 − ℓ ) < d s − ( d k +1 − ℓ ) ≥ r . These last two inequalities we replace by the hypothesis d s − ( d k +1 − ℓ ) = r .Let g = k +1 Y i =1 i = s ( X d i − i − · d s − ( d k +1 − ℓ ) − Y h =1 ( X s − β h ) , then deg( g ) = P k +1 i =1 , i = s ( d i − d s − ( d k +1 − ℓ ) − P ki =1 ( d i − ℓ − d − d s − ( d k +1 − ℓ ) = 1 then we take the second product in the definition of g as being 1 and still get deg( g ) = d − g ∈ P ( δ,s ) d since deg X s g < r .Suppose that n = k + 1, since w (Ψ( g )) = d k +1 − ℓ + 1 we must have W (1) ( D ( δ,s ) X ( d )) = W (2) ( C X ( d )) (from the above data on W (2) ( C X ( d )).We now treat the case where k + 1 < n , then we have d s < d k +2 , and fromthe hypothesis we also have 3 ≤ d ≤ · · · ≤ d n . Assume that d k +1 < d k +2 and let f = g.X k +2 , then deg( f ) = d and f ∈ P ( δ,s ) d , from w (Ψ( f )) = ( d k +1 − ℓ + 1)( d k +2 − Q ni = k +3 d i we get W (1) ( D ( δ,s ) X ( d )) = W (2) ( C X ( d )). In the casewhere d k +1 = d k +2 from d s < d k +2 and d s − ( d k +1 − ℓ ) = ℓ − ( d k +2 − d s ) = r ≥ ℓ ≥ 2, so again we have w (Ψ( f )) = W (2) ( C X ( d )),which finishes the proof. 16 Examples In this section we present some tables with numerical data obtained from theabove results. In the tables, we use the following notation: m = |X | is thelength of D ( δ,s ) X ( d ), κ = dim F q D ( δ,s ) X ( d ), v = W (1) ( C X ( d )), w = W (1) ( D ( δ,s ) X ( d ))and we denote by N = m − κ − (cid:16)l κr m − (cid:17) ( δ − 1) + 1 the upper bound forthe minimum distance, which appears in Theorem 4.1. In the tables d runsin the range 1 ≤ d ≤ ˜ d . When w = v then w ≥ W (2) ( C X ( d )) and in Section5 the values for W (2) ( C X ( d )) are presented. Yet, when w = v and we are inthe hypotheses of Corollary 5.9, then we write the true value of w .In the table below, for the d presented we always have w = v . D (25 , X ( d ) d m 343 343 343 343 343 343 343 343 343 343 343 κ 15 21 56 91 126 160 165 169 172 174 175 w 147 98 45 40 35 30 29 28 27 26 25 N