# Talk:Function (mathematics)

WikiProject Mathematics (Rated B+ class, Top-importance)
This article is within the scope of WikiProject Mathematics, a collaborative effort to improve the coverage of Mathematics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Mathematics rating:
 B+ Class
 Top Importance
Field: Basics
A vital article.
One of the 500 most frequently viewed mathematics articles.
Wikipedia Version 1.0 Editorial Team / Vital

## A Modest Proposal

It is clear that after much good work by many people there is no longer a bull goose mathematician capable of settling the question of codomains -- the age when Hilbert said it, I believe it, and that settles it is long past. (The same is true of rings.)

I suggest: the article begin with a definiton for the non-specialist. A function assigns to any given input a unique output. We then need some examples. Later in the article, below the ToC, we need a statement that different authors use different definitions, and a clear statement of the three primary points of view: 1: a function is a set of ordered pairs, 2: a function is an ordered triple: domain, codomain, set of ordered pairs, 3: (the naive definition) a function is a rule.

I really do think that we can discuss this until the cows come home and not arrive at a single definition of "function".

Rick Norwood (talk) 17:29, 9 June 2013 (UTC)

I think the article does start off in a reasonably non-specialist way and it most deals with the case where the differences don't matter much, i.e. where X and Y are specified. I'm not too keen on confusing people by having say exp(x) be the same function whether we're talking about reals or complex numbers and I'm pretty certain students in the future will often have some exposure to computer languages which not only distinguish the two but have explicitly given possible inputs and outputs. The article used to be more up front about the two main variants where one said function without specifying X and Y and discussed them in parallel, but it was changed to the current form with a main and alternate view after having people come along arguing that one side or the other was the greatest most wonderful way and one side basically ran over the other - in fact I believe that argument was initiated by people arguing that not having a codomain was the main way so it kind of backfired on them. Dmcq (talk) 18:14, 9 June 2013 (UTC)
I agree with the proposal. Also, any explanation saying that exp(x) is the same function whether we're talking about reals or complex numbers would indeed be very confusing, but (fortunately) thus far no one has proposed such a thing. However, continuous personal remarks intending wanton misrepresentation are harmful to the final quality of the article. Indeed, in the preceding observations, I often unambiguously endorsed representing both views. Far from "running over" something, I even showed how to make the codomain-based view consistent (using pairs or triples), altbeit properly balanced with factual mathematical properties (no hyperboles!) indicating that choices do matter.
Unfortunately, the current Wikipedia article is very problematic. On one hand, the stated definition is indeed the simplest and most frequently used in modern texts, namely as a functional set of pairs, as in Bourbaki (B1) (no "extra's", as in the triple of B0). On the other hand, the same article without blinking talks about codomains as an attribute of such a function. This is inconsistent and, if diehards persist in denial, will backfire on the entire article.
Since apparently symbolic arguments are basically run over or simply not understood, I make a final attempt by providing an example and then stop wasting my time (ironic cheers predictable). The example comes literally from Hammack, chosen because it is freely available to everyone [Hammack, Book Of Proof], Example 12.2 page 196.
(Begin quote) Let $A = \{p, q, r, s\}$ and $B = \{0, 1, 2\}$ and
$f = \{(p, 0), (q, 1), (r,2), (s,2)\} \subseteq A \times B$
This is a function $f : A \rightarrow B$ because each element of $A$ occurs exactly once as the first coordinate of an ordered pair in $f$ (End quote)
By definition 12.2 that precedes this example on the same page, $B$ is the codomain. However, letting $C = \{0, 1, 2, 3\}$, we also have $f = \{(p, 0), (q, 1), (r,2), (s,2)\} \subseteq A \times C$ and hence $f : A \rightarrow C$, so $C$ is the codomain. Since $C \neq B$, this is a contradiction.
Comparing the definitions shows that this is exactly the same situation as in the Wikipedia article. I rest my case. Boute (talk) 20:39, 9 June 2013 (UTC)
You stuck in f both times but that doesn't mean the two f's are the same. One f is a function from A to B, the other is a function from A to C.It is like in the real or complex number case saying that 1.0 is a real or 1.0 is a complex number. They may look the same but they're different. Of course that's working from the opposite viewpoint to you, you are right from your own viewpoint. Dmcq (talk) 21:33, 9 June 2013 (UTC)
In both cases, the function is simply the set $\{(p, 0), (q, 1), (r,2), (s,2)\}$, irrespective of the name. You can even rephrase the argument without the name, just in terms of this set. If you want to enforce a difference under Hammock's Definition 12.1, you have to use tagged sets or a similar device (as in the disjount union of a set with itself - see Meyer, Introduction to the Theory of Programmig Languages, 1990). In most of mathematics and engineering, enforcing a difference is restrictive. In programming, you can do it in the manner just explained when you need it. This is the advantage of not irrevocably building the difference into the definition from the start. Boute (talk) 05:26, 10 June 2013 (UTC)
You are still in the mode of trying to persuade us that one definition is better than the other. This is the wrong approach. You should be trying to persuade us that one definition is *more accepted* than the other. Or at least, that the level of coverage of one approach in our article is out of proportion to its level of acceptance in the literature. —David Eppstein (talk) 05:56, 10 June 2013 (UTC)
Don't patronize. I'm not trying to persuade anyone; people can only persuade themselves by careful thought about arguments given. I don't even believe that "the level of coverage of one approach in our article is out of proportion to its level of acceptance in the literature". To the contrary, I repeatedly emphasized that the current definition of a function in the article is, and even by far, the most accepted one, as I carefully checked. At worst, the coverage of codomains might be out of proportion, but judging that requires statistics that are not available.
So please stop wasting time and concentrate on the essence of the arguments I gave, which concerns the remaining inconsistencies in the current article. Try to get it right; it's easy for any mathematician used to formal reasoning. Boute (talk) 07:18, 10 June 2013 (UTC)
Afterthought: I consider it only polite to keep responding to remarks addressed directly or indirectly at me, but would prefer devoting my time to other things and see how the article stands in, say, a few months. Boute (talk) 07:29, 10 June 2013 (UTC)
The two functions are only the same because of your definition of a function. Most of the article talks about a function from X to Y rather than a function all on its own and does not try comparing it to some other function from A to B. It is only in the alternatives section it talks about functions without such a qualification. If a function from X to Y is considered as typed then its value can be given by a set of ordered pairs, that does not mean it is the same as some other type of function. It is only if you start with the assumption that it is completely defined by the set and the qualification is irrelevant that of course the qualification is irrelevant because we're assuming functions are untyped. To go back to your considering they are the same from the value without considering the type consider
2 in a representation of numbers using set theory may have the value 2={{}, {{}}}
When talking about ordered pairs a way of representing ordered pairs a short way is (a,b)={a,{a,b}}, this means for instance that (0,0)={{},{{}}}. And in a representation of the integers by the equivalence class of a-b that is 0.
However we do not conclude that 2=(0,0)=0 because the set represents different things each time. It is typed.
To fully specify a typed function complete with its type so we can say function on its own meaning some type of function then we need to specify a triple. But if one's not interested in specifying the domain and codomain and just want untyped functions then of course your way of doing it works. However outside of logic and set theory most people are more interested in sets of functions with a given source and destination set whatever about the flexibility of being completely free. Dmcq (talk) 09:04, 10 June 2013 (UTC)
(MARGIN RESET) Referring to the definition in the current Wikipedia article, also found in most present textbooks: the interpretation just described can be found nowhere in the literature. To the contrary, the notions of cartesian product, subsets and set equality are defined everywhere (i.e. in all references that came up in these discussions thus far) in a clear and unambiguous way that logically excludes this interpretation. Also, consider the analogy with the (PRE) style mentioned above: assume someone states: "DEFINITION: Let T be a set. A subset S of T is a set whose elements are all in T ". Now someone else might start arguing that T is an attribute of S, and that a set defined as a subset of T is somehow different from the same set defined as a subset of U in case U is different from T. However, equality between sets is defined as having the same elements, irrespective of the (many!) sets of which the considered sets might be a subset. Hence, if a function is defined as a subset of X × Y (with the extra property as in the article), it is a set and does not "change" if one defines it as a subset of X × Z -- assuming, of course, that the subset relation indeed holds. Note that using the same X is imperative, and that the function type that logically follows from the Wikipedia definition is that of the ISO standard, stating that the type definition f : XY specifies that Dom f = X and Ran f is a subset of Y. Such functions are not, in any meaningful sense, "less typed" than in the alternative definitions (e.g., as triples), only typed differently. In the example definition "sqrt : R>= 0 → R>= 0 defined by (sqrt x)^2 = x" the type specifies the nonnegative root. Obviously, in this setting, the "distinguishing effect" you are trying to obtain by a nonstandard view on set equality can be obtained simply by using tagged sets for Y and Z, as is common practice in programming language semantics (recall Meyer). Boute (talk) 13:42, 10 June 2013 (UTC)
As far as I can see, you are still talking about the definition of a "function" rather than "a function from X to Y". Instead of continuing that analysis, I would like to ask you to focus on describing any inconsistencies you see in the actual text of the article. You have claimed there are some, but I did not see them when I looked through the text. — Carl (CBM · talk) 14:10, 10 June 2013 (UTC)

(MARGIN RESET - long text by necessity!) I apologize for the length of this text, but please don't read it diagonally, look at all references provided (just 1 click away every time to make it easy) and, in case there is still disagreement, point specifically to the particular step in the arguments and state why you don't consider it logically valid.

I was definitely talking about "a function from X to Y" (or "A to B") as in Hammack's Definition 12.1, p. 195), in the current Wikipedia article and nearly all present-day textbooks. Let's call this definition (X2Y).

(I) I'd also prefer skipping the analysis, but some preliminary arguments in small steps are indispensable to see the inconsistencies in the rest of the article. For distinguishing definition variants, rigorous logic avoids (a) reading into a definition things that are not there, (b) overlooking things that are (already) there.

An illustration: by Example 12.2, p. 196, quoted literally earlier, Hammack demonstrates that he really means what he says in Definition 12.1 -- as befits a book about proofs. He concludes that the example function (a set of pairs) is really a function from A to B from two facts:

(i) the function is a subset of A × B;
(ii) each element of A occurs exactly once as a first component.

This is exactly what his (and the Wikipedia) definition says, nothing more, nothing less, leaving no room for other interpretations. Replacing B by any superset C of Ran f (or Im f) throughout Example 12.2 yields a proof that the same function (set of pairs!) is also a function from A to C under definition (X2Y).

Conclusion: all that (X2Y) says about the relationship between f : XY and the sets X and Y is that Dom f =X and Ran f (or Im f) is a subset of Y. This logically obvious point is made explicit in Bartle, p. 5, in Zakon, pp. 10--11 and by Labl, p. 14, referenced in the Wikipedia article on real analysis, and what the ISO standard says about the notation f : AB. It is consistent with all modern texts using the (X2Y) definition, up to the point where some texts themselves contain internal inconsistencies (the latter's existence is quite scary).

Consequence A: making a codomain a function attribute in the sense that, given f : XY, one can write Cod f = Y is inconsistent with (X2Y), since it would allow Cod f = Y and Cod f = Z with Y /= Z. Obviously, this does not prevent calling Y the "codomain" of the area of discourse.

Consequence B: with (X2Y), "onto" is a preposition, as in "onto Y" (Halmos, Bartle, Kolmogorov etc.), and using "onto" as an adjective assumes Y from the context. Example: in the April 2013 Bulletin of the AMS, Kontorovich, pp. 199 and 210 uses both forms whereas Fuchs, pp. 241, 242, 244--246 uses "onto" as a preposition only.

Occasionally the remark surfaces that one cannot talk just about a "function" an sich but only about "a function from X to Y for given sets X and Y". Its validity critically depends on the definition variant. A complete analysis is skipped here, but consider:

(a) The definition in Apostol (A) and Bourbaki (B1) where a "function" an sich is simply a functional set of pairs is in no way problematic and is used formally in Suppes, Axiomatic Set Theory (Dover 1972), Definition 39, page 86 -- so let's call this definition (ABS).
(b) It has been shown that any function from X to Y as defined by (X2Y) is a function by (ABS), and that any function f as defined by (ABS) is a function from Dom f to any superset of Ran f by (X2Y). This follows from the definitions if one puts aside all dogmata other than rigorous logic. Conclusion: the remark that the phrase "from X to Y" is essential in the definition of a "function" does not pertain to the Wikipedia definition (which can be rephrased as ABS), but only to some other definitions that one might discuss in an "alternative definitions" section.

(II) This careful preparation allows to be more brief in discussing the residual inconsistencies in the Wikipedia article, and how to correct them with very minimal changes. Aside: keeping the "codomain" issue in a separate Wikipedia article is inviting inconsistencies due to incompatible editings.

(IIa) Inconsistencies in the "function" article In brief: residual inconsistencies in the article arise whenever it is said or implied that a function according to (X2Y) has a unique codomain. The text of the Definition section with (X2Y) is itself consistent, but the diagram is inconsistent with (X2Y), since the set of ordered pairs shown is the function by definition (X2Y), not just a component of it.

Similarly, saying that "A function is properly defined only when the domain and codomain are specified" is inconsistent with (X2Y), according to which a function is fully defined as a set of pairs.

(IIb) Correction with minimal changes It suffices to make clear that "codomain" in the context of (X2Y) is not an attribute of the function itself but a set assumed known in, or implied by, the context.

(i) In the introductory text. For instance, changing the text "called the domain, a set containing the outputs, called its codomain" into "called its domain, a set containing the outputs, called codomain" and adding "In some definitions, the codomain is part of the context only, in others it is also part of the function itself.
Definitely misleading is the suggestion that function spaces in real analysis involve codomains. I checked all references and links in that article where the definition of "function" was visible (Google Books is more irritating than Amazon): nearly all of them use definition (X2Y) but none of the (X2Y)-users mention the term "codomain", and the function space XY, also written YX, is simply as defined in the ISO standard. Note that this function space is isomorphic to the XY variant with codomain.
(i) In all the rest of the article: similar diligent care.

The codomain article, whether or not integrated in this "function" article, needs more references to compensate for its strong bias. I'll add them when time permits. Boute (talk) 06:49, 15 June 2013 (UTC)

The problem is encapsulated in the example of the problem you are having about whether you aredealing with a typed functionor just functions where the type is not specified. Now how about applying your own logic to
Natural number 2 ={{}{{{}}}
Ordered pair (0,0)={{{].{{}}}
Integer 0=0-0={{}.{{}}}
Therefore 0=2.
Two sets that look the same can mean two entirely different things if they are typed. If the domain and codomain are given then the function can be specified by a set of ordered pairs. That does not mean it is the same as a function to some other codomain. This applies to both the source and target for relations from one set to another. The big difference comes when one talks about a relation without assuming one is talking about a relation between one set and another. Some people say you map the relation on one pair of sets to the on one the other pair whereas your way is to say it is exactly the same relation. Even though that first reference you gave talked about the graph of a function you say they showed their true colours because they wrote f=set instead of graph(f)=set but you ignored the inclusion in the set product at the end of the line so in fact they were saying the f was a function from A to B. Don't you think it would be better to accept people might actually mean what they say they mean rater than try and find something to show they mean something other than what they say?
It is perfectly okay your path and for the 1={{},{{}}} I guess one aught to put extra brackets and operators round it like saying Graph(f) instead of f above if one were working in set theory and yet wanted to deal with functions from A to B. However trying to show what you want is better and interpreting other people's work in your way is not leading anywhere useful. Why can't you just try and improve the alternatives section rather than trying to prove a point of view? 12:50, 15 June 2013 (UTC)
I am quite aware of the problem you mentioned with natural numbers, ordered pairs etc. (just google "representational and denotational semantics"), but that is an entirely different issue. Indeed, that problem stems from representing quite different kinds of objects by sets. Unavoidably this causes artefacts, as also extensively discussed by Halmos in Naive Set Theory in various places, e.g., p. 25. Here we are dealing with function objects only.
The sentence in my analysis,
"(i) the function is a subset of A × B"
highlights rather than ignores (quote) "inclusion in the set product at the end of the line".
Moreover, this inclusion is the crux of the matter. If B is a subset of C then A × B is a subset of A × C. Hence, if f is a subset of A × B it is, by transitivity, a subset of A × C. Note that, in all the (X2Y) definitions in the ever-growing reference list, it is the function itself that is defined as a subset of A × B (not its graph, which is not even mentioned).
It may interest you learning that my own preferred definition of "function" (which I carefully avoided discussing at all on these pages) is quite more abstract than (X2Y) or (ABS), essentially to avoid artefacts as discussed by Halmos. So my arguments are not motivated in any way by "what I want" for definition, but by the importance of getting the Wikipedia article right. Boute (talk) 18:31, 15 June 2013 (UTC)
A function from A to B is completely represented by its graph but according to the first alternative in the article is typed a function from A to B. It is quite reasonable to represent it with a set of pairs. The product specified the A and B and the author went and specified them. It really makes very little sense that you go around saying an author really meant something else when they talk about domains codomains and graphs. There are other works that say differently and agree with the alternative view. As to being correct, we are not some sort of Bourbaki group. As WP:POV says we should present the significant views fairly and in proportion. Dmcq (talk) 20:10, 15 June 2013 (UTC)
I'm not talking about alternate views or which of them is "correct", I am talking only and exclusively about the definition of a function from X to Y as in the Definition section of the Wikipedia article, and in all the other texts that happen to use exactly the same definition. In each of my comments, I've added new references pertaining to this definition -- when will you give some as well? Please read Bartle, p. 5, Zakon, pp. 10--11 and Labl, p. 14. It's free! Anyway, the time I allotted for this is up. I'll see in a few months how it goes. Boute (talk) 21:10, 15 June 2013 (UTC)
I haven't Bartle but I looked at the other two and basically we just don't see eye to eye and we've gone over it all before. I believe the f:A->B description in the main part of the article covers both viewpoints quite adequately, and I really don't see why you keep on trying to say as far as I can see that one of the alternatives is wrong and the other is the only one that is truly consistent with the main part of the article. Dmcq (talk) 21:54, 15 June 2013 (UTC)

In view of the discussion above, wasn't the old version of the section Formal definition [1] actually better than the present one, which only mentions the definition of a function as a set of ordered pairs? Isheden (talk) 15:58, 30 June 2013 (UTC)

I put some work into that old section but it seemed people here wanted things more black and white confuse people with different possibilities. The article now has a main usage and an alternatives section. I believe the alternatives deserves a higher profile but the point of view warring like above has rather polarized the whole business. Dmcq (talk) 20:17, 30 June 2013 (UTC)

## Function (set theory)

If we remove a few lines in bottom, then this page is perfect for Function (set theory) instead of Function (Mathematics). The bottom section where people hardly notice is (imho) an accuracy dispute, since when do we agree that function has to has something to do with set and set theory? And the informal concept of function becomes history? --14.198.220.253 (talk) 10:56, 9 November 2013 (UTC)

I think the situation is practically completely opposite to what you say. It is mainly in the foundations like set theory where people use functions without a given domain and codomain. Dmcq (talk) 12:23, 9 November 2013 (UTC)
I say the situation is independent of what you think. It is mainly in the foundations like set theory where people use functions with a given set of domain and codomain. --14.198.220.253 (talk) 12:52, 9 November 2013 (UTC)
That is simply asserting your opinion again. Either provide evidence that shows the article should change or wait for more opinions on this talk page to back your opinion. Dmcq (talk) 14:22, 9 November 2013 (UTC)
The same goes for you, that is why i see it as an uncited opinion and turn the "joke" back on you, here is your comment, you can verify it. --14.198.220.253 (talk) 14:25, 9 November 2013 (UTC)
You're the one wanting to change things. Dmcq (talk) 14:29, 9 November 2013 (UTC)
I don't know how one can explain the previous edit then, everything is an edit on Wikipedia. --14.198.220.253 (talk) 14:35, 9 November 2013 (UTC)
Many edits are not objected to and consensus can be gained at the talk page for some which are objected to. Dmcq (talk) 14:42, 9 November 2013 (UTC)

## Discuss reverted change casting doubt

Please do not just try forcing things into an article when another editor objects and gives reasons. Please read WP:BRD. Sources say that is how it is said. Provide a source saying it is said some other way. Dmcq (talk) 14:33, 9 November 2013 (UTC)

First, BRD is not a policy. Second, is previous edit a reliable source? If not, then an edit has to has a source as long as it is reverted? Where is bold? You see.
Third, you think it is "casting doubt", I don't think it is. Let me explain further,
\begin{align} f\colon \mathbb{N} &\to \mathbb{Z} \\ x &\mapsto 4-x. \end{align}
The first part can be read as:
• "f is a function from $\mathbb{N}$ (the set of natural numbers) to $\mathbb{Z}$ (the set of integers)" or
• "f is an $\mathbb{Z}$-valued function of an $\mathbb{N}$-valued variable".
Your edit changes from "The first part can be read as:" to "The first part is read:".
When you say "is read", it is not clear that whether it has to be read that way or not. For example, "a function f from N to Z.", "a function f maps from domain N to codomain Z", "f is a function has domain N and codomain Z.", "f colon N arrow Z is a function f from N to Z", Are they all wrong?
Is there a transformation rule to those two forms? What makes them so special? Why should it be in those two forms and keep all the words and structure in check?
That's why I think "is read" is in fact "casting doubt", or in good faith, unclear.
I think you can say $f\colon \mathbb{N} \to \mathbb{Z}$ means "f is a function from $\mathbb{N}$ to $\mathbb{Z}$", you can at best suggest people to read it in certain way, you can say it in different way in English even though it makes use of the word "from" "to" "function"..etc. but you don't say "it is read" because it sounds like it has to be read in the following way. --14.198.220.253 (talk) 15:19, 9 November 2013 (UTC)
You changed the 'is read as' to 'can be read as'. The 'can be' means there are other forms also. Have you found other forms? Dmcq (talk) 15:33, 9 November 2013 (UTC)
Have you read my post? --14.198.220.253 (talk) 15:35, 9 November 2013 (UTC)
Yes. Have you found a citation for a new version? Dmcq (talk) 15:48, 9 November 2013 (UTC)
Have you read the article? Have you found a citation for the old version? Yes?--14.198.220.253 (talk) 15:51, 9 November 2013 (UTC)
If you are doubting those forms then put in {{citation needed}} for places where you require a citation and fill in the reason. Dmcq (talk) 15:59, 9 November 2013 (UTC)
Thanks, it is a useful advice, but I am not doubting those forms.
Thought you said something about consensus above. You didn't respond to my examples yet, "a function f from N to Z.", "a function f maps from domain N to codomain Z", "f is a function has domain N and codomain Z.", "f colon N arrow Z is a function f from N to Z", Are they all wrong? --14.198.220.253 (talk) 16:14, 9 November 2013 (UTC)
They're descriptions of a function f okay, but are they readings of what's written or descriptions of f which just mean the same? 1+1 is the same as 2 but it is read differently. Saying f is a function from domain N to codomain Z for instance is saying N is a domain whereas it is a function from N to Z which has domain N and codomain Z. The alternative definitions section goes into the difference between a function and a function from N to Z and the various ideas of what a function might be. It is certainly okay mostly to just say function here but reading it that way sounds problematic to me. At best it sounds like loose language to me and there's enough loose language already around functions. So yes I rally would like to see someone saying it is read one of those ways rather than you making them up. Dmcq (talk) 16:39, 9 November 2013 (UTC)
I didn't say "f is a function from domain N to codomain Z", but even if your interpretation is right, we can just take that one out. So, why can't I read it as "a function f from N to Z"? Is it wrong?
It is certainly okay mostly to just say function here but reading it that way sounds problematic to me. At best it sounds like loose language to me and there's enough loose language already around functions.
You see, you just said there are "good read" and "bad read", so there is no "must read" or "is read". If you have some kind of transformation rule, for example, to read $f\colon \mathbb{N} \to \mathbb{Z}$ literally, you map each symbol to an English word, "f colon N arrow Z". If you can do that for its semantics too, then we can discuss.
"is read" is inaccurate for now, we should change it to "can be read", "it is recommended that" "it means"..etc. --14.198.220.253 (talk) 17:33, 9 November 2013 (UTC)
Please provide a citation saying is is read otherwise. We are supposed to summarize what is out there, not have people arguing about their own ideas and then stick them in. Dmcq (talk) 19:01, 9 November 2013 (UTC)
I have now had a look around at some places where they say how it is read and there are some variations that justify not being dogmatic about it so 'can' can be put in so I'll self revert. Dmcq (talk) 20:00, 9 November 2013 (UTC)

## Letting logic prevail over dogmatism

Wikipedia is meant to serve its readers. Insisting on personal opinions is acceptable for mathematics only if they are based on logic, because logic serves clarity in the interest of the readers. Insisting on personal opinions that violate logic is dogmatism, leading to endless discussions and creating only confusion.

This especially holds for the function concept, and it is saddening to see how an essentialy very simple concept is made bewildering to readers by violating logic.

(A) Let's consider the logical consequences of the definition in the main article, here quoted literally:

"A function f from X to Y is a subset of the cartesian product X × Y subject to the following condition: every element of X is the first component of one and only one ordered pair in the subset."

Like any definition, this definition consists of two parts:

• The definiendum (the concept being defined): "A function f from X to Y ".
• The definiens (a defining statement): "a subset of the cartesian product X × Y subject to the following condition: every element of X is the first component of one and only one ordered pair in the subset."

Example:

The set {(0, a), (1, b)} is a subset of {0, 1} × {a, b} satisfying the condition that every element of {0, 1} is the first component of one and only one ordered pair in {(0, a), (1, b)}. Hence it satisfies the definiens and therefore, by definition, is a function from {0, 1} to {a, b}.
The same {(0, a), (1, b)} is a subset of {0, 1} × {a, b, c} satisfying the condition that every element of {0, 1} is the first component of one and only one ordered pair in {(0, a), (1, b)}. Hence it satisfies the definiens and therefore, by definition, is a function from {0, 1} to {a, b, c}.

More generally, since the definiens contains the clause " every element of X ", from a given function f we can derive the set X stated in the definiendum. Hence this set is an attribute of f, and therefore can properly be called the domain of f.

The definition does not allow such a conclusion for Y. Indeed, let f be a function from X to Y, and let Z be a set that includes Y but is not equal to Y. Clearly f is a subset of the cartesian product X × Z such that every element of X is the first component of one and only one ordered pair in f. Therefore, by definition, f is (also) a function from X to Z. Hence, given the definition, Y is not an atribute of f, and therefore cannot properly be called the codomain of f, and doing so is inconsistent. The most one can do is letting Y be part of the context of discourse and call it the codomain (or the codomain considered), but without the addition "of f".

Recall that the set of first components of the pairs constituting a function f was called the domain of f. The set of second components is also uniquely determined by f and and therefore can properly be called the range of f or the image of f (the choice of terminology being a matter of preference, not logic).

For instance, the range (or image) of the function {(0, a), (1, b)} is {a, b}.

The notation $f\colon X \rightarrow Y$ is defined by the ISO 80000-2 standard of 2009 on page 15 as specifying that f has domain X and range included in Y. Inconsistency with the definition is avoided by not mentioning codomains at all.

(B) The observations in (A) show that the Wikipedia article as it stands contains many inconsistencies. Let's consider the options to make it correct, apart from the simplest way just mentioned (avoiding codomains)

The only consistent way to make codomains a function attribute is changing the definition, redefining a function as a pair f := (F, Y) or a triple f := (F, X, Y), where F is a set of pairs as defined in the original definition. Bourbaki briefly considered this option on page 76 in Theorie des Ensembles. However, on the very next page (p. 77), Borbaki announces his intention to use the simplest possible definition, also found in the subsequent literature (Apostol, Suppes, Tarski, Mendelson, ...): a function is a set of ordered pairs no two of which have the same first component. Following this definition, domain and range are defined as the sets of first and second components respectively, and $f\colon X \rightarrow Y$ as in the ISO 80000-2 standard.

Furthermore, codomains have disadvantages only: they unnecessarily complicate the definition and are very restrictive. For instance, all texts attaching a codomain to a function define the composition $g \circ f$ of $f \colon X \rightarrow Y$ and $g \colon U \rightarrow V$ only for the special case where U = Y. More common definitions, in particular nearly all analysis texts, do not impose any restriction but, instead, define the domain of $g \circ f$ as the set of all x in X such that f(x) is in U.

Conclusions: (A) The inconsistencies in the current article have been demonstrated. (B) Among the options to correct them, one is clearly preferable over the other.

Since I will be away during Jan. 12-20, I will not follow the discussions during that period.Boute (talk) 13:23, 11 January 2014 (UTC)

You have already made the same argument above, and it has already been addressed. Since there is nothing new in this section except another long repetition of your argument, I don't see any reason for a detailed reply. Please re-read the rest of this talk page. — Carl (CBM · talk) 14:37, 11 January 2014 (UTC)
Untrue: only the conclusion is the same; the argument is formulated in a quite different way, to find out the best way to explain the obvious conclusions to those who are unwilling to accept them. What has remained the same are the reactions: the unwillingness to address the logic: never were any counterarguments given to the main point, illustrated by the (new) example: by definition, {(0, a), (1, b)} is a function from {0,1} to {a, b}, but also from {0,1} to {a,b,c}.Boute (talk) 17:49, 11 January 2014 (UTC)
I think the section title says it all as far as Wikipedia is concerned. Yes talking about various ideas of how things should be done is interesting but this is a mathematics article so should follow mathematics sources, and as part of Wikipedia it is subject to WP:OR and WP:V. We need your ideas clearly outlined and obviously so in reliable sources with weight and then it should be documented with its due weight compared to the other stuff around. You have also come at the wrong time as far as I'm concerned as there's a person over at the exponentiation article giving reasons why we shouldn't describe the current state of things as far as zero to the power of zero is concerned, they say it must be defined as 1 in the article. Yep we describe two different ideas which are to an extent contradictory but that's what out there. I don't see this as a much different case with its alternatives section. Dmcq (talk) 16:12, 11 January 2014 (UTC)
Also an incorrect appraisal of the situation: the number of references I have provided in these pages for books where functions were presented fully consistently are a multiple of what anyone else has provided. So the bureaucratic pretexts quoting WP:OR and WP:V do not even apply. The argument "that's what out there" indeed justifies presenting different views, but for mathematics articles this is responsible only for views that are internally consistent, and the separation is made clear. The current article indiscriminately mixes (at least) two mutually inconsistent views without a clean separation , e.g., as I outlined in (B) above. Again (this is the only repetitive part): finally address the logic in the arguments.Boute (talk) 17:49, 11 January 2014 (UTC)
Yes but doesn't cut it for Wikipedia. The answer is simply yes we should present the different versions with due weight. We should try for intelligibility too but that is not a Wikipedia policy. I think you may have the mistaken idea that a lot of good logic helps your argument. It doesn't. What is best is reliable sources that clearly show things without needing a lot of extra arguments to explain why what they say shows something. Dmcq (talk) 18:22, 11 January 2014 (UTC)
I'm sorry to hear that intelligibility is not Wikipedia policy. One wonders what is left of Wikipedia in that case. Anyway, I agree about needing good sources: they exist in abundance for any topic in mathematics, and I listed many of them on these pages. However, the simplest and clearest account of function, found in Bourbaki, Apostol, Suppes, Mendelson etc. was systematically vetoed by the editors of this article. With the risk of being accused of repetition: this definition states: "A function f is a set of ordered pairs, no two of which have the same first component." Following this definition, domain and range are defined as the sets of first and second components respectively, and $f\colon X \rightarrow Y$ as in the ISO 80000-2 standard, namely, specifying that the domain of f is X and the range of f is included in Y. This definition is fully equivalent to the current Wikipedia definition but, being simpler, creates less confusion in peoples' minds. I'm off now until the 20th, and then I'll make an edit to that effect. A note on alternative views with sources will be included, but restricted to self-consistent ones. Here only logic can tell which is which: we won't find reliable sources stating that 17350983 + 1395618 = 23283568 is wrong. Boute (talk) 21:51, 11 January 2014 (UTC)
As explained in the article and in more detail in the article Range (mathematics) the term range is avoided in the article because different authors use the term for different things so it causes confusion. Dmcq (talk) 22:30, 11 January 2014 (UTC)
Terminology is the least of the problems and trivial to fix in principle. Yet, I have seen all the alternative terms in the literature, and all them have been used somewhere else for other meanings. It is not hard to accept that every author clearly announces his choice among the many widely used terms, and uses it consistently. Boute (talk) 06:55, 12 January 2014 (UTC)

(Margin reset) The main inconsistency that damages the article --- Irrespective of editors' personal "preferences", is it still unclear to anyone that, given the current Wikipedia definition (undisputed, because free of inconsistencies)

"A function f from X to Y is a subset of the cartesian product X × Y subject to the following condition: every element of X is the first component of one and only one ordered pair in the subset."

precludes later introduction of

A function f with domain X and codomain Y is commonly denoted by $f\colon X \rightarrow Y$

on penalty of inconsistency? And that the ISO 80000-2 standard (or equivalent definitions for $f\colon X \rightarrow Y$ from the literature) offers a consistent alternative?

If not, we should all concentrate on finding out why some people fail to recognize this. I dare hope that Dmcq's remark about "reliable sources" does not mean that he wants to see such a source specifically point out this inconsistency in the current Wikipedia article! That is where only logic can settle the issue. Boute (talk) 06:55, 12 January 2014 (UTC)

What you are basically saying is that a function from X to Y is a function from X to Z if Y is a subset of Z because it is a set. Yes it is a set but it is a set with an associated type as far as many people are concerned. A number may be defined using a set so we see definitions saying 0 is {}and 1 is {{}}, others use sets for rationals and reals. However the sets so used have types and if we just wrote {{}}+{} it isn't at all clear a priori what the answer should be without saying what is the type of + or of the sets.
The main part of the article takes no sides on this point. That is for the alternatives section because different people disagree on that point. If someone asks for a function from X to Y the X and Y are counted as part of what they want. They don't expect to have to check the values of the function they are given to see if it satisfies the requirements. If a function from X to Y is the same as a function from X to Z then how can one be sure about the function except by checking the actual values rather than the definition? This is the reason some people consider a function from X to Y as having the X and Y as part of the thing being defined. The f so defined may look very similar to another f from X to Z but it is not the same as the function from X to Z as far as they are concerned. Dmcq (talk) 13:20, 12 January 2014 (UTC)
It is clear what you are saying but, as the definiendum/definiens analysis shows, the function concept as defined has only X associated with it, not Y. So the only compatible interpretation of the type specification $f\colon X \rightarrow Y$ is the one in the ISO 80000-2 standard (or any equivalent formulation). Hence, by the chosen definition, the article has already taken a clear (and very wise) position! If you want Y to be part of the function, you have to change the definition into f = (F, Y) or f = (F, X, Y) as in Bourbaki, who reverted on the next page to the simpler definition (wise, for reasons given).
From the practical viewpoint, you are also right that knowing Y is useful, but for that it is not necessary to make Y a function attribute. It suffices introducing the function together with the type specification $f\colon X \rightarrow Y$. The type $X \rightarrow Y$ is just the type of all functions with domain X and range included in Y (see e.g. Meyer's book on programming language theory). Boute (talk) 16:44, 12 January 2014 (UTC)
As a practical matter what is covered by the main part of the article covers the majority of cases, but I do think the alternatives section could be expanded to explain the different points of view better. Dmcq (talk) 18:10, 12 January 2014 (UTC)

## Property that f^n(x) = id(x)

Is there a name for a function with the property that

1. f^2 = f(f(x) = id(x)
2. f^n = id(x) for some n

where id(x) is the identity function? 130.236.61.243 (talk) 14:19, 6 February 2014 (UTC)

(1) is an involution. —David Eppstein (talk) 16:20, 6 February 2014 (UTC)