4

Let R be an arbitrary (commutative integral domain) with the algorithm for GCD. It is known a general algorithm to decide whether a given element in R is a square of some element? I suspect that there does not exist such an algorithm in general. But remarks from experts can be useful.

Thanks.

RobPratt
  • 50,938
mechvel
  • 61
  • 2

2 Answers2

3

No. GCD is insensitive to units but squares are extremely sensitive. So we can take $R = K[x]$ where $K$ is a field. This has a GCD algorithm given by the usual Euclidean algorithm provided only that we can algorithmically compute addition, multiplication, and division in $K$ (and we only need divisions for the leading coefficients).

However we can embed difficult problems into the problem of determining whether an element of $K$ is square. For example, we can take $K = \mathbb{Q}(\sqrt{p_n} : n \in S)$ where $p_n$ is an enumeration of the primes and $S$ is an arbitrary subset of $\mathbb{N}$. So we can take $S$ to be, for example, the set of halting Turing machines with respect to some encoding. Even worse we could take $S$ to be, for example, the set of true arithmetic statements with respect to some encoding.

Edit: As mechvel notes, this doesn't solve the problem as stated because membership in $K$ is not decidable either.

Qiaochu Yuan
  • 468,795
  • All right, let it be about a field K. Your discourse with undecidable subsets of primes does not solve this problem. Because you parameterize K with a subset S of primes which membership is not algorithmically solved. So that the arithmetic operations in such K(S) are not given as algorithms. Right? If S is given explicitly as a (finite) tuple, then K is algorithmically given. But I wonder about square detecting algorithm in any Q(root(p_1)...root(p_n)). May be there exist such? Say, for Q(root(2)) I can suggest such. Anyway your notes about units and primes were helpful. Thank you. – mechvel Mar 02 '25 at 17:43
  • @mechvel: ah, you're right, it's not decidable which expressions are elements of $K$. My apologies! For any particular finite extension one should be able to extract an algorithm using factorization in the corresponding ring of integers + Dirichlet's unit theorem, along these lines: https://math.stackexchange.com/questions/4952509/how-to-determine-multiplicative-dependence-of-two-algebraic-numbers/4952552#4952552 – Qiaochu Yuan Mar 02 '25 at 18:40
  • Thank you for reference. The problem remains: I suspect that there does not exist the algorithm in the problem for general case. But I wonder of whether it is known a proof for this. – mechvel Mar 02 '25 at 21:27
0

I have an example showing how other tricky problems can be embedded in this problem that may be more satisfactory because the ring itself is more tractable. It may also be less satisfactory because there is, I think, still an algorithm to solve this problem. The GCD in question will be the ring of formal sums of knots.

The equivalence classes of knots form a commutative monoid $M$ under the knot sum, so we can define a monoidal ring $\Bbb{Z}[M]$, which is made up of elements that look like $3A + 4B - 2C$ where $A, B, C$ are knots, and you multiply two knots by taking the knot sum $\#$, and this multiplication is extended to every element of $\Bbb{Z}[M]$ linearly, like you would expect, i.e.

$$(aA + bB) \cdot (cC + dD) = acA\#C + adA\#D + bcB\#C + bdB\#D$$

Because of Schubert's Theorem, $M$ is freely generated by the prime knots, so $\Bbb{Z}[M]$ is isomorphic to the polynomial ring over $\Bbb{Z}$ with countably many generators- which is a UFD, hence also a GCD. But the problem of determining if an element is square includes the problem of determining whether a knot $A$ can be expressed in the form $B \# B$.

Zoe Allen
  • 7,939
  • My initial question was on an algorithm for detecting squares in an arbitrary algorithmic field (or in a GCDDomain). It can be considered its neighbor problem of detecting squares in an arbitrary algorithmic commutative monoid. Because a field (and GCDDomain too) has its multiplicative monoid inside. You write of the monoid by # of knot classes. May be someone knows what is # and how to detect squares by # ... – mechvel Mar 07 '25 at 21:33