Proof of equality of two finitely generated subgroups I want to prove the following: Let $m,n\in \mathbb{Z}$. Prove that $\langle m,n \rangle =\langle d \rangle$ iff. $d=\mathrm{gcd}(m,n)$.
Here is my proof. One direction is straightforward, however I'm unsure about the converse (can I really conclude that $d=\mathrm{gcd}(m,n)$ ?). Could someone tell me if my proof inadequate?
First, if $d=\mathrm{gcd}(m,n)$, then by Bézout's identity, $\exists \, r,s\in \mathbb{Z}$ s.t. $d=rm+sn$. An element $x\in \langle m,n \rangle$ is of the form $x=am+bn$ for $a,b\in \mathbb{Z}$. Moreover, since $d$ divides both $m$ and $n$, then for some $m',n'\in \mathbb{Z}$, we have that $x=am'd+bn'd=(am'+bn')d\in \langle d \rangle$. Hence, $\langle m,n \rangle \subset \langle d \rangle$. Also, because elements of $\langle d \rangle$ are of the form $kd=(kr)m+(ks)n$, $k\in \mathbb{Z}$, they are in $\langle m,n \rangle$, thus $\langle d \rangle \subset \langle m,n \rangle$. We conclude that $\langle m,n \rangle = \langle d \rangle$. 
EDIT of converse: Conversely, suppose that $\langle m,n \rangle = \langle d \rangle$. Since $m,n \in \langle m,n \rangle$, then $m,n \in \langle d \rangle$, and so for some $k,k' \in \mathbb{Z}$, $m=kd$ and $n=k'd$, hence $d$ is a common divisor of $m$ and $n$. We claim that $d=\mathrm{gcd}(m,n)$. Indeed, suppose $\bar{d}$ is another common divisor of $m$ and $n$, i.e., $m=\bar{m}\bar{d}$, $n=\bar{n}\bar{d}$, for some $\bar{m},\bar{n}\in \mathbb{Z}$. Knowing that elements in $\langle m,n \rangle$ can be expressed as linear combinations of $m$ and $n$ we can write, for $d\in \langle m,n \rangle$, and for some integers $r$ & $s$, $$d=rm+sn=r\bar{m}\bar{d}+s\bar{n}\bar{d}=\bar{d}(r\bar{m}+s\bar{n}) \Rightarrow \bar{d}|d. $$ We conclude that $d=\gcd(m,n)$. This completes the proof.
 A: I think what you're trying to prove is not strictly true, since for any $m,n\in\mathbb{Z}$, $\gcd(m,n)\ge0$.
I think what you should try to prove is the following:
Claim: Let $m,n,d\in\mathbb{Z}$ with $d\ge0$. Then $\langle m,n\rangle=\langle d\rangle$ iff $d=\gcd(m,n)$.
So for this proof, you should assume that $m,n,d\in\mathbb{Z}$ and that $d\ge0$. Then you should show that $\langle m,n\rangle=\langle d\rangle$ iff $d=\gcd(m,n)$.
Your proof of the first direction (i.e. $\langle m,n\rangle=\langle d\rangle$ implies $d=\gcd(m,n)$) is fine, assuming you've already established Bézout's identity.
For the other direction, you can use the following characterization of the GCD: for any $m,n,d\in\mathbb{Z}$, $d=\gcd(m,n)$ iff the following hold:


*

*$d\ge0$

*$d$ divides $m$ and $d$ divides $n$

*for all $x\in\mathbb{Z}$, if $x$ divides $m$ and $x$ divides $n$, then $x$ divides $d$.


Hence to finish your proof of the converse, you just need to show that $x\in\mathbb{Z}$ and $x$ divides both $m$ and $n$, then $x$ divides $d$.
I hope this was helpful. Good luck!
