1

Consider a function $f:\mathbb{N} \to \mathbb{N}$, $f(x)=x-5\lfloor x/5\rfloor.$ Is this a valid function? At $x=20$ its value is $0$ which is not in its codomain?

user7530
  • 49,280

1 Answers1

1

Generally speaking, no. A function is only well-defined if each element of the domain maps to (exactly) one element in the codomain.

However I assume that this particular $f$ came from a textbook or notes where the author allows natural numbers to include zero. There is unfortunately not universal consensus about whether $\mathbb{N}$ includes zero or not, and the charitable interpretation here is that $f$ is intended to map to and from $\{0,1,2,\ldots\}$.

user7530
  • 49,280