## § How ideals recover factorization [TODO ]

• consider $Z[-5]$. Here, we have the equation that $2 \times 3 = (1 + \sqrt{-5})(1 - \sqrt{-5})$.
• Why are $2, 3, (1 + \sqrt 5), (1 - \sqrt 5)$ prime?
• we can enumerate numbers upto a given absolute value. Since the absolute value is a norm and is multiplicative, we only need to check for prime factorization of a given number $n$ in terms of primes $p$ with smaller absolute value (ie, $|p| < |n|$).
• If we list numbers in $Z[-\sqrt{5}]$ upto norm square $6$ (because $6$ is the norm square of $1 - \sqrt{5}$), we get:
This was generated from the python code:
class algnum:
def __init__(self, a, b):
self.a = a
self.b = b
return algnum(self.a + other.a, self.b + other.b)
def __mul__(self, other):
# (a + b \sqrt(-5)) (a' + b' \sqrt(-5))
# aa' + ab' sqrt(-5) + ba' sqrt(-5) + bb' (- 5)
# aa' - 5 bb' + sqrt(-5)(+ab' +ba')
return (self.a * other.b - 5 * self.b * other.b,
self.a * other.b + self.b * other.a)
def __str__(self):
if self.b == 0:
return str(self.a)
if self.a == 0:
return f"{self.b}sqrt(-5)"
return f"[{self.a}, {self.b} sqrt(-5)]"

def normsq(self):
# (a + b \sqrt(-5))(a - b \sqrt(-5))
# = a^2 - (-5) b^2
# = a^2 + 5 b^2
return self.a * self.a + 5 * self.b * self.b
def is_zero(self):
return self.a == 0 and self.b == 0
def is_one(self):
return self.a == 1 and self.b == 0

def is_minus_one(self):
return self.a == -1 and self.b == 0

__repr__ = __str__

nums = [algnum(a, b) for a in range(-10, 10) for b in range(-10, 10)]

def divisor_candidates(p):
return [n for n in nums if n.normsq() < p.normsq() \
and not n.is_zero() \
and not n.is_one() \
and not n.is_minus_one()]

# recursive.
print("normsq of 2: ", algnum(2, 0).normsq());
print("normsq of 3: ", algnum(3, 0).normsq());
print("normsq of 1 + sqrt(-5):" , algnum(1, 1).normsq());
print("potential divisors of 2: ", divisor_candidates(algnum(2, 0)))
# candidates must be real. Only real candidate is 2.
print("potential divisors of 3: ", divisor_candidates(algnum(3, 0)))
# Candidate must be mixed.
print("potential divisors of (1 + sqrt(-5)): ", divisor_candidates(algnum(1, 1)))
print("potential divisors of (1 - sqrt(-5)): ", divisor_candidates(algnum(1, -1)))


#### § Recovering unique factorization of ideals

• In the above ring, define $p_1 \equiv (2, 1 + \sqrt(-5))$.
• Define $p_2 \equiv (2, 1 - \sqrt(-5))$.
• Define $p_3 \equiv (3, 1 + \sqrt(-5))$.
• Define $p_4 \equiv (3, 1 - \sqrt(-5))$.
• We claim that $p_1 p_2 = (2)$, $p_3 p_4 = (3)$, $p_1 p_3 = (1 + \sqrt(-5))$, $p_2 p_4 = (1 - \sqrt{-5})$.
• This shows that the ideals that we had above are the products of "prime ideals".
• We recover prime factorization at the ideal level , which we had lost at the number level .