How to prove $\gcd(a,\gcd(b, c)) = \gcd(\gcd(a, b), c)$? I am trying to prove that $\gcd(a, \gcd(b, c)) = \gcd(\gcd(a, b), c)$.
The definition of GCD available to me is as follows:
Given integers a and b, there is one and only one number d with the following properties.


*

*$d \geqslant 0$

*$d|a$ and $d|b$

*$e|a$ and $e|b$ implies $e|d$.


In the book that I am studying, prime factorization of numbers hasn't been taught yet. Only, the definition of GCD, I've given above has been taught and proven. So, I want to use only this to prove that $\gcd(a, \gcd(b, c)) = \gcd(\gcd(a, b), c)$. Could you please help me?
 A: Please note that this solution uses an idea that is very similar to the idea in the solution posted much earlier by ncmathsadist.
We show that for any integer $u$, if $u$ divides the left-hand side, then $u$ divides the right-hand side, and vice-versa.  Thus the left-hand side and the right-hand side have the same set of divisors, so must be equal, since they are both non-negative.
Now suppose that $u$ divides  $\gcd(a, \gcd(b, c))$. Then $u$ divides $a$ and $u$ divides $\gcd(b,c)$. So $u$ divides $b$ and $c$, and therefore $a$, $b$, and $c$.
Now look at the right-hand side. We know that $u$ divides all of $a$, $b$, and $c$. So $u$ divides $\gcd(a,b)$, and therefore $u$ divides $\gcd(\gcd(a,b),c)$. 
Showing that if $u$ divides the right-hand side, then $u$ divides the left-hand side is essentially the same calculation, and can be omitted. 
A: Same answer as I just gave in sci.math...
Note that 
$$d|x,y\Longleftrightarrow d|\gcd(x,y).$$
So:
$$\begin{align*}
d|a,\gcd(b,c) &\Longleftrightarrow d|a,b,c\\
&\Longleftrightarrow d|\gcd(a,b),c
\end{align*}$$
A: First note that $(a,b) \mapsto \gcd(a,b)$ is symmetric in $a$ an $b$.  Suppose $d$ is a commond divisor of $a$, $b$ and $c$.  Then $c|a$ and $d|\gcd(b,c)$ so $d|\gcd(a, \gcd(b,c))$.   
Conversely suppose that $d$ is a common divisor or $a$ and $\gcd(b,c)$. Then $d|a$ and 
$d|\gcd(a,b)$.  Hence, $d$ is a common divisor of $a$, $b$ and $c$.  
Our result follows now by symmetry.
A: Here is a proof I am attempting from all the hints I have got so far. Please let me know if this is correct.
Let $d = \gcd(a, \gcd(b, c))$. Therefore,


*

*$d \geqslant 0$ from the definition of GCD.

*$d|a$ from the definition of GCD.

*$d|\gcd(b, c)$ from the definition of GCD.

*$e|a$ and $e|\gcd(b,c)$ implies $e|d$, also from the definition of GCD.

*From 3, $d|b$.

*From 3, $d|c$.

*From 2 and 5, $d|\gcd(a, b)$.

*Let $e|\gcd(a, b)$ and $e|c$. From the definition we know that $\gcd(a, b) | a$ and $\gcd(a, b) | b$. Therefore, $e|a$ and $e|b$ from the transitive property of divisibility. So, $e|\gcd(b, c)$ from the definition of GCD. So, from 4 we have, $e|$d.


From 1, 7, 6 and 8, we get, $d = \gcd(\gcd(a, b), c)$.
