Partial function

Last updated

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

Contents

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 function. 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 from to is sometimes written as or 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 and any one has either:

For example, if is the square root function restricted to the integers

defined by:
if, and only if,

then is only defined if is a perfect square (that is, ). So but is undefined.

Basic concepts

An example of a partial function that is injective. Partial function.svg
An example of a partial function that is injective.
An example of a function that is not injective. Total function.svg
An example of a function that is not injective.

A partial function arises from the consideration of maps between two sets X and Y that may not be defined on the entire set X. A common example is the square root operation on the real numbers : because negative real numbers do not have real square roots, the operation can be viewed as a partial function from to The domain of definition of a partial function is the subset S of X on which the partial function is defined; in this case, the partial function may also be viewed as a function from S to Y. 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. For a computer-science example of the latter, see Halting problem .

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

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 where both and are subsets of some set [1]

Function spaces

For convenience, denote the set of all partial functions from a set to a set by This set is the union of the sets of functions defined on subsets of with same codomain :

the latter also written as In finite case, its cardinality is

because any partial function can be extended to a function by any fixed value not contained in so that the codomain is 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 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.

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 is the non-negative integers) is a partial function:

It is defined only when

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 is a function if and only if has one element. The reason for this is that two morphisms and can only be composed as if that is, the codomain of must equal the domain of

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, forms a regular semigroup called the semigroup of all partial transformations (or the partial transformation semigroup on ), typically denoted by [7] [8] [9] The set of all partial bijections on 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.

See also

Related Research Articles

In mathematics, a binary relation associates elements of one set, called the domain, with elements of another set, called the codomain. A binary relation over sets X and Y is a set of ordered pairs (x, y) consisting of elements x from X and y from Y. It is a generalization of the more widely understood idea of a unary function. It encodes the common concept of relation: an element x is related to an element y, if and only if the pair (x, y) belongs to the set of ordered pairs that defines the binary relation. A binary relation is the most studied special case n = 2 of an n-ary relation over sets X1, ..., Xn, which is a subset of the Cartesian product

<span class="mw-page-title-main">Bijection</span> One-to-one correspondence

A bijection, bijective function, or one-to-one correspondence between two mathematical sets is a function such that each element of the second set is mapped to from exactly one element of the first set. Equivalently, a bijection is a relation between two sets such that each element of either set is paired with exactly one element of the other set.

In mathematics, a binary function is a function that takes two inputs.

<span class="mw-page-title-main">Endomorphism</span> Self-self morphism

In mathematics, an endomorphism is a morphism from a mathematical object to itself. An endomorphism that is also an isomorphism is an automorphism. For example, an endomorphism of a vector space V is a linear map f: VV, and an endomorphism of a group G is a group homomorphism f: GG. In general, we can talk about endomorphisms in any category. In the category of sets, endomorphisms are functions from a set S to itself.

<span class="mw-page-title-main">Group homomorphism</span> Mathematical function between groups that preserves multiplication structure

In mathematics, given two groups, (G,∗) and (H, ·), a group homomorphism from (G,∗) to (H, ·) is a function h : GH such that for all u and v in G it holds that

In algebra, a homomorphism is a structure-preserving map between two algebraic structures of the same type. The word homomorphism comes from the Ancient Greek language: ὁμός meaning "same" and μορφή meaning "form" or "shape". However, the word was apparently introduced to mathematics due to a (mis)translation of German ähnlich meaning "similar" to ὁμός meaning "same". The term "homomorphism" appeared as early as 1892, when it was attributed to the German mathematician Felix Klein (1849–1925).

<span class="mw-page-title-main">Inverse function</span> Mathematical concept

In mathematics, the inverse function of a function f is a function that undoes the operation of f. The inverse of f exists if and only if f is bijective, and if it exists, is denoted by

In mathematics, a surjective function (also known as surjection, or onto function ) is a function f such that, for every element y of the function's codomain, there exists at least one element x in the function's domain such that f(x) = y. In other words, for a function f : XY, the codomain Y is the image of the function's domain X. It is not required that x be unique; the function f may map one or more elements of X to the same element of Y.

In mathematics, an injective function (also known as injection, or one-to-one function ) is a function f that maps distinct elements of its domain to distinct elements; that is, x1x2 implies f(x1) ≠ f(x2). (Equivalently, f(x1) = f(x2) implies x1 = x2 in the equivalent contrapositive statement.) In other words, every element of the function's codomain is the image of at most one element of its domain. The term one-to-one function must not be confused with one-to-one correspondence that refers to bijective functions, which are functions such that each element in the codomain is an image of exactly one element in the domain.

In mathematics, the concept of an inverse element generalises the concepts of opposite and reciprocal of numbers.

<span class="mw-page-title-main">Domain of a function</span> Mathematical concept

In mathematics, the domain of a function is the set of inputs accepted by the function. It is sometimes denoted by or , where f is the function. In layman's terms, the domain of a function can generally be thought of as "what x can be".

<span class="mw-page-title-main">Codomain</span> Target set of a mathematical function

In mathematics, a codomain or set of destination of a function is a set into which all of the output of the function is constrained to fall. It is the set Y in the notation f: XY. The term range is sometimes ambiguously used to refer to either the codomain or the image of a function.

In category theory, an epimorphism is a morphism f : XY that is right-cancellative in the sense that, for all objects Z and all morphisms g1, g2: YZ,

In mathematics, a function from a set X to a set Y assigns to each element of X exactly one element of Y. The set X is called the domain of the function and the set Y is called the codomain of the function.

<span class="mw-page-title-main">Range of a function</span> Subset of a functions codomain

In mathematics, the range of a function may refer to either of two closely related concepts:

In mathematics, a function space is a set of functions between two fixed sets. Often, the domain and/or codomain will have additional structure which is inherited by the function space. For example, the set of functions from any set X into a vector space has a natural vector space structure given by pointwise addition and scalar multiplication. In other scenarios, the function space might inherit a topological or metric structure, hence the name function space.

In category theory, a faithful functor is a functor that is injective on hom-sets, and a full functor is surjective on hom-sets. A functor that has both properties is called a fully faithful functor.

In mathematical analysis, and applications in geometry, applied mathematics, engineering, and natural sciences, a function of a real variable is a function whose domain is the real numbers , or a subset of that contains an interval of positive length. Most real functions that are considered and studied are differentiable in some interval. The most widely considered such functions are the real functions, which are the real-valued functions of a real variable, that is, the functions of a real variable whose codomain is the set of real numbers.

<span class="mw-page-title-main">Bijection, injection and surjection</span> Properties of mathematical functions

In mathematics, injections, surjections, and bijections are classes of functions distinguished by the manner in which arguments and images are related or mapped to each other.

References

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