I'm trying to comprehend a proof from my Elementary Number Theory course. Here, a quadratic integer $\theta$ is a solution of an equation of the form $x^2 + bx + c = 0$ with $b$ and $c$ integers.
Let $R = \mathbb{Z}[\theta]$ be a quadratic integer ring, and suppose that for every $a, b$ in $R$ not both zero, there exists a linear combination of $a$ and $b$ that divides both $a$ and $b$. Show that every irreducible element of $R$ is prime, so that unique factorization holds in $R$.
Official solution: Let $r$ be an irreducible element of $R$, and suppose that $r$ divides a product $s t$ of elements of $R$. We must show that $r$ divides $s$ or $r$ divides $t$. Suppose that $r$ does not divide $s$. By hypothesis, there is a linear combination $n r+m s$ (for some $n, m \in R)$ that divides both $r$ and $s ;$ since no associate of $r$ can divide $s, n r+m s$ must be a unit, which without loss of generality we can assume equal to 1. Then $1=n r+m s$, so $t=n r t+m s t$, and since $r$ divides nrt and $m s t$ we must have $r$ divides $t$.
I don't understand the line: ...is a linear combination $n r+m s$ (for some $n, m \in R)$ that divides both $r$ and $s ;$ since no associate of $r$ can divide $s, n r+m s$ must be a unit, which without loss of generality we can assume equal to 1. Why does "no associate of $r$ can divide $s$" imply that $n r+m s$ must be a unit? Also, is it correct that all units in quadratic integer rings are of form $\pm 1$?
Does showing that every irreducible element is prime imply that the ring we are working in is a UFD? How can I come to that conclusion? (I factor into irreducibles, and using the prime property I continuously "delete" the same irreducibles from both sides of the equation, thus we have unique factorization. I hope this is correct?)
Again, partial answers (answering only one of the questions) are very welcome! I will upvote them too. If there are any other solutions to the above problem, not necessarily following the official solution, then those are also very welcome! Thanks in advance!
It is a special case of a standard proof that irreducibles are prime in (Bezout $\Rightarrow$) gcd domains. The hypothesis implies that $\,\gcd(a,b)\,$ exists for all $\,a,b\,$ not both $\,0,\,$ since linear common divisors are always greatest, i.e. by hypothesis there are $\,r,s\in R$ with $\,d := ar+bs\mid a,b\,$ a common divisor, necessarily (divisibly) greatest, by $\,c\mid a,b\Rightarrow c\mid ra+sb = d.\,$
Below is the standard proof of Euclid's Lemma in gcd form and Bezout form
Lemma $\ \ (p,a)=1,\ p\mid ab\,\Rightarrow\, p\mid b,\ $ with proof as below
$\color{#c00}{\rm GCD}\text{ form:}\ \ \ \ \ \color{#c00}{(a,\ p)\ =\ 1},\ p\mid ab,pb\,\Rightarrow\, p\mid (ab,\ pb)\, =\ \ \color{#c00}{(a,\ p)}b\ =\ b$
$\color{#0a0}{\rm Bezout}\text{ form:}\ \ \ \color{#0a0}{ra\!+\!sp=1},\ p\mid ab,pb\,\Rightarrow\, p\mid rab\!+\!spb = (\color{#0a0}{ra\!+\!sp})b = b$