The following is from Matsumura,
Theorem 4.10 Let $A$ be a ring and $M$ a finite $A$-module.
(i) For any non-negative integer $r$ set $$U_r = \{p \in \text{Spec} \space A | M_\mathfrak{p} \text{can be generated over} A_\mathfrak{p} \text{by} \space r \space \text{elements}\}$$ then $U_r$ is an open subset of Spec $A$.
(ii) If $M$ is a module of finite presentation then the set $$U_F = \{\mathfrak{p} \in \text{Spec} \space A | M_\mathfrak{p} \text{is a free} \space A_\mathfrak{p}-\text{module}\}$$ is open in Spec $A$.
However, on page $37$, he states
For $n= 1, 2, ...$, the subset $X_n = \{ \mathfrak{p} \in$ j-Spec $A | \mu(\mathfrak{p}, M) \geq n\}$ is closed in $j$-Spec $A$ by Theorem $4.10$.
where $\mu(\mathfrak{p},M)$ is the cardinality of a minimal generating set of $M_\mathfrak{p}$ over $A_\mathfrak{p}$, and j-Spec $A$ is the set of all prime ideals which can be written as the intersection of maximal ideals.
By the subspace topology, (for j-Spec $A$) we have that
$U_n = \{p \in$ j-Spec $A | M_\mathfrak{p} \text{can be generated over} A_\mathfrak{p} \text{by} \space n \space \text{elements}\}$ is open in j-Spec $A$.
But
$U_n = \{p \in$ j-Spec $A | M_\mathfrak{p} \text{can be generated over} A_\mathfrak{p} \text{by} \space n \space \text{elements}\}$
$= \{ \mathfrak{p} \in$ j-Spec $A | \mu(\mathfrak{p}, M) \leq n\}$
So we can obviously see that the complement of this, which is
$\{ \mathfrak{p} \in$ j-Spec $A | \mu(\mathfrak{p}, M) > n\}$
must be closed in j-Spec $A$. However, Matsumura says that
$\{ \mathfrak{p} \in$ j-Spec $A | \mu(\mathfrak{p}, M) \geq n\}$
must be closed...which I don't understand, because the inequality is not strict (so it is not the complement of an open set). Is it possible if anybody can explain this to me?
Thanks in advance
$U_{r-1} = \{p \in \text{Spec} \space A | M_\mathfrak{p} \text{ can be generated over} A_\mathfrak{p} \text{by} \space r-1 \space \text{elements}\}$ is also an open set in Spec $A$. Thus $U_{n-1} \cap j$-Spec $A$ is open in $j$-Spec $A$. And $X_n$ is just the complement of $U_{n-1} \cap j$-Spec $A$, hence closed.