In mathematics, a function[note 1] is a binary relation between two sets that associates every element of the first set to exactly one element of the second set. Typical examples are functions from integers to integers, or from the real numbers to real numbers.
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 enlarged the domains of application of the concept.
A function is a process or a relation that associates each element x of a set X, the domain of the function, to a single element y of another set Y (possibly the same set), the codomain of the function. It is customarily denoted by letters such as ,
and
.[1]
If the function is called f, this relation is denoted by y = f (x) (which reads "f of x"), where the element x is the argument or input of the function, and y is the value of the function, the output, or the image of x by f.[2] The symbol that is used for representing the input is the variable of the function (e.g., f is a function of the variable x).[3]
A function is uniquely represented by the set of all pairs (x, f (x)), called the graph of the function.[note 2][4] 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. The set of these points is called the graph of the function; it is a popular means of illustrating the function.
Functions are widely used in science, and in most fields of mathematics. It has been said that functions are "the central objects of investigation" in most fields of mathematics.[5]
A function is a process or a relation that associates each element x of a set X, the domain of the function, to a single element y of another set Y (possibly the same set), the codomain of the function. It is customarily denoted by letters such as ,
and
.[1]
If the function is called f, this relation is denoted by y = f (x) (which reads "f of x"), where the element x is the argument or input of the function, and y is the value of the function, the output, or the image of x by f.[2] The symbol that is used for representing the input is the variable of the function (e.g., f is a function of the variable x).[3]
A function is uniquely represented by the set of all pairs (x, f (x)), called the graph of the function.[note 2][4] 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. The set of these points is called the graph of the function; it is a popular means of illustrating the function.
Functions are widely used in science, and in most fields of mathematics. It has been said that functions are "the central objects of investigation" in most fields of mathematics.[5]
Intuitively, a function is a process that associates each element of a set X, to a single element of a set Y.
Formally, a function f from a set X to a set Y is defined by a set G of ordered pairs (x, y) such that x ∈ X, y ∈ Y, and every element of X is the first component of exactly one ordered pair in G.[6][note 3] In other words, for every x in X, there is exactly one element y such that the ordered pair (x, y) belongs to the set of pairs defining the function f. The set G is called the graph of the function. Formally speaking, it may be identified with the function, but this hides the usual interpretation of a function as a process. Therefore, in common usage, the function is generally distinguished from its graph.
Functions are also called maps or mappings, though some authors make some distinction between "maps" and "functions" (see section #Map).
In the definition of function, X and Y are respectively called the domain and the codomain of the function f.[7] If (x, y) belongs to the set defining f, then y is the image of x under f, or the value of f applied to the argument x. In the context of numbers in particular, one also says that y is the value of f for the value x of its variable, or, more concisely, that y is the value of f of x, denoted as y = f(x).
Two functions f and g are equal, if their domain and codomain sets are the same and their output values agree on the whole domain. More formally, f = g if f(x) = g(x) for all x ∈ X, where f:X → Y and g:X → Y.[8][9][note 4]
The domain and codomain are not always explicitly given when a function is defined, and, without some (possibly difficult) computation, one might only know that the domain is contained in a larger set. Typically, this occurs in mathematical analysis, where "a function from X to Y " often refers to a function that may have a proper subset[note 5] of X as domain. For example, a "function from the reals to the reals" may refer to a real-valued function of a real variable, and this phrase does not mean that the domain of the function is the whole set of the real numbers, but only that the domain is a set of real numbers that contains a non-empty open interval; such a function is then called a partial function. For example, if f is a function that has the real numbers as domain and codomain, then a function mapping the value x to the value is a function g from the reals to the reals, whose domain is the set of the reals x, such that f(x) ≠ 0.
The range of a function is the set of the images of all elements in the domain. However, range is sometimes used as a synonym of codomain, generally in old textbooks.[citation needed]
Any subset of the Cartesian product of two sets and
defines a binary relation
between these two sets. It is immediate that an arbitrary relation may contain pairs that violate the necessary conditions for a function given above.
A binary relation is functional (also called right-unique) if
A binary relation is serial (also called left-total) if
A binary relation is serial (also called left-total) if
A partial function is a binary relation that is functional.
A function is a binary relation that is functional and serial.
Various properties of functions and function composition may be reformulated in the language of relations. For example, a function is injective if the converse relation
A function is a binary relation that is functional and serial.
Various properties of functions and function composition may be reformulated in the language of relations. For example, a function is injective if the converse relation A function is a binary relation that is functional and serial.
Various properties of functions and function composition may be reformulated in the language of relations. For example, a function is injective if the converse relation is functional, where the converse relation is defined as
[10]
The set of all functions from some given domain to a codomain is sometimes identified with the Cartesian product of copies of the codomain, indexed by the domain. Namely, given sets and
any function
is an element of the Cartesian product of copies of
s over the index set
Viewing as tuple with coordinates, then for each
, the
th coordinate of this tuple is the value
This reflects the intuition that for each
the function picks some element
namely,
(This point of view is used for example in the discussion of a choice function.)
Infinite Cartesian products are often simply "defined" as sets of functions.[11]
There are various standard ways for denoting functions. The most commonly used notation is functional notation, which defines the function using an equation that gives the names of the function and the argument explicitly. This gives rise to a subtle point which is often glossed over in elementary treatments of functions: functions are distinct from their values. Thus, a function f should be distinguished from its value f(x0) at the value x0 in its domain. To some extent, even working mathematicians will conflate the two in informal set
Infinite Cartesian products are often simply "defined" as sets of functions.[11]
There are various standard ways for denoting functions. The most commonly used notation is functional notation, which defines the function using an equation that gives the names of the function and the argument explicitly. This gives rise to a subtle point which is often glossed over in elementary treatments of functions: functions are distinct from their values. Thus, a function f should be distinguished from its value f(x0) at the value x0 in its domain. To some extent, even working mathematicians will conflate the two in informal settings for convenience, and to avoid appearing pedantic. However, strictly speaking, it is an abuse of notation to write "let be the function f(x) = x2 ", since f(x) and x2 should both be understood as the value of f at x, rather than the function itself. Instead, it is correct, though long-winded, to write "let
be the function defined by the equation f(x) = x2, valid for all real values of x ". A compact phrasing is "let
with f(x) = x2," where the redundant "be the function" is omitted and, by convention, "for all
in the domain of
" is understood.
This distinction in language and notation can become important, in cases where functions themselves serve as inputs for other functions. (A function taking another function as an input is termed a functional.) Other approac
This distinction in language and notation can become important, in cases where functions themselves serve as inputs for other functions. (A function taking another function as an input is termed a functional.) Other approaches of notating functions, detailed below, avoid this problem but are less commonly used.
As first used by Leonhard Euler in 1734,[12] functions are denoted by a symbol consisting generally of a single letter in italic font, most often the lower-case letters f, g, h.[1] Some widely-used functions are represented by a symbol consisting of several letters (usually two or three, generally an abbreviation of their name). In which case, a roman type is customarily used instead, such as "sin" for the sine function, in contrast to italic font for single-letter symbols.
The notation (read: "y equals f of x")
means that the pair (x, y) belongs to the set of pairs defining the function f. If X is the domain of f, the set of pairs defining the function is thus, using set-builder notation,
Often, a definition of the function is given by what f does to the explicit argument x. For example, a function f can be defined by the equation
for
for all real numbers x. In this example, f can be thought of as the composite of several simpler functions: squaring, adding 1, and taking the sine. However, only the sine function has a common explicit symbol (sin), while the combination of squaring and then adding 1 is described by the polynomial expression . In order to explicitly reference functions such as squaring or adding 1 without introducing new function names (e.g., by defining function g and h by
and
), one of the methods below (arrow notation or dot notation) could be used.
When the symbol denoting the function consists of several characters and no ambiguity may arise, the parentheses of functional notation might be omitted. For example, it is common to write instead of
instead of
For explicitly expressing domain X and the codomain Y of a function f, the arrow notation is often used (read: "the function f from X to Y" or "the function f mapping elements of X to elements of Y"):
or
For example, if a multiplication is defined on a set X, then the square function on X is unambiguously defined by (read: "the function
from X to X that maps x to x ⋅ x")
the latter line being more commonly written
Often, the expression giving the function symbol, domain and codomain is omitted. Thus, the arrow notation is useful for avoiding introducing a symbol for a function that is defined, as it is often the case, by a formula expressing the value of the function in terms of its argument. As a common application of the arrow notation, suppose Often, the expression giving the function symbol, domain and codomain is omitted. Thus, the arrow notation is useful for avoiding introducing a symbol for a function that is defined, as it is often the case, by a formula expressing the value of the function in terms of its argument. As a common application of the arrow notation, suppose Index notation is often used instead of functional notation. That is, instead of writing f (x), one writes This is typically the case for functions whose domain is the set of the natural numbers. Such a function is called a sequence, and, in this case the element natural numbers. Such a function is called a sequence, and, in this case the element The index notation is also often used for distinguishing some variables called parameters from the "true variables". In fact, parameters are specific variables that are considered as being fixed during the study of a problem. For example, the map In the notation
For example, For example, There are other, specialized notations for functions in sub-disciplines of mathematics. For example, in linear algebra and functional analysis, linear forms and the vectors they act upon are denoted using a dual pair to show the underlying duality. This is similar to the use of bra–ket notation in quantum mechanics. In logic and the theory of computation, the function notation of lambda calculus is used to explicitly express the basic notions of function abstraction and application. In category theory and homological algebra, networks of functions are described in terms of how they and their compositions commute with each other using commutative diagrams that extend and generalize the arrow notation for functions described above.
is a two-argument function, and we want to refer to a partially applied function
produced by fixing the second argument to the value t0 without introducing a new function name. The map in question could be denoted
using the arrow notation for elements. The expression
(read: "the map taking x to
") represents this new function with just one argument, whereas the expression
refers to the value of the function f at the point
.
Index notation
is called the nth element of sequence.
(see above) would be denoted
using index notation, if we define the collection of maps
by the formula
for all
.
the symbol x does not represent any value, it is simply a placeholder meaning that, if x is replaced by any value on the left of the arrow, it should be replaced by the same value on the right of the arrow. Therefore, x may be replaced by any symbol, often an interpunct " ⋅ ". This may be useful for distinguishing the function f (⋅) from its value f (x) at x.
may stand for the function
, and
may stand for a function defined by an integral with variable upper bound:
.
Other terms