Skip to main content

1 Modular Arithmetic

Divisibility​

Definition​

Let x,y∈Zx,y\in Z with xβ‰ 0x\neq0 We say that a divides b a|b, if there exists some k∈Zk\in Z such that b=akb = ak.

Theorem​

Proof Easy

  1. If a∣ba|b and a∣ca|c then a∣(b+c)a|(b+c)
  2. If a∣ba|b then a∣bca|bc
  3. If a∣ba|b and b∣cb|c then a∣ca|c (transitivity)

Corollary

Let a,b,c∈Za, b, c \in Z. If a|b and a|c, then a|mb+nc for any m,n∈Zm, n \in Z

Modular Arithmetic​

Definition​

Let x,y∈Zx,y\in Z,m∈N+m\in N^{+}

we say x is congruent to y modulo m

x≑y(modm)x\equiv y\pmod m if and only if m∣(xβˆ’y)m|(x-y)

Notation: x≑y(modm)x\equiv y\pmod m or mod(x,m)mod(x,m)

Claim

x≑y(modm)x\equiv y\pmod m if and only if xx and yy have the same remainder when divided by m (Proof easy)

29 (mod 12) ≑ 5

13 (mod 5) ≑ 3.

Lemma​

if a≑b(modm)a\equiv b\pmod m, c≑d(modm)c\equiv d\pmod m,then

  1. a+c≑b+d(modm)a+c\equiv b+d\pmod m

  2. ac≑bd(modm)ac\equiv bd\pmod m

Solution:

  1. a≑b(modm)a\equiv b\pmod m and c≑d(modm)c\equiv d\pmod m

β‡’m∣(aβˆ’b)\Rightarrow m|(a-b) and m∣(cβˆ’d)m|(c-d)

β‡’m∣(aβˆ’b+cβˆ’d)\Rightarrow m|(a-b+c-d)

β‡’m∣(a+cβˆ’(b+d))\Rightarrow m|(a+c-(b+d))

β‡’a+c≑b+d(modm)\Rightarrow a+c\equiv b+d\pmod m

  1. m∣(aβˆ’b)m|(a-b) and m∣(cβˆ’d)m|(c-d)

β‡’m∣acβˆ’bc\Rightarrow m|ac-bc and m∣bcβˆ’bdm|bc-bd

β‡’m∣acβˆ’bd\Rightarrow m|ac-bd

β‡’ac≑bd(modm)\Rightarrow ac\equiv bd \pmod m

Theorem​

  1. If d∣xd|x and d∣yd|y, then d∣mod(x,y)d|mod(x,y)

    Proof:

    mod(x,y)β‡’y∣xβˆ’mod(x,y)mod(x,y)\Rightarrow y|x-mod(x,y)

    ∡d∣y\because d|y

    ∴d∣xβˆ’mod(x,y)\therefore d|x-mod(x,y)

    ∴d∣mod(x,y)\therefore d|mod(x,y)

  2. If d∣yd|y and d∣mod(x,y)d|mod(x,y), then d∣xd|x

    Similar

  3. GCD Mod Corollary: gcd(x,y)=gcd(y,mod(x,y))gcd(x,y)=gcd(y,mod(x,y))

    x and y have same set of common divisors as x and mod (x,y) by Lemma.

    Same common divisors β‡’\Rightarrow largest is the same.