We've seen how the notion of a ring acting on an abelian group leads to the structure of a module. Can a ring act on another ring? Or, to phrase the question a bit differently, if a ring $R$ acts on a module $M$, is it possible for $M$ to have a second operation that's both compatible with the given $R$-action and makes $M$ into a ring? These two questions lead to the following two equivalent definitions of a structure known as an algebra.

Definition of an algebra (via modules)

Let $R$ be a commutative ring (with unity). An $R$-algebra is an $R$-module $A$ that is also equipped with a multiplication that makes $A$ into a ring (with unity), with the following compatibility property between the $R$-action and the multiplication in $A$:

for all $r\beta \x88\x88R$ and ${a}_{1},{a}_{2}\beta \x88\x88A$.

Definition of an algebra (via rings)

Let $R$ be a commutative ring (with unity). An $R$-algebra is a ring $A$ (with unity) together with a ring morphism^{[1]}$f:R\beta \x86\x92A$ whose image is contained in the center of $A$.

Let's quickly verify these two definitions are actually equivalent. First suppose $A$ is an $R$-algebra in the first sense. For the sake of this analysis, let's use a $\beta \x8b\x86$ to denote the action of an element $r\beta \x88\x88R$ on an element $a\beta \x88\x88A$, and reserve a $\beta \x8b\x85$ (or no notation at all) for a product of elements in $A$. Then $A$ is a ring (with unity) and we can consider the map $f:R\beta \x86\x92A$ defined by $r\beta \x86\xa6r\beta \x8b\x86{1}_{A}$. We claim this is a ring morphism whose image is in the center of $A$. First note we certainly have $f({1}_{R})={1}_{R}\beta \x8b\x86{1}_{A}={1}_{A}$, since part of the assumption of the $R$-action on the module $A$ is that the identity element ${1}_{R}$ acts as the identity on $A$. Next note that properties of the $R$-action on the module $A$ guarantee that

$$\begin{array}{rl}f(r{r}^{\beta \x80\xb2})& =f({r}^{\beta \x80\xb2}r){\textstyle \phantom{\rule{1em}{0ex}}}\text{(because\Beta}R\text{\Beta is commutative)}\\ & =({r}^{\beta \x80\xb2}r)\beta \x8b\x86{1}_{A}\\ & ={r}^{\beta \x80\xb2}\beta \x8b\x86(r\beta \x8b\x86{1}_{A}){\textstyle \phantom{\rule{1em}{0ex}}}\text{(by the properties of the\Beta}R\text{-action on the module\Beta}A\text{)}\\ & ={r}^{\beta \x80\xb2}\beta \x8b\x86f(r)\\ & ={r}^{\beta \x80\xb2}\beta \x8b\x86(f(r)\beta \x8b\x85{1}_{A})\\ & =f(r)\beta \x8b\x85({r}^{\beta \x80\xb2}\beta \x8b\x86{1}_{A}){\textstyle \phantom{\rule{1em}{0ex}}}\text{(by compatibility of the\Beta}R\text{-action with the product in\Beta}A\text{)}\\ & =f(r)\beta \x8b\x85f({r}^{\beta \x80\xb2}).\end{array}$$

So, our map $f:R\beta \x86\x92A$ really is a ring morphism. Moreover, for every $r\beta \x88\x88R$ the compatibility condition guarantees that for every $a\beta \x88\x88A$ we have

Conversely, suppose $f:R\beta \x86\x92A$ is a ring morphism whose image is contained in the center of $A$. Then $A$ is an abelian group (under its additive operation) and we can define a set map $\beta \x8b\x86:R\Gamma \x97A\beta \x86\x92A$ by $r\beta \x8b\x86a=f(r)a$. We claim this defines a left action of $R$ on $A$. First note that

We assume rings have unity, which means we're assuming every algebra also has unity. There is an alternative definition without that assumption, which one would call a non-unital algebra.

There is also an alternative definition that results in a very similar structure to an algebra, with the notable exception that the multiplication in $A$ is not (assumed to be) associative. Such a structure (when the multiplication is not associative) is called a non-associative algebra.

We will not worry about these slightly more general structures.

Examples

Every ring (with unity) is a $\mathbf{Z}$-algebra. For each ring $A$ with unity,there is a unique ring morphism $\mathbf{Z}\beta \x86\x92A$, and the image of that ring morphism is always contained in the center of $A$.

If $A$ is a commutative ring (with unity), then $A$ is itself an $A$-algebra. More generally, if $A$ is a ring (with unity) and $R\beta \x8a\x86A$ is a subring of the center of $A$, then $A$ is an $R$-algebra.

The ring ${\mathrm{M}}_{n}(R)$ of $n\Gamma \x97n$ matrices with entries in a commutative ring $R$ is an $R$-algebra. The ring morphism $f:R\beta \x86\x92{\mathrm{M}}_{n}(R)$ sends each ring element $r$ to $r\beta \x8b\x85{I}_{n}$, the diagonal matrix with $r$ on the diagonal.

More generally, if $M$ is an $R$-module then the endomorphism ring${\mathrm{End}}_{R}(M)$ is an $R$-algebra.

The field of complex numbers $\mathbf{C}$ is a commutative $\mathbf{R}$-algebra, with $\mathbf{R}\beta \x86\x92\mathbf{C}$ the usual inclusion map.

The quaternions $\mathbf{H}$ is an $\mathbf{R}$-algebra but not a $\mathbf{C}$-algebra (as the complex numbers are not in the center of the quaternions).

The polynomial ring $R[{x}_{1},\beta \x80\xa6,{x}_{n}]$ is the free commutative $R$-algebra on the set $\{{x}_{1},\beta \x80\xa6,{x}_{n}\}$.

The tensor algebra$\mathcal{T}(M)$ of an $R$-module $M$ is an $R$-algebra.

Much like a ring is a monoid object in the category of abelian groups, an $R$-algebra is a monoid object in the category of $R$-modules.

Morphisms of algebras

As might be expected, morphisms of $R$-algebras should be maps that respect "the algebraic structures." From the ring-centeric definition, that would mean:

Definition of an algebra morphism (via rings)

Suppose $A$ and $B$ are two $R$-algebras. An $R$-algebra morphism from $A$ to $B$ is a ring morphism $\mathrm{{\rm O}\x95}:A\beta \x86\x92B$ such that $\mathrm{{\rm O}\x95}(r\beta \x8b\x85a)=r\beta \x8b\x85\mathrm{{\rm O}\x95}(a)$ for every $r\beta \x88\x88R$ and $a\beta \x88\x88A$.

In other words, if $f:R\beta \x86\x92A$ and $g:R\beta \x86\x92B$ are the ring morphisms giving $A$ and $B$ their $R$-actions, then we should have a commutative diagram