5

Problem Statement

Prove that if a function $f$ is primitive recursive, then there are countably infinite number of primitive recursive definitions of $f$

Yes, this is a homework question.

My Work

I proved that there are infinite number of definitions using the following construction

$$g_k(n) = \underbrace{P_{1}^1(P_{1}^1( \dots( P_{1}^1}_{k \text{ times}}(f(n))\dots), \ \forall \ k \in \mathbb{N}$$

Here $P_1^1$ is the projection basis function which picks the $1^{\text{st}}$ element from a vector of size $1$

Now $k$ is unbounded and we will get an equivalent definition for $f$ for each $k$

Now the issue is that this is not the only way to construct an infinite number of equivalent definitions i.e. I could have also use the multiplication operator and multiplied the output of $f$ by 1 as many times as I liked.

How can I show that there is a $1-1$ correspondence of the set of all primitive recursive definitions with the set of naturals numbers? Unlike bit strings, I am unable to comprehend in what way I should assign some number to each function. In fact I don't even know in how many ways can I create equivalent definitions, so how can I even start to enumerate these functions?

Any hints?

Raphael
  • 73,212
  • 30
  • 182
  • 400
Banach Tarski
  • 1,208
  • 9
  • 20

4 Answers4

1

I proved that there are infinite number of definitions using the following construction

That works in principle, but be careful about what $f$ is in that term, formally.

Now the issue is that this is not the only way to construct an infinite number of equivalent definitions

Right you are!

How can I show that there is a 1−1 correspondence of the set of all primitive recursive definitions with the set of naturals numbers?

You don't have to do this explicitly. Use that the class of countable sets is closed against taking subsets.

Raphael
  • 73,212
  • 30
  • 182
  • 400
1

Suppose we are given a primitive recursive function $f$. Let us define the following sets: \begin{align*} A &= \text{"the set of all finite strings of symbols"} \\ B &= \text{"the set of all finite strings of symbols that define a primitive recursive function"} \\ C &= \text{"the set of all finite strings of symbols that define $f$"} \end{align*} Obviously we have $$C \subseteq B \subseteq A$$ You already know that $A$ is countably infinite. In your solution you constructed a countably infinite subset of $C$. Therefore, all three sets $A$, $B$ and $C$ are countably infinite. This is so because:

Theorem: If $X \subseteq A \subseteq Y$ and both $X$ and $Y$ have the same cardinality then $A$ has that cardinality as well.

Andrej Bauer
  • 31,657
  • 1
  • 75
  • 121
0

Just define a function $a(n)$ that adds 1 to non-zero (i.e., $a(n) = \operatorname{if} n = 0 \operatorname{then} 0 \operatorname{else} n + 1$) and another one $s(n) = \operatorname{if} n = 0 \operatorname{then} 0 \operatorname{else} n - 1$. For any given function $f(n)$, there are an infinite collection of functions computing the same result, like $s(a(f(\ldots))$, where the $s(a(\ldots))$ game can be repeated as often as you like.

vonbrand
  • 14,204
  • 3
  • 42
  • 52
0

For any set of functions $X$, let $f(X)$ be the set of functions including

  1. all the initial functions
  2. the (generalized) composition of any functions in $X$
  3. the functions obtained from any $f,g \in X$ by applying the primitive recursion scheme on $f,g$.

If we consider $$ \emptyset \cup f(\emptyset) \cup f(f(\emptyset)) \cup ... = \bigcup_{n \in \mathbb N} f^n(\emptyset) $$ we build the exactly the set of primitive recursion functions. This is easy to check (and is also an immediate application of Kleene's fixed point theorem in domain theory).

Now, every set $f^n(\emptyset)$ is countable, and a countable union of countable set is also countable.

Note that this argument is applicable not only to the definition of the PR functions set, but to many inductive definitions as well. Indeed, we only need that $f(X)$ is countable when $X$ is such. In computer science, this happens very frequently.

chi
  • 14,704
  • 1
  • 31
  • 40