text:
By a ``ring'' in this book we mean a commutative ring with identity, and an integral domain is a ring without zero-divisors. In this chapter we briefly recall several notions related to rings.

\section{Fundamental theorem of finitely generated modules over a PID}
A {\em principal ideal domain} (in short, {\em PID}) is an integral domain such that every ideal is principal. An {\em irreducible element} or {\em prime} of a PID is a nonzero element which is a non-unit\footnote{A unit of a ring is an element which has a multiplicative inverse.} and which can not be expressed as a product of two non-units. The following is usually called the ``fundamental theorem'' or the ``structure theorem'' of finitely generated modules over a PID. Its proof can be found in any standard introductory abstract algebra text, e.g.\ \cite{dummit-foote}.

\begin{thm} \label{fundamentally-over-PID}
Let $M$ be a finitely generated module over a PID $R$. Then
$$M \cong R^r \dsum R/\langle p_1^{\alpha_1} \rangle
			  \dsum R/\langle p_2^{\alpha_2} \rangle \cdots
			  \dsum R/\langle p_k^{\alpha_k} \rangle$$
for some $r, \alpha_1, \ldots, \alpha_k \geq 0$ and primes $p_1, \ldots, p_k$.
\end{thm}

\section{Prime and Maximal ideals, Noetherian rings, Zero-divisors}
Given elements $g_1, \ldots, g_k$ of a ring $R$, we write $\langle g_1, \ldots, g_k\rangle$ to denote the ideal generated by $R$. Recall that a {\em prime} ideal of $R$ is a proper ideal $\ppp$ such that $fg \in \ppp$ implies either $f$ or $g$ is in $\ppp$. A {\em maximal} ideal of $R$ is a proper ideal $\mmm$ such that the only proper ideal of $R$ containing $\mmm$ is $\mmm$ itself. It is straightforward to check that every maximal ideal is prime. The following are some other basic properties of prime and maximal ideals - see e.g.\ \cite[Chapter 1]{am} for their proof.

\begin{thm} \label{thm:mp}
Let $R$ be a nonzero ring (remember that by ``ring'' we mean a commutative ring with identity).
\begin{enumerate}
\item \label{mp:max-existence} Given any non-unit $g \in R$, there is a maximal ideal of $R$ containing $g$.
\item \label{mp:prime-avoidence} If $\qqq$ is an ideal of $R$ contained in the union of finitely many prime ideals $\ppp_1, \ldots, \ppp_k$ of $R$, then $\qqq \subseteq \ppp_j$ for some $j$.
\item \label{mp:prime-containment} If $\ppp$ is a prime ideal of $R$ containing the intersection of finitely many ideals $\qqq_1, \ldots, \qqq_k$, then $\ppp \supseteq \qqq_j$ for some $j$. If $\ppp = \bigcap_{j=1}^k \qqq_j$, then $\ppp = \qqq_j$ for some $j$.
\item \label{mp:nilradical} The intersection of all prime ideals of $R$ is precisely its {\em nilradical}, i.e.\ the ideal consisting of all {\em nilpotent}\footnote{$g \in R$ is called {\em nilpotent} if there is $n \geq 1$ such that $g^n = 0$.} elements of $R$ 	.
\end{enumerate}
\end{thm}

Assertion \eqref{mp:prime-avoidence} of \cref{thm:mp} is sometimes referred to as ``prime avoidance''; see \cite[Lemma 3.3]{eisenview} for a stronger variation and geometric interpretation. A ring $R$ is called {\em Notherian} if every nonempty set $\scrI$ of ideals in $R$ has a maximal element with respect to $\subseteq$, i.e.\ there is an ideal $\qqq \in \scrI$ such that the only element of $\scrI$ containing $\qqq$ is $\qqq$ itself. It is straightforward to check that the ring of integers, or more generally, any PID is Noetherian. Hilbert's basis theorem (\cref{thm:Hilbert-basis}) implies that quotients of polynomial rings in finitely many variables over a field are also Noetherian. Most of the rings that appear in this book are Noetherian. The ring $R[x_1, x_2,\cdots]$ of polynomials in infinitely many variables $x_j$, $j \geq 1$, over a ring $R$ is {\em not} Noetherian, since e.g.\ the sequence of ideals $\langle x_1, \ldots, x_n \rangle$, $n \geq 1$, does not have any maximal element. A {\em zero-divisor} in a ring $R$ is a nonzero element $f$ such that $fg = 0$ for some nonzero $g$. Given $g \in R$, one writes $(0:g)$ for the set of all $f \in R$ such that $fg = 0$; in other words $(0:g)$ is the {\em annihilator} of $g$. It is clear that the set of zero-divisors is precisely the union of the annihilators of the nonzero elements of $R$.

\begin{prop} \label{prop:zero-union-prime}
The set of zero-divisors in a Noetherian ring $R$ is a union of prime ideals which are of the form $(0:g)$ for some $g \in R$.
\end{prop}

\begin{proof}
Let $\scrI$ be the set of all ideals of a Noetherian ring $R$ of the form $(0:g)$, where $g$ varies over nonzero elements of $R$. By Noetherianity of $R$, each $\qqq \in \scrI$ is contained in a maximal element $\ppp \in \scrI$. We will show that $\ppp$ is prime. Indeed, pick $g \in R$ such that $\ppp = (0:g)$. If $\ppp$ is not prime, then there is $f_1f_2 \in R \setminus \ppp$ such that $f_1f_2 \in \ppp$, i.e.\ $f_1f_2g = 0$. But then $(0:f_2g)$ properly contains $\ppp$. This contradiction (to the maximality of $\ppp$) completes the proof.
\end{proof}

In \cref{prop:zero-union-minimally-prime} below we prove a stronger version of \cref{prop:zero-union-prime}.

\section{Nakayama's lemma}
In this section we present a brief discussion of {\em Nakayama's lemma} following \cite{am}. Let $R$ be a ring, and $\jjj$ be its {\em Jacobson ideal}, i.e.\ the intersection of all the maximal ideals of $R$.

\begin{lemma} \label{jacobson-unit}
$1 + f$ is a unit in $R$ for each $f \in \jjj$.
\end{lemma}

\begin{proof}[Proof of \cref{jacobson-unit}]
Pick $f \in \jjj$. If $1 + f$ is not a unit, then there is a maximal ideal $\mmm$ of $R$ that contains $1 + f$ (\cref{thm:mp}, assertion \eqref{mp:max-existence}). Since $\mmm$ contains both $f$ and $1 + f$, it contains $1$, which is a contradiction.
\end{proof}

\begin{lemma}[Nakayama] \label{Nakayama}
Let $M$ be a finitely generated $R$-module and $\qqq$ be an ideal of $R$ contained in the Jacobson ideal of $R$. If $\qqq M = M$, then $M = 0$.
\end{lemma}

\begin{proof}
Assume $M \neq 0$ and let $u_1, \ldots, u_k$ be a minimal set of generators of $M$. Since $u_k \in \qqq M$, there is an equation of the form $u_k = \sum_{j=1}^k f_ju_j$, with each $f_j \in \qqq$. It follows that $(1-f_j)u_k = \sum_{j=1}^{k-1}u_jf_j$. Since $1 - f_j$ is a unit in $R$ (\cref{jacobson-unit}), it follows that $u_k$ is an $R$-linear combination of $u_1, \ldots, u_{k-1}$. This means that $M$ can be generated by $u_1, \ldots, u_{k-1}$, a contradiction.
\end{proof}
Let $R$ be a local ring with (the unique) maximal ideal $\mmm$, and $\kk = R/\mmm$ be its residue field. Let $M$ be a finitely generated $R$-module. Since $M/\mmm M$ is annihilated by $\mmm$, it is a finitely generated $R/\mmm$-module, i.e.\ a finite dimensional vector space over $\kk$.

\begin{cor} \label{Nakayama-generation}
Let $m_1, \ldots, m_k \in M$ be such that their images span $M/\mmm M$ as a vector space over $\kk$. Then $m_1, \ldots, m_k$ generate $M$ as a module over $R$.
\end{cor}

\begin{proof}
Let $N$ be the submodule of $M$ generated by $m_1, \ldots, m_k$. Since the image of $N$ in $M/\mmm M$ is all of $M/\mmm M$, it follows that $M = N + \mmm M$. But then $\mmm (M/N) = (N + \mmm M)/N = M/N$. \Cref{Nakayama} then implies that $M = N$, as required.
\end{proof}

\section{Local rings} \label{local-ring-section}
A {\em local ring} is a ring with a unique maximal ideal. If $S$ is a multiplicative closed subset of a ring $R$, then the {\em localization} $R_S$ of $R$ with respect to $S$ is the equivalence class of ``fractions'' $\{f/g: f \in R,\ g \in S\}$ under the equivalence relation that $f/g \sim f'/g'$ provided $(fg' - f'g)h = 0$ for some $h \in S$. It is easy to check that $R_S$ is a commutative ring with respect to the usual rules of addition and multiplication of fractions. Two cases of localizations are especially relevant for our purpose:
\begin{itemize}
\item Case 1: $S = \{f^k\}_k$ for some $f \in R$. In this case we denote $R_S$ by $R_f$, and say that $R_f$ is the {\em localization of $R$ at $f$.}
\item Case 2: $S = R \setminus \ppp$ for some prime ideal $\ppp$ of $R$. In this case we denote $R_S$ by $R_\ppp$, and say that $R_\ppp$ is the {\em localization of $R$ at $\ppp$.}
\end{itemize}
It is straightforward to check that [the equivalence class of] every element of $S$ is invertible in $R_S$ (unless it is the zero ring), and every ideal $I$ of of $R_S$ is generated by $R \cap I$. It follows that if $R$ is Noetherian, then so is $R_S$. We refer to \cite[Chapter 3]{am} for a lucid discussion of these and other basic properties of localizations of commutative rings.

\section{Discrete valuation rings}\label{discrete-valuection}

A {\em discrete valuation} on a field $K$ is a surjective map $\nu$ from $K$ onto $\zz \cup \{\infty\}$ such that $\nu(0) = \infty$, $\nu(fg) = \nu(f) + \nu(g)$ and $\nu(f+g) \geq \min\{\nu(f), \nu(g)\}$ for each $f,g \in K$. It is straightforward to check that the set of all $f \in K$ such that $\nu(f) \geq 0$ is a subring of $K$; it is called the {\em valuation ring} of $\nu$.

\begin{example}
A basic example of a discrete valuation is the {\em order} of rational functions in one variable. Recall that the order of $f = \sum_j a_j t^j \in \kk[t]$, where $t$ is an indeterminate, is $\ord(f) := \min\{j: a_j \neq 0\}$, and the order can be extended to rational functions by defining $\ord(f/g) := \ord(f) - \ord(g)$. The valuation ring of $\ord$ is precisely the localization of $\kk[t]$ at the maximal ideal generated by $t$, i.e.\ the subring $\{f/g: f, g \in \kk[t],\ g(0) \neq 0\}$ of $\kk(t)$.
\end{example}

A {\em discrete valuation ring} is an integral domain which is the valuation ring of a discrete valuation on its field of fractions. We now record some properties of discrete valuation rings: their verification is straightforward, and is left as an exercise.

\begin{prop} \label{prop:discrete-properties}
Let $\nu$ be a discrete valuation on a field $K$, and $R := \{f \in K: \nu(f) \geq 0\}$ be the valuation ring of $\nu$.
\begin{enumerate}
\item The units of $R$ are precisely the elements $f$ in $K$ with $\nu(f) = 0$.
\item $\mmm := \{f \in K: \nu(f) > 0\}$ is the unique maximal ideal of $R$; in particular, $R$ is a {\em local ring}.
\item If $f$ is any element in $\mmm$ such that $\nu(f) = 1$, then $\mmm$ is the (principal) ideal of $R$ generated by $f$. More generally, every proper ideal of $R$ is a principal ideal generated by $f^k$ for some $k \geq 1$.
\item \label{exercise:discrete-properties-dim} If $R$ contains a field $\kk$ which is isomorphic to $R/\mmm$, then for each $g \in R$, $R/gR$ is a vector space over $\kk$ of dimension $\nu(g)$.
\item \label{uniquely-dvr} $R$ uniquely determines $\nu$, i.e.\ if $\nu'$ is a discrete valuation on $K$ such that $R$ is also the valuation ring of $\nu'$, then $\nu' = \nu$. \qed
\end{enumerate}
\end{prop}

\Cref{prop:discrete-properties} in particular implies that a discrete valuation ring $R$ is a local ring whose maximal ideal is principal. A {\em parameter} of $R$ is a generator of its maximal ideal.

\section{Krull dimension} \label{Krull-section}
A {\em chain} of prime ideals of length $n \geq 0$ in a ring $R$ is a finite sequence $\ppp_0 \subsetneq \ppp_1 \subsetneq \cdots \subsetneq \ppp_n$ of prime ideals of $R$. The {\em Krull dimension} of $R$ is the supremum of the lengths of all chains of prime ideals in $R$.

\begin{example} \label{Krull-examples}
Since the only maximal ideal of a nontrivial field $F$ is the zero ideal, the Krull dimension of $F$ is zero. Each of the following rings has Krull dimension one: the ring of integers, the ring of polynomials in one variable over a field, a discrete valuation ring.
\end{example}

\section{Primary Decomposition} \label{appendix:primary-decomposition}
A proper ideal $\qqq$ of a ring $R$ is {\em primary} if $fg \in \qqq$ implies either $f \in \qqq$ or $g^k \in \qqq$ for some $k \geq 1$.

\begin{prop} \label{prop:radical-of-primaries}
Let $\qqq$ be an ideal of a ring $R$ and $\sqrt{\qqq}$ be the radical\footnote{The radical of $\qqq$ is the ideal consisting of all $g \in R$ such that $g^k \in \qqq$ for some $k \geq 1$.} of $\qqq$.
\begin{enumerate}
\item If $\qqq$ is primary, then $\sqrt{\qqq}$ is prime.
\item \label{radical-of-primaries:maximal} If $\sqrt{\qqq}$ is {\em maximal}, then $\qqq$ is primary.
\item \label{radical-of-primaries:intersection} Write $\ppp := \sqrt{\qqq}$. Assume $\qqq$ and $\qqq'$ are primary ideals of $R$ such that $\sqrt{\qqq'} = \sqrt{\qqq} = \ppp$. Then $\qqq \cap \qqq'$ is also primary and $\sqrt{\qqq \cap \qqq'} = \ppp$.
\end{enumerate}
\end{prop}

\begin{proof}
The proof of the first assertion is straightforward from the definition of a primary ideal - it is left as an exercise. For the second assertion, assume $\sqrt{\qqq}$ is maximal.

\begin{proclaim} \label{claim:radmax-unit}
If $g \not\in \sqrt{\qqq}$, then $g$ is a unit in $R/\qqq$.
\end{proclaim}

\begin{proof}
Indeed, there is $f \in \sqrt{\qqq}$ and $u, v \in R$ such that $gu + fv = 1$. If $k \geq 1$ is such that $f^k \in \qqq$, then the relation $(gu + fv)^k = 1$ reduces to $gu' = 1$ in $R/\qqq$ for an appropriate $u' \in R$.
\end{proof}

Pick $f, g \in R$ such that $fg \in \qqq$. If $g \not\in \sqrt{\qqq}$, then \cref{claim:radmax-unit} implies that $f \in \qqq$. Therefore $\qqq$ is primary. It remains to prove the third assertion. It is straightforward to check that $\sqrt{\qqq \cap \qqq'} = \sqrt{\qqq} \cap \sqrt{\qqq'} = \ppp$. Now pick $fg \in \qqq \cap \qqq'$ such that $f \not\in \qqq \cap \qqq'$. Then $f$ is not in either $\qqq$ or $\qqq'$, and since both are primary with radical $\ppp$, it follows that $g \in \ppp = \sqrt{\qqq \cap \qqq'}$, so that $\qqq \cap \qqq'$ is also primary.
\end{proof}

\begin{example} \label{example:xy-y^2}
The ideal $\qqq$ of $\kk[x,y]$ generated by $x^2$ and $xy$ is {\em not} primary, since $xy \in \qqq$, but $x \not\in \qqq$ and $y \not\in \sqrt{\qqq} = \langle x \rangle$. In particular, assertion \eqref{radical-of-primaries:maximal} of \cref{prop:radical-of-primaries} does not hold if ``maximal'' is replaced by ``prime.''
\end{example}

\begin{example}
The primary ideals of $\kk[t]$ are the zero ideal and the ideals generated by $f^n$, $n \geq 1$, for irreducible polynomials $f$. More generally, the nonzero primary ideals of a PID are precisely the ideals generated by powers of irreducible elements.
\end{example}

\begin{example}
The ideal $\qqq$ of $\kk[x,y]$ generated by $x$ and $y^2$ is primary (\cref{prop:radical-of-primaries}, assertion \eqref{radical-of-primaries:maximal}). The radical of $\qqq$ is the maximal ideal $\mmm$ generated by $x, y$. Note that $\mmm \supsetneq \qqq \supsetneq \mmm^2$, so that $\qqq$ is {\em not} a prime-power.
\end{example}

A {\em primary decomposition} of an ideal $\qqq$ is an expression
\begin{align}
\qqq = \bigcap_{j = 1}^k \qqq_j \label{eqn:minimal-decomposition}
\end{align}
of $\qqq$ as a finite intersection of primary ideals $\qqq_j$. Given such a primary decomposition, excluding any redundant ideal from the right hand side and then grouping the ideals with the same radical, it can be ensured that
\begin{itemize}
\item $\qqq$ can {\em not} be expressed as an intersection of less than $k$ of the $\qqq_j$, and
\item the radicals $\sqrt{\qqq_j}$ of $\qqq_j$ are distinct (due to assertion \eqref{radical-of-primaries:intersection} of \cref{prop:radical-of-primaries});
\end{itemize}
in that case we say that \eqref{eqn:minimal-decomposition} is a {\em minimal} primary decomposition, and that the prime ideals $\sqrt{\qqq_j}$ are {\em associated with} $\qqq$ (that $\sqrt{\qqq_j}$ are prime follows from \cref{prop:radical-of-primaries}). Note that
\begin{align*}
\sqrt{\qqq} = \bigcap_{j=1}^k \sqrt{\qqq_j}
\end{align*}
is a (not necessarily minimal) primary decomposition of the radical $\sqrt{\qqq}$ of $\qqq$; in particular, $\sqrt{\qqq}$ is a finite intersection of {\em prime} ideals associated with $\qqq$.

\begin{example}
Let $\qqq := \langle x^2, xy \rangle \subset \kk[x,y]$. We saw in \cref{example:xy-y^2} that $\qqq$ is not primary. Each of the following is a minimal primary decomposition of $\qqq$ (since $\langle x \rangle$ is prime and the radical of the other ideal in the decomposition is maximal)
\begin{align*}
\qqq = \langle x \rangle \cap \langle x^2, y \rangle
	= \langle x \rangle \cap \langle x^2, xy, y^k \rangle\ (k \geq 1)
\end{align*}
In particular, minimal primary decompositions are in general {\em not} unique\footnote{However, the {\em isolated} primary ideals (i.e.\ primary ideals whose radicals are minimal among the radicals of all primary ideals appearing in the decomposition) in a primary decomposition are in fact unique (e.g.\ the ideal $\langle x \rangle$ will appear in every primary decomposition of $\langle x^2, xy \rangle$) - see \cite[Corollary 4.11]{am}.}.
\end{example}

\begin{prop} \label{prop:minimal-prime}
Let $\qqq$ be an ideal in $R$ which has a primary decomposition. Then every prime ideal in $R$ containing $\qqq$ contains one of the prime ideals associated with $\qqq$. The minimal ideals among those associated with $\qqq$ are precisely the minimal elements in the set of all ideals in $R$ containing $\qqq$.
\end{prop}

\begin{proof}
Follows immediately from assertion \eqref{mp:prime-containment} of \cref{thm:mp}.
\end{proof}

The following is a fundamental property of Noetherian rings; it is a combination of \cite[Theorem 4.5, Proposition 7.17]{am}.

\begin{thm} \label{thm:primary-decomposition}
Assume $R$ is Noetherian. Then every proper ideal has a primary decomposition. In particular, every radical ideal is a finite intersection of prime ideals. The prime ideals associated with an ideal $\qqq$ are precisely those prime ideals of $R$ which occur in the set of ideals $(\qqq:f) := \{g \in R: fg \in \qqq\}$ as $f$ varies over $R$, and hence are uniquely determined by $\qqq$.
\end{thm}

\begin{cor} \label{prop:zero-union-minimally-prime}
The set of zero-divisors in a Noetherian ring $R$ is the union of the prime ideals associated with the zero ideal. Every prime ideal of $R$ contains a prime ideal associated with the zero ideal. The minimal ideals among the prime ideals associated with the zero ideal are precisely the minimal elements of the set of {\em minimal}\footnote{A {\em minimal} prime ideal $\ppp$ of a ring $R$ is a prime ideal $\ppp$ such that the only prime ideal of $R$ contained in $\ppp$ is $\ppp$ itself.} prime ideals of $R$. In particular, every element of a minimal prime ideal of $R$ is a zero-divisor.
\end{cor}

\begin{proof}
The first assertion follows from combining \cref{prop:zero-union-prime,thm:primary-decomposition}. The remaining assertions then follow from \cref{prop:minimal-prime}.
\end{proof}

\begin{cor}\label{prop:non-zero-divisor-restriction}
Let $f$ be a non zero-divisor in a ring $R$ and $\ppp$ be a minimal prime ideal of $R$. If $R$ is Noetherian, then (the image of) $f$ remains a non zero-divisor in $R/\ppp$.
\end{cor}

\begin{proof}
\Cref{prop:zero-union-minimally-prime} implies that $f \not\in \ppp$. Therefore, if $g \not\in \ppp$, then $fg \not\in \ppp$. Therefore $f$ is not a zero-divisor in $R/\ppp$, as required.
\end{proof}

\section{Length of modules} \label{length-section}
Let $M$ be a module over a ring $R$. A {\em composition series} of $M$ of length $n \geq 0$ is a sequence
\begin{align}
M = M_0 \supsetneq M_1 \supsetneq \cdots \supsetneq M_n = 0 \label{composition-series}
\end{align}
of $R$-submodules which is ``maximal,'' or equivalently, each quotient $M_{i-1}/M_i$, $1 \leq i \leq n$, is {\em simple}, (that is, has no non-zero proper submodule). Not every module has a composition series. In fact the following are equivalent (\cite[Proposition 6.8]{am}):
\begin{enumerate}
\item $M$ has a composition series,
\item $M$ satisfies {\em both} ascending and descending chain conditions\footnote{$M$ satisfies {\em ascending} (respectively, {\em descending}) {\em chain condition} if for every chain $M_0 \subseteq M_1 \subseteq \cdots$ (respectively, $M_0 \supseteq M_1 \supseteq \cdots$) of submodules of $M$, there is $k$ such that $M_j = M_k$ for all $j \geq k$.}.
\end{enumerate}
If $M$ has a composition series, then all composition series of $M$ have the same length (\cite[Proposition 6.7]{am}). The {\em length} $l(M)$ of $M$ is defined to be infinite if it has no composition series; otherwise $l(M)$ is the length of any composition series of $M$. If \eqref{composition-series} is a composition series of $M$, then each $M_{i-1}/M_i$ is isomorphic to $R/\mmm$ for some maximal ideal $\mmm$ of $R$

\begin{prop} \label{exercise:composition-quotient}
Let $M$ be a module over a ring $R$ with a composition-series $M = M_0 \supsetneq M_1 \supsetneq \cdots \supsetneq M_n = 0$. Fix $i$, $1 \leq i \leq n$.
\begin{enumerate}
\item \label{composition-quotient:max} Each $M_{i-1}/M_i$ is isomorphic to $R/\mmm$ for some maximal ideal $\mmm$ of $R$.
\item \label{composition-quotient:k} Let $\mmm$ be as in assertion \eqref{composition-quotient:max}. If there is a subfield $k$ of $R$ which maps isomorphically onto $R/\mmm$, then $M_{i-1}/M_i$ is a one dimensional vector space over $k$.
\end{enumerate}
\end{prop}

\begin{proof}
Pick any nonzero element $\bar m \in M_{i-1}/M_i$. Since $M_{i-1}/M_i$ is simple, the map $R \to M_{i-1}/M_i$ given by $f \mapsto fm$ is a surjective map and its kernel must be a maximal ideal of $R$. This implies the first assertion. The second assertion follows immediately from the first.
\end{proof}

\begin{cor} \label{prop:local-field-finite-length}
Assume $R$ is a local ring with maximal ideal $\mmm$, and there is a field $k \subseteq R$ which maps isomorphically onto $R/\mmm$. Then for any $R$-module $M$, the length of $M$ as an $R$-module is equal to the length of $M$ as a $k$-module, which in turn is equal to the dimension of $M$ as a $k$-vector space. \qed
\end{cor}

\begin{prop} \label{prop:minimal-localization-finite-length}
Let $\ppp$ be a {\em minimal} prime ideal of a Noetherian ring $R$. Then the localization $R_\ppp$ of $R$ at $\ppp$ has a finite length as an $R_\ppp$-module.
\end{prop}

\begin{proof}
Since $\ppp$ is a minimal prime ideal of $R$, the ideal generated by $\ppp$ is the unique prime ideal of $R_\ppp$, i.e.\ the Krull dimension of $R_\ppp$ is zero. Since $R_\ppp$ is also Noetherian, it follows that it is {\em Artinian}\footnote{A ring $R$ is {\em Artinian} if it satisfies the descending chain condition as a module over itself, i.e.\ if for every descending chain of ideals $I_0 \supseteq I_1 \supseteq \cdots$, there is $k$ such that $I_j = I_k$ for all $j \geq k$.} (\cite[Theorem 8.5]{am}) as well. This implies that the length $R_\ppp$ as a module over itself is finite (\cite[Proposition 6.8]{am}), as required.
\end{proof}

\section{Graded rings} \label{graded-section}
By a {\em graded ring} in this book we mean a commutative ring $S$ together with a decomposition $S = \dsum_{d \in \zz} S_d$ of $S$ into a direct sum of abelian groups (with respect to the addition operator of $S$) such that $S_dS_e \subseteq S_{d+e}$ for each $d, e \in \zz$. For each $d \in \zz$, an element of $S_d$ is called a {\em homogeneous} element of {\em degree} $d$. Every $f \in S$ has a unique {\em homogeneous decomposition} $f = \sum_{d \in S}f_d$ where $f_d \in S_d$ for each $d$; we say that the $f_d$ are the {\em homogeneous components} of $f$. An ideal of $S$ is called {\em homogeneous ideal} if for every $f \in I$, every homogeneous component of $f$ is also in $I$.

\begin{example} \label{example:graded-polynomials}
The most basic example of a graded ring is the polynomial ring, i.e.\ the ring of polynomials in a collection of indeterminates over a field, where the grading is induced by the usual degree of polynomials, and the homogeneous elements are simply the homogeneous polynomials.
\end{example}

\begin{prop} \label{prop:homogeneous-ideal}
Let $I$ be an ideal of a graded ring $S = \dsum_{d \in \zz} S_d$.
\begin{enumerate}
\item \label{homogenous-ideal:0} $I$ is homogeneous if and only if it is generated by homogeneous elements.
\item \label{homogeneous-ideal:q} If $I$ is homogeneous, then $S/I$ is a graded ring with associated decomposition $S/I = \dsum_{d \in \zz} S_d/(I \cap S_d)$.
\item \label{homogeneous-ideal:r} If $I$ is homogeneous, then the radical of $I$ is also homogeneous.
\end{enumerate}
\end{prop}

\begin{proof}
The first assertion is straightforward, and the second assertion follows immediately from the first. For the third assertion assume to the contrary that $\sqrt{I}$ is not homogeneous. Then there is nonzero $f = \sum_d f_d \in \sqrt{I}$ such that none of the nonzero homogeneous components of $f$ is in $\sqrt{I}$. Pick $k \geq 1$ such that $f^k \in I$. If $d_0$ is the smallest integer such that $f_{d_0}$ is nonzero, then $f_{d_0}^k$ is a homogeneous component of $f^k$. Since $I$ is homogeneous, $f_{d_0}^k \in I$, so that $f_{d_0} \in \sqrt{I}$, which gives the required contradiction.
\end{proof}

\begin{example}
$I := \langle x + x^2, x^3 \rangle$ is not a homogeneous ideal of $\kk[x]$ (with respect to the grading given by degree), however $\sqrt{I} = \langle x \rangle$ is homogeneous. Therefore the converse of assertion \eqref{homogeneous-ideal:r} of \cref{prop:homogeneous-ideal} is not true in general.
\end{example}

The following result is straightforward - its proof is left as an exercise.

\begin{prop} \label{prop:graded-localization}
Let $f$ be a homogeneous element in a graded ring $S = \dsum_{d \in \zz} S_d$ and $S_f$ be the localization of $S$ at $f$.
\begin{enumerate}
\item $S_f$ is also a graded ring. The homogeneous elements of degree $e$, where $e$ is any integer, of $S_f$ are $\{g/f^k: k \in \zz,\ g \in S_{kd + e}\}$.
\item Assume in addition that $S$ is a finitely generated algebra over a subring $R$ of $S_0$. Then $S_f$ and $S_{(f)}$ are also finitely generated algebras over $R$. \qed
\end{enumerate}
\end{prop}

Given graded rings $T, S$, a {\em graded ring homomorphism} $\phi: T \to S$ is a ring homomorphism that preserves degrees; if in addition $\phi$ is a $k$-algebra homomorphism for some field $k \subseteq T_0$, we say that it is a {\em graded $k$-algebra homomorphism}. If $f$ is a homogeneous element of $S$, the subring of the localization $S_f$ consisting of homogeneous elements of degree zero is denoted by $S_{(f)}$. The following result is also straightforward to verify using the definitions.

\begin{prop} \label{prop:hom-graded-to-local}
Let $\phi: T \to S$ be a homomorphism of graded $k$-algebras for some field $k \subseteq T_0$. For each homogeneous $g \in T$, $\phi$ induces a $k$-algebra homomorphism $T_{(g)} \to S_{(\phi(g))}$. \qed
\end{prop}

\section{Macaulay's Unmixedness Theorem}
In this section we give a proof, following \cite[Section VII.8]{zsII}, of the {\em unmixedness theorem} of F.\ S.\ Macaulay for polynomial rings $R := k[x_1, \ldots, x_n]$ over an arbitrary field $k$. The statement of this theorem requires the notion of {\em dimension}\footnote{It is in fact the same as the dimension of the algebraic variety determined by $\qqq$ as defined in \cref{dimension-section}; here we give a purely algebraic treatment.} $\dim(\qqq)$ of an ideal $\qqq$ of $R$. If $\qqq$ is prime, then $\dim(\qqq)$ is the transcendence degree (of the field of fractions) of $R/\qqq$ over $k$. In general $\dim(\qqq)$ is the maximum of the dimensions of the prime ideals {\em associated with} $\qqq$. Since the minimal elements of the set of prime ideals of $R$ containing $\qqq$ are precisely the minimal elements of the set of ideals associated with $\qqq$ (\cref{prop:minimal-prime}), it follows that $\dim(\qqq)$ is the maximum of the dimensions of the {\em minimal} prime ideals containing $\qqq$. One of the most fundamental properties of dimensions is given by Krull's prime ideal theorem (\cref{thm:principal-ideal}) - the following result is its straightforward consequence.

\begin{prop} \label{prop:Macaulay-dim}
Let $k$ be an arbitrary field, and $\qqq$ be a {\em proper} ideal of $k[x_1, \ldots, x_n]$ generated by $f_1, \ldots, f_m$, $m \leq n$. Then $\dim(\qqq) \geq n - m$. If in addition $\dim(\qqq) = n - m$, then $\dim(\langle f_1, \ldots, f_j \rangle) = n - j$, for each $j = 1, \ldots, m$. \qed
\end{prop}

The following is a special case of Macaulay's unmixedness theorem (\cref{thm:Macaulay}).

\begin{prop} \label{Macaulay:1}
Let $g = g_1^{q_1}\cdots g_r^{q_r} \in R := k[x_1, \ldots, x_n]$, where $g_j$ are irreducible (non-constant) polynomials and $q_j$ are positive integers. Then $h \in R$ is a zero-divisor in $R/\langle g \rangle$ if and only if $h$ is divisible by some $g_j$.
\end{prop}

\begin{proof}
This immediately follows from the fact that $R$ is a unique factorization domain.
\end{proof}

\begin{thm}[
Macaulay's unmixedness\footnote{An ideal is {\em unmixed} if all its associated prime ideals have the same dimension. \Cref{thm:Macaulay} is called the ``unmixedness theorem'' due to this equivalent formulation: ``Let $\qqq$ be an ideal of $k[x_1, \ldots, x_n]$ generated by $m$ polynomials. If $\dim(\qqq) = n - m$, then $\qqq$ is unmixed.'' The equivalence of this statement with \cref{thm:Macaulay} follows in straightforward manner from \cref{prop:zero-union-minimally-prime} and Krull's principal ideal theorem (\cref{thm:principal-ideal}).} theorem {\cite[Theorem VII.26]{zsII}
}] \label{thm:Macaulay}
Let $k$ be an arbitrary field, and $f_1, \ldots, f_m \in k[x_1, \ldots, x_n]$, $m \leq n$, be such that $\dim(\langle f_1, \ldots, f_m\rangle) = n-m$. Then for each $j = 1, \ldots, m$, $f_j$ is a non zero-divisor in $k[x_1, \ldots, x_n]/\langle f_1, \ldots, f_{j-1} \rangle$.
\end{thm}

\begin{proof}
Write $R := k[x_1, \ldots, x_n]$. We proceed by induction on $m$. The case of $m = 1$ is obvious, and the case of $m = 2$ follows from \cref{Macaulay:1}. So assume $m \geq 3$. If $f_m$ is a zero-divisor in $R/\langle f_1, \ldots, f_{m-1} \rangle$, then it is contained in a prime ideal $\ppp$ associated with $\qqq := \langle f_1, \ldots, f_{m-1} \rangle$.

\begin{proclaim} \label{Macaulay:claim-p}
$\dim(\ppp) < n - m + 1$.
\end{proclaim}
\begin{proof}
By assumption $\qqq$ is {\em not} a minimal prime ideal containing $\qqq$, i.e.\ $\ppp \supsetneq \ppp' \supseteq \qqq$ for some prime ideal $\ppp'$ of $R$ with $\dim(\ppp') = n - m + 1$. The claim follows from applying Krull's principal ideal theorem (\cref{thm:principal-ideal}) to $R/\ppp'$.
\end{proof}

Let $d := \dim(\ppp)$. Then there are $x_1, \ldots, x_d$ which are algebraically independent over $k$ in $R/\ppp$. This means $\kk[x_1, \ldots, x_d] \cap \ppp = 0$. Let $\tilde R := k(x_1, \ldots, x_d)[x_{d+1}, \ldots, x_n]$. Given an ideal $\rrr$ of $R$, we write $\tilde \rrr$ for the ideal of $\tilde R$ generated by $\rrr$.

\begin{proclaim} \label{Macaulay:claim-p-2}
Let $\rrr$ be a prime ideal of $R$ contained in $\ppp$ and $\tilde \rrr$ be the ideal of $\tilde R$ generated by $\rrr$.
\begin{enumerate}
\item $\dim(\tilde \rrr) = \dim(\rrr) - d$.
\item If $\rrr$ is associated with $\qqq$, then $\tilde \rrr$ is associated to $\tilde \qqq$.
\end{enumerate}
\end{proclaim}

\begin{proof}
The first assertion follows immediately from choosing a transcendence basis (over $k$) of $R/\rrr$ containing $x_1, \ldots, x_d$. Now pick $f \in R$ such that $\rrr = (\qqq : f)$. Then it is straightforward to check that $\tilde \rrr = (\tilde \qqq: f)$. Since $\tilde \rrr$ is a prime ideal of $\tilde R$, the second assertion follows from \cref{thm:primary-decomposition}.
\end{proof}

In \cref{Macaulay:claim-p-2} taking $\rrr = \qqq'$, where $\qqq'$ is the ideal from the proof of \cref{Macaulay:claim-p}, implies that $\tilde \qqq$ is a proper ideal of $\tilde R$ with dimension $\leq n - d - (m-1)$. Since $\tilde \qqq$ is generated by $m - 1$ elements, \cref{prop:Macaulay-dim} implies that $\dim(\tilde \qqq)$ is precisely $n - d - (m - 1)$. On the other hand, applying \cref{Macaulay:claim-p-2} with $\rrr = \ppp$ shows that $\tilde \ppp$ is a zero dimensional ideal of $\tilde R$ which is also associated with $\tilde \qqq$. But then \cref{Macaulay:maximal-case} below gives a contradiction and proves \cref{thm:Macaulay}.

\begin{proclaim} \label{Macaulay:maximal-case}
Let $\bbb \subset \aaa$ be ideals in $R := k[x_1, \ldots, x_r]$ such that
\begin{enumerate}
\item $\aaa$ is prime,
\item $\dim(\aaa) = 0$,
\item $\bbb$ is generated by $m - 1$ elements, and
\item $\dim(\bbb) = r - (m - 1)$.
\end{enumerate}
If $r \geq m$, then $\aaa$ is {\em not} associated with $\bbb$.
\end{proclaim}

To complete the proof of \cref{thm:Macaulay} it remains to prove \cref{Macaulay:maximal-case}. Pick a set $g_1, \ldots, g_{m-1}$ of generators of $\bbb$. Let $\ccc$ be the ideal of $R$ generated by $g_1, \ldots, g_{m-2}$ (recall that $m \geq 3$). \Cref{prop:Macaulay-dim} implies that $\dim(\ccc) = r - (m - 2)$. If $h \in R$ is not in any of the minimal prime ideal associated with $\ccc$, the induction hypothesis then applies to $g_1, \ldots, g_{m-2}, h$ and implies that $h$ is {\em not} a zero-divisor in $R/\ccc$. \Cref{thm:primary-decomposition,prop:Macaulay-dim} then imply that all prime ideals associated to $\ccc$ have dimension $r - m + 2$; enumerate these ideals as $\ppp_1, \ldots, \ppp_s$. Let $\ppp_{s+1}, \ldots, \ppp_{s'}$ be the {\em minimal} (i.e.\ $(r - m + 1)$-dimensional) prime ideals associated to $\bbb$. Since $r \geq m$, each $\ppp_j$ has dimension greater than zero. We will use the following result to construct a special type of polynomial which does not belong to any $\ppp_j$.

\begin{prolemma} \label{Macaulay:transcendental-choice}
Given finitely many prime ideals $\ppp_1, \ldots, \ppp_{s'}$ of positive dimensional prime ideals in $R := k[x_1, \ldots, x_r]$, there is $e$, $1 \leq e \leq s'$, and a polynomial $h(x_1, \ldots, x_{e-1})$ such that the image of $y_e := x_e + h(x_1, \ldots, x_{e-1})$ is transcendental over $k$ in $R/\ppp_j$ for each $j$.
\end{prolemma}

\begin{proof}
Pick the smallest integer $i_1$ such that $x_{i_1}$ is transcendental over $k$ in $R/\ppp_j$ for some $j$. Reorder the $\ppp_j$ in a way that $x_{i_1}$ is transcendental over $k$ in $R/\ppp_1, \ldots, R/\ppp_{s_1}$ and algebraic over $k$ in $R/\ppp_j$ for $j > s_1$. If $s_1 < s'$, then pick the smallest integer $i_2 > i_1$ such that $x_{i_2}$ is transcendental over $k$ in $R/\ppp_j$ for some $j > s_1$. Then reorder $\ppp_{s_1 + 1}, \ldots, \ppp_{s'}$ in a way that $x_{i_2}$ is transcendental over $k$ in $R/\ppp_{s_1+1}, \ldots, R/\ppp_{s_2}$ and algebraic over $k$ in $R/\ppp_j$ for $j > s_2$. Since each $\ppp_j$ is positive dimensional, we can continue in this way until there is an integer $t$ such that $s_t = s'$. In particular,
\begin{defnlist}
\item $x_{i_t}$ is transcendental over $k$ in $R/\ppp_j$ for each $j = s_{t-1} + 1, \ldots, s_t = s'$.
\end{defnlist}
Now fix $j$, $s_{t-2} + 1 \leq j \leq s_{t-1}$. We claim that there is at most one integer $q$ such that $x_{i_t} + x_{i_{t-1}}^q$ is algebraic over $k$ in $R/\ppp_j$. Indeed, otherwise there would be $q_1 \neq q_2$ such that $x_{i_{t-1}}^{q_1} - x_{i_{t-1}}^{q_2}$ is algebraic over $k$ in $R/\ppp_j$; but this is impossible since by construction $x_{i_{t-1}}$ is transcendental over $k$ in $R/\ppp_j$. Therefore
\begin{defnlist}[resume]
\item there is a positive integer $q_{t-1}$ such that $x_{i_t} + x_{i_{t-1}}^{q_{t-1}}$ is transcendental over $k$ in $R/\ppp_j$ for each $j = s_{t-2} + 1, \ldots, s_{t-1}$.
\end{defnlist}
Continuing in this way one can choose integers $q_{t-1}, q_{t-2}, \ldots, q_1$ such that for each $t' = 1, \ldots, t - 1$,
\begin{defnlist}[resume]
\item $x_{i_t} + x_{i_{t-1}}^{q_{t-1}} + \cdots + x_{i_{t-t'}}^{q_{t-t'}}$ is transcendental over $k$ in $R/\ppp_j$ for each $j = s_{t-t'-1} + 1, \ldots, s_{t-t'}$.
\end{defnlist}
Since for each $t' = 1, \ldots, t$ and each $i < i_t'$, $x_i$ is algebraic over $k$ in $R/\ppp_j$ for each $j > s_{t'-1}$, it follows that $x_{i_t} + x_{i_{t-1}}^{q_{t-1}} + \cdots + x_{i_1}^{q_1}$ satisfies the conclusion of the lemma with $e := i_t$.
\end{proof}

We go back to the proof of \cref{Macaulay:maximal-case}. Let $y_e$ be the polynomial from \cref{Macaulay:transcendental-choice}. Note that $R = k[x_1, \ldots, x_{e-1}, y_e, x_{e+1}, \ldots, x_r]$. Since $\dim(\aaa) = 0$, the image of $y_e$ in $R/\aaa$ is algebraic over $k$. Let $f := \phi(y_e) \in k[y_e]$ be the polynomial with the minimum degree in $y_e$ which is zero in $R/\aaa$. Note that
\begin{prooflist}
\item \label{Macaulay:f-in-a} $f \in \aaa$, and
\item \label{Macaulay:f-not-in-pj} $f$ is {\em not} in any $\ppp_j$, since the image of $y_e$ is transcendental over $k$ in $R/\ppp_j$.
\end{prooflist}

\begin{proclaim} \label{Macaulay:induction}
$g_{m-1}$ is not a zero-divisor in $R/\langle \ccc, f \rangle$.
\end{proclaim}

\begin{proof}
Note that $R/\langle f \rangle \cong k(\bar y_e)[x_1, \ldots, x_{e-1}, x_{e+1}, \ldots, x_r]$, where $\bar y_e$ is the image of $y_e$ in $R/\aaa$. Let $\bar \bbb$ be the ideal of $R/ \langle f \rangle$ generated by $\bbb$. Krull's principal ideal theorem (\cref{thm:principal-ideal}) and observation \ref{Macaulay:f-not-in-pj} above imply that $\dim(\bar \bbb) = \dim(\bbb) - 1 = r - (m - 1) - 1 =  r -1 - (m-1)$. Since $\bar \bbb$ is generated by $m - 1$ elements (namely the images $\bar g_i$ of $g_i$,\ $1 \leq i \leq m-1$) in the polynomial ring $R/\langle f \rangle$ over $k(\bar y_e)$, the induction hypothesis implies that $\bar g_{m-1}$ is not a zero-divisor in $(R/\langle f \rangle)/ \langle \bar g_1, \ldots, \bar g_{m-2} \rangle \cong R/\langle f, \ccc \rangle$, as required.
\end{proof}

Returning to the proof of \cref{Macaulay:maximal-case}, assume to the contrary that $\aaa$ is associated with $\bbb$. Then there is $g \in R$ such that $\aaa \supseteq (\bbb: g)$ (\cref{thm:primary-decomposition}); in particular $gf \in \bbb = \langle  \ccc, g_{m-1} \rangle$. Therefore there is $h \in R$ such that $gf - g_{m-1}h \in \ccc$, i.e.\ $g_{m-1}h \in \langle \ccc, f \rangle$. \Cref{Macaulay:induction} then implies that $h \in \langle \ccc, f \rangle$, i.e.\ $h - af \in \ccc$ for some $a \in R$. It follows that $gf - g_{m-1}af = (g - g_{m-1}a)f \in \ccc$. Since $f$ is not in any prime ideal associated with $\ccc$ (observation \ref{Macaulay:f-not-in-pj}), $f$ is {\em not} a zero divisor in $R/\ccc$ (\cref{thm:primary-decomposition,prop:zero-union-minimally-prime}). It follows that $g - g_{m-1}a \in \ccc$, so that $g \in \langle \ccc, g_{m-1} \rangle = \bbb$. But then $(\bbb : g) = R \not\subseteq \aaa$. This contradiction finishes the proof of \cref{Macaulay:maximal-case} and \cref{thm:Macaulay}.
\end{proof}

\section{Properties of order at a point on a possibly non-reduced curve} \label{order-app}
In \cref{nrcurve-section} we defined the notion of ``order at a point on a possibly non-reduced curve,'' and stated some of its properties without proof. In this section we prove these results, namely \cref{order-properties,order-curve}, in respectively \cref{order-properties-app,order-curve-app}. The proof uses somewhat more involved commutative algebra than the rest of the book. Given a point $a$ on a possibly non-reduced curve $C$ and $f \in \local{C}{a}$, the {\em order} $\ord_a(f)$ of $f$ at $a$ is the dimension of $\local{C}{a}/f\local{C}{a}$ as a vector space over $\kk$.

\begin{prop}[\cref{order-properties}] \label{order-properties-app}
Let $a$ be a point on a possibly non-reduced curve $C$ and $f \in \local{C}{a}$. Let $C' := \supp(C)$. Recall that $\local{C'}{a}$ is a quotient of $\local{C}{a}$.
\begin{enumerate}
\item If the image of $f$ is a non zero-divisor in $\local{C'}{a}$, then $\ord_a(f) < \infty$. In particular, if $f$ is a non zero-divisor in $\local{C}{a}$, then $\ord_a(f) < \infty$.
\item \label{order-properties:finite} If $f$ is a non zero-divisor in $\local{C}{a}$, then $\ord_a(f) < \infty$.
\item $\ord_a(f) = 0$ if and only if $f$ is invertible in $\local{C}{a}$.
\item If $f$ is a non zero-divisor in $\local{C}{a}$ and $g \in \local{C}{a}$, then $\ord_a(fg) = \ord_a(f) + \ord_a(g)$.
\end{enumerate}
\end{prop}

\begin{proof}
If the image of $f$ is a non zero-divisor in $\local{C'}{a}$, then Krull's principal ideal theorem \cite[Corollary 11.18]{am} implies that the quotient $\local{C}{a}/f\local{C}{a}$ of $\local{C}{a}$ by the ideal generated by $f$ is a zero dimensional Noetherian local ring. Therefore it is also Artinian \cite[Theorem 8.5]{am} and a finite dimensional vector space over $\kk$ \cite[Exercise 8.3]{am}, which proves the first assertion. The second assertion is straightforward. For the third assertion, \woutlog\ we may assume that $\ord_a(g) < \infty$. Let $(f_1, \ldots, f_l)$ be a basis of $\local{C}{a}/f\local{C}{a}$ and $(g_1, \ldots, g_m)$ be a basis of $\local{C}{a}/g\local{C}{a}$ over $\kk$. Let $h \in \local{C}{a}$. Write $K_f$ and $K_g$ for respectively the $\kk$-linear span of the $f_i$ and of the $g_j$. Then $\local{C}{a} = K_f + f\local{C}{a} = K_f + fK_g + fg\local{C}{a}$, which implies that $f_1, \ldots, f_l, fg_1, \ldots, fg_m$ spans $\local{C}{a}$ modulo the ideal generated by $fg$. We claim that they are also linearly independent over $\kk$. Indeed, pick $c_i, d_j \in \kk$ such that $\sum_ic_if_i + \sum_j d_jfg_j = fgh$, $h\in \local{C}{a}$. Then $\sum_ic_if_i  \in f\local{C}{a}$, so that $c_1 = \cdots = c_l = 0$. It follows that $f\sum_jd_jg_j = fgh$. Since $f$ is a non zero-divisor, $\sum_j d_j g_j = gh \in g\local{C}{a}$. It follows that $d_1 = \cdots = d_m = 0$ as well.
\end{proof}

The proof of \cref{order-curve} will be long. We start with a few auxiliary results.

\begin{lemma} \label{lemma:k[[t]]-module}
Let $R$ be a ring containing a field $k$, and $t \in R$ be such that $t$ is transcendental over $k$, and $R$ contains the ring $k[[t]]$ of power series in $t$ over $k$. Assume $R/tR$ is a finite dimensional vector space over $k$ generated by (the images in $R/tR$ of) $f_1, \ldots, f_m \in R$. Then $f_1, \ldots, f_m$ generate $R$ as a module over $k[[t]]$.
\end{lemma}

\begin{proof}
Given $g \in R$, it can be successively expressed as $g	= \sum_j f_jh_{0,j} + tg_1 = \sum_j f_j(h_{0,j} + th_{1,j}) + t^2g_2$, and so on, resulting in an expression of the form $g = \sum_j f_jh_j$ with $h_j \in \kk[[t]]$.
\end{proof}

\begin{prop} \label{irreducible-order}
Let $a$ be a point on an possibly non-reduced affine curve $C$. Assume $C' := \supp(C)$ is irreducible and nonsingular at $a$. Let $t$ be a regular function on $C$ such that $t|_{C'}$ is a parameter of $\local{C'}{a}$. Assume $t$ is not a zero-divisor in $\local{C}{a}$. Then
\begin{enumerate}
\item $\ord_a(t) = \mu_{C'}(C)$, where $\mu_{C'}(C)$ is the multiplicity of $C'$ in $C$ (defined in \cref{nrcurve-section} in the paragraph preceding \cref{order-curve}),
\item  $\ord_a(f) = \ord_a(f|_{C'})\ord_a(t)$ for each regular function $f$ on $C$.
\end{enumerate}
\end{prop}

\begin{proof}
We start with the first assertion. \Woutlog\ we may assume that $C$ is the closed subscheme of $\kk^{n+1}$ determined by the ideal $J$ in $S := \kk[x_0, \ldots, x_n]$, and $a$ corresponds to the point $x_0 = \cdots = x_n = 0$, and $t$ is the restriction of $x_0$. \Cref{thm:exactly-complete} implies that $\hatlocal{C}{a} \cong \hat S/J \hat S$ where $\hat S := \kk[[x_0, \ldots, x_n]]$. Let $r := \dim_\kk(\hat S/(x_0\hat S + J\hat S)) =  \dim_\kk(\hatlocal{C}{a}/t\hatlocal{C}{a})$. Assertion \eqref{order-properties:finite} of \cref{order-properties-app} and \cref{exercise:finite-quotient} imply that $r = \dim_\kk(\local{C}{a}/t\local{C}{a}) = \ord_a(t)$. In particular, $r < \infty$, so that \cref{lemma:k[[t]]-module} implies that $\hat S/J \hat S$ is a finitely generated $\kk[[x_0]]$-module. Since $t$ is a non zero-divisor in $\local{C}{a}$, \cref{thm:exactly-complete} implies that $x_0$ is a non zero-divisor in $\hat S/J \hat S$. The fundamental theorem of finitely generated modules over a PID (\cref{fundamentally-over-PID}) then implies that $\hat S/J\hat S \cong \kk[[x_0]]^{s}$ as a module over $\kk[[x_0]]$ for some $s \geq 0$. But then $s = \dim_\kk(\hat S/(x_0\hat S + J \hat S)) = r$. Since $t|_{C'}$ is a parameter of $\local{C'}{a}$, for each $i =1, \ldots, n$, there is $u_i \in \local{C}{a}$ and a positive integer $m_i$ such that $x_i - u_ix_0^{m_i}$ is nilpotent in $\local{C}{a}$. Pick a representative $\psi_i \in \hat S$ of $u_i$ and set $y_i := x_i - x_0^{m_i}\psi_i$. Pick $\phi_1, \ldots, \phi_r \in \hat S$ such that $\hat S/J\hat S = \dsum_{i=1}^r \phi_i \kk[[x_0]]$ as a $\kk[[x_0]]$-module. Since the linear parts of $(x_0, y_1, \ldots, y_n)$ are linearly independent, \cref{power-basics} implies that $\hat S = \kk[[x_0, y_1, \ldots, y_n]]$. Moreover, since each $y_j$ is nilpotent modulo $J\hat S$, each $\phi_i$ can be expressed as a $\kk[[x_0]]$-linear combination of finitely many monomials in $(y_1, \ldots, y_n)$. Let $y^{\alpha_j}$, $j = 1, \ldots, N$, be a minimal collection of such monomials such that every other monomial in $(y_1, \ldots, y_n)$ is their $\kk((x_0))$-linear combination modulo $J\hat S$. After a Gauss-Jordan elimination process and re-orderings of the $\alpha_j$ if necessary we may assume that $\phi_i= y^{\alpha_i} + \sum_{j = r+1}^N \phi_{i,j}(x_0)y^{\alpha_j}$, $i = 1, \ldots, r$, where $\phi_{i,j}(x_0) \in \kk((x_0))$. Now express $y^{\alpha_1}$ as a $\kk[[x_0]]$-linear combination of the $\phi_i$ modulo $J \hat S$:
\begin{align*}
y^{\alpha_1}
	= \sum_{i=1}^r \rho_i(x) \phi_i
	= \sum_{i=1}^r \rho_i(x)y^{\alpha_i} + \sum_{i=1}^r\sum_{j=r+1}^N \rho_i(x) \phi_{i,j}(x)y^{\alpha_j}
\end{align*}
The minimality assumption on the $y^{\alpha_i}$ implies that $\rho_1(x) = 1$, and $\rho_i(x)\phi_{i,j}(x) = 0$ if either $i > 1$ or $j > 1$. It follows that $y^{\alpha_1} = \phi_1$. The same arguments inductively show that $\phi_i = y^{\alpha_i}$ for each $i = 1, \ldots, r$. In particular, $N = r$.

\begin{proclaim} \label{claim:1/t}
$\local{C}{C'}$ (which was defined in \cref{scheme:local-section}) can be identified with a $\kk$-subalgebra of $\local{C}{a}[1/t]$.
\end{proclaim}

\begin{proof}
Elements of $\local{C}{C'}$ are of the form $f/g$ where $f,g \in \local{C}{a}$ such that $g|_{C'} \not\equiv 0$. Let $m := \ord_a(g|_{C'})$. \Cref{reduced-invertible} implies that there is invertible $u \in \local{C}{a}$ such that $g = ut^m - h$ where $h$ is a nilpotent in $\local{C}{a}$. Pick $k$ such that $h^{k+1} = 0$. Write $f' := f/u$ and $h' := h/u$. Then $f/g = f'/(t^m - h') = t^{-m(k+1)}f'\sum_{j=0}^k t^{mj}h'^{k-j}$ which is an element of $\local{C}{a}[1/t]$. Since $t$ is a non zero-divisor in $\local{C}{a}$, it follows that the map $\local{C}{C'} \to \local{C}{a}[1/t]$ is injective.
\end{proof}

\Cref{claim:1/t,prop:complete-inclusion} imply that $\local{C}{C'}$ is a $\kk$-subalgebra of $\hatlocal{C}{a}[1/t] \cong \hat S_{x_0}/ J\hat S_{x_0}$, where $\hat S_{x_0} := \hat S[1/x_0] = \kk((x_0))[[y_1, \ldots, y_n]]$. Re-order $\alpha_1, \ldots, \alpha_r$ if necessary to ensure that $\alpha_i - \alpha_j \in \zzeroo{n}$ only if $i \geq j$. For each $i = 0, \ldots, r$, let $\hat J_i$ be the ideal of $\hat S_{x_0}/J \hat S_{x_0}$ generated by $y^{\alpha_{i+1}}, \ldots, y^{\alpha_r}$ and $M_i := \hat J_i \cap \local{C}{C'}$. Now fix $i$, $0 \leq i \leq r-1$.

\begin{proclaim} \label{claim:M_i-generators}
$y^{\alpha_{i+1}}, \ldots, y^{\alpha_r}$ generate $M_i$ as an ideal of $\local{C}{C'}$.
\end{proclaim}

\begin{proof}
Pick $h \in M_i$. \Cref{claim:1/t} implies that there exists $k \geq 0$ such that $ht^k \in \local{C}{a}$ and $hx_0^k$ is a $\kk[[x_0]]$-linear combination of the $y^{\alpha_{i+1}}, \ldots, y^{\alpha_r}$ in $\hat S/J \hat S$. Write $M'_i$ for the ideal of $\local{C}{a}$ generated by $y^{\alpha_{i+1}}, \ldots, y^{\alpha_r}$ and $N'_i$ for the ideal of $\local{C}{a}$ generated by $M'_i$ and $ht^k$. Let $L'_i := N'_i/M'_i$ be the quotient of $N'_i/M'_i$ as a module over $\local{C}{a}$. Let $\hat L'_i, \hat M'_i, \hat N'_i$ be the completion (with respect to the maximal ideal of $\local{C}{a}$) of respectively $L'_i, M'_i, N'_i$. \Cref{thm:exactly-complete} implies that $\hat L'_i \cong \hat N'_i/\hat M'_i$, and then \cite[Propositions 10.13]{am} implies that $\hat L'_i \cong (\hatlocal{C}{a} \otimes_{\local{C}{a}} N'_i)/(\hatlocal{C}{a} \otimes_{\local{C}{a}} M'_i) = 0$. A theorem of Krull \cite[Theorem 10.17]{am} then implies that $L'_i = 0$, so that $ht^k \in M'_i$. Since $t$ is invertible in $\local{C}{C'}$, it follows that $h \in M'_i$, as required.
\end{proof}

\Cref{claim:M_i-generators} implies that $M_i/M_{i+1}$ is generated by $y^{\alpha_{i+1}}$ as an $\local{C}{C'}$-module. Since $y^{\alpha_{i+1}} \in M_i \setminus M_{i+1}$, it follows that $M_i/M_{i+1} \neq 0$. On the other hand, if $h$ is a nilpotent element in $\local{C}{C'}$, then as an element of $\hat S_{x_0} / \hat J\hat S_{x_0}$, $h$ is in the ideal generated by $y_1, \ldots, y_n$, and the ordering of the $\alpha_j$ ensures that $hM_i \subseteq M_{i+1}$. Combining these observations we see that as an $\local{C}{C'}$-module, $M_i/M_{i+1} \cong \local{C}{C'}/\nnn$, where $\nnn$ is the (maximal) ideal of nilpotent elements of $\local{C}{C'}$. It follows that $\local{C}{C'} = M_0 \supset M_1 \supset \cdots \supset M_r = 0$ is a composition series of $\local{C}{C'}$, so that $\mu_{C'}(C) = r$, which proves the first assertion of \cref{irreducible-order}. \\

For the second assertion, we may assume \woutlog\ that $q := \ord_a(f|_{C'}) < \infty$. Then there is $u \in \local{C}{a}$ such that $u|_{C'}$ is invertible and $(t^q - uf)|_{C'} = 0$. \Cref{reduced-invertible} implies that $u$ is invertible in $\local{C}{a}$. Note that $h := t^q - uf$ is nilpotent in $\local{C}{a}$. By replacing $C$ by a smaller neighborhood\footnote{Since $C$ is a {\em possibly non-reduced} curve, by a ``neighborhood of $a$ in $C$'' we mean an open subscheme of $C$ containing $a$.} of $a$ in $C$ if necessary we may assume $h$ is nilpotent in $S/J$. Let $z$ be a new indeterminate which we think of as the last coordinate of $\kk^{n+1} \times \kk = \kk^{n+2}$, and let $D$ be the closed subscheme of $\kk^{n+2}$ determined by the ideal $K$ in $T := \kk[x_0, \ldots, x_n, z]$ generated by $J$ and $z^q - h$. In $T/K$ we have $uf = t^q - z^q = \prod_{i=1}^q (t - \zeta_i z)$, where the $\zeta_i$ are the $q$-th roots of unity in $\kk$. Note that $D' := \supp(D)$ is isomorphic to $C'$; in particular $a$ can be naturally identified with a point on $D$, which by an abuse of notation we also denote by $a$. Since $z$ is nilpotent in $T/K$, it follows that $(t- \zeta_i z)|_{D'} = t|_{D'}$ is a parameter of $\local{D'}{a}$ for each $i$. Since $T/K = \sum_{i=0}^{q-1} z^i S/J \cong (S/J)^q$ as a module over $S/J$, it follows that
\begin{prooflist}
\item $t$ is not a zero-divisor in $\local{D}{a}$, which implies that $t - \zeta_i z$ is not a zero-divisor in $\local{D}{a}$ for any $i$ (since it is easy to check that if $g_1$ is a zero-divisor and $g_2$ is nilpotent, then $g_1 + g_2$ is a zero-divisor), and
\item $\ord_a(g|_D) = q\ord_a(g|_C)$ for each for each $g \in S/J$.
\end{prooflist}
These observations together with the first assertion and \cref{order-properties-app} imply that $q\ord_a(f|_C) = \ord_a((uf)|_D) = \sum_{i=0}^{q-1}\ord_a((t - \zeta_i z)|_D) = q\ord_a(t|_D) = q^2 \ord_a(t|_C)$, so that $\ord_a(f|_C) = q\ord_a(t|_C)$, as required.
\end{proof}

\begin{lemma} \label{finite-order}
Let $D$ be a possibly non-reduced affine curve over $\kk$ defined by an ideal $I$ of $\kk[x_1, \ldots, x_n]$. If $f \in R :=\kk[x_1, \ldots, x_n]/I$ is such that $r := \dim_\kk(R/fR) < \infty$. Then $r = \sum_{a \in D} \ord_a(f)$.
\end{lemma}

\begin{proof}
Since $r < \infty$, there are finitely many zeroes of $f$ on $D$. Denote them by $a_1, \ldots, a_k$; let $\mmm_j$ be the maximal ideal of $a_j$ in $R$ and $\iota_j: R \to R_{\mmm_j}$ be the natural map.

\begin{proclaim} \label{chinese-claim-1}
$fR = \bigcap_j \iota_j^*(fR_{\mmm_j})$.
\end{proclaim}

\begin{proof}[Proof (\`a la Mumford {\cite[Proposition 1.11]{mummetry}})]
We only need to show the ``$\supset$'' inclusion. Let $h \in \iota_j^*(fR_{\mmm_j})$ for each $j$. Then for each maximal ideal $\mmm$ of $R$, there exists $u \not\in \mmm$ such that $uh \in fR$. It follows that the ideal $(fR : h) := \{u\in R: uh \in fR\}$ of $R$ is not contained in any maximal ideal of $R$. The Nullstellensatz then implies that $1 \in (fR: h)$, as required.
\end{proof}

\begin{proclaim} \label{chinese-claim-2}
If $j \neq j'$, then $\iota_j^*(fR_{\mmm_j}) + \iota_{j'}^*(fR_{\mmm_{j'}}) = R$.
\end{proclaim}

\begin{proof}
Since $R_{\mmm_j}/fR_{\mmm_j}$ and  $R_{\mmm_{j'}}/fR_{\mmm_{j'}}$ are Artinian local rings, their maximal ideals are nilpotent \cite[Proposition 8.6]{am}. Therefore there exists $q$ such that $(\mmm_j)^qR_{\mmm_j}\subseteq fR_{\mmm_j}$ and $(\mmm_{j'})^qR_{\mmm_{j'}}\subseteq fR_{\mmm_{j'}}$. Since $1 \in (\mmm_j)^q + (\mmm_{j'})^q$ [why?], the claim follows.
\end{proof}

\Cref{chinese-claim-1,chinese-claim-2} and the Chinese remainder theorem imply that
\begin{align}
r = \dim_\kk(R/fR) = \sum_{j=1}^k \dim_\kk(R/\iota_j^*(fR_{\mmm_j})) \label{r-1}
\end{align}
\begin{proclaim} \label{m_j-claim}
$R/\iota_j^*(fR_{\mmm_j}) \cong R_{\mmm_j}/fR_{\mmm_j} $ for each $j$.
\end{proclaim}

\begin{proof}
It is straightforward to see that the natural map $R/\iota_j^*(fR_{\mmm_j}) \to R_{\mmm_j}/fR_{\mmm_j}$ is injective. For surjectivity, note that if $h = g_1/g_2$ is an element of $(\mmm_j)^qR_{\mmm_j}$ for some $q \geq 0$, where $g_1\in R$ and $g_2 \in R\setminus \mmm_j$, then $h - cg_1 \in (\mmm_j)^{q+1}R_{\mmm_j}$, where $c \in \kk$ is the image of $g_2^{-1}$ in $\kk \cong R_{\mmm_j}/\mmm_jR_{\mmm_j}$. It follows by an induction on $q$ that for each $h \in R_{\mmm_j}$ and $q \geq 1$, there exists $h' \in R$ such that $h - h' \in (\mmm_j)^{q+1}R_{\mmm_j}$. Choosing $q$ such that $(\mmm_j)^{q+1}R_{\mmm_j} \subseteq fR_{\mmm_j}$ (which is possible due to the arguments in the proof of \cref{m_j-claim}) yields the required result.
\end{proof}

The result follows from \eqref{r-1} and \cref{m_j-claim}.
\end{proof}

\begin{thm}[\cref{order-curve}] \label{order-curve-app}
Let $a$ be a point on a possibly non-reduced curve $C$. Let $C_1, \ldots, C_s$ be the irreducible components of $\supp(C)$ containing $a$ and $\pi_i:\tilde C_i \to C_i$ be the desingularizations of $C_i$. If $f$ is a non zero-divisor in $\local{C}{a}$, then
\begin{align}
\ord_a(f)
	&= \sum_i \mu_{C_i}(C) \ord_{ a}(f|_{C_i})
	= \sum_i \mu_{C_i}(C) \sum_{\tilde a \in \pi_i^{-1}(a)} \ord_{\tilde a}(\pi_i^*(f|_{C_i}))
	\label{order-curve-identity-app}
\end{align}
\end{thm}

\begin{proof}
Write $C' := \supp(C)$. \Woutlog\ we may assume that
\begin{prooflist}
\item $C$ is affine, i.e.\ the closed subscheme determined by an ideal $\aaa$ of $\kk[x_1, \ldots, x_n]$; in particular $\kk[C'] = \kk[x_1, \ldots, x_n]/\sqrt{\aaa}$;
\item $C' \setminus\{a\}$ is nonsingular;
\item $f$ is in the maximal ideal of $\local{C}{a}$;
\item $f$ restricts to a regular function on $C'$, and
\item the restriction of $f$ to every irreducible component of $C'$ is non-constant.
\end{prooflist}
Let $\bar C'$ be the (unique) compactification of $C'$ such that $\bar C' \setminus \{a\}$ is nonsingular (given a closed embedding of $C'$ into an affine space, $\bar C'$ can be explicitly constructed by taking the closure of $C'$ in an projective completion of the affine space and then resolving the singularities at infinity of the closure of $C'$). The restriction $f' := f|_{C'}$ of $f$ to $C'$ induces a morphism $\bar C' \to \pp^1$ (\cref{exercise:curve-nonsingular-morphextension}); we use $f'$ to denote this morphism as well. Note that $f'(a) = 0 \in \kk \subset \pp^1$ (since $f$ is in the maximal ideal of $\local{C}{a}$). It follows that
\begin{prooflist}[resume]
\item There is a finite set $S$ of $\kk \setminus \{0\}$ such that $f'^{-1}(\kk \setminus S)$ is an {\em affine} curve\footnote{In fact $f'^{-1}(\kk)$ is also affine; however, all the proofs we know of use Riemann-Roch theorem, which we do not cover in this book.} (\cref{exercise:affine-inverse}).
\end{prooflist}
Let $D' := f'^{-1}(\kk \setminus S)$ and $p' := \prod_{s \in S}(f'-s) \in \kk[C'] \cap \kk[D']$. Then $D' \supseteq C' \setminus V(p')$. Let $q'$ be an element in $\kk[f']$ such that $q'(a) \neq 0$ and $D'\setminus V(p'q')$ is contained in $C'$. Let $g' := p'q' \in \kk[f']$. It is straightforward to check that $g'$ is regular on $C' \cup D'$, $g'(a) \neq 0$, $D' \setminus V(g') = C' \setminus V(g')$, and $\kk[D']_{g'} = \kk[C']_{g'}$. In other words, if we write $X$ for the open subscheme $C \setminus V(g)$ of $C$, and $X'$ for the support of $X$, then there is a commutative diagram as in \cref{fig:XX'DD'-0}.

\newcommand{\subfigwidth}{0.4\textwidth}
\begin{center}
\begin{figure}[h]

\begin{subfigure}[b]{\subfigwidth}
\begin{tikzcd}
X
\arrow[d, "\supp"]
&
& \\
X'
\arrow[r, "\cong"]
&
D'\setminus V(g')
\arrow[hook, r]
&D'
\end{tikzcd}
\caption{}
\label{fig:XX'DD'-0}
\end{subfigure}

\begin{subfigure}[b]{\subfigwidth}
\begin{tikzcd}
X
\arrow[d, "\supp"]
\arrow[r, "\cong"]
&
D \setminus V(g)
\arrow[r, hook]
\arrow[d, "\supp"]
&
D
\arrow[d, "\supp"]
\\
X'
\arrow[r, "\cong"]
&
D'\setminus V(g')
\arrow[r, hook]
&D'
\end{tikzcd}
\caption{}
\label{fig:XX'DD'-1}
\end{subfigure}
\caption{Compactification of $C\setminus V(g)$}  \label{fig:XX'DD'}
\end{figure}
\end{center}

Pick $g \in \kk[f]$ such that $g' = g|_{C'}$. We now construct an affine scheme $D$ with support $D'$ such that the diagram in \cref{fig:XX'DD'-1} commutes. Indeed, since $g'$ is invertible in $\kk[X'] \cong (\kk[x_1, \ldots, x_n]/\sqrt{\aaa})_{g'}$, it follows that $g$ is invertible in $A := (\kk[x_1, \ldots, x_n]/\aaa)_g$ (to see this use the same arguments as in the proof of \cref{reduced-invertible}). Pick $\kk$-algebra generators $f_1 = 1/g, f_2 = g, f_3, \ldots, f_k$ of $A$ such that
\begin{prooflist}[resume]
\item for each $j = 2, \ldots, k$, the image $\bar f_j$ in $\kk[X']$ of $f_j$ is in the image of the natural map $\kk[D'] \to \kk[X']$, and
\item $\kk[D'] = \kk[\bar f_2, \ldots, \bar f_k]$.
\end{prooflist}
Let $B := \kk[f_2, \ldots, f_k] \subset A$, and $D$ be the ``closed subscheme of $\kk^{k-1}$ with coordinate ring $B$,'' i.e.\ $D$ is the closed subscheme of $\kk^{k-1}$ corresponding to the kernel of the surjective map $\kk[x_2, \ldots, x_k] \to B$ which maps each $x_j$ to $f_j$. Then it is straightforward to check that the diagram in \cref{fig:XX'DD'-1} commutes. For each $i = 1, \ldots, s$, we write $D_i$ for the irreducible component of $D$ containing $C_i$. Let $p :=  \prod_{s \in S} (f-s) \in \kk[f]$, so that $p' = p|_{C'}$. Then $p'$ is invertible in $\kk[D']$, which implies that $p$ is invertible in $B$.

\begin{proclaim}
$B$ (respectively $\kk[D']$) is a finitely generated module over $\kk[f]_p$ (respectively $\kk[f']_{p'}$).
\end{proclaim}

\begin{proof}
\Cref{curve-finite} implies that each $\kk[D_i]$ is a finitely generated $\kk[f']_{p'}$-module. Since the natural map $\kk[D'] \to \prod_i \kk[D_i]$ is injective, $\kk[D']$ is isomorphic to a $\kk[f']_{p'}$-submodule of $\prod_i \kk[D_i]$, and therefore also a finitely generated module over $\kk[f']_{p'}$. Pick a finite collection $g'_1, \ldots, g'_k$ of $\kk[f']_{p'}$-module generators of $\kk[D']$. Pick $g_i \in B$ such that $g'_i = g_i|_{D'}$, $i = 1, \ldots, k$. Let $h_1, \ldots, h_l$ be generators of the ideal $\nnn$ of nilpotent elements of $B$. There is $m \geq 0$ such that $\nnn^{m+1} = 0$. We claim that $B$ is generated as a $\kk[f]_p$-module by $g_ih_1^{\alpha_1} \cdots h_m^{\alpha_m}$, $1 \leq i \leq k$, $\alpha \in \zzeroo{l}$, $\alpha_1 + \cdots + \alpha_l \leq m$. Indeed, let $u \in B$. Then there are $\phi_1, \ldots, \phi_k \in \kk[f]_p$ such that $u_1 := u - \sum_{j=1}^k \phi_j g_j \in \nnn$. Then $u_1 = \sum_{j=1}^l u_{1,j} h_j$. Expressing the $u_{1,j}$ as $\kk[f]_p$-linear combinations of the $g_j$ modulo $\nnn$ and continuing as above gives the claim.
\end{proof}

The fundamental theorem of finitely generated modules over a PID (\cref{fundamentally-over-PID}) implies that as a $\kk[f]_p$-module $B$ has a decompositions of the form:
\begin{align*}
B &\cong (\kk[f]_p)^r \dsum \left(\dsum_j \kk[f]_p/\langle \phi_j(f) \rangle \right)
\end{align*}
such that each $\phi_j(f)$ is a non-constant polynomial in $f$ which does {\em not} vanish at $f = c$ for any $c \in S$. For each $c \in \kk$, it follows that $f-c$ is a zero-divisor in $B$ if and only if $t-c$ divides some $\phi_j(t)$ in $\kk[t]$ (where $t$ is an indeterminate); in particular, there are only finitely many such $c \in \kk$. It is straightforward to see that $r = \dim_\kk(B/\langle f-c \rangle$ for all $c \in \kk$ such that $f-c$ is a non zero-divisor in $B$. \Cref{finite-order} then implies that
\begin{align*}
r 	= \sum_{\substack{b \in D\\ f(b) = c}} \ord_b(f-c)
\end{align*}
for all $c \in \kk$ such that $f-c$ is a non zero-divisor in $\kk[D]$. Now pick an arbitrary point $a^*  \in C\setminus \{a\}$. Applying the above construction with $a^*$ and $C^* := C \setminus\{a\}$ respectively in place of $a$ and $C$ yields an affine possibly non-reduced curve $D^*$ such that $\supp(D^*)$ containing an open neighborhood of $a^*$, and the same arguments show that there is an integer $r^*$ such that
\begin{align*}
r^*	= \sum_{\substack{b \in D^*\\ f(b) = c}} \ord_b((f-c)|_{D^*})
\end{align*}
for all $c \in \kk$ such that $f-c$ is a non zero-divisor in the ``coordinate ring'' of $D^*$. Since $D$ and $D^*$ are birational, and since our construction guarantees that $f$ is a non zero-divisor in coordinate rings of both $D$ and $D^*$, it follows that $r = r^*$ and
\begin{align}
\sum_{\substack{b \in D\\ f(b) = 0}} \ord_b(f)
	= \sum_{\substack{b \in D^*\\ f(b) = 0}} \ord_b(f|_{D^*})
\label{eqn:order-D=D*}
\end{align}
Let $a_1 = a, a_2, \ldots, a_k$ be the points of $f^{-1}(0)$ on $D$. For each $j > 1$, the construction of $D^*$ shows that $a_j \in D^*$ and $a_j$ has a neighborhood on $D$ which is isomorphic to $D^*$. Let $S^* := (f|_{\supp(D^*)})^{-1}(0) \setminus \{a_2, \ldots, ,a_k\} \subset D^*$. Identity \eqref{eqn:order-D=D*} implies that
\begin{align*}
\ord_a(f)
	= \sum_{b \in S^*} \ord_b(f|_{D^*})
\end{align*}
It follows from the construction of $D^*$ that $\supp(D^*)$ is nonsingular at every point on $S$. For each $b \in S^*$, let $D^*_{i_b}$ be the (unique) irreducible component of $D^*$ containing $b$. \Cref{irreducible-order} then implies that
\begin{align*}
\ord_a(f)
	= \sum_{b \in S^*} \mu_{D^*_{i_b}}(D^*)\ord_b(f|_{D^*_{i_b}})
\end{align*}
Since there $D^*_{i_b}$ and $C_i$ have isomorphic nonempty Zariski open subsets such that the corresponding open subschemes of $D^*$ and $C$ are isomorphic, it follows that $\mu_{D^*_{i_b}}(D^*) = \mu_{C_{i_b}}(C)$, and since the desingularization $\tilde C_i$ of $C_i$ is isomorphic to $D^*_{i_b}$ near $b$, it follows that $\ord_b(f|_{D^*_{i_b}})  = \ord_b(\pi_{i_b}^*(f|_{C_{i_b}}))$, which proves the theorem.
\end{proof}

\section{The power series ring and monomial orders} \label{power-order-section}
In this section we define ``monomial order,'' and use it to give simple proofs that the ring of power series (in finitely many variables over a field) is Noetherian (\cref{noetherian-power-series}) and that the dimensions of the quotients of power series rings are ``finitely determined'' (\cref{finite-determinacy}).

\subsection{Monomial order} \label{monomial-section}
A {\em monomial order} on $\zzeroo{n}$ is a binary relation $\preceq$ on $\zzeroo{n}$ such that
\begin{defnlist}

\item \label{total-prop} $\preceq$ is a {\em total order}\footnote{A {\em total order} on a set $S$ is a binary relation $\preceq$ on $S$ which is reflexive (i.e.\ $x \preceq x$ for all $x \in S$), transitive (i.e.\ if $x \preceq y$ and $y \preceq z$ then $x \preceq z$), antisymmetric (i.e.\ if $x \preceq y$ and $y \preceq x$ then $x = y$), and totally comparable (i.e.\ either $x \preceq y$ or $y \preceq x$ for each $x, y \in S$).},
\item \label{compatible-prop} $\preceq$ is compatible with the addition on $\zzeroo{n}$, i.e.\ if $\alpha \preceq \beta$, then $\alpha + \gamma \preceq \beta + \gamma$ for all $\gamma \in \zzeroo{n}$, and
\item \label{zero-prop} $0 \preceq \alpha$ for each $\alpha \in \zzeroo{n}$.
\end{defnlist}
We show below in \cref{corner-well} that every monomial order $\preceq$ is also a {\em well order} on $\zzeroo{n}$, i.e.\ for every nonempty subset $S$ of $\zzeroo{n}$, there is a unique $\alpha \in S$ such that $\alpha \preceq \alpha'$ for all $\alpha' \in S$. Let $x_1, \ldots, x_n$ be indeterminates. Since a monomial order $\preceq$ on $\zzeroo{n}$ defines an ordering on the set of monomials in $(x_1, \ldots, x_n)$, we also say that $\preceq$ is a monomial order on $\kk[x_1, \ldots, x_n]$ or on $\kk[[x_1, \ldots, x_n]]$.

\begin{example} \label{lexicographic-example}
The {\em lexicographical order} $\preceq_{lex}$ on $\zzeroo{n}$ is defined as follows: if $\alpha, \beta \in \zzeroo{n}$, then $\alpha \preceq_{lex} \beta$ if either $\alpha = \beta$, or $\alpha \neq \beta$ and the first non-zero coordinate (from the left) of $\alpha - \beta$ is negative. It is straightforward to check that $\preceq_{lex}$ is a monomial order and also a well order on $\zzeroo{n}$.
\end{example}

A {\em corner point} of a subset $S$ of $\zzeroo{n}$ is an element $\alpha \in S$ such that there is no $\alpha' \in S$, $\alpha' \neq \alpha$, such that $\alpha = \alpha' + \beta$ for some $\beta \in \zzeroo{n}$.

\begin{lemma} \label{corner-lemma}
Let $S$ be a nonempty subset of $\zzeroo{n}$. The set $\scrC_S$ of corner points of $S$ is finite and nonempty. Moreover, $S + \zzeroo{n} = \scrC_S + \zzeroo{n}$.
\end{lemma}

\begin{proof}
It is immediate to check that the minimal element of $S$ with respect to $\preceq_{lex}$ is a corner point of $S$, which proves that $\scrC_S$ is nonempty. Now assume $\scrC_S$ has infinitely many elements. Let $\alpha^0 = (\alpha^0_1, \ldots, \alpha^0_n)$ be an arbitrary element of $S$. For each $\alpha = (\alpha_1, \ldots, \alpha_n) \in \scrC_S$, there is $j$ such that $\alpha_j < \alpha^0_j$. Fix $j_1$ such that there are infinitely many $\alpha \in \scrC_S$ with $\alpha_{j_1} < \alpha^0_{j_1}$. Since there are finitely many choices for $\alpha_{j_1}$, it follows that there is $a_{j_1} < \alpha^0_{j_1}$ such that $\scrC^1_S:= \{\alpha \in \scrC_S: \alpha_{j_1} = a_{j_1}\}$ is infinite. Now fix $\alpha^1 \in \scrC^1$. Replacing $\alpha^0$ by $\alpha^1$ and $\scrC_S$ by $\scrC^1_S$ and running the above procedure yields $j_2 \neq j_1$ and $a_{j_2} < \alpha^1_{j_2}$ such that $\scrC^2_S := \{\alpha \in \scrC^1_S: \alpha_{j_2} = a_{j_2}\}$ is infinite. Continuing this process we will end up with an infinite set $\scrC^n_S$. But this is absurd, since $\scrC^n_S$ will consist of a single element $(a_1, \ldots, a_n)$ by construction. This contradiction implies that $\scrC_S$ was finite to begin with, which proves the first assertion. For the second assertion, pick $(\alpha_1, \ldots, \alpha_n) \in S$ and define $S_{\leq \alpha} := \{\beta \in S: \alpha - \beta \in \zzeroo{n}\}$. The first assertion implies that there is a corner point $\beta$ of $S_{\leq \alpha}$. It is clear that $\beta$ is also a corner point of $S$ and $\alpha \in \beta + \zzeroo{n}$. This proves the second assertion.
\end{proof}

\begin{cor} \label{corner-well}
Every monomial order on $\zzeroo{n}$ is also a well order on $\zzeroo{n}$.
\end{cor}

\begin{proof}
Let $\preceq$ be a monomial order on $\zzeroo{n}$ and $S$ be a nonempty subset of $\zzeroo{n}$. Let $\scrC_S$ be the set of corner points of $S$. Since $\scrC_S$ is finite and nonempty, it has a unique minimal element $\beta_0$ with respect to $\preceq$. For every $\alpha \in S$, \cref{corner-lemma} implies that there is $\beta \in \scrC_S$ such that $\alpha - \beta \in \zzeroo{n}$, so that properties \ref{compatible-prop} and \ref{zero-prop} of monomial orders imply that $\beta \preceq \alpha$. It follows that $\beta_0$ is the minimal element of $\scrS$ with respect to $\preceq$.
\end{proof}

\begin{cor} \label{corner-convex}
Let $S \subset \zz^n$. Then the convex hull of $S + \rzeroo{n}$ is a (convex) polyhedron.
\end{cor}

\begin{proof}
By translating $S$ if necessary, we may assume $S \subset \zzeroo{n}$. \Cref{corner-lemma} implies that $S + \rzeroo{n} = \scrC_S + \rzeroo{n}$, where $\scrC_S$ is the {\em finite} set of corner points of $\scrS$. It is straightforward to see that the convex hull of the Minkowski addition of any finite set with $\rzeroo{n}$ is a convex polyhedron.
\end{proof}

We say that a monomial order $\preceq$ on $\zzeroo{n}$ has {\em finite depth} if for every $\alpha \in \zzeroo{n}$, the set $\znzeropreceqalpha := \{\beta \in \zzeroo{n}: \beta \preceq \alpha\}$ is finite.

\begin{example} \label{grlex}
The lexicographic order $\preceq_{lex}$ from \cref{lexicographic-example} does {\em not} have finite depth. The {\em graded lexicographic order} $\preceq_{grlex}$ on $\zzeroo{n}$ is defined as follows: if $\alpha = (\alpha_1, \ldots, \alpha_n)$ and $\beta = (\beta_1, \ldots, \beta_n) \in \zzeroo{n}$, then $\alpha \preceq_{grlex} \beta$ if either $\sum_j \alpha_j < \sum_j \beta_j$, or if $\sum_j \alpha_j = \sum_j \beta_j$ and $\alpha \preceq_{lex} \beta$. It is straightforward to check that $\preceq_{grlex}$ is a monomial order on $\zzeroo{n}$ of finite depth.
\end{example}

\subsection{Rings of formal power series over a field} \label{power-section}

Let $k$ be a field, $x_1, \ldots, x_n$ be indeterminates, and $R:= k[[x_1, \ldots, x_n]]$ be the ring of formal power series in $(x_1, \ldots, x_n)$ over $k$. \Cref{corner-lemma} implies that every ideal of $R$ which is generated by monomials is finitely generated. We now prove the more general fact that every ideal of $R$ is finitely generated. Fix a monomial order $\preceq$ on $\zzeroo{n}$. For each nonempty subset $S$ of $\zzeroo{n}$, we write $\In_{\preceq}(S)$ for the minimal element of $S$ with respect to $\preceq$. For $f = \sum_\alpha c_\alpha x^\alpha \in R$, the {\em support} $\supp(f)$ of $f$ is the set $\{\alpha: c_\alpha \neq 0\} \subseteq \zzeroo{n}$; if $f \neq 0$ and $\alpha := \In_\preceq(\supp(f))$, we say that $\alpha$ is the {\em initial exponent} of $f$ denoted by $\exp_\preceq(f)$ and $c_\alpha x^\alpha$ is the {\em initial form} $\In_\preceq(f)$ of $f$. For each subset $Q$ of $R$, we write $\exp_\preceq(Q) := \{\exp_\preceq(f): f \in Q,\ f \neq 0\} \subseteq \znzero$ for the set of initial exponents of non-zero elements in $Q$.

\begin{thm} \label{power-basis}
Let $\preceq$ be a monomial order of finite depth on $\zzeroo{n}$. Let $I$ be an ideal and  $\scrC_I = \{\alpha_1, \ldots, \alpha_s\}$ be the set of corner points of $\exp_\preceq(I)$. For each $i = 1, \ldots, s$, pick $f_i\in I$ such that $\In_\preceq(f_i) = x^{\alpha_i}$.
\begin{enumerate}
\item Each $g \in R$ can be expressed as $g = \sum_i f_i h_i + g'$ for some $h_1, \ldots, h_s, g'  \in R$ such that either $g' = 0$, or $\exp_\preceq(g) \preceq \exp_\preceq(g')$ and $\exp_\preceq(g') \not \in \exp_\preceq(I)$.
\item $I$ is generated by $f_1, \ldots, f_s$.
\item If $g \in R\setminus \{0\}$ is such that $\supp(g) \subset \zzeroo{n} \setminus\exp_\preceq(I)$, then $g \not\in I$. In particular, $\dim_\kk( R/I) = | \zzeroo{n} \setminus \exp_\preceq(I)|$ and if $\dim_\kk( R/I) < \infty$, then $\{x^\alpha: \alpha \in \zzeroo{n} \setminus \exp_\preceq(I)\}$ form a $\kk$-basis of $ R/I$.
\end{enumerate}
\end{thm}

\begin{proof}
At first we prove the first assertion. Pick $g \in R$. If $\alpha := \exp_\preceq(g) \not\in \exp_\preceq(I)$, there is nothing to do. Otherwise pick the smallest $i_1$, $1 \leq i_1 \leq s$, such that $\alpha = \alpha_{i_1} + \beta_1$ for some $\beta_1 \in \zzeroo{n}$. Then $\In_\preceq(g) = c_1x^{\alpha_{i_1} + \beta_1}$ for some $c_1 \in \kk$. Write $g_0 := g$ and $g_1 := g - c_1x^{\beta_1}f_{i_1}$. Continuing with $g_1$ and repeating this procedure, yields a sequence of elements $(g_k)_{k \geq 0}$ such that $\exp_\preceq(g_k) \precneqq \exp_\preceq(g_{k+1})$ for each $k$. Either this sequence is infinite, in which case the finite depth of $\preceq$ ensures that $f$ is a $R$-linear combination of the $f_j$, or it stops at a stage $k$, in which case $\exp_\preceq(g_k) \not\in \exp_\preceq(I)$. This implies the first assertion. The second assertion follows from the first. The third assertion follows from the first assertion and finite depth of $\preceq$.
\end{proof}

\begin{cor}\label{noetherian-power-series}
$R$ is Noetherian. \qed
\end{cor}

\subsection{Finite determinacy of quotients of power series rings} \label{finite-determinacy-section}
Given formal power series $f_1, \ldots, f_s \in R := k[[x_1, \ldots, x_n]]$, in this section we show that the dimension of $R/\langle f_1, \ldots, f_s \rangle$ as a vector space over $k$ can be {\em finitely determined}, i.e.\ it can be determined by {\em polynomials} $g_1, \ldots, g_s$ provided the $g_j$ are ``sufficiently close'' to to $f_j$, where the ``closeness'' of elements of $R$ will be measured by monomial orders of finite depth.

Let $\preceq$ be a monomial order on $\zzeroo{n}$. For each $f = \sum_\alpha c_\alpha x^\alpha \in R$ and each $\beta \in \zzeroo{n}$ write $[f]_{\preceq \beta} := \sum_{\alpha \preceq \beta} c_\alpha x^\alpha$.

\begin{thm} \label{finite-determinacy}
Assume $\preceq$ has finite depth. Let $I$ be an ideal of $R$ generated by $f_1, \ldots, f_s$. For each $\beta \in \zzeroo{n}$, let $[I]_{\preceq \beta}$ be the ideal of $R$ generated by $[f_j]_{\preceq \beta}$, $j = 1, \ldots, s$.
\begin{enumerate}
\item \label{finite-determinacy:finite} If $\dim_\kk(R/I) < \infty$, then there is $\beta \in \zzeroo{n}$ such that $\exp_\preceq(I) = \exp_{\preceq}([I]_{\preceq \beta'})$ and $\dim_\kk(R/I) = \dim_\kk(R/[I]_{\preceq \beta'})$ for all $\beta' \succeq \beta$.
\item If $\dim_\kk(R/I) = \infty$, then for each $N \geq 0$, there is $\beta \in \znzero$ such that $\dim_\kk(R/[I]_{\preceq \beta'}) \geq N$ for all $\beta' \succeq \beta$.
\end{enumerate}
\end{thm}

\begin{proof}
At first assume $\dim_\kk(R/I) < \infty$. Due to \cref{power-basis} to prove assertion \cref{finite-determinacy:finite} it suffices to show that $\exp_\preceq([I]_{\preceq {\beta'}}) = \exp_\preceq(I)$ if $\beta'$ is sufficiently ``high'' with respect to $\preceq$. \Cref{power-basis} implies that $\zzeroo{n} \setminus \exp_\preceq(I)$ is finite. For every finite subset $S$ of $\zzeroo{n}$, write $\ld_\preceq(S)$ for the maximal element of $S$ with respect to $\preceq$. Let $\beta_1 := \ld_\preceq (\zzeroo{n} \setminus \exp_\preceq(I))$. Then for each $\beta' \succeq \beta_1$ and each $g_1, \ldots, g_s \in R$, we have
\begin{align*}
\sum_j g_j[f_j]_{\preceq \beta'}
	&= \sum_j g_j([f_j]_{\preceq \beta'} -f_j) + \sum_j g_jf_j
\end{align*}
Let $h := \sum_j g_j[f_j]_{\preceq \beta'}$, $h_1 := \sum_j g_j([f_j]_{\preceq \beta'} -f_j)$ and $h_2 := \sum_j g_jf_j$. Since $\exp_\preceq(h_2) \in \exp_\preceq(I)$ and $\exp_\preceq(h_1) \succneqq \ld_\preceq (\zzeroo{n} \setminus \exp_\preceq(I))$, it is straightforward to see that if $h = h_1 + h_2\neq 0$, then $\exp_\preceq(h ) \in \exp_\preceq(I)$. It follows that $\exp_\preceq ([I]_{\preceq \beta'}) \subseteq \exp_\preceq(I)$. Now let $\scrC_I$ be the set of corner points of $\exp_\preceq(I)$ and $\beta_2 := \ld_\preceq (\exp_\preceq(\scrC_I))$. Fix $\alpha \in \scrC_I$. There is $g_1, \ldots, g_s \in R$ such that $\exp(\sum_j g_jf_j) = \alpha$. Pick $\beta' \succeq \beta_2$, and define $h, h_1,h_2$ as above. Then $\exp_\preceq (h_2) \precneqq \exp_\preceq(h_1)$, so that $\exp_\preceq(h) = \exp_\preceq(h_2) = \alpha$. Therefore $\scrC_I\subset \exp_\preceq ([I]_{\preceq \beta'})$ and consequently \cref{corner-lemma} implies that $\exp_\preceq (I) \subset \exp_\preceq ([I]_{\preceq \beta'})$. It follows that $\exp_\preceq (I) = \exp_\preceq ([I]_{\preceq \beta'})$ whenever $\beta' \succeq \beta := \ld_\preceq\{\beta_1, \beta_2\}$, which proves the first assertion. For the second assertion, fix $N \geq 0$. Take an arbitrary finite subset $S$ of $\znzero \setminus \exp_{\preceq}(I)$ such that $|S| \geq N$ and let $\beta := \ld_\preceq(S)$. The same argument as in the beginning of the proof suggests that for each $\beta' \succeq \beta$ and each $g_1, \ldots, g_s \in R$, $\exp_\preceq(\sum_j g_j[f_j]_{\preceq \beta'}) \not\in S$, so that \cref{power-basis} implies that $\dim_\kk(R/[I]_{\preceq \beta'}) \geq |S| \geq N$, as required.
\end{proof}

\section{Primitive elements of $\zz^n$}
An element in $\zz^n$ is {\em primitive} if it is nonzero and the greatest common divisor of its nonzero coordinates is one. Every member of a basis of $\zz^n$ is primitive. The following lemma shows that the converse is also true. In this section we use $\langle \cdot, \cdot \rangle$ to denote the standard inner product on $\zz^n$, i.e.\
$$\langle (a_1, \ldots, a_n), (b_1, \ldots, b_n) \rangle := \sum_j a_jb_j$$

\begin{lemma} \label{basis-lemma}
Let $n$ be a positive integer and $G$ be a subgroup of $\zz^n$.
\begin{enumerate}
\item If $\alpha$ is a primitive  element in $\zz^n$, then there is a basis of $\zz^n$ containing $\alpha$.
\item $G \cong \zz^m$ for some $m \leq n$, and there is a basis $(\alpha_1, \ldots, \alpha_n)$ of $\zz^n$ and positive integers $k_1, \ldots, k_m$ such that $(k_1 \alpha_1, \ldots, k_m \alpha_m)$ is a basis of $G$.
\end{enumerate}
\end{lemma}

\begin{proof}
For the first assertion, let $\alpha_1 :=\alpha$. Since $\alpha_1$ is primitive, there is $\beta_1 \in \znstar$ such that $\langle \beta_1, \alpha_1 \rangle = 1$. Let $H_1 := \beta_1^\perp := \{ \gamma \in \zz^n:  \langle \beta_1, \gamma \rangle= 0\}$. If $H_1 \neq 0$, pick a primitive element $\alpha_2 \in H_1$ and $\beta_2 \in \znstar$ such that $\langle \beta_2, \alpha_2 \rangle = 1$, and set $H_2 := H_1 \cap \beta_2^\perp$. Continue in this way up to the $n$-th step. It is straightforward to see that $\beta_1, \ldots, \beta_n$ are linearly independent (over $\rr$), so that $H_n = 0$ and $(\alpha_1, \ldots, \alpha_n)$ is a basis of $\zz^n$, as required. For the second assertion, we may assume $G \neq \{0\}$. For each non-zero $\alpha \in G$, let $d_\alpha$ be the greatest common divisor of the non-zero coordinates of $\alpha$. Pick $\alpha \in G$ with the smallest possible $d_\alpha$. Due to the first assertion we may assume \woutlog\ that $\alpha = d_\alpha(1, 0, \ldots, 0)$. The minimality of $d_\alpha$ implies that for all $\beta = (\beta_1, \ldots, \beta_n) \in G$, the first coordinate $\beta_1$ of $\beta$ is divisible by $d_\alpha$. It follows that $G = \zz \alpha + G'$, where $G' := G \cap (\{0\} \times \zz^{n-1})$. The second assertion holds for $G'$ by induction on $n$, which in turn implies that it holds for $G$.
\end{proof}

\begin{cor} \label{change-of-basis-lemma}
Let $\phi: \zz^n \to \zz^m$ be a homomorphism of abelian groups and $r$ be the rank (over $\qq$) of the matrix of $\phi$. Then the matrix of $\phi$ with respect to appropriate bases of $\zz^n$ and $\zz^m$ is of the form
\begin{align*}
\mat{\phi}
	&=
		\left[
			\begin{array}{c|c}
			D & 0\\
			\hline
			0 & 0
			\end{array}
		\right]
\end{align*}
where $D$ is an $r\times r$-diagonal matrix whose diagonal entries are positive integers.
\end{cor}

\begin{proof}
Let $e^m_i$ and $e^n_j$ denote respectively the $i$-th standard unit element in $\zz^m$ and the $j$-th standard unit element in $\zz^n$. Let $\alpha_1, \ldots, \alpha_m$ be the rows of the matrix of $\phi$ with respect to the standard bases of $\zz^n$ and $\zz^m$. Let $G$ be the subgroup of $\zz^n$ generated by $\alpha_1, \ldots, \alpha_m$. \Cref{basis-lemma} implies that after a change of basis of $\zz^m$ we may assume that $G$ is generated by $k_1e^n_1, \ldots, k_re^n_r$, where each $k_j$ is a positive integer. Pick $\gamma_1 = (\gamma_{1,1}, \ldots, \gamma_{1,m}) \in \zz^m$ such that $\sum_j \gamma_{1,j}\alpha_j = k_1e^n_1$. Then $\gamma_1$ must be a primitive element of $\zz^m$, so after a change of basis in $\zz^m$, we may assume that $\gamma_1 = e^m_1$, which in turn implies that $\alpha_1 = k_1e^n_1$. Note that for each $j = 2, \ldots, m$, $\alpha_j $ is of the form $d_jk_1e^n_1 + \alpha'_j$, with $\alpha'_j$ in the subgroup $G'$ of $\zz^n$ generated by $k_2e^n_2, \ldots, k_re^n_r$. Therefore, after a change of basis of $\zz^m$ the form $e^m_j \mapsto e^m_j +  d_jk_1e^m_1$, $j = 2, \ldots, m$, the matrix of $\phi$ is of the form
\begin{align*}
		\left[
			\begin{array}{c|c}
			k_1 & 0\\
			\hline
			0 & M
			\end{array}
		\right]
\end{align*}
for some $(n-1) \times (m-1)$ matrix $M$. Now apply induction (say, on $n$) to the homomorphism from $\zz^{n-1} \to \zz^{m-1}$ induced by $M$.
\end{proof}

\section{Symmetric multiadditive functions on a commutative semigroup}
Throughout this section $(\scrK, +)$ is a commutative semigroup and $n$ is a positive integer. Let $\rho$ be a mapping from $\scrK^n$ to $\rr$. We say that $\rho$ is {\em symmetric} if $\rho(f_1, \ldots, f_n) = \rho(f_{\sigma_1}, \ldots, f_{\sigma_n})$ for each permutation $\sigma$ of $(1, 2, \ldots, n)$. We say that $\rho$ is {\em multiadditive} if
\begin{align}
\begin{split}
\rho(h_1, \ldots, h_{j-1}, qf + rg, h_{j+1} \ldots, h_n)
	&= q\rho(h_1, \ldots, h_{j-1}, f, h_{j+1} \ldots, h_n) \\
	&\qquad + r \rho(h_1, \ldots, h_{j-1}, g, h_{j+1} \ldots, h_n)
\end{split}
\label{multiadditivity}
\end{align}
for each $q, r \in \zzero$, $j \in \{1, \ldots, n\}$ and $f,g, h_1, \ldots, h_{j-1}, h_{j+1}, \ldots, h_n \in \scrK$. Throughout this section we use $\rho$ to denote a symmetric multiadditive function from $\scrK^n$ to $\rr$.

\subsection{Existence from polynomial functions}
For nonnegative integers $j_1, \ldots, j_k, n$ such that $n = j_1 + \cdots + j_k$, we write $\binom{n}{j_1, \ldots, j_k}$ for the {\em multinomial coefficient} $n!/(j_1! \cdots j_k!)$. Recall that $\binom{n}{j_1, \ldots, j_k}$ is precisely the coefficient of $x_1^{j_1} \cdots x_k^{j_k}$ in $(x_1 + \cdots + x_k)^n$.

\begin{lemma} \label{mixed-lemma}
Let $\nu: \scrK \to \rr$ be a function which satisfies the following property: for each $s \geq 1$ and $f_1, \ldots, f_s \in \scrK$, there are $\nu_\alpha(f_1, \ldots, f_s) \in \rr$ for all $\alpha \in \scrE_s:= \{(\alpha_1, \ldots, \alpha_s) \in (\zzeroo{s}: \alpha_1 + \cdots  + \alpha_s = n\}$ such that for all $\lambda_1, \ldots, \lambda_s \in \zzero$,
\begin{align}
\nu(\lambda_1f_1 + \cdots + \lambda_s f_s) = \sum_{\alpha \in \scrE_s} \nu_\alpha(f_1, \ldots, f_s) \lambda_1^{\alpha_1} \cdots \lambda_s^{\alpha_s}
\label{rho-pol}
\end{align}
Then $\rho(f_1, \ldots, f_n) := \frac{1}{n!}\nu_{(1, \ldots, 1)}(f_1, \ldots, f_n)$ is a symmetric multiadditive function from $\scrK^n$ to $\rr$ such that $\rho(f, \ldots, f) = \nu(f)$.
\end{lemma}

\begin{proof}
Fix $f\in \scrK$. Applying \eqref{rho-pol} with $s = 1$ shows that $\nu(\lambda f) = \nu_n(f)\lambda^n$ for each $\lambda \in \zzero$.  Setting $\lambda = 1$, we have $\nu_n(f) = \nu(f)$, and therefore $\nu(\lambda f) = \lambda^n \nu(f)$ for all $\lambda \in \zzero$. It follows that
\begin{align*}
\nu(\lambda_1f+ \cdots + \lambda_n f)
	&=  (\lambda_1 + \cdots + \lambda_n)^n \nu(f)
	= \sum_\alpha \binom{n}{\alpha_1, \ldots, \alpha_n} \lambda_1^{\alpha_1} \cdots \lambda_n^{\alpha_n} \nu(f)
\end{align*}
so that
\begin{align*}
\rho(f, \ldots, f) = \frac{1}{n!}\binom{n}{1, \ldots, 1} \nu(f) =  \nu(f)
\end{align*}
It is clear that $\rho$ is symmetric in its arguments. For multiadditivity, write elements of $\zz^{n+1}$ as $(\alpha, \beta, \ggamma) := (\alpha, \beta, \gamma_1, \ldots, \gamma_{n-1})$ and note that
\begin{align*}
\nu(\lambda f + \mu g + \tau_1h_1 + \cdots + \tau_{n-1} h_n)
	&= \sum_{(\alpha, \beta, \ggamma) \in \scrE_{n+1}} \nu_{(\alpha, \beta, \ggamma)} (f, g, h_1, \ldots, h_{n-1}) \lambda^\alpha \mu^\beta\tau_1^{\gamma_1} \cdots \tau_{n-1}^{\gamma_{n-1}}

\end{align*}
so that
\begin{align*}
\nu(\lambda (f + g) + \tau_1h_1 + \cdots + \tau_{n-1} h_n)
	&= \sum_{(\alpha, \beta, \ggamma) \in \scrE_{n+1}} \nu_{(\alpha, \beta, \ggamma)} (f, g, h_1, \ldots, h_{n-1}) \lambda^{\alpha +\beta} \tau_1^{\gamma_1} \cdots \tau_{n-1}^{\gamma_{n-1}}
\end{align*}
It follows that
\begin{align*}
\nu_{(\delta, \ggamma)}(f+g, h_1, \ldots, h_{n-1})
	&= \sum_{\alpha + \beta = \delta}\nu_{(\alpha, \beta, \ggamma)}(f, g, h_1, \ldots, h_{n-1})
\end{align*}
In particular,
\begin{align*}
\rho(f + g, h_1, \ldots, h_{n-1})
	&= \frac{1}{n!}\nu_{(1, \ldots, 1)}(f + g, h_1, \ldots, h_{n-1}) \\
	&= \frac{1}{n!}(\nu_{(1, 0, 1, \ldots, 1)}(f, g, h_1, \ldots, h_{n-1})
		+ \nu_{(0, 1, \ldots, 1)}(f , g, h_1, \ldots, h_{n-1})) \\
	&= \rho(f, h_1, \ldots, h_{n-1}) + \rho(g, h_1, \ldots, h_{n-1})
\end{align*}
which implies that $\rho$ is multiadditive, and completes the proof.
\end{proof}

\subsection{Identities from homogeneous polynomials}

Let $x_1, \ldots, x_N$ be indeterminates and $A_n$ be the abelian group spanned by homogeneous polynomials of degree $n$ in $x_1, \ldots, x_N$. Given $f := (f_1, \ldots, f_N) \in \scrK^N$, $\rho$ induces a map $\rho_f: A_n \to \rr$ given by
\begin{align*}
x_{i_1}^{j_1} \cdots x_{i_k}^{j_k} \mapsto \rho(f_{i_1}, \ldots, f_{i_1}, \ldots, f_{i_k}, \ldots, f_{i_k}),
\end{align*}
where each $f_{i_s}$ is repeated $j_s$ times. It is straightforward to check that $\rho_f$ is a homomorphism of abelian groups. This implies the following principle:

\begin{rem} \label{polynomial-identity}
Any identity that is valid on $A_n$ remains valid after replacing every term that appears in it by its image under $\rho_f$.
\end{rem}

 We now use this observation to show that a symmetric multiadditive function is uniquely determined by its diagonal part.

\begin{lemma} \label{r-s-I-lemma}
Let $x_1, \ldots, x_n$ be indeterminates and $I \subseteq [n]$. Let $I := \{i_1, \ldots, i_k\}$, where $k = |I|$. Write
\begin{align*}
s_I & := (x_{i_1} + \cdots + x_{i_k})^n \\
r_I &:= \sum_{\substack{j_1 + \cdots + j_k = n \\j_l \geq 1,\ l = 1, \ldots, k}} \binom{n}{j_1, \ldots, j_k} x_{i_1}^{j_1} \cdots x_{i_k}^{j_k}
\end{align*}
Then
\begin{align}
r_I
	&= s_I -	\sum_{\substack{J \subset I \\ |J| = k -1}}s_J
			+ \sum_{\substack{J \subset I \\ |J| = k -2}}s_J + \cdots
						+ (-1)^{k-1} \sum_{\substack{J \subset I \\ |J| = 1}}s_J \label{r-s-I}
\end{align}
In particular,
\begin{align}
n!x_1 \cdots x_n
	&= \sum_{\substack{I \subseteq [n]\\ I \neq \emptyset}}(-1)^{n - |I|} (\sum_{i \in I} x_i )^n\ \label{r-s-[n]}
\end{align}
\end{lemma}

\begin{proof}
It suffices to prove identity \eqref{r-s-I}, since identity \eqref{r-s-[n]} follows from \eqref{r-s-I} by setting $I = [n]$. Straightforward algebra shows that
\begin{align*}
s_I &= \sum_{j_1 + \cdots + j_k = n } \binom{n}{j_1, \ldots, j_k} x_{i_1}^{j_1} \cdots x_{i_k}^{j_k}
	= r_I + \sum_{J \subsetneq I}r_J

	= r_I + \sum_{\substack{J \subsetneq I \\ |J| = k -1}}r_J + \sum_{\substack{J \subsetneq I \\ |J| \leq  k -2}}r_J \\
	&= r_I + \sum_{\substack{J \subsetneq I \\ |J| = k -1}}(s_J -  \sum_{J' \subsetneq J} r_{J'}) + \sum_{\substack{J \subsetneq I \\ |J| \leq  k -2}}r_J \\
	&= r_I + 	\sum_{\substack{J \subsetneq I \\ |J| = k -1}}s_J + \sum_{\substack{J \subsetneq I \\ |J| \leq  k -2}}(1 - k + |J|)r_J
	= r_I + 	\sum_{\substack{J \subsetneq I \\ |J| = k -1}}s_J + \sum_{l=1}^{k-2}\sum_{\substack{J \subset I \\ |J| =  l}}(1 - k + l)r_J \\
	&= r_I + 	\sum_{\substack{J \subsetneq I \\ |J| = k -1}}s_J
		 - \sum_{\substack{J \subset I \\ |J| = k -2}}(s_J -  \sum_{J' \subsetneq J} r_{J'}) + \sum_{l=1}^{k-3}\sum_{\substack{J \subset I \\ |J| =  l}}(1 - k + l)r_J \\
	&= r_I + 	\sum_{\substack{J \subsetneq I \\ |J| = k -1}}s_J
			 - \sum_{\substack{J \subset I \\ |J| = k -2}}s_J
			 + \sum_{l=1}^{k-3}\sum_{\substack{J \subset I \\ |J| =  l}}(1 - (k - l) + \binom{k-l}{2})r_J
\end{align*}
In this way, at every step writing $r_J = s_J - \sum_{J' \subsetneq J} r_{J'}$ and rearranging terms, and observing that $r_J = s_J$ whenever $|J| = 1$, we will have
\begin{align*}
s_I
	&= r_I + 	\sum_{\substack{J \subsetneq I \\ |J| = k -1}}s_J
				 - \sum_{\substack{J \subset I \\ |J| = k -2}}s_J + \cdots
				 + (-1)^{k-3}\sum_{\substack{J \subset I \\ |J| = 2}}s_J \\
	& \qquad
				 + \sum_{\substack{J \subset I \\ |J| =  1}}(1 - (k - 1) + \binom{k-1}{2} + \cdots + (-1)^{k-2} \binom{k-1}{k-2})s_J
\end{align*}
Since $\sum_{j = 0}^{k-2}(-1)^j \binom{k-1}{j} = (1-1)^{k-1} - (-1)^{k-1} = -(-1)^{k-1}$, the lemma follows.
\end{proof}

\begin{cor}[See e.g.\ \cite{mathoverflow-tom-leinster}] \label{tom-lemma}
$\rho$ is uniquely determined by its diagonal part, i.e.\ the map from $\scrK$ to $\rr$ which sends $f \mapsto \rho(f, \ldots, f)$. More precisely,
\begin{align}
\rho(f_1, \ldots, f_n)
	&= \frac{1}{n!}\sum_{\substack{I \subseteq [n]\\ I \neq \emptyset}}(-1)^{n - |I|}\rho  (\sum_{i \in I} f_i, \ldots, \sum_{i \in I} f_i )
\end{align}
\end{cor}

\begin{proof}
Combine \cref{polynomial-identity} and identity \eqref{r-s-[n]}.
\end{proof}

\begin{lemma}
Let $x_1, \ldots, x_k, y_1, \ldots, y_k$ be indeterminates. Then
\begin{align}
x_1 \cdots x_k
	&= \sum_{I \subseteq [k]} (-1)^{k- |I|} \prod_{i \in I}(x_i + y_i) \prod_{j \in [k]\setminus I} y_j \label{kushnirenko-pol-identity}
\end{align}
\end{lemma}

\begin{proof}
We prove this by induction on $k$. For $k = 1$ it boils down to the identity $x_1 = (x_1 +y_1) - y_1$. In the general case, write
\begin{align*}
x_1 \cdots x_k
	&= \prod_{i=1}^k (x_i + y_i) - \sum_{j = 1}^k (\prod_{i=1}^{j-1}x_i)y_j (\prod_{i=j+1}^k(x_i + y_i))
\end{align*}
Applying induction to the expression $\prod_{i=1}^{j-1}x_i$ yields that
\begin{align*}
x_1 \cdots x_k
	&= \prod_{i=1}^k (x_i + y_i) - \sum_{j = 1}^k
		(\sum_{I \subseteq [j-1]} (-1)^{j-1- |I|} \prod_{i \in I}(x_i + y_i) \prod_{i' \in [j-1]\setminus I} y_{i'})
		y_j (\prod_{i=j+1}^k(x_i + y_i)) \\
	&= \prod_{i=1}^k (x_i + y_i) - \sum_{j = 1}^k
			\sum_{\substack{[k] \supseteq I \supseteq [k]\setminus [j]   \\ I \not\ni j}}
			(-1)^{k - |I| -1} \prod_{i \in I}(x_i + y_i) \prod_{i' \in [k]\setminus I} y_{i'}\\
	&= 	\sum_{I \subseteq [k]}
				(-1)^{k - |I|} \prod_{i \in I}(x_i + y_i) \prod_{i' \in [k]\setminus I} y_{i'}
\end{align*}
This completes the proof.
\end{proof}

For the next result we assume $\rho: \scrK^n \to \rr$ is a symmetric multiadditive ``rational'' map, i.e.\ $\rho$ may not be defined everywhere on $\scrK^n$, but if $\rho(f_1, \ldots, f_n)$ is defined, then $\rho(f_{\sigma_1}, \ldots, f_{\sigma_n})$ are defined for all permutations $\sigma$ of $(1, \ldots, n)$, and all of them take the same value in $\rr$; and identity \eqref{multiadditivity} holds whenever $\rho$ is defined on at least two of the three elements of $\scrK^n$ that appear on \eqref{multiadditivity}. Given $h_1, \ldots, h_n \in \scrK$ and $I, J \subseteq [n]$ such that $|I| + |J| = n$, we write $\rho((h_i)_{i \in I}, (h_j)_{j \in J})$ for $\rho(h_{i_1}, \ldots, h_{i_k}, h_{j_1}, \ldots, h_{j_{n-k}})$ (provided it is defined), where $I = \{i_1, \ldots, i_k\}$ and $J = \{j_1, \ldots, j_{n-k}\}$.

\begin{cor} \label{kushnirenko-lemma}
Let $f_1, \ldots, f_n, g_1, \ldots, g_n \in \scrK$ be such that $\rho((f_i)_{i \in I}, (g_j)_{j \in [n] \setminus I})$ is defined for each $I \subseteq [n]$. Then
\begin{align}
\rho(f_1, \ldots, f_n)
	&= \sum_{I \subseteq [n]} (-1)^{n- |I|} \rho((f_i + g_i)_{i \in I}, (g_j)_{j \in [n] \setminus I})  \label{kushnirenko-semigroup-identity}
\end{align}
\end{cor}

\begin{proof}
Let $x_1, \ldots, x_n, y_1, \ldots, y_n$ be indeterminates and $B_n$ be the abelian group generated by the monomials of degree $n$ of the form $\prod_{i \in I}x_i \prod_{j \in [n]\setminus I}y_j$ for all $I \subseteq [n]$. Then the map $\rho_{f,g}$ which sends $\prod_{i \in I}x_i \prod_{j \in [n]\setminus I}y_j \mapsto \rho((f_i)_{i \in I}, (g_j)_{j \in [n] \setminus I})$ is a well defined homomorphism from $B_n$ to $\rr$. Since all the monomials that appear on \eqref{kushnirenko-pol-identity} for $k = n$ belong to $B_n$, identity \eqref{kushnirenko-semigroup-identity} therefore follows from applying $\rho_{f,g}$ to the $k = n$ case of \eqref{kushnirenko-pol-identity}.
\end{proof}

config: arxiv


TITLE: Problem with Expected Value (with conditional!)
QUESTION [0 upvotes]: this is my first post on Maths so sorry if I haven't done this properly! I've been told that y = A + BX + C, and that E(C|X) = 0.
They've then jumped to the conclusion that E(y|X) = A + BX.
So I get that E(C|X) = 0, and C = y - (A + BX), so E(y-(A + BX)|X) = 0.
Just not sure how they've just moved the (A + BX) to the other side to get E(y|X) = A + BX, can you just move it to the other side or am I being an idiot?
Thanks!

REPLY [0 votes]: You cannot just move it to the right side. You'll have to move it with the conditional expectation (linearity of expectation). In other words, $\mathbb{E}[H - G\,|\,K] \iff \mathbb{E}[H\,|\,K] = \mathbb{E}[G\,|\,K]$.
So what you have to do is convince yourself that $\mathbb{E}[(A + BX)\,|\,X] = A + BX$. If $A$ and $B$ are constants, then it reduces to understanding that $\mathbb{E}[X|X] = X$, which should be easy.


TITLE: If $c\equiv a \pmod{r}$ and $c\equiv b\pmod{s}$,  prove $a\equiv b\pmod{\gcd(a,b)}$
QUESTION [1 upvotes]: I ran into this problem with my abstract algebra homework the other night, and I think I am really close to solving it.  By the definition of modulo n, I know that
c=a + rm, m being some integer
c=b + sn, n being some integer
I want to prove a=b + (rm + sn)
I have tried algebraically manipulating these equalities, but to no avail.  Is this the right track, or do I need a different approach?  I have a quiz tomorrow, so an answer would be much appreciated. :D

REPLY [1 votes]: I am guessing that the question you are trying to ask is:

If $c$ is congruent to $a$ modulo $r$, and $c$ is congruent to $b$ modulo $s$, then $a$ is congruent to $b$ modulo $\gcd(r,s)$ (not modulo $\gcd(a,b)$).

If so: you know $r$ divides $c-a$, so $\gcd(r,s)$, which divides $r$, also divides $c-a$. And $s$ divides $c-b$, so $\gcd(r,s)$ divides $c-b$. So $\gcd(r,s)$ divides both $c-a$ and $c-b$, which means it divides their difference. Which just happens to be...
Or along what you write: express $r$ and $s$ as multiples of $\gcd(r,s)=d$. Since $r=dk$ and $s=d\ell$ for some $k$ and $\ell$, you get
\begin{align*}
c &= a+rm = a+d(km).\\
c &= b+sn = b+d(\ell n).
\end{align*}
That means $a+d(km) = b+d(\ell n)$. Now, can you write $a = b+dt$ for some integer $t$?

REPLY [1 votes]: Suppose $c \equiv a \pmod r$ and $c \equiv b \pmod s$. We want to show that $a \equiv b \pmod{t}$ where $t = \gcd(r,s)$. So $c-a = rl$ and $c-b = sm$ for $l,m \in \mathbb{Z}$. So $a-b = sm-rl$.

REPLY [1 votes]: HINT $\rm\ \ \ d\ |\ r\ |\ c-a,\ \ \ d\ |\ s\ |\ c-b\ \ \Rightarrow\ \ d\ | \ c-b-(c-a)\ =\ a-b\:.\ $ Now put $\rm\ d = gcd(r,s)$


TITLE: Fundamental Group Contains Infinite Cyclic Subgroup
QUESTION [3 upvotes]: Let $X \subseteq \Bbb{R}^2$ s.t. $\Bbb{R}^2$ such that $S^1 \subseteq X \subseteq \Bbb{R}^2 - \{(0,0)\}$. Prove that contains $\pi_1(X,(0,1))$ an infinite cyclic subgroup.

Here's what I did. Let $j : S^1 \to X$ be the embedding of $S^1$ into $X$. I then showed that the induced homomorphism $j_* : \pi_1(S^1,(0,1)) \to \pi_1(X, (0,1))$ injective, so $\pi_1(X,(0,1))$ contains the subgroup $j_*(\pi_1(S^1,(0,1))) \simeq \pi_1(S^1,(0,1)) \simeq \Bbb{Z}$. However, I didn't really use the fact that $X \subseteq \Bbb{R}^2 - \{(0,0)\}$ in my proof, which makes me nervous. Does what I did sound right? Here's my proof of injectivity.

Let $\alpha$ be a loop $(0,1)$ such that $j_*([\alpha]) = [1_{(0,1)}]$ (note that $1_{(0,1)}$ is the constant loop about $(0,1)$, not the indicator function). Then $[j \circ \alpha] = [1_{(0,1)}]$ which implies there is some path homotopy $H : I \times I \to X$ such that $H(s,0) = j(\alpha (s)) = \alpha (s)$ and $H(s,1) = 1_{(0,1)}(s) = (0,1)$ for every $s \in I$; and $H(0,t) = (0,1) = H(1,t)$ for every $t \in I$. But these are points in $S^1$, so the codomain of $H$ can be restricted and this gives a path homotopy between $\alpha$ and $1_{(0,1)}$ itself.

...As I'm typing this up, I now see the issue. The "boundaries" of the map lie in $S^1$, but there is no guarantee that what is happening "in between" stays in $S^1$...I think I could use a hint at this point. The fact that we are subtracting an interior point of $S^1$ from $\Bbb{R}^2$ should play some role.

REPLY [2 votes]: Hint: there is $r: \mathbb{R}^2\setminus\{0\} \to S^1$ such that $S^1\to \mathbb{R}^2\setminus\{0\}\to S^1$ is the identity on $S^1$; and $S^1\to X\to \mathbb{R}^2\setminus \{0\} = S^1\to X\to \mathbb{R}^2\setminus\{0\}$


TITLE: Covering $X^2$ with countable subsets of $X$ for uncountable set $X$
QUESTION [3 upvotes]: Let $X$ be an uncountable set and consider a map $x\mapsto C_x$ assigning to every $x\in X$ a countable subset $C_x$ of $X$. Now for any $x\in X$ define $$R_x:=\{x'\in X|x\in C_{x'}\}.$$
Obviously $R_x$ can be any subset of $X$. It is also clear that $R_x=X$ can hold for at most countably many $x$. But what happens if $R_x$ is just a bit smaller than $X$? Specifically, is it possible that $R_x$ is co-countable for all $x$?
My intuition says NO. It is based on the following picture. For each $x$ $C_x$ can be taken to define a column in $X^2$: $$C_x':=\{(x,y)\in X^2|y\in C_x\}.$$ The union of all these columns defines a very "sparse" subset of $X^2$. The union can also be written as the union of all rows. If these rows would all be co-countable, the set doesn't look that "sparse" anymore. However, making this precise by turning $X^2$ into a measure space doesn't seem the way to go as the sets $C_x$ can be very wild.

REPLY [2 votes]: Let $X$ be the set of countable ordinals, and let $C_x=\{w\in X\mid w \le x\}$.

Then for all $x\in X,\;C_x$ is countable, but $R_x$ is co-countable.