TITLE: Can you find a domain where $ax+by=1$ has a solution for all $a$ and $b$ relatively prime, but which is not a PID?
QUESTION [17 upvotes]: In Intro Number Theory a key lemma is that if $a$ and $b$ are relatively prime integers, then there exist integers $x$ and $y$ such that $ax+by=1$.  In a more advanced course instead you would use the theorem that the integers are a PID, i.e. that all ideals are principal.  Then the old lemma can be used to prove that "any ideal generated by two elements is actually principal."  Induction then says that any finitely generated ideal is principal.  But, what if all finitely generated ideals are principal but there are some ideals that aren't finitely generated?  Can that happen?

REPLY [2 votes]: I found this 6-year old question when I was searching about Bézout domains and I think I can say something about the question. Well, more exactly I think the work of P. M. Cohn in his paper "Bézout rings and their subrings" deserves to be exposed. 
First, let me give some terminology. Given an integral domain $R$, we say that $a,b\in R$ are coprime if $\gcd(a,b)$ exists and $\gcd(a,b)=1$. On the other hand, we say that $a$ and $b$ are comaximal if there are $x,y\in R$ such that $ax+by=1$. 
It's easy to see that comaximal $\implies$ coprime, but the other implication isn't necessarily true. Domains where coprime $\implies$ comaximal were called by Cohn Pre-Bézout domains. As the names suggest, these aren't necessarily Bézout domains, because we only have the "Bézout relationship" for coprime elements. But, it turns out that we can use Pre-Bézout domains to characterize Bézout domains among the class of GCD domains. More exactly, it's true the following:
Theorem: Let $R$ be an integral domain. TFAE:
i) $R$ is a Bézout domain.
ii) $R$ is a GCD Pre-Bézout domain.
Proof: i)$\implies$ii) It's immediate.
ii)$\implies$i) Let $a,b\in R$. WLOG, we can suppose that $a\neq 0\neq b$. As $R$ is a GCD domain, then $d=\gcd(a,b)$ exists. By an elementary property of gcds we have that $1=\gcd(a/d,b/d)$ and since $R$ is Pre-Bézout then $a/d$ y $b/d$ are comaximal, which means that there are $x,y\in R$ such that $$\frac{a}{d}x+\frac{b}{d}y=1.$$ Finally, if we multiply by $d$ the above equality we get $$ax+by=d.$$
Thus $d$ is a $R$-linear combination of $a$ and $b$. Hence, $R$ is Bézout domain.
In conclusion, according to Cohn, the class of domains you are looking for are known as Pre-Bézout domains, and these aren't necessarily Bézout domains, let alone PIDs.