(Translated by https://www.hiragana.jp/)
Function (mathematics): Difference between revisions - Wikipedia Jump to content

Function (mathematics): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
revert
revert to Andre
Line 1: Line 1:
#REDIRECT [[Function]]
[[de:Funktion (Mathematik)]]
[[eo:Funkcio]]
[[fr:fonction]]
[[nl:afbeelding]]
[[pl:Funkcja matematyczna]]
In [[mathematics]], a '''function''' is also called a [[mapping]] or a [[map]]. Functions are one of the most basic concepts of mathematics, and appear in almost every discipline.

In its most informal sense, a '''function''' is an explicit rule or formula, such as ''f''(''x'') = ''x''<sup>2</sup> or ''f''(''x'',''y'')=''xy'', that converts some input value(s) into another value by substitution into the formula. The input value(s) is often called the ''argument(s)'' of the function; and the resulting output value is often called the value of the function when it is ''evaluated'' at those specific arguments.

The [[function domain | domain]] of a function is the [[set]] from which the input values are taken, and the [[codomain]] of a function is the set to which the output values belong.
The [[range]] of a function is the set of all possible output values.

In mathematics, a formula is qualified as a (well-defined) function if the following two conditions are satisfied:
#For each input value, there should only be one possible output value.
#For each input value, the formula should produce at least one output value in the codomain.

To illustrate, consider the following three figures:

<table>
<tr><td>[[image:notMap1.png]]</td><td> This is not a function in usual sense because the element 3 in ''X'' is associated with two elements ''b'' and ''c'' in ''Y'' (Condition 1 is violated). It is a '''multivalued function'''.</td></tr>

<tr><td>[[image:notMap2.png]]</td><td> This is not a function in usual sense because the element 1 in ''X''&nbsp; is associated with nothing (Condition 2 is violated). It is a '''partial function'''.</td></tr>

<tr><td>[[image:mathmap.png]]</td><td> This is a (well-defined) function. It can be stated explicitly as
:<math>f(x)=\left\{\begin{matrix} a, & \mbox{if }x=1 \\ d, & \mbox{if }x=2 \\ c, & \mbox{if }x=3. \end{matrix}\right.</math>
The range of ''f'' is {a,c,d}.
</td></tr>
</table>

==Formal Definition==

The ''[[graph of a function|graph]]'' of a function ''f'' is the collection of all pairs (''x'', ''f''(''x'')) for all ''x'' in ''X''. In the example above, the graph of ''f'' is {(1,a),(2,d),(3,c)}.

More abstractly, the function ''f''(''x'') = ''x''<sup>2</sup>, where ''x'' is any [[natural number]], can be considered as equivalent to the [[infinite]] set {(1,1), (2,4), (3,9), (4,16), ...}; and when taken over the [[real number]]s ('''R'''), we can consider it equivalent to the [[uncountable]] set {(''x'', ''x''<sup>2</sup>)}.

By ''starting'' with the graph of a function, we can give a precise definition from a [[set theory|set theoretic]] point of view:

A function ''f'' with domain ''X'' and codomain ''Y'' (written as ''f'': ''X'' &rarr; ''Y'') is a [[subset]] of the [[Cartesian product]] ''X''&nbsp;&times;&nbsp;''Y'' (in other words, ''f'' is a set of ordered pairs {(''x'', ''y'')} with ''x'' in ''X'', ''y'' in ''Y'', often called a [[binary relation]]); with the additional properties that ''f'' is:
#''Functional'': if there are two pairs (''x'', ''y'') and (''x'', ''z'') in ''f'', then ''y'' = ''z''.
#''Total'': for all ''x'' in ''X'', there exists an ordered pair (''x'', ''y'') in ''f'' for some ''y'' in ''Y''.

Notice that the two conditions above are precisely what is needed for the symbol ''f''(''x'') to be defined uniquely for any ''x'' in ''X''.
If a function ''f'' is defined by specifying it as a binary relation (either directly or indirectly), then we say that ''f'' is ''well defined'' if ''f'' actually satisfies these conditions. We can then write ''f''(''x'') to be the (unique) value ''y'' in ''Y'' which corresponds to the pair (''x'', ''y'') in ''f''; in other words, the statements ''f''(''x'') = ''y'' and (''x'', ''y'') in ''f'' are equivalent.


Occasionally, especially in the theory of computability, functions as defined here are called '''total functions''' to distinguish them from [[partial function]]s which don't require condition 2 from above. In this encyclopedia, the terms "total function" and "function" are synonymous.

One may also consider functions that expect several input values; for instance the [[volume]] <var>V</var> of a [[right circular cone]] can be computed from the [[radius]] <var>r</var> of its base and its height <var>h</var> according to the rule <var>V</var>(<var>r</var>,<var>h</var>)&nbsp;= 1/3&nbsp;*&nbsp;pi&nbsp;*&nbsp;<var>r</var><sup>2</sup>&nbsp;*&nbsp;<var>h</var>. We then consider the domain of ''V'' to be the set of ordered pairs of reals (''r'', ''h''); and we write that ''V'':('''R''' &times; '''R''') &rarr; '''R'''.

This definition of function provides mathematicians with a number of useful advantages over the "explicit formula" definition:
*Clearly, if we already have an explicit formula for ''f''(''x''), we can construct the set of pairs ''f''; so nothing is lost by this definition.
*The definition allows us to consider functions in the abstract which, as a practical matter, could never be evaluated. In particular, functions which would require an infinite number of operations to evaluate can be considered as a set which has been ''given'' as a whole, rather than calculated.
*In many cases, there ''is'' no explicit formula which amounts to more than a "table" of arguments and values; the above definition accommodates these types of functions naturally.
*We can talk about ''sets'' of functions without specifying them exactly; for example, given the domain '''R''' of real numbers, and the codomain '''N''' of natural numbers, we can talk about the set of ''all'' functions of the form ''f'': '''R''' &rarr; '''N''', or some subset of these functions which satisfy other criteria. Mathematicians are often interested in such generalizations.
*In some cases, it may be unclear whether or not some binary relation ''f'' is "truly" a function; the definition provides a way of proving the existence of a well-defined function without actually specifying an explicit formula.

Observe that in set theory there is no distinction between a ''function'' ''f'' and its ''graph''.
In practice (for example, in [[mathematical analysis|analysis]]) one has the paradoxical situation that the set-theoretic formalism is used, but the language still reflects the classical definition.
One rarely talks about functions in terms of the graph.
However, considering the properties of the graph as a set can be a very powerful technique, and there are theorems formulated or proved most easily in terms of the graph as a set, such as the [[closed graph theorem]].

==Images and preimages==

If <var>f</var>:&nbsp;<var>X</var>&nbsp;&rarr;&nbsp;<var>Y</var> is a function and <var>A</var> is a [[subset]] of <var>X</var>, then the ''image'' (or ''direct image'') of <var>A</var> under <var>f</var> is the subset of <var>Y</var> defined by
:<var>f</var>(<var>A</var>)&nbsp;:= {<var>f</var>(<var>x</var>)&nbsp;: <var>x</var> in <var>A</var>}.

If ''A''=''X'', then ''f''(''X'') is called the ''image'' or ''range'' of ''f''.
In our example, the image of {2,3} under ''f'' is ''f''({2,3})={c,d} and the image of ''f'' is {a,c,d}.

If <var>B</var> is a subset of <var>Y</var>, we define its ''preimage'' (or ''inverse image'') to be the subset of <var>X</var> defined by
:<var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var>)&nbsp;:= {<var>x</var> in <var>X</var>&nbsp;: <var>f</var>(<var>x</var>)&nbsp in &nbsp;<var>B</var>}.
In our example, the preimage of {a,b} is ''f''<sup>&nbsp;&minus;1</sup>({a,b})={1}.

Note that with this definiton, ''f''<sup>&nbsp;-1</sup> becomes a function whose domain is the set of all subsets of ''Y'' (also known as the [[power set]] of ''Y'') and whose codomain is the power set of ''X'''.

Some consequences that follow immediately from these definitions are:
*<var>f</var>(<var>A</var><sub>1</sub>&nbsp;&cup;&nbsp;<var>A</var><sub>2</sub>)&nbsp;= <var>f</var>(<var>A</var><sub>1</sub>)&nbsp;&cup;&nbsp;<var>f</var>(<var>A</var><sub>2</sub>).
*<var>f</var>(<var>A</var><sub>1</sub>&nbsp;&cap;&nbsp;<var>A</var><sub>2</sub>)&nbsp;&sube; <var>f</var>(<var>A</var><sub>1</sub>)&nbsp;&cap;&nbsp;<var>f</var>(<var>A</var><sub>2</sub>).
*<var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var><sub>1</sub>&nbsp;&cup;&nbsp;<var>B</var><sub>2</sub>)&nbsp;= <var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var><sub>1</sub>)&nbsp;&cup;&nbsp;<var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var><sub>2</sub>).
*<var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var><sub>1</sub>&nbsp;&cap;&nbsp;<var>B</var><sub>2</sub>)&nbsp;= <var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var><sub>1</sub>)&nbsp;&cap;&nbsp;<var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var><sub>2</sub>).
*<var>f</var>(<var>f</var><sup>&nbsp;&minus;1</sup>(<var>B</var>))&nbsp;&sube;&nbsp;<var>B</var>.
*<var>f</var><sup>&nbsp;&minus;1</sup>(<var>f</var>(<var>A</var>))&nbsp;&supe;&nbsp;<var>A</var>.

The results relating images and preimages to the algebra of [[set theoretic intersection|intersection]] and [[set theoretic union|union]] work for any number of sets, not just for 2.

Notice that the range of <var>f</var> is the image <var>f</var>(<var>X</var>) of its domain.

==Specifying functions==

Functions can be specified in several ways.
In practice, most functions that relate (combinations of) numbers with numbers are specified by one or more equation.
For example, the ''dist'' function can be specified with
: ''dist''(<var>x</var>,<var>y</var>)&nbsp;:= (<var>x</var><sup>2</sup>&nbsp;+&nbsp;<var>y</var><sup>2</sup>)<sup>1/2</sup>
or
: <var>z</var>&nbsp;:=&nbsp;(<var>x</var><sup>2</sup>&nbsp;+&nbsp;<var>y</var><sup>2</sup>)<sup>1/2</sup>,
where <var>z</var> is called the ''dependent variable'' and <var>x</var> and <var>y</var> are called the ''independent variables''.
This type of specification is sometimes called ''specification by [[intension]]''.

Another way of specifying functions is by specifying the the set of [[ordered pair]]s that form the function's graph by either enumerating it or specifying it in [[set theory]].
The ''wght'' function, for example, might be specified by
: ''wght''&nbsp;:=&nbsp;{(Larry,160),&nbsp;(Jimmy,165),&nbsp;(Ruth,125),&nbsp;(Cindy,120),&nbsp;...}
and ''nlog'' might be specified by
: ''nlog''&nbsp;:=&nbsp;{(<var>x</var>,<var>y</var>)&nbsp;&isin;&nbsp;<b>R</b>&nbsp;&times;&nbsp;<b>R</b>&nbsp;: <var>x</var>&nbsp;=&nbsp;e<sup><var>y</var></sup>}.
This type of specification is sometimes also called ''specification by [[extension (semantics)|extension]]''.

A third way of specifying functions that is often used in [[computer science]] is ''specification by computation'', where it is indicated how the result of the function is computed from the arguments.
An example of this are Lambda expressions in [[Lambda calculus]] where the function ''max''(<var>a</var>,<var>b</var>) with <var>a</var> and <var>b</var> [[integer]]s might be specified as
: ''max''&nbsp;:=&nbsp;&lambda;&nbsp;(<var>a</var>,<var>b</var>)&nbsp;&isin;&nbsp;<b>Z</b>&nbsp;&times;&nbsp;<b>Z</b>&nbsp;. '''if'''&nbsp;<var>a</var>&nbsp;<&nbsp;<var>b</var> '''then'''&nbsp;<var>b</var> '''else'''&nbsp;<var>a</var>.

Functions may also be specified by ''[[recursion]]''. The canonical example is the [[Fibonacci series]]; we are given that ''f''(1) = 1, ''f''(2) = 1, and the recurrence that for all ''n''>2, ''f''(''n'') = ''f''(''n''-1) + ''f''(''n''-2). The conclusion of the recurrence theorem is that each recurrence there exists a unique function which satisfies the recurrence and the initial conditions.

==Injective, surjective and bijective functions==

Several types of functions are very useful, deserve special names:
*[[injective]] (one-to-one) functions send different arguments to different values; in other words, if ''x'' and ''y'' are members of the domain of ''f'', then ''f''(''x'') = ''f''(''y'') if and only if ''x'' = ''y''. Our example is an injective function.
*[[surjective]] (onto) functions have their range equal to their codomain; in other words, if ''y'' is any member of the codomain of ''f'', then there exists at least one ''x'' such that ''f''(''x'') = ''y''.
*[[bijective function]]s are both injective and surjective; they are often used to show that the sets ''X'' and ''Y'' are "the same" in some sense.

==Examples of functions==

(More can be found at [[List of functions]].)

* The relation ''wght'' between persons in the United States and their weights.
* The relation between nations and their capitals.
* The relation ''sqr'' between [[natural number]]s <var>n</var> and their squares <var>n</var><sup>2</sup>.
* The relation ''nlog'' between ''positive'' [[real number]]s <var>x</var> and their [[natural logarithm]]s ln(<var>x</var>). Note that the relation between real numbers and their natural logarithms is not a function because not every real number has a natural logarithm; that is, this relation is not total and is therefore only a partial function.
* The relation ''dist'' between points in the plane <b>R</b><sup>2</sup> and their distances from the origin (0,0).
* The relation ''grav'' between a point in the punctured plane <b>R</b><sup>2</sup>&nbsp;\ {(0,0)} and the vector describing the [[gravitational force]] that a certain mass at that point would experience from a certain other mass at the origin (0,0).

== <var>n</var>-ary function ==

If the domain of a function is a subset of the [[Cartesian product]] of <var>n</var> sets then the function is called an ''<var>n</var>-ary function''.
For example, the relation ''dist'' has the domain <b>R</b>&nbsp;&times;&nbsp;<b>R</b> and is therefore a [[binary function]].
In that case ''dist''((<var>x</var>,<var>y</var>)) is simply written as ''dist''(<var>x</var>,<var>y</var>).

In [[abstract algebra]], operators such as "*" are defined as binary functions; when we write a formula such as ''x''*''y'' in this context, we are implictly invoking the function *(''x'',''y'').

==Combining functions==

The functions <var>f</var>:&nbsp;<var>X</var>&nbsp;&rarr;&nbsp;<var>Y</var> and <var>g</var>:&nbsp;<var>Y</var>&nbsp;&rarr;&nbsp;<var>Z</var> can be ''composed'' by first applying <var>f</var> to an argument <var>x</var> and then applying <var>g</var> to the result.
Thus one obtains a function <var>g</var>&nbsp;<small>o</small>&nbsp;<var>f</var>: <var>X</var>&nbsp;&rarr;&nbsp;<var>Z</var> defined by (<var>g</var>&nbsp;<small>o</small>&nbsp;<var>f</var>)(<var>x</var>)&nbsp;:= <var>g</var>(<var>f</var>(<var>x</var>)) for all <var>x</var> in <var>X</var>.
As an example, suppose that a plane's height at time <var>t</var> is given by the function <var>h</var>(<var>t</var>) and that the oxygen concentration at height <var>x</var> is given by the function <var>c</var>(<var>x</var>).
Then (<var>c</var>&nbsp;<small>o</small>&nbsp;<var>h</var>)(<var>t</var>) describes the oxygen concentration around the plane at time <var>t</var>.

If <var>f</var>:&nbsp;<var>X</var>&nbsp;&rarr;&nbsp;<b>R</b> and <var>g</var>:&nbsp;<var>X</var>&nbsp;&rarr;&nbsp;<b>R</b> are functions with common domain <var>X</var> and codomain is a [[ring (mathematics)|ring]] <b>R</b>, then one can define the sum function <var>f</var>&nbsp;+&nbsp;<var>g</var>: <var>X</var>&nbsp;&rarr;&nbsp;<b>R</b> and the product function <var>f</var>&nbsp;&times;&nbsp;<var>g</var>: <var>X</var>&nbsp;&rarr;&nbsp;<b>R</b> as follows:
:(<var>f</var>&nbsp;+&nbsp;<var>g</var>)(<var>x</var>)&nbsp;:= <var>f</var>(<var>x</var>)&nbsp;+&nbsp;<var>g</var>(<var>x</var>);
:(<var>f</var>&nbsp;&times;&nbsp;<var>g</var>)(<var>x</var>)&nbsp;:= <var>f</var>(<var>x</var>)&nbsp;&times;&nbsp;<var>g</var>(<var>x</var>);
for all <var>x</var> in <var>X</var>.
This turns the set of all such functions into a ring.
By taking some other [[abstract algebra|algebraic structure]] <var>A</var> in the place of <b>R</b>, we can turn the set of all functions from <var>X</var> to <var>A</var> into an algebraic structure of the same type in an analogous way.
-------
In [[computer science]], a '''function''' is another common term for [[subprogram]].

Revision as of 23:00, 21 May 2003

Redirect to: