Definition:Greatest Common Divisor

Definition
$$\forall a, b \in \Z: a \ne 0 \or b \ne 0$$, there exists a largest $$d \in \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\}$$.

Its existence is proved in Existence of Greatest Common Divisor.

Note that:
 * $$\gcd \left\{{a, b}\right\} = \gcd \left\{{b, a}\right\}$$

so the set notation is justified.

Generalization
This definition can be extended to any (finite) number of integers.

Let $$S = \left\{{a_1, a_2, \ldots, a_n}\right\} \subseteq \Z$$ such that $$\exists x \in S: x \ne 0$$ (that is, at least one element of $$S$$ is non-zero).

Then:
 * $$\gcd \left({S}\right) = \gcd \left\{{a_1, a_2, \ldots, a_n}\right\}$$

is defined as the largest $$d \in \Z^*_+$$ such that $$\forall x \in S: d \backslash x$$.

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, can be argued to be preferable.

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