# Math4302 Modern Algebra (Lecture 24)

## Rings

### Definition of ring

A ring is a set $R$ with binary operation $+$ and $\cdot$ such that:

- $(R,+)$ is an abelian group.
- Multiplication is associative: $(a\cdot b)\cdot c=a\cdot (b\cdot c)$.
- Distribution property: $a\cdot (b+c)=a\cdot b+a\cdot c$, $(b+c)\cdot a=b\cdot a+c\cdot a$. (Note that $\cdot$ may not be abelian, may not even be a group, therefore we need to distribute on both sides.)

> [!NOTE]
>
> $a\cdot b=ab$ will be used for the rest of the sections.

<details>
<summary>Examples of rings</summary>

$(\mathbb{Z},+,*)$, $(\mathbb{R},+,*)$ are rings.

---

$(2\mathbb{Z},+,\cdot)$ is a ring.

---

$(M_n(\mathbb{R}),+,\cdot)$ is a ring.

---

$(\mathbb{Z}_n,+,\cdot)$ is a ring, where $a\cdot b=a*b\mod n$.

e.g. in $\mathbb{Z}_{12}, 4\cdot 8=8$.

</details>

> [!TIP]
>
> If $(R+,\cdot)$ is a ring, then $(R,\cdot)$ may not be necessarily a group.

#### Properties of rings

Let $0$ denote the identity of addition of $R$. $-a$ denote the additive inverse of $a$.

- $0\cdot a=a\cdot 0=0$
- $(-a)b=a(-b)=-(ab)$, $\forall a,b\in R$
- $(-a)(-b)=ab$, $\forall a,b\in R$

<details>
<summary>Proof</summary>

1) $0\cdot a=(0+0)\cdot a=0\cdot a+0\cdot a$, by cancellation, $0\cdot a=0$.  
Similarly, $a\cdot 0=0\cdot a=0$.

2) $(a+(-a))\cdot b=0\cdot b=0$ by (1), So $a\cdot b +(-a)\cdot b=0$, $(-a)\cdot b=-(ab)$. Similarly, $a\cdot (-b)=-(ab)$.

3) $(-a)(-b)=(a(-b))$ by (2), apply (2) again, $-(-(ab))=ab$.
</details>

#### Definition of commutative ring

A ring $(R,+,\cdot)$ is commutative if $a\cdot b=b\cdot a$, $\forall a,b\in R$.

<details>
<summary>Example of non commutative ring</summary>

$(M_n(\mathbb{R}),+,\cdot)$ is not commutative.

</details>

#### Definition of unity element

A ring $R$ has unity element if there is an element $1\in R$ such that $a\cdot 1=1\cdot a=a$, $\forall a\in R$.

> [!NOTE]
>
> Unity element is unique.
>
> Suppose $1,1'$ are unity elements, then $1\cdot 1'=1'\cdot 1=1$, $1=1'$.

<details>
<summary>Example of field have no unity element</summary>

$(2\mathbb{Z},+,\cdot)$ does not have unity element.
</details>

#### Definition of unit

Suppose $R$ is a ring with unity element. An element $a\in R$ is called a unit if there is $b\in R$ such that $a\cdot b=b\cdot a=1$.

In this case $b$ is called the inverse of $a$.

> [!TIP]
>
> If $a$ is a unit, then its inverse is unique. If $b,b'$ are inverses of $a$, then $b'=1b'=bab'=b1=b$.

We use $a^{-1}$ or $\frac{1}{a}$ to represent the inverse of $a$.

Let $R$ be a ring with unity, then $0$ is not a unit. (identity of addition has no multiplicative inverse)

If $0b=b0=1$, then $\forall a\in R$, $a=1a=0a=0$.

#### Definition of division ring

If every $a\neq 0$ in $R$ has a multiplicative inverse (is a unit), then $R$ is called a division ring.

#### Definition of field

A commutative division ring is called a field.

<details>
<summary>Example of field</summary>

$(\mathbb{R},+,\cdot)$ is a field.

---

$(\mathbb{Z}_p,+,\cdot)$ is a field, where $p$ is a prime number.
</details>

#### Lemma $\mathbb{Z}_p$ is a field

$\mathbb{Z}_p$ is a field if and only if $p$ is prime.

<details>
<summary>Proof</summary>

If $\mathbb{Z}_n$ is a field, then $n$ is prime.

<!-- This is equivalent to the statement that: If $\mathbb{Z}_p$ is a field and $1\leq m\leq n-1$, then $\operatorname{gcd}(m,n)=1$.

We $\operatorname{gcd}(m,n)=d>1$,  -->

We proceed by contradiction. Suppose $n$ is not a prime, then $d|n$ for some $2\leq d\leq n-1$, then $[d]$ does not have inverse.

If $[d][x]=[1]$, then $dx\equiv 1\mod n$, so $dx-1=ny$ for some $y\in \mathbb{Z}$, but $d|dx$, and $d|ny$, so $d|1$ which is impossible.

Therefore, $n$ is prime.

---

If $p$ is prime, then $\mathbb{Z}_p$ is a field.

Since $p$ is a prime, then $\operatorname{gcd}(m,n)=1$ for $1\leq m\leq n-1$. So $1=mx+ny$ for some $x,y\in \mathbb{Z}_p$. Then $[x]$ (the remainder of $x$ when divided by $p$) is the multiplicative inverse of $[m]$. $[m][x]=[mx]=[1-ny]=[1]$.

</details>