Codomain
From Free net encyclopedia
A codomain in mathematics is the set of "output" values associated with (or mapped to) the domain of "input" arguments in a function. For any given function <math>f\colon A\rightarrow B</math>, the set A, on which f is defined (the arguments), is called the domain, and B (the set of possible values) is called the codomain of f. The set of all actual values <math>\lbrace f(x) | x \in A \rbrace</math> or f(A) is called the range of f. The difference between the range and the codomain is a notational one, but it becomes important when functions are compared one to another. What's important to remember is that the codomain is declared as part of the specification of a function; the range is a consequence of the structure of a function (i.e., it varies from particular function to particular function). Strictly speaking, any codomain should include the range -- i.e., the range is the smallest codomain. More precisely, the triple variable (f, A, B) cannot name functions unless the range is a subset of B.
Example
Let the function f be a function on the real numbers:
- <math>f\colon \mathbb{R}\rightarrow\mathbb{R}</math>
defined by
- <math>f\colon\,x\mapsto x^2.</math>
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,∞):
- <math>0\leq f(x)<\infty.</math>
One could have defined the function g thus:
- <math>g\colon\mathbb{R}\rightarrow\mathbb{R}^+_0</math>
- <math>g\colon\,x\mapsto x^2.</math>
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,
<math>h\colon\,x\mapsto \sqrt x.</math>
We must define the domain to be <math>\mathbb{R}^+_0</math>:
- <math>h\colon\mathbb{R}^+_0\rightarrow\mathbb{R}</math>.
Now let's define the compositions
- <math>h \circ f</math>,
- <math>h \circ g</math>.
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 <math>\mathbb{R}</math>. 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
fr:Ensemble d'arrivée io:Arivey-ensemblo nl:Codomein uk:Область значень zh:陪域