Function application

From HandWiki
Short description: Concept in mathematics


In mathematics, function application is the act of applying a function to an argument from its domain so as to obtain the corresponding value from its range.[1] In this sense, function application can be thought of as the opposite of function abstraction.

Representation

Function application is usually depicted by juxtaposing the variable representing the function with its argument encompassed in parentheses. For example, the following expression represents the application of the function ƒ to its argument x.

f(x)

In some instances, a different notation is used where the parentheses aren't required, and function application can be expressed just by juxtaposition. For example, the following expression can be considered the same as the previous one:

fx

The latter notation is especially useful in combination with the currying isomorphism. Given a function f:(X×Y)Z, its application is represented as f(x,y) by the former notation and f(x,y) (or fx,y with the argument x,yX×Y written with the less common angle brackets) by the latter. However, functions in curried form f:X(YZ) can be represented by juxtaposing their arguments: fxy, rather than f(x)(y). This relies on function application being left-associative.

When mathematical notation is represented in a digital document, the invisible zero-width Unicode characters U+2061 and U+2062 can be used to distinguish concatenation meaning function application from concatenation meaning multiplication

Set theory

In axiomatic set theory, especially Zermelo–Fraenkel set theory, a function f:DR is often defined as a relation (fD×R) having the property that, for any xD there is a unique yR such that (x,y)f.

One is usually not content to write "(x,y)f" to specify that y, and usually wishes for the more common function notation "f(x)=y", thus function application, or more specifically, the notation "f(x)", is allowed by defining a binary function symbol () as:[2]

X(Y)={zif X is a function, and (Y,z)Xotherwise

Or, more formally:[3][4]

X(Y)=z(D,R(XRD((Y,z)X)))(D,R(XRD(Y,z)X)z=), where RD denotes set exponentiation: the set of all functions from D to R.

In prose: X(Y)=z if there exists a domain D and range R such that X is a function from D to R and (Y,z)X; or (the negation of former) and z=. The choice of using the empty set when X(Y) is undefined is arbitrary. However, since () is a primitive function symbol, it must be defined for any two objects (sets, in this case) it takes in the domain of discourse.[5]

If Ψ(X,Y,z) denotes the formula on the right side of the biconditional above, for any two sets, X,Y the formula Ψ associates a unique object z: X,Y!zΨ(X,Y,z). Therefore the language of set theory can use an extension by definition to include the function application operation () conservatively.

As an operator

Function application can be defined as an operator, called apply or $, by the following definition:

f$x=f(x)

The operator may also be denoted by a backtick (`).

If the operator is understood to be of low precedence and right-associative, the application operator can be used to cut down on the number of parentheses needed in an expression. For example;

f(g(h(j(x))))

can be rewritten as:

f$g$h$j$x

However, this is perhaps more clearly expressed by using function composition instead:

(fghj)(x)

or even:

(fghjx)()

if one considers x to be a constant function returning x.

Other instances

Function application in the lambda calculus is expressed by β-reduction.

The Curry–Howard correspondence relates function application to the logical rule of modus ponens.

See also

References

  1. Alama, Jesse; Korbmacher, Johannes (2023), Zalta, Edward N.; Nodelman, Uri, eds., The Lambda Calculus (Winter 2023 ed.), Metaphysics Research Lab, Stanford University, https://plato.stanford.edu/archives/win2023/entries/lambda-calculus/, retrieved 2024-02-29 
  2. Mendelson, Elliot (1987). Introduction to Mathematical Logic (3rd ed.). Belmont: Wadsworth, Inc.. pp. 185. doi:10.1007/978-1-4615-7288-6. ISBN 978-1-4615-7290-9. https://link.springer.com/book/10.1007/978-1-4615-7288-6. 
  3. Suppes, Patrick (1972). Axiomatic set theory. Internet Archive. New York, Dover Publications. pp. 87. ISBN 978-0-486-61630-8. https://archive.org/details/axiomaticsettheo00supp_0/. 
  4. Lévy, Azriel (1979). Basic set theory. Berlin; New York: Springer-Verlag. pp. 27. ISBN 978-0-387-08417-6. https://archive.org/details/basicsettheory00levy_0/mode/2up. 
  5. Lévy, Azriel (1979). Basic set theory. Berlin; New York: Springer-Verlag. pp. 15. ISBN 978-0-387-08417-6. https://archive.org/details/basicsettheory00levy_0/mode/2up.