\subsection{Finitely generated and Noetherian modules}

\begin{definition}[Generated submodule]
    Let $R$ be a ring, $M$ an $R$-module, $S \subseteq M$.
    Then the following sets coincide
    \begin{enumerate}
        \item
              $\left\{ \sum_{s \in S'} r_{s} \cdot s ~ |~ S \subseteq S' \text{finite}, r_s \in R, \right\}$,
        \item
              $\bigcap_{\substack{S \subseteq N \subseteq M\\N \text{submodule}}} N$,
        \item
              The $\subseteq$-smallest submodule of $M$ containing $S$.
    \end{enumerate}

    This subset of $N \subseteq M$ is called the
    \vocab[Module!Submodule]{submodule of $M $ generated by $S$}.
    If $N= M$ we say that
    \vocab[Module!generated by subset $S$]{$ M$ is generated by $S$}.
    $M$ is finitely generated
    $:\iff \exists S \subseteq M$ finite such that $M$ is generated by $S$.
\end{definition}

\begin{definition}[Noetherian $R$-module]
    $M$ is a \vocab{Noetherian}  $R$-module
    if the following equivalent conditions hold:
    \begin{enumerate}
        \item
              Every submodule  $N \subseteq M$ is finitely generated.
        \item
              Every sequence $N_0 \subset N_1 \subset \ldots$ of submodules terminates.
        \item
              Every set $\mathfrak{M} \neq \emptyset$ of submodules of $M$ has a
              $\subseteq$-largest element.
    \end{enumerate}
\end{definition}
\begin{proposition}[Hilbert's Basissatz]
    \label{basissatz}
    If $R$ is a Noetherian ring,
    then the polynomial rings $R[X_1,\ldots, X_n]$
    in finitely many variables are Noetherian.
\end{proposition}
\subsubsection{Properties of finite generation and Noetherianness}

\begin{fact}[Properties of Noetherian modules]
    \begin{enumerate}
        \item
              Every Noetherian module over an arbitrary ring is finitely generated.
        \item
              If $R$ is a Noetherian ring, then an $R$-module is Noetherian iff it is
              finitely generated.
        \item
              Every submodule of a Noetherian module is Noetherian.
    \end{enumerate}
\end{fact}
\begin{proof}

    \begin{enumerate}
        \item
              By definition, $M$ is a submodule of itself.
              Thus it is finitely generated.
        \item
              Since $M$ is finitely generated,
              there exists a surjective homomorphism $R^n \to M$.
              As $R$ is Noetherian, $R^n$ is Noethrian as well.
        \item
              trivial
    \end{enumerate}
\end{proof}

\begin{fact}
    Let $M, M', M''$ be $R$-modules.
    \begin{enumerate}
        \item
              Suppose $M \xrightarrow{p} M''$ is surjective.
              If $M$ is finitely generated (resp.  Noetherian),
              then so is $M''$.
        \item
              Let  $M' \xrightarrow{f} M \xrightarrow{p} M'' \to 0$ be exact.
              If $M'$ and $M ''$ are finitely generated (reps.  Noetherian),
              so is $M$.
    \end{enumerate}
\end{fact}
\begin{proof}
    \begin{enumerate}
        \item
              Consider a sequence $M_0'' \subset M_1'' \subset \ldots \subset M''$.
              Then $p^{-1} M_i''$ yields a strictly ascending sequence.
              If $M$ is generated by $S,
              |S| < \omega$, then $M''$ is generated by $p(S)$.
        \item
              Because of 1.~we can replace $M'$ by $f(M')$
              and assume $0 \to M' \xrightarrow{f} M \xrightarrow{p} M'' \to 0$
              to be exact.
              The fact about finite generation follows from
              Einführung in die Algebra.

              If  $M', M''$ are Noetherian, $N \subseteq M$ a submodule,
              then $N' \coloneqq f^{-1}(N)$ and $N''\coloneqq p(N)$
              are finitely generated.
              Since $0 \to N' \to  N \to  N'' \to  0$ is exact,
              $N$ is finitely generated.
    \end{enumerate}
\end{proof}
\subsection{Ring extensions of finite type}

\begin{definition}[$R$-algebra]
    Let $R$ be a ring.
    An $R$-algebra $(A, \alpha)$ is a ring $A$
    with a ring homomorphism $R \xrightarrow{\alpha} A$.
    $\alpha$ will usually be omitted.
    In general  $\alpha$ is not assumed to be injective.
    \\
    \\
    An $R$-subalgebra is a subring $\alpha(R) \subseteq A' \subseteq A$.\\
    A morphism of $R$-algebras $A \xrightarrow{f} \tilde{A}$ is
    a ring homomorphism with $\tilde{\alpha} = f \alpha$.
\end{definition}

\begin{definition}[Generated (sub)algebra, algebra of finite type]
    Let $(A, \alpha)$ be an $R$-algebra.
    \begin{align*}
        \alpha: R[X_1,\ldots,X_m] & \longrightarrow A[X_1,\ldots,X_m]\\
        P = \sum_{\beta \in \N^m} p_\beta X^{\beta}
            & \longmapsto \sum_{\beta \in \N^m}  \alpha(p_\beta) X^{\beta}
    \end{align*}
    is a ring homomorphism.
    We will sometimes write $P(a_1,\ldots,a_m)$ instead of
    $(\alpha(P))(a_1,\ldots,a_m)$.

    Fix $a_1,\ldots,a_m \in A^m$.
    Then we get a ring homomorphism $R[X_1,\ldots,X_m] \to A$.
    The image of this ring homomorphism is the  $R$-subalgebra of $A$
    \vocab[Algebra!generated subalgebra]{generated by the $a_i$}.
    $A$ is \vocab[Algebra!of finite type]{of finite type}
    if it can be generated by finitely many $a_i \in I$.

    For arbitrary $S \subseteq A$ the subalgebra generated by $S$ is the
    intersection of all subalgebras containing $S$ \\
    $=$ the union of subalgebras generated by finite  $S' \subseteq S$\\
    $= $ the image of $R[X_s | s \in S]$ under $P \mapsto (\alpha(P))(S)$.
\end{definition}
\subsection{Finite ring extensions} % LECTURE 2
\begin{definition}[Finite ring extension]
    Let $R$ be a ring and $A$ an $R$-algebra.
    $A$ is a module over itself and the ringhomomorphism $R \to  A$
    allows us to derive an $R$-module structure on $A$.
    $A$ \vocab[Algebra!finite over]{is finite over} $R$	/
    the $R$-algebra $A$ is finite / $A / R$ is finite
    if $A$ is finitely generated as an $R$-module.
\end{definition}
\begin{fact}[Basic properties of finiteness]
    \begin{enumerate}[A]
        \item
              Every ring is finite over itself.
        \item
              A field extension is finite as a ring extension
              iff it is finite as a field extension.
        \item
              $A$ finite $\implies$ $A$ of finite type.
        \item
              $A / R$ and $B / A$ finite $\implies$ $B / R$ finite.
    \end{enumerate}
\end{fact}
\begin{proof}
    \begin{enumerate}[A]
        \item
              $1$ generates $R$ as a module
        \item
              trivial
        \item
              Let $A $ be generated by $a_1,\ldots,a_n$ as an $R$-module.
              Then $A$ is generated by $a_1,\ldots,a_n$ as an $R$-algebra.
        \item
              Let $A$ be generated by $a_1,\ldots,a_m$ as an $R$-module
              and $B$ by $b_1,\ldots,b_n$ as an $A$-module.
              For every $b$ there exist $\alpha_j  \in A$
              such that $b = \sum_{j=1}^{n} \alpha_j b_j$.
              We have $\alpha_j = \sum_{i=1}^{m} \rho_{ij} a_i$
              for some $\rho_{ij} \in R$
              thus $b = \sum_{i=1}^{m} \sum_{j=1}^{n} \rho_{ij} a_i b_j$
              and the  $a_ib_j$ generate $B$ as an $R$-module.
    \end{enumerate}

\end{proof}

\subsection{Determinants and Caley-Hamilton} %LECTURE 2 TODO: move to int. elements?
This generalizes some facts about matrices to matrices with elements from
commutative rings with $1$.
\footnote{Most of this even works in commutative rings without $ 1$,
    since $1$ simply can be adjoined.}
\begin{definition}[Determinant]
    Let $A = (a_{ij}) \in \Mat(n,n,R)$.
    We define the determinant by the Leibniz formula
    \[
        \det(A) \coloneqq \sum_{\pi \in S_n} \sgn(\pi) \prod_{i=1}^{n} a_{i, \pi(i)}.
    \]

    Define $\text{Adj}(A)$ by $\text{Adj}(A)^{T}_{ij} \coloneqq (-1)^{i+j} \cdot M_{ij}$,
    where $M_{ij}$ is the determinant of the matrix resulting from $A$
    after deleting the $i^{\text{th}}$ row and the $j^{\text{th}}$ column.
\end{definition}
\begin{fact}
    \begin{enumerate}
        \item
              $\det(AB) = \det(A)\det(B)$.
        \item
              Development along a row or column works.
        \item
              Cramer's rule:
              $A \cdot \text{Adj}(A) = \text{Adj}(A) \cdot A = \det(A) \cdot \mathbf{1}_n$.
              $A$ is invertible iff $\det(A)$ is a unit.
        \item
              Caley-Hamilton:
              If $P_A = \det(T \cdot \mathbf{1}_n - A)$%
              \footnote{$T \cdot \mathbf{1}_n -A \in  \Mat(n,n,A[T])$},
              then $P_A(A) = 0$.
    \end{enumerate}
\end{fact}
\begin{proof}
    All rules hold for the image of a matrix under a ring homomorphism if they hold
    for the original matrix.
    The converse holds in the case of injective ring homomorphisms.
    Caley-Hamilton was shown for algebraically closed fields in LA2 using the
    Jordan normal form.
    Fields can be embedded into their algebraic closure,
    thus Caley-Hamilton holds for fields.
    Every domain can be embedded in its field of quotients $\implies$
    Caley-Hamilton holds for domains.

    In general, $A$ is the image of $(X_{i,j})_{i,j = 1}^{n} \in \Mat(n,n,S)$
    where $S \coloneqq \Z[X_{i,j} | 1 \le i, j \le n]$ (this is a domain)
    under the morphism $S \to A$ of evaluation defined by
    $X_{i,j} \mapsto a_{i,j}$.
    Thus Caley-Hamilton holds in general.
\end{proof}

\subsection{Integral elements and integral ring extensions} %LECTURE 2
\begin{proposition}[on integral elements]
    \label{propinte}
    Let $A$ be an $R$-algebra, $a \in A$.
    Then the following are equivalent:
    \begin{enumerate}[A]
        \item
              $\exists n \in \N, (r_i)_{i=0}^{n-1}, r_i \in R: a^n = \sum_{i=0}^{n-1} r_i a^i$.
        \item
              There exists a subalgebra  $B \subseteq A$ finite over $R$ and containing $a$.
    \end{enumerate}
    If $a_1, \ldots, a_k \in A$ satisfy these conditions,
    there is a  subalgebra of $A$ finite over $R$ and containing all $a_i$.
\end{proposition}
\begin{definition}
    \label{intclosure}
    Elements that satisfy the conditions from \ref{propinte} are called
    \vocab{integral over} $R$.
    $A / R$ is \vocab[Algebra!integral]{integral},
    if all $a \in A$ are integral over $R$.
    The set of elements of	$A$ integral over $R$ is called the
    \vocab{integral closure} of $R$ in $A$.
\end{definition}
\begin{proof}
    \hskip 10pt
    \begin{enumerate}
        {\color{gray} \item[B $\implies$ A]
            Let $a \in A$ such that there is a subalgebra $B \subseteq A$ containing $a$
            and finite over $R$.
            Let $(b_i)_{i=1}^{n}$ generate $B$ as an $R$-module.
            \begin{align*}
                q: R^n      & \longrightarrow B\\
                (r_1,\ldots,r_n) & \longmapsto \sum_{i=1}^{n} r_i b_i
            \end{align*}
            is surjective.
            Thus there are $\rho_{i} = \left(r_{i,j}\right)_{j=1}^n \in R^n$
            such that $a b_i = q(\rho_i)$.
            Let $\mathfrak{A}$ be the matrix with the $\rho_i$ as columns.
            Then for all $v \in R^n: q(\mathfrak{A} \cdot v) = a \cdot  q(v)$.
            By induction it follows that
            $q(P(\mathfrak{A}) \cdot v) = P(a)q(v)$ for all $P \in R[T]$.
            Applying this to $P(T) = \det(T\cdot \mathbf{1}_n - \mathfrak{A})$
            and using Caley-Hamilton,
            we obtain $P(a) \cdot q(v) = 0$.  $P$ is monic.
            Since $q$ is surjective, we find $v \in R^{n} : q(v) = 1$.
            Thus $P(a) = 0$  and $a$ satisfies A.}
        \item[B $\implies$ A]
            if $R$ is Noetherian.\footnote{This suffices in the exam.}
            Let $a \in A$ satisfy B.
            Let $B$ be a subalgebra of $A$ containing $b$ and finite over $R$.
            Let $M_n \subseteq B$  be the $R$-submodule generated by the $a^i$
            with $0 \le i < n$.
            As a finitely generated module over the Noetherian ring $R$,
            $B$ is a Noetherian $R$-module.
            Thus the ascending sequence $M_n$ stabilizes at some step $d$
            and $a^d \in M_d$.
            Thus there are $(r_i)_{i=0}^{d-1} \in  R^d$
            such that $a^d = \sum_{i=0}^{d-1} r_ia^i$.
        \item[A $\implies$ B]
            Let $a = (a_i)_{i=1}^n$ where all $a_i$ satisfy A,
            i.e.~$a_i^{d_i} = \sum_{j=0}^{d_i -  1} r_{i,j}a_i^j$
            with $r_{i,j} \in R$.
            Let $B \subseteq A$ be the sub-$R$-module generated by
            $a^\alpha = \prod_{i=1}^n a_i^{\alpha_i}$
            with $0 \le  \alpha_i < d_i$.
            $B$ is closed under $a_1 \cdot $ since
            \[
                a_1a^{\alpha} =
                \begin{cases}
                    a^{(\alpha_1 + 1, \alpha')}                     & \text{if } \alpha = (\alpha_1, \alpha'), 0 \le \alpha_1 < d_1 - 1, \\
                    \sum_{j=0}^{d_1 - 1} r_{i_1,j} a^{(j, \alpha')} & \text{if } \alpha_1 = d_1 - 1.
                \end{cases}
            \]
            By symmetry, this hold for all $a_i$.
            By induction on $|\alpha| = \sum_{i=1}^{n} \alpha_i$,
            $B$ is invariant under $a^{\alpha}\cdot $.
            Since these generate $B$ as an $R$-module,
            $B$ is multiplicatively closed.
            Thus A holds.
            Furthermore we have shown the final assertion of the proposition.
    \end{enumerate}
\end{proof}
\begin{corollary}
    \label{cintclosure}
    \begin{enumerate}
        \item[Q]
            Every finite $R$-algebra $A$ is integral.
        \item[R]
            The integral closure of $R$ in $A$ is an $R$-subalgebra of $A$.
        \item[S]
            If $A$ is an $R$-algebra,
            $B$ an $A$-algebra and $b \in B$ integral over $R$,
            then it is integral over $A$.
        \item[T]
            If $A$ is an integral $R$-algebra and $B$ any $A$-algebra,
            $b \in B$ integral over $A$,
            then $b$ is integral over  $R$.
    \end{enumerate}
\end{corollary}
\begin{proof}
    \begin{enumerate}
        \item[Q]
            Put $ B = A $ in B.
        \item[R]
            For every $r \in R$ $\alpha(r)$ is a solution to $T - r = 0$,
            hence integral over  $R$.
            From B it follows,
            that the integral closure is closed under ring operations.
        \item[S]
            trivial
        \item[T]
            Let $b \in B$ such that $b^n = \sum_{i=0}^{n-1} a_ib^{i}$.
            Then there is a subalgebra $\tilde{A} \subseteq A$ finite over $R$,
            such that all $a_i \in \tilde{A}$.
            $b$ is integral over $\tilde{A}$
            Hence $\exists \tilde{B} \subseteq B$ finite over $\tilde{A}$ and $b \in \tilde{B}$.
            Since  $\tilde{B} / \tilde{A} $ and $\tilde{A} / R$ are finite,
            $\tilde{B} / R$ is finite and $b$ satisfies B.
    \end{enumerate}
\end{proof}

\subsection{Finiteness, finite generation and integrality}
% some more remarks on finiteness, finite generation and integrality

\begin{fact}[Finite type and integral $\implies$ finite]
    \label{ftaiimplf}
    If $A$ is an integral $R$-algebra of finite type,
    then it is a finite $R$-algebra.
\end{fact}
\begin{proof}
    Let $A $ be generated by $\left( a_i \right)_{i=1}^{n}$ as an $R$-algebra.
    By the proposition on integral elements (\ref{propinte}),
    there is a finite $R$-algebra $B \subseteq A$ such that all $a_i \in B$.
    We have $B = A$, as $A$ is generated by the $a_i$ as an $R$-algebra.
\end{proof}
\begin{fact}[Finite type in tower]
    If $A$ is an $R$-algebra of finite type and $B$ an $A$-algebra
    of finite type, then $B$ is an $R$-algebra of finite type.
\end{fact}
\begin{proof}
    If $A / R$ is generated by $(a_i)_{i=1}^m$ and $B / A$ by $(b_j)_{j=1}^{n}$,
    then $B /R$ is generated by the $b_j$ and the images of the $a_i$ in $B$.
\end{proof}
{
    \color{red}
    \begin{fact}[About integrality and fields]
        \label{fintaf}
        Let $B$ be a domain integral over its subring $A$.
        Then $B$ is a field iff $A$ is a field.
    \end{fact}
}
\begin{proof}
    Let $B$ be a field and $a \in A \setminus \{0\} $.
    Then $a^{-1} \in  B$ is integral over $A$,
    hence $a^{-d} = \sum_{i=0}^{d-1} \alpha_i a^{-i}$
    for some $\alpha_i \in A$.
    Multiplication by $a^{d-1}$ yields
    $a^{-1} = \sum_{i=0}^{d-1} \alpha_i a^{d-1-i} \in A$.

    On the other hand, let $B$ be integral over the field $A$.
    Let $b \in  B \setminus \{0\}$.
    As $B$ is integral over $A$,
    there is a sub-$A$-algebra $\tilde{B} \subseteq B$,
    $b \in \tilde{B}$ finitely generated as an $A$-module,
    i.e.~a finite-dimensional $A$-vector space.
    Since $B$ is a domain,
    $\tilde{B} \xrightarrow{b\cdot } \tilde{B}$
    is injective,
    hence surjective,
    thus $\exists x \in \tilde{B} : b \cdot  x \cdot 1$.
\end{proof}
\subsection{Noether normalization theorem}
\begin{lemma}
    \label{nntechlemma}
    Let $S \subseteq \N^n$ be finite.
    Then there exists $\vec k \in  \N^n$ such that $k_1 =1$
    and $w_{\vec k}(\alpha) \neq w_{\vec k}(\beta)$
    for $\alpha \neq \beta \in S$,
    where $w_{\vec k}(\alpha) = \sum_{i=1}^{n} k_i \alpha_i$.
\end{lemma}
\begin{proof}
    Intuitive:
    For $\alpha \neq \beta$ the equation
    $w_{(1, \vec \kappa)}(\alpha) = w_{(1, \vec \kappa)}(\beta)$
    ($\kappa \in  \R^{n-1}$) defines a codimension $1$
    affine hyperplane in $\R^{n-1}$.
    It is possible to choose $\kappa$ such that all $\kappa_i$ are
    $> \frac{1}{2}$
    and with Euclidean distance $> \frac{\sqrt{n-1} }{2}$
    from the union of these hyperplanes.
    By choosing the closest $\kappa'$ with integral coordinates,
    each coordinate will be disturbed by at most $\frac{1}{2}$,
    thus at Euclidean distance $\le \frac{\sqrt{n-1} }{2}$.

    More formally:\footnote{The intuitive version suffices in the exam.}
    Define $M \coloneqq \max \{\alpha_i | \alpha \in S, 1 \le  i \le  n\}$.
    We can choose $k$ such that $k_i > (i-1) M k_{i-1}$.
    Suppose $\alpha \neq \beta$.
    Let $i$ be the maximal index such that $\alpha_i \neq  \beta_i$.
    Then the contributions of $\alpha_j$
    (resp.~$\beta_j$)
    with $1 \le j < i$ to $w_{\vec k}(\alpha)$
    (resp. $w_{\vec k}(\beta)$)
    cannot undo the difference $k_i(\alpha_i - \beta_i)$.
\end{proof}

\begin{theorem}[Noether normalization]
    \label{noenort}
    Let $K$ be a field and $A$ a $K$-algebra of finite type.
    Then there are $a = (a_i)_{i=1}^{n} \in A$ which
    are algebraically independent over $K$,
    i.e.~the ring homomorphism
    \begin{align*}
        \ev_a: K[X_1,\ldots,X_n] & \longrightarrow A\\
        P & \longmapsto P(a_1,\ldots,a_n)
    \end{align*}
    is injective.
    $n$ and the $a_i$ can be chosen such that $A$ is finite over the image of
    $\ev_a$.
\end{theorem}
\begin{proof}
    Let $(a_i)_{i=1}^n$ be a minimal number of elements
    such that $A$ is integral over its $K$-subalgebra
    generated by $a_1, \ldots, a_n$.
    (Such $a_i$ exist, since $A$ is of finite type).
    Let $\tilde{A}$ be the $K$-subalgebra generated by the $a_i$.
    If suffices to show that the $a_i$ are algebraically independent.
    Since $A$ is of finite type  over $K$ and thus over $\tilde{A}$,
    by fact \ref{ftaiimplf} (integral and finite type $\implies$ finite),
    $A$ is finite over $\tilde{A}$.
    Thus we only need to show that the  $a_i$ are algebraically independent
    over $K$.
    Assume there is $P \in K[X_1,\ldots,X_n] \setminus \{0\}$
    such that $P(a_1,\ldots,a_n) = 0$.
    Let $P = \sum_{\alpha \in \N^n} p_\alpha X^{\alpha}$ and
    $S = \{ \alpha \in \N^n | p_\alpha \neq 0\}$.
    For $\vec{k} = (k_i)_{i=1}^{n} \in \N^n$ and $\alpha \in \N^n$ we define
    $w_{\vec{k}}(\alpha) \coloneqq \sum_{i=1}^{n} k_i\alpha_i$.

    By \ref{nntechlemma} it is possible to choose $\vec{k} \in \N^n$
    such that $k_1 = 1$ and for $\alpha \neq  \beta \in S$ we have
    $w_{\vec{k}}(\alpha) \neq w_{\vec{k}}(\beta)$.

    Define $b_i \coloneqq a_{i+1} - a^{k_{i+1}}_1$ for $1 \le  i < n$.
    \begin{claim}
        $A$ is integral over the subalgebra $B$ generated by the $b_i$.
    \end{claim}
    \begin{subproof}
        By the transitivity of integrality,
        it is sufficient to show that the $a_i$ are integral over $B$.
        For $i > 1$ we have $a_i = b_{i-1} + a_1^{k_i}$.
        Thus it suffices to show this for $a_1$.
        Define
        $Q(T) \coloneqq P(T, b_1 + T^{k_2}, \ldots,
          b_{n-1} + T^{k_n}) \in B[T]$.
        We have $0 = P(a_1,\ldots, a_n) = Q(a_1)$.
        Hence it suffices to show that the leading coefficient of $Q$ is a unit.

        We have
        \[
            T^{\alpha_1} \prod_{i=1}^{n-1} (b_i + T^{k_i + 1})^{\alpha_{i+1}} =
            T^{w_{\vec k}(\alpha)} +
                \sum_{l = 0}^{w_{\vec k}(\alpha) - 1} \beta_{\alpha, l} T^l
        \]
        with suitable $\beta_{\alpha, l} \in B$.

        By the choice of $\vec k$, we have
        \[
            Q(T) = p_{\alpha} T^{w_{\vec k}(\alpha)}
            + \sum_{j=0}^{w_{\vec k}(\alpha) - 1} q_j T^j
        \]
        with $q_j \in B$ and
        $\alpha$ such that $w_{\vec k}(\alpha)$ is maximal subject
        to the condition $p_\alpha \neq 0$.
        Thus the leading coefficient of $Q$ is a unit.
    \end{subproof}

    This contradicts the minimality of $n$, as $B$ can be generated by $< n$
    elements $b_i$.
\end{proof}
