\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\PassOptionsToPackage{usenames,dvipsnames}{xcolor}
\usepackage{tcolorbox}
\usepackage{amssymb}
\tcbuselibrary{theorems}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{pgf,tikz,pgfplots}
\usepackage{mathrsfs}
\usepackage[symbol]{footmisc}
\usepackage{tikz-cd}
\usepackage{xfrac}

\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\DeclareMathOperator{\lcm}{lcm}
\DeclareMathOperator{\pmmp}{pmmp}
\DeclareMathOperator{\shmvp}{shmvp}
\theoremstyle{definition}
\newtheorem{myth}{Teorem\"{e}}
\newtheorem{myd}[myth]{Definition}
\newtheorem{myp}[myth]{Problem}
\newcommand{\ord}[2]{\text{ord}_{#1}(#2)}
\newcommand{\cho}[2]{{#1 \choose #2}}
\newcommand{\Hom}{\text{Hom}}
\newcommand{\Image}{\text{Im}}
\newcommand{\modd}{\text{-mod}}
\newcommand\restr[2]{{% we make the whole thing an ordinary symbol
  \left.\kern-\nulldelimiterspace % automatically resize the bar with \right
  #1 % the function
  \littletaller % pretend it's a little taller at normal size
  \right|_{#2} % this is the delimiter
  }}

\newcommand{\littletaller}{\mathchoice{\vphantom{\big|}}{}{}{}}

%%%%%%% Problem Environment  %%%%%%%%%%%%%%%%%
\newtheoremstyle{problemstyle}  % <name>
        {10pt}                                               % <space above>
        {10pt}                                               % <space below>
        {\normalfont}                               % <body font>
        {}                                                  % <indent amount}
        {\normalfont\bfseries}                 % <theorem head font>
        {\normalfont\bfseries.}         % <punctuation after theorem head>
        {.5em}                                          % <space after theorem head>
        {}                                                  % <theorem head spec (can be left empty, meaning `normal')>
\theoremstyle{problemstyle}

\newtheorem{problem}{Problem}[section] % Comment out [section] to remove section number dependence

%%%%  Ushtrime Enviroment  %%%%%

\newtheorem{exercise}{Exercise} % Comment out [section] to remove section number dependence


%%%% Theorem Environment %%%%
\newtcbtheorem
  []% init options
  {theo}% name
  {Theorem}% title
  {%
    colback=BlueGreen!5,
    colframe=green!35!blue,
    fonttitle=\bfseries, before
skip=20pt,after skip=20pt 
  }% options
  {theo}% prefix

%%%% Proposition Environment %%%%
\newtcbtheorem
  [no counter]% init options
  {proposition}% name
  {Proposition}% title
  {%
    colback=RedOrange!5,
    colframe=RedOrange!85!Orange,
    fonttitle=\bfseries, before
skip=20pt,after skip=20pt 
  }% options
  {proposition}% prefix

%%%% Corollary Environment %%%%
\newtcbtheorem
  [no counter]% init options
  {corollary}% name
  {Corollary}% title
  {%
    colback=Plum!10,
    colframe=Plum!95!Black,
    fonttitle=\bfseries, before
skip=20pt plus 2pt,after skip=20pt plus 2pt
  }% options
  {corollary}% prefix
%%%% Remark Environment %%%%
\newtcbtheorem
  [no counter]% init options
  {remark}% name
  {Remark}% title
  {%
    colback=OrangeRed!10,
    colframe=OrangeRed!95!Black,
    fonttitle=\bfseries, before
skip=20pt plus 2pt,after skip=20pt plus 2pt
  }% options
  {remark}% prefix  
%%%% Lemma Environment %%%%
\newtcbtheorem
  [no counter]% init options
  {lemma}% name
  {\textcolor{darkgray}{Lemma}}% title
  {%
    colback=Goldenrod!10,
    colframe=Goldenrod!95!White,
    fonttitle=\bfseries, before
skip=20pt plus 2pt,after skip=20pt plus 2pt
  }% options
  {lemma}% prefix  

%%%%%  SOLUTION ENVIRONMENT %%%%%
\newenvironment{solution}{\renewcommand{\proofname}{Solution}\begin{proof}}{\end{proof}}
%%%%
\setlength\parindent{0pt}
\title{Math 380 - Class Notes}
\author{Leart Ajvazaj}
\date{September 2022}
\begin{document}
\maketitle
\section*{Lecture 1}
What is this course about?
\begin{itemize}
    \item Commutative Algebra
    \item Category Theory (homological algebra)
    \item Possible Applications
\end{itemize}
The first new thing we'll encounter is the notion of "modules."
\\
\textit{Question:} What is a module?
In linear algebra we have studied vector spaces. If $k$ is a field, then a $k$-vector space $V$ can be expressed as $V\simeq k^I.$ Note that to do this we need to pick a basis of $V.$\\
How do we think about a $k$-vector space "intrinsically"? (without needing to pick a basis). Roughly speaking:
\begin{itemize}
    \item A $k$-vector space $V$ is an abelian group $V$ with an action of $K$ on $V$: $K\times V\to V$ satisfying certain distributive properties.
    \item Modules are analogous to vector spaces when instead of a field $k$ we have a commutative ring $A.$
\end{itemize}
Examples: 
\begin{itemize}
    \item $A=k$ a field. Then $\{A\text{-modules}\}=\{k\text{-vector spaces}\}$
    \item $A=\mathbb{Z}, M=p\mathbb{Z}$ with $\mathbb{Z}\times M\to M$ via $(m,ap)\mapsto ma\cdot p.$
\end{itemize}
\subsection*{Highlights of this Course}
\subsubsection*{\textcolor{RubineRed}{Noetherian Modules}}
They are going to be described in detail later.
Now we think of Noetherian modules using the following anology:
\textcolor{red}{Insert picture}
However the structure of Noetherian $A$-modules is much more complicated than finite dimensional $k$-vector spaces.\\
Example:
\begin{itemize}
    \item It is clear that for a finite dimensional $k$-vector space $V,$ a sub $k$-vector space $W\subset V$ is also finite dimensional.
    \item Take $A=k[x_1,x_2,...,x_]$ then the ideal $I=(x_1,x_2,...)\subseteq A$ is \textcolor{red}{not} "finitely generated" over $A.$
\end{itemize}
Remark: We will prove the \textcolor{ProcessBlue}{Hilbert Basis Theorem } which tells us that if we have only finitely many variables  $A[x_1,x_2,...,x_n]$ then we're good.
\subsubsection*{\textcolor{RubineRed}{Hidden Algebraic Geometry}}
Algebraic geometry is the study of spaces given by zeros of polynomial equations.
Its connection to commutative algebra is two-fold:
\begin{itemize}
    \item Commutative algebra is the standard tool for treating algebraic geometry.
    \item Algebraic geometry provides many interesting examples in commutative algebra.
\end{itemize}
\textit{Question:} How to produce interesting examples of commutative rings?
\begin{itemize}
    \item[a)] From algebra and arithmetic: $\mathbb{Q},\mathbb{R},\mathbb{Z},\mathbb{Z}[\sqrt{-3}],\mathbb{Z}[x],\mathbb{F}_p,...$
    \item[b)] From Geometry!
\end{itemize}
Take $X$ to be a topological space/smooth manifold/complex manifold/algebraic variety then $\Gamma(x)=$ continuous/ $C^{\infty}$/holomorphic/algebraic functions on $X.$
Usually $\Gamma(x)$ is an interesting example of a commutative ring.\\
Moreover (modern point of view in AG) we can know a lot about $X$ by studying the ring of functions on $X.$ \textcolor{red}{SHTOJE FOTON}\\
\begin{theo}{}{}
Let $A$ be a Noetherian commutative ring and $M$ be a finitely generated $A$-module.
$M$ is a projective $A$-module if and only if $M$ is locally free.
\end{theo}
\section*{Lecture 2}
Important: In this course we only consider (unital) commutative rings!

A \textcolor{RubineRed}{\textbf{commutative ring}} denoted by $A$ is a set with binary operations $+:A\times A\to A$ and $\cdot:A\times A\to A$ such that 
\begin{itemize}
    \item[i)] $A$ is an abelian group with respect to "$+$"
    \item[ii)] $\cdot$ is commutative, $ab=ba;$ associative, $(ab)\cdot c=a\cdot(bc);$ distributive, $(a+b)\cdot c=ac+bc.$
\end{itemize}
 
 
\begin{itemize}
    \item $a\in A$ is a \textbf{\textcolor{RubineRed}{unit}} if it has an inverse under "$\cdot$"
    \item a \textbf{\textcolor{RubineRed}{field}} is a commutative ring where every nonzero element is a unit.
\end{itemize}
Examples of fields:
$$\mathbb{Q},\mathbb{R},\mathbb{C},\mathbb{F}_p,\mathbb{Q}[\sqrt{2}]$$
Examples of commutative rings (that are not fields):
$$\mathbb{Z},\mathbb{Z}[\sqrt{2},\sqrt{3}],\mathbb{Z}[x,y,z]$$
\subsection*{Products, Subrings, and Homomorphisms}
\section*{Lecture 4}
\subsection*{Modules}
Throughout, let $A$ be a (unital, commutative) ring as before.
 
An \textbf{\textcolor{RubineRed}{A-module}} is an abelian group $M$ with a map $A\times M\to M$ such that $\forall a,b\in A,\; \forall m,n\in M$ we have:\\
Associativity: $(ab)m=a(bm)$\\
Distributivity: $(a+b)m=am+bm$, $a(m+n)=am+an$\\
Identity element: $1\cdot m=m\in M$
 
Examples:
\begin{itemize}
    \item  If $A=K$ is a field then $K$-modules are $K$-vector spaces.
    \item If $A=\mathbb{Z}$ then $\mathbb{Z}$-modules are abelian groups.
\end{itemize}
\textit{Question:}If $A=k[x]$ is a polynomial ring over a field $k,$ what are $A-$modules?\\
\textit{Answer:} A $k[x]$-module is a $k$-vector space + a $k$-linear operator $\gamma:V\to V.$
\begin{lemma}{}{}
Let $\varphi:A\to B$ be a ring homomorphism. A $B$-module is naturally an $A$-module induced by $\varphi.$ 
\end{lemma}
\begin{proof}
If $M$ is a $B$-module, then $M$ is abelian and we have an action $*:B\times M\to M$ such that
\begin{center}
$(ab)*m=a*(b*m)$\\
$(a+b)*m=a*m+b*m$\\
$a*(m+n)=a*m+a*n$\\
$1*m=m$
\end{center}
Define an action $\star :A\times M\to M$ such that $a\star m=\varphi(a)*m$
then we have $$(ab)\star m=\varphi(ab)*m=\varphi(a)\varphi(b)*m=\varphi(a)*(b\star m)=a\star (b\star m)$$
and similarly by using properties of homomorphisms and the definition of the action $\star$ we get the other properties.
\end{proof}
\begin{corollary}{}{}
There is a natural bijection between $$\{k[x]\text{-modules}\}\longleftrightarrow \{k\text{-vector spaces + linear operator}\}$$
\end{corollary}
\begin{proof}
The main idea is the following (taken from https://tinyurl.com/3fz67x4k)
If $V$ is a $k$-vector space and $\gamma:V\to V$ is a linear operator we can define a $k[x]$-module structure via: $x*v=\gamma(v).$
\end{proof}
\section*{Lecture 5}
\textit{Question:} What are $k[x]/(x^2)$-modules?
\begin{lemma}{}{}
Let $A$ be a ring and $I\subset A$ an ideal.
An $A/I$-module is an $A$-module such that $I$ acts by $0.$
\end{lemma}
\begin{proof}
Let $M$ be an $A/I$-module.
Using the previous lemma we can view $M$ as an $A$ modula where $a*m=\pi(a)m$ where $\pi:A\to A/I$ is the projection map. Hence it is clear that $t\in I$ will act by $0$ as $\pi(t)=0+I.$\\
On the other hand if $M$ is an $A$-module and $I$ acts by $0$ we can define an action such that $(a+I)*m=am.$ 
\end{proof}
Remark: Using the lemma we have that a $k[x]/(x^2)$-module is a $k[x]$ module such that $x^2$ acts by $0$ thus it is a $k$-vector space $V$ with a linear operator $\gamma:V\to V$ such that $\gamma^2=0.$

\subsection*{Homomorphisms of Modules} 
 
Let $M,N$ be $A$-modules. 
A \textbf{\textcolor{RubineRed}{homomorphism}} (of $A$-modules) $f:M\to N$ is:
\begin{itemize}
    \item An abelian group homomorphism: $f(m_1+m_2)=f(m_1)+f(m_2)\;\;\forall m_1,m_2\in M$
    \item $A$-linear: $f(am)=af(m)\;\;\forall a\in A,\;\;\forall m\in M$
\end{itemize}
We denote by $\text{Hom}_A(M,N)$ the set of all ($A$-linear) homomorphisms from $M$ to $N.$
 
\begin{lemma}{}{}
$\text{Hom}_A(M,N)$ has a natural $A$-module structure.
\end{lemma}
\begin{proof}
Everything works as you would expect it to.\\
\underline{Addition}: $f,f'\in \text{Hom}_A(M,N)$ then $f+f':M\to N$ can be defined so that $m\mapsto f(m)+f'(m).$\\
\underline{Multiplication}: $[f:M\to N]\in \text{Hom}_A(M,N)$ such that $af:M\to N$ is taken as $m\mapsto af(m).$\\
We can check that these definitions satisfy the conditions.
\end{proof}
Examples: 
\begin{itemize}
    \item $A=k$, a field then $\text{Hom}_k(k^n,k^m)\simeq k^{nm}$ (the $k$-vector space given by $n\times m$ matrices)
\end{itemize}
\begin{proposition}{}{}
For any $A$-module, the $A$-module $\text{Hom}_A(A,M)$ is isomorphic to $M.$
\end{proposition} 
\begin{proof}
Define $\Phi:\text{Hom}_A(A,M)\to M$ such that $\Phi(f)=f(1).$
We claim that $\Phi$ is an isomorphism.
It's easy to show that it is a homomorphism.
Assume $\Phi(f)=\Phi(g)$ then $f(1)=g(1)\Rightarrow af(1)=ag(1)\Rightarrow f(a)=g(a).$
So $\Phi$ is injective.\\
To show surjectivity consider $\Phi(f)$ where $f:A\to M$ sends $a\to am$ therefore $\Phi(f)=m.$ 
\end{proof}
\subsection*{Some Constructions with Modules}
\begin{itemize}
    \item Direct sum, direct product
    \item submodules and quotient modules
\end{itemize}
 
Given a set $I$ and $A$-modules $M_i$ for $\forall i\in I$ we can construct the \textbf{\textcolor{RubineRed}{direct sum}} of $M_i$  $$\bigoplus_{i\in I} M_i :=\{(m_i)_{i\in I}|m_i\in M_i \text{ and only finitely many }m_i\neq0\}$$
We can also construct the \textbf{\textcolor{RubineRed}{direct product}} of $M_i$
$$\displaystyle\prod_{i\in I}M_i=\{(m_i)_{i\in I}|m_i\in I\}.$$
 
Note:
\begin{itemize}
    \item We always have $$\bigoplus_{i\in I}M_i\hookrightarrow \displaystyle\prod_{i\in I} M_i$$
    \item When $I$ is finite, these two $A$-modules are the same.
    \item For an $A$-module $M$ we will introduce submodules and quotient modules.
\end{itemize}
 
A \textbf{\textcolor{RubineRed}{submodule}} of an $A$-module $M$ is an abelian subgroup $N\subset M$ closed under the $A$-action, that is, $an\in N\subset M.$
 
Examples:
\begin{itemize}
    \item[(1)] $A$ viewed as a standard $A$-module then submodule of $A$ = ideal of $A.$
    \item[(2)] For a homomorphism $\varphi:M\to N$ of $A$-modules $\ker\varphi$ and $\text{Im}\varphi$ are submodules of $M$ and $N$, respectively.
\end{itemize}
\section*{Lecture 6}
More examples of submodules:
\begin{itemize}
    \item[(1)] For any ideal $I\subset A$ and submodule $N\subset M$ we can construct $$IN:=\{\displaystyle\sum_{i=1}^s a_in_i|a_i\in I, n_i\in N, s\in\mathbb{N}\}.$$
    This is a submodule of $M$.
    \item[(2)] $M_1,M_2\subset M$ are submodules $\Rightarrow M_1\cap M_2$ and $M_1+M_2=\{m_1+m_2|m_1\in M_1,\; m_2\in M_2\}$
\end{itemize}
 
If $N\subset M$ is a submodule (over the ring $A$, as usual) a \textbf{\textcolor{RubineRed}{quotient module}} is $M/N:=\{m+N|m\in M\}$ as an abelian group and $\pi:M\to M/N$ with $m\mapsto m+N$ is a homomorphism of abelian groups.
 
\begin{proposition}{}{}
\begin{itemize}
    \item[(a)] $M/N$ is naturally an $A$-module: $A\times M/N\to M/N$ via $(a,m+N)\mapsto am+N.$
    \item[(b)] (Universal Property) Let $f:M\to M'$ be any homomorphism between modules such that $N\subset \ker(f)$ then there exists a unique homomorphism $g:M/N\to M'$ with $f=g\circ \pi.$
\end{itemize}
\end{proposition}
The universal property is summarized by the following diagram\\
\begin{center}
\begin{tikzcd}
M \arrow[rr, "f(N)=0"] \arrow[rd, "\pi"', two heads] &                                        & M' \\
                                                     & M/N \arrow[ru, "\exists ! g"', dotted] &   
\end{tikzcd}
\end{center}
Examples:
\begin{itemize}
    \item $I\subset A$ is an ideal, $M$ is an $A$-module, then since $IM\subset M$ is a submodule we can consider the $A$-quotient module $M/IM.$ 
    We claim that $M/IM$ is an $(A/I)$-module induced by the $A$-module structure.
    \item As a special case: $A$-ring, $m$-maximal ideal ($\Rightarrow k=A/m$ is a vector space). 
    Then for any $A$-module $M,$ we obtain an $A/m$-module $M/mM.$
    Equivalently, $M/mM$ is a $k$-vector space.
\end{itemize}
This is a technique where we can reduce the study of modules to the study of vector spaces. 
This is very useful in algebraic geometry!
\subsection*{Isomorphisms}
\begin{itemize}
    \item For $f:M\to N$ an $A$-module homomorphism $$\Large\sfrac{M}{\ker f}\normalsize\simeq \text{Im}(f)$$
    \item $K\subset N\subset M$ submodules, we have $$\Large\sfrac{\sfrac{M}{K}}{\sfrac{N}{K}} \simeq M/N$$
    \item $M_1,M_2\subset M$ submodules, we have $$\Large\sfrac{M_1}{M_1\cap M_2}\simeq \sfrac{(M_1+M_2)}{M_2}$$
    \item $N\subset M$ submodule $\rightsquigarrow$ Quotient module $\Large\sfrac{M}{N}.$ 
    There are bijections between
    \begin{center}
        \{Submodules of $\Large\sfrac{M}{N}$\} $\overset{1:1}{\longleftrightarrow}$ \{ Submodules of $M$ that contain $N$\}
    \end{center}
\end{itemize}
\subsection*{Finitely Generated Modules}
We will consider 4 classes of modules with "finiteness" conditions.
\begin{itemize}
    \item Finitely generated modules
    \item Finitely generated free modules
    \item Noetherian modules
    \item Artinian modules
\end{itemize}
 
\begin{itemize}
    \item For some set $I$, we say that a collection of elements $m_i\in M (i\in I)$ are \textbf{\textcolor{RubineRed}{generators}} if $M=\{\displaystyle\sum_{i\in K\subset I} a_im_i| K \text{ a finite subset }a_i\in A\}.$\\ This says precisely that any element of $M$ is an $A$-linear combination of finite number of $m_i$'s.
    \item $M$ is \textbf{\textcolor{RubineRed}{finitely generated}} if $M$ is generated if $M$ is generated by finitely many elements.
\end{itemize}
 
\begin{lemma}{}{}
$M$ is finitely generated $\iff$ $M$ is a quotient module of $A^{\oplus k}$ for some $k\in \mathbb{N}.$
\end{lemma}
\begin{proof}$\empty$\\
"$\Rightarrow$"\\ Suppose $M$ is finitely generated. 
Therefore we have a set $\{m_1,m_2,...,m_n\}$ are generators of $M.$ 
Consider the surjection $\varphi:A^{\oplus n}\twoheadrightarrow M$ via $(a_1,a_2,...,a_n)\mapsto \displaystyle\sum_{i=1}^n a_im_i.$
So we have $\Large\sfrac{A^{\oplus n}}{\ker\varphi}\simeq M$ thus $M$ is a quotient module of $A^{\oplus}.$\\
"$\Leftarrow$"\\
Assume we have $\varphi:A^{\oplus k}\rightarrow M$ surjective, then we know that $m_i:=\varphi(0,0,...,0,\underset{i-th}{1},0,...)$ form generators.
\end{proof}
\subsection*{Free Modules}
 
\begin{itemize}
    \item $m_i\in M \;(i\in I)$ form a \textbf{\textcolor{RubineRed}{basis}} of $M$ if $\forall m\in M$ can uniquely be written as a finite $A$-linear combination of $m_i$'s.
    \item $M$ is called \textbf{\textcolor{RubineRed}{free}}, if it has a basis.
\end{itemize}
 
Examples:
\begin{itemize}
    \item $A=\mathbb{Z}, M=\mathbb{Z}^{\oplus 5}\oplus \Large\sfrac{\mathbb{Z}}{2\mathbb{Z}}\oplus \Large\sfrac{\mathbb{Z}}{4\mathbb{Z}}\oplus\Large\sfrac{\mathbb{Z}}{3\mathbb{Z}}.$
    Calculate $\Large\sfrac{M}{mM}$ when $m=(2),(3),(5),...$
    \begin{itemize}
        \item[$\circ$] $\Large\sfrac{M}{(2)M}\simeq \mathbb{F}_2^{\oplus 5}\oplus 1\oplus\mathbb{F}_2\oplus \mathbb{F}_3.$
        \item[$\circ$] $\Large\sfrac{M}{(3)M}\simeq \mathbb{F}_3^{\oplus 5}\oplus 1\oplus1\oplus \mathbb{F}_3.$
    \end{itemize}
    \item $(2)\subset \mathbb{Z}$ is a free $\mathbb{Z}$-module while $(2,x)\subset \mathbb{Z}[x]$ is not free.
    We clearly have that $m_1=2$ and $m_2=x$ form generators of $(2,x).$ 
    However they do not form a basis as $2x=x\cdot m_1=2m_2.$ 
\end{itemize}
\section*{Lecture 7}
\begin{proposition}{}{}
Every free module is isomorphic to $\mathbb{A}^{\oplus I}$ ($I$ is some set).
\end{proposition}
\begin{proof}$\empty$
\begin{itemize} 
    \item[(1)] Claim: $A^{\oplus I}$ is free.
    Choose $e_i=(0,0,...,0,\underset{i-th}{1},0,...,0)$ then they form a basis of $A^{\oplus I}.$
    \item[(2)] Assume $M$ is free.
    Then it has some basis $m_i \;\; i\in I.$ 
    So we construct $\varphi:A^{\oplus I}\to M$ such that $e_i\mapsto m_i$ which is injective (by uniqueness) and surjective (because $\{m_i\}$ is a basis).
\end{itemize}
\end{proof}
Remark: While thre proof above seems to implicitly assume that $I$ is countable, this is not the case. You can define basis vectors without the list notation.\\
Remark: Classifying finitely generated modules is very hard in general!
\begin{proposition}{}{}
If $M\simeq A^{\oplus k},\; k\in \mathbb{N}$ then every basis of $M$ has $k$ elements.
\end{proposition}
\begin{proof}
Suppose that $A^{\oplus k}\simeq A^{\oplus k'}.$
We need to show that $k=k'.$
Let $m$ be a maximal ideal of $A,$ then $\Large\sfrac{A^{\oplus k}}{m A^{\oplus k}}\simeq \sfrac{A^{\oplus k'}}{mA^{\oplus k'}}$ (draw a diagram to see this).
Using that $\Large\sfrac{A^{\oplus k}}{mA^{\oplus k}}\simeq (\sfrac{A}{m})^{\oplus k}$ we have that $(\Large\sfrac{A}{m})^{\oplus k}\simeq (\Large\sfrac{A}{m})^{\oplus k'}$ as vector spaces. 
Therefore $k=k'.$
\end{proof}
\subsection*{Noetherian Rings and Modules}
 
\begin{itemize}
    \item An $A$-module $M$ is \textbf{\textcolor{RubineRed}{Noetherian}} if $\forall$ submodule of $M$ is finitely generated.
    \item $A$ is a \textbf{\textcolor{RubineRed}{Noetherian ring}} if it is Noetherian as a module over itself.
    Equivalently, every ideal of $A$ is finitely generated.
\end{itemize}
 
Examples (Noetherian rings):
\begin{itemize}
    \item Fields are Noetherian.
    \item $\mathbb{Z}, k[x]$ are PID therefore Noetherian.
    \item $k[x_1,x_2,...]$ is \textcolor{red}{not} Noetherian.
    \item $k[x_1,...,x_n]$ is Noetherian.
\end{itemize}
\subsection*{Ascending Chain Condition}
We say that a module $M$ satisfies the ascending chain condition (ACC) if for any collection of submodules $\{N_i\}_{i\in\mathbb{N}}: \; N_1\subseteq N_2\subseteq N_3\subseteq...\subseteq M$ terminates.
That is, $\exists k>0$ such that $N_j=N_k\;\;\forall j>k.$
\begin{proposition}{}{}
$M$ is Noetherian if and only if $M$ satisfies the ACC.
\end{proposition}
\begin{proof}

\end{proof}
\subsection*{Hilbert Basis Theorem}
\begin{theo}{Hilbert Basis Theorem}{}
Let $A$ be a Noetherian ring, then $A[x]$ is Noetherian.
\end{theo}
\begin{proof}
Next time!
\end{proof}
Let's look at some corollaries of the Hilbert basis theorem before proving it.
\begin{corollary}{}{}
If $A$ is Noetherian, then $A[x_1,x_2,...,x_k]$ is Noetherian.
\end{corollary}
\begin{proof}
Induction.
\end{proof}
\begin{corollary}{}{}
If $A$ is a Noetherian ring, then any quotient ring of $A[x_1,x_2,...,x_n]$ is Noetherian. 
That is, $A[x_1,x_2,...,x_n]/I$ is Noetherian for any ideal $I$ of $A[x_1,x_2,...,x_n].$
\end{corollary}
\begin{proof}
Any ideal $J\subset A[x_1,...,x_n]/I$ corresponds to an ideal $\Tilde{J}\subset A[x_1,...,x_n]$ that contains $I.$
Since $J$ is Noetherian we have that it is finitely generated.
Say $g_1,...,g_s$ are its generators then we must have that $\pi(g_1),...,\pi(g_s)$ generate $J.$
\end{proof}
\section*{Lecture 8}
We finally prove the Hilbert Basis Theorem.
\begin{proof}
Let $I\subset A[x]$ be an ideal. 
We want to show that $I$ is finitely generated.
By way of contradiction, assume it is not.
We can construct a sequence of elements $f_1,f_2,...\in I$ as follows:
\begin{itemize}
    \item Choose $f_1\in I$ with minimal possible degree.
    \item $I$ is not finitely generated, therefore $I\setminus (f_1)\neq0.$ Hence we can choose $f_2\in I\setminus (f_1)$ with minimal possible degree.

        $$\vdots$$

    \item After we've constructed $f_1,f_2,...,f_k$ we know that $I\setminus(f_1,f_2,...,f_k)\neq 0.$
    So we can choose $f_{k+1}\in I\setminus(f_1,f_2,...,f_k)$ with minimal degree.
\end{itemize}
This process inductively constructs $f_1,f_2,...\in A[x].$
Now we shall look at the leading coefficients of $f_i:$
$$f_k=a_kx^{n_k}+\text{lower degree terms}.$$
By construction, $n_1\leq n_2\leq ...\leq n_k\leq...$
We set $I_k=(a_1,a_2,...,a_k)\subseteq A.$ 
Thus we have the ascending chain of ideals $I_1\subseteq I_2\subseteq I_3\subseteq...\subseteq A.$
Since $A$ is Noetherian we have that this chain terminates.
Hence $\exists m>0$ such that $a_{m+1}\in(a_1,a_2,...,a_m).$
Therefore $a_{m+1}=\displaystyle\sum_{i=1}^m b_ia_i\;(b_i\in A).$\\
\textbf{\textcolor{ProcessBlue}{Highlight:}} We consider 
\begin{equation*}
\begin{split}
    g_{m+1}&:=f_{m+1}-\displaystyle\sum_{i=1}^m b_i x^{n_{m+1}-n_i} f_i\\
    & =\underset{=0}{\underbrace{(a_{m+1}-\sum_{i=1}^m b_ia_i)}}x^{n_{m+1}}+\text{lower degree terms.}
\end{split}    
\end{equation*}
Note that since $f_1,f_2,...,f_{m+1}\in I$ and $g=f_{m+1}-(\text{linear combination of }f_i)$ we have that $g\not\in (f_1,f_2,...,f_m).$
Further $\deg(g)<\deg(f_{m+1})$ yet this contradicts the minimality assumption of $f_{m+1}$ hence completing the proof.
\end{proof}
\subsection*{Noetherian Modules}
\begin{proposition}{}{}
Let $A$ be a ring, $M$ is an $A$-module, $N\subset M$ is a submodule.
$M$ is Noetherian if and only if both $N$ and $M/N$ are Noetherian.
\end{proposition}
\begin{proof}
Pset 4
\end{proof}
\begin{theo}{}{}
Let $A$ be Noetherian. Any finitely generated $A$-module is Noetherian.
\end{theo}
\begin{proof}
We first show that $A^{\oplus 2}$ is a Noetherian $A$-module.
Consider the inclusion $A\hookrightarrow A^{\oplus 2}$ via $a\mapsto (a,0)$ whose quotient module is $A^{\oplus2}/A\simeq A.$
By the proposition above since $A$ is Noetherian, $A^{\oplus2}$ is Noetherian.
By induction, we have that $A^{\oplus k}$ is Noetherian. By the proposition in Lecture 6, a finitely generated module $M$ is a quotient of some $A^{\oplus k}.$ 
Hence $M$ is Noetherian.
\end{proof}
\subsection*{Artinian Module}
We have characterized the Noetherian condition by ACC.
What happens for DCC?
 
\begin{itemize}
    \item $M$ is an $A$-module. $A$ \textbf{\textcolor{RubineRed}{descending chain}} (DC) of submodules is $M\supset N_1\supset N_2\supset...$
    \item We say that $M$ satisfies the \textbf{\textcolor{RubineRed}{descending chain condition}} if any descending chain terminates; that is, for a DC $(N_i)_{i>0}$ there exists $k>0$ such that $N_i=N_k\;\forall i>k.$
    \item $M$ is an \textbf{\textcolor{RubineRed}{Artinian A-module}} if $M$ satisfies the DCC.
\end{itemize}
 
Examples:
\begin{itemize}
    \item $A=k,$ $M$ is Artinian if and only if it is finite dimensional.
    \item $A=\mathbb{Z}$ or $k[x],$ then $A$ is \textcolor{red}{not} an Artinian $A$-module!
\end{itemize}
Similar to the Noetherian case:
\begin{proposition}{}{}
$A$ is a ring, $M$ is an $A$-module, $N\subset M$ is submodule. $M$ is Artinian if and only if $N, M/N$ are Artinian.
\end{proposition}
\begin{proof}
Identical to the analog for the Noetherian case.
\end{proof}
 
A ring $A$ is \textbf{\textcolor{RubineRed}{Artinian}} if itself is an Artinian $A$-module.
 
Examples (Artinian rings):
\begin{itemize}
    \item Any field is Artinian
    \item $k$ is a field. We consider $k[x_1,x_2,...,x_n]/I$ the quotient ring.\\
    Claim: If $\dim_k(k[x_1,...,x_n]/I)<\infty$ then $A=k[x_1,...,x_n]/I$ is an Artinian ring
    \item $\mathbb{Z}$ is not an Artinian ring, but $\mathbb{Z}/n\mathbb{Z}$ for all $n>0$ is Artinian.
\end{itemize}
Remark: We know that Noetherian module $\not\Rightarrow$ Artinian module and Artinian module $\not\Rightarrow$ Noetherian module. 
However, we have the following result:
\begin{theo}{}{}
Every Artinian ring is a Noetherian ring.
\end{theo}
\section*{Lecture 9}
\subsection*{Noetherian and Artinian Modules}
We will achieve a classification of modules that satisfy both ACC and DCC.
 
Let $A$ be a ring and $M$ an $A$-module.
\begin{itemize}
    \item $M$ is \textbf{\textcolor{RubineRed}{simple}} if $\{0\}$ and $M$ are the only two distinct sub-modules of $M.$
    \item A \textbf{\textcolor{RubineRed}{Jordan-H\"older}} (JH) filtration is a filtration of finitely many sub-modules:
    $\{0\}=M_0\subsetneq M_1\subsetneq ...\subsetneq M_k=M$ such that $M_i/M_{i+1}$ is simple for all $i.$
\end{itemize}
 
Examples:
\begin{itemize}
    \item[(1)] $A=k$ a field. A $k$-vector space is simple if and only if it is $1$-dimensional.
    \item[(2)] $\mathbb{Z}/p\mathbb{Z}$ is a simple $\mathbb{Z}$-module.
    \item[(3)] $\mathbb{Z}/6\mathbb{Z}$ as a $\mathbb{Z}$-module admits JH filtrartions:
    $$\underset{M}{\underbrace{\mathbb{Z}/6\mathbb{Z}}}\supset \underset{M_1}{\underbrace{2\mathbb{Z}/6\mathbb{Z}}}\supset \underset{M_2}{\underbrace{\{0\}}}$$ and 
    $$\underset{M}{\underbrace{\mathbb{Z}/6\mathbb{Z}}}\supset \underset{M'_1}{\underbrace{3\mathbb{Z}/6\mathbb{Z}}}\supset \underset{M'_2}{\underbrace{\{0\}}}$$    
    These are different filtrations but yield the same graded pieces.
    $M/M_1\simeq M_1'/M_2'$ and $M_1/M_2\simeq M/M_1'.$
\end{itemize}
 
An $A$-module $M$ is of \textbf{\textcolor{RubineRed}{finite length}} if it has a JH filtration.
 
Next, we classify Noetherian and Artinian Modules.
\begin{theo}{Classification of Noetherian and Artinian Modules}{}
Let $M$ be an $A$-module. $M$ is Noetherian and Artinian if and only if $M$ has finite length.
\end{theo}
\begin{proof}
Coming soon.
\end{proof}
\subsection*{Finitely-Generated Modules over PID}
We want to classify all finitely-generated modules over a PID $A.$\\
Recall:
\begin{itemize}
    \item A ring $A$ is called a PID if every ideal of $A$ is of the form $(a)$ with $a\in A.$
    \item PID $\Rightarrow$ UFD
    \item In a PID every prime ideal is maximal.
    \item PID are Noetherian
\end{itemize}
Examples: $\mathbb{Z},k[x],$ Euclidean domains, etc.
\begin{theo}{Classification of Finitely-Generated Modules over PID}
Let $M$ be a finitely-generated $A$-module with $A$ a PID. 
Then $$M\simeq A^{\oplus k}\oplus \displaystyle\bigoplus_{i=1}^l A/(p_i)^{d_i}$$ for some $k,l\in\mathbb{N}_0$, primes $p_1,...,p_l$, and $d_1,...,d_l\in\mathbb{N}.$\\
Moreover, $k$ is uniquely determined by $M$ and $(p_1^{d_1}),...,(p_l^{d_l})$ are uniquely determined up to permutation.
\end{theo}
\begin{proof}
\textit{Later.}
\end{proof}
\subsection*{Two Special Cases}
Case 1: $A=\mathbb{Z}.$ This is exactly the classification of finitely-generated abelian groups.\\
Case 2: $A=k[x]$ where $k$ is algebraically closed. An $A$-module $M$ is naturally a $k$-vector space. Our result says that $\dim_k M<\infty \Rightarrow \text{Jordan Normal Form Theorem}.$
\section*{Lecture 10}
\textit{Proving the classification theorem.}
\section*{Lecture 11}
\subsection*{Localizations}
Question: What is a \textit{localization}?\\
Answer: It is a construction where we allow to "invert" certain elements.
 
Let $A$ be a ring as before. A \textbf{\textcolor{RubineRed}{multiplicatively closed subset}} (MC subset) of $A$ is $S\subseteq A$ with 
\begin{itemize}
    \item $1\in S, 0\not\in S.$
    \item $s,t\in S\Rightarrow st\in S.$
\end{itemize}
 
Examples of MC subsets:
\begin{itemize}
    \item[(1)] $S=\{\text{units of } A\}$
    \item[(2)] $S=\{\text{nonzero elements of }A\}.$ $S$ is MC if and only if $A$ is an integral domain.
    \item[(3)] $S=\{1,f,f^2,...\}$ is MC if $f$ is not nilpotent.
    \item[(4)] If $p\subset A$ is a prime ideal then $S=A\setminus p$ is MC.
\end{itemize}
Goal: Given $A$ and $S\subset A$ a MC subset, construct a new ring $A_s$ where the elements of $A_s$ look like $\dfrac{a}{s}$ ($s\in S, a\in A$).\\

Construction: As a set $A_s=(A\times S)/\sim$ where $\sim$ is given by: $(a,s)\sim (b,t) \iff u(at-bs)=0$ in $A$ for some $u\in S\setminus\{0\}.$\\
Remark: A naive way of constructing $A_s$ is to only put $(u,s)\sim (b,t)\iff at=bs.$ This does not induce an equivalence relation generally.
Suppose $(b,t)\sim(c,w)$ in addition to $(a,s)\sim (b,t).$ 
We would hope that $(a,s)\sim (c,w)$ so we want $at=bs$ and $bw=ct$ implies $aw=cs$ however this follows in the case of integral domains but for all rings.\\
We use $\dfrac{a}{s}$ to denote the equivalence class of $(a,s)$ with binary operations $$\dfrac{a}{s}+\dfrac{a'}{s'}=\dfrac{as'+a's}{ss'},\;\; \dfrac{a}{s}\cdot \dfrac{a'}{s'}=\dfrac{aa'}{ss'}.$$
\begin{proposition}{}{}
The operations above are well-defined and $A_s$ is a ring with the identity element $\dfrac{1}{1}.$
\end{proposition}
\begin{proof}
Boring.
\end{proof}
We localize for the MC subsets discussed above.
\begin{itemize}
    \item[(1)] $A_s=A$ since $\dfrac{a}{s}\in A$ as $a\in A$ and $s$ is a unit.
    \item[(2)] $A$-integral domain, $S=A\setminus\{0\}$ then $A_s$ is a field. This is the field of fractions encountered in Math 350.
    \item[(3)] Write $A_f$ for the ring $A_s$ in this case. Consider two examples:
    \begin{itemize}
        \item $f=5, A=\mathbb{Z}, A_f=\{\dfrac{m}{5^n}| n\in\mathbb{N}_0, m\in\mathbb{Z}\}$
        \item $f=x\in k[x], k[x]_x=\{\dfrac{f(n)}{x^n}| n\in\mathbb{N}_0, f(x)\in k[x] \}$
    \end{itemize}
    \item[(4)] People usully write $A_p$ for the localization ring $A_s$ when $S=A_0\setminus p.$ 
    Example: $\mathbb{Z}, (5)=p$ $$\mathbb{Z}_{(5)}=\{\dfrac{a}{b}\in\mathbb{Q}\;|\;5\nmid b, a\in\mathbb{Z}\}$$
\end{itemize}
\subsection*{Digression}
If we consider $A$ beyond the cases of PID the structure for $A$-modules is very complicated. Here are some interesting constructions of $A$-modules from combinatorics.
For any $n\in\mathbb{N}$ we want to construct some interesting $\mathbb{C}[x,y]$-modules $M$ which are quotients of $\mathbb{C}[x,y]$ and have $\dim_\mathbb{C}M=n.$\\
\begin{center}
    Input: box configurations in a corner $\rightsquigarrow$ Output: $M.$
\end{center}
For example for $n=5$ we have a configuration as follows:
\begin{center}
    \includegraphics[width=0.9\textwidth]{fig2.png}
\end{center}
For $n=7$ we have a construction like the following
\begin{center}
    \includegraphics[width=0.9\textwidth]{fig1.png}
\end{center}
\section*{Lecture 12}
\subsection*{Localization of Rings}
\begin{lemma}{}{}
$\iota: A\to A_s$ is a ring homomorphism. In particular, $a\mapsto \dfrac{a}{1}.$ $A_s$ is naturally an $A$-module.
\end{lemma}
\begin{proposition}{Universal Property for $A_s$}{}
Assume $B$ is a ring with $\varphi:A\to B$ a ring homomorphism. 
If $\varphi(s)$ is a unit for all $x\in S\subseteq A,$ then there exists a unique ring homomorphism $\varphi':A_s\to B$ such that
\begin{center}
\begin{tikzcd}
A \arrow[rd] \arrow[rr, "\varphi"] &                                     & B \\
                                   & A_s \arrow[ru, "\varphi'"', dotted] &  
\end{tikzcd}
$\;\;\varphi=\varphi'\circ\iota$
\end{center}
\end{proposition}
\begin{proof}
We construct $\varphi'$ as $\varphi'(\dfrac{a}{s})=\varphi(a)\varphi(s)^{-1}\in B.$\\
Step 1: This is well-defined: $(a,s)\sim (b,t)\Rightarrow \varphi(a)\varphi(s)^{-1}=\varphi(b)\varphi(t)^{-1}.$\\
Step 2: $\varphi'$ is a ring homomorphism.\\
Step 3: Assume $\varphi'$ is any homomorphism satisfying the assumptions. 
Since $\varphi'$ makes the diagram commute we have $\varphi'(\dfrac{a}{1})=\varphi(a)\;\; \forall a\in A.$
In particular, for every $s\in S$ 
$$\varphi'(\dfrac{s}{1})=\varphi(s)\Rightarrow \varphi'(\dfrac{1}{s})=\varphi(s)^{-1}$$
Therefore $\varphi'(\dfrac{a}{s})=\varphi(a)\varphi(s)^{-1}\forall a\in A,\; s\in S.$
So $\varphi'$ has to be the one defined above.
\end{proof}
Exercise: If $A$ is an integral domain and $S\subset A$ is an MC subset. 
$A_s$ can be described as a subring of $\text{Frac}(A).$ 
More precisely, $A_s=\{\dfrac{a}{s}\in \text{Frac}(A)\;|\; a\in A, s\in S\}.$
\begin{proposition}{}{}
$A$ is a ring, $f\in A$ is not nilpotent, then $A_f\simeq A[t]/(tf-1).$ 
\end{proposition}
\begin{proof}
We define a homomorphism $\varphi:A\to A[t]/(tf-1)$ via $a\mapsto a+(tf-1).$
It is clear that $\varphi(f)(t+(tf-1))=tf+(tf-1)=1$ thus $\varphi(f)$ is a unit which implies $\varphi(f^n)$ is a unit.
Using the universal property for $A_s:$
\begin{center}
    \begin{tikzcd}
A \arrow[rd] \arrow[rr, "\varphi"] &                                     & {A[t]/(tf-1)} \\
                                   & A_f \arrow[ru, "\varphi'"', dotted] &              
\end{tikzcd}
$\rightsquigarrow \varphi':A_f\to A[t]/(tf-1)$
\end{center}
Now construct the inverse the inverse $\varphi'':A[t]/(tf-1)\to A_f$ via $\Tilde{\varphi''}:A[t]\to A_f$ that sends $g(t)$ to $g(\dfrac{1}{f})$ and the universal property.
It remains to check that $\varphi''\circ \varphi'=\text{id}, \varphi'\circ\varphi''=\text{id}.$
\end{proof}
\subsection*{Localization of Modules}
 
If $S\subset A$ is an MC subset and $M$ is an $A$-module then $M_s:=(M\times S)\sim$ where $(m,s)\sim(n,t)\iff \exists u: umt=uns$
 
This notion is consistent to that of ring localizations.
\begin{proposition}{}{}
$(S\subset A,M)$ induces the localization $A_s$ and $M_s.$
\begin{itemize}
    \item $M_s$ has a natural $A_s$-module structure.
    \item The action is given by $\dfrac{a}{s}\times \dfrac{m}{s}\to\dfrac{am}{st}.$
\end{itemize}
\end{proposition}
Remark: 
\begin{itemize}
    \item In particular $M_s$ is an $A$-module via $A\overset{\iota}{\to}A_s: a\cdot\dfrac{m}{s}=\dfrac{am}{s}$ 
    \item We have a natural homomorphism $M\overset{\iota_M}{\to} M_s$ via $m\mapsto \dfrac{m}{1}$
\end{itemize}
Exercise: Prove that $\ker(\iota_M)=\{m\in M\;|\;\exists s\in S\text{ such that }sm=0\}.$
\subsection*{Localizations vs Submodules}
\begin{proposition}{}{}
$M'\subset M$ is a submodule over $A$ and $S\subset A$ is an MC subset. Then $M_S'$ is naturally an $A_S$ submodule of $M_S.$
\end{proposition}
\begin{proof}
We define the $A_S$ homomorphism $M_S'\to M_S$ via $\dfrac{m'}{s}\mapsto \dfrac{m}{s}.$
Check that this is well-defined and injective.
This essentially follows from the fact that equivalence relations for $M'\times S$ are the restriction of equivalence relation for $M\times S.$
\end{proof}
\begin{proposition}{}{}
$N\subset M$ is a submodule. We have natural bijections 
\begin{center}
    $\{A_s\text{-submodules }N'\subset M_S\}\overset{\sim}{\longleftrightarrow} \{A\text{-submodules } N\subset M: sm\in N, s\in S, m\in M\Rightarrow m\in N\}$
\end{center}
\end{proposition}
\begin{proof}

\end{proof}
\begin{corollary}{}{}
If $M$ is a Noetherian $A$-module, then $M_S$ is Noetherian $A_S$-module.
\end{corollary}
\section*{Lecture 13}
\subsection*{Localizations vs Homomorphisms}
\begin{proposition}{}{}
Given $\psi\in \text{Hom}_A(M,N)$
\begin{itemize}
    \item[(a)] $\psi_S:M_S\to N_S$ via $\dfrac{m}{s}\to \dfrac{\psi(m)}{s}$  is well defined and $A_s$-linear ($\Rightarrow \psi_S\in \text{Hom}_{A_S}(M_S,N_S)$)
    \item[(b)] $\ker(\psi_S)=(\ker(\psi))_S$ as an $A_S$-submodule of $M_S$ and $\text{Im}(\psi_S)=(\text{Im}(\psi))_S$ as an $A_S$-submodule of $N_S.$
\end{itemize}
\end{proposition}
\begin{proof}
$\empty$
\begin{itemize}
    \item[(a)] Exercise
    \item[(b)] Exercise
\end{itemize}
\end{proof}
\begin{corollary}{}{}
$M$ is an $A$-module and $M'\subset M$ is a submodule.
Then $(M/M')_S\overset{\sim}{\to}M_S/M_S'.$
\end{corollary}
Localization will be back!
\subsection*{Some Potential Application}
For $A$-modules $P$ and $Q$, if $P\oplus Q\simeq A^{\oplus k}$ free.
It can happen that $P$ is not free!
Such modules are called "projective modules."
\begin{theo}{}{}
Let $M$ be a finitely-generated module over a Noetherian ring $A.$ The following are equivalent:
\begin{itemize}
    \item  $M$ is projective.
    \item For any maximal ideal $m\subset A,$ $M_m$ is a free $A_m$-module.
    \item there exist $f_1,f_2,...,f_k\in A$ with $(f_1,...,f_k)=A$ and $M_{f_i}$ is a free $A_{f_i}$-module.
\end{itemize}
\end{theo}
\subsection*{Categories and Functors}
 
A \textbf{\textcolor{RubineRed}{category}} $\mathcal{C}$ consists of 
\begin{itemize}
    \item a collection of objects, $Ob(\mathcal{C})$
    \item a set of \textbf{\textcolor{RubineRed}{morphisms}} (aka "arrows"): $\forall X,Y\in Ob(\mathcal{C})\rightsquigarrow \text{Hom}_\mathcal{C}(X,Y).$
    \item Composition maps: 
    $\forall X,Y,Z\in Ob(\mathcal{C}),$ $$\underset{(f,g)\longmapsto g\circ f}{\text{Hom}_\mathcal{C}(X,Y)\times \text{Hom}_\mathcal{C}(Y,Z)\to \text{Hom}_\mathcal{C}(X,Z)}$$
\end{itemize}
They satisfy the following axioms:
\begin{itemize}
    \item (\underline{Associativity}) Composition is associative
    $(f\circ g)\circ h=f\circ(g\circ h),\;\; \forall f\in \text{Hom}_\mathcal{C}(W,X), g\in \text{Hom}_\mathcal{C}(X,Y), h\in \text{Hom}_\mathcal{C}(Y,Z).$
    \item (\underline{Identity}) $\forall X\in Ob(\mathcal{C})$ there exists a distinguished element $1_X\in \text{Hom}_\mathcal{C}(X,X)$ such that: $f\cdot 1_X=f \;\; \forall f\in \text{Hom}_\mathcal{C}(X,Y)$ and $1_X\cdot g=g\;\;\forall g\in \text{Hom}_\mathcal{C}(Z,X).$
\end{itemize}
 
Examples:
\begin{itemize}
    \item[(1)] The category of sets:
    \begin{itemize}
        \item Ob = Sets
        \item Morphism = Maps of sets
        \item Composition = Composition of maps
        \item Identity = Identity $1_X:X\to X$
    \end{itemize}
    \item[(2)] The category of groups:
    \begin{itemize}
        \item Ob = Groups
        \item Morphism = Group Homomorphism
        \item Composition = Composition of Group Homomorphisms
        \item Identity = $1_G:G\to G$ via $g\to g.$
    \end{itemize}
    \item[(3)] Similarly, we can describe the category of rings, $A$-modules, fields, etc.
\end{itemize}
\subsection*{Functors}
\begin{center}
    \includegraphics[width=0.9\textwidth]{fig3.png}
\end{center}
Let $\mathcal{C}$ and $\mathcal{D}$ be categories. A \textbf{\textcolor{RubineRed}{functor}} $F:\mathcal{C}\to\mathcal{D}$ is 
\begin{itemize}
    \item an assignment on objects: 
    $$F:Ob(\mathcal{C})\to Ob(\mathcal{D})$$
    $$X\mapsto F(X)$$
    \item an assignment on morphisms: For $\forall X,Y\in Ob(\mathcal{C})$ there is a map $$\underset{f\longmapsto F(f)}{\text{Hom}_\mathcal{C}\to \text{Hom}_\mathcal{D}(F(X),F(Y))}$$ 
\end{itemize}
Satisfying the "compatibility" axioms:
\begin{itemize}
    \item (Composition) $F(g\circ f)=F(g)\circ F(f)$ for all $f\in \text{Hom}_\mathcal{C} (X,Y), g\in \text{Hom}_\mathcal{C}(Y,Z).$
    \item (Identity) $F(1_X)=1_{F(X)}$ for all $x\in Ob(\mathcal{C}).$
\end{itemize}
 
Examples of functors:
\begin{itemize}
    \item[(0)] Identity functor $Id_\mathcal{C}:\mathcal{C}\to\mathcal{C}.$
    \item[(1)] Forgetful functor. Let $\mathcal{C}$ be the category of groups/rings/$A$-modules... and let $\mathcal{D}$ be the category of sets. 
    $$\text{For}:\mathcal{C}\to\mathcal{D}$$ is the functor that forgets the group/ring/module structure of objects of $\mathcal{C}.$
    \item[(2)] $\mathcal{C}$ be any category, $X\in \mathcal{C}.$ We can define a functor $F_X$ (dependent on $X$)
    $$F_X:\mathcal{C}\to\text{Sets}$$ via $Y\mapsto \text{Hom}_\mathcal{C}(X,Y).$
    Precisely, on objects: $F_X(Y)=\text{Hom}_\mathcal{C}(X,Y)\in Ob(\text{Sets}),$ on morphisms: $Y_1\overset{f}{\to}Y_2\rightsquigarrow F(f):\text{Hom}_\mathcal{C}(X,Y_1)\to \text{Hom}_\mathcal{C}(X,Y_2)$ sending $[\psi:X\to Y_1]\mapsto [f\circ \psi: X\to Y_1\to Y_2]$
\end{itemize}
Remark: It makes sense to talk about isomorphic objects in a category $\mathcal{C}.$
If $f\in \text{Hom}_\mathcal{C}(X,Y)$ has a $2$-sided inverse $g.$
In this case $f$ is called an isomorphism.
\subsection*{Bonus: Topological Interlude}
We illustrate here that the "categorical point of view" is very helpful via the example of the Brouwer fixed point theorem.
\begin{theo}{Brouwer Fixed Point Theorem}{}
A continuous self-map $f:D^2\to D^2$ of the unit disc has a fixed point.
\end{theo}
Remark: Fixed point theorems have had great importance in modern mathematics and beyond. For instance, Nash's equilibrium theorem (Nobel Prize '94).
\begin{proof} $\empty$\\
\underline{Step 1:} If it is NOT true, then we can construct a map $g:D^2\to S^1$ as follows:
\begin{center}
    \includegraphics[width=\textwidth]{fig4.png}
\end{center}
$g$ is the identity when restricting to the boundary of the circle. One can show that $g$ is, in fact, continuous.\\
\underline{Step 2:} We show that there is NO such a map.
Our tool here is the \underline{the fundamental group}; it is a functor.
$$\pi_1:\text{Category of topological spaces}\to \text{Grp}$$ sending $X\to \pi_1(X)$ and continuous maps to group homomorphisms.
Also $\pi_1(S^1)=\mathbb{Z}, \pi_1(D^2)=0.$
Assuming we have a map $g$ as in step 1, we have:
\begin{center}
    \includegraphics[width=\textwidth]{fig5.png}
\end{center}
Applying $\pi_1$ we get \begin{center}
    \begin{tikzcd}
\mathbb{Z} \arrow[rr] \arrow[rrrr, "\text{id}"', bend right] &  & 0 \arrow[rr] &  & \mathbb{Z}
\end{tikzcd}
\end{center}
But this is not possible hence we have a contradiction.
\end{proof}
\section*{Lecture 14}
\subsection*{Opposite Category}
Motivation: In algebraic topology, we consider "cohomology" which is an "assignment":
$$H^i:\text{Topological Spaces}\to \text{abelian group}$$
$$X\longmapsto H^{i}(X,\mathbb{Z})$$
For morphisms: $$[X\overset{f}{\to}Y]\longmapsto [H^i(X,\mathbb{Z})\leftarrow H^i(Y,\mathbb{Z})].$$
 
For any category $\mathcal{C},$ we can construct another category $\mathcal{C}^{opp}$ (called the \textbf{\textcolor{RubineRed}{opposite category}} of $\mathcal{C}$):
\begin{itemize}
    \item $Ob(\mathcal{C}^{opp})=Ob(\mathcal{C})$
    \item Morphisms: $\text{Hom}_{\mathcal{C}^{opp}}(X,Y)=\text{Hom}_{\mathcal{C}}(Y,X).$
    \item $g^{opp}\cdot f:=f\cdot g$ for $f\in \text{Hom}_{\mathcal{C}^{opp}}(X,Y)=\text{Hom}_{\mathcal{C}}(Y,X)$ and $g\in \text{Hom}_{\mathcal{C}^{opp}}(Y,Z)=\text{Hom}_{\mathcal{C}}(Z,Y)$
\end{itemize}
 
So we're simply reversing the arrows of the category $\mathcal{C}$ when considering $\mathcal{C}^{opp}.$\\
Example:\\
Recall the functor $F_X:\mathcal{C}\to \text{Sets}$ sending $Y\mapsto \text{Hom}_{\mathcal{C}}(X,Y).$ 
We can construct another functor $F_X^{opp}:\mathcal{C}\to \text{Sets}^{opp}$ via $Y\mapsto \text{Hom}_{\mathcal{C}}(Y,X).$
Since $\forall \mathcal{C}$ the categories $\mathcal{C}$ and $\mathcal{C}^{opp}$ have the same objects we call a functor $F:\mathcal{C}\to \mathcal{D}^{opp}$ a \textbf{\textcolor{RubineRed}{contravariant functor }} $F:\mathcal{C}\to \mathcal{D}.$
\subsection*{Adjoint Functors}
Let $\mathcal{C},\mathcal{D}$ be categories and $F:\mathcal{C}\to \mathcal{D}, G:\mathcal{D}\to \mathcal{C}$ be functors.
 
$F$ is \textbf{\textcolor{RubineRed}{left adjoint}} to $G,$ if $\forall X\in Ob(\mathcal{C}), Y\in Ob(\mathcal{D}),$ there exists a bijection $\eta_{XY}:\text{Hom}_\mathcal{D}(F(X),Y)\overset{\sim}{\to}\text{Hom}_\mathcal{C}(X,G(Y))$ such that:
\begin{itemize}
    \item[(1)] For all $X,X'\in Ob(\mathcal{C}), Y\in Ob(\mathcal{D}), X'\overset{\varphi}{\to}X,$ the following diagram commutes:
    \begin{center}
        \begin{tikzcd}
{\text{Hom}_\mathcal{D}(F(X),Y)} \arrow[rrr, "{\eta_{X,Y}}"] \arrow[dd, "?\circ F(\varphi)"] &  &  & {\text{Hom}_\mathcal{C}(X,G(Y))} \arrow[dd, "?\circ \varphi"] \\
                                                                                             &  &  &                                                               \\
{\text{Hom}_\mathcal{D}(F(X'),Y)} \arrow[rrr, "{\eta_{X',Y}}"]                               &  &  & {\text{Hom}_\mathcal{C}(X',G(Y))}                            
\end{tikzcd}
    \end{center}
\item[(2)] For all $Y,Y'\in Ob(\mathcal{D}), Y\overset{\psi}{\to}Y', X\in Ob(\mathcal{C})$. the following diagram commutes:
\begin{center}
    \begin{tikzcd}
{\text{Hom}_\mathcal{D}(F(X),Y)} \arrow[rrr, "{\eta_{X,Y}}"] \arrow[dd, "\psi\circ ?"] &  &  & {\text{Hom}_\mathcal{C}(X,G(Y))} \arrow[dd, "G(\psi)\circ ?"] \\
                                                                                       &  &  &                                                               \\
{\text{Hom}_\mathcal{D}(F(X),Y')} \arrow[rrr, "{\eta_{X,Y'}}"]                         &  &  & {\text{Hom}_\mathcal{C}(X,G(Y'))}                            
\end{tikzcd}
\end{center}
\end{itemize}
In this case we also say that $G$ is \textbf{\textcolor{RubineRed}{right adjoint}} to $F.$
 
\underline{Philosophy:} If we start with interesting functors, their adjoint functors are usually interesting. Sometimes, we can get interesting functors as adjoint functors of boring functors! (There are many applications in sheaf theory and algebraic geometry).\\
Examples:
\begin{itemize}
    \item[(1)] Fix a ring $A.$ Let $G:=\text{For}:A\text{-mod}\to \text{Sets}$.\\
    \textbf{Claim:} $G$ has a left-adjoint functor $F$ given by $$F:\text{Sets}\to A\text{-mod}$$
    $$I\mapsto A^{\oplus I}$$
    $$[I\to J]\mapsto [A^{\oplus I}\to A^{\oplus J}].$$
    \textit{proof.} 
    Coming soon!
    \item[(2)] $G:\mathbb{Z}\text{-mod}\to \text{Grp}$ as the natural inclusion.\\
    \textbf{Claim:} $G$ has a left-adjoint functor given by $$F:\text{Grp}\to \mathbb{Z}\text{-mod}$$
    $$G\mapsto G/[G,G]$$
    where $[G,G]$ is the commutator.
\end{itemize}
\subsection*{Uniqueness}
Question: If adjoint functors exist, are they unique?\\
Answer: Essentially, YES!\\
In order to make sense of this we need to talk about the notion of "isomorphic functors".
 
$\mathcal{C}$ and $\mathcal{D}$ are categories and $F,G:\mathcal{C}\to \mathcal{D}$ are functors. 
A \textbf{\textcolor{RubineRed}{functor morphism}} $\eta:F\to G$ is an assignment:
$$\forall X\in Ob(\mathcal{C})\rightsquigarrow \text{ a morphism } \eta_X:F(X)\to G(X).$$
Such that $\forall X,Y\in Ob(\mathcal{C}), \;\forall f\in \text{Hom}_\mathcal{C}(X,Y)$ the following diagram commutes: 
\begin{center}
    \begin{tikzcd}
F(X) \arrow[rrr, "F(f)"] \arrow[dd, "\eta_X"] &  &  & F(Y) \arrow[dd, "\eta_Y"] \\
                                              &  &  &                           \\
G(X) \arrow[rrr, "G(f)"]                      &  &  & G(Y)                     
\end{tikzcd}
\end{center}
 
\begin{proposition}{}{}
\begin{itemize}
    \item[(a)] Identity morphism is a morphism of any functor.
    \item[(b)] Transitivity: $\tau:G\to H, \eta:F\to G \rightsquigarrow \tau \circ \eta : F\to H.$
\end{itemize}
\end{proposition}
 
$F,G:\mathcal{C}\to \mathcal{D}$ are \textbf{\textcolor{RubineRed}{isomorphic functors}} if there exists functor morphisms $f:F\to G, g:G\to F$ such that $g\circ f=id_F, f\circ g=id_G.$
 
\begin{theo}{}{}
The left or right adjoint functor to a given functor, if it exists, is unique up to functor isomorphisms.
\end{theo}
We will need to make use of the Yoneda lemma in order to prove this result. 
\begin{theo}{Yoneda Lemma}{}
$\mathcal{C}$ is a category, $X\in Ob(\mathcal{C})$ is fixed. Recall that $F_X:\mathcal{C}\to \text{Sets}$, $Y\mapsto \text{Hom}_\mathcal{C}(X,Y).$ 
Assume $F:\mathcal{C}\to \text{Sets}$ is any functor.
Then $\text{Hom}_{Fun}(F_X,F)$ is naturally bijective with $F(X).$
\end{theo}
\section*{Lecture 15}
\subsection*{More on Functors}
Recall that for two categories $\mathcal{C}$ and $\mathcal{D}$, a functor i an "assignment" $F:\mathcal{C}\to \mathcal{D}$ on objects together with arrows:
\begin{itemize}
    \item $X\in Ob(\mathcal{C})\rightsquigarrow F(X)\in Ob(\mathcal{D})$
    \item $[X\overset{f}{\to}Y]$ in $\mathcal{C}$ $\rightsquigarrow$ $[F(X)\overset{F(f)}{\to} F(Y)]$ in $\mathcal{D}.$
\end{itemize}
An important class of functors that we are interested in when we study modules is that of additive functors.
 
A functor $F:A\text{-mod}\to B\text{-mod}$ is \textbf{\textcolor{RubineRed}{additive}} if $\forall M,N\in Ob(A\text{-mod}), \; \text{Hom}_A(M,N)\to \text{Hom}_A(F(M),F(N))$ is a group homomorphism.\\
\textbf{\textcolor{RubineRed}{Additive contravariant}} functors $A\text{-mod}\to B\text{-mod}$ are additive functors $A\text{-mod}^{opp}\to B\text{-mod}^{opp}.$
 
Examples:
\begin{itemize}
    \item[(1)] $X\in Ob(\mathcal{C}),$ we have introduced the functor $F_X=\text{Hom}_\mathcal{C}(X,-):\mathcal{C}\to \text{Sets}.$
    Now, if $\mathcal{C}=A\text{-mod}, M\in Ob(\mathcal{C}),$ then $F_M:=\text{Hom}_A(M,-):A\text{-mod}\to \text{Sets}$ can be promoted to an additive functor
    $$\widetilde{F}_M:=\text{Hom}_A(M,-):A\text{-mod}\to A\text{-mod}.$$
    This means $F_M=For\circ \widetilde{F}_M.$
    \begin{center}
        \begin{tikzcd}
A\text{-mod} \arrow[rd, "\widetilde{F}_M"'] \arrow[rr, "F_M"] &                                 & \text{Sets} \\
                                                              & A\text{-mod} \arrow[ru, "For"'] &            
\end{tikzcd}
    \end{center}
    Exercise: Check the claim above.\\
    Hint: In order to show that $\widetilde{F}_M$ defined above is a functor one needs to prove:
    \begin{itemize}
        \item  $\forall A\text{-mod} N, \; \widetilde{F}_M(N)$ is an $A\text{-module.}$
        \item $\forall \psi\in \text{Hom}_A(N,N'),\; \widetilde{F}_M(\psi)$ is $A$-linear.
        \item The map $\psi\mapsto F_M(\psi)$ is a group homomorphism $$\text{Hom}_A(N,N')\to \text{Hom}_A(\widetilde{F}_M(N),\widetilde{F}_M(N')).$$
    \end{itemize}
    \item[(2)] Similarly, $\forall N\in Ob(A\text{-mod})$ we have $$\widetilde{F}_N^{opp}:=\text{Hom}_A(\cdot, N):A\text{-mod}^{opp}\to A\text{-mod}$$ is an additive functor.
    \item[(3)] A further generalization:
    $$\rho:A\to B \text{ - a ring homomorphism.}$$
    Then for fixed $M\in Ob(B\text{-mod}),$ 
    $$\text{Hom}_A(M,-):A\text{-mod}\to B\text{-mod}$$ is an additive functor.
    \item[(4)] Localization vs additive functors.\\
    $S\subset A$ is an MC subset.
    Localization provides a natural functor:
    \begin{center}
        $A\text{-mod}\to A_S\text{-mod}$\\
        $M\mapsto M_S$\\
        $[M\to N]\mapsto[M_S\to N_S]$
    \end{center}
    Claim: This is an additive functor.
\end{itemize}
\subsection*{Tensor Product}
In linear algebra for two $k$-vector spaces $V_1,V_2$ we can talk about their tensor product $V_1\otimes V_2.$
If $\{e_i\}_{i\in I}$ and $\{e_j\}_{j\in J}$ are bases for $V_1$ and $V_2,$ respectively, then $V_1\otimes V_2$ is a vector space with a basis given by $e_i\otimes f_j.$
We want to provide a general construction of tensor product for $A$-modules from the point of view of categories and functors.\\
Fix a ring $A.$ Let $M_1, M_2\in Ob(A\text{-mod}).$
We generalize $F_M:=\text{Hom}_A(M,-)$ to $$\text{Hom}_{M_1,M_2}:=\text{Bilin}_A(M_1\times M_2,-):A\text{-mod}\to \text{Sets}$$
$$F_{M_1,M_2}(N)=\{A\text{-bilinear maps } M_1\times M_2\to N\}$$
Remark: $\psi:M_1\times M_2\to N$ is an $A$-bilinear map, if it is $A$-linear on both factors $M_1$ and $M_2.$\\
\underline{Question:} Is $\text{Bilin}_A(M_1\times M_2,-)$ essentially a new functor?\\
\underline{Answer:} No. It is isomorphic to $\text{Hom}_A(\star,-):A\text{-mod}\to \text{Sets}$ where $\star$ is some $A$-module.
$\star\in Ob(A\text{-mod})$ dependent on $M_1$ and $M_2,$ will be the tensor product $M_1\otimes_A M_2\in Ob(A\text{-mod}).$
 
If $M_1,M_2\in Ob(A\text{-mod})$ we define the \textbf{\textcolor{RubineRed}{tensor product}} of $M_1, M_2$ is an $A$-module, denoted by $M_1\otimes_A M_2$ with a bilinear map $$M_1\times\to M_1\otimes_A M_2 \text{ via }(m_1,m_2)\mapsto m_1\otimes m_2$$ such that For all $N\in Ob(A\text{-mod})$ and for all $A$-bilinear map $\beta:M_1\times M_2\to N$ there exists a unique $A$-linear map 
$$\widetilde{\beta}:M_1\otimes M_2\to N$$ satisfying that $\beta(m_1,m_2)=\widetilde{\beta}(m_1\otimes m_2).$
 
The universal property used to define the tensor product above is summarized in the diagram:
\begin{center}
    \begin{tikzcd}
{(m_1,m_2)} \arrow[d, maps to] & M_1\times M_2 \arrow[d] \arrow[rrd, "\beta"]     &  &   \\
m_1\otimes m_2                 & M_1\otimes_A M_2 \arrow[rr, "\widetilde{\beta}"] &  & N
\end{tikzcd}
\end{center}
Claim: The object $M_1\otimes_A M_2\in Ob(A\text{-mod}),$ if exists, is unique up to isomorphism.
\begin{proof}
If there is another $A$-mod, $M_1\otimes_A'M_2,$ satisfies the above properties then there exists a unique linear map $M_1\otimes_A' M_2\to M_1\otimes_A M_2.$
This map is an isomorphism of $A$-modules since its inverse is given by the universal property of $M_1\otimes_a M_2.$
\end{proof}
Remark: If the tensor product $M_1\otimes_A M_2$ exists, then the universal property shows that we have an isomorphism of functors:
$\Hom(M_1\otimes_A M_2,-)=\text{Bilin}_A(M_1,M_2):A\text{-mod}\to \text{Sets}$
\begin{theo}{}{}
Tensor product exists for every $M_1,M_2\in Ob(A\text{-mod}).$
\end{theo}
\subsubsection*{Bonus}
In modern mathematics and physics categories and functors serve as the fundamental language for describing several phenomena.
For example, in his 1994 ICM (International Congress of Mathematics) talk, Maxim Kontsevich formulated the "mirror symmetry" in physics as an equivalence of two categories which encode different geometric structures.
\section*{Lecture 16}
\subsection*{Construction of Tensor Product}
We will prove the theorem stated above.\\
\underline{Step 1:} If one of the modules is free:  $M_1= A^{\oplus I}, M_2=M$ then $A^{\oplus I}\otimes_A M$ exists and is isomorphic to $M^{\oplus I}$ and the natural $A$-bilinear map is: $A^{\oplus I}\times M\to M^{\oplus I}$ via $((a_i)_{i\in I},m)\mapsto (a_im)_{i\in I}.$\\
\textit{Proof of Step 1.} 
First we'll show that for every $A$-bilinear map $\beta:A^{\oplus I}\times M\to N$ there exists a unique $A$-linear map $\widetilde{\beta}:M^{\oplus I}\to N$ such that $\beta((a_i),m)=\widetilde{\beta}(a_im)).$
For given $\beta$ above, we define $A$-linear map $\beta_i:M\to N$ via $m\mapsto \beta(e_im).$
\begin{center}
    \begin{tikzcd}
A^{\oplus I}\times M \arrow[rd, "\beta"] \arrow[d, "\otimes"] &   \\
M^{\oplus I} \arrow[r, "\widetilde{\beta}"']                  & N
\end{tikzcd}
\end{center}
Then define $\widetilde{\beta}:M^{\oplus I}\to N$ via $(m_i)_{i\in I}\mapsto \sum_{i\in I}\beta_i(m_i).$
We can check that $\widetilde{\beta}((a_im)_{i\in I})=\beta((a_i)_{i\in I},m).$\\
\underline{Step 2:} Assume for $M_1', M_2\in Ob(A\text{-mod}), \; M_1'\otimes_A M_2$ exists. 
Then for any $M_1\in Ob(A\text{-mod})$ with surjective $A\text{-linear}$ $M_1'\overset{\pi_1}{\twoheadrightarrow} M_1$ we can conclude that $M_1\otimes_A M_2$ exists as well.
More precisely, write $M_1\simeq M_1'/K_1$ where $K_1=\ker(\pi_1).$ 
We can define $K\subset M_1'\otimes_A M_2$ to be the sub-module spanned by $k_1\otimes m_2$ with $k_1\in K_1$ and $m_2\in M_2.$\\
Claim: $M_1'\otimes M_2/K$ is the tensor product of $M_1\otimes_A M_2.$\\
\textit{Proof of the Claim:} Coming soon!\\
\underline{Step 3:} Step 1+ Step  2$\Rightarrow$ Theorem:
$\forall M_1,M_2$ find $A^{\oplus I}\twoheadrightarrow M_1$ then $A^{\oplus I}\otimes_A M_2$ gives $M_1\otimes_A M_2.$ \qed\\

Examples:
$A=\mathbb{Q}[x,y], \; I=(x,y)$
\begin{itemize}
    \item[(1)] $A\otimes_A I= 
    I$ from step 1.
    \item[(2)] $I\otimes_A I=?$\\
    We first write $I$ as a quotient using the map $\pi_1:A^{\oplus 2}\to I$ via $(a,b)\mapsto (ax+by).$
    $K_1=\{(a,b)\in A^{\oplus 2}| ax=-by\}.$
    $A$ is a UFD, $ax=-by$ implies $a=gy, b=-gx$ for $g\in A.$
    We have $K_1=\text{Span}_A((y,-x))=A(y,-x)\subseteq A^{\oplus 2}.$
    calculation in the notes
\end{itemize}
\begin{lemma}{}{}
If $M_1=\text{Span}_A(m_i|i\in I)$ and $M_2=\text{Span}_A(n_j|j\in J)$, then $M_1\otimes_A M_2$ is spanned by $m_i\otimes n_j.$
\end{lemma}
\section*{Lecture 17}
\subsection*{Properties of Tensor Product}
\begin{proposition}{}{}
If $M\in Ob(A\text{-mod})$, then $-\otimes_A M: A\text{-mod}\to A\text{-mod}$ via $N\mapsto N\otimes_A M$ is an additive functor.
\end{proposition}
\begin{proof}
Soon
\end{proof}
For $\varphi_1:M_1'\to M_1, \varphi_2:M_2'\to M_2$ there is an $A$-homomorphism $\varphi_1\otimes \varphi_2: M_1'\otimes_A M_2'\to M_1\otimes_A M_2$ via $m_1'\otimes m_2'\mapsto \varphi_1(m_1')\otimes \varphi_2(m_2').$\\
General fact: $\text{Hom}_A(M_1',M_1)\times \text{Hom}_A(M_2',M_2)\to \text{Hom}_A(M_1'\otimes_A M_2', M_1\otimes_A M_2)$ via $(\varphi_1,\varphi_2)\mapsto \varphi_1\otimes \varphi_2.$
\begin{theo}{}{}
$M_1,M_2,M_3\in Ob(A\text{-mod})$
\begin{itemize}
    \item[(1)] (Associativity) There exists a unique isomorphism $(M_1\otimes_A M_2)\otimes_A M_3\to M_1\otimes_A(M_2\otimes_A M_3)$ satisfying $(m_1\otimes m_2)\otimes m_3\mapsto m_1\otimes (m_2\otimes m_3).$
    \item[(2)] (Commutativity) There exists a unique isomorphism $M_1\otimes_A M_2\overset{\sim}{\to}M_2\otimes_A M_1$ satisfying $m_1\otimes m_2\mapsto m_2\otimes m_1.$
    \item[(3)] (Distributivity) There exists a unique isomorphism $M_1\otimes_A(M_2\oplus M_3)\overset{\sim}{\to}M_1\otimes_A M_2\oplus M_1\otimes_A M_3$ satisfying $m_1\otimes(m_2,m_3)\mapsto (m_1\otimes m_2, m_1\otimes m_3).$
    \item[(4)] (Identity element) There exists a unique isomorphism $A\otimes_A M\overset{\sim}{\to}M$ satisfying $a\otimes m\mapsto am.$
\end{itemize}
\end{theo}
\begin{proof}
$\empty$
\begin{itemize}
    \item[(1)] We fist need to construct an $A$-linear map: 
    $$\widetilde{\beta}:(M_1\otimes_A M_2)\otimes_A M_3\to M_1\otimes_A(M_2\otimes_A M_3)$$ sending $(m_1\otimes m_2)\otimes m_3\mapsto m_1\otimes (m_2\otimes m_3).$
    We also want a bilinear map $$\beta:(M_1\otimes_A M_2)\times M_3\to M_1\otimes_A (M_2\otimes_A M_3)$$ sending $(m_1\otimes m_2,m_3)\mapsto m_1\otimes (m_2\otimes m_3).$
    To construct this, fix $m_3\in M_3$ and get an $A$-linear map $M_2\to M_2\otimes_A M_3$ via $m_2\mapsto m_2\otimes m_3.$\\
    Define $\beta_{m_3}:M_1\otimes_A M_2\to M_1\otimes_A (M_2\otimes_A M_3)$ as the map induced by $id:M_1\to M_1$ and $M_2\to M_2\otimes_A M_3$ above. 
    Note that $\beta_{m_3}$ depends $A$-linearly on $m_3.$
    We now get the bilinear map $\beta(x,m_3):=\beta_{m_3}(x).$
    \item[(2)] Problem Set
    \item[(3)] Problem Set
\end{itemize}
\end{proof}
\subsection*{Application: New Functors from $A$-mod to $B$-mod}
For this section, fix $\rho: A\to B$ to be a ring homomorphism. 
As we have seen before, any $B$-module can be viewed as an $A$-module.
This induces a functor from $B$-mod to $A$-mod.\\
How could we get $B$-modules from $A$-modules?\\
Setup: $L^B\in Ob(B\text{-mod}).$ For all $M^A\in Ob(A\text{-mod})$ we can consider $$L^B\otimes_A M^A\in Ob(A\text{-mod}).$$ Note that we're viewing $L^B$ as an $A$-module. 
\begin{proposition}{}{}
There exists a unique $B$-module structure on $L^B\otimes_A M^A$ which recovers its $A$-module structure and satisfies $b\cdot_B(l\otimes m)=bl\otimes m$ on generators with $b\in B, l\in L^B, m\in M^A$
\end{proposition}
\begin{proof}
We first construct the $B$-action $B\times (L^B\otimes_A M^A)\to L^B\otimes_A M^A.$
For $b\in B$ we have $\varphi_b:L^B\to L^B$ via $l\mapsto lb$ is an $A$-linear map (via $\rho:A\to B$).
$$b\times -:L^B\otimes_A M^A\to L^B\otimes_A M^A$$ given by $\varphi_b\otimes id_{M^A}.$
Check associativity and distributivity on generators to show that this is a $B$-module structure on $L^B\otimes_A M^A.$\\
Finally checking uniqueness finishes the proof.
\end{proof}
Hence for a ring homomorphism $\rho:A\to B$ and $L^B\in Ob(B\text{-mod})$ we have a functor $$L^B\otimes_A -:A\text{-mod}\to B\text{-mod}.$$
\subsection*{Adjoint Functors}
Again, let $\rho:A\to B$ be a ring homomorphism. Fix $L^B\in Ob(B\text{-mod}).$ 
We have two functors:
\begin{center}
    \begin{tikzcd}
A\text{-mod} \arrow[rr, "-\otimes_A L^B", bend left=49] &  & B\text{-mod} \arrow[ll, "{\text{Hom}_B(L^B,-)}"', bend left=49]
\end{tikzcd}
\end{center}
More precisely $\text{Hom}_B(L^B,-):B\text{-mod}\to B\text{-mod}$ is the composition of $\text{Hom}_B(L^B,-):B\text{-mod}\to B\text{-mod}$ with the forgetful functor $B\text{-mod}\to A\text{-mod}$ via $\rho:A\to B.$
\begin{theo}{}{}
$L^b\otimes_A - $ is the left adjoint to $\text{Hom}_B(L^B,-).$
\end{theo}
The theorem says that for any $A$-module $M^A$ and any $B$-module $N^B$, we want to construct a bijection $\eta_{M,N}:\text{Hom}_B(L^B\otimes_A M^A, N^B)\overset{\sim}{\to}\text{Hom}_A(M^A,\text{Hom}_B(L^B,N^B))$ which satisfies some natural conditions on $M^A$ and $N^B.$\\
Exercise: Think about what this means for vector spaces.
\section*{Lecture 18}
\subsection*{Three Faces of Tensor Product}
\begin{itemize}
    \item 1st face: Universal property
    $$\text{Bilin}_A(M\times N, -)=\text{Hom}_A(M\otimes_A N,-)$$
    \item 2nd face: Computational perspective
    $$\pi:A^{\oplus I}\to M\rightsquigarrow M\otimes_A N=\dfrac{A^{\oplus I}\otimes N}{\text{Span}_A(k\otimes n|k\in \ker(\pi),n\in N)}$$
    \item 3rd face: left adjoint functor to $\text{Hom}(L,-)$ (i.e. $\text{Hom}_A(M\otimes L,N)=\text{Hom}_A(M,\text{Hom}_A(L,N))$)
    We generalize this to a relative setting $\rho:A\to B$ 
\end{itemize}
We want to prove that $L^B\otimes_A - $ is left adjoint to $\Hom_B(L^B.-).$ 
More precisely, for any $A$-module $M^A$ and any $B$-module $N^B$ we want to construct a bijection $\eta_{M,N}:\Hom_B(L^B\otimes_A M^A, N^B)\overset{\sim}{\to}\Hom_A(M^A,\Hom_B(L^B,N^B))$ which satisfies some natural conditions on $M^A$ and $N^B.$
The idea is that both sets above will be naturally identified with a third set:
$\text{Bilin}_{B,A}(L^B\times M^A,N^B):=\{\beta:L^B\times M^A\to N^B| B\text{-linear in the first factor, }A\text{-linear in the second factor} \}.$
We will now prove the theorem.
\begin{proof} $\empty$\\
\underline{Bijection 1:} $\eta'_{M,N}:\Hom_B(L^B\otimes_AM^A,N^B)\overset{\sim}{\to}\text{Bilin}_{B,A}(L^B\times M^A,N^B).$
The way we construct this is the following:\\
$\beta\in \text{Bilin}_{B,A}(L^B\times M^A,N^B)\rightsquigarrow \beta \in \text{Bilin}_{A}(L^B\times M^A,N^B)\iff \widetilde{\beta}\in \text{Hom}_A(L^B\otimes_A M^A,N^B ).$
We need to show that $\widetilde{\beta}$ is $B$-linear.
Rest of the proof online.
\end{proof}
\subsubsection*{A special Case}
Given a ring homomorphism $\rho:A\to B$ as above. 
$B\otimes_A -: A\text{-mod}\to B\text{-mod}$ is left adjoint to $\text{For}:B\text{-mod}\to A\text{-mod}.$ (For example $\mathbb{C}\otimes_{\mathbb{R}}-:\mathbb{R}\text{-vector space}\to \mathbb{C}\text{-vector space}$, complexification in linear algebra).
The functor $B\otimes_A -$ is usually called base change.
\subsection*{Tensor Product and Rings}
 
For a fixed ring homomorphism $\rho:A\to B$ we say that $B$ is an \textbf{\textcolor{RubineRed}{$A$-algebra}}
 
Roughly speaking, an $A$-algebra is an $A$-module with compatible ring structure. 
A morphism between two $A$-algebras $B$ and $C$ is a ring homomorphism $B\to C$ with 
\begin{tikzcd}
B \arrow[rr] & {} \arrow[loop, distance=2em, in=235, out=305] & C \\
             & A \arrow[lu, "\rho_B"] \arrow[ru, "\rho_C"]    &  
\end{tikzcd}\\
Remark: Different homomorphisms $\rho:A\to B$ endow $B$ different $A$-algebra structures.\\
Say $A,B,C$ are rings and $B,C$ are $A$-algebras, then we consider $B\otimes_A C.$
\begin{proposition}{}{}
There exists a unique $A$-algebra structure on $B\otimes_A C$ such that $(b_1\otimes c_1)(b_2\otimes c_2)=b_1b_2\otimes c_1c_2$
\end{proposition}
\begin{proof}
Since $b\otimes c$ for $b\in B, c\in C$ span $B\otimes_AC$, uniqueness will follow from existence.
Since $B$ is an $A$-algebra we have that $B\times B\to B$ via $(b_1,b_2)\mapsto b_1b_2$ is an $A$-bilinear map.
Hence there exists some $\mu_B:B\otimes_A B\to B$ via $b_1\otimes b_2\mapsto b_1b_2$ and similarly $\mu_C:C\otimes_AC\to C$ via $c_1\otimes c_2\mapsto c_1c_2.$
Combining the two, we get $\mu_B\otimes \mu_C:(B\otimes_AB)\otimes_A(C\otimes_AC)\to B\otimes_AC.$
THe desired morphism $(B\otimes_A C)\times(B\otimes_AC)\to B\otimes_AC$ is induced by the tensor product $(B\otimes_AC)\otimes_A(B\otimes_AC)\to B\otimes_AC$ given above and the natural isomorphism $(B\otimes_AB)\otimes_A(C\otimes_AC)\simeq (B\otimes_AC)\otimes(B\otimes_AC).$
\end{proof}
\subsubsection*{Appendix}
We may talk about product and coproduct for objects in a category $\mathcal{C}$ via universal properties.
\begin{itemize}
    \item $X_1,X_2\in\text{Ob}(\mathcal{C})$, we say that $X$ (usually denoted by $X_1\times X_2$) is the product of $X_1,x_2$ if the functor $$F_{X_1}^{opp}\times F_{X_2}^{opp}:\underset{Y}{\mathcal{C}}\underset{\longmapsto}{\to}\underset{\text{Hom}(Y,X_1)\times \text{Hom}(Y,X_2)}{\text{Sets}}$$
    is isomorphic (as a functor) to $$F_X^{opp}:\underset{Y}{\mathcal{C}}\underset{\longmapsto}{\to} \underset{\text{Hom}(Y,X)}{\text{Sets}}.$$
    \item Coproduct $(X_1*X_2)=\text{product in }\mathcal{C}^{opp}.$
    That is, an object $X_1*X_2\in\mathcal{C}$ such that $\Hom_\mathcal{C}(X_1*X_2,-)\simeq \Hom_\mathcal{C}(X_1,-)\times \Hom_\mathcal{C}(X_2,-).$
\end{itemize}
\begin{theo}{}{}
$B, C$ are $A$-algebras. $B\otimes_A C$ is the coproduct of $B$ and $C$ in the category of $A$-algebras.
That is, the functors $\Hom_{A-alg}(B,-)\times \Hom_{A-alg}(C,-):A\text{-alg}\to \text{Sets}$ and $\Hom_{A-alg}(B\otimes_AC,-):A\text{-alg}\to \text{Sets}$ are isomorphic as functors.
\end{theo}
\section*{Lecture 19}
\subsection*{Exactness of Functors}
\textit{In modern mathematics, "exactness" plays a crucial role. The key notion of "cohomology" is to measure the failure of exactness of certain functors.}\\
We work with categories of $A$-modules.
Consider a sequence of $A$-modules:
\begin{itemize}
    \item $M_0\overset{\varphi_0}{\to}M_1 \overset{\varphi_1}{\to }M_2\to...\overset{\varphi_{k-1}}{\to}M_k$ \hspace{10mm} ($\star$)
    \item $M_i\in Ob(A\text{-mod}$ and $\varphi_i\in\Hom_A(M_i,M_{i+1}).$ 
\end{itemize}
 
\begin{itemize}
    \item We say that the sequence ($\star$) is \textbf{\textcolor{RubineRed}{exact}} if $\Image(\varphi_{i-1})=\ker(\varphi_i).$
    \item We call an exact sequence of the shape $$0\to M_1\overset{\varphi_1}{\to}M_2\overset{\varphi_2}{\to} M_3\to0$$ a \textbf{\textcolor{RubineRed}{short exact sequence}} (SES).
\end{itemize}
 
In particular, the SES definition says that $\varphi_1$ is injective, $\varphi_2$ is surjective, and $\Image(\varphi_1)=\ker(\varphi_2).$\\
Construction/Example of SES:\\
Take $N\subset M$ a sub-module. Then we obtain the SES:
$$0\to N\to M\to M/N\to 0.$$
In general, we are interested in how an additive functor interacts with SES.
 
Let $F:A\text{-mod}\to B\text{-mod}$ be an additive functor.
\begin{itemize}
    \item We say that $F$ is \textbf{\textcolor{RubineRed}{left exact}} if, for all SES $$0\to M_1\overset{\varphi_1}{\to}M_2\overset{\varphi_2}{\to}M_3\to 0\in Ob(A\text{-mod})$$ the sequence $$0\to F(M_1)\overset{F(\varphi_1)}{\to}F(M_2)\overset{F(\varphi_2)}{\to}F(M_3)$$ is exact
    \item Similarly, we say $F$ is \textbf{\textcolor{RubineRed}{right exact}} if for all $SES$
    $$0\to M_1\overset{\varphi_1}{\to}M_2\overset{\varphi_2}{\to}M_3\to 0\in Ob(A\text{-mod})$$ the sequence
    $$F(M_1)\overset{F(\varphi_1)}{\to}F(M_2)\overset{F(\varphi_2)}{\to}F(M_3)\to 0$$ is exact.
    \item We say that $F:A\text{-mod}\to B\text{-mod}$ is \textbf{\textcolor{RubineRed}{exact}}, if it is both right and left exact.
\end{itemize}
 
We're lucky as many natural functors are left/right exact. These are the most interesting functors!
\subsection*{Examples (Localization, Tensor, and Hom)}
\subsubsection*{The Localization Functor}
Let $S\subset A$ be a MC subset. Localization provides us an assignment $M\in Ob(A\text{-mod}\rightsquigarrow M_s\in Ob(A_S\text{-mod})$ which is actually a functor.
\begin{proposition}{}{}
$(-)_s$ is an exact functor.
\end{proposition}
\begin{proof}
By lecture 13 we have that $\varphi:M\to N \rightsquigarrow \varphi_S:M_S\to N_S$ satisfies $\Image(\varphi_S)=\Image(\varphi)_S, \ker(\varphi_S)=\ker(\varphi)_S.$
Now take a SES $0\to M\overset{\varphi_1}{\to}N\overset{\varphi_2}{\to}Q\to 0$.
Note that since $\varphi_1$ is injective we get $\varphi_1,s$ is injective.
Similarly, $\varphi_2$ surjective implies that $\varphi_{2,s}$ is surjective.
We also know that $\Image(\varphi_1)=\ker(\varphi_2)$ implies $\Image(\varphi_{1,s})=\ker(\varphi_{2,s}).$
\end{proof}
\subsubsection*{Tensor Product is Right Exact}
Pick $L\in Ob(A\text{-mod})$ then we have the functor $-\otimes_AL:A\text{-mod}\to A\text{-mod}.$
\begin{proposition}{}{}
$-\otimes_AL$ is right exact.
\end{proposition}
\begin{proof}
Take a short exact sequence $0\to M\overset{f}{\to}N\overset{g}{\to}Q\to 0$ in $Ob(A\text{-mod}).$
We want to show that $M\otimes_A L\overset{f\otimes id_L}{\to}N\otimes_A L\overset{g\otimes id_L}{\to}Q\otimes_AL\to 0$ is exact.
Since $g$ is surjective we have that $g\otimes id_L$ is surjective (all generators lie in its image).
We need to show that $\ker(g\otimes id_L)=\Image(f\otimes id_L).$
Recall: in the construction of tensor product (Lecture 16) we have shown that for $N\overset{g}{\twoheadrightarrow}Q$ surjective with kernel $M$, we have: $$Q\otimes_A L=N\otimes_A L/\text{Span}_A(m\otimes l; m\in M, l\in L).$$
In particular, $\ker(g\otimes id_L)=\ker[N\otimes_A L\to N\otimes_A L/ \text{Span}_A(m\otimes l; m\in M, l\in L)]=\text{Span}_A(m\otimes l;m\in M, l\in L)=\Image(f\otimes id_L: M\otimes_A L\to N\otimes_AL).$
\end{proof}
Remark: From homework, we see that in general $-\otimes_A L$ is NOT exact.
For example we take $0\to I \to A\to A/I\to0.$
$-\otimes_A L$ is right exact however we know that $A\otimes_A L\simeq L$ and $(A/I)\otimes_A L\simeq L/IL$ thus $A\otimes_AL\to (A/I)\otimes_A L$ is the quotient map $L\twoheadrightarrow L/IL$ but this would require an injective map $I\otimes_AL\to A\otimes_AL$ which is not always possible.
\subsubsection*{The Hom Functor is Left Exact}
Setup: $L\in Ob(A\text{-mod}),$ $\Hom_A(L,-):A\text{-mod}\to A\modd.$
\begin{proposition}{}{}
The $\Hom_A(L,-)$ functor is left exact.
\end{proposition}
\begin{proof}
Pick a short exact sequence $0\to M\overset{f}{\to}N\overset{g}{\to}Q\to0.$
We want: $0\to\Hom_A(L,M)\overset{f\circ?}{\to}\Hom_A(L,N)\overset{g\circ?}{\to}\Hom_A(L,Q)$ is exact.\\
By homework 3 problem 1, we have that $f$ is injective implies that $\Hom_A(L,M)\overset{f\circ?}{\to}\Hom_A(L,N)$ is injective.
We need to check that $\Image(f\circ?)=\ker(g\circ?).$
Equivalently this is to check that: 
for $\psi\in\Hom_A(L,N)$, the following are equivalent:
\begin{itemize}
    \item[(a)] $g\circ \psi=0\in \Hom_A(L,Q)$
    \item[(b)] $\psi=f\circ \psi'$ for some $\psi'\in \Hom_A(L,M)$
\end{itemize}
$(b)\Rightarrow (a)$ is obvious since for $\psi=f\circ \psi'$ we have $g\circ \psi = \underset{=0}{g\circ f}\circ \psi'=0.$\\
$(a)\Rightarrow (b)$ we have $g\circ \psi=0\iff \Image(\psi)\subseteq \ker(g)=\Image(f)\simeq M$
so we can view $\psi$ as a map $L\to M.$
\end{proof}
Remark: Problem 1 (2) in homework 3 shows that $\Hom_A(L,-)$ may not be exact.\\
Variant:
\begin{proposition}{}{}
$\Hom_A(-,L): A\modd^{opp}\to A\modd $ is left exact.
\end{proposition}
\begin{proof}
Take a short exact sequence $0\to M\overset{f}{\to}N\overset{g}{\to}Q\to0.$
We want: $0\to\Hom_A(Q,L)\overset{?\circ g}{\to}\Hom_A(N,L)\overset{?\circ f}{\to}\Hom_A(M,L)$ is exact.
The rest of the proof follows is "symmetric" to that of the previous proposition.
\end{proof}
\section*{Lecture 20}
\subsection*{Projective and Flat Modules}
The failure of $\otimes$ and $\Hom$ to be exact functors gives rise to flat and projective modules.
 
\begin{itemize}
    \item For $P\in Ob(A\modd),$ we say that $P$ is \textbf{\textcolor{RubineRed}{projective}} if $\Hom_A(P,-):A\modd\to A\modd$ is exact.
    \item For $L\in Ob(A\modd),$ we say that $L$ is \textbf{\textcolor{RubineRed}{flat}} if $L\otimes_A-:A\modd\to A\modd$ is exact.
\end{itemize}
 
Trivial example: $A$ (as an $A$-module) is both projective and flat since $A\otimes_A M\simeq M, \Hom_A(A,M)\simeq M.$\\
\textit{Question:} More interesting examples? Before answering this, we need to develop a little more theory.
\subsection*{Basic Properties of Left/Right Exact Functors}
\begin{lemma}{}{}
Let $F:A\modd\to B\modd$ be left exact.
Then 
\begin{itemize}
    \item[(i)] $F$ sends injections to injections.
    \item[(ii)] $F$ sends left exact sequences to left exact sequences.
    \item[(iii)] $F$ is exact $\iff$ $F$ sends surjections to surjections.
\end{itemize}
\end{lemma}
\begin{proof}
$\empty$
\begin{itemize}
    \item[(i)] Obvious
    \item[(iii)] Trivial
    \item[(ii)]
\end{itemize}
\end{proof}
We can formulate the analog of the previous lemma for right exact functors.
\subsection*{An Interesting Class of Flat Modules}
\begin{theo}{}{}
Let $S\subset A$ be an MC subset. $A_S$ is an $A$-module/$A$-algebra.
The two functors are isomorphic:
\begin{itemize}
    \item $(-)_S:A\modd\to A_S\modd$
    \item $-\otimes_AA_S:A\modd\to A\modd$
\end{itemize}
\end{theo}
\begin{proof}
It suffices to show that both functors are left adjoint to the forgetful functor $$\text{For}:A_S\modd\to A\modd$$
\begin{itemize}
    \item For $-\otimes_A A_S$, this is given by Lecture 18.
    \item For $(-)_S$, this follows from the following fact: $\forall N'\in Ob(A_S\modd), \; \forall M\in Ob(A\modd)$
    there is a natural isomorphism $\Hom_{A_S}(M_S,N')\overset{\sim}{\to}\Hom_A(M,N').$
    Construction:
    $$[\varphi:M_S\to N']\longmapsto [M\overset{\iota_M}{\to}M_S\overset{\varphi}{\to}N']$$
    $$[M_S\overset{\psi_s}{\to}N_S'=N']\begin{tikzcd}
{} & {} \arrow[l, maps to]
\end{tikzcd} [M\overset{\psi}{\to}N'].$$
\end{itemize}
\end{proof}
\begin{corollary}{}{}
For any MC subset $S\subset A$ $A_S$ is a flat $A$-module.
\end{corollary}
\subsection*{Projective Modules}
\begin{proposition}{}{}
For any free module $A^{\oplus I}$ is a projective $A$-module.
\end{proposition}
\begin{proof}
Note that for any $M\in Ob(A\modd)$ there is a natural isomorphism. $\Hom_A(A^{\oplus I},M)\overset{\sim}{\to} M^{\times I}$ via $[\varphi:A^{\oplus I}\to M]\mapsto (\varphi(e_i))_{i\in I}$ so the functors $\Hom_A(A^{\oplus I},-)$ and $(-)^{\times I}$ are isomorphic.
Take a surjection $M\twoheadrightarrow N.$ 
We want to show that $\Hom_A(A^{\oplus I},M)\to \Hom_A(A^{\oplus I},N)$ is surjective.
This is equivalent to $M^{\times I}\overset{\varphi^{\times I}}{\to } N^{\times I}$ is surjective, which follows from the surjectivity of $\varphi.$
\end{proof}
\begin{theo}{}{}
Take $P\in Ob(A\modd).$ The following are equivalent:
\begin{itemize}
    \item[(1)] $P$ is a projective $A$-module.
    \item[(2)] For any surjective $\pi: M\twoheadrightarrow P$ of $A$-modules there exists $\iota:P\to M$ such that $\pi \circ \iota=id_P$
    \item[(3)] There exists an $A$-module $P'$ such that $P\oplus P'$ is a free $A$-module.
\end{itemize}
\end{theo}
\begin{proof}
$(1)\Rightarrow (2).$
If $M\twoheadrightarrow P$ is surjective then by the lemma above $\Hom_A(P,M)\overset{\pi\circ?}{\twoheadrightarrow} \Hom_A(P,P)$ is surjective.
We get that $id_P\in \Hom_A(P,P)$ can we written as $\pi \circ \iota$ with $\iota\in \Hom_A(P,M).$\\
$(2)\Rightarrow (3).$ Pick a set of generators of $P$, so that we have $A^{\oplus I}\overset{\pi}{\twoheadrightarrow} P$ (surjective).  By (2), we have $\iota:P\to A^{\oplus I}$  with $\pi\circ \iota=id_P$ therefore $\iota$ is injective and $A^{\oplus I}\simeq \ker(\pi)\oplus P.$\\
$(3)\Rightarrow (1).$ By the proposition above we know that $P\circ P'\simeq A^{\oplus I}$ is projective.\\
Claim: Let $P_1, P_2$ be $A$-modules. The following are equivalent:
\begin{itemize}
    \item[(a)] $P_1$ and $P_2$ are both projective.
    \item[(b)] $P_1\oplus P_2$ is projective.
\end{itemize}
\textit{Proof of Claim:} We can check that the two functors are isomorphic:
$\Hom_A(P_1,-)\times \Hom_A(P_2, -):A\modd\to A\modd$ and $\Hom_A(P_1\oplus P_2, -): A\modd\to A\modd.$
Using this, for any surjection $M\overset{f}{\to}M$ we have the commutative diagram
\begin{tikzcd}
{\text{Hom}_A(P_1\oplus P_2, M)} \arrow[d, "f\circ?"] & \simeq & {\text{Hom}_A(P_1,M)\times \text{Hom}_A(P_2,M)} \arrow[d, "{(f\circ?,f\circ?')}"] \\
{\text{Hom}_A(P_1\oplus P_2,M')}                      & \simeq & {\text{Hom}_A(P_1,M')\times \text{Hom}_A(P_2,M')}                                
\end{tikzcd}
$(b)\iff$ right vertical arrow is surjective for every surjective $f.$\\
$(a)\iff$ left vertical arrow is surjective for every
\end{proof}
\subsubsection*{More on Flat Modules}
\begin{proposition}{}{}
\begin{itemize}
    \item[(1)] $A^{\oplus I}$ is flat
    \item[(2)] Projective modules are flat.
\end{itemize}
\end{proposition}
\begin{proof}
Soon/pset9
\end{proof}
\section*{Lecture 21}
\subsection*{Projective Modules over Local Rings}
Recall from pset 6, problem 2 that a ring $A$ is called a local ring if it has a unique maximal ideal $m\subset A.$
Examples of local rings are provided by localizations at prime ideals $A_S$ where $S=A\setminus p$ where $p$ is a prime ideal
\begin{theo}{}{}
If $A$ is a local ring and $P$ is a finitely generated $A$-module, then $P$ is free.
\end{theo}
\begin{proof}
$\empty$\\
\underline{Step 1:} We first establish Nakayama's Lemma.
\begin{lemma}{}{}
Let $(A,m)$ be a local ring and $M$ be a finitely-generated $A$-module.
If the submodule $mM\subseteq M$ coincides with $M,$ then $M=0.$
\end{lemma}
\begin{proof}
Pick $m_1,m_2,...,m_k$ generators of $M.$ 
Note that $M=mM \iff \exists a_{ij}\in m\;\; (i,j=1,2,...,k)$ such that $m_i=\displaystyle\sum_{j=1}^k a_{ij}m_j.$
We can write this as a matrix equation: $$[Id_k -R]\begin{bmatrix} m_1 \\ m_2 \\ \vdots \\ m_k \end{bmatrix}=0$$
where $R=(a_{ij})\in Mat_{k}(m).$
Multiplying to the left by the adjoint matrix $R'$ (that is, $R'\cdot R=\det(R)Id_k$) we get that $$\det(Id_k-R)\cdot m_i=0 \;\;\forall i\in\{1,2,...,k\}$$
Therefore $$\det(Id_k-R)\cdot m=0\;\;\forall m\in M.$$
Now we note that $\det(Id_k-R)=1-r$ with $r\in m$ which has to be a unit since $m$ is the only maximal ideal in $A.$
Hence $M=0.$
\end{proof}
\underline{Step 2:} We consider $P/mP$ as a $(A/m)$-vector space.
Since $P$ is finitely generated, $P/mP$ is a finite dimensional vector space.
We pick an $(A/m)$-linear isomorphism: $$\theta:(A/m)^{\oplus l}\overset{\sim}{\to}P/mP.$$
This, combined with $$A^{\oplus l}\twoheadrightarrow (A/m)^{\oplus l}$$ induces a morphism $A^{\oplus l}\overset{\varphi}{\twoheadrightarrow} P/mP.$
Since  $A^{\oplus l}$ is a projective $A$-module, we know that $\varphi$ can be lifted to $\widetilde{\varphi}:A^{\oplus l}\to P$ as in the commutative diagram:
\begin{tikzcd}
P \arrow[rr, two heads] &                                                                                     & P/mP \\
                        & A^{\oplus l} \arrow[ru, "\varphi"] \arrow[lu, "\exists\widetilde{\varphi}", dotted] &     
\end{tikzcd}
\underline{Step 3:} We apply the Nakayama lemma.
We have obtained an $A$-linear map $\widetilde{\varphi}:A^{\oplus l}\to P$ with $l=\dim(P/mP)$ as an $(A/m)$-vector space.\\
Claim 1: $\widetilde{\varphi}$ is a surjection.\\
In fact, $\widetilde{\varphi}$ induces the isomorphism $(A/m)^{\oplus l}\overset{\theta}{\to}P/mP.$ Hence claim 1 follows from the general lemma:
\begin{lemma}{}{}
Let $(A,m)$ be a local ring and $M$ and $N$ be $A$-modules. If $f:M\to N$ induces a surjection $\overline{f}:M/mM\to N/mN$, then $f$ is a surjection too. 
\end{lemma}
\begin{proof}
Homework 10
\end{proof}
Claim 2: $\widetilde{\varphi}$ is also an injection.\\
In fact, we write $0\to K\to A^{\oplus l}\overset{\widetilde{\varphi}}{\to}P\to0$ with $K=\ker(\widetilde{\varphi}).$
Since $P$ is projective, by Lecture 20 we have $A^{\oplus l}\simeq P\oplus K.$
Therefore using the "modulo $m$" trick we obtain $$(A/m)^{\oplus l}\simeq (P/mP)\oplus (K/mK)$$ as $(A/m)$-vector spaces.
Therefore $K/mK=0$ (since $\dim(P/mP)=l$) and so $mK=K$ which, by Nakayama's lemma, implies that $K=0.$
\end{proof}
\subsection*{Algebraic Subsets}
\textit{We now take an algebraic geometry tangent.}\\
Remark: For this part, we will work with the field of complex numbers $\mathbb{C}.$ 
However, we note that most of the theory actually works for an arbitrary algebraically closed field.\\
Set: $A=\mathbb{C}[X_1,X_2,...,X_n].$
For any ideal $I\subset A$, we can consider the "vanishing set" of $I$:
\begin{itemize}
    \item $V(I):=\{(t_1,t_2,..,t_n)\in\mathbb{C}^n|f(t_1,...,t_n)=0\text{ for any } f\in I\}$
    \item $V(I)$ is naturally a subset of $\mathbb{C}^n.$
\end{itemize}
 
A subset $S\subset \mathbb{C}^n$ is called an \textbf{\textcolor{RubineRed}{algebraic subset}} if $S=V(I)$ for some ideal $I.$
 
Examples:
\begin{itemize}
    \item $\mathbb{C}^n$ is an algebraic subset of $\mathbb{C}^n$, since it is $V(0).$
    Similarly, $\varnothing\subset \mathbb{C}^n$ is an algebraic subset since it is $V(1).$
    \item Any finite set $\{p_1,p_2,...,p_k\}\subseteq \mathbb{C}^1$ is algebraic, since it is $V((x-p_1)(x-p_2)...(x-p_k)).$
    \item Any infinite set in $\mathbb{C}^1$ is NOT algebraic.
\end{itemize}
The examples above provide a complete description of algebraic subsets in $\mathbb{C}^1.$
They are $\varnothing, \mathbb{C}^1$, and finite subsets.\\
For $n\geq 2$ the structure of algebraic subsets is more complicated. The complexity of algebraic subsets is almost the same as the complexity of ideals in $A=\mathbb{C}[X_1,X_2,...,X_n].$
Before moving on, we note:
\begin{proposition}{}{}
Every algebraic subset of $\mathbb{C}^n$ is of the shape $V(f_1,f_2,...,f_k).$
\end{proposition}
\begin{proof}
By the Hilbert Basis Theorem, the ring $A$ is Noetherian.
Hence every ideal is generated by finitely many elements.
\end{proof}
Remark: $v(f_1,...,f_k)$ is the same as the set $\{p\in\mathbb{C}^n|\; f_1(p)=f_2(p)=...=f_k(p)=0\}.$\\
We will now consider the correspondence $$\underset{\textcolor{blue}{\text{geometry}}}{\text{Algebraic subsets}}\longleftrightarrow \underset{\textcolor{blue}{\text{algebra}}}{\text{ideals}}$$
From an ideal $I\subset A$, we can get an algebraic subset $V(I).$\\
From an algebraic subset $S\subset \mathbb{C}^n$, we can get an ideal $$I(S)=\{f\in A| f(p)=0 \;\forall p\in S\}.$$
If we start with $S=V(I)$ then $I(V(I))\subset A$ may not be the original ideal $I$! 
For example $I=(x^2)\subset \mathbb{C}[x]$ but $I(V(I))=(x)\subset \mathbb{C}[x].$
The Hilbert Nullstellensatz makes this relation precise.
\begin{theo}{Hilbert Nullstellensatz}{}
$I(V(I))=\sqrt{I}$
\end{theo}
\section*{Lecture 22}
\subsection*{Hilbert Nullstellensatz}
In this section we give a proof to the Hilbert Nullstellensatz stated last time. \\
It is clear that $\sqrt{I}\subset I(V(I))$ 
If $f\in \sqrt{I}$ then $f^n\in I$ hence $f^n|_{V(I)}=0$ thus $f|_{V(I)}=0.$
It suffices to show that $I(V(I))\subseteq \sqrt{I}.$ That is, if $f|_{V(I)}=0$, then $f^N\in I.$
We will reduce this to a purely algebraic theorem.
 
    We say that a ring $B$ is a \textbf{\textcolor{RubineRed}{finitely generated $A$-algebra}}, if $\exists n>0$, and a surjective ring homomorphism $A[x_1,x_2,...,x_n]\twoheadrightarrow B$
 
Remark: 
Obviously $B$ is an $A$-algebra by $A\hookrightarrow A[x_1,...,x_n]\twoheadrightarrow B.$\\
A finitely generated $A$-algebra may not be a finitely generated module.
\begin{theo}{}{}
Assume $L/K$ is a field extension with $K$ an infinite field. If $L$ is a finitely generated $K$-algebra, then $L/K$ is a finite extension.
\end{theo}
\begin{proof}[Proof of Nullstellensatz]
We will assume the theorem above and show that the Hilbert Nullstellensatz follows.\\
\underline{Step 1:}\\
Claim: If $I\subseteq A$ is an ideal such that $I\neq A$, then $V(I)\neq \varnothing.$
\begin{proof}{Proof of Claim}
For $I\subseteq I'$, we have $V(I)\supseteq V(I').$ Therefore, it suffices to prove the claim for maximal ideals on $\mathbb{C}[x_1,x_2,...,x_n].$
Set $L:=\mathbb{C}[x_1,...,x_n]/m$ (it is a field since $m$ is maximal)
\begin{center}
\begin{tikzcd}
\mathbb{C} \arrow[rr, hook] \arrow[rrrr, "\mathbb{C}\text{ is a subfield of }L"', bend right] &  & {\mathbb{C}[x_1,...,x_n]} \arrow[rr, two heads] &  & {\mathbb{C}[x_1,...,x_n]/m=L}
\end{tikzcd}
\end{center}
By the theorem above $L/\mathbb{C}$ is a finite extension. 
Hence $L=\mathbb{C}$ ($\mathbb{C}$ is algebraically closed!)
Therefore, $\forall i\in\{1,2,...,n\} \; \exists a_i\in\mathbb{C}$ such that 
$$\underset{a_i}{\mathbb{C}}\underset{\longmapsto}{\overset{\sim}{\longrightarrow}} \underset{\overline{x_i}}{\mathbb{C}[x_1,...,x_n]/m}$$
So $m$ contains $x_i-a_i\in\mathbb{C}[x_1,...,x_n]\;\forall i=1,...,n.$
Hence $(x_1-a_1,...,x_n-a_n)\subseteq m.$
However, $(x_1-a_1,...,x_n-a_n)$ is already a maximal ideal thus $m=(x_1-a_1,...,x_n-a_n)$ and $V(m)=(a_1,...,a_n)\in\mathbb{C}^n$ is a single point.
\end{proof}
\underline{Step 2:}\\
Claim 2: Claim 1 implies the Nullstellensatz.
\begin{proof}
By the Hilbert Basis Theorem assume $I=(f_1,f_2,...,f_r).$
We want to prove: if $g|_{V(f_1,...,f_r)}=0$, then $\exists N>0$ such that $g^N\in \text{Span}_A(f_1,f_2,...,f_r).$
Trick: We consider a new ideal $J$ in $A[y]=\mathbb{C}[x_1,...,x_n,y]$,  $J=(f_1,f_2,...,f_r, gy-1)\subseteq A[y].$
We look at $V(J)\subseteq \mathbb{C}^{n+1}.$\\
Claim: $V(J)=\varnothing.$\\
Reason: $g$ vanishes at where $f_1,...,f_r$ all vanish. Therefore it is impossible that $f_1,...,f_r$ and $gy-1$ vanish simultaneously.
In particular, we know from step 1 that $J=A[y]$ thus $1\in A[y]$ is an $A[y]$-linear combination of $f_1,...,f_r,gy-1.$
So $1=\displaystyle\sum_{i=1}^r r_if_i +u(gy-1)$ which is an identity in the polynomial ring $A[y]=\mathbb{C}[x_1,...,x_n,y].$ Therefore it is really a match of coefficients of monomials.
We set $y=\dfrac{1}{g}$ and get $1=\displaystyle\sum_{i=1}^r r_i(x_1,..,x_r,\dfrac{1}{g})f_i$ in $\mathbb{C}(x_1,...,x_r)).$
Multiplied by a large power of $g$ we get that some power of $g$ lies in $(f_1,...,f_r).$
\end{proof}
\end{proof}
\subsection*{Integral Elements}
We do some preparation for proving the theorem from the previous section.
Setup: Let $A\subset B$ be a subring, $B$ is an integral domain.  $B$ is an $A$-algebra $A\hookleftarrow B.$
 
We say that $b\in B$ is \textbf{\textcolor{RubineRed}{integral over $A$}} if $\exists f\in A[x]$ with leading coefficient $1,$ such that $f(b)=0.$
 
\begin{theo}{}{}
Let $A\subseteq B$ as before. The following are equivalent:
\begin{itemize}
    \item[(a)] $b\in B$ is integral over $A.$
    \item[(b)] $A[b]\subseteq $ is a finitely generated $A$-module.
    \item[(c)] There exists a subring $B'\subseteq B$ containing $A[b],$ which is a finitely generated $A$-module.
\end{itemize}
\end{theo}
\begin{corollary}{}{}
$A\subseteq B$ as before.
$\{\text{Integral elements in }B\text{ over }A\}\subset B$ is a subring.
\end{corollary}
\begin{proof}
soon!
\end{proof}
\section*{Lecture 23}
Hilbert Nullstellensatz for $I\subseteq \mathbb{C}[x_1,...,x_n]$ gives $I(V(I))=\sqrt{I}.$
Last time we reduced Hilbert Nullstellensatz to Zariski's Lemma.
\begin{theo}{Zariski's Lemma}{}
Let $L/K$ be a field extension with $K$ an infinite field. $L$ is a finitely generated $K$-algebra ($K[x_1,...,x_m]\twoheadrightarrow L$ ring surjetion).
Then $L/K$ is a finite extension.
\end{theo}
\begin{proof}
We can write $L=K[v_1,v_2,...,v_n]$ where $v_i\in L.$
We do induction on $n.$\\
$n=1.$ Then $K[x]\overset{h}{\twoheadrightarrow}K[v]=L$ via $x\mapsto v$ therefore $L=K[x]/\ker(h)=K[x]/(f).$\\
Since $L$ is a field, $f\neq0.$
Therefore, $v$ is integral over $K$ hence $L=K[v]$ is a finitely generated $K$-module.\\
Now assume the result holds for $n.$ We want to show it for $$L=K[v_1,v_2,...,v_{n+1}]$$
Note that $L$ is a field, so $$L=K(v_1)[v_2,v_3,...,v_{n+1}]$$
We can apply the inductive hypothesis to obtain that $L/K(v_1)$ is a finite extension.
\begin{itemize}
    \item If $v_1$ is algebraic over $K$, then $K(v_1)/K$ is also a finite extension. So $L/K$ is a finite extension.
    \item If $v_1$ is NOT algebraic over $K,$ then $K(v_1)\simeq K(x)$ ($=\text{Frac} K[x]$).
    This is impossible (left as exercise to the reader)
\end{itemize}
\end{proof}
\end{document} 