hcju/stacksqa huggingface dataset:
It is clear that (1) implies (2). \medskip\noindent Assume (2) and let $\overline{k}$ is the separable algebraic closure of $k$. Suppose $\mathfrak q_i \subset R \otimes_k \overline{k}$, $i = 1, 2$ are two minimal prime ideals. For every finite subextension $\overline{k}/k'/k$ the extension $k'/k$ is separable and the ring map $R \otimes_k k' \to R \otimes_k \overline{k}$ is flat. Hence $\mathfrak p_i = (R \otimes_k k') \cap \mathfrak q_i$ are minimal prime ideals (as we have going down for flat ring maps by Lemma \ref{lemma-flat-going-down}). Thus we see that $\mathfrak p_1 = \mathfrak p_2$ by assumption (2). Since $\overline{k} = \bigcup k'$ we conclude $\mathfrak q_1 = \mathfrak q_2$. Hence $\Spec(R \otimes_k \overline{k})$ is irreducible. \medskip\noindent Assume (3) and let $\overline{k}$ be the algebraic closure of $k$. Let $\overline{k}/\overline{k}'/k$ be the corresponding separable algebraic closure of $k$. Then $\overline{k}/\overline{k}'$ is purely inseparable (in positive characteristic) or trivial. Hence $R \otimes_k \overline{k}' \to R \otimes_k \overline{k}$ induces a homeomorphism on spectra, for example by Lemma \ref{lemma-p-ring-map}. Thus we have (4). \medskip\noindent Assume (4). Let $k'/k$ be an arbitrary field extension and let $\overline{k}$ be the algebraic closure of $k$. We may choose a field $F$ such that both $k'$ and $\overline{k}$ are isomorphic to subfields of $F$. Then $$ R \otimes_k F = (R \otimes_k \overline{k}) \otimes_{\overline{k}} F $$ and hence we see from Lemma \ref{lemma-separably-closed-irreducible} that $R \otimes_k F$ has a unique minimal prime. Finally, the ring map $R \otimes_k k' \to R \otimes_k F$ is flat and injective and hence any minimal prime of $R \otimes_k k'$ is the image of a minimal prime of $R \otimes_k F$ (by Lemma \ref{lemma-injective-minimal-primes-in-image} and going down). We conclude that there is only one such minimal prime and the proof is complete.
Let $S' \subset S$ be a subalgebra. Then for any extension $k \subset k'$ the ring map $S' \otimes_k k' \to S \otimes_k k'$ is injective also. Hence (1) follows from Lemma \ref{lemma-injective-minimal-primes-in-image} (and the fact that the image of an irreducible space under a continuous map is irreducible). The second and third property follow from the fact that tensor product commutes with colimits.
Recall that irreducible components correspond to minimal primes (Lemma \ref{lemma-irreducible}). As $R \to R \otimes_k S$ is flat we see by going down (Lemma \ref{lemma-flat-going-down}) that any minimal prime of $R \otimes_k S$ lies over a minimal prime of $R$. Conversely, if $\mathfrak p \subset R$ is a (minimal) prime then $$ R \otimes_k S/\mathfrak p(R \otimes_k S) = (R/\mathfrak p) \otimes_k S \subset \kappa(\mathfrak p) \otimes_k S $$ by flatness of $R \to R \otimes_k S$. The ring $\kappa(\mathfrak p) \otimes_k S$ has irreducible spectrum by assumption. It follows that $R \otimes_k S/\mathfrak p(R \otimes_k S)$ has a single minimal prime (Lemma \ref{lemma-injective-minimal-primes-in-image}). In other words, the inverse image of the irreducible set $V(\mathfrak p)$ is irreducible. Hence the lemma follows.
Assume $k$ is algebraically closed in $K$. By Definition \ref{definition-geometrically-irreducible} and Lemma \ref{lemma-geometrically-irreducible} it suffices to show that the spectrum of $K \otimes_k k'$ is irreducible for every finite separable extension $k'/k$. Say $k'$ is generated by $\alpha \in k'$ over $k$, see Fields, Lemma \ref{fields-lemma-primitive-element}. Let $P = T^d + a_1 T^{d - 1} + \ldots + a_d \in k[T]$ be the minimal polynomial of $\alpha$. Then $K \otimes_k k' \cong K[T]/(P)$. The only way the spectrum of $K[T]/(P)$ can be reducible is if $P$ is reducible in $K[T]$. Assume $P = P_1 P_2$ is a nontrivial factorization in $K[T]$ to get a contradiction. By Lemma \ref{lemma-polynomials-divide} we see that the coefficients of $P_1$ and $P_2$ are algebraic over $k$. Our assumption implies the coefficients of $P_1$ and $P_2$ are in $k$ which contradicts the fact that $P$ is irreducible over $k$.
By Definition \ref{definition-geometrically-irreducible} and Lemma \ref{lemma-geometrically-irreducible} it suffices to show that the spectrum of $S \otimes_k k'$ is irreducible for every finite separable extension $k'/k$. Since $K$ is geometrically irreducible over $k$ we see that $K' = K \otimes_k k'$ is a finite, separable field extension of $K$. Hence the spectrum of $S \otimes_k k' = S \otimes_K K'$ is irreducible as $S$ is assumed geometrically irreducible over $K$.
Assume (1). Denote $\Omega$ an algebraic closure of $k(t)$. By Definition \ref{definition-geometrically-irreducible} we find that the spectrum of $$ K \otimes_k \Omega = K \otimes_k k(t) \otimes_{k(t)} \Omega $$ is irreducible. Since $K(t)$ is a localization of $K \otimes_k k(T)$ we conclude that the spectrum of $K(t) \otimes_{k(t)} \Omega$ is irreducible. Thus by Lemma \ref{lemma-geometrically-irreducible} we find that $K(t)/k(t)$ is geometrically irreducible. \medskip\noindent Assume (2). Let $k'/k$ be a field extension. We have to show that $K \otimes_k k'$ has a unique minimal prime. We know that the spectrum of $$ K(t) \otimes_{k(t)} k'(t) $$ is irreducible, i.e., has a unique minimal prime. Since there is an injective map $K \otimes_k k' \to K(t) \otimes_{k(t)} k'(t)$ (details omitted) we conclude by Lemmas \ref{lemma-injective-minimal-primes-in-image} and \ref{lemma-minimal-prime-image-minimal-prime}.
Assume (1) and let $\alpha \in K$ be separably algebraic over $k$. Then $k' = k(\alpha)$ is a finite separable extension of $k$ contained in $k$. By Lemma \ref{lemma-subalgebra-geometrically-irreducible} the extension $k'/k$ is geometrically irreducible. In particular, we see that the spectrum of $k' \otimes_k \overline{k}$ is irreducible (and hence if it is a product of fields, then there is exactly one factor). By Fields, Lemma \ref{fields-lemma-finite-separable-tensor-alg-closed} it follows that $\Hom_k(k', \overline{k})$ has one element which in turn implies that $k' = k$ by Fields, Lemma \ref{fields-lemma-separable-equality}. Thus (2) holds. \medskip\noindent Assume (2). Let $k' \subset K$ be the subfield consisting of elements algebraic over $k$. By Lemma \ref{lemma-field-extension-geometrically-irreducible} the extension $K/k'$ is geometrically irreducible. By assumption $k'/k$ is a purely inseparable extension. By Lemma \ref{lemma-p-ring-map} the extension $k'/k$ is geometrically irreducible. Hence by Lemma \ref{lemma-geometrically-irreducible-transitive} we see that $K/k$ is geometrically irreducible.
The first statement is immediate from Lemma \ref{lemma-geometrically-irreducible-separable-elements} and the fact that elements separably algebraic over $k'$ are in $k'$ by the transitivity of separable algebraic extensions, see Fields, Lemma \ref{fields-lemma-separable-permanence}. If $k \subset K$ is finitely generated, then $k'$ is finite over $k$ by Fields, Lemma \ref{fields-lemma-algebraic-closure-in-finitely-generated}.
Let $k \subset k' \subset K$ be the subextension found in Lemma \ref{lemma-make-geometrically-irreducible}. Note that as $k \subset \overline{k}$ is integral all the prime ideals of $\overline{k} \otimes_k K$ and $\overline{k} \otimes_k k'$ are maximal, see Lemma \ref{lemma-integral-no-inclusion}. By Lemma \ref{lemma-geometrically-irreducible-any-base-change} the map $$ \Spec(\overline{k} \otimes_k K) \to \Spec(\overline{k} \otimes_k k') $$ is bijective because (1) all primes are minimal primes, (2) $\overline{k} \otimes_k K = (\overline{k} \otimes_k k') \otimes_{k'} K$, and (3) $K$ is geometrically irreducible over $k'$. Hence it suffices to prove the lemma for the action of $\text{Gal}(\overline{k}/k)$ on the primes of $\overline{k} \otimes_k k'$. \medskip\noindent As every prime of $\overline{k} \otimes_k k'$ is maximal, the residue fields are isomorphic to $\overline{k}$. Hence the prime ideals of $\overline{k} \otimes_k k'$ correspond one to one to elements of $\Hom_k(k', \overline{k})$ with $\sigma \in \Hom_k(k', \overline{k})$ corresponding to the kernel $\mathfrak p_\sigma$ of $1 \otimes \sigma : \overline{k} \otimes_k k' \to \overline{k}$. In particular $\text{Gal}(\overline{k}/k)$ acts transitively on this set as desired.
Recall that $\Spec(R)$ is connected if and only if $R$ has no nontrivial idempotents, see Lemma \ref{lemma-characterize-spec-connected}. Hence, by Lemma \ref{lemma-limit-argument} we may assume $R$ and $S$ are of finite type over $k$. In this case $R$ and $S$ are Noetherian, and have finitely many minimal primes, see Lemma \ref{lemma-Noetherian-irreducible-components}. Thus we may argue by induction on $n + m$ where $n$, resp.\ $m$ is the number of irreducible components of $\Spec(R)$, resp.\ $\Spec(S)$. Of course the case where either $n$ or $m$ is zero is trivial. If $n = m = 1$, i.e., $\Spec(R)$ and $\Spec(S)$ both have one irreducible component, then the result holds by Lemma \ref{lemma-separably-closed-irreducible}. Suppose that $n > 1$. Let $\mathfrak p \subset R$ be a minimal prime corresponding to the irreducible closed subset $T \subset \Spec(R)$. Let $I \subset R$ be such that $T' = V(I) \subset \Spec(R)$ is the closure of the complement of $T$. Note that this means that $T' = \Spec(R/I)$ (Lemma \ref{lemma-spec-closed}) has $n - 1$ irreducible components. Then $T \cup T' = \Spec(R)$, and $T \cap T' = V(\mathfrak p + I) = \Spec(R/(\mathfrak p + I))$ is not empty as $\Spec(R)$ is assumed connected. The inverse image of $T$ in $\Spec(R \otimes_k S)$ is $\Spec(R/\mathfrak p \otimes_k S)$, and the inverse of $T'$ in $\Spec(R \otimes_k S)$ is $\Spec(R/I \otimes_k S)$. By induction these are both connected. The inverse image of $T \cap T'$ is $\Spec(R/(\mathfrak p + I) \otimes_k S)$ which is nonempty. Hence $\Spec(R \otimes_k S)$ is connected.
For any extension of fields $k \subset k'$ the connectivity of the spectrum of $R \otimes_k k'$ is equivalent to $R \otimes_k k'$ having no nontrivial idempotents, see Lemma \ref{lemma-characterize-spec-connected}. Assume (2). Let $k \subset \overline{k}$ be a separable algebraic closure of $k$. Using Lemma \ref{lemma-limit-argument} we see that (2) is equivalent to $R \otimes_k \overline{k}$ having no nontrivial idempotents. For any field extension $k \subset k'$, there exists a field extension $\overline{k} \subset \overline{k}'$ with $k' \subset \overline{k}'$. By Lemma \ref{lemma-separably-closed-connected} we see that $R \otimes_k \overline{k}'$ has no nontrivial idempotents. If $R \otimes_k k'$ has a nontrivial idempotent, then also $R \otimes_k \overline{k}'$, contradiction.
The second assertion follows from the first combined with Lemma \ref{lemma-connected-component}. By Lemmas \ref{lemma-subalgebra-geometrically-connected} and \ref{lemma-limit-argument} we may assume that $R$ and $S$ are of finite type over $k$. Then we see that also $R \otimes_k S$ is of finite type over $k$. Note that in this case all the rings are Noetherian and hence their spectra have finitely many connected components (since they have finitely many irreducible components, see Lemma \ref{lemma-Noetherian-irreducible-components}). In particular, all connected components in question are open! Hence via Lemma \ref{lemma-disjoint-implies-product} we see that the first statement of the lemma in this case is equivalent to the second. Let's prove this. As the algebra $S$ is geometrically connected and nonzero we see that all fibres of $X = \Spec(R \otimes_k S) \to \Spec(R) = Y$ are connected and nonempty. Also, as $R \to R \otimes_k S$ is flat of finite presentation the map $X \to Y$ is open (Proposition \ref{proposition-fppf-open}). Topology, Lemma \ref{topology-lemma-connected-fibres-connected-components} shows that $X \to Y$ induces bijection on connected components.
By Lemma \ref{lemma-geometrically-reduced-any-reduced-base-change} the ring $R \otimes_k S$ is reduced and by Lemma \ref{lemma-geometrically-irreducible-any-base-change} the ring $R \otimes_k S$ is irreducible (the spectrum has just one irreducible component), so $R \otimes_k S$ is an integral domain.
We consider the collection of local subrings of $K$ as a partially ordered set using the relation of domination. Suppose that $\{A_i\}_{i \in I}$ is a totally ordered collection of local subrings of $K$. Then $B = \bigcup A_i$ is a local subring which dominates all of the $A_i$. Hence by Zorn's Lemma, it suffices to show that if $A \subset K$ is a local ring whose fraction field is not $K$, then there exists a local ring $B \subset K$, $B \not = A$ dominating $A$. \medskip\noindent Pick $t \in K$ which is not in the fraction field of $A$. If $t$ is transcendental over $A$, then $A[t] \subset K$ and hence $A[t]_{(t, \mathfrak m)} \subset K$ is a local ring distinct from $A$ dominating $A$. Suppose $t$ is algebraic over $A$. Then for some $a \in A$ the element $at$ is integral over $A$. In this case the subring $A' \subset K$ generated by $A$ and $ta$ is finite over $A$. By Lemma \ref{lemma-integral-overring-surjective} there exists a prime ideal $\mathfrak m' \subset A'$ lying over $\mathfrak m$. Then $A'_{\mathfrak m'}$ dominates $A$. If $A = A'_{\mathfrak m'}$, then $t$ is in the fraction field of $A$ which we assumed not to be the case. Thus $A \not = A'_{\mathfrak m'}$ as desired.
Assume that $x$ is not in $A$. Let $A'$ denote the subring of $K$ generated by $A$ and $x$. Since $A$ is a valuation ring we see that there is no prime of $A'$ lying over $\mathfrak m$. Since $\mathfrak m$ is maximal we see that $V(\mathfrak m A') = \emptyset$. Then $\mathfrak m A' = A'$ by Lemma \ref{lemma-Zariski-topology}. Hence we can write $1 = \sum_{i = 0}^d t_i x^i$ with $t_i \in \mathfrak m$. This implies that $(1 - t_0) (x^{-1})^d - \sum t_i (x^{-1})^{d - i} = 0$. In particular we see that $x^{-1}$ is integral over $A$. Thus the subring $A''$ of $K$ generated by $A$ and $x^{-1}$ is finite over $A$ and we see there exists a prime ideal $\mathfrak m'' \subset A''$ lying over $\mathfrak m$ by Lemma \ref{lemma-integral-overring-surjective}. Since $A$ is a valuation ring we conclude that $A = (A'')_{\mathfrak m''}$ and hence $x^{-1} \in A$.
If $A$ is not $K$, then $A$ is not a field and there is a nonzero maximal ideal $\mathfrak m$. If $\mathfrak m'$ is a second maximal ideal, then choose $x, y \in A$ with $x \in \mathfrak m$, $y \not \in \mathfrak m$, $x \not \in \mathfrak m'$, and $y \in \mathfrak m'$ (see Lemma \ref{lemma-silly}). Then neither $x/y \in A$ nor $y/x \in A$ contradicting the assumption of the lemma. Thus we see that $A$ is a local ring. Suppose that $A'$ is a local ring contained in $K$ which dominates $A$. Let $x \in A'$. We have to show that $x \in A$. If not, then $x^{-1} \in A$, and of course $x^{-1} \in \mathfrak m_A$. But then $x^{-1} \in \mathfrak m_{A'}$ which contradicts $x \in A'$.
It is clear that $A$ is a domain. Let $a, b \in A$. Lemma \ref{lemma-x-or-x-inverse-valuation-ring} tells us we have to show that either $a | b$ or $b | a$ in $A$. Choose $i$ so large that there exist $a_i, b_i \in A_i$ mapping to $a, b$. Then Lemma \ref{lemma-valuation-ring-x-or-x-inverse} applied to $a_i, b_i$ in $A_i$ implies the result for $a, b$ in $A$.
By Lemma \ref{lemma-valuation-ring-cap-field} the ring $A$ is a valuation ring. If $A$ is a field, then $A = K$. Then $A = K \subset B$ is an integral extension, hence there are no proper inclusions among the primes of $B$ (Lemma \ref{lemma-integral-no-inclusion}). This contradicts the assumption that $B$ is a local domain and not a field.
Note that $\mathfrak m_{A'} \subset C$ and $C/\mathfrak m_{A'} = A$. In particular, the fraction field of $C$ is equal to the fraction field of $A'$. We will use the criterion of Lemma \ref{lemma-x-or-x-inverse-valuation-ring} to prove the lemma. Let $x$ be an element of the fraction field of $C$. By the lemma we may assume $x \in A'$. If $x \in \mathfrak m_{A'}$, then we see $x \in C$. If not, then $x$ is a unit of $A'$ and we also have $x^{-1} \in A'$. Hence either $x$ or $x^{-1}$ maps to an element of $A$ by the lemma again.
Suppose $x$ is in the field of fractions of $A$ and integral over $A$, say $x^{d + 1} + \sum_{i \leq d} a_i x^i = 0$. By Lemma \ref{lemma-x-or-x-inverse-valuation-ring} either $x \in A$ (and we're done) or $x^{-1} \in A$. In the second case we see that $x = - \sum a_i x^{i - d} \in A$ as well.
Suppose $x \in K$, $x \not \in A$. Consider $B = A[x^{-1}]$. Then $x \not \in B$. Namely, if $x = a_0 + a_1x^{-1} + \ldots + a_d x^{-d}$ then $x^{d + 1} - a_0x^d - \ldots - a_d = 0$ and $x$ is integral over $A$ in contradiction with the fact that $A$ is normal. Thus $x^{-1}$ is not a unit in $B$. Thus $V(x^{-1}) \subset \Spec(B)$ is not empty (Lemma \ref{lemma-Zariski-topology}), and we can choose a prime $\mathfrak p \subset B$ with $x^{-1} \in \mathfrak p$. Choose a valuation ring $V \subset K$ dominating $B_\mathfrak p$ (Lemma \ref{lemma-dominate}). Then $x \not \in V$ as $x^{-1} \in \mathfrak m_V$. \medskip\noindent If $A$ is local, then we claim that $x^{-1} B + \mathfrak m_A B \not = B$. Namely, if $1 = (a_0 + a_1x^{-1} + \ldots + a_d x^{-d})x^{-1} + a'_0 + \ldots + a'_d x^{-d}$ with $a_i \in A$ and $a'_i \in \mathfrak m_A$, then we'd get $$ (1 - a'_0) x^{d + 1} - (a_0 + a'_1) x^d - \ldots - a_d = 0 $$ Since $a'_0 \in \mathfrak m_A$ we see that $1 - a'_0$ is a unit in $A$ and we conclude that $x$ would be integral over $A$, a contradiction as before. Then choose the prime $\mathfrak p \supset x^{-1} B + \mathfrak m_A B$ we find $V$ dominating $A$.
Assume $A$ is a valuation ring and let $f_1, \ldots, f_n \in A$. Choose $i$ such that $v(f_i)$ is minimal among $v(f_j)$. Then $(f_i) = (f_1, \ldots, f_n)$. Conversely, assume $A$ is a local domain and every finitely generated ideal of $A$ is principal. Pick $f, g \in A$ and write $(f, g) = (h)$. Then $f = ah$ and $g = bh$ and $h = cf + dg$ for some $a, b, c, d \in A$. Thus $ac + bd = 1$ and we see that either $a$ or $b$ is a unit, i.e., either $g/f$ or $f/g$ is an element of $A$. This shows $A$ is a valuation ring by Lemma \ref{lemma-x-or-x-inverse-valuation-ring}.
Suppose $A$ is a discrete valuation ring with valuation $v : A \setminus \{0\} \to \mathbf{Z}$ normalized so that $\Im(v) = \mathbf{Z}_{\geq 0}$. By Lemma \ref{lemma-ideals-valuation-ring} the ideals of $A$ are the subsets $I_n = \{0\} \cup v^{-1}(\mathbf{Z}_{\geq n})$. It is clear that any element $x \in A$ with $v(x) = n$ generates $I_n$. Hence $A$ is a PID so certainly Noetherian. \medskip\noindent Suppose $A$ is a Noetherian valuation ring with value group $\Gamma$. By Lemma \ref{lemma-ideals-valuation-ring} we see the ascending chain condition holds for ideals in $\Gamma$. We may assume $A$ is not a field, i.e., there is a $\gamma \in \Gamma$ with $\gamma > 0$. Applying the ascending chain condition to the subsets $\gamma + \Gamma_{\geq 0}$ with $\gamma > 0$ we see there exists a smallest element $\gamma_0$ which is bigger than $0$. Let $\gamma \in \Gamma$ be an element $\gamma > 0$. Consider the sequence of elements $\gamma$, $\gamma - \gamma_0$, $\gamma - 2\gamma_0$, etc. By the ascending chain condition these cannot all be $> 0$. Let $\gamma - n \gamma_0$ be the last one $\geq 0$. By minimality of $\gamma_0$ we see that $0 = \gamma - n \gamma_0$. Hence $\Gamma$ is a cyclic group as desired.
Consider the ring $S = R \oplus I \oplus I^2 \oplus \ldots = \bigoplus_{n \geq 0} I^n$. Convention: $I^0 = R$. Multiplication maps $I^n \times I^m$ into $I^{n + m}$ by multiplication in $R$. Note that if $I = (f_1, \ldots, f_t)$ then $S$ is a quotient of the Noetherian ring $R[X_1, \ldots, X_t]$. The map just sends the monomial $X_1^{e_1}\ldots X_t^{e_t}$ to $f_1^{e_1}\ldots f_t^{e_t}$. Thus $S$ is Noetherian. Similarly, consider the module $M \oplus IM \oplus I^2M \oplus \ldots = \bigoplus_{n \geq 0} I^nM$. This is a finitely generated $S$-module. Namely, if $x_1, \ldots, x_r$ generate $M$ over $R$, then they also generate $\bigoplus_{n \geq 0} I^nM$ over $S$. Next, consider the submodule $\bigoplus_{n \geq 0} I^nM \cap N$. This is an $S$-submodule, as is easily verified. By Lemma \ref{lemma-Noetherian-basic} it is finitely generated as an $S$-module, say by $\xi_j \in \bigoplus_{n \geq 0} I^nM \cap N$, $j = 1, \ldots, s$. We may assume by decomposing each $\xi_j$ into its homogeneous pieces that each $\xi_j \in I^{d_j}M \cap N$ for some $d_j$. Set $c = \max\{d_j\}$. Then for all $n \geq c$ every element in $I^nM \cap N$ is of the form $\sum h_j \xi_j$ with $h_j \in I^{n - d_j}$. The lemma now follows from this and the trivial observation that $I^{n-d_j}(I^{d_j}M \cap N) \subset I^{n-c}(I^cM \cap N)$.
Let $N = \bigcap_{n \geq 0} I^nM$. Then $N = I^nM \cap N$ for all $n \geq 0$. By the Artin-Rees Lemma \ref{lemma-Artin-Rees} we see that $N = I^nM \cap N \subset IN$ for some suitably large $n$. By Nakayama's Lemma \ref{lemma-NAK} we see that $N = 0$.
Proof of (1). Let $x_1, \ldots, x_n$ be generators for the module $N$, see Lemma \ref{lemma-Noetherian-basic}. For every prime $\mathfrak p$, $I \subset \mathfrak p$ we see that the image of $N$ in the localization $M_{\mathfrak p}$ is zero, by Lemma \ref{lemma-intersect-powers-ideal-module-zero}. Hence we can find $g_i \in R$, $g_i \not \in \mathfrak p$ such that $x_i$ maps to zero in $N_{g_i}$. Thus $N_{g_1g_2\ldots g_n} = 0$. \medskip\noindent Part (2) follows from (1) and Lemma \ref{lemma-characterize-zero-local}.
Assume $\mathfrak m^n M \not = 0$ for all $n\geq 0$. Choose $x \in M$ and $f_1, \ldots, f_n \in \mathfrak m$ such that $f_1f_2 \ldots f_n x \not = 0$. By Nakayama's Lemma \ref{lemma-NAK} the first $n$ steps in the filtration $$ 0 \subset R f_1 \ldots f_n x \subset R f_1 \ldots f_{n - 1} x \subset \ldots \subset R x \subset M $$ are distinct. This can also be seen directly. For example, if $R f_1 x = R f_1 f_2 x$ , then $f_1 x = g f_1 f_2 x$ for some $g$, hence $(1 - gf_2) f_1 x = 0$ hence $f_1 x = 0$ as $1 - gf_2$ is a unit which is a contradiction with the choice of $x$ and $f_1, \ldots, f_n$. Hence the length is infinite, i.e., (1) holds. Combine (1) and Lemma \ref{lemma-finite-length-finite} to see (2).
Consider the filtration $0 = \mathfrak m^n M \subset \mathfrak m^{n-1} M \subset \ldots \subset \mathfrak m M \subset M$. All of the subquotients are finitely generated $R$-modules to which Lemma \ref{lemma-dimension-is-length} applies. We conclude by additivity, see Lemma \ref{lemma-length-additive}.
Let $\mathfrak m$ be a maximal ideal of $R$. By Lemma \ref{lemma-dimension-is-length} the module $R/\mathfrak m$ has length $1$. The equivalence of the first two assertions is tautological. Suppose that $M$ is simple. Choose $x \in M$, $x \not = 0$. As $M$ is simple we have $M = R \cdot x$. Let $I \subset R$ be the annihilator of $x$, i.e., $I = \{f \in R \mid fx = 0\}$. The map $R/I \to M$, $f \bmod I \mapsto fx$ is an isomorphism, hence $R/I$ is a simple $R$-module. Since $R/I \not = 0$ we see $I \not = R$. Let $I \subset \mathfrak m$ be a maximal ideal containing $I$. If $I \not = \mathfrak m$, then $\mathfrak m /I \subset R/I$ is a nontrivial submodule contradicting the simplicity of $R/I$. Hence we see $I = \mathfrak m$ as desired.
If $M_i/M_{i-1}$ is not simple then we can refine the filtration and the filtration is not maximal. Thus we see that $M_i/M_{i-1}$ is simple. By Lemma \ref{lemma-characterize-length-1} the modules $M_i/M_{i-1}$ have length $1$ and are of the form $R/\mathfrak m_i$ for some maximal ideals $\mathfrak m_i$. By additivity of length, Lemma \ref{lemma-length-additive}, we see $n = \text{length}_R(M)$. Since localization is exact, we see that $$ 0 = (M_0)_{\mathfrak m} \subset (M_1)_{\mathfrak m} \subset (M_2)_{\mathfrak m} \subset \ldots \subset (M_n)_{\mathfrak m} = M_{\mathfrak m} $$ is a filtration of $M_{\mathfrak m}$ with successive quotients $(M_i/M_{i-1})_{\mathfrak m}$. Thus the last statement follows directly from the fact that given maximal ideals $\mathfrak m$, $\mathfrak m'$ of $R$ we have $$ (R/\mathfrak m')_{\mathfrak m} \cong \left\{ \begin{matrix} 0 & \text{if } \mathfrak m \not = \mathfrak m', \\ R_{\mathfrak m}/\mathfrak m R_{\mathfrak m} & \text{if } \mathfrak m  = \mathfrak m' \end{matrix} \right. $$ This we leave to the reader.