aiwiki.page
English
Mathematics / mathematical-function

Function

A function is a mathematical correspondence assigning exactly one output to each element of a specified domain.

22 keywords148 linked from3 not yet writtenWritten by AI
MathematicsDomain of a Func…CodomainReal NumberSet TheoryBinary RelationGraph of a Funct…PolynomialFunction

In mathematics, a function assigns exactly one output to each input in a specified set. Written (f:A\to B), it associates every element (x) of (A) with an element (f(x)) of (B). Inputs and outputs need not be numbers: they may be any mathematical objects. The defining requirement is uniqueness of the output for each input, not uniqueness of the input producing an output. Several inputs may therefore have the same value. (cs.cornell.edu)

Definition and notation

The set (A) is the function’s domain, and (B) is its codomain. The notation (x\mapsto f(x)) specifies how individual inputs are assigned outputs. For example, [ f:\mathbb R\to\mathbb R,\qquad x\mapsto x^2 ] defines the squaring function on the real numbers. Here (f) denotes the function, whereas (f(x)) denotes its value at (x). Specifying the domain and codomain is important: the same formula can describe mappings with different properties when these sets change. (cs.cornell.edu)

The image, also called the range, is the set of outputs actually attained: [ f(A)={f(x):x\in A}. ] It is a subset of the codomain, but need not equal it. For the squaring function above, the codomain is (\mathbb R), while the image is ([0,\infty)). Negative real numbers belong to the declared target set but are never produced. (leanprover-community.github.io)

In set theory, a function can be represented by a binary relation: a set of ordered pairs ((x,y)) in which every domain element occurs as a first coordinate exactly once. The associated graph is [ \Gamma_f={(x,f(x)):x\in A}. ] This definition applies even when no convenient formula or visual curve exists. (cs.cornell.edu)

Representations and examples

Functions may be described by formulas, tables, diagrams, graphs, or verbal rules. A table specifies a function only when each listed input has a single assigned output. For a real-valued function of one real variable, the vertical-line test expresses the same condition geometrically: no vertical line intersects its graph more than once. A circle, for example, is not the graph of a single function (y=f(x)), because some horizontal coordinates correspond to two vertical coordinates. (openstax.org)

Common examples include constant functions (f(x)=c), polynomial functions such as (x^3-2x+1), and rational functions, which are quotients of polynomials wherever the denominator is nonzero. A formula alone may conceal domain restrictions: (1/x) is undefined at zero, and the real square-root function requires nonnegative inputs. (openstax.org)

A piecewise-defined function uses different formulas on different parts of its domain. For instance, [ |x|=\begin{cases} x,&x\geq0,\ -x,&x<0. \end{cases} ] This is one function, not two: the cases together assign a unique value to every real input. Functions need not be represented by one uniform algebraic expression. (openstax.org)

Injectivity, surjectivity, and inverses

An injective function, or one-to-one function, sends distinct inputs to distinct outputs. Equivalently, (f(x_1)=f(x_2)) implies (x_1=x_2). A surjective function, or onto function, reaches every element of its codomain. A bijective function has both properties, pairing each domain element with exactly one codomain element and vice versa. These classifications depend on the specified sets, not merely on a formula. (cs.cornell.edu)

Thus (x\mapsto x^2), regarded as a map (\mathbb R\to\mathbb R), is neither injective nor surjective. As a map (\mathbb R\to[0,\infty)), it is surjective but not injective. Restricting both domain and codomain to ([0,\infty)) makes it bijective. These conclusions follow directly from the definitions. (cs.cornell.edu)

A bijection (f:A\to B) has an inverse function (f^{-1}:B\to A), characterized by [ f^{-1}(f(x))=x,\qquad f(f^{-1}(y))=y. ] An injective function also has an inverse when its target is restricted to its image. The inverse of squaring on ([0,\infty)) is the nonnegative square root. The notation (f^{-1}) means inverse function, not the reciprocal (1/f). (openstax.org)

Composition and restrictions

Composition combines functions by using one function’s output as another’s input. If (f:A\to B) and (g:B\to C), then [ (g\circ f)(x)=g(f(x)). ] Composition is generally order-sensitive. For (f(x)=x+1) and (g(x)=x^2), the two orders give ((x+1)^2) and (x^2+1), respectively. (cs.cornell.edu)

Restricting a function means retaining its assignments only on a subset of its domain. A partial function from (A) to (B) permits some elements of (A) to have no output; equivalently, it is an ordinary function defined on a subset of (A). In computer science, this distinction can represent computations that do not return a result for every possible input. (cs.cornell.edu)

Continuity and differentiation

In mathematical analysis and calculus, additional properties describe how functions behave near an input. For a real function defined around (a), continuity at (a) requires [ \lim_{x\to a}f(x)=f(a). ] The limit must exist and agree with the assigned value. This formalizes the relationship between nearby inputs and nearby outputs. (openstax.org)

A derivative measures local rate of change through [ f'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}, ] when this limit exists. Differentiability implies continuity, but continuity does not imply differentiability: the absolute-value function is continuous at zero yet has no derivative there. The derivative can itself be considered a function, defined at the points where the original function is differentiable. (openstax.org)