A function in intension is a finite description of a computation, such as a program or a formal construction expression. A function in extension is the resulting input-output map, including its domain if it is partial. Different descriptions may have the same extension: the programs that return directly and that compute describe the same function. Finite descriptions have Gödel numbers; equality of the resulting partial computable functions is a separate semantic question.
The primitive recursive functions are the smallest class of numerical functions containing the zero functions, the successor function and all projection functions, and closed under function composition in recursion theory and primitive recursion. More explicitly, from and the latter operation forms
For function composition in recursion theory, an -ary and -ary give . Zero functions of all allowed arities can be included, with nullary zero included if arity is part of the coding convention. Every resulting function is total: the initial functions are total, function composition in recursion theory preserves totality, and mathematical induction on verifies totality of primitive recursion. Applying structural induction for primitive recursive functions then covers all construction expressions.
Use a fixed effective Gödel numbering of finite tagged construction trees with decidable decoding. A node is tagged as zero, successor, projection, composition, or recursion. The primitive recursive syntax and arity checking algorithm first checks that the input decodes as a finite tree, then works upwards from its leaves. A projection tag is legal exactly when , with output arity . A composition node declares its output arity and is legal when its outer child has arity , there are exactly inner children, and each has arity ; its arity is . The declared arity also handles the case . A recursion node is legal when its base child has arity and its step child has arity ; its arity is . Zero and successor tags have their declared arities. Ill-formed nodes are rejected. The process terminates because there are only finitely many nodes. Thus, for each fixed ,
This is a syntactic assertion about functions in intension. It does not assert that arbitrary machine indices computing primitive recursive functions form a decidable set. That extensional property is nontrivial, hence undecidable by Rice theorem. For an explicit reduction, given a program construct a program that, on every input, waits for to halt and then returns . Its extension is a primitive recursive function if , and otherwise is nowhere defined and so is not a primitive recursive function. A decision procedure for this latter semantic set would decide the diagonal halting set.
Enumerate the decidable syntax set in increasing code order as . There are infinitely many such descriptions; iterating successor after a unary zero expression already supplies infinitely many. Let be the extension of a valid construction and define
To compute , find by the syntax test and interpret its finite construction tree. Evaluate function composition in recursion theory by evaluating the children, and evaluate primitive recursion by the prescribed finite loop of length equal to its final input. Termination follows from the totality argument above, so and are total computable functions.
If were a unary primitive recursive function, some construction would have extension . Then the diagonal argument gives
which is impossible. The displayed is total and computable but not primitive recursive. Repetitions of extensions in the enumeration cause no problem: every possible extension is represented, which is all the diagonal argument needs. The same argument shows that the two-variable interpreter cannot itself be primitive recursive.
Let be any sequence in a complete, totally bounded metric space . Cover by finitely many balls of radius ; one contains infinitely many terms. From those terms choose an infinite subsequence lying in one ball of radius , and continue. The diagonal argument produces a subsequence whose tail from its th term onward lies in a ball of radius . Hence
whenever , so the subsequence is Cauchy. Completeness makes it converge in .
Every sequence in therefore has a convergent subsequence, so is sequentially compact. Sequential compactness is equivalent to compactness for metric spaces, and thus is compact. This proves that a complete totally bounded metric space is compact.
The boundedness in the Sobolev space and the weak sequential compactness of bounded sequences in a reflexive Banach space give a subsequence converging weakly to some . For each integer , the Rellich-Kondrachov compactness theorem makes compact because the dimension is two. Repeated extraction followed by the diagonal argument gives one subsequence converging strongly to in every with integral .
For any finite real , choose an integer . Since has finite measure, the Lp inclusion on a finite measure space gives
The same subsequence therefore works for every finite .
Apply Arzela-Ascoli theorem on . Pointwise boundedness and equicontinuity give a subsequence converging uniformly there. Successively extract subsequences for , and take the diagonal subsequence. It converges uniformly on every closed bounded interval. Its limits on nested intervals agree, so they define on the real numbers; the locally uniform limit of continuous functions is continuous.
On the unit ball, part 1 controls the norm. Outside it, , so
Hence , proving that the embedding is continuous.
For compactness, let be bounded in . On each ball, it is bounded in , so the Rellich-Kondrachov compactness theorem gives a subsequence convergent in local . The tail estimate
is uniform in and tends to zero as . A diagonal argument therefore gives convergence in all of . This is the compact embedding of a confining-potential energy space.
Enumerate the vertices as . Since every vertex has finite degree, choose increasing finite vertex sets whose union is and such that the closed neighbourhood of lies in whenever . By part (b), each finite induced graph has an unfriendly two-colouring.
There are only two colours. Pass successively to an infinite subsequence on which the colour of is constant, then one on which the colour of is constant, and so on. The diagonal argument gives a limiting colouring in which, for every fixed finite set of vertices, all its colours agree with those in infinitely many of the finite colourings.
Fix . Its entire finite neighbourhood lies in every sufficiently large , and along the diagonal subsequence the colours of and all its neighbours eventually stabilize. The unfriendly inequality for in therefore passes unchanged to the limit. This holds for every vertex, proving the unfriendly partition theorem for a countable locally finite graph.
By definition of the weak topology, exactly when for every .
Let be bounded and choose a norm-dense sequence in . Successive subsequences make converge, and the diagonal argument produces a single subsequence on which every converges. Uniform boundedness of and norm approximation of an arbitrary by the show that is Cauchy for every . Thus is weakly Cauchy, and
for every , so its difference sequence is weakly null.
For the countable family , use the weak metric from part a. Delete a finite initial segment from the th sequence so that every remaining term has weak distance less than from zero, and relabel that tail. Enumerate all these tails while preserving the order within each one. For every weak neighbourhood of zero, all terms from sufficiently large lie inside it, and only finitely many terms from each of the finitely many remaining sequences lie outside it. The resulting enumeration is weakly null and contains the relabelled th sequence as a subsequence for every . Equivalently, without relabelling, it contains a tail-subsequence of every original sequence, which is the form used below.
Suppose the Finite Ramsey theorem failed for fixed positive integers . For every choose a -coloring with no monochromatic -set. There are only finitely many colorings of , so an infinite subsequence of the agrees there. Pass to a further infinite subsequence agreeing on , and continue. The diagonal argument produces compatible colorings such that and no has a monochromatic -set.
Define whenever . Compatibility makes this a well-defined finite coloring of . By Ramsey's theorem it has an infinite monochromatic set, whose first elements contradict the defining property of a sufficiently large . This compactness argument proves the finite statement.
Assume a complete list were primitive recursive. Closure under diagonal composition and successor makes
primitive recursive. Completeness gives a row with for every , but at this says . This is the diagonal argument.