
%  This are the class notes for Algebra I, 818, F00. 9/21/00



\chapter{Preface}

These are the lecture notes for the class MTH 818 which I'm currently 
teaching at Michigan State University. The text book used for this class is 
Hungerford' Algebra \cite{Hun}. Much of the contends follows Hungerford's 
book but  the proofs  given  here often diverge from Hungerford's.

\tableofcontents

\chapter{Group Theory}

\section{Latin Squares}\l{ls}
 
\begin{Def}\l{binaryop} Let $G$ be a set and $\phi: G\times G\to G$ a
map.
\begin{itemize}
\AI{a}  $\phi$ is called a \ei{binary operation} on $G$. We write $ab$ for
$\phi(a,b)$.  $(G,\phi)$ is called a \ei{pre-group}.
\AI{b} $e\in G$ is called an \ei{identity element} if $ea=ae=a$ for all 
$a\in G$. \AI{c} We say that $(G,\phi)$ is a \ei{Latin square} if for all 
$a,b$ in $G$ there exist unique elements $x,y$ in $G$ so that $$ ax=b\text{ 
and } ya=b$$ \AI{d} The \ei{multiplication table} of $(G,\phi)$ is the 
matrix $(ab)_{a\in G,b\in G}.$ \AI{e} The \ei{order} of $(G,\phi)$ is the 
cardinality $|G|$ of $G$.  \end{itemize} \end{Def}


We remark that $(G,\phi)$ is a latin square if and only if each $a\in G$
appears exactly once in each row and in each column of the multiplication
table.  If there is no confusion about the binary operation in mind, we
will just write $G$ for $(G,\phi)$ and call $G$ a pre-group




\begin{Def} Let $G$ and   $H$ be pre-groups and $\alpha:G\to H$ a map.
\begin{itemize}
\AI{a} $\alpha$ is called a (pre-group) \ei{homomorphism} if
$\alpha(ab)=\alpha(a)\alpha(b)$, for all $a,b\in G$.
\AI{b} $\alpha$ is
called an \ei{isomorphism} if $\alpha$ is a homomorphism and there exists a
homomorphism $\beta:H\to G$ with $\alpha\beta=\id_H$ and
$\beta\alpha=\id_G$.
\AI{c} $\alpha$ is an \ei{automorphism} if $G=H$ and
$\alpha$ is an isomorphism.
\end{itemize}
\end{Def}

Let $G$ be a pre-group. The \ei{opposite} pre-group $G^\op$ is defined by 
$G^\op=G$ has  a set and 
$$ g\cdot_\op h= hg.$$
Let $G$ and $H$ be pre-groups. An pre-group \ei{anti homomorphism}$\alpha: 
G\to H$ is a pre-group homomorphism $\alpha: G\to H^\op$. So 
$\alpha(ab)=\alpha(b)\alpha(a)$.




\begin{lemma}\l{basicbinary}
\begin{itemize}
\AI{a} Let $G$ be a pre-group. Then $G$ has at most one identity.
\AI{b} Let $\alpha:G\to H$ be a pre-group homomorphism. Then $\alpha$ is a
isomorphism if and only if $\alpha$ is a bijection.
\end{itemize}
\end{lemma}
\proof (a) Let $e$ and $e^*$ be identities. Then
$$e=ee^*=e^*$$

(b) Clearly any isomorphism is a bijection. Conversely, assume $\alpha$ is a
bijection and let $\beta$ be its inverse map. We need to show that $\beta$
is an homomorphism. For this let $a,b\in H$. Then as $\alpha$ is a
homomorphism
$$\alpha(\beta(a)\alpha(b))=\alpha(\beta(a))\alpha(\beta(b))
=ab=\alpha(\beta(ab)).$$
Since $\alpha$ is one to one ( or by applying $\beta$) we get
$$\beta(a)\beta(b).$$
So $\beta$ is an homomorphism.\qed




Below we list  ( up to isomorphism) all Latin square of order at most $5$
which have an identity element $e$. It is fairly straightforward to obtain
this list ( although the case $|G|=5$ is rather tedious). We leave the
details to the reader, but indicate a case division which leads to the
various Latin squares.

Order 1,2 and 3:

$$\begin{array}{c|c}  & e \\ \hline
                    e & e
                    \end{array} \quad\quad
                    \begin{array}{c|cc}  & e & a\\ \hline
                    e & e & a  \\
                    a  & a & e
                    \end{array} \quad\quad
                    \begin{array}{c|ccc}
                       & e & a & b\\ \hline
                    e  & e & a & b\\
                    a  & a & b & e\\
                    b  & b & e & a
                    \end{array}$$

 Order 4 \quad Here we get two non-isomorphic Latin squares. One for the
case that $a^2\neq e$ for some $a\in G$ and one for the case that $a^2=e$
for all $a\in G$.



       $$(1) \begin{array}{c|cccc}
                      & e & a & b & c \\ \hline
                    e & e & a & b & c \\
                    a & a & b & c & e \\
                    b & b & c & e & a \\
                    c & c & e & a & b
                    \end{array} \quad \quad (2)
                    \begin{array}{c|cccc}
                      & e & a & b & c \\ \hline
                    e & e & a & b & c \\
                    a & a & e & c & b \\
                    b & b & c & e & a \\
                    c & c & b & a & e
                    \end{array}$$


Order 5  This time we get lots of cases:


Case 1: There exists $e\neq a\neq b$ with $a^2=e=b^2$.

Case 2  There exists $e\neq a$ with $a^2\neq e$, $aa^2=e$ and $(a^2a)^2=e$.

Case 3 There exists $e\neq a$ with $a^2\neq e$, $aa^2=e$ and
$(a^2a)^2\neq e$

 Case 4 There exists $e\neq a$ with $a^2\neq e$, $a^2a=e$ and $(aa^2)^2= e$.

  This Latin square is anti-isomorphic  but not isomorphic to the one 
in case 2.  Anti-isomorphic means that is there exists  bijection 
$\alpha$ with $\alpha(ab)=\alpha(b)\alpha(a))$.

  Case 5   There exists $e\neq a$ with $a^2\neq e$, $a^2a=e$ and
           $(aa^2)^2\neq e$.

 This Latin square is isomorphic and anti-isomorphic to the one in case 3.


 Case 6 There exists $e\neq a$ with $a^2\neq e$, $a^2a=aa^2\neq e$

 Case 7 There exists $e\neq a$ with $a^2\neq e =(a^2)^2$.

 Case 8 There exists $e\neq a$ with $(a^2)^2\neq e$ and $e\neq a^2a\neq
aa^2\neq e$.

In this case put $c=aa^2$. Then $c^2\neq e$ and either $cc^2=e$ or
$c^2c=e$. Moreover $(c^2c)^2\neq e$ respectively $(cc^2)^2\neq e$ and the
latin square is isomorphic to the one in Case 3.


                   $$(1) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & e & c & d & b \\
                    b & b & d & e & a & c \\
                    c & c & b & d & e & a \\
                    d & d & c & a & b & e
                    \end{array}
                    (2) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & e & d & c \\
                    b & b & c & d & a & e \\
                    c & c & d & a & e & b \\
                    d & d & e & c & b & a
                    \end{array}
                    (3) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & e & d & c \\
                    b & b & c & d & e & a \\
                    c & c & d & a & b & e \\
                    d & d & e & c & a & b
                    \end{array}
                    (4) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & c & d & e \\
                    b & b & e & d & a & c \\
                    c & c & d & a & e & b \\
                    d & d & c & e & b & a
                    \end{array}$$


                    $$(5) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & c & d & e \\
                    b & b & e & d & a & c \\
                    c & c & d & e & b & a \\
                    d & d & c & a & e & b
                    \end{array}
                    (6)\begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & c & d & e \\
                    b & b & c & d & e & a \\
                    c & c & d & e & a & b \\
                    d & d & e & a & b & c
                    \end{array}
                    (7) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & c & d & e \\
                    b & b & d & e & a & c \\
                    c & c & e & d & b & a \\
                    d & d & c & a & e & b
                    \end{array}
                    (8) \begin{array}{c|ccccc}
                      & e & a & b & c & d \\ \hline
                    e & e & a & b & c & d \\
                    a & a & b & c & d & e \\
                    b & b & d & a & e & c \\
                    c & c & e & d & x & y \\
                    d & d & c & e & y & x
                    \end{array} \{x,y\}=\{a,b\}$$



\section{Semigroups, monoids and groups}\l{smg}

\begin{Def} Let $G$ be a pre-group.
\begin{itemize}
\AI{a} The binary operation on $G$ is called \ei{associative} if
$$(ab)c=a(bc)$$
for all $a,b,c\in G$. If this is the case we call $G$ a \ei{semigroup}.
\AI{b} $G$ is a \ei{monoid} if it is a semigroup and has an identity.
\AI{c} Suppose that  $G$ is a monoid. Then $a\in G$ is called 
\ei{invertible} if there exists $a^{-1}\in G$ with $$aa^{-1}=e=a^{-1}a.$$ 
Such an $a^{-1}$ is called an \ei{inverse} of $a$. \AI{d}  A \ei{group} is 
a monoid in which every element is invertible. \AI{e} $G$ is called 
\ei{abelian} ( or \ei{commutative}) if $$ab=ba$$ for all $a,b\in G$, 
\end{itemize} \end{Def}







{\bf Examples:} \quad Let $\mathbb Z^+$ denote the positive integers and
$\mathbb N$ the non-negative integers. Then $(\mathbb Z^+,+)$ is a
semigroup, $(\mathbb N,+)$ is a monoid and $(\mathbb Z,+)$ is a group.
$(\mathbb Z,\cdot)$ and $(\mathbb R,\cdot )$ are monoids. Let $\mathbb
R^*=\mathbb R\setminus \{0\}$. Then $(\mathbb R^*,\cdot)$ is a
group. The integers modulo $n$ under addition is another example. We denote 
this group by $(\mathbb Z/n\mathbb Z,+)$. All the examples so far have 
been abelian.


Note that in a group $a^{-1}b $ is the unique solution of $ax=b$ and 
$ba^{-1}$ is the unique solution of $ya=b$. So every group is a Latin 
square with identity. The converse is not true. Indeed of the Latin squares 
listed in section \ref{ls} all the once or order less 
than five are groups. But of Latin squares of order five only the one 
labeled (6) is a group.

Let $\mathbb K$ be a field and $V$ a vector space over $\mathbb V$. Let
$\End_\mathbb K(V)$ the set of all $\mathbb K$-linear maps from $V$ to $V$. 
Then $\End_\mathbb K(V)$ is a monoid under compositions. Let $\GL_\mathbb 
K(V)$ be the set of $\mathbb K$-linear bijection  from $V$ to $V$. Then 
$\GL_\mathbb K(V)$ is a group under composition, called the general linear 
group of $V$. It is easy to verify that $GL_\mathbb K(V)$ is not abelian 
unless $V$ has dimension $0$ or $1$.

Let $I$ be a set. Then the set $\Sym(I)$ of  all bijection from $I$ be $I$
is a group under composition, called the symmetric group on $I$. If
$I=\{1,\ldots, n\}$ we also write $\Sym(n)$ for $\Sym(I)$. $\Sym(n)$ is
 called the symmetric group of degree $n$. $\Sym(I)$ is not abelian as 
long as $I$ has at least three elements.

Above we obtained various examples of groups by starting with a monoid and
then considered only the invertible elements. This  works
in general:

\begin{lemma}\l{basicmonoid}  Let $G$ be a monoid.
\begin{itemize}
\AI{a} Suppose that $a,b,c\in G$, $a$ is a left inverse of $b$ and $c$ is 
right inverse of $b$. Then $a=c$ and $a$ is an inverse.
\AI{b} An element in $G$ has an inverse if an only if it has a left inverse 
and a right inverse.
\AI{c} Each element in $G$ has at most one inverse.
 \AI{d} If $x$ and $y$ 
are invertible, then $x^{-1}$ and $xy$ are invertible. Namely $x$ is an 
inverse of $x^{-1}$ and $y^{-1}x^{-1}$ is an inverse of $xy$.
 \AI{e} Let 
$G^*$ be the set of invertible elements in $G$, then $G^*$ is a group. 
\end{itemize} \end{lemma} \proof (a)
$$a=ae=a(bc)=(ab)c=ec=c$$

(b) and (c) follow immediately from (a).

(d) Clearly $x$ is an inverse of $x^{-1}$. Also

$$(y^{-1}x^{-1})(xy)=y^{-1}(x^{-1}(xy))=y^{-1}((x^{-1}x)y)=y^{-1}(ey)=y^{-1}
y=e$$

Similarly $(xy)(y^{-1}x^{-1})=e$ and so $y^{-1}x^{-1}$ is indeed an inverse
for $xy$.

(e) By (d) we can restrict the binary operation $G\times G\to G$ to get a
binary operation $G^*\times G^*\to G^*$. Clearly  this is associative. Also
$e\in G^*$ so $G^*$ is a monoid. By (d) $x^{-1}\in G^*$ for all $x\in G^*$
and so $G^*$ is a group.\qed


Every group $G$ is isomorphic to its opposite group $G^\op$. Indeed the map 
$x\to x^{-1}$ is an anti-automorphism of $G$ and an isomorphism $G\to 
G^\op$. \medskip


The associative law says that $(ab)c=(ab)c$ for all $a,b,c $ is a semigroup.
Hence also
$$(a(bc))d=((ab)c)d=(ab)(cd)=a(b(cd))=a((bc)d)$$
for all $a,b,c,d$ in $G$. That is for building products of four
elements in a given order it does not matter how we place the parenthesis. 
We will show that this is true for products of arbitrary length. The tough 
part is to define what we really mean with a product of $(a_1,\ldots, a_n)$ 
where $a_i\in G$ for some pre-group $G$. We do this by induction on $n$.

For $n=1$, $a_1$ is the only product of $(a_1)$.

For $n\geq 2$, $z$ is a product of $(a_1,\ldots,a_n)$ if and only if $z=xy$,
 where $x$ is a product of $(a_1,\ldots a_m)$ and $y$ is a product
of $(a_{m+1}\ldots a_n)$, for some $1<m<n$.

The only product of $(a_1,a_2)$ is $a_1a_2$. The products of
$(a_1,a_2,a_3)$ are $(a_1a_2)a_3$ and $a_1(a_2a_3)$. Associativity now just
says that every 3-tuple as a unique product.

For later use, if $G$ has an identity we define $e$ to be the only 
product of the empty tuple.

For the proof of next theorem we also define the standard product of
$(a_1,\ldots a_n)$. For $n=1$ this is $a_1$ while for $n\geq 2$ it is $xa_n$
where $x$ is the standard product of $(a_1,\ldots,a_{n-1})$.


\begin{theorem}[General Associativity Law] Let $G$ be a semigroup. Then any
(non-empty) tuple of elements has a unique product.
\end{theorem}
\proof By induction on the length $n$ of the tuple. For $n=1$ or  $2$ there
is nothing to proof.  So suppose $n\geq 3$. We will show that any product  $z$ of
$(a_1,\ldots a_n)$ is the standard product. By definition of $z$, $z=xy$ where
$x$ is product of $(a_1,\ldots a_m)$ and $y$ is a product of $(a_{m+1},\ldots,a_n)$.

Suppose first that $m=n-1$. By induction $x$ is the standard product of 
$(a_1,\ldots ,a_{n-1})$. Also $z=xa_n$ and  so by definition $z$ is the 
standard product.

Suppose next that $m< n-1$. Again by induction $y$ is the standard product of
$(a_{m+1},\ldots, a_n)$ and so $y=sa_n$ where $s$ is the standard product of
$(a_{m+1}\ldots,a_{n-1})$. Hence
$$z=xy=x(sa_n)=(xs)a_n$$
As $xs$ is a product of $(a_1,\ldots a_{n-1})$, we are done by the $m=n-1$ case.\qed




One of the most common ways to define a group is as the group of
automorphism of some object. For example above we used sets and vector
spaces to define the symmetric groups and the general linear group.

If the object is a pre-group $G$ we get a group which we denote by
$\Aut(G)$. So $\Aut(G)$ is the set of all automorphisms of the
pre-group $G$. The binary operation on $\Aut(G)$ is the composition.

We will determine the automorphism for the Latin squares in \ref{ls}. 
As the identity element is unique it is fixed by any automorphism. It 
follows that the Latin square of order 1 or 2, have no non-trivial 
automorphism ( any structure as the trivial automorphism which sends every 
element to itself).

The Latin square of order three has one non-trivial automorphism. It sends 
$$e\to e\quad  a\to b \quad b\to a.$$
Consider the first Latin square of order 4. It has two elements with 
$x^\neq 2 e$, namely $a$ and $c$. So again we have a unique non- trivial 
automorphism:
$$e\to e\quad a\to c\quad b\to b\quad c\to a.$$
Consider the second Latin square of order 4. Here is an easy way to 
describe the multiplication: $ex=x, xx=e$ and $xy=z$ if $\{x,y,z\}=\{a,b,c\}$.
It  follows that any permutation of $\{e,a,b,c\}$ which fixes $e$ is an 
automorphism. Hence the group of automorphism is isomorphic to $\Sym(3)$,

Consider the Latin square of order 5 labeled (1). The multiplication table was 
uniquely determine by any pair $x\neq y$ of non-trivial elements with  
$x^2=y^2=e$. But $x^2=e$ for all $x$. So every $e\neq x\neq y\neq e$ 
there exists a unique automorphism with 
$$a\to x\quad b\to y$$
Thus the group of automorphisms has order 12. The reader might convince 
herself that also the set of bijection which are automorphisms or 
anti-automorphisms form a group. In this case it has order 24. That is any 
bijection fixing $e$ is an automorphism or anti-automorphism.

Consider the Latins square of order five labeled (2). This multiplication 
table is uniquely determine by any element with $x^2\neq e$, $xx^2=e$ and 
$(x^2x)^2=e$. $a$, $b$  and $d$ have this property and we get two 
non-trivial automorphism:
$$e\to e, a\to b\quad b\to d,\quad c\to c\quad d\to a\text{ and } 
  e\to e, a\to d\quad b\to a ,\quad c\to c\quad d\to b  $$
That is any permutation fixing $e$ and $c$ and cyclicly permuting $a,b,d$ is 
an automorphism. 
 Consider the Latins square of order five labeled (3). This time only $a$ 
itself has the defining property. It follows that no non-trivial 
automorphism exists. But it has an anti-isomorphism fixing $a,b$ and $d$ and 
interchanging $a$ and $c$.

The Latin square (4) and (5) had been (anti-)-isomorphic  to  (2) 
and (3). So consider (6). All non-trivial elements have the defining 
property. So there are $4$ automorphisms. They fix $e$ and cyclicly permute
$(a,b,c,d)$.

Finally consider the Latin square (7). Here $a,c,d$ have the defining 
property. So there are $3$ automorphism. They  fixe $e$ and $b$ and 
cyclicly permuted $(a,c,d)$. Here all bijections fixing $a$ and $b$ are 
automorphism or anti-automorphism.


It might be interesting to look back and consider the isomorphism types of 
the groups we found as automorphism of Latin squares.  $\mathbb Z/n\mathbb 
Z$ for $n=1,2,3,4$, $\Sym(3)$  and a group of order 12. We will later see 
that $\Sym(4)$ has a unique subgroup of order 12 called $\Alt(4)$. So the 
group of order 12 must be isomorphic to $\Alt(4)$.


  



Another class of objects one can use are graphs. We define a graph to be a
tuple $(\Gamma,-)$, where $\Gamma$ is a set and $"-"$ is an anti-reflexive,
symmetric relation on $\Gamma$. The elements are called vertices, If $a$
and $b$ are vertices with  $a-b$ we say that $a$ and $b$ are adjacent. An
edge is a pair of adjacent vertices. An automorphism of the graph $\Gamma$
is an bijection $\alpha\in \Sym(\Gamma)$ such that $a-b$ if and only if
$\alpha(a)-\alpha(b)$. In  other words a bijection which  maps edges to
edges. $\Aut(\Gamma)$ is the set of all automorphisms of $\Gamma$ under
composition.

As an example let $\Gamma_4$ be a  square:

\setlength{\unitlength}{.1mm}
$$\begin{picture}(300,300)(-150,-150)
\put(-100,-100){\line(1,0){200}}
\put( 100,-100){\line(0,1){200}}
\put(100,100){\line(-1,0){200}}
\put(-100,100){\line(0,-1){200}}
\put(-100,-100){\circle*{20}}
\put(100,-100){\circle*{20}}
\put(100,100){\circle*{20}}
\put(-100,100){\circle*{20}}
\put(-140,-140){$1$}
\put(120,-140){$2$}
\put(120,120) {$3$}
\put(-140,120){$4$}
\dottedline{4}(-150,0)(150,0)
\dottedline{4}(0,-150)(0,150)
\dottedline{5}(-115,-115)(115,115)
\dottedline{5}(-115,115)(115,-115)
\end{picture}$$

The square has the following automorphisms: rotations by $0,90,180$ and
$270$ degrees, and reflections on each of the four dotted lines. 
So $\Aut(\Gamma_4)$ has order 8. \par

 To describe $\Aut(\Gamma_4)$ as a subset of $\Sym(4)$ we introduce the
cycle notation for elements of $\Sym(I)$ for a finite set $I$.
 We say that $\pi\in \Sym(I)$ is a cycle  of length if the exists $a_1\ldots
a_m\in I$ such that
 $$\pi(a_1)=a_2,\pi(a_2)=a_3,\ldots,  \pi(a_{m-1})=a_m, \pi(a_m)=a_1$$
and $\pi(j)=j$ for all other $j\in I$.

Such a cycle will be denoted by
$$(a_1a_2a_3\ldots a_m)$$
The set $\{a_1,\ldots a_m\}$ is called the support of the cycle.
Two cycles are called disjoint if their supports are disjoint.

It is clear that every permutations can be uniquely written as a product of
disjoint cycle.

$$\pi=(a_1^1a_2^1\ldots a_{m_1}^1)\,(a_1^2a_2^2\ldots
a_{m_2}^2)\,\ldots\, (a_1^ka_2^k\ldots a_{m_k}^k)$$

One should notice here that disjoint cycles commute and so the order of
multiplication is irrelevant. Often we will not list the cycles of
length 1.

So $(135)(26)$ is the permutation  which sends $1$ to $3$, $3$ to $5$,$5$
to $1$, $2$ to $6$, $6$ to $2$ and fixes $4$ and any number larger than
$6$. \medskip

With this notation we can explicitly list the elements of $\Aut(\Gamma_4)$:

The four rotations:  $e, (1234), (13)(24), (1432)$

And the four reflections: $(14)(23), (13), (12)(34), (24)$.
\medskip



\section{The projective plane of order 2}

In this section we will look at the automorphism group of  the projective
plane of order two.

To define a projective plane consider  a 3-tuple $\cal E =(\cal P,\cal L, 
\cal R)$ where $\cal P$ and $\cal L$ are  non-empty sets and ${\cal 
R}\subseteq \cal P\times \cal R$. The elements of $\cal P$ are called 
points, the elements of $\cal L$ are called lines and we say a point $P$ 
and a line $l$ are incident if $(P,l)\in \cal R$.  $\cal E$  is called a 
projective plane if it has they following two 
properties\medskip


(PP1)\quad   Any two distinct points are incident with a unique common
line. \medskip

(PP2)\quad  Any two distinct lines are incident with unique common
point. \medskip

We say that a projective plane has order two if every point is incident
with exactly three lines and every line is incident with exactly three
points. Before studying the automorphism group will
need to establish some facts about projective planes of order two.

Let $P$ be any points. Then any other point lies on exactly one of the
three lines through $P$. Each of whose three lines has 2 points besides $P$
and so we have $1+3\cdot 2=7$ points. By symmetry we also have seven lines.

A sets of points is called collinear if they points in the set are incident
with a common line. 

Now let $A,B,C$ be any three points which are not collinear. We will show
that the whole projective plane can be uniquely described in terms of the
tuple $(A,B,C)$. Given two distinct points $P$ and  $Q$, let  $PQ$ be the
line incident to $P$ and $Q$. Also let $P+Q$ be the unique point on $PQ$
distinct from $P$ and $Q$. Since two distinct lines have exactly on point
in common, $ A,B,C, A+B, A+C,B+C$ are pairwise
distinct. Also  the two lines  $A(B+C)$ and  $B(A+C)$ have a point in common
and this point is not one of the six points we already found. Hence they
intersect in $A+(B+C)=B+(A+C)=C+(A+B)$, the seventh and last point.

Also $AB,AC,BC,A(B+C), B(A+C), C(A+B)$ are six pairwise distinct lines.

Now $(A+B)(A+C)$ must intersect $BC$. But $B$ does not lie on $(A+B)(A+C)$
since otherwise $(A+B)(A+C)=(A+B)B=AB$. Similar $C$ is not on $(A+B)(A+C)$.
So $(B+C)$ lies on $(A+B)(A+C)$ and $B+C=(A+B)+(A+C)$ So the seventh line is
incident with $A+B,A+C$ and $B+C$. So we completely determined the
projective plane:

\setlength{\unitlength}{.1mm}
$$\begin{picture}(600,600)(-300,-300)
\qbezier(-150,25)(0,225)(150,25)
\qbezier(-150,25)(-200,-150)(0,-200)
\qbezier(150,25)(200,-150)(0,-200)
\put(-300,-200){\line(2,3){300}}
\put(-300,-200){\line(2,1){450}}
\put(300,-200){\line(-2,3){300}}
\put(300,-200){\line(-2,1){450}}
\put(-300,-200){\line(1,0){600}}
\put(0,-200){\line(0,1){450}}
\put(-296,-197){\circle*{20}}
\put(-345,-250){ $A$}
\put(296,-197){\circle*{20}}
\put(280,-250){ $B$}
\put(0,250){\circle*{20}}
\put(-25,270){ $C$}
\put(-150,25){\circle*{20}}
\put(-290,40){ $A+C$}
\put(150,25){\circle*{20}}
\put(160,40){ $B+C$}
\put(0,-200){\circle*{20}}
\put(-75,-250){ $A+B$}
\put(0,-53){\circle*{20}}
\put(10,-58){ \tiny $A+B+C$}
\end{picture} $$



An automorphism of $\cal E$ is a pair
 $(\alpha ,\beta)\in \Sym(\cal P)\times \Sym(\cal L)$ such that for each 
point $P$ and each line $l$, $P$ and $l$ are incident if and only if 
$\alpha(P)$ and $\beta(l)$ are incident. Clearly $\beta$ is uniquely 
determined by $\alpha$ ( namely if $l=PQ$ then 
$\beta(l)=\alpha(P)\alpha(Q)$) and ( after identifying a line with  the set of 
incident points) an automorphism of the plane is just a permutation of the 
points which sends lines to lines.

Let $\Aut(\cal E)$ be the set of automorphisms of $\cal E$. Then
$\Aut(\cal E)$ is a group under composition. Let $\tilde
A,\tilde B,\tilde C$ be  three non-collinear points. Its clear from the
above that there exists a unique automorphism of $\cal E$ with
$$A\to \tilde A,\, B\to \tilde B,\, C\to\tilde C$$
Now $\tilde A$ can be any one of the seven points, $\tilde B$ is any of the six points different
from $\tilde A$ and $\tilde C$ is any of the four points not incident to $\tilde A\tilde B$. Thus
$$|\Aut({\cal E})|= 7 \cdot 6\cdot 4=168.$$



We finish this section with a look at  the operation $+$ we have
introduced on the points. Let $G=\{e\}\cup \cal P$. Here $e$ is an
arbitrary element not in $\cal P$. Define a binary operation on $G$ as
follows:

 $e+g=g+e$, $P+P=e$ and for distinct points $P$ and $Q$, $P+Q$ is as
above. 

It is easy to check that $G$ is a group. Also the points correspond to the 
subgroup of order $2$ in $G$ and the lines to the subgroups of order 4. In 
particular there is an obvious isomorphism between $\Aut(\cal E)$ and 
$\Aut(G)$.



\section{Subgroups, cosets and counting}


\begin{Def}\l{defsubgroup}
Let $G$ be a group and $H\subseteq G$. We say that $H$ is a subgroup of $G$ 
and write $H\leq G$ if
\begin{itemize}
\AI{a} $e \in H$
\AI{b} $H$ is closed under multiplication, that is for all  $a,b\in H$,
$ab\in H$
\AI{c} $H$ is closed under inverses, that is for all $a\in H$, $a^{-1}\in 
H$. 
\end{itemize} \end{Def}

 Note that  any subgroup of $G$ is itself a group, where the binary 
operation is given by restricting the one on $G$. We leave it as 
an exercise to the reader to verify that a subset $H$ of $G$ is a 
subgroup if and only if $H$ is not empty and for all $a,b\in H$, 
$ab^{-1}\in H$. The following lemma is of crucial importance to the theory 
of groups.

\begin{lemma}\l{ leftcosets} Let $H$ be a subgroup of $G$. The relation
$\sim$ on $G\times G$ define by
$$ a\sim b\quad \text{ if and only if there exists } h\in H \text{ with } 
\quad b=ah$$ is an equivalence relation. 
\end{lemma} \proof  Let $a\in G$  then $a=ae$ and so $\sim$ is reflexive.

Let $a\sim b$ and pick $h\in H$ with $b=ah$. Then

$$ bh^{-1}=(ah)a^{-1}=a(hh^{-1})=ae=a$$
Since $H$ is a subgroup of $G$, $h^{-1}\in H$ and so $b\sim a$. Hence $\sim$
is symmetric.

Suppose next that $a\sim b$ and $b \sim c$. Then $b=ah$ and $c=bk$ with
$k,h\in H$. We compute
$$ c=bk=(ah)k=a(hk)$$
Since $H$ is a subgroup, $hk\in H$ and so $a\sim c$ and $\sim$ is
transitive.\qed

The reader might have noticed that the reflexivity corresponds to $e\in H$, 
the symmetry to the closure under inverses and the transitivity to the 
closure under multiplication. Indeed $\sim$ can be defined for any subset 
of $G$, and its a equivalence relation if an only if the subset is a 
subgroup.

The equivalence classes of $\sim$ are called the (left) \ei{cosets} of $H$.
The coset containing $a\in G $ is denoted by $aH$ and so $aH=\{ah\mid h\in
H\}$. The set of cosets of $H$ is denoted by $G/H$ and so $G/H=\{ gH\mid
g\in G\}$. Observe that the map $H\to gH\mid h\to gh$ is a bijection and so
$|H|=|gH|$ for all $gH\in G/H$.

\begin{theorem}[\nei{Lagrange}] Let $H$ be a subgroup of $G$. Then
$|G|=|G/H|\cdot |H|$. In particular if $G$ is finite, the order of $H$
divides the order of $G$.
\end{theorem}
\proof Just observe that $|G/H|$ is the numbers of cosets, each coset
contains $|H|$ elements and $G$ is the disjoint union of the cosets.\qed

Let \ei{${\cal P}(G)$} be the \ei{power set} of $G$, that is the set of 
subsets. For $H,K\subset G$ put $$HK=\{ hk\mid h\in H,k\in K\}.$$ This  
binary operation is associative and $\{e\}$ is an identity element. So 
${\cal P}(G)$ is a monoid.

If $K$ is a subgroup then  $HK$ is a union of cosets of $K$, namely $HK=\bigcup_{h\in H} hK$. We write
$HK/K$ for the sets of cosets of $K$ in $HK$. In general if $J\subseteq G$
is a union of cosets of $H$, $J/H$ denotes the sets of all those cosets. The
same argument as in the proof of Lagrange's Theorem shows $|J|=|J/K|\cdot
|K|$.

\begin{lemma} Let $H$ and $K$be subgroups of $G$.
\begin{itemize}
\AI{a} The map $H/H\cap K\to HK/K, h(H\cap K)\to hK$ is a well defined
bijection.
\AI{b} $|HK|=\frac{|H||K|}{|H\cap K|}$
\end{itemize}
\end{lemma}
\proof (a) Since $(H\cap K)K=K$, $hK=h((H\cap K)K)=(h(H\cap K))K$ and so is 
independent of  the choice of $h\in h( H\cap K)$. The map is clearly onto. 
Finally if $hK=jK$ for some $h,j\in H$, then $h^{-1}jK=K$, $h^{-1}j\in K$ 
and so $h^{-1}j\in H\cap K$ and $h(H\cap K)=j(H\cap K)$. Thus the map is 
one to one.

(b) By (a) we have $|H/H \cap K|=|HK/K|$. So
$$ \frac{|H|}{|H\cap K|}=\frac{ |KH|}{|K|}$$
Thus (b) holds.\qed


\section{Normal subgroups and the isomorphism theorem}

Just as we  have defined (left) cosets one can define right cosets for a
subgroup
$H$ of $G$. The right cosets have the form $Hg=\{ hg\mid h\in H\}$. In
general a left coset of $H$ is not a right coset.

\begin{Def}\l{defnormal} Let $G$ be a group.
\begin{itemize}
\AI{a} For $a,b\in G$ put $b^a=aba^{-1}$ and for $I\subseteq G$ put
$I^a=aIa^{-1}=\{i^a\mid i\in I\}$. The map $i_h: G\to G, b\to b^a$ is
called conjugation be $a$.
\AI{b} A subgroup $H$ of $G$ is called a \ei{normal} subgroup of $G$  and
we write $H\normal G$ if
$$H=H^g \text{ for all } g\in G.$$
\end{itemize}
\end{Def}

\begin{lemma}\l{basicnormal} Let $N\leq G$. Then the following are
equivalent:
\begin{itemize}
\AI{a} $N\unlhd G$.
\AI{b} $gN=Ng$ for all $g\in G$.
\AI{c} Every left coset is a right coset
\AI{d} Every left coset is contained in a right coset.
\AI{e}  $N^g\subseteq N$ for all $g\in G$.
\end{itemize}
\end{lemma}
\proof Suppose (a) holds. Then $gNg^{-1}=N$ for all $g\in G$. Multiplying
with $g$ from the right we get $gN=Ng$.

Suppose (b) holds. Then the left cosets $gN$ equals the right coset $Ng$.
so (c) holds.

Clearly (c) implies (d)

Suppose that (d) holds. Let $g\in G$. Then $gN\subseteq Nh$ for some $h\in
G$. Since $g\in gN$ we conclude $g\in Nh$ and so $Ng=Nh$, as the right
cosets partition $G$. Thus $gN\subseteq Ng$. Multiplying with $g^{-1}$ from
the right we get $gNg^{-1}\subseteq N$. Thus (e) holds.

Finally suppose that (e) holds. Let $g\in G$. Then also $g^{-1}\in N$ and
applying (e) to $g^{-1}$ we obtain $g^{-1}Ng\subset N$. Multiplying with
$g$ from the left and $g^{-1}$ from the right we obtain $N\subset
gNg^{-1}=N^g$. Since also $N^g\subset N$, $N=N^g$ and so (a) holds.\qed

We will now start to establish a connection between normal subgroups and 
homomorphism.

\begin{lemma}\l{basichom} Let $\phi:G\to H$ be a group homomorphism.
	\begin{itemize}
		\AI{a} $\phi(e)=e$.
		\AI{b} $\phi(a^{-1})=\phi(a)^{-1}$.
		\AI{c} $\phi(a^g)=\phi(a)^{\phi(g)}$.
		\AI{d} If $A\leq G$ then $\phi(A)\leq H$.
		\AI{e} If $B\leq H$ then $\phi^{-1}(B)\leq G$.
		\AI{f} Let $\ker \phi=\{ g\in G\mid \phi(g)=e\}$. Then 
$\ker \phi$ is a normal subgroup of $G$. \AI{g} $\phi$ is one to one if and 
only if $\ker \phi=\{e\}$. \AI{h} If $N\normal G$, and $\phi$ is onto, 
$\phi(N)\normal H$. \AI{i} If $M\normal H$, $\phi^{-1}(M)\normal G$. 
\end{itemize} \end{lemma} \proof Straightforward.\qed

For $H\subseteq G$ define $H^{-1}=\{ h^{-1}\mid h\in H\}$.

\begin{lemma}\l{basicG/N} Let $N\unlhd G$.
\begin{itemize}
\AI{a} The product of any two cosets of $N$ is again a coset of $N$. Namely
$(aN)(bN)=(ab)N$.
\AI{b} For each $g\in G$, $(gN)^{-1}$ is a coset of $N$, namely
$(gN)^{-1}=g^{-1}N$.
\AI{c} $G/N$ is a group.
\AI{d} The map \quad $G\to G/N, \quad g\to gN$\quad is an onto  homomorphism 
with kernel $N$. \end{itemize} \end{lemma} \proof (a) $(aN)(bN)= 
a(Nb)N=a(bN)N=abNN=abN$

(b) $(aN)^{-1}=Na^{-1}=a^{-1}N$

(c) By (a)  multiplication is binary operation on $G/N$. Clearly $N$ is an
identity element and by (a) $g^{-1}N$ is an inverse for $gN$. Also 
multiplication of subsets is associative and so (c) holds.

(d) By (a) the map is a homomorphism. Clearly it is onto. $g$ is mapped
to $e_{G/N}=N $ if and only if $gN=N$ and so if and only if $g\in N$. Thus
$N$ is the kernel of the map\qed


\begin{lemma}[The Isomorphism Theorem]\l{IT} Let $\alpha: G\to H$ be a
homomorphism of groups. The map 
$$\bar\alpha: G/\ker\alpha \to \alpha(H),\quad g\ker \alpha \to \alpha(g)$$
is a well-defined isomorphism. 
\end{lemma} 
\proof Let $a\in \ker \alpha$ and $g\in G$. Then
$$\alpha( gn)=\alpha(g)\alpha(n)=\alpha(g)e=\alpha(g)$$
and so $\bar\alpha$ is well defined. By definition $\bar\alpha$ is onto.

Let $g\ker\alpha\in \ker \bar\alpha$. Then $\alpha(g)=e$ and so $g\in
\ker\alpha$ and $g\ker\alpha=\ker\alpha=e_{G/ker\alpha)}$. Hence by 
\ref{basichom}g, $\bar\alpha$ is one to and so an isomorphism.\qed


 From the two preceding lemmas we see that the normal subgroup of $G$ are
exactly the kernels of homomorphism. Also every homomorphism $G\to H$ can be
factorized as $\alpha=\rho\bar\alpha\pi$, where $\pi:G\to G/\ker \alpha$ is
the canonical homomorphism from \ref{basicG/N}, $\bar\alpha$ is the
isomorphism from \ref{IT} and $\rho:\alpha(H)\to H, h\to h$ is the inclusion
map. Note here that $\pi$ is onto, $\bar\alpha$ an isomorphism and $\rho$ is
one to one.



\begin{lemma}\l{capg} Let $G$ be a group and $(G_i,i\in I)$ a family of
subgroups. Then $\bigcap_{i\in I} G_i$ is a subgroup. If all of the $G_i$
are normal in $G$, so is $\bigcap_{i\in I} G_i$.
\end{lemma}
\proof Left as an exercise.\qed

\begin{Def} Let $G$ be a group and $J\subseteq G$.
\AI{a} The subgroup $\langle J\rangle$ of $G$ \ei{generated} by $J$ is 
defined by $$ \langle J\rangle =\bigcap_{J\subseteq H\leq G} H$$ \AI{b} The 
normal subgroup $\langle J^G\rangle$ of $G$ generated by $J$ is defined by 
$$ \langle J^G\rangle =\bigcap_{J\subseteq H\unlhd G} H$$ \end{Def}

If $(J_i,i\in I)$ is a family of subsets we also write $\langle J_i\mid i\in
I\rangle$ for $\langle \bigcup_{i\in I} J\rangle$. $J\subseteq G$ is called
normal if $J^g=J$ for all $g\in G$.

\begin{lemma}\l{basicgen} Let $I$ be a subset of $G$.
\begin{itemize}
	\AI{a} Let $\alpha: G\to H$ be a group homomorphism. Then $\alpha(\langle 
I \rangle)=\langle \alpha(I)\rangle$.
	\AI{b} Let $g\in G$. Then $\langle I^g\rangle=\langle I\rangle^g$.
        \AI{c} If $I$ is normal in $G$, so is  $\langle I\rangle$.
        \AI{d}  $\langle I\rangle$ consists of  all products of elements
in $I\cup I^{-1}$. 
	\AI{e} $\langle I^G\rangle =\langle I^g\mid g\in  G\rangle$  
 and consists of all products of elements in $\bigcup_{g\in G} (I\cup I^{-1})^g$. 
\end{itemize} 
\end{lemma} 
\proof (a)\quad 
Let $A=\langle I \rangle$ and $B=\langle \alpha(I)\rangle)$. 
As $\alpha(A)$ is a subgroup of $H$ and contains 
$\alpha(I)$ we have $B\leq \alpha(A)$. Also $\alpha^{-1}(B)$ is a subgroup 
of $G$ and contains $I$. Thus $A\leq \alpha^{-1}(B)$ and so 
$\alpha(A)\leq B$. Hence $B=\alpha(A)$.

(b) Apply (a) to the homomorphism $x\to x^g$.

(c) Follows from (b).

(d) \quad Let $H$ be the subset of $G$ consists of all products of elements 
in $I\cup I^{-1}$, that is all elements of the form $a_1a_2\ldots a_n$, 
with $n\geq 0$ and $a_i\in I\cup I^{-1}$ for all $1\leq i\leq n$. Then 
Clearly $H$ is contained in any subgroup of $G$ containing $I$. Thus 
$H\subseteq \langle I\rangle$. But $H$ is also a subgroup containing $I$ 
and so $\langle I\rangle\leq H$.


(e)   By (b) $\langle I^g\mid g\in G\rangle $ is  normal subgroup of $G$.
It is also contained in every normal subgroup containing $I$ and we get
 $\langle I^G\rangle =\langle I^g\mid g\in G\rangle$. The second statement 
follows from (c).\qed

For $a,b\in G$ put 
$$[a,b]=aba^{-1}b^{-1}$$
and for $A,B\subseteq G$ define 
$$[A,B]=\langle [a,b]\mid a\in A,b\in B\rangle.$$
$[a,b]$ is called the commutator of $a$ and $b$. Note that $[a,b]=e$ if and 
only if $ab=ba$. Also
$$[a,b]=b^ab^{-1}=ab^{-a}$$
where we used the abbreviation $b^{-a}=(b^{-1})^{a}$,
Finally observe 
$$[a,b]^{-1}= bab^{-1}a^{-1}=[b,a]$$
Hence $[A,B]=[B,A]$ for  any $A,B\subseteq G$.

\begin{lemma}\l{comnormal} Let $G$ be a group.
\begin{itemize}
   \AI{a} Let $N\leq G$. Then $N\normal G$ if and only if $[N,G]\leq N$
   \AI{b} Let $A,B\normal G$. Then $[A,B]\leq A\cap B$.
   \AI{c} Let $A,B\normal G$ with $A\cap B=\{e\}$. Then $[A,B]=\{e\}$
and  $ab=ba$ for all $a\in A,b\in B$.
\end{itemize}
\end{lemma}
\proof $$n^g\in N\Longleftrightarrow n^gn^{-1}\in N\Longleftrightarrow 
[n,g]\in N.$$ Thus (a) holds. (b) follows from (a), and (c) follows from 
(a)\& (b).\qed


For $H\subseteq G$ define \ei{$N_G(H)$}$=\{g\in H\mid H^g=H$. $N_G(H)$ is
called the \ei{normalizer} of $H$ in $G$. If 
$K\subseteq G$ we say that $K$ \ei{normalizes} $H$ provided that 
$K\subseteq N_G(H)$.

\begin{lemma}\l{normalize} Let $G$ be a group.
\begin{itemize}
\AI{a} Let $A,B$ be subgroups of $G$. Then $AB$ is a subgroup of $G$ if
and only if $AB=BA$.
\AI{b} Let $H\subseteq G$. Then $N_G(H)$ is a subgroup of $G$.
\AI{c} If $K,H\leq G$ and $K\leq N_G(H)$, then $\langle K,H\rangle=KH$.
\AI{d} Let $K_i,i\in I$ be a family of subsets if $G$. If each $K_i$ 
normalizes $H$, so does $\langle K_i\mid i\in I\rangle$. \end{itemize} 
\end{lemma} \proof (a) If $AB$ is a subgroup of $G$, then 
$$AB=(AB)^{-1}=B^{-1}A^{-1}=BA$$ Conversely suppose that $AB=BA$. The above 
equation shows that $AB$ is closed under inverses. Also $e=ee\in AB$ and 
$$(AB)(AB)=A(BA)B=A(AB)B=A^2B^2=AB$$ So $AB$ is closed under 
multiplication.

(b) Readily verified.

(c) Let $k\in K$. Then $kH=Hk$ and so $HK=KH$. So by (a) $HK$ is a subgroup
of $G$.

(d) Follows directly from (b).\qed



\section{Cyclic groups}

A group is cyclic if $G=\langle x\rangle$ for some $x\in G$. In this
section we will determine all cyclic groups up to isomorphism and
investigate their subgroups and homomorphisms.

\begin{lemma}\l{subgroupsZ}
\begin{itemize}
\AI{a}  Let $H$ be a subgroup of $(\mathbb Z,+)$ Then $H=n\mathbb Z$ for
some $n\in \mathbb N$.
\AI{b} Let $n,m\in \mathbb N$. Then $n\mathbb Z\leq m\mathbb Z$ if and only
if $m$ divides $n$.
\end{itemize}
\end{lemma}
\proof (a) If $H=\{0\}$, then $H=0\mathbb Z$. So we may assume that
$H\neq \{ 0\}$.  Since $H$ is a subgroup, $m\in H$ implies $-m\in H$. So
$H$ contains some positive integer. Let $n$ be the smallest such. Let $m\in
H$ and write $m=rn+s$, $r,s\in \mathbb Z$ with $0\leq s< n$. We claim that
$rn\in H$. $rn\in H$ if and only if $-rn\in H$. So we may assume $r>0$. But
then
$$rn=\underbrace{n+n+\ldots+n}_{r-\text{times}}$$
 and as $n\in H$, $rn\in H$. So also $s=m-rn\in H$. Since $0\leq s < n$,
the minimal choice of $n$ implies $s=0$. Thus $m=rn\in n\mathbb Z$ and
$H=n\mathbb Z$.

(b)  $n\mathbb Z\leq m\mathbb Z$ if and only if $n\in m\mathbb Z$. So if 
and only if $m$ divides $n$.\qed.

\begin{lemma}\l{free1} Let $G$ be a group and $g\in G$. Then $\phi:\mathbb
Z\to G, \quad n\to g^n$ is the unique homomorphism from $(\mathbb Z,+)$ to 
$G$ which sends $1$ to $g$. 
\end{lemma} \proof More or less obvious.\qed


For $r\in \mathbb Z^+\cup\{\infty\}$ define
 $r^*=\begin{cases} r & \text{ if } r<\infty\\
                    0    & \text{ if } r=\infty   \end{cases}$.

This definition is motivated by the fact that $|\mathbb Z/n \mathbb Z|^*=n$.





\begin{lemma}\l{clfcyclic}
 Let $G=\langle x\rangle$ be a cyclic group and put $n=|G|^*$
\begin{itemize}
\AI{a} The  map
$$\mathbb Z/n \mathbb Z\to G,\quad m+n\mathbb Z\to x^m$$
is a well-defined isomorphism.
\AI{b} Let $H\leq G$ and put $m=|G/H|^*$. Then $m$ divides $n$, and
$H=\langle x^m\rangle$.
\end{itemize}
\end{lemma}
\proof By \ref{free1} the map $\phi:\mathbb Z\to G, m\to g^m$ is a
homomorphism.As $G=\langle x\rangle$, $\phi$ is onto. By
\ref{subgroupsZ}
$\ker\phi=t\mathbb Z$ for some non-negative integer $t$. By the isomorphism
theorem the map
$$\mathbb Z/t \mathbb Z\to G, m+t\mathbb Z\to x^m$$
 is a well defined isomorphism.  Hence $\mathbb Z/t \mathbb Z\cong G$. Hence
 $t=|\mathbb Z/t \mathbb Z|^*=|G|^*=n$ and (a) is proved.

(b) By \ref{subgroupsZ} $\phi^{-1}(H)=s\mathbb Z$ for some $s\in {\cal N}$.
Since $n\mathbb Z\leq s\mathbb Z$, \ref{subgroupsZ} implies  that $s$ divides
$n$. As $\phi$ is onto, $\phi(s\mathbb Z)=H$ and so 
$H=\langle\phi(s)\rangle=\langle x^s\rangle$. Moreover $$G/H \cong (\mathbb 
Z/n \mathbb Z)/ ( s\mathbb Z/n \mathbb Z)\cong \mathbb Z/s \mathbb Z.$$ 
Thus $s=m$ and(b) is proved \qed

\begin{lemma} Let $G=\langle x\rangle $ be a cyclic. Let $H$be any group
and $y\in H$. Put $n=|G|^*$ and $m=|x|^*$. Then there exists a homomorphism
$G\to H$ with $x\to y$ if and only if $m$ divides $n$.
\end{lemma}
\proof Exercise.\qed



\section{Simplicity of the alternating groups}

In this section we will investigate the normal subgroups of symmetric group
$\Sym(n)$, $n$ a positive integer. We start be defining a particular normal
subgroup called the alternating group $\Alt(n)$. Let $\mathbb R$ be the field
of real numbers and $\GL_n(\mathbb R)$ the group of invertible linear
transformation of the vector space $\mathbb R^n$. Define
$\alpha: \Sym(n)\to \GL_n(\mathbb R)$ by
$$\alpha(\pi)(r_1,\ldots,r_n)=(r_{\pi^{-1}(1)},\ldots,r_{\pi^{-1}(n)})$$
It is easy to check that $\alpha$ is a homomorphism. Now define
$\sgn=\det\circ\alpha$. As the determinant is a homomorphism from 
$\GL_n(\mathbb R)$ to $\mathbb R$,   $\sgn$ is a homomorphism form 
$\Sym(n)$ to $\mathbb R$. Also if $x=(i,j)\in \Sym(n)$ is a 2-cycle, we see 
that $\sgn(x)=-1$. So if $x=(a_1,a_2,\ldots a_m)\in \Sym(n)$ is a $m$-cycle 
then $$\sgn(x)=\sgn(\, (a_1,a_2)(a_2,a_3)\ldots 
(a_{m-1},a_m)\,)=(-1)^{m-1}$$

So we conclude that
$$\sgn(x)=
      \begin{cases}
           1  &   \text{ if $x$ has an even number of even  cycles}\\
          -1  &   \text{ if $x$ has an odd number of even cycles}\
      \end{cases}$$

Define $\Alt(n)=\ker \sgn$. Then $\Alt(n)$ is a normal subgroup of
$\Sym(n)$, $\Alt(n)$ consists of all permutation which have an even number
of even cycles and 
  $$\Sym(n)/Alt(n)\cong \sgn(\Sym(n))=\{1,-1\}\cong \mathbb
Z/2\mathbb Z.$$
  In particular, $$|Alt(n)|=\frac{n!}{2}$$

Before continuing to investigate the normal subgroup of
$\Sym(n)$ we wish to define  conjugacy classes in an arbitrary group
$G$. We say that two elements $x,y$ in $G$ are conjugate if
$y=x^g=gxg^{-1}$ for some $g\in G$. It is an easy exercise to verify that
this is an equivalence relation. The equivalence classes are called the
conjugacy classes of $G$. The conjugacy class containing $x$ is $x^G=\{
x^g\mid g\in G\}$.

\begin{proposition}\l{normalcc}
A subgroup of $G$ is normal if and only if
it is  the union of conjugacy classes of $G$.
\end{proposition}
\proof Let $N\leq G$. The following are clearly equivalent:

   $$\begin{array}{l}
   N\normal G \\
   N^g\leq N\text{ for all } g\in G\\
   n^g\in N \text{ for all } n\in N,g\in G\\
   n^G\subseteq N \text{ for all } n\in N\\
   N=\bigcup_{n\in N} n^G\\
   N \text{ is  a union of conjugacy classes } \end{array}$$\qed


To apply this to $\Sym(n)$ we need to determine its conjugacy classes.
For $x\in \Sym(n)$ define the cycle type of $x$ to be sequence
$(m_i)_{i\geq 1}$, where $m_i$ is the numbers of cycles of $x$ of length
$i$. So the cycle type keeps track of the lengths of the cycles of $x$,
counting multiplicities.

\begin{proposition} Two elements in $\Sym(n)$ are conjugate if and only if
they have the same cycle type.
\end{proposition}
\proof We will show that the conjugate of the cycle $g=(a_1,\ldots,a_m)$ by
the element $\pi\in \Sym(n)$ is the cycle
$(\pi(a_1),\pi(a_2),\ldots,\pi(a_m))$.

Let $1\leq k\leq n$. If $k\neq \pi(a_j))$ for some $j$, then $\pi^{-1}(k)$
is fixed by $g$. So $(\pi g\pi^{-1})(k)=\pi(\pi^{-1}(k))=k$.

If $k=\pi(a_j)$ then
$$(\pi g\pi^{-1})(\pi(a_j))=\pi(g(a_j))=\pi(a_{j+1})$$

Suppose now that $g$ has cycle type $(m_i)$. Then
$$g=\prod_{i\geq 1}\prod_{1\leq j\leq m_i} g_{ij}$$
where $g_{ij}=(a_1(ij),\ldots a_i(ij))$ is a cycle of length $i$. Moreover
for each $1\leq l\leq n$ there exists uniquely determined $i, j$ and $k$ with
$l=a_k(ij)$.

In particular,

$$g^\pi=\prod_{i\geq 1}\prod_{1\leq j\leq {m_i}} g_{ij}^\pi$$
where $g_{ij}^\pi=(\pi(a_1(ij)),\ldots \pi(a_i(ij)))$ is a cycle of length
$i$. So also $g^\pi$ has cycle type $(m_i)$.

Conversely, suppose also $h$  has cycle type $(m_i)$. so
$$h=\prod_{i\geq 1}\prod_{1\leq j\leq {m_i}} h_{ij}$$
where $h_{ij}=(b_1(ij),\ldots b_i(ij))$ is a cycle of length $i$.

Define  $\pi\in Sym(n)$ by
$$\pi(a_k(ij))=b_k(ij)$$
But then $g^{\pi}=h$ and $g$ and $h$ are conjugate.\qed

Lets now investigate the normal subgroups of $\Sym(3)$. We start by
listing the conjugacy classes \smallskip

$$\begin{array}{lr} e & 1 \text{ element}\\
(123),(132) & 2 \text{ elements}\\
(12), (13), (23) & 3\text{ elements}\end{array}$$

Let $e\neq N\unlhd \Sym(3)$. If $N$ contains the $2$-cycles, then $|N|\geq
4$. Since $|N|$ divides $|\Sym(3)|=6$ we get $|N|=6$ and $N=\Sym(3)$.

If $N$ does not contain the 2-cycles we get $N=\{e,(123),(132)\}=\Alt(3)$.

So $\Alt(3)$ is the only proper normal subgroup of $\Sym(3)$.\bs

Lets move on to $\Sym(4)$. The conjugacy classes are:

$$\begin{array}{cr} e &  1 \text{ element}\\

(123), (132), (124), (142), (134),(143), (234), (243)%  8 \text{ elements}\\

(12)(34),(13)(24),(14)(23)& 3\text{ elements}\\

(12),(13),(14),(23),(24),(34)& 6 \text{ elements}\\

(1234), (1243), (1324),(1342),(1423),(1432)& 8 \text{ elements}
\end{array}$$

Let $N$ be a proper normal subgroup of $\Sym(4)$ then $|N|$ divides
$24=|\Sym(4)|$, Thus $|N|=2,3,4,6,8$ or $12$. So $N$ contains $1,2,3,5,7$
or $11$ non-trivial elements. As $N\setminus\{e\}$ is a union of conjugacy 
classes, $|N|-1\geq 3$. So $|N|-1\in \{3,5,7,11\}$. In particular $|N|-1$ 
is odd. But $\Sym(3)$ has a unique non-trivial conjugacy class of odd 
length, namely the double 2-cycles. So $K\subseteq N$, where 
$K=\{e,(12)(34),(13)(24), (14)(23)\}$. Then $|N\setminus K|\in \{0,3,8\}$ 
All remaining conjugacy classes have length $6$ or $8$ and we conclude that 
$N=K$ or $|N\setminus K|=8$. In the second case, $N$ consist of $K$ and the 
3-cycles and so $N=\Alt(4)$. Note also that $(12)(34)\, (13)(24)=(14)(23)$ 
and so $K$ is indeed a normal subgroup of $\Sym(4)$.

Thus the  proper normal subgroups of $\Sym(4)$ are $\Alt(4)$ and $K$.

Just for fun lets as determine the quotient group $\Sym(4)/K$. No
non-trivial element of $K$ fixes  "4". So $\Sym(3)\cap K=\{e\}$ and
$$|\Sym(3)K|=\frac{|\Sym(3)||K|}{|\Sym(3)\cap K|}=
\frac{ 6\cdot 4}{1}=24=|\Sym(4)|.$$
Thus $\Sym(3)K=\Sym(4)$. And
$$\Sym(4)/K=\Sym(3)K/K\cong \Sym(3)/(\Sym(3)\cap K)=\Sym(3)/\{e\}\cong 
\Sym(3)$$ So the quotient of $\Sym(4)$ by $K$ is isomorphic to $\Sym(3)$.

\bs

Counting arguments as above can be used to determine the normal subgroups
in all the $\Sym(n)$'s, but we prefer to take a different approach.

\begin{lemma}\l{3cycles}
\begin{itemize}
\AI{a} $Alt(n)$ is the subgroup of $\Sym(n)$ generated by all the 3-cycles.
\AI{b} If $n\geq 5$ then $\Alt(n)$ is the subgroup of $\Sym(n)$ generated
by all the double 2-cycles.
\AI{c} Let $N$ be a normal subgroup of $\Alt(n)$ containing a 3-cycle. Then
$N=\Alt(n)$.
\AI{d} Let $n\geq 5$ and $N$ a normal subgroup of $\Alt(n)$ containing a
double 2-cycle. Then $N=\Alt(n)$.
\end{itemize}
\end{lemma}
\proof (a) By induction on $n$. If $n\leq 3$, all non-trivial elements in
Alt(n) are 3-cycles. So we may assume $n\geq 4$. Let $H$ be the subgroup of
$\Sym(n)$ generated by all the 3-cycles. By induction $\Alt(n-1)\leq H$.
Let $g\in \Alt(n)$. If $g(n)=n$, $n\in \Alt(n-1)\leq H$. So suppose
$g(n)\neq n$ and let $a<n$ with $a\neq g(n)$. Let $h$ be the 3-cycle
$(g(n),n,a)$. Then $(hg)(n)=h(g(n))=n$. Hence $hg\in Alt(n-1)\leq H$ and so
also $g=h^{-1}(hg)\in H$. \smallskip

(b) Let $h=(a,b,c)$ be a 3-cycle in $\Sym(n)$. Since $n\geq 5$, there exist
$1\leq d<e\leq n$ distinct from $a,b$ and $c$. Note that
$$(a,b,c)=(a,b)(d,e) \, (b,c)(d,e)$$
and so the subgroup generated by the double 2-cycles contains all the
3-cycles. Hence (b) follows from (a).

(c)  Let $h=(a,b,c)$ by a 3-cycle in $N$ and $g$ any 3-cycle in
$\Sym(n)$. By (a) it suffices to prove that $g\in N$. Since all 3-cycles are
conjugate in $\Sym(n)$ there exists $t\in \Sym(n)$ with $h^t=g$. If $t\in
\Alt(n)$ we get $g=h^t\in N^t= N$, as $N$ is normal in $\Alt(n)$.

So suppose that $t\not\in Alt(n)$. Then $t(a,b)\in \Alt(n)$. Note that
$h^{-1}=(c,b,a)=(b,a,c)$ and so
$(h^{-1})^{(a,b)}=(b,a,c)^{(a,b)}=(a,b,c)=h$. Thus

$$(h^{-1})^{t(a,b)}=((h^{-1})^{(a,b)})^t=h^t=g$$

As the left hand side is in $N$ we get $g\in N$.

(d) A similar argument as in (c) shows that (b) implies (d)\qed


\begin{theorem}\l{altnsimple} Let $n\geq 5$. Then $\Alt(n)$ has no proper
normal subgroup.
\end{theorem}
\proof If $n>5$ we assume by induction that the theorem is true for $n-1$.
Let $N$ be a non-trivial normal subgroup of $\Alt(n)$.  \smallskip

Case 1:  $N$ contains an element $g\neq e$ with $g(i)=i$ for some $1\leq
i\leq n$.\smallskip

Let $H=\{ h\in \Alt(n)\mid h(i)=i\}$. Then $H\cong\Alt(n-1)$, $g\in H\cap
N$ and so $H\cap N$ is a non-trivial normal subgroup. We claim the $H\cap
N$ contains a 3-cycle or a double 2-cycle. Indeed if $n=5$, then $n-1=4$
and the claim holds as every non-trivial element in $\Alt(4)$ is either a
3-cycle or a double 2-cycle. It is also true for  $n>5$ since then by
induction $H\cap N=H$.

By the claim and \ref{3cycles}c,d we conclude $N=\Alt(n)$.\smallskip


Case 2: $N$ contains a element $g$ with a cycle of length at least $3$.
\smallskip

Let $(a,b,c,\ldots)$ be a cycle of $g$ of length at least 3. Let $1\leq
d\leq n$ be distinct from $a,b$ and $c$. Put $h=g^{(adc)}$. Then $h$ has
the cycle $(d,b,a,\ldots)$. Also as $N$ is normal in $\Alt(n)$, $h\in N$.
So also $hg\in N$.

We compute  $(hg)(a)=h(b)=a$ and $(hg)(b)=h(c)\neq h(d)=b$. So $hg\neq e$
and $hg$ fixes  $"a"$. So by case 1, $N= \Alt(n)$.\smallskip

Case 3: $N$ contains an element $g$ with at least two  2-cycles.\smallskip

Such a $g$ has the form $(ab)(cd)t$ where $t$ is a product of cycles
disjoint from $\{a,b,c,d\}$. Let $h=g^{(abc)}$. Then $h=(bc)(ad)t$
Thus
$$gh^{-1}=(ab)(cd)tt^{-1}(bc)(ad)=(ac)(bd).$$
 As $h$ and $gh^{-1}$ are
in $N$, Case 1 ( or  \ref{3cycles}d) shows that $N=\Alt(n)$,.\smallskip

Now let $e\neq g\in N$. As $n\geq 4$, $g$ must fulfill one of the three
above cases and so $N                                                                           
                                                                  =\Alt(n)$.\qed

A group without proper normal subgroups is called simple. So the previous
theorem can be rephrased as:

\centerline{For all $n\geq 5$, $Alt(n)$ is simple.}\medskip

\begin{proposition}\l{normalsym} Let $N\normal \Sym(n)$. Then either 
$M=\{e\}, \Alt(n)$ or $\Sym(n)$, or $n=4$ and 
$N=\{e,(12)(34),(13)(24),(14)(23)\}$. \end{proposition} \proof
 The case  $n\leq 4$ was dealt with above. So suppose $n\geq 5$.
  Then $N\cap \Alt(n)$ 
is a normal subgroup of $\Alt(n)$ and so by \ref{altnsimple}, $N\cap 
\Alt(n)=\Alt(n)$ or $\{e\}$.

In the first case $\Alt(n)\leq N\leq \Sym(n)$. Since
$|\Sym(n)/\Alt(n)|=2$, we conclude $N=\Alt(n)$ or $N=\Sym(n)$.

In the second case we get 
$$|N|= |N/N\cap \Alt(n)|=| N\Alt(N)/Alt(N)|\leq |\Sym(n)/Alt(n)|\leq 2$$
Suppose that $|N|=2$ and let $e\neq n\in N$. As
$n^2=e$, $n$ has a 2-cycle $(ab)$. Let $a\neq c\neq b$ with $1\leq c\leq
n$. The $n^{(abc)}$ has cycle $(bc)$ and so $n\neq n^{(abc)}$. A
contradiction to $N=\{e,n\}$ and $N\normal \Sym(n)$.\qed

\begin{lemma}\l{absim} The abelian simple groups are exactly cyclic groups 
of prime order.
\end{lemma}
\proof Let $A$ be an abelian simple group and $e\neq a\in  A$. Then $\langle
a\rangle \unlhd A$ and so $A=\langle a\rangle$ is cyclic. Hence $A\cong
\mathbb Z/m\mathbb Z$ for some $m\geq 0$. If $m=0$, $2\mathbb Z$ is a normal
subgroup. Hence $m>0$. If $m$ is not a prime we can pick a divisor $1<k<m$.
But then $k\mathbb Z/m\mathbb Z$ is a proper normal subgroup. \qed







\section{Direct products and direct sums}\l{dpds}

Let $G_1$ and $G_2$ be groups. Then $G=G_1\times G_2$ is a group where the
binary operation is given by
$$(a_1,a_2)(b_1,b_2)=(a_1b_1,a_2b_2).$$

Consider the projection maps
$$\pi_1: G\to G_1, (a_1,a_2)\to a_1 \quad \mbox{ \rm and} \quad\pi_2: G\to
G_2, (a_1,a_2)\to a_2$$

Note that each $g\in G$ is uniquely determined by its images under
$\pi_1$ and $\pi_2$. Indeed we have $g=(\pi_1(g),\pi_2(g))$. We exploit this
fact in the following abstract definition.

\begin{Def} Let $(G_i,i\in I)$ be a family of groups. The \ei{direct 
product} of the $(G_i,i\in I)$ is a group $G$ together with a family of 
homomorphism $(\pi_i: G\to G_i,i\in I)$ such that:

Whenever $H$ is a group and $(\alpha_i: H\to H_i,i\in I)$ is family of
homomorphism, then there exists a unique homomorphism $\alpha: H\to G$ such
that the diagram:
\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(0,40){$G$}
\put(4,41.3){\vector(1,0){25}}
\put(16,42.5){$\alpha$}
\put(30,40){$H$}
\put(15,23){$G_i$}
\put(3,39){\vector(1,-1){12}}
\put(30,39){\vector(-1,-1){12}}
\put(4.6,31.2){$\pi_i$}
\put(25,31.2){$\alpha_i$}
\end{picture}$$
commutes for all $i\in I$.
\end{Def}

We will now show that the direct product ( in the above sense) always
exists. As a set let $G=\prod_{i\in} G_i$, the set theoretic product of the
$G_i's$. That is $G$ consists of all function $f:I\to\bigcup_{i\in I} G_i$
with $f(i)\in G_i$ for all $i\in I$. The binary  operation is defined by
$(fh)(i)=f(i)h(i)$.  It is easy to
check that $G$ is a group. Define
 $$\pi_i: \prod_{i\in I} G_i \to G_i, f\to  f(i).$$
Obviously $\pi_i$ is a homomorphism. Let $H$ a group and $\alpha_i:
H\to G_i$ a family of homomorphism. Define $\alpha: H\to G$ by

$$\alpha(h)(i):=\alpha_i(h) \mbox{\rm for all} \ i\in I$$
But this is equivalent to
 $$\pi_i(\alpha(h))=\alpha_i(h)$$
 and so to
$$\pi_i\alpha=\alpha_i.$$

In other words, $\alpha$ is the unique map which
makes the above diagram commutative. It trivial to verify that $\alpha$ is
 a homomorphism and so $(\pi_i,i\in I)$ meets the
definition of the direct product.\bs

Lets go back to the above example $G=G_1\times G_2$. This time we consider
the inclusion maps:
$$\rho_1: G_1\to G, g_1\to (g_1,e)\mr{ and }  \rho_2:G_2\to G, g_2\to
(e,g_2)$$
Note also that $[\rho_1(G_1),\rho_2(G_2)]=\{e\}$.

Given a group $H$. A family  of \ei{commuting homomorphism} is a family of
homomorphism $(\alpha_i:G_i\to H,i\in I)$ such that
$$\alpha_i(g_i)\alpha_j(g_j)=\alpha_j(g_j)\alpha_i(g_i)$$
 for all $i\neq j\in I, g_i\in G_i$ and $g_j\in G_j$. 

\begin{Def} A \ei{direct sum} of the family of groups $(G_i,i\in I)$ is a
group $G$ together with a  family  of commuting homomorphism 
$(\rho_i:G_i\to G, i\in I)$ such that:

Whenever $H$ is a group and   $(\alpha_i:G_i\to H,i\in I)$ is a
family of commuting homomorphism, then there exists a unique homomorphism
$\alpha:G\to H$ so that the diagram
\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(0,40){$G$}
\put(4,41.3){\vector(1,0){25}}
\put(16,42.5){$\alpha$}
\put(30,40){$H$}
\put(15,23){$G_i$}
\put(15,27){\vector(-1,1){12}}
\put(19,27){\vector(1,1){12}}
\put(4.6,31.2){$\rho_i$}
\put(25,31.2){$\alpha_i$}
\end{picture}$$
commutes for all $i\in I$.
\end{Def}

 Before we proceed and show that directs sums exists we prove a couple of 
lemmas, which are useful in the construction.

 \begin{lemma}\l{directsumgen} Let $(\rho_i: G_i\to G,i \in I)$ be a direct 
sum of $(G_i,i\in I)$. Then \begin{itemize}
\AI{a} Each $\rho_i, i\in I$, is one to one.
\AI{b} $G=\langle \rho_i(G_i)\mid i\in I\rangle$.
\end{itemize}
\end{lemma}
\proof (a) For $i,j\in I$ define
$$\alpha_{ij}: G_i\to G_j, g\to \begin{cases}  g& \text{ if } i=j\\
                                               e& \text{ if } i\neq j
                                \end{cases}$$
Then for each $j\in I$, $(\alpha_{ij}\mid i\in I)$ is a family of 
commuting homomorphisms. So there exists $\alpha_j:G\to G_j$ with 
$\alpha_{ij}=\alpha_j\rho_i$. 

As $\alpha_{ii}=\id_{G_i}$ is one to one, also  $\rho_i$ is to one.

(b) Let $H=\langle \rho_i(G_i) \mid i\in I\rangle $. Define $\tilde\rho_i: 
G_i\to H, g\to \rho_i(g)$. Hence there exists map $\tilde \beta: G\to H$ with
$\beta\rho_i=\tilde \rho_I$. $\tilde\beta$ defines a map $G\to G, g\to 
\beta(g)$. Then $\beta\rho_i=\rho_i$ for all $i\in I$. Now also $\id_G$ is 
a map from $G\to G$ with $\id_G\rho_i=\rho_i$, so the uniqueness part in 
the definition of the direct sum implies $\beta=\id_G$. Thus for all $g\in 
G$, $g=\id_G(G)=\beta(g)\in H$.\qed

\begin{lemma}\l{alphaunique} Let $\alpha,\beta :G\to H$ be group 
homomorphism. Let $(G_i,i\in I)$ be a family of subgroups of $G$. Suppose 
that 
\begin{itemize} \AI{a} $\alpha\mid_{G_i}=\beta\mid_{G_i}$ for all 
$i\in I$. 
\AI{b} $G=\langle G_i\mid i\in I\rangle$. 
\end{itemize} 
Then  $\alpha=\beta$
\end{lemma} \proof Let $D=\{ g\in G\mid 
\alpha(g)=\beta(g)\}$. Clearly $D$ is a subgroup of $G$. By (a) $G_i\leq D$ 
for all $i\in I$. Thus by (b), $G\leq D$ and so $D=G$.\qed


It follows from the two preceding lemmas that the uniqueness statement in 
the definition of the direct sum can be equivalently replaced by the 
condition $G=\langle \rho_i(G_i)\mid i\in I\rangle$.



 
 We will construct the direct sum as a subgroup of the direct product 
$\prod_{i\in I}G_i$. We will view the elements of the direct products as 
tuples $g=(g_i)_{i\in I}$, with $g_i\in G_i$ for all $i\in I$. Define the 
\ei{support} $\supp(g)$ of $g$ by
 $$\supp(g)=\{i\in I\mid g_i\neq e\}.$$
  Let $$\bigoplus_{i\in I} G_i=\{ g \in \prod_{i\in I} G_i\mid\, \supp(g) \text{ 
is finite }\}.$$


Now $\supp(e)=\emptyset$,  
$\supp(g)=\supp(g^{-1})$ and 
$\supp(gh)\subseteq 
\supp(g)\cup\supp(h)$. So $\bigoplus_{i\in I} 
G_i$ is a subgroup of $\prod_{i\in I} G_i$. Define $\rho_i: G_i\to 
\bigoplus_{i\in I} G_i$ by $$\rho_i(g)_j=\left\{ \begin{array}{ll} e    & 
\mbox{ if $j\neq i$} \\ g & \mbox{ if $j=i$} \end{array} \right.$$ Then for 
all $i\neq j$ 
  $$(\rho_i(g_i)\rho_j(g_j))_k= \begin{cases} g_i & \text{ if } 
k=i\\ g_j & \text{ if } k=j \\ e   & \text{ if } i\neq k\neq 
j\}\end{cases}=(\rho_j(g_j)\rho_i(g_i))_k$$
and so $(\rho_i,i\in I)$ is a 
family of  commuting homomorphism. Note that $\bigoplus_{i\in I} G_i$ is 
exactly the subgroup of $\prod_{i\in I} G_i$ generated by the 
$\rho_i(G_i), i\in I$

 Let $H$ be a group and $(\alpha_i:G_i\to H,i\in I)$  a family of commuting
 homomorphism. Define $\alpha:\bigoplus_{i\in I} G_i \to H$ by
 $$ \alpha((g_i)_{i\in I})=\prod_{i\in I} \alpha_i(g_i)$$
The product on the right hand side  does not seem to make
sense at first. But all but finitely many of the $g_i$'s ( and so also of
$\alpha_i(g_i))$'s are trivial. So the product is effectively a finite
product. Secondly since the $\alpha_i(G_i)$ commute with each other, the
order in which the product is taken does not matter. To verify that 
$\alpha$ is homomorphism we compute

 $$\alpha(g)\alpha(h)=\prod_{i\in I}\alpha_i(g_i)\prod_{i\in I}\alpha_i(h_i)
 =\prod_{i\in I}\alpha_i(g_i)\alpha_i(h_i)=\prod_{i\in 
I}\alpha_i(g_ih_i)=\alpha(gh)$$

 
Let $g\in G_i$. Then  $\rho_i(g)_j =e$ for all $j\neq 1$ and  
$\alpha(\rho_i(g))=\alpha_i(g)$. Thus $\alpha\rho_i=\alpha_i$.

The uniqueness of $\alpha$ follows from $G=\langle \phi_i(G_i)\rangle$ and 
\ref{alphaunique}\qed

We say that $G$ is the internal direct sum of $(G_i, i\in I)$ provided that
each $G_i$ is a subgroup of $G$ and that $G$, together with the inclusion
map from $G_i$ to $G$, is a direct sum of  $(G_i,i\in I)$. In particular
this  means that for each family $\alpha_i: G_i\to H$ of commuting
homomorphism  there exists a unique homomorphism $\alpha: G\to H$ with 
$\alpha\mid_{G_i}=\alpha_i$.

\begin{proposition}\l{internal sum}
Let $G$ be a group and $(G_i,i\in I)$ a family of subgroups. The following
are equivalent:
\begin{itemize}
\NI{1}  $G$ is the internal direct sum of the $(G_i,i\in I)$..
\NI{2}  Each of  following three statement hold:
        \begin{itemize} \AI{a} Each $G_i$ is normal in $G$.
        \AI{b} $G=\langle G_i\mid i\in I\rangle$.
        \AI{c} For each $i$, $G_i\cap \langle G_j\mid i\neq j\in
I\rangle=\{e\}$.
        \end{itemize}
 \NI{3} $[G_i,G_j]=e$ for all $i\neq j\in G$ and each $g\in G$ can be
uniquely written as $\prod_{i\in I} g_i$, there $g_i\in G_i$ and all but
finitely many $g_i$'s are trivial.
\end{itemize}
\end{proposition}
\proof $(1)\Longrightarrow (2)$

 Suppose (1) holds. By \ref{directsumgen}b, 2b 
holds. 

As the inclusion maps commute, $[G_i,G_j]=\{e\}$ for all $i\neq j$. 
In particular $G_j\leq N_G(G_i)$ for all $j\in I$. So 2a follows from 2b.

Let $\alpha_{ij}$ and $\alpha_i$ be as in the proof of \ref{directsumgen}a. 
Then $\alpha_i(g)=g$ for all $g\in G_i$. In particular, $G_i\cap \ker 
\alpha_i=\{e\}$. For all $j\neq i$, $G_j\leq \ker \alpha_i$ so 2c holds.

$(2)\Longrightarrow (3)$

 Suppose (2) holds. $H_i=G_i\cap \langle G_j\mid i\neq j\in I\rangle$. By 
assumption each $G_j$ is normal in $G$ so both $G_i$ and $H_i$ are normal 
in $G$. Moreover by assumption $G_i\cap H_i=e$ and so $$[G_i,H_i]\leq 
G_i\cap H_i=e$$ Thus $[G_i,G_j]=e$ for all $i\neq j\in I$. By assumption 
$G$ is generated by the $G_i's$ and so $g\in G$ can be written as 
$\prod_{i\in I} g_i$.

Suppose that
$$\prod_{i\in I} g_i=\prod_{i\in I} a_i$$
for some $g_i,a_i\in G_i$. Then

$$a_ig_i^{-1}=\prod_{i\neq j\in I} a_j^{-1} g_j$$

As the left side lies in $G_i$ and the right side in $H_i$ we conclude that
$a_ig_i^{-1}=e$ and so $a_i=g_i$. Thus (3) holds.

$(3)\Longrightarrow (1)$

Suppose that (3) holds. Let $(\alpha_i: G_i\to H, i\in )I$ be a
family of commuting homomorphism. Define $\alpha: G\to H$ by
$\alpha(g)=\prod_{i\in I} \alpha_i(g_i)$, where $g=\prod_{\in I} g_i$ and
$g_i\in G_i$. Hence (1) holds. \qed


The direct sums are slightly more natural in the category of abelian 
groups, namely every family of homomorphisms is automatically a family of 
commuting homomorphisms. In particular we see that the direct sum of a 
family of abelian groups is the coproduct in the category of abelian groups.

The direct sum can also be used to define the \ei{free abelian group} 
\ei{$ FA(I)$} on a set $I$. Namely put 
$$ FA(I)=\bigoplus _{i\in I} \mb Z.$$ 
Identify $i$ with $\rho_i(1)$. Then we see that every element in $FA(I)$ 
can be uniquely written as $$\sum_{i\in I} n_i i$$ where $n_i\in {\mb Z}$ 
and almost all $n_i$'s are $0$. Note here that in an abelian group we write 
$na$ for $a^n$. $FA(I)$ as the following universal property:

\begin{theorem}\l{freeabelian} Let $A$ be an abelian group and $(a_i,i\in 
I)$ a family of elements in $A$ Then there exists a unique homomorphism 
$$\alpha: FA(I)\to A \text{ with }  i\to a_i.$$ for all $i\in I$. 
\end{theorem} \proof This follows from \ref{free1} and the definition of 
the direct sum. $\alpha$ is given by $$\alpha( \sum_{i\in I} n_i 
i)=\sum_{i\in I} n_i a_i$$\qed

Direct products and direct can also be defined for semigroups and monoids.
Direct sums cause a slight problem for semigroups since then the condition 
$g_i=e$ for almost all $i$ makes no sense. Maybe the easiest way to go 
around this problem is to embed each semigroup $G_i$ into a monoid 
$G_i^+=G_i\cup \{e_i\}$ where $e_i$ is an identity in $G_i^+$. Then define
$$\bigoplus_{i\in I}G_i=\bigoplus_{i\in I} G_i^+\,\setminus \{ (e_i)_{i\in 
I}\}$$

The \ei{free abelian monoid} on a set $I$ is
$$\bigoplus_{i\in I} \mb N$$
and removing the identity from this we get the \ei{free abelian semigroup}.


\section{Free products}

  Let $(G_i,i\in I)$ be a family of groups. In this
section we will construct a group called the \ei{free product} of the 
$(G_i,i\in I)$ and denoted by $\coprod_{i\in I} G_i$. On an intuitive level 
this group is the largest group which contains the  $G_i$'s  and is 
generated by them. On a formal level it is the coproduct of the $G_i$'s in 
the category of groups. (See theorem \ref{CoGr} below). To simplify 
notation we will assume ( without loss of generality)




 \begin{hypothesis}
 \begin{itemize}
 \AI{i}  $(G_i,i\in I)$ is a family of groups. 

 \AI{ii} $e_{G_i}=e_{G_j}$ for all $i,j\in I$. Call this common identity
element $e$.

\AI{iii} $G_i\cap G_j=\{e\}$ for all $i\neq j\in I$.
\end{itemize}
\end{hypothesis}

Let $X=\bigcup_{i\in I} G_i$. For $x\in X$ with $x\neq e$ let $i_x\in I$ be
defined by $x\in G_{i_x}$. Note that by (iii) of our Hypothesis $i_x$ is
well defined. Let $n\in \mb N$. A \ei{word}  of length n in $X$ is a tuple 
$(x_1,x_2,\ldots x_n)$ with $x_m\in X$ for all $1\leq m\leq n$. $W$ denotes 
the set of all words. The empty tuple ($n=0$) is denoted by $w_0$. Define 
a binary operation $"*"$ on $W$ by

$$ (x_1,x_2,\ldots,x_n)*(y_1,y_1\ldots,y_m)= (x_1,\ldots,x_n,y_1,\ldots
y_n).$$

Clearly $"*"$ is associative. As  $w_0$ is an
identity, $W$ is a monoid.



Identify each $x\in X$ with the word $(x)$. Call $a, b\in X$ comparable if 
there exists $i\in I$  with $a,b\in G_i$. ( So either $a=e$, or $b=e$, or 
$i=i_a=i_b$). We would like that $ab=a*b$ for such $a,b$, but this is 
nonsense, since $(ab)$ is a word of length $1$ and $a*b=(a,b)$ is of length 
2. To fix this problem we will introduce an equivalence relation on $W$.


Let $v,w\in W$. Write  $v<w$ if one of the following holds:

\begin{itemize}
 \NI{ <1}  There exists $x,y\in W$ and
comparable $a,b\in X$ with $w=x*a*b*y$ and $v=x*ab*y$
\NI{< 2} There exists $x,y\in W$ so that $w=x*e*y$ and $w=x*y$.
\end{itemize}

 Note that $v<w$ is only possible if $l(v)=l(w)-1$, where $l(v)$ denotes
the length of the word $v$, Also since $e$ is comparable with any $x\in X$,
condition ($<2$) implies condition ($<1$), with one exception though:

If $x$ and $y$ are both the empty word $w_0$ we see from $(<2)$ that $w_0<
e$.

As $<$ is not symmetric  we define $v-w$ if $v<w$ or
$w<v$. Finally  to achieve transitivity define $v\sim w$ if
$$v=v_0 - v_1 - v_2 -\ldots -  v_{n-1}- v_n=w$$
for some $v_k\in W$. Here we allow $n=0$, so  $v\sim v$ for all words $v$.
The  minimal such $n$ is called the distance of $v$ and $w$.


\begin{lemma}\l{basicsim} $\sim$ is an equivalence relation and 
\begin{itemize}
\NI{\sim 1} $ab\sim a*b$ for all comparable $a,b$ in $X$
\NI{\sim 2} If $t,v,w\in W$ with $v\sim w$ then $t*v\sim t*w$.
\NI{\sim 3} If $t,v,w\in W$ with $v\sim w$ then $v*t\sim w*t$.
\end{itemize} \end{lemma}
\proof By $(<1)$ with $x=y=w_0$,  $ab<a*b$ for all comparable pairs $a,b$.
So $(\sim 1)$ holds.

To prove $(\sim 2)$ let $v\sim w$. By induction on the distance of $v$ and
$w$ we may assume that $v-w$, say $v<w$.

So $w=x*a*b*y$ and $v=x*ab*y$ for appropriate $x,y,a$ and $b$.

Thus $t*w=(t*x)*a*b*y$ and $t*v=(t*w)*ab*y$.

Hence $t*v<t*w$ and in particular $t*v\sim t*w$.

$(\sim 3)$ is proved with a similar argument.\qed


For $w\in W$ let $\tilde w$ be the equivalence class of $"\sim"$
containing $w$. Let $\tilde W$ be the set of all such equivalence classes.
Define a binary operation on $\tilde W$ by $\tilde v * \tilde
w=\widetilde{v*w}$. We need to verify that this is well defined:

So let  $v_1\sim v_2$ and $w_1\sim w_2$. Then the previous lemma
\ref{basicsim} $v_1*w_1\sim v_2*w_1$ and $v_2 *w_1\sim v_2 * w_2$.
So by transitivity of $\sim $, $v_1 * v_2\sim w_1 * w_2$, as required.


\begin{lemma}\l{tildewgroup}
\begin{itemize}

\AI{a} $\tilde W$ is a group.

\AI{b} Let $i\in I$. Then map $\rho_i: G_i \to W$, $a\to \tilde{(a)}$ is a
homomorphism.

\AI{c}  $\tilde W=\langle \rho_i(G_i)\mid i\in I\rangle$.

\end{itemize}
\end{lemma}

\proof As $W$ is a monoid so is $\tilde W$. By $(\sim 1)$, $\rho_i$ is a
homomorphism of monoids. Also $\rho_i(e)=\tilde e=\tilde w_0$ is the identity
of $\tilde W$ and it follows that $\tilde a$ is invertible for all $a\in
G_i$, that is for all $a\in X$. But every element in $\tilde W$ is product
of elements in $\tilde X$. Thus (c) holds and all elements in $\tilde W$ are
invertible. Hence also (a) is proved.\qed


We have found the group we were looking for.  Next we will proceed to find a
 canonical representative for each of the equivalence classes.

Call a word $w=(x_1,\ldots x_n)$ reduced if $x_k\neq e$ (for all $1\leq
k\leq n$) and  $x_k$ and $x_{k+1}$ are not comparable (for all $1\leq k<
n$. So $w$ is not reduced if and only if there exists $v\in W$ with $v<w$.
Also each $e\neq a\in G_i$ is reduced. We will show that every
equivalence class contains a unique reduced word.

For this we consider one further relation on $W$. Define $v<<w$ if
      $$v=v_0< v_1 < v_2\ldots v_{n-1}< v_n=w$$
for some $v_k\in W$. Again allow for $n=0$ and so $v<<v$. Also note that
$v<<w$ implies $v\sim w$ ( but not vice versa).


\begin{lemma}\l{reducedwords}
\begin{itemize}
\AI{a}  For each $w\in W$ there exists a unique reduced word $w_r\in W$ with
$w_r<<w$. $w_r$ is called the reduction of $w$.

\AI{b}  $v\sim w$ if an only $v_r=w_r$.

\AI{c}  Each $\tilde w$ contains a unique reduced word, namely $w_r$.
\end{itemize}
\end{lemma}

\proof (a) Choose a word $z$ of minimal length with respect to $z<<w$. If
$v<z$ for some $v$ we conclude $v<<w$ and $l(v)=l(z)-1< l(z)$, a
contradiction to the minimal choice of $z$. Hence no such $v$ exists and
$z$ is reduced. This establishes the existence part. To show uniqueness let
$z_1$ and $z_2$ be reduced with $z_i<<w$. 

If $z_1=w$ then $w$ is reduced and
 $z_2<<w$ implies $z_2=w=z_1$. So we may assume that
$z_1\neq w\neq z_2$.

By definition of $"<<"$ there exists $v_i\in W$ with
$z_i<<v_i<w$.

Suppose that $v_i=w_0$ for some $i\in \{1,2\}$. Then $w=e$ and
$z_1=w_0=z_2$.

Suppose next that $v_1\neq w_0\neq v_2$. Then $v_i<w$ fulfills $(<1)$ and
there exist $x_i,y_i$ and comparable $a_i,b_i\in X$ with
$$v_i=x_i*a_ib_i*y_i  \hspace{1in} w=x_i*a_i*b_i*y_i$$
Let $l_i$ be the length of $z_i$. Without loss $l_1\leq l_2$. We will
consider various cases.  \smallskip

If $l_1=l_2$ we get $v_1=v_2$. As $x_i<<v_1=v_2$ and $l(v_1)<l(w)$ we can
apply induction and conclude $x_1=x_2$.\smallskip

Suppose next that $l_2=l_1+1$. Then $x_2=x_1*a_1$,  $b_1=a_2$ and
$y_1=b_2*y_2$. So

$$v_1=x_1*(a_1a_2)*b_2*y_2\hspace{1in} v_2=x_1*a_1*(a_2b_2)*y_2$$

If $a_2=e$, then $v_1=x_1*a_1*b_2*y_2=v_2$ and as above $x_1=x_2$.

So suppose $a_2\neq e$. Then $a_1,a_2=b_1$ and $b_2$ all lie in a common
$G_i$. In particular $a_1a_2$ and $b_2$ are comparable. The same holds for
$a_1$ and $a_2b_2$. Put $u= x_1*(a_1a_2b_2)*y_2$. It follows that $u<v_1$
and $u<v_2$. Then $x_i<<v_i$, $u_r<<v_i$ and by induction $x_1=u_r=x_2$.

Finally suppose that $l_1+1< l_2$. Then $x_2=x_1*a_1*b_1*d$ and
$y_1=e*a_2*b_2*y_2$ for some (maybe empty) words $e$ and $d$.

Hence
$$v_1=x_1*(a_1a_2)*d*e*a_2*b_2*y_2\hspace{0.7in}
v_2=x_1*a_1*a_2*d*e*a_2b_2*y_2$$
Put $u=x_1*(a_1a_2)*d*e*a_2b_2*y_2$. Then again $u<v_1$, $u<v_2$ and
$x_1=u_r=x_2$.\smallskip

This completes the proof of (a).

Let $v,w$ be words. If $v_r=w_r$, then $v\sim v_r=w_r\sim w$ and so $v\sim
w$. Conversely suppose that $v\sim w$. By induction on the distance of $v$
and $w$ we may assume that $v-w$ and say $v<w$. Then $v_r<<w$ and so by
(a), $v_r=w_r$. Thus (b) holds.

Let $v$ be any reduced element in $\tilde w$.
Then $v\sim w$ and so by (b) $v=v_r=w_r$. Thus also (c) holds. \qed


Let $W_r$ be the set of reduced words. By the previous lemma the map
$W_r\to \tilde W$, $w\to \tilde w$ is a bijection. Unfortunately, $W_r$ is
not closed under multiplication, that is the product of two reduced words
usually is not reduced. But it is not difficult to figure out what the
reduction of the product is. Indeed let $x=(x_1,\ldots,x_n)$ and
$y=(y_1,\ldots y_n)$ be reduced words. Let $s$ be maximal with
$y_t^{-1}=x_{n-t}$ for all $1\leq t< s$. Then

$$x*y\sim (x_1,\ldots, x_{n-s},y_s,\ldots ,y_m).$$

If $x_{n-s}$ and $y_s$ are not comparable, this is the reduction of $x*y$.

On the other hand if $x_{n-s}$ and $y_s$ are  comparable we have

$$x*y\sim (x_1,\ldots,x_{n-s-1}, x_{n-s}y_s,y_{s+1}\ldots ,y_m)$$
 and this is the reduction of $x*y$.\medskip
 
 We now define the free product $\coprod_{i\in I}G_i$ of $(G_i,i\in I)$ to be 
the group $\tilde W$ together with the family of homomorphism $(\rho_i,i\in 
I)$. The free product has the following important property ( which we could 
have used to define   the free product).



\begin{theorem}\l{CoGr} Let $H$ be a group and $(\alpha_i: i\to H_i)$ a
family of homomorphisms. Then there exists a unique homomorphism
$\tilde \alpha: {\coprod_{i\in I} G_i}\to H$ so that the diagram
\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(-5,40){${\coprod_{i\in I} G_i}$}
\put(9,41.3){\vector(1,0){20}}
\put(16,42.5){$\tilde\alpha$}
\put(30,40){$H$}
\put(15,23){$G_i$}
\put(15,27){\vector(-1,1){11}}
\put(19,27){\vector(1,1){12}}
\put(4.6,31.2){$\rho_i$}
\put(25,31.2){$\alpha_i$}
 \end{picture}$$
 commutes for all $i\in I$.
\end{theorem}
 \proof We define a map $\alpha:W\to H$  by induction on length of the
words. Put $\alpha(w_o)=e$ and if $w=y*g_i$ with $g_i\in G_i$ define
$\alpha(w)=\alpha(y)\alpha_i(g_i)$. Clearly $\alpha$ is a homomorphism of
monoids. We claim that  $\alpha(v)=\alpha(w)$ whenever $v\sim w$. Indeed
it suffices to show this for $v<w$. Then $w=x*a*b*y$ and $v=x*ab*y$ with
$a,b\in G_i$ for some $i$. Hence
$$\alpha(w)=\alpha(x)\alpha(a)\alpha(b)\alpha(y)=
\alpha(x)(\alpha_i(a)\alpha_i(b)\alpha(y)=\alpha(x)\alpha_i(ab)\alpha(y)=
\alpha(x)\alpha(ab)\alpha(y) =\alpha(v).$$
By the claim we get a well defined map $\tilde\alpha:\tilde W\to H, \tilde
w\to \alpha(w)$. Also as $\alpha$ is a homomorphism, $\tilde\alpha$ is,
too. $\tilde \alpha$ is unique, as  the restriction of $\tilde \alpha$
to $\rho_i(G_i)$ is determined by the commuting diagram and as the
$\rho_i(G_i)$ generate $\tilde W$ (see \ref{alphaunique}).\qed


We remark that  free products also exists in the categories of 
semigroups and of monoids. Indeed, everything we did for groups carries 
over word for word, with one exception though. In case of semigroups we do 
not include $w_0$ in the sets of words and omit $(<2)$ in the 
definition of $v<w$. Recall that the only role $(<2)$ played was to 
identify $(e)$ with $w_0$.\medskip


A \ei{relation} in $X$ is an expression of the form $w=e$ where $w$ is a 
word in $X$. Let ${\cal R}$ be a set of words. Define $$ \coprod_{i\in I} 
G_i/\langle  w=e, w\in {\cal R}\rangle$$ to be  the group $\tilde W /N$, 
where $N=\langle \tilde{\cal R}^{\tilde W\rangle}$. $\tilde W/N$ is called 
the group generated by  $(G_i, i\in I) $ with relation $w=e,w\in {\cal R}$. 
Put $$\bar \rho_i: G_i\to  \coprod_{i\in I} G_i/\langle  w=e, w\in {\cal 
R}\rangle,\quad g\to \rho_i(g)N$$

Let $H$ be a group and $(\alpha_i: G_i\to H, i\in I)$ a family of
homomorphism. We say that the family fulfills the relations $w=e, w\in
{\cal R}$ if $\alpha(w)=e$ for all $w\in W$. Here $\alpha$ is as in the
proof of\ref{CoGr}, that is 
$$\alpha((w_1,\ldots,w_n)=\alpha_{i_1}(w_1)\ldots \alpha_{i_n}(w_n)$$
where $w_j\in G_{i_j}$.

\begin{theorem}\l{productrelation}
Let $H$ be a group and $(\alpha_i: G_i\to H, i\in I)$ a family 
of homomorphism which fulfills the relations $w=e, w\in {\cal R}$. Then 
there exists a unique homomorphism 
$$\bar\alpha : \coprod_{i\in I} G_i/\langle  w=e, w\in {\cal R}\rangle \to 
H\text { with } \bar\rho_i(g_i)\to \alpha_i(g_i)$$
for all $g_i\in G_i, i\in I$.
\end{theorem}
\proof
By \ref{CoGr} there exists a unique homomorphism $\tilde \alpha: 
\coprod_{i\in } {G_i}\to H$ with $\tilde \alpha(\rho_i(g_i))=\alpha_i(g_i)$.
Since $(\alpha_i,i\in I)$ fulfills the relations, ${\cal R}\leq \ker 
\alpha$ and so $N\leq \ker \tilde \alpha$. Thus the map $\bar 
\alpha:\tilde W/N\to H, gN\to \alpha(g)$ is well defined and has all the 
desired  properties. The uniqueness of $\bar \alpha$ follows from the 
uniqueness of $\tilde \alpha$.\qed

We will now work out an easy example. Let $I={1,2}$  and
suppose $G_1$ and $G_2$ are both of order $2$.  Let $G_1=\langle a\rangle$
and $G_2=\langle b\rangle$. Then it is easy to list all the reduced words:

$$w_0$$
$$\underbrace{(a*b)*(a*b)*\ldots*(a*b)}_{n\text{ times}}$$
$$\underbrace{(b*a)*(b*a)*\ldots*(b*a)}_{n\text{ times}}$$
$$\underbrace{(a*b)*(a*b)*\ldots*(a*b)}_{n\text{ times}}*a$$
$$\underbrace{(b*a)*(b*a)*\ldots*(b*a)}_{n\text{ times}}*b$$

Put $z=a*b$. Then $z^{-1}=b^{-1}*a^{-1}=b*a$. So the above list now reads
$z^0, z^n, z^{-n}, z^n*a$ and $z^{-n}*b$. The last words is equivalent to
$z^{-n}*b*(a*a)=z^{-(n+1)}*a$. Let $D=\coprod_{i\in \{1,2\}} G_i$. We
conclude that
$$D=\{ z^n, z^na\mid n\in \mathbb Z\}.$$
Let $Z=\langle z\rangle $. Then $Z\cong (\mathbb Z,+)$ and $Z$ has index
two in $G_1*G_2$.  In particular $Z\unlhd D$. Also $z^a=aza=aaba=ba=z^{-1}$.
Thus
$$ (z^{n})^a=z^{-n}\quad\text{ and }\quad  z^na=az^{-n}.$$
 In particular, if $A\leq Z$ then both $Z$ and $a$ normalize $D$ and
$A\normal G$.

Here is a property of $D$ which will come in handy later on: \smallskip

 \centerline{All elements in $D\setminus Z$ are conjugate to $a$ or 
$b$.}\smallskip

 Indeed $z^naz^{-n}=z^nz^na=z^{2n}a$ and $z^nbz^{-n}=z^{2n}b=z^{2n}baa=z^{2n+1}a$. So $z^{2n}a$ is conjugate to $a$ 
and $z^{2n+1}a$ is conjugate to $b$.\medskip

Fix $n\in \mb Z$. Consider the relation $z^n=e$. Put 
$N=\langle z^n\rangle$. Then $N\normal D$ and  so

$$\coprod_{i\in \{1,2\}} G_i/\langle (ab)^n=e\rangle=D/N$$

Since $Z/D\cong \mathbb Z/n\mathbb Z$, $D/N$ has order $2n$. $D/N$ is
called the dihedral group of order $2n$, or the dihedral group of degree
$n$.

Suppose now that $\bar D$ is any group generated by two elements of order
two, $\bar a$ and $\bar b$.  Then there exists a homomorphism  $\alpha:D\to
\bar D$ sending $a$ to $\bar a$ and $b$ to $\bar b$. Let $\bar z=\bar
a\bar b$ and $\bar Z=\langle \bar z \rangle$. Since neither $a$ nor $b$ are
in $ \ker \a$ and all elements in $D\setminus Z$ are conjugate to $a$ or $b$,
$\ker \alpha\leq Z$. Thus $\ker\alpha=\langle z^n\rangle $ for some $n\in
\mathbb N$ and so $\bar D\cong D/\ker\alpha= D/N$. So any group generated
by two elements of order 2 is a dihedral group.\medskip

Next we will use the free products of groups to define the \ei{free group} 
$F(I)$ on a set $I$. First for each $i\in I$ pick a group $G_i$ with $i\in 
G_i$, $G_i\cong (\mathbb Z,+)$ and $G_i=\langle i\rangle$. So

$$G_i=\{i^n\mid n\in \mathbb Z\}.$$ 
Then let 
$$F(I)=\coprod_{i\in I} G_i.$$ 
 and define 
$$\rho: I\to F(I),\quad i\to \tilde i.$$
Identify $i$ and $\tilde i$. Then every element in $F(I)$ can by uniquely 
written as
$$i_1^{n_1}i_2^{n_2}\ldots i_m^{n_m}$$
where $m\in \mathbb N$, $i_k\in I$, $i_k\neq i_{k+1}$ and $0\neq n_k\in 
\mathbb Z$. Indeed these are exactly the reduced words.


\begin{theorem}\l{freegroup} Let $I$ be a set and $H$ a group. For $i\in I$ 
let $h_i\in H$. Then there exists a unique homomorphism $\alpha:F(I)\to H$ 
with $\alpha(i)=h_i$.
\end{theorem}
\proof Define $\alpha_i:G_i\to H$, $i^n\to h_i^n$. The theorem now follows 
from \ref{CoGr}\qed


The concept of relations \index{relation} also caries over. For ${\cal R}$ a 
set of words define 
$$F(I)/\langle w=e, w\in {\cal R}\rangle := F(I)/N,$$
 where $N=\langle \tilde R^{F(I)}\rangle$.  $F(I)/\langle w=e, w \in {\cal 
R}\rangle$ is called the groups defined by the generators $i\in I$ and 
relations $w=e,w\in {\cal R}$. Often this group is also denoted by 
$$\langle I\mid w=e,w\in {\cal R}\rangle$$
For $i\in I$, put $\bar i=iN$.


Let $H$ be group, and $h_i\in H$. We say that $(h_i,i\in I)$ fulfills the 
relations $w=e$ provide that
$$h_{i_1}^{n_1}h_{i_2}^{n_2}\ldots h_{i_m}^{n_m}=e$$
where $w=(i_1^{n_1},i_2^{n_2},\ldots, i_m^{n_m})$.


\begin{theorem}\l{genrel}
Let $H$ be a group and  $(h_i,i\in I)$ a family of elements in $H$ 
fulfilling the relations  $w=e, w\in {\cal R}$. Then there exists a unique 
homomorphism 
$$\bar{\alpha}:\langle I\mid w=e,w\in {\cal R}\rangle\to H\text{ with } 
\bar i\to h_i$$
for all $i\in I$. $\bar \alpha$ is onto, if and only if $H=\langle h_i\mid 
i\in I\rangle$.
\end{theorem}
\proof The first statement follows directly  from \ref{productrelation}. 
The second  one follows from  \ref{basicgen}.\qed


{\bf Some examples:}\medskip

The group $$\langle a,b \mid a^2=e, b^2=e\rangle$$ is the 
infinite dihedral group. 
$$\langle a,b\mid a^2=2,b^2=e, (ab)^n=e \rangle$$ is 
the  dihedral group of degree $n$.

If $v$ and $w$ are words, we also call $v=w$ a relations. It just stands 
for $vw^{-1}=e$, where 
$(i_1^{n_1},\ldots,i_m^{n_m})^{-1}=(i_m^{-n_m},\ldots,i_1^{-n_1})$.
 $$\langle a,b,c\mid  ab=c, ab=ba, c^2=a, c^3=b, c^5=e\rangle$$ 
 is the trivial group. Indeed, 
$c=ab=c^2c^3=c^5=e$. Hence also $a=c^2=e$ and $b=c^2=e$.
$$\langle a, b\mid a^3=b^3=(ab)^2=e\rangle$$ 
is isomorphic to $Alt(4)$.  To see this let $G$ be this group and  put 
$z=ab$. Then $z^2=1$. Put $K=\langle z,z^a\rangle$. Since both $z$ and 
$z^a$ have order two (or 1), $K$ is a dihedral group. We compute 
$$z^{a^2}z^az=(a^2(ab)a^{-2})\, a(ab)a^{-1}\, 
ab=a^3b(a^{-2}a^2)b(a^{-1}a)b=a^3b^3=e.$$

Thus $z^az=z^{-a^2}=z^{a^2}$. In particular $(z^az)^2=1$ and so $K$ is a 
quotient of the dihedral group of order 4. Thus $K=\{e,z,z^a,z^{a^2}\}$. 
Now $(z^{a^2})^a=z^{a^3}=z^e=z$ and so $a\in N_G(K)$. Thus $\langle 
a\rangle K$ is a subgroup of $G$. It contains $a$ and $z=ab$ and so also 
$b=a^{-1}z$. Thus $G=\langle a\rangle K$. As $K$ has order dividing $4$ 
and $\langle a\rangle$ has order dividing $3$, $G$ has order dividing 12.  
Thus to show that $G$ is isomorphic to $\Alt(4)$ it suffices to show that 
$\Alt(4)$ is a homomorphic image of $G$. I.e we need to verify that 
$\Alt(4)$ fulfills the relations.

For this let $a^*=(123)$ and $b^*=(124)$. Then $a^*b^*=(13)(24)$ and so 
$(a^*b^*)^2=e$. Thus there exists a homomorphism $\phi: G\to \Alt(4)$ with 
$\phi(a)=a^*$ and $\phi(b)=b^*$. As $a^*$ and $b^*$ generate $\Alt(4)$, 
$\phi$ is onto. As $|G|\leq |\Alt(4)|$ we conclude that $\phi$ is an 
isomorphism.
\medskip


Similarly to the free group on a set one can define the \ei{free semigroup} 
and the \ei{free monoid} on a set $I$. If $|I|=1$ these are $(\mb 
Z^+,+)$ and $(\mb N,+)$, respectively. In the general case every element in 
the free semigroup ( free monoid) can be uniquely written as 
$$i_1^{n_1}i_2^{n_2}\ldots i_m^{n_m}$$ where $i_k\in I$, $i_k\neq i_{k+1}$ 
and $ n_k\in  \mb Z^+$. Also $m\in \mb Z^+$ in the semigroup case and 
$m\in \mb N$ in the monoid case.



\section{Group Actions}

 \begin{Def}\l{defgroupaction}
 An \ei{action} of a group $G$ on a set $S$ is a function
$$G\times S\to S, (a,s)\to as$$
such that

\begin{itemize}
\AI{GA1} $es=s$ for all $s\in S$.
\AI{GA2} $(ab)s=a(bs)$ for all $a,b\in G$, $s\in S$.
\end{itemize}
\end{Def}

Note the similarity with the group multiplication. In particular, the binary
operation of a group defines an action of $G$ on $G$, called  the action
by left multiplication. The function $(a,s)\to
a*s:=sa$ is not an action ( unless $G$ is abelian) since
$ab*s=sab=(a*s)b=(b*a)s$. For this reason we define the action of $G$ on $G$
by right multiplication as $(a,s)\to sa^{-1}$. There is a further action
of $G$ on itself, namely the conjugation $(a,s)\to s^a=asa^{-1}$.\bs

It might be interesting to notice that an action of $G$ on a set $S$ can 
also be thought of as an homomorphism $\phi: G\to\Sym(S)$. 
Indeed given such a $\phi$ define an action by $(a,s)\to \phi(a)(s)$. Since 
$\phi(e)=e_{\Sym(S)}=\id_S$, $(GA1)$ holds. And $(GA2)$ follows directly 
from $\phi(ab)=\phi(a)\circ \phi(b)$.

Conversely, given an action of $G$ on $S$ and $a\in G$, define $\phi(a):
S\to S, s\to as$. $(GA2)$ translates into $\phi(ab)=\phi(a)\circ\phi(b)$ 
and (GA1) into $\phi(e)=id_S$. We still need to verify that $\phi(a)\in 
\Sym(S)$. But this follows from 
$$\id_S=\phi(e)=\phi(aa^{-1})=\phi(a)\circ\phi(a^{-1})$$


For $X\subseteq S$ define 
$$\Stab_G(X)=\{ g\in G\mid gs=s\text{ for all } s\in X\}.$$ 
Then $\Stab_G(S)$ is exactly the kernel of $\phi$ and  in particular it is 
a normal subgroup. By the isomorphism theorem, 
$$G/\Stab_G(S)\cong \phi(G)\leq \Sym(S).$$
 If $\Stab_G(S)=\{e\}$, we say that the action is faithful. This is the case 
 if and only if  $\phi$ is one. So in some sense the groups acting faithfully  
on a set $S$ are just the subgroups of$\Sym(S)$. \bs

There are lots of actions of groups besides the actions on itself. For example
 $\Sym(S)$ acts on $S$. The automorphism group of the square acts on the 
four corners of the square. The automorphism group of a projective plane 
acts on the points and also on the lines of the plane. The group of 
invertible matrices acts on the underlying vector space.


For the rest of the section we assume:

\begin{hypothesis} $G$ is a group acting on a set $S$.
\end{hypothesis}


\begin{lemma}\l{orbits} Define a relation $\sim$ on $S$ by $s\sim t$ if and only
$t=as$ for some $a\in G$. Then $\sim$ is an equivalence relation on $S$.
\end{lemma}

\proof  Since $s=es$, $s\sim s$ and $\sim $ is reflexive.

 If $t=as$, then
$$a^{-1}t=a^{-1}(as)=(a^{-1} a)s=es=s$$
Thus $s\sim t$ implies $t\sim s$ and $\sim$ is symmetric.

Finally if $s=at$ and $t=br$ then $s=at= a(br)=(ab)r$. Thus $s\sim t$ and
$t\sim r$ implies $s\sim r$ and $\sim$ is reflexive. \qed

 The equivalence classes of $\sim$ are called the \ei{orbits} of $G$ on 
$S$. The set of orbits is denoted by  $S/G$.  The orbit of $G$ containing 
$s$ is $Gs=\{ gs\mid g\in G$\}. A subset $T$ of $S$ is called 
$G$-\ei{invariant} if $gt\in T$ for all $t\in T$ and $g\in G$. In this case 
$G$ also acts on $T$. Observe that the orbits of $G$ on $S$ are  the 
minimal $G$ invariant subsets. We say that $G$ acts \ei{transitive}ly on 
$S$ if $G$ has exactly one orbit on $S$. That is for each $s,t\in S$ there 
exists $g\in G$ with $t=gs$. Equivalently $G$ is transitive on $S$ if 
$S=Gs$ for some (or all) $s\in S$. So the $G$-orbits can be also described 
as subsets of $S$ on which $G$ acts transitively.

Some special cases of orbits:
Let $H\leq G$. The right cosets of $H$ are the orbits for the action of $H$
on $G$ by left multiplication. The left cosets are the orbits for $H$ by
the right multiplication. Finally the conjugacy classes are the orbits for
the action $G$ on $G$ by conjugation.

\begin{Def} Let $G$ be acting on the sets $S$ and $T$ and $\alpha: S\to T$
a function.

\begin{itemize}
\AI{a}  $\alpha$ is called  $G$-\ei{equivariant} if
$$ \alpha(gs)=g\alpha(s)$$
for all $g\in G$ and $s\in S.$

\AI{b} $\alpha$ is called a $G$-\ei{isomorphism} if $\alpha$ is 
$G$-equivariant and an bijection. \end{itemize} \end{Def}


If $G$ acts on a set $S$ it also acts on the \ei{power set} ${\cal P}(S)$, 
that is the set of all subsets. Indeed for $T\subseteq S$ and $g\in G$ put 
$gT=\{gt|t\in T\}$.

 If $H\leq G$ then $G$ acts on $G/H$ by $(a,bH)\to abH$. Clearly this is a
transitive action. It turns out that any transitive action of $G$ is
isomorphic to the action on the coset of a suitable subgroup.



\begin{lemma}\l{transorbits} Let $s\in S$ and put $H=\Stab_G(s)$.
\begin{itemize}
\AI{a} The map
$$\alpha: G/H\to S, \, aH\to as$$
is well defined, $G$-equivariant and one to one.

\AI{b} $\alpha$ is  an $G$-isomorphism if and only if $G$ acts transitively
on $S$

\AI{c} $\Stab(as)=H^a$ for all $a\in G$.

\AI{d}  If $G$ is transitive on $S$, $|S|=|G/\Stab_G(s)|$.
\end{itemize}
\end{lemma}

\proof (a) Let $h\in H$. Then
$(ah)s=a(hs)=as$ and $\alpha$ is well defined. Also
$$\alpha(a(bH))=\alpha( (ab)H)=(ab)s=a(bs)=a\alpha(bH)$$
So $\alpha$ is $G$-equivariant. If $\alpha(aH)=\alpha(bH)$ we get $as=bs$
so $(a^{-1}b)s=s$. As $H=\Stab_G(s)$ this implies $a^{-1}b\in H$ and so
$b\in aH$ and $bH=aH$. Thus $\alpha$ is one to one and (a) is
established.\smallskip

(b) By (a) $\alpha$ is a $G$-isomorphism if and only if $\alpha$ is onto.
But this is the case exactly then $S=Gs$ and so if and only if $G$ is
transitive on $S$.\smallskip

(c)
$$g(as)=as\Longleftrightarrow  a^{-1}gas=s\Longleftrightarrow
a^{-1}ga\in H \Longleftrightarrow g\in aHa^{-1}=H^a$$

(d) follows directly from (b)\qed


\begin{lemma} Suppose that $G$ acts transitively on the sets $S$ and $T$. Let
$s\in S$ and $t\in T$. Then $S$ and $T$ are $G$-isomorphic if only if
$\Stab_G(s)$ and $\Stab_G(t)$ are conjugate in $G$.
\end{lemma}
\proof  Suppose first that $\alpha: S\to T$ is a $G$-isomorphism. Since
$\alpha(gs)=g\alpha(s)$ and $\alpha$ is one to one,
$\Stab_G(s)=\Stab_G(\alpha(s))$. Since $G$ is transitive on $T$, there 
exists $h\in G$ with $g\alpha(s)=t$. Thus 
$$ \Stab_G(t)=\Stab_G(g\alpha(s))=\Stab_G(\alpha(s))^g=\Stab_G(s)^g.$$
Conversely suppose that $\Stab_G(s)^g=\Stab_G(t)$. Then 
$\Stab_G(gs)=\Stab_G(t)$ and so by \ref{transorbits}b applied to $S$ and to 
$T$: $$S\cong G/\Stab_G(gs)= G/\Stab_G(t)\cong T$$ \qed

A subset $R\subset S$ is called a set of \ei{representatives} for the 
orbits on $S$, provided that $R$ contains exactly one element from each 
$G$-orbit. In other words the map $R\to S/G, r\to Gr$ is a bijection. An 
element $s\in S$ is called a \ei{fixed-point} of $G$ if $gs=s$ for all 
$g\in G$. The fixed points correspond to the orbits of length 1 ( the 
trivial orbits). $\Fix_S(G)$ denotes the set of all fixed points. Note that 
\ei{$\Fix_S(G)$}$\subseteq R$ for any set of representatives $R$ for $S/G$ 
and $R\setminus \Fix_G(R)$ is a set of representatives for the non-trivial 
$G$-orbits.


\begin{lemma}\l{orbiteq} Let $R\subset S$ be a set of representatives for
$S/G$.

$$ |S|=\sum_{r\in R} |G/\Stab_G(r)|=|\Fix_S(G)|+\sum_{r\in R\setminus
\Fix_S(G)} |G/\Stab_G(r)|$$
\end{lemma}

\proof Since $S$ is the disjoint unions of its orbits, $|S|=\sum_{r\in R}
|Gr|$. By \ref{transorbits}d,  $|Gr|=|G/\Stab_G(r)|$ and the lemma is
proved.\qed

For the case of conjugation the equation in the preceding lemma is called
the class equation. Define the \ei{center} \ei{$Z(G)$} of a group by 
$$Z(G)=\{ g\in G\mid gh=hg \text{ for all } h\in G\}.$$
 Note that $g$ is a fixed-point for $G$ under conjugation if and  only if 
$g=g^h=hgh^{-1}$ for all $h\in G$ and so if only if $gh=hg$ for all $h\in 
G$. That is $\Fix_G(G)=Z(G)$. Also setting $C_G(a)=\{ b\in G\mid ba=ba\}$ 
we have $G_G(a)=\Stab_G(a)$. With this notation we have:

\begin{lemma}[Class Equation]\l{classeq} Let $R$ be a set of
representatives for the conjugacy classes of $G$. Then

$$G=\sum_{r\in R} |G/C_G(r)|=|Z(G))|+ \sum_{r\in R\setminus Z(G)}
|G/C_G(r)|$$\qed
\end{lemma}

These formulas become particular powerful if $G$ is a finite \ei{$p$-group},  
that is $|G|=p^k$ for some non-negative integer $k$.

\begin{lemma}\l{Smodp} Let $p$ be a prime and  $P$  a $p$-group acting 
on a set $S$. Then
$$|S|\equiv |\Fix_S(P)| \pmod p.$$
\end{lemma}

\proof If $s\in S$ is not a fixed-point, then $\Stab_P(s) \lneq P$ and so
$$|P/\Stab_P(s)|=\frac{|P|}{|\Stab_P(s)|}\equiv 0\pmod p.$$

The lemma now follows from \ref{orbiteq}.\qed

For $H\leq G$ define $N_G^*(H)=\{ a\in G\mid H\leq H^a\}$. 
Note that $N_G^*(H)$ is submonoid of $G$, but not
necessarily a subgroup, as it might not be closed under inverses. 


\begin{lemma}\l{HfixG} Let $H\leq G$.
\begin{itemize}
\AI{a} The fixed-points of $H$ acting by left multiplication on
$G/H$ are $N_G^*(H)/H$.
\AI{b} With respect to the action of $G$ on the subgroups of $G$ by
conjugation, $\Stab_G(H)=N_G(H)$.
\AI{c} If $H$ is finite, then $N^*_G(H)=N_G(H)$.
\end{itemize}
\end{lemma}
\proof(a)  Clearly $gH=H$ if and only if $g\in H$. So
$\Stab_G(H)=H$ and $\Stab_G(aH)=H^a$. Hence $H$ fixes 
$aH$ if and only if $H\leq H^a$, that is if and only if $a\in N_G^*(H)$. 
Thus (a) holds.

(b)  Obvious.

(c) As conjugation is an bijection, $|H|=|H^g|$. So for finite $H$, 
$H\leq H^g$ implies $H=H^g$.\qed

\begin{lemma}\l{CenterP} Let $P$ be a non-trivial $p$-group.
\begin{itemize}
\AI{a}  $Z(P)$ is non-trivial.
\AI{b} If $H\lneq P$ then $H\lneq N_P(H)$.
\end{itemize}
\end{lemma}
\proof (a) Consider first the action by conjugation. By \ref{Smodp}

$$0\equiv |P|\equiv |Z(P)|\pmod p.$$
Thus $|Z(P)|\neq 1$.

(b) Consider the action of $H$ on $P/H$. By \ref{HfixG} and \ref{Smodp}
$$0\equiv |P/H|\equiv |N_P(H)/H)|\pmod p.$$
So $|N_P(H)/H|\neq 1$. \qed



As a further example how actions an set can be used we give a second proof
that $\Sym(n)$ has normal subgroup of index two. For this we first 
establish the following lemma.

\begin{lemma}\l{equivrep} Let $\Delta$ be a finite set  and $\sim$ a
non-trivial equivalence relation on $\Delta$ so that each equivalence class
has size at most 2. Let
$$\Omega=\{R\subseteq \Delta\mid R \text{ contains
exactly one element from each equivalence class of} \sim \}. $$
Define the
relation $\approx$ on $\Omega$ by $R\approx S$ if and only if $|R\setminus
S|$ is even. Then $\approx$ is an equivalence relation and has exactly two
equivalence classes.
\end{lemma}
\proof For $d\in \Delta$ let $\tilde d$ be the equivalence class of $\sim$ containing
$d$ and let $\tilde \Delta$ be the set of equivalence classes. Let
$A,B\in\Omega$ and define
$$\tilde \Delta_{AB}=\{X\in \tilde \Delta\mid
A\cap X\neq B\cap X\}.$$
Let $d\in A$. Then $d\not\in B$ if and only if
$A\cap \tilde d\neq B\cap \tilde d$. So $|A\setminus B|=|\tilde
\Delta_{AB}|$ and
$$ A\approx B \Longleftrightarrow \tilde \Delta_{AB} \text{ is even}$$
In particular, $\approx$ is reflexive and symmetric. Let $R,S,T\in \Omega$.
Let $X\in \tilde\Delta$. Then $X\cap
R\neq X\cap T$ exactly if either $X\cap R\neq X\cap S= X\cap T$ or $X\cap
R= X\cap S\neq X\cap T$.

Thus
$$\tilde \Delta_{RT}=(\tilde \Delta_{RS}\setminus \tilde
\Delta_{ST}) \cup (\tilde \Delta_{ST}\setminus\tilde\Delta_{RS})$$
Hence
 $$(*) \quad |\tilde  
\Delta_{RT}|=|\tilde\Delta_{RS}|+|\tilde\Delta_{ST}|-2|\tilde 
\Delta_{RS}\cap \tilde\Delta_{ST}|.$$
If $R\approx S$ and $S\approx T$,  the right  side of $(*)$
is an even number.  So also  the left  side is even and $R\approx T$.

So $\approx$ is an equivalence relation. Let $R\in \Omega$. As $\sim$ is
not trivial there exist $r,t\in \Delta$ with $r\sim t$ and $r\neq t$.
Exactly one of $r$ and $t$ is in $R$. Say $r\in R$. Let $T=(R\cup
\{t\})\setminus \{r\}$. Then $T\in \Omega$ and $|T\setminus R|=1$. Thus $R$
and $T$ are not related under $\approx$. Let $S\in \Omega$. Then the left
side of $(*)$ odd and  so exactly one of
$|\tilde\Delta_{RS}|$ and $|\tilde\Delta_{ST}|$ is even. Hence $S\approx R$
or $S\approx T$. Thus $\approx$ has exactly two equivalence classes and  all
the parts of the lemma are proved.\qed

Back to $\Sym(n)$. Let $\Delta=\{(i,j)\mid 1\leq i,j\leq n, i\neq j\}$. Then
$\Sym(n)$ acts on $\Delta$. Define $(i,j)\sim (k,l)$ iff $(k,l)=(i,j)$ or
$(k,l)=(j,i)$. Define $\Omega$ as in the previous lemma. Clearly $\Sym(n)$
acts on $\Omega$ and also on $\Omega/\!\approx$ (the set of equivalence
classes of $"\approx"$). Let $R=\{ (i,j)\ 1\leq i < j\leq n\}$. Then $R\in
\Omega$. The 2-cycle $(1,2)$ maps $R$ to $(R\cup 
\{(2,1)\})\setminus\{(1,2)\}$. Thus $R$ and $(1,2)R$ are not related under 
$\approx$ and so $\Sym(n)$ acts non trivially on $\Omega/\!\approx$, which 
is a set of size 2. The kernel of the action is a normal subgroup of index 
two.\medskip

\begin{lemma}\l{2odd}Let $G$ be a finite group of order $2n$ with $n$ odd.
Then $G$ index a normal subgroup of index $2$.
\end{lemma}
\proof View $G$ has a subgroup of $\Sym(G)$ via the action of $G$ on $G$ by
right multiplication. Let $t\in G$ be an element of order $2$. Since $t$ has no
fix-points on $G$, $t$ has $n$ orbits of length $2$. Thus $t$ is the product of an
odd number of 2-cycles and so $\sgn(t)=-1$. Hence $\ker sgn\mid_G$ is a normal
subgroup of index 2.\qed

The following lemma is an example how the actions on a subgroup can be used 
to identify the subgroup.

\begin{lemma}\l{sym5}
\begin{itemize}
\AI{a} Let $H\leq \Sym(6)$ with $|H|=120$. Then $H\cong \Sym(5)$.
\AI{b} Let $H\leq \Alt(6)$ with $|H|=60$. Then $H\cong \Alt(5)$.
\end{itemize}
\end{lemma}
\proof Let $G=\Sym(6)$ in (a) and $G=\Alt(6)$ is case (b). In both cases 
$|G/H|=\frac{6!}{5!}=6$. Let $I=G/H$. Then $G$ acts on $I$ by left 
multiplication. Let $\phi: G\to \Sym(I)$ be the resulting homomorphism. 
Since $\Stab_G(H)=H$, $\ker \phi\leq H$ and so $\ker\phi\neq \Alt(6)$ and 
$\ker\phi\neq \Sym(6)$. Also $\ker \phi$ is a normal subgroup of $G$  and 
we conclude from \ref{normalsym} that $\ker \phi=\{\}e$. Thus $\phi$ is one 
to one and so $|\phi(G)|=|G|\in \{6!, \frac{6!}{2}\}$. Since $\Sym(I)\cong 
\Sym(6)$ we conclude that $\phi(G)$ has index $1$ or $2$ in $\Sym(I)$. 
Therefore $\phi(G)\normal G$. Thus $\phi(G)=\Sym(I)$ in case 
(a) and $\phi(G)=\Alt(I)$ in case (b). Note that $\phi(H)$ fixes an element 
$i$ in $I$, namely $i=H$. Thus $\phi(H)\leq \Stab_{\Sym(I)}(i)$.

Suppose that (a) holds. Note that $\Stab_{\Sym(I)}(i)\cong \Sym(5)$, 
$|\Sym(5)|=|H|$ and $\phi$ is one to one. Thus $\phi(H)=\Stab_{\Sym(I)}(i)$ 
and $H\cong \Sym(5)$.

Suppose that (b) holds. The same argument as above shows 
$\phi(H)=\Stab_{\Alt(I)}(i)$  and $H\cong \Alt(5)$.\qed


We remark that although any subgroup $H$ of order 120 in $\Sym(6)$ is 
isomorphic to $\Sym(5)$ it does not have to be one of   $\Sym(5)$'s in 
$\Sym(6)$ which fix some $k$ in $\{1,2,3,4,5,6\}$. Indeed there does 
exist one which acts transitively on the six elements. (To see this 
consider the action of $\Sym(5)$ on its six cyclic subgroups of order 5).

On the other hand the above proof says that $H$ fixes a point $i$ in the set 
$I$. This seems to be contradictory, but isn't. The set $I$ is a set 
with six elements on which $\Sym(6)$ acts but it is not isomorphic to the 
set $\{1,2,3,4,5,6\}$. $\Sym(6)$ has two non-isomorphic action on sets of 
size six. Luckily this only happens for $\Sym(6)$ and not for any other 
$\Sym(n)$, but we will not prove this.

\section{Sylow $p$-subgroup}

In this section $G$ is a finite group and $p$ a prime.  A \ei{$p$-subgroup} 
of $G$ is a subgroup $P\leq G$ which is a $p$-group. A \ei{Sylow 
$p$-subgroup} $P$ of $G$ is a maximal $p$-subgroup of $G$. That is $P$ is a 
$p$-subgroup and if $P\leq Q$ for some $p$-subgroup $Q$, then $P=Q$. Let 
\ei{$\Syl_p(G)$} be the set of all Sylow $p$-subgroups of $G$. For the 
following it will be important to realize that $G$ acts on $\Syl_p(G)$ by 
conjugation. The following lemma implies that $G$ acts on $\Syl_p(G)$ by 
conjugation.

\begin{lemma} Let $P\in \Syl_p(G)$ and $\alpha\in \Aut(G)$. Then 
$\alpha(P)\in \Syl_p(G)$.
\end{lemma}
\proof  Since $\alpha$ is an bijection, $|P|=|\alpha(P)|$ and so 
$\alpha(P)$ is a $p$-group. Let $\alpha(P)\leq Q$, $Q\leq G$ a $p$-group. 
Then $P\leq\alpha^{-1}(Q)$ and the maximality of $P$ implies 
$P=\alpha^{-1}(Q)$. Thus $\alpha(P)=Q$ and $\alpha(P)$ is indeed a maximal 
$p$-subgroup of $G$.\qed

\begin{theorem}[Cauchy]\l{Cauchy} Let  $G$ is a finite group, and $p$ a 
prime dividing the order of $G$. Then $G$ has an element of order $p$ 
\end{theorem} 
\proof Let $X=\langle x\rangle$ be any cyclic group of order 
$p$. Then $X$ acts on $G^p$ by 
$$x^k*(a_1,\ldots,a_p)=(a_{1+k},a_{2+k}\ldots ,a_p,a_1,\ldots,a_k).$$ 
Consider the subset 
   $$S=\{ (a_1,\ldots, a_p)\in G^p\mid a_1a_2\ldots a_p=e\}.$$
Note that we can choose the first $p-1$ coordinates freely and 
then the last one is uniquely determined. So $|S|=|G|^{p-1}$.

We claim that $S$ is $X$ invariant. For this note that
$$(a_1a_2\ldots a_p)^{a_1^{-1}}=a_1^{-1}(a_1\ldots a_p)a_1=a_2\ldots 
a_pa_1.$$
 Thus $a_1a_2\ldots a_p=e$ if and only if $a_2\ldots a_pa_1=e$. So $X$ acts 
on $S$.

 From \ref{Smodp} we have

$$|S|\equiv |\Fix_S(X)|\pmod p$$

As $ p$ divides $|G|$, it divides  $|S|$ and so also 
$|\Fix_S(X)|$. Hence there exists some $(a_1,a_2,\ldots a_p)\in \Fix_S(X)$  
distinct from $(e,e,\dots,e)$. But being in $\Fix_S(X)$ just means 
$a_1=a_2=\ldots a_p$. Being in $S$ implies $a_1^p=a_1a_2\ldots a_p=e$.  
Therefore $a_1$ has order $p$.\qed


\begin{theorem}[Sylow]\l{sylow} Let $G$ be a finite group, $p$ a prime and 
$P\in \Syl_p(G)$. 
\begin{itemize} 
	\AI{a} All Sylow $p$-subgroups are conjugate in $G$. 
	\AI{b} $|\Syl_p(G)|=|G/N_G(P)|\equiv 1\pmod p.$ 
	\AI{c} $|P|$ is the largest power of $p$ dividing $|G|$.
	\AI{d}  Every  $p$-subgroup of $G$ is contained in a Sylow  
	$p$-subgroup of $G$. 
\end{itemize} 
\end{theorem} 
\proof  Let ${\cal S}=P^G=\{P^g\mid g\in G\}$,  the set of Sylow 
$p$-subgroups conjugate to $P$. First we show\medskip

(1)\quad $P$ has a unique fixed point on  ${\cal S}$ and on $\Syl_p(G)$, 
namely $P$ itself.\medskip

Indeed, suppose that $P$ fixes $Q\in \Syl_p(G)$. Then $P\leq N_G(Q)$ and
$PQ$ is a subgroup of $G$. Now $|PQ|=\frac{ |P||Q|}{|P\cap Q|}$ and so $PQ$
is a $p$-group. Hence by maximality of $P$ and $Q$ $P=PQ=Q$. \medskip

(2)\quad ${\cal S} \equiv 1\pmod p$\medskip

By (1) $\Fix_{\cal S}(P)=1$ 
and so (2) follows from \ref{Smodp}.\medskip

(3)\quad $\Syl_p(G)={\cal S}$\medskip

Let $Q\in \Syl_p(G)$. Then $|\Fix_{\cal S}(Q)|\equiv |{\cal S}|\equiv 
1\pmod p$. Hence $Q$ has a fixed point $T\in  {\cal S}$. By (2) applied 
to $Q$, this fixed-point is $Q$. So $Q=T\in {\cal S}$.  \medskip

Note that $N_G(P)$ is the stabilizer of $P$ in $G$ with respect to 
conjugation. As $G$ is transitive on ${\cal S}$ we conclude is $|{\cal 
S}|=|G/N_G(P)|$. Thus (2) and (3) imply (a) and (b). \medskip

(4)\quad $p$ does not divides $|N_G(P)/P|$.  \medskip

Suppose it does. Then by Cauchy's theorem $N_G(P)/P$ has a non-trivial
$p$-subgroup $|Q/P|$. Since $|Q|=|Q/P|\, |P|$ , $Q$ is a $p$-group with
$P\lneq Q$, a contradiction to the maximality of $P$\medskip

By (b) and (4) $p$ divides neither  $|G/N_G(P)|$ nor $ |N_G(P)/P|$.
Since
$$|G|=|G/N_G(P)|\, |N_G(P)/P|\, |P|$$
 (c) holds.

 $|G|$ is finite  so any $p$-subgroup of $G$ lies in a maximal $p$-subgroup,
proving (d).\qed


As an application of Sylow's theorem we will investigate groups of order
12,15,30 and 120. We start with a couple of general observation.

\begin{lemma}\l{easysylow} Let $G$ be a finite group, $p$ a prime,  
 and $P\in \Syl_p(G)$. Also let $N$ the kernel of the action of $G$ on 
$\Syl_p(G)$. 
\begin{itemize} \AI{a} $|\Syl_p(G)|$ divides $\frac{|G|}{|P|}$ 
and equals 1 $\pmod p$.
\AI{b} $P\normal PN$. In particular, $P$ is the unique Sylow $p$-subgroup 
of $PN$. 
\AI{c} $N\cap P\in \Syl_p(N)$ and $N\cap P\normal G$. In 
particular $P\leq N$ if and only if $P\normal G$. 
\AI{d} $PN/N\in 
\Syl_p(G/N)$. Moreover the map $$ \Syl_p(G)\to \Syl_p(G/N)\quad Q\to QN/N$$ 
is a bijection. \end{itemize} \end{lemma} \proof (a) Follows directly from 
\ref{sylow}b.

(b)  Just note that  $N\leq N_G(P)$.

 (c) Since $P\normal in PN$,  $N\cap P\normal N$. Also $|N/N\cap P|=|NP/P|$ and so $p$ does not divide $|N/N\cap 
P|$. So $N\cap P$ is Sylow $p$-subgroup of $N$. As $N\cap P\normal N$ it is 
the only Sylow $p$-subgroup of $N$. Thus $N\cap P\normal G$.

(d) $\frac{|G/N|}{PN/N}|=\frac{|G|}{|PN|}$. The latter number is not 
divisible by $p$ and so $PN/N$ is a Sylow  $p$-subgroup of $GN/N$.

Since every Sylow $p$-subgroup of $G/N$ is of the form $(PN/N)^{gN}=P^gN/N$ 
the map is onto. Suppose that $PN/N=QN/N$. Then $Q\leq PN$ and so by (b) $Q=P$.
Thus the map  is also one to one.\qed

\begin{lemma}\l{order30}
\begin{itemize}
\AI{a} Let $G$ be a group of order 12. Then either $G$ has unique Sylow 
$3$-subgroup or $G\cong \Alt(4)$.
\AI{b} Let $G$ be  group of order 15. Then $G\cong \mathbb Z/3 \mathbb Z 
\times \mathbb Z/5\mathbb Z$.
\AI{c} Let $G$ be a group of order 30. Then $G$ has a unique Sylow 
$3$-subgroup and a unique Sylow $5$-subgroup.
\end{itemize}
\end{lemma}
\proof (a) By \ref{easysylow}a the number of Sylow $3$ subgroups divides 
$\frac{12}{3}$ and is 1$\pmod 3$. Thus $|\Syl_3(G)|=1$ or $4$. In the first 
case we are done. In the second case let $N$ be the kernel of the action on 
$\Syl_3(G)$. By \ref{easysylow}, $G/N$ still has 4 Sylow $3$-subgroups. 
Thus $|G/N|\geq 4\cdot 2=12=|G|$, $N=\{e\}$ and $G$ is isomorphic to a 
subgroup of order 12 in $\Sym(4)$. Such a subgroup is normal and so $G\cong 
\Alt(4)$ by \ref{normalsym}.

(b) The numbers of Sylow $5$ subgroups is $1\pmod 5$ and divides 
$\frac{15}{3}=5$. Thus $G$ has a unique Sylow $5$-subgroup $S_5$. Also the 
number of Sylow $3$ subgroups is $1\pmod 3$ and divides $\frac{15}{3}=5$. 
Thus $G$ has a unique Sylow $3$-subgroup $S_3$. Then $S_3\cap S_5=1$, 
$|S_3S_5|=15$ and so $G=S_3S_5$. As both $S_3$ and $S_5$ are normal in $G$, 
$[S_3,S_5]\leq S_3\cap S_5=\{e\}$ and so 
 $$G\cong S_3\times S_5 \cong \mathbb Z/3 \mathbb Z \times \mathbb 
Z/5\mathbb Z.$$

(c) By \ref{2odd}  any group which as order twice an odd number has 
a normal  subgroup of index two. Hence $G$ has a  normal subgroup of order 
15. This normal subgroup contains all the Sylow $3$ and Sylow 
$5$-subgroups of $G$ and so (c) follows from (b).\qed

\begin{lemma}\l{order120} Let $G$  be a group of order 120. Then one of the
following holds:
\begin{itemize}
\AI{a} $G$ has a unique Sylow $5$-subgroup.
\AI{b} $G\cong \Sym(5)$.
\AI{c} $|Z(G)|=2$ and $G/Z(G)\cong \Alt(5)$.
\end{itemize}
\end{lemma}
\proof Let $P\leq \Syl_5(G)$ and put $I=\Syl_5(G)$.

 If $|I|=1$, $(a)$ holds. 
 
 So suppose that $|I| >1$. Then by\ref{easysylow}a, $|I\equiv 1\pmod 
5$ and $|I|$ divides $|G/P|=24$. The numbers larger than 
$1$ and less or equal to $24$ which are $1 \pmod 5$ are $1,6,11,16$ and 
$21$. Of these only $6$ divides 24. Thus $|I|=6$. Let  $\phi: G\to \Sym(I)$ 
be the homomorphism given by the action of $G$ on $I$. Put $N=\ker \phi$ 
and $H=\phi(G)$. The $H$ is subgroup of $\Sym(I)\cong \Sym(6)$ and $H\cong 
G/N$. By \ref{easysylow}d, $G/N$ (and so also  $H$) has exactly $6$-Sylow 
$5$ subgroups. In particular the order of $H$ is a multiple of 30. By 
\ref{order30}c, $|H|\neq 30$.


Suppose next that $|H|=120$. Note that $N=1$ and so $G\cong H$ in this
case. Now $H\leq \Sym(I)\cong \Sym(6)$. Thus \ref{sym5}a implies 
$G\cong H\cong \Sym(5)$.

Suppose next that $|H|=60$. If $H\not\leq \Alt(I)$, then $H\cap \Alt(I)$ is
a group of order 30 with six  Sylow $5$-subgroups, a contradiction to 
\ref{order30}. Thus $H\leq \Alt(I)\cong Alt(6)$. So by \ref{sym5}b, $H\cong 
\Alt(5)$. Since $|N|=2$ and $N\unlhd G$, $N\leq Z(G)$. Also $\phi(Z(G))$ is 
a abelian normal subgroup of $H\cong \Alt(5)$ and so $\phi(Z(G))=e$. Hence 
$N=Z(G)$ and $$G/Z(G)=G/N\cong H\cong \Alt(5).$$\qed


\chapter{Rings}
\section{Rings}

\begin{Def} A \ei{ring} is a tuple $(R,+,\cdot)$ such that
\begin{itemize}
\AI{a} $(R,+)$ is an abelian group.
\AI{b} $(R,\cdot)$ is a semigroup.
\AI{c} For each $r\in R$ both left and right multiplication by $r$ are
homomorphisms of $(R,+)$
\end{itemize}
\end{Def}


In other words a ring is a set $R$ together with two binary operations $+: 
R\times R\to R, (a,b)\to a+b$ and\, $\cdot: R\times R\to R, (a,b)\to ab$ 
such that

\begin{itemize}
\AI{R1}  $(a+b)+c=a+(b+c)$ so that for all $a,b,c\in R$
\AI{R2}  There exists $0\in R$ with $0+a=a=a+0$ for all $a\in R$.
\AI{R3}  For each $a\in R$ there exists $-a\in R$ with $a+(-a)=0=(-a)+a$.
\AI{R4} $a+b=b+a$ for all $a,b\in R$.
\AI{R5}  $a(bc)=(ab)c$ for all $a,b,c\in R$.
\AI{R6}  $a(b+c)=ab+ac$ for all $a,b,c\in R$.
\AI{R7}  $(a+b)c=ab+ac$ for all $a,b,c\in R$.
\end{itemize}


Let $R$ be a ring. The identity element of $(R,+)$ is denoted by $0_R$ or 
$0$. If $(R,\cdot)$ has an identity element we will denote it by $1_R$ or 
$1$. In this case we say that $R$ is a ring with identity. $R$ is 
commutative if $(R,\cdot)$ is.\medskip

Some examples:  $(\mb Z,+,\cdot)$, $(\mb Z/n \mb Z,+,\cdot)$, $(\End_{\mb 
K}(V),+,\circ)$


There is a unique ring  with one element:


$$\begin{array}{c|c} + & 0\\ \hline
                               0 &   0\\
\end{array}\quad 
\quad\quad\begin{array}{c|c}\cdot  & 0\\ \hline
                               0 &   0\\
\end{array}$$

There are two rings of order two :


$$\begin{array}{c|cc}   + &    0   &   1\\ \hline
                                    0 &   0  &    1\\ 
                                    1 &    1  &  0

\end{array}\quad\quad\quad 
\begin{array}{c|cc}\cdot  & 0 & 1\\ \hline
                               0 &   0  & 0 \\ 
                               1 &   0  & n
\end{array}$$
Here $n\in {0,1} $ for $n=0$ we have a ring with zero-multiplication, that is $ab=0$ for all
$a,b\in R$. For $n=1$ this is $(\mb Z/2\mb Z,+,\cdot)$.


There are the following rings of order 3:


$$\begin{array}{c|ccc}   + &    0   &   1  &-1\\ \hline
                                    0 &   0  &    1  &-1 \\ 
                                    1 &    1  &  -1   &0 \\
                                     -1&   -1 &  0 &  1
\end{array}\quad\quad\quad 
\begin{array}{c|ccc}  \cdot &    0   &   1  &-1\\ \hline
                                       0 &   0  &    0  &0   \\ 
                                       1 &    0 &  n   &-n \\
                                     -1&   0&  -n &  n
\end{array}$$

Indeed if we define $n=1\cdot 1$, then $(-1)\cdot 1=-(1\cdot 1)=-n$. Here $n\in\{ 0,1,-1\}$. For
$n=0$ this is a ring with zero multiplication. For $n=1$ this is $(\mb Z/3\mb Z,+,\cdot)$.  If
$n=-1$, this is isomorphic to the $n=1$ case under the bijection $1\leftrightarrow -1$.

At the end of this section we will generalize these argument to find all 
rings whose additive group is cyclic. 




Let $A$ be an abelian group and $\End(A)$ the set of endomorphisms of $A$, 
(that is the homomorphisms from $A$ to $A$). Define 
$(\alpha+\beta)(a)=\alpha(a)+\beta(a)$ and $(\alpha\circ\beta 
)(a)=\alpha(\beta(a))$. Then $(\End(A),+,\circ)$ is a ring.

Direct products and direct sums of rings are rings.  Indeed, let $(R_i,i\in 
I)$ be a family of groups. For $f,g\in \prod_{i\in I}R_i$ define $f+g$ and 
$fg$ by  $(f+g)(i)=f(i)+g(i)$ and $(fg)(i)=f(i)g(i)$.  With this definition 
both $\prod_{i\in I} R_i$ and $\sum_{i\in I} R_i$ are rings.

In the following lemma we collect a few elementary properties of rings.

\begin{lemma}\l{elementaryring} Let $R$ be a ring.
\begin{itemize}
\AI{a} $0a=a0=0$ for all $a\in R$
\AI{b} $(-a)b=a(-b)=-(ab)$ for all $a,b\in R$.
\AI{c} $(-a)(-b)=ab$ for all $a,b\in R$.
\AI{d} $(na)b=a(nb)=n(ab)$ for all $a,b\in R,n\in \mb Z$.
\AI{e} $(\sum_{i=1}^n a_i)(\sum_{j=1}^n b_j)=\sum_{i=1}^n\sum_{j=1}^m 
a_ib_j$ 
\end{itemize} \end{lemma} \proof (a)-(e) hold since right and left 
multiplication are homomorphisms. For example any homomorphism sends $0$ to 
$0$. So (a) holds. We leave the details to the reader.\qed

Let $R$ be a ring and $G$ be semigroup. The \ei{semigroup ring} 
\ei{$R[G]$} of $G$ over $R$ is defined as follows:

As an abelian group $R[G]=\bigoplus_{g\in G} R$   . Define 
$(r_g)\cdot (s_g)=(t_g)$ where

$$t_g=\sum_{\{ (h,l)\in G\times G\mid hl=g\}} \quad r_hs_l$$


Note that since the elements in $\bigoplus_{g\in G} R$ have finite support 
all these sums are actual finite sums. Its straightforward to check that 
$R[G]$ really is a ring. Here is an alternative description of the 
multiplication which makes the nature of this ring a little bit more 
transparent. For $r\in R$ and $g\in G$ write $rg$ for the element in 
$\oplus_{g\in G} R$ which has $r$ in the $g$-th coordinate and $0$ 
everywhere else. ( So $rg=\rho_g(r)$ in the notation of section 
\ref{dpds}). Then $(r_g)_{g\in G}=\sum_{g\in G} r_g g$ and $$\sum_{g\in G} 
r_gg \cdot \sum_{h\in G} s_hh=\sum_{g\in G,h\in G} (r_gs_h)(gh).$$ Also 
note that $rg=sh$ implies $r=s$ and is $r\neq 0$, $g=h$.

 If  $R[G]$ has  an identity, then 
$R$ has an identity.   Indeed  $r=\sum r_gg$ is an identity in 
$R[G]$. Let $a=\sum r_g$.  We will show that $a$ is an identity in $R$. Let 
$s\in R^\#$ and $g\in G$. Then $$sh=r(sh) =\sum (r_gs) gh.$$ Summing up the 
coefficients we see that $s=(sum_{g\in G} r_g)s=as$. Similarly $sa=s$ and 
so $a$ is an identity in $R$. If $R$ has an identity $1$, we identify $g$ 
with $1g$.

Here is an example of a semigroup $G$ without an identity so that ( for any ring
$R$ with an identity) $R[G]$ has an identity. As a set $G=\{a,b,i\}$. Define the
multiplication by
$$xy=\begin{cases} x &\text{ if } x=y\\ i & \text{ if }  x\neq y\end{cases}$$ 
Then
$$(xy)z=(xy)z=\begin{cases} x &\text{if } x=y=z\\ i &\text{ otherwise}\end{cases}$$
Hence the binary operation is associative and $G$ is a semigroup. 
Put $r=a+b-i\in R[G] $. We claim that $r$ is an identity. We compute
$ar=ra=aa+ab-ai=a+i-i=a$, $br=rb=ba+bb-bi=i+b-i=b$ and 
$ir=ri=ia+ib-ii=i+i-i=i$. As $R[G]$  fulfills both distributive laws this 
implies that $r$ is an identity in $R[G]$.





If $R$ and $G$ are commutative, $R[G]$ is too.

The converse is not quite true:

 Suppose $R[G]$ is commutative, then 
$$(rs)(gh)=(rg)(sh)=(sh)(rg)=(sr)(hg)=(rs)(hg).$$
So if $rs\neq 0$ for some $r,s\in R$ we get $gh=hg$ and $G$ is commutative.

But if $rs=0$ for all $r,s\in R$ then also $xy=0$ for all $x,y\in R[G]$. So 
$R[G]$ is commutative, regardless whether $G$ is or not.


Here is an example  for a semigroup ring. Let $G=(\mb N,+)$. Then $R[\mb 
N]$ is isomorphic the polynomial ring over $R$.  Indeed the map 
$$\sum_{i=0}^\infty a_ix^i\to (a_i)_{i\in {\mb N}}$$ is clearly an 
isomorphism.





Put $R^\#=R\setminus\{0\}$, the nonzero elements.

\begin{Def} Let $R$ be a ring.
\begin{itemize}
\AI{a} A left ( resp. right) \ei{zero divisor} is an element $a\in R^\#$ 
such that there exists  $b\in R^\#$ with  $ab=0$ (resp. $ba=0$).
A zero divisor is an element which is both a left and a right zero divisor.
\AI{b} An nonzero element is called (left,right) invertible if 
it is (left,right) invertible in $(R^\#,\cdot)$. An invertible element 
is also called a unit.
\AI{c} A non-zero commutative ring with identity and no zero-divisors 
is called an \ei{integral domain}. 
\AI{d} A non-zero ring with identity  all of 
whose nonzero elements are invertible is called a \ei{division ring}. A 
\ei{field} is a commutative division ring. \end{itemize} \end{Def}



Note that a ring with identity is  zero if and only if 
$1=0$. So in (c) and (d) the condition that $R$ is non-zero can be replaced 
by $1\neq 0$.

We denote the sets of units in $R$ with $R^*$. Note that $(R^*,\cdot)$ is
group ( see \ref{basicmonoid}c). A ring has no left zero divisors if and 
only the left cancellation law
$$ xa=ya\Longrightarrow x=y$$
holds in $R^\#$.


$\mb R$ is a field, $\mb Z$ is an integral domain.  For which $n\in \mb 
Z^+$ is $\mb Z/n\mb Z$ an integral domain? It is if and only, 

$$n\mid kl\Longrightarrow n\mid k \text{ or } n\mid l$$
so if and only if $n$ is a prime. The following 
lemma implies that $\mb Z/p \mb Z$ is a field for all primes $p$.

\begin{lemma} \l{finiteidfield} All finite integral domains are fields
\end{lemma}
\proof Let $R$ be a finite integral domain and $a\in R^\#$. As $R$ is an 
integral domain, multiplication by $a$ is a one to one map from $R^\#\to 
R^\#$. As $R$ is finite, this map is onto. Thus $ab=1$ for some $b\in R$. 
So all non-zero elements are invertible.\qed


\begin{Def}\l{ringhom} Let $R$ and $S$ be rings. A \ei{ring homomorphism} 
is a map $\phi: R\to S$ so  $\phi: (R,+)\to (S,+)$ 
and $\phi: (R,\cdot)\to (S,\cdot)$ are homomorphisms of semigroups.\end{Def}


Note that $\phi:R\to S$ is an homomorphism if and only if 
$\phi(r+s)=\phi(r)+\phi(s)$ and $\phi(rs)=\phi(r)\phi(s)$,

For a ring $R$ we  define the \ei{opposite ring} \ei{$R^\op$} by 
$(R^\op,+^\op)=(R,+)$, and $a \cdot^\op b=b\cdot a$. If $R$ and $S$ 
are rings then a map $\phi:R\to S$ is called an \ei{anti-homomorphism} if 
 $\phi:R\to S^\op$ is ring homomorphism. So $\phi(a+b)=\phi(a)+\phi(b)$ and 
$\phi(ab)=\phi(b)\phi(a)$.


Let $\End(R)$ be the set of ring homomorphism. Then $\End(R)$ is monoid 
under composition. But as the sum of two ring homomorphisms usually is not 
a ring homomorphism, $\End(R)$ has no natural structure as a ring.


The map $\mb Z\to \mb Z/n \mb Z\quad m\to m+n\mb Z$ is a ring homomorphism.

For  $r\in R$ let ${\cal R}_r: R\to R, s\to sr$  and 
${\cal L}_r: R\to R, s\to rs.$ By definition of  a ring ${\cal R}_a$ and 
${\cal L}_r$ are homomorphisms of $(R,+)$. But  left and right 
multiplication usually is not a ring homomorphism.
The map ${\cal L}: R\to\End((R,+)), r\to {\cal L}_r$ is a homomorphism 
but the map ${\cal R}: R\to\End((R,+)), r\to {\cal R}_r$ is an 
anti-homomorphism. Note that if $R$ has an identity, then both ${\cal R}$ 
and ${\cal L}$ are one to one. \medskip

\begin{theorem}\l{homgr} Let $\alpha: R\to S$ be a ring homomorphism, $G$ a
semigroup  and
$\beta: G\to (S,\cdot)$ a semigroup  homomorphism such that 
$$\alpha(r)\beta(g)=\beta(g)\alpha(r) \forall r\in R, g\in G$$


Then 
$$  \gamma: R[G]\to S \quad \sum_{g\in G}  r_gg\to \sum
\alpha(r_g)\beta(g)$$ is a ring homomorphism.  
\end{theorem}
\proof 

$$\gamma(\sum_{g\in G} r_gg+\sum_{g\in G} s_gg)
=\gamma(\sum_{g\in G}(r_g+s_g)g)=
\sum_{g\in G} \alpha(r_g+s_g)\beta(g)=$$
$$=\sum_{g\in G}(\alpha(r_g)+\alpha(s_g))\beta(g)
=\sum_{g\in G}\alpha(r_g)\beta(g)+\sum_{g\in G}\alpha(s_g)\beta(g)=
\gamma(\sum_{g\in G} r_gg)+\gamma(\sum_{g\in G} s_gg)$$
and 

$$\gamma(\sum_{g\in G} r_gg\cdot \sum_{k\in K} s_kk)=
\gamma(\sum_{g\in G}\sum_{k\in G} r_gs_kgk)=
\sum_{g\in G}\sum_{k\in G} \alpha(r_gs_k)\beta(gk)=$$
$$=\sum_{g\in G}\sum_{k\in G} \alpha(r_g)\alpha(s_k)\beta(g)\beta(k)=
\sum_{g\in G} \alpha(r_g)\beta(g)\cdot \sum_{k\in G} \alpha(s_k)\beta(k)=
\gamma(\sum_{g\in G} r_gg)\cdot \gamma(\sum_{k\in G} s_kk)$$




Let $A$ be an abelian group. Define $\phi:\mb Z\to \End(A)$ by  
$\phi(n)(r)=nr$. Then $\phi$ is a ring homomorphism. Since $\ker \phi$ is an 
additive subgroup of $\mb Z$, $\ker \phi=n\mb Z$ for some $n\in \mb N$. $n$ 
is called the \ei{exponent} of $A$ and denote by $\exp(A)$. If $n\neq 0$, 
$n$ is the smallest positive number such that $na=0$ for all $a\in A$ ( 
that is $nA=0$). And $n=0$ if $mA\neq 0$ for all $m\in \mb Z^+$.

Let $R$ be a ring. The \ei{characteristic} \, $\chr R$  of $R$ is the 
exponent of $(R,+)$. Suppose $R$ has an identity.  The map 
$\rho: \mb Z\to R,\quad n\to n1$ is a homomorphism of rings. We claim that 
$\ker \rho =\ker \phi$. This can be verified directly or by observing that 
$\phi={\cal L}\circ \rho$.


\begin{lemma} Suppose $R$ is a non-zero ring with identity and no zero 
divisors. Then $\chr R$ is $0$ or a prime. \end{lemma} \proof Let $n=\chr 
R$ and suppose $n\neq 0$. If $n=1$ then $r=1r=0$ for all $r\in R$. So $n> 
1$. Suppose $n$ is not a prime, then $n=st$ with $s,t\in \mb Z^=$. So 
$$(s1)(t1)=(st)1=n1=0.$$
As $R$ has no zero divisors we conclude that $s1=0$ or $t1=0$. In each case 
the case the get a minimality of $n$.\qed


Let $r\in R$. If $R$ has an identity we define $r^0=1$. If $R$ does not 
have an identity we will use the convention $r^0s=s$ for all $s\in R$.

\begin{lemma}[Binomial Theorem] Let $R$ be  ring, $a_1,a_2\ldots,a_n\in R$ 
and $m\in \mb Z^+$.
\begin{itemize}
\AI{a} $$(\sum_{i=1}^n a_i)^m=\sum_{i_1=1}^n\sum_{i_2=1}^n\ldots 
\sum_{i_m=1}^n a_{i_1}a_{i_2}\ldots a_{i_m}$$ 

\AI{b} If $a_ia_j=a_ja_i$ for 
all $1\leq i,j\leq n$, then 
$$  (\sum_{i=1}^n a_i)^m =\sum_{\{(m_i)\in \mb 
N^n\mid \sum_{i=1}^n m_i=m \}} \dbinom{m}{m_1,m_2,\ldots,
m_n}\,a_1^{m_1}a_2^{m_2}\ldots a_n^{m_n}$$ \end{itemize} \end{lemma} \proof 
(a) follows form \ref{elementaryring}e and induction on $m$.

For (b) notice that $a_{i_1}\ldots a_{i_m}=a_1^{m_1}a_2^{m_2}\ldots 
a_n^{m_n}$, where $m_k=|\{ j\mid i_j=k\}|$. So (b) follows from (a) and a 
simple counting argument.\qed


\begin{lemma}\l{easygcd} Let $n,m,k\in \mb Z^+$.
\begin{itemize}
\AI{a} If  $\gcd(m,k)=1$ or $\gcd(n,m)=1$, then $\gcd(f,k)=1$ for some 
$f\in \mb Z$ with $f\equiv n\pmod m$. 
 \AI{b} There exists $f\in \mb Z$ so that $\gcd(f,k)=1$ 
and $fn\equiv \gcd(n,m)\pmod m$ 
\end{itemize} \end{lemma} 
\proof (a) Suppose 
first that $\gcd(m,k)=1$. Then $1-n=lm+sk$ for some integers $l,s$. Thus 
$1=(n+lm)+sk$. Put $f=n+lm$, then $\gcd(n+lm,k)=1$. 

Suppose next that $gcd(n,m)=1$. Write $k=k_1k_2$ where $\gcd(k_1,m)=1$ and 
all primes dividing $k_2$ also divide $m$. By the first part there 
exists $l\in \mb Z$ with $\gcd(n+lm,k_1)=1$. Now any prime dividing $k_1$, 
divides $m$ and (as $\gcd(n,m)=1$), does not divide $m$. Hence it also does 
not divide $m+lm$. Thus $\gcd(n+lm,k)=\gcd(n+lm,k_1)=1$.

(b) Let $d=\gcd(n,m)$. Replacing $n$ be $\frac{n}{d}$ and $m$ by 
$\frac{m}{d}$ we may assume that $d=1$. Then $n^*n\equiv 1\pmod m$ for 
some $n^*\in \mb Z$. Since $\gcd(n^*,m)=1$ we can apply (a) to 
$n^*,m$ and $k$. So  there exists $f$ with $\gcd(f,k)=1$ and $f\equiv 
n^*\pmod m$. Then also $fn\equiv 1\pmod m$.\qed



\begin{lemma} Let $R$ be a ring with $(R,+)$ cyclic. Then $R$ is isomorphic 
to exactly one of the following rings:
\begin{itemize}
\NI{1}  $\mb Z$ with regular addition but zero-multiplication.
\NI{2}  $(n \mb Z/nm\mb Z,+,\cdot)$, where $m\in \mb N, n\in \mb Z^+$ and 
$n$ divides $m$.
\end{itemize}
\end{lemma} 
\proof  Let $m\in \mb N$ so that  $(R,+)\cong (\mb Z /m \mb Z,+)$ and let  
$a$ be generator for $(R,+)$.  So $a\cdot a=na$ for some $n\in \mb Z$. Then 
for all $k,l\in \mb Z$, $(ka)\cdot (la)=kln a$ and so the multiplication is 
uniquely determine by $n$.  Note that $(-a)(-a)=na=(-n)(-a)$. So replacing 
$a$ be $-a$ we may assume that $n\in \mb N$.  Also if $m>0$ we may choose 
$0<n\leq m$.

Suppose first that $n=0$. Then by our choice $m=0$ as well. So $(R,+)\cong  
(\mb Z,+)$ and $rs=0$ for all $r,s\in R$.

Suppose next that $n>0$.
Then  the map
$$n\mb Z/nm\mb Z\to R, \quad nk+nm\mb Z\to ka$$
is an isomorphism. 
If $m=0$, these rings are non-isomorphic for different $n$. Indeed $R^2=nR$ 
and so  $|R/R^2|=n$. Therefore $n$ is determined by the isomorphism type 
$R$.


For $m>0$, various choices of $n$ can lead to isomorphic rings. Namely the 
isomorphism type only depends on $d=\gcd(n,m)$. To see this we apply 
\ref{easygcd} to obtain  $f\in \mb Z$ with $\gcd(f,m)=1$ and $fn\equiv 
d\pmod m$. Then $1=ef+sm$ for some $e,s\in \mb Z$ and so $f+m\mb Z$ is invertible.
Hence also  $fa$ is a generator for $(R,+)$ and 
$$(fa)\cdot (fa)= f^2na=(fn)(fa)=d(fa).$$ 
Also $R^2=dR$ and $|R/R^2|=\frac{m}{d}$. So $d$ is determined by the 
isomorphism type of $R$. \qed


\section{Ideals and homomorphisms}


\begin{Def} Let $R$ be a ring.
\begin{itemize}
\AI{a} A \ei{subring}  of $R$ is  a subset $S\subseteq R$ so that $S$ is a 
subgroup of $(R,+)$ and a subsemigroup of $(R,\cdot)$.
\AI{b} An left (right) \ei{ideal} in $R$ is a subring  $I$ of $R$ so that 
$rI\subseteq I$ $Ir\subseteq I$ for all $r\in R$.
\AI{c} An ideal in $R$ is a left ideal which is also a right ideal.
\end{itemize}
\end{Def}


$n\mb Z$ is an ideal in $\mb Z$. 

Let $V$ be a $\mb K$-vector space. Let $W\leq V$ be $\mb K$ subspace. 
Define
 $$\Ann(W)=\{\alpha\in \End_\mb K(V)\mid \alpha(w)=0 \text{ for all } 
w\in W\}.$$ 
Then $\Ann(W)$ is an left ideal in $\End_\mb K (V)$. Indeed it 
is clearly an additive subgroup  and 
$(\beta\circ\alpha)(w)=\beta(\alpha(w)=\beta(0)=0$ for all $\beta\in 
\End_{\mb K} (V)$ and $\alpha\in \Ann(W)$. We will see later that 
$\End_{\mb K}(V)$ is a \ei{simple ring}, that is it has no proper ideals.

\begin{lemma}\l{basicring hom} Let $\phi:R\to S$ be a ring homomorphism.
	\begin{itemize}

		\AI{a} If $T$ is a subring of $R$, $\phi(T)$ is a subring 
of $S$.
 	\AI{b} If $T$ is a subring of $S$ then $\phi^{-1}(T)$ is a subring of $R$. 
	\AI{c} $\ker \phi$ an ideal in $R$. 
        \AI{d} If $I$ is an (left,right) ideal in $R$ and $\phi$ is onto, 
$\phi(I)$ is a (left,right) ideal in $S$.
	 \AI{e} If $J$ is a (left,right) ideal in $S$, then $\phi^{-1}(J)$ 
is an (left,right) ideal on $R$. \end{itemize} \end{lemma} 
\proof Straight forward.\qed



Let $\alpha: R\to S$ be a ring homomorphism and $\beta: G\to H$ a semigroup 
homomorphism. Consider the ring homomorphism:
$$  \gamma: R[G]\to S[H]\quad \sum_{g\in G}  r_gg\to
\sum \alpha(r_g)\beta(g)$$
What is the image and the kernel of $\gamma$? Clearly
$\gamma(R[G])=\alpha(R)[\beta(G)]$. Let $I=\ker \alpha$.
To compute $\ker \gamma$ note that
$$\gamma(\sum_{g\in G}  r_gg)=\sum_{h\in H} \alpha(\sum_{g\in
\beta^{-1}(h)}\!\! r_g) h$$
and so
$$\sum_{g\in G} r_gg\in \ker \gamma\Longleftrightarrow \sum_{t\in
\beta^{-1}(h)}\!\! r_t\,\in\, I \text { for all } h\in \beta(G).$$

If $\beta$ is a group homomorphism we can describe $\ker \gamma$  just in
terms of $I=\ker \alpha$ and $N:=\ker \beta$. Indeed
the $\beta^{-1}(h)$'s ($h\in \beta(G)$) are just the cosets of $N$ and so
$$\sum_{g\in G} r_gg\in \ker g\Longleftrightarrow \sum_{t\in T}
r_t\in I \text { for all } T\in G/N.$$

Let as consider the special case where $R=S$, $\alpha=\id_R$ and $H=\{e\}$.
Identify
$R[{e}]$ with $R$ via $re\leftrightarrow r$.
Then $\gamma$ is the map 
$$R[G]\to R, \sum  r_gg\to \sum r_g.$$
The kernel of $\gamma$ is the ideal
$$R^\circ[G]=\{\sum r_gg\mid  \sum r_g=0\}$$
\nei{$R^\circ[G]$}is called the \ei{augmentation ideal} of $R[G]$.\medskip


For subsets $A,B$ of the ring $R$ define $A+B=\{a+b\mid a\in A, b\in B\}$. 
Let $\langle A\rangle$ be the additive subgroup of $R$ generated by $A$. Also 
put $AB=\langle ab\mid a\in A, b\in B\rangle$,  More general define $A_1A_2\ldots A_n$ to be 
the additive subgroup generated by the products $a_1a_2\ldots a_n$, $a_i\in 
A_i$.   If $A$ is a left ideal, then also $AB$ is a left ideal. If $B$ is a 
right ideal, then $AB$ is a right ideal. In particular, if $A$ is a left
ideal an d$R$ is a right ideal, then $AB$ is an ideal. If
$A,B$ are (right,left) ideals  so is $A+B$ and $A\cap B$. Actually arbitrary
intersection of  (left,right)ideals are (left,right)ideals. So for
$A\subseteq R$ we define  the ideal \ei{$(A)$} generated by $A$ to be

$$(A)=\bigcap\{ I\mid I \text{ is an ideal in } R, A\subseteq I\}$$

The left ideal generated by $A$ is just $RA+\langle A\rangle$. If $R$ has 
an identity this is equal to $RA$. Also $(A)=\langle A\rangle+RA+AR+RAR$ 
which simplifies to $RAR$ if $R$ has an identity.



\begin{lemma}\l{RmodI} Let $I$ be an ideal in the ring $R$.
\begin{itemize} 
\AI{a} The binary operation
 $$R/I\times R/I\to R/I,\quad  (a+I,b+I)\to  ab+I$$
  is well defined. 
\AI{b} $(R/I,+,\cdot)$ is a ring. 
\AI{c}  The map 
$$\pi: R\to R/I,\quad r\to r+I$$
is a ring homomorphism with kernel $I$. 
\end{itemize} \end{lemma} \proof
(a) Let 
$i,j\in I$. Then $(a+i)(b+j)=ab+ib+aj+ij$. As $I$ is an ideal, $ib+aj+ij\in 
I$ and so $(a+i)(b+j)+I=ab+I$.

(b) and (c) follow from the corresponding results for groups and (a).


\begin{lemma}[The Isomomorphism Theorem]\l{itr}
 Let $\phi: R\to S$ be a ring homomorphism. Then the map
 $$\bar\phi: R/\ker \phi\to \phi(R), \quad r+\ker \phi\to \phi(r) $$
is a well defined isomorphism of rings.
\end{lemma} By the Isomorphism Theorem for groups \ref{IT}, this is a 
well defined isomorphism for the additive groups. But clearly also 
$\bar\phi(ab)=\bar\phi(a)\bar\phi(b)$ and $\bar\phi$ is a ring 
isomorphism.\qed 

\medskip

We will see below that any  ring $R$ can be embedded into a ring $S$ with 
an identity. This embedding is somewhat unique. Namely suppose that $R\leq 
S$ and $S$ has an identity. Then for $n,m\in \mb Z$ and $r,s\in 
R$ we have $(n1+r)+)(m1+s)=(n+m)1+(r+s)$ and 
$(n1+r)(m1+s)=(nm)1+(mr+ns+rs)$. So already $\mb Z1+R$ is a ring with $1$, 
contains $R$ and the addition and multiplication on $\mb Z1+R$ is uniquely 
determined. But there is some degree of freedom. Namely $\mb Z1+R$ does 
not  have to  be a direct sum. 

 Let $\hat R =\mb Z\times R$ as abelian groups.  We make $\hat R$ into a  
ring by defining
 $$(n,r)\cdot(m,s)=(nm,ns+mr+rs).$$
 Then $(1,0)$ is an identity in $\hat{R}$. 
 The map $\phi: \hat R\to S, (n,r)\to n1+r$ is a homomorphism with image $\mb Z1+R$. Let us investigate 
$\ker \phi$. $(n,r)\in \ker \phi$ iff $r=-n1$. Let $k\mb Z$ be the inverse 
image of $\mb Z1\cap R$ in $\mb Z$. Also put $t=k1$ and $D_{k,t}=\{(lk, 
-lt)\mid l\in \mb Z\}$. Then $\ker \phi=D_{k,t}$. Hence 
$\hat{R}/D_{k,t}\cong \mb Z1+R$. 

Now which choices of $k\in \mb Z$ and $t\in R$ can really occur? Note that as
$t=-n1$, $tr=kr=rt$. This necessary  condition on $k$ and $t$ turns out to 
be sufficient:

Let $k\in \mb Z$. $t\in R$ is called an $k$-element if $tr=rt=kr$ for
all $r\in R$. Note that a $1$-element is an identity, while a $0$-element is an 
element with $tR=Rt=0$. Also if $a$ and $b$ are $k$-elements, then $a-b$ is 
a $0$-element. So if a $k$-elements exists it  unique modulo the zero 
elements.

Suppose now that $t$ is a $k$-element in $R$. Define $D_{t,k}$ has above. 
We claim that $D_{k,t}=\mb Z(k,-t)$ is an ideal in $R$.  For this we 
compute( using $rt=kr$)
$$(n,r)\cdot (k,-t)=(nk,kr-nt-rt)=(nk,kr-nt-kr)=(nk,-nt)=n(k,-t).$$
So $D_{k,t}$ is a left ideal. Similarly, $D_{t,k}$ is a right ideal. Put 
$R_{k,t}=\hat R/D_{k,t}$. Then $R_{k,t}$ is a ring with identity, contains 
$R$ ( via the embedding $r\to (0,r)+D_{k,t}$) and fulfills $\mb Z1\cap 
R=k\mb Z1=\mb Zt$.

Note that if $t$ is an $k$-element and $s$ an $l$-element, then $-t$ is an 
$-k$ element and $t+s$ is an $(k+l)$-element. Therefore the sets of $k\in 
\mb Z$ for which there exists a $k$-element is a subgroup of $\mb Z$ and so 
of the form $i\mb Z$ for some $i\in \mb N$. Let $u$ be a $i$-element.  
$R_{i,u}$ is in some sense the smallest ring with a identity which contains 
$R$. Also if $R$ has no $0$-elements, $u$ and so $R_{i,u}$ is uniquely 
determined.

For example if $R=n\mb Z$, then $i=n=u$ and $R_{i,u}\cong \mb Z$. Indeed 
$\hat R=\mb Z \times n\mb Z$, $D_{nn}=\{ (jn,-jn)\mid j\in \mb Z\}$, $\hat 
R=\mb Z(1,0)\oplus D_{n,n}$ and the map $R_{n,n}\to \mb Z$, 
$(j,r)+D_{n,n}\to j+r$ is an isomorphism between $R_{n.n}$ and $\mb Z$.

Next we will show that  $R$ can be embedded into a ring with identity which  
has same characteristic as $R$. Put $n=\chr R$, then $0$ is an $n$-element. 
Also $D_{n,0}=n\mb Z\times \{0\}$ and $R_{n,0}\cong \mb Z/n\mb Z\times R$ 
as abelian groups. So  $R_{n,0}$ has characteristic $n$. On the other 
hand $\hat{R}=R_{0,0}$ always has characteristic $0$.\medskip



\begin{Def}\l{dprime} Let $I$ be an ideal in the ring $R$ with $I\neq 
R$.
 \begin{itemize}
\AI{a} $I$ is  \ei{prime ideal} if for all ideals $A,B$ in 
$R$ $$AB\subseteq I\Longleftrightarrow \quad A\subseteq I \text{ or } 
B\subseteq I$$ 
\AI{b} $I$ is a \ei{maximal ideal} if for each ideal $A$ of $R$. 
$$I\subseteq A\subseteq R\Longleftrightarrow A=I \text{ or } A=R.$$ 
\end{itemize}
\end{Def}

Note that $n\mb Z \,m\mb Z=nm\mb Z$ and so $k\mb Z$ is a prime ideal in $\mb 
Z$ if and only if $k$ is prime. Also $n \mb Z\subseteq m\mb Z$ if an only 
if $m$ divides $n$. So $k\mb Z$ is maximal if and only if $k$ is a prime. 
So for $\mb Z$  the maximal ideals are the same as the prime ideals. This 
is not true in general.

\begin{lemma}\l{basicprime} Let $P\neq R$ be an ideal in the ring $R$.
\begin{itemize}
\AI{a} If for all $a,b\in R$,
$$ab\in P \Longleftrightarrow a\in P\text{ or } b\in P$$
then $P$ is a prime ideal 
\AI{b}  If $R$ is commutative, the converse of $(a)$ holds.
\AI{c}  If $R$ is commutative, then $P$ is a prime ideal if and only $R/P$ 
has no zero divisors.
 \end{itemize} \end{lemma}
\proof (a) Let $A$ and $B$ are 
ideals in $R$ with $AB\subseteq P$. We need to show that $A\subseteq P$ or 
$B\subseteq B$. So suppose $A\nsubseteq P$ and pick $a\in A\setminus P$. 
Since $ab\in P$ for all $b\in B$ we conclude $b\in P$ and $B\subseteq P$.


(b) Suppose that $P$ is prime ideal and $a,b\in R$ with $ab\in P$. Then for 
all $n,m\mb Z$ and $r,s\in R$. $$(na+ra)(mb+sa)=(nm)ab+(ns+mr+rs)ab$$ and 
so $(a)(b)\subseteq (ab)\subseteq P$. As $P$ is prime, $(a)\subseteq P$ or 
$(b)\subseteq P$. Hence $a\in P$ or $b\in P$.

(c) Just note that the condition in (a) is equivalent to saying that 
$R/P$ has no zero divisors.
\qed


\begin{lemma}\l{primeintegral} Let $R$ be a nonzero commutative ring with
identity  and $P$ an ideal. Then $P$ is prime ideal if and only if $R/P$ is 
an integral domain. \end{lemma} \proof If $P$ is a prime ideal or if $R/P$ 
is an integral domain we have that $R\neq P$. So the lemma follows from 
\ref{basicprime}c.\qed

\begin{theorem}\l{basicmaximal} Let $R$ be a ring with identity and $I\neq 
R$ be an ideal. Then $I$ is contained in a maximal ideal. In particular 
every nonzero ring with identity has a maximal ideal. 
\end{theorem} \proof 
The second statement follows from the first applied to the zero ideal. To 
prove the first we apply Zorn's lemma \ref{Zorn}. For this let ${\cal M}$ 
be the set of ideals $J$ of $R$ with $I\subseteq J\subsetneq R$. Order 
${\cal M}$ by inclusion and let ${\cal C}$ be a nonempty chain in ${\cal 
M}$. Let $M=\cup {\cal C}$. Then  $M$ is an ideal and $I\subseteq M$. Also 
$1$ is not contained in any member of $\cal C$ and so $1\not\in M$. Hence 
$M\neq R$ and $M\in {\cal M}$. Thus every chain has an upper bound and so 
by Zorn's Lemma ${\cal M}$ has a maximal element $M$. If $M\subset A$ for 
some ideal $A\neq R$, then $I\subseteq A$, $A\in {\cal M}$ and so by 
maximality of $M$ in ${\cal M}$, $A=M$. Thus $M$ is a maximal ideal. \qed

\begin{theorem}\l{maximalprime} 
Let $M$ be a maximal ideal. Then $M$ is a 
prime ideal unless $R$ has no identity, $R\neq R^2$ and $R^2\subseteq M$.
\end{theorem}
\proof Suppose that $M$ is not prime. Then $AB\subseteq M$ for some ideals 
$A$ and $B$ with $A\not\leq M$ and $B\not\leq M$. The maximality of $M$ 
implies $R=A+M=B+M$. Thus $R^2=(A+M)(B+M)\subseteq AB+M\subseteq M$. Has 
$M\neq M$ we get $R^2\neq R$. In particular $R$ does not have an identity 
since otherwise $R=R1\subseteq R^2$.\qed

We remark that an ideal $I\neq R$ is maximal if and only if $R/I$ is simple.

\begin{lemma}\l{basicsimplerings}
\begin{itemize}
\AI{a} Let $R$ be a division ring. Then $R$ has non proper left or right 
ideals. In particular $R$ is simple.
\AI{b} Let $R$ be a non-zero 
commutative ring with identity. The $R$ is simple if and only if $R$ is a 
field. \end{itemize} \end{lemma} \proof
 (a) Let $I$ be an nonzero left ideal in 
$R$ and pick $0\neq i\in I$. Then $1=i^{-1}i\in RI\subseteq R$ and so 
$R=R1\subseteq I$.

(b) By (a) we only need to show that simple implies field. So suppose $R$ 
is simple and  $0\neq a\in R$. Since $R$ has an identity, $Ra$ is an 
non-zero ideal. As $R$ is simple $Ra=R$. Thus $ra=1$ for some  $r$. As $R$ 
is commutative, $ar=1$ and so $r$ has an inverse.\qed


If $I$ is  an ideal  we will sometimes write $a\equiv b \pmod I$ 
if $a+I=b+I$, that is if $a-b\in I$. If  $R=\mb Z$ and $I=n \mb 
Z$ then $a\equiv b\pmod{n\mb Z}$ is the same as $a\equiv b \pmod n$.

\begin{theorem}[\nei{Chinese Remainder Theorem}]\l{CRT} Let $(A_i,i\in I)$
be a  family of ideals in the ring $R$. 
\begin{itemize} 
\AI{a} The map $\theta:$ 
$$ R/\bigcap_{i\in I} A_i\to \prod_{i\in A_i} R/A_i$$
$$  r+\bigcap_{i\in I} A_i\to (r+A_i)_{i\in I}$$ 
is a well defined monomorphism. 
\AI{b}  Suppose that $I$ is finite, $R=R^2+A_i$ and $R=A_i+A_j$ for all 
$i\neq j\in I$. Then 
\begin{itemize}
\AI{ba} If $|I|> 1$, then $R=A_i+\bigcap_{i\neq j\in I}A_j$. 
\AI{bb} $\theta$ is an isomorphism. 
\AI{bc}   For $i\in I$ let $b_i\in R$ be given.  Then there exists $b\in R$ 
with $$ b\equiv b_i\pmod  {A_i}  \text{ for all } i\in I$$ Moreover, $b$ is 
unique $\pmod {\bigcap_{i\in I} A_i}$. \end{itemize} \end{itemize} 
\end{theorem} \proof (a)  The map $r\to (r+A_i)_{i\in I}$ is clearly a ring 
homomorphism with kernel $\bigcap_{i\in I} A_i$. So $(a)$ holds.

$(ba)$ For $\emptyset \neq J\subseteq I$ put $A_J=\bigcap_{j\in J} A_j$. We 
will show by induction on $|J|$ that
$$R=A_i+A_J$$
for all $\emptyset \neq J\subseteq I\setminus\{i\}$.
Indeed if $|J|=1$ this is part of the assumptions. So suppose $|J|>1$, pick 
$j\in J$ and put $K=J\setminus\{j\}$. Then by induction $R=A_i+A_K$ and 
$R=A_i+A_j$. Note that as $A_j$ and $A_K$ are ideals, $A_jA_K\subseteq 
A_j\cap A_K=A_J$ Thus
$$R^2=(A_i+A_j)(A_i+A_K)\subseteq A_i+A_jA_K\subseteq A_i+A_J$$
Hence $R=A_i+R^2=A_i+A_J$.

$(bb)$  By (a) we just need to show that 
$\theta$ is onto. For $|I|=1$, this is obvious. So suppose $I|\geq 2$. Let 
$$x=(x_i)_{i\in I} \in  \prod_{i\in A_i} R/A_i.$$ 
We need to show that 
$x=\theta(b)$ for some $b\in R$.  Let $x_i=b_i+A_i$ for some $b_i\in R$. By 
$(ba)$, we may choose $b_i\in \bigcap_{j\in i\neq I} A_j$.  So $b_i\in A_j$ 
for all $j\neq i$. Thus $$\theta(b_i)_j=\begin{cases} x_i & \text{ if } 
j=i\\ 0   &\text{ if }   j\neq i\end{cases}$$ Put $b\sum_{i\in I} b_i$. 
Then $\theta(b)_j=x_j$ and so $\theta(b)=x$.\qed


$(bc)$ This is clearly equivalent to $(bb)$\qed


The special case  $R=\mb Z$ is an elementary result from number theory 
which was know to Chinese mathematicians in the first century A.D. To state 
this result we first need to observe a couple of facts about ideals in $\mb 
Z$.

Let $n,m$ be positive integers. $\gcd(n,m)$ denotes the greatest common 
divisor and $\lcm(n,m)$ the least common multiple of $n$ and $m$. Then

$$n\mb Z \cap m\mb Z =\lcm(n,m)\mb Z$$
and
$$n\mb Z+ m\mb Z=\gcd(n,m)\mb Z$$
In particular $n$ and $m$ are relatively prime if and only if 
$n\mb Z+m\mb  Z=\mb Z$. So part (bc) of the Chinese Remainder 
Theorem translates into:


\begin{corollary} Let $m_1,\ldots m_n$ be positive integers which are 
pairwise relatively prime. Let $b_1,\ldots,b_n$ be integers. Then there 
exists an integer $b$ with 
$$b\equiv b_i\pmod {m_i} \text{ for all } 1\leq i\leq n$$
Moreover, $b$ is unique $\pmod {m_1m_2\ldots m_n}$ \qed
\end{corollary}




\section{Factorizations in commutative rings}


\begin{Def} Let $R$ be a commutative rings and $a,b\in R$.
\begin{itemize}
\AI{a} We say that $a$ \ei{divides} $b$ and write $a\mid b$, if 
$(b)\subseteq (a)$. 
\AI{b} We say that $a$ and $b$ are \ei{associate} and write 
$a\sim b$, if $(a)=(b)$
\AI{c} We say that $a$ is proper if $\{0\}\neq (a)\neq R$. 
\end{itemize}
\end{Def}

Some remarks on this definition. First note that 
$$ a\sim b\Longleftrightarrow a\mid b \text{ and } b\mid a$$
Also $a|b$ is a symmetric and transitive relation. $a\sim b$ is an 
equivalence relation.
If $R$ has an identity, $a\mid b$ if and only if $b=ra$ for some $r\in R$.

\begin{lemma}\l{unitdivide} Let $R$ be a commutative ring with identity 
and $u\in R$. The following are equivalent
\begin{itemize}
\NI{1} $u$ is a unit.
\NI{2} $u\mid 1$
\NI{3} $u\mid r$ for all $r\in R$
\NI{4} $(u)=R$
\NI{5} $u$ is not contained in any maximal ideal of $R$.
\NI{6}  $r\sim ur$ for all $r\in R$.
\end{itemize}
\end{lemma}
\proof Straightforward.\qed

In particular, we see that if $R$ has an identity, $a$ is proper if and 
only if $a$ is neither $0$ nor a unit.

\begin{lemma}\l{r*orbits}  Let $R$ be an integral domain. Let $a,b,u\in 
R^\#$ with $b=ua$. Then $b\sim a$ if and only if $u$ is a unit.
\end{lemma}
\proof The "if" part follows from \ref{unitdivide}, part 6. So suppose that 
$b\sim a$. Then $a=vb$ for some $v\in R$. Thus $1b=b=ua=u(vb)=(uv)b$. Since 
the cancellations law hold in integral domains we conclude that $uv=1$. So 
$u$ is a unit.\qed


Recall that $R^*$ denotes the (multiplicative) groups of units in $R$.
$R^*$ acts on $R$ by left multiplication. The previous lemma now says that 
in an integral domain the orbits of $R^*$ are exactly the equivalence 
classes of $\sim$. 

\begin{Def}\l{dpid}Let $R$ be a ring.
\begin{itemize}
\AI{a} An ideal $I$ is called a \ei{principal  ideal} if its generated by
one  element, that is $I=(r)$ for some $r\in R$.
\AI{b} $R$ is called a \ei{principal ideal ring} if every ideal is a
principal  ideal.
\AI{c} $R$ is \ei{principal ideal domain} (\ei{PID}), if $R$ is an integral 
domain and a principal ideal ring. \end{itemize} \end{Def}

\begin{Def} Let $R$ be a commutative ring with identity and $c$ a proper 
element. \begin{itemize} \AI{a} $c$ is called \ei{irreducible }if for all 
$a,b\in R$ $$ c=ab\Longrightarrow  a \text{ or } b \text{ is a unit}$$ 
\AI{b} $c$ is called a \ei{prime} if for all $a,b\in R$ $$ p\mid 
ab\Longrightarrow p|a \text{ or } p\mid b.$$ 
\end{itemize} \end{Def}


\begin{lemma}\l{primeirr} Let $p$ and $c$ be nonzero elements in the 
integral domain $R$. \begin{itemize} \AI{a}  The following are 
equivalent:
\begin{itemize}
\NI{1} $p$ is a prime
\NI{2} $(p)$ is a prime ideal
\NI{3} $R/(p)$ is an integral domain
\end{itemize}
 \AI{b} The following are equivalent \begin{itemize} \NI{1} $c$ is irreducible 
\NI{2} For all $a\in R$, $$a\mid c\Longrightarrow a\sim u \text{ or } a 
\text{ is a unit}$$ \NI{3} $(c)$ is maximal in the set of proper principal 
ideals. \end{itemize} \AI{c}  Every prime  element in $R$ is irreducible. 
\AI{d} If $R$ is principal ideal then the following are equivalent
\begin{itemize}  \NI{1} 
$p$ is a prime \NI{2}   $p$ is irreducible. \NI{3}   $(p)$ is a maximal 
ideal. \NI{4}    $R/(p)$ is a field.
\end{itemize}
 \AI{e} Every associate of a prime is a 
prime and every associate of an irreducible element is irreducible. 
\end{itemize} \end{lemma}\proof (a) This follows from \ref{basicprime}a and 
\ref{primeintegral}.

(b) Suppose 1. holds and $a\mid c$. Then 
$c=ab$. If $a$ is not a unit, then $b$ is a unit and so $a\sim c$. Hence 2. 
holds

Suppose 2. holds and $(c)\subseteq (a)$. Then $a\mid u$. If $a\sim c$, 
$(a)=(c)$ and if $a$  is a unit $(a)=R$. Thus 3. holds.

Suppose that 3. holds and $c=ab$. Then $(c)\subseteq (a)$ and so either 
$(a)=(c)$ or $(a)=R$. In the first case $a\sim c$ and so by \ref{r*orbits} 
$b$ us a unit. In the second case $a$ is a unit. So 1. holds.

$(c)$ Let $p$ be a prime and $p=ab$. So $p\mid a$ or $p\mid b$. Without 
loss $p\mid a$. Since also $a\mid p$ we get $p\sim a$. Thus \ref{r*orbits} 
implies that $b$ is unit.

$(d)$  By (c) 1. implies 2. 

Suppose 2. holds 
 By $(b3)$ says that $(p)$ is a maximal  proper principal ideal. Since 
every ideal in a PID is a principal ideal, $(p)$ is a maximal ideal. So 3. 
holds. 

By \ref{basicsimplerings} 3. implies 4.

Suppose 4. holds. Then by \ref{antimalarial}, (p) is 
a prime ideal. So by $(a)$, $p$ is a prime.

$(e)$ By $(a)$ and $(b)$ the properties "prime" and "irreducible" of an 
element only depends  on  the ideal generated by the element. Thus (e) 
holds.

 




\begin{lemma}\l{uniquefactor} Let $R$ be an integral domain and $a\in R$.
 Suppose that $a=p_1\cdot\ldots\cdot p_n$ with each $p_i$  a prime in $R$.
\begin{itemize}\AI{a}
 If $q\in R$ is a prime with $q\mid a$, then $q\sim 
p_i$ for some $1\leq i\leq n$.
\AI{b} If $a=q_1\ldots q_m$ with each $q_i$ a prime. Then
$n=m$ and there exists $\pi\in \Sym(n)$ with $q_i\sim p_{\pi(i)}$.
\end{itemize} 
\end{lemma} (a) Put $b=p_2\ldots p_n$. Then $a=p_1b$ and $q\mid p_1b$. Thus 
 $q|p_1$ or $q\mid b$ . In the first case as primes are irreducible 
$q\sim p_1$. In the second case induction implies $q\sim p_j$ for some 
$j\leq 2\leq n$. 

(b) By (a), $q_1\sim p_j$ for some $j$. Without loss 
$q_1=p_1$. As $R$ has no zero-divisor, $b=q_2\ldots q_m$ and we are done by 
induction. \qed


\begin{Def} A \ei{unique factorization domain} (\ei{UFD}) is an integral 
domain in which every proper element is a product of primes. 
\end{Def}

Let $R$ be a UFD. Then each irreducible element is divisible by a prime and 
so equal to that prime. So primes and irreducibles are the same in UFD's. 
Also \ref{uniquefactor} implies   that  the prime factorizations are unique 
up to associates.


Our next goals is to show that every PID is a UFD. For this we need a 
couple of preparatory lemmas.

\begin{lemma}\l{chainideal} Let ${\cal I}$ be chain of ideals in the ring 
$R$.
\begin{itemize}
 \AI{a} $\bigcup {\cal I}$ is an ideal.
 \AI{b} If\, $\bigcup {\cal I}$ is finitely generated as an ideal, then
$\bigcup {\cal I}\in {\cal I}$.
\end{itemize}
 \end{lemma}
\proof (a) is obvious.

(b) Suppose that $\bigcup {\cal I}=(F)$ for some finite $F\subseteq \bigcup 
{\cal I}$.  For each $f\in F$ there exists $I_f\in {\cal I}$ with $f\in 
I_f$. Since ${\cal I}$ is totally ordered, the finite set $\{I_f\mid f\in 
F\}$ has a maximal element $I$ then $I\in {\cal I}$, $F\subseteq I$ and so 
$$\bigcup {\cal I} =(F)\subseteq I\subseteq \bigcup{\cal I}$$
Thus $I=\bigcup {\cal I}$ and (b) is proved.

\begin{lemma}\l{minchain} Let $R$ be an integral domain and 
${\cal I}$ a set of principal ideals.  Then one of the following holds:
\begin{itemize}
\NI{1} $\bigcap {\cal I}=\{0\}$.
\NI{2} ${\cal I}$ has a minimal element.
\NI{3} There exists an infinite strictly ascending series of principal 
ideals. \end{itemize} \end{lemma} \proof Suppose that neither 1. nor 2. 
hold. Then there exists an infinite descending series

$$Ra_1\supsetneq Ra_2\supsetneq\ldots Ra_n\supsetneq 
Ra_{n+1}\supsetneq\ldots$$
and an element $0\neq a$ contained in each $Ra_n$. Let $a=r_na_n$ with  
$r_n\in R$. Since $a_{n+1}\in R{a_n}$, $a_{n+1}=sa_n$ for some $s\in R$.
Thus
$$r_na_n=a=r_{n+1}a_{n+1}=r_{n+1}sa_n$$
As $R$ is an integral domain, $r_n=r_{n+1}s$ and so $Rr_n\subseteq 
Rr_{n+1}$. If $Rr_{n+1}= Rr_n$, then $Rr_{n+1}=Rsr_{n+1}$. So $r_{n+1}\sim 
sr_{n+1}$ and by \ref{r*orbits}, $s$ is a unit. As $a_{n+1}=sa_{n}$ we 
conclude that $Ra_n=Ra_{n+1}$, a contradiction. Thus 
$$Rr_1\subsetneq 
Rr_2\subsetneq\ldots Rr_n\subsetneq Rr_{n+1}\subseteq \ldots$$ is an 
infinite strictly ascending series of ideals.\qed




\begin{lemma}\l{maxmin} Let $R$ be a ring in which every ideal is finitely 
generated. 
  \begin{itemize} 
  \AI{a} Any nonempty set of ideals in $R$ has a maximal member.
  \AI{b} Suppose in addition that $R$ is an integral domain. Then every 
non empty set of principal ideals with nonzero intersection  has a minimal 
member. 
\end{itemize}
\end{lemma} \proof (a) By \ref{chainideal}, $R$ has no strictly 
ascending series of ideals. Thus (a) holds. (b) follows from 
\ref{chainideal} and \ref{minchain}\qed



\begin{lemma}\l{PIDUFD} Every principal ideal domain is a unique 
factorization domain.
\end{lemma}
\proof Let $S$ be the set of proper elements in $R$ which can be written as 
a product of primes. Let $a$ be proper in $R$. Let 
$${\cal S}=\{ (s)\mid  a\in (s), s\in S\}$$
 We claim that ${\cal S}$ is not empty. Indeed, let $(s)$ be a maximal ideal
with $(a)\subset (s)$. Then $s$ is irreducible and so by \ref{primeirr} $s$ 
is a prime. Hence $s\in S$ and $(s)\in {\cal S}$. As $a\in \bigcap 
{\cal S}$, $\bigcap {\cal S}$ is not empty. So by \ref{maxmin}b, ${\cal S}$ 
has a minimal member, say $(b)$ with $b\in S$. Since $a\in (b)$,   $a=ub$  
for some $u\in R$. Suppose that $u$ is not a unit. Then as seen above there 
exists a prime $p$ dividing $u$. Then $pb$ divides $a$ and so $a\in (pb)$. 
But $pb\in S$ and $b\not\in (pb)\subsetneq (b)$ a contradiction to the 
minimal choice of $(b)$. \qed


\begin{Def}\l{deuklidring}  An \ei{Euclidean ring} is a commutative ring
together with a function $\phi:R^\#\to \mb N$ such that:

 For all $a,b\in R$ with $b\neq 0$, there exists $q,r\in R$ with
$$a=qb+r$$
 and either $r=0$ or $q(r)<q(b)$.
\end{Def}

An \ei{Euclidean domain} is an Euclidean ring which is also an integral 
domain.

Some examples:


$\mb Z$ is an Euclidean domain with $\phi$ the absolute value function.

Any field is a Euclidean domain with $\phi=0$.

The polynomial ring over any field is a Euclidean ring with $\phi$ the
degree function.

\begin{lemma}\l{ERPR} Any Euclidean ring is a principal ring with identity.
An Euclidean domain is a PID and a UFD.
\end{lemma} 
\proof
Let $I$ be a nonzero ideal and let $0\neq a\in I$ with
$\phi(a)$ minimal. Let $b\in I$. Then by $ER2$, $b=qa+r$ for some $q,r\in R$
with (if $r\neq 0$), $\phi(r)<\phi(a)$. Suppose that $r\neq 0$. Then
$r=b-qa\in I$ , a contradiction to the minimal choice of $\phi(a)$. Thus
$b=qa\in (a)$. Hence $I=Ra=(a)$ and $R$ is a principal ring. 

To show that $R$
has an identity note that $R=Ra$ for some $a$.  In particular, $a=ea$ for
some $e\in R$. Now for all $r\in R$, $r=sa$ for some $s$ and
$er=esa=sea=sa=r$ so $e$ is an identity.

The last statement follows form \ref{PIDUFD}.\qed

Let $R$ be an euclidean ring and $\phi: R^\#\to \mb N$ the corresponding function.
Let $0\neq \tilde a \in (a)$ with $\phi(\tilde a)$ minimal. From the proof of the previous
lemma,
$(\tilde a)=(a)$ so $a\sim \tilde a$. Define $\phi^*(a)=\phi(\tilde a)$
We claim that:

\begin{itemize}
\AI{a}  $\phi^*(a)\leq \phi^*(ab)$ for all $a,b\in R^\#$ with $ab\neq 0$.
\AI{b} For all $a,b\in R$ with $b\neq 0$,  there exists $q,r\in R$ with $a=qb+r$
 and either $r=0$ or $q^*(r)<q^*(b)$.
\end{itemize}

Let $d=ab$. Then $d\in (a)$ and so $\tilde d\in (d)\subseteq (a)$. Thus $\phi(\tilde
a)\leq\phi(tilde d)$. So (a) holds.
By definition of an euclidean domain, there exists $r$ and $s$ with
$\tilde a= q\tilde b+ $ and either $t=0$ or $\phi(r) < \phi(\tilde b)$.
Since $a=u\tilde a$ and $\tilde b=v b$ with $u,v$ units we get

$$a= (uvq) b+ uv r$$.
If $r=0, uvr=0$. Suppose  $r\neq 0$. As $u$ and $v$ are units $(uvr)=(r)$. Thus
$$\phi^*(uvr)=\phi^*(r)\leq \phi(r)< \phi(\tilde b)=\phi^*(b)$$
So (b) holds.\bigskip.\qed





Next we introduce greatest common divisor in arbitrary
commutative rings. But the reader should be aware that often no greatest
common divisor exist.

\begin{Def}\l{dgcd} Let $X$ be  a subset of the commutative ring $R$ and
$d\in R$ 
\begin{itemize} 
\AI{a} We say $d$ is a \ei{common divisor} of $X$ and write $d\mid X$ if 
$X\subseteq (d)$, that is if $d\mid x$ for all $d\in X$. 
 \AI{b} We say that $d$ is \ei{greatest common divisor} of $X$ and write 
$d\sim \gcd(X)$ if $d|X$ and $e|d$ for all $e\in R$ with $e|X$. 
 \AI{c} We say that $X$ is \ei{relatively prime} if all 
commons divisors of $X$ are units. \end{itemize} \end{Def}

Note that if a greatest common divisor exists it is unique up to
associates. A common divisor exists if and only if $(X)$ is contained in a
principal ideal. A greatest common divisor exists if and only if the
intersection of all principal ideals containing $X$ is a principal ideal.
(Here we define the intersection of the empty set of ideals to be the ring
itself). The easiest case is then $(X)$ itself is a principal ideal. Then
the greatest common divisors are just the generators of $(X)$. An element in
$(X)$ generates $(X)$ if and only if it's a common divisor.
So  if the ring has an identity, $(X)$ is a principal ideal if and only if
$X$ has a common divisor of the form
$\sum_{x\in X} r_xx$, where as usually all but finitely many $r_x$'s are
supposed to be $0$. 

Note that from the above we have the following statement:

Every subset of $R$ has a greatest common divisor if and only if any 
intersection of principal ideals is a principal ideal. That is  if and only if the set of 
principal ideals in $R$ is closed under intersections.

In particular,  greatest common divisors exists in $PID$'s and can be
expressed as a linear combination of the $X$.

 Greatest common divisors still exists in $UFD$'s, but are no longer
necessarily a linear combination of $X$. Indeed let ${\cal P}$ be a set of
representatives for the associate classes of primes.  For each $0\neq r\in
R$,
$$x=u_r\prod_{p\in{\cal P}} p^{m_p(r)}$$
for some $m_p(r)\in \mb N$ and a unit $u_r$. Let 
$$m_p=\min_{x\in X} m_p(x).$$
Since $m_p\leq m_p(x)$
only finitely many of the $m_p$ are nonzero. So we can define 
$$d=\prod_{p\in{\cal P}} p^{m_p}.$$
A moments thought reveals that $d$ is  a greatest common divisor.  
\medskip


Here are a couple of concrete examples which might help to understand some 
of the concepts we developed above.

First let $R=\mb Z[i]$, the subring of $\mb C$ generated by $i$. R is 
called the ring of \ei{Gau{\ss}ian integers}.

Note that  $R=\mb Z+\mb Z i$.  We will first show that 
$R$ is an Euclidean ring. Indeed, put $\phi(a_1+a_2i)=a_1^2+a_2^2$. Then 
$\phi(xy)=\phi(x)\phi(y)$ and $\phi(x)\in \mb Z^+$. So $(ER1)$ holds. Let 
$x,y\in R$ with $x\neq 0$. Put $z=\frac{y}{x}\in \mb C$. Then $y=zx$. Also 
there exists $d=d_1+d_2i\in \mb C$ with $q:=z-d\in R$ and $|d_i|\leq 
\frac{1}{2}$. In particular, $\phi(d)\leq 
\frac{1}{2}^2+\frac{1}{2}^2=\frac{1}{2}$. Put $r=y-qx$ then 
$r=zx-qx=(z-q)x=dx$. So $\phi(r)=\phi(d)\phi(x)\leq \frac{1}{2}\phi(x)$. 
Hence also $(ER2)$ holds.

Let $a$ be a prime in $R$ and put $P=(a)$. Since $\phi(a)=\bar a a\in P$, 
$P\cap \mb Z\neq 0$. Also  $1\not\in P$ and so $P\cap Z$ is a proper 
ideal in $\mb Z$. Since $R/P$ has no zero divisors, $\mb Z+P/P\cong \mb 
Z/P\cap \mb Z$ has no zero divisors. Thus $P\cap \mb Z=p\mb Z$ for some 
prime integer $p$. Let $Q=pR$. Then $Q\leq P\leq R$. We will determine  the 
zero divisors in $R/Q$. Indeed suppose that $ab\in Q$ but neither $a$ nor 
$b$ are in $Q$. Then $p^2$ divides $\phi(ab)$. So we may assume that $p$ 
divides $\phi(a)$. Hence $a_1^2=-a_2^2\pmod p$. If $p$ divides $a_1$ it 
also divides $a_2$, a contradiction to $a\not\in Q$. Therefore we can 
divide by $a_2 \pmod p$ and conclude that the equation $x^2=-1$ has a 
solution in $\mb Z/p\mb Z$. Conversely, if $n^2\equiv -1\pmod p$ for some 
integers $n$ we see that (up to associates) $n+i+Q$ and $n-i+Q$ are the only 
zero divisors.

Suppose that no integer $n$ with $n^2\equiv -1\pmod p$ exists. Then $R/Q$ 
is an integral domain and so a field. Hence $Q=P$ and $a\sim p$ in this 
case.

Suppose that $n$ is an integer with  $n^2\equiv -1\pmod p$. As $P$ is 
a prime ideal and $(n+i)(n-i)\in Q\leq P$, one of $n\pm i$ is in  $P$. We 
conclude that $a\sim n\pm i$. \medskip


Next let $R=\mb Z[\sqrt{10}]$. We will show that $R$ has some irreducible 
elements which are not primes. In particular, $R$ is neither UFD, PID or 
Euclidean. Note that $R=\mb Z+ \mb Z\sqrt{10}$. For $r\in 
R$ define $r_1,r_2\in \mb Z$ by $r=r_1+r_2\sqrt{10}.$ Define $\tilde 
r=r_1-r_2\sqrt{10}$ and $N(r)=r\tilde r=r_1^2-10r_2^2$. $N(r)$ is called 
the \ei{norm} of $r$. We claim that $r\to\tilde r$ is a ring automorphism of 
$R$. Clearly it is an automorphism of $(R,+)$. Let $r,s\in R$. Then 
$$rs=(r_1+r_2\sqrt{10})(s_1+s_2\sqrt{10})=(r_1s_1+10r_2s_2)+(r_1s_2+r_2s_2)\
\sqrt{10}$$ It follows that $\widetilde{rs}=\tilde r\tilde s$. In 
particular, $$N(rs)=rs\widetilde{rs}=rs\tilde r\tilde s=r\tilde r s \tilde 
s=N(r)N(s)$$ and $N:R\to \mb Z$ is a multiplicative homomorphism. Let $r$ 
be a unit in $R$.  Since $N(1)=1$, we conclude that $N(r)$ is unit in $\mb 
Z$ and so $N(r)=\pm 1$. Conversely, if $N(r)=\pm 1$, then 
$r^{-1}=\frac{\tilde r}{N(r)}=N(r)\tilde r\in R$ and $r$ is a unit. For 
example $3+\sqrt{10}$ is unit with inverse $-3+\sqrt{10}$. As $\sqrt{10}$ 
is not rational, $N(r)\neq 0$ for $r\in R^\#$.




We claim that all of $2,3$, $f:=4+ \sqrt{10}$ and $\tilde f$ are irreducible.
Indeed suppose that $ab$ is one of those numbers and neither $a$ nor $b$ 
are units. Then $N(a)N(b)\in \{4,9,6\}$ and so $N(a)\in \{\pm 2,\pm 3\}$ and 
$$N(a)\equiv 2,3\pmod 5$$ But for any $x\in R$  we have $$N(a)\equiv 
a_1^2\equiv 0,1,4 \pmod 5$$ 
So indeed $2,3, f$ and $\tilde f$ are primes. Note that $2\cdot 3=6=-f\tilde f$.
Hence $2$ divides $f\tilde f$ but (as $f$ and $\tilde f$ are irreducible)  $2$
divides neither
$f$ nor  $\tilde f$. So $2$ is not a prime. With the same argument none of $3$, $f$ 
and $\tilde f$ are not primes. 

We claim that every proper element in $R$ is a product of irreducible. 
Indeed let $a$ be proper in $R$ and suppose that $a$ is not irreducible. 
Then $a=bc$ with neither $b$ nor $c$ units. Then as $N(a)=N(b)N(c)$ both 
$b$ and $c$ have smaller norm as $a$. So by induction on the norm, both $b$ 
and $c$ can be factorized into irreducible. 

Since $R$ has irreducibles which are not primes, we know that $R$ can not be 
a PID. But let us verify directly that $I=(2,f)=2R+fR$ is not a 
principal ideal. First note that $f\tilde f=-6\in 2R$. Since also $2f\in 2R$ we
$I\tilde f\in  2R $. Since 4 does not divide $N(f)$, $f\not\in 2R$ and so $I$ does not 
contain a unit. Suppose now that $h$ is a generator for $I$. Then $h$ is 
not a unit and divides $f$. So as $f$ is irreducible, $h\sim f$ and 
$I=(f)$. But every element in $(f)$ has norm divisible by $N(f)=6$, a 
contradiction to $2\in I$ and $N(2)=4.$


\section{Localization}

Let $R$ be a commutative ring and $\emptyset\neq S\subseteq R$.In this 
section we will answer the following question:

Does there exists a  commutative ring with identity $R^\prime$ so that $R$ 
is a subring of $R^\prime$ and all elements in $S$ are invertible in $R$ ? 

Clearly this is not possible if $0\in S$ or $S$ contains zero 
divisors. It turns out that this condition is also sufficient. Note that if 
all elements in $S$ are invertible in $R^\prime$, also all elements in 
the subsemigroup of $(R,\cdot)$ generated by $S$ are invertible in 
$R^\prime$. So we may assume that $S$ is closed under multiplication:

\begin{Def}\l{dmult} A \ei{multiplicative subset} of the ring $R$ is a 
nonempty subset $S$ with $st\in S$ for all $s,t\in S$.\end{Def}

\begin{lemma}\l{fractions} Let $S$ be a multiplicative subset of the 
commutative  ring $R$. Define the  relation $\sim$ of $R\times 
S$ by $$  (r_1,s_1)\sim (r_2,s_2) \quad \text { if } \quad t(r_1s_2-r_2s_1)=0 \text{
for  some } t\in S.$$ Then $\sim$ is an equivalence relation. \end{lemma} 
\proof $\sim$ is clearly reflexive and symmetric. Suppose now that 
$(r_1,s_1)\sim (r_2,s_2)$ and $(r_2,s_2)=(r_3,s_3)$. Pick  $t_1$ and $t_2$ 
in $S$ with
$$t_1(r_1s_2-r_2s_1)=0 \text{ and }  t_2(r_2s_3-r_3s_2)=0.$$
Multiply the first equation with $t_2s_3$ and the second  one with 
$t_1s_1$. Then both equation contain the term $t_1t_2r_2s_1s_3$ but with 
opposite sign. So adding the two resulting equations we see:
$$0=t_2s_3t_1r_1s_s-t_1s_1t_2r_3s_2=t_1t_2s_2(r_1s_3-r_3s_1)$$
Thus $(r_1,s_1)\sim (r_3,s_3)$.\qed


Let $S$,$R$ and $\sim$ as in the previous lemma. Then \ei{$S^{-1}R$} 
denotes the set of equivalence classes of $\sim$. \ei{$\frac{r}{s}$} stands
for the equivalence class containing $(r,s)$. Note that if $0\in S$, $\sim$ 
has exactly one equivalence class. If $R$ has no zero divisors and 
$0\not\in S$ then $\frac{r_1}{s_1}=\frac{r_2}{s_2}$ if and only if 
$r_1s_2=r_2s_1$.

\begin{proposition}\l{ringfrac} Let $S$ be a multiplicative subset of the 
commutative ring $R$ and $s\in S$ 
\begin{itemize}
\AI{a}  The binary operations
$$\frac{r}{s}+\frac{r^\prime}{s^\prime}=\frac{rs^\prime +r^\prime 
s}{ss^\prime} \quad \text{ and }\quad 
\frac{r}{s}\cdot\frac{r^\prime}{s^\prime}=\frac{rr^\prime}{ss^\prime}$$ on 
$S^{-1}R$ are well-defined. \AI{b} $(S^{-1}R,+,\cdot)$ is an ring. \AI{c} 
$\frac{s}{s}$ is an identity. \AI{d} The map $$\phi_S: R\to S^{-1}R, 
\quad r\to \frac{rs}{s}$$ is a ring homomorphism and independent from the 
choice of $s$. \AI{e} $\phi_S(s)$ is invertible. \end{itemize} 
\end{proposition} \proof 
(a) By symmetry it suffices to check that the 
definition of $+$ and $\cdot$ does not depend on the choice of $(r,s)$ in 
$\frac{r}{s}$. Let $\frac{r_1}{s_1}=\frac{r}{s}$ so $t(rs_1-r_1s)=0$ for 
some $t\in S$.

Then 
$$t[(rs^\prime +r^\prime s)s_1s^\prime- (r_1s^\prime +r^\prime 
s_1)ss^\prime]=t(rs_1-r_1s)s^\prime s^\prime=0$$
and so $+$ is well defined. Also
$$t(rr^\prime s_1s^\prime -r_1r^\prime ss^\prime)=t(rs_1-r_1s)r^\prime 
s^\prime=0$$
and so $\cdot$ is well defined.

(b) It is a routine exercise to check the various rules for a ring. Maybe 
the least obvious  one is the associativity of the addition:

$$(\frac{r_1}{s_1}+\frac{r_2}{s_2})+\frac{r_3}{s_3}=
  \frac{r_1s_2+r_2s_1}{s_1s_2}+\frac{r_3}{s_3}=
  \frac{r_1s_2s_3+r_2s_1s_3+r_3s_1s_2}{s_1s_2s_3}=
  \frac{r_1}{s_1}+\frac{r_2s_3+r_3s_2}{s_2s_3}=
  \frac{r_1}{s_1}+(\frac{r_2}{s_2}+\frac{r_3}{s_3})$$
We leave it to the reader to check the remaining rules.

(c) and (d) are obvious. For (e) note that $\phi_S(s)=\frac{s^2}{s}$ has 
 $\frac{s}{s^2}$ as its inverse. \qed
 
 

The ring $S^{-1}R$ is called the ring if fraction of $R$ by $S$. It has the 
following universal property:

\begin{proposition}\l{uringfrac} Let $R$ be a commutative ring, $S_0$ a 
non-empty subset and $S$ the multiplicative subset of $R$ generated by $S$. 
Suppose that $R^\prime$ is a commutative ring with identity and 
$\alpha(R)\to R^\prime$ is a ring isomorphism so that $\alpha(s_0)$ is a unit 
for all $s_0\in S_0$. Then there exists a unique homomorphism
$$\alpha^*: S^{-1}R\to R^\prime \text{ with } \phi_S(r)\to \alpha(r).$$
Moreover, $$\alpha^*(\frac{r}{s})=\alpha(r)\alpha(s)^{-1}.$$
\end{proposition}
\proof Note that as $\alpha(S_0)$ consists of units so does $\alpha(S)$. 
So once we verify that
$$\alpha^*(\frac{r}{s})=\alpha(r)\alpha(s)^{-1}.$$
is well defined, the remaining assertion are readily verified.

So suppose that $\frac{r_1}{s_1}=\frac{r_2}{s_2}$. Then 
$$t(r_1s_2-r_2s_1)=0$$
 for some $t\in S$. Applying $\alpha$ we conclude
$$\alpha(t)(\alpha(r_1)\alpha(s_2)-\alpha(r_2)\alpha(s_1))=0.$$
As $\alpha(t),\alpha(s_1)$ and $\alpha(s_2)$ are units, we get
$$\alpha(r_1)\alpha(s_1)^{-1}=\alpha(r_2)\alpha(s_2)^{-1}$$
Hence $\alpha^*$ is indeed well-defined.\qed






When is $\frac{r}{s}=0$? The zero element  in $S^{-1}R$ is $\frac{0}{s}$ 
Hence  $\frac{r}{s}=0$ if and only if there exists $t\in S$ with 
$0=t(rs-0s)=trs$ for some $t\in S$. This is true if and only if $tr=0$ for 
some $t\in S$. Put $$R_S=\{r\in R\mid tr=0 \text{ for some } t\in S\}.$$ So 
$\frac{r}{s}=0$ if and only $r\in R_S$.

What is the kernel of $\phi=\phi_S$? $\phi(r)=\frac{rs}{s}$. Hence 
$r\in \ker \phi$ if and only if $rs\in R_S$ and so if and only if 
$r\in R_S$. Thus  $\ker \phi=R_S$. 
So $\phi$ is one to one if and only if $R_S=0$. This in turn just means 
that $S$ contains no zero divisors. In this is the case we will identify 
$R$ with it image in $S^{-1}R$

Let $\check{R}$ be the set of all non-zero, non zero divisors. 
and assume $\check{R} \neq \emptyset$. We claim that $\check R$ is a 
multiplicative set. Indeed let $s,t\in \check R$. Suppose that $rst=0$ for 
some $r\in R$. Then as $t\in \check R$, $rs=0$ and as $s\in \check R$, 
$r=0$ so $st\in \check R$. The $\check R^{-1}R$ is called the \ei{complete 
ring of fraction} of $R$. 

 If $R$ has no zero divisors, then $\check R=R^\#$ and the 
complete ring of fraction is a field. This field is called the \ei{field of 
fraction} of $R$ and denoted by $\mb F_R$. \index{$\mb F_R$} 

The standard example is  $R=\mb Z$. Then $\mb F_{\mb Z}=\mb Q$.

If $\mb K$ is a field then $\mb F_{\mb K[x]}=\mb K(x)$, the field of 
rational functions over $K$. Slightly more general if $R$ has 
no-zero divisors then $\mb F_{R[x]}=\mb F_R(x)$, the field of rational 
function over the field of fractions of $R$.\medskip


We will now spend a little but of time to investigate the situation where 
$S$ does contain some zero divisors.

 Define $$\phi^*: S^{-1}R\to 
\phi(S)^{-1}\phi(R),\quad \frac{r}{s}\to \frac{\phi(r)}{\phi(s)}$$ We 
claim that $\phi^*$ is a well defined isomorphism.  For this we prove the 
following lemma.

\begin{lemma}\l{alp*} Let $\alpha:R\to  R^\prime$ be a homomorphism of 
commutative rings and $S$ and $S^\prime$ multiplicative subsets of $R$ and 
$R^\prime$ respectively. Suppose that $\alpha(S)\subseteq S^\prime$. 
\begin{itemize} \AI{a} $\alpha(S)$ is a multiplicative subset of 
$R^\prime$. \AI{b} $$\alpha^*: S^{-1}R\to S^{\prime -1}R^\prime, \quad 
\frac{r}{s}\to \frac{\alpha(r)}{\alpha(s)}$$ is a well defined homomorphism. 
\AI{c} Suppose that $S^\prime=\alpha(S)$. Then
$$\ker \alpha^*=\{\frac{r}{s}\mid r\in R, s\in S, Sr\cap \ker 
\alpha\neq\emptyset\} \text{ and }  \alpha^*(S^{-1}R)=\alpha(S)^{-1} 
\alpha(R)$$ \end{itemize} \end{lemma} \proof (a) Just note that 
$\alpha(s)\alpha(t)=\alpha(st)$ for all $s,t\in S$.

(b) Note that $\phi_{S^\prime}(\alpha(s))$ is invertible. Hence $\alpha^*$ 
is nothing else as the homomorphism given by \ref{uringfrac} applied to 
the homomorphism:
$$\phi_{S^\prime}\circ\alpha: R\to S^{\prime-1}R^\prime$$

(c) Let $\frac{r}{s}\in\ker \alpha^*$.  As seen above this means 
$t^\prime\alpha(r)=0$ for some $t^\prime\in S^\prime$. By assumption 
$t^\prime=\alpha(t)$ for some $t\in T$. Thus $\frac{r}{s}=0$ if and only if 
$tr\in \ker \alpha$ for some $t\in S$. 

That $\alpha^*(S^{-1}R)=\alpha(S)^{-1} \alpha(R)$ is obvious.\qed

Back to the map $\phi^*$. By the previous lemma $\phi^*$ is a well defined 
homomorphism and onto. Let $\frac{r}{s}\in \ker \phi^*$. Then
 $tr\in \ker \phi$ for some  and $t\in S$. As $\ker \phi=R_S$, $\tilde t 
tr=0$ for some $\tilde t\in S$. Hence $r\in R_S$ and $\frac{r}{s}=0$. 
Therefore $\phi^*$ is one to one and so an isomorphism. 

Note also that $\phi(R)\cong R/R_S$. Let $\bar R=R/R_S$ and $\bar 
S=S+R_S/R_S$. As $\phi^*$ is an isomorphism we get
$$ S^{-1}R\cong \bar S^{-1}\bar R$$
We have $\bar R_{\bar S}=0$. So in some sense we can always reduce to the 
case where $S$ has no zero divisors. \medskip


In the next lemma we study the ideals in $S^{-1}R$. For $A\subset R$ and 
$T\subseteq S$ put $$T^{-1}A=\{ \frac{a}{t}\mid a\in A, t\in T\}$$

\begin{proposition}\l{idealfrac} Let $S$ be a multiplicative subset of the 
commutative ring $R$.
\begin{itemize}
\AI{a} If $I$ is an ideal in $R$ then $S^{-1}I$ is an ideal in $S^{-1}R$

\AI{b} If $J$ is an ideal in $R$ then $I=\phi_S^{-1}(J)$ is an ideal in $R$ 
with $J=S^{-1}I$.

\AI{c} The map $I\to S^{-1}I$ is a surjection from the set of ideals in $I$ 
to the set of ideals to $S^{-1}R$.

 \end{itemize} \end{proposition}

\proof Put $\phi=\phi_S$.

(a) is readily verified. 

(b) Inverse images of ideals are always ideals. To establish the second 
statement in (b) let $j=\frac{r}{s}\in J$. As $J$ is an ideal 
$$\frac{s^2}{s}\frac{r}{s}=\frac{rs^2}{s^2}=\frac{rs}{s}\in J$$
Thus $\phi(r)\in J$ and $r\in I$. So $j=\frac{r}{s}\in S^{-1}I$. 

Conversely, if $r\in I$ and $s\in S$ then since $\phi(r)\in J$ an d$J$ is 
an ideal:
 $$\frac{r}{s}=\frac{rs^2}{s^3}=\frac{s}{s^2}\frac{rs}{s}=
\frac{s}{s^2}\phi(r)\in \frac{s}{s^2}J\subseteq J $$
So (b) holds.

(c) follows from (a) and (b).\qed

If $R$ has an identity the previous proposition can be improved:

\begin{proposition}\l{idfraid} Let $R$ be a commutative ring with 
identity and $S$  a multiplicative subset $R$.
\begin{itemize}
\AI{a} Suppose $R$ has an identity. Let $I$ be an ideal in $R$. Then 
$$ \phi_S^{-1}(S^{-1}I)=\{ r\in R\mid Sr\cap I\neq \emptyset\}.$$
\AI{b)} Define an ideal $I$ in $R$ to be $S^{-1}$-closed if $r\in I$ for 
all $r\in R$ with $rS\cap I\neq \emptyset$.   Then 
$$\tau : I\to S^{-1}I$$ 
is a bijection between the $S^{-1}$-closed 
ideals and the ideals in $S^{-1}R$. The inverse map is given by 
$$\tau^{-1} : J\to \phi_S^{-1}J.$$

\AI{c} $I\cap S=\emptyset$ for all $S^{-1}$ closed ideals with $I\neq R$.
\AI{d}  A prime ideal $P$ in $R$ is $S^{-1}$ closed if an only if $P\cap 
S=\emptyset.$
\AI{e} $\tau$ induces a bijection between the $S^{-1}$ closed prime ideals 
in $R$ and the prime ideals in $S^{-1}R$.

\end{itemize}
\end{proposition}
\proof  (a) Let $r\in R$ then the following are equivalent:\smallskip

$\phi(r)\in S^{-1}I$.


$ \phi(r)=\frac{i}{s} \text{ for some }  i\in I, s\in S$

$\frac{r}{1}=\frac{i}{s}  \text{ for 
some }  i\in I, s\in S$

$t(rs-i)=0 \text{ for some } i\in I,s,t\in S$

$tsr=ti \text{ for some } i\in I,s,t\in S$

$sr\in I \text{ for some } s\in S$

$Sr\cap I\neq \emptyset$.\smallskip

So (a) holds.

We write $\phi$ for $\phi_S$ and say "closed" for $S^{-1}$ closed.

(b) follows from (a) and \ref{idealfrac}b,c.

(c)  Suppose $I$ is  closed and $s\in S\cap I$. Then $S^{-1}I$ 
contains the unit $\phi(s)$ and so $S^{-1}I=S^{-1}R$. Thus 
$I=\phi^{1}(S^{-1}R$ and $I=R$.


(d) Let $P$ be a prime ideal in $R$. Suppose that $S\cap P=\emptyset$ and 
let $r\in R$ and $s\in S$ with $rs\in P$. Then by \ref{basicprime}b, $r\in 
P$ or $s\in P$. By assumption $s\not \in P$ and so $r\in P$. Thus $P$ is 
 closed.  Conversely, if $P$ is closed, (c) implies $P\cap S=\emptyset$.
 
(e) Let $P$ be a closed prime ideal. We claim the $S^{-1}R$ is a prime 
ideal in $R$. First since $\tau$ is an bijection, $S^{-1}P\neq R$. Suppose 
that $\frac{r}{s}\frac{r^\prime}{s^\prime}\in S^{-1}P$. Then also 
$\phi(rr^\prime)\in S^{-1}P$. As $P$ is closed, $rr^\prime\in P$. As 
$P$ is prime we may assume $r\in P$. But then $\frac{r}{s}\in S^{-1}P$ and 
so $S^{-1}P$ is a prime.

Suppose next that $I$ is closed and $S^{-1}I$ is a prime. If $rr^\prime\in 
I$, then $\phi(r)\phi(r^\prime)\in S^{-1}I$. As $S^{-1}I$ is prime we may 
assume that $\phi(r)\in S^{-1}I$. As $I$ is closed this implies $r\in I$ 
and so $I$ is a prime ideal. \qed


Let $R$ be a commutative ring with identity. By \ref{basicprime} an ideal 
$P$ in $R$ is a prime ideal if and only if $R\setminus P$ is a 
multiplicative subset of $R$. Let $P$ be the prime ideal. The ring
$$R_P:=(R\setminus p)^{-1}R$$\index{$R_P$}
is called the \ei{localization} of $R$ at the prime $P$. For $A\subseteq R$ 
write $A_P$ for $(R\setminus p)^{-1}A$.

\begin{theorem}\l{localprimes} Let $P$ be a prime ideal in the commutative 
ring with identity $R$. 
\begin{itemize}
\AI{a} The map $Q\to Q_P$ is a bijection between the prime ideals of $R$ 
contained in $P$ and the prime ideals in $R_P$.
\AI{b} $P_P$ is the unique maximal ideal in $R_P$. $r\in R$ is a unit if 
and only if $r\not\in P_P$.
\end{itemize}
\end{theorem}
\proof  
(a) Put $S=R\setminus P$ and let $Q$ a prime ideal in $R$. Then $Q\cap 
S=\emptyset$ if and only if $Q\subset P$. Thus (a) follows from 
\ref{idfrais}.

(b) Let $I$ be a maximal ideal in $R_P$. Then by \ref{maximalprime} $I$ is 
prime ideal. Thus by (a) $I=Q_P$ for some $Q\subseteq P$. Thus $I\subseteq 
P_P$ and $I=P_P$. The statement about the units now follows from 
\ref{unitdivide}. 

Actually we could also have argued as follows: all elements in 
$R_P\setminus P_P$ are of the form $\frac{s}{s^\prime}$ and so invertible. 
Hence by \ref{unitdivide} $P_P$ is the unique maximal ideal in $R$.\qed


\begin{Def} A \ei{local ring} is a commutative ring with identity which as 
a unique maximal ideal.
\end{Def}


 Using \ref{unitdivide} we see 

\begin{lemma}\l{chlocal} Let $R$ be a commutative ring with identity. The 
the following are equivalent:
\begin{itemize}
\AI{a} $R$ is a local ring.
\AI{b} All the non-units are contained in an ideal $M\lneq R$.
\AI{c} All the non-units form an ideal. \qed
\end{itemize}
\end{lemma}

We finish this section with some examples.

Let $p$ be an prime integer. 
Then $\mb Z_{(p)}=\{ \frac{n}{m}\in \mb Q\mid p\nmid m\}$. Since $0$ and 
$(p)$ are the only prime ideals of $\mb Z$ contained in $(p)$, 
$O$ and $\frac{n}{m}\in \mb Q\mid p\nmid m, p\mid n\}$ are the only 
prime ideal  in $\mb Z_{(p)}$. What are the ideals? Every non zero ideal of 
$\mb Z$ is of the form $(t)$ for some $t\in \mb Z^+$. Write $t=ap^k$ with 
$p\nmid a$. Suppose $(t)$ is closed. As $a\in S=\mb Z\setminus (p)$ and 
$ap^k\in (t)$ we conclude that $p^k\in (t)$. Thus $a=1$ and $t=p^k$. It is 
easy to see that $(p^k)$ is indeed closed. 

So we conclude that the ideals in $\mb Z_{(p)}$ are 
$$ p^k\mb Z_{(p)}=\{ \frac{n}{m}\in \mb Q\mid p\nmid m, p^k\mid n\}$$
In particular $\mb Z_{(p)}$ is a PID.

We reader might have notice that in the above discussion $\mb Z$ can be 
replaced by any PID $R$, $p$ by any prime in $R$ and $\mb Q$ by $\mb F_R$. 





 






\section{Polynomials rings, power series and free rings }

Let $R$ be a ring and $(A,+)$ a group written additively. Since $(A,+)$ is 
a subgroup of the multiplicative group of $R$ it is convenient to the 
following "\ei{exponential notation}. Denote $a\in A$ be $x^a$ and define 
$x^ax^b=x^{a+b}$. The the elements in $R[A]$ can be uniquely written as 
$f=\sum_{a\in A} f_ax^a$ where $f_a\in R$, almost all $f_a=0$.
Also

$$fg=\sum_{a\in A}\sum_{b\in A}= f_af_bx^{a+b}=\sum_{c\in A} (\sum_{a+b=c} 
f_af_b)x^c$$




Let $R$ be a ring and $I$ a set. Put $\mb I=\bigoplus_{i\in I} \mb N$, the free
abelian monoid on $I$. The semigroup ring
 $$R[\mb I]. $$
is called the  \ei{polynomial ring}  over $R$ in the variables $I$ 
and is denoted by \ei{$R[I]$}

 We will use the above exponential notation. Let $i\in I$. Recall that 
$\phi_i(1)\in \mb I$ is defined as
$$(\rho_i(1))_j=\begin{cases} 1& \text{ if } i=j\\ 0 &\text{ if } i\neq 
j\end{cases}.$$
We write $x_i$ for $x^{\rho_i(1)}$. Let $\alpha\in\mb I$, then 
$\alpha$ is a tuple $(\alpha_i)_{i\in I}$, $\alpha_i\in \mb N$, where 
almost all $\alpha_i$ are zero. So $$x^\alpha=\prod_{i\in I} 
x_i^{\alpha_i}$$. Every element $f\in R[I]$ now can be uniquely written as 
$$ f= \sum_{\alpha\in \mb I} f_\alpha x^\alpha$$ where $f_\alpha\in R$ and 
almost all $f_\alpha$ are zero. The element of $R[I]$ are called 
\ei{polynomials}. Polynomials of the form $rx^\alpha$, with $r\neq 0$, are 
called \ei{monomials}.  As almost all $\alpha_i$ are zero 
$$rx^\alpha=rx_{i_1}^{\alpha_{i_1}}x_{i_2}^{\alpha_{i_2}}\ldots 
x_{i_n}^{\alpha_{i_n}}$$ for some $i_k\in I$.

The $f_\alpha x^\alpha$ with $f_\alpha\neq 0$ are called the monomials of 
$f$. So every polynomial is the sum of its monomials.

Note 
that the map $r\to rx^0$ is monomorphism. So we can and do identify  $r$ 
with $rx^0$.

If $I=\{1,2,\ldots m\}$ we also write $R[x_1,\ldots,x_m]$ for $R[I]$. 
Then every element in $R[x_1,\ldots, x_m]$ can be uniquely written as
$$\sum_{n_1=0}^\infty\sum_{n_2=0}^\infty \ldots \sum_{n_m=0}^\infty 
r_{n_1,\ldots,n_m} x_1^{n_1}x_2^{n_2}\ldots x_m^{n_m}$$

If $I$ has a unique element $i$ we write $x$ for $x_i$ and $R[x]$ for 
$R[I]$. Then each $f\in R[x]$ has the form $f=r_0+ r_1x+ 
r_2x^2+\ldots+r_nx^n$, where $n$ is maximal with repect to $r_n\neq 0$. 
$r_n$ is called the \ei{leading coeficient} of $f$ and $n$ the \ei{degree} 
of $f$,



Note that if $I$ happens to have the structure of a semigroup, the symbol $R[I]$ has a double
meaning, the polynomial ring or the semigroup ring. But this should not lead to any confusions.

If $y=(y_i, i\in I)$ is a family of pairwise commuting elements is some 
semigroup, and $\alpha\in \mb I$ we define 
$$y^\alpha=\prod_{i\in I} y_i^{\alpha_i}$$
Note that as almost all $\alpha_i$ are zero and the $y_i$ pairwise commute, 
this is well-defined.
Also if we view the symbol $x$ as the family $(x_i, i\in I)$, this 
is consistent with the $x^\alpha$ notation.

 
The polynomial ring has the following universal property:

\begin{proposition}\l{polev} Let $\Phi: R\to S$ be a ring homomorphism and 
$y=(y_i)_{i\in I}$ a family of elements in $S$ such that \begin{itemize} 
\AI{a} For all $r\in R$ and all $i\in I$ $$\Phi(r)y_i=y_i\Phi(r)$$ 
\AI{b} for all $i,j\in I$ $$y_iy_j=y_jy_i$$ \end{itemize}
 Then there exists 
a unique homomorphism $$\Phi_y: R[I]\to S;\quad \text{ with }  \quad 
rx_i\to \Phi(r)y_i \text{ for all } r\in R,i\in I.$$ Moreover, 
$$\Phi_y: \sum_{\alpha\in \mb I} f_\alpha x^\alpha\to 
\sum_{\alpha\in \mb I} \Phi(f_\alpha) y^\alpha .$$ 
\end{proposition} \proof As $\mb I$ is the free abelian monoid on $I$,  (b) implies
that there exists a unique homomorphism $\beta: \mb I\to (S,\cdot)$ with
$\alpha(x_i)=y_i$. The existence of $\Phi_y$ now follows from \ref{homgr}. The
uniqueness is obvious. \qed

The reader should notice  that the assumption  in the previous proposition are automatically
fulfilled if $S$ is commutative. So each $f\in R[I]$ gives rise to a function 
$f^\Phi: S^I\to S$ with $f^\Phi(y)=\Phi_y(f)$.

Example: Suppose $I=\{1,2,\ldots m\}$, $R=S$ is commutative and 
$\alpha=\id=\id_R$ and $$f=\sum r_{n_1,\ldots, n_m} x_1^{n_1}\ldots 
x_m^{n_m}$$ Then $$f^\id(y_1,\ldots,y_n)=\sum r_{n_1,\ldots,n_m} 
y_1^{n_1}\ldots y_m^{n_m}.$$ The reader should be careful not to confuse 
the polynomial $f$ with the function $f^\id$.  Indeed the following example 
shows that $f^\id$ can be  the zero function without $f$ being zero.

Let $R=\mb Z /p \mb Z$, $I={1}$, $p$ a prime integer,and
$$f=x(x-1)(x-1)\ldots (x-(p-1))$$
Then $f$ is a polynomial of degree $p$ in $(\mb Z/p \mb Z)[x]$. But $f^\id(y)=0$ for all $y\in \mb
Z/p \mb Z$.






\begin{lemma}\l{RIJ} Let $R$ be a ring and $I$ and$J$ disjoint sets. Then
there exists a unique isomorphism
$$ R[I][J]\to R[I\cup J] \text{ with } rx_i\to rx_i \text{ and } rx_j
\to rx_j$$ for all $r\in R,i\in I,j\in J$. 
\end{lemma} \proof  Use 
\ref{polev} to show the existence of such a homomorphism and its inverse. 
We leave the details to the reader. \qed



Let $R$ be a ring and $G$ a semigroup. In the definition of the semigroup 
ring $R[G]$ we had to use the direct sum rather than the direct product 
since otherwise the definition of the products of two elements would 
involve infinite sums. But suppose   $G$ has the
following property 
$$(FP) \quad |\{(a,b)\in G\times G\mid ab=g\}| \text{ is 
finite for all } g\in G.$$ Then we can define the \ei{power semigroup ring} 
of $G$ over $R$, \ei{$R[[G]]$}by

 $$(R[[G]],+)=(\prod_{g\in G} R,+)$$ 
 and
 $$(r_g)_{g\in G}\cdot (s_g)_{g\in G}=(  \sum_{(h,k)\in G\times G\mid hk=g} 
r_hs_k)_{g\in G}$$

If $G$ is a group then it fulfills $(FP)$ if and only if $G$ is finite. 
So we do not get anything new. But there are lots of infinite semigroups 
with ($FP$). For example $G=\mb N$.  $R[[\mb N]]$ is isomorphic to $R[[x]]$ the
ring of formal power series. Other semigroups with $(FP)$ are the free 
(abelian) monoids (or semigroups) over a set  \medskip

Let $I$ be a set. Then the power semigroup ring 
$$R[[\bigoplus_{i\in I} \mb N]]$$
is called the ring of \ei{formal power series} over $R$ in the variables 
$I$ and is denoted by $R[[I]]$.  The elements of $R[[I]]$ are called 
formal power  series.  We use the same exponential notation as for the 
ring of polynomials. Every formal power series can be uniquely written as a 
formal sum 
$$f=\sum_{\alpha\in \mb I} f_\alpha x^\alpha$$
Here $f_\alpha\in R$. But in contrast to the polynomials we do not require 
that almost all $f_\alpha$ are zero.

If $I=\{1\}$ the formal power series have the form:
$$f=\sum_{n=0}^\infty f_nx^n=f_0+f_1x+f_2x^2\ldots f_nx^n\ldots$$
with $f_n\in R$.
Note that there does not exist an analog for \ref{polev} for formal power 
series, since the definition of $\Phi_y(f)$ involves an infinite sum. 

\begin{lemma}\l{invpower} Let $R$ be ring with identity and $f\in R[[x]]$.
\begin{itemize}
\AI{a} $f$ is a unit  if and only if $f_0$ is.
\AI{b} If $R$ is commutative and $f_0$ is irreducible, then $f$ is 
irreducible.
\end{itemize}
\end{lemma}
\proof (a) Note that $(fg)_0=f_0g_0$ and $1_0=1$ so if $f$ is a unit so is 
$f_0$. Suppose now that $f_0$ is a unit.
We define $g\in R[[x]]$ by defining its coefficients inductively as follows
$g_0=f_0^{-1}$ and for $n>0$, 

$$  g_n=-f_0^{-1} \sum{i=0}^{n-1} f_{n-i}g_{i}$$.
Note that this just says $\sum_{i=0}^n f_{n-i}g_i=0$ for all $n>0$.
Hence $fg=1$. Similarly $f$ has  a left inverse $h$ 
by\ref{basicmonoid} $g=h$ is a left inverses.

(b) Suppose that $f=gh$. Then $f_0=g_0h_0$. So as $f_0$ is irreducible, 
one of $g_0,f_0$ is a unit. Hence by (a) $g$ or $h$ is a unit.\qed

As an example we see that $1-x$ is a unit in $R[[x]]$. Indeed

$$(1-x)^{-1}=1+x+x^2+x^3+\ldots.$$


\begin{lemma}\l{fdpow} Let $\mb D$ be a division ring. 
\begin{itemize} 
\AI{a}$(x)=\{ f\in \mb D[[x]]\mid f_0=0\}$ 
\AI{b} The elements of $(x)$ are exactly the non-units of $\mb D[[x]]$.
\AI{c} Let $I$ be a left ideal in $\mb D[[x]]$. Then $I=x^k\mb 
D[[x]]=(x^k)$ for some $k\in \mb N$. \AI{d} Every left ideal in $\mb 
D[[x]]$ is a right ideal and $\mb D[[x]]$ is a principal ideal ring. \AI{e} 
$(x)$ is the unique maximal ideal in $\mb D[[x]]$. \AI{f} If $\mb D$ is a 
field, $\mb D[[x]]$ is a $PID$ and a local ring. \end{itemize} \end{lemma} 
\proof (a) is obvious and (b) follows from \ref{invpower}.

(c) Let $k\in {\mb N}$ be minimal with $x^k\in I$. Let $f\in I$ and let $n$ 
be minimal with $f_n\neq 0$. Then $f=x^ng$ for some $g\in \mb D[[x]]$ with 
$g_0\neq 0$. Hence $g$ is unit and $x^n=g^{-1}f\in I$. So $k\leq n$ and 
$f=(x^{n-k}g)x^k\in \mb D[[x]] x^k=(x^k)$. Thus $I=(x^k)$.

(d),(e) and (f) follow immediately  form (c).

\section{Factorizations in polynomial rings}

Let $R$ be a ring and $I$ a set and $f\in R[I]$. 
We define  the degree function
 $$\deg: R[I]\to \mb N \cup \{-\infty\}$$
as follows :
\begin{itemize}
\AI{a} if $f$ is a monomial $rx^\alpha$, then $\deg f=\sum_{i\in I} \alpha_i$,

\AI{b} if $f\neq 0$ then $\deg f$ is the maximum of the degrees of its 
monomials.

\AI{c} if $f=0$ then $\deg f=-\infty$
\end{itemize}

Sometimes it will be convenient to talk about the degree $\deg_J f$ with 
respect to subset of $J$ of $I$. This is defined as above, only that 
$$\deg_J(rx^\alpha)=\sum_{j\in J} \alpha_j$$ Alternatively, $\deg_Jf $ is 
the degree of $f$ as a polynomial  in $R^\prime[J]$, where 
$R^\prime=R[I\setminus J]$.

A polynomial is called \ei{homogeneous} if all its monomials have the same 
degree. Let $f\in R[X]$ then $f$ can be uniquely written as   
$$ f=\sum_{i=0}^\infty h(f,i)$$
where $h(f,i)$ is zero or  a homogenous polynomial of degree $i$. Note here 
that almost all $h(f,i)$ are zero. Let $h(f)=h(f,\deg f)$.

\begin{lemma}\l{basdeg} Let $R$ be a ring, $I$ a set and 
$f,g\in R[I]$. \begin{itemize} \AI{a} $\deg (f+g)\leq \max(\deg f,\deg g)$ 
with equality unless $h(g)=-h(f)$. \AI{b} If $f$ and $g$ are homogeneous, 
then $fg$ is homogeneous. Also either $\deg(fg)=\deg(f)+\deg(g)$ or $fg=0$. 
\AI{c} $h(fg)=h(f)h(g)$ unless $h(f)h(g)=0$. \AI{d} $R[I]$ has no zero 
divisors if and only if $R$ has no zero divisors. \AI{e} $\deg fg \leq \deg 
f+\deg g$ with equality if $R$ has no zero divisors. \end{itemize} 
\end{lemma} \proof (a),(b) and (c) are readily verified.

(d) If $R$ has zero divisors, then as $R$ is embedded in $R[I]$, $R[I]$ has 
zero divisors.

Suppose next that $R$ has no zero divisors. Let $f,g\in R[I]^\#$. We need to 
show that $fg\neq 0$. By (c) we may assume that $f$ and $g$ are 
homogeneous.

 Consider first the case that $|I|=1$. Then $f=ax^n$, $g=bx^m$ and 
$fg=(ab)x^{n+m}$. Here $a,b\in R^\#$ and so $ab\neq 0$. Thus also 
$fg\neq 0$. 
If $I$ is finite, $R[I]=R[I\setminus\{i\}][i]$ and so by induction $R[I]$ 
has no zero divisors.

For the general case just observe that $f,g\in R[J]$ for some finite 
subset $J$ of $I$.

(e) If $R$ has no zero divisors, (d) implies $h(f)h(g)\neq 0$. Thus by (b) 
and (c),
$$\deg f=\deg h(fg)=\deg h(f)h(g)=\deg h(f)+\deg h(g)=\deg f+\deg g.$$\qed

\begin{lemma}\l{RP} Let $R$ be a ring, $P$ an ideal in $R$ and $I$ a set.
\begin{itemize}
\AI{a} Let $P[I]=\{ f\in R[I]\mid f_\alpha\in P \text{ for all } \alpha\in 
\mb I\}$. Then $P[I]$ is an ideal in $R[I]$ and
    $$R[I]/P[I]\cong (R/P)[I]$$
\AI{b} If $R$ has an identity, $P[I]=P\cdot R[I]$ is the ideal in $R[I]$ 
generated by $P$.
\end{itemize}
\end{lemma}
\proof (a)  Define $\phi: R[I]\to (R/P)[I], \sum_{\alpha\in \mb I} f_\alpha 
x^\alpha \to \sum_{\alpha\in \mb I} (f_\alpha+P) x^\alpha $.
By \ref{polev} $\phi$ is a ring homomorphism. Clearly $\phi$ is onto and 
$\ker \phi=P[I]$ so (a) holds.

(b) Let $p\in P$ then $px^\alpha\in P\cdot R[I]$. Thus $P[I]\leq P\cdot 
R[I]$. The other inclusion is obvious.\qed

\begin{corollary}\l{pstay} Let $R$ be a commutative ring with identity, $I$ 
a set and $p\in R$. Then $p$ is  a prime in $R$ if and only if $p$ is a 
prime in $R[I]$.
\end{corollary}
\proof $R$ is a prime if and only if $R/pR$ is an integral domain. So by 
\ref{basdeg}d if and only if $(R/pR)[I]$ is an integral domain. So by 
\ref{RP} if and only if $R[I]/pR[I]$ is a prime ideal and so if and only if 
$p$ is a prime in $R[I]$.\qed

\begin{theorem}[Long Divison]\l{lngdiv} Let $R$ be a ring and $f,g\in 
R[x]$. Suppose that the leading coefficient of $g$ is a unit in $R$. Then 
there exist uniquely determined $q,r\in R$ with $$f=qg+r \text{ and } \deg 
r<\deg g$$ \end{theorem}\proof Let $h(f)=ax^n$ and $h(g)=bx^m$. If $n<m$, 
we conclude that $q=0$   and $r=f$ is the unique solution.

So suppose that $m\leq n$. Then any solution necessarily has 
$h(f)=h(q)h(g)$ and so $s(q)=ab^{-1}x^{n-m}$. Now $f=qg-r$ if and only if

$$f-ab^{-1}x^{n-m}g= (q-ab^{-1}x^{n-m})g+r$$
So uniqueness and existence follows by induction on $\deg f$.\qed


Let $R$ be a ring  and $f\in R[x]$. Define the function

$$f^r: R\to R , c \to\sum_{\alpha\in \mb N} f_\alpha c^\alpha$$

The function $f^r$ is called the \ei{right evaluation } of $f$. Note here that as
$R$ is not necessarily  commutative , $f_\alpha c^\alpha$ might differ from
$c^\alpha f^\alpha$.  If $R$ is commutative $f^r=f^\id$. 

The map $f\to f^r$ is an additive homomorphism but not necessarily a
multiplicative homomorphism. That  is we might have
$(fg)^r(c)\neq f^r(c)g^r(c)$. Indeed let $f=rx$ and $g=sx$. Then  
$fg=(rs)x^2$, $(fg)^r(c)=rsc^2$ and $f^r(c)g^r(c)=rcsc$.

\begin{lemma}\l{fgfg} Let $R$ be a ring, $f,g\in R[x]$ and $c\in R$. If
$g^r(c)c=cg^r(c)$ then $$(fg)^r(c)=f^r(c)g^r(c).$$
\end{lemma}
\proof  As $f\to f^r$ is a additive homomorphism we may assume that $f=rx^m$
for some $r\in R$, $m\in \mb N$. Thus

$$fg=\sum_{\alpha\in \mb N} rg_\alpha x^{\alpha+m}$$ and so

$$(fg)^r(c)=\sum_{\alpha\in \mb N} rg_\alpha c^{\alpha+m}=$$
$$=r(\sum_{\alpha\in \mb N} g_\alpha c^{\alpha} )c^m=
rg^r(c)c^m=rc^mg^r(c)=f^r(c)g^r(c)$$\qed

\begin{corollary}\l{xmc} Let $R$ be a ring with identity, $c\in R$ and 
$f\in R[x]$. 
\begin{itemize}
\AI{a} Then there exists a unique $q\in R[x]$ with $$ 
f=q(x-c)+f^r(c).$$
\AI{b} $f^r(c)=0$ if and only if $f=q(x-c)$ for some $q\in R[x]$.
\end{itemize}
\end{corollary} \proof 
(a) By\ref{lngdiv} $f=q\cdot(x-c)+r$ with 
$\deg r<\deg (x-c)=1$. Thus $r\in R$.  By \ref{fgfg} 
$$f^r(c)=q^r(c)(c-c)+r=r$$
Hence $r=f^r(c)$. The uniqueness  follows from \ref{lngdiv}

(b) follows from (a).\qed

\begin{corollary}\l{xmcp} Let $R$ be an commutative ring with identity and 
$c\in R$. \begin{itemize} 
 \AI{a} $R[x]/(x-c)\cong R$.
  \AI{b} $x-c$ is a prime if and 
only $R$ is an integral domain. \end{itemize} \end{corollary} \proof

 
 (a) Consider the ring homomorphism $\id_c: R[x]\to R, f\to f(c)$ 
(see \ref{polev} Clearly $\id_c$ is onto. By \ref{xmc}b $ \ker 
\id_c=(x-c)$ so (b) follows from the Isomorphism Theorem for rings.

(b) Note that $x-c$ is a prime if and only if $R[x]/(x-c)$ has non-zero 
divisors. Thus (b) follows from (a).\qed

\begin{corollary} Let $\mb F$ be a field. Then $\mb F[x]$ is an Euclidean 
domain. In particular, $\mb F[x]$ is a PID and a UFD. The units in $\mb 
F[x]$ are precisely the nonzero elements in $\mb F$.
\end{corollary}
\proof Just note that by \ref{lngdiv} $\mb K[x]$ is a Euclidean domain.\qed

Let $R$ be a subring of the commutative ring $S$. Write $R\to S$ for the 
inclusion map from $R$ to $S$. Let $I$ be a set, $f\in R[I]$ and  $c\in 
S^I$. We say that $c$ is a \ei{root} of $f$ if
$$f^{R\to S}(c)=0.$$

Let $R$ be any ring, $f\in R[x]$ and $c\in R$. We say that $c$ is a root of 
$f$ if $f^r(c)=0$. Note that for $R$ commutative this agrees with previous 
definition of a root for $f$ in $R$.

\begin{theorem}\l{sroots} Let $D$ be an integral domain contained in the 
integral domain $E$. Let $0\neq f\in D[x]$. Let $m\in \mb N$ be maximal so 
that there exists $c_1,\ldots c_m\in E$ with $$\prod_{i=1}^m x-c_i  \quad 
\mid\quad f$$ in $E[x]$. Let $c$ be any root of $f$ in $E$. Then $c=c_i$ 
for some $i$. In particular, $f$ has at most $\deg f$ distinct roots in 
$E$. \end{theorem} \proof Let $f= g\prod_{i=1}^m x-c_i$ with $g\in E[x]$. 
By maximality of $m$, $x-c\nmid g$. By \ref{ xmcp} $x-c$ is a prime in 
$E[x]$ and so $$x-c\mid \prod_{i=1}^m x-c_i$$ By \ref{uniquefactor}, 
$x-c\sim x-c_i$ for some $i$. Thus $x-c=x-c_i$ and $c=c_i$.\qed


We remark that the previus theorem can be false for non-commuative divison 
rings. For example the polynomial $x^2+1=0$ has six roots in the division 
ring $\mb H$ of quaternions, namely $\pm i, \pm j, \pm k$.


Let $R$ be a ring,  $f\in R[x]$ and  $c$ b a root 
of $f$ in $D$. Then by \ref{sroots} We can write $f$ has $f=g(x-c)^m$ with 
$m\in \mb Z^+$, $g\in R[x]$ and so that $c$ is not a root of $g$.  $m$ is 
called the \ei{multiplicity} of the root $g$. If $m\geq 2$ we say that  $c$ 
is a \ei{multiple root}

As a tool to detect multiple roots we introduce the formal  \ei{derivative} 
$f^\prime$ of a polynomial $f\in R[x]$.
$$f^\prime:=\sum_{\alpha\in \mb Z^+} nf_\alpha x^{\alpha-1}$$
Put $f^{[0]}=f$ and inductively,  $f^{[k+1]}=(f^{[k]})^\prime$ for all 
$k\in \mb N$.

 \begin{lemma}\l{diru} Let $R$ be a ring,  $f,g\in R[x]$  and $c\in 
R$. Then \begin{itemize} \AI{a} $(cf)^\prime=cf^\prime$ \AI{b} 
$(f+g)^\prime=f^\prime+g^\prime$. \AI{c} $(fg)^\prime=f^\prime 
g+fg^\prime$. \AI{d} If $ff^\prime=f^\prime f$, 
$(f^n)^\prime=nf^{n-1}f^\prime$. \end{itemize} \end{lemma} \proof (a) and 
(b) are obvious.

(c) By (b) we may assume that $f=rx^m$ and $g=sx^n$ are monomials.
We compute

$$(fg)^\prime= (rsx^{n+m})^\prime=(n+m)rsx^{n+m-1}$$
$$f^\prime g+ fg^\prime=mrx^{m-1}sx^n+ rx^mnsx^{n-1}=(n+m)rsx^{m+n-1}$$
Thus (c) holds.

(d) follows from (c) and induction on $n$.\qed


\begin{lemma}\l{mroots} Let $R$ be a ring with identity, $f\in R[x]$ and 
$c\in R$ a root of $f$. \begin{itemize} \AI{a} Suppose that $f=g(x-c)^n$ 
for some $n\in \mb N$ and $g\in R[x]$. Then $$f^{[n]}(c)=n!g(c).$$ \AI{b} 
$c$ is a multiple root of $f$ if and only if $f^\prime(c)=0$. \AI{c}  
Suppose that $(\deg f)!$ is neither zero nor a zero divisor in $R$. Then 
the multiplicity of  the root $c$ is smallest number $m\in \mb N$ with 
$f^{[m]}(c)\neq 0$. \end{itemize} \end{lemma} \proof (a) We will show  that 
for all $0\leq i\leq n$, there exists $h_i\in R[x]$ with $$ 
f^{[i]}=\frac{n!}{(n-i)!}g(x-c)^{n-i} +h_i(x-c)^{n-i+1}$$ For $i=0$ this is 
true with $h_0=0$. So suppose its true for $i$. Then using \ref{diru}

 $$f^{[i+1]}=(f^{[i]})^\prime= \frac{n!}{(n-i)!}(g^\prime (x-c)^{n-i}+ 
g(n-i)(x-c)^{n-i-1})+ h_i^\prime (x-c)^{n-i+1}+ h_i(n-i+1)x^{n-i}$$
This is of the form $\frac{n!}{(n-i-1)!}g(x-c)^{n-i-1}$ plus a left multiple 
of $(x-c)^{n-i}$. So the statements holds for $i+1$.

For $i=n$ we conclude $f^{[n]}=n!g+ h_n(x-a)$ Thus (a) holds.

(b) Since $c$ is a root, $f=g(x-a)$ for some $g\in R[x]$. So by (a) applied 
to $n=1$, $f^\prime(c)=g(c)$. Thus (b) holds.

(c) Let  $m$ the multiplicity of $c$ has a root of $f$. So 
$f=g(x-c)^m$ for some $g\in R[x]$ with $g(c)\neq 0$. 
Let $n<m$. Then $f=(g(x-c)^{m-n})(x-c)^n$ and (a) implies $f^{[n]}(c)=0$.
Suppose that $f^{[m]}(c)=0$. Then by (a), $m!g(c)=0$. As $m\leq\deg f$ we 
get $(\deg f)!\, g(c)=0$. Thus by assumption $g(c)=0$, a contradiction.
This $f^{[m]}(c)\neq 0$ and (c) holds.\qed


Consider the polynomial $x^p$ in $\mb Z/p \mb Z[x]$. Then $(x^p)^\prime= 
px^{p-1}=0$. This shows that the condition on $(\deg f)!$ in part (c) of 
the previous theorem is necessary.








Let $D$ be an UFD, $I$ a set  and $f\in D[I]$. We say that $f$ is 
\ei{primitive} if $1$ is a greatest common divisor of the coefficents of 
$f$.

\begin{lemma}\l{cont} Let $D$ be a UFD, $\mb F$ its field of fractions and 
$I$ a set. Let $f\in \mb F[I]$. Then there exists $a_f,b_f\in D$ and 
$f^*\in \mb D[I]$ so that \begin{itemize} \AI{a} $f^*$ is primitive in 
$D[I]$. \AI{b} $a_f$ and $b_f$ are relatively prime. \AI{c} 
$f=\frac{a_f}{b_f}f^*$. \end{itemize} Moreover $a_f,b_f$ and $f^*$ are 
unique up to associates in $D$.
 \end{lemma}
 \proof We will first show the existence. Let $f=\sum_{\alpha\in\mb 
I} f_\alpha x^\alpha$ with $f_\alpha\in \mb F$. Then 
$f_\alpha=\frac{r_\alpha}{s_\alpha}$ with $r_\alpha,s_\alpha\in D$. Here we 
choose $s_\alpha=1$ if $f_\alpha=0$. Let $s=\prod_{\alpha\in\mb I} 
s_\alpha$. Then $sf\in D[I]$. Let $r=\gcd_{\alpha\in\mb I} sf_\alpha$ and 
$f^*=r^{-1}sf$.  Then $f^*\in D[I]$, $f^*$ is primitive and 
$f=\frac{r}{s}f^*$. Let $e$ the a greates common divisor of $r$ and $s$ and 
put $a_f=\frac{r}{e}$ and $b_f=\frac{s}{e}$. Then (a),(b) and (c) hold.

To show uniqueness suppose that $f=\frac{a}{b}\tilde f$ with $a,b\in D$ 
relative prime and $\tilde f\in D[I]$ primitive. Then

$$ba_f^*=b_fa\tilde f$$
Taking the gretaes common divisor of the coefficents on each side of this 
equation we see that $ba_f$ and $b_fa$ are associate in $D$. In particular, 
$a$ divides $ba_f$ and as $b$ is realtively prime to $a$, $a$ divides 
$a_f$. By symmetry $a_f$ divides $a$ and so $a=ua_f$ for some unit $u$ in 
$D$. Similarly $b=vb_f$ for some  unit $v\in D$. Thus 
$vb_fa_ff^*=ub_fa_f\tilde f$. As $D$ is an integral domain we conclude 
$\tilde f= u^{-1}vf^*$.\qed

Let $f$ be as in the previuos theorem. The fraction $c_f=\frac{a_f}{b_f}$ 
is called the content of $f$. Note that $c_f\in \mb F$ and $f=c_ff^*$.

 


 \begin{lemma}\l{cont} Let $D$ be a UFD, $\mb F$ its field of 
fraction, $I$ a set and $f,g\in \mb F[I]^\#$. \begin{itemize} \AI{a} 
$c_{fg}= uc_fc_g$ for some unit $u\in D$.
 \AI{b}$(fg)^*=u^{-1} f^*g^*$ 
 \AI{c}  
The product of primitive polynomials is primitive. \AI{d} If $f\mid g$ in 
$\mb F[I]$, then $f^*\mid g^*$ in $D[I]$. \AI{e} Suppose $f$ is primitive. 
Then $f$ is irreducible in $D[I]$ if and only if its irreducible in $\mb F 
[I]$ \AI{f} Suppose  $f$ is primitive.Then  $f$ is a prime in $D[I]$ if and 
only if it is a prime in $\mb F[I]$. \end{itemize} \end{lemma}
 \proof  Note that $fg=c_fc_gf^*g^*$. So (a), (b) and (c) will follow once 
the show that the product of two primitive polynomials is primitive. 
Suppose not. Then there exist  primitive $f,g\in D[I]$ and a prime $p$ in 
$D$ dividing all the coefficients of $fg$. But then $p\mid fg$ in $D[I]$. 
By \ref{pstay} $p$ is prime in $D[I]$ and so $p$ divides $f$ or $g$ in 
$D[I]$. A contradiction as $f$ and $g$ are primitive.

(d) Suppose that $f\mid g$. Then $g=fh$ for some $h\in \mb F[I]$. By (b) 
$g^*=f^*h^*$ and so (d) holds.

(e) Suppose that $f$ is irreducible in $\mb F[I]$ and $f=gh$ with $g,h\in 
D[x]$ Then by (a) both $g$ and $h$ are primitive. On the other hand since 
$f$ is irreducible in $\mb F[I]$, one of $g$ or $h$ is a unit in $F[I]$ and 
so in $\mb F$. It follows that one of $g$ and $h$ is a unit in $D$. So $f$ 
is also irreducible in $D[I]$.

 Suppose that $f$ is irreducible in $D[I]$ and $f=gh$ for some $g,h\in 
\mb F[x]$. Then $f=f^*\sim g^*h^*$ and as $f$ is irreducible in $D[I]$, one 
of $g^*,h^*$ is a unit in $D$. But then one of $g$ and $h$ is in $\mb F$ 
and so a unit in $\mb F[I]$.

(f) Suppose that $f$ is prime in $D[I]$ and that $f\mid gh$ in $\mb F[I]$.
By (d) $f=f^*\mid g^*h^*$ and as $f$ is a prime in $D[I]$ we may assume 
$f\mid g^*$. As $g^*$ divides $g$ in $F[I]$ $f$ does too. So $f$ is a prime 
in $F[I]$.

Suppose that $f$ is a prime in $F[I]$ and $f\mid gh$ in $D[I]$ for some 
$g,h\in D[I]$. Then as $f$ is a prime in $F[I]$ we may assume that $f\mid 
g$ in $F[I]$. But (d) $f=f^*\mid g^*$ in $D[I]$. As $g^*$ divides $g$ in 
$D[I]$, $f$ does too . So $f$ is a prime in $D[I]$.\qed




\begin{theorem}\l{DXUFD} Let $D$ be a UFD and $I$ a set, then $D[I]$ is a 
$UFD$.
\end{theorem}
\proof 


Let $f$ be in $D[I]$. We need to show that $f$ is the product of primes. 
Now $f\in D[J]$ for some finite $f$ and by \ref{pstay} a prime 
factorization in $D[J]$ is a prime factorization in $D[I]$. So we may 
assume that $J$ is finite and then by induction that $|I|=1$.

Note that $f=c_ff^*$ with $f^*\in D[x]$ primitive and $c_f\in D$. As $D$ is 
a $UFD$, $c_f$ is a product of primes in $D$ and by\ref{pstay} also a 
prodcut of primes in $D[x]$. So we may assume that $f$ is primitive. 
Suppose that $f=gh$ with $g,h\in D[x]$ with neither $g$ nor $h$ a unit. As 
$f$ is primitive, $g$ and $h$ both have positive degree smaller than $f$. 
So by induction on $\deg f$ both $g$ and $h$ are a product of primes. So we 
may assume that $f$ is irreducible. Let $\mb F=\mb F_D$.  By \ref{cont} $f$ 
is irreducible in $\mb F[x]$. As $\mb F[x]$ is Euclidean, $f$ is a prime in 
$\mb F[x]$. Hence by \ref{cont} $f$ is a prime in $D[x]$. \qed

 








\chapter{Modules}
\section{Modules and  Homomorphism}

In this section we introduce modules over a ring.  It  corresponds to the 
concept of group action in the theory of groups.

\begin{Def} Let  $R$ be a  ring. A (left) $R$-\ei{module}s is an abelian group $M$
together with a function 
$$ R\times M\to M,\quad   (r,m)\to rm$$
such that for all $r,s\in R$ and $a,b\in M$:
\begin{itemize}
\AI{Ma}  $r(a+b)=ra+rb$.
\AI{Mb}  $(r+s)a=ra+sa$.
\AI{Mc}  $r(sa)=(rs)a$.
\end{itemize}
\end{Def}

Given a ring $R$ and an abelian group $M$.   $M$ is an $R$-modules if and only if
there exists a ring homomorphism $\Phi: R\to  \End(M)$.

Indeed if  $M$ is an $R$-modules define $\Phi: R\to \End(M)$ by 
$$ \Phi(r)(m)=rm$$
By $(Ma)$, $\Phi(r)$ is indeed an homomorphism. And $(Mb)$ and $(Mc)$ imply 
that $\Phi$ is a ring homomorphism.

Conversely, given a ring  homomorphism $\Phi: R\to \End(M)$, define $rm=\Phi(r)m$.
Then $M$ is a $R$-module.

Analogue to a module we can define a right $R$-module via a function $M\times R\to
R$ fulfilling the appropriate conditions. It is then easy to verify that a right modules for
$R$ is nothing else as a left modules for $R^\op$. In particular, for commutative ring left
and right modules are the same.

Every abelian group $M$ is a $\mb Z$ -module via $(n,m)\to nm$. Indeed this is the
only way $M$ becomes a $\mb Z$ module under the additional assumption that
$1m=m$.

\begin{Def} Let $R$ be a ring with identity and $M$ a $R$-modules.
\begin{itemize} 
\AI{a}  $M$ is a \ei{unitary} $R$-module provide that
$$ 1m=m$$
for all $m\in M$.
\AI{b} If $R$ is a division ring and $M$ is unitary then $M$ is called a vector space
over $R$.
\end{itemize}
\end{Def}

{\bf Examples:}

  If $M$ is an abelian group then $M$ is a module for $\End(M)$ via $\phi m=\phi(m)$.

If $R$ is a ring and $I$ is an  left ideal then $I$ and $R/I$ are $R$-modules by left
multiplication.

If $S$ is a subring of $R$ then $R$ is an $S$-module via left 
multiplication.

Direct sums and direct products of $R$-modules are $R$ modules. In particular,
if  $\Omega$ is a set, then $R^\Omega$ is a $R$-module via
$(rf)(\omega)=rf(\omega)$. Or  $r(s_\omega)=(rs_\omega)$.

Let $R$ is a ring and $G$ a semigroup. Suppose that $G$ act on a set $\Omega$. Then 
$R^\omega$ is an $R[G]$ modules. To see this we first define an action of 
$G$ on $R^\Omega$ by $$(gf)(\omega)=f(g^{-1}\omega)$$ Then extend this to 
$R[G]$ by $$ (\sum_{g\in G} r_gg)f=\sum_{g\in G} r_ggf$$

\begin{Def} Let $V$ and $W$ be $R$-modules. An $R$-module homomorphism from
$V$ to $W$ is a function:
$$f: V\to W$$
such that
$$ f(a+c)=f(a)+f(c) \text{  and }f(ra)=rf(a)$$
for all $a,c\in R, r\in R$.
\end{Def}

We often will say that $f:V\to W$ is $R$-\ei{linear} instead of  $f:V\to W$ is a
$R$-modules homomorphism.   Terms like $R$-module
monomorphism, $R$-module isomorphism, $\ker f$ and so on are defined in the usual
way.  If $V$ and $W$ are $R$-modules, $\Hom_R(V,W)$ denotes the set of 
$R$-linear maps from $V$ to $W$. Since  sums of $R$-linear maps are 
$R$-linear, $\Hom_R(V,W)$ is an ablian group. $\End_R(V)$ denotes set of 
$R$-linear endomorphsims of $V$. Since compositions of $R$-linear maps are 
$R$-linear, $\End_R(V)$ is a ring. Note that $V$ is also a module for 
$\End_R(V)$ via $\phi v=\phi(v)$.


\begin{Def} Let $R$ be a ring and $M$ a $R$-module. An  
$R$-\ei{submodule} $A$ of $M$ is an additive subgroup $A$ of $M$ such that 
$ra\in A$ for all $r\in R,a\in A$. \end{Def}

Note that submodules of modules are modules. If the modules is unitary so 
is the submodule.  If $V$ is a submodules of $M$, then $M/V$ is a 
$R$-module  by $$r( m+V)=rm+V$$ It is easy to verify that this gives a 
well-defined module structure. Also the map $$ M\to M/V,\, m\to m+V$$ is 
$R$-linear, is onto and has kernel $V$.

If $f:V\to W$ is $R$-linear, then $\ker f$ is a submodule of $V$ and $f(V)$ is a
submodules of $W$.  

\begin{theorem}[Isomorphism Theorem for Modules]\l{IMT} Let $R$ be a ring 
and $f:V\to W$ and $R$-linear map. Then $$\bar{f}: V/W\to f(W), v+W\to 
f(v)$$ is a well-defined $R$-linear isomorphism. \end{theorem} \proof  By 
the isomorphism theorem for groups \ref{IT}, this is a well defined 
isomorphism of (additive) groups.  We just need to check that it is 
$R$-linear. So let $r$ and $v\in V$. Then $$\bar{f}(r(v+W))=\bar 
f(rv+W)=f(rv)=rf(v)=r\bar f(v+W)$$\qed


Let $M$ an $R$-module and $S\subseteq R$ and $X\subset M$. 
$$SX=\langle sx\mid s\in S,x\in X\rangle$$
that is the additive subgroup of $M$ generated by the $sx, s\in S,x\in X$.
Note that for all $X\subseteq M$, $RM$ is a submodule of $M$.

Let $T\subseteq R$. Recall that $ST=\langle st\mid s\in S,t\in T\rangle$.
Note that this agrees with the above definition of $SX$, when we view $T$ 
is a subset of the $R$-module $R$. It is easy to verify that
$$(ST)X=S(TX)=\langle stx\mid s\in S,t\in T,x\in X\rangle$$
Here we wrote $stx$ for $(st)x=s(tx)$. 


 Define the 
submodule $(X)$ of $M$ generated by $R$ as the intersection of all the 
$R$-submodules of $M$ containing $X$. Note $(X)=M+RM$ and if $M$ 
is unitary $(X)=RM$.

For $X\subset M$ define the \ei{annihilator} of $R$ in $X$ as
$$\Ann_R(X)=\{r\in R\mid rX=\{0\}\}$$
For $S\subseteq R$  define
$$\Ann_M(S)=\{m\in M\mid Sm=\{0\}\}$$


\begin{lemma}\l{bann} Let $R$ be ring, $M$ a $R$-module and $X\subseteq 
M$. 
Then \begin{itemize}
\AI{a} $\Ann_R(X)$ is a left ideal in $R$.
 \AI{b} Let $I$ be a right ideal in $R$. Then $\Ann_M(I)$ is $R$-submodule 
in $M$.
 \AI{c} Suppose that one of the following holds:
 \begin{itemize}
 \NI{1} $R$ is commutative.
 \NI{2} All left ideals in $R$ are also right ideals.
 \NI{3} $\Ann_R(X)$ is a right ideal.
 \end{itemize}
 Then  $\Ann_R(X)=\Ann_R((X))$. 
 \AI{d} Let $m\in M$. Then the map $$R/\Ann_R(m)\to 
Rm, r\to rm$$ is a well defined $R$-isomorphism. \end{itemize} \end{lemma} 
(a) Let $r,s\in \Ann_R(X)$, $t\in R$ and $x\in X$. Then

$$ (r+s)x=rx+sx=0 \text{ and } (ts)x=t(sx)=0$$
So $\Ann_R(X)$ is a left ideal in $R$.

(b) 
$$ I(R\Ann_M(I))=(IR)\Ann_M(I)\subseteq I\Ann_M(I)=\{0\}.$$
Thus $R\Ann_M(I)\leq \Ann_M(I)$ and (b) holds.

(c) Note that 1. implies 2. and by (a) 2. implies 3. So in any case 
 $\Ann_R(X)$ is a right ideal in $R$. Hence by (b) 
$$W:=\Ann_M(\Ann_R(X))$$ is an $R$-submodule. Since $X\subseteq W$  we get 
$(X)\leq W$. Thus $\Ann_R(X)$ annihilates $(X)$. So $$\Ann_R(X)\leq 
\Ann_R((X)).$$ The other inclusion is obvious.

(d) Consider the map 
$$f: R\to M,\quad r\to rm.$$
Clearly $f$ is $\mb Z$-linear. Also for $r,s\in R$
 $$ f(rs)=(rs)m=r(sm)=rf(s)$$
 So $f$ is $R$-linear. 
Since $\Ann_R(m)=\ker f$, (d) follows from the isomorphism theorem. \qed

{\bf Example} Let $\mb K$ be a field. Let $R={\cal M}_\mb K(n)$ be the ring 
of $n\times n$ matrices over $\mb K$. Then $\mb K^n$ is a module  for 
$R$  via   $(m_{ij})(k_i)= (\sum_{j=1}^n m_{ij}k_j)$. Let 
$e_1=(e_{1i})\in K^n$ be defined by $e_{11}=1$ and $e_{1i}=0$ for all 
$2\leq i\leq n$. Then $\Ann_R(e_1)$ consists of all matrices whose first 
column is zero. Note that $(e_1)=Re_1=K^n$, indeed if $k\in K^n$ and $M$ is 
any matrix with $k$ as it first column, then $Me_1=k$ and so $k\in Re_1$. 
Hence $\Ann_R((e_1))=0$ and $\Ann_R(e_1)\neq \Ann_R((e_1))$. So the 
conclusion in part (c) of the previuos lemma does not hold in general.

\section{Exact Sequences}

\begin{Def}\l{dexact}
A (finite or infinite) \ei{sequence} of $R$-linear maps
$$   \ldots \s{f_{i-2}}{\longrightarrow} A_{i-2}\s{f_{i-1}}{\longrightarrow}
 A_{i-1}\s{f_{i}}{\longrightarrow} A_{i}\s{f_{i+1}}{\longrightarrow}
 A_{i+1}\s{f_{i+2}}{\longrightarrow} \ldots$$
is called \ei{exact} if for all suitable $j\in\mb Z$
$$\Im f_j=\ker f_{j+1}$$
\end{Def} 

We denote the zero $R$-module with $0$. Then for all $R$-modules $M$ there 
exists unique $R$-linear maps, $0\to M$ and $M\to 0$.

The sequence
$$0\to A\s{f}{\longrightarrow}B$$
is and only if $f$ is one to one.
$$A\s{f}{\longrightarrow} B\to 0$$
is exact if and only if $f$ is onto. 
$$0\to A\s{f}{\longrightarrow}B\to 0$$
is exact if and only if $f$ is an isomorphism.

A sequence of the form
$$0\to A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C\to 0$$
is called a short sequence. If it is exact we have that $f$ is one to one,
$\ker g=\Im f$ and $g$ is onto. Since $f$ is one to one we have $\Im f\cong 
A$ and so $\ker g\cong A$. Since $g$ is onto the isomorphisms theorem says
$B/\ker g\cong C$. So the short exact sequence tells us that $B$ has a 
submodule which isomorphic to $A$ and whose quotient is isomorphic to $C$.


Given two exact sequences  
$${\cal A}:\, \s{f_{i-1}}{\longrightarrow}
 A_{i-1}\s{f_{i}}{\longrightarrow} A_{i}\s{f_{i+1}}{\longrightarrow} \text{ 
and } {\cal B}:\, \s{g_{i-1}}{\longrightarrow} 
B_{i-1}\s{g_{i}}{\longrightarrow} B_{i}\s{g_{i+1}}{\longrightarrow} $$
 A \ei{homomorphism} of exact sequences $\varphi:{\cal A}\to {\cal B}$ is a 
tuple of $R$-linear maps $(h_i: A_i\to B_i)$ so that the diagram 
$$\begin{CD} @>{f_{i-1}}>> A_{i-1} @>{f_{i}}>> A_i@>f_{i+1}>> 
A_{i+1}@>{f_{i+2}}>>\\ @. @VV{h_{i-1}}V       @VV{h_{i}}V     
@VV{h_{i+1}}V\\ @>{g_{i-1}}>> B_{i-1} @>{g_{i}}>> B_i@>f_{i+1}>> 
B_{i+1}@>{g_{i+2}}>> \end{CD}$$ commutes. $\id_{\cal A}: {\cal A}\to {\cal 
A}$ is defined as $(\id_{A_i})$. 
$\varphi$ is called as isomorphism if there exists $\vartheta: {\cal B}\to
{\cal A}$ with $\vartheta\varphi=\id_{\alpha}$ and 
$\varphi\vartheta=\id_{\cal B}$. It is an easy exercise to show that 
$\varphi$ is an isomorphism  and if and only if each $h_i$ is.



\begin{theorem}[Short Five Lemma]\l{five} Given a homomorphism of short 
exact sequences:
$$\begin{CD}0 @>>> A @>f>> B @>g>> C@>>>0\\ 
@. @VV\alpha V @VV\beta V @VV\gamma V \\
0 @>>> A^\prime @>{f^\prime}>> B^\prime @>{g^\prime}>> 
C^\prime @>>>0\end{CD}$$
Then
\begin{itemize}
\AI{a} If $\alpha$ and $\gamma$ are one to one, so is $\beta$.
\AI{b} If $\alpha$ and $\gamma$ are onto, so is $\beta$.
\AI{c} If $\alpha$ and $\gamma$ are isomorphisms, so is $\beta$.
\end{itemize}
\end{theorem}
\proof (a) Let $b\in B$ with $\beta(b)=0$. Then also $g^\prime(\beta(b))=0$ 
and as the diagram commutes $\gamma(g(b))=0$. As $\gamma$ is one to one 
$g(b)=0$. As $\ker g=\Im f$, $b=f(a)$ for some $a\in A$. Thus 
$\beta(f(a))=0$ and so $f^\prime(\alpha(a))=0$. As $f^\prime$ is one to one,
$\alpha(a)=0$. As $\alpha$ is one to one, $a=0$. So $b=f(a)=0$ and $\beta$ 
is one to one.

(b) Let $b^\prime\in B^\prime$. As $\gamma$ and $g$ are onto, so is 
$\gamma\circ g$. So there exists $b\in B$ with  
$g^\prime(b^\prime)=\gamma(g(b))$. 
As the diagram commutes $\gamma(g(b))=g^\prime(\beta(b))$. Thus 
$d:=b^\prime-\beta(b)\in \ker g^\prime$.
As $\ker g^\prime=\Im f^\prime$ and $\alpha$ is onto, $\ker g^\prime=\Im 
(f^\prime\circ \alpha)$. So $d=f^\prime(\alpha(a))$ for some $a\in A$. As 
the diagram commutes, $d=\beta(f(a))$. 
So

$$b^\prime-\beta(b)=d=\beta(f(a))$$
Hence $b^\prime=\beta(b+f(a))$ and $\beta$ is onto.

(c) follows directly from (a) and (b).\qed

\begin{theorem}\l{split} Given a short exact sequence
$0\to A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C\to 0$.
 Then the following three statements are equivalent:
\begin{itemize}
\AI{a} There exists a $R$-linear map $\gamma: C\to B$ with $g\circ 
\gamma=\id_C$.
\AI{b} There exists a $R$-linear map $\eta: B\to A$ with $\eta\circ 
f=\id_A$.
\AI{c} There exists $\tau: B\to A\oplus C$ so that 
 $$\begin{CD}0 @>>> A @>f>> B @>g>> C@>>>0\\ @. \Big\Arrowvert @. 
@VV\tau V \Big\Arrowvert @.  \\ 0 @>>> A @>\rho_1>> A\bigoplus C @>\pi_2>> C 
@>>>0\end{CD}$$ is an isomorphism of short exact sequences. \end{itemize} 
\end{theorem} \proof (a)$\Rightarrow$ (c) Consider

$$\begin{CD} 0 @>>> A @>\rho_1>> A\bigoplus C @>\pi_2>> C @>>>0\\ 
@. \Big\Arrowvert @. @VV(f,\gamma)V \Big\Arrowvert @.  \\
 0 @>>> A @>f>> B @>g>> C@>>>0 \end{CD}$$
Here $(f,\gamma): A\oplus C\to B, (a,c)\to f(a)+\gamma(c)$.
It is readily verified that this is a homomorphism.
The Short Five Lemma \ref{five} implies that is an isomorphism.

(b)$\Rightarrow$ (c) This time consider
 $$\begin{CD}0 @>>> A @>f>> B @>g>> C@>>>0\\ @.\Big\Arrowvert @.
@VV(\eta,g)V \Big\Arrowvert @. \\ 0 @>>> A @>\rho_1>> A\bigoplus C @>\pi_2>> 
C @>>>0\end{CD}$$

(c)$\Rightarrow$ (a)\& (b)  Define $\eta=\pi_1\circ\tau$ and 
$\gamma=\tau^{-1}\rho_2$.
Then 
$$\eta\circ f=\pi_1\circ (\tau\circ f)=\pi_1\circ \rho_1=\id_A$$
and 
$$g\circ \gamma =(g\circ \tau^{-1})\circ \rho_2= 
\pi_1\circ\rho_2=\id_C$$\qed

An exact sequence which fulfills the three equivalent conditions in the 
previous theorem is called \ei{split}.\smallskip

To make the last two theorems a little more transparent we will restate 
them in an alternative way. First note that any short exact sequence can be 
viewed as pair of $R$ modules $D\leq M$. Indeed, given $D\leq M$ we 
obtain a short exact sequence



$$\begin{CD} 0 @>>> D @>>> M@>>> M/D @>>> 0\end{CD}$$
Here $D\to M$ is the inclusion map and $M\to M/D$ is the canonical 
epimorphism. Conversely, every short exact sequence is isomorphic to one of 
this kind:

$$\begin{CD}0 @>>> A @>f>> B @>g>> C@>>>0\\ 
@. @VVfV \Big\Arrowvert @. @VV{\bar g^{-1}}V \\
0 @>>> \Im f @>>> B @>>>  B/\Im f @>>> 0 \end{CD}$$


Secondly define a homomorphism $\Phi: ( A\leq B) \to 
(A^\prime\leq B^\prime)$ to be a homomorphism $\Phi: B\to B^\prime$ with 
$\Phi(A)\leq A^\prime$

Such a $\Phi$ corresponds to the following homomorphism of short exact 
sequences:

$$\begin{CD}0 @>>> A @>>> B @>>> B/A@>>>0\\ 
@. @VV\Phi_A V @VV{\Phi}V @VV\Phi_{B/A}V\\
0 @>>> A^\prime @>>> B^\prime @>>>  B^\prime/A^\prime @>>> 0\end{CD}$$
Here $\Phi_A: A\to A^\prime: a\to \Phi(a)$ and $\Phi_{B/A}: B/A\to 
B^\prime/A^\prime: b+A\to \Phi(b)+A^\prime$.
Since $\Phi(A)\leq A^\prime$ both of these maps are well defined.

Lets translate the Five Lemma into this language:

\begin{lemma}\l{five"} Let $\Phi: (A\leq B)\to (A^\prime\leq B^\prime)$ be a 
homomorphism.
\begin{itemize}
\AI{a} If $\Phi_A$ and $\Phi_{B/A}$ are one to one, so is $\Phi$.
\AI{b} If $\Phi_A$ and $\Phi_{B/A}$ are onto so is $\Phi$.
\AI{c} If $\Phi_A$ and $\Phi_{B/A}$ are isomorphism, so is $\Phi$.
\end{itemize}
\end{lemma}
\proof This follows from the five lemma, but we provide a second proof.

(a) As $\ker \Phi_{B/A}=0$, $\ker \Phi\leq A$. So $\ker \Phi=\ker \Phi_A=0$.

(b) As $\Phi_{B/A}$ is onto, $B^\prime=\Phi(B)+A^\prime$. As 
$\Phi(A)=A^\prime$ we conclude $B^\prime=\Phi(B)$.

(c) Follows from (a) and (b).\qed

The three conditions on split exact sequences translate into:

\begin{lemma}\l{split"} Given a pair of $R$-modules $A\leq B$. The following three 
conditions are equivalent. \begin{itemize} \AI{a} There exists a 
homomorphism $\gamma: B/A\to B$ with $\bar{b} =\gamma(\bar{b})+A$ for all 
$\bar{b}\in B$. \AI{b} There exists a homomorphism $\eta: B\to A$ with 
$\eta(a)=a$ for all $a\in A$. \AI{c} There exists a $R$-submodule $K$ of 
$B$ with $B=A\bigoplus K$. \end{itemize} \end{lemma} \proof Again this 
follows from \ref{split} but we give a second proof:

(a)$\Rightarrow$ (c):  Put $K=\gamma(B/A)$. Then clearly $K+A=B$. Also if 
$\gamma(b+A)\in A$ we get $b+A=A=0_{B/A}$. Thus $\gamma(b+A)=0$ and $K\cap 
A=0$.

(b)$\Rightarrow$ (c)  Put $K=\ker \eta$. The clearly $K\cap A=0$. Also if 
$b\in B$. Then $\eta(b)\in A$ and $\eta(b-\eta(b))=\eta(b)-\eta(b)=0$. Thus 
$b=\eta(b)+(b-\eta(b))\in A+B$. Thus $B=A+K$.

(c) $\Rightarrow$ (a): Define $\gamma(k+A)=k$ for all $k\in K$.

(c) $\Rightarrow$ (b): Define $\eta(a+k)=a$ for all $a\in A, k\in K$\qed

Finally if $A$ is a $R$-submodule of $B$ we say that $B$ splits over $A$ if 
the equivalent conditions in the previous lemma hold.

\section{Projective and injective modules}

In this section all rings are assumed to have an identity and all 
$R$-modules are assumed to by unitary.

We write $\phi: A\onto B$  if $\phi: A\to B$ is onto. And $\phi: A\into 
B$ if $\phi$ is one to one.

\begin{Def} Let $P$ be a module over the ring $R$. We say that $P$ is 
projective provided that
\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(0,40){$P$}

\put(30,40){$A$}
\put(15,23){$B$}
\put(3,39){\vector(1,-1){12}}
\put(30,39){\vector(-1,-1){11}}
\put(20,29){\vector(-1,-1){2}}
\put(4.6,31.2){$\beta$}
\put(25,31.2){$\alpha$}
\put(40,31){$\Longrightarrow$}
 
\put(50,40){$P$}
\put(54,41.3){\vector(1,0){25}}
\put(66,42.5){$\gamma$}
\put(80,40){$A$}
\put(65,23){$B$}
\put(53,39){\vector(1,-1){12}}
\put(80,39){\vector(-1,-1){11}}
\put(70,29){\vector(-1,-1){2}}
\put(54.6,31.2){$\beta$}
\put(75,31.2){$\alpha$}
\end{picture}$$
where both diagrams are commutative.

\end{Def}


  Let $I$ be a set and $R$ a ring. Then the \ei{free module} $F_R(I)$ on 
$I$ over is the module $\bigoplus_{i\in I} R$. We will usually write 
$F(I)$ for $F_R(I)$. We identify $i$ with $\rho_i(1)$. Hence 
$F_R(I)=\bigoplus_{i\in I} Ri$.

\begin{lemma}\l{universalfree} Let $M$ be an $R$-module and
$(m_i,i\in I)$ a family of elements in $M$. Then there exists a unique 
homomorphism 
$$\alpha: F_R(I)\to M\text{ with } i\to m_i.$$
$\alpha$ is given by  $\alpha(\sum_{i\in I} r_ii)=\sum_{i\in I} r_im_i$.
\end{lemma}
\proof Obvious.





\begin{lemma}\l{freeproj} Any free module is projective.  
\end{lemma}
\proof Given $\alpha: A\onto B$ and $\beta: F_R(I)\to B$. Let $i\in I$. 
Since $\alpha$ is onto, $\beta(i)=\alpha(a_i)$ for some $a_i\in A$. By 
\ref{universalfree} there exists $\gamma: F_R(I)\to A$ with 
$\gamma(i)=a_i$. Then $$\alpha(\gamma(i)=\alpha(a_i)=\beta(i).$$ So by the 
uniqueness assertion in \ref{universalfree}, $\alpha\circ 
\gamma=\beta$.\qed

Let $A$ and $B$ be $R$-modules. We say that $A$ is a \ei{direct summand} of 
$B$ if $A\leq B$ and $B=A\oplus C$ for some $C\leq B$.

Note that if $A$ is a direct summand of $B$ and $B$ is direct summand of 
$C$ then $A$ is a direct summand of $C$. Also if $A_i$ is a direct summand 
of $B_i$, then $\bigoplus_{i\in I} A_i$ is a direct summand of 
$\bigoplus_{i\in I} B_i$.

\begin{lemma}\l{dsproj} Any direct summand of a projective module is 
projective. \end{lemma} 
\proof

 \parbox{3.5in}{Let $P$ be  projective and
$P=P_1\bigoplus  P_2$ for some submodules $P_i$ of $P$. We need to show that $P_1$
is  projective. Given $\alpha: A\onto B$ and $\beta: P_1\to B$. Since $P$ is 
projective there exists $\tilde \gamma: P\to A$ with $$\alpha\circ \tilde 
\gamma= \beta\circ \pi_1$$ Put $\gamma=\tilde \gamma \rho_1$. Then 
$$\alpha\circ \gamma=\alpha\circ\tilde \gamma\circ \rho_1= \beta\circ \pi_1 
\circ \rho_1=\beta$$} \ \quad \
\parbox{2in}{
\setlength{\unitlength}{1mm}
$$\begin{picture}(40,30)(0,25)

\put(15,57){$P$}
\put(13,55){\vector(-1,-1){11}}
\put(4,43){\vector(1,1){11}}
\put(18,55){\vector(1,-1){11}}
\put(0,40){$P_1$}
\put(4,41.3){\vector(1,0){25}}
\put(24,50){$\tilde \gamma$}
\put(2,49.5){$\pi_1$}
\put(11, 47){$\rho_1$}
\put(30,40){$A$}
\put(15,23){$B$}
\put(14,38){$\gamma$}
\put(3,39){\vector(1,-1){12}}
\put(30,39){\vector(-1,-1){11}}
\put(20,29){\vector(-1,-1){2}}
\put(3,31.2){$\beta$}
\put(25,31.2){$\alpha$}
\end{picture}$$}

\qed



\begin{theorem}\l{chproj}  Let $P$ be a module over the ring $R$. Then the 
following are equivalent:
\begin{itemize}
\AI{a} $P$ is projective.
\AI{b} Every shot exact sequence
 $0\to A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}P\to 0$ splits.
\AI{c} $P$ is (isomorphic to) a direct summand of a free module.
\end{itemize}
\end{theorem}
\proof
(a)$\Rightarrow$ (b):  Since $P$ is projective we have
\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(0,40){$P$}
\put(4,41.3){\vector(1,0){25}}
\put(16,42.5){$\gamma$}
\put(30,40){$B$}
\put(15,23){$P$}
\put(3,39){\vector(1,-1){12}}
\put(30,39){\vector(-1,-1){11}}
\put(20,29){\vector(-1,-1){2}}
\put(3,31.2){$\id_P$}
\put(25,31.2){$g$}
\end{picture}$$
So the exact sequence is split by \ref{split}a.

(b) $\Rightarrow$ (c):  Note that  $P$ is the quotient of some free module 
$F$. But then by (b) and \ref{split}c, $P$ is isomorphic to a direct 
summand of $F$.

(c)$\Rightarrow$ (a): Follows from \ref{freeproj} and \ref{dsproj}\qed

\begin{corollary} Direct sums of projective modules are projective.
\end{corollary}
\proof Follows from \ref{chproj}c.


Next we will dualize the concept of projective modules.  

\begin{Def} A module $J$ for the ring $R$ is called \ei{injective} if 
\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(0,40){$J$}

\put(30,40){$A$}
\put(15,23){$B$}
\put(15,27){\vector(-1,1){12}}
\put(19,27.5){\vector(1,1){11}}
\put(19,27.5){\line(-1,0){2}}
\put(19,27.5){\line(0,-1){2}}

\put(4.6,31.2){$\beta$}
\put(25,31.2){$\alpha$}
\put(40,31){$\Longrightarrow$}
 
\put(50,40){$J$}
\put(79,41.3){\vector(-1,0){25}}
\put(66,42.5){$\gamma$}
\put(80,40){$A$}
\put(65,23){$B$}
\put(65,27){\vector(-1,1){12}}
\put(69,27.5){\vector(1,1){11}}
\put(69,27.5){\line(-1,0){2}}
\put(69,27.5){\line(0,-1){2}}
\put(54.6,31.2){$\beta$}
\put(75,31.2){$\alpha$}
\end{picture}$$
where both diagrams are commutative.
\end{Def}


Above we  showed that free modules are projective and so 
 every module is the quotient of a projective module. 
To dualize this our first goal is to find a class of injective  
$R$-modules so that   every $R$-modules is embedded into a member of 
the class. We do this into step steps: First we find injective modules for 
$R=\mb Z$. Then we use those to define injective modules for an arbitrary 
ring ( with identity).

To get started we prove the following lemma, which makes it easier to 
verify that a given module is injective.

\begin{lemma}\l{ezinj} Let $J$ be a module over the ring $R$. Then $J$ is 
injective if and only if for all left ideals $I$ in $R$: 
$$\begin{picture}(50,20)(0,25) \put(0,40){$J$}

\put(30,40){$R$}
\put(15,23){$I$}
\put(15,27){\vector(-1,1){12}}
\put(19,27.5){\vector(1,1){11}}
\put(19,27.5){\line(-1,0){2}}
\put(19,27.5){\line(0,-1){2}}

\put(4.6,31.2){$\beta$}

\put(40,31){$\Longrightarrow$}
 
\put(50,40){$J$}
\put(79,41.3){\vector(-1,0){25}}
\put(66,42.5){$\gamma$}
\put(80,40){$R$}
\put(65,23){$I$}
\put(65,27){\vector(-1,1){12}}
\put(69,27.5){\vector(1,1){11}}
\put(69,27.5){\line(-1,0){2}}
\put(69,27.5){\line(0,-1){2}}
\put(54.6,31.2){$\beta$}

\end{picture}$$
where both diagrams are commutative.
\end{lemma}
\proof Given $\alpha: B\into A$ and $\beta: B\to J$, we need to find 
$\gamma: B\to J$ with $\beta=\gamma\alpha$. Without loss, $B\leq A$ and 
$\alpha$ is the inclusion map. $\beta=\gamma\alpha$ now just means 
$\gamma\mid_B=\beta$.

That is we are trying to extend $\beta$ to $A$. We will use Zorn's lemma 
find a maximal extension of $\beta$. Indeed let 
$${\cal M}=\{ \delta: D\to J\mid   B\leq D\leq A, \delta\mid_B=\beta\}$$
Order ${\cal M}$ by $\delta_1\leq \delta_2$ if 
$$D_1\subseteq D_2  \text{ and } \delta_2\mid_{D_1}=\delta_1$$
We claim that every chain $\{\delta_i: D_i\to J \mid i\in I\}$ in ${\cal M}$ has an upper
bound. Let $D=\bigcup_{i\in I} D_i$ and defone $\delta: D\to J$ by
$\delta(d)=\delta_i(d)$ if $d\in D_i$ for some $i\in I$. It is easy to verify that $\delta$ is
well defined, $\delta\in {\cal M}$ and $\delta$ is an upper bound for ${\\delta_i: D_i\to J
\mid i\in I}$.

Hence  by Zorn's  lemma, ${\cal M}$ has a maximal element $\delta: D\to J$.

The reader might have noticed that we did not use our assumptions on $J$ 
yet. Maximal extensions always exists.

Suppose that $D\neq B$ and pick $b\in B\setminus D$.

Consider the $R$-linear map:
$$\mu:  D\oplus R\to A ,\quad  (d,r)\to d+rb$$
Let $I$ be the projection of $\ker \mu$ onto $D$. Then as $\ker 
\mu$ is a submodule of $D\oplus R$, $I$ is a submodule of $R$, that is a 
left ideal.  Moreover, $\ker\mu=\{(-ib,i)\mid i\in I$ and $I$ consists of 
all $r\in R$ with $rb\in D$.
Consider the map $\xi : I\to J, i\to \delta(ib))$.
By assumption $\xi$ can be extended to a map
$$\xi : R\to J \text{ with } \xi(i)=\delta(ib).$$
Define $\Xi : D\oplus R\to J, (d,r)\to \delta(d)+\xi(r)$.
Then $\Xi$ is $R$-linear. Also $\Xi(-ib,i)=-\delta(ib)+\xi(i)=
-\delta(ib)+\delta(ib)=0$. Hence $\ker\mu\leq \ker \Xi$ and we obtain a 
$R$-linear map 
$$\bar \Xi:   (D\bigoplus R)/\ker \mu \to J.$$
So by the Isomorphism Theorem we conclude that
$$D+Rb\to J,\quad d+rb\to \delta(d)+\xi(r)$$
is a well defined $R$-linear map. Clearly its contained in ${\cal M}$,
a contradiction to the maximal choice of $\delta$.

Thus $D=B$ and $J$ is injective. The other direction of the lemma is 
obvious.\qed

\begin{lemma} \l{hrmr}  Let $R$ be a ring and $M$ an $R$-module. Then
$$\Delta:\,  \Hom_R(R,M)\to M,\, \phi\to \phi(1)$$
is a $\mb Z$-isomorphism.
\end{lemma}
\proof Clearly $\Delta$ is $\mb Z$-linear. To show that $\Delta$ is an bijective we will
find an inverse. Let $m\in M$. Define
$$\Gamma(m): \,R\to M, \, r\to rm$$.
The claim that $\Gamma(m)$ is $R$-linear. Indeed its $\mb Z$-linear and 
$$\Gamma(m)(sr)=(sr)m=s(rm)$$
for all $s,t\in R$. So $\Gamma(m)\in \Hom_R(R,M)$. Also
$$\Delta(\Gamma(m))=\Gamma(m)(1)=1m=m$$
and for $\phi\in \Hom_R(R,M)$,
$$(\Gamma(\Delta(\phi))(r)=r\Delta(\phi)=r\phi(1)=\phi(r1)=\phi(r)$$
So $\Gamma(\Delta(\phi))=\phi$ and $\Gamma$ is the inverse of $\Delta$.\qed

 Let $R$ be an integral domain. We say that the $R$-module 
 $M$ is \ei{divisible} if $rM=M$ for all 
$r\in R^\#$. 
Note that every quotient of a divisible module is divisible. Also direct 
sums and direct summand of divisible modules are divisible

If $R$ is divisible as an $R$-modules if and only if $R$ is a field.
The field of fraction, $\mb F_R$ is divisible as an $R$-module.

\begin{lemma}\l{divinj} Let $R$ be an integral domain and  $M$ an 
$R$-module. \begin{itemize} \AI{a}  If $M$ is injective, then $M$ is 
divisible. \AI{b} If $R$ is a PID, $M$ is injective if and only of $M$ is 
divisible. \end{itemize} \end{lemma} 
\proof (a) Let $0\neq t\in R$ and 
$m\in M$ Consider the map $$Rt\to M, rt\to rm$$ As $I$ is an integral 
domain this is  well defined and
$R$-linear. As
$M$ is injective this  homomorphism can be extended to a homomorphism $\gamma: R\to
M$. Then 
$t\gamma(1)=\gamma(t1)=\gamma(t)=m$. Thus $m\in tR$ and $R=tR$ so $M$ is 
divisible.

(b) Suppose that $M$ is divisible. Let $I$ be a ideal in $R$ and $\beta: 
I\to M$ a $R$-linear map. As $R$ is a PID, $I=Rr$ for some $t\in R$. As $M$ 
is divisible, $\beta(t)=tm$ for some $m\in M$. Define
$$\gamma: R\to M, r\to rm$$
Then $\gamma$ is $R$-linear and $\gamma(rt)=rtm=\beta(rt)$. 
We showed that the condition of \ref{ezinj} are fulfilled. So $M$ is 
injective.\qed

\begin{proposition}\l{exinj} Let $R$ be a integral domain.
\begin{itemize}
\AI{a} Every $R$ module can be embedded into an divisible $R$-module.
\AI{b} If $R$ is a $PID$, then every $R$-module can be embedded into a 
injective module. \end{itemize} \end{proposition} \proof  (a) Let $M$ a $R$ 
module. Then $$M\cong A/B$$ where $A=\bigoplus_{i\in I} R$for some set $I$ 
and $B$ is a submodule of $A$.  Let $D=\bigoplus_{i\in I} \mb F_R$. Then 
$D$ is divisible and $B\leq A\leq D$. Also $D/B$ is divisible and $A/B$ is 
a submodule of $D/B$ isomorphic to $M$.

(b) follows from (a) and \ref{divinj}.\qed

An abelian group $A$ is called \ei{divisible} if it is divisible as $\mb 
Z$-module. 

Let $R$ be a ring and $A,B$ and $T$ be $R$-modules. Let $\phi: A\to B$ be $R$-linear.
Then the maps
$$\phi^*: \,\Hom_R(B,T)\to \Hom_R(A,T), \,  f\to f\circ \phi$$
and
$$\check \phi:\, \Hom_R(A,T) \to \Hom_R(B,T),\, f\to \phi\circ f$$
are $\mb Z$ linear. Suppose that $\psi: B\to C$ is $R$-linear. Then

$$\check{(\psi\circ \phi)}=\check{\phi}\circ\check {\psi} \text{ and }
(\phi\circ \psi)^* =\psi^*\circ \phi^*.$$


\begin{lemma}\l{exinjR} Let $R$ be a ring, $M$ a $R$-module, $D$ a right 
$R$-module and $A$ an abelian group. \begin{itemize}
 \AI{a} $\Hom_{\mb 
Z}(D,A)$ is an $R$-module via $r\phi(d)=\phi(dr)$. 
\AI{b}  
The map $$\Xi=\Xi(M,A): \Hom_R(M,\Hom_{\mb Z}(R,A))\to \Hom_{\mb
Z}(M,A),\quad 
\Xi(\Phi)(m)=\Phi(m)(1)$$ is an $\mb Z$-isomorphism. 
\AI{c} $\Xi(M,A)$ depends naturally on $M$ and $A$. That is 
\begin{itemize}
\AI{ca} Let $\beta: A\to B$ be $\mb Z$-linear. Then the following diagram is
commutative:
$$\begin{CD} 
\Hom_R(M,\Hom_{\mb Z}(R,A)) @>\Xi(M,A)>> \Hom_{\mb Z}(M,A)\\
@VV\check{\check{\beta}}V @VV\check{\beta}V\\
\Hom_R(M,\Hom_{\mb Z}(R,B)) @>\Xi(M,B)>>\Hom_{\mb Z}(M,B)
\end{CD}$$
That is $\Xi(\check{\beta}\circ \Phi)=\beta\circ \Xi(\Phi)$ for all $\Phi\in
\Hom_R(M,\Hom_\mb Z(R,A))$.
\AI{cb}Let $\eta: M\to N$ be $R$-linear. Then the following diagram is
commutative:
$$\begin{CD} 
\Hom_R(M,\Hom_{\mb Z}(R,A)) @>\Xi(M,A)>> \Hom_{\mb Z}(M,A)\\
@AA\eta^{*}A @AA\eta^*A\\
\Hom_R(N,\Hom_{\mb Z}(R,A)) @>\Xi(N,A)>>\Hom_{\mb Z}(N,A)
\end{CD}$$
That is $\Xi(\Psi)\circ \eta= \Xi(\Psi\circ \eta)$ for all $\Psi\in \Hom_R(N,\Hom_\mb
Z(R,A))$.
\end{itemize}
\AI{d} If $A$ is 
divisible, $\Hom_{\mb Z}(R,A)$ is an injective $R$-module. \end{itemize} 
\end{lemma} \proof (a) Let $r,s\in R$, $\phi,\psi\in \Hom_{\mb Z}(D,A)$ 
and $d,e\in D$. 
$$(r\phi)(d+e)=\phi((d+e)r)=\phi(dr+er)=\phi(dr)+\phi(er)= 
(r\phi)(d)+(r\phi)(e)$$ Thus $r\phi\in \Hom_{\mb Z}(D,A)$. 
$$(r(\phi+\psi))(d)=(\phi+\psi)(dr)=\phi(dr)+\psi(dr)=(r\phi+r\psi)(d)$$ $$ 
( ( r +s)\phi)(d)=\phi(d(r+s))=\phi(dr)+\phi(ds)=(r\phi+s\phi)(d)$$ 
$$((rs)\phi)(d)=\phi(d(rs))=\phi((dr)s)=(s\phi)(dr)=(r(s\phi))(d)$$ So 
$\Hom_{\mb Z}(D,A)$ is indeed a $R$-module.



(b) Clearly $\Xi$ is $\mb Z$-linear. Suppose that $\Xi(\Phi)=0$.
Then $\Phi(m)(1)=0$ for all $m\in M$. Let $r\in R$. Then
$$0=\Phi(rm)(1)=(r\Phi(m))(1)=(\Phi(m))(1r))=\Phi(m)(r)$$
Thus $\Phi(m)(r)=0$ for all $r$. So $\Phi(m)=0$ for all $m$ and so $\Phi=0$.
So $\Xi$ is on to one.

To show that $\Xi$ is onto, let $\alpha\in \Hom_{\mb Z}(M,A)$.

Define $\Phi\in \Hom_R(M,\Hom_{\mb Z}(R,A))$ by
$$\Phi(m)(r)=\alpha(rm)$$
Clearly $\Phi(m)$ is indeed in $\Hom_{\mb Z}(R,A)$. 
We need to verify that $\Phi$ is $R$-linear. Let $s\in R$. Then
$(Phi(sm))(r)=\alpha(rsm)$ and $(s\Phi(m))(r)=\Phi(m)(rs)=\alpha(rsm)$. So 
$\Phi(sm)=s\Phi(m)$ and $\Phi$ is $R$-linear.

Also
$$(\Xi(\Phi)(m)=(\Phi(m))(1)=\alpha(1m)=\alpha(m)$$
and so $\Xi(\Phi)=\alpha$ and $\Xi$ is onto.

(ca)  $$(\check{\beta}\circ \Xi)(\Phi)(m)=\beta( \Xi(\Phi)(m))=\beta(\Phi(m)(1))$$
and 
$$(\Xi \circ \check{\check{\beta}})(\Phi)(m)=\check{\check{\beta}}(\Phi))(m)(1)=(\check
\beta(\Phi(m))(1)=\beta(\Phi(m)(1)).$$


(cb) Let $\Psi\in \Hom_R(N,\Hom_{\mb Z}(R,A))$. Then

$$(\eta^*\circ \Xi)(\Psi)(m)= \eta^*(\Xi(\Psi))(m)=\Xi(\Psi)(\eta(m)=\Psi(\eta(m))(1)$$
and
$$ (\Xi\circ \eta^*)(\Psi)(m)=\Xi(\eta^*(\Psi))(m)=(\eta^*(\Psi(m))(1)=\Psi(\eta(m))(1).$$





(d) Let $I$ be a left ideal in $R$ and $\beta: I\to \Hom_{\mb Z}(R,A)$.
By \ref{ezinj} we need to show that $\beta$ extends to
 $\gamma: R\to \Hom_{\mb Z}(R,A)$. Let $\Xi=\Xi(I,A)$ be given by (b). Put
$\tilde\beta=\Xi(\beta)$. Then  $$\tilde \beta: I\to A$$ is $\mb Z$-linear.  Since $A$ is
divisible, it is injective as an $\mb Z$-module.  So $\tilde\beta$ extends a
$\mb Z$-linear map $\tilde \gamma: . R\to A$. That is $\tilde \beta= \tilde \gamma\circ 
\rho$, where $\rho: I\to M$ is the inclusion map.. By (b) there exists an $R$-linear
$\gamma: M\to \Hom_\mb Z(R,A)$ with $\Xi(\gamma)=\tilde \gamma$. By (cb)

$$\Xi(\gamma\circ \rho)=\Xi(\gamma)\circ \rho= \tilde\gamma \circ \rho=\tilde
\beta=\Xi(\beta)$$

As $\Xi$ is one to one, we conclude $\beta=\gamma\circ \rho$ and so $\gamma$ is the
wanted extension of $\beta$.\qed 


\begin{theorem}\l{eminj} Let $R$ be a ring. Every $R$-module can be 
embedded into an injective $R$-module.                       
\end{theorem}
\proof Let $M$ be a $R$-module. By \ref{exinj} $M$ is a subgroup of some 
divisible abelian group $A$. Let $\rho:M\to A$ be the inclusion map. Then
$\check{\rho}: \Hom_R(R,M)\to \Hom_{\mb Z}(R,A),\, \phi \to \rho\circ \phi$
is a $R$-momomorphism.  By \ref{hrmr} $M\cong \Hom_R(R,M)$ and so
$M$ is isomorphic to an $R$-submodule of $\Hom_{\mb Z}(R,A)$. 
By \ref{exinjR} $\Hom_{\mb Z}(R,A)$ is injective.\qed


\begin{lemma}\l{prodinj}
\begin{itemize}
\AI{a} Direct summands of injective modules are injective.
\AI{b} Direct products of injective modules are injective.
\end{itemize}
\end{lemma}
\proof(a) Let $J=J_1\oplus J_2$ with $J$ injective.
Given $\alpha: B\into A$ and $\beta:B\to J_1$. As $J$ is injective there 
exists $\tilde \gamma: A\to J$ with 
$$\tilde \gamma\circ\alpha=\rho_1\circ\beta.$$
 Put $\gamma=\pi_1\circ 
\tilde \gamma$ Then $$ \gamma\tilde \circ\alpha=\pi_1\circ\tilde 
\gamma\circ\alpha=\pi_1\circ \rho_1\circ \alpha=\alpha.$$

(b) Suppose that $J_i,i\in I$ is a family of injective modules. Given
$\alpha:B\to A$ and $\beta: B\to \prod_{i\in I} J_i$. Since $J_i$ is 
injective there exists $\gamma_i: A\to J_i$ with 
$$\gamma_i\circ \alpha=\pi_i\circ\beta$$
Put $\gamma=(\gamma_i)_{i\in I}$.

Then 
$$\pi_i\circ \gamma\circ \alpha= \gamma_i\circ\alpha=\pi_i\circ\beta$$
and so $\gamma\circ \alpha=\beta$. Hence $\prod_{i\in I} J_i$ is 
injective.\qed

\begin{theorem}\l{chrinj} Let $M$ be an $R$-module. Then the following are 
equivalent:
\begin{itemize}
\AI{a} $M$ is injective.
\AI{b} If $A$ is a $R$-module with $M\leq A$, then $A$ splits over $M$.
\end{itemize}
\end{theorem}
\proof
(a)$\Rightarrow $  (b) Since $M$ is injective we obtain

\setlength{\unitlength}{1mm}
$$\begin{picture}(50,20)(0,25)
\put(0,40){$M$}
\put(29,41.3){\vector(-1,0){25}}
\put(16,42.5){$\gamma$}
\put(30,40){$A$}
\put(14,22){$M$}
\put(15,27){\vector(-1,1){12}}
\put(19,27.5){\vector(1,1){11}}
\put(19,27.5){\line(-1,0){2}}
\put(19,27.5){\line(0,-1){2}}
\put(3,30){$\id_M$}
\put(26,30){$\id_{M\to A}$}
\end{picture}$$
Hence by \ref{splits"}, $A$ splits over $M$.

(b)$\Rightarrow$ (a)
By \ref{eminj}, $M$ is a submodule of an injective module. So by 
assumption, $M$ is a direct summand of this injective module. Thus by 
\ref{prodinj} $M$ is injective.\qed

\section{The  Functor Hom}


If $A\leq B$, $\id_{A\to B}$ denotes the inclusion map $A\to B,  a\to a$.


\begin{lemma}\l{homex} Let $R$ be a ring.  Given a sequence
$A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C$ of $R$-modules. Then the
following two statements are equivalent:
\begin{itemize}\AI{a}  
$$A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C$$
is exact and  $A$ splits over $\ker f$.
\AI{b} For all $R$-modules $D$,
$$\Hom_R(D,A)\s{\check{f}}{\longrightarrow}\Hom_R(D,B)\s{\check{g}}
{\longrightarrow}\Hom_R(D,C)$$
is exact.
\end{itemize}
\end{lemma}
\proof  We first compute $\ker \check g$ and $\Im \check f$.
Let $\beta=\in \Hom_R(D,B)$. Then $g\circ \beta=0$ if and only if $\Im \beta\leq \ker g$.
Thus

$$\ker \check g=\Hom_R(D,\ker g).$$
Also 
$$\Im {\check f} =f\circ \Hom_R(D,A):=\{ f\circ \alpha\mid \alpha\in \Hom_R(D,A)\} \leq
\Hom_R(D,\Im f).$$

Suppose first that (a) holds. Then $\ker g=\Im f$ and $A=\ker f \oplus K$  for some
$R$-submodule $K$ of $ A$.  It follows that  $f\mid_K: K\to \Im f$ is an isomorphisms. 
Let $\phi\in \Hom_R(D,\Im f)$. Let 

 $$\alpha= \id_{K\to A} \circ (f\mid_K)^{-1}\circ \phi$$
Then $\alpha\in \Hom_R(D,A)$ and $f\circ \alpha= \phi$. So 
$$Im \check f=\Hom_R(D,\Im f)=\Hom_R(D, \ker g)=\ker \check g.$$

Suppose next that (b) holds.
Let $D=\ker g$. Then 
$$\id_{\ker g\to B}\in \ker \check g=\Im \check g\leq \Hom_R(D,\Im f)$$
thus $\ker g\leq \Im  f$.
 Next choose $D=A$. Then 
$$f=f\circ \id_A\in \ker \check g=\Hom_R(D,\ker  g)$$
Hence $\Im f\leq \ker g$ and so $0\to A\to B\to C\to 0$ is exact.

Finally choose $D=\Im f$. Then $\id_{\Im f\to B}\in \ker \check g$ and so
$$\id_{\Im f\to B}=f\circ \gamma$$
for some  $\gamma\in \Hom(\Im f, A)$. So by \ref{split"}, $A$ splits over $A$.\qed

Here is the dual version of the previous lemma:


\begin{lemma}\l{homex1} Let $R$ be a ring.  Given a sequence
$A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C$ equivalent.
\begin{itemize}
\AI{a}  
$$A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C$$
is exact and  $C$ splits over $\Im g$.
\AI{b} For all $R$-modules $D$,
$$\Hom_R(A,D)\s{f^*}{\longleftarrow}\Hom_R(B,D)\s{g^*}
{\longleftarrow}\Hom_R(C,D)$$
is exact.
\end{itemize}
\end{lemma}
\proof Dual to the one for \ref{homex}. We leave the details to the reader.
 
The following three theorem are immediate consequences of the previous two:

\begin{theorem}\l{homex2} Let $R$ be ring. Then the following are 
equivalent \begin{itemize}\AI{a} $$0\to 
A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C$$ is exact. \AI{b} For every 
$R$ module $D$, $$0\to 
\Hom(D,A)\s{\check{f}}{\longrightarrow}\Hom(D,B)\s{\check{g}}{\longrightarrow
}\Hom(D,C)$$ is exact. \end{itemize} \qed\end{theorem}

\begin{theorem}\l{homex3} Let $R$ be ring. Then the following are 
equivalent \begin{itemize}\AI{a} $$
A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C\to 0$$ is exact. \AI{b} For 
every $R$ module $D$, 
$$\Hom_R(A,D)\s{f^*}{\longleftarrow}\Hom_R(B,A)\s{g^*}{\longleftarrow } 
\Hom_R(C,A)\leftarrow 0$$ is exact. \qed\end{itemize} \end{theorem}

\begin{theorem}\l{homex4}  Let $R$ be a ring.  Given a sequence of $R$-modules
$0\to A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C\to $ . Then the
following three  statements are equivalent:
\begin{itemize}\AI{a}  
$$0\longrightarrow A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C \longrightarrow
0 $$ is split exact.
\AI{b} For all $R$-modules $D$,
$$0\longrightarrow
\Hom_R(D,A)\s{\check{f}}{\longrightarrow}\Hom_R(D,B)\s{\check{g}}
{\longrightarrow}\Hom_R(D,C)\longrightarrow o$$ is exact.
\AI{c} For all $R$-modules $D$,
$$0 \longleftarrow \Hom_R(A,D)\s{f^*}{\longleftarrow}\Hom_R(B,D)\s{g^*}
{\longleftarrow}\Hom_R(C,D) \longleftarrow 0$$ is exact.\qed
\end{itemize}
\end{theorem}




\begin{theorem}\l{homdir} Let $A$ and $B_i,i\in I$ be $R$-modules. Then
\begin{itemize}
\AI{a} $\Hom_R(\bigoplus_{i\in I} B_i,A)\cong \prod_{i\in I}\Hom_R(B_i,A)$
\AI{b} $\Hom_R(A,\prod_{i\in I} B_i)\cong \prod_{i\in I}\Hom_R(A,B_i)$
\AI{c} $\Hom_R(A,\bigoplus_{i\in I} B_i)\cong \bigoplus_{i\in 
I}\Hom_R(A,B_i)$ \end{itemize} \end{theorem} \proof Pretty obvious, the 
details are left to the reader.\qed

Let $R$ and $S$ be rings. An $(R,S)$-\ei{bimodule}  is abelian group $M$ so 
that $M$ is a left $R$-module, a right $S$ module such that
$$ (rm)s=r(ms)$$
for all $r\in R$, $s\in S$ and $m\in M$. 

For example $R$ is a $(R,R)$ modules if we view $R$ as  a left $R$- and  right
$R$-module by multiplication from the left and right, respectively.

\begin{lemma}\l{bimo} Let $R$ and $S$ be rings. Let $\phi: A\to A^\prime$ be 
$R$-linear and   let $B$ a $(R,S)$-bimodule. Then \begin{itemize}\AI{a} 
$\Hom_R(A,B)$ is a right $S$-module by $$(fs)(a)=f(a)s.$$ \AI{b} 
$$\phi^* : \Hom_R(A^\prime ,B)\to \Hom_R(A,B),\, f\to f\circ \phi $$ is
$S$-linear.
\AI{c} 
$\Hom_R(B,A)$ is a left $S$-module with action of $S$ given by 
$$(sf)(b)=f(bs)$$ \AI{d} $$\check{\phi}:  \Hom_R(B,A)\to \Hom_R(B,A^\prime), f\to
\phi f$$ is 
$S$ linear. \end{itemize} \end{lemma} \proof Straightforward.\qed

 
 Let $R$ be a ring and $M$ a $R$-module. The \ei{dual} of $M$ is the module
 $$M^*:= \Hom_R(M,R)$$
 As $R$ is an $(R,R)$-bimodule, $M^*$ is a right $R$-module.
 The elements of $M^*$ are called \ei{linear functionals} on $M$.
 
From \ref{homdir} we have 
$$(\bigoplus_{i\in I} M_i)^*\cong \prod_{i\in I} M_i^*$$

By  \ref{ hrmr} $R^*=\cong R$, (but the reader should be aware that here $R$ 
is a right $R$-module  that is the action is given  by right multiplication.)
 
We conclude
$$F(I)^*\cong R^I$$
and so if $I$ is finite then $F(I)^*$ is isomorphism to the free 
right-module on $I$.

An $R$-module $M$ is called \ei{cyclic} of $M=Rm$ for some $m\in M$.

\begin{lemma}\l{M*cy} Let $R$ be a ring and $M=Rm$ a cyclic $R$ modules. 
Let $I=\Ann_R(m)$ and $J=\{ r\in R\mid Ir=0\}$. 
\begin{itemize}
\AI{a} $J$ is an  right ideal in  $R$. 
\AI{b}   $$\tau : M^*\to J,\quad f\to f(m)$$
 is an isomorphism of right $R$-modules.
\end{itemize}
\end{lemma} \proof (a)  Let $j\in J$, $r\in R$ and $i\in I$. Then $i(jr)=(ij)r=0r=0$ and so
$jr\in J$. Thus (a) holds.

(b) Let $a\in \Ann_R(m)$. Then $af(m)=f(am)=f(0)=0$ and so $f(m)\in J$. So 
$\tau$ is well defined. It is clearly $\mb Z$-linear and 
$$(fr)(m)=f(m)r$$
So $\tau(fr)=\tau(f)r$ and $\tau$ is right $R$-linear.


Let $j\in J$. Then $Ij=0$ and so the map
$$\xi(j):  M\to R,  rm\to rj$$ 
is well defined and $R$-linear. 
$$\tau(\xi(j)=\xi(j)(m)=\xi(j)(1m)=1j=j$$
and
$$(\xi(\tau(f)))(rm)=r\tau(f)=rf(m)=f(rm)$$
and so $\xi(\tau(f))=f$ and $\tau$ is a bijection.\qed





If $R$ is commutative, left and right modules are the same. So we might 
have that $M\cong M^*$ as $R$-modules. In this case $M$ is called 
\ei{self-dual}. For example free modules of finite rang over a commutative 
ring are self-dual.
\medskip
  Let $R$ be a ring, the \ei{double dual} of a module $M$ is 
$M^{**}:=(M^*)^*$. Define 

$$\vartheta: M\to M^{**}, \vartheta(m)(f)=f(m).$$
It is readily verified that $\vartheta$ is $R$-linear. 
If $M=F_R(I)$ is free of finite rang we see that $\vartheta$ is an isomorphism.
If $M=F_R(I)$ is free of infinite rang, then $\vartheta$ is a monomorphism but 
usually not an isomorphism. 

In general $\vartheta$ does not need to be one to one.
For example if $R=\mb Z$,  $n\in\mb Z^+$ and $M=\mb X/n \mb Z$, then it is 
easy to see that $M^*=0$. Indeed let $\phi\in M^*$ and $m\in M$. Then 
$nm=0$ and so $n\phi(m)=\phi(nm)=0$. Thus $\phi(m)=0 $
Since $M^*=0$, also $M^{**}=0$.

Let us investigate $\ker \vartheta$ in general. Let $m\in M$ then 
$\vartheta(m)=0$ if and only if $\phi(m)=0$ for all $\phi\in M^*$. 


\section{Tensor products}

Let $R$ be a commutative ring and $A,B,C$ $R$-modules. A function $f:A\times 
B\to C$ is called $R$-\ei{bilinear} if 
for each $a$ in $A$ and $b$ in $B$ the maps 
$$f(a,*): B\to C, y\to f(a,y) \text{ and } f(*,b): A\to C, x\to f(x,b)$$
are $R$-linear. 

For example the ring multiplication is $R$-linear. Also if $M$ is any 
$R$-module. Then $M^*\times M\to R, (f,m)\to f(m)$

Let $R$ be any ring, $A$ a right and $B$ a left $R$-module. Let $C$ be any 
abelian  group. A map $f: A\times B\to C$ is called $R$-balanced, if is 
$\mb Z$ bilinear and

$$f(ar,b)=f(a,rb)$$
for all $a\in A,b\in B, r\in R$.
 $M^*\times M\to R, (f,m)\to f(m)$ is an example of a $R$-balanced map.
 

\begin{Def}\l{dtensor} Let $A$ be a right and $B$ a left module for the ring 
$R$. A tensor product for $(A,B)$ is an $R$-balanced map:
$$\otimes:  (A\times B)\to A\otimes_R B, (a,b)\to a\otimes b$$
such that for all $R$-balanced maps $f: A\times B\to C$ there exists a 
unique $\mb Z$-linear 
$$\bar f: A\otimes B\to C \text{ with } f(a,b)=\bar f(a\otimes b).$$
\end{Def}

\begin{theorem}\l{extens} Let $R$ be a ring, $A$ be a right and $B$ a left 
$R$-module. Then there exits a tensor product for $(A,B)$.
\end{theorem}
\proof Let $A\otimes_R B$ the abelian group with generators $\{ x(a,b)\mid 
a\in A,b\in B$ and relations 

$x(a,b)+x(a^\prime,b)=x(a+a^\prime,b), a,a^\prime\in A, b\in B$,

$x(a,b)+x(a,b^\prime)=x(a,b+b^\prime), a\in A, b,b^\prime\in B$

and

$x(ar,b)=x(a,rb),a\in A,b\in B, r\in R$

Write $a\otimes b$ for $x(a,b)$ and define 

$$\otimes  A\times B \to A\otimes B, (a,b)\to a\otimes b$$.
We leave it as any easy exercise to verify that this is indeed an tensor 
product.\qed







Let $R$ be a ring. Then $\otimes: R\times_R R\to R, (r,s)\to rs$ is a 
tensor product. Indeed given any $R$-balanced map, $f: R\times R\to C$. 
Define $$\bar f: R: R\to C,  r\to f(r,1)$$ As $f$ is $\mb Z$-bilinear, 
$\bar f$ is $\mb Z$-linear. Also $$\bar f(r\otimes s)= \bar 
f(rs)=f(rs,1)=f(r,s)$$ So indeed $\otimes$ is a tensor product. With the 
same argument we have:



\begin{lemma}\l{AtenR} Let $R$ be a ring, $A$ a right and $B$ a left 
$R$-module. Then 
 $$A\otimes_R R\cong A \quad \text{ and }\quad R\otimes_R B\cong B$$
 \qed
  \end{lemma}

With a little bit more  work we will prove

\begin{lemma}\l{tensy} Let $R$ be a ring, $J$ a right ideal in $R$ and 
$I$ a left ideal in $R$ . Then
$$\otimes: R/J\times_R R/I\to R/J+I, (r+J,s+I)\to (rs+(I+J)$$
is a tensor product for $(R/J,R/I)$. 
\end{lemma} \proof


Note here that $I+J$ is neither a left nor a right ideal in $R$. It is 
just an additive subgroup, $R/I+J$ is an abelian group but in general 
not a ring. 
First we need to check that $\otimes$ is well defined:
$$(r+j)(s+i)+(I+J)=rs+(js+ri+ji)+(I+J)=rs+(I+J)$$
Note here that as $J$ is a right ideal $js+ji\in J$ and as $I$ is a left 
ideal $ri\in I$.

Clearly $\otimes$ is $R$-balanced.  Suppose now that $f: R/J\times 
R/I\to C$ is $R$-balanced.

Define 
$$\bar f: R/(I+J)\to C, r+(I+J)\to f(r+J,1+I)$$
Again we first need to verify that this is well-defined. 
$$f(r+i+j+J,1+I)=f((r+J)+(i+J),1+I) =f(r+I,1+I)+f((1+J)i,1+I)=$$
$$=f(r+I,1+I)+f(1+J,i(1+I))=f(r+I,1+I)+ f(1+I,0_{R/I})=f(r+J,1+I)$$
So $\bar f $ is well defined and clearly $\mb Z$ linear.
$$\bar f( r+J\, \otimes \, s+I)=\bar f(rs+I+J)=f(rs+J,1+I)=f((r+J)s,1+I)=
f(r+j,s+I)$$
and $\otimes$ is indeed a tensor product.\qed

If $R$ is PID we conclude
$$R/Rm\otimes_R R/Rn\cong R/\gcd(n,m)R$$
In particular, if $n$ and $m$ are relative prime $R/Rm\otimes R/Rn=0$


Let $M$ be a finite dimensional vector space over the division ring $\mb 
D$. Let $x\in M,\phi\in M^*$, $R=\End_D(M), I=\Ann_R(x)$ and 
$J=\Ann_R(y)$. Then $M\cong R/I$ and $M^*=R/J$. 
Thus 
$M^*\otimes_R M\cong R/(I+J)$. We leave it as an exercise to verify that 
$R/I+J\cong D$. We conclude that
$$M^*\times M\to D. (f,m)\to f(m)$$
is a tensor product of $(M^*,M)$.

\begin{lemma}\l{tenbi} Let $R,S,T$ be rings, $\alpha: A\to A^\prime$  
$(R,S)$- linear and $\beta: B\to B^\prime$  $(S,T)$-linear. \begin{itemize} 
\AI{a} $A\otimes_S B$ is an $(R,T)$ bimodule in such a way that $$    
r(a\otimes)b=(ra\otimes bt)$$ for all $r\in R,a\in A,b\in B,s\in S$. \AI{b} 
There exists a unique $Z$-linear map $$\alpha\otimes\beta: A\otimes_S \to 
B\to A^\prime \otimes B^\prime \text{ with } a\otimes b\to \alpha(a)\otimes 
\beta(b)$$ for all $a\in A, b\in B$. Moreover, $\alpha\otimes \beta$ is 
$(R,T)$-linear. \end{itemize} \end{lemma} \proof: (a) Let $r\in R$, and 
$t\in Y$. We claim that  $$\phi(r,t): A\times B\to A\otimes_S B, (a,b)\to 
ra\otimes bt$$ is $S$-balanced. Indeed its clearly $\mb Z$-bilinear and 
$$r(as)\otimes bt=(ra)s\otimes bt= ra\otimes s(bt)= ra\otimes (sb)t$$ So 
its $S$-balanced. Hence we obtain a map a $\mb Z$-linear $$\Phi(r,t): 
A\otimes_S B \to A\otimes_S B,\text{ with } a\otimes b\to ra\otimes bs.$$ 
Let $r,r\prime\in R$ and $t\in T$. It is easy to verify that 
$$\Phi(r+r^\prime,t)(a\otimes b)=(\Phi(r,t)+\Phi(r^\prime,t)(a\otimes b)$$ 
and $$\Phi(rr^\prime,1)(a\otimes 
b)=(\Phi(r,1)\circ\phi(r^\prime,1))(a\otimes b)$$ Thus by the uniqueness 
assertion in the definition of the tensor product, 
$$\Phi(r+r^\prime ,t)=\Phi(r,t)+\Phi(r^\prime,t)\text{ and } 
\Phi(rr^\prime,1)=\Phi(r,1)\circ \Phi(r^\prime,1).$$Thus $A\otimes B$ is a 
left $R$-module by $rv=\Phi(r,1)(v).$ Similarly$A\otimes B$ is a right 
$T$-module by $vt=\Phi(1,t)v.$ Also $r((a\otimes b)t=ra\otimes bs=(r 
(a\otimes b))t$ So $ (rv)t=r(vt)$ for all $\in R, t\in T, v\in A\otimes_R 
B$. Thus (a) holds.

 
(b) The map $$A\times B\to A^\prime \otimes_S B^\prime, (a,b)\to 
\alpha(a)\otimes\beta(b)$$
is $S$-balanced.
So $\alpha\otimes \beta$ exists. That its $(R,T)$-linear is easily verified 
using arguments as in (a).\qed



\begin{proposition}\l{seten} Let $D$ be a right $R$-module and 
$$ A\s{f}{\longrightarrow}B\s{g}{\longrightarrow}C\to 0$$
 an exact sequence of $R$. Then 
$$D\otimes_R A\s{\id_D\otimes 
f}{\longrightarrow}D\otimes_R B\s{\id_D\otimes 
g}{\longrightarrow}D\otimes C\to 0$$
is exact sequence of $\mb Z$-modules.
\end{proposition}
\proof  As $D\times C$ is generated by the $d\otimes c$ and $g$ is onto, 
$\id)D\otimes g$ is onto.  Also 
$$((\id_D \otimes g)\circ (\id_D\otimes f)(d\otimes a)=d\otimes 
(g(f(a))=0$$
So 
$$\Im (\id_D\otimes f)\leq \ker g(\id_D\otimes g)$$.

Let $E=\Im f$ and 
$$H=\Im \id_D\otimes \id_{E\to B}=\langle d\otimes e,d\in D,e\in 
E\rangle\leq D\otimes_R B$$
Note that $H=\Im (\id_D\otimes f)$.
We will show that $H=F:=\ker (\id_D\otimes g)$.
Without loss $C=B/H$ and $g$ is the canonical epimorphism.
We claim that the map
$$D\times B/E \to (D\otimes B)/H, (d,b+E)\to d\otimes b+H$$ 
is well defined and $R$-balanced.

Indeed $d\otimes (b+e)+H= (d\otimes b)+(d\otimes e)+H=d \otimes b +H$
So it well defined. Its clearly $R$-balanced.

Hence we obtain an onto $\mb Z$-linear map:
$$ D\otimes_R B/E \to (D\otimes B)/H, \text{ with }  d\otimes (b+E)\to 
(d\otimes b)+H.$$
$\id_D\otimes g $ induces an isomorphism
$$ (D\otimes B)/F\to  D\otimes_R B/E,\text{ with } (d\otimes b)+F\to 
d\otimes (b+E)$$

The composition of these two maps give on onto map

$$\tau: (D\otimes B)/F\to (D\otimes B)/H \text{ with } (d\otimes b)+F\to 
(d\otimes b)+E.$$
As $D\otimes B$ is generated by the $d\otimes b$ we get
$\tau( v+F)=v+E$ for all $v\in D\otimes B$. Since $\tau(0)=0$ we conclude 
that $f\in E$ for all $f\in F$. Thus $F\leq E$ and $E=F$.\qed





\begin{lemma}\l{tendir}
\begin{itemize}
\AI{a} Let $(A_i,i\in I)$ be a family of right $R$ modules and $(B_j,j\in 
J)$ a family of left $R$-modules. Then
$$ \bigoplus{i\in I}\, \otimes_R \, \bigoplus{j\in J} \cong 
\sum_{i\in I} \sum_{j\in J} A_i\otimes B_j $$
\AI{b} Let $R$ be a ring and $I,J$ sets. Then  
$$F(I)\otimes F(J)\cong F(I\times J)$$
 as a $\mb Z$-modules.
\AI{b} Let $R$ and $S$ be rings with $R\leq S$. Let $I$ be a set and view 
$S$ as an $(S,R)$-bimodule. Then 
$$S \otimes_R F_R(I)\cong F_S(I)$$
as $S$-module.
\end{itemize}
\end{lemma}
\proof (a) is readily verified using the universal properties of direct 
sums and tensor products. 

(b)  Since $R\otimes_R R\cong R$, (b) follows from (a).

(c) As $S\otimes_R R\cong S$, (c) follows from (a) \qed

\begin{lemma} Let $A$ be a right $R$ module, $B$ a $(R,S)$-bimodule and $C$ 
a left $S$-module.
Then there exits $\mb Z$-linear isomorphism
$$ (A\otimes_R B)\otimes S C) \text{ with } (a \otimes b)\otimes c\to 
a\otimes (b\otimes c)$$
for all $a\in A, b\in B, c\in C$.
\end{lemma}
\proof Straightforward form the universal properties of tensor products.\qed


In future we will just write $A\otimes_R B\otimes_S C$ for 
any of the two isomorphic tensor products in the previous lemma. A similar 
lemma holds for more than three factors.  $A\otimes_R B\otimes_S C$ can 
also be characterized through $(R,S)$-balanced maps from $A\times 
B\times C\to T$, where $T$ is an abelian group. We leave the details to the 
interested reader.


\begin{proposition}\l{tehoas}  Let $A$ be a right $R$ module, $B$ a $(R,S)$-bimodule and $C$ 
a right $S$-module. Then the map:
$$\Xi: \Hom_S(A\otimes_R B, C)\to \to \Hom_R(A, \Hom_S(B,C), 
\Xi(f)(a)(b)=f(a\otimes b)$$
is a $\mb Z$-isomorphism.
\end{proposition}
\proof Note that  $\Xi(f)(a): B\to C, b\to f(a,b)$ is indeed $S$-linear.
Also $\Xi(f): A\to \Hom_S(B,C)$ is $R$-linear and $\Xi$ is $\mb Z$-linear.
It remains to show that $\Xi$ is a bijection. We do this by defining an 
inverse. 
Let $\alpha: A\to\Hom_S(B,C)$ be $R$-linear. 
We claim that the map 
$$A\times B\to C; (a,b)\to \alpha(a)(b)$$
is $R$ balanced. Indeed it is $\mb Z$-bilinear and 
$$\alpha(ar)(b)=(\alpha(a)r)(b)=\alpha(a)(rb).$$
So there exist 
$$\Theta(\alpha): A\otimes B \to C \text{ with } \Theta(\alpha)(a\times 
b)=\alpha(a)(b)$$
for all $a\in A$, $b\in B$.
It is readily verified that $\Theta(\alpha)$ is $S$-linear.
So 
$$\Theta: \Hom_R(A, \Hom_S(B,C)\to \Hom_S(A\otimes_R B, C)$$
We claim that $\Theta$ and $\Xi$ are inverses:

$$\Xi(\Theta(\alpha))(a)(b)=\Theta(\alpha)(a\otimes b)=\alpha(a)(b)$$
So $\Xi(\Theta(\alpha))=\alpha$.
$$\Theta(\Xi(f))(a\otimes b)=\Xi(f)(a)(b)=f(a\otimes b)$$
and so $\Theta(\Xi(f))=f$.\qed


Here is a special case of the previous proposition. Suppose $R$ is a 
commutative ring and $A$ and $B$, $R$-modules. Applying \ref{tehoas} with 
$C=R$. We get that

$$(A\otimes B)^*\cong \Hom_R(A,B^*)$$

Suppose that $R$ is commutative and $A,B$ are $R$-modules we obtain a $\mb 
Z$-linear map:

$$\sigma: A^*\otimes B^*\to (A\otimes B)^*\text { with } \gamma(\alpha 
\otimes \beta)) (a\otimes b)=\alpha(a)\beta(b).$$ 
Indeed this follows from  $\alpha \otimes \beta: A\otimes B\to R\otimes R\cong R$.

If $A$ and $B$ are free of finite rang it is easy to see that this is an 
isomorphism. If $A$ and $B$ are free, $\sigma$ is still one to one, but 
not necessarily onto.  Suppose that $A_k=R/I_k$,  $k\in \{1,2\}$, is a 
cyclic $R$-module. Put $J_k=\Ann_R(I_k)$. Then by \ref{m*cy}, $A_k^*\cong 
J_k$. Also $A_1\otimes A_2\cong R/(I_1+I_2)$. Now $\Ann_R(I_1+I_2)= 
Ann_R(I_1)\cap \Ann_R(I_2)=J_1\cap J_2$. Thus $(A_1\otimes_R A_2)^*\cong 
J_1\cap J_2$. $\sigma$ from above ( with $A=A_1, B=A_2$) now reads: 
$$\sigma: J_1\otimes_R J_2\to J_1\cap J_2\quad (j_1,j_2)\to j_1j_2$$ We 
will know give an example where $\sigma=0$ but $J_1\otimes J_2\neq 0$. Let 
$S$ be a ring and $M$ an $(S,S)$-bimodule. Define $M\rtimes S$ to be the 
ring with additive group $M\oplus S$ and multiplication $$ (m_1,s_1)\cdot 
(m_2,s_2)=(m_1s_2+ s_1m_2, s_1s_2)$$ It is easy to verify that $M\times S$ 
is a ring. As an example we verify that the multiplication is associative 
$$ ((m_1,s_1)\cdot (m_2,s_2))\cdot (m_3,s_3)=(m_1s_2+s_1m_2,s_1s_2)\cdot 
(m_3,s_3)=(m_1s_2s_3+s_1m_2s_3+s_2s_2m_3,s_1s_2s_3)$$ A similar calculation 
shows that the right side is also equal to $(m_1,s_1)\cdot((m_2,s_2)\cdot 
(m_3,s_3))$. Identify $(m,0)$ with $m$ and $(0,s)$ with $s$. Then 
$$M\rtimes S=M+S, s_1\cdot s_2=s_1s_2, s\cdot m=sm, m\cdot s=ms \text{ and }
m_1\cdot m_2=0$$
 for all $s,s_1,s_2\in S$ and $m,m_1,m_2\in m$. Also $M$ is 
an ideal in $M\rtimes S$ and $(M\rtimes S)/M\cong S$. Indeed the map 
$M\rtimes S\to S, (m,s)\to s$ is an onto ring homomorphism with kernel $M$.

Suppose now that $S$ is commutative and $M$ a faithful $S$ module. Put 
$R=M\rtimes S$. Then $R$ is commutative. As $M^2=0$ and $\Ann_S(M)=0$, 
$\Ann_R(M)=M$. Also $M\cap M=M=M+M$. We conclude $(R/M)^*\cong M$, 
$R/M\otimes R/M\cong R/M$, $(R/M\otimes R/M)^*\cong M$
and 
$$\sigma: M\otimes_R M\to M, (m_1,m_2)\to m_1m_2=0$$
Suppose that $M=F_S(I)$ is a free $S$-module. Then as an $R$-module,
$$M\cong \bigoplus_{i\in I} R/M$$
Thus $$M\otimes_R M\cong \bigoplus_{i\in I}\bigoplus_{j\in I} R/M$$
and so $M\otimes_R M\neq 0$ ( unless $I\neq \emptyset$).



\section{Free modules and torsion modules}

In this section $R$ is a ring with identity and all $R$-modules are assumed 
to be unitary.




Let $M$ be a $R$-module and $(m_i,i\in I)$ a family of elements in $M$. 
By \ref{universalfree} there exists a $R$-linear map
 $$\alpha: \bigoplus_{i\in I} R\to M \text{ with } i\to m_i$$
 If $\alpha$ is an isomorphism,
$(m_i\mid i\in I)$ is called a \ei{basis} for $M$. It is more or less 
obvious that a subset $B$ of $M$ is a basis if and only if every element 
$m$ in $M$ can be uniquely written as $m=\sum_{b\in B} r_bb $ with $r_b\in 
R$ for all $b\in R$. As usually we assume here that almost all $r_b$ are 
zero. If $M$ has a basis $B$ then $M$ is isomorphic to the free module on 
$B$. For this reason we call $M$ itself a free module. We say that a subset 
$L$ of $M$ is \ei{linear independent} if $L$ is a basis for $RL$, note that 
this is the case if and only if $$\sum_{l\in L} r_ll=0 \Longrightarrow 
r_l=0 \text{ for all } l\in L$$




Is a submodule of a free module free? The answer is almost always no. For 
example if $R=\mb Z/n \mb Z$ with $n\in \mb Z^+$, $n$ not a prime,  and $m$ 
is a proper divisor of $m$ then $m\mb Z/n\mb Z$ is a submodule of $R$ which 
is not free.  A obvious necessary condition for all submodules of all free 
modules for a ring $R$ to be free is  that all submodules of $R$ 
itself are free. The next theorem shows that this condition is also  
sufficient.

\begin{theorem}\l{subfree} 
\begin{itemize}
\AI{a}  Suppose that all left ideals in the ring $R$ are free as
$R$-modules. Then every submodule of a free module is free.
\AI{b} If $R$ is a pricipal ring and $M$ is a $R$-submodule of $F_R(I)$ for 
some set $I$, then $M\cong F_R(J)$ for some set $J\subseteq I$.
\end{itemize}
\end{theorem} \proof (a) Let $M$ be a free module with 
basis $B$ and $A$ a $R$-submodule in $M$. According to the well ordering 
principal (\ref{wellorder})   we can choose a well ordering on $B$. For 
$b\in B$ define $$M^*_b=\sum_{e\in B, e\in B}\in Re$$ and $M_b=M_b^*$. Let 
$A_b=M_b\cap A$ and $A_b^*=M_b^*\cap A$. Then

$$A_b/A_b^*=A_b/A_b\cap M_b^*\cong A_b+M_b^*/M_b^*\leq M_b/M_b^*\cong 
Rb\cong R$$.

By assumption every submodule of $R$ is free and so $A_b/A_b^*$ is free. 
Let $E_b\subset A_b$ so that $(e+A_b^*, e\in E_b)$ is a basis for 
$A_b/A_b^*$. Let $E=\bigcup_{b\in B} E_b$. We claim that $E$ is a basis for 
$A$. 

Let $m\in M$. Then $m=\sum_{b\in b} r_bb$ with $r_b=\in R$ and almost all 
$m_b=0$. So we can choose $b_m\in B$ maximal with respect $r_{b_m}\neq 0$.
Clearly for $e\in E_b$, $b_e=b$. In general, $b_m$ is minimal in $B$ with 
$m\in M_{b_m}$.

Now suppose that $\sum_{e\in E} r_e e=0$  so that almost all, but not 
all $r_e=0$. Let $b$ be maximal with $b=b_e$ and $r_e\neq 0$ for some $e\in 
E$. The $e\in E_b$ for all $e$ with $b_e=e$ and $e\in A_b^*$ for all $e$ 
with $r_e\neq 0$ and $b_e\neq b$. Thus

$$0=\sum_{e\in E} r_ee +A_b^*=\sum_{e\in E_b} r_ee+A_b^*$$
But this contradicts the linear independents of the $e+A_b^*, e\in E_b$.

Hence $E$ is linear independent.  Suppose that $A\nleq RE$ and pick $a\in A\setminus
RE$ with $b=b_a$ miniaml. Then $a\in  A_b$. Hence 
 $$a+A^*_b=\sum_{e\in E_b}  r_ee+A^*_b$$
Put $d=\sum_{e\in E_b} r_ee$. Then $d\in RE\leq A$, $a-d\in A^*_b$. By minimality
of $b$, $a-d\in RE$ and so $a\in d+RE=RE$.

So $A\leq RE$, $A=RE$ and $E$ is a basis for $A$.

(b) If $R$ is a prinicpal ring then $|E_b|\leq 1$ for all $b\in {\cal 
B}$ so (b) holds.\qed


If $R$ is commutative ( with identity) only $PID$ have the property that 
every left ideal in $R$ is free. Indeed if $a,b\in R^\#$, then $ba-ab=0$ 
and so $a$ and $b$ are linear dependent. Hence every ideal is cyclic as a 
module and so a principal ideal.  Suppose that $ab=0$ for some non-zero $a,b\in R$. Then
$bRa=0$ and so $Ra$ is not free, a contradiction.  Thus $R$ is also an integral  domain
and so a PID.


\begin{corollary} \l{subfingen} Let $R$ be a principal ring, $M$ an 
$R$-module and  $W$ an 
$R$-submodule of $M$. If  $M=RI$ for some $I\subset M$, hen $W=RJ$ for some 
$J\subseteq W$ with $|J|\leq |I|$. In particular, if $M$ is finitely 
generated as $R$-module, so is $M$.
 \end{corollary} \proof Let $\phi: F_R(I)$ be $R$-linear with $\phi(i)=i$ 
for all $i\in I$. Let $A=\phi^{-1}(W)$. By \ref{subfree} $A$ has a basis 
$J^*$ with $|J^*|\leq |I|$. Let $J=\phi(J^*)$. Then $J$ gerated $W$ as an 
$R$-module and $|J|\leq |J^*|\leq |I|$.\qed







\begin{Def}\l{dtorsion} Let $M$ be a unitary $R$-module and $m\in M$.
\begin{itemize} 
\AI{a} $m$ is called a \ei{torsion element} if $\Ann_R(m)\neq 0$.
\AI{b} $M$ is called a \ei{torsion module} if all elements are torsion 
elements. \AI{c} $M$ is called \ei{torsion free} if $0$ is the only torsion 
element. 
\AI{d}  $M$ has \ei{finite exponent} of $\Ann_R(M)\neq 0$.
\end{itemize} \end{Def}

Note that $m$ is not a torsion element if and only if $\{m\}$ is 
linear independent.


\begin{lemma}\l{torsion} Let $M$ be a module for the integral domain 
$R$. 
\begin{itemize}
\AI{a} The torsion elements form a submodule $T(M)$.
\AI{b} If $M$ is generated by finitely many torsion elements, then  $M$  
 has finite exponent.
\AI{c} $M/T(M)$ is torsion free.
  \end{itemize} \end{lemma}
  \proof (a) Let $a, b$ be 
torsion elements and pick $r,s\in R^\#$ with $ra=sb=0$. As $R$ is an 
integral domain $rs\neq 0$. Also $$rs(Ra+Rb)=Rsra+Rrsb=0$$ Hence all 
elements in $Ra+Rb$ are torsion. So the torsion elements indeed form a 
submodule.

(b) Suppose that $M=RA$, where $A$ is a finite set of torsion elements. For 
$a\in A$ pick $t_a\in R^\#$ with $t_aa=0$. Put $t=\prod_{a\in A} t_a$. Then 
$t\neq 0$ and $tM=0$

(c)  Let $x+T(M)$ be a torsion element. Pick $0\neq r\in R$ with $rx\in 
T(M)$. Then $rx$ is torsion and so $s(rx)=0$ for some $0\neq s\in R$. 
Hence $(sr)x=0$ and as $R$ is an integral domain, $sr\neq 0$. So $x\in 
T(M)$ and $M/T(M)$ is torsion free.\qed


\begin{theorem}\l{freetorsion} Let $M$ be an $R$-module.
\begin{itemize}
\AI{a} Any linear independent subset of $M$ lies in a maximal linear 
independent subset.
\AI{b} Let $L$ be a maximal linear independent subset of $M$. Then $M/RL$ 
is a torsion module.
\end{itemize} 
\end{theorem} \proof (a) Let $E$ be a linear 
independent subsets of $M$. Let ${\cal L}$ be the set of linear independent 
subsets of $M$ containing $E$. Order ${\cal L}$ by inclusion. The union of 
a chain in ${\cal L}$ an upper bound for the chain. So  Zorn's Lemma 
\ref{Zorn} implies that $M$ has a maximal linear independent subset $L$. 


(b) Let $W=RL$.  Suppose that $M/W$ is not torsion and 
pick $m\in M$ so that $m+W$ is not torsion. Then $m$ is not torsion and 
$Rm\cap W=0$. Hence $L\cup \{m\}$ is linear independent, a contradiction to 
the maximal choice of $L$. \qed

We remark that if $L$ is a maximal linear independent subset of $M$, then 
$RL$ does not have to be a maximal free submodule. Indeed  the following 
example shows that $M$ does not have even to have to have   a 
maximal free submodule. ( Zorn's lemma does not apply has the union of a 
chain of free submodules might not be free)

Let $R=\mb Z$ and $M=\mb Q$ with $\mb Z$ acting by right multiplication. As 
$\mb Q$ has no zero divisors, $M$ is torsion free. In particular, every 
non-zero element $a$ is linear independent. We claim $\{a\}$ is a maximal 
linear independent subset. Indeed $a,b\in \mb Q$.  Then $a=\frac{n}{m}$ 
and $b=\frac{p}{q}$ with $n,m,q,p\in \mb Z$. Then  $(mp) a- (nq) b=nm-nm=0$ 
and $a$ and $b$ are linear dependent.

We conclude that every free submodule of $M$ is of the form $\mb Z a, a\in 
Q$. Let $t\in \mb Z$ with $t>1$ then $\mb Za\lneq mb Z \frac{a}{t}$ 
and so $M$ has no maximal free submodules.

$\mb Q$ as a $\mb Z$ module has another interesting property: every 
finitely generated submodules is cyclic. Indeed, if $A$ is generated by 
$\frac{n_i}{m_i},1\leq i\leq k$, put $m=\lcm_{1\leq i\leq k} m_i$ and 
 Then $mA\cong A$ and $mA\leq \mb Z$. So $mA$ and $A$ are cyclic. \medskip


Since division rings  have no non-zero unitary torsion modules 
\ref{freetorsion} has the following corollary:

\begin{corollary}\l{vectorspace}  Let $V$ be a vector space over the 
division ring $D$. Then $V$ has a basis and every linear independent subset 
of $V$ can be extended to a basis of $V$.\qed
\end{corollary}

\begin{lemma}\l{idsubfree} Let $M$ be a torsion free $R$-module for the 
integral domain $I$. Suppose that one of the following holds: 
\begin{itemize} \NI{1} $M$ is finitely generated. 
\NI{2} If $N$ is a 
submodule of $M$ so that $M/N$ is a torsion module, then $M/N$ has finite 
exponent.
 \end{itemize} Then $M$ is isomorphic to a submodule of a free 
module $W$. Moreover $W$ can be chosen as a submodule of $M$. 
\end{lemma} 
\proof Note that by \ref{torsion} condition $1.$ implies condition $2.$. So 
we may assume that $2.$ holds. 
By \ref{freetorsion} there exists a free submodule $W$ of $V$ so that 
$M/W$ is torsion. By there exists $0\neq r\in R$ with 
$rM/W=0$ Hence $rM\leq W$.

Consider the map
$$\alpha: M\to W, m\to rm$$
As $R$ is commutative, $\alpha$ is a $R$-linear. As $M$ is $\alpha$ is one 
to one. Thus $m\cong \alpha(M)=rM\leq W$.\qed


\begin{theorem}\l{torfree} Let $M$ be a finitely generated module for the 
PID $R$. Then there exists a free submodule $F\leq M$ with $M=F\oplus T(M)$.
\end{theorem}
\proof By \ref{torsion}, $M/T(M)$ is torsion free, so by \ref{idsubfree} 
$M/T(M)$ is isomorphic to a submodule of a free module. Hence by 
\ref{subfree} $M/T(M)$ is free. Finally by \ref{freesplit} $M/T(M)$ splits 
over $T(M)$.\qed


\section{Modules over PID's}

A non-zero  $R$-module $M$ is called \ei{simple} if $0$ and $M$ are the only
$R$-submodules of $M$. For example if $I$ is a left ideal in $R$, then $R/I$ is simple if
and only if $I$ is a maximal left ideal.
\begin{theorem}\l{primary} Let $R$ be a $PID$ and $p\in R$ a prime. 
Suppose that $M$ is an $R$-module with $p^kM=0$ for some $k\in {\mb Z^+}$. Then 
\begin{itemize}
 \AI{a} If $M=Rm$ is cyclic, $M\cong R/(p^l)$ for some $0\leq l\leq k$. 
Moreover, every $R$-submodule of $Rm$ is of the form $Rp^tm$ for some 
$0\leq t\leq l$. \AI{b} Let $W$ be a $R$-submodule in $M$. Then $W$ is a 
direct summand of $M$ if and only if $p^tM\cap W\leq p^tW$ for all $t\in 
{\mb N}$. \AI{c} $M$ is a direct sum of cyclic submodules. \end{itemize} 
\end{theorem} \proof Put $P=(p)$. Recall that $P^0$ is defined as $R$. 
Without loss $k$ is minimal with respect to $p^kM=0$.

 (a) Let $J=\Ann_R(m)$. Then $M\cong R/J$. Let $W$ be a an $R$-submodule of 
$M$. Then $W=Im$ for some ideal $I$ of $R$ with $J\leq I$. Since $R$ is a PID, 
$I=Ri$ for some $i\in I$.  Since $p^kM=0$, $p^k\in J\leq I$ and so $i\mid 
p^k$. Thus $I=(p^t) $ and $J=(p^l)$ for some $s\leq\leq l k$. Since 
$W=Im=Rp^tm$, all parts of (a) are proved.

(b)  $"\Longrightarrow"$    Suppose that $M=W\oplus K$ for some 
$R$-submodule $K$ of $M$. Then $p^tM=p^tW\oplus p^tK$ and so $p^tM\cap 
W=p^tW$.

$"\Longleftarrow"$  Suppose that 
$P^tW\cap W=P^tW$ for all $t\in \mb N$. We proceed by induction on $k$. 
If $k=0$ we get $M=0$  and there is nothing to prove. Note that 
$P^{k-1}(PM)=0$ and $$P^t(PM)\cap PW=(P^{t+1}M\cap W)\cap PW=P^{t+1}W\cap 
PW=P^t(PW).$$ Thus by induction $PW$ is a direct summand of $PM$. Let 
$PM=D\oplus PW$ for some submodule $D$ of $PM$.  Note that $D\cap W= D\cap 
PM\cap W=D\cap PW=0$.

Let ${\cal M}$ be the set of all submodules $E$ in $M$ with $D\leq E$ and 
$E\cap W=0$. The $D\in {\cal M}$. Order ${\cal M}$ by inclusion. The union 
of a chain in ${\cal M}$ is in ${\cal M}$. So by Zorn's lemma \ref{Zorn}, 
${\cal M}$ has a maximal member $E$. Suppose $M\neq E+W$ and let $m\in 
M\setminus (E+W)$. Then $pm\in pM=D+pW$. So there exists $w\in W$ with 
$pm-pw\in D\leq E$. So replacing $m$ by $m-w$ we  assume that $pm\in E$. 
Let $t\in R$ with $tm\in E+W$. If $t\not\in P$, then as $PM\leq E+W$ and 
$P$ is a maximal, $Rm\leq E+W$, a contradiction. So $t=rp$ for some $r\in 
R$ and $tm=rpm\in E$. Thus $Rm\cap (E+W)\leq E$ and $$(Rm+E)\cap W\leq 
((Rm+E)\cap (E+W))\cap W= ((Rm\cap (E+W))+E)\cap W\leq E\cap W=0$$ a 
contradiction the maximal choice of $E$.

So $M=E+W=E\oplus W$ and $W$ is a direct summand of $M$.

(c) Let ${\cal D}$ be the set of sets of cyclic submodules of $M$. We say 
that $D\in {\cal D}$ is linear independent if $\sum D=\oplus D$ and we say 
that $D$ is a direct summand  if $\sum D$ is a direct summand of $M$. 
 Let ${\cal M}$ be the set of all linear independent, direct summands in 
${\cal D}$. Order ${\cal M}$ by inclusion. Let ${\cal C}$ be  a chain in 
${\cal M}$ and $D=\bigcup {\cal C}$. Clearly $D\in {\cal D}$. Also $D$ is 
linear independent.

 We claim that 
 $$\sum D=\bigcup_{C\in {\cal C}} \sum C.$$
Clearly the right hand side is contained in the left. Let $x\in \sum D$. 
Then $x\in U_1+U_2+\ldots U_n$ for some $U_i\in D$. Since $D=\bigcup {\cal 
C}$ there exits $C_i\in {\cal D}$ with $U_i\in C_i$. Since ${\cal D}$ is a 
chain we may assume $C_1\subseteq C_2\subseteq \ldots \subseteq C_n$. hence 
$U_i\in C_n$ for all $1\leq i\leq n$ and so 
$$x\in   U_1+U_2+\ldots U_n\leq \sum C_n\leq \bigcup_{C\in {\cal C}} \sum 
C$$ This proves the claim.


From the claim
 $$ (\sum D)\cap  p^tM=\bigcup_{C\in {\cal C}} (\sum C\cap 
p^tM)= \bigcup_{C\in {\cal C}} \sum p^tC =p^t\sum D$$ Thus by (b) $\sum D$ 
is a direct summand of $M$. So $D\in {\cal D}$ and $D$ is an upper bound 
for ${\cal C}$. So by Zorn's lemma, ${\cal D}$ has a maximal member $D$. By 
definition of ${\cal D}$, $M=\sum D\oplus E$ for some $R$-submodule $E$ of 
$D$.

Suppose that $E\neq 0$. Pick $l$ minimal with $p^lE= 0$. Then $p^{l-1}E\neq 
0$ and we can choose $e\in E$ with $p^{l-1}e\neq 0$. We claim that $Re$ is 
a direct summand of $E$. For this we want to apply (b) to $Re$ and $R$.
Let $0\leq t< l$. By (a)  every submodule of $Re$ is 
of the form $p^sRe$. In particular, $Re\cap p^tE=p^sRe$ for some $s$. But 
$p^{l-t}(Re\cap p^tE)=0$, so $p^{l-t}p^se=0$ and $s\geq t$. Thus 
$$Re\cap p^tE=p^sRe\leq p^tRe$$
So by (b) $Re$ is a direct summand of $E$. But then $\sum D+Re$ is a direct 
summand of $M$. Also $Re\cap \sum D\leq E\cap \sum D=0$ and $D\cup\{Re\}$ 
is linear independent. But thus contradicts the maximal choice of $D$.

Hence $E=0$ and $M=\sum D=\bigoplus D$ and (c) holds.





\begin{theorem}\l{decprim} Let $R$ be a PID and $M$ a torsion  module for 
$R$. Let ${\cal P}$ be the set of non-zero prime ideals in $M$.
 For $P\in {\cal P}$ let $M_P=\bigcup_{k\in \mb Z^+} 
\Ann_M(P^k)$. Then $$M=\bigoplus_{P\in {\cal P}} M_P.$$ \end{theorem} 
\proof Let $m\in M$ and pick $r\in R^\#$ with $rm=0$. Then there exists 
pairwise non associate primes  $p_i\in R$ and  postive integer $k_i$,  
$1\leq k\leq n$  with $$r=p_1^{k_1}\ldots p_m^{k_n}$$ 
Put $a_i=\prod_{j\neq i} p_j^{k_j}$. Then $r=p_i^{k_i}a_i$. Also 
$\gcd_{i=1}^n a_i=1$ and so $1=\sum s_ia_i$ for some $s_i\in R$. Put 
$m_i=s_ia_im$. Then $m=\sum_{i=1}^n m_i$ and

$$p_i^{k_i}m_i=p_i^{k_i}s_ia_im=s_i(p_i^{k_i}a_i)m=s_i(rm)=0$$
Thus $m_i\in \Ann_M(p_i^{k_i})\leq M_{(p_i)}$ and so

$$M=\sum_{P\in {\cal P}} M_P$$
Let $P\in {\cal P}$. Put 
$$M_{P^\prime}= \sum_{P\neq Q\in {\cal P}} M_Q$$
In remains to show that $M_{P^\prime}\cap M_P=0$. For this let $k\in {\mb 
Z^+}$ and $0\neq m\in M_{P^\prime}$. Then $am=0$ for some $a\in R$ with 
$a\not\in P$. Let $P=(p)$. Then  $1=ra+sp^k$ for some $r,s\in R$.

Thus $m=ram+sp^km=sp^km$. Hence $p^km\neq 0$ and $m\not\in M_P$.\qed

\begin{theorem}\l{pidmod} Let $M$ be a finitely generated module for the 
PID $R$. Then $M$ is direct sum of finitely many cyclic modules. Moreover, 
each of the summand can be chosen be isomorphic to  $R/P^k$ for some prime 
ideal $P$ and some $k\in \mb Z^+$. \end{theorem}
 \proof By \ref{torfree}, 
$M=F\oplus T(M)$, where $F$ is free. So $F$ is a direct sum of copies of 
$R$. Note that $R\cong R/0$ and $0$ is a prime ideal. Also by \ref{decprim} 
$T(M)=\bigoplus_{p\in P} M_p$. As $M$ is finitely generated and $M_p$ is a 
homomorphic image of $M$, $M_p$ is finitely generated. So (see 
\ref{torsion}) $p^kM_p=0$ for some $k\in \mb N$. Thus by \ref{primary} 
$M_p$ is the direct sum of cyclic modules, and each of the cyclic modules 
is isomorphic to $R/(p^l)$. We leave it as an exercise to verify that all 
the direct sums involved are actually finite sums.\qed



\begin{corollary}
\begin{itemize}\AI{a}
 Let $A$ be a finitely generated abelian group. Then $A$ is the direct sum 
of cyclic groups.
\AI{b} Let $A$ be an \ei{elementary abelian} $p$-group for some prime $p$. 
(That is $A$ is abelian and $pA=0$). Then $A$ is the direct sum of copies 
of $\mb Z /p\mb Z $.
\end{itemize}
\end{corollary}
\proof Note that an abelian group is nothing else as a module over $\mb Z$. 
So (a) follows from \ref{pidmod} and (b) from \ref{primary}. (b) can also 
by proved by observing that $A$ is also a module over the field $\mb Z/p\mb 
Z$ and so has a basis.\qed






