examples of primitive recursive predicates
In this entry, we give some examples of primitive recursive predicates. In particular, we will show that the predicate “x is a prime number
” is primitive recursive.
In the examples, we use to indicate a predicate (over the natural numbers ). First, two very simple examples:
- 1.
given by “” for a fixed is primitive recursive. To see this, note that the set associated with is , and its associated characteristic function
is primitive recursive by example 3(l) in this entry (http://planetmath.org/ExamplesOfPrimitiveRecursiveFunctions). As a result, is primitive recursive.
- 2.
given by “” is primitive recursive. The associated set is whose characteristic function is , which is primitive recursive.
Before exhibiting more examples, we prove some basic facts about primitive recursive predicates:
Proposition 1.
If and are primitive recursive predicates, then so are (negation), (disjunction
), and (conjunction
).
Proof.
Let be the sets associated with the predicates and . We may assume that for some positive integer . Let and be the associated characteristic functions.
First, is the characteristic function of , which is the associated set of the predicate . Since is primitive recursive, so is .
Next, is the characteristic function of , which is the associated set of the predicate . Since is primitive recursive, so is .
Finally, the set associated with is , which is , which is primitive recursive. Hence is primitive recursive as well.∎
In short, primitive recursiveness is preserved under Boolean operations on predicates. By induction, we also see primitive recursiveness is preserved under finite disjunction and finite conjunction.
Using this fact, we list three more examples:
- 3.
the predicate “” is primitive recursive, since it is the conjunction of primitive recursive predicates “” and “”.
- 4.
the predicate “” is primitive recursive, since it is the conjunction “” and “”, both of which are primitive recursive.
- 5.
the predicate “”, where is a fixed finite set
, is primitive recursive, as it is the disjunction of primitive predicates of the form “”, where ranges over . Since the disjunction operation
is finitary, “” is primitive recursive also.
Here’s another useful fact about primitive recursive predicates:
Proposition 2.
If is primitive recursive, so is , defined by simultaneous substitution of the variables in by -ary primitive recursive functions :
Proof.
Let be the characteristic function of (the set associated with) , then
is , the characteristic function of . Since , are primitive recursive, , obtained by functional composition, and hence , are primitive recursive too.∎
Let us list two more examples:
- 6.
the predicate “” is primitive recursive.
- 7.
the predicate “” is primitive recursive.
Finite disjunctions and finite conjunctions of predicates can be thought of as special cases of bounded quantification (http://planetmath.org/BoundedQuantifier) on predicates. In view of this, we have the following facts:
Proposition 3.
If is primitive recursive, so are
Proof.
The set associated with is , which is just
For each fixed , let . Then by proposition 2, is primitive recursive. Let be the characteristic function of , and the function such that is if , and otherwise. So is primitive recursive (see this entry (http://planetmath.org/ExamplesOfPrimitiveRecursiveFunctions)). Now, define function by
So iff iff iff .
As a result, iff for all iff . In other words, is the characteristic function of . Since is obtained from by bounded product, is primitive recursive. This shows that is primitive recursive as well.
Next, since the characteristic function of is the same as the characteristic function of , we conclude that is primitive recursive by proposition 1 and what we have just proved.∎
Our final example is the following:
- 8.
given by “ is prime” is primitive recursive. One way to characterize is the following: , and can not be written as a product
of two natural numbers, both greater than . In other words,
where means “can be characterized by” (they share the same characteristic function). Observe that since , both and are in fact bounded
by . Therefore,
As each of , and is primitive recursive, so are their conjunction:
the negation of which:
two successive applications of bounded universal quantifiers
:
and finally its conjunction with the primitive recursive predicate , which is just . Therefore, is primitive recursive.
Remark. The empty set , corresponding to the predicate “”, is clearly primitive recursive. However, as a function, is not primitive recursive.