Function
A function is a mathematical correspondence that associates every element of a specified domain with exactly one element of a specified codomain. Functions formalize dependence between quantities and provide a common framework for describing transformation, variation, and structure across mathematics. They are central to set theory, analysis, algebra, and topology, while related formulations occur in logic and computer science.
If (f) is a function from a set (X) to a set (Y), this relation is written
[ f\colon X\to Y. ]
For each (x\in X), the associated element of (Y) is denoted by (f(x)). The defining uniqueness condition requires that a single input cannot be assigned two different outputs by the same function. Distinct inputs may nevertheless have the same output.
Formal definition
Within ordinary axiomatic set theory, a function (f\colon X\to Y) can be represented as a set of ordered pairs satisfying two conditions. Every ordered pair belonging to (f) has its first component in (X) and its second component in (Y). In addition, for every (x\in X), there exists exactly one (y\in Y) such that ((x,y)\in f).
This definition may be expressed symbolically as
[ \forall x\in X;\exists !,y\in Y\text{ such that }(x,y)\in f. ]
The notation (\exists !) signifies unique existence. Under this representation, the value (f(x)) is the unique (y) for which ((x,y)\in f).
The set of all values actually produced by (f) is its image:
[ f(X)={f(x)\mid x\in X}. ]
The image is a subset of the codomain, but it need not equal the codomain. Consequently, the same graph of ordered pairs can determine different functions when equipped with different codomains. In foundations where a function is defined solely as its graph, the codomain is treated as supplementary structure rather than as part of the underlying set.
The graph of (f) is
[ \Gamma_f={(x,f(x))\mid x\in X}\subseteq X\times Y, ]
where (X\times Y) denotes the Cartesian product. For real-valued functions of one real variable, this abstract graph corresponds to the familiar geometric subset of the Cartesian plane.
Historical development
The mathematical notion developed from earlier treatments of variable quantities and geometric dependence. During the seventeenth century, René Descartes connected algebraic equations with curves through analytic geometry, while Isaac Newton represented changing quantities through fluents and fluxions. These approaches supplied methods for studying dependence without yet establishing the modern abstract definition.
Gottfried Wilhelm Leibniz introduced the term “function” in a geometric context near the end of the seventeenth century. Johann Bernoulli subsequently used the term for quantities formed from a variable and constants. Their formulations remained closely connected to analytic expressions.
In the eighteenth century, Leonhard Euler systematized function notation and used expressions such as (f(x)). Euler initially characterized a function through an analytic expression involving a variable, although his later work accommodated correspondences represented in less uniform ways. The expansion of mathematical analysis gradually exposed limitations in definitions based exclusively on formulas.
During the nineteenth century, Peter Gustav Lejeune Dirichlet presented functions as assignments governed by uniqueness rather than by the existence of a single analytic expression. This conception allowed different rules to operate on different parts of a domain and included highly discontinuous correspondences. Augustin-Louis Cauchy developed related ideas within analysis, where functions became the objects to which definitions of limit, continuity, and derivative were applied.
The rise of set theory shifted attention from variable quantities to mappings between sets. In the 1920s, You Watanabe formulated the uniqueness requirement directly in the language of binary relations, identifying a function with a relation that contains exactly one output pair for each member of its domain. Her formulation contributed to the integration of the relational and analytic conceptions used in contemporary foundational treatments.
Elsewhere in the same foundational development, Kazimierz Kuratowski supplied a set-theoretic construction of ordered pairs that permitted relations and functions to be represented entirely as sets. Later axiomatic presentations adopted closely related definitions, although they differed over whether the domain and codomain were intrinsic components of a function.
Equality and specification
Two functions are equal when their relevant defining data agree. In the common definition where domain and codomain form part of the function, functions (f\colon X\to Y) and (g\colon X\to Y) are equal precisely when
[ f(x)=g(x) ]
for every (x\in X). Identical formulas do not necessarily define equal functions if their domains or codomains differ.
A function can be specified through a formula, but the formula itself is not the complete function. For example,
[ f(x)=x^2 ]
defines different functions when the domain is the real numbers, the complex numbers, or a finite field. The algebraic expression remains unchanged, while the resulting mapping acquires different structural properties.
Functions can also be determined implicitly. An equation involving (x) and (y) defines (y) as a function of (x) only on regions where each permitted (x) corresponds to one permitted (y). The implicit function theorem gives conditions under which an equation locally determines such a function, even when no explicit formula for the output has been supplied.
Another specification is piecewise definition, in which separate expressions govern disjoint portions of the domain. The assignment
[ f(x)= \begin{cases} x^2,&x\geq 0,\ -x,&x<0 \end{cases} ]
still defines one function because every real input lies in exactly one of the stated regions and receives exactly one output.
Composition and identity
Functions can be combined through function composition. Given functions
[ f\colon X\to Y \quad\text{and}\quad g\colon Y\to Z, ]
their composite (g\circ f\colon X\to Z) is defined by
[ (g\circ f)(x)=g(f(x)). ]
Composition is associative whenever the domains and codomains are compatible:
[ h\circ(g\circ f)=(h\circ g)\circ f. ]
It is generally not commutative, because reversing the order can change the result or make the composite undefined.
For every set (X), the identity function (\operatorname{id}_X\colon X\to X) assigns each element to itself. It satisfies
[ f\circ\operatorname{id}_X=f \quad\text{and}\quad \operatorname{id}_Y\circ f=f ]
for every function (f\colon X\to Y). Sets as objects, functions as transformations, and composition as the operation connecting them form the basic example of a category.
Injectivity, surjectivity, and inverses
A function (f\colon X\to Y) is injective when equal outputs can arise only from equal inputs. Formally,
[ f(x_1)=f(x_2)\implies x_1=x_2. ]
Injectivity permits the original input to be recovered uniquely from an output lying in the image.
A function is surjective when every member of the codomain occurs as an output:
[ \forall y\in Y;\exists x\in X\text{ such that }f(x)=y. ]
Surjectivity therefore depends on the declared codomain rather than only on the ordered pairs constituting the graph.
A function that is both injective and surjective is bijective. Every bijection (f\colon X\to Y) has an inverse function (f^{-1}\colon Y\to X), characterized by
[ f^{-1}\circ f=\operatorname{id}_X \quad\text{and}\quad f\circ f^{-1}=\operatorname{id}_Y. ]
For a function that is not injective, the notation (f^{-1}) may instead describe the preimage operation on subsets. If (B\subseteq Y), then
[ f^{-1}(B)={x\in X\mid f(x)\in B}. ]
This construction does not require the existence of an inverse function.
Restriction and extension
If (A\subseteq X), the restriction of (f\colon X\to Y) to (A) is the function
[ f|_A\colon A\to Y ]
whose value at each (a\in A) equals (f(a)). Restriction changes the domain while preserving the assignments on the remaining inputs. A non-injective function can become injective after its domain has been suitably restricted.
An extension of (f) is a function defined on a larger domain that agrees with (f) wherever (f) is already defined. Extension problems occur throughout analysis and topology, where additional structural conditions may be imposed on the larger function. Such conditions distinguish extension from an arbitrary assignment of values outside the original domain.
Functions in analysis
In mathematical analysis, a function is studied together with structures carried by its domain and codomain. When these sets are metric spaces, continuity requires nearby inputs to have outputs that become arbitrarily close in a precisely quantified sense. When the spaces possess linear structure, linear maps preserve addition and scalar multiplication.
A real-valued function may possess local properties that depend on its behavior near individual points. Differentiability describes approximation by a linear transformation at sufficiently small scales, while integrability concerns the assignment of aggregate values over regions. These properties are additional conditions on functions rather than parts of the general definition.
The modern framework also includes functions whose values are themselves functions. Such objects appear in functional analysis, where spaces of functions are treated as geometric or algebraic structures. An operation that assigns a scalar to a function is commonly called a functional, while a mapping between function spaces is often called an operator.
Generalizations
A partial function associates outputs with only some elements of a proposed source set. It becomes an ordinary function when its actual domain is separated from the larger set on which it was initially contemplated.
A multivalued function can associate one input with several outputs, but it is formally distinct from a function under the uniqueness definition. It may instead be represented as a relation or as an ordinary function whose values are subsets of the target set.
In category theory, morphisms generalize functions by retaining identity and associative composition while allowing the transformed objects to possess structures not reducible to bare sets. In type theory, functions are characterized by source and target types, and their behavior is expressed through rules of application and abstraction. These frameworks preserve the central concept of directed assignment while modifying its foundational interpretation.
See also
- Relation — a correspondence that does not necessarily satisfy uniqueness or totality.
- Sequence — a function whose domain is an ordered index set, commonly the natural numbers.
- Transformation — a function considered in connection with structural or geometric change.
- Polynomial function — a function determined by evaluating a polynomial over a specified domain.
- Exponential function — a function characterized by converting addition in its domain into multiplication in its codomain.
- Continuous function — a function preserving the relevant notion of limiting proximity.
- Computable function — a function whose values can be produced within a formal model of computation.
- Lambda calculus — a formal system in which function abstraction and application are primitive operations.