The basic form of the theorem applies to functions of two arguments (Nies 2009, p. 6). Given a Gödel numbering φ {\displaystyle \varphi } of recursive functions, there is a primitive recursive function s of two arguments with the following property: for every Gödel number p of a partial computable function f with two arguments, the expressions φ s ( p , x ) ( y ) {\displaystyle \varphi _{s(p,x)}(y)} and f ( x , y ) {\displaystyle f(x,y)} are defined for the same combinations of natural numbers x and y, and their values are equal for any such combination. In other words, the following extensional equality of functions holds for every x:
More generally, for any m, n > 0, there exists a primitive recursive function S n m {\displaystyle S_{n}^{m}} of m + 1 arguments that behaves as follows: for every Gödel number p of a partial computable function with m + n arguments, and all values of x1, …, xm:
The function s described above can be taken to be S 1 1 {\displaystyle S_{1}^{1}} .
Given arities m and n, for every Turing Machine TM x {\displaystyle {\text{TM}}_{x}} of arity m + n {\displaystyle m+n} and for all possible values of inputs y 1 , … , y m {\displaystyle y_{1},\dots ,y_{m}} , there exists a Turing machine TM k {\displaystyle {\text{TM}}_{k}} of arity n, such that
Furthermore, there is a Turing machine S that allows k to be calculated from x and y; it is denoted k = S n m ( x , y 1 , … , y m ) {\displaystyle k=S_{n}^{m}(x,y_{1},\dots ,y_{m})} .
Informally, S finds the Turing Machine TM k {\displaystyle {\text{TM}}_{k}} that is the result of hardcoding the values of y into TM x {\displaystyle {\text{TM}}_{x}} . The result generalizes to any Turing-complete computing model.
This can also be extended to total computable functions as follows:
Given a total computable function s m , n : N m + 1 → N {\displaystyle s_{m,n}:\mathbb {N} ^{m+1}\rightarrow \mathbb {N} } and m , n ≥ 1 {\displaystyle m,n\geq 1} such that ∀ x → ∈ N m , ∀ y → ∈ N n {\displaystyle \forall {\vec {x}}\in \mathbb {N} ^{m},\forall {\vec {y}}\in \mathbb {N} ^{n}} , ∀ e ∈ N {\displaystyle \forall e\in \mathbb {N} } :
ϕ e m + n ( x → , y → ) = ϕ s m , n ( e , x → ) n ( y → ) {\displaystyle \phi _{e}^{m+n}({\vec {x}},{\vec {y}})=\phi _{s_{m,n}{(e,{\vec {x}})}}^{n}({\vec {y}})}
There is also a simplified version of the same theorem (defined infact as "simplified smn-theorem", which basically uses a total computable function as index as follows:
Let f : N n + m → N {\displaystyle f:\mathbb {N} ^{n+m}\rightarrow \mathbb {N} } be a computable function. There, there is a total computable function s : N m → N {\displaystyle s:\mathbb {N} ^{m}\rightarrow \mathbb {N} } such that ∀ x ∈ N m {\displaystyle \forall x\in \mathbb {N} ^{m}} , y → ∈ N n {\displaystyle {\vec {y}}\in \mathbb {N} ^{n}} :
f ( x → , y → ) = ϕ S ( x → ) ( n ) ( y → ) {\displaystyle f({\vec {x}},{\vec {y}})=\phi _{S({\vec {x}})}^{(n)}({\vec {y}})}
The following Lisp code implements s11 for Lisp.
For example, (s11 '(lambda (x y) (+ x y)) 3) evaluates to (lambda (g42) ((lambda (x y) (+ x y)) 3 g42)).