examples of primitive recursive predicates

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.

Φ

⁢

(

x

)

given by “

x

=

n

” for a fixed

n

∈

ℕ

is primitive recursive. To see this, note that the set associated with

Φ

is

{

n

}

, 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.

Φ

⁢

(

x

,

y

)

given by “

x

≤

y

” is primitive recursive. The associated set is

{

(

x

,

y

)

∣

x

≤

y

}

whose characteristic function is

sgn

⁡

(

s

⁢

(

y

)

⁢

-

˙

⁢

x

)

, 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

S

,

T

be the sets associated with the predicates

Φ

and

Θ

. We may assume that

S

,

T

⊆

ℕ

k

for some

positive integer

k

. Let

c

S

and

c

T

be the associated characteristic functions.

First,

1

⁢

-

˙

⁢

c

S

is the characteristic function of

ℕ

k

-

S

, which is the associated set of the predicate

¬

⁢

Φ

. Since

1

⁢

-

˙

⁢

c

S

is primitive recursive, so is

¬

⁢

Φ

.

Next,

mult

⁡

(

C

S

,

C

T

)

is the characteristic function of

S

∩

T

, which is the associated set of the predicate

Φ

∧

Θ

. Since

mult

⁡

(

C

S

,

C

T

)

is primitive recursive, so is

Φ

∧

Θ

.

Finally, the set associated with

Φ

∨

Θ

is

S

∪

T

, which is

ℕ

k

-

(

(

ℕ

k

-

S

)

∩

(

ℕ

k

-

T

)

)

, 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 “

x

=

y

” is primitive recursive, since it is the conjunction of primitive recursive predicates “

x

≤

y

” and “

y

≤

x

”.

4.

the predicate “

y

<

x

” is primitive recursive, since it is the conjunction “

y

≤

x

” and “

¬

⁡

(

x

=

y

)

”, both of which are primitive recursive.

5.

the predicate “

x

∈

S

”, where

S

is a fixed

finite set

, is primitive recursive, as it is the disjunction of primitive predicates of the form “

x

=

n

”, where

n

ranges over

S

. Since the disjunction

operation

is finitary, “

x

∈

S

” is primitive recursive also.

Here’s another useful fact about primitive recursive predicates:

Proposition 2

.

If

Φ

⁢

(

x

1

,

…

,

x

m

)

is primitive recursive, so is

Θ

⁢

(

x

1

,

…

,

x

n

)

, defined by

simultaneous substitution

of the

variables

x

i

in

Φ

by

n

-ary

primitive recursive functions

f

i

:

Θ

⁢

(

x

1

,

…

,

x

n

)

:=

Φ

⁢

(

f

1

⁢

(

x

1

,

…

,

x

n

)

,

…

,

f

m

⁢

(

x

1

,

…

,

x

n

)

)

.

Proof.

Let

c

Φ

be the characteristic function of (the set associated with)

Φ

, then

c

Φ

⁢

(

f

1

⁢

(

x

1

,

…

,

x

n

)

,

…

,

f

m

⁢

(

x

1

,

…

,

x

n

)

)

is

c

Θ

, the characteristic function of

Θ

. Since

c

Φ

,

f

i

are primitive recursive,

c

Θ

, obtained by

functional

composition

, and hence

Θ

, are primitive recursive too.
∎

Let us list two more examples:

6.

the predicate “

x

⁢

y

≠

z

” is primitive recursive.

7.

the predicate “

y

<

x

!

” 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

Φ

⁢

(

𝐱

,

y

)

is primitive recursive, so are

Θ

⁢

(

𝒙

,

y

)

:=

∀

z

≤

y

⁢

Φ

⁢

(

𝒙

,

z

)

𝑎𝑛𝑑

Ψ

⁢

(

𝒙

,

y

)

:=

∃

z

≤

y

⁢

Φ

⁢

(

𝒙

,

z

)

.

Proof.

The set associated with

Θ

⁢

(

𝒙

,

y

)

is

{

(

𝒙

,

y

)

∣

for all

⁢

z

≤

y

,

Φ

⁢

(

𝒙

,

z

)

}

, which is just

S

:=

{

(

𝒙

,

y

)

∣

Φ

⁢

(

𝒙

,

0

)

}

∩

{

(

𝒙

,

y

)

∣

Φ

⁢

(

𝒙

,

1

)

}

∩

⋯

∩

{

(

𝒙

,

y

)

∣

Φ

⁢

(

𝒙

,

y

)

}

For each fixed

i

, let

Φ

i

⁢

(

𝒙

)

:=

Φ

⁢

(

𝒙

,

i

)

. Then by

proposition

2,

Φ

i

is primitive recursive. Let

c

i

be the characteristic function of

Φ

i

, and

d

the function such that

d

⁢

(

𝒙

,

i

)

is

c

i

⁢

(

𝒙

)

if

i

∈

{

0

,

…

,

n

}

, and

0

otherwise. So

d

is primitive recursive (see this entry (

http://planetmath.org/ExamplesOfPrimitiveRecursiveFunctions

)). Now, define function

c

by

c

⁢

(

𝒙

,

y

)

:=

∏

i

=

0

y

d

⁢

(

𝒙

,

i

)

.

So

1

=

d

⁢

(

𝒙

,

i

)

=

c

i

⁢

(

𝒙

)

iff

Φ

i

⁢

(

𝒙

)

iff

(

𝒙

,

i

)

∈

{

(

𝒙

,

i

)

∣

Φ

⁢

(

𝒙

,

i

)

}

iff

(

𝒙

,

y

)

∈

{

(

𝒙

,

y

)

∣

Φ

⁢

(

𝒙

,

i

)

}

.

As a result,

1

=

c

⁢

(

𝒙

,

y

)

iff

(

𝒙

,

y

)

∈

{

(

𝒙

,

y

)

∣

Φ

⁢

(

𝒙

,

i

)

}

for all

i

∈

{

0

,

…

,

y

}

iff

(

𝒙

,

y

)

∈

S

. In other words,

c

is the characteristic function of

S

. Since

c

is obtained from

d

by

bounded product

,

c

is primitive recursive. This shows that

Θ

is primitive recursive as well.

Next, since the characteristic function of

Ψ

⁢

(

𝒙

,

y

)

is the same as the characteristic function of

¬

⁢

∀

z

≤

y

⁢

(

¬

⁢

Φ

⁢

(

𝒙

,

z

)

)

, we conclude that

Ψ

is primitive recursive by proposition 1 and what we have just proved.
∎

Our final example is the following:

8.

Φ

⁢

(

x

)

given by “

x

is prime” is primitive recursive. One way to characterize

Φ

is the following:

1

<

x

, and

x

can not be written as a

product

of two natural numbers, both greater than

1

. In other words,

Φ

(

x

)

≡

(

1

<

x

)

∧

∀

y

(

∀

z

¬

(

x

=

y

z

∧

1

<

y

∧

1

<

z

)

)

,

where

≡

means “can be characterized by” (they share the same characteristic function). Observe that since

x

=

y

⁢

z

, both

y

and

z

are in fact

bounded

by

x

. Therefore,

Φ

(

x

)

≡

(

1

<

x

)

∧

∀

y

≤

x

(

∀

z

≤

x

¬

(

x

=

y

z

∧

1

<

y

∧

1

<

z

)

)

.

As each of

x

=

y

⁢

z

,

1

<

y

, and

1

<

z

is primitive recursive, so are their conjunction:

x

=

y

⁢

z

∧

1

<

y

∧

1

<

z

,

the negation of which:

¬

⁡

(

x

=

y

⁢

z

∧

1

<

y

∧

1

<

z

)

,

two successive applications of bounded

universal quantifiers

:

∀

y

≤

x

(

∀

z

≤

x

¬

(

x

=

y

z

∧

1

<

y

∧

1

<

z

)

)

,

and finally its conjunction with the primitive recursive predicate

1

<

x

, which is just

Φ

⁢

(

x

)

. Therefore,

Φ

⁢

(

x

)

is primitive recursive.

Remark

. The

empty set

∅

, corresponding to the predicate “

x

<

x

”, is clearly primitive recursive. However,

∅

as a function, is not primitive recursive.

Title

examples of primitive recursive predicates

Canonical

name

ExamplesOfPrimitiveRecursivePredicates

Date of creation

2013-03-22 19:05:43

Last modified on

2013-03-22 19:05:43

Owner

CWoo (3771)

Last modified by

CWoo (3771)

Numerical id

9

Author

CWoo (3771)

Entry type

Example

Classification

msc 03D20

Related topic

ExamplesOfPrimitiveRecursiveFunctions

Generated on Thu Feb 8 20:03:31 2018 by

LaTeXML