Elementary recursive function: Difference between revisions

From HandWiki
Unex (talk | contribs)
over-write
 
simplify
 
Line 1: Line 1:
{{Short description|Concept in computability theory}}
{{Short description|Concept in computability theory}}
The term '''elementary''' was originally introduced by [[Biography:László Kalmár|László Kalmár]] in the context of [[Computability theory|computability theory]].{{sfn|Kalmár|1943}}{{sfn|Kleene|1952|pages=285, 526}} He defined the class of '''elementary recursive functions''' (''"Kalmár elementary functions"'') as a subset of the [[Primitive recursive function|primitive recursive function]]s — specifically, those that can be computed using a limited set of operations such as composition, bounded sums, and bounded products. These functions grow no faster than a fixed-height tower of [[Exponentiation|exponentiation]] (for example, <math>O(2^{2^n})</math>). Not all primitive recursive functions are elementary; for example, [[Tetration|tetration]] grows too rapidly to be included in the elementary class.
The term '''elementary''' was originally introduced by [[Biography:László Kalmár|László Kalmár]] in the context of [[Computability theory|computability theory]].{{sfn|Kalmár|1943}}{{sfn|Kleene|1952|pages=285, 526}} He defined the class of '''elementary recursive functions''' (''"Kalmár elementary functions"'') as a subset of the [[Primitive recursive function|primitive recursive function]]s — specifically, those that can be computed using a limited set of operations such as composition, bounded sums, and bounded products.{{sfn|Rose|1984|p=3|loc=Definition}} These functions grow no faster than a fixed-height tower of [[Exponentiation|exponentiation]] (for example, <math>O(2^{2^n})</math>). Not all primitive recursive functions are elementary; for example, [[Tetration|tetration]] grows too rapidly to be included in the elementary class. The elementary recursive functions correspond to the class <math>\mathcal{E}^3</math> of the [[Grzegorczyk hierarchy]].{{sfn|Rose|1984|p=33|loc=Theorem 2.3}}


In [[Computational complexity theory|computational complexity theory]], the term [[ELEMENTARY]] refers to a class of decision problems solvable in elementary time — that is, within time bounded by some fixed number of exponentials. Formally:
In [[Computational complexity theory|computational complexity theory]], the term [[ELEMENTARY]] refers to a class of decision problems solvable in elementary time — that is, within time bounded by some fixed number of exponentials. Formally:
Line 11: Line 11:
==Definition==
==Definition==


The definitions of elementary recursive functions are the same as for [[Primitive recursive function|primitive recursive function]]s, except that primitive recursion is replaced by bounded summation and bounded product. All functions work over the [[Natural number|natural number]]s. The basic functions, all of them elementary recursive, are:
The definitions of elementary recursive functions are the same as for [[Primitive recursive function|primitive recursive function]]s, except that primitive recursion is replaced by bounded summation and bounded product.{{sfn|Kalmár|1943}}{{sfn|Rose|1984|p=3|loc=Definition}}{{sfn|Tourlakis|2022|p=580|loc=15.1.34 Definition}} All functions work over the [[Natural number|natural number]]s. The basic functions, all of them elementary recursive, are:


# '''Zero function'''.  Returns zero: <math>f(x)=0</math>.
# '''Zero function'''.  Returns zero: <math>f(x)=0</math>.
# '''Successor function''': <math>f(x)=x+1</math>. Often this is denoted by <math>S</math>, as in <math>S(x)</math>. Via repeated application of a successor function, one can achieve addition.
# '''Successor function''': <math>f(x)=x+1</math>. Often this is denoted by <math>S</math>, as in <math>S(x)</math>. Via repeated application of a successor function, one can achieve addition.
# '''Projection functions''': these are used for ignoring arguments. For example, <math>f(a,b)=a</math> is a projection function.
# '''Projection functions''': these are used for ignoring arguments. For example, <math>f(a,b)=a</math> is a projection function.
# '''Subtraction function''': <math>f(x,y)=x-y</math> if <math>y<x</math>, or 0 if <math>y\ge x</math>. This function is used to define conditionals and iteration.
# '''Subtraction function''': <math>f(x,y) = \max(x-y, 0)</math>. This function is used to define conditionals and iteration.


From these basic functions, we can build other elementary recursive functions.
From these basic functions, we can build other elementary recursive functions.
Line 39: Line 39:
The class of elementary recursive functions coincides with the closure under superposition of the projection functions and one of the following sets of initial functions:
The class of elementary recursive functions coincides with the closure under superposition of the projection functions and one of the following sets of initial functions:
:* <math>\{ n + m,\; n \mathbin{\dot{-}} m,\; \lfloor n/m \rfloor,\; 2^n \}</math>{{sfn|Marchenkov|1980}}
:* <math>\{ n + m,\; n \mathbin{\dot{-}} m,\; \lfloor n/m \rfloor,\; 2^n \}</math>{{sfn|Marchenkov|1980}}
:* <math>\{ 1, \; n+m,\; n \mathbin{\dot{-}} m, \; \lfloor n/m \rfloor, \; n \times m, \; n^m \}</math>{{sfn|Mazzanti|2002}}
:* <math>\{ n+m,\; n \mathbin{\dot{-}} m, \; \lfloor n/m \rfloor, \; nm, \; n^m \}</math>{{sfn|Mazzanti|2002}}
:* <math>\{ n + 1,\; n \mathbin{\dot{-}} m,\; \lfloor n/m \rfloor,\; n^m \}</math> :* <math>\{ n + m,\; n \bmod m,\; n^2,\; 2^n \}</math>{{sfn|Marchenkov|2007}}
:* <math>\{ n + m,\; n \bmod m,\; n^2,\; 2^n \}</math>{{sfn|Marchenkov|2007}}
:* <math>\{ n + m,\; n \bmod m,\; 2^n \}</math>{{refn|<math>n^2 = 2^{n+n} \bmod (2^n + n)</math> {{harvtxt|Prunescu|Sauras-Altuzarra|Shunia|2025}}}}
:* <math>\{ n + m,\; n \bmod m,\; 2^n \}</math>{{refn|<math>n^2 = 2^{n+n} \bmod (2^n + n)</math> {{harvtxt|Prunescu|Sauras-Altuzarra|Shunia|2025}}}}
where <math>n \mathbin{\dot{-}} m = \max (n - m, 0)</math> denotes truncated subtraction ([[Monus#Natural numbers|monus]]).
where <math>n \mathbin{\dot{-}} m = \max (n - m, 0)</math> denotes truncated subtraction ([[Monus#Natural numbers|monus]]).


In 2025 Mihai Prunescu, Lorenzo Sauras-Altuzarra and Joseph M. Shunia proved that the class of Kalmár elementary functions can be inductively generated from addition (<math>n + m</math>), integer remainder (<math>n \bmod m</math>) and base-two exponentiation (<math>2^n</math>), improving previous results by Marchenkov{{sfn|Marchenkov|2007}} and Mazzanti.{{sfn|Mazzanti|2002}} In addition, they further proved that the substitution basis defined by these three operations is minimal.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025}}
In 2025 Mihai Prunescu, Lorenzo Sauras-Altuzarra and Joseph M. Shunia proved that the class of Kalmár elementary functions can be inductively generated from [[Addition|addition]] (<math>n + m</math>), [[Modulo|integer remainder]] (<math>n \bmod m</math>) and [[Power of two|base-two exponentiation]] (<math>2^n</math>), improving previous results by Mazzanti{{sfn|Mazzanti|2002}} and Marchenkov.{{sfn|Marchenkov|2007}} They further proved that the substitution basis defined by these three operations is minimal.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025}} An open question is whether <math>\{ n+m, \; \lfloor n/m \rfloor, \; 2^n \}</math> is an alternative basis.
 
'''Example 1'''


;Example 1:
Let
Let
:<math>f(a, b) = a \bmod b, \; g_1(n) = 2^{n+n}</math>, and <math>g_2(n) = 2^n + n</math>.
<math display="block">f(a, b) = a \bmod b, \quad g_1(n) = 2^{n+n}, \quad g_2(n) = 2^n + n \, .</math>
Then the function
Then the function
:<math>h(n) = f(g_1(n), g_2(n)) = 2^{n+n} \bmod (2^n + n)</math>
<math display="block">h(n) = f(g_1(n), g_2(n)) = 2^{n+n} \bmod (2^n + n)</math>
defines the square function <math>h(n) = n^2</math> by superposition alone.
defines the square function <math>h(n) = n^2</math> by superposition alone.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025|loc=Theorem 2}} This shows how functions like squaring can be expressed using only addition, integer remainder, and base-two exponentiation through superposition, '''without requiring explicit recursion'''.


This shows how functions like squaring can be expressed using only addition, exponentiation, and modulo through superposition, '''without requiring explicit recursion'''.
;Example 2:
Another example of an elementary recursive function is the [[Kronecker delta]]
<math display="block">\delta_{ij} = 2^{ (2^i \bmod (2^j + 1)) + (2^j \bmod (2^i + 1)) \bmod (2^i + 2^j) } \bmod 2 \, ,</math>
which satisfies <math>\delta_{ij} = 1</math> if <math>i = j</math> and <math>0</math> otherwise.


'''Example 2'''
;Further examples
:<math>x \mathbin{\dot{-}} y = ((2^{x+y} + x) \bmod (2^{x+y} + y)) \bmod (2^{x+y} + x)</math>.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025|loc=Theorem 3}}
:<math>x \mathbin{\dot{-}} y = ((2^{x+y} + x) \bmod (2^{x+y} + y)) \bmod (2^{x+y} + x)</math>.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025|loc=Theorem 3}}


'''Example 3'''
:<math>2xy = (x + y)^2 \mathbin{\dot{-}} (x^2 + y^2)</math>.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025|loc=In proof of Corollary 2}}
{{anchor|KroneckerDelta}}
 
The [[Kronecker delta]] <math>\delta_{ij}</math> can be expressed as
:<math>\lfloor x / y \rfloor = (2(x+1)(x\mathbin{\dot{-}}(x \bmod y ))) \bmod (2(x + 1 )y \mathbin{\dot{-}} 1)</math>.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025|loc=Theorem 4}}
<math display="block">
 
\delta_{ij} = 2^{ (2^i \bmod (2^j + 1)) + (2^j \bmod (2^i + 1)) \bmod (2^i + 2^j) } \bmod 2 \, ,
:<math>xy = \lfloor 2xy / 2 \rfloor</math>.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025|loc=Corollary 2}}
</math>
 
which satisfies <math>\delta_{ij} = 1</math> if <math>i = j</math> and <math>0</math> otherwise.
:<math>x^y = 2^{(x y + x + 1)y} \bmod ( 2^{x y + x + 1} \mathbin{\dot{-}} x )</math>.<ref>{{cite web|title=Can superposition alone generate the Kalmár elementary function x<sup>y</sup> from <x + y, x mod y, 2<sup>x</sup> >?|url=https://math.stackexchange.com/questions/5094779/can-superposition-alone-generate-the-kalm%C3%A1r-elementary-function-xy-from-x|website=StackExchange|access-date=2026-02-14}}</ref>
Since it uses only addition, integer remainder (mod), and base‑2 exponentiation, it is an explicit example of an elementary recursive function.{{sfn|Prunescu|Sauras-Altuzarra|Shunia|2025}}


== Lower elementary recursive functions ==
== Lower elementary recursive functions ==


''Lower elementary recursive'' functions follow the definitions as above, except that bounded product is disallowed. That is, a lower elementary recursive function must be a zero, successor, or projection function, a composition of other lower elementary recursive functions, or the bounded sum of another lower elementary recursive function.
''Lower elementary recursive'' functions follow the definitions as above, except that bounded product is disallowed.{{sfn|Rose|1984|p=3|loc=Definition}} That is, a lower elementary recursive function must be a zero, successor, or projection function, a composition of other lower elementary recursive functions, or the bounded sum of another lower elementary recursive function.


Lower elementary recursive functions are also known as Skolem elementary functions.{{sfn|Skolem|1962}}{{sfn|Volkov|2010}}
Lower elementary recursive functions are also known as Skolem elementary functions.{{sfn|Skolem|1962}}{{sfn|Volkov|2010}}
Line 89: Line 90:


== References ==
== References ==
 
{{refbegin|2}}
*{{cite journal
*{{cite journal
  | last = Kalmár
  | last = Kalmár
Line 172: Line 173:
  | last3 = Shunia
  | last3 = Shunia
  | first3 = Joseph M.
  | first3 = Joseph M.
  | date = 2025-08-08
  | date = 2025-11-07
  | title = A Minimal Substitution Basis for the Kalmar Elementary Functions
  | title = A Minimal Substitution Basis for the Kalmar Elementary Functions
  | eprint = 2505.23787
  | eprint = 2505.23787
Line 197: Line 198:
  | date = 1962
  | date = 1962
  | doi = 10.1305/ndjfl/1093957149
  | doi = 10.1305/ndjfl/1093957149
}}
*{{cite book
|last=Tourlakis
|first=George
|title=Computability
|year=2022
|publisher=Springer
|location=Cham, Switzerland
|isbn=978-3-030-83202-5
|url=https://link.springer.com/book/10.1007/978-3-030-83202-5
}}
}}


Line 219: Line 231:
  | class = cs.CC
  | class = cs.CC
}}
}}
{{refend}}
== Further reading ==
{{refbegin|2}}
*{{cite journal
|last=Avigad
|first=Jeremy
|title=Number theory and elementary arithmetic
|journal=[[Philosophy:Philosophia Mathematica|Philosophia Mathematica]]
|volume=11
|issue=3
|pages=257–284
|year=2003
|doi=10.1093/philmat/11.3.257  |url=https://academic.oup.com/philmat/article/11/3/257/1415080
}}
{{refend}}


== External links ==
== External links ==
{{refbegin|2}}
*{{cite web
*{{cite web
  | last= Lysikov
  | last= Lysikov
Line 230: Line 259:
  | access-date=2025-09-08
  | access-date=2025-09-08
}}
}}
{{refend}}


{{ComplexityClasses}}
{{ComplexityClasses}}

Latest revision as of 06:43, 15 April 2026

Short description: Concept in computability theory

The term elementary was originally introduced by László Kalmár in the context of computability theory.[1][2] He defined the class of elementary recursive functions ("Kalmár elementary functions") as a subset of the primitive recursive functions — specifically, those that can be computed using a limited set of operations such as composition, bounded sums, and bounded products.[3] These functions grow no faster than a fixed-height tower of exponentiation (for example, O(22n)). Not all primitive recursive functions are elementary; for example, tetration grows too rapidly to be included in the elementary class. The elementary recursive functions correspond to the class 3 of the Grzegorczyk hierarchy.[4]

In computational complexity theory, the term ELEMENTARY refers to a class of decision problems solvable in elementary time — that is, within time bounded by some fixed number of exponentials. Formally:

ELEMENTARY=kDTIME(expk(nc))
where expk(n) denotes a k-level exponential tower (e.g., 22n).

Although the name comes from the same historical origin, the ELEMENTARY complexity class deals with decision problems and Turing machine runtime, rather than total functions.

Definition

The definitions of elementary recursive functions are the same as for primitive recursive functions, except that primitive recursion is replaced by bounded summation and bounded product.[1][3][5] All functions work over the natural numbers. The basic functions, all of them elementary recursive, are:

  1. Zero function. Returns zero: f(x)=0.
  2. Successor function: f(x)=x+1. Often this is denoted by S, as in S(x). Via repeated application of a successor function, one can achieve addition.
  3. Projection functions: these are used for ignoring arguments. For example, f(a,b)=a is a projection function.
  4. Subtraction function: f(x,y)=max(xy,0). This function is used to define conditionals and iteration.

From these basic functions, we can build other elementary recursive functions.

  1. Composition: applying values from some elementary recursive function as an argument to another elementary recursive function. The function f defined as the composition f(x1,,xn)=h(g1(x1,,xn),,gm(x1,,xn)) is elementary recursive if h is elementary recursive and each gi is elementary recursive.
  2. Bounded summation: f(m,x1,,xn)=i=0mg(i,x1,,xn) is elementary recursive if g is elementary recursive.
  3. Bounded product: f(m,x1,,xn)=i=0mg(i,x1,,xn) is elementary recursive if g is elementary recursive.

Superposition bases for elementary functions

In the context of computability theory, superposition is a method of constructing new functions from existing ones by functional composition. It allows the outputs of one or more functions to serve as the inputs to another function.

More formally, suppose:

  • f(x1,,xk) is a k-ary function, and
  • g1(x1,,xn),,gk(x1,,xn) are n-ary functions.

Then the superposition of these functions yields a new n-ary function:

h(x1,,xn)=f(g1(x1,,xn),,gk(x1,,xn)).

The class of elementary recursive functions coincides with the closure under superposition of the projection functions and one of the following sets of initial functions:

  • {n+m,n˙m,n/m,2n}[6]
  • {n+m,n˙m,n/m,nm,nm}[7]
  • {n+m,nmodm,n2,2n}[8]
  • {n+m,nmodm,2n}[9]

where n˙m=max(nm,0) denotes truncated subtraction (monus).

In 2025 Mihai Prunescu, Lorenzo Sauras-Altuzarra and Joseph M. Shunia proved that the class of Kalmár elementary functions can be inductively generated from addition (n+m), integer remainder (nmodm) and base-two exponentiation (2n), improving previous results by Mazzanti[7] and Marchenkov.[8] They further proved that the substitution basis defined by these three operations is minimal.[10] An open question is whether {n+m,n/m,2n} is an alternative basis.

Example 1

Let f(a,b)=amodb,g1(n)=2n+n,g2(n)=2n+n. Then the function h(n)=f(g1(n),g2(n))=2n+nmod(2n+n) defines the square function h(n)=n2 by superposition alone.[11] This shows how functions like squaring can be expressed using only addition, integer remainder, and base-two exponentiation through superposition, without requiring explicit recursion.

Example 2

Another example of an elementary recursive function is the Kronecker delta δij=2(2imod(2j+1))+(2jmod(2i+1))mod(2i+2j)mod2, which satisfies δij=1 if i=j and 0 otherwise.

Further examples
x˙y=((2x+y+x)mod(2x+y+y))mod(2x+y+x).[12]
2xy=(x+y)2˙(x2+y2).[13]
x/y=(2(x+1)(x˙(xmody)))mod(2(x+1)y˙1).[14]
xy=2xy/2.[15]
xy=2(xy+x+1)ymod(2xy+x+1˙x).[16]

Lower elementary recursive functions

Lower elementary recursive functions follow the definitions as above, except that bounded product is disallowed.[3] That is, a lower elementary recursive function must be a zero, successor, or projection function, a composition of other lower elementary recursive functions, or the bounded sum of another lower elementary recursive function.

Lower elementary recursive functions are also known as Skolem elementary functions.[17][18]

Whereas elementary recursive functions have potentially more than exponential growth, the lower elementary recursive functions have polynomial growth.

The class of lower elementary functions has a description in terms of composition of simple functions analogous to that we have for elementary functions.[18][19] Namely, a polynomial-bounded function is lower elementary if and only if it can be expressed using a composition of the following functions: projections, n+1, nm, n˙m, nm, n/m, one exponential function (2n or nm) with the following restriction on the structure of formulas: the formula can have no more than two floors with respect to an exponent (for example, xy(z+1) has 1 floor, (x+y)yz+x+zx+1 has 2 floors, 22x has 3 floors). Here nm is a bitwise AND of n and m.

See also

Notes

References

  • Prunescu, Mihai; Sauras-Altuzarra, Lorenzo (2025-06-05). "On the representation of C-recursive integer sequences by arithmetic terms". arXiv:2405.04083 [math.LO].
  • Prunescu, Mihai; Sauras-Altuzarra, Lorenzo; Shunia, Joseph M. (2025-11-07). "A Minimal Substitution Basis for the Kalmar Elementary Functions". arXiv:2505.23787 [math.LO].
  • Volkov, S. A. (2010). "On the class of Skolem elementary functions". Journal of Applied and Industrial Mathematics 4 (4): 588–599. doi:10.1134/S1990478910040149. 
  • Volkov, Sergey (2016). "Finite Bases with Respect to the Superposition in Classes of Elementary Recursive Functions [dissertation]". arXiv:1611.04843 [cs.CC].

Further reading