debugModerate
Why we cannot prove that a computable function is total?
Viewed 0 times
cannottotalwhycomputablefunctionprovethat
Problem
We know that we cannot find an algorithm that would prove that a computable function "f" is total if it IS total. How come?
When a function is total, it must have a proof (derived from soundness and correctness of logic). And proof is a finite sequence of symbols, so why does simple enumeration through all the sequences (which ends in finite time) not provide us with a proof?
When a function is total, it must have a proof (derived from soundness and correctness of logic). And proof is a finite sequence of symbols, so why does simple enumeration through all the sequences (which ends in finite time) not provide us with a proof?
Solution
You misunderstand soundness and completeness of logic. You think that it says:
A statement is true if, and only if, it is provable.
But it really says:
A statement is true in every model if, and only if, it is provable.
It can happen that there is a model in which a statement is true but not provable. What if you live in such a model? Then it could happen that in the model in which you live there is a total function $f$, but there is no proof that $f$ is total.
Here is a precise mathematical reason why your thinking does not work. I am going to show that, whatever formal system you are using (so long as it is a reasonable one), there is a total function which your formal system does not prove to be total.
You do proofs in some formal system $T$ (for instance, $T$ could be first-order logic and Zermelo-Fraenkel set theory) whose axioms are computably enumerable (or else you're a mystic guru). Let us also assume that $T$ contains arithmetic, and that $T$ is consistent (or else you're mad).
Define the following function
Observe that
Because $T$ is consistent,
But $T$ does not prove that
Supplemental: Ideas about having multiple theories $T_0, T_1, T_2, \ldots$ are quashed by (where
Now $g$ is total if and only if all $T_i$'s are consistent, but no $T_j$ can prove that they are all consistent (if it could, it would prove its own consistency as well).
A statement is true if, and only if, it is provable.
But it really says:
A statement is true in every model if, and only if, it is provable.
It can happen that there is a model in which a statement is true but not provable. What if you live in such a model? Then it could happen that in the model in which you live there is a total function $f$, but there is no proof that $f$ is total.
Here is a precise mathematical reason why your thinking does not work. I am going to show that, whatever formal system you are using (so long as it is a reasonable one), there is a total function which your formal system does not prove to be total.
You do proofs in some formal system $T$ (for instance, $T$ could be first-order logic and Zermelo-Fraenkel set theory) whose axioms are computably enumerable (or else you're a mystic guru). Let us also assume that $T$ contains arithmetic, and that $T$ is consistent (or else you're mad).
Define the following function
fdef f(n):
if n encodes a proof of 0 = 1 in formal system T:
while True: pass
else:
return 0Observe that
f is total if, and only if, $T$ is consistent:- if $T$ is consistent then it does not prove $0 = 1$, hence
fnever enters the infinitewhileloop.
- if
fis total, then it never enters the infinitewhileloop, therefore no $n$ encodes a proof of $0 = 1$ in $T$, therefore there is no proof of $0 = 1$ in $T$, which means that $T$ is consistent.
Because $T$ is consistent,
f is total.But $T$ does not prove that
f is total: if it did, then it would prove that, for every $n$, $n$ does not encode a proof of $0 = 1$, but this would imply that $T$ proves its own consistency, which it cannot by Gödel's incompleteness theorem.Supplemental: Ideas about having multiple theories $T_0, T_1, T_2, \ldots$ are quashed by (where
unpair is a bijection $\mathbb{N} \to \mathbb{N} \times \mathbb{N}$):def g(n):
(i, j) = unpair(n)
if i encodes a proof of 0 = 1 in formal system T(j):
while True: pass
else:
return 0Now $g$ is total if and only if all $T_i$'s are consistent, but no $T_j$ can prove that they are all consistent (if it could, it would prove its own consistency as well).
Code Snippets
def f(n):
if n encodes a proof of 0 = 1 in formal system T:
while True: pass
else:
return 0def g(n):
(i, j) = unpair(n)
if i encodes a proof of 0 = 1 in formal system T(j):
while True: pass
else:
return 0Context
StackExchange Computer Science Q#62594, answer score: 11
Revisions (0)
No revisions yet.