II. Recursive Pairing Functions 31Since R and R are both r.e., then the relationmust be r.e. (Why?) Hence /(xi,... ,x n ) is a recursive function.Proposition 7.(1) For any r.e. relation R(XI,. .. ,x n , y\,..., y^) and any numbersai,...,ak, the relation R(XI, ... ,z n ,ai,... ,a&) (as a relationamong x\,..., x n ) is r.e. {In \-notation, this relation is written:\x\...x n : R(xi,...,x n ,ai,...,ak).J(2) For any recursive function f(x\,... ,a: n , j/ 1} ... ,j/fc) and numbersai,...,ak, the function /(a?i,... ,x n ,ai,... ,«&) zs recursive.Also for any numbers b\,..., b n , the function /(6j,..., b n ,y\ i • • • i Dk) ( as a function of y\,..., yk) is recursive.(3) For any r.e. relation R(x,y), its inverse R(y,x) [In \-notation,the inverse is written: Xx,y: Ry,x] is r.e.(4) For any recursive function f(x,y), the function f(x,x) is recursive.Proof. In each case, the new relation (or function) is explicitly definablefrom the old one.//. Recursive Pairing Functions§4. Recursive Pairing Functions. By a recursive pairingfunction, we mean a 1-1 recursive function J(x,y) such that thereexist recursive functions K(x) and L(x) such that for all x,We recall that a function f(x,y) is called 1-1 if for all numbersXi,yi,x 2 and j/ 2 , if /(zi,2/i) = /(a^.ya), then x l - z 2 and ^ = y 2 .There are many ways to construct recursive pairing functions. Thestandard method is to use Georg Cantor's enumeration of all orderedpairs of natural numbers, which is this: We first take all ordered pairs(x,y) whose sum is 0 (there is only one such pair, viz. (0,0)). Thenwe take all pairs (a;, y) whose sum is 1; there are only two such pairs,and we take them in the order (0,1), (1,0). Then we take all orderedpairs whose sum is 3 in the order (0,3), (1,2), (2,1), (3,0), and soforth. Thus (0,0) is the Oth term of our enumeration, and for any
32 Chapter I. Recursive Enumerability and Recursivityra, if (x, y) is the nth term, then the (n + l)th term isThe first 13 terms of the enumeration are (0,0), (0,1), (1,0), (0,2),(1,1), (2,0), (0,3), (1,2), (2,1), (3,0), (0,4), (1,3), (2,2), (3,1),(4.0). We then define J(x,y) to be that number n such that (x,y)is the nth element of the enumeration.One can show that(see Exercise 4 below), and so the function J(x,y) is recursive. NotethatSince each number x is J(xi,xz) for exactly one pair (a;i,a;2), wedefine K(x) — x\ and L(x) — x%. Then J(Kx,Lx) — J(xi^x^) = a;,and so J(Kx,Lx} = x.Also, for any numbers x and y, if we let z = J(x, y), then Kz — xand Lz — y—in other words, KJ(x,y) = x and LJ(x,y) = y.Since J(x, y) is recursive, so are the functions Kx and Lx becauseandWe thus have:Proposition 8. There is a 1-1 recursive function J(x,y) and recursivefunctions Kx and Lx such that for all numbers x and y:(1) J(Kx,Lx) = x,(2) KJ(x,y) = x and LJ(x,y) = y.The functions Kx and Lx are called the inverse functions ofJ(x,y).Corollary. For any recursive function f(x,y), there is a recursivefunction 4>(x) such that for all x,y : f(x,y) =