Intro to incompleteness · Chapter 4
Proof is not the same as truth
We introduce formal systems, logical systems, and Peano arithmetic, carefully distinguishing the notions of provability and truth. Building on worked examples with BinarySum and its variants, we study soundness, completeness, and decidability, and prove that Peano arithmetic is semi-decidable but neither complete nor decidable — setting the stage for the incompleteness theorem.
We must not believe those who today, with a philosophical bearing and a tone of authority, prophesy the downfall of culture and accept the ignorabimus. For us there is no ignorabimus, and in my opinion none in natural science either. In opposition to the foolish ignorabimus our answer is: we must know — we will know!
In this chapter we ask whether the concepts of proof and truth can be expressed algorithmically: is there an automatic way to prove theorems and verify mathematical statements? As we explained in Chapter 1, this was one of the central themes of early 20th-century mathematics.
Mathematics consists of deducing theorems from a certain list of axioms. To define this concept precisely, we turn to formal systems (Section 4.1).
However, we are especially interested in knowing whether the statements (or formulas) of a system are true. For this, we will need to define logical systems (Section 4.2).
Once we have distinguished provable from true, we ask about the relationship between these two concepts in a given logical system: from this we will understand the notions of soundness and completeness in Section 4.3, and finally we will ask whether we can algorithmically check if a formula is true—whether a logical system is decidable or not (see Chapter 3). Throughout this section we introduce multiple examples of logical systems that reinforce the concepts already mentioned, all revolving around a simple arithmetic operation.
Next, we introduce a logical system of special importance: Peano arithmetic (Section 4.4). This system is capable of proving a large number of number-theoretic theorems, so it will be especially interesting to know whether all its true statements are provable (this is precisely the First Incompleteness Theorem, which we prove in Chapter 5). To do this, we will find a way to translate the halting problem (Section 3.6) into a formula of this system.
Finally, we introduce further properties of the systems introduced in Section 4.5.
4.1 Formal systems
Throughout this work we have presented multiple proofs, but what exactly is a proof? When we talk about proving something, we mean doing so mathematically. Unlike scientific proofs, mathematical proofs are exact and verifiable. In this way, we can ask whether a computer can perform proofs automatically.
To answer all these questions, we need to create a mathematical structure that allows us to formalize the concept of proof.
A formal system is a triple , where:
- is a formal language over some alphabet . Each element of is called a well-formed formula (or formula).2
- is the set of axioms: a set of formulas from .
- is the set of inference rules: a set of computable functions mapping formulas of (premises) to formulas of (derivations) (see Definition 3.9).
If, given two formulas , is derived from , we use the notation . If is derived from in a finite number of derivations, we use the notation .
Let us see an example of a formal system that will be extremely useful in this chapter.
Let be the formal system composed of:
- Language : formed over the alphabet , recognized by the regular expression3
where is an abbreviation for the regular expression .
- Axiom set : consists of a single axiom,
- Inference rule set : the following:
where we use the following notation: and are words over the alphabet and is a word obeying the regular expression . The underlined parts are maximal matches of the regular expression for .
It is important to emphasize the notation used to describe the inference rules of , in particular the meaning of maximal match. A maximal match, in this case, is a substring that satisfies the regular expression for and cannot be extended in either direction. In the formula 100+11+1001=101, we have four maximal matches of this type: 100, 11, 1001, and 101, in that order.
It would be possible to describe these rules using regular expressions, but this would make the notation less simple and intuitive.
Once a formal system is defined, it is possible to prove (or demonstrate) some of its formulas, which we call theorems.
Given a formal system , a proof of a formula of is a finite sequence of formulas of , where each formula is either an axiom or follows from applying an inference rule to formulas appearing earlier in the sequence.
A formula is called a theorem (or provable formula) if there exists a proof in .
Let us see an example of a theorem in .
Let 1+1+1=11 be a formula of . We show that it is a theorem:
| Step | Formula | Justification | |
|---|---|---|---|
| (F1) | 1=1 |
(axiom) | |
| (F2) | 1+1=1+1 |
(apply R1 to F1) | |
| (F3) | 1+1=10 |
(apply R2 to F2) | |
| (F4) | 1+1+1=1+10 |
(apply R1 to F3) | |
| (F5) | 1+1+1=11 |
(apply R3 to F4) |
Note that, although it is not in the definition, proofs of theorems are usually accompanied by notes that help verify the proof. The companion repository provides binary_addition.py with is_theorem to generate proofs. To test whether a formula is a theorem in any of the systems in this chapter, specify the system name followed by the formula.
Below are some examples of using this function:
>>> from binary_addition import is_theorem
>>> is_theorem('BinarySum', '1+1+1=11')
(F1) 1=1 (Axioma)
-> (F2) 1+1=1+1 (R1)
-> (F3) 1+1+1=1+1+1 (R1)
-> (F4) 1+1+1=1+10 (R2)
-> (F5) 1+1+1=11 (R3)
'theorem'
>>> is_theorem('BinarySum', '11+1=10')
'not proved within the first 109322 generated formulas'
>>> is_theorem('BinarySum', 'ill-formed')
'ill-formed formula'
>>> is_theorem('NonexistentSystem', 'whatever')
'system does not exist'The proof of 1+1+1=11 performed by is_theorem is different from that of Example 4.4. This is perfectly possible: a theorem can have several proofs. This fact is evident from Definition 4.3 itself: a formula is a theorem if "there exists a proof".
4.2 Logical systems
As the name suggests, the system is intended to check formulas of binary addition. In this way, a word like 11 represents the number , and a formula like 1+1+1=11 represents that . Note that this allows us to recognize whether a formula of is true: we simply interpret it as an arithmetic formula and declare it true if it is a correct arithmetic formula. In this way, formulas like 10+1=11 are true, while others like 11+1=10 are not.
In the previous section, we intentionally did not mention the concept of truth: a formal system has no notion of certainty. This is because the definitions of theorem and true formula are completely different.
Theorems depend only on syntax: "Can we prove a theorem from certain axioms and inference rules?" Truth, however, depends on semantics: "Is this formula true when interpreted by giving certain meaning to its symbols?"
By definition, formal systems depend only on syntax. In this section, we introduce logical systems, which are nothing more than formal systems to which we add a semantics. When we add the arithmetic semantics we have discussed to the formal system , we obtain the logical system .
Let be the logical system obtained by adding arithmetic semantics to the formal system .
A formula in is true if it is correct when viewed as a formula of binary number addition.
Formally, we can define these systems as:
A logical system consists of a formal system and a semantics or truth assignment , where is a function assigning to formulas of an interpretation, which is a value from the set .
The truth assignment need not be computable (Definition 3.9) and may be defined for all formulas or for a subset of them.4
Once we incorporate a truth assignment into a formal system, we can say when a formula is true. We make this precise in the following definition:
Given a logical system with , we say that the formula is true if is well defined and . Otherwise, we say the formula is false.
Let us see examples of true and false formulas for .
Let 1+1+1=11 be a formula of . Clearly, this formula is true since the following arithmetic operation is correct in the binary numeral system:
The file binary_addition.py also provides a function to check the truth of formulas in logical systems, called is_true. An example:
>>> from binary_addition import is_true
>>> is_true('BinarySumLogical', '1+1+1=11')
True
>>> is_true('BinarySumLogical', '11+1=10')
False
>>> is_true('BinarySumLogical', 'ill-formed')
False
>>> is_true('BinarySum', '1+1+1=11')
'system does not exist or is not a logical system'We will introduce more logical systems obtained by adding (Logical system 4.8) and removing (Logical system 4.9) rules from .
Let be the logical system obtained by adding the following inference rule to :
Let be the logical system obtained by removing inference rule (R3) from .
These systems are especially interesting, since in them we can find both provable formulas that are not true (Example 4.10) and true formulas that are not provable (Example 4.11).
The formula 1+1=1 is a theorem and is not true in .
Clearly, is not a correct binary addition operation, and therefore it is not a true formula. However, it is a theorem because we can prove it directly from the axiom using the new rule (R1b) introduced.
from binary_addition import is_theorem, is_true
is_theorem('BinarySumLogicalBroken', '1+1=1')
(F1) 1=1 (Axioma)
-> (F2) 1+1=1 (R1b)
'theorem'
is_true('BinarySumLogicalBroken', '1+1=1')
FalseThe formula 1+10=11 is not a theorem and is true in .
The formula is true since is a correct binary addition operation. However, it is not a theorem because, having removed (R3), we cannot replace 0 with 1.
from binary_addition import is_theorem, is_true
is_theorem('BinarySumLogicalRestricted', '1+10=11')
'not proved within the first 154639 generated formulas'
is_true('BinarySumLogicalRestricted', '1+10=11')
TrueIt is important to note that the function is_theorem cannot prove that a formula is not provable due to the way we designed it. The code above does not prove that 1+10=11 is not a theorem—the proof of this example does.
4.3 Soundness, completeness, and decidability
We have found logical systems in which there are true formulas that are not provable, and vice versa. This leads us to the definition of two important properties of logical systems.
A logical system is sound if all its theorems are true. Otherwise, we say it is unsound.
A logical system is (semantically) complete5 if all true formulas are theorems. Otherwise, we say it is incomplete.
Let us see whether the logical systems we have presented so far are sound and complete. A summary of all results can be seen in Table 4.1.
Proving that is sound and complete is a matter of checking the axiom and each inference rule against the intended meaning of binary addition. A sketch is enough to see the idea; the full arguments are Proposition 4.14 and Proposition 4.15 below.
The logical system is sound and complete.
Proof
Sketch. The only axiom is 1=1, which is true. Each of (R1)–(R3) preserves truth of binary addition identities: (R1) adds one on both sides, (R2) replaces by the even number , and (R3) replaces by the odd number . Conversely, every true identity can be reduced to a sum of ones by reversing those rules, and that sum is derived from the axiom by (R1). The detailed proofs are given below.
The logical system is sound.
Proof
To prove soundness, we verify that all inference rules map true formulas to true formulas. First, the axiom 1=1 is true, since indeed .
Now we check each rule.
(R1)
If and are binary numbers and we assume the formula is true, then . Therefore, the formula is true, since .
(R2)
The maximal matches on mean we must verify that, given a binary number , if is true then is true, i.e. we must show .
A binary number is represented by digits (each or ): , satisfying:
It suffices to observe that:
and that the number corresponds exactly to the binary string .
(R3)
Analogously to the previous rule, we verify that:
The logical system is complete.
Proof
We show that every true formula is a theorem. Every true formula has the form:
where each (for all , ) is a binary number (matching the regular expression ), and the following arithmetic identity holds:
Our goal is to prove that is a theorem. We first prove the following key claim: given a binary number that is a maximal match of the regular expression , it can be derived from the sum of ones, i.e.:
Assuming this claim, we have:
Since , we get:
and clearly can be obtained by applying rule (R1) times to the axiom , so:
Since and 1=1 is an axiom, is a theorem.
It remains to prove the claim that:
Let be a positive binary number. The case is immediate; for , there are two cases.
If is odd, it can be written with digits as . Suppose a formula of contains as a maximal match of , i.e. . Then can be derived from a formula via rule (R3), , where:
If is even, it can be expressed as the sum for some positive binary . If contains as a maximal match, then via rule (R2), where:
With this in hand, every positive integer occurring in a formula of can be reduced to the sum of ones: given ,
This holds because every positive natural number can be reduced to the sum of ones by recursively applying the above operations: divide by when even (using R2 in reverse), or subtract when odd (using R3 in reverse).
Since the other logical systems are "obtained" from , the following propositions are much simpler to prove. As is evident, Example 4.10 and Example 4.11 prove that is unsound and that is incomplete, respectively.
Let us see these propositions next.
The logical system is complete and unsound.
Proof
It is easy to see that this system is complete from the completeness of . We observe that both logical systems have the same semantics, that is, they have the same true formulas. Thus, a true formula in is also true in .
Let us see whether is a theorem in . By the completeness of , is a theorem in that system. But since has all the rules of (and one more), is also a theorem in .
However, the logical system is unsound. In Example 4.10 we saw a formula that is a theorem and is not true.
The logical system is incomplete and sound.
Proof
The incompleteness of this system follows from Example 4.11. Soundness follows from the soundness of .
Let be a theorem of . Since has all the rules of (and one more), is a theorem in . From the soundness of , is true. But since has the same semantics, will also be true in this system.
The logical systems and were obtained by modifying the syntax of . We now introduce the last system of this type, which arises from modifying the semantics of .
Let be the logical system obtained from by modifying its semantics. We interpret formulas as formulas of binary number addition, but the symbol = will be interpreted as "greater than or equal to" ().
In this last logical system we could have modified the symbol = to >=. However, we do not do so intentionally, to remember that syntax and semantics are independent—we can assign whatever truth value we wish.
Let us see a simple illustrative example of a true formula and a false formula.
The formula 1+1=1 is true in , while 1=1+1 is false.
from binary_addition import is_true
is_true('BinarySumLogicalFixed', '1+1=1')
True
is_true('BinarySumLogicalFixed', '1=1+1')
FalseBy modifying the semantics, we have managed to "fix" the system, as its name suggests. Indeed, is complete and sound.
The logical system is complete and sound.
Proof
It is straightforward to see that this logical system is sound. It suffices to observe that rule (R1b) allows us to prove statements like 1+1=1. This rule always adds more 1s to the left of = than to the right. Thus, in every theorem of the system the left-hand side of the equality will be greater than or equal to the right-hand side, matching the definition of the truth assignment (semantics).
Sketch. Soundness of (R1b) is immediate: it only adds ones on the left of =, which we interpret as . Completeness uses the same reduction to sums of ones as , then applies (R1b) enough times to make up the difference . The detailed argument is Proposition 4.18 below.
The logical system is complete.
Proof
We use the result obtained in the previous proposition. Every true formula has the form:
where each is a binary number (matching ) and the following holds:
Denote both sides as and respectively:
Since , there exists such that . By the previous proposition:
It now suffices to observe that:
where step applies rule (R1) times and step applies rule (R1b) times.
As a summary, we see in the following table the completeness and soundness of the systems presented (along with other information we will see later).
| Sound | Complete | Decidable | |
|---|---|---|---|
| (rules R1, R2, R3) | yes | yes | yes |
| (rules R1, R1b, R2, R3) | no | yes | yes |
| (rules R1, R2) | yes | no | yes |
| (rules R1, R1b, R2, R3 and a different semantics) | yes | yes | yes |
| assumed | no | no |
In addition to the properties of soundness and consistency, we can introduce a computational property: decidability. We already know what decidable means for a decision problem: that we can solve it with a program that always halts and has the correct output. For a logical system we can define a decision problem, .
- Input: a formula of .
- Output:
yesif is well defined and , andnootherwise.
For each logical system we obtain a different decision problem. Once this problem is defined, it is natural to define the decidability of a logical system through the decidability of the problem.
We say that a logical system is decidable if the decision problem is decidable.
Thus, a logical system is decidable if there exists a program that decides whether a formula is true or not. It is important to note that some authors define a system as decidable when the problem (which we define next) is decidable. As we have seen, truth and proof are different concepts, and we will always refer to truth when asking whether a logical system is decidable.
- Input: a formula of .
- Output:
yesif is a theorem of , andnootherwise.
Let us see whether the logical systems we have introduced in this chapter are decidable. In the case of , it is straightforward to create a program capable of checking whether the inserted formulas are well formed, and of checking whether the arithmetic operation is correct. In fact, this program is implemented: it is the function is_true from binary_addition.py:
>>> from binary_addition import is_true
>>> is_true('BinarySumLogical', '1+1+1=11')
True
>>> is_true('BinarySumLogical', '11+1=10')
FalseIn the case of the remaining logical systems, creating programs that decide them is equally straightforward. The implementations of these programs are likewise in is_true. Below are more examples of running this function on the remaining logical systems.
>>> from binary_addition import is_true
>>> is_true('BinarySumLogical', '11=1+1')
False
>>> is_true('BinarySumLogicalBroken', '11=1+1')
False
>>> is_true('BinarySumLogicalRestricted', '11=1+1')
False
>>> is_true('BinarySumLogicalFixed', '11=1+1')
True4.4 Peano arithmetic
The logical systems we have explored are of little use. What we want is to work with logical systems that allow us to prove interesting results in mathematics. Mathematicians, logicians, and philosophers have studied many logical systems since the late 19th century, but two stand out for their importance: the Zermelo–Fraenkel axioms, of set theory, and Peano arithmetic, of number theory. In this section we focus on the latter, since Peano arithmetic contains formulas about integers, addition, multiplication, etc.
We call the logical system of Peano arithmetic. You can find the complete description of this system in Peano arithmetic. In Figure 4.22 you can find some details of that description.
Peano arithmetic consists of logical symbols such as , , , , , , , and . The axioms and inference rules of allow deducing properties of the natural numbers. These are represented from via the successor function , so that is , is , etc. In general, represents for a natural .
The inference rules include classical logical formulas, such as modus ponens: given and , we can deduce .
In this system we can produce very interesting formulas about arithmetic. We see some of them below.
Some formulas of (expressed in natural language):6
- (PF1) .
- (PF2) For every integer , .
- (PF3) and are divisors of .
- (PF4) is prime.
- (PF5) Let . Then .7
- (PF6) If , there are no positive integers such that (Fermat's Last Theorem).
- (PF7) Let . Then, for every positive integer there exists a positive integer such that .
To work with in Python programs, we need to find a way to encode the various symbols, which we specify in Table 4.2.
| Symbol | Encoding | Description |
|---|---|---|
NO (p) |
Negation | |
(p) O (q) |
Disjunction | |
FORALL (x) : (p) |
Universal quantifier | |
S(a) |
Successor | |
EXISTS (x) : (p) |
Existential quantifier | |
(p) => (q) |
Implication | |
(p) <=> (q) |
Biconditional | |
(p) = (q) |
Equality |
For example, consider the statement "there do not exist integers and such that and ", which can be represented in as and admits the following string encoding:
NO EXISTE x,y : S(S(0))*x = y Y y = S(S(S(0)))
The formulas of , being from a logical system, can be true or false. In Example 4.23, the first six formulas (from (PF1) to (PF6)) are true,89 while the last one (formula (PF7)) is false.
To be able to prove whether a formula of is true, we need it to be closed: this occurs when all its variables are quantified by a "for all" () or an "exists" ().10 An example is , which is a closed formula since and are quantified, while is not a closed formula. This distinction is important because, if a formula is not closed, we cannot know whether it is true. We will only consider closed formulas in from here on.
Once we accept that Peano arithmetic can express mathematical statements like those in Example 4.23, we can continue to express the outputs of a program in . The following proposition shows how to do this for a concrete set of formulas about the programs we will need later.11
Let be a computer program (or a Turing machine).12 The statement given by
" halts on the empty input"
can be translated into an equivalent formula in . (Here, by "equivalent" we mean that is true if and only if is true.)
Proof
We sketch the proof, since carrying it out with strict rigor would be long and tedious.
In this case, it is simpler to prove this via Turing machines. Recall that we can define each moment of the machine's execution by a configuration. In the case of a single-tape Turing machine, we can easily encode any configuration: we can use an encoding similar to that specified in Proposition 2.21, adding the character ^ to indicate the head position. As an example, an encoding of a configuration from Example 2.11 is specified below:
Likewise, we can encode strings as numbers in a binary string (a word over the alphabet ). Thus, it is reasonable to assume that the configuration of a Turing machine can be represented by a number as a binary string. The transition function of the Turing machine takes one of these configurations in binary as input string, and outputs the new configuration, encoded in the same way. From this point of view, the transition function is a function from integers to integers. We call this function , since evaluating this function once is equivalent to one step of computation on the Turing machine. Note that the function can be written using Peano arithmetic: it is nothing more than a simple function that depends on a few bits of input.
Suppose is the integer representing the initial configuration of the machine. After one step of computation, the configuration of the machine will be , and after two steps, . We can abbreviate this as . After steps, the configuration of the machine will be . It is important to emphasize that each of the configurations can be expressed using Peano arithmetic.
On the other hand, it is evident that the statement
" halts on the empty input"
is equivalent to
"There exists a natural such that is a halting configuration"
By halting configuration we mean that the Turing machine cannot continue executing transitions: it has halted. Checking this is also straightforward. We write a function that takes an integer as input and outputs or . if configuration is a halting configuration, and otherwise.
Writing this function in is not difficult either: already in Definition 2.7 we said that a machine halts if there is no transition defined for the configuration it is in. It is evident that we can translate this statement into a formula of Peano arithmetic.
Thus, we have proved that is a formula of for a natural and a binary . Therefore, the statement:
"There exists a natural such that "
can also be translated into a formula of . This statement is equivalent to the previous ones, and this formula is precisely the we seek.
From the previous proof, it is evident that the construction of from is carried out in a completely algorithmic way, which could in principle be implemented by a Python program. Let such a program be halting_to_peano.py. The code for this work does not provide a program that implements this, since doing so is a complex task.13 However, in the rest of this chapter, we will import the main function halting_to_peano when necessary.
We will next define two important decision problems: IsPeanoTheorem and IsPeanoTrue.14
- Input: a formula of .
- Output:
yesif is a well-formed, closed formula in and is a theorem of ;nootherwise.
- Input: a formula of .
- Output:
yesif is a well-formed, closed, and true formula of ;nootherwise.
Given a statement in , the above problems ask whether is provable and/or true. It turns out that both problems are undecidable. The undecidability of IsPeanoTrue tells us, via Definition 4.20, that is not decidable (as we already anticipated in Table 4.1).11
is undecidable.
Proof
We proceed by the reduction (Problem 3.25) .
We prove that this reduction is implemented in Program 4.1. The main function has as input a program . Using Proposition 4.24, we convert the statement into an equivalent formula in Peano arithmetic. It is important to note that halting_to_peano is a computable function, as we commented earlier. Clearly, halts if and only if is true, which proves the reduction. The result follows from Proposition 3.22.
from is_true_peano import is_true_peano # oracle
from halting_to_peano import halting_to_peano # NOT an oracle
def halting_on_empty_to_is_true_peano(program):
halts_in_peano = halting_to_peano(program)
return is_true_peano(halts_in_peano)IsPeanoTheorem is undecidable.
Proof
Similarly to Proposition 4.27, we use the reduction .
Before this, we must appreciate a property of statements of the form " halts on the empty input". Let us call such a statement ,15 and we will show that for any program , if is true in , then it is a theorem in . It is important to note that this is not the case for all formulas (if it were, would be complete).
The reason this holds precisely for formulas is because we simply need to simulate until it halts, something we can define using Peano arithmetic: we simply compute for each incrementally, until the result is .
We can now perform the reduction using Program 4.1, replacing is_true_peano with is_theorem_peano. As true formulas of the type are theorems, the reduction is correct.
The case of IsPeanoTheorem is less severe, since the problem is in fact semi-decidable (see Definition 3.20). This means we can write a program that checks whether a formula is a theorem (if the formula is not a theorem, the program need not halt).11
IsPeanoTheorem is semi-decidable.
Proof
It is easy to see that Program 4.2 makes IsPeanoTheorem semi-decidable. The idea is to iterate over all possible strings until we see whether one of them is a proof of the input formula.
We import the function is_proof_peano, which given a formula and a proof in checks whether the proof proves that the formula is a theorem. Clearly, this function is not an oracle. In fact, its implementation is straightforward: it suffices to check whether each formula in the proof is an axiom or follows from earlier formulas through the inference rules of the system, checking that the last formula matches the formula we want to prove.
In the loop we iterate over all strings to see whether they are a proof of formula. These strings are enumerated in shortlex order: first all strings of length are enumerated in lexicographic order, then those of length , etc. This ordering is provided by the function next_string from utilities.
If formula is a theorem, its proof will eventually be found and the program will return yes. Otherwise, the program will not halt, but this is not a problem, since we intend to show the semi-decidability of the problem, which does not require the program to halt for negative instances.
import utilities
from is_proof_peano import is_proof_peano # NOT an oracle
def is_theorem_peano(formula):
proof = ''
while True:
if is_proof_peano(proof, formula) == 'yes':
return 'yes'
proof = utilities.next_string(proof)The fact that IsPeanoTheorem is semi-decidable is extremely important, and is due to a syntactic property of : it is recursively axiomatizable.
A formal system is recursively axiomatizable if its axioms are recursively enumerable, that is, if there exists a program that enumerates its axioms.16
Saying that a logical system is recursively axiomatizable is nothing more than saying that the problem is semi-decidable. This property is fundamental for the proof we will carry out of the First Incompleteness Theorem (Theorem 5.2), since if were not recursively axiomatizable, we could not use the function is_theorem_peano.
The problem IsTheorem bears a strong relation to the Entscheidungsproblem (see Chapter 1). This problem seeks to find a general algorithm that, given a mathematical statement, determines whether it is a theorem. By Proposition 4.28, IsPeanoTheorem is undecidable, which proves the Entscheidungsproblem in the particular case of Peano arithmetic. The argument we have carried out is similar to the one Turing made in 17.
Finally, since is a logical system, we can ask about its soundness and completeness. The question of whether is complete is the central object of this work, and will be treated in Chapter 5.
Asking about the soundness of is a complex question. In this work, we assume its soundness, since it is reasonable that the theorems of are true.18
4.5 Syntactic completeness and consistency
Logic books are extremely inconsistent19 in defining properties of logical systems (even in defining what a formal system and a logical system are). So far, we have defined the properties of soundness, (semantic) completeness, and decidability. There is another definition of completeness that depends only on syntax, and is therefore applicable to formal systems.20
For this definition, the formal language must include a well-defined notion of negation (). This is the case in first-order theories such as Peano arithmetic and Zermelo–Fraenkel set theory, but negation is also available in other logical languages.
For this class of systems it is also possible to define a new property: consistency. Again, we can define two types of consistency, a syntactic one and a semantic one.
Let be a formal system. Whenever possible, we say that is syntactically consistent if, for every formula of , it is not possible that both and are theorems.
Let be a logical system. Whenever possible, we say that is semantically consistent if, for every formula of , it is not possible that both and are true.
In other words, a system is consistent if it does not give rise to contradictory proofs or truths. In a sound and complete system, a formula is syntactically consistent if and only if it is semantically consistent.
It is important to make an observation regarding the definitions of syntactic completeness and consistency: although we defined them for formal systems, it is straightforward to extend this definition to logical systems, taking into account their syntax.
Thus, we say that a logical system is syntactically complete if, given a formula of , or are theorems. Analogously, is syntactically consistent if it is not possible that both and are theorems.
The definitions we have made so far (not including that of decidability) are summarized in Figure 4.34.
Let be a logical system and a formula of .
*definition also applicable to formal systems
Footnotes
Vinnikov, V. (1999). We shall know: Hilbert's apology. Mathematical Intelligencer, 21(1):42–46.
↩Whenever we speak of formulas we mean well-formed formulas.
↩Here the symbol
↩+is a literal, not the operator .When a formula is not well defined or does not have a defined interpretation, we can assume it is false.
↩Later we introduce the notion of syntactic completeness (Definition 4.31). Whenever we call a system complete without specifying, we refer to its semantic completeness.
↩They can be translated straightforwardly to Peano arithmetic. For example, (PF2) is , and (PF6) is . Although comparison and exponentiation operations are not initially defined in , we can define them via formulas of the system.
↩means iterating three times: .
↩Fermat's Last Theorem has special historical relevance: it was formulated in 1637 and was not resolved until 1995 by Andrew Wiles.
↩Wiles, A. (1995). Modular elliptic curves and Fermat's Last Theorem. Annals of Mathematics, 141(3):443–551.
↩Recall that in Definition 4.6 we said that the truth assignment may be defined for a subset of the formulas.
↩MacCormick, J. (2018). What Can Be Computed? Princeton University Press.
↩ ↩2 ↩3We prove the equivalence in the Theorem 2.23.
↩Henderson, J. (2013). Gödel's First Incompleteness Theorem in Python. https://github.com/johnyf/godel_py
↩Note that and (see Problem 4.21 and Problem 4.19).
↩We use from English halting.
↩If is infinite, the program will run forever.
↩Turing, A.M. (1937). On computable numbers, with an application to the Entscheidungsproblem. Proceedings of the London Mathematical Society, 42(1):230–265.
↩You can see those axioms in Peano arithmetic.
↩Note the irony.
↩Kleene, S.C. (1971). Introduction to Metamathematics. North-Holland.
↩That is, that the notion of negation () is well defined in the formal system.
↩It is possible that both and are theorems.
↩