Lemma 1
Let a,b,q,r∈Z such that a=b⋅q+r
Then gcd(a,b)=gcd(b,r)
Euclid's Algorithm (a, b)
x=a
y=b
while y=0
r=x mod y
y=r
return x
Bezout's Theorem
Let a,b∈Z+.
There exists s,t∈Z such that:
s⋅a+t⋅b=gcd(a,b)
Lemma 2
Let a,b,c∈Z+
If gcd(a,b)=1 and a∣bc, then a∣c
Lemma 3
Let p be a prime number and a1,a2,...,an be integers.
If p∣a1⋅a2⋅...⋅an, then there exists 1≤i≤n with p∣ai
Theorem
Let m≥2 be a positive integer and a,b,c∈Z such that ac≡bc(modm) and gcd(c,m)=1.
Then a≡b(modm)