Partial composition is possible for
multivariate functions. The function resulting when some argument of the function is replaced by the function is called a composition of and in some computer engineering contexts, and is denoted f|_{x_i = g} = f (x_1, \ldots, x_{i-1}, g(x_1, x_2, \ldots, x_n), x_{i+1}, \ldots, x_n). When is a simple constant , composition degenerates into a (partial) valuation, whose result is also known as
restriction or
co-factor. f|_{x_i = b} = f (x_1, \ldots, x_{i-1}, b, x_{i+1}, \ldots, x_n). In general, the composition of multivariate functions may involve several other functions as arguments, as in the definition of
primitive recursive function. Given , a -ary function, and -ary functions , the composition of with , is the -ary function h(x_1,\ldots,x_m) = f(g_1(x_1,\ldots,x_m),\ldots,g_n(x_1,\ldots,x_m)). This is sometimes called the
generalized composite or
superposition of
f with . The partial composition in only one argument mentioned previously can be instantiated from this more general scheme by setting all argument functions except one to be suitably chosen
projection functions. Here can be seen as a single vector/
tuple-valued function in this generalized scheme, in which case this is precisely the standard definition of function composition. A set of finitary
operations on some base set
X is called a
clone if it contains all projections and is closed under generalized composition. A clone generally contains operations of various
arities. The notion of commutation also finds an interesting generalization in the multivariate case; a function
f of arity
n is said to commute with a function
g of arity
m if
f is a
homomorphism preserving
g, and vice versa, that is: f(g(a_{11},\ldots,a_{1m}),\ldots,g(a_{n1},\ldots,a_{nm})) = g(f(a_{11},\ldots,a_{n1}),\ldots,f(a_{1m},\ldots,a_{nm})). A unary operation always commutes with itself, but this is not necessarily the case for a binary (or higher arity) operation. A binary (or higher arity) operation that commutes with itself is called
medial or entropic. ==Generalizations==