From the book principle of mathematical analysis define 2.1:

Consider two sets $A$ and $B$, whose elements may be any objects whatsoever, and suppose that with each element $x$ of $A$ there is associated, in some manner, an element of $B$, which we denote by $f(x)$. $f$ is said to be a function from A to B(or a mapping of A into B )

My understanding: when we talk about a function, formally, we have to specify the domain $A$ and the codomain $B$.


  1. the function $f(x)=2x$, with the domain A=[1,2] and codomain B=[2,4]
  2. the function $f(x)=2x$, with the domain A=[1,2] and codomain B=[0,100].
  3. Strictly, formally, that is two different functions, right?
  4. Actually the former one is a surjective function, and the latter is not, right?
  • $\begingroup$ See this discussion Basically, there are two ways of thinking about a function, leading to slightly different issues. $\endgroup$ – Arturo Magidin May 23 '19 at 17:47
  • $\begingroup$ In your example, isn't $A$ the domain and $B$ the codomain? As for your examples, your assertions are correct. $\endgroup$ – John Douma May 23 '19 at 19:03
  • $\begingroup$ See also math.stackexchange.com/q/60365. $\endgroup$ – Paul Frost May 23 '19 at 23:18

To a set theorist the examples are the same function. In set theory a function IS its graph (as set theorists want everything to be a set). With this definition, a function can be said to be injective/surjective/bijective from its domain to a specified co-domain.

Your example is surjective to $[2,4]$ but not to any other set.

Anther term is the image of a function $f$, which is $\{y: \exists x\,(\,(x,y)\in f\}$. Note that "$\in f \,$" means "in the graph of $f $ ".

| cite | improve this answer | |
  • $\begingroup$ Concerning the set-theoretic concept of a function you are right - unfortunately ;-) I would prefer to define a function as triple $(X,Y,f)$, where $X,Y$ are sets and $f \subset X \times Y$ is a subset with suitable properties. $\endgroup$ – Paul Frost May 23 '19 at 23:24
  • $\begingroup$ so, if we define a function as a triple $(X, Y, f)$, then $X$ is the domain, $Y$ is the image, and the $f$ is the rule? In this case, we don't care about the codomain that much, and think it as an additional thing of the function. $\endgroup$ – dawen May 24 '19 at 16:04
  • $\begingroup$ @dawen: No, generally in that formulation, $Y$ is the codomain, a set that contains (but need not be equal to) the image. $\endgroup$ – Arturo Magidin May 24 '19 at 17:31
  • $\begingroup$ Don't use math mode for italics; math italic is different from regular italic, and hard to read. To get italics, use *: e.g., writing *this* will produce *italics*, and two asterisks yields **boldface** gives: writing this will produce italics, and two asterisks yields boldface. $\endgroup$ – Arturo Magidin May 24 '19 at 17:40
  • $\begingroup$ OK, so, actually, the domain\codomain\image(which is implicitly in the $f$)\ everything is inside that triple formulation $(X, Y, f)$. And if we just consider the $f$, my example is actually the same function, but if we use the triple formulation, it is not the same function. $\endgroup$ – dawen May 24 '19 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.