Undecideable problems would prove much of mathematics

It is possible to prove that there are problems that algorithms cannot solve, but those proofs reply on pardoxes and different sizes of infinity and other tools that most people find difficult to accept. This page gives a more intuitive but less formal argument for the idea that some problems are hard to solve.

Suppose I wrote a program HH that took as input another program ff and returned as output one of two things: either an assertion that ff always returns after a finite amount of time, or an example input xx that would make f(x)f(x) run forever.

If such a program existed, it could be used to solve huge numbers of open math problems that mathematicians have spent centuries trying to solve without success. That power strongly suggests that we could never create HH. We outline a proof that HH cannot exist on another page, but since that proof is hard for many to grasp we give examples here that show why HH would be weirdly powerful if it did exist.

Many unsolved math problems are complicated to even describe, but not all are. The rest of this page shows how HH, if it existed, could be used to solve some famously hard problems in mathematics.

Collatz conjecture

The Collatz conjecture asks if, for any positive integer xx, we would eventually reach 11 if we repeatedly replace xx with {x/2if x is even3x+1if x is odd\begin{cases}x/2&\text{if }x\text{ is even}\\3x+1&\text{if }x\text{ is odd}\end{cases}.

To solve this using HH, define the following ff:

f(positive integer x):
    repeat until x is 1:
        if x is odd, replace x with 3x+1
        otherwise, replace x with x/2

Then call H(f)H(f); it will either return an xx that never reaches 11 under Collatz’s rules or it will prove that there is no such xx.

Goldbach’s conjecture

Goldbach’s conjecture asks if every even integer is the sum of two prime numbers.

To solve this using HH, define the following ff:

f(even integer x):
    For every integer k from 2 to x-2:
        if k is prime and x-k is also prime:
            stop running
    If you get here, repeat doing something pointless forever

Then call H(f)H(f); it will either return an even xx that is not the sum of two prime numbers or it will prove that there is no such xx.

Legendre’s conjecture

Legendre’s conjecture asks if there is always at least one prime number between n2n^2 and (n+1)2(n+1)^2.

To solve this using HH, define the following ff:

f(integer n):
    For every integer k from n squared to (n+1) squared:
        if k is prime:
            stop running
    If you get here, repeat doing something pointless forever

Then call H(f)H(f); it will either return an nn that has no primes between n2n^2 and (n+1)2(n+1)^2 or it will prove that there is no such nn.

Are all Fermat numbers square-free?

A Fermat number has the form $F_n = 2^{2^n}}$. A square-free number cannot be divided by any integer k>1k>1 twice without a remainder. It is not known if all Fermat numbers are square free.

To solve this open problem using HH, define the following ff:

f(positive integer n):
    Compute F_n = 2^(2^n)
    For every k between 2 and F_n
        If (F_n / k) / k is an integer,
            repeat doing something pointless forever

Then call H(f)H(f); it will either return an nn for which FnF_n is not square-free or it will prove that there is no such nn.