Content deleted Content added
Undid revision 1214874430 by D.Lazard (talk) |
Reverted 2 edits by Farkle Griffen (talk): Restoring stable vesion again. No consensus for this change that has not been explained on the tall page. WP:3RR applies also to the author of a change |
||
(116 intermediate revisions by 50 users not shown) | |||
Line 1:
{{Short description|Association of one output to each input}}
{{redirect
{{Functions}}
In [[mathematics]], a '''function''' from a [[set (mathematics)|set]] {{mvar|X}} to a set {{mvar|Y}} assigns to each element of {{mvar|X}} exactly one element of {{mvar|Y}}.<ref name=halmos>{{harvnb |Halmos |1970 |p=30}}; the words ''map'', ''mapping'', ''transformation'', ''correspondence'', and ''operator''
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. [[History of the function concept|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 function|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
A function is
Given its ___domain and its codomain, a function is uniquely represented by the set of all [[pair (mathematics)|pairs]] {{math|(''x'', ''f''{{hair space}}(''x''))}}, called the ''[[graph of a function|graph of the function]]'', a popular means of illustrating the function.<ref group="note">This definition of "graph" refers to a ''set'' of pairs of objects. Graphs, in the sense of ''diagrams'', are most applicable to functions from the real numbers to themselves. All functions can be described by sets of pairs but it may not be practical to construct a diagram for functions between other sets (such as sets of matrices).</ref><ref>{{Cite
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.{{sfn |Spivak |2008 |p=39}}
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 ==
Line 19 ⟶ 20:
[[Image:Example Function.png|thumb|right|The red curve is the [[graph of a function]], because any [[Vertical line test|vertical line]] has exactly one crossing point with the curve.]]
A '''function''' {{mvar|f}} from a [[set (mathematics)|set]] {{mvar|X}} to a set {{mvar|Y}} is an assignment of
If the element {{mvar|y}} in {{mvar|Y}} is assigned to {{mvar|x}} in {{mvar|X}} by the function {{mvar|f}}, one says that {{mvar|f}} ''maps'' {{mvar|x}} to {{mvar|y}}, and this is commonly written <math>y=f(x).</math> In this notation, {{mvar|x}} is the ''
A function {{mvar|f}}, its ___domain {{mvar|X}}, and its codomain {{mvar|Y}} are often specified by the notation <math>f: X\to Y.</math> In this case, one may write <math>x\mapsto y</math> instead of <math>y=f(x).</math> This allows the definition of a function without naming it. For example, the [[square function]] is the function <math>x\mapsto x^2.</math>▼
▲A function {{mvar|f}}, its ___domain {{mvar|X}}, and its codomain {{mvar|Y}} are often specified by the notation <math>f: X\to Y.</math>
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 <math>f:\R\to\R</math> is a [[real function]], the determination of the ___domain of the function <math>x\mapsto 1/f(x)</math> requires to know the [[zero of a function|zeros]] of {{mvar|f.}} This is one of the reasons for which, in [[mathematical analysis]], "a function {{nowrap|from {{mvar|X}} to {{mvar|Y}} "}} may refer to a function having a proper subset of {{mvar|X}} as a ___domain.<ref group="note">The true ___domain of such a function is often called the ''___domain of definition'' of the function.</ref> For example, a "function from the reals to the reals" may refer to a [[real-valued function|real-valued]] function of a [[function of a real variable|real variable]] whose ___domain is a proper subset of the [[real number]]s, typically a subset that contains a non-empty [[open interval]]. Such a function is then called a [[partial function]].▼
▲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 <math>f:\R\to\R</math> is a [[real function]], the determination of the ___domain of the function <math>x\mapsto 1/f(x)</math> requires
▲The [[range of a function|range]] or [[Image (mathematics)|image]] of a function is the set of the [[Image (mathematics)|images]] of all elements in the ___domain.<ref name="EOM Function"/><ref name="T&K Calc p.3">{{Taalman Kohn Calculus|p=3}}</ref><ref name="Trench RA pp.30-32">{{Trench Intro Real Analysis|pp=30–32}}</ref><ref name="TBB RA pp.A4-A5">{{Thomson Bruckner Bruckner Elementary Real Analysis|pp=A-4–A-5}}</ref>
A function {{mvar|f}} on a set {{mvar|S}} means a function from the ___domain {{mvar|S}}, without specifying a codomain. However, some authors use it as shorthand for saying that the function is {{math|''f'' : ''S'' → ''S''}}.
=== Formal definition ===
[[file:Injection keine Injektion 2a.svg|thumb|Diagram of a function]]
[[file:Injection keine Injektion 1.svg|thumb|Diagram of a relation that is not a function. One reason is that 2 is the first element in more than one ordered pair. Another reason is that neither 3 nor 4 are the first element (input) of any ordered pair
The above definition of a function is essentially that of the founders of [[calculus]], [[Leibniz]], [[Isaac Newton|Newton]] and [[Euler]]. However, it cannot be [[formal proof|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 {{math|''X''}} and {{math|''Y''}} is a [[subset]] of the set of all [[ordered pair]]s <math>(x, y)</math> such that <math>x\in X</math> and <math>y\in Y.</math> The set of all these pairs is called the [[Cartesian product]] of {{math|''X''}} and {{math|''Y''}} and denoted <math>X\times Y.</math> Thus, the above definition may be formalized as follows.
A ''function'' with ___domain {{math|''X''}} and codomain {{math|''Y''}} is a binary relation {{mvar|R}} between {{math|''X''}} and {{math|''Y''}} that satisfies the two following conditions:<ref>{{cite book | last=Halmos | first=Paul R. | title=Naive Set Theory | publisher=Springer | year=1974 | pages=30–33}}</ref>
* For every <math>x</math> in <math>X</math> there exists <math>y</math> in <math>Y</math> such that <math>(x,y)\in R.</math>
* If <math>(x,y)\in R</math> and <math>(x,z)\in R,</math>
A function is formed by three sets, the ''___domain'' <math>X,</math> the ''codomain'' <math>Y,</math> and the ''graph'' <math>R</math> that satisfy the three following conditions.
*<math>R \
*<math>\forall x\in X, \exists y\in Y, \left(x, y\right) \in R \qquad</math>
*<math>(x,y)\in R \land (x,z)\in R \implies y=z\qquad</math>
Line 55 ⟶ 57:
Using functional notation, this means that, given <math>x\in X,</math> either <math>f(x)</math> is in {{mvar|Y}}, or it is undefined.
The set of the elements of {{mvar|X}} such that <math>f(x)</math> is defined and belongs to {{mvar|Y}} is called the ''___domain of definition'' of the function. A partial function from {{mvar|X}} to {{mvar|Y}} is thus
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 <math>\R</math> of the [[real number]]s to itself. Given a real function <math>f:x\mapsto f(x)</math> its [[multiplicative inverse]] <math>x\mapsto 1/f(x)</math> is also a real function. The determination of the ___domain of definition of a multiplicative inverse of a (partial) function amounts to compute the [[zero of a function|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
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 {{math|0}} belongs to its ___domain of definition (see [[Halting problem]]).
Line 71 ⟶ 73:
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 {{mvar|n}} variables is a function whose ___domain is a set of {{mvar|n}}-tuples.<ref group=note>{{mvar|n}} may also be 1, thus subsuming functions as defined above. For {{math|1=''n'' = 0}}, each [[constant (mathematics)|constant]] is a special case of a multivariate function, too.</ref> For example, multiplication of [[integer]]s 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 [[Surface (mathematics)#Graph of a bivariate function|parametric surface]], as used in, e.g., [[bivariate interpolation]].
Given {{mvar|n}} sets <math>X_1,\ldots, X_n,</math> the set of all {{mvar|n}}-tuples <math>(x_1,\ldots,x_n)</math> such that <math>x_1\in X_1, \ldots, x_n\in X_n</math> is called the [[Cartesian product]] of <math>X_1,\ldots, X_n,</math> and denoted <math>X_1\times\cdots\times X_n.</math>
Therefore, a multivariate function is a function that has a Cartesian product or a [[proper subset]] of a Cartesian product as a ___domain.
where the ___domain {{mvar|U}} has the form
If all the <math>X_i</math> are equal to the set <math>\R</math> of the [[real number]]s or to the set <math>\C</math> of the [[complex number]]s, one talks respectively of a [[function of several real variables]] or of a [[function of several complex variables]].
Line 89 ⟶ 95:
=== Functional notation ===
The functional notation requires that a name is given to the function, which, in the case of a unspecified function is often the letter {{mvar|f}}. Then, the application of the function to an argument is denoted by its name followed by its argument (or, in the case of a multivariate functions, its arguments) enclosed between parentheses, such as in
The argument between the parentheses may be a [[variable (mathematics)|variable]], often {{mvar|x}}, that represents an arbitrary element of the ___domain of the function, a specific element of the ___domain ({{math|3}} in the above example), or an [[expression (mathematics)|expression]] that can be evaluated to an element of the ___domain (<math>x^2+1</math> in the above example). The use of a unspecified variable between parentheses is useful for defining a function explicitly such as in "let <math>f(x)=\sin(x^2+1)</math>".
Line 96 ⟶ 104:
Functional notation was first used by [[Leonhard Euler]] in 1734.<ref>{{cite book|first1=Ron|last1=Larson|first2=Bruce H.|last2=Edwards|title=Calculus of a Single Variable|page=19|year=2010|publisher=Cengage Learning|isbn=978-0-538-73552-0}}</ref> Some widely used functions are represented by a symbol consisting of several letters (usually two or three, generally an abbreviation of their name). In this case, a [[roman type]] is customarily used instead, such as "{{math|sin}}" for the [[sine function]], in contrast to italic font for single-letter symbols.
The functional notation is often used
=== Arrow notation ===
Arrow notation defines the rule of a function inline, without requiring a name to be given to the function. It uses the ↦ arrow symbol, read as "[[maps to]]". For example, <math>x\mapsto x+1</math> is the function which takes a real number as input and outputs that number plus 1. Again, a ___domain and codomain of <math>\R</math> is implied.
The ___domain and codomain can also be explicitly stated, for example:
\operatorname{sqr}\colon \Z &\to \Z\\
x &\mapsto x^2.\end{align}</math>
Line 116 ⟶ 125:
This is typically the case for functions whose ___domain is the set of the [[natural number]]s. Such a function is called a [[sequence (mathematics)|sequence]], and, in this case the element <math>f_n</math> is called the {{mvar|n}}th element of the sequence.
The index notation can also be used for distinguishing some variables called ''[[Parameter (mathematics)|parameter]]s'' 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 <math>x\mapsto f(x,t)</math> (see above) would be denoted <math>f_t</math> using index notation, if we define the collection of maps <math>f_t</math> by the formula <math>f_t(x)=f(x,t)</math> for all <math>x,t\in X</math>.
=== Dot notation ===
Line 124 ⟶ 133:
the symbol {{mvar|x}} does not represent any value; it is simply a [[placeholder name|placeholder]], meaning that, if {{mvar|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, {{mvar|x}} may be replaced by any symbol, often an [[interpunct]] "{{math| ⋅ }}". This may be useful for distinguishing the function {{math|''f''{{hair space}}(⋅)}} from its value {{math|''f''{{hair space}}(''x'')}} at {{mvar|x}}.
For example, <math> a(\cdot)^2</math> may stand for the function <math> x\mapsto ax^2</math>, and <math display="inline"> \int_a^{\, (\cdot)} f(u)\,du</math> may stand for a function defined by an [[integral]] with variable upper bound: <math display="inline"> x\mapsto \int_a^x f(u)\,du</math>.
=== Specialized notations ===
Line 140 ⟶ 149:
|-
| rowspan="3" |[[Map (mathematics)|Map/Mapping]]
|None; the terms are synonymous.<ref>{{Cite web|url=http://mathworld.wolfram.com/Map.html|title=Map|last=Weisstein|first=Eric W.|website=
|-
|A map can have ''any set'' as its codomain, while, in some contexts, typically in older books, the codomain of a function is specifically the set of [[real number|real]] or [[complex number|complex]] numbers.<ref name=Lang87p43>{{cite book |last=Lang |first=Serge |title=Linear Algebra |chapter=III §1. Mappings |chapter-url={{GBurl|0DUXym7QWfYC|p=43}} |publisher=Springer |date=1987 |isbn=978-0-387-96412-6 |edition=3rd |page=43 |quote=A function is a special type of mapping, namely it is a mapping from a set into the set of numbers, i.e. into, '''R''', or '''C''' or into a field ''K''.}}</ref>
Line 153 ⟶ 162:
|}
A function may also be called a '''map''' or a '''mapping''', but some authors make a distinction between the term "map" and "function". For example, the term "map" is often reserved for a "function" with some sort of special structure (e.g. [[maps of manifolds]]). In particular ''map'' may be used in place of ''homomorphism'' for the sake of succinctness (e.g., [[linear map]] or ''map from {{mvar|G}} to {{mvar|H}}'' instead of ''[[group homomorphism]] from {{mvar|G}} to {{mvar|H}}''). Some authors<ref name=Apostol81p35>{{cite book |first=T. M. |last=Apostol |title=Mathematical Analysis|year=1981 |publisher=Addison-Wesley |page=35 |isbn=978-0-201-00288-1 |oclc=928947543 |edition=2nd}}</ref> reserve the word ''mapping'' for the case where the structure of the codomain belongs explicitly to the definition of the function.
Some authors, such as [[Serge Lang]],<ref name=Lang87p43/> use "function" only to refer to maps for which the [[codomain]] is a subset of the [[real number|real]] or [[complex number|complex]] numbers, and use the term ''mapping'' for more general functions.
Line 165 ⟶ 174:
=== By listing function values ===
On a finite set
=== By a formula ===
Line 187 ⟶ 196:
If a function <math>f: X\to Y</math> is not bijective, it may occur that one can select subsets <math>E\subseteq X</math> and <math>F\subseteq Y</math> such that the [[restriction of a function|restriction]] of {{mvar|f}} to {{mvar|E}} is a bijection from {{mvar|E}} to {{mvar|F}}, and has thus an inverse. The [[inverse trigonometric functions]] are defined this way. For example, the [[cosine function]] induces, by restriction, a bijection from the [[interval (mathematics)|interval]] {{closed-closed|0, ''π''}} onto the interval {{closed-closed|−1, 1}}, and its inverse function, called [[arccosine]], maps {{closed-closed|−1, 1}} onto {{closed-closed|0, ''π''}}. The other inverse trigonometric functions are defined similarly.
More generally, given a [[binary relation]] {{mvar|R}} between two sets {{mvar|X}} and {{mvar|Y}}, let {{mvar|E}} be a subset of {{mvar|X}} such that, for every <math>x\in E,</math> there is some <math>y\in Y</math> such that {{math|''x R y''}}. If one has a criterion allowing selecting such
For example, the equation of the [[unit circle]] <math>x^2+y^2=1</math> defines a relation on real numbers. If {{math|−1 < ''x'' < 1}} there are two possible values of {{mvar|y}}, one positive and one negative. For {{math|1=''x'' = ± 1}}, these two values become both equal to 0. Otherwise, there is no possible value of {{mvar|y}}. This means that the equation defines two implicit functions with ___domain {{closed-closed|−1, 1}} and respective codomains {{closed-open|0, +∞}} and {{open-closed|−∞, 0}}.
Line 207 ⟶ 216:
The [[factorial]] function on the nonnegative integers (<math>n\mapsto n!</math>) is a basic example, as it can be defined by the recurrence relation
and the initial condition
== Representing a function ==
Line 221 ⟶ 233:
Given a function <math>f : X\to Y,</math> its ''graph'' is, formally, the set
In the frequent case where {{mvar|X}} and {{mvar|Y}} are subsets of the [[real number]]s (or may be identified with such subsets, e.g. [[interval (mathematics)|intervals]]), an element <math>(x,y)\in G</math> may be identified with a point having coordinates {{math|''x'', ''y''}} in a 2-dimensional coordinate system, e.g. the [[Cartesian plane]]. Parts of this may create a [[Plot (graphics)|plot]] that represents (parts of) the function. The use of plots is so ubiquitous that they too are called the ''graph of the function''. Graphic representations of functions are also possible in other coordinate systems. For example, the graph of the [[square function]]
consisting of all points with coordinates <math>(x, x^2)</math> for <math>x\in \R,</math> yields, when depicted in Cartesian coordinates, the well known [[parabola]]. If the same quadratic function <math>x\mapsto x^2,</math> with the same formal graph, consisting of pairs of numbers, is plotted instead in [[polar coordinates]] <math>(r,\theta) =(x,x^2),</math> the plot obtained is [[Fermat's spiral]].
Line 289 ⟶ 304:
Given two functions <math>f: X\to Y</math> and <math>g: Y\to Z</math> such that the ___domain of {{mvar|g}} is the codomain of {{mvar|f}}, their ''composition'' is the function <math>g \circ f: X \rightarrow Z</math> defined by
: <math>(g \circ f)(x) = g(f(x)).</math>▼
That is, the value of <math>g \circ f</math> is obtained by first applying {{math|''f''}} to {{math|''x''}} to obtain {{math|1=''y'' = ''f''(''x'')}} and then applying {{math|''g''}} to the result {{mvar|y}} to obtain {{math|1=''g''(''y'') = ''g''(''f''(''x''))}}. In this notation, the function that is applied first is always written on the right.
The composition <math>g\circ f</math> is an [[operation (mathematics)|operation]] on functions that is defined only if the codomain of the first function is the ___domain of the second one. Even when both <math>g \circ f</math> and <math>f \circ g</math> satisfy these conditions, the composition is not necessarily [[commutative property|commutative]], that is, the functions <math>g \circ f</math> and <math> f \circ g</math> need not be equal, The function composition is [[associative property|associative]] in the sense that, if one of <math>(h\circ g)\circ f</math> and <math>h\circ (g\circ f)</math> is defined, then the other is also defined, and they are equal, that is, <math>(h\circ g)\circ f = h\circ (g\circ f).</math> Therefore, it is usual to just write <math>h\circ g\circ f.</math>
Line 309 ⟶ 325:
{{Main|Image (mathematics)}}
Let <math>f: X\to Y.</math> The ''image'' under {{mvar|f}} of an element {{mvar|x}} of the ___domain {{mvar|X}} is {{math|''f''(''x'')}}.<ref name="EOM Function"/> If {{math|''A''}} is any subset of {{math|''X''}}, then the ''image'' of {{mvar|A}} under {{mvar|f}}, denoted {{math|''f''(''A'')}}, is the subset of the codomain {{math|''Y''}} consisting of all images of elements of {{mvar|A}},<ref name="EOM Function"/> that is,
The ''image'' of {{math|''f''}} is the image of the whole ___domain, that is, {{math|''f''(''X'')}}.{{r|PCM p.11}} It is also called the [[range of a function|range]] of {{mvar|f}},{{r|EOM Function|T&K Calc p.3|Trench RA pp.30-32|TBB RA pp.A4-A5}} although the term ''range'' may also refer to the codomain.{{r|TBB RA pp.A4-A5|PCM p.11}}<ref name = "standard">''Quantities and Units - Part 2: Mathematical signs and symbols to be used in the natural sciences and technology'', p. 15. ISO 80000-2 (ISO/IEC 2009-12-01)</ref>
On the other hand, the ''[[inverse image]]'' or ''[[preimage]]'' under {{mvar|f}} of an element {{mvar|y}} of the codomain {{mvar|Y}} is the set of all elements of the ___domain {{math|''X''}} whose images under {{mvar|f}} equal {{mvar|y}}.<ref name="EOM Function"/> In symbols, the preimage of {{mvar|y}} is denoted by <math>f^{-1}(y)</math> and is given by the equation
Likewise, the preimage of a subset {{math|''B''}} of the codomain {{math|''Y''}} is the set of the preimages of the elements of {{math|''B''}}, that is, it is the subset of the ___domain {{math|''X''}} consisting of all elements of {{math|''X''}} whose images belong to {{math|''B''}}.<ref name="EOM Function"/> It is denoted by <math>f^{-1}(B)</math> and is given by the equation
For example, the preimage of <math>\{4, 9\}</math> under the [[square function]] is the set <math>\{-3,-2,2,3\}</math>.
Line 338 ⟶ 359:
Let <math>f : X\to Y</math> be a function.
The function {{mvar|f}} is ''[[injective function|injective]]'' (or ''one-to-one'', or is an ''injection'') if {{math|''f''(''a'') ≠ ''f''(''b'')}} for every two different elements {{math|''a''}} and {{mvar|''b''}} of {{mvar|X}}.<ref name="PCM p.11">{{Princeton Companion to Mathematics|p=11}}</ref><ref name="EOM Injection">{{eom |title=Injection |oldid=30986 |
The function {{mvar|f}} is ''[[surjective]]'' (or ''onto'', or is a ''surjection'') if its range <math>f(X)</math> equals its codomain <math>Y</math>, that is, if, for each element <math>y</math> of the codomain, there exists some element <math>x</math> of the ___domain such that <math>f(x) = y</math> (in other words, the preimage <math>f^{-1}(y)</math> of every <math>y\in Y</math> is nonempty).<ref name="PCM p.11"/><ref name="EOM Surjection">{{eom |title=Surjection |oldid=35689 |author-first=O.A. |author-last=Ivanova|mode=cs1}}</ref> If, as usual in modern mathematics, the [[axiom of choice]] is assumed, then {{mvar|f}} is surjective if and only if there exists a function <math>g: Y\to X</math> such that <math>f\circ g=\operatorname{id}_Y,</math> that is, if {{mvar|f}} has a [[right inverse function|right inverse]].<ref name="EOM Surjection"/> The axiom of choice is needed, because, if {{mvar|f}} is surjective, one defines {{mvar|g}} by <math>g(y)=x,</math> where <math>x</math> is an ''arbitrarily chosen'' element of <math>f^{-1}(y).</math>
Line 346 ⟶ 367:
Every function <math>f: X\to Y</math> may be [[factorization|factorized]] as the composition <math>i\circ s</math> of a surjection followed by an injection, where {{mvar|s}} is the canonical surjection of {{mvar|X}} onto {{math|''f''(''X'')}} and {{mvar|i}} is the canonical injection of {{math|''f''(''X'')}} into {{mvar|Y}}. This is the ''canonical factorization'' of {{mvar|f}}.
"One-to-one" and "onto" are terms that were more common in the older English language literature; "injective", "surjective", and "bijective" were originally coined as French words in the second quarter of the 20th century by the [[Nicolas Bourbaki|Bourbaki group]] and imported into English.<ref>{{
=== Restriction and extension <span class="anchor" id="Restrictions and extensions"></span> ===
Line 352 ⟶ 373:
{{main|Restriction (mathematics)}}
If <math>f : X \to Y</math> is a function and {{math|''S''}} is a subset of {{math|''X''}}, then the ''restriction'' of <math>f</math> to ''S'', denoted <math>f|_S</math>, is the function from {{math|''S''}} to {{math|''Y''}} defined by
for all {{math|''x''}} in {{math|''S''}}. Restrictions can be used to define partial [[inverse function]]s: if there is a [[subset]] {{math|''S''}} of the ___domain of a function <math>f</math> such that <math>f|_S</math> is injective, then the canonical surjection of <math>f|_S</math> onto its image <math>f|_S(S) = f(S)</math> is a bijection, and thus has an inverse function from <math>f(S)</math> to {{math|''S''}}. One application is the definition of [[inverse trigonometric functions]]. For example, the [[cosine]] function is injective when restricted to the [[interval (mathematics)|interval]] {{closed-closed|0, ''π''}}. The image of this restriction is the interval {{closed-closed|−1, 1}}, and thus the restriction has an inverse function from {{closed-closed|−1, 1}} to {{closed-closed|0, ''π''}}, which is called [[arccosine]] and is denoted {{math|arccos}}.
Line 378 ⟶ 401:
Functions enjoy [[pointwise operation]]s, that is, if {{mvar|f}} and {{mvar|g}} are functions, their sum, difference and product are functions defined by
(f+g)(x)&=f(x)+g(x)\\
(f-g)(x)&=f(x)-g(x)\\
(f\cdot g)(x)&=f(x)\cdot g(x)\\
\end{align}.</math>
The domains of the resulting functions are the [[set intersection|intersection]] of the domains of {{mvar|f}} and {{mvar|g}}. The quotient of two functions is defined similarly by
but the ___domain of the resulting function is obtained by removing the [[zero of a function|zeros]] of {{mvar|g}} from the intersection of the domains of {{mvar|f}} and {{mvar|g}}.
Line 394 ⟶ 421:
Many other real functions are defined either by the [[implicit function theorem]] (the inverse function is a particular instance) or as solutions of [[differential equation]]s. For example, the [[sine]] and the [[cosine]] functions are the solutions of the [[linear differential equation]]
such that
=== Vector-valued function ===
Line 427 ⟶ 457:
The definition of a function that is given in this article requires the concept of [[set (mathematics)|set]], since the ___domain and the codomain of a function must be a set. This is not a problem in usual mathematics, as it is generally not difficult to consider only functions whose ___domain and codomain are sets, which are well defined, even if the ___domain is not explicitly defined. However, it is sometimes useful to consider more general functions.
For example, the [[singleton set]] may be considered as a function <math>x\mapsto \{x\}.</math> Its ___domain would include all sets, and therefore would not be a set. In usual mathematics, one avoids this kind of problem by specifying a ___domain, which means that one has many singleton functions. However, when establishing foundations of mathematics, one may have to use functions whose ___domain, codomain or both are not specified, and some authors, often logicians, give precise
These generalized functions may be critical in the development of a formalization of the [[foundations of mathematics]]. For example, [[Von Neumann–Bernays–Gödel set theory]], is an extension of the set theory in which the collection of all sets is a [[Class (set theory)|class]]. This theory includes the [[Von Neumann–Bernays–Gödel set theory#NBG's axiom of replacement|replacement axiom]], which may be stated as: If {{mvar|X}} is a set and {{mvar|F}} is a function, then {{math|''F''[''X'']}} is a set.
Line 451 ⟶ 481:
== In computer science ==
{{main|Function (computer programming)|Lambda calculus}}
In [[computer programming]], a [[Function (programming)|function]] is, in general, a [[subroutine]] which [[implementation|implements]] the abstract concept of function. That is, it is a program unit that produces an output for each input. [[Functional programming]] is the [[programming paradigm]] consisting of building programs by using only subroutines that behave like mathematical functions, meaning that they have no [[side effect (computer science)|side effect]]s and depend only on their arguments: they are [[Referential transparency|referentially transparent]]. For example, <code>if_then_else</code> is a function that takes three ([[nullary]]) functions as arguments, and, depending on the
In many [[programming language]]s, every subroutine is called a function, even when there is no output but only side effects, and when the functionality consists simply of modifying some data in the [[computer memory]].
Except for computer-language terminology, "function" has the usual mathematical meaning in [[computer science]]. In this area, a property of major interest is the [[computable function|computability]] of a function. For giving a precise meaning to this concept, and to the related concept of [[algorithm]], several [[models of computation]] have been introduced, the old ones being [[μ-recursive function|general recursive function]]s, [[lambda calculus]] and [[Turing machine]]. The fundamental theorem of [[computability theory]] is that these three models of computation define the same set of computable functions, and that all the other models of computation that have ever been proposed define the same set of computable functions or a smaller one. The [[Church–Turing thesis]] is the claim that every philosophically acceptable definition of a ''computable function'' defines also the same functions.▼
▲
General recursive functions are [[partial function]]s from integers to integers that can be defined from
Line 464 ⟶ 495:
* [[#Function composition|composition]],
* [[primitive recursion]], and
* [[μ operator|minimization]].
Although defined only for functions from integers to integers, they can model any computable function as a consequence of the following properties:
* a computation is the manipulation of finite sequences of symbols (digits of numbers, formulas,
* every sequence of symbols may be coded as a sequence of [[bit]]s,
* a bit sequence can be interpreted as the [[binary representation]] of an integer.
[[Lambda calculus]] is a theory that defines computable functions without using [[set theory]], and is the theoretical background of functional programming. It consists of ''terms'' that are either variables, function definitions (''{{lambda}}''-terms), or applications of functions to terms. Terms are manipulated
In its original form, lambda calculus does not include the concepts of ___domain and codomain of a function. Roughly speaking, they have been introduced in the theory under the name of ''type'' in [[typed lambda calculus]]. Most kinds of typed lambda calculi can define fewer functions than untyped lambda calculus.
Line 477 ⟶ 510:
=== Subpages ===
{{div col|colwidth=22em}}
* [[History of the function concept]]
* [[List of types of functions]]
* [[List of functions]]
Line 543 ⟶ 577:
== External links ==
* [http://functions.wolfram.com/ The Wolfram Functions] – website giving formulae and visualizations of many mathematical functions
* [https://dlmf.nist.gov/ NIST Digital Library of Mathematical Functions]
|