In an earlier section we tackled the gaussian integers, but that was relatively easy, since the gaussian integers form a pid. With some help from localization, analogous reasoning allows us to characterize the prime ideals of S, the integral ring of E/Q.
Let E = Q[u], where u = sqrt(m).
Turn S into a pid by localizing about the prime ideal P = {p} in Z. This does not change the splitting problem, i.e. the factorization of p*S inside S.
Only prime ideals Q lying over P survive localization. They may be found by searching for their prime generators.
The norm is the same formula we saw before, |a+bu| = a2-mb2, but this time a and b could be rational, as long as they don't have p in the denominator.
First assume p is odd, and p does not divide m. In the context of this pid, p is composite iff some element f has a norm that is an associate of p. Thus f times its conjugate is an associate of p. This means a2-mb2 is divisible by p, and not p2. Get a common denominator for a and b, and look at numerators. Now a2-mb2 is divisible by p, and not p2, where a and b are integers. Write a2 = mb2 mod p, whence a = b = 0 (which would make the expression divisible by p2), or m is a square mod p. (We saw this with the gaussian integers; -1 had to be a square mod p).
Conversely, let m be a square mod p. Set a = sqrt(m) and b = 1. Now f times its conjugate is divisible by p, yet it is smaller than p2. And we don't have to worry about |f| = 0, because m is square free. Thus |f| is an associate of p in ZP. Therefore f is a proper factor of p iff m is a square mod p.
Suppose f, a proper factor of p, is an associate of its conjugate. That makes the quotient a unit in SP. Write this as f2/|f|. The denominator has one factor of p. The numerator includes the term 2abu. Since p does not divide 2, a, or b, the numerator is not divisible by p. The quotient is not part of SP, f and its conjugate are not associates, and P splits into two distinct primes.
Remember that norm equals index, so the residue field of f has size p, just like p in Z. The residue degree is 1, and since there is but one factor of f in p, i.e. p = f times f conjugate, the ramification degree is also 1. This happens across two primes, f and f conjugate, hence the degree equation is satisfied. This is a good sanity check on our work.
Let p = 2, where p still does not divide m. Now a and b are rational, with odd denominators, or denominators with one factor of 2 (if m = 1 mod 4). Again, we are looking for f = a+bu, with |f| = 2. Clear any odd denominators, which are units in SP. If b is an even integer than a is also even, and the norm is divisible by 4. A similar result holds if a is even. If a and b are odd integers we can obtain 2 mod 4, but only when m is 3 mod 4. This is illustrated by 1+i over 2, when m = -1 (the gaussian integers).
Finally let a and b be half integers. Multiply through by 4 and the right side is 8, not 16. Write a2 = mb2 mod 8, but not mod 16. An odd square mod 16 is either 1 or 9. Suitable values of a and b can be found iff m = 1 mod 8. When m = 1 mod 16 try a = 3 and b = 1, and when m = 9 mod 16 try a = b = 1.
Conversely, set a = b = 1 when m = 3 mod 4, a = b = 1/2 when m = 9 mod 16, and a = 3/2 and b = 1/2 when m = 1 mod 16. This creates f with the proper norm. Thus 2 splits iff m = 3 mod 4 or 1 or 9 mod 16.
Assume the aforementioned primes are associates and see if the quotient is a unit in SP. Write this as f2/|f|, whence the denominator has one factor of 2. Start with m = 3 mod 4. The second coefficient is 2ab, which becomes ab, which is odd. The first coefficient, a2+mb2, is divisible by 4, and when 2 is divided out, courtesy of |f| downstairs, we have an even number. The norm of this quotient is odd, which is a unit, hence this is a unit, and the prime ideals coincide.
With m = 1 mod 8, 2ab becomes a half integer, and ab is a quarter integer, which is not part of the ring. The primes are distinct. To illustrate, if (3+u)/2 and its conjugate are part of the same prime ideal Q then so is their sum, or 3. Since 3-2 = 1, Q is all of S.
The next item to consider is p dividing m, which was not an issue with m = -1. Assume m is square free, so that m = p*v with p and v coprime. This means p-v is a unit in ZP. Set f = p+u and note that f has norm p*(p-v). Thus f is a proper factor of p.
Again, ask whether f and its conjugate are associates by looking at f2/|f|. The quotient looks like p+v + 2u. Its norm is p2+2vp+v2-4p. Since p does not divide v2, this is a unit, and the prime ideals coincide.
Here is a summary of our results.
Notice that P is ramified iff p divides the discriminant m or 4m. This is exactly what we expect.