0

After several years of absence, I seem to have lost track of the very basic of number theory. In my head, I know what I am allowed to do, but not why I am allowed to do it. I have been consulting Wikipedia's list of properties of modular arithmetic, but I can't find any property that matches up to the following:

What property of modular arithmetic lets us conclude that $a^{2b}\mod{n} \equiv a^{b}\mod{n} \cdot a^{b}\mod{n}$ for $a,b,n \in \mathbb{Z}$? I worry that I've confused the Computer Science style of "mod as in remainder upon division" and the mathematics style of "mod as in congruence", but I was sure that this worked for both. For example, I am confident that $5^4\mod{3} = 5^{2}\mod{3} \cdot 5^{2}\mod{3}=(5^{2}\mod{3})^2=(5\mod{3})^4 =(2\mod{3})^4 =(2)^4\mod{3} = 16 \mod{3} = 1\mod{3}$ is completely valid.

J. Mini
  • 371
  • First of all make it clear that both of them are different. The remainder one is equivalent to Euclid's Division Lemma. Note that in computer science, $a=b\ \mathrm{mod}\ n$ means that $a$ is the remainder when $b$ is divided by $n$. However, $a\equiv b\ (\mathrm{mod}\ n)$ means that the remainder when $a$ is divided by $n$ is the same as when $b$ would be divided by $n$. Thus, the congruence means in CS that, $a\ \mathrm{mod}\ n = b\ \mathrm{mod}\ n$. Hope this is clear to you :) – ultralegend5385 Nov 03 '20 at 15:56
  • Use the congruence laws first to deduce congruence, then apply a final mod at the end, as in the linked dupe. – Bill Dubuque Nov 04 '20 at 00:43

1 Answers1

0

Well the multiplication in $\Bbb Z_n$ is defined as $\overline{ab} = \overline a\cdot\overline b$, where $\overline a$ denotes the residue class of $a$ mod $n$.

This amounts to the congruence $ab\mod n = [(a\mod n)\cdot (b\mod n)]\mod n$.

Your congruence $a^2b^2\mod n≡ab\mod n⋅ab\mod n $ is not correct as it requires $\mod n$ at the end: $a^2b^2\mod n ≡ab\mod n⋅ab\mod n \mod n$

Wuestenfux
  • 20,964