Ring (source code)

= Ring
{title2=$R$}
{wiki=Ring_(mathematics)}

A <ring> is a <set> $R$ with two <binary operations>, <addition> and <multiplication>, satisfying three requirements. Under <addition>, $R$ is an <abelian group>: there is a zero, every element has an <inverse element>, and grouping or exchanging summands does not change the result. <Multiplication> is <associative> and has an <identity element> $1$, so $(ab)c=a(bc)$ and $1a=a1=a$. Finally, both versions of the <distributive property> hold:
$$
a(b+c)=ab+ac,\qquad (a+b)c=ac+bc.
$$
Here every <ring> is unital, but the <zero ring>, with $0=1$, is allowed. <Commutativity> of <multiplication> is an additional condition defining a <commutative ring>. These conventions agree with https://kconrad.math.uconn.edu/blurbs/ringtheory/ringdefs.pdf[Keith Conrad's Standard Definitions for Rings]{ref}.

The <integers> form a <ring> with their usual operations. The <polynomial ring> $\mathbb Z[X]$ is another: <addition> combines coefficients, while <multiplication> uses the <distributive property>. For example,
$$
(1+2X)(3-X)=3+5X-2X^2.
$$
The same rules justify symbolic calculations in both <rings>; this is why one definition can organize apparently different kinds of arithmetic. In every <ring>, $a0=0a=0$, and $a(-b)=-(ab)$. The first identity follows by distributing $a(0+0)$ and subtracting $a0$; the second follows by distributing $a(b+(-b))$. Thus familiar sign rules are consequences of the structure.

Order still matters in some <rings>. In the <matrix ring> $M_2(\mathbb R)$, take
$$
A=\begin{pmatrix}1&0\\0&0\end{pmatrix},\qquad B=\begin{pmatrix}0&1\\1&0\end{pmatrix}.
$$
Then <matrix multiplication> gives
$$
AB=\begin{pmatrix}0&1\\0&0\end{pmatrix},\qquad BA=\begin{pmatrix}0&0\\1&0\end{pmatrix}.
$$
Nevertheless, <matrix multiplication> is <associative>, distributes over <addition>, and has the <identity matrix> as its <identity element>. This is a valid <ring>. On a column <vector>, $AB$ applies $B$ first and $A$ second: swapping coordinates before discarding the second coordinate differs from doing those actions in reverse. The failure of <commutativity> records a meaningful difference in <function composition>.

\Image[/matrix-ring-noncommutation.png]
{title=Two orders of matrix multiplication give different outputs on the same vector}