Primitive Recursive Function - Some Common Primitive Recursive Functions

Some Common Primitive Recursive Functions

The following examples and definitions are from Kleene (1952) pp. 223-231 — many appear with proofs. Most also appear with similar names, either as proofs or as examples, in Boolos-Burgess-Jeffrey 2002 pp. 63-70; they add #22 the logarithm lo(x, y) or lg(x, y) depending on the exact derivation.

In the following we observe that primitive recursive functions can be of four types:

  1. functions for short: "number-theoretic functions" from { 0, 1, 2, ...} to { 0, 1, 2, ...},
  2. predicates: from { 0, 1, 2, ...} to truth values { t =true, f =false },
  3. propositional connectives: from truth values { t, f } to truth values { t, f },
  4. representing functions: from truth values { t, f } to { 0, 1, 2, ... }. Many times a predicate requires a representing function to convert the predicate's output { t, f } to { 0, 1 } (note the order "t" to "0" and "f" to "1" matches with ~(sig( )) defined below). By definition a function φ(x) is a "representing function" of the predicate P(x) if φ takes only values 0 and 1 and produces 0 when P is true".

In the following the mark " ' ", e.g. a', is the primitive mark meaning "the successor of", usually thought of as " +1", e.g. a +1 =def a'. The functions 16-21 and #G are of particular interest with respect to converting primitive recursive predicates to, and extracting them from, their "arithmetical" form expressed as Gödel numbers.

  1. Addition: a+b
  2. Multiplication: a×b
  3. Exponentiation: ab,
  4. Factorial a! : 0! = 1, a'! = a!×a'
  5. pred(a): Decrement: "predecessor of a" defined as "If a> 0 then a-1 → anew else 0 → a."
  6. Proper subtraction: a ┴ b defined as "If a ≥ b then a-b else 0."
  7. Minimum (a1, ... an)
  8. Maximum (a1, ... an)
  9. Absolute value: | a-b | =defined a ┴ b + b ┴ a
  10. ~sg(a): NOT: If a=0 then sg(a)=1 else if a>0 then sg(a)=0
  11. sg(a): signum(a): If a=0 then sg(a)=0 else if a>0 then sg(a)=1
  12. "b divides a" : If the remainder ( a, b )=0 then else b does not divide a "evenly"
  13. Remainder ( a, b ): the leftover if b does not divide a "evenly". Also called MOD(a, b)
  14. a = b: sg | a - b |
  15. a < b: sg( a' ┴ b )
  16. Pr(a): a is a prime number Pr(a) =def a>1 & NOT(Exists c)1
  17. Pi: the i+1-st prime number
  18. (a)i : exponent ai of pi =def μx ; μx is the minimization operator described in #E below.
  19. lh(a): the "length" or number of non-vanishing exponents in a
  20. a×b: given the expression of a and b as prime factors then a×b is the product's expression as prime factors
  21. lo(x, y): logarithm of x to the base y
In the following, the abbreviation x =def xi, ... xn; subscripts may be applied if the meaning requires.
  • #A: A function φ definable explicitly from functions Ψ and constants q1, ... qn is primitive recursive in Ψ.
  • #B: The finite sum Σy ψ(x, y) and product Πyψ(x, y) are primite recursive in ψ.
  • #C: A predicate P obtained by substituting functions χ1,..., χm for the respective variables of a predicate Q is primitive recursive in χ1,..., χm, Q.
  • #D: The following predicates are primitive recursive in Q and R:
  • NOT_Q(x) .
  • Q OR R: Q(x) V R(x),
  • Q AND R: Q(x) & R(x),
  • Q IMPLIES R: Q(x) → R(x)
  • Q is equivalent to R: Q(x) ≡ R(x)
  • #E: The following predicates are primitive recursive in the predicate R:
  • (Ey)y R(x, y) where (Ey)y denotes "there exists at least one y that is less than z such that"
  • (y)y R(x, y) where (y)y denotes "for all y less than z it is true that"
  • μyy R(x, y). The operator μyy R(x, y) is a bounded form of the so-called minimization- or mu-operator: Defined as "the least value of y less than z such that R(x, y) is true; or z if there is no such value."
  • #F: Definition by cases: The function defined thus, where Q1, ..., Qm are mutually exclusive predicates (or "ψ(x) shall have the value given by the first clause that applies), is primitive recursive in φ1, ..., Q1, ... Qm:
φ(x) =
  • φ1(x) if Q1(x) is true,
  • . . . . . . . . . . . . . . . . . . .
  • φm(x) if Qm(x) is true
  • φm+1(x) otherwise
  • #G: If φ satisfies the equation:
φ(y,x) = χ(y, NOT-φ(y; x2, ... xn ), x2, ... xn then φ is primitive recursive in χ. 'So, in a sense the knowledge of the value NOT-φ(y; x2 to n ) of the course-of-values function is equivalent to the knowledge of the sequence of values φ(0,x2 to n), ..., φ(y-1,x2 to n) of the original function."

Read more about this topic:  Primitive Recursive Function

Famous quotes containing the words common, primitive and/or functions:

    Throughout the 1980’s, we did hear too much about individual gain and the ethos of selfishness and greed. We did not hear enough about how to be a good member of a community, to define the common good and to repair the social contract. And we also found that while prosperity does not trickle down from the most powerful to the rest of us, all too often indifference and even intolerance do.
    Hillary Rodham Clinton (b. 1947)

    The price we pay for the complexity of life is too high. When you think of all the effort you have to put in—telephonic, technological and relational—to alter even the slightest bit of behaviour in this strange world we call social life, you are left pining for the straightforwardness of primitive peoples and their physical work.
    Jean Baudrillard (b. 1929)

    The mind is a finer body, and resumes its functions of feeding, digesting, absorbing, excluding, and generating, in a new and ethereal element. Here, in the brain, is all the process of alimentation repeated, in the acquiring, comparing, digesting, and assimilating of experience. Here again is the mystery of generation repeated.
    Ralph Waldo Emerson (1803–1882)