# Number of generators of a finitely generated module

Let $M$ be a finitely generated $R$ module.

Let $\mathfrak{m}$ be a maximal ideal of $R$ then $M/\mathfrak{m}M\cong M\otimes _R R/\mathfrak{m}$ is a finite dimennsional vector space over $R/\mathfrak{m}$. Suppose $n$ be the dimension of this vector space. We can then say that we need at least $n$ elements to generate $M$.

Let $\{\bar{v}_1,\bar{v}_2,\cdots,\bar{v}_n\}$ generate $M/\mathfrak{m}M$ then we have $M=N+\mathfrak{m}M$ where $N$ is the submodule of $M$ generated by $\{v_1,\cdots,v_n\}$.

In case of local ring $(R,\mathfrak{m})$ we say that by Nakayama Lemma we have $M=N$ thus $M$ is also generated by $n$ elements.

Suppose we are not in a local ring, I guess all we can say is we need at least $n$ elements to generate $M$.

We expect some local global property and vary $\mathfrak{m}$ over all maximal ideals of $R$. As there is no restriction on number of maximal ideals, we may not find maximum among number of generators of $M/\mathfrak{m}M$ where $\mathfrak{m}$ varies over all maximal ideals.

Is this the reason, if yes the only to define minimal number of generators locally?

There are two ways to assign some number to a finitely generated $R$ module.

• Dimension of vector space $M/\mathfrak{m}M$ over $R/\mathfrak{m}$ for maximal ideals $\mathfrak{m}$ of $R$.
• Minimal number of generators of module $M_{\mathfrak{p}}$ over local ring $R_{\mathfrak{p}}$ for prime ideals $\mathfrak{p}$ of $R$.

I want to ask which one of these gives more information about the minimal number of generators of $M$. I guess the case of localization gives more information as we are considering a bigger collection i.e., prime ideals over maximal ideals.

Because $M$ is finitely generated, so are its quotients $M/IM$, so certainly there is an integer $n$ such that for some maximal $I$ we have $\dim M/IM=n$ while for every other maximal $J$, $\dim M/JM\leqslant n$.
It is worth to point out one usually wants to look at localizations of modules to define "rank" (this comes from the geometric interpretation of localization): if $P$ is projective f.g. then the localizations of $P$ on primes are free (by Kaplansky), and if they all have the same rank, it makes sense to define the rank of $P$ as this common number. One can prove, in fact, that when fixing a f.g. projective $P$, the map
$$\operatorname{Spec}(R) \longrightarrow \mathbb Z$$ $$\mathfrak p \mapsto \dim P_{\mathfrak p}$$
is locally constant (this is a version of local freeness), so f.g.p modules have a rank when $R$ is say connected.