Talk:Function (mathematics)

message: The concept of a function or a mapping has been described (Herstein, page 9) as "probably the single most important and universal notion that runs through all of mathematics". Evidently this also pertains to all other branches of science (physics, engineering etc.) where mathematics is used. 
In present-day mathematics, there are essentially two major variants of the function concept, and in a balanced account both must be addressed. For this purpose, we designate them as (A) the plain variant and (B) the labeled variant, which has a codomain. The subject matter also requires ample references, also because different formulations often define the same variant, thereby clarifying each other.  About a dozen paragraphs suffice for giving the reader a structured guide through the rather varied literature.
==== A. Functions: the plain variant ====
This variant is the simplest and also the most widespread throughout the sciences, including (but not limited to) calculus/analysis,
set theory,
logic,
algebra,
discrete mathematics,
computer science,
and mathematical physics.  Authors and specific page numbers will be mentioned later.
A.1 Basic definition 
One of the simplest formulations is provided by Apostol (p.53):
In general, a collection of ordered pairs is called a graph or a relation and is called functional or determinate if no two pairs have the same first member (or component). Thus the preceding definition can be rephrased by saying that a function is a functional graph ((Bourbaki p. 77). Formulations that are equivalent in content and style appear in calculus/analysis (Apostol p. 53, Flett, p. 4), set theory (Bourbaki p. 77, Dasgupta p. 8, Quine p. 21,  Suppes p. 57, Tarski & Givant p. 3), logic (Mendelson p. 6, Tarski p. 98), discrete mathematics (Scheinerman p. 73), computer science ((Meyer p. 25, Reynolds p. 452).  The wordings differ but all define the same concept, apart from the fact that some authors apply them to classes instead of mere sets.
A.2 Conventions The set of all first members of the ordered pairs in a graph (or relation) G is called the domain of G and is written \mathrm{dom}\,G or \mathcal{D}\,G. The set of all second members is called the range of G and is written \mathrm{ran}\,G or \mathcal{R}\,G. Let f be a function (functional graph). For each x in the domain of f there is exactly one y such that (x, y) \in f. Hence y is uniquely determined by f and x. It is therefore properly called the value of f at x and can be unambiguously denoted by some suitable combination of f and x, the common "default" form being f\,x or f(x). Other forms may be chosen as convenient by prior agreement, such as f_x or x^f . A common example of the latter is writing M^{\mathsf T} for matrix transposition.
A.3 The function equality theorem (Apostol p. 54) Functions f and g are equal (f = g) if and only if (a) f and g have the same domain and (b) f(x) = g(x) for every x in this domain. This theorem follows directly from set equality and holds for all formulations (preceding and following) of the definition of plain functions. It implies that a (plain) function f is fully specified by its domain and the value f(x) for each x in that domain. An illustration follows next.
A.4 Function composition  This is the most important operation on functions. For any (plain) functions f and g, the composition g \circ f  (also written f\,;g) is also a function, specified as follows: (a) the domain of g \circ f is the set of all values x in the domain of f such that f(x) is in the domain of g and (b) for any such x, the value of (g \circ f)(x) is given by (g \circ f)(x) = g(f(x)) or, written with less clutter, (g \circ f) x = g(f\,x) (see Apostol p. 140, Flett p. 11, Suppes p. 87, Tarski & Givant p. 3, Mendelson p. 7, Meyer p. 32, Reynolds p. 450,452).  Composition has the interesting property that, for all functions f, g and h, we have h \circ (g \circ f) = (h \circ g) \circ f. This associativity allows making the parentheses optional and writing, for instance, h \circ g \circ f = f\,;g\,;h.
A.5 Conveying domain and range information The literature presents numerous conventions for relating the domain and/or range of a (plain) function f to sets X and Y. A helpful preamble is the following legend.
statement                   	meaning
f is a partial function on X	\mathrm{dom}\,f \subseteq X
f is a (total) function on X	\mathrm{dom}\,f = X
 
statement    	meaning
f is (in)to Y	\mathrm{ran}\,f \subseteq Y
f is onto Y  	\mathrm{ran}\,f = Y
For instance (Apostol p. 578, Flett p. 5, Dasgupta  p. 10, Scheinerman p. 169, Meyer p. 26, Reynolds p. 458): 
Flett (p. 5) warns that such phrases only conveys information about the domain and the range but does not define a new kind of function. A function from X to Y is commonly introduced by writing f : X \rightarrow Y, where X \rightarrow Y can be interpreted as the set of all (total) functions from X (in)to Y (Meyer p. 26, Reynolds p. 458), in other contexts also written Y^X.  As a logical consequence, f : X \rightarrow Y  stipulates that (a) the domain of f is X and (b) the values f(x) are in Y and can be further specified, for instance, by a formula.  This style is very convenient, as illustrated by the following function specifications
By definition, both specify the same function (\mathsf{sqra} = \mathsf{sqrb}) which is onto \mathbb R_{\geq 0} but not onto \mathbb R.
Consider also
Here \mathsf{posrt} and \mathsf{negrt} are respectively the positive and negative square root function. Both are functions from \mathbb R_{\geq 0} to \mathbb R but \mathsf{posrt} is onto \mathbb R_{\geq 0} whereas \mathsf{negrt} is onto \mathbb R_{\leq 0}.
  
Similarly, a partial function from X to Y is a function with domain included in X and range included in Y. For instance, in calculus/analysis most functions are defined on some subset (interval, region, ...) of \mathbb R, \mathbb R^n, \mathbb C, \mathbb C^n and so on hence are partial on these sets. For the set of partial functions from X (in)to Y one finds various notations, such as X \not\rightarrow Y (Meyer p. 26) and X\;\stackrel{\longrightarrow}{\scriptscriptstyle\mathrm{PFUN}}\;Y (Reynolds p. 458).
As a very interesting illustration, the reader can verify that, given f : X \rightarrow Y and g : U \rightarrow V, the composition g \circ f is a partial function from X to V and that g \circ f is a total function from X to V iff \mathrm{ran}\,f \subseteq \mathrm{dom}\,g, which trivially holds in case Y = U. 
Important remark: as in natural language, onto is used as a preposition, mentioning Y explicitly (Flett p. 5, Scheinerman p. 172; more references follow in the next paragraph). A function that is onto Y is sometimes called surjective on Y or a surjection on Y.  Scheinerman (p, 172) designates omitting Y as "mathspeak", but it is not harmless and may cause misunderstandings.  
A.6 A shortcut formulation for a function from X to Y  Quite a few authors (Bartle & Sherbert p. 5, Royden p. 8,  Halmos p. 30,
Herstein p. 10, Gerstein p. 110,  Gries & Schneider p. 280, Szekeres p. 10) do not start from the basic definition given earlier but directly define a function f from X (in)to Y as a subset of X \times Y such that for every x in X there is exactly one y in Y such that (x, y) \in f. Less often, some authors (Bartle p. 13, Gries and Schneider p. 280) use a formulation that amounts to replacing "exactly one" by "at most one", which effectively defines a partial function from X to Y.
Important remark: appearances notwithstanding, this shortcut formulation logically defines exactly the same kind of function as the basic definition with exactly the same properties and conventions. In particular:,
* The function equality theorem holds as stated (only mentioned explicitly by Gerstein p. 113).
* Composition g \circ f is defined for any functions f, g, although some authors overlook this and define g \circ f only for  f : X \rightarrow Y and  g : Y \rightarrow Z, which reduces generality by assuming \mathrm{ran}\,f \subseteq \mathrm{dom}\,g.
* Any function f is a function from its domain to any superset of its range. Hence the versatile specification style illustrated by the examples \mathsf{sqra}, \mathsf{sqrb}, \mathsf{posrt}, \mathsf{negrt} remains applicable.
* As before, onto-ness is specified with respect to a set, using "onto" as a preposition (Bartle p. 13, Bartle & Sherbert p.7, Royden p. 8,  Halmos p. 31, Herstein p. 12, Gerstein p. 118, Szekeres p. 11).
A.7 Separating the plain function concept from its graph Whereas defining a function as a graph is very precise and rigorous, it creates some ambiguities for certain common conventions. Just two examples: (i) writing f^n for n-fold function composition and S^n for the n-fold Cartesian product, and (ii) defining sequences (in particular pairs) as functions on some subset of the natural numbers. Some definitions (Carlson p. 182, Kolmogorov & Fomin p. 5, Rudin p. 21) avoid this by defining a function f from X to Y less formally as associating "in some manner" a unique value f(x) in Y with every value x in X, called the domain of f.  This can be captured as follows:
As noted by Royden (footnote p. 8) this formulation can be made precise by taking the statement of the function equality theorem (A.3) as an axiom. The range of f is then the set of all values f(x) for x in the domain of f.
All earlier auxiliary formulations carry through literally as stated, namely, fully general composition (A.4) and conveying domain/range information (A5).  The graph of f is then the set of all pairs (x, f x) for x in the domain of f and is denoted by \mathcal G\,f. Evidently f = g if and only if \mathcal G\,f = \mathcal G\,g. This may be useful in simplifying certain proofs and definitions (e.g., for inverses).
==== B. Functions: the labeled variant and the notion of codomain====
Recall that, for plain functions, the appearance of Y in  f : X \rightarrow Y specifies that f(x) \in Y, without making Y an attribute of f (in contrast X, which is specified to be the domain). How to exploit this flexibility in function specifications was demonstrated by the examples  \mathsf{sqra}, \mathsf{sqrb}, \mathsf{posrt}, \mathsf{negrt}.
Dasgupta (p. 10) points out that making Y an attribute of f in a proper fashion requires explicitly attaching Y to f to form a triplet \langle f, X, Y \rangle.  Mac Lane (p. 27) calls this modification labelling. In general,
The set X is called the source of F and Y is called the target of F or the codomain of F. The domain and the range of F are those of f. Similar formulations, sometimes identifying domain and source, are given by  Bourbaki p. 76, Adámek & al. footnote p. 14, Bird & De Moor p. 26, Pierce p. 2. Some of the major differences with the plain varianr are:
* Equality of labeled functions requires equality for source, domain, codomain and images.
* For a labeled function F := \langle f, X, Y \rangle, the following terminology holds: (i) F is partial means that \mathrm{dom}\,f \subseteq X, (ii) F is total means that \mathrm{dom}\,f = X, and (iii)  or F is surjective means that \mathrm{ran}\,f = Y.
* Composition G \circ F is defined only in case \mathrm{cod}\,F = \mathrm{src}\,G. In case G is total this means that \mathrm{cod}\,F = \mathrm{dom}\,G, which is quite restrictive when compared to the plain variant.
==== References ====
Last updated: Boute (talk) 13:18, 15 February 2022 (UTC)
thread_title:  Outline for the article (text starts here) 

message: Last updated: Boute (talk) 13:18, 15 February 2022 (UTC)
thread_title:  References 

message: While many authors ostensibly use the "labeled" definition (in which the codomain Y is part of the function), I have observed that they are often inconsistent in their use of it.  Is the codomain of the sine function the reals, or just the interval [-1_+1]?  In the "labeled" view, either sin:\mathbb{R}\rightarrow \mathbb{R} or sin:\mathbb{R}\rightarrow [-1 \_ +1], not both.As for surjective, in the "plain" definition one defines "f is surjective on a set Y"; which is more conveniently stated as "\mathop{\mathrm{Img}}(f) = Y, where \mathop{\mathrm{Img}}(f) is the image of f (which is uniquely defined by the set of pairs).--Jorge Stolfi (talk) 19:07, 15 November 2023 (UTC)
replies: text: As I wrote in more detail on my talk page: Stolfi's attempts to install one specific definition from advanced mathematics into the lead of an article whose topic is already the subject of middle-school mathematics (in the form of graphing real functions) is a violation of WP:TECHNICAL and a way to make our articles unreadable and offputting (see recent WT:WPM thread on accessibility of mathematics articles). It is also a violation of WP:NPOV in favoring one specific definition as the only definition when there are multiple definitions possible and in use. —David Eppstein (talk) 21:15, 15 November 2023 (UTC)
replies: text: Having restored the posts doesn't mean I'd agree with Stolfi. Having read the discussion at User_talk:David_Eppstein#Function_(mathematics), I'd just like to add that the 1st lead sentence is not just some "interesting property", but a pretty precise informal definition. - Jochen Burghardt (talk) 21:30, 15 November 2023 (UTC)
replies: text: Thanks Jurgen for recovering my posts. While I don't have the energy to fight any more, let me refer to my comment on David's Talk page about the supposed precision of the word  "associate".  And then add this: Wikipedia is meant to be an encyclopedia, that is, a reference book -- not a textbook, or popularization book.  Making people like mathematics (or any other science) is not one of its goals.  Yes, articles should be written so as to be useful to the widest possible readership, which means they must avoid unnecessary jargon and technical concepts -- but they should be written for those readers who come here to find out what a word like "function" precisely means. Hardly anyone will come to this article looking for an "informal definition": they already have that, thank you...All the best, --Jorge Stolfi (talk) 16:11, 18 November 2023 (UTC)
replies: text: @Jorge Stolfi I recently made a change in the formal definition (HERE, application and discussion here) which was rejected. The new definition (triplet) I proposed was introduced in such a way that the old definition (binary relation) was placed in the "reduced formal definition" section, where it is mentioned in the introduction (along with citing) that both definitions are commonly used. What do you think about this change - do you think it is an improvement to the article and could be reinstated? Kamil Kielczewski (talk) 20:54, 12 March 2024 (UTC)
replies: text: Several years ago I tried to edit the definition in this article, but all I achieved into a three-page discussion in this Talk page with an editor who insisted that the word "set" should be avoided because it reminds readers of high-school math which drives them away. I gave up when a third editor joined the discussion, arguing that it should be defined using category theory.Then I swore I would never again try to edit a math article here in Wikipedia.I should have stood by that oath.</br>All the best, Jorge Stolfi (talk) 10:03, 18 March 2024 (UTC)

text: Speaking of which, I find it somewhat curious that there is no mention in this article of type theory and the way that functions are formalized in type theory. —David Eppstein (talk) 21:22, 15 November 2023 (UTC)
thread_title:  Definition issues 

message: The section Partial Functions which has no source, contains this paragraph:
:"Similarly, a function of a complex variable is generally a partial function with a domain of definition included in the set \Complex of the complex numbers. The difficulty of determining the domain of definition of a complex function  is illustrated by the multiplicative inverse of the Gamma function: the determination of the domain of definition of the function z\mapsto 1/\Gamma(z) is equivalent to the proof or disproof of one of the major open problems in mathematics, the Riemann hypothesis."
#I think that it means the Riemann zeta function, instead of the Gamma Function.
#Also the meaning of the phrase : "the determination of the domain of definition" of the function z\mapsto 1/\zeta(z) is not clear to me and also then meaning of "equivalent to the proof or disproof of" the Riemann hypothesis. For example, does it mean that if we prove that the R.H. is false (by giving a counterexample), then  we can (or cannot) "determine" the domain of definition of the function z\mapsto 1/\zeta(z)"?
--Cbigorgne (talk) 17:38, 13 March 2024 (UTC)
replies: text: Thank you for pointing this. I'll fix this. for the second point, I'll simply replace "equivalent" with "more or less equivalent". I think that it is a good way for making clear without entering in technical details that it not a true equivalence. D.Lazard (talk) 19:19, 13 March 2024 (UTC)
thread_title:  Riemann Hypothesis and partial functions 

message: The redirect Overriding (mathematics) has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at  until a consensus is reached.  Tea2min (talk) 11:59, 26 April 2024 (UTC)
thread_title:  "[[:Overriding (mathematics)]]" listed at [[Wikipedia:Redirects for discussion|Redirects for discussion]] 

message: The function as relation or mapping in the single and multiple-valued and in classical functions, continuous functions, smooth functions, and about the language of functions, and domains and ranges and images and codomains, is very overloaded.  This article is picking a course of opinion which does not represent its wide and varied usage, function the term.  Over time, as other aspects of mathematics solidified, it's "function" the term that is most loosely thrown about, then as with regards to relations that are admitted to various sub-fields, each claiming their own definition of function has those are each distinct and different ant not compatible.  This article, which could be called "mappings" instead as that's largely what it defines, does not from the outset affect to describe the development of the definition over time, nor does it very well reflect the most usual sort of arithmetic definition with which most people are familiar, or as with regards to domain and range.  Mathematics is not merely differential geometry, and the definition of function is among the very most general and general throughout.  So, this article should largely start explaining that "function theory" is its own sort of world, and a history and survey of "this is what is called a function historically or in these various settings", then with regards to an opinion of "this is a function today and in the most usual setting", which it is largely arguable that this article does not reflect, instead expect.
It reminds one of "graph", "chart", and "plot", about diagrams of functions, drawing a function.
Functions are modern, and Cartesian thus including the multi-valued, and not just classical functions, smooth classical continuous functions that are single-valued, and not just differential geometry's functions with neither vertical nor horizontal tangent, "functions" in mathematics are very general, and sub-fields that restrict the definition for their own purpose are presumptious that their definition is implicit, where it is not.
This article is opinionated and needs context in itself why the definition of function is so broad that it's about its own sub-field of mathematics, in matters of relation.
This article needs a brief survey of the development of the term over time, and to point to the many different intended interpretations of the term.
This article needs a thorough introduction detailing the survey of the meaning of the term "function" over time as mathematics has grown, and, specifically not removing what has become its fuller definition, in the interest of su-fields that would restrict its meaning for their own purposes in notation, where instead they should declare their own regions of syntax, because general usage does not agree.
This article has problems and hides them. 97.113.179.80 (talk) 15:03, 19 May 2024 (UTC)
replies: text: Are you volunteering to track down a pile of sources and write that draft? –jacobolus (t) 21:01, 19 May 2024 (UTC)
replies: text: Keeping in mind the goal of simultaneously being readable to middle-schoolers and providing pointers to current research-level mathematics... —David Eppstein (talk) 21:03, 19 May 2024 (UTC)
thread_title:  Function is Overloaded in definition and meaning, this article should be a survey