Information About

Codomain





EXAMPLE


Let the function ''f'' be a function on the Real Number s:

: f\colon \mathbb{R} ightarrow\mathbb{R}

defined by

: f\colon\,x\mapsto x^2.

The codomain of ''f'' is R, but clearly ''f''(''x'') never takes Negative values, and thus the range is in fact the set R0+—non-negative reals, i.e. the Interval [0,∞):

: 0\leq f(x)<\infty.

One could have defined the function ''g'' thus:

: g\colon\mathbb{R} ightarrow\mathbb{R}^+_0
: g\colon\,x\mapsto x^2.

While ''f'' and ''g'' have the same effect on a given number, they are not, in the modern view, the same function since they have different codomains.

To see why, suppose we define a second function,

h\colon\,x\mapsto \sqrt x.

We ''must'' define the domain to be \mathbb{R}^+_0:

: h\colon\mathbb{R}^+_0 ightarrow\mathbb{R}.

Now let's define the Compositions

:h \circ f,

:h \circ g.

Which of these compositions make sense?

As it turns out, the first one doesn't. Suppose (as we must, unless we write down an explicit contradiction of this) we do not know what the range of ''f'' is; we only know that it can be \mathbb{R}. But then we're in trouble, because the square root is not defined for negative numbers! Now we have a possible contradiction.

This is unclear, and in formal work should be avoided. Function composition therefore requires by definition that the ''codomain'' (not the range, which is a consequence of the function and so said to be indeterminate at the level of the composition) of the function on the right be the same as the domain of the function on the left.

The codomain can affect whether the function is a Surjection ; in our example, ''g'' is a surjection while ''f'' is not. The codomain does not affect whether the function is an Injection .


SEE ALSO