If I understand correctly, in ZFC set theory, a function is just a set of ordered pairs with certain properties. The codomain set is just the set of all its 2nd co-ordinates (ordinates). There is no distinction made between the codomain and what is commonly called the range of a function. So, every function in ZFC set theory would be surjective. Is that correct?
-
3"The codomain set is just the set of all its 2nd coordinates. There is no distinction made between the codomain and what is commonly called the range of the function" Without additional context provided, that may be correct... however there are plenty of times where we want to be specific and we will intentionally specify the domain and codomain when defining the function. To accomplish this, rigorously we might choose to call a function not just a set of ordered pairs... but rather an ordered triple $F=(f,A,B)$ where $A$ is the domain, $B$ the codomain, and $f$ the set of ordered pairs. – JMoravitz Apr 28 '22 at 16:29
-
1If that were the case then the empty set wouldn't be the initial object in the category of sets – MIO Apr 28 '22 at 16:30
-
@aldodecristo In category theory, functions are primitive objects, and are not defined, unlike in set theory, where functions are sets. Thus, in each context, a different definition is used. There is nothing wrong with the set-theoretic definition. There is no contradiction there. – Angel Apr 28 '22 at 16:35
-
That is not at all the usual definition of the codomain of a function. Under the usual definition, the codomain and range are very often not equal. – Malice Vidrine Apr 29 '22 at 15:30
-
1@Angel: That is extremely misleading to say and it is quite unclear what you mean by "in category theory". Category theory is typically formulated within a background set-theoretic foundation for mathematics, just like the rest of mathematics. It is certainly ludicrous to say that functions are "not defined" in this context, unless you are specifically referring to something like using ETCS as a foundation (which is not at all what "in category theory" means). – Eric Wofsey Apr 29 '22 at 19:57
3 Answers
Surjectivity is a relationship between a function and a set. It is an extrinsic property of a function, when the function is defined as a set of ordered pairs. Not an intrinsic one like injectivity is.
So talking about whether or not "a function" (in the context of $\sf ZFC$) is surjective is kind of meaningless, in the sense that the information is missing. Normally, however, we have an implicit context for a function where we also assign it a domain and codomain, and then we can ask whether or not the range is equal to the its codomain, in which case it is indeed surjective.
For this reason, when we talk about functions we normally say things like:
- let $f$ be a function from $A$ onto $B$.
- The function $f\colon A\to B$ is surjective.
We are including the necessary context in this text.

- 393,674
-
Can this be done using only ZFC theory or do we need to "step outside" of ZFC. – Dan Christensen Apr 28 '22 at 16:42
-
1
-
@AsafKaragila Things likes indicating whether or not a function is surjective. – Dan Christensen Apr 28 '22 at 16:52
-
4@Dan: The statement "$f$ is surjective onto $B$" is a statement in the language of set theory, since it states that the range of $f$ equals to $B$. I'm not sure at what point we had to "step outside". It is just not an intrinsic property of being a particular set of ordered pairs, since $B$ is not part of the definition here. – Asaf Karagila Apr 28 '22 at 16:53
-
-
@Dan: If you are working in positive logic, where negation is not part of your language, then you can't do that. – Asaf Karagila Apr 28 '22 at 16:57
-
-
-
My guess is that there are no non-surjective functions in formal ZFC theory. But I stand to be corrected. – Dan Christensen Apr 28 '22 at 17:05
-
1@DanChristensen If you can say "$f$ is surjective onto $B$", and you have negation, why can't you say "NOT($f$ is surjective onto $B$)"? – Arturo Magidin Apr 28 '22 at 17:20
-
@Dan: I guess you also think that in this world everything is "big", right? My point is that "big" is relative to something else. Yes, Mount Everest is big, but it's tiny compared to the whole continent. Yes, an ant is big, but in relation to a bacteria, not in relation to a human. Likewise, "$f$ is surjective", without additional context, is a meaningless statement. – Asaf Karagila Apr 28 '22 at 17:22
-
@AsafKaragila How would you translate into the formal language of ZFC/FOL: The function $f: A\to B$ is not surjective? What other context is required? – Dan Christensen Apr 28 '22 at 17:28
-
2@Dan: When writing $f\colon A\to B$, we usually interpret this as the formal statement that is the conjunction of (1) $f$ is a set of ordered pairs satisfying the property of "being a function"; (2) the domain of $f$ is exactly $A$; (3) the range of $f$ is contained in $B$. If you want to add surjectivity or its failure change (3) to be "equal to" or "proper subset of" as necessary. – Asaf Karagila Apr 28 '22 at 17:32
-
@AsafKaragila So you have the surjective function $f: A \to B$ where $B\subsetneq C$ for some set $C$? – Dan Christensen Apr 28 '22 at 17:46
-
1@Dan: Yes. Because surjectivity is a relationship between a function and a set. – Asaf Karagila Apr 28 '22 at 17:52
-
@AsafKaragila But even with your little trick here, you do not have a ZFC-style function mapping $A$ to $C$. – Dan Christensen Apr 28 '22 at 21:22
-
4@DanChristensen I don't understand your arguing for there being a trick. This is all purely based on definition. What is your definition of surjective? If you your definition of $f$ being surjective is "$f$ is surjective iff for all y in codomain exists $x$ in domain such that $f(x)=y$" then yeah all functions are surjective, but that's a stupid definition of surjective. The normal one would given $f\subseteq A\times C$ $f$ function, we say $f$ is surjective iff $\forall y\in C$ $\exists x\in A f(x)=y$. This definition implicitly defines surjectivity conditionally on choice of $A\times C$. – DRF Apr 29 '22 at 08:32
-
@DRF That is indeed my definition. Really quite mainstream. I don't see how it is inconsistent with your definition. As for "trick", I meant that respectfully. It's a clever workaround I hadn't thought of, but IIUC it does not result in a ZFC-style non-surjective function mapping $A$ to $C$. – Dan Christensen Apr 29 '22 at 15:38
-
2@DanChristensen What "is" your definition. I gave two in my comment. And the second one results in a non-surjective function. Also I'm really confused what ZFC has to do with most of this. ZFC is a collection of very basic (in terms of hierarchy) axioms that is used to build a foundational framework for most of the rest of mathematics. ZFC doesn't even define a function much less surjectivity. – DRF Apr 29 '22 at 21:18
Your question has nothing to do with ZFC set theory specifically and is just about the definition of "function" that you choose to use. ZFC set theory does not define "function" any more than it defines "group" or "Hilbert space"; it just provides a foundational theory in which all of these notions can be defined (in various different interchangeable but not exactly identical ways) and worked with.
So, if you define a function as just a set of ordered pairs in which no two distinct elements have the same first coordinate, then yes, there is no point in talking about whether such a function is "surjective". If you define a function to have a codomain as part of its definition itself (as in Angel's answer), then it is meaningful to ask whether a function is surjective. Or, as in Asaf's answer, you can not include a codomain in your definition of a function and instead talk about whether a function is surjective with respect to some chosen codomain.
All of these are reasonable choices and can be done within ZFC set theory or pretty much any other foundation for mathematics that you might want to use instead. Which definition you choose has nothing to do with the specific foundational axioms you are using. The only connection this has with ZFC is that set theorists tend to use the codomain-less definition more often than other mathematicians do, since it has some technical conveniences in the context of axiomatic set theory that it doesn't have in most other parts of math.

- 330,363
While some authors do define functions as just sets of ordered pairs, this is largely an oversimplification aimed at a beginner-level audience in mathematics. An author with more educated and sophisticated audience, though, will make the distinction between a relation and a graph, and thus a function, and a graph. Whether an author uses one definition or the other also depends on how old the text is. Older authors tend to use the simpler definition you gave, but more modern authors tend to be more careful in distinguishing functions and graphs.
Consider two sets $X$ and $Y.$ The Cartesian product is denoted $X\times{Y}.$ A subset $G$ of $X\times{Y}$ is called a graph, though in graph theory, graphs are almost always defined for when $X=Y.$ The graph $G$ is called a functional graph if and only if
- For every $y\in{Y},$ there exists exactly one $x\in{X}$ such that $(x,y)\in{G}.$
In older texts, $G$ is just called a function, rather than a functional graph. Under this definition of a function, it actually is meaningless to talk about surjectivity, because the domain and graph uniquely determine the codomain.
In newer texts, a function would instead be defined by $F=((X,Y),G).$ In other words, to have a well-defined function, you must have a well-defined domain, well-defined codomain, and a well-defined graph. Changing the codomain changes the function, even if the graph and codomain are the same. In this context, $Y$ is the codomain, and $F[X]\subseteq{Y},$ where $F[X]$ is the range of $F.$ Surjectivity is then defined as $F$ having the property that $F[X]=Y.$ This can be done in the language of ZFC. This can be done in any language forming a Heyting algebra. If $Y\subset{F[X]},$ then $G$ violates the functional graph axiom, so $F$ is not a function.

- 3,774
- 12
- 14
-
You have raised points that motivated my question in the first place. In ZFC theory, to construct a function, you need only establish the existence of a set of ordered pairs with certain properties. In a more modern approach, as you class it, you must first establish the existence of 3 sets that are to be used as the domain, codomain and graph of the required function. The function operator is then defined in terms of these 3 sets. It has the advantage of being able to tell us not only if $y=f(x)$ is true or false as in the other approach, but also whether it is defined or undefined. – Dan Christensen Apr 28 '22 at 18:24
-
... In the other approach, "y=f(x)" would sometimes be classed that are false when it would more rightly be thought of as being undefined. Where $x$ is not in the domain of $f$ the definition of the function operator $f$ should not be applicable IMHO. – Dan Christensen Apr 28 '22 at 18:46
-
... It seemed to me that non-surjective functions could not be represented in ZFC, but @Asaf gave a simple, though somewhat unsatisfying workaround. But we still do not have a ZFC-like function mapping set $A$ to set $C$ in my example. – Dan Christensen Apr 29 '22 at 00:25
-
9I strongly disagree with the idea that defining a function as a set of pairs satisfying uniqueness in the first coordinate is in any way an oversimplification for beginners. It's a perfectly valid and common definition of a function, used in many advanced texts, and can easily be non-surjective, based on which cartesian product you're considering. The function ${(x,x^2);x\in \mathbb{R}}\subseteq \mathbb{R}^2}$ is non-surjective. – DRF Apr 29 '22 at 05:55
-
5I just pulled out Set theory (and introduction to independence proofs) By Kunen and he defines: "A relation is a set $R$ all of whose elements are ordered pairs." He defines domain and codomain in the usual way and than defines a functions: "$f$ is a function iff $f$ is a relation and $\forall x\in \text{dom}(f);\exists !y\in\text{ran}(f) (\langle x,y\rangle\in f)$". Personally I wouldn't say Kunen's text is aimed at a beginner-level audience. Though I suppose your milage may very. You could say Grad students are beginners. – DRF Apr 29 '22 at 06:02
-
@DRF Some readers here may think of Kunen at 78 as an "older author." – Dan Christensen Apr 29 '22 at 17:39
-
1@DanChristensen The book is from 1980 unless I'm mistaken, but yeah in my mind I definitely wouldn't call someone who's been dead 2 years an older author. Especially since as far as I can tell there's no newer set theory book of this level. Kunen and Jech are still the mainstays from what I can find. – DRF Apr 29 '22 at 21:27
-
1@DanChristensen: What about Jech? Halbeisen? Dzamonja? What counts as "recent" for you? – Asaf Karagila Apr 29 '22 at 22:07
-
@AsafKaragila The book may have been from 1980, but the author was from 1943. Don't know about the others. – Dan Christensen Apr 30 '22 at 13:18
-
1@Dan: So, you will only accept books written by people under 30? I don't understand the point you're trying to make. – Asaf Karagila Apr 30 '22 at 13:19
-
@AsafKaragila Angel is just pointing out a trend in mathematics, one I support and think will continue. – Dan Christensen Apr 30 '22 at 13:53
-
2