Q:

Let $A$ be a principal ideal domain, and $a,b,d$ elements of $A$. Prove that $d$ is a gcd of $a$ and $b$ if and only if $aA+bA=dA$.

I can prove that $aA+bA=dA$ implies that $d$ is a gcd of $a$ and $b$. I can also prove that $d$ being a gcd of $a$ and $b$ implies that $aA+bA\subset dA$, since $a+b$ is a multiple of $d$. What im struggling with is the final piece: proving it also implies $dA\subset aA+bA$. 
I realize $aA+bA=dA$ is equivalent to $ax+by=d$ for some $x,y$ in $A$, but the only proofs I found online are for $A=\mathbb{Z}$ or $A=F[x]$ for some field $F$. Both of these make use of a Division Algorithm and I can't find a way to generalize that. 
I just started doing ring theory a few days ago, so my understanding of rings is still quite small.

A:

Use the hypothesis that $A$ is a PID:
Consider the ideal generated by $a$ and $b$, i.e. $aA+bA$. Now, since $A$ is a PID, this ideal is generated by one element, say $\delta$: yielding $aA+bA=\delta A$.
But now, by your first step, $\delta$ is a $\gcd$ of $a$ and $b$, hence it is associate to $d$ (i.e. $d=\delta u$ with a unit $u$), so $dA=\delta A = aA+bA$. -QED-

