Gaussian Integers and Modular Arithmetic

by always_correct, Nov 29, 2016, 2:45 AM

Most, if not all reading should be acquainted with the set of complex numbers $\mathbb{C}$, usually this comes from dealing with special polynomials, such as those of the form $x^{n} - 1$. We introduce the Gaussian Integers, brought forth by Gauss in 1832. As one can guess, these integers comprise the set
$$\mathbb{Z}[i] = \{a+bi \mid a,b \in \mathbb{Z} \}$$The interesting thing about Gaussian Integers is that they are similar to integers in the way that all $x \in \mathbb{Z}[i]$ can be factored into unique primes. As an example, we look at the factorization of $4+7i$:
$$4+7i = (3+2i)(2+i) = (2-3i)(-1+2i)$$Right now you have to take my word for it, but all four of these factors are prime. We see here that there are two possible factorizations, which seems to contradict the uniqueness of a prime factorization. We know* that the integers form a unique factorization domain, but look at this:
$$10 = 2\cdot5 = (-2)\cdot(-5)$$Are these two different factorizations? In essence, no. These factorizations differ by the multiplication of a unit, in this case elements $u$ in $\mathbb{R}$ or $\mathbb{C}$ such that there exists another element in that set $v$ such that $uv = 1$, the multiplicative identity.
Looking closely at the prime factorizations, we can't tell for sure right now that $(3+2i)$ and $(2+i)$ are indeed prime.

We can deal with the general case by noting a key fact, if $x \in \mathbb{Z}$ is not a Gaussian prime, then $x = (a+bi)(a-bi)$ for some $a,b \in \mathbb{Z}$. Using this, assume $z = (a+bi)$ is a Gaussian prime, with $b\neq 0$. Then, $z\overline{z}=a^2+b^2$ is not a Gaussian prime. Assume $a^2 + b^2$ is not prime, that is for some $c \in \mathbb{Z}$, $c | a^2 + b^2$. Then, $c \mid a+bi$ or $c \mid a-bi$ (why?). We know that $c \nmid a+bi$ as $z$ is a Gaussian prime, this means that $c \nmid a$ or $c \nmid b$ (why?). Thus, $c \nmid (a-bi)$(why?) contradicting our assumption. Now, let $N(\alpha)=N(a+bi)=a^2+b^2$, we call this the norm of $\alpha$. We have just shown that if $\pi$ is Gaussian prime, then $N(\pi)$ is prime. We stop here to note the useful fact that the norm is multiplicative, that is:
$$N(\alpha\beta)=N(\alpha)N(\beta)$$We would also like to show that if $N(\alpha)$ is prime, then $\alpha$ is a Gaussian prime. To do this we write down the prime factorization: $\alpha=\pi_{1}\pi_{2}\ldots\pi_{n}$. The specific prime factorization does not matter. Just note that:
$$N(\alpha) = N\left(\prod_{i=1}^{n}\pi_{i}\right) = \prod_{i=1}^{n}N(\pi_{i}) = \prod_{i=1}^{n}p_i$$where $p_i$ is a prime. We then switch to the contrapositive: If $\alpha$ is not a Gaussian prime, then $N(\alpha)$ is not prime. By the above, we see this is obviously true.

*If you are familiar with the proof of unique factorization in $\mathbb{Z}$, try inducting on the norm to prove it in $\mathbb{Z}[i]$.
We have obviously dealt with showing the numbers we assumed were Gaussian primes before were in fact Gaussian primes(still remember them?), but we left out a case in the first demonstration. We proved that the norm is prime for Gaussian primes with imaginary part not zero, i.e. $z \not\in \mathbb{Z}$. This is obviously untrue for $z \in \mathbb{Z}$. So what are the Gaussian primes on the real axis? One might guess all primes are Gaussian primes, but this would be close, but very far from the truth:
$$5 = (2+i)(2-i) = 2^2 + 1^2$$This is such because $5$ is real, so might be able to be written as $(x+yi)(x-yi)=x^2+y^2$. In this case we have found the sufficient $x,y$. So, if $p$ is a real Gaussian prime, then $p \neq (x+yi)(x-yi) = x^2 + y^2$. Straight away we can see if $p=4n+3$, $p\neq x^2+y^2$ as the RHS is at most $2 \pmod{4}$. Suprisingly, for any $p=4n+1$, for some $x,y$ we have $p=x^2+y^2$. An elegant proof credited to Dedekind is given below, although a bit out of scope for this post.
Let $p=4n+1$ be a prime number. By Euler's Criterion there exists an $a$ such that $a^{\frac{p-1}{2}} \equiv -1 \pmod{p}$. Simplifying, we see this implies $a^{2n}-1 \equiv 0 \pmod{p}$, or that there exists an $m$ such that $m^2+1$ is divisible by $p$. We write this as $p \mid (m+i)(m-i)$. Note that $p \nmid m \pm i$(why?). Thus $m+i$ and $m-i$ contain factors such that when multiplied, $p$ divides their product. Thus, at best, $p$ divides the product of two or more factors, but can't divide just one, and hence is not prime. It follows then that $p = (x+yi)(x-yi)$ for some $x,y$. This yields $p = x^2+y^2$.
We understand fully when a Gaussian integer $a+bi$ is prime, this is when:

The norm $a^2+b^2$ is prime, and $b \neq 0$.
$b = 0$ and $a\equiv 3 \pmod{4}$ and $a$ is prime.

Now we can have more of a visual understanding of these Gaussian primes, as I have programmed a complex plane viewer, which produced these nice images:
http://i.imgur.com/sH5BmZo.png


http://i.imgur.com/zNDVhyR.png
With primes out of the way, we can talk about arithmetic in the Gaussian integers. In the integers, we can use induction to prove that for any integers $a,b$, $a$ can be written as $a = bq + r$, where $0 \leq r < b$. This can be shown to hold in a similar way for Gaussian integers, and the takeaway here is that writing a number in this form shows the least remainder and quotient obtained from a division algorithm. Here is the statement for Gaussian integers:

For any two Gaussian integers $\alpha$ and $\beta$, $\alpha$ can be written as $\alpha = \beta \omega + r$, where $0\leq |r| \leq \frac{\sqrt{2}}{2}\sqrt{N(\beta)}$. Obviously this isn't satisfactory to simply hear, one must see. Before we visualize, realize that is we are not providing a rigorous proof, we simply mean to show how one can pick a $\beta$ and thus why $0\leq |r| \leq \frac{\sqrt{2}}{2}\sqrt{N(\beta)}$. We start by expanding $\omega = x+yi$. We then look solely at the $\beta \omega$ term.
$$\beta \omega = \beta x + \beta yi = \beta x + \beta ' y$$where $\beta ' = i\beta$. Now we can visualize. Remember that $x$ and $y$ may be any integer. We view $\beta$ and $\beta '$ as vectors, one rotated 90 degrees from the other(why?).
http://i.imgur.com/BZL8kz2.png
Now $x,y$ can be any integer, so we consider all linear combinations of these vectors, that is $x$ and $y$ scale the two, then we add the vectors. All the possible values of $\beta \omega = \beta x + \beta yi = \beta x + \beta ' y$ is shown by the intersection points in the image. Note that squares form as they are 90 degrees apart(what else makes them squares?).
http://i.imgur.com/yEvxiZV.png
We know $\alpha$ can be any point on this grid, so we now know what to do about the bounds on $|r|$, seeing $r$ is the distance from the nearest intersection point. We know the minimum that $r$ can be $0$, and the maximum distance is obtained when $\alpha$ is in the center of a square, when $|r| =  \frac{\sqrt{2}}{2}\sqrt{N(\beta)}$. This is show in the below image, the middle dot being the place $\alpha$ has to be to maximize $|r|$, with the circles represent the area swept out by all points $|r|$ away from an intersection point.
http://i.imgur.com/kJX8hzp.png
Finally, we can talk about modular arithmetic. We define modular arithmetic in the same way we do in $\mathbb{Z}$, that is $\alpha \equiv \beta \pmod{\gamma}$ iff $\gamma \mid (\alpha - \beta)$. Many useful things can be done with this modular arithmetic, and it is very close to modular arithmetic in $\mathbb{Z}$. Geometrically, we see the number of residues modulo $\pi$ is the number all the Gaussian integers in or on the sides, not corners, of a square of the many squares formed by considering linear combinations of $\pi$ and $i\pi$, as we saw from looking at remainders from division algorithms. Note that in the integers, the number of non-zero residues modulo $p$ is $p-1$. Let $n(\pi)$ represent the amount of residues modulo $\pi$. The analog of Fermat's Little Theorem turns out to be true.

Let $\pi$ be a Gaussian prime. If $\alpha \not\equiv 0 \pmod{\pi}$, then
$$\alpha^{n(\pi)-1} \equiv 1 \pmod{\pi}$$
We need a small affirmation, that is the existence of an inverse. We need to prove the there exist an $x$ such that $\alpha x \equiv 1 \pmod{\beta}$ if $\alpha$ and $\beta$ share no factors(why?). To prove this we write it as $\alpha x = \beta y + 1 \iff \alpha x - \beta y = 1$. We note there exists $x,y$ that fulfill this as Bezout's lemma applies, because it is essentially the division algorithm run in reverse. (what division algorithm? try finding one for Gaussian integers!).

We prove this in the way we normally prove the theorem. Let $\beta_{1},\beta_{2},\ldots,\beta_{n(\pi)}$ be the distinct residues modulo $\pi$, and set $\beta_{n(\pi)}=0$. Consider the sequence $\alpha\beta_{1},\alpha\beta_{2},\ldots,\alpha\beta_{n(\pi)-1}$.

Assume, for the sake of contradiction, for some $j$ and $k$, that $\alpha\beta_{j} \equiv_{\pi} \alpha\beta_{k}$. We multiply both sides by $\alpha^{-1}$, and we obtain that $\beta_{j} \equiv_{\pi} \beta_{k}$. This is absurd, as we have each residue being distinct.

Thus, all residues of the sequence $\alpha\beta_{1},\alpha\beta_{2},\ldots,\alpha\beta_{n(\pi)-1}$ are distinct, and thus, $\beta_{1}\beta_{2}\ldots\beta_{n(\pi)-1} \equiv\alpha\beta_{1}\alpha\beta_{2}\ldots\alpha\beta_{n(\pi)-1}\pmod{\pi}$. Multiplying both sides by $\prod_{k=1}^{n(\pi)-1}\beta_{k}^{-1}$, which exists since $\pi$ is a Gaussian prime and hence all non-zero residues are co-prime to $\pi$, we arrive at $\alpha^{n(\pi)-1} \equiv 1 \pmod{\pi}$. Note that the proof of the analog of Euler's Totient Theorem is exactly this.

We have just one more thing to deal with, what is $n(\alpha)$? There are a few things that need to be proved, which is left to you to prove.

1. $n(\alpha) = n(\overline{\alpha})$ (think geometrically)
2. $z \in \mathbb{Z} \implies n(z) = z^2$ (combinatorics)
3. $n(\alpha\beta)=n(\alpha)n(\beta)$ (expand and substitute as much as possible)

Using these facts, we have that:
$$n(\alpha)^2=n(\alpha)n(\overline{\alpha})=n(\alpha\overline{\alpha}) = n(|\alpha|^2) = N(\alpha)^2$$Thus, $n(\alpha) = N(\alpha)$. That is quite surprising, and I end this post with the theorem once more, for $\alpha$ co-prime to a Gaussian $\pi$, we have that:
$$\boxed{\alpha^{N(\pi)-1}\equiv 1 \pmod{\pi}}$$Thank you for reading.
:)
This post has been edited 1 time. Last edited by always_correct, Nov 29, 2016, 2:53 AM

Learn, find, and share mathematics.

avatar

always_correct
Shouts
Submit
  • there are over 6000! anyway, I'm resting with the whole Euler line problem right now

    by always_correct, Aug 6, 2017, 8:16 PM

  • Have you seen something about Kimberling centers (triangle centers) and center lines?

    by alevini98, Aug 5, 2017, 11:19 PM

  • no its not dead

    by always_correct, Jul 12, 2017, 1:19 AM

  • Wow this is great, is this dead?

    by Ankoganit, Jul 3, 2017, 8:41 AM

  • oh its a math blog.....

    by Swimmer2222, Apr 13, 2017, 12:58 PM

  • Why is everyone shouting
    Oh wait...

    by ArsenalFC, Mar 26, 2017, 8:45 PM

  • Shout! ^^

    by DigitalDagger, Mar 4, 2017, 3:49 AM

  • 14th shout!

    by arkobanerjee, Feb 8, 2017, 2:48 AM

  • 14th shout! be more active

    by Mathisfun04, Jan 25, 2017, 9:13 PM

  • 13th shout :coolspeak:

    by Ryon123, Jan 3, 2017, 3:47 PM

  • Dang, so OP. Keep it up! :D

    by monkey8, Dec 28, 2016, 6:23 AM

  • How much time do you spend writing these posts???

    by Designerd, Dec 5, 2016, 5:02 AM

  • good blog!

    by AlgebraFC, Dec 5, 2016, 2:09 AM

  • Nice finally material for calculus people to read thanks

    by Math1331Math, Nov 27, 2016, 2:50 AM

  • Whoa how much time do you spend typing these posts?

    They're nice posts!

    by MathLearner01, Nov 24, 2016, 3:30 AM

  • i am remove it please

    by always_correct, Nov 22, 2016, 2:18 AM

  • 5th shout!

    by algebra_star1234, Nov 20, 2016, 2:41 PM

  • fourth shout >:D

    by budu, Nov 20, 2016, 4:59 AM

  • 3rd shout!

    by monkey8, Nov 20, 2016, 3:24 AM

  • 2nd shout!

    by RYang, Nov 20, 2016, 3:01 AM

  • first shout >:D

    by doitsudoitsu, Oct 9, 2016, 7:54 PM

21 shouts
Tags
About Owner
  • Posts: 809
  • Joined: Sep 20, 2016
Blog Stats
  • Blog created: Oct 7, 2016
  • Total entries: 8
  • Total visits: 10696
  • Total comments: 7
Search Blog
a