Lably
Skip to content

Function (mathematics)

Association of one output to each input

  • 37 min read
  • 11 chapters
  • 6 labs on Lably

Learn it on Lably

Functions were originally the idealization of how a varying quantity depends on another quantity. For example, the position of a planet is a function of time. Historically, the concept was elaborated with the infinitesimal calculus at the end of the 17th century, and, until the 19th century, the functions that were considered were differentiable (that is, they had a high degree of regularity). The concept of a function was formalized at the end of the 19th century in terms of set theory, and this greatly increased the possible applications of the concept.

A function is often denoted by a letter such as f, g or h. The value of a function f at an element x of its domain (that is, the element of the codomain that is associated with x) is denoted by f(x); for example, the value of f at x = 4 is denoted by f(4). Commonly, a specific function is defined by means of an expression depending on x, such as f(x)=x2+1; in this case, some computation, called function evaluation, may be needed for deducing the value of the function at a particular value; for example, if f(x)=x2+1, then f(4)=42+1=17.

Given its domain and its codomain, a function is uniquely represented by the set of all pairs (x, f (x)), called the graph of the function, a popular means of illustrating the function. When the domain and the codomain are sets of real numbers, each such pair may be thought of as the Cartesian coordinates of a point in the plane.

Functions are widely used in science, engineering, and in most fields of mathematics. It has been said that functions are "the central objects of investigation" in most fields of mathematics.

The concept of a function has evolved significantly over centuries, from its informal origins in ancient mathematics to its formalization in the 19th century. See History of the function concept for details.

Definition

A function f from a set X to a set Y is an assignment of one element of Y to each element of X. The set X is called the domain of the function and the set Y is called the codomain of the function.

If the element y in Y is assigned to x in X by the function f, one says that f maps x to y, and this is commonly written y=f(x). In this notation, x is the argument or variable of the function.

A specific element x of X is a value of the variable, and the corresponding element of Y is the value of the function at x, or the image of x under the function. The image of a function, sometimes called its range, is the set of the images of all elements in the domain.

A function f, its domain X, and its codomain Y are often specified by the notation f:X→Y. One may write x↦y instead of y=f(x), where the symbol ↦ (read 'maps to') is used to specify where a particular element x in the domain is mapped to by f. This allows the definition of a function without naming. For example, the square function is the function x↦x2.

The domain and codomain are not always explicitly given when a function is defined. In particular, it is common that one might only know, without some (possibly difficult) computation, that the domain of a specific function is contained in a larger set. For example, if f:R→R is a real function, the determination of the domain of the function x↦1/f(x) requires knowing the zeros of f. This is one of the reasons for which, in mathematical analysis, "a function from X to Y " may refer to a function having a proper subset of X as a domain. For example, a "function from the reals to the reals" may refer to a real-valued function of a real variable whose domain is a proper subset of the real numbers, typically a subset that contains a non-empty open interval. Such a function is then called a partial function.

A function f on a set S means a function from the domain S, without specifying a codomain. However, some authors use it as shorthand for saying that the function is f: S → S.

Formal definition

The above definition of a function is essentially that of the founders of calculus, Leibniz, Newton and Euler. However, it cannot be formalized, since there is no mathematical definition of an "assignment". It is only at the end of the 19th century that the first formal definition of a function could be provided, in terms of set theory. This set-theoretic definition is based on the fact that a function establishes a relation between the elements of the domain and some (possibly all) elements of the codomain. Mathematically, a binary relation between two sets X and Y is a subset of the set of all ordered pairs (x,y) such that x∈X and y∈Y. The set of all these pairs is called the Cartesian product of X and Y and denoted X×Y. Thus, the above definition may be formalized as follows.

A function with domain X and codomain Y is a binary relation R between X and Y that satisfies the two following conditions:

  • For every x in X there exists y in Y such that (x,y)∈R.
  • If (x,y)∈R and (x,z)∈R, then y=z.

This definition may be rewritten more formally, without referring explicitly to the concept of a relation, but using more notation (including set-builder notation):

A function is formed by three sets (often as an ordered triple), the domain X, the codomain Y, and the graph R that satisfy the three following conditions.

  • R⊆{(x,y)∣x∈X,y∈Y}
  • ∀x∈X,∃y∈Y,(x,y)∈R
  • (x,y)∈R∧(x,z)∈R⟹y=z

A relation satisfying these conditions is called a functional relation.

The more usual terminology and notation can be derived from this formal definition as follows. Let ⁠f⁠ be a function defined by a functional relation ⁠R⁠. For every ⁠x⁠ in the domain of ⁠f⁠, the unique element of the codomain that is related to ⁠x⁠ is denoted ⁠f(x)⁠. If ⁠y⁠ is this element, one writes commonly ⁠y=f(x)⁠ instead of ⁠(x,y)∈R⁠ or ⁠xRy⁠, and one says that "⁠f⁠ maps ⁠x⁠ to ⁠y⁠", "⁠y⁠ is the image by ⁠f⁠ of ⁠x⁠", or "the application of ⁠f⁠ on ⁠x⁠ gives ⁠y⁠", etc.

Partial functions

Partial functions are defined similarly to ordinary functions, with the "total" condition removed. That is, a partial function from X to Y is a binary relation R between X and Y such that, for every x∈X, there is at most one y in Y such that (x,y)∈R.

Using functional notation, this means that, given x∈X, either f(x) is in Y, or it is undefined.

The set of the elements of X such that f(x) is defined and belongs to Y is called the domain of definition of the function. A partial function from X to Y is thus an ordinary function that has as its domain a subset of X called the domain of definition of the function. If the domain of definition equals X, one often says that the partial function is a total function.

In several areas of mathematics, the term "function" refers to partial functions rather than to ordinary (total) functions. This is typically the case when functions may be specified in a way that makes difficult or even impossible to determine their domain.

In calculus, a real-valued function of a real variable or real function is a partial function from the set R of the real numbers to itself. Given a real function f:x↦f(x) its multiplicative inverse x↦1/f(x) is also a real function. The determination of the domain of definition of a multiplicative inverse of a (partial) function amounts to compute the zeros of the function, the values where the function is defined but not its multiplicative inverse.

Similarly, a function of a complex variable is generally a partial function whose domain of definition is a subset of the complex numbers C. The difficulty of determining the domain of definition of a complex function is illustrated by the multiplicative inverse of the Riemann zeta function: the determination of the domain of definition of the function z↦1/ζ(z) is more or less equivalent to the proof or disproof of one of the major open problems in mathematics, the Riemann hypothesis.

In computability theory, a general recursive function is a partial function from the integers to the integers whose values can be computed by an algorithm (roughly speaking). The domain of definition of such a function is the set of inputs for which the algorithm does not run forever. A fundamental theorem of computability theory is that there cannot exist an algorithm that takes an arbitrary general recursive function as input and tests whether 0 belongs to its domain of definition (see Halting problem).

Multivariate functions

A multivariate function, multivariable function, or function of several variables is a function that depends on several arguments. Such functions are commonly encountered. For example, the position of a car on a road is a function of the time travelled and its average speed.

Formally, a function of n variables is a function whose domain is a set of n-tuples. For example, multiplication of integers is a function of two variables, or bivariate function, whose domain is the set of all ordered pairs (2-tuples) of integers, and whose codomain is the set of integers. The same is true for every binary operation. The graph of a bivariate surface over a two-dimensional real domain may be interpreted as defining a parametric surface, as used in, e.g., bivariate interpolation.

Commonly, an n-tuple is denoted enclosed in parentheses, such as in (1,2,…,n). When using functional notation, one usually omits the parentheses surrounding tuples, writing f(x1,…,xn) instead of f((x1,…,xn)).

Given n sets X1,…,Xn, the set of all n-tuples (x1,…,xn) such that x1∈X1,…,xn∈Xn is called the Cartesian product of X1,…,Xn, and denoted X1×⋯×Xn.

Therefore, a multivariate function is a function that has a Cartesian product or a proper subset of a Cartesian product as a domain.

f:U→Y,

where the domain U has the form

U⊆X1×⋯×Xn.

If all the Xi are equal to the set R of the real numbers or to the set C of the complex numbers, one talks respectively of a function of several real variables or of a function of several complex variables.

Sign in to keep reading

10 more chapters are free with a Lably account.

More in General