Partial function
From Free net encyclopedia
This article pertains to functions in mathematics and computer science. For other usages see function (disambiguation).
In mathematics, a partial function is a relation that associates each element of a set, sometimes called its domain (but see discussion below), with at most one element of another (possibly the same) set, called the codomain. In particular, this means that some elements of the domain may not be associated with any element of the codomain.
If a partial function f:X→Y associates, to every element in X, an element of Y, then f is termed a total function, or simply a "function" as traditionally understood in mathematics. Not every partial function is a total function.
Domain of a partial function
There are two distinct meanings in current mathematical usage for the notion of the domain of a partial function. One, probably the less common, but favored by category theorists, is the one alluded to above: The domain of a partial function f:X→Y is X. Some authors may refer to the domain of definition as those values on which the function is defined, and consider it distinct from the domain. Many other mathematicians, including recursion theorists, prefer to reserve the term "domain of f" for the set of all values x such that f(x) is defined.
Discussion and examples
The above diagram represents a partial function that is not a total function since the element 1 in X is not associated with anything. Until the second half of the 20th century, only total functions were considered "well-defined".
Consider the natural logarithm function mapping the real numbers to themselves. The logarithm of a non-positive real is not a real number, so the natural logarithm function doesn't associate any real number in the codomain with any non-positive real number in the domain. Therefore, the natural logarithm function is not a total function when viewed as a function from the reals to themselves, but it is a partial function. If the domain is restricted to only include the positive reals (that is, if the natural logarithm function is viewed as a function from the positive reals to the reals), then the natural logarithm is a total function.