Article · Wikipedia archive · Last revised Jun 16, 2026

Smn theorem

In computability theory the S mn  theorem, written also as "smn-theorem" or "s-m-n theorem" is a basic result about programming languages. It was first proved by Stephen Cole Kleene (1943). The name comes from the occurrence of an with subscript and superscript in the original formulation of the theorem.

Last revised
Jun 16, 2026
Read time
≈ 4 min
Length
864 w
Citations
Source

In computability theory the S m
n
 
theorem
, written also as "smn-theorem" or "s-m-n theorem" (also called the translation lemma, parameter theorem, and the parameterization theorem) is a basic result about programming languages (and, more generally, Gödel numberings of the partial computable functions) (Soare 1987, Rogers 1967). It was first proved by Stephen Cole Kleene (1943). The name S m n {\displaystyle S_{m}^{n}} comes from the occurrence of an S {\displaystyle S} with subscript n {\displaystyle n} and superscript m {\displaystyle m} in the original formulation of the theorem (see below).

In practical terms, the theorem says that for a given programming language and positive integers m {\displaystyle m} and n {\displaystyle n} , there exists a particular algorithm that accepts as input the source code of a program with m + n {\displaystyle m+n} free variables, together with m {\displaystyle m} values. This algorithm generates source code that in essence substitutes the values for the first m {\displaystyle m} free variables, leaving the rest of the variables free.

Details

The basic form of the theorem applies to functions of two arguments (Nies 2009, p. 6). Given a Gödel numbering φ {\displaystyle \varphi } of partial computable functions, there is a primitive recursive function s {\displaystyle s} of two arguments with the following property: for every Gödel number e {\displaystyle e} of a partial computable function f {\displaystyle f} with two arguments, the expressions φ s ( e , x ) ( y ) {\displaystyle \varphi _{s(e,x)}(y)} and f ( x , y ) {\displaystyle f(x,y)} are defined for the same combinations of natural numbers x {\displaystyle x} and y {\displaystyle y} , and their values are equal for any such combination. In other words, the following extensional equality of functions holds for every x {\displaystyle x} :

φ s ( e , x ) λ y . φ e ( x , y ) . {\displaystyle \varphi _{s(e,x)}\simeq \lambda y.\varphi _{e}(x,y).}

More generally, for any m , n > 0 {\displaystyle m,n>0} , there exists a primitive recursive function S n m {\displaystyle S_{n}^{m}} of m + 1 {\displaystyle m+1} arguments that behaves as follows: for every Gödel number e {\displaystyle e} of a partial computable function with m + n {\displaystyle m+n} arguments, and all values of x 1 , x 2 , . . . , x m {\displaystyle x_{1},x_{2},...,x_{m}} :

φ S n m ( e , x 1 , , x m ) λ y 1 , , y n . φ e ( x 1 , , x m , y 1 , , y n ) . {\displaystyle \varphi _{S_{n}^{m}(e,x_{1},\dots ,x_{m})}\simeq \lambda y_{1},\dots ,y_{n}.\varphi _{e}(x_{1},\dots ,x_{m},y_{1},\dots ,y_{n}).}

The function s {\displaystyle s} described above can be taken to be S 1 1 {\displaystyle S_{1}^{1}} .

Formal statement

Given arities m {\displaystyle m} and n {\displaystyle 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 {\displaystyle n} , such that

z 1 , , z n : TM x ( y 1 , , y m , z 1 , , z n ) = TM k ( z 1 , , z n ) . {\displaystyle \forall z_{1},\dots ,z_{n}:{\text{TM}}_{x}(y_{1},\dots ,y_{m},z_{1},\dots ,z_{n})={\text{TM}}_{k}(z_{1},\dots ,z_{n}).}

Furthermore, there is a Turing machine S {\displaystyle S} that allows k {\displaystyle k} to be calculated from x {\displaystyle x} and y {\displaystyle 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 {\displaystyle S} finds the Turing Machine TM k {\displaystyle {\text{TM}}_{k}} that is the result of hardcoding the values of y {\displaystyle y} into TM x {\displaystyle {\text{TM}}_{x}} . The result generalizes to any Turing-complete computing model.

Example

The following Lisp code implements s11 for Lisp.

(defun s11 (f x)
  (let ((y (gensym)))
    (list 'lambda (list y) (list f x y))))

For example, (s11 '(lambda (x y) (+ x y)) 3) evaluates to (lambda (g42) ((lambda (x y) (+ x y)) 3 g42)), where g42 is a "fresh" symbol.

See also

See also

References

References

External links