1

I am interested in defining / extending gcd (and possibly euclidean algorithm) over the finite field $\mathbb{Z}_p$ (that is over integers modulo a prime $p$).

The problem I have in extending this notion to this finite field is how to define a sensible modulo operation (and implemenent it) since all elements have inverses and division is exact.

For example for the field of rationals $\mathbb{Q}$ a sensible and non-trivial extension of gcd exists and in fact makes use of the gcd over integers.

ie:

$$gcd_{\mathbb{Q}}(\frac{p_1}{q_1},\frac{p_2}{q_2}) = \frac{gcd_{\mathbb{Z}}(q_2p_1, q_1p_2)}{q_1q_2}$$

Can something similar be done for finite field $\mathbb{Z}_p$?

Of course, the trivial definition:

$$gcd_{\mathbb{Z}_{p}}(n_1,n_2) = 1$$

can be used (since gcd is not uniquely defined but involves multiplication with a unit of the ring) but I was hoping for something less trivial, for example

$$gcd_{\mathbb{Z}_{p}}(n_1,n_2) = min_{\mathbb{Z}}(n_1,n_2)$$

Is this valid as an extended defintion of gcd over the finite field?

If this is already answered elsewhere, please point me to the right direction. The reason I am asking this question is because I implement a symbolic library and I need some sensible (and preferably non-trivial) defaults to gcd and lcm algorithms when the ring is the finite field $\mathbb{Z}_p$.

Any suggestions / ideas?

Nikos M.
  • 2,158
  • What property are you looking for this "gcd" to satisfy? What problem are you hoping to solve with this? – Tobias Kildetoft Mar 10 '20 at 18:13
  • @TobiasKildetoft, I would simply like to have a gcd version for the finite field, and preferably the gcd would not be trivial (eg identicaly one). if a relation to gcd over inrtegers exists (as for example for gcd over rationals) so much the better. Or any sensible generalisation as gcd is not uniquely defined. Hope this answers your question – Nikos M. Mar 10 '20 at 18:16
  • What does it mean to generalize the usual gcd? That is not really a meaningful term here. – Tobias Kildetoft Mar 10 '20 at 18:17
  • @TobiasKildetoft, this is what I am asking myself. I gave the gcd over the rationals as a generalisation that I find very sensible. If somethign similar can be done with finite field is what I am asking or even my suggestion to get the minimum of the two numbers is valid as well. The minimum would be a non-trivial result (and with minimum computation needed). But any non-trivial result that has similar properties to gcd can is fine. – Nikos M. Mar 10 '20 at 18:20
  • Well, what makes the one for rationals a sensible one? In what way does it generalize the usual gcd (other than the fact that it happens to restrict to it)? – Tobias Kildetoft Mar 10 '20 at 18:23
  • @TobiasKildetoft, another extension of gcd can be used as well. But this one produces a non-trivial result, restricts to integer gcd for integer numbers and is computationaly the same as integer gcd. Of course it is not unique, again, but is a good example. Lets not go into which one to prefer over equivalent non-unique extensions of the gcd , anyone that is non trivial will do for me (as long as it does not need more computation than integer gcd, less is even better) – Nikos M. Mar 10 '20 at 18:26
  • @TobiasKildetoft, if the gcd generalisation can work for the ring $\mathbb{Z} / n\mathbb{Z}$ for general integers modulo $n$ (not necessarily prime $n$, ie not necessarily a field) then even better I dont know if $\mathbb{Z} / n\mathbb{Z}$ has the necessary structure to have gcd, but if that is the case, then even better if the generalisation can work for it as well – Nikos M. Mar 10 '20 at 18:42

1 Answers1

1

As you say, $\Bbb Z_p$ is a field for prime $p$. The notion of gcd, and divisibility in general, is quite boring and trivial in a field. You seemingly want to compare it to $\Bbb Z$, but it is more fair, in this particular case, to compare it to $\Bbb Q$ or $\Bbb R$. It's just not an issue.

On the other hand, in the ring of polynomials over a field, the theory of divisibility is indeed very rich and interesting, and in some sense forms the basis of much of algebraic geometry.

Arthur
  • 199,419
  • sorry I cant seem to grasp your answer. Of course my librray supports polynomials over fields and finite fields, but I have gcd algorithms for this case. I am wondering for gcd computation (even if trivial) for the finite field as is (not for polynomials over it). – Nikos M. Mar 09 '20 at 13:10
  • In a field every number $a$ is divisible by any other nonzero number $b$. Just write $a=a\cdot 1 = a \cdot b^{-1} \cdot b$... – Jonas Linssen Mar 09 '20 at 13:45
  • @PrudiiArca, of course the trivial definition $gcd(n_1,n_2)=1$ can be used since every element (except $0$) is invertible, but I was hoping for somethiong less trivial leg $gcd(n_1,n_2)=min(n_1,n_2)$. Is this valid? See updated question – Nikos M. Mar 10 '20 at 15:10