0

Consider this text from page 7 of the book in the title.

"In the case of the function abs, if we are working with integers, the domain and the range are Z, so we write abs : Z−→Z. In the case of the addition function for integers, the domain is the set of pairs of integers Z × Z and the range is Z, so we write add : Z × Z−→Z. Note that a function may not necessarily use all the elements of the specified range. The function abs never takes on the value −1 even though −1 ∈ Z. A function that does use all the elements of the range is said to be onto the range"

A couple things I find confusing...

  1. Is the purpose of range not to specify what exactly the output of the function can be? Why can the set of integers be the range of abs() when integers include negative numbers?

  2. Consider the wording "The function abs never takes on the value −1 even though −1 ∈ Z". Is "takes on" equivalent to saying "produces an output of"? "Takes on" sounds to me like input but abs() does take input of -1.

  • The book appears to be confusing “range” and “codomain”. A function $f$ is defined on some domain $A$. Its range is the set ${x \mid \exists a \in A (x = f(a))}$. We write $f : A \to B$ if $A$ is the domain of $f$ and $range(f) \subseteq B$; we say that $B$ is “the codomain” (though a function can have more than one codomain; we typically fix a single codomain of a function). When writing code, the codomain is the type that the function outputs; there is typically only one codomain unless inheritance exists. – Mark Saving May 02 '22 at 21:17
  • This is not the only place where I've seen "range" used as a synonym for "codomain". People who use "range" this way usually use "image" to mean what others call "range". – Andreas Blass May 03 '22 at 00:30
  • I have seen both seen "range" used to mean codomain and to mean image many times. I believe (but could well be wrong) that "codomain" was first coined exactly because the more traditional "range" was also used to mean "image". – Paul Sinclair May 03 '22 at 19:40

1 Answers1

1

In standard English mathematical usage "$f$ takes on the value $-1$" means that $-1$ is a possible output for the function $f$. We might say "$f$ takes $-1$ as an input", but we would not say "$f$ takes on $-1$ as an input". The "on" indicates some outside of $f$, not inside.

Of course when it comes to language, there are no fixed rules, no matter how hard people try to make them. So just because I say this is true, doesn't mean that others will agree. But this is what I believe your book is following. And it is the more common usage in my opinion.

For your first question, Mark Saving has a good suggestion that you consider the range (or "codomain", to use less ambiguous terminology) to be the type of the output of the function, rather than the set of all values it actually takes on.

Why mathematicians define functions with a codomain larger than the image would be difficult to explain. The answer amounts to "because the math is prettier that way". But understanding why the math is prettier that way requires a lot of experience. Trying to explain it to those without that experience is similar to explaining colors to someone born blind.

Paul Sinclair
  • 43,643