<<

1 Solving Problems CDM ∗ (Semi) Decidability 2 Decidability

3 Semidecidability

Klaus Sutner 4 Diophantine Equations Carnegie Mellon University Spring 2021

Computability and Problems 2 Decision Problems 3

Definition In TCS and math, the main interest in the machinery of computability comes from the desire to solve certain discrete problems. Here are the A decision problem consists of a of instances and a subset of most important types: Yes-instances.

Problem: Primality Decision Problems Return a Yes/No answer. Instance: A natural number x. Question: Is x a ? Counting Problems Count objects of a certain kind.

Function Problems Calculate a certain function. Here the set of all instances is N and the set of Yes-instances is p N p prime . { ∈ | } Search Problems Select one particular solution. The answer (solution) to any decision problem is just one bit (true or false).

Counting Problems 4 Function Problems 5

Definition Definition A counting problem consists of a set of instances, each instance I is A function problem consists of a set of instances and, for each instance I, associated with a set of “solutions” sol(I). We need to calculate the a unique solution sol(I). cardinality of sol(I).

Problem: Prime Counting Problem: Next Prime Instance: A natural number x. Instance: A natural number x. Solution: The number of primes p x. Solution: The least prime p > x. ≤

Here the set of all instances is and the “solutions” for x are Instances are again N and the solution for x N is sol(x) = p where p is N ∈ p x p prime . In the literature, this function is denoted π(x). the appropriate prime (uniquely determined). { ≤ | } We insist that there always is a solution (otherwise sol would be a partial The answer to a counting problem is always a natural number. function). Search Problems 6 Solving a Problem 7

Definition To solve a decision problem, a computable function has to accept A search problem consists of a set of instances and, for each instance I, a each instance of the problem as input, and return “Yes” or “No” set of solutions sol(I). depending on whether the instance is a Yes-instance.

To solve a counting problem, a computable function has to accept In this case, “the” solution is not required to by unique. And, we allow each instance x of the problem as input, and return the appropriate for sol(I) to be empty. This turns out to be very convenient in practice. count sol(x) as answer. | | To solve a function problem, a computable function has to accept Problem: Factor each instance x of the problem as input, and return the unique Instance: A natural number x. sol(x). z < z < x x Solution: A natural number , 1 , dividing . To solve a search problem, a computable function has to accept each instance x of the problem as input, and return either an element of sol(x) or “No” if sol(x) is empty (the instance has no solutions). Note that the set of solutions is empty if x is prime.

Connections 8 Instances 9

Note that Primality, Prime Counting and Next Prime are closely Our examples have N as the set of instances. In general, for some general Π connected: an for one problem can be turned into an algorithm decision problem we may have for the other, plus a modest bit of overhead (a white lie). This idea of a

reduction is critical in and in complexity theory. a set IΠ of instances, and

a set Y I of Yes-instances. Π ⊆ Π Factor is a bit different, though: there are primality tests that provide no

insight into factors of a composite number. For example, IΠ might be the collection of all ugraphs, and YΠ could be the collection of all connected ugraphs. In fact, we now know that Primality is easy in the sense that there is a time algorithm for it, but we fervently hope that Factor will If we code everything as naturals, then I is always trivial (certainly turn out to be hard (certain cryptographic methods will fail otherwise). Π p.r.). The same holds for the other types of problems.

More Instances 10 Canonical Representations 11

Another issue is the choice of input data structure. Fortunately, in all practical cases there seems to be a canonical, natural choice. Essentially, One might wonder what an algorithm is supposed to do with input that all that is needed is: is not an instance of the problem in question.

There are two choices: Natural numbers are given in binary.

Nested lists of objects (hereditarily finite lists). We don’t care: the behavior of the algorithm can be arbitrary.

More realistic: the algorithm rejects bad input. This is perfectly Note that numbers could actually be expressed as lists, but that seems a reasonable since the collection of all inputs is always trivially bit excessive (we might as well descend all the way into misery and use decidable (in fact very low in the p.r. hierarchy). pure set-theory). Something very fishy is going on if it is not. But recall that we ignore efficiency entirely at this point; we are only concerned with abstract computability. Things get trickier in the realm of low complexity classes. Honest Instances (or: Don’t Cheat) 12 versus Computability 13

We will often informally talk about algorithms without offering any In all our models the input must be given in explicit, unobfuscated form. definition of this concept; every CS person knows what an algorithm is. We could cheat and say that an algorithm is just a computable function. Not allowed are tricks like the following:

Encode natural number n as 1, n whenever n is prime; h i and as 0, n when n is compound. Alas, that is just not right. Certainly, every algorithm expresses a h i computable function, but it is surprisingly difficult to give a coherent and With this “input convention” primality testing would be trivial, but the useful definition of what constitutes an algorithm. If you want to get an coding procedure requires a lot of computational effort. idea of how one might think about this problem, look at the paper by Moschovakis on the web. Worse, a similar trick could be used to trivialize any computational problem: just code the solution as part of the input. You can think of an algorithm as a Fuggedaboudit. computable function, taking into account implementation issues and efficiency.

A Paper 14

1 Solving Problems ∗

2 Decidability If you want to get a first impression on how one might go about developing a real theory of algorithms, take a look at

3 Semidecidability Moschovakis 02

4 Diophantine Equations

Decidability 16 Formally . . . 17

Informally, a problem is decidable if there is a decision algorithm that We can easily model this in terms of computable functions: A returns Yes or No depending on whether the input has the property in question. Definition k A set R N is decidable if the characteristic function charR is ⊆ computable. Yes A decision problem is decidable if the set of Yes-instances is decidable. x A No Note that the characteristic function is always total: no matter what the input is, the computation will be finite and will produce a result. Gottfried Leibniz (1646–1716) 18 Ars Magna 19

ars inveniendi: generate all true scientific statements.

ars iudicandi: decide whether a given scientific statement is true.

It is obvious that if we could find characters or signs suited for expressing all our thoughts as clearly and as exactly as arithmetic expresses numbers or geometry expresses lines, we could do in all matters insofar as they are subject to reasoning all that we can do in arithmetic and geometry. For all investigations which depend on reasoning would be carried out by transposing these characters and by a species of calculus.

In a way, the idea of decidability can be traced back to Leibniz’s ars magna.

Decision Algorithms 20 Hilbert’s List 21

Decision problems have been around since the day of the flood: one is interested in checking whether a number is prime, whether a polynomial is irreducible, whether a polygon is convex, and so on. Gauss certainly understood the computational difficulty of primality checking.

Leibniz notwithstanding, the formal study of decision problems from a computational perspective is relatively new.

The first big splash came in 1900, when Hilbert presented his famous list of 23 open problems at the International Congress of Mathematicians in Paris.

Hilbert’s list was enormously influential throughout the 20th century.

Some of Hilbert’s Problems 22 Entscheidungsproblem 23

1. Prove the Continuum Hypothesis. Well-order the reals. The Entscheidungsproblem is solved when one knows a pro- 2. Prove that the axioms of arithmetic are consistent. cedure by which one can decide in a finite number of operations ... whether a given logical expression is generally valid or is satis- fiable. The solution of the Entscheidungsproblem is of funda- 8. Prove the Riemann Hypothesis. mental importance for the theory of all fields, the theorems of ... which are at all capable of logical development from finitely many axioms. 10. Given a with any number of unknown quantities and with rational integral numerical coefficients: to devise D. Hilbert, W. Ackermann a process according to which it can be determined by a finite number Grundzuge¨ der theoretischen Logik, 1928 of operations whether the equation is solvable in rational integers. A Hedge 24 Aside: Hardness 25

Hilbert’s dream failed, there is no algorithm to solve the Note that Hilbert and Ackermann hedge a bit: the decision procedure for Entscheidungsproblem. the Entscheidungsproblem needs to work only for areas where the fundamental assumptions can be finitely axiomatized. But we can scale back a bit: try to solve the Entscheidungsproblem only for a small domain. For example, only worry about propositional logic That leaves open the possibility that some part of math might not be (rather than full first-order). In this capacity, the Entscheidungsproblem finitely axiomatizable, and thus outside of the reach of the is an excellent source of difficult problems in complexity theory. Entscheidungsproblem.

Still, J. Herbrand pointed out that For suitable versions of the Entscheidungsproblem, instead of undecidability, we get computational hardness. For example, for NP, we In a sense, the Entscheidungsproblem is the most general only need Boolean formulae of type problem of . x , . . . , x ϕ(x , . . . , x ) ∃ 1 n 1 n

Closure Properties 26 Even Better: Effective Boolean Algebra 27

Lemma As usual, we have used elementary arithmetic to express logical The decidable sets are closed under intersection, union and complement. operations. In other words, the decidable sets form a Boolean algebra. conjunction min(b , b ) b b A B A ∧ B disjunction max(b , b ) b b Proof. A B A ∨ B k b b Consider two decidable sets A, B N . We have two register machines negation 1 A A ⊆ − ¬ MA and MB that decide membership.

Idea: Run both MA and MB on input x, returning output bA and bB where bA, bB 0, 1 . But this means that the Boolean algebra of decidable sets is effective: we ∈ { } can represent the elements by natural numbers (recall the index For intersection return min(bA, bB), machinery), and the corresponding algebraic operations are then

for union return max(bA, bB), computable (even primitive recursive).

for the complement of A return 1 bA. − We have a computable structure, not just an abstract algebra. 2

How Bad Can It Be? 28 Counting 29

Theorem Here is an innocent question: There are undecidable decision problems.

Is every decision problem A N decidable? ⊆ Proof. There are uncountably many subsets of N (to be precise: 2ℵ0 ). If this were true we could construct, for any A N, a register machine But there are only countably many register machines (recall our coding ⊆ MA that, on input any number x N, halts with output charA(x). machinery). ∈ Hence uncountably many problems A N are not decidable. ⊆ Unfortunately, the answer is NO. 2 Here is a cardinality argument due to Cantor that shows that there are lots of undecidable problems. Note that this argument, like others in set theory, leaves a bitter after-taste: it does not produce any concrete undecidable problem. As usual, there is a more constructive approach. Going Concrete 30 Halting 31

Problem: Halting Fortunately, our study of clones of computable functions points us in the Instance: Index e N. ∈ right direction when it comes to finding a concrete undecidable problem. Question: Does register machine Me halt on input e?

Recall our observation that the eval operator for computable functions is A slightly more precise way to express this would be to fix a universal register machine and to ask whether on input program e and data e necessarily partial: sometimes eval(e, x) must be undefined, otherwise we U U are faced with a contradiction. halts: (e, e) U ↓ This opens the door for a decision problem. The choice of the URM is entirely arbitrary, but will not affect the decidability status of Halting.

Other Halting 32 Yet Other Halting 33

We can also get rid of the input altogether: the machine can start with a It may seem more natural to consider the following version: precomputation that produces the input for the main computation.

Problem: Full Halting Problem: Pure Halting Instance: Index e N, an argument x N. Instance: Index e N. ∈ ∈ ∈ Question: Does register machine Me halt on input x? Question: Does register machine Me halt?

As we will see, there is essentially no difference between the two versions, In this case, all registers are zeroed out before the computation starts. and the first one is slightly more elegant. Again, this is essentially the same as the other two versions. Arguably, this is the most elegant variant.

Halting is Undecidable 34 Proof, Formal 35

A standard diagonalization argument shows that Halting cannot be Suppose Halting (version 1) is decidable. solved by a register machine. Then we can define a function g by cases:

z (z) + 1 if z (z) , g(z) { } { } ↓ Theorem ' (0 otherwise. The Halting Problem is undecidable.

This function g is computable, so g has some index e. Contradiction via input e: And, of course, we could do this in any model of computation, there if g(e) , then g(e) = g(e) + 1; always is a universal “machine.” ↓ if g(e) , then g(e) = 0. ↑ Proof, Informal 36 Diagonalization 37

Assume Halting is decidable. Then the following program

// impossible function Diagonalization was invented by Cantor in if( halt(z,z) ) the context of set-theory; see the return eval(z,z) + 42; uncountability argument above. else return 0; It is rather surprising that this tool also turns out to be of central importance in the computational universe. produces a contradiction.

Here halt(z,z) is the halting tester that exists by assumption, and eval(z,z) is the universal RM: run Mz on input z.

Alas . . . 38 Better Riemann 39

One can then extend ζ to a function of type C C (analytic → Diagonalization always leaves a bad aftertaste—one has the desired continuation), a difficult to draw beast. object, but the construction is oddly elusive, and feels insufficiently “concrete.”

Can one make the problem with Halting a little more tangible?

Sure. Take you favorite open problem in math, the Riemann Hypothesis.

In its original form, RH looks like a solid chunk of complex analysis. You start with the Riemann zeta function

s ζ(s) = n− n 1 X≥ where s C, Re(s) > 1. ∈ The modulus of ζ(s) for 0 Re(s) 1 and 0 Im(s) 50. ≤ ≤ ≤ ≤

Roots 40 It’s Π1 41

Π1 means: requires just one universal quantitifier to define (plus The critical open question about the ζ function is this: where are the bounded quantitifiers and standard arithmetic). non-real roots. Here is the big conjecture, proposed by Bernhard This may sound patently wrong, but can be shown with enough effort: Riemann in 1859: let Hn = k n 1/k be the nth harmonic number, and σ(n) the divisor function (total≤ sum of all divisors of n). These are all primitive recursive. All non-real roots s have the property Re(s) = 1/2. P The RH is equivalent to: for all n,

Hn Note that this statement seems to require considerable horse-power: first σ(n) Hn + e log Hn ≤ we need to define the analytic extension of a power series, then we want to argue about some of roots of the resulting function. As written, this looks like real arithmetic involving e and log. In the actual argument, everything has to be rephrased in terms of rational numbers, and one needs to be very careful with error estimates. Example: n = 40 42 The Riemann Register Machine 43

Based on this inequality, one can now construct a register machine M that runs through a (potentially infinite) loop and tries to check the inequality for all n.

If finds a counterexample, it stops and returns 42. Otherwise runs M M forever.

Claim: halts iff the Riemann Hypothesis is false. M

There even are estimates on how large would need to be (though M existing work uses Turing machines rather than register machines; less than 10, 000 states).

Pushing Things 44

Similarly we can design a register machine that systematically Z enumerates all first-order logic theorems provable in Zermelo-Fraenkel with Choice. This works since the axioms of ZFC are easily decidable. Halting is seriously hard. Now suppose is set up to halt when it finds a proof of = , Z ∅ {∅} otherwise it runs forever.

By G¨odel’s incompleteness theorem, and assuming that ZFC is consistent, we cannot prove in ZFC that never halts, nor can we prove Z that it halts.

So ZFC is too weak to say anything about the Halting behavior of . Z

The Next Step 47

1 Solving Problems ∗

2 Decidability Decidability makes direct algorithmic sense, we are trying to test for certain properties in a computational manner.

3 Semidecidability Alas, it turns out that there is a weaker property, called semidecidability, that is very closely related to decidability, and that is arguably more fundamental and ultimately more important. 4 Diophantine Equations Semidecidability 48 In Pictures 49

Here is a generalization of decidability: Yes Definition x A A set A Nk is semidecidable if there is a register machine that, on ⊆ zip input x, halts if x A, and fails to halt otherwise. ∈

We will call this a semidecision procedure.

You can think of this as a broken decision algorithm: if the answer is Yes, Just to be clear: zip is not output, it just means “there is no output.” the algorithm works properly and stops after finitely many steps. But, if the answer is No, it just keeps running forever, it never produces a result.

Quoi? 50 Proof 51

Clearly, A decidable implies that both A and A are semidecidable. Note that Halting is the critical natural example of a semidecidable problem: we can determine convergence in finitely many steps, but divergence takes forever. This is exactly the idea behind an unbounded But the opposite direction is far from trivial: we have two semidecision procedures and , but we don’t know which one is going to halt. So search: we find a witness in finitely many steps if there is one, but A0 A1 we cannot simply run, say, first. otherwise we keep searching forever. A0 The way around this problem is to run both procedures in parallel on the given input: we combine two computations into one, alternating steps. Here is the critical connection between decidability and semidecidability: We stop as soon as one of the sub-computations terminates.

Lemma Intuitive, this no surprise; every operating system does this. But it A set is decidable iff the set and its complement are both semidecidable. actually is another fundamental property of computation: we can interleave two computations into a single one.

Closure Properties 52 Kleene Normal Form 53

Lemma Here is a closer look at Halting and semidecability. Suppose we have a universal register machine producing an enumeration e of all U { } The semidecidable sets are closed under intersection and union. computable functions.

We claim that there is a primitive recursive relation T (e, x, t) and a Proof. primitive recursive function D (in fact, both T and D are quite straightforward) such that For intersection we can simply run the two semidecision-procedures sequentially. e (x) t T (e, x, t) But for union we again need to interleave two computations. { } ↓ ⇐⇒ ∃ 2 e (x) D(min t T (e, x, t) { } ' |  Note: We do not have closure under complement in general: Halting T (e, x, t) essentially means: the computation of on e and x terminates and the last lemma prohibit that. U after at most t steps. Kleene’s T Predicate 54 Undecidability 55

T (e, x, t) The reason e (x) y is not decidable is that we cannot bound the { } ' existential quantitifier in e (x) t T (e, x, t) in a computable e the index of a register machine M { } ↓ ⇐⇒ ∃ manner. x an input argument for M t a witness for a halting computation of M on input x. Essentially, the only way we can find the right t is by running the computation, there is no clever computational shortcut in general. This is a perfect example of (computational incompressibility). The witness is usually the (sequence number that codes) a sequence of configurations C0,C1,...,Cn of M.

Since we have an alleged witness, T is easily decidable and primitive Note that this is not a problem in any real algorithm: given some recursive. particular input we can always compute ahead of time an upper bound on the running time of the algorithm. Ditto for memory requirement. Moreover, given the right t, it is easy to read off the output of the computation (that’s D’s job). Proof: check all the algorithms in 451.

Still Unhappy? 56

1 Solving Problems ∗ Halting may well seem like a somewhat unsatisfactory example of an undecidable problem: it’s a perfect case of navel gazing. Certainly it does not deal with a question at least superficially unrelated to computability. 2 Decidability

Actually, anyone who has ever written a complicated program in a language like C would have to admit that Halting is really quite natural. 3 Semidecidability

But how about undecidable problems that are of independent interest? Perhaps something that was studied even before the concept of an 4 Diophantine Equations algorithm was invented?

Hilbert’s 10th Problem 58 Examples 59

Perhaps the most famous example of an undecidability result in mathematics is Hilbert’s 10th problem (HTP), the insolubility of Diophantine equations. Pythagorean triples: it is not hard to classify all the solutions of

A Diophantine equation is a polynomial equation with integer x2 + y2 z2 = 0 coefficients: −

P (x1, x2, . . . , xn) = 0

The problem is to determine whether such an equation has an integral But tackling solution. xk + yk zk = 0 − for k > 2 was one of the central problems of and it took Theorem (Y. Matiyasevic, 1970) more than 350 years to show that solutions only exist for k = 1, 2. It is undecidable whether a Diophantine equation has a solution in the integers. The Proof 60 Diophantine Sets 61

The proof is too complicated to be presented here, but the main idea is a We want to describe a Z with some particular property: reduction: ∈

Show that decidability of Hilbert’s 10th problem implies decid- Even: a = 2x. ability of the Halting problem. Non-zero: ax = (2y 1)(3z 1). − − More precisely, call a set A Z Diophantine if there is a polynomial P ⊆ 2 2 2 2 with coefficients over Z such that Non-negative: a = x1 + x2 + x3 + x4 (Lagrange’s theorem)

a A x1, . . . , xn Z P (a, x1, . . . , xn) = 0 . ∈ ⇐⇒ ∃ ∈  Similarly we can show closure under intersection (sum of squares) and This condition is rather unwieldy, it is usually fairly difficult to show that union (product). a particular set is in fact Diophantine.

Again: Semidecidability 62 Details 63

A It turns out that exactly the semidecidable sets are Diophantine. In First M. Davis was able to show that every semidecidable set has a particular, the Halting Set is Diophantine, and so it must be undecidable Davis normal form: there is a polynomial such that whether an integer polynomial has an integral solution. a A z y < z x , . . . , x P (a, x , . . . , x , y, z) = 0 . ∈ ⇐⇒ ∃ ∀ ∃ 1 n 1 n It is clear that every Diophantine set is semidecidable: given a, we can  simply enumerate all possible x Zn in a systematic way, and compute ∈ P (a, x). Davis, Putnam and Robinson then managed to remove the offending bounded universal quantifier at the cost of changing P to an exponential 0 If we ever hit , we stop; otherwise we run forever. polynomial (containing terms xy).

Surprisingly the opposite direction also holds, but this is much, much Lastly, Matiyasevic showed how to convert the exponential polynomial harder to show. into an ordinary one.

Bounding Roots 64 Two Variables 65

How about 2 variables, say y2 = x3 + c? Here is 2 c 3. − ≤ ≤ Note that if we could produce a computable bound on the size of a possible root we could use brute-force search to determine whether one 2 2 2

exists (in principle, in reality we die an exponential death). 1 1 1

0 0 0

n n 1 -1 -1 -1 Consider a univariate polynomial p(x) = anx + an 1x − + . . . a0 of − degree n (so an = 0). -2 -2 -2 6 -2 -1 0 1 2 -2 -1 0 1 2 -2 -1 0 1 2 By rearranging terms a bit and using the standard properties of inequalities over the reals we find that for any root x 2 2 2

1 1 1 a x n max | | ≤ · a 0 0 0 | n| -1 -1 -1 where amax = max( an 1 ,..., a0 ). Done by search. | − | | | -2 -2 -2 -2 -1 0 1 2 -2 -1 0 1 2 -2 -1 0 1 2 Discrete Case 66 Cubes 67

For real solutions, this is trivial. But we are looking for integral solutions, How about sums of three cubes? and then things get incredibly messy. x3 + y3 + z3 = c

It is known that the least integral solution, if it exists, is bounded by Over Z, it is not known that this is decidable.

exp((1010 c )10000) Worse, it may well be that c is the sum of 3 cubes iff c = 4 (mod 9). | | 6 ± But that’s an open problem.

Recent result, found by a big computer search: So, in principle, this is decidable by brute force seach. 33 = 88661289752875283 87784054428622393 27361114688070403 − − In practice, nothing moves; even if we were to allow nondeterminism.

This just in . . . 68 Bounding Roots, II 69

So it would not be unreasonable to think that integer roots of P (x1, . . . , xn) can be bounded by some rapidly growing but computable Andrew Sutherland at MIT and Andrew Booker at U Bristol used over a function of n, the degree d of P , and the largest coefficient c. million hours of compute time on the Charity Engine to find Perhaps something insanely huge like

d+17 A n! c d, nn 42 = 805387388120759743+804357581458175153+126021232973356313 | | − would work? 

If not, try an even higher level of the Ackermann hierarchy or one of Friedman’s monsters?

Bounding Roots is Hard 70 Even Fermat is Hard 71

Alas, finding bounds even in very concrete cases turns out to be quite difficult. For example, consider again the three cubes problem For Fermat type problems xn + yn = zn we have a complete answer thanks to Wiles. Note that the solutions (x, y, z) have the nice property x3 + y3 + z3 = 74. that (αx, αy, αz) is also a solution.

The smallest solution is So we can rephrase this as solving xn + yn = 1 over the rationals.

This naturally leads to the question “How many rational points are there x = 284650292555885 on an algebraic curve?”, another brutally hard problem (see Falting’s − y = 66229832190556 Theorem). − z = 283450105697727 More Problems 72 The Sun God’s Herd 73

An old puzzle, supposedly due to Archimedes, about the size of the herd Or try to find a positive solution for the seemingly innocuous Pell of cattle owned by the sun god, comes down to solving a system of linear equation: equations and then the Pell equation

2 2 x 991y 1 = 0. x2 410286423278424 y2 1 = 0. − − − −

Of course, x = 1, y = 0 is a trivial solution. The smallest positive solution here is In this case, the least positive solution has 103273 and 103265 decimal digits.

x = 379516400906811930638014896080 Exercise (in futility) y = 12055735790331359447442538767 Try to find a positive solution to 313(x3 + y3) = z3. Or try x3 + y3 + z3 = 33.

Different Rings 74 One Implication 75

Note that the choice of Z as ground ring is important here. We can ask It is true that an algorithm for HTP over Z would produce an algorithm the same question for polynomial equations over other rings R (always for HTP over Q. assuming that the coefficients have simple descriptions). Consider P (x) = 0 with x Q. This is equivalent to ∈ Z: undecidable y, z Z P (y/z) = 0 z1 . . . zk = 0 ∃ ∈ ∧ 6 Q: major open problem 

R: decidable Of course, this is exactly the wrong direction. C: decidable

Exercise Decidability of Diophantine equations over the reals is a famous result by Why does undecidability over Z not simply imply undecidability over Q? A. Tarski from 1951, later improved by P. Cohen. What is the obstruction?

Hard 76 Jones, Sato, Wada, Wiens Polynomial 77

Since we can encode arbitrary semidecidable sets as Diophantine equations, we can in particular encode universal sets. (k + 2) 1 [wz + h + j q]2 [(gk + 2g + k + 1)(h + j) + h z]2 − − − − − That means that there is a single polynomial with parameter a for which  the question [16(k + 1)3(k + 2)(n + 1)2 + 1 f 2]2 [2n + p + q + z e]2 − − − − 3 2 2 2 2 2 2 2 x , . . . , x P (a, x , . . . , x ) = 0 [e (e + 2)(a + 1) + 1 o ] [(a 1)y + 1 x ] ∃ 1 n 1 n − − − − − [16r2y4(a2 1) + 1 u2]2 [n + l + v y]2 [(a2 1)l2 + 1 m2]2 − − − − − − − − is already undecidable. [ai+k +1 l i]2 [((a+u2(u2 a))2 1)(n+4dy)2 +1 (x+cu)2]2 − − − − − − − [p + l(a n 1) + b(2an + 2a n2 2n 2) m]2 [q + y(a p 1)+ As one might suspect, there is a trade-off between the degree d of such a − − − − − − − − − polynomial and its number of variables n. Here are some known (d, n) s(2ap+2a p2 2p 2) x]2 [z +pl(a p)+t(2ap p2 1) pm]2 − − − − − − − − − pairs that admit universal polynomials: 

(4, 58), (8, 38), (12, 32),..., (4.6 1044, 11), (8.6 1044, 10), (1.6 1045, 9) This polynomial P has 26 variables and degree 25. P (N26) N is the set ∩ of prime numbers. Note the factor (k + 2) up front. Diophantine Games 78 An Example 79

Suppose P is an integer-coefficient polynomial of 2n variables. Consider the Diophantine game

There are two players: Peter (parameters) and Ursula (unknowns). They 2 (x1 + a2) + 1 = (x2 + 2)(x3 + 2) alternate picking natural numbers a1, x1, a2, x2, . . . , an, xn. If, in the end, P (a1, . . . , an, x1, . . . , xn) = 0 So Peter has only one choice, but Ursula has three. Ursula wins, otherwise Peter wins. The RHS is always composite, but the LHS could be prime.

Clearly, given P , it is undecidable whether Peter or Ursula has a winning Indeed, if there are infinitely many primes of the form k2 + 1, then Peter strategy. has a winning strategy; otherwise Ursula wins.

But things are actually much worse; even if Ursula has a winning strategy, it may not be constructively describable. Alas, the existence of these primes is an open problem in number theory.

Harder Questions 80

The existence of a root to an integer polynomial is naturally semidecidable. But we can easily ask slightly more complicated questions:

Problem: Cofinite Roots Instance: A integer polynomial P (a, x1, . . . , xn). Question: Is there a root for all but finitely many values of a?

Intuitively, this seems too complicated for a semidecision procedure: one unbounded search is not enough.

One can prove that this problem is in fact harder than just semidecidable.