examples of primitive recursive encoding
In this entry, we present three examples of primitive recursive encodings. In all the examples, the following notations are used: is the set of all natural numbers (including ), is the set of all finite sequences over , and is the encoding in question. For any sequence , its image under is denoted by , and is called the sequence number corresponding to . Furthermore, denotes the empty sequence, and its sequence number is denoted by . The fact that the in each of the examples below is in fact encoding is proved in this entry (http://planetmath.org/EncodingWords).
Example 1. (Multiplicative encoding) is defined as follows:
where is the successor function, and are the first prime numbers.
To see that is primitive recursive, we verify the following:
the predicate “ is a sequence number” is primitive recursive: a number is a sequence number iff or, if for some prime , then for any prime . The predicates
where “ is prime”, are primitive recursive by bounded quantification. Thus “ is a sequence number” iff “ or ” iff “”, is primitive recursive as a result.
is clearly primitive recursive.
can be defined as the number of primes dividing , which is primitive recursive.
can be defined as the exponent of the -th prime in (the largest power of dividing ), which is again primitive recursive.
Example 2. (Encoding via a pairing function) First, let be a (primitive recursive) pairing function. For any , define
Then define by
is primitive recursive because
is a bijection, so the predicate “ is a sequence number” is the same as “”, which is clearly primitive recursive,
is primitive recursive since both and are, the latter of which can be shown to be primitive recursive by induction,
The two functions such that are primitive recursive. So in particular is primitive recursive.
If , then , and . Thus,
is primitive recursive, since each case is primitive recursive.
In other words,
To see that is primitive recursive, we first define three functions given by , the exponent of in , given by , and given by
Clearly, are all primitive recursive. Furthermore, has the property that if , then , and therefore for large enough . Using , we may proceed to show that is primitive recursive:
Remark. In the third example, can be more generally defined so that
provided that are coprime. It is fairly straightforward to show that is again primitive recursive.
|Title||examples of primitive recursive encoding|
|Date of creation||2013-03-22 19:06:23|
|Last modified on||2013-03-22 19:06:23|
|Last modified by||CWoo (3771)|