Find a generator for ideal $(a,b)$ in an euclidean domain [Euclidean $\Rightarrow$ PID] 
Let $D$ be a euclidean domain and $a, b \in D$. Show that $M = \{xa + yb \ \mid \ x, y \in D\} $ is an ideal of $D$. Find $d \in D$ such that $M = \langle d \rangle$ and prove your claim.

My effort: we can extend Bezout's identity to euclidean domains (I see nothing in the proof that can't be extended here) to find $\alpha, \beta \in D$ such that $d \doteq 
  \text{gcd } (a,b) = \alpha \cdot a + \beta \cdot b$. Then, given any $x \in D$, we have $x d = x\cdot (\alpha \cdot a + \beta \cdot b) = (x\alpha)a + (x \beta)b \in M$, therefore $\langle d \rangle \subset M$. Conversely, since $a = d m $ and $b = d n$ for some $m, n \in D$, given $xa + yb \in M$, we have $xa + yb = d(xm + yn) \in \langle d \rangle$, whence $M \subset \langle d \rangle$, and then $M = \langle d \rangle$. 
Is this alright? I'm always wary of questions that are solved too easily (and I'm usually right for that, since my solutions are usually wrong in those cases), so I'd appreciate a second opinion/corrections.
 A: Yes, the proof of the Bezout identity is the same as in $\Bbb Z,\,$ e.g. see here.. We can finish more simply as below, similer to the Euclidean algorithm
$$\begin{align} (a,b) &= (d,a,b)\ \ \ {\rm by} \ \ d\in (a,b)\\
                     &= (d,\color{#c00}{0,0})\ \ \ {\rm by} \ \ a\equiv \color{#c00}0\equiv b\!\!\!\pmod{\!d}
\end{align}\qquad\qquad$$
Generally it is true that  $\ (d,I) = (d,\,I\bmod d)\,$ for any ideal $I\,$ (with easy proof -  à  la Euclid in $\Bbb Z)$
Remark $ $ The key idea is that ideals are closed under remainder (mod), so the "least" $\,d\in I\,$ must divide every $\,i\in I,\,$ else $\,0\neq i\ {\rm mod}\ d\,$ is in $\,I\,$ and smaller than $\,d,\,$ contra minimality of $\,d.\,$ The descent in this proof can be interpreted constructively as computing a generator of $\,I\,$ by computing the gcd of its elements (by taking repeated remainders).
The idea extends to PIDs: (Dedekind-Hasse criterion) 
 a domain $\rm\,D\,$ is a PID iff given  $\rm\:0\neq a, b \in D,\:$ 
 either $\rm\:a\:|\:b\:$ or some D-linear combination $\rm\:a\,d+b\,c\:$ is "smaller" than $\rm\,a.\,$ In a PID we can choose the number of prime factors as a measure of (Euclidean) size.
A: That looks great to me.  This is exactly the power of Bezout's identity to show that finitely generated ideals are principal.  
It is perhaps worth noting that you should also be able to do it in even more generality for any ideal, not just finitely generated ideals. You simply choose an element of minimal degree under the Euclidean division algorithm and it will generate the ideal. See for example: https://proofwiki.org/wiki/Euclidean_Domain_is_Principal_Ideal_Domain
