Rank-Metric Codes, Generalized Binomial Moments and their Zeta Functions

In this paper we introduce a new class of extremal codes, namely the $i$-BMD codes. We show that for this family several of the invariants are determined by the parameters of the underlying code. We refine and extend the notion of an $i$-MRD code and show that the $i$-BMD codes form a proper subclass of the $i$-MRD codes. Using the class of $i$-BMD codes we then obtain a relation between the generalized rank weight enumerator and its corresponding generalized zeta function. We also establish a MacWilliams identity for generalized rank weight distributions.


Introduction
A well-studied problem in coding theory is the determination of the invariants of a code, such as its rank distribution, its binomial moments and its generalized weights. Computation of such invariants for an arbitrary code is a non-trivial problem. On the other hand, for codes in certain families, all or some of these invariants are determined by the standard coding theoretic parameters of length, dimension and minimum distance.
Optimal codes are of great interest in coding theory and often have rigidity properties, which make them interesting as combinatorial objects. Perhaps the best known class of optimal codes in the rank metric are the maximum rank distance (MRD) codes. This family were first introduced in the coding theory literature by Delsarte [7] and are characterised as being the k-dimensional subspaces of F n×m q that attain the rank-metric analogue of the Singleton bound. In this sense, the class of MRD codes may be regarded as a q-analogue of the maximum distance separable (MDS) linear block codes. Delsarte's construction (see also [12,22]) immediately yields the existence of MRD codes for any choice of the parameters q, m, n and minimum rank distance. Moreover, these parameters fully determine all the invariants of the codes in this class. Similarly, the weight enumerator of an MDS code is determined by its parameters q, n and minimum Hamming distance.
An interesting fact about the MRD codes is that for a fixed ambient space F n×m q (where we write n ≤ m, without loss of generality), the set of n + 1 distinct MRD rank weight enumerators forms a Q-basis of the space of homogeneous polynomials in Q[X, Y ] of degree n. The analogous statement holds also for the MDS weight enumerators. These observations have been exploited in studying the zeta function of a linear code. This object was introduced in [9,10] for linear block (Hamming metric) codes and in [3] for rank-metric codes. The zeta function is the generating function of the normalized binomial moments of a code and can be related to the code's weight enumerator. The corresponding recurrence formula of the zeta function, the zeta polynomial, turns out to have coefficients that are exactly the coefficients that arise in the expression of the weight enumerator as a Q-linear combination of Singleton-optimal weight enumerators (MDS for the Hamming metric and MRD for the rank metric).
A central problem studied in this paper is on the behaviour of the generalized rank weight distribution of a code with respect to its generalized binomial moments and on the connections between these objects via zeta functions. In order to develop such a theory, what is first required is the correct notion of code optimality, as optimal codes provide the fundamental building blocks for this theory.
We mention some classes of optimal codes, for example, the F q m -linear i-MRD codes [8] and the dually quasi-MRD (DQMRD) codes [6]. In [5], de la Cruz introduced another class of F q -linear rank-metric codes that are i-MRD for i ∈ {1, 1 + m, . . . , 1 + ( k m − 1)m}. It turns out that the i-MRD property does not provide a class of codes equipped to describe generalized zeta functions. For this reason, we introduce a new class of extremal codes in the rank metric, namely the family of i-BMD (binomial moment determined) codes, which we will see are a subclass of the i-MRD codes. This is another class of codes whose invariants are determined. In this paper we introduce the zeta function for generalized rank weights and we show that using the i-BMD property, we can extend the connection between the generalized zeta functions and the generalized rank weight enumerators of a code. We also generalize the notion of i-MRD for the remaining cases. We study these new objects via an anticode approach. Introduced in [18], this technique gives a more general analysis of the theory and allows us to easily generalize the results in this paper for codes in other metrics, such as the Hamming metric. The MacWilliams identities [7,19] give an explicit way to compute the binomial moments and the rank distribution of a code from those of its dual. We describe these identities for generalized rank weights.
Outline. In Section 2 we recall some well-known definitions and results. In Section 3 we refine and extend, via an anticode approach, the definition of binomial moments introduced in [3] and we link them with the generalized rank weight distribution.
In Section 4 we introduce the notion of an i-BMD code. We show that, due to their strong rigidity properties, i-BMD codes allow us to determine a priori, for all i ≤ j ≤ k, their j-th generalized rank weights, their j-th generalized binomial moments and their j-th generalized rank distributions. We also extend the definition of the class of i-MRD codes.
In Section 5 we describe the i-th generalized zeta function of a code and relate this to the i-th generalized rank weight enumerator. We show that the j-th generalized rank weight enumerators of the i-BMD codes, i ≤ j ≤ k, form a Q-basis for the space of the j-th generalized rank weight enumerators. We give an explicit formula to compute the coefficient of a j-th generalized rank weight enumerator with respect to this basis in Section 6, using the wellknown Bell polynomials.
In Section 7 we derive the MacWilliams identities for generalized rank weight distributions and we show how to explicitly compute the i-th generalized binomial moments (i-th generalized normalized binomial moments resp.) of a code, knowing all the j-th generalized binomial moment (j-th generalized normalized binomial moments resp.), 0 ≤ j ≤ i, of its dual. We then use these results to compute the i-th generalized rank weight distribution and the i-th generalized zeta function. Finally, in Section 8 we describe i-BMD codes for the Hamming codes and we prove that they indeed coincide with the class of i-MDS codes.

Preliminaries
Throughout the paper, q is a prime power and F q is the finite field with q elements. We let n, m be positive integers and assume 2 ≤ n ≤ m without loss of generality. We denote the row-space and column-space of a matrix M ∈ F n×m q by rowsp(M ) and colsp(M ) respectively. From now on, unless otherwise stated, C ≤ F n×m q is a rank-metric code whose dimension is denoted by k and its minimum distance by d.
The dual of C is the code where Tr(M N t ) is the trace of the square matrix M N t .
We denote by k ⊥ and d ⊥ the dimension and the minimum distance of C ⊥ respectively. Note that colsupp(C) and rowsupp(C) are subspaces of F n q and F m q respectively. Definition 2.4. Let U be a subspace of F n q . The subcodes of C column-supported and row-supported on U are

respectively.
A rank-metric analogue of the Singleton bound for a rank-metric code C was proved by Delsarte in [7,Theorem 5.4] and it can be stated as We say that C is an MRD (Maximum Rank Distance) code if it meets the bound in (1). One can easily check that the code {0} and its dual F n×m q are MRD. In [7, Theorem 5.5], Delsarte proved that C is MRD if and only if its dual code C ⊥ is MRD and that such codes exist for every choice of the parameter n, m and d. In [19,Proposition 47] another upper bound on the dimension of C was given as: (2) Definition 2.5 ([18, Definition 22]). We say that C is an optimal anticode if it attains the bound in (2).
We denote by A the set of optimal anticodes in F n×m q and by A u the set of mu-dimensional optimal anticodes, for any 0 ≤ u ≤ n. In particular, It is known that C is an optimal anticode if and only if C ⊥ is an optimal anticode [19]. Optimal anticodes were characterized by Meshulam [16,Theorem 3], who gave a proof for the square case n = m, but from which the case n < m easily follows.
Theorem 2.6. The following hold.
Note moreover that for all n and m and all 0 ≤ u ≤ n we have A u = ∅. Lemma 2.7. Suppose n = m and let 1 ≤ u ≤ n − 1. We have Proof. Suppose, toward a contradiction, that U, V ≤ F n×n where e i denotes the i-th element of the standard basis of F n q . Indeed, we can take as A and B the matrix representations of any F q -isomorphisms f , g of F n q such that f (U ) = e 1 , . . . , e u q and g(V ) = e 1 , . . . , e u q . We then have Therefore, which is impossible as 1 ≤ u ≤ n − 1.
We recall the definition of generalized rank weights introduced in [18]. See [13,Section 5] for an overview of the alternative definitions and characterizations that have been proposed.
In [18], the d i (C)s were called generalized Delsarte weights. When the code C is clear from context, we simply write d i for d i (C) and d ⊥ i for d i (C ⊥ ). Lemma 2.9 ([18, Theorem 30]). The following hold: Another family of cardinality-extremal codes was introduced in [6]. The authors show that such codes exist for every choice of n, m and d.
We say that C is DQMRD (dually QMRD) if both C and C ⊥ are QMRD.
Finally, we recall the definition and some well-know properties of the q-binomial coefficient; a standard reference is [1]. Definition 2.11. Let a, b be integers. The q-binomial coefficient of a and b is Lemma 2.12. Let a, b, c be integers. The following hold.

Generalized Binomial Moments and Rank Distributions
In this section, we define the generalized rank weight distributions and generalized binomial moments of a rank-metric code via the anticode approach. Our results extend those of [3]. Throughout the paper, i is an integer in {0, 1, . . . , k}, unless otherwise stated. [19,Theorem 54]. Therefore by Lemma 3.1 we conclude |C ∩ A| = q k−m(n−u) , from which the result follows.
where, for every U ≤ F n q , Notice that this definition is required in order for the generalized binomial moment to be an invariant under duality.
Lemma 3.4. The following holds for any 0 ≤ u ≤ n.
Proof. Suppose i = 0. Then d 0 = 0 and we only need to treat the case u > n − d ⊥ . In such a case we have from which Now suppose i = 0. We continue the proof assuming n = m. The case n < m is analogous and in fact simpler.
Suppose u > n − d ⊥ . Applying Lemma 3.2 to Definition 3.3 we get Suppose now u < d i and let U ≤ F n q be of dimension u. Assume, towards a contradiction, that B (i) Remark 3.5. The connection between Definition 3.3 and optimal anticodes is the following. For n < m and 0 ≤ u ≤ n, Lemma 2.7 implies On the other hand, if n = m and 1 ≤ i ≤ k one can check that for 0 ≤ u ≤ n − 1 we have Finally, in the case u = n = m and 1 ≤ i ≤ k we have while in the case n = m and i = 0 we have We now introduce a new invariant of C which extends the notion of rank distribution, showing that this invariant encodes the same information as the generalized binomial moments.
Definition 3.6. The i-th generalized rank weight distribution of C is the integer vector whose w-th component, 0 ≤ w ≤ n, is defined by where, for every W ≤ F n q , This implies, by Theorem 2.6, that there exists an optimal anticode A ∈ A w ⊆ A such that D ≤ C ∩ A, which contradicts the minimality of d i .
The following is the main theorem of this section. It gives inversion formulae connecting the i-th generalized rank weight distribution and the sequence of generalized binomial moments indexed by i. This result generalizes [19,Lemma 30].
Theorem 3.8. The following hold for 0 ≤ u, w ≤ n.
Therefore using the Möbius inversion formula [23, Proposition 3.7.1] we obtain We continue the proof assuming m = n. The case n < m is analogous and in fact simpler. By (5) and (6) we have On the other hand, by (7) and (8) we get This concludes the proof.
The following generalizes the definition of rank weight enumerator.
Definition 3.9. The i-th generalized rank weight enumerator of C is the homogeneous polynomial of degree n in Q[X, Y ] defined by The coefficients of W . Another well known Q-basis of the ring of homogeneous polynomials of degree n is given by The inversion formula associated with these polynomials is In the reminder of the section we compute the coefficients of W Theorem 3.11. We have Proof. Applying the inversion formula for the q-Bernstein polynomial to Definition 3.9 we obtain where the latter inequality follows by Theorem 3.8 and the definition of normalized generalized binomial moments.

i-BMD rank-metric codes
In this section we introduce a new family of extremal rank-metric codes, namely the i-BMD codes, whose generalized rank weight distributions and generalized binomials moments depend only on the code parameters n, m, k, d. Introducing this family of codes is also motivated by the fact that it refines the notions of MRD and DQMRD. Ducoat and Oggier [8,Definition 2], in the F q m -linear case, and de la Cruz [5, Definition 5.1], for some values of the parameter i, defined the family of codes that are optimal with respect to the i-th generalized rank weight. We extend these definitions referred to as i-MRD codes and we show that this latter family properly contains the class of i-BMD codes. For the remainder α, ρ will denote non-negative integers such that k = αm + ρ and 0 ≤ ρ ≤ m − 1.
Moreover, every non-zero matrix rank-metric code is i-BMD for all i such that i m ≥ n. Proof. The first part of the statement is an immediate consequence of the fact that the generalized rank weights form an increasing sequence. For the second part, Lemma 2.9 implies that d i + d ⊥ ≥ i m + 1, from which the statement follows. Definition 4.3. We say that C is minimally i-BMD if i = min{j : C is j-BMD}.
Notice that the codes {0} and F n×m q are minimally 1-BMD. A useful property of an i-BMD code is that, for any i ≤ j ≤ k, its j-th generalized rank weight distributions and binomial moments depend only on the code parameters n, m, k and d i . We give explicit formulae in the following results.
Proof. It follows from Lemmas 3.4 and 4.2 and the Definition of a j-BMD code.
As an immediate consequence we have the following.
We now introduce another family of extremal codes, extending the definitions in [5,8].
Proof. Let C be an i-MRD code. We have In the following example we show that if C is i-MRD then it is not necessarily (i + 1)-MRD. In the remainder of the paper, we denote the codes in the examples by C v and use them repeatedly. One can check that the generalized rank weights of C are Therefore C 1 is 2-MRD but is not 3-MRD.
Lemma 4.10 ([6, Theorem 22]). If C is DQMRD, then its generalized rank weights are determined by the parameters n, m and k as follows: Lemma 4.11. The code C is DQMRD if and only if m ∤ k and C is i-MRD for all 1 ≤ i ≤ k.
The result now follows by direct application of Lemma 4.10.
We devote the remaining part of this section to showing that if a code is i-BMD then it is i-MRD and that, in general, the converse does not hold. Assume that C has dimension k ∈ {1, . . . , nm − 1}. For an integer 1 ≤ p ≤ m, we define the sets In [18,Corollary 38], it is shown that V p (C ⊥ ) = {1, 2, . . . , n} \ V p+k (C). In particular, the generalized rank weights of C completely determine the generalized rank weights of C ⊥ .
For the remainder, we assume that r, t are positive integers such that It is easy to check that these integers exist for any i. Moreover, Lemma 4.13. Let i ≥ 2, C be minimally i-BMD and suppose 1 ≤ k ⊥ < r, 2 ≤ r ≤ m. Then exactly one of the following holds.
(2) There exists an integer 1 ≤ s ≤ k m such that k + 1 − (s + 1)m < i ≤ k + 1 − sm, d ⊥ = s + 1 and This establishes (1). Suppose now that there exists an integer 1 ≤ s ≤ k m such that k + 1 − (s + 1)m < i ≤ k + 1 − sm then, by Lemma 4.12, we have d k+1−jm = n − j + 1 for 1 ≤ j ≤ s. On the other hand we have n This concludes the proof.
Lemma 4.14. If C is k-BMD then d k = n.
Proof. Suppose toward a contradiction that there exists a k-BMD code C with d k = δ < n. By definition of generalized rank weights we get and therefore C must be contained in an optimal anticode A ∈ A(n × m, δ). Let B ∈ GL n (F q ) be a matrix such that B · C ⊆ F n×m q e 1 , . . . , e δ q .
Notice that in particular the last row of every matrix in B · C must be of all zeros. Hence (B · C) ⊥ must contains the matrix  which implies d ⊥ = 1. Therefore, n − d k − d ⊥ = n − δ − 1 ≥ 0 and we get a contradiction.
We can now prove the main result of this section.
Proof. We already observed that the codes {0} and F n×m q are 1-MRD, it easy to check that that they are also 1-BMD. Indeed, which implies that C is either MRD or DQMRD and therefore 1-MRD. Lemma 4.14 implies d k = n for a k-BMD code. Thus, n = n − k−k m and C is k-MRD. Let C be i-BMD for an 2 ≤ i ≤ k − 1. If r ≤ k ⊥ then Lemma 4.12 implies d i = n − t + 1. Therefore, We now consider the case r > k ⊥ , in which case 2 ≤ r ≤ m. Let C be minimally j-BMD for some j ∈ {2, . . . , i}. We consider two cases, j > k + 1 − m and j ≤ k + 1 − m.
In the first case, namely j > k + 1 − m, Lemma 4.13 implies d ⊥ = 1 and d k+1−m = n − 1. Therefore, We have shown that if r > k ⊥ and C is minimally j-BMD then C is j-MRD. It remains to show that C is also i-MRD in this case. Recall that k + 2 − tm ≤ i ≤ k − (t − 1)m and j ≤ i. Now, in the case k + 2 − tm ≤ j ≤ i ≤ k − (t − 1)m we have In the case j < k The following example shows that the converse of Theorem 4.15 does not hold. We want to show that C 1 is not 2-BMD, i.e., that n − d 2 (C 1 ) − d(C ⊥ 1 ) ≥ 0.
Define the sets We have Observe that the only codes that are 1-MRD but not 1-BMD are those that are QMRD but not DQMRD. Figure 1 shows the set representation of the class of 1-MRD codes.  Proof. Suppose i = 2 and that C is 1-MRD and minimally 2-BMD code C. We have which implies that C is 1-BMD, yielding a contradiction. Now assume i ≥ 3. Since C is (i − 1)-MRD and minimally i-BMD we have Recall that k = αm + ρ. Write i = βm + σ with 0 ≤ σ ≤ m − 1 and β ≤ α. Therefore, (9) can be rewritten as Table 1 below shows the values of ρ, β and σ for which the relation in (10) holds. Notice that i ≥ 3 and β = 0 imply σ ≥ 3. Table 1 It remains to check that for each case in the Table 1 for which d ⊥ is determined we get a contradiction. We show only this for the first of such cases in the table and omit the proofs for remaining cases. Assume ρ = 0, β ≥ 1 and σ = 1 then we have d ⊥ = α − β by Table 1. On the other hand, k = mα, i = βm + 1 = αm + 1 − (α − β)m and we have Since C is minimally i-BMD, Theorem 4.12 implies d i = n − α + β + 1 and therefore d ⊥ = α − β + 1 which yields a contradiction.
We give a graphical illustration of the families of i-MRD and i-BMD codes in Figure 2.
(3) Observe that, in general, all the regions in Figure 2 are non-empty. We illustrate this for i = 2 giving an example of codes for each region.
(2) The code C 2 of dimension 6 generated by We conclude this section with an example of two minimally i-BMD codes of the same dimension with the property that their dual codes are not minimally j-BMD for the same 0 ≤ j ≤ k ⊥ . This shows that the property of being minimally i-BMD does not obey a duality statement.
Example 4.19. Let C 1 be the code of Example 4.9 and C 4 the code defined above. One can check that the generalized rank weight distribution of C 4 is the generalized rank weight distribution of C ⊥ 1 is Therefore, we get that both C 1 and C 4 are minimally 4-BMD, C ⊥ 1 is minimally 4-BMD, while C ⊥ 4 is minimally 2-BMD.

The Generalized Zeta Function
Inspired by the work in [3], in this section we define and study the zeta function for generalized rank weights. Throughout this section we work in the polynomial rings Q[T ] and Q[X, Y, T ].
The following result is the rank-metric analogue of [14, Theorem 3.8] Theorem 5.2. There exists a unique polynomial P (i) More precisely, the coefficient of T u in P (13) and the degree of P (i) Using Lemma 2.12 one can show that the coefficient of T u in P (i) C (T ) is exactly the quantity in (13) by definition. A standard computation using Lemma 2.12 shows that Therefore P (i) C (T ) is a polynomial and its degree is at most n − d ⊥ − d i + i + 1.
We call the polynomial P (i) C (T ) in (12) the i-th generalized zeta polynomial of C. It is interesting to observe that for an i-BMD code the generalized zeta polynomials and zeta functions are partially determined by the code dimension, as the next result shows. The proof easily follows from Theorem 4.15.
Corollary 5.3. Suppose that C is i-BMD. The following hold for i ≤ j ≤ k.

This recovers [3, Lemma 4].
Notation 5.5. In the sequel, for j, u ∈ Z ≥0 and τ ∈ {0, . . . , m − 1} we let Observe that, by Corollary 5.3, the objects b τ (T ) in Notation 5.5 are those associated with a j-BMD code of dimension k ≡ τ mod m, provided that such a code exists.
The next result shows a precise connection, via the q-Bernstein polynomials, among the i-th generalized zeta function, the i-th generalized rank weight enumerator, and the i-th generalized rank weight.

Proof. We have
where the last equality follows from Theorem 3.11.
Example 5.7. Let C 1 be the code of Example 4.9 and recall that d 2 (C 1 ) = 2. One can check that Therefore W (2) as predicted by Lemma 5.6.
We conclude this section with a result on generalized zeta functions/polynomials that we will need later.
The result follows from Theorem 5.2. Indeed, as desired.

A Connection with Bell Polynomials
For each τ ∈ {0, . . . , m − 1} and r ∈ {0, . . . , n} we define Note that, by Corollary 5.3, M (i) τ,r (X, Y ) is the i-th generalized rank weight enumerator of an i-BMD code of dimension k ≡ τ mod m and d i = r, provided that such a code exists.
It is not difficult to check that, for a given τ , the set M (i) τ,r (X, Y ) : 0 ≤ r ≤ n} is a Q-basis for the space that contains the i-th generalized rank weight enumerators.
In [3,Theorem 1], the authors show for i = 1 that it is possible to express the 1st generalized rank weight enumerator of C with respect to the basis M (1) 0 as follows where the p  τ . In particular, we give an explicit expression for the rational numbers β and show the relation with P (i) C (T ). Our approach for deriving such coefficients is based on Bell polynomials. Introduced in [2], these polynomials encode the different ways in which an integer can be partitioned. See also [4] and [17]. These polynomials find applications in several fields of mathematics.
There are two forms of Bell polynomials, namely the exponential and the ordinary form. For convenience, we introduce an homogeneous version of the definition of the ordinary Bell polynomials. In the following, a, b are non-negative integers.
Definition 6.1. The homogeneous ordinary partial Bell polynomials are the polynomials P u,w (x 0 , x 1 , . . . , x a−b+1 ) in an infinite number of variables x 0 , x 1 , . . ., defined by the formula or, equivalently, by the series expansion as An explicit way to compute such polynomials is given by the following well-known result.
Notice that the first three compositions give the monomial 3x 2 1 x 3 x 2 0 while the last three give 3x 1 x 2 2 x 2 0 . Therefore, . We can compute the remaining (5, b)-th homogeneous ordinary partial Bell polynomials analogously and by summing them up over b we get that the 5-th homogeneous ordinary Bell polynomial is The following result is an application of Faà di Bruno's formula [11]. In this paper we need a purely combinatorial formualtion such result, involving the Bell polynomial. It can be found in [21]. Note that the last equality in the previous lemma follows from the definition of homogeneous ordinary Bell polynomials and the fact that P a,0 = 0 for all a ≥ 0.
We now state the main theorem of this section. In Corollary 6.9, this will provide us with a way of expanding W where τ,1 , −p Proof. We start by observing that Applying Lemma 6.5 we obtain as P 0 = P 0,0 = 1 by definition. Combining this with Lemma 5.8 we obtain as desired.
An immediate consequence of the theorem above is the following.
Corollary 6.7. Let β (i) τ,u (C), u ≥ 0, be the coefficients defined in Theorem 6.6. For all 0 ≤ τ ≤ m − 1 we have P (i) The next result gives an alternative way to compute the β (i) τ,u (C).
Proof. By Lemma 6.5 we have We conclude this section by showing that the β Proof. The result follows combining Lemma 5.6 and Theorem 6.6, as W In particular we have that for every 0 ≤ u ≤ n − d − d ⊥ + 2. Moreover, Corollary 6.9 gives which is the second part of [3, Theorem 1] up to a constant.
We conclude this section illustrating Theorem 6.6 and Corollary 6.9 in an example with i = 3 and τ = 1.

Duality Results
In this section we establish a MacWilliams identity for the generalized rank distribution. We then use it to explicitly compute the generalized zeta functions, the generalized binomial moments and the generalized rank weight distributions of C ⊥ knowing the generalized binomial moments of C. The following result generalizes [19,Lemma 30].
where in the third line we applied Lemma 2.12. Since the map A → A ⊥ is a bijection between the mu-dimensional and the m(n − u)-dimensional optimal anticodes in F n×m q , we get from which the statement follows.
Corollary 7.3. The following hold for all 0 ≤ u ≤ n − d i − d.
Proof. Part 1 follows from Theorem 7.1 and the definition of b Proof. The desired formula follows from Theorem 3.8 and Theorem 7.1.

Codes for the Hamming Metric
The results of the previous sections have analogues for the Hamming metric, with the main distinction given by the notion of support of a code and its codewords. The two theories are linked by the role played by the two associated lattices, in the sense of [20]. More precisely, in the rank metric this lattice is that of subspaces of a linear space over F q , while in the Hamming metric it is the Boolean algebra over the set {1, ..., n}.
In the sequel we use the characterization of generalized Hamming weights given in [18, Proposition 9] for q ≥ 3. All the results in this section are stated under this assumption.
We recall that a linear code is a subspace of F n q of dimension k whose Hamming weight and support are defined respectively as wt(c) := |{1 ≤ i ≤ n : c i = 0}| and supp(C) := {1 ≤ i ≤ n : ∃ c ∈ C with c i = 0}. Using the characterization of [18] we define the i-th generalized weight of C as d i (C) := min{dim Fq (A) : A ∈ A(n), dim Fq (C ∩ A) ≥ i}, where A(n) is the set of optimal linear anticodes in the Hamming metric, i.e., the set of all the codes such that dim Fq (C) = max{wt(c) : c ∈ C}.
The property of being i-MDS has already appeared in literature [24,Section 6]. For a F q -[n, k, d] Hamming-metric code C we say that C is i-BMD if n − d ⊥ − d i (C) < 0. Note that if C is i-BMD then it is also (i + 1)-BMD. Indeed, As in Section 3, a useful property of i-BMD codes is that for any i ≤ j ≤ k, their j-th generalized rank weight distributions and binomial moments depend only on some fundamental code parameters. More precisely, if C is a minimally i-BMD code then the following hold for all i ≤ j ≤ k: n (C) denotes the j-th weight distribution of C. We conclude this section with the Hamming metric analogue of Theorem 4.15. One implication can be obtained as in the rank metric case, using Wei's duality for the Hamming-metric generalized weights [24,Theorem 3]. The other implication also follows from Wei's duality and is omitted here.