Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Partial function
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{distinguish|text=the [[partial application]] of a function of several variables, by fixing some of them}} {{short description|Function whose actual domain of definition may be smaller than its apparent domain}} {{more footnotes|date=August 2014}} In [[mathematics]], a '''partial function''' {{mvar|f}} from a [[Set (mathematics)|set]] {{mvar|X}} to a set {{mvar|Y}} is a [[function (mathematics)|function]] from a [[subset]] {{mvar|S}} of {{mvar|X}} (possibly the whole {{mvar|X}} itself) to {{mvar|Y}}. The subset {{mvar|S}}, that is, the ''[[Domain of a function|domain]]'' of {{mvar|f}} viewed as a function, is called the '''domain of definition''' or '''natural domain''' of {{mvar|f}}. If {{mvar|S}} equals {{mvar|X}}, that is, if {{mvar|f}} is defined on every element in {{mvar|X}}, then {{mvar|f}} is said to be a '''total function'''. In other words, a partial function is a [[binary relation]] over two [[Set (mathematics)|sets]] that associates to every element of the first set ''at most'' one element of the second set; it is thus a [[univalent relation]]. This generalizes the concept of a (total) [[Function (mathematics)|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 is difficult to specify. However, even when the exact domain of definition is known, partial functions are often used for simplicity or brevity. 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 [[Zero of a function|zeros]] of the denominator; in this context, a partial function is generally simply called a {{em|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 [[Function (mathematics)#Arrow notation|arrow notation]] is used for functions, a partial function <math>f</math> from <math>X</math> to <math>Y</math> is sometimes written as <math>f : X \rightharpoonup Y,</math> <math>f : X \nrightarrow Y,</math> or <math>f : X \hookrightarrow Y.</math> However, there is no general convention, and the latter notation is more commonly used for [[inclusion map]]s or [[embedding]]s.{{citation needed|reason=Provide a few example citations for each notation.|date=July 2019}} Specifically, for a partial function <math>f : X \rightharpoonup Y,</math> and any <math>x \in X,</math> one has either: * <math>f(x) = y \in Y</math> (it is a single element in {{mvar|Y}}), or * <math>f(x)</math> is undefined. For example, if <math>f</math> is the [[square root]] function restricted to the [[integer]]s : <math>f : \Z \to \N,</math> defined by: : <math>f(n) = m</math> if, and only if, <math>m^2 = n,</math> <math>m \in \N, n \in \Z,</math> then <math>f(n)</math> is only defined if <math>n</math> is a [[Square number|perfect square]] (that is, <math>0, 1, 4, 9, 16, \ldots</math>). So <math>f(25) = 5</math> but <math>f(26)</math> is undefined. == Basic concepts == {| align="right" |- |[[Image:Partial function.svg|thumb|200px|An example of a partial function that is [[injective]].]] |- |[[Image:Total function.svg|thumb|200px|An example of a [[#Function|function]] that is not injective.]] |} A partial function arises from the consideration of maps between two sets {{mvar|X}} and {{mvar|Y}} that may not be defined on the entire set {{mvar|X}}. A common example is the square root operation on the real numbers <math>\mathbb{R}</math>: because negative real numbers do not have real square roots, the operation can be viewed as a partial function from <math>\mathbb{R}</math> to <math>\mathbb{R}.</math> The ''domain of definition'' of a partial function is the subset {{mvar|S}} of {{mvar|X}} on which the partial function is defined; in this case, the partial function may also be viewed as a function from {{mvar|S}} to {{mvar|Y}}. In the example of the square root operation, the set {{mvar|S}} consists of the nonnegative real numbers <math>[0, +\infty).</math> 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 {{mvar|S}} is equal to the whole set {{mvar|X}}, the partial function is said to be ''total''. Thus, total partial functions from {{mvar|X}} to {{mvar|Y}} coincide with functions from {{mvar|X}} to {{mvar|Y}}. Many properties of functions can be extended in an appropriate sense of partial functions. A partial function is said to be [[Injective function|injective]], [[Surjective function|surjective]], or [[Bijection|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.<ref name="Hollings2014-251">{{cite book|author=Christopher Hollings|title=Mathematics across the Iron Curtain: A History of the Algebraic Theory of Semigroups|url=https://books.google.com/books?id=O9wJBAAAQBAJ&pg=PA251|year=2014|publisher=American Mathematical Society|isbn=978-1-4704-1493-1|page=251}}</ref> 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 (function)|transformation]] can be generalized to partial functions as well. A '''partial transformation''' is a function <math>f : A \rightharpoonup B,</math> where both <math>A</math> and <math>B</math> are [[subset]]s of some set <math>X.</math><ref name="Hollings2014-251"/> == Function spaces == For convenience, denote the set of all partial functions <math>f : X \rightharpoonup Y</math> from a set <math>X</math> to a set <math>Y</math> by <math>[X \rightharpoonup Y].</math> This set is the union of the sets of functions defined on subsets of <math>X</math> with same codomain <math>Y</math>: : <math>[X \rightharpoonup Y] = \bigcup_{D \subseteq X} [D \to Y],</math> the latter also written as <math display="inline">\bigcup_{D\subseteq{X}} Y^D.</math> In finite case, its cardinality is : <math>|[X \rightharpoonup Y]| = (|Y| + 1)^{|X|},</math> because any partial function can be extended to a function by any fixed value <math>c</math> not contained in <math>Y,</math> so that the codomain is <math>Y \cup \{ c \},</math> 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 {{em|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 number]]s 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 <math>\mathbb{N}</math> is the non-negative [[integers]]) is a partial function: : <math>f : \N \times \N \rightharpoonup \N</math> : <math>f(x,y) = x - y.</math> It is defined only when <math>x \geq y.</math> === 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 <math>\circ \;:\; \hom(C) \times \hom(C) \to \hom(C)</math> is a total function if and only if <math>\operatorname{ob}(C)</math> has one element. The reason for this is that two morphisms <math>f : X \to Y</math> and <math>g : U \to V</math> can only be composed as <math>g \circ f</math> if <math>Y = U,</math> that is, the codomain of <math>f</math> must equal the domain of <math>g.</math> The category of sets and partial functions is [[Equivalence of categories|equivalent]] to but not [[Isomorphism of categories|isomorphic]] with the category of [[pointed set]]s and point-preserving maps.<ref name="KoslowskiMelton2001">{{cite book|editor=Jürgen Koslowski and Austin Melton|title=Categorical Perspectives|year=2001|publisher=Springer Science & Business Media|isbn=978-0-8176-4186-3|page=10|author=Lutz Schröder|chapter=Categories: a free tour}}</ref> 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]]."<ref name="KoblitzZilber2009">{{cite book|author1=Neal Koblitz|author2=B. Zilber|author3=Yu. I. Manin|title=A Course in Mathematical Logic for Mathematicians|year=2009|publisher=Springer Science & Business Media|isbn=978-1-4419-0615-1|page=290}}</ref> The category of sets and partial bijections is equivalent to its [[Opposite category|dual]].<ref name="Borceux1994">{{cite book|author=Francis Borceux|title=Handbook of Categorical Algebra: Volume 2, Categories and Structures|url=https://books.google.com/books?id=5i2v9q0m5XAC&pg=PA289|year=1994|publisher=Cambridge University Press|isbn=978-0-521-44179-7|page=289}}</ref> It is the prototypical [[inverse category]].<ref name="Grandis2012">{{cite book|author=Marco Grandis|title=Homological Algebra: The Interplay of Homology with Distributive Lattices and Orthodox Semigroups|url=https://books.google.com/books?id=TWqhelao4KsC&pg=PA55|year=2012|publisher=World Scientific|isbn=978-981-4407-06-9|page=55}}</ref> === In abstract algebra === [[Partial algebra]] generalizes the notion of [[universal algebra]] to partial [[Operation (mathematics)|operations]]. An example would be a [[Field (mathematics)|field]], in which the multiplicative inversion is the only proper partial operation (because [[division by zero]] is not defined).<ref name="RosenbergSabidussi1993">{{cite book|editor1=Ivo G. Rosenberg |editor2=Gert Sabidussi|title=Algebras and Orders|year=1993|publisher=Springer Science & Business Media|isbn=978-0-7923-2143-9|author=Peter Burmeister|chapter=Partial algebras – an introductory survey}}</ref> The set of all partial functions (partial [[Transformation (function)|transformation]]s) on a given base set, <math>X,</math> forms a [[regular semigroup]] called the semigroup of all partial transformations (or the partial transformation semigroup on <math>X</math>), typically denoted by <math>\mathcal{PT}_X.</math><ref name="CliffordPreston1967">{{cite book|author1=Alfred Hoblitzelle Clifford|author2=G. B. Preston|title=The Algebraic Theory of Semigroups. Volume II|url=https://books.google.com/books?id=756KAwAAQBAJ&pg=PR12|year=1967|publisher=American Mathematical Soc.|isbn=978-0-8218-0272-4|page=xii}}</ref><ref name="Higgins1992">{{cite book|author=Peter M. Higgins|title=Techniques of semigroup theory|year=1992|publisher=Oxford University Press, Incorporated|isbn=978-0-19-853577-5|page=4}}</ref><ref name="GanyushkinMazorchuk2008">{{cite book|author1=Olexandr Ganyushkin|author2=Volodymyr Mazorchuk|title=Classical Finite Transformation Semigroups: An Introduction|url=https://archive.org/details/classicalfinitet00gany_719|url-access=limited|year=2008|publisher=Springer Science & Business Media|isbn=978-1-84800-281-4|pages=[https://archive.org/details/classicalfinitet00gany_719/page/n26 16] and 24}}</ref> The set of all partial bijections on <math>X</math> forms the [[symmetric inverse semigroup]].<ref name="CliffordPreston1967"/><ref name="Higgins1992"/> === Charts and atlases for manifolds and fiber bundles === Charts in the [[Atlas (topology)|atlases]] which specify the structure of [[manifold]]s and [[fiber bundle]]s 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 [[Atlas (topology)#Transition maps|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 == * {{annotated link|Analytic continuation}} * {{annotated link|Multivalued function}} * {{annotated link|Densely defined operator}} == References == * [[Martin Davis (mathematician)|Martin Davis]] (1958), ''Computability and Unsolvability'', McGraw–Hill Book Company, Inc, New York. Republished by Dover in 1982. {{isbn|0-486-61471-9}}. * [[Stephen Kleene]] (1952), ''Introduction to Meta-Mathematics'', North-Holland Publishing Company, Amsterdam, Netherlands, 10th printing with corrections added on 7th printing (1974). {{isbn|0-7204-2103-9}}. * [[Harold S. Stone]] (1972), ''Introduction to Computer Organization and Data Structures'', McGraw–Hill Book Company, New York. === Notes === {{reflist|group=note}} {{reflist}} {{Functions navbox}} [[Category:Mathematical relations]] [[Category:Functions and mappings]] [[Category:Properties of binary relations]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Annotated link
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Distinguish
(
edit
)
Template:Em
(
edit
)
Template:Functions navbox
(
edit
)
Template:Isbn
(
edit
)
Template:More footnotes
(
edit
)
Template:Mvar
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)