Function composition
Multivariate functions

Partial composition is possible for multivariate functions. The function resulting when some argument x of the function f is replaced by the function g is called a composition of f and g in some computer engineering contexts, and is denoted f | f | x i = g = f (x 1, …, x i − 1, g (x 1, x 2, …, x n), x i + 1, …, x n). {\displaystyle 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 g is a simple constant b, composition degenerates into a (partial) valuation, whose result is also known as restriction or co-factor.

f | x i = b = f (x 1, …, x i − 1, b, x i + 1, …, x n). {\displaystyle 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 f, a n -ary function, and n m -ary functions g,..., g, the composition of f with g,..., g, is the m -ary function h (x 1, …, x m) = f (g 1 (x 1, …, x m), …, g n (x 1, …, x m)). {\displaystyle 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 g,..., g. 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 g,..., g 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 i.e.: f (g (a 11, …, a 1 m), …, g (a n 1, …, a n m)) = g (f (a 11, …, a n 1), …, f (a 1 m, …, a n m)). {\displaystyle 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.
keywords:existence, length_constraints:number_words[96]