We will now give definitions for greedy weights for matroids, and later show that greedy weights for linear codes and their associated matroids coincide. First, recall the definition for generalized Hamming weights for matroids, given in [12]:
Definition 13
Let M be a matroid of rank \(n-k\) on a set of cardinality n. For \(1 \leqslant r \leqslant n-k,\)
$$\begin{aligned} d_r= \min \{|\sigma |:\ \sigma \in \mathcal {N}_r\} = \min \{|\sigma |:\ \sigma \in N_r\}. \end{aligned}$$
Definition 14
Let M be a matroid on n elements of rank \(n-k\). Let \(\Sigma \) be the set
$$\begin{aligned} \Sigma =\left\{ (\sigma _1,\ldots ,\sigma _k) \in \mathcal {N}_1\times \cdots \times \mathcal {N}_k\vert \ \sigma _1 \subsetneq \cdots \subsetneq \sigma _k\right\} . \end{aligned}$$
Let \(\overline{\Sigma }\) be the set
$$\begin{aligned} \overline{\Sigma } = \left\{ e(S)=(|\sigma _1|,\ldots ,|\sigma _k|):\ S=(\sigma _1,\ldots ,\sigma _k) \in \Sigma \right\} . \end{aligned}$$
Then the (bottom-up) greedy weights \((e_1,\ldots ,e_k)\) of M are the
$$\begin{aligned} (e_1,\ldots ,e_k) = \min _{\mathrm {lex}} \overline{\Sigma } \end{aligned}$$
while the top-down greedy weights \((\tilde{e}_1,\ldots ,\tilde{e}_k)\) of M are
$$\begin{aligned} (\tilde{e}_1,\ldots ,\tilde{e}_k) = \min _{\mathrm {revlex}} \overline{\Sigma }. \end{aligned}$$
If \(S=(\sigma _1,\ldots ,\sigma _k) \in \mathcal {N}_1\times \cdots \times \mathcal {N}_k\) is such that \(e(S)=(e_1,\ldots ,e_k)\) (resp. \((\tilde{e}_1,\ldots ,\tilde{e}_k)\)), we say that \(\sigma _i\) computes \(e_i\) (resp. \(\tilde{e}_i\)).
Definition 15
Let M be a matroid of rank \(n-k\) on a set of cardinality n, and let \((d_1,\ldots ,d_k)\) be its generalized Hamming weights. The CEZ greedy weights \((g_1,\ldots ,g_k)\) are defined as follows:
$$\begin{aligned} g_1=d_1 \end{aligned}$$
and for \(2\leqslant r \leqslant k\),
$$\begin{aligned} g_r = \min \{|\sigma |:\ \sigma \in \mathcal {N}_r \text { and } \exists \tau \in \mathcal {N}_{r-1} \text { such that } \tau \subset \sigma \text { and }|\tau | = d_{r-1}\}. \end{aligned}$$
We say that \(\sigma \in \mathcal {N}_i\) computes \(g_i\) if it satisfies the conditions in the definition.
Example 1
Let C be the [8, 4]-linear code over \(\mathbb {F}_3\) defined by the generator matrix
$$\begin{aligned} G=\begin{bmatrix} 1&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0\\ 0&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 0\\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 1&{}\quad 1&{}\quad 0\\ 0&{}\quad 0&{}\quad 0&{}\quad 0&{}\quad 1&{}\quad 2&{}\quad 0&{}\quad 1 \end{bmatrix}. \end{aligned}$$
Its weights are
$$\begin{aligned} (d_1,d_2,d_3,d_4)= & {} (2,4,6,8),\\ (e_1,e_2,e_3,e_4)= & {} (g_1,g_2,g_3,g_4) = (2,4,7,8) \end{aligned}$$
and
$$\begin{aligned} (\tilde{e}_1,\tilde{e}_2,\tilde{e}_3,\tilde{e}_4)=(3,4,6,8). \end{aligned}$$
As a consequence of the unique rank increase of the nullity function, both the bottom up and the top down greedy weights are strictly increasing sequences. The CEZ greedy weights \(g_i\) are not necessary monotonous, as the following example shows.
Example 2
Let M on \(E=\{1,\ldots ,23\}\) whose circuits are the following: all the subsets of \(\{13,\ldots ,23\}\) of cardinality 9 together with \(\{1,\ldots ,8\}\), \(\{5,\ldots ,12\}\) and \(\{1,2,3,4,9,10,11,12\}\). This is a matroid of rank 18. Then,
$$\begin{aligned} (d_1,d_2,d_3,d_4,d_5)= & {} (8,10,11,19,23),\\ (e_1,e_2,e_3,e_4,e_5)= & {} (8,12,21,12,23),\\ (\tilde{e}_1,\tilde{e}_2,\tilde{e}_3,\tilde{e}_4,\tilde{e}_5)= & {} (10,11,12,19,23),\\ (g_1,g_2,g_3,g_4,g_5)= & {} (8,12,11,19,23). \end{aligned}$$
Example 3
Consider the following graph:
Its associated matroid, that is, the matroid whose circuits correspond to cycles of the graph, is a matroid on the set of its 25 edges, and rank 21. The generalized Hamming weights of the matroid are
$$\begin{aligned} (d_1, d_2, d_3, d_4)=(6,12,18,25). \end{aligned}$$
The greedy weights are
$$\begin{aligned} (e_1,e_2,e_3,e_4)= & {} (6,13,21,25),\\ (\tilde{e}_1,\tilde{e}_2,\tilde{e}_3,\tilde{e}_4)= & {} (8,12,18,25),\\ (g_1,g_2,g_3,g_4)= & {} (6,13,18,25). \end{aligned}$$
The weight \(d_2\) corresponds to the minimum support of the union of two different cycles (the right part of the graph), while the weight \(e_2\) corresponds to the minimum cardinality of the support of the union of two different cycles, where one of the cycles is a cycle of minimal length (the left part of the graph, since the only cycle of minimal length is the hexagon on the left part). See also [14] for the computation of generalized Hamming weights of (signed) graphs.
In Definitions 14 and 15, we could actually have asked the subsets to be in \(N_i\), not just \(\mathcal {N}_i\), as the following proposition shows:
Proposition 1
Let M be a matroid of rank \(n-k\) on a set of cardinality n. Let \(\Sigma '\) be the set
$$\begin{aligned} \Sigma ' =\left\{ (\sigma _1,\ldots ,\sigma _k):\ \sigma _1 \subsetneq \cdots \subsetneq \sigma _k \text { and }\sigma _i \in N_i\text {, }\ \forall i\right\} . \end{aligned}$$
Then we have the following:
$$\begin{aligned} (e_1,\ldots ,e_k)=\min _{\mathrm {lex}}\{e(S):\ S \in \Sigma '\},\\(\tilde{e}_1,\ldots ,\tilde{e}_k)=\min _{\mathrm {revlex}}\{e(S):\ S \in \Sigma '\}, \end{aligned}$$
and for all \(2\leqslant i \leqslant k\),
$$\begin{aligned} g_i=\min \{|\sigma |:\ \sigma \in N_i \text { and } \exists \tau \in N_{i-1} \text { such that } \tau \subset \sigma \text { and }|\tau | = d_{i-1}\}. \end{aligned}$$
Proof
The first and third assertions rely on the same observation. We will thus only treat the first assertion. It is clear that
$$\begin{aligned} \min _{\mathrm {lex}}\{e(S):\ S \in \Sigma '\} \geqslant _{\mathrm {lex}} (e_1,\ldots ,e_k). \end{aligned}$$
Now, let \(S=(\sigma _1,\ldots ,\sigma _k) \in \Sigma \) such that
$$\begin{aligned} e(S)=(e_1,\ldots ,e_k)=\min _{\mathrm {lex}}\{e(S):\ S \in \Sigma \}. \end{aligned}$$
We will show that \(\sigma _i \in N_i\) for all i. If not, let i be the smallest index for which this is not true. By definition of \(N_1\) and the lexicographic order, \(i >1\). Since \(\sigma _i \not \in N_i\), this means that there exists \(\tau \subsetneq \sigma _i\) such that \(n(\tau )=i\). Obviously, \(\sigma _{i-1} \not \subset \tau \) otherwise, replacing \(\sigma _i\) by \(\tau \) in the sequence S, we would get a chain of sets that would contradict the minimality of e(S) for the lex ordering. Thus, we can find \(x \in \sigma _{i-1} - \tau \). Without loss of generality, we can suppose that \(\tau =\sigma _i-\{x\}\). Consider then \(\rho =\sigma _{i-1}-\{x\}\). By minimality of \(\sigma _{i-1}\) in the set of subsets with nullity \(i-1\), and by the unique rank increase property of n, \(n(\rho ) = i-2\). Then, by (\(N_3\)):
$$\begin{aligned} 2i-2= n(\rho ) + n(\sigma _i) = n(\sigma _{i-1}\cap \tau ) + n(\sigma _{i-1} \cup \tau ) \geqslant n(\sigma _{i-1}) + n(\tau ) = 2i-1, \end{aligned}$$
which is absurd. Thus, all elements in S are in \(N_i\), and the first assertion is proved.
The second assertion is easier to prove since we don’t have any bottom constraints. Again, it is clear that
$$\begin{aligned} \min _{\mathrm {revlex}}\{e(S):\ S \in \Sigma '\} \geqslant _{\mathrm {lex}} (\tilde{e}_1,\ldots ,\tilde{e}_k). \end{aligned}$$
For the contrary, let \(S=(\sigma _1,\ldots ,\sigma _k) \in \Sigma \) such that
$$\begin{aligned} e(S)=(\tilde{e}_1,\ldots ,\tilde{e}_k)=\min _{\mathrm {revlex}}\{e(S):\ S \in \Sigma \}. \end{aligned}$$
Assume that there exists an index i such that \(\sigma _i \not \in N_i\). Let \(\tau _i \subsetneq \sigma _i\) such that \(\tau _i \in N_i\), and take recursively for \(j<i\) any \(\tau _j \subset \tau _{j+1}\) such that \(n(\tau _j)=j\). This can always be done by the unique rank increase property of n. Then the sequence \(S'=(\tau _1,\ldots ,\tau _i,\sigma _{i+1},\ldots ,\sigma _k) \in \Sigma \), and by construction,
$$\begin{aligned} e(S') <_{\mathrm {revlex}} e(S), \end{aligned}$$
which is absurd. This in turn shows that
$$\begin{aligned} \min _{\mathrm {revlex}}\{e(S):\ S \in \Sigma '\} \leqslant _{\mathrm {lex}} (\tilde{e}_1,\ldots ,\tilde{e}_k). \end{aligned}$$
\(\square \)
Remark 6
The set \(\Sigma '\) appearing in Proposition 1 is the set of maximal chains in the poset of cycles for the matroid. Taking complements, this is the poset of flats of the dual matroid. If \(d^{\perp } \ge 3,\) then this poset is a geometric lattice with atoms of cardinality 1. Then the cardinalities \(c_f\) of the flats, and hence all the cardinalities \(n-c_f\) of the cycles \(\sigma \) of the matroid, can be given a purely lattice-theoretical interpretation in terms of atoms. Hence it is possible to reformulate Proposition 1 by lattice-theoretical invariants.
Corollary 1
Let M be a matroid of rank \(n-k\) on a set of cardinality n. For \(1 \leqslant i \leqslant k\),
$$\begin{aligned} X \subset E \text { is a (top-down, bottom-up, CEZ) }i\text {-greedy subcode} \Rightarrow \beta _{i,X} \ne 0 \end{aligned}$$
and
$$\begin{aligned} g_i, e_i,\tilde{e}_i \in \{j \vert \beta _{i,j} \ne 0\}. \end{aligned}$$
Proof
In the proof above, we showed that any subset that computes a greedy-weight is a cycle. This is then a direct consequence of Theorem 1. \(\square \)
Wei duality of greedy weights
If M is a matroid, then it is proved in [12] that the weight hierarchy of the matroid and its dual satisfy Wei duality, that is
$$\begin{aligned} \{d_1,\ldots ,d_k\} \cup \{n+1-\overline{d}_1,\ldots ,n+1-\overline{d}_{n-k}\} = \{1,\ldots ,n\}, \end{aligned}$$
where \(\overline{d}_i\) denotes the ith generalized Hamming weight of \(\overline{M}\). This result is a generalization of duality for linear codes proved by Wei [22]. In his doctoral thesis [19], Schaathun proves a Wei duality for greedy weights for linear codes, namely that
$$\begin{aligned} \{e_1,\ldots ,e_k\} \cup \{n+1-\overline{\tilde{e}}_1,\ldots ,n+1-\overline{\tilde{e}}_{n-k}\} = \{1,\ldots ,n\}. \end{aligned}$$
In this section, we will prove that his result extends to matroids. As opposed to [12], our proof is constructive, in the sense that we exhibit an element in \(\Sigma '(\overline{M})\) that computes the greedy weights of the dual matroid. Before doing so, if \(S=(\sigma _1,\ldots ,\sigma _k) \in \Sigma \), we define \(\delta (S)\) in the following (not unique) way: consider a maximal chain
$$\begin{aligned}\emptyset \subsetneq \rho _1 \subsetneq \cdots \subsetneq \rho _n=E\end{aligned}$$
that contains all the \(E-\sigma _i\) for \(1\leqslant i\leqslant k\). Obviously, we have \(|\rho _i|=i\) for every \(1\leqslant i\leqslant n\). Then \(\delta (S)\) is the chain \(\tau _1\subsetneq \cdots \subsetneq \tau _{n-k}\) obtained by removing all the subsets of cardinality \(n-|\sigma _i|+1\). Even if this is not uniquely defined, the set \(\overline{\delta }(S) = \{|\tau _1|,\ldots ,|\tau _{n-k}|\}\) is, since we have
$$\begin{aligned} \overline{\delta }(S) = \{1,\ldots ,|E|\}-\{n+1-|\sigma _i|: \ 1\leqslant i \leqslant k\}. \end{aligned}$$
In particular, we have, with a slight abuse of notation,
$$\begin{aligned} \overline{\delta }\delta S = e(S)=\{|\sigma _1|,\ldots ,|\sigma _k|\}. \end{aligned}$$
Denote by \(\overline{n}\) the nullity function of \(\overline{M}\).
Lemma 1
Let \(S=(\sigma _1,\ldots ,\sigma _k)\) be a tower that computes the bottom up greedy weights of M, and let \(\delta (S)=(\tau _1\ldots ,\tau _{n-k})\). Then for all \(1\leqslant i \leqslant n-k\),
$$\begin{aligned} \overline{n}(\tau _i)=i. \end{aligned}$$
Proof
Using the notation from the definition of \(\delta (S)\), we have for every i the chain
$$\begin{aligned} E- \sigma _{i+1}= \rho _j \subsetneq \cdots \subsetneq \rho _{j+s} = E-\sigma _i \end{aligned}$$
where \(j= n-|\sigma _{i+1}|\) and \(s=|\sigma _{i+1}|-|\sigma _i|\). From the duality formula for the rank functions and nullity functions, we get that, since \(n(\sigma _t)=t\),
$$\begin{aligned} \overline{n}(E-\sigma _{i+1}) = k+i+1-|\sigma _{i+1}| \end{aligned}$$
while
$$\begin{aligned} \overline{n}(E-\sigma _i)=k+i-|\sigma _i|. \end{aligned}$$
Since \(\overline{n}\) is unit rank increase, this means that all \(\overline{n}(\rho _{j+t})\) are distinct, except for 2 of them, and that they span the set \(\{k+i+1-|\sigma _{i+1}|,\ldots ,k+i-|\sigma _i|\}.\) We show now that \(\overline{n}(\rho _j)=\overline{n}(\rho _{j+1})\). Since both set differ by just 1 element, we have either \(\overline{n}(\rho _j)=\overline{n}(\rho _{j+1})\) or \(\overline{n}(\rho _j)=\overline{n}(\rho _{j+1})-1\). Suppose the latter occurs. Then,
$$\begin{aligned} n(\sigma _{i+1})=n(E-\rho _j) = n-k-|\rho _j|+\overline{n}(\rho _j) = n(E-\rho _{j+1}). \end{aligned}$$
Since
$$\begin{aligned} \sigma _i \subsetneq E-\rho _{j+1} \subsetneq E-\rho _j = \sigma _{i+1} \end{aligned}$$
(the first strict inclusion coming from the fact that \(n(\sigma _i)=n(\sigma _{i+1})-1 = n(E-\rho _{j+1})-1\)), the tower
$$\begin{aligned} \sigma _1\subsetneq \cdots \subsetneq \sigma _i \subsetneq E-\rho _{j+1} \subsetneq \sigma _{i+2} \cdots \subsetneq \sigma _k \in \Sigma \end{aligned}$$
and the k-tuple formed by the cardinalities of the elements of the tower is strictly lower for the lex order than \((e_1,\ldots ,e_k)\) which is absurd. \(\square \)
Lemma 2
Let \(S,S' \in \Sigma \). Then
$$\begin{aligned} e(S)<_{\mathrm {lex}} e(S') \Leftrightarrow e(\delta (S))<_{\mathrm {revlex}} e(\delta (S')). \end{aligned}$$
Proof
Write \(S=(\sigma _1,\ldots ,\sigma _k)\), \(S'=(\sigma '_1,\ldots ,\sigma '_k)\), \(\delta (S)=(\tau _1,\ldots ,\tau _{n-k})\) and \(\delta (S')=(\tau '_1,\ldots ,\tau '_{n-k})\). By hypothesis, there exists an \(1\leqslant i \leqslant k\) such that for all \(1\leqslant j <i\), \(|\sigma _j|=|\sigma '_j|\) while \(|\sigma _i|<|\sigma '_i|\). In our definition of \(\delta \) above (and we keep the notation, using \(\rho _s\) and \(\rho '_s\) for S and \(S'\) respectively) this means that for \(l\geqslant n-|\sigma _i|-k+i+1\),
$$\begin{aligned} |\tau _l|=|\tau '_l| \end{aligned}$$
while
$$\begin{aligned} \left| \tau _{n-|\sigma _i|-k+i}\right| <\left| \tau '_{n-|\sigma _i|-k+i}\right| =n-|\sigma _i|+1, \end{aligned}$$
that is
$$\begin{aligned} e(\delta (S))<_{\mathrm {revlex}} e(\delta (S')) \end{aligned}$$
The other way is done in a similar way, noticing that \(e\delta \delta (S)=\overline{\delta }\delta (S) = e(S)\). \(\square \)
We then obtain the following analogue of [19, Theorem 10.2], where one showed Wei duality for greedy weights of linear codes:
Theorem 2
Let M be a matroid of rank k on a ground set E of cardinality n. Then
$$\begin{aligned} \{e_1,\ldots ,e_k\} \cup \{n+1-\overline{\tilde{e}}_1,\ldots ,n+1-\overline{\tilde{e}}_{n-k}\} = \{1,\ldots ,n\}. \end{aligned}$$
Proof
Let \(S\in \Sigma \) such that \(e(S)=(e_1,\ldots ,e_k)\). Consider \(T=\delta (S)\). By Lemma 1, we know that \(T \in \Sigma (\overline{M})\), and thus
$$\begin{aligned} e(T) \geqslant _{\mathrm {revlex}} (\overline{\tilde{e}}_1,\ldots ,\overline{\tilde{e}}_{n-k}). \end{aligned}$$
If this is not an equality, let \(T' \in \Sigma (\overline{M})\) such that \(e(T')=(\overline{\tilde{e}}_1,\ldots ,\overline{\tilde{e}}_{n-k})\). Then by Lemma 2 and the fact that \(e\delta \delta (T)=e(T)\), we get that
$$\begin{aligned} e(S) >_{\mathrm {lex}} e(\delta (T)) \geqslant _{\mathrm {lex}} (e_1,\ldots ,e_k)=e(S) \end{aligned}$$
which is absurd. \(\square \)
Greedy weights of codes and matroids
In for example [1, 3,4,5,6,7, 18,19,20] one describes and treats greedy weights of linear codes C over finite fields in various ways. In this part, we will show that the greedy weights for codes and their associated matroids coincide. We start with some lemmas:
Lemma 3
Let C be a [n, k]-code, M its associated matroid and \(X \subset \{1,\ldots ,n\}\). Consider the subcode
$$\begin{aligned} C(X) = \left\{ w \in C\vert \ \mathrm {Supp}(w) \subset X\right\} \subset C. \end{aligned}$$
Then
$$\begin{aligned} \dim C(X)=n(X)=n(\mathrm {Supp}(C(X))). \end{aligned}$$
Proof
The first equality is an easy consequence from the fact that \(C(X) = \ker G_{E-X}\), and a rewriting of the rank-nullity theorem using the relation between the rank of the matroid and its dual. Moreover, the dimension of the relations between the columns of H indexed \(\mathrm {Supp}(C(X))\) is n(X), that is,
$$\begin{aligned} n(\mathrm {Supp}(C(X))) = n(X). \end{aligned}$$
\(\square \)
Theorem 3
The greedy weights of a [n, k]-linear code C and those of its associated matroid M coincide.
Proof
Let first \(S=\sigma _1\subset \cdots \subset \sigma _k \in \Sigma \) be such that \(e(S)=(e_1(M),\ldots ,e_k(M))\), and let \(D_i=C(\sigma _i)\). Then \(\dim D_i= n(\sigma _i)=i\) and \(D_1 \subset \cdots \subset D_k\). We always have \(\mathrm {Supp}(D_i) \subset \sigma _i\), which shows that
$$\begin{aligned} (e_1(C), \ldots ,e_k(C)) \leqslant _{\mathrm {lex}} (e_1(M),\ldots ,e_k(M)). \end{aligned}$$
For the converse, let \(D_1\subset \cdots \subset D_k\) be subcodes of C with \(\dim D_i=i\) and \(wt(D_i) = e_i(C)\). Let \(\sigma _i=\mathrm {Supp}(D_i)\). Of course
$$\begin{aligned} \sigma _1\subset \cdots \subset \sigma _k, \end{aligned}$$
and since \(D_i \subset C(\sigma _i)\), we always have
$$\begin{aligned} n(\sigma _i) = \dim C(\sigma _i) \geqslant \dim D_i=i. \end{aligned}$$
We claim that there is equality. If not, let i be minimal such that \(n(\sigma _i)>i\). Then, there exists \(\tau \) with \(n(\tau )=i\) such that \(\sigma _{i-1} \subsetneq \tau \subsetneq \sigma _i\) (take \(\sigma _0=\emptyset \) in the case \(i=1\)), and let \(D'_i=C(\tau )\). Clearly
$$\begin{aligned} D_1\subset \cdots D_{i-1} \subset D_i' \end{aligned}$$
and \(\dim D'_i = n(\tau )=i\). This would give rise to a tower of subcodes
$$\begin{aligned} D_1\subset \cdots D_{i-1} \subset D_i'\subset \cdots \subset D'_k \end{aligned}$$
with \(\dim D_j' =j\) for \(i \leqslant j\leqslant k\) that would contradict the minimality of \((e_1(C),\ldots ,e_k(C))\) for the lexicographic order. This shows that
$$\begin{aligned} (e_1(C), \ldots ,e_k(C)) \geqslant _{\mathrm {lex}} (e_1(M),\ldots ,e_k(M)). \end{aligned}$$
The proofs for top-down and CEZ greedy weights are done in a similar way. \(\square \)
Theorem 3 is a generalization of Wei duality for linear codes as presented in [19]. From [17, Theorem 2.2.8], the matroid associated to the dual of linear code is precisely the dual of the matroid of the linear code in question