Functions turn inputs into outputs, and it is important to determine what type of inputs and outputs can or may occur. This is described using two concepts: the domain of a function is the set of all allowed inputs and its codomain is the set to which all outputs must belong:

One can make all kinds of variants of functions by changing the domain or codomain:

A function is defined not only by what it does, but also by its possible (or ’allowed’) input and output. For example, the function ’square-number’ is strictly speaking a different function than the function ’square-whole-numbers’ or the function ’square-real numbers’. So, two functions are equivalent if and only if they have the same input set and output set and if they assign the same output value to each input.

Even if each function , and each maps to , then strictly speaking they are still different functions. In many cases, however, we will simply speak of the function ’square’ and ignore the distinction between domain and codomain. We then write .

When discussing inverse functions, this distinction will become important.

Extra 1: Variants of functions

For a function , one can typically make the domain smaller and the codomain larger:

  • If , then the constraint of to , noted , is defined as
  • If , then you can associate the following function with , almost always notated with just :

For a function , one can sometimes make the domain bigger or the codomain smaller. The smallest possible codomain is exactly the image: The function can easily be extended to a function . The function cannot be extended any further.

2025-10-01 16:05:16