I have encountered two definitions of GCD(greatest common divisor) and am confused about the equality between them. Also, I want to show my understanding of GCD. Instead of finding GCD between two numbers, I use $n$ numbers.
As stated in many textbooks, GCD defines as the greatest common divisor of $a_1,a_2,\cdots, a_n$(definition one)
Another definition states that if $d|a_i$, and $d$ is divisible by all the common devisors $d^{'},ie $ $d^{'}|d$, then $d$ is GCD. (definition two).
First, I use $(a_1,a_2,\cdots, a_n)$ to denote the GCD under definition two, $a_i \in Z$ ,$n \in N^*$. It is obvious that $a_1,a_2,\cdots, a_n$ and $|a_1|,|a_2|,\cdots, |a_n|$ have the same devisors, so I suppose all $a_i \geq0$. Coz all $a_i=0$ is a bit complex. I suppose that at least one of $a_i >0$.
By Euclidean algorithm, I can show that $(a_1,a_2)$ exists and is unique when I choose $(a_1,a_2)>0$. Now I check whether we have $(a_1,a_2,\cdots, a_n)$=$((a_1,a_2,\cdots, a_{n-1}),a_n)$
When $n=3$,
$\because ((a_1,a_2),a_3)|(a_1,a_2),((a_1,a_2),a_3)|a_3$
$\because (a_1,a_2)|a_1, (a_1,a_2)|a_2$,
$\therefore ((a_1,a_2),a_3)|a_1,((a_1,a_2),a_3)|a_2$
$\therefore ((a_1,a_2),a_3)$ is a common divisor of $a_1, a_2,a_3$.
If $d$ is also a common divisor of $a_1, a_2,a_3$, we have $d|a_3$, $d|(a_1,a_2)$, so $d|((a_1,a_2),a_3)$. By definition $((a_1,a_2),a_3)$ is a GCD, now I check the unique part.
If $d_1$ and $d_2$ are both GCD of $a_1,a_2,a_3$, then $d_1|d_2$ and vice versa. Coz we stated that at least one $a_i>0$, so $d_i \neq 0$, so $d_1=d_2$
So we have $(a_1,a_2,a_3)=((a_1,a_2),a_3)$
Similiarly, $(a_1,a_2,\cdots, a_n)$=$((a_1,a_2,\cdots, a_{n-1}),a_n)$
So I know the GCD exists for $n$ numbers and is unique when we choose it to be greater than zero.
Now I want to show the two definitions are equivalent.
1 $\longrightarrow$ 2
By the division algorithm, $d=qd'+r$, where $0\leq r <d'$,$d|a_i$, $d'|a_i$, and $d$ is the greatest,
My question is
how can I show $d'|d$?
2 $\longrightarrow$ 1
This part is trivial, suppose $(a_1,\cdots,a_n)=d$, then any common divisor $d'$ is a factor of $d$, i.e. $d=q*d'$, coz $d>0$ and $d'>0$, we have $q \geq 1$, so $d$ is the greatest.