If is a formula of , the language of arithmetic, its Gödel code will be a number . The code map is injective.

Coding Symbols:

Assign to the variable the integer . Thus

For the other symbols of ,

\neg \mapsto 2, \ \land \mapsto 4, \ \lor \mapsto 6, \ \rightarrow \mapsto 8, \ ( \mapsto 10, \ ) \mapsto 12, \\ \forall \mapsto 14, \ \exists \mapsto 16, \ = \mapsto 18, \ S \mapsto 20, \ + \mapsto 22, \ \cdot \mapsto 24, \ 0 \mapsto 26. \end{gather*}

Let be the integer assigned to the symbol .

Coding Formulas:

To the string of symbols assign the Gödel code/number where is the prime.

For example, to the formula which is an abbreviation of , assign Given a string of symbols, in particular a term or a formula, we can effectively find the associated Gödel code. Conversely, given an integer, we can effectively find whether or not it is the Gödel code of a string of symbols, and if so we can effectively write out this string.

Primitive Recursive Syntactic Relations and Constructions

Likewise the relations (Concatenation), (Negation), , such that C(a,b,c) \text{ iff } a = \ulcorner \varphi \urcorner, \; b = \ulcorner \psi \urcorner, \; c = \ulcorner \varphi \land \psi \urcorner \quad \text{for some formulas } \varphi, \psi, $$$$ N(a,b) \text{ iff } a = \ulcorner \varphi \urcorner, \; b = \ulcorner \neg \varphi \urcorner \quad \text{for some formula } \varphi, $$$$ E_n(a,b) \text{ iff } a = \ulcorner \varphi \urcorner, \; b = \ulcorner \exists v_n \varphi \urcorner \quad \text{for some formula } \varphi, are all primitive recursive.

Also, the relation Sub defined by and is obtained from by substituting for each free occurrence of in , is primitive recursive.

The usual sets of formulas (atomic formulas, sentences, etc.) and operations on formulas (forming the conjunction of two formulas etc.), after coding, are clearly computable. Moreover, they are primitive recursive as their validity does not require unbounded search.

One can then check that the set of Gödel codes of terms, of atomic formulas, of all formulas, of formulas with at most free, of sentences, of axioms etc., are primitive recursive

There is similarly a primitive recursive function whose range is the set of gödel codes of formulas with at most free.

That is, Composing the primitive recursive functions , the binary function defined by is also primitive recursive. There are actually much more stuff in Hilbert deductive system that we would code.

Coding Proofs

Just as we coded formulas as integers, so we can code finite sequences of formulas, and in particular formal proofs, as integers.

If is a proof from , then is a finite sequence of formulas . Analogously to (7.2), we code as the integer , where Conversely, given a natural number one can (in principle) effectively obtain the corresponding proof, denoted by . Formula coding uses and while proof coding uses and . This is no big deal, we could also use even integers and odd integers for formulas and proofs respectively, or just rely on context!

A particularly significant for us is the relation defined by It is primitive recursive by similar arguments to before.

Arithmetic Representation

The relations discussed above and the relation are all primitive recursive. Hence by theorem , they can be represented in by -formulas. In particular, there is a -formula (which represents ) such that for ,

Similarly, the ternary proof relation , defined by is primitive recursive. It follows that we can effectively exhibit a -formula in the language of number theory, such that . (As usual, the formal proofs can be written out by mimicking the calculation of the primitive recursive characteristic function of , which comes in turn from its given primitive recursive definition.)

Provability

Consider the set of those for which there is a proof of the sentence corresponding to . That is, (Note that this is a statement in the metalanguage.) "" meaning “provable”. Because of the existential quantifier , the set is not primitive recursive, nor is it computable in the broader sense. However, is computably enumerable in the following sense: we can write a program which will enumerate all possible proofs, and hence enumerate all sentences which are provable

But one cannot know of an arbitrary sentence , how long it will take to be listed if it is indeed provable. As we will see later, for some it will be the case that both and its negation will not be provable from . There is then no algorithmic procedure which will eventually give a “provability” answer for every input .

Following the definition of and introduction of the -formula , we define the -formula by The formula is , although it does not correspond to a primitive computable (or even a total computable) function. It asserts there is a proof of the sentence with Gödel number . Similarly and importantly, define for which is the provability relation meaning, in this case, that there is a formal proof from of . Then there is a -formula defined by This is the formula in the language of arithmetic corresponding to there is a proof of ”. More explicitly it corresponds to there is a proof coded up by of .

We can enumerate all formulas with one variable , in a primitive recursive computable manner. Similarly for sentences and proofs. Define Prf(p,n) to mean codes a proof of sentence coded by , i.e Prf(p,n) iff codes a proof of sentence coded by . Then Prf is primitive recursive relation.

So there is a formula, which we can explicitly find, P(u,v) s.t, and is . Define Prov(n)