Enumeration of some matrices and free linear codes over commutative finite local rings

: Let R be a commutative finite local ring. Two enumeration problems over R are presented. We enumerate the matrices over R with a given McCoy rank and a given number of rows of single unit, and the free linear codes over R which have a given rank and a given number of vectors of single unit.


Introduction
Problems concerning the enumeration of matrices over nite elds under given conditions have been classically studied. A well-known basic formula gives the number of m × n matrices over the nite eld Fq of order q of rank r: see [8] for the proof. Abdel-Gha ar [1] analyzed matrices over Fq with rows of single unit over Fq, i.e. rows that have a single nonzero entry. N Fq (m, n, r, k), then denotes the number of m × n matrices over Fq of rank r that have exactly k rows of single unit. This is discussed in [1], and is equal to Abdel-Gha ar showed that this may be folded into coding theory by counting the number of linear codes of F n q that contain a given number of vectors of single unit. At the same time, the number of linear codes containing no vectors of single unit is also obtained. This is useful in error detection and correction, since the minimum distance of a linear code containing no vectors of single unit is at least two (see [10]).
We know that all nonzero elements in a eld are units. However, a commutative ring which is not a eld consists of many zero divisors and units. This typically makes working over rings more di cult than working over elds. Nevertheless, over the past decades, much has been understood about matrices and codes over rings [2], [3], [4], [6], [7], and [13]. The purpose of this paper is to generalize the results of [1] on matrices and linear codes over nite elds to commutative nite local rings.

Preliminaries
Throughout the paper, our rings contain the identity ≠ .
Let R be a nite commutative ring. A row vector r = (r , r , . . . , rn) ∈ R n is called a row of single unit or vector of single unit if a single entry is a unit and all other entries are zero. It is clear that, if R is a eld, then a row of single unit is a row having a single nonzero entry. For i = , , . . . , n, let e i = (e i , e i , . . . , e in ) ∈ R n where e ii = and e ij = for all i ≠ j. Clearly, e , e , . . . , en are vectors of single unit which form a basis of the R-module R n . They are therefore known as standard basis vectors. Moreover, x is a vector of single unit if and only if x = u e i for some unit u ∈ R and standard vector e i . A set { x , x , . . . , xr} of vectors in R n is said to be linearly independent, if for any a , a , . . . , ar in R, a x + a x + . . . ar xr = implies that a = a = · · · = ar = . It is clear that a set of standard basis vectors is linearly independent. A submodule C of the R-module R n generated by a linearly independent set of r vectors is called a free linear code of rank r, and this linearly independent set is called a basis for C.
Next, we introduce McCoy's concept of rank of matrices over commutative rings [11]. This generalizes the rank of matrices over elds. Let A be an m × n matrix over R. For ≤ t ≤ min{m, n}, let I t (A) be the ideal of R generated by the t × t minors of A and I (A) = R. It follows that where Ann R I = {r ∈ R : rb = for all b ∈ I} is the annihilator of I. The McCoy rank or rank of A, denoted rank A, is the maximum number r such that Ann R Ir(A) = { }. If R is a eld, this rank coincides with the usual rank. Some properties of this rank over commutative rings resemble those of the rank over elds. For instance, an n×n invertible matrix over R is of rank n. The set of n×n invertible matrices over R is called the general linear group of degree n, denoted by GLn(R). Next, let A be an m × n matrix over R. Then ≤ rank A ≤ min{m, n}, rank A = rank A T , rank A = rank PAQ for all P ∈ GLm(R) and Q ∈ GLn(R), and rank A = if and only if Ann R I (A) ≠ { }. Moreover, when m = n, rank A < n if and only if det A is the zero or a zero divisor of R, and when m ≤ n, A has rank m if and only if the rows of A are linearly independent. References [4] and [5] set out further properties. Furthermore, the rank of a matrix over R is simple to compute when R is a commutative nite local ring. A local ring is a ring with unique maximal ideal. Clearly, a eld is a commutative local ring with unique maximal ideal { }. If M is the maximal ideal of a commutative local ring R, then R M is the group of units of R and the quotient ring R/M is a eld that is known as the residue eld of R. A commutative local ring R is also equipped with the natural map π : R → R/M, given by π(a) = a + M for all a ∈ R. Hence, if A = [a ij ] is a matrix over R, then π(A) = [π(a ij )] is a matrix over its residue eld R/M. The rank of matrices over commutative nite local rings can be computed by the following lemma.

Lemma 2.1. [3] Let R be a commutative nite local ring with maximal ideal M and the natural map π : R → R/M. If A is a matrix over R, then rank A = rank π(A).
In the rest of this paper, we rst determine the number of m × n matrices over a commutative nite local ring of rank r. Among these, we count the number of matrices with a given number of rows of single unit. Relationships of such matrices over a commutative nite local ring and matrices over its residue eld are discussed. We then note some properties of free linear codes over commutative nite local rings. Relationships of free linear codes with vectors of single unit and matrices with rows of single unit are discussed. Finally, we present a formal expression of the number of free linear codes of rank r containing a given number of standard basis vectors.

. Matrices with rows of single unit
In this section we enumerate m × n matrices over a commutative nite local ring R of rank r. To do this we apply lifting.
The number of m × n matrices over R of rank r is given by When applying the formula in (1.1) over a nite eld, the number of m × n matrices over the residue eld R/M of rank r is equal to From (1), we see that each matrix over R/M of rank r can be lifted to |M| mn matrices over R of rank r. Thus, the number of m × n matrices over R of rank r is |M| mn Since |R/M| = q, we have (2).
We next consider the relationship between rows of single unit over a commutative nite local ring and those over its residue eld. We next derive the number of m × n matrices of rank r having exactly k rows of single unit.
. . . a m + m m a m + m m · · · · · · amn + mmn Note that the number of m × n matrices over R/M of rank r having exactly k rows of single unit is N R/M (m, n, r, k). All these matrices may be lifted to |M| mn−nk+k matrices over R of rank r with k rows of single unit. This yields (3).
Such matrices over commutative nite local rings, which have rows of single unit, are related to certain free linear codes.

. Free linear codes and standard basis vectors
Free linear codes over rings are an active research eld. Dougherty and Saltürk [7] determined the number of free linear codes of R n of rank r when R is a Frobenius commutative nite local ring. Sirisuk and Meemark [12] determined the number of free linear codes of R n of rank r when R is an arbitrary commutative nite local ring. Both are given by |M| nr−r n r q where n r q is the number of linear codes of F n q of dimension r given by n r q = (q n − )(q n − q) · · · (q n − q r− ) (q r − )(q r − q) · · · (q r − q r− ) = n n − r q . When R is the nite eld Fq of order q, it was shown in [1] that the number of linear codes of F n q of dimension r containing exactly k standard basis vectors is given by To generalize this to a commutative nite local ring R, we count the number of free linear codes of R n of rank r that contain exactly k standard basis vectors. Let C be a free linear code of R n of rank r with basis B = { b , b , . . . , br}. An r × n matrix G whose rows form a basis for C is called a generator matrix for C, that is, Since the rows of G are linearly independent, it follows that rank G = r, |C| = |R| r and C = { aG : a ∈ R r }. If, on the other hand, C is a free linear code of rank r and x , x , . . . , xr are vectors in C such that the r × n matrix  . . , xr} is linearly independent, and provides a basis for C. In addition, if G and G are both generator matrices for C, then G = UG where U ∈ GLr(R). Two free linear codes are said to be equivalent if and only if one can be obtained from the other by permuting the coordinates. Next, we give the forms of generator matrices of free linear codes over commutative nite local rings. We invoke the following lemma.

Proposition 3.5. Let R be a commutative nite local ring. Assume that C is a free linear code of R n of rank r. Then C is equivalent to a free linear code with a generator matrix Ir A , where A is an r × (n − r) matrix over R. Moreover, if C contains at least k standard basis vectors, then C is equivalent to a free linear code with a generator matrix I k I r−k A
where A is an (r − k) × (n − r) matrix over R.
Proof. Let C be a free linear code of R n of rank r with a generator matrix G. We perform row operations on G.
Since the rst row of G is linearly independent it has, by Lemma 3.4, a coordinate with a unit. We can multiply the rst row by the inverse of this unit so that the coordinate becomes . We then use the in the rst row to force the entries in all other rows within that coordinate to . This yields a new generator matrix UG where U ∈ Gr(R). The rows of UG form a basis for C, and thus are linearly independent. We then apply the same process to the second and subsequent rows. The new generator matrix G obtained for C is equivalent to a matrix of the form Ir A for some r × (n − r) matrix A after permuting the columns of G . Therefore, C is equivalent to a free linear code with a generator matrix Ir A .
Next, without loss of generality, we may assume that C is a free linear code of rank r generated by Since e i j is generated by Ir A , the i th j row of Ir A must be the standard basis vector e i j for any j ∈ { , , . . . , k}. We next interchange the rows by placing rows i , i , . . . , i k in the rst k rows. After permuting the rst r columns, we see that C is equivalent to a free linear code generated by which contains at least k standard basis vectors.
From Proposition 3.5, a free linear code containing exactly k standard basis vectors is related to a matrix having exactly k rows of single unit. This yields Corollary 3.6.
Corollary 3.6. If C is a free linear code of R n of rank r containing exactly k standard basis vectors, then C has a generator matrix which is of rank r with k rows of single unit.
Proof. Let C be a free linear code of R n of rank r containing exactly k standard basis vectors. By Proposition 3.5 we may assume that C is a code with a generator matrix G = matrix over R. Note that rank G = rank π(G) = r. Since C does not contain k + standard basis vectors, none of the rows of A are zero vectors. Thus, G is a matrix of rank r having exactly k rows of single unit.
Finally, we note that, if C is a free linear code of R n over a commutative nite local ring R of rank r with a basis { b , b , . . . , br}, then π(C) is a linear code of (R/M) n over the residue eld R/M of dimension r with a basis {π( b ), π( b ), . . . , π( br)} (see [12]). From this, we derive the number of free linear codes of R n that contain exactly k standard basis vectors. Proof. It is easy to see that, if e i is a standard basis vector in R n , then π( e i ) is a standard basis vector in (R/M) n . This proves (1). For (2), let C be a linear code of (R/M) n of dimension r containing at least k standard basis vectors. By Proposition 3.5, we may assume that a generator matrix G for C is where A is an (r − k) × (n − r) matrix over R/M and I k , I r−k are the identity matrices over R/M. We write A = a ij + M and let A = a ij . Consider a linear code C of R n generated by where N is an (r − k) × (n − r) matrix, all entries of which are in M. Since rank G = rank π(G) = rank(G) = r, C is a free linear code of rank r. From the rst k rows of the matrix G, we see that C contains at least k standard basis vectors. Next, let C(G) = I k I r−k A + N : N is an (r − k) × (n − r) matrix whose entries are in M. .
Note that, if C is a free linear code of R n generated by a matrix in C(G), then π(C) = C. Suppose that are two matrices in C(G) that generate the same code. Then G = UG where U ∈ GLr(R). We can see that U = Ir. Hence, N = N . Thus, all matrices in C(G) generate distinct free linear codes. Proposition 3.5 further implies that any free linear code C of R n of rank r that contains at least k standard basis vectors and where π(C) = C has a generator matrix of the form (3.1). Therefore, C(G) generates the set of |M| (n−r)(r−k) free linear codes of R n of rank r containing at least k standard basis vectors. These are lifted from C. We next prove ( We nally apply the Principle of Inclusion and Exclusion [9] to conclude that the number of free linear codes of R n of rank r containing exactly k standard basis vectors is r =k (− ) −k k n |M| (n−r)(r− ) n − n − r q as desired.
In summary, we have investigated matrices with a given number of rows of single unit and free linear codes containing a given number of standard basis vectors over commutative nite local rings. These matrices and free linear codes can be applied in coding theory. We know that an m × n matrix can be used to transmit messages of length m. Indeed, if G is an m × n matrix, we may encode a message u ∈ R m with a codeword uG. Matrices with rows of single unit would therefore allow a message to be encoded facilely. Encoding and decoding is simpli ed if the code is a free linear code whose generator matrix comprises rows of single unit.