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(x_1, \dots, x_k) is a k-ary function, and :* g_1(x_1, \dots, x_n), \dots, g_k(x_1, \dots, x_n) are n-ary functions. Then the superposition of these functions yields a new n-ary function: :h(x_1, \dots, x_n) = f(g_1(x_1, \dots, x_n), \dots, g_k(x_1, \dots, x_n)). 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 \mathbin{\dot{-}} m,\; \lfloor n/m \rfloor,\; 2^n \} :* \{ n+m,\; n \mathbin{\dot{-}} m, \; \lfloor n/m \rfloor, \; nm, \; n^m \} :* \{ n + m,\; n \bmod m,\; n^2,\; 2^n \} :* \{ n + m,\; n \bmod m,\; 2^n \}{{refn|n^2 = 2^{n+n} \bmod (2^n + n) }} where n \mathbin{\dot{-}} m = \max (n - m, 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 (n \bmod m) and
base-two exponentiation (2^n), improving previous results by Mazzanti and Marchenkov. They further proved that the substitution basis defined by these three operations is minimal. An open question is whether \{ n+m, \; \lfloor n/m \rfloor, \; 2^n \} is an alternative basis. ;Example 1: Let f(a, b) = a \bmod b, \quad g_1(n) = 2^{n+n}, \quad g_2(n) = 2^n + n \, . Then the function h(n) = f(g_1(n), g_2(n)) = 2^{n+n} \bmod (2^n + n) defines the square function h(n) = n^2 by superposition alone. 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 \delta_{ij} = 2^{ (2^i \bmod (2^j + 1)) + (2^j \bmod (2^i + 1)) \bmod (2^i + 2^j) } \bmod 2 \, , which satisfies \delta_{ij} = 1 if i = j and 0 otherwise. ;Further examples :x \mathbin{\dot{-}} y = ((2^{x+y} + x) \bmod (2^{x+y} + y)) \bmod (2^{x+y} + x). :2xy = (x + y)^2 \mathbin{\dot{-}} (x^2 + y^2). :\lfloor x / y \rfloor = (2(x+1)(x\mathbin{\dot{-}}(x \bmod y ))) \bmod (2(x + 1 )y \mathbin{\dot{-}} 1). :xy = \lfloor 2xy / 2 \rfloor. :x^y = 2^{(x y + x + 1)y} \bmod ( 2^{x y + x + 1} \mathbin{\dot{-}} x ). == Lower elementary recursive functions ==