Why do $g'|g$ and $g|g'$, when $g=\gcd(a,b)$ and $g'=\gcd(a,b)$? According to >this proof<, the author is saying that
$g=\gcd(a,b)$, $g'\in\mathbb{N}$, and $g'=\gcd(a,b)$.
The author then states that $g'|g$ and $g|g'$.
From my understanding, $g'*k_1=a$ and $g*k_2=a$ [where $k_1$ and $k_2$ are integers].
It follows that $g'*k_1=g*k_2$.
But from that, how can one reach the conclusion that $g'|g$ and $g|g'$?
Edit:
The given definition of Greatest Common Divisor:
$g$ is the greatest common divisor of a and b, where $a$ and $b$ are non-zero integers if:


*

*$g|a$ and $g|b$

*if $c$ is any integer such that $c|a$ and $c|b$, then $c\leq{g}$
Edit2:
I'm assuming that $g$ and $g'$ are some greatest common divisors of $a$ and $b$.
 A: Your statement is rather ambiguous. You probably want to show that if $g$ and $g'$ both satisfy the requirements for being a greatest common divisor of $a$ and $b$, then $g=g'$. (You cannot use $g=\gcd(a,b)$ until you have proved uniqueness, so this is why your statement is ambiguous.)
This depends on what definition of greatest common divisor you use. There are two common ones, when restricting ourselves to the natural numbers.

First definition. The greatest common divisor of $a$ and $b$ (not both $0$) is the largest common divisor of $a$ and $b$.

With this definition, there is no problem in stating uniqueness.

Second definition. A number $g$ is a greatest common divisor of $a$ and $b$ if

*

*$g\mid a$ and $g\mid b$

*for all $c$, if $c\mid a$ and $c\mid b$, then $c\mid g$

With this definition, uniqueness must be proved. Thus, since you're asking, I'll assume this is your definition.
Now, suppose $g$ and $g'$ both satisfy the requirements above.
Since $g\mid a$ and $g\mid b$ by 1 applied to $g$, we get, from 2 applied to $g'$ with $c=g$, that $g\mid g'$.
Since $g'\mid a$ and $g'\mid b$ by 1 applied to $g'$, we get, from 2 applied to $g$ with $c=g'$, that $g'\mid g$.
From here the proof of $g=g'$ follows easily.
A: As $g'$ is a greatest common divisor of $a,b$ we have that $g' \mid a$ and $g' \mid b$, by definition. Now by the definition of a greatest common divisor $g$ is divided by any number that divides both $a$ and $b$, hence $g' \mid g$. Similarly we prove that $g \mid g'$, which implies that $g = g'$.
A: The proof shows that a gcd exists, then goes on to show that there can only be one gcd. He says to suppose that both $g$ and $g'$ are gcd's of $a$ abd $b$.
As egreg stated, the normal definition of gcd(a,b) is

  
*
  
*$g\mid a$ and $g\mid b$
  
*for all $c$, if $c\mid a$ and $c\mid b$, then $c\mid g$
  

If that's the case, it follows that $g \mid g'$ and $g' \mid g$. He argues that, clearly then, $g = g'$. Well, to be truely picky, he's wrong. If we are using the set of all integers, then it follows that $ g = \pm g'$. In a ring $R$, $u \in R$ is a unit if $u^{-1}$ exists in $R$. The units of the set of integers are $1$ and $-1$. If $x,y \in R$ can be expressed as $s = uy$, where $u$ is a unit in $R$, then $x$ and $y$ are called associates. So it would be more correct to say that any two gcd's of $a$ and $b$ are associates of each other.
To be honest, I have never seen your definition before:

  
*
  
*$g\mid a$ and $g\mid b$
  
*for all $c$, if $c\mid a$ and $c\mid b$, then $c \le g$
  

but it does work for the set of integers. And we could argue that,if $g$ and $g'$ are gcd's of $a$ and $b$, then $g \le g'$ and $g' \le g$. It would follow that $g=g'$.
A: Worth explicit emphasis: this uniqueness of the gcd (up to associates)   follows immediately from the universal property of the gcd (as for all universal specified objects); said in elementary language:
the OP gcd definition is equivalent to $\  d\mid a,b \!\!\color{#c00}{\overset{\rm def\!\!}\iff} d\mid \gcd(a,b),\,\ {\rm for\ all}\,\ d\in \Bbb N$
therefore  $\,\color{#0af}{g=}\gcd(a,b)\color{#0a0}{=g'}\,$ implies $\ \color{#0af}{d\mid g} \!\color{#c00}{\overset{\rm def\!\!}\iff}\, d\mid a,b \!\color{#c00}{\overset{\rm def\!\!}\iff}\, \color{#0a0}{d\mid g'}$
Choose $\,\color{#0a0}{d = g'}\,$ in $(\color{#c00}{\Leftarrow\Leftarrow})$ above $\Rightarrow \color{#0af}{\color{#0a0}{g'}\mid g},\,$ & $\,\color{#0af}{d\!=\!g}\,$ in $(\color{#c00}{\Rightarrow\Rightarrow})$ above $\Rightarrow \color{#0a0}{\color{#0af}g\mid g'}.\ \small\bf QED$

Remark $ $ If ideals are familiar then since $\Bbb Z$ is a PID the hypothesis is equivalent to
$$ (g) = (a,b) = (g')\qquad $$
so $\,(g)\supseteq (g')\Rightarrow g\mid g'\:\!;\,$ reversely $\,g'\mid g\,$ via swap $\,g\,$ & $\,g'$ (by symmetry).
