Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking through some lecture notes, and found that the author defined two functions f and g to be equal if:

  • they have the same domain, say S,
  • they have the same codomain, and
  • f(x)=g(x) for all x in S.

This seems peculiar to me. In the notation of relations, for instance, this implies that

  • the relation $R=\{(t,\sqrt{t}): t \in \mathbb{R}^{\geq 0}\} \subseteq \mathbb{R}^{\geq 0} \times \mathbb{R}$ and
  • the relation $R'=\{(t,\sqrt{t}): t \in \mathbb{R}^{\geq 0}\} \subseteq \mathbb{R}^{\geq 0} \times \mathbb{R}^{\geq 0}$

are not equal (despite $R=R'$).

Question: Is there any reason to define two functions as non-equal based solely on their codomains?

share|cite|improve this question
up vote 11 down vote accepted

It can be convenient to require that codomains are part of the definition of a function. For example, when speaking of surjectiveness: If $f=g$ and $f$ is surjective, then $g$ is surjective, but only if we are careful to require that equality implies having the same target set.

The first function you defined is not surjective. The second one is, and in fact it is invertible.

Similarly, the inclusion $\mathbb Z\to\mathbb R$ is for some purposes different from the identity map $\mathbb Z\to\mathbb Z$.

It is true that in many contexts it hardly matters. You might be interested in this MathOverflow question coming from a case where the distinction was considered important.

share|cite|improve this answer
Thanks for that. Makes sense, although this suggests that the relation-based definition should (strictly speaking) include the domain and codomain along with the relation itself. – Douglas S. Stones Dec 16 '11 at 7:53
@Douglas: Bourbaki and many categorically inclined people include domain and codomain in the definition of a function whereas many set-theoretic texts don't adhere to that convention. See also this MO thread. – t.b. Dec 16 '11 at 8:05
Thanks, that's very helpful. – Douglas S. Stones Dec 16 '11 at 9:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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