# Talk:Codomain

### Errors in the Article

The first point I would like to make is that there is no sense in writing something like "let f be a function from R to R, where f(x) = x^(1/2)." This is because there is no such function. Suppose to the contrary that there is such a function f. Because it is a function, we know that for all a in R (its domain), there exists b in R (its codomain) such that b = f(a) = a^(1/2). However, it is easy to see that for a = -1, no b in R satisfies the statement b = a^(1/2) = (-1)^(1/2). This leads to a contradiction. Therefore, we conclude that there is no such function. Another interpretation would be that the "function" f is not well-defined, although this terminology is misleading as it suggests that f is in fact a function, which we have just disproved.

Of course, there is nothing wrong with supposing that such a function exists. It is just that doing so serves no purpose, since any statement follows from a false supposition. At any rate, the article should be changed to fix what is clearly a mistake.

The second point I would like to make is that even if the functions f and g were properly defined, it is trivial to show that f and g are in fact the same. By treating them as the sets they really are, proving that f = g is a simple task of proving set equality. This disproves the article's current claim that the functions are not the same.

## Example

### Copied from article

Let the function f be a function on the real numbers:

$f\colon \mathbb {R} \rightarrow \mathbb {R}$ defined by

$f\colon \,x\mapsto x^{2}$ The codomain of f is R, but clearly f(x) never takes negative values, and thus the range is in fact the set R+—non-negative reals, i.e. the interval [0,∞):

$0\leq f(x)<\infty$ One could have defined the function g thus:

$g\colon \mathbb {R} \rightarrow \mathbb {R} ^{+}$ <== does not include zero!!
$g\colon \,x\mapsto x^{2}$ While f and g have the same effect on a given number, they are not, in the modern view, the same function since they have different codomains.

The codomain can affect whether or not the function is a surjection; in our example, g is a surjection while f is not.

### Discussion

Why should f and g be considered different functions? No doubt this is very confusing for those who are meeting functions for the first time; also I know of no use for the surjection concept (although I still have to read that article). Brianjd

I have a math degree and I was never taught any such thing. I was taught that the range is the set of all outputs, and that if someone says x->x^2 has a range of R, then they were just wrong or imprecise.
Secondly the use of the words possible and actualized is totally confusing
Thirdly I can understand how x->x^2 is different if you are talking about R and C, but when both map R->R+ I don't see how misstating the proper range changes the function at all. This seems to be some kind of semantic nuance that is only important when abusive language is used with classes of functions.
I just don't get it. I'm gonna check my analysis books when I get home.

It's just a case of mathematicians wanting to complicate things and make their profession seems advanced.

I too agree that it's stupid to consider a "mapped to" set to be anything different than the range of the function doing the mapping. But mathematicians allow for the mapped to set to have some useless elements to which the function will never map to (i.e., the codomain of f(x) = x^2 being R has no use, why not limit it to R+?).

It is important in many areas of advanced mathematics, particularly algebraic topology to distinguish between the range of the function and the codomain. The reason is that when you apply a functor like homology or fundamental group to a function, the resulting homorphisms can be entirely different. For example proofs of the fundamental theorem of algebra and its generalizations to quaternions and octonions using algebraic topology techniques rely on clever use of this distinction. Fiedorow 20:09, 7 December 2005 (UTC)
I do agree that in the case discussed, it seems quite useless to claim that f and g are different functions (and that range and codomain are two separate, different concepts). However, in a more general case, it is IMO worthwhile. For example, let there be a function p: R^3 -> R^3 that to each vector in R^3 maps its orthogonal projection on a plane L. It makes sense to claim that p is not the same as q, another R^3 -> R^3 function that to each vector in R^3 maps its orthogonal projection on a plane W, right? And a function s: R^3 -> R^2 is another case. While both L and W are "two dimensional" in a sense, it is quite clear that they are not equal to R^2. So I guess my point is that I agree with the current article, but recognize the need for an example that more clearly illustrates the point. 85.224.198.251 17:01, 3 May 2007 (UTC)

### CODOMAIN - "set of all possible values" ?

Assume f: A ->B, If the ran(f) is a proper subset of B, then how are the values in the set B-ran(f) "possible values" of the function f defined on A?

The set of all positive values is ran(f) not B. B is a set which contains the set of all positive values (a set being mapped "into" by f defined on A)

To describe ran(f) as the set of "actual values" implies that the function is actually used for all members of A. This is true if we're graphing y=f(x) or some other mechanism that actually feeds all members of A into f. But a function isn't like this, it's just a machine or rule that "can" take any value in A and map it to it's corresponding value in ran(f).

ran(f) is the set of all "possible" values!

From the point of view adopted in this context, the domain A and the codomain B are part of the data associated to the function f. Admittedly this doesn't make much sense when one considers one function in isolation. However it is very helpful when one is considering large collections of functions. One wants to say things like "consider all continuous functions with domain A and codomain B". Fiedorow 15:29, 19 December 2005 (UTC)
Yes but to explain the codomain as the set of possible values and range as the set of actual values is vague and makes even less sense in light of your comments above (and even less sense when going back and reading the explanation again).
The range is the "set of all possible output values from the function." The codomain is "the set that contains the set of possible output values of the function, and thus is a superset of the range."
A set, not the set. f could easily be defined to have a codomain of C instead of R or R0+. (Correct me if I'm wrong.) Twifkak 21:06, 15 August 2007 (UTC)

=== g(x) = √x ? The example for g(x) states the codomain is R. Now I understand that you can define the codomain to be any set that the range is a subset of, which *seems* ok. The implication of this is g(9) = {3, -3}. This is a one-to-many mapping and I thought violated the basic definition of a function? Usually f(x) = √x is defined to be f(x) = +√x.... doesn't this definition *require* the codomain to be limited to [0,∞) ??? Perhaps the problem is the unqualified use of the radical sign to indicate the operation of taking a positive square root allowing people like me to think -3 *is* in the *range* of g(9) when you meant it not to be?71.31.152.112 (talk) 19:24, 17 October 2010 (UTC)

Square root here means the non-negative square root. This is referred to as the 'principal value' of square root and is what is normally meant when people refer to 'the' square root rather than 'a' square root. The codomain can be the whole of R without any problem using that definition. Dmcq (talk) 21:24, 17 October 2010 (UTC)

## On the composition example

The article gives an example where two functions with the same graph are given, but with different stated codomains, and claims that in one caase a certain composition is possible and in another case it is not. This could be expanded into a longer explanation of why it is sometimes necessary to track the codomain explicitly; it is not about the ability of the functions qua functions to be composed, but about the ability of the functions qua morphisms in a category to be composed. In a noncategorical context, all that is needed in order to compose f and g into $f\circ g$ is that the range of g is contained in the domain of f, and this is a property of the graphs alone. CMummert 13:06, 14 October 2006 (UTC)

## Suggestions from a non-mathematician

I don't have any mathematical training other than a high school diploma, so I don't have the confidence to make the changes to this article myself, but I have a few questions/comments. I think I already know the answers, but I'm probably wrong. Either way, I think these are questions that a lot of untrained readers will be asking, and they're worth explaining in the article.

1. A function has to be defined for every number in its domain, right? The principal difference between range and codomain seems to be that this distinction does not apply to codomains: just because a number is within the codomain of a function doesn't mean that that function has to be capable of producing that number as output.

Correct

2. How, then, do we determine what the codomain of a function is? When the domain of a function isn't explicitly limited, we assume it to be the set for which that function is defined. (At least, that's what I think I did in high school.) The codomain seems to be quite different. It seems like it's not determinable (and probably not relevant) unless it's explicitly defined.

It usually is, I.E. all reals or complex numbers

3. I assume that a big, easy-to-understand instance where the codomain and the range would differ is if the domain is limited. For example, if we define f(x) = x^2, f has a codomain of the real numbers that are greater than or equal to zero. However, if we define its domain as [3:infinity), then its codomain remains the same, but its range is now [9:infinity) instead of [0:infinity). Right?

Yes--Cronholm144 11:39, 29 May 2007 (UTC)

168.209.97.34 09:10, 28 May 2007 (UTC)

## A thousand words

I think that many problems with the understanding of this concept could be alleviated by the addition of the set theory blob mapping to the codomain blob. If you have read texts on algebra I think you know what I mean. Unfortunately I think that any picture I make will look haphazard at best. I will give it a shot though... don't hesitate to stop me.--Cronholm144 11:31, 29 May 2007 (UTC)

Something like this except cleaner

## possible error ?

Do any of you think that the sentence at the start of this article:

"Unlike the range, which is a consequence of the definition of a function, the codomain is part of the definition of a function. "

contains a minor error ?

Shouldn't the sentence be something like:

"Unlike the range, which is a consequence of the definition of a function, the codomain is NOT part of the definition of a function. "

On an unrelated note. I was reading your comments pertaining to comparison of the "codomain" and "range" concepts. Do any of you think that the computer science concept of "data type" might be useful here? A codomain, could be regarded as the set of all possible values having a specific data type, or some arbitrary subset of such a set, for example the set of all complex numbers, the set of all real numbers, the set of all groups, etc..., and the range, of a function could be thought of as that subset of a codomain, to which that function maps values. Do any of you know if there exists a term that is regarded as acceptable in mathematics, whose meaning is roughly equivalent to the meaning of the computer science "data type" concept ? —Preceding unsigned comment added by 76.178.75.237 (talk) 03:14, 11 June 2008 (UTC)

No I think the current wording is perfectly correct. For instance the square function on the reals would normally be defined with codomain the reals but its range is just the positive reals. Computer science tends to refer to the codomain as the range which can cause trouble and also has partial functions. Otherwise the word 'type' seems to cover both maths and computyer science pretty well I'd have thought. Dmcq (talk) 13:06, 25 April 2009 (UTC)
Some people working in logic like to define functions as just by the mapping of values without explicitly defining a domain or codomain, this can be easier as sometimes the 'function' is defined going from one class to another rather than between sets. Leaving out the typing of the function avoids having to cope with that. For most of mathematics though the codomain is part of the definition of a function. Dmcq (talk) 17:26, 18 May 2009 (UTC)

## Reverted?

Excuse me, please why have you reverted my changes if they're correct and i gave a source, which shows this page isn't correct?

123unoduetre (talk) 21:29, 22 May 2009 (UTC)

There are several problems with your edits and overall I don't think they constituted an improvement to the article. I do admit that this article could be improved, and that some of the ideas you were trying to incorporate into the article might have merit. First though you mention that this page is incorrect, can you please state which statements in the article are incorrect? Thanks. Paul August 21:40, 22 May 2009 (UTC)
While f and g map a given x to the same number, they are not, in the modern view, the same function because they have different codomains. This sentence is false for example. There are other things which i wouldn't call mathematics, but hand-waving. Should i list them all here? 123unoduetre (talk) 21:57, 22 May 2009 (UTC)
If it's only about style and some wiki standards i would be grateful if some more experienced user help me with doing it correctly. I could write new, correct article from scratch too. 123unoduetre (talk) 22:30, 22 May 2009 (UTC)
As I said above logicians don't seem to be up to speed with the concept of domain and codomain as used in most of maths. I had a quick look in Google Books and the very fist book my search on "codomain image" turned up was page 16 of Discrete algorithmic mathematics By Stephen B. Maurer, Anthony Ralston where it says that the square function from the reals to the reals is different from the square function from the reals to the positive reals. The definition you gave is not useful and completely misses the point of having a codomain. It stops one talking about onto or one to one functions functions or the composition of functions. Dmcq (talk) 23:02, 22 May 2009 (UTC)
You might notice that in this book author doesn't give any mathematical definition on function. He only gaves intuitions about it. Mathematical definition would be set theoretical definition in some axiomatic set theory. I assume you agree with me that mathematics is science which is based on formal systems. Citation from book you gave in chapter about functions: "A function is a rule or process that associates each element of one set with a unique element of another (the codomain or output space). If one emphasizes the dynamic process of getting from inputs to outputs one often call the function the mapping." As you might notice it isn't correct definition of function and he never gives any set theoretical definition. Now i'll show you why it isn't correct definition. 1. it defines function by process or rule, but rule and process are leaved undefined. Let's assume rule is some algorithm. So this definitions says only about computable functions. But there exist also non-computable functions. Of course they're not interesting from point of view of computer science, but we speak about mathematics. Do you have some other sources i could show are incorrect? (Books are wrong sometimes, sorry about that). 123unoduetre (talk) 23:42, 22 May 2009 (UTC)
First book on google books about mathematical analysis: http://books.google.pl/books?id=Pjk60RP-IeUC&printsec=frontcover&dq=mathematical+analysis#PPA4,M1 page 3-4 123unoduetre (talk) 23:47, 22 May 2009 (UTC)
This book clearly states a function is a type of relation from X to Y. A relation from X to Y is defined as a subset of X x Y. Thus the codomain is specified, contrary to your assertion. Indeed, the book also then defines surjectivity, making it even clearer that this is a property of the function (and thus codomain is part of the function). --C S (talk) 11:18, 23 May 2009 (UTC)
It seems you don't understand what you're talking about. Assume function f is subset of X x Y. Assume range(f)=Z and Z is subset of Y. So this function is also subset of X x Z. Assume A is superset of Z, so this function is also subset of X x A. Do you understand this? —Preceding unsigned comment added by 123unoduetre (talkcontribs) 11:33, 23 May 2009 (UTC)
Ah yes, I must be the ignorant one here. No, I don't get how you can read a clear statement that a function is a relation "from X to Y" with an additional condition and then argue that X and Y do not appear as part of the definition of function. The notation used is even f: X --> Y. To put it simply, the book does not back up your assertion that f: X-->Y and g: X--> A (with A not equal to Y) are the same functions merely if f(x) = g(x). As I pointed out, the passage even states that "f is surjective if its range is all of Y". Note that "f" is mentioned alone, indicating that Y is part of f. It does not, as your second link above does, always carefully denote the target space before stating the function is surjective onto the target. I'm sorry if you're having trouble distinguishing between sources that state what you mean and those that do not at all. --C S (talk) 11:59, 23 May 2009 (UTC)
I gave definition of f:X-->Y below. I accept that sentence you gave is a bit vague. But it's inly one sentence. And please refer to definition author gave. You don't accept that from definition of function as set of pairs it logically follows what i'm talking about? Should i give you a formal proof of it for you to accept that? 123unoduetre (talk) 12:23, 23 May 2009 (UTC)
If you really want i could give you many examples. But it doesn't making sense to search google books. But if you really, really want i could do it, and count books which use correct and incorrect definitions of functions. Then i could show you some numbers. Of course i could accept that some authors (but not the one you gave (he doesn't give any definition of function)) use different definition. But wikipedia is encyclopedia, and should give most common understanding of terms. 123unoduetre (talk) 23:51, 22 May 2009 (UTC)
http://books.google.pl/books?id=qA5FTMT7HE4C&pg=PP1&dq=mathematical+analysis#PPA12,M1 page 12 123unoduetre (talk) 23:54, 22 May 2009 (UTC)
http://books.google.pl/books?id=jn_h9eIWIzUC&printsec=frontcover&dq=discrete+mathematics&lr=#PPA78,M1 page 78 this is discrete mathematics book 123unoduetre (talk) 00:11, 23 May 2009 (UTC)
Again, this book defines a function as specifying a domain and codomain. See several pages earlier in the book for discussion which makes this clear. Not to mention the very page you cite states that two functions must have the same "type" to be equal. A type is a specification of domain and codomain, written A --> B. --C S (talk) 11:18, 23 May 2009 (UTC)
Please understand difference between implication and equivalence. It states: if f and g are function of type A->B then (if for all x in A f(x)=g(x) then f=g). There is implication, not equivalence. Of course this sentence is true. But still it doesn't mean functions have to have same type. And please understand definition of function as set of pairs. 123unoduetre (talk) 11:40, 23 May 2009 (UTC)
Yes, I understand the difference. But I think you don't understand how mathematical definitions are phrased. Before that statement, the book did not explain when to consider to functions to be equal. In that statement it is defining equality for functions of the same type. The passage even continues, "In other words, if f and g are of the same type A--> B, then f and g are said to be equal if..." This passage makes up a short section with the heading "Equality of functions". Do you really think this section is pointing out just an implication? The inference you are making here, that functions don't have to be of the same type, refutes the several pages of discussion prior to making this definition in the book. --C S (talk) 12:03, 23 May 2009 (UTC)
It's unimportant, because what i say follows logically from definition of function as set of pairs. Do you understand what consequence is? 123unoduetre (talk) 12:23, 23 May 2009 (UTC)
http://books.google.pl/books?id=Er1r0n7VoSEC&pg=PP1&dq=set+theory+jech#PPA24,M1 page 24 This book is written by Karel Hrbacek, Thomas J. Jech. I hope you know who Jech is. I suppose it should be enough for you. It took too much of my time. I'm tired. 123unoduetre (talk) 00:41, 23 May 2009 (UTC)

I'm waiting for help of somebody who could explain to me how could i edit this page to comply to wikipedia standards and style. Thank you. 123unoduetre ([[U

ser talk:123unoduetre|talk]]) 00:46, 23 May 2009 (UTC)

The book you originally quoted did not specifically say functions were the same if the codomain was different, and the book you quoted in answer to me didn't mention codomain at all. What you are trying to put in is not right, that is why it shouldn't be put in. I'm quite willing to accept some other work you've quoted will say what you said but it isn't a very sensible thing to say as it destroys the whole point of a codomain. As I said before logicians really are happier without the domain and codomain part of the modern definition of a function and only using the set of pairs, however in the rest of mathematics that is not how things are done. I'll post a bit on the Mathematics project talk page at WT:WPM#Codomain definition to get other people's opinions on it. Dmcq (talk) 10:30, 23 May 2009 (UTC)
I had a better look at the definition in the next book as well after that one I said didn't mention codomain and it didn't mention codomain either. However they did say that a function was equal to another function if its type was the same and the mapping was the same and it gave the type as A->B where A and B are sets. It then had an explanation which didn't mention B, so basically their definition was okay but the explanation was incomplete. Dmcq (talk) 10:37, 23 May 2009 (UTC)
I don't know about logicians, but amongst mathematicians, I wouldn't be surprised if analysis books were split either way, all topology/geometry and algebra books say a function has a specified codomain. --C S (talk) 11:18, 23 May 2009 (UTC)
Wrong, for example this book defines function as set of pairs. It's about topology: http://books.google.com/books?id=-goleb9Ov3oC&printsec=frontcover&dq=topology&hl=pl 123unoduetre (talk) 11:25, 23 May 2009 (UTC)
This one too: http://books.google.com/books?id=-o8xJQ7Ag2cC&printsec=frontcover&dq=topology&hl=pl#PPA4,M1 123unoduetre (talk) 11:27, 23 May 2009 (UTC)

Sigh. I suppose you're now desperately trying to overturn any consensus here (which so far is against you) by doing random Google searches. Well, nice try, but you should have stopped while you were slightly ahead. WIllard's book clearly states a function specifies a domain and codomain. "A function f from a set A to a set B, written f: A--> B, is a subset of A x B..." As for Kelley, good find! I will now amend my statement to: "I wouldn't be surprised if ....all topology/geometry (except Kelley)...". By the way, Kelley is such an old book he points out there is this neat new arrow notation, although he prefers the lambda notation! An interesting choice of book to refute me. I should probably add some caveats like I'm not talking about ancient books (so don't go dig up some topology book from 1800s; I never read Listing's Topologie...). --C S (talk) 11:59, 23 May 2009 (UTC)
Ok so i'll find some other books through google search 123unoduetre (talk) 12:23, 23 May 2009 (UTC)
http://books.google.pl/books?id=-o8xJQ7Ag2cC&printsec=frontcover&dq=topology#PPP1,M1 is it old too? 123unoduetre (talk) 12:51, 23 May 2009 (UTC)
I'm searching google, because i suppose you're not interested in books in polish. 123unoduetre (talk) 12:53, 23 May 2009 (UTC)
This is about abstract alebra: http://books.google.com/books?id=LE4mPB-1RFQC&printsec=frontcover&dq=abstract+algebra&hl=pl#PPA16,M1 123unoduetre (talk) 11:30, 23 May 2009 (UTC)
I'll give you the benefit of the doubt here, as this book is the second (but first preview-able) hit when you search Google books for "abstract algebra". But I wish you would look down a bit further. For example, the one with Mac Lane and Birkhoff as authors (which, incidentally, is a much much more famous algebra book), the 4th hit down and previewable, explicitly states a function must specify codomain. 5th hit down (Dummit and Foote), is not previewable, but I own it, and it states a function is denoted A--> B , that A is the domain and B is the codomain.
B is codomain of f <=> rg(f) subset B 123unoduetre (talk) 12:23, 23 May 2009 (UTC)
Incidentally, the people here you are arguing with do have perhaps a modicum of more mathematical knowledge than you, believe it or not. --C S (talk) 11:59, 23 May 2009 (UTC)
Of course they can be great mathematicians. But i'm not saying they aren't. I'm arguing about what is definition of function, not what people here know or do not know. 123unoduetre (talk) 12:28, 23 May 2009 (UTC)
In your previous post I don't know which book are you refering. Could you please use title? I'll try to make it more clean to all parts involved in discussion: we are arguing about definition of function. I gave some formal definition as set of pairs. You didn't gave any formal definition of function. I gave in my text some non-standard (in my opinion) definition of function as <F,B>, where F i set of pairs and B is codomain, and told it's nonstandard. You are saying that in common mathematics functions definitions include codomains, so i suppose either you're proponent of non formal treatment of mathematics, or would accept some definition similar to mine. So the whole point is to decide which definition of function is standard and which isn't. I gave you some books which use my definition of function as set of pairs. You gave me one book which doesn't give any formal definition of function, but only guide intuitions about it. I suppose there is one nice solution of this problem. We could write in text 3 things: 1. what intuition is about functions 2. two possible definition of function, one iny my way (set of pairs), and one in your way (maybe similar to my "nonstandard" definition, you have to choose). 3, We should show difference between these definitions when comparing functions. For first definition it's enough to have domains and values of function for domain members to be the same. For second definition they also have to have the same codomain. Do you accept such solution? 123unoduetre (talk) 11:04, 23 May 2009 (UTC)
Is an inclusion of one set into another (for example, the reals into the complexes) equal to the identity map? Are the abstractly-defined integers to be identified with their image as a subset of the real numbers? How about their image under the homomorphism $f(n)=z^{n}$ for some arbitrary complex number z? Your answers to these questions have to be the same, and the last one had better be "no". For practical purposes we assume that the answer to the second one is "yes", but if we are giving "formal definitions" a map into the real numbers which happens to take values inside the image of the integers is not actually an integer-valued function. A map into the complex numbers whose values are all of the form $z^{n}$ can certainly not be considered integer-valued, since there are infinitely many possible x such that $z^{x}=z^{n}$ . It makes no sense to talk about equality of values except when the codomains are equal, and by extension it makes no sense to talk about a "set of pairs" unless you specify exactly which sets both coordinates of these pairs are drawn from. In a situation where all objects are considered to come from one "universal" set this may be automatic, and then a set-of-pairs definition for a function is appropriate, but only then. Ryan Reich (talk) 12:02, 23 May 2009 (UTC)
Answer to first question: no from axiom of extensionality. answer for second question: it depends how you define integers. when you do only arithmetics you could use von neumann's numbers for integers. but if you would like to work with reals you define integers as subset of reals. of course there is isomorphism. same for question 3, but in this case i use complex numbers. it depends on what i'd like to work with. i could also define is in some other way if there is isomorhism i'm interested in. But the most important thing in this case is, that numbers are defined axiomatically. So i could use any representation of them if it fullfils axioms, and i do not use any properties of representation outside my axioms. 123unoduetre (talk) 12:38, 23 May 2009 (UTC)
I see you understood the point I was making: what a function "is" depends on what you consider its inputs and values to be. A function from "the reals" to "the complexes" is properly specified by picking representations of both axiomatically-defined terms. Therefore, if the notion is to be useful (and I'm being intuitive right here) then when talking about functions between high-level objects like the reals and the complexes, we should never consider two of them the same unless both domain and codomain are the same, because the axiomatic definition of one may not require that it be contained in the other even if it sometimes is. Of course, that's for high-level objects defined axiomatically (and the axioms merely single out a class of isomorphic sets), but set theory and functions come before the rest of mathematics. Although it is possible when we have descended to the level of working with ur-elements of sets that one set is by definition a subset of another, we don't let that influence our definition of functions because philosophically we must make the distinction. It's the same as the distinction we make between two objects being isomorphic and being equal: for example, two unequal sets with the same cardinality are isomorphic; you can't have a set theory in which every cardinality has only one representative set, since that violates regularity. Since the axioms force us to make this distinction, we choose also to always distinguish between a set-as-a-subset and the same set on its own.
Don't tell me I'm being too intuitive, either. I'm giving the reasons that underlie our choice of definition of a function. In practice, everything we see is a structured object rather than a primitive set, and even you have already agreed that for these, equality of functions depends on the choice of codomain. Set theory is supposed to model the intuition about sets as well as the mathematical practice, so there is no reason to insist that we change the definition when dealing with "plain" sets. Put another way, every set is structured in the sense that we had to choose a model of ZFC first.
Finally, of course there's a place somewhere for a discussion of the historical definition of functions. But you will not find a modern book in most fields of math that claims that we should ignore the codomain, so don't try to pass this off as an equally valid alternative definition. Ryan Reich (talk) 13:56, 23 May 2009 (UTC)
Interesting point. I'll think about it for a while and give you my response. Thank you. 123unoduetre (talk) 15:21, 23 May 2009 (UTC)
Ok, i could give you an answer. I hope i get right wat you said. What i understood is, because we are using functions to deal with "high level" objects defined axiomatically, these functions should be different if they have different codomains, because it isn't stated in axioms if one of their codomains is subset of another. Please correct me if my understanding is wrong. In my opinion there is one mistake in this resoning. Either you use axiomatic method or not. If you do not use it, you do not use general notion of number and such. So you could assume being subset and such. But if you use axiomatic method, it's different. Now i'll try to explain how axiomatic method in set theory works in my opinion. 1. You find some axioms for something you have in mind, some structure etc. 2. You try to find some set theoretic object which fullfils them. If you find it you can be sure that axioms are consistent (if ZFC is). You can also be sure, that adding such object to set theory doesn;t extend it. 3 You add to set theory some new symbol (for example A) denoting universe of your structure, and other symbols denoting relations and functions on this structure. You also add sentence "<A,R1,..,Rn,F1,...,Fn> fullfills axioms of my structure" (it would be many sentences, i've shortened it). Now you could work with this structure, and you're sure that you do not use any underlying building blocks of A, becaue you didn't gave any information about them. The only thing you have are axioms of this structure. In this case you don't have A is subset of B, if A and B are different structure, so you cannot proove that functions are the same objects. I could give an example for first and second method of treatment. First method is as i said just selecting some partcular object and naming it. So i use von Neumann numbers and name it Natural Numbers (N). The structure would be <N,S,0>, where S is successor. I do not care if it fullfils the axioms, because i didn't give any. I get theorems from my defined structure, so i could for example proove that $\forall {y\in {N}}{S(y)\neq 0}$ . Etc. As you might see i'm not concerned about any generalisation at all, and i use things like $S(x)=x\cup \{x\}$ . Second method would be like that: I have Peano Axioms. I discover that von Neumann's numbers fullfill it. Now i know i could add such structure to set theory. So i add something like that: <N,S,0> fullfills peano axioms; S:N->N\{0}; 0\in{N}. Now i'm sure i do not use any of von Neumann numbers properties in my proofs. If i define real numbers with standard axioms of complete ordered field in same way, i cannot proove that functions from one to another are the same. I could only proof isomorphism of subset of reals to naturals. But of course i could proof equality on real numbers functions. I hope you understand my point of view now. Thank you for your time spent reading my posts. 123unoduetre (talk) 17:22, 23 May 2009 (UTC)
I also do not say that triple definition is wrong or doesn't go well with intuition. I'm only saying that 1. both definition are used in literature 2. If you select one definition you have to stick to it, and gave theorems about this one, not another one. 3. Theorem of function equality depends on definition of function. 4. the only way ob being sure that you didn't use any information about underlying blocks you create you structure from is not providing this information in axioms. 5. You could use all correct inferences. 123unoduetre (talk) 17:43, 23 May 2009 (UTC)
I agree. My point, which you've explained nicely, is that if one deals with a lot of objects with axiomatic properties it's best to require each function to come with domain and codomain, since at best two things merely have a natural inclusion one into the other, rather than one being a subset of the other. As long as you only work with the axioms, the definition of functions by triples is the required level of generality. I suppose that if your domain of discourse has only a few axiomatic objects, or none, everything being specified uniquely, identifying a function with the set which is its graph and forgetting the names of the coordinate sets is admissible. It's a matter of convenience in each case. I just can't think of many areas of math where there is an easily-identified universe; real or complex analysis, maybe, and the foundations, but not topology or algebra for sure (which accounts for what CS said about the split). Anyway, more industrious people than I have moved on already. Ryan Reich (talk) 18:03, 23 May 2009 (UTC)

Michael Artin's Algebra contains the following note in its Appendix, pp. 585-6: Template:Bquote His terminology is a bit wrong (he uses "range" for what we call "codomain"; he calls what is properly the range, the "set of values") but the idea is clear. Ryan Reich (talk) 11:14, 23 May 2009 (UTC)

I wouldn't call it wrong, or even a "bit wrong". The use of "range" for codomain is very common. --C S (talk) 11:19, 23 May 2009 (UTC)
Not in this article. It would be aggravating if 123unoduentre were to argue that the words were ambiguous (I mean, two functions definitely are different if their ranges-as-sets-of-values are different). After all, there are four other sources on my bookshelf defining functions as triples but not explicitly outlining the point in question here, and I wouldn't use those as evidence like I have Artin because although they support me, they don't unambiguously rule out the alternative. But next thing you'll know we'll be hearing that he defines "map" using the word "function" so the definition is circular and vacuous. Ryan Reich (talk) 11:32, 23 May 2009 (UTC)
The topology book he quotes does seem to unambiguously support the position that only the pairs of values defines a function. The next two however use the type A->B in the definition and do not say functions are the same if B is changed, and they do talk about onto and such concepts which don't work without the idea of a codomain. All three do not mention the word codomain at all. Dmcq (talk) 11:49, 23 May 2009 (UTC)
Of course it's possible that some authors are wrong. But from definition of function as set of pairs it logically follows what i'm talkin about. There is nothing like function onto. There is only function onto B. Definitions: f:A-->B <=> f is function and dom(f)=A and rg(f) subset B. f:A-onto->B <=> f is function and dom(f)=A and rg(f)=B. 123unoduetre (talk) 11:55, 23 May 2009 (UTC)
f is onto B <=> f is function and rg(f)=B 123unoduetre (talk) 11:59, 23 May 2009 (UTC)

123unoduetre, this type of condescending edit comment is certainly not helping your case, especially when you are simultaneously proving that you believe that concepts such as "function" have unique, immutable, definitions throughout mathematics. (Said he, going on to prove that Wikipedia has other editors who are more skilled in condescension.) Your definition is indeed the traditional one and still the more common one in set theory. But there is a general shift from the old style to the new style. Whenever a mathematician talks about a function that is "onto" without explaining "onto what", or about a surjective function, they are using the modern definition that includes the codomain in the official definition of the function. I made a little survey of set theory books:

• Jech (Set Theory) only uses the old definition.
• Enderton (Elements of Set Theory) mentions that "the general concept of 'a function' emerged slowly over a period of time" but uses only the old definition which does not include domain and codomain (and even seems unaware of the more recent definition).
• Halmos (Naive Set Theory) uses the old sense only, but has rudiments of the modern sense when talking about "functions from A to B".
• Kunen (Set Theory, An Introduction to Independence Proofs) is ambivalent. Officially he uses the old definition, but he introduces the $f\colon A\to B$ notation in a way that makes it very hard to use without hand-waving. Similarly Devlin (The Joy of Sets).
• Bourbaki (Theory of Sets) uses the modern sense exclusively. (Note that the English translation is defective: It jumps around between the words "mapping" and "function" where the original uses "fonction" consistently.)
• Ebbinghaus (Einführung in die Mengenlehre; Introduction to Set Theory, no English translation) defines functions as including domain and codomain and gives the following examples:
• f1: QQ, f1(x) = 7 for all x
• f2: Q → {7}, f2(x) = 7 for all x
• f3: QQ, f3(x) = number of prime divisors of 510510 for all x.
He says explicitly that from a mathematical point of view ("nach mathematischer Auffassung"), f1f2 because f1 and f2 have different codomains. (Not even so much as a hint that this might be controversial or a recent definition.) And goes on to explain philosophical issues that might lead one to doubt that f1 = f3. (He consistently uses the term "graph of a function" for a function in the old sense.)

Now this was just set theory. Perhaps the most natural context of the present article is category theory, and I find it hard to believe there is a single serious book on category theory that uses the old definition of functions.

The reason I felt it worth to do so much research is that the treatment at function (mathematics) is not entirely satisfactory. (Do have a look; it gives the modern definition as the standard and explains the old one as an alternative.) --Hans Adler (talk) 11:59, 23 May 2009 (UTC)

I see what has happened with the topology book by John L Kelley, it is a reprint of a 1955 text and the whole business was only being cleared up about then. Dmcq (talk) 12:01, 23 May 2009 (UTC)

That's why i proposed to show both definitions and explain differences between them in one of my previous posts. 123unoduetre (talk) 12:26, 23 May 2009 (UTC)

You quoted the topology book to back up your case. It is out of date in this respect. I don't see how you propose to get a definition of codomain from a list of books that don't mention the word.Dmcq (talk) 12:38, 23 May 2009 (UTC)
Perhaps you could just find one book that firstly mentions the word codomain and secondly says something like f: A->B and g: A->C are the same if the values of f(x) and g(x) are the same for all elements of A when B and C are subsets of a common set? Anything like that, the quotes saying they are different for different B and C seem pretty unambiguous. Not a derivation by yourself using logic, that would be original research, just a place people can look at thanks. Dmcq (talk) 12:52, 23 May 2009 (UTC)
Ok, i'll do my best. 123unoduetre (talk) 13:00, 23 May 2009 (UTC)
http://www.econ.upenn.edu/~mhoelle/teaching/mathcamp08/chpt4.pdf some lecture notes, word codomain used123unoduetre (talk) 13:12, 23 May 2009 (UTC)
And this is best source, it shows both definitions and discuss them: http://homepages.cwi.nl/~jve/svdi/RCRH7.pdf 123unoduetre (talk) 13:18, 23 May 2009 (UTC)
The first does not agree with you and the second has a couple of different definitions of a function. It refers to your type definition of equality of functions as "functions are identical (in the set-theoretic sense)", i.e. very definitely qualified, and when it talks about codomain it says the set-theoretic definition of a function can't cope with it. It says
"Note that the set-theoretic way of identifying the function f with the relation R = {(x, f(x)) | x 2 X} has no way of dealing with this situation: it is not possible to recover the intended codomain Y from the relation R. As far as R is concerned, the codomain of f could be any set that extends ran(R)."
The notes also discuss the definition of a function as an algorithm. Dmcq (talk) 13:40, 23 May 2009 (UTC)
That's exactly why i would like to create page which 1. tell what intuition stands behind function concept 2. show 2 common formal approaches, one would be function as set of pairs, and second would be function as for example triple. 3. Show differences 123unoduetre (talk) 13:48, 23 May 2009 (UTC)
This source is nice too: http://planetmath.org/encyclopedia/Function.html 123unoduetre (talk) 13:48, 23 May 2009 (UTC)
http://www.peter-dixon.staff.shef.ac.uk/teaching/STDN.PDF also word codomain used. 123unoduetre (talk) 14:22, 23 May 2009 (UTC)

Instead of arguing about whether the codomain is or should be part of the definition of a function, how about adding some reliable secondary sources, and basing the article on these references? That would be a tad more encyclopedic than unsourced analysis as to why the codomain is or isn't part of the definition, no? Geometry guy 12:54, 23 May 2009 (UTC)

And I don't mind if it is in Polish, I would like to see the word codomain in it though please. Dmcq (talk) 12:59, 23 May 2009 (UTC)
Of course it won't be word codomain. But it'll be polish translation of it. 123unoduetre (talk) 13:01, 23 May 2009 (UTC)
Fine, I'll struggle through, my guess is it comes from the German zielmenge but my wife knows Russian. Dmcq (talk) 13:20, 23 May 2009 (UTC)
Przeciwdziedzina is codomain: http://wazniak.mimuw.edu.pl/index.php?title=Matematyka_dyskretna_1/Wyk%C5%82ad_3:_Zliczanie_zbior%C3%B3w_i_funkcji but there is nothing about function equivalence. But i gave you example above where author discuss codomains (RCRH7.pdf) 123unoduetre (talk) 13:41, 23 May 2009 (UTC)
I suppose i've shown that definition i'd like to use is really used by mathematicians. It seems for me, that it's reasonable to create articles which explain both definitions and differences between them. I'd be thankful to people who could help me create them well. Thank you. And of course thank you for interesting discussion. 123unoduetre (talk) 14:27, 23 May 2009 (UTC)
And big thanks for Hans Adler for making research on this topic. 123unoduetre (talk) 14:31, 23 May 2009 (UTC)
Hans and I have added a bunch of sources to the article. Additionally I've linked to a bunch of quotes from Google books which demonstrate the diversity of views on the notion of codomain in the literature. Try to write the article based on what its sources say. If you don't think the sources are a representative sample, add to them or change them for others. Geometry guy 15:11, 23 May 2009 (UTC)
Thank you. I'll check it after answering to the point Ryan Reich made. 123unoduetre (talk) 15:21, 23 May 2009 (UTC)
I think I can can see the problem from the Polish article. Mostly it is fine but it says things like $(x,y)\in f$ rather than in the graph of f. I think they were just being sloppy but I'm not absolutely sure. I wasn't able to spot an equivalent of range (mathematics) which is totally confused between image and codomain in the English but they do have image (mathematics). As to changing this article I haven't seen evidence of a diversity of views where codomain is mentioned, range certainly but not codomain. Dmcq (talk) 15:53, 23 May 2009 (UTC)
Just had a good look at those references inserted into the article. The Ian Stewart et al one is pretty unambiguous about accepting the set-theoretic version and calling it codomain as being an acceptable practice though he also says the triple is more formal. Okay that pretty much clinches it, the additions that have just been added deserve their place in I guess. Dmcq (talk) 16:06, 23 May 2009 (UTC)
Thank you for incorporating changes. 123unoduetre (talk) 17:27, 23 May 2009 (UTC)

here's a related source:

Does anyone know a primer on proofs that uses the 'mathematician's' definition of function? It's not surprising that a book about 'how to prove things' takes a more logical approach.Adam.a.a.golding (talk) —Preceding undated comment added 11:22, 29 December 2009 (UTC).

The book you mentioned seems to be okay about functions as far as modern mathematics is concerned, why did you give a search highlighting 'relation'? Dmcq (talk) 12:21, 29 December 2009 (UTC)

## Codomain of a morphism

While we're at it, this article also needs to contain the definition of the codomain of a morphism as used in category theory. Paul August 16:27, 23 May 2009 (UTC)

Yes. I've written short note in my version of article about category theory, that codomains are primitives there. I suppose my version wasn't as good as i thought. I would like to work with all of you to create better unbiased one. Thank you. 123unoduetre (talk) 16:43, 23 May 2009 (UTC)

## Composition example and what are domain and codomain - sets, type variables, ...?

I am not sure that function composition should require the codomain of the function on the right side of the composition to be same as the domain of the function on the left side and that the image is "indeterminate at the level of the composition". I would say both codomain and image are consequences of a function's definition, so that as soon as we can prove that the image of f is a subset of the domain h (for which it suffices but is not necessary to prove that the codomain of f is a subset of the domain of f), we can define the composition $h\circ f$ .

The question is actually, whether X and Y in the triple (X, Y, F) are mere sets or some kind of type variables. The statement that image is "indeterminate at the level of the composition" would only make sense if X and Y in the triple were not just sets but some metamathematical type variables so that they were more "determinate" than the image of F. In some programming languages such a type system might indeed be beneficial because it helps to assure that the code is correct. E.g. in Java one might use Java classes to represent sets and then using generics one might create an interface

interface Function<S,T>


representing a function that converts an instance of class S to an instance of class T, and a class

class CompositeFunction<S,T> implements Function<S,T>


with a constructor

<U> CompositeFunction(Function<? super S,? extends U> first, Function<U,? extends T> second)


But in a mathematical proof one has got other means of proof than a type system, so I think the type system is not absolutely necessary.

Anyhow, I think the more important thing about including codomain in the definition of function is whether we can make statements like "Function f is a surjection." and "Function f is a bijection." or we have to (or at least formally would have to) explicitly mention the target set in order to be able to talk about surjectivity and bijectivity, i.e. we could only make sentences like "Function f is a surjection to Y.". So I think it should be said before the composition example that the "new" definition of function (the one that defines function as a triple (X, Y, F)) makes surjectivity and bijectivity properties of a function. After that, one might give the composition example with the explanation that there are different possible formalisms and in one formalism, where one regards codomain as a type variable, one might say that the image of a function is "indeterminate at the level of the composition". In fact, without such an explanation I would rather cut out the composition example because it is a bit confusing.

Well, and then the domain and codomain are also commonly used to make statements like "Function f is continuous." or "Function f is open." or "Function f is monotone." or "Function f is a group isomorphism.", which are actually formally incorrect if one considers the domain and codomain as just sets. In practice, of course, one has the justification that the algebraic/topological/order structure of domain and codomain are often obvious from the context. The justification might indeed be a bit more formally sound if one considers the domain and codomain as metamathematical variables.

But I still think that the simple consequence of incorporating codomain in function definition - being able to talk about a function being surjection - should be mentioned first and after that, if at all (i.e. if someone takes the effort to elaborate on it), the more complex issues that depend on whether we consider the domain and codomain as mere sets (the composition example and being able to talk whether a function is continuous, for example).

I don't quite understand what the linear transformation example is trying to say but it also seems to be something more complex than merely a consequence of codomain being a set and should also (if at all) be more clearly worded. —Preceding unsigned comment added by Jaan Vajakas (talkcontribs) 14:14, 1 June 2009 (UTC)

This is a very long comment, and it's impossible to respond to everything you brought up in a few lines. So I will restrict myself to a few aspects.
• Making domain and codomain part of the definition of a function can indeed be seen as the mathematical equivalent of a type system as you describe it. But to stay in your metaphor, if we want to compose a map f with codomain A, which is a subset of B, and a map g with domain B to get a new map gf, then we can do it because there is an implicit type cast from A to B. Or in more usual mathematical terms, when we write gf we really mean gif, where i is the inclusion function from A into B.
• I don't know what you mean by "metamathematical variables". I think the most natural way to think about continuity of functions is to start by defining a "function" from a topological space to another as a function between the underlying sets. Then continuity is a property of "functions" between topological spaces.
• I think the point of the linear transformation example is that it motivates codomains insofar as linear transformations have a natural codomain that will be assumed without a second thought even by many mathematicians who would ordinarily define functions without a codomain. --Hans Adler (talk) 15:01, 3 June 2009 (UTC)
I just disliked the categorical statements that the composition the image is "indeterminate at the level of the composition", so I thought about when one could say such things and came to the conclusion that such a statement could only be justified if the knowledge about the domain and codomain of a function (or more precisely, the codomain of a function being equal to or subset of the domain of another function) would be on qualitatively different level than that of the image of the function. Since one can use a mathematical proof to prove that the image of a function is in the domain of another function, I called the knowledge of the domain and codomain "metamathematical" or "type system".
In practice, this "metamathematical" knowledge could mean e. g. that we use in the mathematical text the same variable for the codomain of the first function and the domain of the second. The variables used in the mathematical text are not mathematical objects in the sense that the text never makes statements about its variables, but rather the mathematical objects referred to by the variables. For example, if we have defined two set variables A and B, then we might be able to mathematically prove that they are equal sets, but that does not make them equal as variables. So this "metamathematical knowledge" would be easier to obtain (just compare variable names), but could not be used to prove all the results that can be proven by a mathematical proof.
This theory was just my invention, but otherwise I just cannot see how one can make statements like "image is indeterminate at the level of the composition". But I am not sure that this formalism should be explained in the article, as too much formalism could make things unnecessarily complicated. I would probably rather just remove the statement that "image is indeterminate at the level of the composition" and I would not say "the composition $h\circ f$ does not make sense" because in this example it is quite obvious that the image of f is in the domain of h.--Jaan Vajakas (talk) 13:28, 4 June 2009 (UTC)
I believe the statement "the image is indeterminate at the level of the composition" is a good description of the rationale. The composition $h\circ f$ is not defined when using the definition of a function by the triple (X,Y,F) and the definition of composition for such functions as requiring the domain of one to be the same as codomain of the other. The statement is an attempt to make the article mean something to casual users rather than just give a formal definition. Dmcq (talk) 14:24, 4 June 2009 (UTC)
I suppose some rewording could be applied, but it's not so important, because these sentences are all informal, and of course they depend on definition of composition. I agree that definition of composition used with definition of function as triple, which requires codomain and domain equal is useful for people using such definition of function, because it makes it not dependent on function image. Nevertheless from formal point of view all terms are defined in FOL, so the statement that such composition is undefined isn't formally true. But it could be read as "it's defined as some object, but it's unimportant pragmatically what object is it, because it isn't useful object, and it doesn't work as expected when we use and think informally about composition". Of course we could use other logics with undefined terms etc. That's why i suppose details aren't so important, because for normal mathematician he/she doesn't have anything particular in mind when using such composition, where codomain isn't equal to domain, so he/she could say it's undefined, which means "it could be some object but you could define it as any object you want, and it isn't important what object it is". I'll try to reword it, and if you like it, use it, if not revert. 123unoduetre (talk) 19:34, 7 June 2009 (UTC)
I don't understand why you keep on trying to remove the whole point of codomains. You're writing in an article about codomains. They only really have relevance for functions defined by a triple (X,Y,F). It isn't a useful idea for functions defined as a set theoretic relation. Function composition for functions defined by (X,Y,F) is only defined when the domain of one is equal to the codomain of the other. Often people expect implic type transformations where the codomain is contained in the domain of the next function but that;s an extension. What you have put in is only really relevant to functions defined as relations and is I think messing the whole business up. Dmcq (talk) 22:44, 7 June 2009 (UTC)
The article Function composition deals with the whole business properly I think. The two types of definition of a function are treated separately and refer to codomain only for the case where functions are defined by a triple(X,Y,F). Dmcq (talk) 23:08, 7 June 2009 (UTC)
I agree with Dmcq. In my current (tired) state I am not touching the article, but the suggestion that composition is defined when domain and codomain are different is a serious regression that needs to be fixed soon. --Hans Adler (talk) 01:13, 8 June 2009 (UTC)
I do not try to remove the point of codomains. If you look what i said previously you might notice that i accepted this form of article. I also agree about how it's written now accept, that people might use triple definition. You might also notice, that my change considered completely different topic. You might also notice, that i made these changes in the spirit of "triple" definition of function, not "old" definition. Could you please explain why reverting my changes while not providing explanation? As you might notice my change was only rewording of some example to better suit formal mathematics, but it still is about functions defined as triples, not "old" definition. Besides that, Function composition definition of composition do not need codomain equal to domain as you might notice when you look into Example section. But as i said before I think codomain definition issue is solved and it's completely different issue. It has little to do with my modifications. That's why i see reversion as unmotivated and rerevert. Please provide explanation. 123unoduetre (talk) 15:16, 9 June 2009 (UTC)
Very sorry, I just read again what was said again and it is fine. I don't know why I misread it so wrong before. You did remove the bit about it being part of the definition which I preferred but the sense is okay and that's the important thing. Dmcq (talk) 19:03, 9 June 2009 (UTC)

## linear transformation example

Since the purpose of this example seems to be to demonstrate the importance of the codomain to people who don't generally deal with maps at that level of abstraction, it might make sense to make the example more concrete. For example instead of talking about linear transformations from R^n to R^m generally, specific spaces could be used, (R^2 to itself for instance, with the example of a non-surjective map being some simple rank 1 transformation, like (x,y) -> (x,0)) This is an idea that would be familiar to anyone with high school math. I would change it, but I'm sort of new to this, and also there seems to be some controversy surrounding this example and I'm scared. Anyway, just a thought.

On second though, I made the change, but obviously feel free to edit or revert it if this made things less clear rather than more.Rckrone (talk) 20:17, 21 June 2009 (UTC)

## Alternative name

Range? 68.173.113.106 (talk) 03:23, 6 March 2012 (UTC)

See the second sentence in the lead. Also range can be clicked on as it is blue and that takes you to an article about it. Dmcq (talk) 09:12, 6 March 2012 (UTC)