1

In Number Theory, I have seen many a times the following property being used though I don't know what it's called formally (that makes it harder to Google):

(a * b) (mod n) = (a mod n) * (b mod n)

What is this called and how can it be formally proved?

sherlock
  • 191
  • It's the definition of multiplication modulo $n$, after it has been shown it does not depend on the choice of the representatives in each class. – Bernard Feb 03 '17 at 22:43
  • This notation can be a little confusing if you're trying to do this on a computer.

    Let a=15, b=42, and n=12.

    (a * b) % n = 6

    (a % n) * (b % n) = 18

    However, ((a % n) * (b % n)) % n = 6.

    From what I read at https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/modular-multiplication, the "multiplication property of modular arithmetic" is

    (a * b) % n = ((a % n) * (b % n)) % n

    – William John Holden Feb 09 '22 at 18:31

1 Answers1

9

If $a=xn+a'$ and $b=yn+b'$, where all are whole numbers, then $a'=a\text{ mod }n$ and $b'=b\text{ mod }n$. It's then easy enough to multiply them:

$$ab=(xn+a')(yn+b')=(xyn+xb'+ya')n+a'b'$$

Take mod $n$ of both sides, and it should then be clear that

$$ab\equiv a'b'\pmod n$$