Partial function explained

In mathematics, a partial function from a set to a set is a function from a subset of (possibly the whole itself) to . The subset, that is, the domain of viewed as a function, is called the domain of definition or natural domain of . If equals, that is, if is defined on every element in, then is said to be a total function.

More technically, a partial function is a binary relation over two sets that associates every element of the first set to at most one element of the second set; it is thus a univalent relation. This generalizes the concept of a (total) function by not requiring every element of the first set to be associated to an element of the second set.

A partial function is often used when its exact domain of definition is not known or difficult to specify. This is the case in calculus, where, for example, the quotient of two functions is a partial function whose domain of definition cannot contain the zeros of the denominator. For this reason, in calculus, and more generally in mathematical analysis, a partial function is generally called simply a . In computability theory, a general recursive function is a partial function from the integers to the integers; no algorithm can exist for deciding whether an arbitrary such function is in fact total.

When arrow notation is used for functions, a partial function

f

from

X

to

Y

is sometimes written as

f:X\rightharpoonupY,

f:X\nrightarrowY,

or

f:X\hookrightarrowY.

However, there is no general convention, and the latter notation is more commonly used for inclusion maps or embeddings.

Specifically, for a partial function

f:X\rightharpoonupY,

and any

x\inX,

one has either:

f(x)=y\inY

(it is a single element in), or

f(x)

is undefined.

For example, if

f

is the square root function restricted to the integers

f:\Z\to\N,

defined by:

f(n)=m

if, and only if,

m2=n,

m\in\N,n\in\Z,

then

f(n)

is only defined if

n

is a perfect square (that is,

0,1,4,9,16,\ldots

). So

f(25)=5

but

f(26)

is undefined.

Basic concepts

A partial function arises from the consideration of maps between two sets and that may not be defined on the entire set . A common example is the square root operation on the real numbers

R

: because negative real numbers do not have real square roots, the operation can be viewed as a partial function from

R

to

R.

The domain of definition of a partial function is the subset of on which the partial function is defined; in this case, the partial function may also be viewed as a function from to . In the example of the square root operation, the set consists of the nonnegative real numbers

[0,+infty).

The notion of partial function is particularly convenient when the exact domain of definition is unknown or even unknowable. For a computer-science example of the latter, see Halting problem.

In case the domain of definition is equal to the whole set, the partial function is said to be total. Thus, total partial functions from to coincide with functions from to .

Many properties of functions can be extended in an appropriate sense of partial functions. A partial function is said to be injective, surjective, or bijective when the function given by the restriction of the partial function to its domain of definition is injective, surjective, bijective respectively.

Because a function is trivially surjective when restricted to its image, the term partial bijection denotes a partial function which is injective.[1]

An injective partial function may be inverted to an injective partial function, and a partial function which is both injective and surjective has an injective function as inverse. Furthermore, a function which is injective may be inverted to a bijective partial function.

The notion of transformation can be generalized to partial functions as well. A partial transformation is a function

f:A\rightharpoonupB,

where both

A

and

B

are subsets of some set

X.

[1]

Function spaces

For convenience, denote the set of all partial functions

f:X\rightharpoonupY

from a set

X

to a set

Y

by

[X\rightharpoonupY].

This set is the union of the sets of functions defined on subsets of

X

with same codomain

Y

:

[X\rightharpoonupY]=cupD[D\toY],

the latter also written as \bigcup_ Y^D. In finite case, its cardinality is

|[X\rightharpoonupY]|=(|Y|+1)|X|,

because any partial function can be extended to a function by any fixed value

c

not contained in

Y,

so that the codomain is

Y\cup\{c\},

an operation which is injective (unique and invertible by restriction).

Discussion and examples

The first diagram at the top of the article represents a partial function that is 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.

Natural logarithm

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 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 function.

Subtraction of natural numbers

Subtraction of natural numbers (in which

N

is the non-negative integers) is a partial function:

f:\N x \N\rightharpoonup\N

f(x,y)=x-y.

It is defined only when

x\geqy.

Bottom element

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 a programming language where function parameters are statically typed, a function may be defined as a partial function because the language's type system cannot express the exact domain of the function, so the programmer instead gives it the smallest domain which is expressible as a type and contains the domain of definition of the function.

In category theory

In category theory, when considering the operation of morphism composition in concrete categories, the composition operation

\circ:\hom(C) x \hom(C)\to\hom(C)

is a function if and only if

\operatorname{ob}(C)

has one element. The reason for this is that two morphisms

f:X\toY

and

g:U\toV

can only be composed as

g\circf

if

Y=U,

that is, the codomain of

f

must equal the domain of

g.

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.[4] It is the prototypical inverse category.[5]

In abstract algebra

Partial algebra generalizes the notion of universal algebra to partial operations. An example would be a field, in which the multiplicative inversion is the only proper partial operation (because division by zero is not defined).[6]

The set of all partial functions (partial transformations) on a given base set,

X,

forms a regular semigroup called the semigroup of all partial transformations (or the partial transformation semigroup on

X

), typically denoted by

l{PT}X.

[7] [8] [9] The set of all partial bijections on

X

forms the symmetric inverse semigroup.[7] [8]

Charts and atlases for manifolds and fiber bundles

Charts in the atlases which specify the structure of manifolds and fiber bundles are partial functions. In the case of manifolds, the domain is the point set of the manifold. In the case of fiber bundles, the domain is the space of the fiber bundle. 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. The "patches" are the domains where the charts are defined.

References

Notes and References

  1. Book: Christopher Hollings. Mathematics across the Iron Curtain: A History of the Algebraic Theory of Semigroups. 2014. American Mathematical Society. 978-1-4704-1493-1. 251.
  2. Book: Jürgen Koslowski and Austin Melton. Categorical Perspectives. 2001. Springer Science & Business Media. 978-0-8176-4186-3. 10. Lutz Schröder. Categories: a free tour.
  3. Book: Neal Koblitz. B. Zilber. Yu. I. Manin. A Course in Mathematical Logic for Mathematicians. 2009. Springer Science & Business Media. 978-1-4419-0615-1. 290.
  4. Book: Francis Borceux. Handbook of Categorical Algebra: Volume 2, Categories and Structures. 1994. Cambridge University Press. 978-0-521-44179-7. 289.
  5. Book: Marco Grandis. Homological Algebra: The Interplay of Homology with Distributive Lattices and Orthodox Semigroups. 2012. World Scientific. 978-981-4407-06-9. 55.
  6. Book: Ivo G. Rosenberg . Gert Sabidussi. Algebras and Orders. 1993. Springer Science & Business Media. 978-0-7923-2143-9. Peter Burmeister. Partial algebras – an introductory survey.
  7. Book: Alfred Hoblitzelle Clifford. G. B. Preston. The Algebraic Theory of Semigroups. Volume II. 1967. American Mathematical Soc.. 978-0-8218-0272-4. xii.
  8. Book: Peter M. Higgins. Techniques of semigroup theory. 1992. Oxford University Press, Incorporated. 978-0-19-853577-5. 4.
  9. Book: Olexandr Ganyushkin. Volodymyr Mazorchuk. Classical Finite Transformation Semigroups: An Introduction. limited. 2008. Springer Science & Business Media. 978-1-84800-281-4. 16 and 24.