Decoding of matrix-product codes.
Abstract
Producción Científica
Full text
Decoding of Matrix-Product Codes∗ Fernando Hernando† San Diego State University [email protected] Diego Ruano‡ Aalborg University [email protected] Abstract We propose a decoding algorithm for the (u|u+v)-construction that decodes up to half of the minimum distance of the linear code. We extend this algorithm for a class of matrix-product codes in two different ways. In some cases, one can decode beyond the error correction capability of the code. 1 Introduction Matrix-product codes, [C1· · · Cs]·A, were introduced by Blackmore and Norton in [1]. They may also be seen as a generalization of the (u|u+v)-construction. Advantages of this method are, first, that long codes can be created from old ones and, second, that the parameters or the codes are known under some conditions [1, 2, 5]. Other generalizations include [3] and [6]. In [2], a decoding algorithm for matrix-product codes with C1⊃ · · · ⊃ Cswas presented. In this work, we present an alternative to that algorithm, where we do not need to assume that the codes C1, . . . , Csare nested. In section 3, we present the new algorithm for s=l= 2, (u|u+v)-construction, the main assumption that we should consider is d2≥2d1, where diis the minimum distance of Ci, di=d(Ci). The new algorithm decodes up to half of the minimum distance. Furthermore, if d1is odd and d2>2d1, we are able to decode beyond this bound, obtaining just a codeword with a high probability. From the algorithm in section 3 we derive two extensions for matrix-product codes defined using a matrix A, of arbitrary size s×l, which verifies a certain property called non-singular by columns. The main difference between these two algorithms resides in the following fact: the algorithm is section 4 requires stronger assumptions (di≥ld1, for all i) than the one in section 5 (di≥id1, for all i), but it is computationally less intense. Both algorithms decode up to half of the designed minimum distance of the code [5], that is known to be sharp in several cases [1, 2] (for intance if C1⊃ · · · ⊃ Cs). If d1odd and leven, we ∗Published in Journal of Algebra and its Applications, Volume 12, Issue 4, Article ID 1250185, 15 pages (2013). Keywords: Linear Codes, Matrix-Product Codes, Decoding Algorithm, Minimum Distance. Subclass: 94B05; 94B35. †Supported in part by Spanish MEC MTM2007-64704. ‡Supported in part by the Danish National Research Foundation and the National Science Foundation of China (Grant No.11061130539) for the Danish-Chinese Center for Applications of Algebraic Geometry in Coding Theory and Cryptography, and Spanish MEC MTM2007- 64704. 1
can decode beyond this bound obtaining a list of codewords that will contain just one codeword with a high probability. The algorithm in section 4 does not become computationally intense for large s, l. 2 Matrix-Product Codes A matrix-product code is a construction of a code from old ones. Definition 2.1. Let C1, . . . , Cs⊂Fm qbe linear codes of length mand a matrix A= (ai,j)∈ M(Fq, s×l), with s≤l. The matrix-product code C= [C1· · · Cs]· Ais the set of all matrix-products [c1· · · cs]·Awhere ci∈Ciis an m×1 column vector ci= (c1,i, . . . , cm,i)Tfor i= 1, . . . , s. Therefore, a typical codeword pis p= c1,1a1,1+· · · +c1,sas,1· · · c1,1a1,l +· · · +c1,sas,l . . ..... . . cm,1a1,1+· · · +cm,sas,1· · · cm,1a1,l +· · · +cm,sas,l .(1) The i-th column of any codeword is an element of the form Ps j=1 aj,icj∈Fm q, therefore reading the entries of the m×l-matrix above in column-major order, the codewords can be viewed as vectors of length ml, p= s X j=1 aj,1cj,..., s X j=1 aj,lcj ∈Fml q.(2) If Ciis an [m, ki, di] code then one has that [C1· · · Cs]·Ais a linear code over Fqwith length lm and dimension k=k1+· · · +ksif the matrix Ahas full rank and k < k1+· · · +ksotherwise. Let us denote by Ri= (ai,1, . . . , ai,l) the element of Fl qconsisting of the i-th row of A, for i= 1, . . . , s. We denote by Dithe minimum distance of the code CRigenerated by hR1, . . . , Riiin Fl q. In [5] the following lower bound for the minimum distance of the matrix-product code Cis obtained, d(C)≥dC= min{d1D1, d2D2, . . . , dsDs},(3) where diis the minimum distance of Ci. If C1, . . . , Csare nested codes, C1⊃ · · · ⊃ Cs, the previous bound is sharp [2]. In [1], the following condition for the matrix Ais introduced. Definition 2.2. [1] Let Abe a s×lmatrix and Atbe the matrix consisting of the first trows of A. For 1 ≤j1<· · · < jt≤l, we denote by A(j1, . . . , jt) the t×tmatrix consisting of the columns j1, . . . , jtof At. A matrix Ais non-singular by columns if A(j1, . . . , jt) is non-singular for each 1 ≤t≤sand 1 ≤j1<· · · < jt≤l. In particular, a non-singular by columns matrix Ahas full rank. Moreover, if Ais non-singular by columns, the bound dCin (3) is d(C)≥dC= min{ld1,(l−1)d2,...,(l−s+ 1)ds} and it is known to be sharp in several cases: it was shown in [1] that if Ais non-singular by columns and triangular, (i.e. it is a column permutation of 2
an upper triangular matrix), then the bound (3) for the minimum distance is sharp. Furthermore, if A is non-singular by columns and the codes C1. . . Csare nested, then this bound (3) is also sharp. A decoding algorithm for the matrix-product code C= [C1· · · Cs]·A⊂Fml q, with Anon-singular by columns and C1⊃ · · · ⊃ Cswas presented [2], assuming that we have a decoding algorithm for Ci, for i= 1, . . . , s. We present in next section another decoding algorithm for a matrix-product code with s=l= 2. 3 A decoding algorithm for the (u|u+v)-construction We consider a decoding algorithm for the (u|u+v)-construction, that is, a matrix-product code with s=l= 2, C= [C1C2]·Awith d2≥2d1and d1≥3, where di=d(Ci) is the minimum distance of Ci. Let A=1 1 0 1 . Note that Cis the (u|u+v)-construction and that an equivalent code will be obtained with any matrix of rank 2. Let t1be the error-correction capability of C1,t1=bd1−1 2c ≥ 1, that is d1= 2t1+ 1 if d1is odd and d1= 2t1+ 2 if d1is even. The minimum distance of Cis d(C) = min{2d1, d2}= 2d1[4]. Thus the error correction capability of the code Cis t=2d1−1 2=2t1if d1is odd 2t1+ 1 if d1is even We provide a decoding algorithm for the matrix-product code C, assuming that we have a decoding algorithm DCifor Ciwhich decodes up to tierrors, for i= 1,2. Let r=p+ebe a received word where p∈Cand the error vector everifies wt(e)≤t. Note that a typical word p∈Cis [c1c2]·A= (c1, c1+c2), namely a received word ris r= (r1, r2)=(c1+e1, c1+c2+e2). Consider r2−r1=c1+c2+e2−c1−e1=c2+ (e2−e1). We may decode r2−r1using the decoding algorithm DC2to obtain c2, since c2∈C2and wt(e2−e1)< d2/2 because wt(e2−e1)≤wt(e1) + wt(e2) = wt(e)≤t<d1≤d2 2. Since we know c2we may consider r2) 2=r2−c2=c1+e2and let r2) 1=r1= c1+e1. We claim that there exists i1∈ {1,2}such that wt(ei1)≤t1: assume that such an idoes not exist, then wt(e) = wt(e1) + wt(e2)≥2t1+ 2, a contradiction. Let wt(ei1)≤t1, then we can obtain c1by decoding r2) i1with the decoding algorithm DC1. A priori, we do not know which index i1is, however we will be able to detect it by checking that we have not corrected more than b(d(C)−1)/2cerrors in total. That is, for p= (c1, c1+c2) and p0= (c0 1, c0 1+c2), we check whether d(r, p)≤tand d(r, p0)≤t. 3
Remark 3.1. Let us compare this decoding algorithm to the algorithm in [2]. In the algorithm in [2], we assume that C1⊃C2and for this algorithm we assume that d2≥2d1. Comparing the complexity of the algorithms: In the algorithm in [2], we should run DC1and DC2twice, in the worst case situation. For this algorithm, we run DC1twice and DC2once. Both algorithms decode up to the error-correction capability of the code. For d1odd and d2>2d1, the previous algorithm can also be used for correcting t+ 1 = 2t1+ 1 errors, that is, one more error than the error-correction capability of C. The algorithm outputs a list with one or two codewords, containing the sent word. Let us assume now that wt(e)≤t+ 1, again we may obtain c2by decoding r2−r1since wt(e2−e1)≤t2because wt(e2−e1)≤wt(e1) + wt(e2) = wt(e)≤t+ 1 = 2t1+ 1 = d1<d2 2. Again there will be an index i1∈ {1,2}such that wt(ei1)≤t1because otherwise wt(e)≥2t1+ 2 >2t1+ 1. Hence, we also decode r2) i2using DC1. Let p= (c1, c1+c2) and p0= (c0 1, c0 1+c2) as above, d(p, r)≤t+ 1 and d(p0, r)≥t+ 1. •d(r, p) = wt((c1+e1, c1+c2+e2)−(c1, c1+c2)) = wt(e)≤t+ 1. •d(r, p0) = wt((c1+e1, c1+c2+e2)−(c0 1, c0 1+c2)) = wt(c1−c0 1+e1, c1− c0 1+e2)≥2d1−wt(e)≥2(2t1+ 1) −(2t1+ 1) = 2t1+ 1 = t+ 1. If we have that d(p, r), d(p0, r)≤t+ 1 we output both codewords, in other case we output only p. Note that the probability of having two codewords in the output list is negligible, since d(r, p0) = t+ 1 if and only if d(c1, c0 1) = d1and for every ej,i 6= 0, with j= 1, . . . , m,i= 1,2, one has that ej,i =−(cj,i −c0 j,i). We will consider in this article two different extensions of this algorithm for any sand l, with s≤l. Namely, for the particular case where s=l= 2, both extensions are equal. 4 A decoding algorithm for Matrix-Product codes, first extension In this section we propose an extension of the algorithm in the previous section for matrix-product codes with any s≤l, the algorithm in this section is less computationally intense than the algorithm in [2] for large s, l. In the following section we will propose another extension. Let C= [C1· · · Cs]·Abe a matrixproduct code, with di≥ld1, for i= 2, . . . , s, and d1≥3, where di=d(Ci) is the minimum distance of Ci. We also require that Ais non-singular by columns. The error-correction capability of Ciis ti=bdi−1 2c ≥ 1. From (3), one has that the designed minimum distance of Cis d(C)≥dC= min{ld1,(l− 1)d2,...,(l−s+ 1)dl}=ld1. Hence, the designed error correction capability of the code Cis t=ld1−1 2=lt1+bl−1 2cif d1is odd lt1+l−1 if d1is even, since d1= 2t1+ 1 if d1is odd and d1= 2t1+ 2 if d1is even. 4
We provide a decoding algorithm for the matrix-product code Cthat decodes up to half of its designed minimum distance, assuming that we have a decoding algorithm DCifor Ciwhich decodes up to tierrors, for i= 1, . . . , s. A codeword in Cis an m×lmatrix which has the form p= [c1, . . . , cs]· A= (Ps j=1 aj,1cj,...,Ps j=1 aj,lcj), where cj∈Cj, for all j. We denote by pi=Ps j=1 aj,icj∈Fm qthe i-th block of p, for i= 1, . . . , l. Suppose that pis sent and that we receive r=p+e, where e= (e1, e2, . . . , el) is an error vector, an m×lmatrix, with weight wt(e)≤t. Let Bbe a matrix in M(Fq, l×s), such that AB is the s×s-identity matrix. Such a matrix exists because Ahas rank sand it can be obtained by solving a linear system, but it is not unique if s < l. Let wi= (0,...,0,1,0,...,0)T∈Fs q be the vector that has all coordinates equal to zero, excepting the i-th coordinate that is equal to 1. For i∈ {2, . . . , s}, consider vi= (v1,i, . . . , vl,i)T∈Fl qequal to vi=Bwi. One has that pvi=Pl j=1 vj,ipj=ci, since pvi=pBwi= [c1, . . . , cs]wi=ci. Therefore rvi= l X j=1 vj,irj= l X j=1 vj,ipj+ l X j=1 vj,iej=ci+ l X j=1 vj,iej. For i= 2, . . . , s, we can decode rviwith the decoding algorithm DCito obtain ci, since ci∈Ciand wt l X j=1 vj,iej ≤ l X j=1 wt(ej) = wt(e)≤t=ld1−1 2≤di−1 2=ti As we have already computed c2, . . . , cswe may consider now r0 i=ri− Ps j=2 ai,jcj=a1,ic1+ei, for i= 1, . . . , l. We claim that there exists i∈ {1, . . . , l}such that w(ei)≤t1because if wt(ei)> t1for all ithen wt(e)≥ lt1+l > t. Therefore, we correct r0 1/a1,1, . . . , r0 l/a1,l, with DC1and at least one of them gives c1as output. Note that a1,i 6= 0, for i= 1, . . . , l since A is non-singular by columns. We have lcandidates for c1,ci) 1=DC1(r0 j/a1,i), for i= 1, . . . , l, we can detect which candidate is equal to c1by checking that we have not corrected more than b(d−1)/2cerrors in total, that is, we check whether d(r−[ci) 1, c2...,cs]·A)≤ b(d−1)/2c, for i= 1, . . . , l. The algorithm is outlined as a whole in procedural form in Algorithm 1. Remark 4.1. Let us compare this decoding algorithm to the algorithm in [2]. In both algorithms we assume that Ais non-singular by columns. For the algorithm in this section, we assume that ld1< difor all i= 2, . . . , s. In the algorithm in [2], we assume that C1⊃ · · · ⊃ Cs, therefore the bound in (3) is sharp. Hence, if C1, . . . , Csare nested, both algorithms decode up to half of the minimum distance of the matrix-product code. In the algorithm in [2], we run DCil stimes, for i= 1, . . . , s, in the worst-case. However, in the algorithm presented in this section, we only run DCionce, for i= 2, . . . , s and we run DC1ltimes, thus it will have polynomial complexity if the algorithms DCihave polynomial complexity, for i= 1, . . . , s (since Bis computed by solving a linear system). Hence the algorithm in [2] becomes computationally intense for large values of s, l but this algorithm does not. 5
Algorithm 1 A decoding algorithm for C= [C1· · · Cs]·A, first extension Input: Received word r=p+ewith c∈Cand wt(e)< d(C)/2, where di=d(Ci) with ld1< diand Afull rank. Decoder DCifor code Ci, i= 1, . . . , s. Output: p. 1: r0=r; 2: Find B, a right inverse of A(AB =Id); 3: for i= 2, . . . , s do 4: v=Bei; 5: ci=DCi(rv); 6: end for 7: r= (r1−Ps j=2 aj,1cj, . . . , rl−Ps j=2 aj,lcj); 8: for i= 1, . . . , l do 9: c1=DC1(ri/a1,i); 10: if c1=“failure” then 11: Break the loop and consider next iin line 8; 12: end if 13: p= [c1· · · cs]·A; 14: if p∈Cand wt(r0−p)≤ b(d(C)−1)/2cthen 15: return p; 16: end if 17: end for We can also consider this algorithm for correcting beyond the designed errorcorrection capability of C, if lis even, d1is odd and di> ld1, for i= 2, . . . , s. Namely, the designed error correction capability of Cis lt1+bl−1 2c=lt1+ (l−2)/2 and we consider now an error vector with wt(e)< lt1+l/2, that is, we are correcting 1 error beyond the designed error correcting capability of C. We should just modify line 14 in Algorithm 1 to accept codewords pwith wt(r0−p)≤lt1+l/2 and create a list with all the output codewords. Again, we can decode rviwith the decoding algorithm DCito obtain ci, since wt l X j=1 vj,iej ≤wt(e)≤lt1+l 2=l 2(2t1+ 1) ≤l 2d1<di 2. Moreover, there exists i∈ {1, . . . , l}such that w(ei)≤t1as well because if wt(ei)> t1for all ithen wt(e)≥lt1+l > lt1+l/2. As before, we have lcandidates for c1and at least one of them is c1, however now we cannot uniquely determine it: let p= [c1, . . . , cs]·Aand p0= [c0 1, c2...,cs]·Awith c16=c0 1, one has that d(p, r)≤lt1+l/2 and d(p0, r)≥lt1+l/2. •d(r, p) = wt(e)≤lt1+l/2. •d(r, p0) = wt(a1,1(c1−c0 1) + e1, . . . , a1,l(c1−c0 1) + el)≥ld1−wt(e)≥ l(2t1+ 1) −(lt1l/2) = lt1+l/2. The algorithm outputs pand all the other codewords -obtained from the other l−1 candidatesthat are at distance at most lt1+l−1 from r. As with 6
s=l= 2, the probability of having more than one codeword in the output list is negligible, since d(r, p0) = lt1+l/2 if and only if the bound in (3) is sharp, d(c1, c0 1) = d1and for every j= 1, . . . , m,i= 1, . . . , l, with ej,i 6= 0, one has that ej,i =−a1,i(cj,1−c0 j,1). Example 4.2. Consider the following linear codes over F3, •C1the [26,20,4] cyclic code generated by f1=x6+x5+ 2x4+ 2x3+x2+ x+ 2. •C2the [26,7,14] cyclic code generated by f2=x19 +x18 +x17 +x15 + 2x14 +x13 + 2x12 +x11 + 2x8+ 2x7+x6+x4+x3+ 2. •C3the [26,3,18] cyclic code generated by f3=x23 + 2x22 +x21 + 2x19 + 2x18 +x17 +x16 +x15 +x13 +x10 +2x9+x8+2x6+2x5+x4+x3+x2+1. Let C= [C1C2C3]·A, where Ais the non-singular by columns matrix A= 111 012 001 . We use decoder DCifor Ci, which decodes up to half the minimum distance, i.e., DC1,DC2,DC3decode up to t1= 1, t2= 6 and t3= 8 errors, respectively. We have that dC= 3d1= 12 and since Ais triangular we have that the minimum distance of Cis d(C) = dC= 12 and we may correct up to t= 5 errors in a codeword of C. Note that 12 = 3d1≤d2, d3. We consider now polynomial notation for codewords of Ci, for all i. Hence the codewords of length 23 in Ciare polynomials in Fq[x]/(x23 −1) and the words in Care elements in (Fq[x]/(x23 −1))3. Note that Cis a quasi-cyclic code. Let r=p+ebe the received word, with codeword p= (0,0,0) and the error vector of weight t= 5 e= (e1, e2, e3) = (1 + x, 2x2+x7,2x11). The matrix B= 121 011 001 verifies that AB =I3. Then v2and v3are the second and third columns of Brespectively. Therefore rv2=c2+ 2e1+e2= 2 + 2x+ 2x2+x7and rv3=c3+e1+e2+e3= 1 + x+ 2x2+x7+ 2x11. •We decode rv3with DC3and we obtain c3= 0 because wt(e1+e2+e3)≤ wt(e)=5< t2= 6. •We decode rv2with DC2and we obtain c2= 0 because wt(2e1+e2)≤ wt(e)=5< t2= 6. •Subtracting c2and c3from r= (c1+e1, c1+c2+e2, c1+ 2c2+c3+e3) we get r0= (c1+e1, c1+e2, c1+e3). Moreover we know that either r0 1=c1+e1or r0 2=c1+e2or r0 3=c1+e3can be decoded with DC1, so we should decode these three words. The weight of r0 3is 1, since the 7
minimum distance of C1is 4 there is only one codeword at distance 1 of the zero-codeword, and thus c3= 0. In the other two cases (r0 1and r0 2) the weight is 2, thus the output of the decoding algorithm DC1in both cases is either zero if it is the only codeword at distance 2 (from r0 1and r0 2 respectively) or “failure” if there is more than one codeword at distance 2. 5 A decoding algorithm for Matrix-Product codes, second extension In this section, we consider another extension of the algorithm in section 3 for arbitrary s≤l. This algorithm imposes softer conditions (than the one in previous section) on the minimum distance of the constituent codes, however it can become computationally intense for large sor l. Let C= [C1· · · Cs]·Abe a matrix-product code, we shall assume that Ais non-singular by columns and that di≥id1, for i= 2, . . . , s, where di=d(Ci) is the minimum distance of Ci. The error-correction capability of Ciis ti=bdi−1 2c. From (3), one has that the designed minimum distance of Cis given by d(C)≥dC= min{ld1,(l− 1)d2,...,(l−s+ 1)ds}and it is computed in the following lemma. Lemma 5.1. Let C= [C1· · · Cs]·Abe a matrix-product code, with Anonsingular by columns and di≥id1, for i= 2, . . . , s. The designed minimum distance of Cis dC=ld1. Proof. We claim that ld1≤(l−i+ 1)di, for i= 2, . . . , s. Since id1≤di, we have that i(l−i+ 1)d1<(l−i+ 1)di. Hence, ld1≤i(l−i+ 1)d1<(l−i+ 1)di if and only if l≤i(l−i+ 1). One has that l≤i(l−i+ 1) ⇐⇒ l(i−1) ≥i2−i⇐⇒ l≥i2−i i−1=i Thus, the claim holds since i≤s≤l. Finally, we have that dC= min{ld1,(l−1)d2,...,(l−s+ 1)ds}=ld1. Hence, the designed error correction capability of the code Cis t=ld1−1 2=lt1+bl−1 2cif d1is odd lt1+l−1 if d1is even, because d1= 2t1+ 1 if d1is odd and d1= 2t1+ 2 if d1is even. As in previous sections, we provide a decoding algorithm for the matrixproduct code C, that decodes up to half of its designed minimum distance, assuming that we have a decoding algorithm DCifor Ciwhich decodes up to tierrors, for i= 1, . . . , s. A codeword in Cis an m×lmatrix which has the form p= [c1· · · cs]·A= (Ps j=1 aj,1cj,...,Ps j=1 aj,lcj), where cj∈Cj, for all j. Suppose that pis sent and that we receive r=p+e, where e= (e1, e2, . . . , el) is an error vector, an m×lmatrix, with weight wt(e)≤t. 8
In order to decode r, we compute ci, for i=s, s−1,...,1, inductively. Then, after siterations we compute pby p= [c1· · · cs]·A. We will now show how ciis obtained, assuming that we have already obtained cs, cs−1, . . . , ci+1 (for i=s, we do not assume anything). Let ri)= (Pi j=1 aj,1cj+e1,...,Pi j=1 aj,lcj+el). We can obtain ri)from rand cs, cs−1, . . . , ci+1, since rs)=rand ri)= (ri+1) 1− ai+1,1ci+1, . . . , ri+1) l−ai+1,lci+1) for i=s−1,...,1. Let Aibe the submatrix of Aconsisting of the first irows of A. Note that As=Aand Aiis an i×l-matrix that is non-singular by columns. Let vi)∈Fl q such that Avi)=wi= (0,...,0,1)T∈Fi q. Such a vi)is not unique in general (it is only unique if i=s=l). For the sake of simplicity we will denote the coordinates of vi)by vi)= (v1, . . . , vl). Note that vi)is a solution of the corresponding linear system Aix=wi(4) Since Avi)=wi, we have that [c1· · · ci]·Aivi)= [c1· · · ci]wi=ci. Hence, ri)vi)=ci+Pl j=1 vjej, in particular for i=s, we have rvi)=cs+Pl j=1 vjej. We may decode ri)vi)with DCito obtain ciif wt(Pl j=1 vjej)< di/2. Therefore, it is wise to consider a vector vi)with low weight, that is with many coordinates equal to zero. We will consider a vector vi)with at least l−icoordinates equal to zero, i.e. of weight wt(vi))≤l−(l−i) = i. Let J={j1, . . . , ji}⊂{1, . . . , l}with #J=i, we claim that we can compute vi), a solution of (4), such that vj= 0 for j6∈ J. Let AJbe the i×i-submatrix of Aigiven by AJ= (ak,j)k∈{1,...,i},j∈J. Since A is non-singular by columns, one has that AJis a full rank squared matrix. Let us consider the linear system AJx=wi,(5) where x∈Fi q. The linear system (5) has a unique solution. Let vi) J= (v1...,vl), where vjk=xk, for k= 1, . . . , i, and vj= 0 otherwise. Then, vi) Jis a solution of (4) of weight lower than or equal to i, and the claim holds. There are several choices for the set J⊂ {1, . . . , l}. We will prove in Theorem 5.2 that at least for one choice of J, we will obtain ciby decoding ri)vi) Jwith DCi. Therefore, in practice, we should consider l ivectors {vi) J}J∈J , with J={J⊂ {1, . . . , l}: #J=i}and decode ri)vi) Jwith DCi. We will have, at most, l idifferent candidates for ciand at least one of them will give cias output. In order to obtain ci−1we should iterate this process for every candidate obtained for ci. After considering the previous computations for i=s, s−1,...,1, we may have several candidates for [c1, . . . , cs]. We can detect which candidate is equal to pby checking that we have not corrected more than b(d(C)−1)/2c errors in total, that is, we check if d(r−[c1...,cs]·A)≤ b(d(C)−1)/2c. The algorithm can be seen in procedural form in Algorithm 2. However, it remains to prove that, at least for one choice of the set J⊂ {1, .. . , l}, one will obtain ci. Theorem 5.2. Let ewith wt(e)≤t. There exists J⊂ {1, . . . , l}, with #J=i, such that Pj∈Jwt(ej)< di/2, for i= 1, . . . , s. 9