# Are Euclidean domains exactly the ones which we can define "mod" on?

A Euclidean domain $E$ is an integral domain where, for any $a, b \in E$, we can write:

$$a = bq + r$$

with either $r = 0$ or $f(r) < f(b)$, where $f$ is the valuation function attached to $E$.

Can I define the binary operation $\bmod$ such that $a \bmod b = r$ for all Euclidean domains? Will it always behave the same way as the mod function on $\mathbb{Z}$ that I'm used to?

What got me wondering was the observation that I can do this on the Euclidean domain $\mathbb{Q}[x]$ by using quotient rings:

\begin{aligned} \psi_{x^2 + x} &:: \mathbb{Q}[x] \rightarrow \mathbb{Q}[x]/\langle x^2 + x \rangle\\ \psi_{x^2 + x}(x^2 + x + 5) &= x^2 + x + 5 + \langle x^2 + x \rangle = 5 + \langle x^2 + x \rangle\\ \end{aligned}

So $r = 5$ and $x^2 + x + 5 \bmod (x^2 + 5) = 5$, as you would expect. It also works for multiplication.

• Side Note: ​ ​ ​ I found it non-obvious that there are any rings which non-trivially admit such modular reduction. ​ Can you come up with one before reading the answer to the question I asked about that? ​ ​ ​ ​ ​ ​ ​ ​
– user57159
Commented Apr 14, 2016 at 18:57
• @RickyDemer: I'm a bit confused -- what do you mean by non-trivial? The example that got me wondering about this was $\mathbb{Q}[x]$. Commented Apr 14, 2016 at 19:05
• By "non-trivial", I mean [[not isomorphic to the integers] and [has an ideal that's neither just {0} nor the whole ring]]. ​ $\mathbb{Q}[x]$ doesn't work because , for example, what would [x-1 mod x] be? ​ ​ ​ ​
– user57159
Commented Apr 14, 2016 at 19:13
• @RickyDemer: Are you talking about the mod function or binary relation? As a function, I would say that $x - 1 \mod x = -1$. Commented Apr 14, 2016 at 19:16
• I'm talking about the mod function, for which outputs should be non-negative, at least when both inputs are positive. ​ ​
– user57159
Commented Apr 14, 2016 at 19:17

As you say, you’re using the binary function “mod” of the computer scientists. But in mathematics, one finds that this function is of very limited utility, and we use the equivalence relation $a\equiv b\pmod I$ instead. It’s read, “$a$ is congruent to $b$ modulo $I$”, and it’s a sentence that will be either true or false.

To your specific question, consider the Euclidean domain $\Bbb Z[i]$, the Gaussian integers. If you take a complex modulus like $\zeta=6+3i$, it makes perfect sense to say whether two Gaussian numbers $\alpha$ and $\beta$ are congruent modulo $\zeta$, namely you check to see whether $\beta-\alpha$ is a multiplie of $\zeta$ by another Gaussian number. But there is no good and consistent way of defining a “mod” function here. You can make up an artificial “mod” function in this situation, but it will be neither good nor consistent.

• Nice counterexample. I guess I'm having a hard time relating this to my knowledge that the binary mod operation does work over $\mathbb{Z}$. (If you choose the smallest positive, I guess). What does $\mathbb{Z}$ have that $\mathbb{Z}[i]$ lacks in this case? Commented Apr 6, 2016 at 5:09
• @AlfredYerger: $\Bbb Z[i]$ certainly is a UFD. $5$ is not irreducible in $\Bbb Z[i]$, so $5 \times 1$ is not a valid factorization into irreducibles. Commented Apr 6, 2016 at 10:24
• Another question I have here: if I choose a convention for mod here, like "the positive real one" in what ways is the resulting function inconsistent? Commented Apr 6, 2016 at 13:11
• @EliRose : ​ There's not necessarily a positive real one. ​ ​ ​ ​
– user57159
Commented Apr 6, 2016 at 17:01
• @RickyDemer, precisely. To define “mod” function, you must choose beforehand a full set of representatives of the equivalence classes (cosets) of your relation. I chose my example precisely so that there would be no such set consisting only of real Gaussian integers. One possible set would be all $m+ni$ with $0\le m<5$ and $0\le n<3$, but this is truly artificial, as I think one’ll notice after trying to work with it for a while. Commented Apr 6, 2016 at 19:40

To your title: No. Any ring works for a mod operation, you just make things the standard coset way. Let $I\subseteq R$ be an ideal. Then we define

$$a\equiv b\mod I\iff a-b\in I.$$

And this is a well-defined equivalence relation.

For the integers this reduces to

$$a\equiv b\mod n\iff a-b\in (n)\iff a-b=nk$$

for some $k\in\Bbb Z$.

So to the question in the body (which is not the same thing) as to if we can define mod for EDs: yes you can, but they're not the most general setting.

• Cool! Can we also construct this definition via quotient rings in the manner I was trying to show? Commented Apr 6, 2016 at 3:50
• I'm not sure what you mean, $R/I$ is what a quotient ring is, and it literally means "things of $R$ up to equivalence mod $I$." Perhaps you mean with the remainder? Remainders is only a thing for EDs, that's their defining property. The mod operation is much more general than this, though Commented Apr 6, 2016 at 3:53
• In my abstract algebra class, we defined $R/I$ as a group of cosets, so the connection to mod is new to me. (It's a lot nicer). So it seems like you're saying that $R/I$ is isomorphic to the group of equivalence classes of elements of $R$ mod $I$, given the definition above. Is that right? What does "remainder" mean in the way that you use it here? Commented Apr 6, 2016 at 4:04
• @EliRose There is no notion of remainder in general rings, if there were they would all be EDs. The term "mod" is used in groups for things modulo normal subgroups, and in rings as rings modulo ideals, i.e. it's always for coset spaces for special subgroups (in groups normal, in rings ideals). You seem to think it is "connected" to the classical notion of "mod," but in reality this notion is the generalization of mod, it's not connected to it, it literally is it. Commented Apr 6, 2016 at 5:33
• Okay, I take your point. (and I wish it had been introduced to me that way). Commented Apr 6, 2016 at 13:13

In a Euclidean domain, there is no requirement that $r$ be uniquely determined by $a$ and $b$, so you cannot define mod in the way you proposed.

• Relating this answer with Adam's below: there's no need to pick canonical representatives to talk about mod. The point is that it's often better to think of mod as a ternary relation, than as a binary operation. Commented Apr 6, 2016 at 3:39
• @NoahSchweber Yes, but the original post talks about defining the "binary operation" mod, in which you are picking a canonical representative.
– Ted
Commented Apr 6, 2016 at 3:40
• Sorry, that wasn't meant as a disagreement with your answer, more a comment to the OP: that while you do need to talk about representatives to view mod as a binary function, everything we actually use mod for goes through fine if it's just a relation. Edited for clarity (and +1 btw). Commented Apr 6, 2016 at 3:43
• Don't we ordinarily pick a canonical representative when we say "$12$ divided by $5$ has a remainder of $2$", though? I guess in that case I'm choosing the smallest positive pair $(q, r)$ such that $a = bq + r$. Commented Apr 6, 2016 at 3:49
• Or perhaps I'm just choosing the only pair with both positive -- is there another that works? Are there other Euclidean domains where the choice is not so clear? Commented Apr 6, 2016 at 3:52