1 Modular Arithmetic
Divisibilityβ
Definitionβ
Let x,yβZ with xξ =0
We say that a divides b
a|b, if there exists some kβZ such that b=ak.
Theoremβ
Proof Easy
- If aβ£b and aβ£c then aβ£(b+c)
- If aβ£b then aβ£bc
- If aβ£b and bβ£c then aβ£c (transitivity)
Corollary
Let a,b,cβZ. If a|b and a|c, then a|mb+nc for any m,nβZ
Modular Arithmeticβ
Definitionβ
Let x,yβZ,mβN+
we say x is congruent to y modulo m
xβ‘y(modm) if and only if mβ£(xβy)
Notation: xβ‘y(modm) or mod(x,m)
Claim
xβ‘y(modm) if and only if x and y have the same remainder when divided by m (Proof easy)
29 (mod 12) β‘ 5
13 (mod 5) β‘ 3.
if aβ‘b(modm), cβ‘d(modm),then
a+cβ‘b+d(modm)
acβ‘bd(modm)
Solution:
- aβ‘b(modm) and cβ‘d(modm)
βmβ£(aβb) and mβ£(cβd)
βmβ£(aβb+cβd)
βmβ£(a+cβ(b+d))
βa+cβ‘b+d(modm)
- mβ£(aβb) and mβ£(cβd)
βmβ£acβbc and mβ£bcβbd
βmβ£acβbd
βacβ‘bd(modm)
Theoremβ
If dβ£x and dβ£y, then dβ£mod(x,y)
Proof:
mod(x,y)βyβ£xβmod(x,y)
β΅dβ£y
β΄dβ£xβmod(x,y)
β΄dβ£mod(x,y)
If dβ£y and dβ£mod(x,y), then dβ£x
Similar
GCD Mod Corollary: 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 β largest is the same.