2

We define $\mathbb{Z}[i] := \{a + bi \mid a, b \in \mathbb{Z}\}, i = \sqrt{-1},$ which is an euclidean ring together with $N: \mathbb{Z}[i] \to \mathbb{N}_0, z \mapsto z\bar{z}=a^2+b^2$ for $z=a+bi$. Being an euclidean ring means also to be a factorial ring so that each element $z \in \mathbb{Z}[i]$ can be decomposed into a product of prime elements.

Given an exercise to decompose $4 + 12i$ into prime factors in $\mathbb{Z}[i]$ I spent a lot of time just bruteforcing the combinations. Then I got $$4+12i = 4(1 + 3i) = 2^2(-1 + i)(1-2i) = (1+i)^2(1-i)^2(-1+i)(1-2i),$$ which also was the intended solution. There is also a theorem that states that if $N(z)$ is a prime in $\mathbb{Z}$, then $z$ is irreducible in $\mathbb{Z}[i]$, hence it is a prime element in $\mathbb{Z}[i]$. That verifies that all factors on the right side of the solution are prime.

As bruteforce is never effective, scalable and good for ones' karma I asked myself if there is a more effective way to compute this decomposition.

Are you aware of any procedure that brings some insights into the decomposition and makes it more effective?

  • 1
    One fact that helps is that if $p$ is a usual integer prime which is $1$ mod $4,$ then $p$ is uniquely $a^2+b^2$ for nonzero $a,b.$ Thus this $p$ factors into two primes in the Gaussian integers. I don't know a good way to actually find such $a,b$ for a large qualifying prime. – coffeemath Oct 03 '22 at 16:25
  • This suits well for $5=1^2 + 2^2 = (1+2i)(1-2i)$ (although I have to search for the theorem) and helps to decompose prime integers in $\mathbb{Z}[i]$. I am still very interested in something that helps to decompose gaussian integers (like $4+12i$), as well. – jupiter_jazz Oct 03 '22 at 16:37
  • @coffeemath see, for example, https://people.math.carleton.ca/~williams/papers/pdf/165.pdf or Wagon https://www.jstor.org/stable/2323912 or: once we have found $\beta^2 \equiv -1 \pmod p,$ $\beta^2 = -1 + p \gamma$ so $\gamma > 0,$ $ (2 \beta)^2 - 4 p \gamma = -4,$ we have positive form $\langle p, 2 \beta, \gamma \rangle $ that Gauss reduces to $\langle 1, 0, 1 \rangle. $ Reduction constructs a 2 by 2 matrix of determinant $1,$ its inverse shows how $\langle 1, 0, 1 \rangle $ represents $p$ WAgon https://www.tandfonline.com/doi/abs/10.1080/00029890.1990.11995559 – Will Jagy Oct 03 '22 at 17:14
  • my answer at https://math.stackexchange.com/questions/1521776/express-prime-as-sum-of-squares-p-a2-b2/1521819#1521819 – Will Jagy Oct 03 '22 at 18:21

1 Answers1

1

Dario Alpern's Gaussian integer factorisation calculator has, like many other programs there, an explanation of the mathematics behind it.

Suppose you have the prime factorisation of the norm $N(z)$; primes of the form $4n+3$ will always appear in pairs. Each integer prime factor or pair – with multiplicity – corresponds to a Gaussian prime factor of $z$ as follows:

  • The ramified prime $2$ corresponds to $1+i$.
  • The split prime $4n+1$ can be written as $m^2+n^2$ in a unique way with $m>n$. Then either $m+ni$ or $m-ni$ is a factor.
  • The inert prime pair $(4n+3)^2$ corresponds to the Gaussian and integer prime $4n+3$.

As an example, for factoring $4+12i$ by hand we notice that it has content (GCD of coefficients) $2^2$, so $$4+12i=(-1)(1+i)^4(1+3i)$$ $1+3i$ has norm $2×5$. So there is another $1+i$ factor and the quotient is a prime: $$4+12i=(-1)(1+i)^5(2+i)$$ Note that the factorisation is only unique up to units.

Parcly Taxel
  • 103,344