In

mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...

, the codomain or set of destination of a function
Function or functionality may refer to:
Computing
* Function key, a type of key on computer keyboards
* Function model, a structured representation of processes in a system
* Function object or functor or functionoid, a concept of object-oriente ...

is the set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...

into which all of the output of the function is constrained to fall. It is the set in the notation . The term range
Range may refer to:
Geography
* Range (geographic), a chain of hills or mountains; a somewhat linear, complex mountainous or hilly area (cordillera, sierra)
** Mountain range, a group of mountains bordered by lowlands
* Range, a term used to i ...

is sometimes ambiguously used to refer to either the codomain or image
An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensiona ...

of a function.
A codomain is part of a function if is defined as a triple where is called the ''domain
Domain may refer to:
Mathematics
*Domain of a function, the set of input values for which the (total) function is defined
**Domain of definition of a partial function
**Natural domain of a partial function
**Domain of holomorphy of a function
* Do ...

'' of , its ''codomain'', and its ''graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...

''. The set of all elements of the form , where ranges over the elements of the domain , is called the ''image
An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensiona ...

'' of . The image of a function is a subset
In mathematics, Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they are ...

of its codomain so it might not coincide with it. Namely, a function that is not surjective
In mathematics, a surjective function (also known as surjection, or onto function) is a function that every element can be mapped from element so that . In other words, every element of the function's codomain is the image of one element of i ...

has elements in its codomain for which the equation does not have a solution.
A codomain is not part of a function if is defined as just a graph. For example in set theory
Set theory is the branch of mathematical logic that studies sets, which can be informally described as collections of objects. Although objects of any kind can be collected into a set, set theory, as a branch of mathematics, is mostly conce ...

it is desirable to permit the domain of a function to be a proper class
Proper may refer to:
Mathematics
* Proper map, in topology, a property of continuous function between topological spaces, if inverse images of compact subsets are compact
* Proper morphism, in algebraic geometry, an analogue of a proper map for ...

, in which case there is formally no such thing as a triple . With such a definition functions do not have a codomain, although some authors still use it informally after introducing a function in the form ., p. 91 (quote 1
Quote is a hypernym of quotation, as the repetition or copy of a prior statement or thought. Quotation marks are punctuation marks that indicate a quotation. Both ''quotation'' and ''quotation marks'' are sometimes abbreviated as "quote(s)".
Co ...

quote 2
Quote is a hypernym of quotation, as the repetition or copy of a prior statement or thought. Quotation marks are punctuation marks that indicate a quotation. Both ''quotation'' and ''quotation marks'' are sometimes abbreviated as "quote(s)".
C ...

; , p. 8 P. is an abbreviation or acronym that may refer to:
* Page (paper), where the abbreviation comes from Latin ''pagina''
* Paris Herbarium, at the ''Muséum national d'histoire naturelle''
* ''Pani'' (Polish), translating as Mrs.
* The ''Pacific Repo ...

Mac Lane, in , p. 232 P. is an abbreviation or acronym that may refer to:
* Page (paper), where the abbreviation comes from Latin ''pagina''
* Paris Herbarium, at the ''Muséum national d'histoire naturelle''
* ''Pani'' (Polish), translating as Mrs.
* The ''Pacific Repo ...

, p. 91 P. is an abbreviation or acronym that may refer to:
* Page (paper), where the abbreviation comes from Latin ''pagina''
* Paris Herbarium, at the ''Muséum national d'histoire naturelle''
* ''Pani'' (Polish), translating as Mrs.
* The ''Pacific Rep ...

, p. 89 P. is an abbreviation or acronym that may refer to:
* Page (paper), where the abbreviation comes from Latin ''pagina''
* Paris Herbarium, at the ''Muséum national d'histoire naturelle''
* ''Pani'' (Polish), translating as Mrs.
* The ''Pacific Repo ...

/ref>
Examples

For a function :$f\backslash colon\; \backslash mathbb\backslash rightarrow\backslash mathbb$ defined by : $f\backslash colon\backslash ,x\backslash mapsto\; x^2,$ or equivalently $f(x)\backslash \; =\backslash \; x^2,$ the codomain of is $\backslash textstyle\; \backslash mathbb\; R$, but does not map to any negative number. Thus the image of is the set $\backslash textstyle\; \backslash mathbb^+\_0$; i.e., the interval . An alternative function is defined thus: : $g\backslash colon\backslash mathbb\backslash rightarrow\backslash mathbb^+\_0$ : $g\backslash colon\backslash ,x\backslash mapsto\; x^2.$ While and map a given to the same number, they are not, in this view, the same function because they have different codomains. A third function can be defined to demonstrate why: : $h\backslash colon\backslash ,x\backslash mapsto\; \backslash sqrt\; x.$ The domain of cannot be $\backslash textstyle\; \backslash mathbb$ but can be defined to be $\backslash textstyle\; \backslash mathbb^+\_0$: : $h\backslash colon\backslash mathbb^+\_0\backslash rightarrow\backslash mathbb.$ Thecompositions
Composition or Compositions may refer to:
Arts and literature
* Composition (dance), practice and teaching of choreography
*Composition (language), in literature and rhetoric, producing a work in spoken tradition and written discourse, to include ...

are denoted
: $h\; \backslash circ\; f,$
: $h\; \backslash circ\; g.$
On inspection, is not useful. It is true, unless defined otherwise, that the image of is not known; it is only known that it is a subset of $\backslash textstyle\; \backslash mathbb\; R$. For this reason, it is possible that , when composed with , might receive an argument for which no output is defined – negative numbers are not elements of the domain of , which is the square root function
In mathematics, a square root of a number is a number such that ; in other words, a number whose ''square'' (the result of multiplying the number by itself, or ⋅ ) is . For example, 4 and −4 are square roots of 16, because .
E ...

.
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 a subset of the domain of the function on the left side.
The codomain affects whether a function is a surjection
In mathematics, a surjective function (also known as surjection, or onto function) is a function that every element can be mapped from element so that . In other words, every element of the function's codomain is the image of one element of i ...

, in that the function is surjective if and only if its codomain equals its image. In the example, is a surjection while is not. The codomain does not affect whether a function is an injection
Injection or injected may refer to:
Science and technology
* Injective function, a mathematical function mapping distinct arguments to distinct values
* Injection (medicine), insertion of liquid into the body with a syringe
* Injection, in broadca ...

.
A second example of the difference between codomain and image is demonstrated by the linear transformation
In mathematics, and more specifically in linear algebra, a linear map (also called a linear mapping, linear transformation, vector space homomorphism, or in some contexts linear function) is a mapping V \to W between two vector spaces that pre ...

s between two vector space
In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called ''vectors'', may be added together and multiplied ("scaled") by numbers called '' scalars''. Scalars are often real numbers, but can ...

s – in particular, all the linear transformations from $\backslash textstyle\; \backslash mathbb^2$ to itself, which can be represented by the matrices
Matrix most commonly refers to:
* ''The Matrix'' (franchise), an American media franchise
** ''The Matrix'', a 1999 science-fiction action film
** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchis ...

with real coefficients. Each matrix represents a map with the domain $\backslash textstyle\; \backslash mathbb^2$ and codomain $\backslash textstyle\; \backslash mathbb^2$. However, the image is uncertain. Some transformations may have image equal to the whole codomain (in this case the matrices with rank
Rank is the relative position, value, worth, complexity, power, importance, authority, level, etc. of a person or object within a ranking, such as:
Level or position in a hierarchical organization
* Academic rank
* Diplomatic rank
* Hierarchy
* ...

) but many do not, instead mapping into some smaller subspace (the matrices with rank or ). Take for example the matrix given by
:$T\; =\; \backslash begin\; 1\; \&\; 0\; \backslash \backslash \; 1\; \&\; 0\; \backslash end$
which represents a linear transformation that maps the point to . The point is not in the image of , but is still in the codomain since linear transformations from $\backslash textstyle\; \backslash mathbb^2$ to $\backslash textstyle\; \backslash mathbb^2$ are of explicit relevance. Just like all matrices, 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 does not have full rank since its image is smaller than the whole codomain.
See also

* * Morphism#CodomainNotes

References

* * * * * * * {{Mathematical logic Functions and mappings Basic concepts in set theory