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:

    The common experience is, that the man fits himself as well as he can to the customary details of that work or trade he falls into, and tends it as a dog turns a spit. Then he is part of the machine he moves; the man is lost.
    Ralph Waldo Emerson (1803–1882)

    Financiers are great mythomaniacs, their explanations and superstitions are those of primitive men; the world is a jungle to them. They perceive acutely that they are at the dawn of economic history.
    Christina Stead (1902–1983)

    Mark the babe
    Not long accustomed to this breathing world;
    One that hath barely learned to shape a smile,
    Though yet irrational of soul, to grasp
    With tiny finger—to let fall a tear;
    And, as the heavy cloud of sleep dissolves,
    To stretch his limbs, bemocking, as might seem,
    The outward functions of intelligent man.
    William Wordsworth (1770–1850)