Incompleteness and Undecidability
April 25, 2018


Decidability

Today, we'll discuss what it means to be a decidable problem. We'll examine a class of problems where the object is to answer a yes or no question for a particular input. One such problem would be taking in a finite directed graph G = (V, E) and two vertices s, d that are in V, and determining whether d is reachable from s. This particular problem is decidable; that is, there exists an algorithm to produce a correct answer in finite time.

To reiterate, if for some problem P there exists an algorithm AP which will produce a correct yes or no answer in finite time, P is decidable.

P is semidecidable if there exists an algorithm AP which will produce the answer yes in finite time if the answer is indeed yes. However, if the answer is no, AP may never terminate.

The notion of cosemidecidability is closely related to the notion of semidecidability. P is cosemidecidable if there exists an algorithm AP which will produce the answer no in finite time if the answer is indeed no. If the answer is yes, AP may never terminate.

Let's consider another yes/no problem. Say we have a polynomial in one variable that is of degree n with integer coefficients, such that the 0th and nth terms have nonzero coefficients. Is it decidable whether that polynomial has at least one integer root?

This problem is certainly semidecidable, because we can guarantee a yes answer in finite time by just plugging in all the integers and evaluating the polynomial to see if its value is 0. Provided the order in which we check the integers ensures that we will reach any particular integer in finite time, we are eventually guaranteed to find a root if it exists. If it doesn't exist, however, the process would not terminate.

But is it also decidable? In fact it is! By the Rational Root Theorem, we know that every integer root will be a divisor of the 0th term. Since the 0th term is finite, it has a finite number of divisors and we can simply go through that list and test them all. If we don't find a root, we can confidently answer that there is no root.

What if we expand the possible input polynomials to allow for x > 1 variables? It turns out that the problem is still semidecidable, because we can still enumerate all possible x-tuples of integer values for our variables and try every single one. However, this new problem is not decidable, because the possible root values are no longer bounded in a predictable way.

Incompleteness

Given two logical formulas A and B, we say that A entails B iff every instance in which A is true also forces B to be true. We say that A proves B iff there exists a proof in some system demonstrating that B can be derived using only axioms and A. A proof system is complete iff for any formula A that entails any formula B, it can produce a proof of B from A.

In order to relate formulas via entailment, we need a way to determine if some instance I satisfies formula A; that is, if A is true in I. For example, we might want to determine whether the instance containing all the integers, which takes arithmetic operators to have their standard meanings, satisfies Goldbach's Conjecture. This conjecture states that all even numbers greater than 2 can be written as the sum of two prime numbers. We can translate the conjecture into more classical logical language like so:

all x : (x > 2 and 2 | x) implies exists a, b : x = a + b and all c : (c > 0 and a > c) implies c ∤ a and all d : (d > 0 and b > d) implies d ∤ b

To determine if the formula above is satisfied, we would have to find a set of axioms that completely captured the natural numbers, and determine if there existed a proof the Goldbach formula from those axioms. Alas, as Kurt Gödel proved last century, finding such a set of axioms is impossible. Look up Gödel's Incompleteness Theorem if you'd like to learn more about this!

A final note

Logical tools are powerful, but even they have their limits. As we've explored above, some of the problems we face in computer science are (really, really) hard, or even unsolvable! However, don't let this get you down. There is lots of work to be done in confronting hard problems and coming up with new and innovative ways to approximate solutions or uncover edge cases that are in fact solveable.