1 Introduction

Rank metric codes are an important variant of linear (block) codes, and they have gained prominence in the past few decades, partly due to myriad applications in network coding and cryptography, as also due to their intrinsic interest. Perhaps a more widely studied notion of rank metric codes is the one that goes back to Gabidulin’s work [8] in 1985. A Gabidulin rank metric code, or simply, a Gabidulin code, of length n and dimension k may be defined as a k-dimensional subspace of the n-dimensional vector space \({\mathbb F}_{q^m}^n\) over the extension field \({\mathbb F}_{q^m}\) of \({\mathbb F}_q\). The analogue of Hamming distance here is the notion of rank distance defined as follows. Fix a \({\mathbb F}_q\)-basis of \({\mathbb F}_{q^m}\) so as to associate to any vector in \({\mathbb F}_{q^m}^n\) an \(m\times n\) matrix with entries in \({\mathbb F}_q\). Now, the rank distance between any \({\mathbf {x}}, {\mathbf {y}} \in {\mathbb F}_{q^m}^n\) is defined as the rank of the difference of the matrices corresponding to \({\mathbf {x}}\) and \({\mathbf {y}}\). The notion of a Delsarte rank metric code is in fact, older (it goes back to the work [6] of Delsarte in 1978) and more general. Indeed, a Delsarte rank metric code, or simply, a Delsarte code of dimension K is a K-dimensional subspace of the \({\mathbb F}_q\)-linear space of all \(m\times n\) matrices with entries in \({\mathbb F}_q\). As before, the rank distance between two \(m\times n\) matrices is the rank of their difference. It is clear that a Gabidulin code of dimension k is a Delsarte code of dimension mk. But a Delsarte code need not be a Gabidulin code, even if its dimension is divisible by m.

Generalized Hamming weights (GHW), also known as higher weights, of a linear code C are a natural and useful generalization of the basic notion of minimum distance of C. These were studied by Wei [20] who showed that the GHW \(d_1, \dots , d_k\) of a linear code C of dimension k satisfy nice properties such as monotonicity (\(d_1< \cdots < d_k\)) and more importantly, duality, whereby the GHW of C and its dual \(C^\perp \) determine each other. It was not immediately clear how an analogue of GHW for rank metric codes could be defined. But then three definitions for the generalized rank weights (GRW) of a Gabidulin rank metric code were proposed by three sets of authors working in different parts of the globe, viz., Oggier and Sboui [16], Kurihara et al. [13], and Jurrius and Pellikaan [11]. Thankfully, all three seemingly disparate definitions turn out to be equivalent (cf. [1, 11]). Moreover, an analogue of Wei duality holds for the GRW’s; see, e.g., Ducoat [7]. For the more general class of Delsarte rank metric codes, Ravagnani [18] proposed an analogous definition of generalized weights (GW) and showed that in the special case of Gabidulin codes, the km GW’s of the corresponding Delsarte code are the same as the k GRW’s of the Gabidulin code (in accordance with the previous definitions), each repeated m times. Further, Ravagnani [18] established a duality for the GW’s of Delsarte rank metric codes. The notion of dual Delsarte codes is facilitated by the trace product, which associates to a pair (AB) of \(m\times n\) matrices with entries in \({\mathbb F}_q\) the element \(\mathrm {Tr}(AB^t)\) of \({\mathbb F}_q\). It is shown by Ravagnani [17] that for suitable choices of \({\mathbb F}_q\)-bases of \({\mathbb F}_{q^m}\), the notions of the (standard) dual of a Gabidulin code and of the (trace product) dual of the corresponding Delsarte code are compatible.

In the classical case of linear codes, Britz et al. [4] showed that Wei duality for generalized Hamming weights of linear codes is, in fact, a special case of Wei duality for matroids and also established Wei-type duality theorems for demi-matroids. It is natural, therefore, to ask if the notion of generalized (rank) weights for (Gabidulin or Delsarte) rank metric codes can be studied in the more general context of something like matroids, and if an analogue of Wei duality can be proved in this set-up. This is the question that we address in this paper. The notion that turns out to be relevant for us is that of (qm)-polymatroids, which has recently been introduced by Shiromoto [19]. We consider, in fact, a little more general class of (qm)-demi-polymatroids, define generalized weights for them, and establish a duality in this context. We show that these can be applied to flags, or chains, of Delsarte rank metric codes. In particular, by considering pairs, i.e., flags of length 2 of Delsarte codes, we recover several results of Martínez-Peñas and Matsumoto [15] on the so called relative generalized weights of Delsarte codes. Also, considering flags of length 1, we can deduce the results of Ravagnani [18] for the GW’s of Delsarte codes and their duals. We remark that q-analogues of matroids, called q-matroids and q-polymatroids, have been considered by Jurrius and Pellikaan [12] and by Gorla et al. [10], respectively. However, as far as we can see, Wei-type duality for their generalized weights is not shown in these papers.

This paper is organized as follows. In Sect. 2 below, we review the definition of a (qm)-demi-polymatroid and outline some basic notions and results. Generalized weights of a (qm)-demi-polymatroid are defined and Wei-type duality for them is established in Sect. 3. These results are then applied to Delsarte rank metric codes as well as to their flags in Sect. 4. As a corollary, one obtains analogues of Wei duality for generalized weights as well as relative generalized weights of Delsarte rank metric codes.

After this work was submitted and put on the arXiv, we learned of the work of Britz et al. [5] where results similar to those in Sect. 3 of this paper are proved, albeit using different methods. A nice comparison of the two approaches is given in the postscript of [5] and we refer the interested reader to it.

2 Demi-polymatroids: definitions and basic facts

nonnegative integers, mn denote positive integers, q a prime power, and \({\mathbb F}_q\) the finite field with q elements. We let E be the vector space \({\mathbb {F}}_q^n\) over \({\mathbb F}_q\) and let

$$\begin{aligned} \Sigma (E) = \text {the set of all }\, {\mathbb F}_q\text {-linear subspaces of} E. \end{aligned}$$

For \(X\in \Sigma (E)\), we denote by \(X^{\perp }\) the dual of X (with respect to the standard “dot product”), i.e., \(X^{\perp } = \{{\mathbf {x}} \in E: {\mathbf {x}} \cdot {\mathbf {y}} = 0 \text { for all } {\mathbf {y}} \in X\}\). It is elementary and well-known that \(X^{\perp }\in \Sigma (E)\) with \(\dim X^{\perp } = n - \dim X\) and \((X^{\perp })^{\perp } = X\), although \(X\cap X^{\perp }\) need not be equal to \(\{\mathbf {0}\}\), but of course \(E^\perp = \{\mathbf {0}\}\).

The first part of the following key notion is due to Shiromoto [19, Definition 2].

Definition 1

A (qm)-polymatroid is an ordered pair \(P= (E,\rho )\) consisting of the vector space \(E={\mathbb {F}}_q^n\) and a function \(\rho :\Sigma (E)\rightarrow {\mathbb {N}}_0\) satisfying (R1)–(R3) below:

  1. (R1)

    \(0\le \rho (X) \le m\dim X\) for all \(X \in \Sigma (E)\);

  2. (R2)

    \(\rho (X) \le \rho (Y)\) for all \(X,Y \in \Sigma (E)\) with \(X \subseteq Y\);

  3. (R3)

    \(\rho (X+Y)+\rho (X \cap Y) \le \rho (X)+\rho (Y)\), for all \(X,Y \in \Sigma (E)\).

In case the ordered pair \(P=(E,\rho )\) satisfies (R1), (R2), and instead of (R3),

  1. (R4)

    \(\rho ^*:\Sigma (E)\rightarrow {\mathbb {N}}_0\) defined by \(\rho ^*(X)=\rho (X^{\perp })+m\dim X-\rho (E)\) for \(X \in \Sigma (E)\), also satisfies (R1) and (R2)

then P is called a (qm)-demi-polymatroid.

If \(P=(E,\rho )\) is as above, then the nonnegative integer \(\rho (E)\) is called the rank of P and is denoted by \(\mathrm{rank}P\). The function \(\rho \) may be called the rank function of P. We have the following “extension” of [19, Proposition 5].

Proposition 2

Let \(P=(E,\rho )\), where \(E={\mathbb {F}}_q^n\) and \(\rho :\Sigma (E)\rightarrow {\mathbb {N}}_0\) is any map. Also let \(\rho ^*\) be as in \(\mathrm {(R4)}\) above. Then:

  1. (i)

    If P is a (qm)-demi-polymatroid, then so is the ordered pair \((E,\rho ^*)\).

  2. (ii)

    If P is a (qm)-polymatroid, then so is the ordered pair \((E,\rho ^*)\).

Proof

  1. (i)

    It suffices to observe that \(\rho (\{\mathbf {0}\})=0\) and \((\rho ^*)^*=\rho \).

  2. (ii)

    This is [19, Proposition 5].

\(\square \)

An immediate consequence of part (ii) of Proposition 2 is that a (qm)-polymatroid is a (qm)-demi-polymatroid. If \(P= (E,\rho )\) and \(\rho ^*\) are as in Proposition 2(i), then \((E,\rho ^*)\) is denoted by \(P^*\) and called the dual of P. Note that

$$\begin{aligned} {\mathrm{rank}}P^* = \rho ^*(E)=\rho (\{\mathbf {0}\})+m\dim E-\rho (E)=mn-{\mathrm{rank}}P \quad \text {and}\quad (P^*)^*=P. \end{aligned}$$

Remark 3

As Shiromoto [19] remarks, a (qm)-polymatroid is a q-analogue of k-polymatroids, and a (q, 1)-matroid is a q-analogue of matroids. An alternative approach to (qm)-polymatroids is provided by Gorla, Jurrius, Lopez, and Ravagnani [10, Definition 4.1.].

Definition 4

Let \(P= (E,\rho )\) be a (qm)-demi-polymatroid. The nullity function of P is the map \(\nu : \Sigma (E)\rightarrow {\mathbb {N}}_0\) defined by

$$\begin{aligned} {\nu }(X)=m\dim X - \rho (X) \quad \text {for } X\in \Sigma (E). \end{aligned}$$

The conullity function of P is the map \(\nu ^*: \Sigma (E)\rightarrow {\mathbb {N}}_0\) defined by

$$\begin{aligned} {\nu }^*(X)=m\dim X -\rho ^*(X)= \rho (E)-\rho (X^{\perp }) \quad \text {for } X\in \Sigma (E). \end{aligned}$$

Proposition 5

Let \(P= (E, \rho )\) be a (qm)-demi-polymatroid and let \(X,Y \in \Sigma (E)\) with \(X\subseteq Y\). Then:

  1. (a)

    \({\nu }(X) \le {\nu }(Y)\) and \(\, {\nu }^*(X) \le {\nu }^*(Y)\);

  2. (b)

    \({\nu }(Y)-{\nu }(X) \le m(\dim Y - \dim X)\) and \(\, {\nu }^*(Y)-{\nu }^*(X) \le m(\dim Y - \dim X)\).

Proof

  1. (a)

    Since \(\rho ^*\) satisfies (R2), thanks to (R4), and since \(Y^\perp \subseteq X^\perp \), we see that \(\rho ^*(Y^\perp ) \le \rho ^*(X^\perp )\), which shows that \(\rho (Y) + m \dim Y^\perp \le \rho (X) + m \dim X^\perp \). Subtracting from \(mn =m\dim E\), we find \({\nu }(X) \le {\nu }(Y)\). Similarly, \(\, {\nu }^*(X) \le {\nu }^*(Y)\).

  2. (b)

    The desired upper bound for \({\nu }(Y)-{\nu }(X)\) follows from noting that by (R2),

$$\begin{aligned} {\nu }(Y)-{\nu }(X) = m\left( \dim Y - \dim X \right) + \rho (X) - \rho (Y) \le m\left( \dim Y - \dim X \right) . \end{aligned}$$

As in (a), the inequality for \(\nu ^*\) follows from using \(P^*\) in place of P. \(\square \)

Proposition 6

Let \(P=(E, \rho )\) be a (qm)-demi-polymatroid. If \(\nu \) and \(\nu ^*\) denote, as usual, the nullity and conullity functions of P, then both \((E, \nu )\) and \((E, \nu ^*)\) are (qm)-demi-polymatroids, which are, in fact, duals of each other.

Proof

Recall that

$$\begin{aligned} {\nu }(X)=m\dim X - \rho (X) \quad \text {and} \quad {\nu }^*(X)=m\dim X -\rho ^*(X)= \rho (E)-\rho (X^{\perp }) \end{aligned}$$

for any \(X\in \Sigma (E)\). Note, in particular, that \(\nu (\{\mathbf {0}\})=0 = \nu ^*(\{\mathbf {0}\})\), and so Proposition 5 implies that both \(\nu \) and \(\nu ^*\) satisfy (R1) and (R2). The dual of \(\nu \) in the sense of (R4) is the function that associates to every \(X\in \Sigma (E)\) the integer

$$\begin{aligned} \nu (X^{\perp })+m\dim X-\nu (E) = \big ( m\dim X^{\perp }- \rho (X^{\perp })\big ) +m\dim X -\big ( mn - \rho (E) \big ), \end{aligned}$$

which is easily seen to be \({\nu }^*(X)\). Thus the two possible meanings of \(\nu ^*\) coincide. Hence, by Proposition 5, \((E, \nu )\) satisfies (R4) as well. Furthermore, it is readily seen that \((\nu ^*)^*=\nu \), and so Proposition 5 also shows that \((E, \nu ^*)\) satisfies (R4). Thus, both \((E, \nu )\) and \((E, \nu ^*)\) are (qm)-demi-polymatroids dual to each other. \(\square \)

We remark that even if \(P=(E, \rho )\) is a (qm)-polymatroid, the associated pairs \((E, \nu )\) and \((E, \nu ^*)\) need not be (qm)-polymatroids. This can be seen, for example, using the following important class of (qm)-polymatroids.

Example 7

Let r be an integer satisfying \(0\le r \le n\). The uniform (q, m)-polymatroid U(rn) is defined as \((E,\rho )\), where \(E={\mathbb {F}}_q^n\), and \(\rho (X)=m\dim X\) for all \(X\in \Sigma (E)\) with \(\dim X \le r\), while \(\rho (X)=mr\) for all \(X\in \Sigma (E)\) with \(\dim X \ge r\). It is easy to see that U(rn) is indeed a (qm)-polymatroid and also that \(U(r,n)^*=U(n-r,n).\)

Remark 8

Unlike in the case of usual (demi-)matroids, there is no “discrete intermediate value theorem” saying that every integer value between 0 and \(\rho (E)\) is attained as the conullity of some subspace of E. Consider the uniform (qm)-polymatroid U(1, 2). Then

$$\begin{aligned} \rho (X) = {\left\{ \begin{array}{ll} 0 &{}\quad \text {if } X= \{\mathbf {0}\}, \\ m &{}\quad \text {if } X \ne \{\mathbf {0}\} \end{array}\right. } \quad \text {and} \quad \nu (X) = \nu ^*(X) = {\left\{ \begin{array}{ll} 0 &{}\quad \text {if } X \ne E, \\ m &{}\quad \text {if } X = E. \end{array}\right. } \end{aligned}$$

Thus, a “discrete intermediate value theorem” does not hold for \(\nu \) as well as for \(\nu ^*\) if \(m>1\). Furthermore, if XY are distinct 1-dimensional subspaces of \(E= {\mathbb F}_q^2\), then \(X+Y = E\) and \(X\cap Y=\{\mathbf {0}\} \), and hence

$$\begin{aligned} \nu (X+Y) + \nu (X\cap Y) = m \not \le 0 = \nu (X) + \nu (Y). \end{aligned}$$

It follows that neither \((E, \nu )\) nor \((E, \nu ^*)\) is a (qm)-polymatroid.

This remark proves in particular:

Proposition 9

There are (qm)-demi-polymatroids that are not (qm)-polymatroids.

3 Wei duality of (qm)-demi-polymatroids

The following definition for the generalized weights of a (qm)-demi-polymatroid appears to be natural.

Definition 10

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid and let \(K= {\mathrm{rank}}P\). For \(r=1,\dots ,K\), the rth generalized weight of P is defined by

$$\begin{aligned} d_r(P)=\min \{\dim X : X\in \Sigma (E) \text { with } {\nu }^*(X) \ge r \}. \end{aligned}$$

We will now establish some basic properties of these generalized weights.

Proposition 11

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid. Then

$$\begin{aligned} 1\le d_r(P) \le d_{r+1}(P) \le n \quad \text {for } 1\le r < {\mathrm{rank}}P. \end{aligned}$$

Proof

Since \({\nu }^*(\{\mathbf {0}\})=0\), it is clear that \(1\le d_r(P) \le n\) for \(1\le r\le {\mathrm{rank}}P\). Next, if \(1\le r < {\mathrm{rank}}P\) and if \(d_{r+1}(P) = \dim Y\) for some \(Y\in \Sigma (E)\) with \(\nu ^*(Y)\ge r+1\), then \(\nu ^*(Y) \ge r\), and so by definition, \(d_r(P) \le \dim Y = d_{r+1}(P)\). \(\square \)

Unlike the generalized Hamming weights of linear codes, strict monotonicity may not hold for generalized weights of (qm)-demi-polymatroids, i.e., we may not have \(d_r(P) < d_{r+1}(P)\). For example, if \(K = {\mathrm{rank}}P>n\), then Proposition 11 implies that \(d_r(P) = d_{r+1}(P)\) for some \(r< K\). However, we will show that \(d_r(P) < d_s(P)\) for \(1\le r < s\le K\), provided \(s-r\ge m\). First, we need some preliminary results.

Lemma 12

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid and let \(K= {\mathrm{rank}}P\). For \(x=0,1, \dots , n\), let \(\, \Sigma _x (E) : = \{ X\in \Sigma (E) : \dim X = x\}\), and let us define

$$\begin{aligned} h(x) := \max \{\nu (X) : X\in \Sigma _x (E) \} \quad \text {and} \quad h^*(x):= \max \{\nu ^*(X) : X\in \Sigma _x (E)\}. \end{aligned}$$

Now fix a positive integer \(x \le n\). Then \(h^*(x-1) \le h^*(x)\) and for \(1\le r\le K\),

$$\begin{aligned} x = d_r(P) \Longleftrightarrow h^*(x-1) < r \le h^*(x) \end{aligned}$$
(1)

In particular, x is a generalized weight of P if and only if \(\, h^*(x-1) < h^*(x)\). Also, \(h(x-1) \le h(x)\) and if \(P^*\) is the dual of P, then for \(1\le s \le {\mathrm{rank}}P^*=mn-K\),

$$\begin{aligned} x = d_s(P^*) \Longleftrightarrow h(x-1) < s \le h(x) \end{aligned}$$
(2)

In particular, x is a generalized weight of \(P^*\) if and only if \(\, h(x-1) < h(x)\).

Proof

Let \(x\in {\mathbb {N}}_0\) with \(1\le x \le n\). If \(X\in \Sigma (E)\) is such that \(\dim X = x-1\) and \(h^*(x-1) = \nu ^*(X)\), then by taking \(Y\in \Sigma (E)\) with \(\dim Y = x\) and \(X \subset Y\), we see from Proposition 5(a) that \(\nu ^*(X) \le \nu ^*(Y) \le h^*(x)\). Thus, \(h^*(x-1) \le h^*(x)\). Similarly, \(h(x-1) \le h(x)\). Now let \(r\in {\mathbb {N}}_0\) with \(1\le r\le K\).

First, suppose \(x=d_r(P)\). Then \(x = \dim Y\) for some \(Y\in \Sigma (E)\) with \(\nu ^*(Y) \ge r\). This implies that \(h^*(x) \ge r\). Moreover, since \(x=d_r(P)\), we see that \(\nu ^*(X) < r\) for every \(X\in \Sigma (E)\) with \(\dim X = x-1\). This implies that \(h^*(x-1) < r\).

Conversely, suppose \(h^*(x-1) < r \le h^*(x)\). Choose \(Y\in \Sigma (E)\) with \(\dim Y = x\) such that \(h^*(x) = \nu ^*(Y)\). Then \(\nu ^*(Y) = h^*(x) \ge r\) and so \(d_r(P)\le x\). Suppose, if possible, \(d_r(P)\le x-1\). Then there is \(Z\in \Sigma (E)\) with \(\dim Z = d_r(P) \le x-1\) and \(\nu ^*(Z) \ge r\). Enlarge Z to a subspace X of E such that \(\dim X = x-1\). In view of Proposition 5(a), we obtain \(h^*(x-1) \ge \nu ^*(X) \ge \nu ^*(Z) \ge r \), which contradicts the assumption \(h^*(x-1) < r \). This shows that \(x=d_r(P)\). Thus (1) is proved.

The equivalence (2) follows by applying (1) to \(P^*\) in place of P. \(\square \)

Here is a nice relation between the functions h and \(h^*\) defined in Lemma 12.

Lemma 13

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid and let \(K= {\mathrm{rank}}P\). Then

$$\begin{aligned} h^*(x) = h(n-x) - m (n-x) + K \quad \text {for } x=0,1, \dots , n. \end{aligned}$$
(3)

Consequently,

$$\begin{aligned} h(n+1-x) - h(n-x) = m - \left( h^*(x) - h^*(x-1) \right) \quad \text {for } x=1, \dots , n. \end{aligned}$$
(4)

In particular, \(0 \le h^*(x) - h^*(x-1) \le m\) for \(x=1, \dots , n\).

Proof

Given any \(X\in \Sigma (E)\), note that \(\nu (X^\perp ) = m \dim X^\perp - \rho (X^\perp )\), and hence \(\nu (X^\perp ) + m \dim X = mn - \rho (X^\perp ) = mn - \left( \rho (E) - \nu ^*(X) \right) \). It follows that

$$\begin{aligned} \nu ^*(X) = \nu (X^\perp ) - m (n - \dim X) + K. \end{aligned}$$

Taking maximum as X varies over elements of \(\Sigma (E)\) with \(\dim X = x\), we obtain (3). Now (3) implies that \(h^*(x) - h^*(x-1) = h(n-x) - h(n+1-x) + m\) for \(x=1, \dots , n\), and this yields (4). Further, since \(h^*(x-1) \le h^*(x)\) and \(h(n-x) \le h(n+1-x) \), thanks to Lemma 12, we also obtain \(0 \le h^*(x) - h^*(x-1) \le m\) for \(x=1, \dots , n\). \(\square \)

Corollary 14

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid and let \(K= {\mathrm{rank}}P\). Then for any positive integers rs such that \(r+m \le K\) and \(s+m \le mn-K\),

$$\begin{aligned} d_r(P)< d_{r+m}(P) \quad \text {and} \quad d_s(P^*) < d_{s+m}(P^*). \end{aligned}$$

Proof

Let r be a positive integer with \(r+m \le K\). Then \(d_r(P) \le d_{r+m}(P)\), by Proposition 11. Suppose, if possible, \(d_r(P) = d_{r+m}(P) = x\), say. Then by (1) in Lemma 12, \(h^*(x-1) < r\) and \(h^*(x)\ge r+m\). Consequently, \(h^*(x) - h^*(x-1) \ge m+1\). This contradicts the last assertion in Lemma 13. Thus \(d_r(P) < d_{r+m}(P)\). Replacing P by \(P^*\), we obtain the desired inequality for the generalized weights of \(P^*\). \(\square \)

We shall now proceed to establish a version of Wei duality for the generalized weights of (qm)-demi-polymatroids. Recall that if C is a \([n,k]_q\)-code, and \(d_1, \dots , d_k\) are the generalized Hamming weights (GHW) of C and \(d_1^\perp , \dots , d_{n-k}^\perp \) are the GHW of the dual of C, then Wei duality states that the values

$$\begin{aligned} n+1 - d_1, \dots , n+1-d_k \quad \text {and} \quad d_1^\perp , \dots , d_{n-k}^\perp \end{aligned}$$

are all distinct and their union is precisely the set \(\{1, \dots , n\}\). In the setting of a polymatroid \(P=(E, \rho )\) of rank K, we can similarly consider

$$\begin{aligned} n+1 - d_1(P), \dots , n+1-d_K(P) \quad \text {and} \quad d_1(P^*), \dots , d_{mn-K}(P^*). \end{aligned}$$

But these mn values would not constitute \(\{1, \dots , mn\}\) when \(m\ge 2\), since they lie between 1 and n. But one could ask for some “m-fold” version of Wei duality, and that is what we give in Theorems 15 and 17 below. These results are inspired by the related results of Ravagnani [18] and also of Martínez-Peñas and Matsumoto [15] about the generalized weights and the relative generalized weights of Delsarte rank metric codes.

Theorem 15

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid of rank K. Also, let pij be integers such that \(1\le p+im \le mn-K\) and \(1 \le p+K+jm \le K.\) Then

$$\begin{aligned} d_{p+im}(P^*) \ne n+1-d_{p+K+jm}(P). \end{aligned}$$

Proof

Write \(r= p+K+jm\), \(s= p+im\), and \(x=d_r(P)\). Let h and \(h^*\) be as in Lemma 12. In view of (4), let

$$\begin{aligned} g = h(n+1-x) - h(n-x) = m - \left( h^*(x) - h^*(x-1) \right) . \end{aligned}$$

Then using (1), we see that

$$\begin{aligned} r \le h^*(x) \quad \text {and} \quad r + m - g = h^*(x) + \left( r - h^*(x-1)\right) > h^*(x). \end{aligned}$$

Thus \(r \le h^*(x) < r+m-g\), and therefore by (3), we obtain

$$\begin{aligned} p+ m(j+n-x) = r + m(n-x) - K \le h(n-x) < r+ m(n-x+1) -g -K. \end{aligned}$$

The second inequality above implies that

$$\begin{aligned} h(n+1-x) = h(n-x) + g < r+ m(n-x+1) -K = p+ m(j+n - x+1). \end{aligned}$$

Now suppose, if possible, \(n+1 -x = d_s(P^*)\). Then by (2), \(h(n-x) < s \le h(n+1-x)\). Combining this with the inequalities obtained earlier, we see that

$$\begin{aligned} p+ m(j+n-x)< s < p+ m(j+n-x)+m. \end{aligned}$$

But this contradicts the fact that \(s\equiv p\!\pmod m\). \(\square \)

Definition 16

For any (qm)-demi-polymatroid P and \(s\in {\mathbb {N}}_0\) with \(s< m\), define

$$\begin{aligned}&W_s(P) = \{ d_r(P) : r=1, \dots , {\mathrm{rank}}P \text { and } r \equiv s \, (\mathrm {mod} \ m) \}, \text { and } \\&{\overline{W}}_s(P) = \{n+1- d_r(P) : r=1, \dots , {\mathrm{rank}}P \text { and } r \equiv s \, (\mathrm {mod} \ m)\}. \end{aligned}$$

The following result may be viewed as a version of Wei duality for generalized weights of (qm)-demi-polymatroids. See Remark 18 for further explanation.

Theorem 17

Let \(P=(E,\rho )\) be a (qm)-demi-polymatroid of rank K and let \(s \in {{\mathbb {N}}_0}\) with \(s < m\). Denote by \(s+^m K\) the unique integer in \(\{0,1,\dots ,m-1\}\) congruent to \(s+K\) modulo m. Then \( W_s(P^*)=\{1,2,\cdots ,n\} \setminus {\overline{W}}_{s+^m K}(P). \)

Proof

By Theorem 15, the sets \(W_s(P^*)\) and \({\overline{W}}_{s+^m K}(P)\) are disjoint, and by Proposition 11, they are subsets of \(\{1,2,\cdots ,n\}\). Thus, it suffices to show that the sum of their cardinalities is n. To this end, write \(s+K = Am + B\) for integers AB with \(0\le B < m\). Note that \(s+^m K = B\). Let us first consider the case \(s=0\). Here, by the definition of \(W_s(P^*)\), and the strict monotonicity, guaranteed by Corollary 14, of the \(d_{s+jm}(P^*)\) as j increases, we see that

$$\begin{aligned} |W_s(P^*)| = \left\lfloor \frac{mn-K}{m}\right\rfloor = \left\lfloor \frac{mn-Am -B}{m}\right\rfloor = {\left\{ \begin{array}{ll} n-A &{} \text {if } B=0, \\ n - A - 1 &{} \text {if } B\ge 1. \end{array}\right. } \end{aligned}$$

On the other hand, Corollary 14 also shows that

$$\begin{aligned} |{\overline{W}}_B(P)| = |W_B(P)|= {\left\{ \begin{array}{ll} \left\lfloor \frac{K}{m}\right\rfloor = A &{} \text {if } B=0, \\ 1 + \left\lfloor \frac{K-B}{m}\right\rfloor = 1+A &{} \text {if } B\ge 1. \end{array}\right. } \end{aligned}$$

Consequently, \(|W_s(P^*)| + | {\overline{W}}_{s+^m K}(P)| = n\). Next, suppose \(s>0\). Here, in a similar manner, Corollary 14 shows that

$$\begin{aligned} |W_s(P^*)| = 1+ \left\lfloor \frac{mn-K-s}{m}\right\rfloor = 1+ \left\lfloor \frac{mn-Am -B}{m}\right\rfloor = {\left\{ \begin{array}{ll} 1+n-A &{} \text {if } B=0, \\ n - A &{} \text {if } B\ge 1 \end{array}\right. } \end{aligned}$$

and also that

$$\begin{aligned} |{\overline{W}}_B(P)| = |W_B(P)| = {\left\{ \begin{array}{ll} \left\lfloor \frac{K-B}{m}\right\rfloor = \left\lfloor \frac{Am-s}{m}\right\rfloor = A-1 &{} \text {if } B=0, \\ 1 + \left\lfloor \frac{K-B}{m}\right\rfloor = 1+ \left\lfloor \frac{Am-s}{m}\right\rfloor = A &{} \text {if } B\ge 1. \end{array}\right. } \end{aligned}$$

So, once again \(|W_s(P^*)| + | {\overline{W}}_{s+^m K}(P)| = n\), as desired. \(\square \)

Remark 18

The above result shows that the generalized weights of a (qm)-demi-polymatroid P and the generalized weights of its dual \(P^*\) determine each other. Indeed, first we treat only the \(d_r(P^*)\) and \(d_{r+^mK}(P)\), for \(r \equiv s \pmod m\), for a fixed value of s. By Theorem  17 they determine each other. Since this is true for each fixed s, as s varies in \(\{0,1,\dots ,m-1\}\), the assertion holds.

We remark also that our proofs of Theorem 15 and the two preceding lemmas are motivated by the proofs of the corresponding result for usual matroids (see, e.g., [14, Proposisjon 5.18]). Further, the proof of Theorem 17 uses arguments that are analogous to those in the proof of [18, Corollary 38].

4 Generalized weights of flags of Delsarte rank metric codes

In this section, we will denote by \({\mathbb M}_{m\times n}({\mathbb F}_q)\), or simply by \({\mathbb M}\) the space of all \(m\times n \) matrices with entries in the finite field \({\mathbb F}_q\). Note that \({\mathbb M}\) is a vector space over \({\mathbb F}_q\) of dimension mn. As stated in the Introduction, by a Delsarte rank metric code, or simply a Delsarte code, we mean a \({\mathbb F}_q\)-linear subspace of \({\mathbb M}\). We denote by \(\dim _{{\mathbb F}_q} C\), or simply \(\dim C\), the dimension of a Delsarte code C.

Following Shiromoto [19], we now associate to a Delsarte code C, (i) a family of subcodes of C indexed by subspaces of \(E={\mathbb F}_q^n\), and (ii) a (qm)-polymatroid.

Definition 19

Let C be a Delsarte code.

  1. (i)

    Given any \(X\in \Sigma (E)\), we define C(X) to be the subspace of C consisting of all matrices in C whose row space is contained in X.

  2. (ii)

    By \(\rho ^{ }_C\) we denote the function from \(\Sigma (E)\) to \({\mathbf {N}_0}\) defined by

    $$\begin{aligned} \rho ^{ }_C(X)=\dim _{{\mathbb {F}}_q}C-\dim _{{\mathbb {F}}_q}C(X^{\perp }) \quad \text { for } X \in \Sigma (E). \end{aligned}$$

    Further, by P(C) we denote the (qm)-polymatroid \((E, \rho ^{ }_C)\).

Remark 20

It is shown in [19, Proposition 3] that \(P(C)=(E, \rho ^{ }_C)\) is indeed a (qm)-polymatroid. Note also that the conullity function \(\nu ^*_{C}\) of P(C) is given by

$$\begin{aligned} \nu ^*_C (X) = \dim C(X) \quad \text {for } X \in \Sigma (E). \end{aligned}$$
(5)

4.1 Demi-polymatroids associated to flags of Delsarte codes

Motivated by the work in [3, 4] on demi-matroids, we consider the following natural and useful extension of the notion defined in part (ii) of Definition 19.

Definition 21

By a flag of Delsarte codes we shall mean a tuple \(\mathsf {F} = (C_1, \dots , C_s)\) of subspaces of \({\mathbb M}= {\mathbb M}_{m\times n}({\mathbb F}_q)\) such that \(C_s \subseteq C_{s-1} \subseteq \cdots \subseteq C_1\). The rank function associated to a flag \(\mathsf {F} = (C_1, \dots , C_s)\) is the map \(\rho _{_{{\mathsf {F}}}}: \Sigma (E) \rightarrow {\mathbb {Z}}\) given by

$$\begin{aligned} \rho _{_{{\mathsf {F}}}}(X) = \sum _{i=1}^s(-1)^{i+1} \rho ^{ }_{C_i}(X) \quad \text {for } X\in \Sigma (E). \end{aligned}$$
(6)

The pair \((E, \rho _{_{{\mathsf {F}}}})\) is a (qm)-demi-polymatroid, and it is denoted by \(P(\mathsf {F})\).

We will presently show that \(P(\mathsf {F})= (E, \rho _{_{{\mathsf {F}}}})\) is indeed a (qm)-demi-polymatroid for any flag \(\mathsf {F}\) of Delsarte codes. First, we need a couple of auxiliary results.

Lemma 22

Let \(C_1, C_2\) be Delsarte codes in \({\mathbb M}= {\mathbb M}_{m\times n}({\mathbb F}_q)\) such that \(C_2\subseteq C_1\) and let \(\rho _i = \rho ^{ }_{C_i}\) for \(i=1, 2\). Then \(\rho _2(X) \le \rho _1(X)\) for all \(X\in \Sigma (E)\).

Proof

Note that the row space of any \(A\in {\mathbb M}\) consists of vectors \(\mathbf {v}A\) as \(\mathbf {v}\) varies over \({\mathbb F}_q^m\) (elements of \({\mathbb F}_q^m\) and \({\mathbb F}_q^n\) are thought of as row vectors); also note that \((\mathbf {v}A) \cdot \mathbf {u} = \mathbf {u}(\mathbf {v}A)^t = \mathbf {u}(A^t\mathbf {v}^t) \) for any \(\mathbf {u}\in {\mathbb F}_q^n\). Now let \(X\in \Sigma (E)\) and define

$$\begin{aligned} U = \{A \in {\mathbb M}_{m\times n}({\mathbb F}_q): \mathbf {u}A^t = \mathbf {0} \text { for all } \mathbf {u} \in X \}. \end{aligned}$$

Clearly, U is a subspace of \({\mathbb M}\) and \(C(X^\perp ) = C\cap U\) for any Delsarte code C. Also,

$$\begin{aligned} \frac{C_2}{C_2\cap U} \simeq \frac{C_2+U}{U} \subseteq \frac{C_1+U}{U} \simeq \frac{C_1}{C_1\cap U}. \end{aligned}$$

Hence \(\dim C_2 - \dim C_2 \cap U \le \dim C_1 - \dim C_1 \cap U\), which yields \(\rho _2(X) \le \rho _1(X)\). \(\square \)

Lemma 23

Let \(C_1, C_2\) be Delsarte codes in \({\mathbb M}= {\mathbb M}_{m\times n}({\mathbb F}_q)\) such that \(C_2\subseteq C_1\) and let \(X, Y\in \Sigma (E)\) be such that \(X\subseteq Y\). Then

$$\begin{aligned} \dim C_1(X) - \dim C_2(X) \le \dim C_1(Y) - \dim C_2(Y). \end{aligned}$$

Proof

Since \(C_2\subseteq C_1\) and \(X\subseteq Y\), it is clear from Definition 19 (i) that

$$\begin{aligned} C_1(X)\cap C_2(Y) = C_2(X) \quad \text {and} \quad C_1(X)+C_2(Y) \subseteq C_1(Y). \end{aligned}$$

Consequently, \(\dim C_1(X) + \dim C_2(Y)- \dim C_2(X) \le \dim C_1(Y)\), as desired. \(\square \)

Theorem 24

Let \(\mathsf {F} = (C_1, \dots , C_s)\) be a flag of Delsarte codes in \({\mathbb M}\) and let \(\rho _{_{{\mathsf {F}}}}\) be the rank function associated to \(\mathsf {F}\). Then \(P(\mathsf {F})=(E,\rho _{_{{\mathsf {F}}}})\) is a (qm)-demi-polymatroid.

Proof

Let \(\rho _j :=\rho ^{ }_{C_j}\) for \(1\le j \le s\). First, suppose s is even, say \(s=2t\). Then for any \(X\in \Sigma (E)\),

$$\begin{aligned} \rho _{_{{\mathsf {F}}}}(X) = \sum _{i=1}^t \big ( \rho ^{ }_{2i-1}(X) - \rho ^{ }_{2i}(X)\big ). \end{aligned}$$
(7)

By Lemma 22, each summand is nonnegative, and so \(\rho _{_{{\mathsf {F}}}}(X) \ge 0\). In case \(s=2t+1\),

$$\begin{aligned} \rho _{_{{\mathsf {F}}}}(X) = \rho ^{ }_{2t+1}(X) + \sum _{i=1}^t\big ( \rho ^{ }_{2i-1}(X) - \rho ^{ }_{2i}(X)\big ). \end{aligned}$$
(8)

and once again \(\rho _{_{{\mathsf {F}}}}(X) \ge 0\), thanks to Remark 20 and Lemma 22. Next, if \(s>1\) and if \(\mathsf {F}' =(C_2, \dots , C_s)\) denotes the flag obtained from \(\mathsf {F}\) by dropping the first term, then by what is just shown \(\rho _{_{\mathsf {F}'}}(X) \ge 0\) for any \(X\in \Sigma (E)\). Hence,

$$\begin{aligned} \rho _{_{{\mathsf {F}}}}(X) = \rho ^{ }_1(X) - \rho _{_{\mathsf {F}'}}(X) \le \rho ^{ }_1(X) \le m \dim X \quad \text {for all } X\in \Sigma (E). \end{aligned}$$

This shows that \(P(\mathsf {F})\) satisfies (R1). Next, let \(X, Y\in \Sigma (E)\) with \(X \subseteq Y\). We will show that \(\rho _{_{{\mathsf {F}}}}(X) \le \rho _{_{{\mathsf {F}}}}(Y)\). To this end, observe that since \(\rho _{_{{\mathsf {F}}}}(X)\) (and likewise \(\rho _{_{{\mathsf {F}}}}(Y)\)) can be expressed as in (7) or (8), and since \(\rho ^{ }_{2t+1}\) satisfies (R2), it suffices to show that the difference \( \Delta _i:= \big ( \rho _{2i-1}(Y) - \rho _{2i}(Y) \big ) - \big ( \rho _{2i-1}(X) - \rho _{2i}(X) \big ) \) is nonnegative for each \(i=1, \dots , t\). But an easy calculation shows that for \(1\le i \le t\),

$$\begin{aligned} \Delta _i = \big ( \dim C_{2i-1}(X^{\perp })-\dim C_{2i}(X^{\perp }) \big )- \big (\dim C_{2i-1}(Y^{\perp })-\dim C_{2i}(Y^{\perp }) \big ), \end{aligned}$$

and by Lemma 23, this is nonnegative since \(Y^\perp \subseteq X^\perp \). Thus \(P(\mathsf {F})\) satisfies (R2).

To prove that \(P(\mathsf {F})\) satisfies (R4), note that the case \(s=1\) is trivial. Thus suppose \(s>1\) and let \(\mathsf {F}' =(C_2, \dots , C_s)\). Also, let

$$\begin{aligned} \rho ^*(X)= \rho _{_{{\mathsf {F}}}}(X^{\perp })+m\dim X-\rho _{_{{\mathsf {F}}}}(E) \quad \text {and}\quad \rho '(X) = \rho _{_{\mathsf {F}'}}(X) \quad \text {for } X\in \Sigma (E). \end{aligned}$$

Since \(\rho _{_{{\mathsf {F}}}}= \rho ^{ }_1 - \rho '\) and since \(\rho ^{*}_1\) satisfies (R1) while \(\rho '\) satisfies (R2), we see that

$$\begin{aligned} \rho ^*(X)= \big ( \rho _1(X^{\perp })+m\dim X -\rho _1(E) \big ) +\big ( \rho '(E)-\rho '(X^{\perp })\big ) \ge \rho _1^*(X) +0 \ge 0. \end{aligned}$$

Also, \(\rho ^*(X)= m\dim X+\big ( \rho _{_{{\mathsf {F}}}}(X^{\perp })-\rho _{_{{\mathsf {F}}}}(E) \big ) \le m\dim X\), since \(\rho _{_{{\mathsf {F}}}}\) satisfies (R2). Thus \(\rho ^*\) satisfies (R1). Finally, if \(X, Y\in \Sigma (E)\) with \(X \subseteq Y\), then we can write \(\rho ^*(Y)-\rho ^*(X) = \big (\rho _{_{{\mathsf {F}}}}(Y^{\perp })+m\dim Y - \rho _{_{{\mathsf {F}}}}(E)\big )- \big (\rho _{_{{\mathsf {F}}}}(X^{\perp })+m\dim X - \rho _{_{{\mathsf {F}}}}(E)\big )\) as

$$\begin{aligned}&m\big (\dim Y -\dim X\big )+\big (\rho _{_{{\mathsf {F}}}}(Y^{\perp })-\rho _{_{{\mathsf {F}}}}(X^{\perp })\big ) \\= & {} m\big (\dim X^{\perp }-\dim Y^{\perp })-\big (\rho ^{ }_1 (X^{\perp })-\ \rho ^{ }_1 (Y^{\perp }) \big ) +\big (\rho '(X^{\perp })-\rho '(Y^{\perp })\big ) \\= & {} \big ( \nu _1(X^{\perp })-\nu _1(Y^{\perp }) \big ) +\big (\rho '(X^{\perp })-\rho '(Y^{\perp }) \big ), \end{aligned}$$

where \(\nu _1\) denotes the nullity function of \((E, \rho ^{ }_1 )\). Thus, using Proposition 6 and the fact that \(\rho '\) satisfies (R2), we see that \(\rho ^*\) satisfies (R4). \(\square \)

4.2 Generalized weights of flags of Delsarte codes

Using Theorem 24 and Definition 10, we can talk about generalized weights of flags of Delsarte codes. The following observation makes them explicit.

Lemma 25

Let \(\mathsf {F} = (C_1, \dots , C_s)\) be a flag of Delsarte codes. Then the conullity function \(\nu ^*_{_{\mathsf {F} }}\) of the associated (qm)-demi-polymatroid \(P(\mathsf {F})=(E,\rho _{_{{\mathsf {F}}}})\) is given by

$$\begin{aligned} \nu ^*_{_{\mathsf {F} }}(X) = \sum _{i=1}^s(-1)^{i+1}\dim C_i(X) \quad \text {for } X\in \Sigma (E). \end{aligned}$$

Proof

For \(i=1, \dots , s\), let \(\rho ^{ }_i\) be as in (6) and let \(\nu ^*_i\) be the conullity function of the (qm)-polymatroid \((E, \rho ^{ }_i)\). Then in view of (5) in Remark 20 we see that

$$\begin{aligned} \nu ^*_{_{\mathsf {F} }}(X) = \rho _{_{{\mathsf {F}}}}(E) - \rho _{_{{\mathsf {F}}}}(X^\perp ) = \sum _{i=1}^s(-1)^{i+1}\nu ^*_i(X) = \sum _{i=1}^s(-1)^{i+1}\dim C_i(X). \end{aligned}$$

for any \(X\in \Sigma (E)\). \(\square \)

The generalized weights of flags of Delsarte codes may be defined as follows.

Definition 26

Let \(\mathsf {F} = (C_1, \dots , C_s)\) be a flag of Delsarte codes in \({\mathbb M}\), and let \(K = \rho _{_{{\mathsf {F}}}}(E) = \sum _{i=1}^s(-1)^{i+1}\dim C_i\). Then for \(r=1, \dots , K\), the rth generalized weight of \(\mathsf {F}\) is denoted by \(d_r(\mathsf {F})\) or by \(d_{{\mathbb M},r}(C_1,\cdots ,C_s)\), and is defined by

$$\begin{aligned} d_r(\mathsf {F}) = \min \big \{\! \dim X : X\in \Sigma (E) \text { with } \sum _{i=1}^s(-1)^{i+1}\dim C_i(X) \ge r \big \}. \end{aligned}$$

In the case of singleton flags, i.e., when \(s=1\), the definition reduces to the following notion, first considered by Martínez-Peñas and Matsumoto [15, Definition 10], of the generalized weight of a Delsarte code C:

$$\begin{aligned} d_r(C) := \min \{ \dim X : X\in \Sigma (E) \text { with } \dim C (X) \ge r\} \quad \text {for } r=1, \dots , \dim C. \end{aligned}$$
(9)

This is related to, but distinct from Ravagnani’s definition (see Sect. 4.5 for details). In the case \(s=2\), generalized weights in Definition 26 coincide with the notion of Relative Generalized Matrix Weights, or RGMW profiles, as defined by Martínez-Peñas and Matsumoto [15, Definition 10].

Our definitions of generalized weights for (qm)-demi-polymatroids and flags of Delsarte rank metric codes are of course compatible, and we record this below.

Theorem 27

Let \(\mathsf {F}=(C_1,\cdots ,C_s)\) be a flag of Delsarte rank metric code and let \(P(\mathsf {F}) = (E, \rho _{_{{\mathsf {F}}}})\) be the corresponding (qm)-demi-polymatroid. Then

$$\begin{aligned} \sum _{i=1}^{s}(-1)^{i+1}\dim C_i = {\mathrm{rank}}P(\mathsf {F}) \quad \text {and for } r=1, \dots , {\mathrm{rank}}P(\mathsf {F}), \quad d_r(\mathsf {F})=d_r(P(\mathsf {F})). \end{aligned}$$

Proof

This follows directly from the definitions and Lemma 25. \(\square \)

4.3 Duality of Delsarte rank metric codes

As indicated in the Introduction, the notion of dual for Delsarte rank metric codes is defined using the trace product. See for example [18, Definition 34]. We recall the basic definition below.

Definition 28

Let C be a Delsarte code. The trace dual, or simply the dual, of C is the Delsarte code \(C^{\perp }\) defined by

$$\begin{aligned} C^\perp = \{ N \in {\mathbb M}_{m\times n}({\mathbb F}_q): \mathrm {Trace}(MN^t) =0 \text { for all } M \in C\}, \end{aligned}$$

where \(N^t\) denotes the transpose of a \(m\times n\) matrix N and, as usual, \(\mathrm {Trace}(MN^t)\) is the trace of the square matrix \(MN^t\), i.e., the sum of all its diagonal entries.

There is a natural connection between duals of Delsarte codes and the duals of (qm)-polymatroids. It is shown by Shiromoto [19] as well as Gorla et al. [10], and we record it below.

Theorem 29

[19, Proposition 11] Let C be a Delsarte code. Then

$$\begin{aligned} P(C^{\perp })=P(C)^*. \end{aligned}$$

The proof is quite short and natural and given in [19, Proposition 11], and also in [10, Theorem 8.1]. An immediate consequence is the following.

Corollary 30

Let C be a Delsarte code in \({\mathbb M}_{m\times n}({\mathbb F}_q)\) and let \(K=\dim C\). Then the generalized  weights \( d_r(C) =\min \{\dim X : X \in \Sigma (E) \text { with } \dim C(X) \ge r\} \) of C (\(1\le r \le K\)) are related to the generalized weights \(d_s(C^\perp )\) of \(C^{\perp }\) (\(1\le s \le mn - K\)) via the “m-fold” Wei duality described in Theorem 17.

Proof

Follows from Theorems 1727, and 29. \(\square \)

We remark that Corollary 30 gives another proof of [15, Proposition 65].

4.4 Duality for flags of Delsarte rank metric codes

Now that we have associated a (qm)-demi-polymatroid \(P(\mathsf {F})=(E,\rho _{_{{\mathsf {F}}}})\) to a flag \(\mathsf {F}\) of Delsarte codes, it seems natural to ask whether \(P(\mathsf {F})^*\) is also a (qm)-demi-polymatroid associated to some flag of Delsarte codes. The answer is yes, and it involves, quite naturally, a dual flag.

Definition 31

By the dual flag corresponding to a flag \(\mathsf {F} = (C_1, \dots , C_s)\) of Delsarte codes, we mean the flag \(\mathsf {F}^{\perp } = (C_s^\perp , \dots , C_1^\perp )\) of Delsarte codes, where \(C_i^\perp \) is the trace dual of \(C_i\) for \(i=1, \dots , s\). Note that \(C_1^{\perp } \subseteq \cdots \subseteq C_s^{\perp }\) so that \(\mathsf {F}^\perp \) is indeed a flag in the sense of Definition 21. Note also that \((\mathsf {F}^{\perp })^{\perp }=\mathsf {F}.\)

The following result is an analogue of [3, Theorem 10].

Proposition 32

Let \(\mathsf {F}= (C_1, \dots , C_s)\) be a flag of Delsarte codes and \(\mathsf {F}^\perp \) the dual flag corresponding to \(\mathsf {F}\). Also let \(\nu ^*_{_{\mathsf {F} }}\) denote the conullity function of the (qm)-demi-polymatroid \(P(\mathsf {F})=(E,\rho _{_{{\mathsf {F}}}})\) associated to \(\mathsf {F}\). Then

$$\begin{aligned} \rho _{_{\mathsf {F}^\perp }}= {\left\{ \begin{array}{ll} \rho _{_{{\mathsf {F}}}}^* &{} \text {if } s \text { is odd}, \\ \nu ^*_{_{\mathsf {F} }}&{} \text {if } s \text { is even}. \end{array}\right. } \end{aligned}$$

Proof

A proof can be given, following word for word the proof of the corresponding result, [3, Theorem 10], for linear block codes. \(\square \)

Proposition 32 identifies the dual (qm)-demi-polymatroid of \(P(\mathsf {F})\) as that associated to the dual flag, when \(\mathsf {F}\) is a flag of odd length s. This includes the case \(s=1\) corresponding to Theorem 29. But what if s is even (and in particular, \(s=2\))? Also what about a version of Wei duality for the generalized weights of flags of Delsarte codes? These questions are answered below.

Theorem 33

Let \(\mathsf {F}= (C_1, \dots , C_s)\) be a flag of Delsarte codes and let \(\mathsf {G} = (C_1, \dots , C_s, \{\mathbf {0}\} )\) denote the flag of length \(s+1\) obtained by appending to \(\mathsf {F}\) the zero subspace to \(\mathsf {F}\) (regardless of whether or not \(C_s = \{\mathbf {0}\}\)). Then:

  1. (a)

    If s is odd, then \(P(\mathsf {F})^*=P(\mathsf {F}^{\perp })\), and the generalized weights of \(\mathsf {F}\) and \(\mathsf {F}^{\perp }\) are in Wei duality with each other as described in Theorem 17.

  2. (b)

    If s is even, then \(P(\mathsf {F})^*=P(\mathsf {G}^{\perp })\), and the generalized weights of \(\mathsf {F}\) and \(\mathsf {G}^{\perp }\) are in Wei duality with each other as described in Theorem 17.

Proof

Part (a) follows from Theorems 1724, and 27 together with Proposition 32. Part (b) follows from part (a) by noting that \(\rho _{_{\mathsf {G}}}=\rho _{_{{\mathsf {F}}}}\). \(\square \)

Corollary 34

Let \(C_1, C_2\) be distinct Delsarte codes in \({\mathbb M}_{m\times n}({\mathbb F}_q)\) with \(C_2\subseteq C_1\), and let \(K=\dim C_1-\dim C_2\). Then the relative generalized  weights

$$\begin{aligned} d_r =\min \{\dim X : X \in \Sigma (E) \text { with } \dim C_1(X) - \dim C_2(X) \ge r\} \end{aligned}$$

are related to the relative generalized weights

$$\begin{aligned} d_r^{\perp } =\min \{\dim X : X \in \Sigma (E) \text { with } \dim {\mathbb M}(X) - \dim C_2^{\perp }(X)+\dim C_1^{\perp }(X) \ge r\} \end{aligned}$$

via the “m-fold” Wei duality described in Theorem 17, for \(r=1, \dots , K\).

Proof

If s is even and \(\mathsf {F}= (C_1, \dots , C_s)\) and \(\mathsf {G}\) are as in Theorem 33, then

$$\begin{aligned} \rho _{_{{\mathsf {F}}}}^*=\rho _{_{\mathsf {G}}}^*=\rho _{_{\mathsf {G}^\perp }} = {\rho _{_{\{0\}^\perp }}} - {\rho _{_{C_{s}^\perp }}} + \cdots + (-1)^s {\rho _{_{C_{1}^\perp }}} = {\rho _{_{{\mathbb M}}}} - {\rho _{_{C_{s}^\perp }}} + \cdots + {\rho _{_{C_{1}^\perp }}} . \end{aligned}$$

In particular, if \(s=2\), then \( \rho _{_{{\mathsf {F}}}}^* = {\rho _{_{{\mathbb M}}}} - {\rho _{_{C_{2}^\perp }}} + {\rho _{_{C_{1}^\perp }}}. \) Thus, the desired result follows from Theorem 33 in view of Eq. (5) in Remark 20. \(\square \)

4.5 Another definition of generalized weights

Ravagnani has given another definition in [18, Definition 23] of generalized weights of (single) Delsarte codes that is based on the following notion of optimal anticodes.

Definition 35

By an optimal anticode we mean an \({\mathbb {F}}_q\)-linear subspace \({\mathcal {A}}\) of \({\mathbb M}_{m\times n}({\mathbb F}_q)\) such that \(\dim _{{\mathbb {F}}_q} {\mathcal {A}} =m\! \left( \mathrm {maxrank}({\mathcal {A}})\right) \), where \(\mathrm {maxrank}({\mathcal {A}})\) denotes the maximum possible rank of any matrix in \({\mathcal {A}}\).

Here is Ravagnani’s definition of generalized weights of Delsarte codes.

Definition 36

Let C be a Delsarte code of dimension K. For \(r=1, \dots , K\), define

$$\begin{aligned} a_r(C)=\frac{1}{m}\min \left\{ \dim _{{\mathbb {F}}_q}{\mathcal {A}} : {\mathcal {A}} \text { an optimal anticode such that }\dim _{{\mathbb {F}}_q}({\mathcal {A}} \cap C)\ge r\right\} . \end{aligned}$$

A relationship between the two notions of generalized weights (given in equation (9) and Definition 36) is stated below.

Theorem 37

Let C be a Delsarte code. Then for each \(r=1, \dots , \dim C\),

$$\begin{aligned} a_r(C)=d_r(C) \text { if } {m > n}, \quad \text {whereas} \quad a_r(C) \le d_r(C) \text { if } m=n. \end{aligned}$$

Further, if \(C^T\) denotes the Delsarte code in \({\mathbb {M}}_{n\times m}({\mathbb F}_q)\) consisting of transposes of the matrices in C, then \(a_r(C)=d_r(C^T)\) if \(m < n\).

Proof

For a proof in the case \(m > n\) or \(m=n\), see [15, Theorem 9] (or alternatively, [10, Proposition 2.11]). For the case \(m<n\), see [9, Theorem 5.18].

When \(m=n\), both [18, Corollary 38] and Corollary 30 are still valid, but the \(a_r\) and the \(d_r\) are not necessarily the same. An example where they are different is given by Martínez-Peñas and Matsumoto [15, Section IX,C]. A precise relationship between the two notions of generalized weights in this case of square matrices is given in [9, Theorem 5.18]. We will discuss a (qm)-demi-polymatroid version of this below, and deduce the said relationship as a consequence.

First note that if \(m=n\) and if \(C \subseteq {\mathbb M}_{m\times n}({\mathbb F}_q)\) is a Delsarte rank metric code, then so is \(C^T:=\{M^t: M \in C\}\), and thus, we obtain two (qm)-polymatroids \(P(C) = (E, \rho ^{ }_C)\) and \(P(C^T) = (E, \rho ^{ }_{C^T})\) as in part (ii) of Definition 19.

Proposition 38

Assume that \(m=n\). Let \(C \subseteq {\mathbb M}_{m\times n}({\mathbb F}_q)\) be a Delsarte rank metric code. Consider \(E={\mathbb {F}}_q^n\) and define \(\rho :\Sigma (E)\rightarrow {\mathbb {N}}_0\) by

$$\begin{aligned} \rho (X)=\min \{\rho ^{ }_{C}(X), \; \rho ^{ }_{C^T}(X)\} \quad \text {for } X\in \Sigma (E). \end{aligned}$$

Then \(P=(E,\rho )\) is a (qm)-demi-polymatroid and its conullity function is given by

$$\begin{aligned} \nu ^*(X)=\max \{\dim C(X), \; \dim C^T (X)\} \quad \text {for } X\in \Sigma (E). \end{aligned}$$

Moreover, the generalized weights of P are given by

$$\begin{aligned} d_r(P)=\min \{d_r(P(C)), \; d_r(P(C^T)) \} \quad \text {for } r=1, \dots , \rho (E). \end{aligned}$$

Consequently, m-fold Wei duality as in Theorem 17 holds for Ravagnani’s generalized weights \(a_r(C)\).

Proof

It is obvious that \(\rho \) satisfies (R1) and (R2) of Definition 1, since we know that each of \(\rho _C\) and \(\rho _{C^T}\) satisfies these properties. So, in order to prove that P is a (qm)-demi-polymatroid, it remains to show that (R4) is satisfied, which means that \(\rho ^*\) satisfies (R1) and (R2). To this end, let \(X\in \Sigma (E)\). Then

$$\begin{aligned} \nonumber \rho ^*(X)= & {} \rho (X^{\perp }) +m\dim X-\rho (E) \nonumber \\= & {} \min \{ \rho ^{ }_{C}(X^{\perp }), \; \rho ^{ }_{C^T}(X^{\perp }) \} +m\dim X- \dim C \nonumber \\= & {} \min \{ \dim C - \dim C(X), \; \dim C - \dim C^T (X) \}+m \dim X -\dim C. \end{aligned}$$

It follows that

$$\begin{aligned} \rho ^*(X) = m\dim X - \max \{\dim C(X), \; \dim C^T(X)\} . \end{aligned}$$
(10)

This implies that \(\rho ^*(X) \le m\dim X\). Moreover, it also implies that \(\rho ^*(X) \ge 0\), because from (5) and Proposition 6 we see that both \(m\dim X - \dim C(X)\) and \(m\dim X - \dim C^T(X)\) are nonnegative. Thus, \(\rho ^*\) satisfies (R1). Next, we show that \(\rho ^*\) satisfies (R2). Fix \(X, Y\in \Sigma (E)\) with \(X \subseteq Y\). In view of (10), the difference \(\rho ^*(Y)-\rho ^*(X)\) can be written as

$$\begin{aligned} m(\dim Y - \dim X ) - \big (\max \{\dim C(Y),\dim C^T(Y)\} - \max \{\dim C(X),\dim C^T(X)\} \big ). \end{aligned}$$

Since the expression above is symmetric in C and \(C^T\), we may assume without loss of generality that \(\max \{\dim C(Y),\dim C^T(Y)\} = \dim C(Y)\). Now, in case \(\max \{\dim C(X),\dim C^T(X)\} = \dim C(X)\), we see that

$$\begin{aligned} \rho ^*(Y)-\rho ^*(X) = m(\dim Y - \dim X ) - (\dim C(Y) - \dim C(X) ) = \rho _{C}^*(Y)-\rho _{C}^*(X), \end{aligned}$$

which is nonnegative since \(\rho _{C}^*\) satisfies (R1), thanks to Proposition 2. In case \(\max \{\dim C(X),\dim C^T(X)\} = \dim C^T(X)\), then \( \dim C^T(X) \ge \dim C(X)\), and so

$$\begin{aligned} \rho ^*(Y)-\rho ^*(X) = m(\dim Y - \dim X ) - (\dim C(Y) - \dim C^T(X) ) \ge \rho _{C}^*(Y)-\rho _{C}^*(X), \end{aligned}$$

which is again nonnegative. Thus, \(\rho ^*\) satisfies (R2). This proves that \(P=(E,\rho )\) is a (qm)-demi-polymatroid. The desired formula for the conullity function of P is immediate from (10). This, in turn, shows that

$$\begin{aligned} d_r(P)=\min \left\{ d_r(P(C)), \; d_r(P(C^T))\right\} \quad \text {for } r=1, \dots , \rho (E). \end{aligned}$$

Indeed, the inequality \(d_r(P) \le \min \{d_r(P(C)), \; d_r(P( C^T )) \}\) is clear from the definition and equation (5). For the other inequality, it suffices to consider \(X_0\in \Sigma (E)\) with \(\max \{\dim C(X_0), \; \dim C^T (X_0)\} \ge r\) such that \(d_r(P) = \dim X_0\).

The last assertion about Wei duality for Ravagnani’s generalized weights \(a_r(C)\) is an immediate consequence of Theorem 17 because we know from [9, Theorem 38] that \(a_r(C) = \min \{d_r(P(C)), \; d_r(P(C^T )) \}\) for \(1\le r \le \dim C = \rho (E)\). \(\square \)