\documentclass[11pt]{article}

\usepackage{amsmath,amssymb,amsthm}

\usepackage{xcolor}

%\usepackage{systeme}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[total={6in,8in}]{geometry}


\theoremstyle{definition}
\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{eg}[thm]{Example}
\newtheorem{ex}[thm]{Exercise}
\newtheorem{defn}[thm]{Definition}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{remark}[thm]{Remark}
\newtheorem{question}[thm]{Question}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz}
\usepackage{tikz-cd}
\tikzstyle{ball} = [circle,shading=ball, ball color=black,
    minimum size=1mm,inner sep=1.3pt]
\tikzstyle{miniball} = [circle,shading=ball, ball color=black,
    minimum size=1mm,inner sep=0.5pt]
\tikzstyle{mminiball} = [circle,shading=ball, ball color=black,
    minimum size=0.6mm,inner sep=0.1pt]
\usetikzlibrary{arrows.meta}
\tikzset{>={Latex[length=2mm,width=1.5mm]}}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\usetikzlibrary{decorations.pathmorphing}    
\usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{arrows.meta,calc}
\usetikzlibrary{bending}
\usetikzlibrary{decorations.markings,shapes.geometric}
\tikzset{->-/.style={decoration={markings, mark=at position #1 with
  {\arrow{>}}},postaction={decorate}}}
\tikzset{-|-/.style={decoration={markings, mark=at position #1 with
  {\arrow{stealth}}},postaction={decorate}}}
\tikzset{movearrow/.style 2 args ={
        decoration={markings,
	  mark= at position {#1} with {\arrow{#2}} ,
        },
        postaction={decorate}
    }
}

%\usepackage{graphicx}

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage{enumitem}
%\setlist[enumerate]{leftmargin=*}
\setlist[enumerate]{itemsep=1pt}

%\allowdisplaybreaks

\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

%\usepackage{algorithm}
%\usepackage[noend]{algpseudocode}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\W}{\mathbb{W}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\newcommand{\incid}{\mathcal{I}(P)}
\newcommand{\tL}{\widetilde{L}}
\newcommand{\tV}{\widetilde{V}}
\newcommand{\F}{\mathcal{F}}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\wt}{\mathrm{wt}}
\DeclareMathOperator{\trace}{\mathrm{tr}}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\Sym}{\mathrm{Sym}}
\DeclareMathOperator{\Hom}{\mathrm{Hom}}
\DeclareMathOperator{\diag}{\mathrm{diag}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}
\DeclareMathOperator{\Div}{\mathrm{Div}}
\DeclareMathOperator{\Pic}{\mathrm{Pic}}
\DeclareMathOperator{\Jac}{\mathrm{Jac}}
\DeclareMathOperator{\cok}{\mathrm{cok}}
\DeclareMathOperator{\sgn}{\mathrm{sgn}}
\DeclareMathOperator{\outdeg}{\mathrm{outdeg}}
\DeclareMathOperator{\supp}{\mathrm{supp}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 361 lecture for Wednesday, Week 1}
\bigskip

\centerline{\textsc{Rings}}
\bigskip

This lecture will be a summary of the basic theory of rings required for this
course.  Do not be discouraged if you cannot absorb all of the information at
once.  These are concepts you will gradually understand by working with myriad 
examples throughout this course.  You are already familiar with many
rings: the ring of integers, $\Z$; polynomial rings, e.g., $\Q[x]$, $\R[x]$,
$\Q[x,y,z]$; quotient rings such as $\Z/n\Z$; and any field, e.g., $\Q$, $\R$,
or~$\C$.  A (nonzero) ring is just a field except that nonzero elements are not
required to have multiplicative inverses.  For example, $2\in \Z$ has no
multiplicative inverse in $\Z$. Check each concept introduced below against
the rings you already know.

\begin{defn}
  A \emph{ring} is a set $R$ with two operations,
  addition $+\colon R\times R\to R$ and multiplication $\cdot\colon R\times R\to
  R$ satisfying the following axioms:
  \begin{enumerate}
    \item[A1.] $a+b=b+a$ for all $a,b\in R$ (commutativity of addition).
    \item[A2.] $a+(b+c)=(a+b)+c$ for all $a,b,c\in R$ (associativity of addition).
    \item[A3.] There exists and element $0\in R$ such that $a+0=a$ for all $a\in R$ (additive
      identity).
    \item[A4.] For each $a\in R$ there exists an element $b\in R$ such that $a+b=0$
      (additive inverses) [The element $b$ is denoted $-a$.  We then define
      \emph{subtraction} by $x-y:= x+(-y)$ for all $x,y\in R$.]
  \end{enumerate}
  (In the following, we follow the usual convention of writing $ab$ for $a\cdot b$.)
  \begin{enumerate}
    \item[M1.] $ab=ba$ for all $a,b\in R$ (commutativity of multiplication).
    \item[M2.] $a(bc)=(ab)c$ for all $a,b,c\in R$ (associativity of
      multiplication).
    \item[M3.] There exists an element $1\in R$ such that $a1=a$ for all $a\in
      R$ (multiplicative identity).
    \item [D.] For all $a,b,c\in R$, we have $(a+b)c=ac+bc$.
  \end{enumerate}
   
\end{defn}

Properties A1--A4 say that $R$ is an \emph{abelian group} under addition. So a
ring satisfies all of the field axioms except we do not require $1\neq 0$ and we
do not require that nonzero elements have multiplicative inverses. (Check that
if $1=0$, then the ring only has one element.)  There are also useful
noncommutative rings in which we do not require that multiplication is
commutative.  What we have called a ring is sometime called a \emph{commutative ring
with unity}.

\begin{defn}
  An \emph{integral domain} is a nonzero commutative ring with no zero divisors.
  In other words, $1\neq 0$ and if $a,b\in R$ with $ab=0$, then either~$a=0$ or
  $b=0$. 
\end{defn}

\begin{ex}
  The ring~$\Z/12\Z$ is not an integral domain.  What are its zero
  divisors?  What are the zero divisors in $\Z/n\Z$ for arbitrary $n$?
  When is $\Z/n\Z$ an integral domain?
\end{ex}

\begin{ex}
  The \emph{cancellation law} holds in an integral domain.
  Let $a,b,c$ be elements in an integral domain~$R$.  Show that if $ab=ac$ and
  $a\neq0$, then $b=c$.
\end{ex}
\bigskip

\centerline{\textsc{Ideals}}
\begin{defn}
  A nonempty subset $I$ of a ring~$R$ is an \emph{ideal} if
  \begin{enumerate}
    \item $I$ is closed under addition, and
    \item if $r\in R$ and~$a\in I$, then $ra\in I$.
  \end{enumerate}
\end{defn}

\begin{defn}
  An ideal $I$ in a ring $R$ is \emph{generated by} $a_{1},\ldots,a_{n}\in R$ if
  every element of $I$ is an $R$-linear combination of elements of
  $a_{1},\ldots,a_{n}$, i.e., for all $a\in I$, we can write
  \[
    a = \sum_{i=1}^{n} r_ia_i
  \]
  for some elements~$r_{i}\in R$.  We then write
  \[
    I = (a_{1},\ldots,a_{n}).
  \]
  We say $I$ is a \emph{principal ideal} if it can be generated by a single
  element, i.e., if there exists $a\in R$ such that $I=(a)=\{ra:r\in R\}$, all
  multiples of a single element~$a$ of $R$.
\end{defn}

\begin{defn}
  An integral domain $R$ in which every ideal is principal is called a
  \emph{principal ideal domain}, abbreviated PID.
\end{defn}

\begin{defn}
  An ideal $I$ in a ring $R$ is \emph{maximal} if $I\neq R$, and the only ideal
  of $R$ properly containing $I$ is $R$, itself.  In other words, if $J$ is an
  ideal of $R$ and $J\supsetneq I$, then $J=R$.
\end{defn}

\begin{ex}
  An ideal $I$ in a ring $R$ is maximal if and only if $R/I$ is a field.
\end{ex}
\bigskip

\centerline{\textsc{Homomorphisms}}
\begin{defn}
  A mapping $\phi\colon R\to S$ between rings $R$ and $S$ is a
  \emph{(ring) homomorphism} if it preserves the ring operations, i.e.,
  for all $a,b\in R$,
  \[
    \phi(a+b)=\phi(a)+\phi(b)\quad\text{and}\quad \phi(ab)=\phi(a)\phi(b).
  \]
  In that case, the \emph{kernel} of $\phi$ is
  \[
    \ker(\phi):=\{r\in R: \phi(r)=0\},
  \]
  and the \emph{image} of $\phi$ is
  \[
    \im(\phi):=\phi(R):=\{\phi(r):r\in R\}.
  \]
  The homomorphism $\phi$ is an \emph{isomorphism} if it is bijective.
\end{defn}

\textbf{Note:} ``kernal'' is a common misspelling of the word ``kernel''.

\begin{ex}  Let $\phi:R\to S$ be a ring homomorphism.
  \begin{enumerate}
    \item $\phi(0)=0$ (where we are being sloppy with notation: the first $0$ is the additive identity of $R$ and
      the second is the additive identity of $S$).
    \item The kernel of $\phi$ is an ideal of $R$.
    \item The image of $\phi$ is not necessarily an ideal of $S$.
    \item $\phi$ is injective if and only if $\ker(\phi)=\{0\}$.
    \item $\phi$ is an isomorphism if and only if its kernel is trivial (i.e.,
      equal to $\{0\}$) and its image is $S$.
    \item If $\phi$ is bijective, its inverse (as a mapping of sets) is
      necessarily a ring homomorphism.
  \end{enumerate}
\end{ex}
\bigskip

\centerline{\textsc{Quotient rings}}
\begin{defn}
  Let $I$ be an ideal in a ring $R$.  The \emph{cosets} of $I$ are the sets of
  the form $a+I:=\{a+i: i\in I\}$ for each~$a\in R$.  The collection of cosets
  naturally forms a ring where
  \[
    (a+I)+(b+I):=(a+b)+I\quad\text{and}\quad(a+I)(b+I):=ab+I.
  \]
  This ring of cosets is called a \emph{quotient ring} and is denoted $R/I$.
\end{defn}

\begin{remark}
  Think about general quotient rings in the same way you think about $\Z/nZ$.
  The ring~$R/I$ is just the ring $R$ after setting all of the elements of $I$
  equal to $0$.  Another way to think about $R/I$ is as a collection of
  equivalence classes: say $a,b\in R$ are equivalent if they differ by an
  element of $I$, i.e., $a=b+i$ of some element $i\in I$, i.e., $a-b\in I$.
  It is typical to denote the equivalence class of $a$ by $\overline{a}$.  We
  can then write~$a=b\bmod I$ if $\overline{a}=\overline{b}$, i.e., if $a-b\in
  I$.
\end{remark}

\begin{defn}
  If $I$ is an ideal of $R$, define the \emph{(canonical) quotient mapping}
\begin{align*}
  \pi\colon R&\to R/I\\
  a&\mapsto \overline{a}=a+I.
\end{align*}
\end{defn}

\begin{ex}
  Check that the quotient mapping $\pi\colon R\to R/I$ is a surjective
  homomorphism with kernel $I$.
\end{ex}

\begin{ex}
  If $\phi\colon R\to S$ is a ring homomorphism, then $\im(\phi)$ is a ring with
  unity $\phi(1)$, and there is a well-defined isomorphism
  \begin{align*}
    \overline{\phi}\colon R/\ker(\phi)&\to\im(\phi) \\
    a+\ker(\phi)&\mapsto \phi(a).
  \end{align*}
\end{ex}
\bigskip

\centerline{\textsc{Divisibility in rings}}

\begin{defn} 
  Let $a,b$ be elements of a ring $R$. Then $a$ divides $b$ (in $R$) if
  there exists $c\in R$ such that~$b=ac$.   If $a$ divides $b$, we write~$a|b$.
\end{defn}

\begin{defn}
  Let $R$ be a ring. 
  \begin{enumerate}
    \item An element $u\in R$ is a \emph{unit} if it has a multiplicative
      inverse. (In other words, there exists $v\in R$ such that $uv=1$.
      Equivalently, $u|1$)
    \item An element $p\in R$ is \emph{prime} if is $p$ not a unit, $p\neq0$, and whenever
      $p|ab$, for some elements $a,b\in R$, then either $p|a$ or $p|b$.
    \item An element $p\in R$ is \emph{irreducible} if $p$ is not a unit, $p\neq
      0$, and whenever $p=ab$ for some elements $a,b\in R$, then either $a$ or
      $b$ is a unit. 
  \end{enumerate}
\end{defn}

\begin{ex}
  Let $p$ be a prime in an integral domain.  Then $p$ is irreducible.
\end{ex}

\begin{eg}
  The element $2\in \Z$ is prime, but it factors into primes in $\Z[i]$ as
  $2=(1+i)(1-i)$.  Similarly, $x^{2}+1$ is prime in $\R[x]$ but factors into
  primes $x^2+1=(x+i)(x-i)\in \C[x]$.
\end{eg}

\begin{prop}
  Let $R$ be a principal ideal domain, and let $r\in R$.  Then $r$ has a
  factorization 
  \[
    r = u\prod_{n=1}^{k} p_{i}^{e_{i}}
  \]
  where $u$ is a unit, the $p_{i}$ are prime, each $e_{i}$ is a positive
  integer, and $k\in \N$.  The factorization
  is unique in the following sense; if $r=v \prod_{i=1}^{\ell} q_{i}^{f_{i}} $
  for some unit $v$, primes~$q_{i}$, positive integers~$f_{i}$, and $\ell\in\N$,
  then $k=\ell$ and up to re-indexing, $p_{i}=u_{i}q_{i}$ with $u_{i}$ a unit
  and $e_{i}=f_{i}$ for all~$i$.
\end{prop}
\begin{proof}
 Math 332.
\end{proof}

\begin{remark}
  A domain in which each element has a prime factorization as above is called a
  \emph{unique factorization domain}, or UFD, for short.  So the above
  proposition says that a PID is a UFD.  To get a better sense of the meaning of
  unique factorization, consider the two factorizations into primes in~$\Z$: we have $12 =
  2\cdot3$ and $12=-2\cdot(-3)$.  In the first factorization, the unit is $1$
  and the primes are~$2$ and~$3$.  In the second factorization, the unit is $-1$
  and the primes are~$2$ and~$-3$.  Note that $3 = (-1)(-3)$.  So the primes~$3$
  and~$-3$ are the same up to multiplication by a unit.
\end{remark}

\begin{eg}
  It turns out that if $K$ is a field and $n>1$, then $K[x_{1},\ldots,x_{n}]$ is
  a UFD but not a PID.  (For instance, in $\R[x,y]$, the ideal $(x,y)$ cannot be
  generated by a single element.)
\end{eg}

\textbf{Proposition.} In a principal ideal domain, an element is prime if and
only if it is irreducible.
\begin{proof}
 Math 332.
\end{proof}

\begin{defn}
  Let $R$ be a PID.  A \emph{greatest common divisor} of
  $a,b\in R$ is an element $d\in R$ such that
  \begin{enumerate}
    \item $d|a$ and $d|b$, and
    \item if $e\in R$ with $e|a$ and $e|b$, then~$e|d$.
  \end{enumerate}
  We write $\gcd(a,b)=d$.
\end{defn}

\begin{prop}
  Let $R$ be a PID, and let $a,b\in R$. Then
  \begin{enumerate}
    \item There exists a greatest common divisor~$d$ of $a,b$.
    \item $(a,b)=(d)$.
    \item There exist~$m,n\in R$ such that
      \[
        ma+nb=d.
      \]
    \item The greatest common divisors of $a,b$ are exactly the elements of the
      form $ud$
      where $u$ is a unit.
  \end{enumerate}
\end{prop}
\begin{proof}
 Since $R$ is a PID, there exists $d\in R$ such that $(a,b)=(d)$.  Since
 $a\in(d)$, There exists $c\in R$ such that~$a=cd$.  Thus, $d|a$.  Similarly,
 $d|b$.  Suppose $e$ is an element of $R$  such that $e|a$ and $e|b$.
 Since $d\in (a,b)$, there exist $m,n\in R$ such that~$d=ma+nb$.  Then, since
 $e|a$ and $e|b$, it follows that~$e|d$.  Thus, $d$ is a greatest common divisor
 of $a$ and $b$.  We have proved all but the last part of the proposition.

 Let $e$ and $d$ both be greatest common divisors of $a$ and $b$.  Then we
 have~$e|d$ and $d|e$.  So there exists $u,v\in R$ such that $e=ud$ and $d=ve$.
 It follows that
 \[
  d=ve=vud.
 \]
 Since $R$ is an integral domain, the cancellation law holds.  Therefore,
 \[
   vu=1.
 \]
 So $u$ is a unit.

 Finally, it is straightforward to check that if $d$ is a greatest common
 divisor of $a$ and $b$, and~$u$ is a unit in $R$, then~$du$ is also a greatest
 common divisor of $a$ and~$b$.
\end{proof}

\begin{cor}
  Let $R$ be a PID and suppose~$a,b\in R$ have no prime factors in common.
  Then there exist~$m,n\in R$ such that
  \[
    ma+nb=1.
  \]
\end{cor}
\begin{proof}
  Say the prime factorizations of $a$ and~$b$ are
  \[
    a = u \prod_{i=1}^{k} p_{i}^{e_{i}}\quad\text{and}\quad b = v
    \prod_{i=1}^{k} p_{i}^{f_{i}}.
  \]
  Then the following is a greatest common divisor of $a$ and $b$:
  \[
    \gcd(a,b)= \prod_{i=1}^{k} p_{i}^{g_{i}}
  \]
  where $g_{i}=\min\{e_{i},f_{i}\}$ for each~$i$.  In particular, if $a$ and
  $b$ have no prime factors in common, $\gcd(a,b)=1$, and the result follows
  from the preceding proposition.
\end{proof}

\begin{prop}
  Let $R$ be a PID, and let~$a\in R$.  Then the ideal $I=(a)$ is maximal if and
  only if $a$ is irreducible (and, hence, if and only if $a$ is prime).
\end{prop}
\begin{proof}
 First suppose that $I$ is maximal and assume that~$a = bc$.   It follows that
 $I=(a)\subseteq (b)$.  Since~$I$ is maximal, there are two choices: either
 $(a)=(b)$ or $(b)=R$.  If $(a)=(b)$, then there exists $d\in R$ such that
 $b=ad$.  But then, $a=bc=adc$.  Since $R$ is an integral domain, we can cancel
 $a$ to get $dc=1$, which shows that $c$ is a unit.  If $(b)=R$, then since
 $1\in R$, there exists $e\in R$ such that $eb=1$, in which case, $b$ is a unit.
 We have shown that if $I$ is maximal, then $a$ is irreducible.

 For the converse, suppose that $a$ is irreducible and that $J$ is an ideal of
 $R$ such that $J\supseteq I=(a)$.  Since $R$ is a PID, there exists $f\in R$ such
 that~$J=(f)$.  Then $J\supseteq I$ implies there exists $g\in R$ such
 that~$a=fg$.  Since $a$ is irreducible, either $f$ is a unit, in which
 case~$J=R$, or $g$ is a unit, in which case~$J=I$.  Hence, $I$ is maximal.
\end{proof}
\bigskip

\Needspace{3\baselineskip}
\centerline{\textsc{Division algorithm}}

\begin{prop}
 The ring $\Z$ is a principal ideal domain.
\end{prop}
\begin{proof}
 Let $I$ be an ideal in $\Z$.  If $I=(0)$, we are done.  Otherwise, let~$a$ be
 the smallest positive element of $I$.  Given any element $b\in I$, apply the
 division algorithm to find $q,r\in \Z$ such that
 \[
   b = aq+r
 \]
 with $0\leq r< a$.  Since $a,b\in I$, and $I$ is an ideal, 
 \[
   r = b-aq\in I.
 \]
 By the definition of $a$, it follows that $r=0$.  Hence, $b=aq$. We have shown
 that $I=(a)$.
\end{proof}

Let $R$ be a ring. The \emph{polynomial ring}~$R[x]$ of polynomials in $x$ with
coefficients in $R$ consists of elements of the form
\[
  f = \sum_{i=1}^{d} a_i x^{i}
\]
for some $a_{i}\in R$ and some $d\in\N$.  If $a_{d}\neq0$, we say the
\emph{degree} of $f$ is $d$, denoted $\deg(f)=d$.  We assume the reader is
familiar with addition and multiplication of polynomials.  If $R$ is a domain
(for instance, if $R$ is a field), then it is easy to check that 
\[
  \deg(fg)=\deg(f)+\deg(g)
\]
for any $f,g\in R[x]$.  The ring $R$ is a subset of $R[x]$.  The elements of
$R$ are exactly the polynomials in~$R[x]$ of degree $0$. 

\begin{prop} (Division algorithm)  Let $K$ be a field, and let $f,g\in K[x]$
  with $f\neq0$.  Then there exists $q,r\in K[x]$ such that
  \[
    g=fq+r
  \]
  where $0\leq\deg(r)<\deg(f)$.
\end{prop}
\begin{proof}
 Math 332.
\end{proof}

\begin{prop}
  Let $K$ be a field.  Then $K[x]$ is a principal ideal
  domain.
\end{prop}
\begin{proof}
 Let $I$ be an ideal in $K[x]$.  If $I=(0)$, we are done.  Similarly, if~$I$
 contains any nonzero element~$a$ of $K$, then $a$ has a multiplicative inverse
 $b\in K$.  By the definition of an ideal, since $a\in I$ and $b\in K\subset
 K[x]$, it follows that $ab=1\in I$.  It then follows that $I=(1)=K[x]$.  So
 again, $I$ is principal.  Now assume that $I\neq(0)$ and the only element of $K$ contained in
 $I$ is $0$.  So there exists an element~$f$ in $I$ of smallest positive degree.
 Given~$g\in I$, apply the division algorithm to find $q,r\in K[x]$ such that
 \[
   g = fq+r
 \]
 where $0\leq r<\deg(f)$.  Since $I$ is and ideal and $f,g\in I$, it follows
 that
 \[
   r = g-fq\in I.
 \]
 By definition of $f$, it follows that $\deg(r)=0$.  Hence, $r\in K\cap
 I=\{0\}$, i.e., $r=0$.  It follows that $g=fq$.  We have shown that $I=(f)$.  
\end{proof}
\end{document}
