3

From Discrete Math and its Applications 8th edition, by Kenneth Rosen

The associative property is defined in the picture above. The screenshot is from Discrete Math and its Applications 8th edition, by Kenneth Rosen. Also, we have this definition for modular multiplication and addition.

Both of these images are on page 257 of the textbook.

My question is why is the associativity property valid? Every other property listed is very intuitive, but I don't know how I'd go about proving the associative property.

Bill Dubuque
  • 272,048
Keeyan
  • 51

4 Answers4

7

Hint:

The author proves

enter image description here

The $\mathbf{mod} \, m$ function has the property that

$\tag 1 [a \, \mathbf{mod} \, m] \, \mathbf{mod} \, m = a \, \mathbf{mod} \, m$

so, using corollary 2, this is also true,

$\tag 2 (a + b)\, \mathbf{mod} \, m = [a + b \, \mathbf{mod} \, m] \, \mathbf{mod} \, m$


Since there is an accepted completed answer, "here is how it is done strictly":

$\quad (a +_m b)+_m c =[(a +_m b) + c] \, \mathbf{mod} \, m = \big[(a + b) \, \mathbf{mod} \, m + c\big] \, \mathbf{mod} \, m =$
$\quad \quad \big[(a + b) + c\big] \, \mathbf{mod} \, m = \big[a + (b+c)\big] \, \mathbf{mod} \, m = \big[a + (b+c) \, \mathbf{mod} \, m \big] \, \mathbf{mod} \, m = $
$\quad \quad \big[a + (b+_mc)\big] \, \mathbf{mod} \, m = a +_m (b+_m c)$

CopyPasteIt
  • 11,366
5

The key is to show that $$a+_m(b+_mc)=[a+(b+c)]\mbox{ mod $m$}$$ (and similarly for $(a+_mb)+_mc$). Using the definition of modular arithmetic you've quoted this goes through the fact that $$a+(b+_mc)\equiv a+(b+c)\quad\mbox{ mod $m$}.$$ This is a little cringe-inducing since it mixes integers and integers-mod-$m$; this is in keeping with the definition you've written, but doesn't make sense if we define $\mathbb{Z}_m$ via equivalence classes instead (this is the standard approach, which is more complicated at the outset but ultimately much nicer), and then a slightly different reasoning is needed.

Note that this is all a bit slippery until we've shown that "$+_m$" is in fact well-defined - if you haven't yet, you should do that first.


At that point, associativity of $+_m$ follows immediately from associativity for $+$: we have $$a+(b+c)=(a+b)+c\implies [a+(b+c)]\mbox{ mod $m$}=[(a+b)+c]\mbox{ mod $m$}.$$ This is just a slightly messy example of the more general fact that $$x=y\implies x\mbox{ mod $m$}=y\mbox{ mod $m$},$$ that is, that "mod" is well-defined.

Noah Schweber
  • 245,398
2

Ring $\rm\color{#c00}{identities}$ (e.g. associative, commutative, distributive laws) that are true in $\,\Bbb Z\,$ are preserved in $\,\Bbb Z_m = \Bbb Z\bmod m\,$ simply because the map $\,h\,:\, a\mapsto a_m\,$ is a surjective (onto) ring hom, i.e. $\,h(a+b) = h(a)+_mh(b),\ $ $h(a\times b) = h(a)\times_m h(b),\, $ so an image of a ring identity (law) in the quotient ring has the same form, i.e. it is preserved, e.g. for associativity of addition we have

$$\begin{align} (a+b)\ \ \ +\ \ \ c\ \ \ &=\ \ \ a\ \ \ \, +\, \ \ \ (b+c)\ \ \ {\rm in}\,\ \Bbb Z\\[.3em] \Rightarrow\ \ \ \ \ \ \ \ \ \ \ \ \ \, h(a+b)+_m h(c) &= h(a)+_m h(b+c)\ \ \ {\rm in}\,\ \Bbb Z_m\\[.3em] \Rightarrow\ \ (h(a)+_m h(b))+_m h(c) &= h(a)+_m (h(b)+_m h(c))\\[.3em] {\rm i.e.} \ \ \ \ \ \ \ \ \,(\bar a\ +_m\ \bar b)\ \ +_m\,\ \ \bar c\ \ &=\ \ \ \ \bar a\,\ +_m\ \ \ (\bar b\ +_m\ \bar c) \end{align}\qquad\quad$$

Being surjective (onto), for any $\,\bar a,\bar b,\bar c\in \Bbb Z_m\,$ there are $\,a,b,c\in\Bbb Z\,$ that map to them, so the final equality above is true for all elements in $\Bbb Z_m,$ i.e. addition is associative in $\Bbb Z_m$ since it's associative in $\Bbb Z.\,$ Similarly, associativity of multiplication, and other (universal) ring laws are inherited, e.g. the commutative and distributive laws.

Generally this shows that algebraic structures axiomatizable by equational identities (varieties) are closed under homomorphic images, i.e. all identities persist to be true in moduluar images. Varieties are also clearly closed under subalgebras and products. Conversely Birkhoff showed (HSP Theorem) that a class of algebraic structure enjoying these three closure properties can be defined using only equational identities as axioms. For example, fields are not closed under product so they have no such axioms, e.g. we need to use an axiom like $\forall x\neq 0\,\exists y\!:\ xy = 1\,$ which is not an $\rm\color{#c00}{identity}$, i.e. not of form $\,\color{#c00}{\forall x,y}\!:\ f(x,y) = g(x,y)\,$ where $\,f,g\,$ are "polynomials" (i.e. compositions of operations of the algebra, here $+,*,0,1$ for rings).

Bill Dubuque
  • 272,048
  • @Downvoter If something is not clear then please feel welcome to ask questions and I will be happy to elaborate. – Bill Dubuque Jun 19 '22 at 09:45
  • I think that it should be considered the possibility of downvoters have to somehow justify. Nothing against downvotes in general, and no hard feelings about the downvotes I received, but an explanation should be required, I think... – amrsa Jun 19 '22 at 10:02
0

Here is a "cringe-inducing" proof that avoids morphisms at all cost:

Let $n$ be a positive integer and define $\mathbb{Z}_{n}:=\{0,1,\ldots,n-1 \}$. Define two operations on $\mathbb{Z}_n$ by

\begin{align} a \ast_{n} b=(a\ast b) \text{ mod }n= a\ast b-n\Big \lfloor \frac{a\ast b}{n} \Big \rfloor,\end{align}

where the symbol $\ast$ is either "$+$" or "$\cdot$", and denotes usual addition and multiplication in the two rightmost expressions of the equation.

Let $a,b,c\in \mathbb{Z}_n$. Let also $\delta=\nu=1$ if $\ast$ represents addition, and $\delta=c$ and $\nu=a$ if $\ast$ represents multiplication. Then, using that $\lfloor x+k\rfloor =\lfloor x \rfloor +k$ if $k$ is an integer, we can show that $\ast_n$ is associative: \begin{align} (a\ast_n b)\ast_n c=(a\ast b-n\Big\lfloor \frac{a\ast b}{n}\Big\rfloor )\ast_n c=&\;(a\ast b-n\Big \lfloor\frac{a\ast b}{n}\Big \rfloor)\ast c-n\bigg \lfloor \frac{(a\ast b-n\lfloor \frac{a\ast b}{n}\rfloor)\ast c}{n}\bigg \rfloor\\ =&\;a\ast b\ast c-n\delta \Big\lfloor \frac{a\ast b}{n} \Big \rfloor-n\bigg \lfloor \frac{a\ast b\ast c-n\delta \lfloor \frac{a\ast b}{n}\rfloor}{n}\bigg \rfloor \\ =&\;a\ast b\ast c-n\delta\Big \lfloor \frac{a\ast b}{n}\Big \rfloor-n\bigg \lfloor \frac{a\ast b\ast c}{n}-\delta \Big \lfloor \frac{a\ast b}{n}\Big \rfloor \bigg \rfloor \\ =&\;a\ast b\ast c-n\delta\Big \lfloor \frac{a\ast b}{n}\Big \rfloor-n(\Big \lfloor \frac{a\ast b \ast c}{n}\Big \rfloor-\delta \Big \lfloor \frac{a\ast b}{n}\Big \rfloor) \\ =&\;a\ast b\ast c-n\Big\lfloor \frac{a\ast b\ast c}{n} \Big \rfloor \\ =&\;a\ast b\ast c-n\nu\Big \lfloor \frac{b\ast c}{n}\Big \rfloor -n(\Big \lfloor \frac{a\ast b\ast c}{n}\Big \rfloor-\nu\Big \lfloor \frac{b\ast c}{n}\Big \rfloor ) \\ =&\;a\ast b\ast c-n\nu \Big \lfloor \frac{b\ast c}{n}\Big \rfloor-n\bigg \lfloor \frac{a\ast b\ast c}{n}-\nu\Big \lfloor \frac{b\ast c}{n}\Big \rfloor \bigg \rfloor \\ =&\;a\ast b\ast c-n\nu\Big \lfloor \frac{b\ast c}{n}\Big \rfloor-n\bigg \lfloor \frac{a\ast b\ast c-n\nu \lfloor \frac{b\ast c}{n}\rfloor }{n} \bigg \rfloor \\ =&\;a\ast(b\ast c-n\Big \lfloor \frac{b\ast c}{n}\Big \rfloor)-n\bigg \lfloor \frac{a\ast(b\ast c-n\lfloor \frac{b\ast c}{n}\rfloor )}{n}\bigg \rfloor\\ =&\;a\ast_n (b\ast c -n\Big \lfloor \frac{b\ast c}{n}\Big \rfloor)\\ =&\;a\ast_n(b \ast_n c). \end{align}

In a similarly painful manner, we can establish left-distributivity:

\begin{align} a\cdot_{n}(b+_nc)=a\cdot_n(b+c-n\Big \lfloor \frac{b+c}{n}\Big \rfloor)=&\; a(b+c-n\Big \lfloor \frac{b+c}{n}\Big \rfloor )-n\bigg \lfloor\frac{a(b+c-n\lfloor\frac{b+c}{n}\rfloor)}{n}\bigg \rfloor \\ =&\;ab+ac-na\Big \lfloor \frac{b+c}{n}\Big \rfloor-n\bigg \lfloor \frac{ab+ac-na\lfloor \frac{b+c}{n}\rfloor}{n}\bigg \rfloor \\ =&\;ab+ac-na\Big \lfloor \frac{b+c}{n}\Big \rfloor-n\bigg \lfloor \frac{ab+ac}{n}-a\Big \lfloor \frac{b+c}{n}\Big \rfloor \bigg \rfloor \\ =&\;ab+ac-na\Big \lfloor \frac{b+c}{n}\Big \rfloor -n(\Big \lfloor \frac{ab+ac}{n}\Big \rfloor -a\Big \lfloor \frac{b+c}{n}\Big \rfloor) \\ =&\;ab+ac-n\Big \lfloor \frac{ab+ac}{n}\Big \rfloor \\ =&\;ab+ac-n\Big \lfloor \frac{ab}{n}\Big \rfloor -n\Big \lfloor \frac{ac}{n}\Big \rfloor-n(\Big \lfloor \frac{ab+ac}{n}\Big \rfloor -\Big \lfloor \frac{ab}{n}\Big \rfloor -\Big \lfloor \frac{ac}{n}\Big \rfloor ) \\ =&\;ab+ac-n\Big \lfloor \frac{ab}{n}\Big \rfloor -n\Big \lfloor \frac{ac}{n}\Big \rfloor-n\bigg \lfloor \frac{ab+ac}{n}-\Big \lfloor \frac{ab}{n}\Big \rfloor -\Big \lfloor \frac{ac}{n}\Big \rfloor \bigg \rfloor \\ =&\;ab+ac-n\Big \lfloor \frac{ab}{n}\Big \rfloor -n\Big \lfloor \frac{ac}{n}\Big \rfloor-n\bigg \lfloor \frac{ab+ac-n\lfloor\frac{ab}{n}\rfloor-n\lfloor \frac{ac}{n}\rfloor}{n}\bigg \rfloor \\ =&\;(ab-n\Big \lfloor \frac{ab}{n}\Big \rfloor)+(ac-n\Big \lfloor \frac{ac}{n}\Big \rfloor)-n\bigg \lfloor \frac{(ab-n\lfloor \frac{ab}{n}\rfloor)+(ac-n\lfloor \frac{ac}{n}\rfloor )}{n}\bigg \rfloor \\ =&\;(ab-n\Big \lfloor \frac{ab}{n}\Big \rfloor )+_n (ac-n\Big \lfloor \frac{ac}{n}\Big \rfloor )\\ =&\;(a\cdot_n b)+_n(a\cdot_n c). \end{align} Of course, this is insanity.

AfterMath
  • 852