I am having some issues understanding the gcd. I am using "Art of Proof," and in this book, the gcd(m,n) is defined as being:
"the smallest element of the set S = {k $\in$ N : k = mx+ny for some x, y $\in$ Z}
I guess my issue is that I don't really understand what k=mx+ny is in the context of gcd.
To provide some context for my confusion, we are asked to use the gcd definition when we prove various things about prime numbers and specifically Euclid's lemma. I have been struggling with this and I think part of it is because I don't really understand the algorithmic definition of gcd.
If we take as definition of the g.c.d. of $m$ and $n$: ‘the greatest natural number which is a divisor of both $m$ and $n$, the smallest element of $S$ satisfies this definition.
Indeed, let's denote $d$ this smallest element non-zero of $S$. Thus, we have $d=xm+yn$ for some $x,y\in\mathbf Z$. Perform the Euclidean division of $m$ by $d$: $$m=qd+r,\quad 0\le r<d$$ We deduce that $$ r=m-qd=(1-qx)m-(qy)n\in S. $$ As $d$ is the smallest positive element of S, this relation implies $r=0$. In other words, $d$ divides $m$. For similar reasons, $d$ divides $n$.
On ther other hand, $d$ is the greatest common divisor of $m$ and $n$, since if $d'\mid m$ and $d'\mid n$, $d'$ divides any linear combination of $m$ and $n$ – in particular, it divides $d$.