Existence of Greatest Common Divisor

Theorem
$$\forall a, b \in \mathbb{Z}: a \ne 0 \lor b \ne 0$$, there exists a largest $$d \in \mathbb{Z}^*_+$$ such that $$d \backslash a$$ and $$d \backslash b$$.

This is called the greatest common divisor of $$a$$ and $$b$$ (abbreviated GCD or gcd) and denoted $$\gcd \left\{{a, b}\right\}$$.

Note that $$\gcd \left\{{a, b}\right\} = \gcd \left\{{b, a}\right\}$$ so the set notation is justified.

Proof

 * Proof of its existence:

$$\forall a, b \in \mathbb{Z}: 1 \backslash a \land 1 \backslash b$$ so $$1$$ is always a common divisor of any two integers.


 * Proof of there being a largest:

As the definition of $$\gcd$$ shows that it is symmetrical, we can assume with no loss of generality that $$a \ne 0$$.

First we note that:

$$\forall c \in \mathbb{Z}: \forall a \in \mathbb{Z}^*: c \backslash a \Longrightarrow c \le \left|{c}\right| \le \left|{a}\right|$$

... from Integer Absolute Value Greater than Divisors.

The same applies for $$c \backslash b$$.

Now we have three different results depending on $$a$$ and $$b$$:

So if $$a$$ and $$b$$ are both zero, then any $$n \in \mathbb{Z}$$ divides both, and there is no greatest common divisor. This is why the proviso that $$a \ne 0 \lor b \ne 0$$.

So we have proved that common divisors exist and are bounded above. Therefore, from Integers Bounded Above has Maximal Element there is always a greatest common divisor.

Comment
Alternatively, $$\gcd \left\{{a, b}\right\}$$ is written in some texts as $$\left({a, b}\right)$$, but this notation can cause confusion with ordered pairs. The notation $$\gcd \left({a, b}\right)$$ is also seen, but the set notation, although arguably more cumbersome, is preferred nowadays.

It is also known as the highest common factor (abbreviated HCF or hcf) and written $$\mathrm {hcf} \left\{{a, b}\right\}$$ or $$\mathrm {hcf} \left({a, b}\right)$$.