1

This specific question has arisen out of my attempts to do a wider exercise (link).


Context

We say two functions, $f$ and $g$, are equal if all three of the following conditions are met:

  • (i) they have the same domain
  • (ii) they have the same codomain
  • (iii) they map the same elements of the domain to the same elements of the codomain

Note 1: Textbook definitions (eg Tao Analysis I) say codomain for the second requirement, and not range. The range is the set of actual values mapped to by the function, and the codomain can be equal to the range, or a superset.

Note 2: The third condition can be stated as $f(x) = g(x)$ for all $x$ in the domain.


Question

The exercise I'm doing states that functions represented as n-tuples must be surjective. I asked why in that question, and that led me to what I think is the root cause of my misunderstanding.

The following example was given by a contributor (link):

Think about the functions :ℝ→ℝ and :ℝ→[0,+∞) where, for all ∈ℝ, ()=():=$^2$. Using the three-step definition of equality for functions, ≠ since codomains don't match: ℝ≠[0,+∞). You cannot deduce from "()=() everywhere" what were the codomains of or . Unless, of course, we demanded that the functions were surjective. But here was not surjective.

In my mind, if we know that the range of two functions is the same, then that is sufficient to say the second requirement (ii) for function equality. Is this wrong? Why?


Discussion

I am aware that the domain is the full set of values that can be input to a function, but that the codomain can be a superset of the range, the actual values mapped to by the function.

Consider a very simple example of two functions:

$$f(1) = a, f(2) = b$$ $$g(1) = a, g(2) = b$$

If we are given that the domain is $\{1,2\}$, we can say the two functions have the same domain. This is requirement (i) for function equality.

We can also see the two function map the same input to the same output, that is, $f(x)=g(x)$ for all $x$ in the domain. This is requirement (iii) for function equality.

In this simple example, we know there is no other value mapped to by $f$ or $g$ outside the range $\{a,b\}$.

For requirement (ii), I contend that we are given the range $\{a,b\}$ and this is sufficient to satisfy the requirements for function equality, given (i) and (iii) are also met.

In summary, we don't always know the range, but if we do, I suggest it is sufficient for condition (ii).

Going back to the example given using $f(x)=g(x)=x^2$. We know:

  • (i) the domains are the same, $\mathbb{R}$
  • (iii) the two functions map the same inputs to the same outputs
  • (ii) the range of the two functions is the same, $[0,+\infty]$

We know $f$ and $g$ can't take values outside this range $[0,+\infty]$, so a codomain of $\mathbb{R}$ isn't more useful or informative than $[0,+\infty]$. In fact it is less informative than the actual range.

So again, in my mind, the two functions are equal.

Why am I wrong?


Update:

In terence Tao's Anlsysis I 4th edition, he states the codomains must be the same. However in the 3rd edition he states the ranges must be the same. Curiouser and curioser ...


Penelope
  • 3,147
  • 1
  • Why codomain and not range? Because given the domain and the "rule" that describes the function, the range is uniquely determined: the set of "output" values. – Mauro ALLEGRANZA Mar 26 '24 at 13:58
  • But obviously two function with same domain can have the same range but still being different... – Mauro ALLEGRANZA Mar 26 '24 at 14:01
  • In note 2, you mean "$f(x) = g(x)$", not "$\dots g(y)$". – Eric Towers Mar 26 '24 at 15:23
  • It makes sense to say the function $f:\mathbb{R}\rightarrow\mathbb{R}$ given by $f(x) = \cos(x)$ for $x\in\mathbb{R}$ is also a function $f:\mathbb{R}\rightarrow[-1,1]$. – Michael Mar 26 '24 at 16:58
  • In Terence Tao's Analysis I 4th edition, he states that the co-domain must be equal. However in the 3rd edition he states the range must be the same. – Penelope Mar 26 '24 at 21:36
  • @MauroALLEGRANZA - replying to you "why" comment. If we have $f:\mathbb{R} \to \mathbb{R}$ where $f(x)=x^2, x \in \mathbb{R}$, then surely this is the same function as $f:\mathbb{R} \to \mathbb{R}^{+}$ ? What is the benefit of saying they are different? There is no benefit from making clear the "type" of output object, and there is benefit in restricting the scope of the codomain to the actual range, which is useful information. – Penelope Mar 26 '24 at 21:40
  • 1
    See here and here. It basically depends on whether you are thinking of functions as ordered triples, (rule,domain,codomain) or as sets of ordered pairs. Both viewpoints are actually important, and they each have strengths and weaknesses, so you usually want to have both in mind. To your last question: the benefit of distinguishing between the function mapping $x\in\mathbb{R}$ to $x^2$ with codomain $\mathbb{R}$ and with codomain $[0,\infty)$ is that only one of them is surjective. – Arturo Magidin Mar 26 '24 at 22:04
  • If you restrict the range of a function to its codomain then all functions are surjective. I suppose this could be argued as a matter of semantics but I ask you. Suppose you had a function $f(x)=x^2; x\in \mathbb R$ and the question you wanted to ask your self and others was "Does $f$ map to all of $\mathbb R$?", how would you think is the best way we should frame our language in order to describe that question and that concept. – fleablood Mar 26 '24 at 22:26
  • 1
    Usually when a function is introduced its codomain is given explicitly, and we only consider whether two functions are equal if we already know that they have the same domain and codomain. Sensible mathematical writing won't depend implicitly on technicalities like this. – Karl Mar 26 '24 at 22:28

0 Answers0