# Function application

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. 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:
    $f\;x$
The latter notation is especially useful in combination with the currying isomorphism. Given a function $f:(X\times Y)\to Z$, its application is represented as $f(x,y)$ by the former notation and $f\;(x,y)$ (or $f\;\langle x,y\rangle$ with the argument $\langle x,y\rangle \in X\times Y$ written with the less common angle brackets) by the latter. However, functions in curried form $f:X\to (Y\to Z)$ can be represented by juxtaposing their arguments: $f\;x\;y$, rather than $f(x)(y)$. This relies on function application being left-associative.
U+2061 FUNCTION APPLICATION (&af;, &ApplyFunction;) — a contiguity operator indicating application of a function; that is an invisible zero width character intended to distinguish concatenation meaning function application from concatenation meaning multiplication.

## Set theory

In axiomatic set theory, especially Zermelo–Fraenkel set theory, a function $f:X\mapsto Y$ is often defined as a relation ($f\subseteq X\times Y$) having the property that, for any $x\in X$ there is a unique $y\in Y$ such that $(x,y)\in f$.
One is usually not content to write "$(x,y)\in 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 defined by an axiom schema. Given any function $f$ with a given domain $X$ and codomain $Y$:
$\forall x\in X,\forall y\in Y(f(x)=y\iff$$\exists !z\in Y((x,z)\in f)\,\land \,(x,y)\in f)$
Stating "For all $x$ in $X$ and $y$ in $Y$, $f(x)$ is equal to $y$ if and only if there is a unique $z$ in $Y$ such that $(x,z)$ is in $f$ and $(x,y)$ is in $f$". The notation $f(x)$ here being defined is a new functional predicate from the underlying logic, where each y is a term in x. Since $f$, as a functional predicate, must map every object in the language, objects not in the specified domain are chosen to map to an arbitrary object, suct as the empty set.

## As an operator

Function application can be trivially defined as an operator, called apply or $\$$, by the following definition:
    $f\mathop {\,\$\,} 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\mathop {\,\$\,} g\mathop {\,\$\,} h\mathop {\,\$\,} j\mathop {\,\$\,} x$
However, this is perhaps more clearly expressed by using function composition instead:
    $(f\circ g\circ h\circ j)(x)$
or even:
    $(f\circ g\circ h\circ j\circ x)$
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.