Codomain

A function f from X to Y. The smaller oval inside Y is the image of f. Y is the codomain of f.

In mathematics, the codomain or target set of a function is the set Template:Mvar into which all of the output of the function is constrained to fall. It is the set Template:Mvar in the notation f: XY. The codomain is also sometimes referred to as the range but that term is ambiguous as it may also refer to the image.

The codomain is part of a function Template:Mvar if it is defined as described in 1954 by Nicolas Bourbaki,[1] namely a triple (X, Y, F), with Template:Mvar a functional subset[2] of the Cartesian product X × Y and X is the set of first components of the pairs in Template:Mvar (the domain). The set Template:Mvar is called the graph of the function. The set of all elements of the form f(x), where Template:Mvar ranges over the elements of the domain Template:Mvar, is called the image of Template:Mvar. In general, the image of a function is a subset of its codomain. Thus, it may not coincide with its codomain. Namely, a function that is not surjective has elements Template:Mvar in its codomain for which the equation f(x) = y does not have a solution.

An alternative definition of function by Bourbaki [Bourbaki, op. cit., p. 77], namely as just a functional graph, does not include a codomain and is also widely used.[3] For example in set theory it is desirable to permit the domain of a function to be a proper class Template:Mvar, in which case there is formally no such thing as a triple (X, Y, F). With such a definition functions do not have a codomain, although some authors still use it informally after introducing a function in the form f: XY.[4][5][6][7][8]

Examples

For a function

${\displaystyle f\colon \mathbb {R} \rightarrow \mathbb {R} }$

defined by

${\displaystyle f\colon \,x\mapsto x^{2}}$, or equivalently ${\displaystyle f(x)\ =\ x^{2}}$,

the codomain of Template:Mvar is ${\displaystyle \textstyle \mathbb {R} }$, but Template:Mvar does not map to any negative number. Thus the image of Template:Mvar is the set ${\displaystyle \textstyle \mathbb {R} _{0}^{+}}$; i.e., the interval Template:Closed-open.

An alternative function Template:Mvar is defined thus:

${\displaystyle g\colon {\mathbb {R} }\rightarrow {\mathbb {R} }_{0}^{+}}$
${\displaystyle g\colon \,x\mapsto x^{2}.}$

While Template:Mvar and Template:Mvar map a given Template:Mvar to the same number, they are not, in this view, the same function because they have different codomains. A third function Template:Mvar can be defined to demonstrate why:

${\displaystyle h\colon \,x\mapsto {\sqrt {x}}.}$

The domain of Template:Mvar must be defined to be ${\displaystyle \textstyle \mathbb {R} _{0}^{+}}$:

${\displaystyle h\colon {\mathbb {R} }_{0}^{+}\rightarrow {\mathbb {R} }}$.

The compositions are denoted

${\displaystyle h\circ f}$,
${\displaystyle h\circ g}$.

On inspection, hf is not useful. It is true, unless defined otherwise, that the image of Template:Mvar is not known; it is only known that it is a subset of ${\displaystyle \textstyle \mathbb {R} }$. For this reason, it is possible that Template:Mvar, when composed with Template:Mvar, might receive an argument for which no output is defined – negative numbers are not elements of the domain of Template:Mvar, which is the square root function.

Function composition therefore is a useful notion only when the codomain of the function on the right side of a composition (not its image, which is a consequence of the function and could be unknown at the level of the composition) is the same as the domain of the function on the left side.

The codomain affects whether a function is a surjection, in that the function is surjective if and only if its codomain equals its image. In the example, Template:Mvar is a surjection while Template:Mvar is not. The codomain does not affect whether a function is an injection.

A second example of the difference between codomain and image is demonstrated by the linear transformations between two vector spaces – in particular, all the linear transformations from ${\displaystyle \textstyle {\mathbb {R} }^{2}}$ to itself, which can be represented by the 2×2 matrices with real coefficients. Each matrix represents a map with the domain ${\displaystyle \textstyle {\mathbb {R} }^{2}}$ and codomain ${\displaystyle \textstyle {\mathbb {R} }^{2}}$. However, the image is uncertain. Some transformations may have image equal to the whole codomain (in this case the matrices with rank 2) but many do not, instead mapping into some smaller subspace (the matrices with rank 1 or 0). Take for example the matrix Template:Mvar given by

${\displaystyle T={\begin{pmatrix}1&0\\1&0\end{pmatrix}}}$

which represents a linear transformation that maps the point (x, y) to (x, x). The point (2, 3) is not in the image of Template:Mvar, but is still in the codomain since linear transformations from ${\displaystyle \textstyle {\mathbb {R} }^{2}}$ to ${\displaystyle \textstyle {\mathbb {R} }^{2}}$ are of explicit relevance. Just like all 2×2 matrices, Template:Mvar represents a member of that set. Examining the differences between the image and codomain can often be useful for discovering properties of the function in question. For example, it can be concluded that Template:Mvar does not have full rank since its image is smaller than the whole codomain.

Notes

1. {{#invoke:citation/CS1|citation |CitationClass=book }}
2. A set of pairs is functional iff no two distinct pairs have the same first component [Bourbaki, op. cit., p. 76]
3. Template:Harvnb, [[[:Template:Google books]] pages 10–11]
5. Template:Harvnb, [[[:Template:Google books]] page 8]
6. Mac Lane, in Template:Harvnb, [[[:Template:Google books]] page 232]
7. Template:Harvnb, [[[:Template:Google books]] page 91]
8. Template:Harvnb, [[[:Template:Google books]] page 89]

References

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}

• {{#invoke:citation/CS1|citation

|CitationClass=citation }}