A partial function is often used when its exact domain of definition is not known, or is difficult to specify.
However, even when the exact domain of definition is known, partial functions are often used for simplicity or brevity.
However, there is no general convention, and the latter notation is more commonly used for inclusion maps or embeddings.
[citation needed] Specifically, for a partial function
is the square root function restricted to the integers then
A common example is the square root operation on the real numbers
In the example of the square root operation, the set S consists of the nonnegative real numbers
The notion of partial function is particularly convenient when the exact domain of definition is unknown or even unknowable.
In case the domain of definition S is equal to the whole set X, the partial function is said to be total.
Because a function is trivially surjective when restricted to its image, the term partial bijection denotes a partial function which is injective.
The notion of transformation can be generalized to partial functions as well.
[1] For convenience, denote the set of all partial functions
an operation which is injective (unique and invertible by restriction).
The first diagram at the top of the article represents a partial function that is not a function since the element 1 in the left-hand set is not associated with anything in the right-hand set.
Whereas, the second diagram represents a function since every element on the left-hand set is associated with exactly one element in the right hand set.
Consider the natural logarithm function mapping the real numbers to themselves.
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 function.
is the non-negative integers) is a partial function: It is defined only when
In denotational semantics a partial function is considered as returning the bottom element when it is undefined.
In computer science a partial function corresponds to a subroutine that raises an exception or loops forever.
The IEEE floating point standard defines a not-a-number value which is returned when a floating point operation is undefined and exceptions are suppressed, e.g. when the square root of a negative number is requested.
In category theory, when considering the operation of morphism composition in concrete categories, the composition operation
The category of sets and partial functions is equivalent to but not isomorphic with the category of pointed sets and point-preserving maps.
[2] One textbook notes that "This formal completion of sets and partial maps by adding “improper,” “infinite” elements was reinvented many times, in particular, in topology (one-point compactification) and in theoretical computer science.
"[3] The category of sets and partial bijections is equivalent to its dual.
An example would be a field, in which the multiplicative inversion is the only proper partial operation (because division by zero is not defined).
[7][8] Charts in the atlases which specify the structure of manifolds and fiber bundles are partial functions.
In these applications, the most important construction is the transition map, which is the composite of one chart with the inverse of another.
The initial classification of manifolds and fiber bundles is largely expressed in terms of constraints on these transition maps.
The reason for the use of partial functions instead of functions is to permit general global topologies to be represented by stitching together local patches to describe the global structure.