#  Generalized Weights of Codes over Rings
and Invariants of Monomial Ideals

Elisa Gorla and Alberto Ravagnani

###### Abstract

We develop an algebraic theory of supports for $R$-linear codes of fixed
length, where $R$ is a finite commutative unitary ring. A support naturally
induces a notion of generalized weights and allows one to associate a monomial
ideal to a code. Our main result states that, under suitable assumptions, the
generalized weights of a code can be obtained from the graded Betti numbers of
its associated monomial ideal. In the case of ${\mathbb{F}}_{q}$-linear codes
endowed with the Hamming metric, the ideal coincides with the Stanley-Reisner
ideal of the matroid associated to the code via its parity-check matrix. In
this special setting, we recover the known result that the generalized weights
of an ${\mathbb{F}}_{q}$-linear code can be obtained from the graded Betti
numbers of the ideal of the matroid associated to the code. We also study
subcodes and codewords of minimal support in a code, proving that a large
class of $R$-linear codes is generated by its codewords of minimal support.

## Introduction

In the past seventy years, much effort has been devoted to the study of
algebraic and combinatorial objects associated to linear error-correcting
codes. Of particular interest is the matroid associated to a linear code via
its parity-check matrix, whose circuits are the minimal Hamming supports of
the codewords. Many central results in classical coding theory, including the
celebrated MacWilliams identities, their generalizations, and the duality
between puncturing and shortening can be elegantly obtained via this
correspondence; see e.g. [2, 3, 4, 11] and the references therein.

The matroid associated to a linear code via its parity check matrix retains a
wealth of information about the structure of the code, including its length,
dimension, minimum distance, weight distribution, and generalized weights.
Moreover, the weight enumerator is determined by the Tutte polynomial of the
matroid, see [8]. In addition, in [10] it is shown that the code’s generalized
weights are determined by the graded Betti numbers of the Stanley-Reisner
ideal of the matroid. The approach of [10] heavily relies on matroid theory
and on the properties of the Hamming support.

In this paper, we depart from the classical theory of linear codes over a
finite field and consider instead $R$-linear codes $C\subseteq R^{n}$, where
$R$ is a finite commutative unitary ring. We start by proposing a general
definition of support as a function $\sigma:R^{n}\to\mathbb{N}^{u}$ that
enjoys a few natural properties. This naturally extends the notion of Hamming
support traditionally studied in coding theory [12, page 177]. We give several
examples of supports and operations to construct new supports from old. We
define the support of a code $C\subseteq R^{n}$ as the join of the supports of
its elements.

We then define the generalized weights of a code via the supports of its
subcodes. Moreover, we identify a class of supports under which the algebra of
the module $R^{n}$ is compatible with the combinatorics of the poset
$\mathbb{N}^{u}$ with the product order. We call these supports modular and
establish some of their structural properties. As one might expect, the
Hamming support is an example of a modular support.

Most of the paper is devoted the study of codes $C\subseteq R^{n}$ endowed
with modular supports. We characterize their minimal codewords and prove that,
if $R$ is a principal ideal ring, then their generalized weights are attained
by subcodes that are minimally generated by codewords of minimal support in
$C$. We also provide evidence in various examples that our results do not
extend to support functions that are not modular.

The centerpiece of this paper is a result connecting the theory of modular
supports with invariants of monomial ideals. We associate a monomial ideal to
a code $C\subseteq R^{n}$ via the supports of its codewords. Under this
correspondence, inclusion of supports translates into divisibility among
monomials. In Theorem 4.4 we prove that, under suitable assumptions, the
generalized weights of an $R$-linear code endowed with a modular support are
determined by the graded Betti numbers of the associated monomial ideal. This
generalizes a result of [10], with a stand-alone proof that does not rely on
matroid theory.

We conclude the paper with a series of observations on the Hamming support. We
review known results in the light of our contribution, such as the fact that
every $\mathbb{F}_{q}$-linear code is generated by its codewords of minimal
support. We also show that the same is true for those of maximal support,
provided that $q$ is sufficiently large (and false in general for binary
codes).

#### Outline.

In Section 1 we define $R$-linear codes and review some algebra results about
finite commutative rings and finite local rings. In Section 2 we define
(modular) supports and generalized weights, establishing their main
properties. Codewords and subcodes of minimal supports are studied in Section
3. In Section 4 we associate a monomial ideal to a code. Moreover, we prove
that the generalized weights of the code are determined by the graded Betti
numbers of the corresponding ideal. We study the Hamming support in Section 5.

#### Acknowledgements.

We are grateful to Maria Evelina Rossi for suggesting Example 1.12.

##  1 Codes and minimal systems of generators

In this section we introduce codes over finite commutative rings and describe
some properties of their systems of generators.

######  Notation 1.1.

Throughout the paper $n$ and $m$ denote positive integers and $(R,+,\cdot)$ is
a finite commutative ring. All rings in this paper are unitary with $1\neq 0$.
We denote by ${\mathbb{N}}=\\{0,1,2,\ldots\\}$ the set of natural numbers. For
$a\in\mathbb{N}$ we let $[a]:=\\{1,\ldots,a\\}$.

A classical theorem in commutative algebra states that every finite
commutative ring $R$ is isomorphic to a finite product of finite local rings.
We forget the isomorphism and write

$R=R_{1}\times\ldots\times R_{\ell},$ (1.1)

where $R_{1},\ldots,R_{\ell}$ are finite local rings. For $i\in[\ell]$, let
$\mathfrak{M}_{i}$ be the maximal ideal of $R_{i}$ and let $J=J(R)$ be the
Jacobson radical of $R$. Recall that the Jacobson radical of a commutative
ring $R$ is the intersection of all maximal ideals of $R$, equivalently

$J=\\{r\in R\,:\,1+rs\mbox{ is invertible for every }s\in R\\}.$

It is easy to check that in our situation

$J=\mathfrak{M}_{1}\times\ldots\times\mathfrak{M}_{\ell}\subseteq
R_{1}\times\ldots\times R_{\ell}=R.$

If $R$ is a finite principal ideal ring, then each $R_{i}$ is a finite chain
ring. For $i\in[\ell]$, let $\mathfrak{M}_{i}=(\alpha_{i})$. Then
$J=(\alpha)$, where $\alpha=(\alpha_{1},\ldots,\alpha_{\ell})$. In particular,
if $R$ is a product of finite fields, then $\mathfrak{M}_{i}=0$ for
$i\in[\ell]$ and $J=0$. If $R=\mathbb{F}_{q}$, then $\ell=1$ and $J=0$ is the
only maximal ideal of $R$.

We denote by $(R,\mathfrak{M})$ a local ring $R$ with maximal ideal
$\mathfrak{M}$. If $(R,\mathfrak{M})$ is a finite local ring, then
$R/\mathfrak{M}$ is a finite field.

In this paper we consider codes of fixed length over the alphabet $R$. All of
our codes are assumed to be linear over $R$.

######  Definition 1.2.

An $R$-linear code, or simply a code, is an $R$-submodule $C\subseteq R^{n}$.
The elements of $C$ are called codewords. A subcode of $C$ is an $R$-submodule
$D\subseteq C$.

Denote by $e_{i}$ the element of $R$ which corresponds to
$(0,\ldots,0,1,0,\ldots,0)\in R_{1}\times\ldots\times R_{\ell}$, where the one
appears in the $i$th component. From the decomposition in (1.1) one has

$R^{n}=R_{1}^{n}\times\ldots\times R_{\ell}^{n}.$

In the sequel, for $i\in\\{1,\ldots,\ell\\}$ we denote by
$\pi_{i}:R^{n}\rightarrow R_{i}^{n}$ the standard projection on the $i$th
coordinate.

Let $C\subseteq R^{n}$ be a code. For any $v=(v_{1},\ldots,v_{\ell})\in C$,
with $v_{i}=\pi_{i}(v)\in R_{i}^{n}$, one has

$(0,\ldots,0,v_{i},0,\ldots,0)=e_{i}v\in C.$

Hence, up to isomorphism, $C$ can be uniquely written as

$C=C_{1}\times\ldots\times C_{\ell}\subseteq R^{n},$ (1.2)

where $C_{i}=\pi_{i}(C)\subseteq R_{i}^{n}$ for all $i\in[\ell]$. We often
consider codes $C\subseteq 0:_{R^{n}}J$. Recall that

$0:_{R^{n}}J=\\{v\in R^{n}\,:\,rv=0\mbox{ for all }r\in J\\}.$

Then

$0:_{R^{n}}J=\left(0:_{R_{1}^{n}}\mathfrak{M}_{1}\right)\times\ldots\times\left(0:_{R_{\ell}^{n}}\mathfrak{M}_{\ell}\right).$

Since $0:_{R^{n}}J$ is an $R$-module annihilated by $J$, it is an
$R/J$-module. Hence, if $(R,\mathfrak{M})$ is a local ring, then
$0:_{R^{n}}\mathfrak{M}$ is a vector space over $R/\mathfrak{M}$.

For $C\subseteq R^{n}$ a code, we also consider the socle

$0:_{C}J=\\{v\in C\,:\,rv=0\mbox{ for all }r\in J\\}=C\cap(0:_{R^{n}}J).$

The socle of $C$ is a the largest subcode of $C$ which is annihilated by $J$.
In particular, if $(R,\mathfrak{M})$ is a local ring, then
$0:_{C}\mathfrak{M}$ is an $R/\mathfrak{M}$-vector space.

A minimal system of generators of a code $C\subseteq R^{n}$ is a subset of $C$
whose elements generate $C$ and which is minimal with respect to inclusion.
Notice that any system of generators of a code $C$ contains a minimal system
of generators of $C$.

######  Definition 1.3.

We denote by $\mu(C)$ the least cardinality of a system of generators of a
code $C$, with $\mu(0)=0$ by convention. For a code $C=C_{1}\times\ldots\times
C_{\ell}\subseteq R^{n}$ as in (1.2), let

$M(C):=\mu(C_{1})+\ldots+\mu(C_{\ell}).$

######  Example 1.4.

Let $R=R_{1}\times\dots\times R_{\ell}$, with $R_{i}$ a finite local ring for
$i\in[\ell]$. Then

$M(R^{n})=\mu(R_{1}^{n})+\ldots+\mu(R_{\ell}^{n})=n\ell.$

Clearly $\mu(C)\leq M(C)$ for every code $C\subseteq R^{n}$. If $R$ is a
finite local ring, all minimal systems of generators of a code $C\subseteq
R^{n}$ have the same cardinality $\mu(C)=M(C)$. This is a consequence of the
next lemma, which summarizes some well-known properties of systems of
generators of modules over local rings; see e.g. [13, Theorem 2.3].

######  Theorem 1.5.

Let $(R,\mathfrak{M})$ be a local ring and let $C=\langle
v_{1},\ldots,v_{t}\rangle$ be an $R$-module. The elements $v_{1},\ldots,v_{t}$
are a minimal system of generators of $C$ if and only if the equivalence
classes $\overline{v_{1}},\ldots,\overline{v_{t}}$ are an
$R/\mathfrak{M}$-basis of the vector space $C/\mathfrak{M}C$. In particular,
every minimal system of generators of $C$ has cardinality
$\mu(C)=\dim_{R/\mathfrak{M}}(C/\mathfrak{M}C)$.

Over an arbitrary $R$, however, not all minimal system of generators of a code
$C\subseteq R^{n}$ have the same cardinality.

######  Example 1.6.

Let $R=\mathbb{Z}_{6}$ and $D=\langle(2,3)\rangle\subseteq
C=\mathbb{Z}_{6}^{2}$. Then $\mu(D)=1$. Moreover, $(2,0)=4(2,3)\in D$ and
$(0,3)=3(2,3)\in D$. Hence $D=\langle(2,0),(0,3)\rangle$ and
$\\{(2,0),(0,3)\\}$ is a minimal system of generators of $D$ of cardinality
$2=M(D)$.

######  Notation 1.7.

Let $C\subseteq R^{n}$ be a code and let

$\mathcal{S}_{j}(C):=\\{D\subseteq C\mbox{ subcode}\,:\,\mbox{$D$ has a
minimal system of generators of cardinality $j$}\\}.$

In particular, $\mathcal{S}_{j}(R^{n})$ is the set of codes $C\subseteq R^{n}$
which have a minimal system of generators of cardinality $j$.

One can show that $M(C)$ is the largest cardinality of a minimal system of
generators of $C\subseteq R^{n}$.

######  Theorem 1.8.

If $C\in\mathcal{S}_{i}(R^{n})$, then there exist $v_{1},\ldots,v_{i}$ minimal
generators of $C$ with the property that

$V=\\{e_{j}v_{k}\,:\,(j,k)\in[\ell]\times[i],\;e_{j}v_{k}\neq 0\\}$

is a minimal system of generators of $C$ with $|V|\geq i$. Moreover

$M(C)=\max\\{i\geq 0\,:\,C\in\mathcal{S}_{i}(R^{n})\\}$

and any minimal system of generators of $C$ of cardinality $M(C)$ has the same
form as $V$.

###### Proof.

Let $w_{1},\ldots,w_{i}$ be a minimal system of generators of
$C=C_{1}\times\ldots\times C_{\ell}$. Let $C_{j}^{\prime}=0\times\ldots\times
0\times C_{j}\times 0\times\ldots\times 0\subseteq C$. Observe that
$e_{j}w_{k}\in C$ for all $k$ and $j$ and
$w_{k}=e_{1}w_{k}+\ldots+e_{\ell}w_{k}$ for all $k\in[i]$. This proves that
the set $\\{e_{j}w_{k}\,:\,(j,k)\in[\ell]\times[i],\,e_{j}w_{k}\neq 0\\}$
generates $C$. Moreover, the set $\\{e_{j}w_{k}\,:\,k\in[i],\,e_{j}w_{k}\neq
0\\}$ generates $C_{j}^{\prime}$ for any $j\in[\ell]$.

Fix $j\in[\ell]$. If $e_{j}w_{1},\ldots,e_{j}w_{i}$ do not form a minimal
system of generators of $C_{j}^{\prime}$, suppose up to reindexing that
$e_{j}w_{1},\ldots,e_{j}w_{k}$ do, for some $k<i$. For $h\in[i]\setminus[k]$,
write $e_{j}w_{h}=r_{h,1}e_{j}w_{1}+\ldots+r_{h,k}e_{j}w_{k}$ for some
$r_{h,1},\ldots,r_{h,k}\in R$. Let $v_{h}=w_{h}$ for $h\in[k]$,
$v_{h}=w_{h}-r_{h,1}e_{j}w_{1}-\ldots-r_{h,k}e_{j}w_{k}$ for
$h\in[i]\setminus[k]$. Then $v_{1},\ldots,v_{i}$ are a minimal system of
generators of $C$ with the property that $e_{j}v_{1},\ldots,e_{j}v_{k}$ are a
minimal system of generators of $C_{j}^{\prime}$ and
$e_{j}v_{k+1}=\ldots=e_{j}v_{i}=0$. Notice that only the $j$th coordinate of
$v_{1},\ldots,v_{i}$ was affected by this operation, hence
$e_{h}w_{k}=e_{h}v_{k}$ for all $k\in[i]$ if $h\neq j$. Performing this
operation for all $j\in[\ell]$ produces a minimal system of generators
$v_{1},\ldots,v_{i}$ of $C$ with the property that the set
$V=\\{e_{j}v_{k}\,:\,(j,k)\in[\ell]\times[i],\,e_{j}v_{k}\neq 0\\}$ is a
minimal system of generators of $C$. Moreover, for $j\in[\ell]$,
$\\{e_{j}v_{k}\,:\,k\in[i],\,e_{j}v_{k}\neq 0\\}$ is a minimal system of
generators of $C_{j}^{\prime}$. Since $v_{1},\ldots,v_{i}\neq 0$, for each
$k\in[i]$ there must be at least a $j\in[\ell]$ such that $e_{j}v_{k}\neq 0$.
This proves that $|V|\geq i$.

To prove the last part of the statement, let $M=\max\\{i\geq
0\,:\,C\in\mathcal{S}_{i}(R^{n})\\}.$ Since $C$ has a minimal system of
generators $v_{1},\ldots,v_{M}$, by the first part of the statement
$V=\\{e_{j}v_{k}\,:\,(j,k)\in[\ell]\times[M],\,e_{j}v_{k}\neq 0\\}$ is a
minimal system of generators of $C$ of $|V|=M$. Therefore, for each $k\in[M]$
there is exactly one $j\in[\ell]$ with $e_{j}v_{k}\neq 0$. Moreover,
$\\{v_{k}\,:\,k\in[M],\,e_{j}v_{k}\neq 0\\}$ is a minimal system of generators
of $C_{j}^{\prime}$ for $j\in[\ell]$, hence it has cardinality $\mu(C_{j})$ by
Theorem 1.5. It follows that $M=\mu(C_{1})+\ldots+\mu(C_{\ell})=M(C)$. ∎

We conclude the section with a few elementary properties of $M(C)$.

######  Proposition 1.9.

Let $R$ be a finite commutative ring and let $D\subseteq C\subseteq
0:_{R^{n}}J$ be codes. Then

$M(D)\leq M(C)$

and equality holds if and only if $D=C$.

###### Proof.

Write $C=C_{1}\times\ldots\times C_{\ell}$ and $D=D_{1}\times\ldots\times
D_{\ell}$. Since $D\subseteq C$, we have $D_{i}\subseteq C_{i}\subseteq
0:_{R_{i}^{n}}\mathfrak{M}_{i}$ for all $i\in[\ell]$. So $C_{i}$ and $D_{i}$
are $R_{i}/\mathfrak{M}_{i}$-vector spaces and $\mu(D_{i})\leq\mu(C_{i})$ for
all $i\in[\ell]$ by Theorem 1.5. It follows that

$M(D)=\mu(D_{1})+\ldots+\mu(D_{\ell})\leq\mu(C_{1})+\ldots+\mu(C_{\ell})=M(C).$

Moreover, $M(D)=M(C)$ if and only if $\mu(D_{i})=\mu(C_{i})$ for all
$i\in[\ell]$. In this case, $C_{i}$ and $D_{i}$ are
$R_{i}/\mathfrak{M}_{i}$-vector spaces of the same dimension by Theorem 1.5.
Hence they are equal, therefore $D=C$. ∎

Notice that one may have $D\subsetneq C\subseteq R^{n}$ with $M(D)=M(C)$. Some
examples of this arise for instance from the fact that, over a principal ideal
ring (PIR in the sequel), the value of $M(C)$ does not change when replacing
$C$ with its socle. We will use this fact repeatedly throughout the paper.

######  Proposition 1.10.

Let $R$ be a finite PIR and let $C\subseteq R^{n}$ be a code. Then

$M(C)=M(0:_{C}J).$

###### Proof.

We may assume without loss of generality that $R$ is a finite chain ring.
Indeed, if the result is true for finite chain rings, then write
$R=R_{1}\times\ldots\times R_{\ell}$ as a product of finite chain rings and
$C=C_{1}\times\ldots\times C_{\ell}$, where $C_{i}\subseteq R_{i}^{n}$ is a
code for $i\in[\ell]$. We have

$M(C)=\mu(C_{1})+\ldots+\mu(C_{\ell})=\mu(0:_{C_{1}}\mathfrak{M}_{1})+\ldots+\mu(0:_{C_{\ell}}\mathfrak{M}_{\ell})=M(0:_{C}J),$

where the last equality follows from

$0:_{C}J=(0:_{C_{1}}\mathfrak{M}_{1})\times\ldots\times(0:_{C_{\ell}}\mathfrak{M}_{\ell}).$

In order to prove that $\mu(C)=\mu(0:_{C}J)$ for $C\subseteq R^{n}$ and $R$ a
finite chain ring, observe that $J=(\alpha)$ is principal and

$\mu(C)=\dim_{R/(\alpha)}(C/\alpha
C)=\dim_{R/(\alpha)}(0:_{C}\alpha)=\mu(0:_{C}\alpha),$ (1.3)

where the first and last equalities follow from Theorem 1.5. The short exact
sequence

$0\to 0:_{C}\alpha\to C\to\alpha C\to 0$

induces an isomorphism $C/\alpha C\cong 0:_{C}\alpha$, which proves the
central equality in (1.3). ∎

The statement of Proposition 1.10 also holds when $C=R^{n}$ and $R$ is a
product of finite Gorenstein local rings.

######  Example 1.11.

Write $R=R_{1}\times\ldots\times R_{\ell}$ and suppose that each $R_{i}$ is a
finite Gorenstein local ring. Suppose first that $\ell=1$, i.e. $R$ is a
Gorenstein local ring with maximal ideal $\mathfrak{M}$. We have the following
isomorphisms of $R/\mathfrak{M}$-vector spaces

$R^{n}/\mathfrak{M}R^{n}\cong(R/\mathfrak{M}R)^{n}\cong(0:_{R}\mathfrak{M})^{n}=0:_{R^{n}}\mathfrak{M},$

where the central isomorphism follows from the definition of a Gorenstein
local ring. Then $\mu(R^{n})=\mu(0:_{R^{n}}\mathfrak{M})=n$ by Theorem 1.5.

For general $\ell$, one has

$M(R^{n})=\mu(R_{1}^{n})+\ldots+\mu(R_{\ell}^{n}).$

Moreover,
$0:_{R^{n}}J=\left(0:_{R_{1}^{n}}\mathfrak{M}_{1}\right)\times\ldots\times\left(0:_{R_{\ell}^{n}}\mathfrak{M}_{\ell}\right)$,
hence

$M(0:_{R^{n}}J)=\mu\left(0:_{R_{1}^{n}}\mathfrak{M}_{1}\right)+\ldots+\mu\left(0:_{R_{\ell}^{n}}\mathfrak{M}_{\ell}\right).$

It follows from the previous case ($\ell=1$) that

$\mu(R_{i}^{n})=\mu(0:_{R_{i}^{n}}\mathfrak{M})=n$

for all $i\in[\ell].$

The argument of Example 1.11 also shows that, if the equality in Proposition
1.10 holds for $C=R^{n}$, for $R$ a finite local ring, then $R$ must be
Gorenstein. However, Proposition 1.10 is not true in general over finite
Gorenstein local rings. The next example illustrating this was suggested to us
by Maria Evelina Rossi.

######  Example 1.12.

Let $R=\mathbb{F}_{2}[x,y]/(x^{2},y^{2})$. Then $R$ is a finite local ring
with maximal ideal $\mathfrak{M}=(x,y)$. Let $C=\mathfrak{M}$. Then
$\mu(C)=2$, but $\mu(0:_{C}\mathfrak{M})=\mu(\langle xy\rangle)=1$.

##  2 Supports and generalized weights

In this section we develop an algebraic theory of supports over a finite
commutative ring $R$. We propose a general definition of support as a map
$R^{n}\to\mathbb{N}^{u}$, which naturally induces a notion of generalized
weights for codes $C\subseteq R^{n}$. This extends the notion of generalized
Hamming weights for codes that are linear over a finite field
${\mathbb{F}}_{q}$. We establish some properties of support functions and
generalized weights. We also define a family of supports, the modular
supports, whose associated generalized weights will be studied in the next
sections.

######  Notation 2.1.

In the sequel, $u\geq 1$ is an integer. For $s,t\in{\mathbb{N}}^{u}$ write
$s\leq t$ if $s_{i}\leq t_{i}$ for all $i\in[u]$. Then
$({\mathbb{N}}^{u},\leq)$ is a (poset) lattice. The meet of
$s,t\in{\mathbb{N}}^{u}$ is the element $s\wedge t\in{\mathbb{N}}^{u}$ given
by $(s\wedge t)_{i}=\min\\{s_{i},t_{i}\\}$ for all $i\in[u]$. The join of
$s,t\in{\mathbb{N}}^{u}$, denoted by $s\vee t$, is $(s\vee
t)_{i}=\max\\{s_{i},t_{i}\\}$ for all $i\in[u]$. For $s\in\mathbb{N}^{u}$, we
let $|s|:=s_{1}+\cdots+s_{u}$.

######  Definition 2.2.

A support on $R^{n}$ is a function $\sigma:R^{n}\to{\mathbb{N}}^{u}$ with the
following properties.

  1. (P1)

$\sigma(v)=0$ if and only if $v=0$.

  2. (P2)

$\sigma(rv)\leq\sigma(v)$ for all $r\in R$ and $v\in R^{n}$.

  3. (P3)

$\sigma(v+w)\leq\sigma(v)\vee\sigma(w)$ for all $v,w\in R^{n}$.

A support function $\sigma:R^{n}\to\mathbb{N}^{u}$ satisfies the following
additional properties.

######  Lemma 2.3.

Let $\sigma:R^{n}\to\mathbb{N}^{u}$ be a support. The following hold.

  1. (P4)

If $v\in R^{n}$ and $r\in R$ is a unit, then $\sigma(rv)=\sigma(v)$.

  2. (P5)

If $v,w\in R^{n}$ and $i\in[u]$ satisfy $\sigma(v)_{i}=0$ and
$\sigma(w)_{i}\neq 0$, then $\sigma(w+v)_{i}\neq 0$.

  3. (P6)

If $v,w\in R^{n}$ and $i\in[u]$ satisfy $\sigma(v)_{i}=\sigma(w)_{i}=0$, then
$\sigma(w+v)_{i}=0$.

###### Proof.

The first claim easily follows from Property (P2). To see the second, suppose
towards a contradiction that $\sigma(w+v)_{i}=0$. Since $w=(w+v)+(-v)$, by
(P3) and the first claim we have
$\sigma(w)\leq\sigma(w+v)\vee\sigma(-v)=\sigma(w+v)\vee\sigma(v)$, from which
$\sigma(w)_{i}=0$, a contradiction. Finally, the third claim follows from
Property (P3). ∎

A support $\sigma:R^{n}\to\mathbb{N}^{u}$ naturally induces a weight function
$\textnormal{wt}:R^{n}\to\mathbb{N}$.

######  Definition 2.4.

The weight of $v\in R^{n}$ is $\textnormal{wt}(v):=|\sigma(v)|$. The minimum
weight and maximum weight of a code $0\neq C\subseteq R^{n}$ are,
respectively,

$\min\textnormal{wt}(C):=\min\\{\textnormal{wt}(v)\,:\,v\in
C\setminus\\{0\\}\\}\qquad\mbox{and}\qquad\max\textnormal{wt}(C):=\max\\{\textnormal{wt}(v)\,:\,v\in
C\\}.$

Notice that the function $\textnormal{wt}:R^{n}\to{\mathbb{N}}$ has indeed the
properties of a weight, since $\textnormal{wt}(v)\geq 0$ for all $v$,
$\textnormal{wt}(v)=0$ if and only if $v=0$, and
$\textnormal{wt}(u+v)\leq\textnormal{wt}(u)+\textnormal{wt}(v)$ for all
$u,v\in R^{n}$. In addition, the weight satisfies
$\textnormal{wt}(rv)\leq\textnormal{wt}(v)$ for all $r\in R$ and $v\in R^{n}$
and $\textnormal{wt}(rv)=\textnormal{wt}(v)$ for $r\in R$ invertible and $v\in
R^{n}$.

We give some examples of support functions. Many others can be obtained by
applying Proposition 2.7 to these examples.

######  Example 2.5.

  1. (1)

The function $\sigma:\mathbb{F}_{2}^{2}\to\\{0,1,2\\}^{3}$ defined by
$\sigma(0,0)=(0,0,0)$, $\sigma(1,0)=(2,0,2)$, $\sigma(0,1)=(2,1,0)$, and
$\sigma(1,1)=(0,1,2)$ is a support.

  2. (2)

Let $R$ a be finite ring and let $0=I_{0}\subsetneq
I_{1}\subsetneq\cdots\subsetneq I_{\epsilon-1}\subsetneq I_{\epsilon}=R$ be a
chain of ideals of $R$. For $r\in R$, let $\sigma(r):=\min\\{0\leq
i\leq\epsilon\,:\,r\in I_{i}\\}$. Extend $\sigma$ coordinatewise to
$\sigma:R^{n}\to\\{0,\ldots,\epsilon\\}^{n}$. It can be checked that $\sigma$
is a support, called the chain support on $R$, see [15, Example 26].

  3. (3)

Let $R$ be a finite chain ring. The chain support associated to the full chain
of ideals of $R$ is the chain ring support on $R$.

  4. (4)

If $R=\mathbb{F}_{q}$ is a finite field, the chain ring support coincides with
the Hamming support
$\sigma^{\textnormal{H}}:\mathbb{F}_{q}^{n}\to\\{0,1\\}^{n}$, given by
$\sigma^{\textnormal{H}}(v)_{i}=1$ if $v_{i}\neq 0$ and
$\sigma^{\textnormal{H}}(v)_{i}=0$ if $v_{i}=0$. See [12] for a general
reference on Hamming-metric codes.

  5. (5)

In his master thesis [5], written under the direction of J. Rosenthal and V.
Weger, N. Gassner introduces the $p$-adic weight and distance on
$\mathbb{Z}_{p^{e}}^{n}$, where $p$ is prime and $e\geq 1$. The $p$-adic
weight on $\mathbb{Z}_{p^{e}}$ induces the same partition as the weight
associated to the chain ring support of $\mathbb{Z}_{p^{e}}$.

Not all the supports studied in the coding theory literature are supports
according to Definition 2.2.

######  Example 2.6.

The Lee weight $\textnormal{wt}^{\textnormal{L}}:\mathbb{Z}_{4}\to\\{0,1,2\\}$
is defined by $\textnormal{wt}^{\textnormal{L}}(0)=0$,
$\textnormal{wt}^{\textnormal{L}}(1)=\textnormal{wt}^{\textnormal{L}}(3)=1$
and $\textnormal{wt}^{\textnormal{L}}(2)=2$. Its coordinatewise extension to
$\mathbb{Z}_{4}^{n}$ is not a support in the sense of Definition 2.2. For
instance,
$\textnormal{wt}^{\textnormal{L}}(1+1)=2\not\leq\max\\{\textnormal{wt}^{\textnormal{L}}(1),\textnormal{wt}^{\textnormal{L}}(1)\\}=1$,
contradicting Property (P3).

In the next proposition we list some simple operations that allow one to
construct new supports from known ones. The proof is straightforward and left
to the reader.

######  Proposition 2.7.

  1. (1)

Let $\sigma:R^{n}\to\mathbb{N}^{u}$ be a function and let
$s:\mathbb{N}^{u}\to\mathbb{N}^{u}$ be a permutation of the coordinates. Then
$\sigma$ is a support if and only if $s\circ\sigma$ is a support.

  2. (2)

Let $\sigma_{i}:R^{n_{i}}\to\mathbb{N}^{u_{i}}$ be functions, $i\in[\ell]$.
Let $n=n_{1}+\ldots+n_{\ell}$ and $u=u_{1}+\ldots+u_{\ell}$. Let

$\sigma=\sigma_{1}\times\cdots\times\sigma_{\ell}:R^{n}\to\mathbb{N}^{u},\qquad(v_{1},\ldots,v_{\ell})\mapsto(\sigma_{1}(v_{1}),\ldots,\sigma_{\ell}(v_{\ell})).$

Then $\sigma$ is a support if and only if $\sigma_{1},\ldots,\sigma_{\ell}$
are supports.

  3. (3)

Let $\sigma:R^{n}\to\mathbb{N}^{u}$,
$\sigma(v)=(\sigma_{1}(v),\ldots,\sigma_{u}(v))$, be a function. Let
$i\in[u]$, $a\in\mathbb{N}\setminus\\{0\\}$, and define

$\sigma_{i,a}:R^{n}\to\mathbb{N}^{u},\qquad
v\mapsto(\sigma_{1}(v),\ldots,\sigma_{i-1}(v),a\sigma_{i}(v),\sigma_{i+1}(v),\ldots,\sigma_{u}(v)).$

Then $\sigma$ is a support if and only if $\sigma_{i,a}$ is.

  4. (4)

Let $\sigma:R^{n}\to\mathbb{N}^{u}$,
$\sigma(v)=(\sigma_{1}(v),\ldots,\sigma_{u}(v))$. For $i\in[u]$, let

$\tilde{\sigma}_{i}:R^{n}\to\mathbb{N}^{u+1},\qquad
v\mapsto(\sigma_{1}(v),\ldots,\sigma_{i-1}(v),\sigma_{i}(v),\sigma_{i}(v),\sigma_{i+1}(v),\ldots,\sigma_{u}(v)).$

Then $\sigma$ is a support if and only if $\tilde{\sigma}_{i}$ is.

  5. (5)

Let $\sigma:R^{n}\to\mathbb{N}^{u}$,
$\sigma(v)=(\sigma_{1}(v),\ldots,\sigma_{u}(v))$, be a support and let
$i\in[u]$. Assume that there are no $a\in\mathbb{N}\setminus\\{0\\}$ and $v\in
R^{n}$ such that $\sigma(v)=(0,\ldots,0,a,0,\ldots,0)$, where $a$ appears in
the $i$th entry. Then

$\hat{\sigma}_{i}:R^{n}\to\mathbb{N}^{u-1},\qquad
v\mapsto(\sigma_{1}(v),\ldots,\sigma_{i-1}(v),\sigma_{i+1}(v),\ldots,\sigma_{u}(v))$

is a support.

  6. (6)

Let $\sigma:R^{n}\to\mathbb{N}^{u}$ be a function,
$\sigma(v)=(\sigma_{1}(v),\ldots,\sigma_{u}(v))$. For $i\in[u]$, let

$\check{\sigma}_{i}:R^{n}\to\mathbb{N}^{u+1},\qquad
v\mapsto(\sigma_{1}(v),\ldots,\sigma_{i-1}(v),\sigma_{i}(v),0,\sigma_{i+1}(v),\ldots,\sigma_{u}(v)).$

Then $\sigma$ is a support if and only if $\check{\sigma}_{i}$ is.

  7. (7)

Let $\sigma:R^{n}\to\mathbb{N}^{u}$ be a support and let $f:R^{k}\to R^{n}$ be
an injective $R$-linear map. Then $\sigma\circ f:R^{k}\to\mathbb{N}^{u}$ is a
support.

  8. (8)

Let $\sigma_{i}:R^{n}\to\mathbb{N}^{u_{i}}$ be supports, $i\in[k]$. Then
$\sigma=(\sigma_{1},\ldots,\sigma_{k}):R^{n}\to\mathbb{N}^{u_{1}+\ldots+u_{k}}$
is a support.

Similarly to the situation of linear codes endowed with the Hamming support, a
support function over a finite commutative ring $R$ induces a notion of
support of a code. In turn, this allows us to define generalized weights for
$R$-linear codes.

######  Definition 2.8.

The support of a code $C\subseteq R^{n}$ is

$\sigma(C):=\bigvee_{v\in C}\sigma(v)\in{\mathbb{N}}^{u}.$

Notice that the support of a code is determined by the supports of the vectors
in any system of generators. More precisely, let $C=\langle
v_{1},\ldots,v_{k}\rangle\subseteq R^{n}$. Since, by Definition 2.2,

$\sigma(r_{1}v_{1}+\ldots+r_{k}v_{k})\leq\sigma(r_{1}v_{1})\vee\ldots\vee\sigma(r_{k}v_{k})\leq\sigma(v_{1})\vee\ldots\vee\sigma(v_{k})$

for any $r_{1},\ldots,r_{k}\in R$, we have

$\sigma(C)=\bigvee_{i=1}^{k}\sigma(v_{i}).$ (2.1)

Moreover, if $D\subseteq C$, then by definition $\sigma(D)\leq\sigma(C)$.

######  Example 2.9.

Equation (2.1) does not hold for the Lee weight
$\textnormal{wt}^{\textnormal{L}}:\mathbb{Z}_{4}\to\\{0,1,2\\}$, nor for its
coordinatewise extension to $\mathbb{Z}_{4}^{n}$. For example,
$\textnormal{wt}^{\textnormal{L}}(\langle
1\rangle)=2>1=\textnormal{wt}^{\textnormal{L}}(1)$, see also Example 2.6.

######  Definition 2.10.

For $r\in[M(C)]$, the $r$-th generalized weight of $C$ is the integer

$d_{r}(C):=\min\\{|\sigma(D)|\,:\,D\in\mathcal{S}_{j}(C)\mbox{ for some }j\geq
r\\}.$

We also set

$d_{0}(C):=0.$

It follows from Theorem 1.8 that for $r\in[M(C)]$ we have
$\mathcal{S}_{r}(C)\neq\emptyset$. Hence $d_{r}(C)$ is well-defined.

######  Remark 2.11.

For $r\in[M(C)]$ one has

$d_{r}(C)=\min\\{|\sigma(D)|\,:\,D\in\mathcal{S}_{r}(C)\\}.$

Indeed, let $j\geq r$ and let $D\in\mathcal{S}_{j}(C)$. Then there exists a
$D^{\prime}\subseteq D$ such that $D^{\prime}\in\mathcal{S}_{r}(C)$ and
$|\sigma(D^{\prime})|\leq|\sigma(D)|$.

In the next lemma we collect a few easy consequences of Definition 2.10.

######  Lemma 2.12.

Let $D\subseteq C\subseteq R^{n}$ be codes. The following hold.

  1. (1)

$d_{1}(C)=\min\textnormal{wt}(C)$.

  2. (2)

$d_{r}(D)\geq d_{r}(C)$ for $r\in[\min\\{M(D),M(C)\\}]$.

  3. (3)

$d_{r+1}(C)\geq d_{r}(C)$ for $r\in[M(C)-1]$.

  4. (4)

$d_{r}(C)=\min\\{|\sigma(D)|\,:\,D\subseteq C,\,M(D)\geq r\\}$ for
$r\in[M(C)]$.

###### Proof.

By Property (P2) one has $\sigma(\langle v\rangle)=\sigma(v)$ for any $v\in
C$. Hence (1) follows, thanks to Remark 2.11. Part (2) holds since every
subcode of $D$ is also a subcode of $C$. Part (3) follows from observing that
$d_{r}$ is the minimum of the function $|\sigma(D)|$ for $D$ ranging over the
set $\mathcal{S}_{r}(C)\cup\ldots\cup\mathcal{S}_{M(C)}(C)$ and passing from
$r$ to $r+1$ we minimize over a subset. In order to prove (4), let $i\geq r$
and $D\in\mathcal{S}_{i}(C)$. Then $M(D)\geq i$ by Theorem 1.8. Therefore, if
$D\in\mathcal{S}_{i}(C)$ for some $i\geq r$, then $D\in\mathcal{S}_{M(D)}(C)$
and $M(D)\geq r$. Since every $D\subseteq C$ belongs to
$\mathcal{S}_{M(D)}(C)$, then $\\{D\in\mathcal{S}_{i}(C)\mbox{ for some }i\geq
r\\}=\\{D\subseteq C,\,M(D)\geq r\\}$. Therefore

$d_{r}(C)=\min\\{|\sigma(D)|\,:\,D\in\mathcal{S}_{i}(C)\mbox{ for some }i\geq
r\\}=\min\\{|\sigma(D)|\,:\,D\subseteq C,\,M(D)\geq r\\}.\qed$

We now show how the structure of supports relate to the decomposition of $R$
in (1.1).

######  Proposition 2.13.

Let $\sigma:R^{n}\rightarrow\mathbb{N}^{u}$ be a support. Then for any
$v=(v_{1},\ldots,v_{\ell})\in R^{n}=R_{1}^{n}\times\ldots\times R_{\ell}^{n}$
we have

$\sigma(v)=\sigma_{1}(v_{1})\vee\ldots\vee\sigma_{\ell}(v_{\ell}),$

where $\sigma_{i}:R_{i}^{n}\rightarrow\mathbb{N}^{u}$ is as support defined
via $\sigma_{i}(v_{i}):=\sigma(e_{i}v)$ for all $i\in[\ell]$.

###### Proof.

It is easy to check that $\sigma_{i}$ is well-defined and is a support for all
$i\in[\ell]$. One has $\sigma_{i}(v_{i})=\sigma(e_{i}v)\leq\sigma(v)$, hence
$\sigma_{1}(v_{1})\vee\ldots\vee\sigma_{\ell}(v_{\ell})\leq\sigma(v)$.
Furthermore,

$\sigma(v)=\sigma\left(\sum_{i=1}^{\ell}e_{i}v\right)\leq\bigvee_{i=1}^{\ell}\sigma(e_{i}v)=\bigvee_{i=1}^{\ell}\sigma_{i}(v_{i}).$

It follows that
$\sigma(v)=\sigma_{1}(v_{1})\vee\ldots\vee\sigma_{\ell}(v_{\ell})$, as
desired. ∎

######  Remark 2.14.

When $R$ is a finite chain ring, support functions on $R$ have a simple
description. To see this, let $\alpha$ be a generator of the maximal ideal of
$R$ and let $\epsilon=\min\\{i>0\,:\,\alpha^{i}=0\\}$. Let
$\sigma,\tau:R\rightarrow\mathbb{N}^{u}$ be supports. Then $\sigma=\tau$ if
and only if $\sigma(\alpha^{i})=\tau(\alpha^{i})$ for $0\leq i\leq\epsilon-1$.
Indeed, every element of $R\setminus\\{0\\}$ is of the form $r\alpha^{i}$
where $r$ is a unit and $0\leq i\leq\epsilon-1$, and
$\sigma(r\alpha^{i})=\sigma(\alpha^{i})$. Therefore, a support
$\sigma:R\rightarrow\mathbb{N}^{u}$ corresponds to a set of vectors
$a^{(0)},a^{(1)},\ldots,a^{(\epsilon-1)}\in\mathbb{N}^{u}$ with the property
that $a^{(0)}\geq a^{(1)}\geq\ldots\geq a^{(\epsilon-1)}$. The correspondence
is determined by setting $\sigma(\alpha^{i})=a^{(i)}$ for all
$i\in\\{0,\ldots,\epsilon-1\\}$. In particular, any support on $R$ induces the
same partition as a chain support.

###  2.1 Modular Supports

In this subsection we define and study a class of supports whose structure is
closely related to the $R$-module structure of $R^{n}$, and that we therefore
call modular. This paper is primarily devoted to the study of generalized
weights associated to modular supports.

######  Definition 2.15.

A support $\sigma$ is modular if it satisfies the following:

  1. (P$\star$)

If $v,w\in R^{n}$ and $i\in[u]$ satisfy $0\neq\sigma(v)_{i}\leq\sigma(w)_{i}$,
then there exists $r\in R$ such that $\sigma(v+rw)_{i}<\sigma(v)_{i}$.

######  Remark 2.16.

By repeatedly applying Property (P$\star$), one obtains the following
equivalent property: If $v,w\in R^{n}$ and $i\in[u]$ satisfy
$0\neq\sigma(v)_{i}\leq\sigma(w)_{i}$, then there exists $r\in R$ such that
$\sigma(v+rw)_{i}=0$.

As for supports, one can easily produce new modular supports from known ones.

######  Proposition 2.17.

Let $\sigma:R^{n}\rightarrow{\mathbb{N}}^{u}$ be a support. Following the
notation and numbering of Proposition 2.7, we have:

  1. (1)

$\sigma$ is modular if and only if $s\circ\sigma$ is modular;

  2. (2)

$\sigma_{1},\ldots,\sigma_{\ell}$ are modular if and only if $\sigma$ is
modular;

  3. (3)

$\sigma$ is modular if and only if $\sigma_{i,a}$ is modular;

  4. (4)

$\sigma$ is modular if and only if $\tilde{\sigma}_{i}$ is modular;

  5. (5)

if $\sigma$ is modular, then $\hat{\sigma}_{i}$ is modular;

  6. (6)

$\sigma$ is modular if and only if $\check{\sigma}_{i}$ is modular;

  7. (7)

if $\sigma$ is modular, then $\sigma\circ f$ is modular;

  8. (8)

if $\sigma_{1},\ldots,\sigma_{k}$ are modular, then
$\sigma=(\sigma_{1},\ldots,\sigma_{k})$ is modular.

Several, but not all, of the supports that we have encountered so far are
modular.

######  Example 2.18.

Support (1) of Example 2.5 is modular, while an arbitrary chain support is
not. Over a finite chain ring, the only modular chain support is the chain
ring support. For example, the chain support on $\mathbb{Z}_{4}$ associated
with the chain $0\subsetneq\mathbb{Z}_{4}$ is not modular. Indeed,
$\sigma(2)=\sigma(4)=1$, but there is no $r\in\mathbb{Z}_{4}$ with $2-4r=0$.

The Hamming support is an example of modular support.

######  Example 2.19.

It is easy to check that the chain ring support of Example 2.5(3) is modular.
Hence a product of chain ring supports is modular by Proposition 2.7 and
Proposition 2.17(2). In particular, the Hamming support is modular.

######  Example 2.20.

The supports of Remark 2.14 are modular if and only if
$(a^{(j)})_{i}\neq(a^{(k)})_{i}$ for all $j,k\in\\{0,\ldots,\epsilon-1\\}$
distinct and $i\in[u]$.

We now give more examples of supports which are not modular.

######  Example 2.21.

Let $R=\mathbb{F}_{2}$ and let $\sigma:\mathbb{F}_{2}^{2}\to\\{0,1\\}^{2}$ be
defined by

$\sigma(0,0)=(0,0),\quad\sigma(1,0)=(1,1),\quad\sigma(0,1)=(0,1),\quad\sigma(1,1)=(1,1).$

Then $\sigma$ is a support which is not modular.

######  Example 2.22.

The chain support on $\mathbb{Z}_{6}$ associated with the chain
$(0)\subsetneq(2)\subsetneq\mathbb{Z}_{6}$ is not modular. Indeed,
$\sigma(2)=1$ and $\sigma(3)=2$, but there is no $r\in\mathbb{Z}_{6}$ with
$2-3r=0$.

The next result shows that every modular support over a finite commutative
ring decomposes as a product of modular supports over finite local rings.

######  Theorem 2.23.

Let $R$ be a finite commutative ring and let
$\sigma:R^{n}\rightarrow\mathbb{N}^{u}$ be a modular support. Up to a
permutation of the coordinates of $\mathbb{N}^{u}$ we have
$\sigma=\sigma_{1}\times\ldots\times\sigma_{\ell}$ where
$\sigma_{i}:R_{i}^{n}\rightarrow\mathbb{N}^{u_{i}}$ for $i\in[\ell]$ and
$u_{1},...,u_{\ell}$ are integers with $u_{1}+\ldots+u_{\ell}=u$. Moreover,
$\sigma_{i}$ is a modular support for all $i\in[\ell]$.

###### Proof.

For $v\in R^{n}$, write $v=(v_{1},\ldots,v_{\ell})$ with $v_{i}\in R_{i}^{n}$.
By Proposition 2.13 we have

$\sigma(v_{1},\ldots,v_{\ell})=\sigma_{1}(v_{1})\vee\ldots\vee\sigma_{\ell}(v_{\ell}),$

where $\sigma_{i}:R_{i}^{n}\rightarrow\mathbb{N}^{u}$ is a support defined via
$\sigma_{i}(v_{i}):=\sigma(e_{i}v)$, $i\in[\ell]$. We claim that for each
$x\in[u]$ there is at most one $i\in[\ell]$ such that
$\sigma_{i}(v_{i})_{x}\neq 0$ for some $v\in R^{n}$. Indeed, assume towards a
contradiction that there exist $i\neq j$ and $v,w\in R^{n}$ such that
$\sigma_{i}(v_{i})_{x},\sigma_{j}(w_{j})_{x}\neq 0$. Without loss of
generality we may assume that
$0<\sigma_{i}(v_{i})_{x}\leq\sigma_{j}(w_{j})_{x}$. By Property (P$\star$)
there exists $r=(r_{1},\ldots,r_{\ell})\in R$ such that

$\sigma(e_{i}v)_{x}>\sigma(e_{i}v+e_{j}rw)_{x}=[\sigma_{i}(v_{i})\vee\sigma_{j}(r_{j}w_{j})]_{x}\geq\sigma_{i}(v_{i})_{x},$

where the equality follows from Proposition 2.13. This a contradiction,
establishing the claim.

We have shown that for each $x\in[u]$ there exists at most one $i\in[\ell]$
for which $(\sigma_{i})_{x}$ is not the zero function. In other words, the
supports of the images of the functions $\sigma_{i}$ are disjoint. Up to
permuting the coordinates of $\mathbb{N}^{u}$, one may assume that
$\sigma_{1}$ is supported on the first $u_{1}$ coordinates, $\sigma_{2}$ on
the next $u_{2}$,…, and $\sigma_{\ell}$ on the last $u_{\ell}$. Therefore one
may regard each $\sigma_{i}$ as a function which takes values in
$\mathbb{N}^{u_{i}}$. Then $\sigma=\sigma_{1}\times\ldots\times\sigma_{\ell}$
and each $\sigma_{i}$ is a modular support by Proposition 2.7(2) and
Proposition 2.17(2). ∎

By combining Remark 2.14 with Theorem 2.23, support functions on a principal
ideal ring $R$ can be easily characterized as follows.

######  Corollary 2.24.

Let $R$ be a finite principal ideal ring and let
$\sigma:R\rightarrow\mathbb{N}^{u}$ be a modular support. By the Zariski-
Samuel Theorem, $R=R_{1}\times\ldots\times R_{\ell}$ where
$R_{1},\ldots,R_{\ell}$ are finite chain rings. For each $i$, let $\alpha_{i}$
be a generator of the maximal ideal of $R_{i}$ and let
$\epsilon_{i}:=\min\\{j\,:\,\alpha_{i}^{j}=0\\}$. Then there exist
$u_{1},\ldots,u_{\ell}$ such that $u_{1}+\ldots+u_{\ell}=u$ and
$\sigma=\sigma_{1}\times\ldots\times\sigma_{\ell}$, where
$\sigma_{i}:R_{i}\rightarrow\mathbb{N}^{u_{i}}$ for $i\in[\ell]$. Let
$\sigma_{i}(\alpha_{i}^{j})=a^{(i,j)}\in\mathbb{N}^{u_{i}}$ for $i\in[\ell]$
and $j\in\\{0,\ldots,\epsilon_{i}-1\\}$. Then
$(a^{(i,j-1)})_{k}>(a^{(i,j)})_{k}$ for $j\in[\epsilon_{i}-1]$, $i\in[\ell]$,
$k\in[u_{i}]$.

Conversely, any set of vectors $a^{(i,j)}\in\mathbb{N}^{u_{i}}$ such that
$a^{(i,j-1)}\geq a^{(i,j)}$ for $j\in[\epsilon_{i}-1]$ and $i\in[\ell]$
defines a support $\sigma=\sigma_{1}\times\ldots\times\sigma_{\ell}$ on $R$
via $\sigma_{i}(r\alpha_{i}^{j})=a^{(i,j)}$ for
$i\in[\ell],j\in\\{0,\ldots,\epsilon_{i}-1\\}$, and $r\in R_{i}$ invertible.
Moreover, if $(a^{(i,j-1)})_{k}>(a^{(i,j)})_{k}$ for $j\in[\epsilon_{i}-1]$,
$i\in[\ell]$, and $k\in[u_{i}]$, then $\sigma$ is modular.

The following is a reformulation of Property (P$\star$) for elements of
$0:_{R^{n}}J$.

######  Corollary 2.25.

Assume that $\sigma$ is modular. If $v,w\in 0:_{R^{n}}J$ and $i\in[u]$ satisfy
$\sigma(v)_{i}\neq 0$ and $\sigma(w)_{i}\neq 0$, then there exists a unit
$r\in R$ with $\sigma(v-rw)_{i}=0$.

###### Proof.

By Theorem 2.23 we may assume without loss of generality that $R$ is a finite
local ring. Indeed, let $j\in[\ell]$ be such that $(\sigma_{j})_{i}$ is not
identically zero and suppose that $\sigma_{j}(v_{j}-r_{j}w_{j})_{i}=0$ for
some $r_{j}\in R_{j}$ invertible, then $r=(1,\ldots,1,r_{j},1,\ldots,1)\in R$
is invertible and satisfies $\sigma(v-rw)_{i}=0$.

Assume now that $(R,\mathfrak{M})$ is a finite local ring. If
$\sigma(v)_{i}\leq\sigma(w)_{i}$, then by Property (P$\star$) there is $r\in
R$ such that $\sigma(v-rw)_{i}=0$. If $r\in\mathfrak{M}$, then $rw=0$, hence
$\sigma(v)_{i}=0$, contradicting the assumption in the statement. Therefore
$r$ is invertible. Similarly, if $\sigma(w)_{i}\leq\sigma(v)_{i}$, then there
exists $s\in R$ invertible such that
$0=\sigma(w-sv)_{i}=\sigma(v-s^{-1}w)_{i}$. ∎

##  3 Codewords and subcodes of minimal support

In this section we study the codewords and subcodes of minimal support of an
$R$-linear code endowed with a modular support. In particular, we establish
some properties of the systems of generators of subcodes of minimal support.
This allows us to derive properties of the generalized weights, such as
monotonicity and a generalization of the Singleton bound.

In the sequel, we follow the notation of the previous sections and let
$\sigma:R^{n}\to\mathbb{N}^{u}$ be a modular support. The minimal codewords of
a code play a central role in our work. They are defined as follows.

######  Definition 3.1.

Let $C\subseteq R^{n}$ be a code. We say that $v\in C\setminus\\{0\\}$ is
minimal in $C$ if its support is minimal among the supports of the elements of
$C\setminus\\{0\\}$. We denote by $\textnormal{Min}(C)$ the set of minimal
codewords of $C$.

######  Remark 3.2.

By definition, $C=0$ has no minimal codewords, i.e.,
$\textnormal{Min}(0)=\emptyset$.

We start by observing that a modular support $\sigma:R^{n}\to\mathbb{N}^{u}$
that takes values in $\\{0,1\\}^{u}$ allows us to associate a matroid to a
code $C$. More precisely, the minimal ones among the supports of the codewords
of $C$ are the circuits of a matroid. This generalizes the well-known fact
that one may associate to a linear block-code the matroid represented by its
parity-check matrix, whose circuits correspond to the minimal supports of the
nonzero codewords of $C$ with respect to the Hamming weight.

######  Theorem 3.3.

Let $R$ be a finite commutative ring and let $\sigma:R^{n}\to\\{0,1\\}^{u}$ be
a modular support. Let $0\neq C\subseteq R^{n}$ be a code. Then the elements
of the set

$\mathcal{C}:=\\{\sigma(v)\,:\,v\in\textnormal{Min}(C)\\}$

are the circuits of a matroid.

###### Proof.

If a support $\sigma$ takes values in $\\{0,1\\}^{u}$, then the support of a
vector can be naturally identified with a subset of $[u]$. In order to show
that $\mathcal{C}$ is the set of circuits of a matroid, we check the circuit
axioms as stated in [14, page 9].

Properties (C1) and (C2) are immediate to verify. To see that Property (C3)
holds, suppose that $\sigma(v),\sigma(w)\in\mathcal{C}$, that
$\sigma(v)\neq\sigma(w)$, and that $(\sigma(v)\wedge\sigma(w))_{i}\neq 0$. By
repeatedly applying Property (P$\star$) and up to exchanging the role of $v$
and $w$, one sees that there exists $r\in R$ with $\sigma(v-rw)_{i}=0$. We
claim that $v-rw\neq 0$. Indeed, if $v=rw$ then we would have
$\sigma(v)=\sigma(rw)\leq\sigma(w)$. Since $\sigma(w)$ is minimal by
assumption and $v\neq 0$, it must be that $\sigma(v)=\sigma(w)$, a
contradiction.

Since $v-rw\neq 0$, we have $\sigma(v-rw)\neq 0$. Fix $z\in C$ with
$\sigma(z)\in\mathcal{C}$, $\sigma(z)\leq\sigma(v-rw)$. We have

$\sigma(z)\leq\sigma(v-rw)\leq\sigma(v)\vee\sigma(-rw)\leq\sigma(v)\vee\sigma(w).$
(3.1)

Moreover, $0=\sigma(v-rw)_{i}\geq\sigma(z)_{i}$. This establishes Property
(C3). ∎

We start our study of the minimal codewords by showing that the minimal
codewords of a code $C$ coincide with those of its socle. We also show that
the minimal codewords are determined by their support, up to multiplication by
a unit.

######  Theorem 3.4.

Let $C\subseteq R^{n}$ be a code and assume that $\sigma$ is modular. The
following hold.

  1. (1)

The set of minimal codewords of $C$ is

$\displaystyle\textnormal{Min}(C)$ $\displaystyle=$
$\displaystyle\bigcup_{i=1}^{\ell}(0\times\ldots\times
0\times\textnormal{Min}(C_{i})\times 0\times\ldots\times 0)$
$\displaystyle\subseteq$
$\displaystyle\bigcup_{i=1}^{\ell}(0\times\ldots\times
0\times(0:_{C_{i}}\mathfrak{M}_{i})\times 0\times\ldots\times
0)\;\;\subseteq\;\;0:_{C}J.$

  2. (2)

In particular,

$\textnormal{Min}(C)=\textnormal{Min}(0:_{C}J).$

  3. (3)

If $v,w\in\textnormal{Min}(C)$ are minimal codewords with
$\sigma(v)=\sigma(w)$, then $v=rw$ for some invertible $r\in R$.

###### Proof.

  1. (1)

By Theorem 2.23, up to a permutation of the coordinates of $\mathbb{N}^{u}$,
$\sigma$ decomposes as a product
$\sigma=\sigma_{1}\times\ldots\times\sigma_{\ell}$, where each $\sigma_{i}$ is
a modular support. Let $i\in[\ell]$ and
$v=(v_{1},\ldots,v_{\ell})\in\textnormal{Min}(C)$ with $v_{i}\neq 0$. Then
$0\neq\sigma(e_{i}v)\leq\sigma(v)$, hence $\sigma(e_{i}v)=\sigma(v)$. In
particular, $\sigma_{j}(v_{j})=0$ for all $j\neq i$, hence $v_{j}=0$ for all
$j\neq i$. Therefore, $v=e_{i}v$ and $v_{i}\in\textnormal{Min}(C_{i})$. This
proves the equality in the statement.

Suppose now that $(R,\mathfrak{M})$ is a finite local ring and
$v\in\textnormal{Min}(C)$. If $r\in R$ is such that $rv\neq 0$, then
$\sigma(v)=\sigma(rv)$. Since $\sigma$ is modular, there exists $s\in R$ such
that $\sigma(v-srv)<\sigma(v)$, hence $v-srv=0$ by the minimality of
$\sigma(v)$. Hence $1-sr\in 0:_{R}v\subseteq\mathfrak{M}$. This shows that
$sr\not\in\mathfrak{M}$, hence $r\not\in\mathfrak{M}$. Therefore, $v\in
0:_{C}\mathfrak{M}$, which proves the second inclusion.

The inclusion follows from the fact that
$0:_{C}J=(0:_{C_{1}}\mathfrak{M}_{1})\times\ldots\times(0:_{C_{\ell}}\mathfrak{M}_{\ell})$.

  2. (2)

This follows from part (1), since $0:_{C}J\subseteq C$ implies

$\textnormal{Min}(0:_{C}J)\supseteq\textnormal{Min}(C)\cap(0:_{C}J)=\textnormal{Min}(C),$

where the equality follows from part (1). Conversely, if
$v\in\textnormal{Min}(0:_{C}J)$, then there exists $w\in\textnormal{Min}(C)$
such that $\sigma(w)\leq\sigma(v)$. Since $w\in 0:_{C}J$ by part (1), then
$\sigma(w)=\sigma(v)$ and $v\in\textnormal{Min}(C)$.

  3. (3)

Since $\sigma$ is modular, there exists $r\in R$ such that
$\sigma(v-rw)<\sigma(v)$. By the minimality of $\sigma(v)$, $v-rw=0$, hence
$v=rw$. Exchanging the roles of $v$ and $w$ one sees that there exists $s\in
R$ such that $w=sv$. Therefore, $(1-rs)v=0$, so $1-rs\in 0:_{R}v$. By part
(1), $v=e_{i}v$ for some $i\in[\ell]$ and $0:_{R}v=R_{1}\times\ldots\times
R_{i-1}\times\mathfrak{M}_{i}\times R_{i+1}\times\ldots\times R_{\ell}$. Since
$1-s_{i}r_{i}\in\mathfrak{M}_{i}$, then $r_{i}\not\in\mathfrak{M}_{i}$, hence
$r_{i}$ is invertible. Let $\overline{r}=(1,\ldots,1,r_{i},1,\ldots,1)$. Then
$v=\overline{r}w$ and $\overline{r}\in R$ is invertible. ∎

Theorem 3.4 implies that a code generated by its minimal codewords must be a
subcode of $0:_{R^{n}}J$. In the next theorem we prove that every subcode of
$0:_{R^{n}}J$ is generated by its minimal codewords.

######  Theorem 3.5.

Let $0\neq C\subseteq R^{n}$ be a code and assume that $\sigma$ is modular.
Then $0:_{C}J$ has a minimal system of generators consisting of codewords that
are minimal in $C$. Moreover, every minimal system of generators of $0:_{C}J$
consisting of minimal codewords has the same cardinality $M(0:_{C}J)$. In
particular, $C$ has a minimal system of generators consisting of minimal
codewords if and only if $C\subseteq 0:_{R^{n}}J$. If this is the case, then
every such minimal system of generators has cardinality $M(C)$.

###### Proof.

By Theorem 3.4(2) we have $\textnormal{Min}(C)=\textnormal{Min}(0:_{C}J)$. Let
$D=0:_{C}J$. Since every system of generators of $D$ contains a minimal one,
in order to show that $D$ has a minimal system of generators consisting of
minimal codewords, it suffices to show that the elements of
$\textnormal{Min}(D)$ generate $D$.

Let $v\in D$ and suppose by contradiction that $v$ is a codeword of minimal
support among those in the set $D\setminus\langle\textnormal{Min}(D)\rangle$.
Since $v\not\in\textnormal{Min}(D)$, then there is a $w\in\textnormal{Min}(D)$
such that $\sigma(w)<\sigma(v)$. Let $i\in[u]$ such that $\sigma(w)_{i}\neq
0$. By Theorem 3.4(1), $w=e_{j}w$ for some $j\in[\ell]$ and
$w_{j}\mathfrak{M}_{j}=0$. By Property (P$\star$) there exists $r\in R$ such
that $\sigma(w-rv)_{i}=0$. Since

$0=\sigma(w-rv)_{i}=\sigma(e_{j}w-e_{j}rv)_{i}<\sigma(e_{j}w)_{i}=\sigma(w)_{i},$
(3.2)

then $r_{j}\not\in\mathfrak{M}_{j}$. Indeed, $v\in 0:_{C}J$ implies that
$v_{j}\in 0:_{C_{j}}\mathfrak{M}_{j}$. Hence, if $r_{j}\in\mathfrak{M}_{j}$,
then $e_{j}w-e_{j}rv=e_{j}w$, contradictiong equation (3.2). Let
$s=(1,\ldots,1,r_{j},1,\ldots,1)\in R$. Then $s\in R$ is invertible and

$\sigma(w-sv)_{i}=\sigma(e_{j}w-e_{j}sv)_{i}=\sigma(e_{j}w-e_{j}rv)_{i}=\sigma(w-rv)_{i}=0.$

Then $\sigma(w-sv)<\sigma(v)$, hence by the minimality of $\sigma(v)$ among
the supports of elements of $D\setminus\langle\textnormal{Min}(D)\rangle$ we
have that $w-sv\in\langle\textnormal{Min}(D)\rangle$. Since $s$ is invertible,
this implies that $v\in\langle\textnormal{Min}(D)\rangle$, which contradicts
the assumption that $v\in D\setminus\langle\textnormal{Min}(D)\rangle$.

In order to prove that every minimal system of generators of $D$ consisting of
minimal codewords has cardinality $M(D)$, write $D=D_{1}\times\ldots\times
D_{\ell}$. By Theorem 3.4(1), every minimal codeword $v$ of $D$ satisfies
$v=e_{i}v$ for some $i\in[\ell]$. Therefore, each minimal system of generators
of $D$ consisting of minimal codewords is the union for $i\in[\ell]$ of
minimal systems of generators of $0\times\ldots\times 0\times D_{i}\times
0\times\ldots\times 0$. Since $R_{i}$ is a finite local ring, the cardinality
of any minimal system of generators of $0\times\ldots\times 0\times
D_{i}\times 0\times\ldots\times 0$ is $\mu(D_{i})$ by Theorem 1.5. Therefore,
the cardinality of a minimal system of generators of $D$ consisting of minimal
codewords is $\mu(D_{1})=\ldots+\mu(D_{\ell})=M(D)$. ∎

We stress that not every minimal system of generators of a code $C\subseteq
0:_{R^{n}}J$ consists of minimal codewords.

######  Example 3.6.

The element $(2,3)$ is not an element of minimal support in
$C=\langle(2,3)\rangle\subseteq\mathbb{Z}_{6}^{2}$. However, $(2,0),(0,3)$ are
elements of minimal support that generate $C$. Here
$C_{1}=\langle(2,0)\rangle\subseteq\mathbb{Z}_{3}^{2}$,
$C_{2}=\langle(0,1)\rangle\subseteq\mathbb{Z}_{2}^{2}$, and
$M(C)=\mu(C_{1})+\mu(C_{2})=2$.

The following property of minimal codewords will be needed in the next
proposition.

######  Lemma 3.7.

Let $\sigma$ be a modular support on $R^{n}$. Let $C\subseteq 0:_{R^{n}}J$ be
a code and let $v\in C$ with $\sigma(v)_{i}\neq 0$. Then there exists
$w\in\textnormal{Min}(C)$ with $\sigma(w)\leq\sigma(v)$ and $\sigma(w)_{i}\neq
0$.

###### Proof.

Write $C=C_{1}\times\ldots\times C_{\ell}$. By Theorem 2.23, we may assume
without loss of generality that $(R,\mathfrak{M})$ is a finite local ring.
Indeed, if $\sigma=\sigma_{1}\times\ldots\sigma_{\ell}$ and
$\sigma(v)_{i}=\sigma_{k}(v_{k})_{i}$ for some $k\in[\ell]$, then $e_{k}v\in
0\times\ldots\times 0\times R_{k}\times 0\times\ldots\times 0$ has
$\sigma(e_{k}v)\leq\sigma(v)$ and $\sigma(e_{k}v)_{i}\neq 0$. If
$w_{k}\in\textnormal{Min}(C_{k})$ and $\sigma_{k}(w_{k})_{i}\neq 0$, then
$\sigma_{k}(w_{k})\leq\sigma_{k}(v_{k})$, therefore

$\sigma(0,\ldots,0,w_{k},0,\ldots,0)\leq\sigma(e_{k}v)\leq\sigma(v)$

and $\sigma(0,\ldots,0,w_{k},0,\ldots,0)_{i}=\sigma_{k}(w_{k})_{i}\neq 0$.
Moreover, $(0,\ldots,0,w_{k},0,\ldots,0)\in\textnormal{Min}(C)$ as
$w_{k}\in\textnormal{Min}(C_{k})$.

Proceed by induction on $|\sigma(v)|$. Let $v^{\prime}\in\textnormal{Min}(C)$
with $\sigma(v^{\prime})\leq\sigma(v)$. If $\sigma(v^{\prime})_{i}\neq 0$ then
let $w=v^{\prime}$, else fix $j\in[u]$ with $\sigma(v^{\prime})_{j}\neq 0$. By
Corollary 2.25 there exists $r\in R$ invertible such that
$\sigma(v^{\prime}-rv)_{j}=0$. Hence $\sigma(v^{\prime}-rv)<\sigma(v)$ and
$\sigma(v^{\prime}-rv)_{i}\neq 0$, by Lemma 2.3(P5). So we may apply the
induction hypothesis to $v^{\prime}-rv$ and obtain $w\in\textnormal{Min}(C)$
such that $\sigma(w)\leq\sigma(v^{\prime}-rv)\leq\sigma(v)$ and
$\sigma(w)_{i}\neq 0$. ∎

We now prove that modularity allows us to produce minimal system of generators
of submodules of $0:_{R^{n}}J$, whose supports have a shape which is
reminiscent of the rows of a matrix in reduced row-echelon form.

######  Proposition 3.8.

Let $j\geq 1$ and let $C\in\mathcal{S}_{j}(0:_{R^{n}}J)$. If $\sigma$ is
modular, then $C$ has a minimal system of generators
$\\{v_{1},\ldots,v_{j}\\}$ such that for all $i\in[j]$ there exists
$k_{i}\in[u]$ with $\sigma(v_{i})_{k_{i}}\neq 0$ and $\sigma(v_{h})_{k_{i}}=0$
for all $h\neq i$.

###### Proof.

Any system of generators with the required property is minimal, since for all
$i\in[j]$

$\sigma(v_{i})\not\leq\bigvee_{h\neq i}\sigma(v_{h}).$

We prove that $C$ has such a system of generators by induction on $j$. The
statement is trivial if $j=1$. Hence assume $j\geq 2$ and fix a minimal system
of generators $\\{w_{1},\ldots,w_{j}\\}$ of $C$. Up to permuting the entries
in the supports, we may assume without loss of generality that
$\sigma(w_{1})_{1}\neq 0$. By Corollary 2.25 there exist
$r_{2},\ldots,r_{j}\in R$ with $\sigma(w_{i}-r_{i}w_{1})_{1}=0$ for all
$i\in\\{2,\ldots,j\\}$. Let $w^{\prime}_{i}:=w_{i}-r_{i}w_{1}$ for
$i\in\\{2,\ldots,j\\}$ and observe that $C$ is generated by
$\\{w_{1},w_{2}^{\prime},\ldots,w_{j}^{\prime}\\}$. Moreover,
$\sigma(v)_{1}=0$ for all $v\in C^{\prime}=\langle
w_{2}^{\prime},\ldots,w_{j}^{\prime}\rangle$ by Lemma 2.3(P6). We apply the
induction hypothesis to the code $C^{\prime}=\langle
w_{2}^{\prime},\ldots,w_{j}^{\prime}\rangle$, obtaining a system of generators
$\\{v_{2},\ldots,v_{j}\\}$ of $C^{\prime}$ such that for all
$i\in\\{2,\ldots,j\\}$ there exists $k_{i}$ with $\sigma(v_{i})_{k_{i}}\neq 0$
and $\sigma(v_{h})_{k_{i}}=0$ for $h\in\\{2,\ldots,j\\}\setminus\\{i\\}$. By
Corollary 2.25 we find $r_{2}^{\prime},\ldots,r_{j}^{\prime}\in R$ with
$\sigma(w_{1}-r_{i}^{\prime}v_{i})_{k_{i}}=0$ for $i\in\\{2,\ldots,j\\}$.
Finally, let $v_{1}:=w_{1}-\sum_{i=2}^{j}r_{i}^{\prime}v_{i}$ and set
$k_{1}=1$. By parts (P5) and (P6) of Lemma 2.3 we have
$\sigma(v_{1})_{k_{1}}\neq 0$ and $\sigma(v_{1})_{k_{i}}=0$ for
$i\in\\{2,\ldots,j\\}$. In addition, $\\{v_{1},\ldots,v_{j}\\}$ is a system of
generators of $C$, since $\\{w_{1},v_{2},\ldots,v_{j}\\}$ is. ∎

The proposition also implies that the codomain of a modular support cannot be
too small.

######  Corollary 3.9.

If $\sigma:R^{n}\to\mathbb{N}^{u}$ is modular, then $u\geq M(0:_{R^{n}}J)$. In
particular, if $R$ is a PIR or $JR^{n}=0$, then $u\geq\ell n$.

###### Proof.

Proposition 3.8 for $C=0:_{R^{n}}J$ and $j=M(0:_{R^{n}}J)$ implies that $u\geq
M(0:_{R^{n}}J)$. If $JR^{n}=0$, then $R^{n}=0:_{R^{n}}J$, hence
$M(0:_{R^{n}}J)=M(R^{n})$. If $R$ is a PIR, then $M(0:_{R^{n}}J)=M(R^{n})$ by
Proposition 1.10. In both cases, one has that $M(0:_{R^{n}}J)=\ell n$. ∎

Understanding the subcodes of $C$ generated by minimal codewords allows us to
prove that the generalized of weights of $C$ are attained by subcodes of
$0:_{C}J$. In particular, $C$ and its socle have the same generalized weights.

######  Proposition 3.10.

Let $R$ be a PIR. Suppose that $\sigma$ is modular and let $C\subseteq R^{n}$
be a code. Let $r\in[M(C)]$ and $D\in\mathcal{S}_{j}(C)$, $j\geq r$, be such
that $d_{r}(C)=|\sigma(D)|$. Then $0:_{D}J\in\mathcal{S}_{i}(C)$ for some
$i\geq r$ and $d_{r}(C)=|\sigma(0:_{D}J)|.$ In particular,

$d_{r}(C)=d_{r}(0:_{C}J).$

###### Proof.

By Proposition 1.10 and Theorem 3.5, $0:_{D}J\subseteq D$ is minimally
generated by a set of $M(0:_{D}J)=M(D)$ codewords. Therefore
$0:_{D}J\in\mathcal{S}_{M(D)}(C)$ and $M(D)\geq r$. Moreover

$|\sigma(0:_{D}J)|\leq|\sigma(D)|=d_{r}(C),$

hence equality holds. Since $0:_{D}J\subseteq 0:_{C}J$, then

$d_{r}(0:_{C}J)\leq|\sigma(0:_{D}J)|=d_{r}(C).$

The reverse inequality follows from the inclusion $0:_{C}J\subseteq C$. ∎

In particular, this allows us to determine the last generalized weight of $C$.

######  Corollary 3.11.

Let $C\subseteq R^{n}$ be a code and $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Then

$d_{M(C)}(C)=|\sigma(0:_{C}J)|.$

###### Proof.

We claim that $M(C)=M(0:_{C}J)$ and $d_{M(C)}(C)=d_{M(C)}(0:_{C}J)$. This is
clear if $C\subseteq 0:_{R^{n}}J$, since $C=0:_{C}J$. If $R$ is a PIR, the
claim follows from Proposition 1.10 and Proposition 3.10.

By Proposition 1.9, $M(D)\leq M(C)$ for every $D\subseteq 0:_{C}J$ and the
only subcode $D\subseteq 0:_{C}J$ with $M(D)=M(C)$ is $D=0:_{C}J$. Therefore

$d_{M(C)}(C)=|\sigma(0:_{C}J)|.\qed$

For a given code, we can produce subcodes that attain its generalized weights
and that are minimally generated by a set of minimal codewords, whose supports
have the same reduced shape as in Proposition 3.8. This technical result plays
a crucial role in the proof of Theorem 4.4.

######  Theorem 3.12.

Let $C\subseteq R^{n}$ be a code and let $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Then, for all
$r\in[M(C)]$, there exists a subcode $D\subseteq C$ such that:

  1. 1.

$d_{r}(C)=|\sigma(D)|$,

  2. 2.

$D$ has a minimal system of generators $\\{v_{1},\ldots,v_{r}\\}$ such that
$v_{i}\in\textnormal{Min}(C)$ for all $i\in[r]$. Moreover

$\sigma(v_{i})\not\leq\bigvee_{j\neq i}\sigma(v_{j}).$

###### Proof.

If $C\subseteq 0:_{R^{n}}J$, then let $D^{\prime}\subseteq C$ such that
$D^{\prime}\in\mathcal{S}_{j}(C)$, $j\geq r$, and
$d_{r}(C)=|\sigma(D^{\prime})|$. If $R$ is a PIR, then by Proposition 3.10
there exist $j\geq r$ and $D^{\prime}\subseteq 0:_{C}J$ such that
$D^{\prime}\in\mathcal{S}_{j}(C)$ and $d_{r}(C)=|\sigma(D^{\prime})|$. In both
cases, by Proposition 3.8, $D^{\prime}$ has a minimal system of generators
$w_{1},\ldots,w_{j}$ with the following property: For all $i\in[j]$ there
exists $k_{i}\in[u]$ with $\sigma(w_{i})_{k_{i}}\neq 0$ and
$\sigma(w_{h})_{k_{i}}=0$ for $h\neq i$. By Lemma 3.7, for all $i\in[j]$ there
exists $v_{i}\in\textnormal{Min}(C)$ with $\sigma(v_{i})\leq\sigma(w_{i})$ and
$\sigma(v_{i})_{k_{i}}\neq 0$. In particular,
$\sigma(v_{i})\not\leq\vee_{h\neq i}\sigma(v_{h})$ for $i\in[j]$. Let
$D=\langle v_{1},\ldots,v_{r}\rangle$. Notice that $D\in\mathcal{S}_{r}(C)$,
since $v_{h}\not\in\langle v_{k}\,:\,k\in[r],k\neq h\rangle$ for all
$h\in[r]$. Moreover,

$|\sigma(D)|=\bigvee_{i=1}^{r}\sigma(v_{i})\leq\bigvee_{i=1}^{j}\sigma(w_{i})=|\sigma(D^{\prime})|.$

Therefore $|\sigma(D)|=|\sigma(D^{\prime})|=d_{r}(C)$. ∎

######  Notation 3.13.

Let $C\subseteq R^{n}$ be a code and let $j\in[M(C)]$. We let

$\mathcal{M}_{j}(C):=\\{D\subseteq C\,:\,\mbox{$D$ has a minimal system of
generators of $j$ minimal codewords}\\}.$

Theorem 3.12 shows that for all $r\in[M(C)]$ there exists
$D\in\mathcal{M}_{r}(C)$ such that $d_{r}(C)=|\sigma(D)|$. In particular, we
have shown the following.

######  Corollary 3.14.

Let $C\subseteq R^{n}$ be a code and let $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. The following quantities
are equal to the $r$-th generalized weight $d_{r}(C)$, for any $r\in[M(C)]$:

  1. 1.

$\min\\{|\sigma(D)|\,:\,D\in\mathcal{S}_{j}(C)\mbox{ for some }j\geq r\\}$,

  2. 2.

$\min\\{|\sigma(D)|\,:\,D\in\mathcal{S}_{r}(C)\\}$,

  3. 3.

$\min\\{|\sigma(D)|\,:\,D\in\mathcal{M}_{j}(C)\mbox{ for some }j\geq r\\}$,

  4. 4.

$\min\\{|\sigma(D)|\,:\,D\in\mathcal{M}_{r}(C)\\}.$

###### Proof.

Equality between $d_{r}(C)$ and 1. holds by definition. Equality between
$d_{r}(C)$ and 4. follows directly from Theorem 3.12. Equality between
$d_{r}(C)$ and 3. then follows from the chain of inclusions

$\mathcal{M}_{r}(C)\subseteq\cup_{j\geq
r}\mathcal{M}_{j}(C)\subseteq\cup_{j\geq r}\mathcal{S}_{j}(C).$

Similarly, equality between $d_{r}(C)$ and 2. follows from the chain of
inclusions

$\mathcal{M}_{r}(C)\subseteq\mathcal{S}_{r}(C)\subseteq\cup_{j\geq
r}\mathcal{S}_{j}(C).\qed$

######  Remark 3.15.

Theorem 3.5 and Corollary 3.14 are in general false for supports that are not
modular. For instance, the support of Example 2.21 violates both results
taking $C=\mathbb{F}_{2}^{2}$.

We can now prove that the generalized weights form a strictly increasing
sequence. This extends a classical result by Wei [17].

######  Theorem 3.16.

Let $C\subseteq R^{n}$ be a code and let $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Then

$\min\textnormal{wt}(C)=d_{1}(C)<d_{2}(C)<\ldots<d_{M(C)}(C)=|\sigma(0:_{C}J)|.$

###### Proof.

By Corollary 3.14 and Theorem 3.4(1) we may assume without loss of generality
that $C\subseteq 0:_{R^{n}}J$. Let $r\in[M(C)-1]$ and let $D\subseteq C$ be
such that $|\sigma(D)|=d_{r+1}(C)$. We may assume that $D$ has a minimal
system of generators $\\{v_{1},\ldots,v_{j+1}\\}$ as in Proposition 3.8 with
$j\geq r$. Then $D^{\prime}:=\langle
v_{1},\ldots,v_{j}\rangle\in\mathcal{S}_{j}(D)$. We have
$\sigma(D^{\prime})\leq\sigma(D)$ and
$\sigma(D^{\prime})_{k_{j+1}}=0<\sigma(D)_{k_{j+1}}$, hence
$|\sigma(D^{\prime})|<|\sigma(D)|$. In particular,

$d_{r}(C)\leq|\sigma(D^{\prime})|<|\sigma(D)|=d_{r+1}(C).$

The two equalities in the statement follow from Lemma 2.12(1) and Corollary
3.11. ∎

As an application of Theorem 3.16, we extend the generalized Singleton bound
[17, Corollary 1] to every code over a PIR and some codes over finite
commutative rings.

######  Corollary 3.17.

Let $C\subseteq R^{n}$ be a code and let $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Then

$\min\textnormal{wt}(C)+r-1\leq d_{r}(C)\leq|\sigma(0:_{R^{n}}J)|-M(C)+r$

for all $r\in[M(C)]$. In particular,

$\min\textnormal{wt}(C)\leq|\sigma(0:_{R^{n}}J)|-M(C)+1.$

###### Proof.

The result follows by combining Theorem 3.16 with

$d_{M}(C)=|\sigma(0:_{C}J)|\leq|\sigma(0:_{R^{n}}J)|,$

where the equality on the left hand side follows from Corollary 3.11. ∎

The next corollary proves that, for modular supports, any subcode $D$ of $C$
with $d_{r}(C)=|\sigma(D)|$ has a minimal system of generators consisting of
$r$ elements, and no minimal system of generators of larger cardinality. This
result allows us to restrict to such subcodes when studying the generalized
weights of $C$.

######  Corollary 3.18.

Let $C\subseteq R^{n}$ be a code and let $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Let $r\in[M(C)]$ and
$D\in\mathcal{S}_{j}(C)$, $j\geq r$, be such that $d_{r}(C)=|\sigma(D)|$. Then
$r=j=M(D)$.

###### Proof.

Since $D\in\mathcal{S}_{j}(C)$, then $r\leq j\leq M(D)$ and
$D\in\mathcal{S}_{M(D)}(C)$ by Proposition 1.8. Then

$|\sigma(D)|\geq d_{M(D)}(C)\geq d_{r}(C)=|\sigma(D)|,$

where the first inequality follows from $D\in\mathcal{S}_{M(D)}(C)$ and the
second from Lemma 2.12(3). Therefore the inequalities are equalities and
$r=j=M(D)$ by Theorem 3.16. ∎

In the next theorem, we establish some additional properties of the subcodes
of $C$ that realize the generalized weights of $C$.

######  Theorem 3.19.

Let $C\subseteq R^{n}$ be a code and let $\sigma$ be a modular support. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Let $r\in[M(C)]$ and
$D\in\mathcal{S}_{r}(C)$ be such that $d_{r}(C)=|\sigma(D)|$. The following
hold.

  1. (1)

If $v\in\textnormal{Min}(C)$ satisfies $\sigma(v)\leq\sigma(D)$, then $v\in
D$. In particular, $\textnormal{Min}(D)=\textnormal{Min}(C)\cap D$.

  2. (2)

$0:_{D}J=\langle v\in
C\,:\,v\in\textnormal{Min}(C),\,\sigma(v)\leq\sigma(D)\rangle$.

In particular, if $D\in\mathcal{M}_{r}(C)$, then $D=\langle v\in
C\,:\,v\in\textnormal{Min}(C),\,\sigma(v)\leq\sigma(D)\rangle$.

###### Proof.

  1. (1)

If $C\subseteq 0:_{R^{n}}J$, then also $D\subseteq 0:_{R^{n}}J$. If $R$ is a
PIR, then $0:_{D}J\subseteq D$ has $\sigma(0:_{D}J)=\sigma(D)$ by Proposition
3.10. In both cases, it suffices to prove the thesis under the assumption that
$D\subseteq 0:_{R^{n}}J$.

If $v\not\in D$, consider $D\subsetneq D^{\prime}=D+\langle v\rangle\subseteq
0:_{R^{n}}J$. We have

$r=M(D)<M(D^{\prime})\leq M(D)+1=r+1,$

where the equalities follows from Corollary 3.18 and the first inequality
follows from Proposition 1.9. The second inequality follows from observing
that, if $D=D_{1}\times\ldots\times D_{\ell}$ and $v=e_{j}v$, then

$D^{\prime}=D_{1}\times\ldots\times D_{j-1}\times(D_{j}+\langle
v_{j}\rangle)\times D_{j+1}\times\ldots\times D_{\ell}.$

Since $v_{j}\not\in D_{j}$ and $0:_{R_{j}}\mathfrak{M}_{j}\supseteq
D_{j}\cup\\{v_{j}\\}$, then

$\mu(D_{j}+\langle v_{j}\rangle)=\dim_{R_{j}/\mathfrak{M}_{j}}(D_{j}+\langle
v_{j}\rangle)=\dim_{R_{j}/\mathfrak{M}_{j}}(D_{j})+1=\mu(D_{j})+1.$

Therefore $M(D^{\prime})=r+1$. Since
$\sigma(D^{\prime})=\sigma(v)\vee\sigma(D)=\sigma(D)$, then
$d_{r+1}(C)\leq|\sigma(D)|=d_{r}(C)$, contradicting Theorem 3.16. It follows
that $v\in D$, as desired.

In order to prove that $\textnormal{Min}(D)=\textnormal{Min}(C)\cap D$, it
suffices to prove that $\textnormal{Min}(D)\subseteq\textnormal{Min}(C)$. Let
$w\in\textnormal{Min}(D)\subseteq C$, then there is a
$v\in\textnormal{Min}(C)$ such that $\sigma(v)\leq\sigma(w)\leq\sigma(D)$,
where the second inequality follows from $w\in D$. By the first part of the
proof, $v\in D$. Therefore $\sigma(w)=\sigma(v)$ and
$w\in\textnormal{Min}(C)$.

  2. (2)

By Theorem 3.4(2) and Theorem 3.5 and part (1),

$0:_{D}J=\langle v\in\textnormal{Min}(D)\rangle=\langle
v\in\textnormal{Min}(C)\cap D\rangle=\langle
v\in\textnormal{Min}(C)\,:\,\sigma(v)\leq\sigma(D)\rangle.\qed$

The next result relates the generalized weights of $C$ with those of its
factors.

######  Corollary 3.20.

Let $C=C_{1}\times\ldots\times C_{\ell}\subseteq R^{n}$ be a code and let
$\sigma$ be a modular support. Assume that either $C\subseteq 0:_{R^{n}}J$ or
$R$ is a PIR. Then

$d_{r}(C)=\min\left\\{\sum_{j=1}^{\ell}d_{r_{j}}(C_{j})\,:\,r_{1}+\ldots+r_{\ell}=r,\;r_{j}\in\\{0,\ldots,\mu(C_{j})\\}\right\\}$

for all $r\in[M(C)]$.

###### Proof.

By Theorem 2.23, up to a permutation of the coordinates of $\mathbb{N}^{u}$ we
can write $\sigma=\sigma_{1}\times\ldots\times\sigma_{\ell}$, where
$\sigma_{j}:R_{j}^{n}\to\mathbb{N}^{u_{j}}$ is a modular support for
$j\in[\ell]$ and $u=u_{1}+\ldots+u_{\ell}$. Fix $r\in[M(C)]$ and
$r_{1},\ldots,r_{\ell}$ such that $r=r_{1}+\ldots+r_{\ell}$ and
$r_{j}\in\\{0,\ldots,\mu(C_{j})\\}$. For $j\in[\ell]$, let
$D_{j}\in\mathcal{M}_{r_{j}}(C_{j})$ be such that
$|\sigma_{j}(D_{j})|=d_{r_{j}}(C_{j})$. Let $D=D_{1}\times\ldots\times
D_{\ell}$. Then $D\in\mathcal{M}_{r}(C)$ has
$|\sigma(D)|=d_{r_{1}}(C_{1})+\ldots+d_{r_{\ell}}(C_{\ell})$, proving that

$d_{r}(C)\leq\min\left\\{\sum_{j=1}^{\ell}d_{r_{j}}(C_{j})\,:\,r_{1}+\ldots+r_{\ell}=r,\;r_{j}\in\\{0,\ldots,\mu(C_{j})\\}\right\\}.$

To prove the reverse inequality, let $D=D_{1}\times\ldots\times
D_{\ell}\in\mathcal{M}_{r}(C)$. By Theorem 3.4(1) each of the minimal
codewords of $C$, say $v_{1},\ldots,v_{r}$, that minimally generate $D$
belongs to $0\times\ldots\times 0\times D_{j}\times 0\times\ldots\times 0$ for
some $j\in[\ell]$. Let

$r_{j}=|\\{v_{1},\ldots,v_{r}\\}\cap(0\times\ldots\times 0\times D_{j}\times
0\times\ldots\times 0)|.$

Then $r=r_{1}+\ldots+r_{\ell}$ and $0\leq r_{j}\leq\mu(D_{j})\leq\mu(C_{j})$
for $j\in[\ell]$. Moreover,

$|\sigma(D)|=\sum_{j=1}^{\ell}|\sigma_{j}(D_{j})|\geq\sum_{j=1}^{\ell}d_{r_{j}}(C_{j}),$

where the last inequality follows from the fact that
$D_{j}\in\mathcal{M}_{r_{j}}(C_{j})$. By Corollary 3.18

$\displaystyle d_{r}(C)$
$\displaystyle=\min\\{|\sigma(D)|\,:\,D\in\mathcal{M}_{r}(C)\\}$
$\displaystyle\geq\min\left\\{\sum_{j=1}^{\ell}d_{r_{j}}(C_{j})\,:\,r=r_{1}+\ldots+r_{\ell},\,r_{j}\in\\{0,\ldots,\mu(C_{j})\\}\right\\}.\qed$

##  4 Codes, Supports, and Monomial Ideals

In this section, we prove that the generalized weights of an $R$-linear code
endowed with a modular support are determined by the graded Betti numbers of a
monomial ideal associated to the code. We follow the notation of the previous
sections.

######  Notation 4.1.

In the sequel we work in the multivariate polynomial ring
$S=K[x_{1},\ldots,x_{u}]$, where $K$ is an arbitrary field. A monomial of $S$
is a polynomial of the form $x_{1}^{a_{1}}\cdots x_{u}^{a_{u}}$, where
$(a_{1},\ldots,a_{u})\in\mathbb{N}^{u}$. In particular, we assume that
monomials are monic. A monomial ideal is an ideal which has a system of
generators consisting of monomials.

We fix a modular support $\sigma$ on $R^{n}$. The support $\sigma$ can be used
to associate a monomial ideal to a subcode of $R^{n}$ as follows.

######  Definition 4.2.

For any $v\in R^{n}\setminus\\{0\\}$, let

$m_{v}:=x^{\sigma(v)}:=x_{1}^{\sigma(v)_{1}}\cdots x_{u}^{\sigma(v)_{u}}\in
S.$

For $0\neq C\subseteq R^{n}$, let

$I_{C}:=\left(m_{v}\,:\,v\in C\setminus\\{0\\}\right)\subseteq S.$

Notice that not every monomial $m\in I_{C}$ corresponds to the support of a
codeword $v\in C\setminus\\{0\\}$. However, every monomial $m\in I_{C}$ is of
the form $m=m_{v}\cdot m^{\prime}$ for some $v\in C\setminus\\{0\\}$ and some
monomial $m^{\prime}\in S$.

######  Proposition 4.3.

Let $0\neq C\subseteq R^{n}$ be a code. Then

$I_{C}=I_{0:_{C}J}=\left(m_{v}\,:\,v\in\textnormal{Min}(C)\right)$

and $\left\\{m_{v}\,:\,v\in\textnormal{Min}(C)\right)\\}$ is a minimal system
of generators of $I_{C}$.

The next theorem is the main result of this paper. We prove that the graded
Betti numbers of the monomial ideal associated to a code determine its
generalized weights.

######  Theorem 4.4.

Let $\sigma$ be a modular support and let $C\subseteq R^{n}$ be a code. Assume
that either $C\subseteq 0:_{R^{n}}J$ or $R$ is a PIR. Let $I_{C}\subseteq S$
be the monomial ideal associated to $C$ and let $r\in[M(C)]$. Then $M(C)$ is
the projective dimension of $S/I_{C}$ and $d_{r}(C)$ is the minimum shift
(i.e., the minimum degree of a nonzero element) in the $r$-th free module in a
minimal free resolution of $S/I_{C}$. In particular, the graded Betti numbers
of $S/I_{C}$ determine $M(C)$ and the generalized weights of $C$.

###### Proof.

Let $I_{C}=(m_{1},\ldots,m_{t})$ where $m_{1},\ldots,m_{t}$ are a minimal
system of monomial generators of $I_{C}$. By Theorem 3.4(3) $\langle
v\rangle=\langle w\rangle$ if and only if $\sigma(v)=\sigma(w)$ for
$v,w\in\textnormal{Min}(C)$. By Theorem 3.5, $0:_{C}J$ has a minimal system of
generators consisting of minimal codewords, hence $t\geq M(0:_{C}J)=M(C)$ by
Proposition 1.10. For each $i\in[t]$ let $v_{i}\in\textnormal{Min}(C)$ such
that $m_{v_{i}}=m_{i}$. For any $A\subseteq[t]$ let

$m_{A}=\operatorname{lcm}\\{m_{i}\,:\,i\in A\\}=x^{\sigma(\langle
v_{i}\,:\,i\in A\rangle)}.$

A graded free resolution of $S/I_{C}$ is given by the Taylor complex [9,
Section 7.1]

$0\longrightarrow\mathbb{F}_{t}\stackrel{{\scriptstyle
f_{t}}}{{\longrightarrow}}\mathbb{F}_{t-1}\stackrel{{\scriptstyle
f_{t-1}}}{{\longrightarrow}}\ldots\stackrel{{\scriptstyle
f_{2}}}{{\longrightarrow}}\mathbb{F}_{1}\stackrel{{\scriptstyle
f_{1}}}{{\longrightarrow}}S\longrightarrow S/I_{C}\longrightarrow 0,$

where

$\mathbb{F}_{r}=\bigoplus_{A\subseteq[t],\;|A|=r}S(-\deg(m_{A}))$

with basis $\\{e_{A}\,:\,A\subseteq[t],\;|A|=r\\}$ and

$f_{r}(e_{A})=\sum_{k=1}^{r}(-1)^{k+1}\frac{m_{A}}{m_{A\setminus\\{i_{k}\\}}}e_{A\setminus\\{i_{k}\\}}\;\mbox{
for }\;A=\\{i_{1},\ldots,i_{r}\\}\subseteq[t].$

The Taylor resolution is in general not minimal: A cancellation occurs between
the modules $S(-\deg(m_{A}))\subseteq\mathbb{F}_{r}$ and
$S(-\deg(m_{B}))\subseteq\mathbb{F}_{r-1}$ if and only if
$B=A\setminus\\{k\\}$ for some $k\in A$ and $m_{A}=m_{B}$. Notice that
$m_{A}=m_{B}$ if and only if $m_{k}\mid\operatorname{lcm}\\{m_{i}\,:\,i\in
B\\}$, that is, if and only if $\sigma(v_{k})\leq\vee_{i\in B}\sigma(v_{i})$.

Let

$0\longrightarrow\mathbb{G}_{p}\stackrel{{\scriptstyle
g_{p}}}{{\longrightarrow}}\mathbb{G}_{p-1}\stackrel{{\scriptstyle
g_{p-1}}}{{\longrightarrow}}\ldots\stackrel{{\scriptstyle
g_{2}}}{{\longrightarrow}}\mathbb{G}_{1}\stackrel{{\scriptstyle
g_{1}}}{{\longrightarrow}}S\longrightarrow S/I_{C}\longrightarrow 0$ (4.1)

be a minimal free resolution obtained from the Taylor resolution after making
all the possible cancellations. In particular, $p$ is the projective dimension
of $S/I_{C}$.

For $A\subseteq[t]$ with $|A|=r$, let

$C_{A}=\langle v_{i}\,:\,i\in A\rangle\subseteq C.$

Notice that, if $v_{k}\in\langle v_{i}\,:\,i\in A\setminus\\{k\\}\rangle$ for
some $k\in A$, then $S(-\deg(m_{A}))$ cancels with
$S(-\deg(m_{A\setminus\\{k\\}}))$ while passing from the Taylor resolution to
resolution (4.1). Therefore, the direct summands $S(-\deg(m_{A}))$ appearing
in (4.1) come from subcodes $C_{A}\in\mathcal{M}_{r}(C)$. Since
$\mathcal{M}_{i}(C)=0$ for $i>M(C)$, then $p\leq M(C)$.

For $r\in[M(C)]$, let $b_{r}$ be the smallest shift appearing in the $r$-th
module of a minimal graded free resolution of $S/I_{C}$, i.e. $b_{r}$ is the
smallest degree of a nonzero element of $\mathbb{G}_{r}$. In particular,
$b_{1}$ is the smallest degree of a minimal generator of $I_{C}$, hence

$b_{1}=d_{1}(C).$

We claim that $b_{r}=d_{r}(C)$ for all $r\in[M(C)]$. Fix a value of $r$ and
choose $A\subseteq[t]$ with $|A|=r$ such that $b_{r}=\deg(m_{A})$. Then
$\sigma(C_{A})=\vee_{i\in A}\sigma(v_{i})=b_{r}$. Since
$C_{A}\in\mathcal{M}_{r}(C)$, then

$d_{r}(C)\leq b_{r}$ (4.2)

by Theorem 3.14.

To prove the reverse inequality of (4.2), we start by observing that

$d_{r}(C)=\min\\{|\sigma(C_{A})|\ :\ |A|=r,\ C_{A}\in\mathcal{M}_{r}(C)\\}$

by Theorem 3.14 and Theorem 3.4(3). Hence $d_{r}(C)$ is one of the shifts
appearing in the $r$-th free module of the Taylor resolution of $S/I_{C}$. In
order to complete the proof, it suffices to prove the following

######  Claim A.

$\mathbb{G}_{r}$ contains at least one direct summand $S(-d_{r}(C))$.

To prove the claim, suppose that we have made all the possible cancellations
until the $(r-1)$-st step of the resolution. Therefore we have a free
resolution of the form

$0\longrightarrow\mathbb{F}_{t}\stackrel{{\scriptstyle
f_{t}}}{{\longrightarrow}}\ldots\mathbb{F}_{r+1}\stackrel{{\scriptstyle
h_{r+1}}}{{\longrightarrow}}\mathbb{H}_{r}\stackrel{{\scriptstyle
h_{r}}}{{\longrightarrow}}\mathbb{G}_{r-1}\stackrel{{\scriptstyle
g_{r-1}}}{{\longrightarrow}}\ldots\stackrel{{\scriptstyle
g_{2}}}{{\longrightarrow}}\mathbb{G}_{1}\stackrel{{\scriptstyle
g_{1}}}{{\longrightarrow}}S\longrightarrow S/I_{C}\longrightarrow 0.$

By Theorem 3.12 and Corollary 3.18, $\mathbb{H}_{r}$ contains a direct summand
$S(-d_{r}(C))$. Consider now the possible cancellations between
$\mathbb{F}_{r+1}$ and $\mathbb{H}_{r}$. The map

$\mathbb{H}_{r}\stackrel{{\scriptstyle
h_{r}}}{{\longrightarrow}}\mathrm{Syz}_{r-1}(I_{C})$ (4.3)

is surjective and corresponds to a choice of generators of the $(r-1)$-st
syzygy module $\mathrm{Syz}_{r-1}(I_{C})$ of $I_{C}$. A cancellation between
$\mathbb{F}_{r+1}$ and $\mathbb{H}_{r}$ comes from an element in the kernel of
$h_{r}$ which has an invertible entry, hence it corresponds to eliminating a
non-minimal generator of $\mathrm{Syz}_{r-1}(I_{C})$. Claim A amounts to
showing that, among all direct summands $S(-d_{r}(C))$ of $\mathbb{H}_{r}$,
there is at least one which does not cancel with a direct summand of
$\mathbb{F}_{r+1}$. If they all cancel, however, $\mathrm{Syz}_{r-1}(I_{C})$
has no elements in degree $d_{r}(C)$. However this is not possible, since the
map in (4.3) is surjective and no component of $h_{r}$ is the zero map, hence
the image of $h_{r}$ contains a nonzero element of degree $d_{r}(C)$. In
particular, $\mathbb{G}_{p}=S(-|\sigma(0:_{C}J)|)^{s}$ for some $s\geq 1$ and
$p=M(C)$. ∎

Since minimal free resolutions of monomial ideals are easy to compute, Theorem
4.4 gives a way to efficiently compute the generalized weights of a code, if
one knows the supports of its minimal codewords. Notice however that the
problem of computing the supports of the minimal codewords (or just the
minimum distance) of a code is NP-hard, even for the special case of binary
linear codes endowed with the Hamming distance, see [16].

We conclude the section with some examples.

######  Example 4.5.

Let $R=\mathbb{Z}_{6}$ and consider the support
$\omega:\mathbb{Z}_{6}\to\mathbb{N}^{2}$ defined as follows:

$\omega(0)=(0,0),\quad\omega(1)=(2,1),\quad\omega(2)=(0,1),\quad\omega(3)=(2,0),\quad\omega(4)=(0,1),\quad\omega(5)=(2,1).$

It can be checked that $\omega$ is modular. We extend $\omega$ componentwise
to a function $\omega:\mathbb{Z}_{6}^{3}\to\mathbb{N}^{6}$ and compose it with
the $\mathbb{Z}_{6}$-linear map defined by the invertible matrix

$A=\begin{pmatrix}3&4&1\\\ 5&3&3\\\ 2&4&5\end{pmatrix}.$

In other words, we define $\sigma:\mathbb{Z}_{6}^{3}\to\mathbb{N}^{6}$ by
$\sigma(v)=(\omega((Av)_{1}),\omega((Av)_{2}),\omega((Av)_{3}))$ for all
$v\in\mathbb{Z}_{6}^{3}$. Then $\sigma$ is modular by Proposition 2.17(7). Let
$C=\langle(3,1,2),(2,4,3)\rangle\subseteq\mathbb{Z}_{6}^{3}$. Then $C$ has the
following six minimal codewords and supports:

$\displaystyle(3,3,3)$ $\displaystyle(0,0,2,0,2,0),$ $\displaystyle(0,4,2)$
$\displaystyle(0,0,0,0,0,1),$ $\displaystyle(2,0,4)$
$\displaystyle(0,1,0,1,0,0),$ $\displaystyle(3,3,0)$
$\displaystyle(2,0,0,0,0,0),$ $\displaystyle(0,2,4)$
$\displaystyle(0,0,0,0,0,1),$ $\displaystyle(4,0,2)$
$\displaystyle(0,1,0,1,0,0).$

In particular, the ideal associated to $C$ is

$I_{C}=(x_{1}^{2},x_{2}x_{4},x_{3}^{2}x_{5}^{2},x_{6}).$

Notice that the generators of $I_{C}$ form a regular sequence, therefore a
minimal free resolution of $S/I_{C}$ is given by the Koszul complex. In other
words, there is no cancellation in the Taylor complex

$0\longrightarrow S(-9)\longrightarrow\begin{array}[]{c}S(-8)\\\ \oplus\\\
S(-7)^{2}\\\ \oplus\\\
S(-5)\end{array}\longrightarrow\begin{array}[]{c}S(-6)^{2}\\\ \oplus\\\
S(-5)^{2}\\\ \oplus\\\ S(-4)\\\ \oplus\\\
S(-3)^{2}\end{array}\longrightarrow\begin{array}[]{c}S(-4)\\\ \oplus\\\
S(-2)^{2}\\\ \oplus\\\ S(-1)\end{array}\longrightarrow S\longrightarrow
S/I_{C}\longrightarrow 0.$

Therefore one has $M(C)=4$, $d_{1}(C)=1$, $d_{2}(C)=3$, $d_{3}(C)=5$, and
$d_{4}(C)=9$. Looking at the maps in the minimal free resolutions, one sees
that

$\displaystyle d_{1}(C)$
$\displaystyle=|\sigma(\langle(0,2,4)\rangle)|=|(0,0,0,0,0,1)|=1,$
$\displaystyle d_{2}(C)$
$\displaystyle=|\sigma(\langle(0,2,4),(3,3,0)\rangle)|=|\sigma(\langle(0,2,4),(2,0,4)\rangle)|=|(2,0,0,0,0,1)|=|(0,1,0,1,0,1)|=3,$
$\displaystyle d_{3}(C)$
$\displaystyle=|\sigma(\langle(0,2,4),(3,3,0),(2,0,4)\rangle)|=|(2,1,0,1,0,1)|=5,$
$\displaystyle d_{4}(C)$
$\displaystyle=|\sigma(\langle(0,2,4),(3,3,0),(2,0,4),(3,3,3)\rangle)|=|(2,1,2,1,2,1)|=9.$

In the next example, we show that all the cancellations discussed in the proof
of Theorem 4.4 can actually occur.

######  Example 4.6.

Let $\sigma$ be the Hamming weight and let $C\subseteq{\mathbb{F}}_{2}^{4}$ be
the even weight code, i.e., the code consisting of all vectors of even weight.
The minimal codewords of $C$ are all vectors of weight $2$ of
${\mathbb{F}}_{2}^{4}$, therefore the associated ideal $I_{C}$ is the ideal
generated by all squarefree monomials of degree $2$ in $4$ variables. A
minimal free resolution of $S/I_{C}$ is well-known and has the form

$0\longrightarrow S(-4)^{2}\longrightarrow S(-3)^{8}\longrightarrow
S(-2)^{6}\longrightarrow S\longrightarrow S/I_{C}\longrightarrow 0.$

The Taylor complex associated to $S/I_{C}$ is as follows

$0\longrightarrow S(-4)\longrightarrow S(-4)^{6}\longrightarrow
S(-4)^{15}\longrightarrow\begin{array}[]{c}S(-4)^{16}\\\ \oplus\\\
S(-3)^{4}\end{array}\longrightarrow\begin{array}[]{c}S(-4)^{3}\\\ \oplus\\\
S(-3)^{12}\end{array}\longrightarrow S(-2)^{6}\longrightarrow S\longrightarrow
S/I_{C}\longrightarrow 0.$

We use the notation of the proof of Theorem 4.4 when referring to the free
modules in the resolutions above. By comparing the two free resolutions, one
sees that the modules ${\mathbb{F}}_{4}$, ${\mathbb{F}}_{5}$ and
${\mathbb{F}}_{6}$ in the Taylor complex completely cancel. Moreover, the free
summand $S(-3)^{4}$ of ${\mathbb{F}}_{3}$, corresponding to the minimal shift
in its homological degree, cancels, as well as the direct summand
$S(-4)^{14}$. Finally, the direct summands $S(-3)^{4}$ and $S(-4)^{3}$ of
${\mathbb{F}}_{2}$ cancel.

It is easy to find examples of functions that are not supports according to
Definition 2.2, and for which the result of Theorem 4.4 does not hold.

######  Example 4.7.

Let $R=\mathbb{Z}_{4}$. Let $\textnormal{wt}^{\textnormal{L}}$ denote the Lee
weight and let $\sigma^{\textnormal{L}}$ be its coordinatewise extension to
$\mathbb{Z}_{4}^{3}$. In Example 2.6 we observed that
$\sigma^{\textnormal{L}}$ is not a support according to Definition 2.2.
Consider the code
$C=\langle(1,1,0),(3,2,1)\rangle\subseteq\mathbb{Z}_{4}^{3}$. Then

$\textnormal{Min}(C)=\\{(1,1,0),(3,3,0),(0,1,3),(0,3,1),(1,0,1),(3,0,3)\\}$

and $I_{C}=(xy,xz,yz)\subseteq S=K[x,y,z]$. The graded Betti numbers of a
minimal free resolution of $S/I_{C}$ are

$0\longrightarrow S(-3)^{2}\longrightarrow S(-2)^{3}\longrightarrow
S\longrightarrow S/I_{C}\longrightarrow 0.$

In particular, $b_{1}=2$ and $b_{2}=3$. One can check that $d_{1}(C)=4$ and
$d_{2}(C)=6$.

Notice that Theorem 4.4 does not hold in general for supports that are not
modular, even for linear codes over fields.

######  Example 4.8.

Let $C=\mathbb{F}_{2}^{2}$ with the support $\sigma$ defined in Example 2.21.
The associated monomial ideal is $I_{\mathbb{F}_{2}^{2}}=(y)\subseteq K[x,y]$,
whose minimal free resolution is

$0\longrightarrow S(-1)\longrightarrow S\longrightarrow S/(y)\longrightarrow
0.$

We have $\mu(\mathbb{F}_{2}^{2})=2$, while the projective dimension of $S/(y)$
is $1$. In particular, the second free module in a minimal free resolution of
$S/(y)$ is $0$ and it does not determine
$d_{2}(\mathbb{F}_{2}^{2})=|\sigma(\mathbb{F}_{2}^{2})|=2$.

##  5 The Hamming Support

In this section we let $R=\mathbb{F}_{q}$ and make some observations on the
Hamming support $\sigma^{\textnormal{H}}:\mathbb{F}_{q}^{n}\to\\{0,1\\}^{n}$,
see Example 2.5. For $v\in\mathbb{F}_{q}^{n}$, we identify
$\sigma^{\textnormal{H}}(v)$ with a subset of $[n]$.

Several authors study the matroid $M_{C}$ associated with the parity-check
matrix of a code $C\subseteq\mathbb{F}_{q}^{n}$, see e.g. [2, 10]. The code
$C$, the matroid $M_{C}$, and the corresponding Stanley-Reisner ideal $I_{C}$
relate as follows:

  1. (1)

Let $A\subseteq[n]$. Then $A\in M_{C}$ if and only if there is no $v\in
C\setminus\\{0\\}$ with $\sigma^{\textnormal{H}}(v)\subseteq A$.

  2. (2)

The squarefree monomials in $I_{C}$ are exactly those of the form $x^{A}$,
where $A\notin M_{C}$.

  3. (3)

The circuits of $M_{C}$ are the supports of the minimal codewords of $C$.

  4. (4)

The minimal monomial generators of $I_{C}$ are in one-to-one correspondence
with the circuits of the matroid $M_{C}$.

Therefore,

$M_{C}=2^{[n]}\setminus\\{A\subseteq[n]\,:\,A\supseteq\sigma(v)\mbox{ for some
}v\in C\setminus\\{0\\}\\}=2^{[n]}\setminus\\{A\subseteq[n]\,:\,x^{A}\in
I_{C}\\}.$ (5.1)

The resolutions of the ideals associated to various classes of codes (most
notably, MDS codes, one/two weight codes, Reed-Muller codes) have been studied
in [7, 6].

The main result of [10] is Theorem 2, which shows that the generalized Hamming
weights of a code $C\subseteq\mathbb{F}_{q}^{n}$ are determined by the graded
Betti numbers of $I_{C}$. Our Theorem 4.4 generalizes [10, Theorem 2] with a
different and stand-alone proof strategy that does not rely on any matroid
theory results.

A known fact about codes $C\subseteq\mathbb{F}_{q}^{n}$ endowed with the
Hamming metric is that they are generated by their minimal codewords [1, Lemma
2.1.4]. This is a special case of Theorem 3.5 in this paper.

######  Corollary 5.1.

Every code $0\neq C\subseteq\mathbb{F}_{q}^{n}$ is generated by its minimal
codewords.

It is natural to ask whether a code $C\subseteq\mathbb{F}_{q}^{n}$ is also
generated by its codewords of maximal support. The answer to this question is
negative in general, as the following simple example shows.

######  Example 5.2.

Let $C={\mathbb{F}}_{2}^{2}$. The only codeword of maximal support is $(1,1)$
and $\langle(1,1)\rangle\subsetneq C$.

Although codes $C\subseteq\mathbb{F}_{q}^{n}$ are in general not generated by
their maximal codewords, for $q$ sufficiently large most codes are.

######  Proposition 5.3.

Let $1\leq k\leq n$. The proportion of codes in $\mathbb{F}_{q}^{n}$, within
the $k$-dimensional ones, generated by their maximal codewords is at least

$\frac{(q-1)^{n}\,(q^{k}-1)-(q^{n}-1)q^{k-1}}{(q^{n}-1)(q^{k}-q^{k-1}-1)},$

and the above fraction approaches 1 as $q\to+\infty$.

###### Proof.

We obtain the result follows from lower bounding the number of $k$-dimensional
codes with $|C\cap A_{n}|>q^{k-1}$, where $A_{n}$ is the set of vectors in
$\mathbb{F}_{q}^{n}$ of weight $n$. To obtain such a lower bound, denote by
$\mathcal{F}$ the set of $k$-dimensional codes in $\mathbb{F}_{q}^{n}$ and
consider the sum

$S:=\sum_{C\in\mathcal{F}}|C\cap A_{n}|.$

We have

$|\mathcal{F}|=\left[\begin{matrix}n\\\ k\end{matrix}\right]_{q}.$

We write $\mathcal{F}$ as a disjoint union
$\mathcal{F}=\mathcal{F}^{\prime}\cup\mathcal{F}^{\prime\prime}$, where
$\mathcal{F}^{\prime}$ is the set of codes $C\in\mathcal{F}$ with $|C\cap
A_{n}|>q^{k-1}$ and $\mathcal{F}^{\prime\prime}$ the set of codes
$C\in\mathcal{F}$ with $|C\cap A_{n}|\leq q^{k-1}$. We then have

$\displaystyle S$ $\displaystyle=$
$\displaystyle\sum_{C\in\mathcal{F}^{\prime}}|C\cap
A_{n}|+\sum_{C\in\mathcal{F}^{\prime\prime}}|C\cap A_{n}|$ (5.2)
$\displaystyle\leq$
$\displaystyle|\mathcal{F}^{\prime}|\,(q^{k}-1)+(|\mathcal{F}|-|\mathcal{F}^{\prime}|)\,q^{k-1}$
$\displaystyle=$
$\displaystyle|\mathcal{F}^{\prime}|\,(q^{k}-q^{k-1}-1)+|\mathcal{F}|\,q^{k-1}.$

On the other hand, we can rewrite $S$ as

$S=\sum_{v\in A_{n}}|\\{C\in\mathcal{F}\,:\,C\ni
v\\}|=|A_{n}|\,\left[\begin{matrix}n-1\\\ k-1\end{matrix}\right]_{q}.$ (5.3)

Combining (5.2) with (5.3), and using the definition of $q$-binomial
coefficient, we obtain

$|\mathcal{F}^{\prime}|/|\mathcal{F}|\geq|A_{n}|\,\frac{q^{k}-1}{(q^{n}-1)(q^{k}-q^{k-1}-1)}-\frac{q^{k-1}}{q^{k}-q^{k-1}-1},$

which is the desired estimate, since $|A_{n}|=(q-1)^{n}$. ∎

## References

  * [1] A. Ashikhmin and A. Barg, _Minimal vectors in linear codes_ , IEEE Transactions on Information Theory 44 (1998), no. 5, 2010–2017.
  * [2] A. Barg, _The matroid of supports of a linear code_ , Applicable Algebra in Engineering, Communication and Computing 8 (1997), no. 2, 165–172.
  * [3] T. Britz, _Higher support matroids_ , Discrete Mathematics 307 (2007), no. 17-18, 2300–2308.
  * [4] , _Code enumerators and Tutte polynomials_ , IEEE Transactions on Information Theory 56 (2010), no. 9, 4350–4358.
  * [5] N. Gassner, _Weight-induced distance functions on $\mathbb{Z}/p^{s}\mathbb{Z}$-codes_, Master Thesis (University of Zurich), 2020, Supervisors: J. Rosenthal and V. Weger.
  * [6] S. R. Ghorpade and R. Ludhani, _On the purity of resolutions of Stanley-Reisner rings associated to Reed-Muller codes_ , arXiv preprint, 2102.00308 (2021).
  * [7] S. R. Ghorpade and P. Singh, _Pure resolutions, linear codes, and Betti numbers_ , Journal of Pure and Applied Algebra 224 (2020), no. 10, 106385\.
  * [8] C. Greene, _Weight enumeration and the geometry of linear codes_ , Studies in Applied Mathematics 55 (1976), no. 2, 119–128.
  * [9] J. Herzog and T. Hibi, _Monomial Ideals_ , Springer, 2011.
  * [10] T. Johnsen and H. Verdure, _Hamming weights and Betti numbers of Stanley-Reisner rings associated to matroids_ , Applicable Algebra in Engineering, Communication and Computing 24 (2013), no. 1, 73–93.
  * [11] R. Jurrius and R. Pellikaan, _Codes, arrangements and matroids_ , Algebraic Geometry Modeling in Information Theory, World Scientific, 2013, pp. 219–325.
  * [12] J. MacWilliams and N. Sloane, _The Theory of Error-Correcting Codes_ , North-Holland Mathematical Library, 1977.
  * [13] H. Matsumura, _Commutative Ring Theory_ , Cambridge University Press, 1989\.
  * [14] J. G Oxley, _Matroid Theory_ , Oxford University Press, 2006.
  * [15] Alberto Ravagnani, _Duality of codes supported on regular lattices, with an application to enumerative combinatorics_ , Designs, Codes and Cryptography 86 (2018), no. 9, 2035–2063.
  * [16] A. Vardy, _The intractability of computing the minimum distance of a code_ , IEEE Transactions on Information Theory 43 (1997), no. 6, 1757–1766.
  * [17] V. K. Wei, _Generalized Hamming weights for linear codes_ , IEEE Transactions on Information Theory 37 (1991), no. 5, 1412–1418.