Need help with proof: $a \mathbb Z + b \mathbb Z = gcd(a,b) \mathbb Z$ As the title says I am trying to prove $a \mathbb Z + b \mathbb Z = gcd(a,b) \mathbb Z$.
My steps so far:
$$a \mathbb Z + b \mathbb Z = \{ a z_1 + bz_2 : z_1, z_2 \in \mathbb Z \} = \{ kp z_1 + lpz_2 : z_1, z_2 \in \mathbb Z \}$$
where $p=gcd(a,b)$, $kp=a$ and $lp=b$.
$$\ldots = \{ p \cdot (k z_1 + l z_2) : z_1, z_2 \in \mathbb Z \} = p \{(k z_1 + l z_2) : z_1, z_2 \in \mathbb Z \}$$
So far, so good. What remains to show is that
$$\{(k z_1 + l z_2) : z_1, z_2 \in \mathbb Z \} = \mathbb Z $$
since then it would follow that
$$p \{(k z_1 + l z_2) : z_1, z_2 \in \mathbb Z \} = p \mathbb Z $$
but here I am stuck. I suspect it has something to do with the fact that $k$ and $l$ are coprime? Maybe there is a theorem about linear combinations of coprime numbers that somehow generates all integers? In any case, help is much appreciated!
 A: I think the most direct way to show this is by dual inclusion, as this is set equality after all. Let $d$ be the gcd of $a,b$. We want to show that
$$
d\mathbb{Z} = a\mathbb{Z} + b\mathbb{Z}
$$
Fix some $ax+by \in a\mathbb{Z} + b\mathbb{Z}$. Since $d|a$ and $d|b$ we have that:
$$
ax+by = da'x+db'y  = d(a'x+b'y) \in d \mathbb{Z}
$$
for some $a',b' \in \mathbb{Z}$. Thus we have that $a\mathbb{Z} + b\mathbb{Z} \subseteq d \mathbb{Z}$.
Now fix some $dx \in d\mathbb{Z}$. By Bezout's identity, we know that there exists some $u,v \in \mathbb{Z}$ such that $ua+vb = d$, so we have that:
$$
dx = (ua+vb)x = (ux)a + (uv)b \in a\mathbb{Z}+b\mathbb{Z}
$$
so we have that $d\mathbb{Z} \subseteq a\mathbb{Z}+b\mathbb{Z}$ and thus the equality of sets.
A: Sometimes Bezout's identity is derived from the equality $a\Bbb Z+b\Bbb Z =\gcd(a,b)\Bbb Z$, so here here is a proof that avoids that. (Of course it is very similar arguing and if you already proved Bezout's identity, e.g. using the euclidean algorithm, then the other solution is probably better).
By the euclidean algorithm $\Bbb Z$ is a PID, hence there is some $c\in\Bbb Z$ such that $$a\Bbb Z+b\Bbb Z=c\Bbb Z$$ We want to show that $c=\varepsilon\gcd(a,b)$ for some unit $\varepsilon\in\{-1,1\}$. Since $a,b\in c\Bbb Z$ we see $c\mid a,b$ so $c$ is a common divisor of $a,b$. We need to verify the universal property in the sense that for any other common divisor $d\mid a,b$ we have $d\mid c$. So let $d\mid a,b$. Then $a\Bbb Z,b\Bbb Z\subseteq d\Bbb Z$. Therefore $$c\Bbb Z=a\Bbb Z+b\Bbb Z\subseteq d\Bbb Z$$ This implies $d\mid c$. Hence $c$ is a greatest common divisor of $a,b$ and the claim follows.
A: It follows immediately from the (universal) definition of ideal sum and the fact that $\,\Bbb Z\,$ is a PID, i.e.
$\begin{align} \forall\ C\!:\,\ \ C\, \supseteq\ A,\,\ B\ \,&\iff\, C\,\supseteq \ A\,+\,B,\, \text{the def'n of ideal sum, becomes in a PID}\\[.3em]
\forall\,(c)\!:\ (c) \supseteq (a),(b)&\iff (c)\supseteq (a)+(b) =: (d),\ \text{becomes in divisibility language}\\[.3em]
\forall\, \ c\!:\,\ \ \ \  c\ \ \mid\,\ \ a,\,\ \ b\ \,&\color{#c00}\iff c\,\mid\, d,\,\ \text{by contains = divides for principal ideals}\\[.3em]
\!\!\!\iff \gcd(a,b) = |d|\ \ \ {\rm [\,or}\ &\,d\,\ {\rm is\ associate\ to}\ \,\gcd(a,b)\,\ \text{in a general domain } D\,]
\end{align}$
since $\ d\mid a,b\ $ by $\,c\!=\!d\;$ in $\,(\!\color{#c00}{\Longleftarrow}\!),\,$ so $\,|d|\,$ is a common divisor of $\,a,b,\,$ necessarily the greatest such since it is divisible by every common divisor $\,c\,$ by $\,(\!\color{#c00}{\Longrightarrow}\!)$
Remark $ $ The $\color{#c00}{\rm red}$ equivalence above is in fact the definition of a gcd in general domains, i.e. a gcd is a common divisor that is divisibly greatest, i.e. an infimum (greatest lower bound) in the poset induced by the divisibility partial order.
