Greatest Common Denominator

Lemma 1

Let a,b,q,r∈Za,b,q, r \in \Z such that a=b⋅q+ra=b\cdot q + r
Then gcd(a,b)=gcd(b,r)\mathrm{gcd}(a,b) = \mathrm{gcd}(b,r)

Euclid's Algorithm (a, b)

x=ax = a
y=by = b
while y≠0y \neq 0
r=x mod yr = x \ \mathrm{mod} \ y
y=ry = r
return xx

Bezout's Theorem

Let a,b∈Z+a,b \in \Z^+.
There exists s,t∈Zs,t \in \Z such that:
s⋅a+t⋅b=gcd(a,b)s\cdot a + t\cdot b = \mathrm{gcd}(a,b)

Lemma 2

Let a,b,c∈Z+a,b,c \in \Z^+
If gcd(a,b)=1(a,b) = 1 and a∣bca|bc, then a∣ca|c

Lemma 3

Let pp be a prime number and a1,a2,...,ana_1, a_2, ..., a_n be integers.
If p∣a1⋅a2⋅...⋅anp|a_1\cdot a_2 \cdot ... \cdot a_n, then there exists 1≤i≤n1 \leq i \leq n with p∣aip|a_i

Theorem

Let m≥2m \geq 2 be a positive integer and a,b,c∈Za,b,c \in \Z such that ac≡bc(modm)ac \equiv bc \pmod{m} and gcd(c,m)=1(c,m) = 1.
Then a≡b(modm)a\equiv b \pmod{m}