Classification of $\Delta$-divisible linear codes spanned by codewords of weight $\Delta$

We classify all $q$-ary $\Delta$-divisible linear codes which are spanned by codewords of weight $\Delta$. The basic building blocks are the simplex codes, and for $q=2$ additionally the first order Reed-Muller codes and the parity check codes. This generalizes a result of Pless and Sloane, where the binary self-orthogonal codes spanned by codewords of weight $4$ have been classified, which is the case $q=2$ and $\Delta=4$ of our classification. As an application, we give an alternative proof of a theorem of Liu on binary $\Delta$-divisible codes of length $4\Delta$ in the projective case.


INTRODUCTION
In this article, all codes are tacitly considered to be linear. An [n, k] q code C is a k-dimensional subspace of the n-dimensional F q -vector space F n q . A generator matrix of a linear [n, k] q -code C is a matrix whose rows form a basis of C. The generator matrix is called systematic if it starts with a k-by-k unit matrix. Up to a permutation of the positions, every linear code has a systematic generator matrix.
Elements c ∈ C are called codewords and n = n(C) is called the length of the code. The support of a codeword c is the number of coordinates with a non-zero entry, i.e., supp(c) = {i ∈ {1, . . . , n} | c i = 0}. The (Hamming-)weight wt(c) of a codeword is the cardinality # supp(c) of its support. A code C is called ∆-divisible if the weight of every codeword is divisible by some integer ∆ ≥ 1. Divisible codes are important in coding theory and have applications in finite geometry, for example, see the surveys [21] and [6]. The classification of divisible codes is a hard problem and has been solved only in special cases. Recent results into this direction can be found in [11,4,1,5,7,9].
Given an [n, k] q code C, the [n, n − k] q code C ⊥ = x ∈ F n q | x y = 0 ∀y ∈ C is called the orthogonal, or dual code of C. A code is called self-orthogonal if C ⊆ C ⊥ and self-dual if C = C ⊥ . Any self-orthogonal binary code is 2-divisible, and any 4-divisible binary code is self-orthogonal. In [15,Th. 6.5], indecomposable self-orthogonal binary codes which are spanned by codewords of weight 4 are completely characterized. Based on the property that self-orthogonal binary codes spanned by codewords of weight 4 are always 4-divisible, we are going to generalize that result. For this, the property of self-orthogonality is replaced by divisibility, which is in the spirit of the generalization of the theorem of Gleason and Pierce (see [17,Sec. 6.1]) by Ward [18,Th. 2]. In fact, this was Ward's original motivation for studying divisible codes.
The main goal of this article is to prove the following characterization of q-ary ∆-divisible codes that are generated by codewords of weight ∆. Theorem 1. Let ∆ be a positive integer and let a be the largest integer such that q a divides ∆. Let C be a q-ary ∆-divisible linear code that is spanned by codewords of weight ∆. Then C is isomorphic to the direct sum of codes of the following form, possibly extended by zero positions.
(iii) For a ≥ 1: The ∆ 2 -fold repetition of the binary parity check code of dimension k ≥ 4.
Up to the order, the choice of the codes is uniquely determined by C.
We would like to point out the following border cases which are covered by Theorem 1.
(a) For any positive integer ∆, the [n, 0] q zero code of length n is ∆-divisible and spanned by an empty set of codewords of weight ∆. It is covered by Theorem 1 as an empty direct sum, extended by n zero positions. (b) The value of a can be 0. This appears whenever ∆ is coprime to q, including also the trivial situation ∆ = 1. Here, only direct sums of ∆-fold repeated simplex codes of dimension 1 appear, which are the same as the ordinary repetition codes of length ∆. In the case ∆ = 1 this means that C is the full Hamming space of some dimension, possibly extended by zero positions. Further related work includes the classical result of Bonisoli characterizing constant weight codes [3] and the generalization to two-weight codes whose bigger weight equals the length of the code [8].

PRELIMINARIES
Let C be a q-ary linear code. If dim(C) = 0, C is called a zero code. A position where all codewords of a linear code C have a zero entry is called a zero position. Equivalently, all generator matrices have a zero column at that position. A code without zero positions is called full-length. Zero positions are irrelevant for many aspects in coding theory, such that it is often sufficient to restrict the investigation to full-length codes.
Two vectors v, w over F q are called (projectively) equivalent, denoted as v ∼ w, if there is a non-zero scalar λ ∈ F × q with v = λw. The highest number of equivalent positions of a code is called its maximum multiplicity. A full-length code of maximum multiplicity ≤ 1 is called projective. The zero code of length 0 is the unique code of maximum multiplicity 0.
For M ⊆ F n q , we define supp(M ) = c∈M supp(c), where supp(∅) = ∅. The number n eff (C) := # supp(C) is called the effective length of C. The effective length equals the number of non-zero positions of C. The code C is full-length if and only if the effective length of C coincides with the ordinary length.
Let N = {1, . . . , n} and c ∈ F n q . For I ⊆ N , we denote the restriction of c to the positions in I by c I , that is c I = (c i ) i∈I . The restriction of a [n, k] q -code C of length n is defined as C I = {c I | c ∈ C}. It is known as the code punctured in N \ I. For c ∈ C, the punctured code C N \ supp(c) is called the residual with respect to c. Its dimension is at most k − 1 but may also be strictly less. The extremal situation that the residual is a zero code appears if and only if supp(c) = supp(C). Note that residuals preserve the properties full-length and projective.
By A i (C) we denote the number of codewords of weight i in C and by B i (C) the number of codewords of weight i in C ⊥ . Mostly, we will just write A i and B i , whenever the code C is clear from the context. We always have A 0 = B 0 = 1. A code with only a single non-zero weight is called constant weight code. Furthermore, the code C is full-length if and only if B 1 = 0, and it is projective if and only if B 2 = B 1 = 0. The weight distribution of C is the sequence (A i ). The weight enumerator of C is the polynomial , and the homogeneous weight enumerator of C is the The weight distributions (A i ) and (B i ) are related by the famous MacWilliams identities [12]. For all i ∈ {0, . . . , n}, A compact form of the MacWilliams identities is given by the polynomial equation involving the homogeneous weight enumerators.
There are several alternative forms of the MacWilliams equations, among them the (Pless) power moments, see [13]. For full-length binary codes, the first four Pless power moments are Two q-ary linear codes C, C of the same length n are called isomorphic or equivalent, denoted as C ∼ = C , if C can be mapped to C via an isometry of the ambient Hamming space F n q , which preserves the F q -linearity of codes. For n ≥ 3, the group of these isometries is given by the semimonomial group on F n q . For binary codes, it reduces to the symmetric group S n acting on the positions. Furthermore, for two q-ary linear codes C, C , not necessarily of the same length, we write C ∼ =0 C if the codes C and C are isomorphic after removing zero positions. If C and C have the same length, C ∼ =0 C is equivalent to C ∼ = C .
The direct sum of an [n, k] q -code C and an [n , k ] q -code C is the [n + n , k + k ] q code If G is a generator matrix of C and G a generator matrix of C , a generator matrix of C ⊕ C is given by To show that some code is indecomposable, the following lemma may be helpful. It is essentially [2, 6.2.13].
Lemma 2.1. Let G = (I k A) be a systematic generator matrix, where I k denotes the k × k unit matrix. We consider the set of non-zero entries of A as the vertex set of a simple graph G, where two distinct vertices are connected by an edge if and only if they are entries in the same row or the same column of A.
Then the code generated by G is indecomposable if and only if G has a connected component containing entries from each row of A.
In this article, we want to classify all ∆-divisible q-ary linear codes which are generated by codewords of weight ∆. The investigated property is invariant under forming direct sums and adding zero positions, such that it suffices to restrict the classification to indecomposable full-length codes with the stated property. These codes turn out to be repetitions of members of the following three families.
(i) The q-ary simplex code Sim q (k) of dimension k ≥ 1. A generator matrix can be constructed column-wise by taking a set of projective representatives of the non-zero vectors in F k q . In the geometric setting, the simplex code Sim q (k) is the set of all points contained in a projective space of algebraic dimension k. Its parameters are [ q k −1 q−1 , k] q and the corresponding weight enumerator is So it is a code of constant weight ∆ = q k−1 and in particular, the code is ∆-divisible and spanned by codewords of weight ∆. Moreover, the code Sim q (k) is full-length and projective and by Lemma 2.1, it is indecomposable. (ii) The q-ary first order Reed-Muller code RM q (k) of dimension k ≥ 2. A generator matrix can be constructed in the following way: Take all vectors in F k−1 q as the columns of a matrix, and extend that matrix by an additional row consisting of the all-one vector. Stated slightly different, RM q (k) is the span of (q − 1) · Sim q (k − 1), extended by a zero position, and a vector of weight q k . In the geometric setting, the first order Reed-Muller code is the set of all points contained in an affine space of dimension k − 1. Its parameters are [q k−1 , k] q and the corresponding weight enumerator is The code RM q (k) is full-length and projective. Using Lemma 2.1 it is checked to be indecomposable for (q, k) = (2, 2). 1 The first order Reed-Muller codes will only be needed in the binary case q = 2. Here, all but a single non-zero word are of weight ∆, so RM 2 (k) is spanned by codewords of weight ∆.
(iii) The q-ary parity check code PC q (k) of dimension k ≥ 1. It is the set of all vectors c ∈ F k+1 q with c 1 + . . . + c k+1 = 0. A generator matrix can be constructed column-wise by taking the k standard basis vectors in F k q together with the negated all-one vector. Geometrically, PC q (k) corresponds to a projective basis of a projective space of algebraic dimension k, sometimes also called projective frame. Its parameters are [k + 1, k] q . It is the dual code of the (k + 1)-fold q-ary repetition code, so the polynomial form of the MacWilliams identities gives the homogeneous weight enumerator as The code PC q (k) is full-length and indecomposable by Lemma 2.1. Moreover, PC q (k) is projective if and only if k = 1. The parity check code will only be needed in the binary case q = 2. Here, PC 2 (k) is just the set of all vectors in F n+1 2 of even weight. Thus it is a ∆-divisible code with ∆ = 2, and the above stated generator matrix shows that PC 2 (k) is spanned by codewords of weight ∆.
Remark 2.2. There are the following isomorphisms among these series of codes.
Up to taking repetitions on both sides, the above stated properties show that there are no other isomorphisms among possibly repeated codes of these series.
We will need the following three lemmas on divisible codes. The first one is known as the Theorem of Bonisoli [3], which says that every constant-weight code is the repetition of some simplex code, possibly extended by zero positions. We state the theorem it in slightly more refined way. Lemma 2.3. Let q be a prime power and ∆ a positive integer. Let a be the largest integer such that q a divides ∆.
Let C be a q-ary linear code of dimension k ≥ 1 of constant weight ∆. Then k ≤ a + 1 and C is isomorphic to the ∆ q k−1 -fold repetition of the q-ary simplex code Sim q (k), possibly extended by zero positions.
The second lemma shows that it is enough to consider F q -linear ∆-divisible codes where ∆ is a power of the base prime. It is essentially [18,Th. 1], see also [20, Th. 2].
Lemma 2.4. Let q = p r be a prime power with p prime. Let ∆ be a positive integer and a the largest integer with p a | ∆. Let C be a F q -linear ∆-divisible code. Then C is isomorphic to the ∆ p a -fold repetition of a p a -divisible F q -linear code, possibly extended by zero positions.
The third lemma is the result [19,Lemma 13] on the divisibility of residual codes, see also [6,Lemma 7].
Lemma 2.5. Let q be a prime power and ∆ a positive integer. Let C be a q-ary ∆-divisible code. Then any residual of C is ∆ gcd(q,∆) -divisible.

THE CHARACTERIZATION
In this section, we will prove Theorem 1.
Lemma 3.1. Let C be a ∆-divisible q-ary linear code and c, c ∈ C two codewords of weight ∆. Then one of the following statements is true: If supp c = supp c , we have wt(c − λc ) = ∆ − a λ . By the ∆-divisibility, a λ ∈ {0, ∆}, and Equation (5) shows that a λ = ∆ for a unique λ ∈ F * q . Therefore c = λc for this value of λ, which is case (i).
Assuming that we are not in case (i) or (iii), the above expression for wt(c − λc ) is neither 0 nor 2∆. By the ∆-divisibility of C, the only remaining possibility is wt(c − λc) = ∆. So a := a λ = ∆ − b independently of λ ∈ F * q . Now Equation (5) yields b = q−1 q ∆ and a = 1 q ∆, showing that we are in case (ii).
For the inductive treatment of indecomposable codes, we prepare the following lemma.
Proof. We define the sets B i (and the codes Suitable codewords c i do indeed exist by the indecomposability of C, as otherwise C = C i−1 ⊕ B \ B i−1 would be a non-trivial decomposition of C for i = 1. We consider the simple graph G i on the vertex set B i where two distinct codewords are connected by an edge if their supports are not disjoint. By induction, all graphs G i are connected. Let E and E be subcodes of C i with E + E = C i and supp(E) ∩ supp(E ) = ∅. For any codeword c ∈ C i there are codewords e ∈ E and e ∈ E with c = e + e . By supp(e) ∩ supp(e ) = ∅, we have wt(c) = wt(e)+wt(e ). If c is of minimum weight, then e = 0 or e = 0, so without restriction c ∈ E. If c ∈ C i is another codeword of minimum weight with supp(c) ∩ supp(c ) = ∅, then necessarily c ∈ E, too. The connectedness of the graph G i shows that without restriction, b ∈ E for all b ∈ B i . Therefore, C i = B i = E and E = 0, implying that C i is indecomposable.
We remark that the above proof still works as long as B consists only of codewords of weight smaller than 2d(C).

3.1.
Non-binary codes. We start with the easier case of non-binary linear codes.
Theorem 2. Let q = 2 be a prime power and ∆ a positive integer. Let a be the largest integer such that q a divides ∆.
There are a + 1 isomorphism types of indecomposable non-zero full-length ∆-divisible q-ary linear codes which are spanned by codewords of weight ∆, one for each dimension k ∈ {1, . . . , a + 1}. It is given by the ∆ q k−1 -fold repetition of the q-ary simplex code of dimension k. Proof. By the discussion in Section 1, all stated codes are full-length, ∆-divisible, indecomposable and spanned by codewords of weight ∆. Furthermore, it is clear that a full-length ∆-divisible code of dimension 1 is equivalent to the ∆-fold repetition of the simplex code of dimension 1. 2 Now let C be an indecomposable full-length ∆-divisible code of dimension k ≥ 2 and B a basis of C consisting of codewords of weight ∆. By Lemma 3.2, there is a c ∈ B such that the code D := B \ {c} is an indecomposable subcode of C of codimension 1. As a subcode, D is ∆-divisible, too. So by induction, By the indecomposability of C, supp(c)∩supp(D) = ∅. Therefore, by Lemma 3.1 there is a c ∈ B \{c} with #(supp(c) ∩ supp(c )) = q−1 q ∆. This implies that the length n of C is bounded by where we have used q ≥ 3 in the last inequality. Now by the ∆-divisibility, C is a code of constant weight ∆. By Lemma 2.3, k ≤ a + 1 and C is equivalent to the code of the stated form.

Binary codes.
We are going to use the same inductive approach in the binary case, too. For that purpose we prepare the following three lemmas, which investigate the extensions of repeated parity check codes, repeated simplex codes and repeated first order Reed-Muller codes.
For k = 2, the code C is the span of a single codeword of weight ∆, and by Lemma 3.1 and the indecomposability of C, necessarily C ∼ = ∆ 2 · PC 2 (2). So we may assume k ≥ 3. The second case we have c ∈ C , which is a contradiction. Lemma 3.4. Let a be a non-negative integer, ∆ = 2 a and k ∈ {2, . . . , a + 2}. Let C be a binary indecomposable full-length ∆-divisible code of dimension k. Assume that C = C , c with a codeword c of weight ∆ and C ∼ =0 ∆ 2 k−2 · Sim 2 (k − 1). Then (i) k = a + 2 and C ∼ = ∆ 2 k−1 · Sim 2 (k) or (ii) k = 2 and C ∼ = ∆ 2 k−2 · RM 2 (k). In particular, C does not exist in the case a = 0. 3 Proof. Because of dim(C ) = k − 1 we have c / ∈ C . By the indecomposability of C there is a codeword c ∈ C with supp(c) ∩ supp(c ) = ∅. We have wt(c) = ∆ as C is a code of constant weight ∆. By Lemma 3.1, #(supp(c) ∩ supp(c )) = ∆ 2 and in particular a ≥ 1. Therefore So by the ∆-divisibility, C can only contain non-zero codewords of weight ∆ and 2∆. If there is no codeword of weight 2∆, Lemma 2.3 gives k = a + 2 and C ∼ = ∆ 2 k−1 · Sim 2 (k). Otherwise, there is a codeword c ∈ C of weight 2∆. Let D be the residual of C with respect to c . Since C is full-length, so is D, and we get n(D) = n(C)−wt(c ) < ∆ 2 . Furthermore, as the residual of a binary ∆-divisible code, D is ∆ 2 -divisible by Lemma 2.5, which implies that D is a full-length zero code. Therefore n(D) = 0 and thus n(C) = 2∆. So c is the all-one word and supp(C ) ⊆ supp(c ). From the simplex code structure of C we conclude that C ∼ = ∆ 2 k−2 · RM 2 (k), and by the indecomposability of C, we have k = 2.
Lemma 3.5. Let a be a positive integer, ∆ = 2 a and k ∈ {4, . . . , a + 3}. Let C be a binary indecomposable full-length ∆-divisible code of dimension k with a basis B of codewords of weight ∆. Let c ∈ B. If B \ {c} ∼ =0 ∆ 2 k−3 · RM 2 (k − 1), then (i) a ≥ 2, k ≤ a + 2 and C ∼ = ∆ 2 k−2 · RM 2 (k) or (ii) k = 4 and C ∼ = ∆ 2 · PC 2 (4). Proof. Let C = B \ {c} . We have # supp(C ) = 2∆ and C contains a codeword e of weight 2∆. Lemma 3.1 and the indecomposability of C yield 2∆ ≤ n(C) ≤ 5 2 ∆. The residual D of C with respect to e is a full-length ∆ 2 -divisible code of length n(D) ≤ 5 2 ∆ − 2∆ = ∆ 2 . This leaves only the possibilities n(D) ∈ {0, ∆ 2 }. Case 1: n(D) = 0. Therefore, n(C) = 2∆. So e is the all-one word in C and hence the unique codeword of weight 2∆. Thus all but a single non-zero codeword are of weight ∆. Therefore, C = C , c , where C is a subcode of dimension k − 1 of constant weight ∆, and c is a codeword of weight ∆. Lemma 2.3 shows that k ≤ a + 2 and C ∼ =0 ∆ 2 k−2 · Sim 2 (k − 1). Now by Lemma 3.4 and the fact that C contains a codeword of weight 2∆, we have C ∼ = ∆ 2 k−2 · RM 2 (k). Case 2: n(D) = ∆ 2 . Therefore, n(C) = 5 2 ∆. The only non-zero weights of C are ∆ and 2∆. Let A ∆ and A 2∆ be their frequencies and let (B i ) be the weight distribution of C ⊥ . The first two Pless power moments give the linear equation system 4 #C − 2 and A 2∆ = 1 4 #C + 1. Now the third and the forth Pless power moment yield The number B 3 must be non-negative, which is equivalent to #C ≤ 16 or k ≤ 4. So k = 4 and . Now by Lemma 3.3 and n(C) = 5 2 ∆, we have C ∼ = ∆ 2 · PC 2 (4).
We remark that the setting of the above lemma makes also sense for k = 3. We didn't include it as the first order Reed-Muller code RM 2 (2) ∼ = F 2 2 (and its repetitions) are decomposable. For k = 3, Case 1 is the same, and it is easily checked that there is no suitable code C in Case 2.
Theorem 3. Let ∆ be a positive integer and a the largest integer such that ∆ is divisible by 2 a . The following codes form a complete and non-redundant list of all isomorphism types of binary indecomposable full-length ∆-divisible codes of dimension k ≥ 1 that are spanned by codewords of weight ∆. ( with a ≥ 1 and k ≥ 4. PROOF. All codes in the list have the stated properties, and by Remark 2.2, the list is non-redundant. By Lemma 2.4, it is enough to consider ∆ = 2 a . It is clear that the only sought-after code of dimension 1 is the code ∆·Sim 2 (1). Now assume that C is a binary indecomposable full-length ∆-divisible code of dimension k ≥ 2 having a basis B of codewords of weight ∆. By Lemma 3.2, there is a codeword c ∈ B such that C := B \ c is indecomposable. By induction, we are in one of the following situations: Case (i). 2 ≤ k ≤ a + 2 and C ∼ =0 ∆ 2 k−2 · Sim 2 (k − 1). By Lemma 3.4, either k = 2 and C ∼ = ∆ 2 k−2 · RM 2 (k), or k = a + 2 and C ∼ = ∆ 2 k−1 · Sim 2 (k). Case (ii). 4 ≤ k ≤ a + 3 (so in particular a ≥ 1) and C ∼ =0 ∆ 2 k−3 · RM 2 (k − 1). By Lemma 3.5, either a ≥ 2 and k ≤ a + 2 and C ∼ = ∆ 2 k−2 · RM 2 (k), or k = 4 and C ∼ = ∆ 2 · PC 2 (k). Case (iii). a ≥ 1, k ≥ 5 and C ∼ =0 ∆ 2 · PC 2 (k − 1). Now by Lemma 3.3, C ∼ = ∆ 2 · PC 2 (k). Our main result Theorem 1 is now a direct consequence of Theorem 2 and Theorem 3 and the discussion of decomposability of linear codes in Section 2.
Corollary 3.6. Let C be an even binary code that is spanned by codewords of weight 2. Then C isomorphic to an essentially unique direct sum of binary parity check codes, possibly extended by zero positions.
Corollary 3.7. Let C be a doubly-even binary code that is spanned by codewords of weight 4. Then C is isomorphic to an essentially unique direct sum of codes of the following form, possibly extended by zero positions.
(i) The binary simplex code of dimension 3. (v) The 4-fold repetition of a binary parity check code.

AN APPLICATION
As an application, we consider binary projective ∆-divisible [4∆, k] 2 -codes C with ∆ = 2 a . We will find an alternative proof of [11,Thm. 4] in the case of projective codes. The idea is to apply Theorem 1 to the subcode of C spanned by all codewords of weight ∆.
If C does not contain the all-one word 1, we may look at the code D = C, 1 , which is a projective ∆-divisible [4∆, k + 1] 2 -code. Therefore, we may restrict ourself to the codes D containing the all-one word, in the sense that all codes C will show up as subcodes of these codes D.
Lemma 4.1. Let ∆ = 2 a and C be a binary projective ∆-divisible [4∆, k] 2 -code containing the allone word. Let C be the subcode spanned by all codewords of weight ∆. Then C falls into one of the following cases.
PROOF. We have A 4∆ = 1. As C is projective, B 1 = B 2 = 0. By the MacWilliams identities, we compute the weight enumerator of C as We have n eff (C ) ≤ n eff (C) and A ∆ (C ) = A ∆ (C), which gives the conditions The values A ∆ and n eff of the codes C i are summarized below.
Theorem 4. Let a ≥ 2 be an integer, ∆ = 2 a and C be a binary projective ∆-divisible [4∆, k]-code. Then k ≤ 2a + 4. In the case of maximum dimension k = 2a + 4, we have (i) C ∼ = RM 2 (a + 2) ⊕ RM 2 (a + 2) or (ii) a = 2 and C ∼ = 2 · PC 2 (7), (1111111100000000) PROOF. For the investigation of the maximum dimension, we may assume 1 ∈ C. Let C be the subcode of C spanned by the codewords of weight ∆.  The case a = 2 is about 4-divisible [16,8] 2 -codes, which are binary Type II self-dual codes of length 16. These codes have first been classified in [14], where our two codes are called A 8 ⊕ A 8 and E 16 . Up to isomorphism, these are the only Type II self-dual codes of length 16.