Integral Domains and Unique Factorisation Domains I'm learning about Rings, commutative rings, IDs, UFDs, etc with each being a subset of the predecessor, and I'm now trying to find an ID that is not a UFD
I understand $\mathbb Z[\sqrt{-5}]$ is an Integral domain, but not a UFD, but I'd like a bit of explanation as to why?
First: $\mathbb Z[\sqrt{-5}] = x + y \sqrt{-5}$ where $x, y \in \mathbb C$
What is this 'thing'. I'd like to understand it in words... I initially thought it was every multiple of $\sqrt{-5}$ in the complex plane but I can see that's not true, so how would you explain it in words?
Does this exist at every point in $\mathbb C$?
And finally, can you please explain a simple case of it where it is an ID but not a UFD?
Thanks a lot!
 A: So, first of all you have the definition of $\mathbb Z[\sqrt-5]$ incorrect. This object is the collection of all those numbers of the form
$$a + b\sqrt{-5} \ \text{for} \ a,b \in \mathbb{Z}$$
This is why it is written $\mathbb{Z}$ adjoin $\sqrt{-5}$.
To see why this is not all of $\mathbb{C}$, we need only check that, for instance, $\frac{1}{2}$ is not an element of this collection.
Why is this an integral domain? Well, since $\mathbb Z[\sqrt-5]$ is just a subset of $\mathbb{C}$ there cannot exist any zero divisors in the former, since $\mathbb{C}$ is a field.
Why is this not a unique factorization domain? Notice that $6 = 6 + 0\sqrt{-5}$ is an element of the collection and, for the same reason, so are $2$ and $3$. Moreover, one can check that $2$ and $3$ are irreducible. But we have also that 
$$6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}),$$
with both $(1 + \sqrt{-5})$ and  $(1 - \sqrt{-5})$ as irreducible elements as well.
Now a question for you: can you show why these numbers are irreducible in $\mathbb Z[\sqrt-5]$, as I've claimed?
A: You misunderstood the definition:
$$
\Bbb{Z}[\sqrt{-5}] := \left\{ a + b \sqrt{-5} : a,b \in \Bbb{Z} \right\}
$$
This is an integral domain because
$$
(a + b\sqrt{-5}) (c + d\sqrt{-5}) = ac - 5bd + (ad + bc)\sqrt{-5}
$$
is $0$ if and only if $(a,b) = (0,0)$ or $(c,d) = (0,0)$, as a direct consequence of $\Bbb{Z}$ being an integral domain[1]. Indeed, suppose that these were (non-zero) zero-divisors. Then neither $a$ or $b$ can be zero, otherwise both $c$ and $d$ are forced to be $0$ because $\Bbb{Z}$ has no zero-divisors. But if $a \neq 0$ then (in $\Bbb{Z}$)
$$
\begin{cases}
ac = 5bd\\
ad = -bc
\end{cases}
\quad \Rightarrow \quad
\begin{cases}
acd = 5bd^2\\
adc = -bc^2
\end{cases}
\quad \Rightarrow \quad
b(c^2 + 5d^2) = 0
$$
which is absurd because $5d^2$ is not a square unless $d \neq 0$ and there are no zero-divisors in $\Bbb{Z}$.
[1] I added this proof to make it clear that $\Bbb{Z}[\sqrt{-5}]$ is a domain if and only if $\Bbb{Z}$ is a domain. A quicker way to see that $\Bbb{Z}[\sqrt{-5}]$ must be a domain would be to see it as a sub-ring of $\Bbb{C}$.

To see that it is not a UFD all you have to do is find an element which factors in two distinct ways. To this end, consider
$$
6 = 2 \cdot 3 = (1+\sqrt{-5})(1-\sqrt{-5})
$$
and prove that $2$ is irreducible but doesn't divide $1 \pm \sqrt{-5}$. This is enough because in a UFD every irreducible element is prime.
Define $N(a+b\sqrt{-5}) := a^2+5b^2$ (this is called the norm of $a+b\sqrt{-5}$) and observe that if $x,y \in \Bbb{Z}[\sqrt{-5}]$ are such that $x \mid y$, then $N(x) \mid N(y)$. In particular, the invertible elements are exactly the elements of norm $1$. This means that if $2$ isn't irreducible, then there must be some non-invertible $x \in \Bbb{Z}[\sqrt{-5}]$ such that $N(x) | 4$ and $x \neq \pm 2$. But $a^2 + 5b^2 = 2$ has no solutions $(a,b) \in \Bbb{Z}^2$ and the only solutions of
$$
a^2 + 5b^2 = 4
$$
with $a,b \in \Bbb{Z}$ are $(a,b) = (\pm 2,0)$. Finally, you can easily see that there are no $a,b \in \Bbb{Z}$ such that
$$
1 + \sqrt{-5} = 2 (a + b\sqrt{-5}) = 2a + 2b\sqrt{-5}
$$
and similarly for $1 - \sqrt{-5}$.
A: I want you to think about numbers of the form $x + y \sqrt{-5}$ with $x, y \in \mathbb{Q}$. The set of all such numbers is usually notated $\mathbb{Q}(\sqrt{-5})$ but you may occasionally see different notations. $\mathbb{Q}(\sqrt{-5})$ includes numbers like $\frac{7}{3}$, $\frac{22 \sqrt{-5}}{7}$, $\frac{3}{2} + 47 \sqrt{-5}$. All numbers in $\mathbb{Q}(\sqrt{-5})$ are algebraic numbers, meaning each is the root of a polynomial with integer coefficients. For example, $\frac{3}{2} + 47 \sqrt{-5}$ is the root of $4x^2 - 12x + 44189$.
Just as some rational numbers are integers, some algebraic numbers are algebraic integers. For an algebraic number to be an algebraic integer there is the additional requirement that it be the root of a polynomial with the leading coefficient 1 (often tacit). So $\frac{3}{2} + 47 \sqrt{-5}$ is an algebraic number but not an algebraic integer because in the polynomial given above the leading coefficient is 4. Nor can we find a different polynomial for it with a leading coefficient of 1. Now, a number like $\sqrt{-5}$ is indeed an algebraic integer and the polynomial is easy: $x^2 + 5$.
Which numbers in $\mathbb{Q}(\sqrt{-5})$ are algebraic integers? That turns out to be all numbers of the form $x + y \sqrt{-5}$ with $x, y \in \mathbb{Z}$ (the proof is short enough but this answer is long enough as it is). This is usually notated $\mathbb{Z}[\sqrt{-5}]$ but you may occasionally see different notations. $\mathbb{Z}[\sqrt{-5}]$ is not only a ring of algebraic integers, it is also an integral domain. The definition of an integral domain, in words, is "a commutative ring with an identity ($1 \neq 0$) with no zero-divisors" (http://www-history.mcs.st-and.ac.uk/~john/MT4517/Lectures/L4.html). Verify that if $a, b \in \mathbb{Z}[\sqrt{-5}]$, then $a + b = b + a$, $ab = ba$, $a + b \in \mathbb{Z}[\sqrt{-5}]$, $ab \in \mathbb{Z}[\sqrt{-5}]$, and if $ab = 0$ that means either $a = 0$ or $b = 0$. The identity element is 1, just like in $\mathbb{Z}$.
To illustrate how the numbers of $\mathbb{Z}[\sqrt{-5}]$ fit in the complex plane, I made this diagram:

The central horizontal line is the real number line, and the central vertical line is the imaginary number line. The black dot represents 0. Only those points on the intersections of black lines correspond to numbers in $\mathbb{Z}[\sqrt{-5}]$.
The white dots represent $-1$ and 1. The red dots represent $-2 + \sqrt{-5}$, $-2 - \sqrt{-5}$, $2 + \sqrt{-5}$ and $2 - \sqrt{-5}$. The green dots represent $-7$, $-3$, 3 and 7. My original version of this diagram had blue dots for $-21$ and 21, but that would have made the diagram too big.
$\mathbb{Z}[\sqrt{-5}]$ is not a unique factorization domain. The classic example of 6 could be considered "minimal," but I'm tired of it, so I'll give you the example of 21 instead. It's important to point out that multiplication by units does not create distinct factorization (the units in this domain are $-1$ and 1, color-coded white in the diagram above). For example, $3 \times 7 = -3 \times -7 = 21$ represents a single factorization of 21. All we did was multiply 3 and 7 by $-1$.
Now I just realized the complex numbers I wanted in my diagram above were $4 - \sqrt{-5}$ and $4 + \sqrt{-5}$. I don't feel like re-doing the diagram and uploading it again. Just use your mind to imagine a diagram big enough to include those two numbers. Notice that $(4 - \sqrt{-5})(4 + \sqrt{-5}) = 21$. But $\frac{4 + \sqrt{-5}}{3} \not\in \mathbb{Z}[\sqrt{-5}]$, $\frac{4 + \sqrt{-5}}{7} \not\in \mathbb{Z}[\sqrt{-5}]$ either, similar statements for $4 - \sqrt{-5}$. Multiplying $4 - \sqrt{-5}$ and $4 + \sqrt{-5}$ by $-1$ gives us $-4 + \sqrt{-5}$ and $-4 - \sqrt{-5}$, but $(-4 + \sqrt{-5})(-4 - \sqrt{-5})$ is not a distinct factorization of 21 for the same reason that $-3 \times -7$ is not distinct from $3 \times 7$.
But $3 \times 7$ is distinct from $(4 - \sqrt{-5})(4 + \sqrt{-5})$. This confirms that $\mathbb{Z}[\sqrt{-5}]$ is not a unique factorization domain. In summary, $\mathbb{Z}[\sqrt{-5}]$ is an integral domain, but it's not a UFD. If you peek ahead in your book, you might see Euclidean domains and principal ideal domains. But for now, suffice it to say that $\mathbb{Z}[\sqrt{-5}]$ is neither Euclidean nor PID.
