Lecture 024

Modular Arithmetic

a \equiv b \pmod m \iff m | a-b congruence modulo m is equivalence relation \mathbb{Z} /m \mathbb{Z} = \{[a]_m | a \in \mathbb{Z}\}

For m \in \mathbb{N}^+: we have following theorems

Same Remainder Theorem

a \equiv b \pmod m \iff \text{a,b have same remainder when divided by m} TODO: proof

Complete Residue System modulo m (Same Remainder Corollary)

Every integer is congruent to exactly one element in \{{0, 1, ..., m-1}\}=\text{complete residue system modulo m}

\mathbb{Z} /m \mathbb{Z} = \{[0]_m, [1]_m, ..., [m-1]_m\}

Why do we use: addition, subtraction, multiplication obey modulo math (not division)

Modular Arithmetic Lemma

a \equiv b \pmod m \land c \equiv d \pmod m \implies

  1. a+c \equiv b+d \pmod m
  2. ac \equiv bd \pmod m

TODO: proof

Using Set Theory:

  1. [a]_m + [b]_m = [a+b]_m
  2. [a]_m \times [b]_m = [ab]_m

Examples

Corollary to Modular Arithmetic Lemma (power)

a \equiv b \pmod m \implies a^n \equiv b^n \pmod m for n \in \mathbb{Z}^+

Counter Example:

Division Theorem

ac \equiv bc \pmod m \implies a \equiv b \pmod {\frac{m}{gcd(c, m)}}

TODO: proof

For multiplication, its like we have: a \equiv b \pmod m \implies ac \equiv bc \pmod {mc} we know this fundamentally

For division, its like we have: a \equiv b \pmod m \implies a/c \equiv b/c \pmod {m/c}

Multiplicative Inverse (MIRP)

\text{a and m are relatively prime} \iff ab\equiv 1 \pmod m)

Unique Inverse Corollary

Inverse are unique under mod m

Existence of Inverse Corollary

(\exists m \in \mathbb{Z})(ax \equiv b \pmod m) \iff gcd(a, m) | b

Finding a inverse

ax \equiv 1 \pmod m

  1. guess and check

  2. guess x for all x up to m in which gcd(m, x) = 1

  3. or perhaps the negative of the first half of result above

Summary

To find a solution to equivalence (or 50x+71y=1 thing)

Table of Content