# Codomain

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Codomain
> Markdown URL: https://mediated.wiki/source/Codomain.md
> Source: https://en.wikipedia.org/wiki/Codomain
> Source revision: 1352085175
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Target set of a mathematical function

A function f from X to Y. The blue oval Y is the codomain of f. The yellow oval inside Y is the [image](/source/Image_(mathematics)) of f, and the red oval X is the [domain](/source/Domain_of_a_function) of f.

In [mathematics](/source/Mathematics), a **codomain** or **set of destination** of a [function](/source/Function_(mathematics)) is a [set](/source/Set_(mathematics)) into which all of the outputs of the function are constrained to fall. It is the set Y in the notation *f* : *X* → *Y*. The term ***[range](/source/Range_of_a_function)*** is sometimes ambiguously used to refer to either the codomain or the [*image*](/source/Image_(mathematics)) of a function.

A codomain is part of a function f if f is defined as a triple (*X*, *Y*, *G*) where X is called the *[domain](/source/Domain_of_a_function)* of f, Y its *codomain*, and G its *[graph](/source/Graph_of_a_function)*.[1] The set of all elements of the form *f*(*x*), where x ranges over the elements of the domain X, is called the *[image](/source/Image_(mathematics))* of f. The image of a function is a [subset](/source/Subset) of its codomain so it might not coincide with it. Namely, a function that is not [surjective](/source/Surjective_function) has elements y in its codomain for which the equation *f*(*x*) = *y* does not have a solution.

A codomain is not part of a function f if f is defined as just a graph.[2][3] For example, in [set theory](/source/Set_theory) it is desirable to permit the domain of a function to be a [proper class](/source/Class_(set_theory)) X, in which case there is formally no such thing as a triple (*X*, *Y*, *G*). 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*: *X* → *Y*.[4]

## Examples

For a function

- f : R → R {\displaystyle f\colon \mathbb {R} \rightarrow \mathbb {R} }

defined by

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

the codomain of f is R {\displaystyle \textstyle \mathbb {R} } , but f does not map to any negative number. Thus the image of f is the set R 0 + {\displaystyle \textstyle \mathbb {R} _{0}^{+}} ; i.e., the [interval](/source/Interval_(mathematics)) [0, ∞).

An alternative function g is defined thus:

- g : R → R 0 + {\displaystyle g\colon \mathbb {R} \rightarrow \mathbb {R} _{0}^{+}}

- g : x ↦ x 2 . {\displaystyle g\colon \,x\mapsto x^{2}.}

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

- h : x ↦ x . {\displaystyle h\colon \,x\mapsto {\sqrt {x}}.}

The domain of h cannot be R {\displaystyle \textstyle \mathbb {R} } but can be defined to be R 0 + {\displaystyle \textstyle \mathbb {R} _{0}^{+}} :

- h : R 0 + → R . {\displaystyle h\colon \mathbb {R} _{0}^{+}\rightarrow \mathbb {R} .}

The [compositions](/source/Function_composition) are denoted

- h ∘ f , {\displaystyle h\circ f,}

- h ∘ g . {\displaystyle h\circ g.}

On inspection, *h* ∘ *f* is not useful. It is true, unless defined otherwise, that the image of f is not known; it is only known that it is a subset of R {\displaystyle \textstyle \mathbb {R} } . For this reason, it is possible that h, when composed with f, might receive an argument for which no output is defined – negative numbers are not elements of the domain of h, which is the [square root function](/source/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 a subset of the domain of the function on the left side.

The codomain affects whether a function is a [surjection](/source/Surjection), in that the function is surjective if and only if its codomain equals its image. In the example, g is a surjection while f is not. The codomain does not affect whether a function is an [injection](/source/Injective_function).

A second example of the difference between codomain and image is demonstrated by the [linear transformations](/source/Linear_transformation) between two [vector spaces](/source/Vector_space) – in particular, all the linear transformations from R 2 {\displaystyle \textstyle \mathbb {R} ^{2}} to itself, which can be represented by the 2×2 [matrices](/source/Matrix_(mathematics)) with real coefficients. Each matrix represents a map with the domain R 2 {\displaystyle \textstyle \mathbb {R} ^{2}} and codomain R 2 {\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](/source/Rank_(linear_algebra)) 2) but many do not, instead mapping into some smaller [subspace](/source/Linear_subspace) (the matrices with rank 1 or 0). Take for example the matrix T given by

- T = ( 1 0 1 0 ) {\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 T, but is still in the codomain since linear transformations from R 2 {\displaystyle \textstyle \mathbb {R} ^{2}} to R 2 {\displaystyle \textstyle \mathbb {R} ^{2}} are of explicit relevance. Just like all 2×2 matrices, T 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 T does not have full rank since its image is smaller than the whole codomain.

## See also

- [Bijection](/source/Bijection) – One-to-one correspondence

- [Morphism § Codomain](/source/Morphism#Codomain)

- [Endofunction](/source/Endofunction#Endofunctions) – Function with the same domain and codomain

## Notes

1. **[^](#cite_ref-1)** [Bourbaki 1970](#CITEREFBourbaki1970), p. 76

1. **[^](#cite_ref-2)** [Bourbaki 1970](#CITEREFBourbaki1970), p. 77

1. **[^](#cite_ref-3)** [Forster 2003](#CITEREFForster2003), [pp. 10–11](https://books.google.com/books?id=mVeTuaRwWssC&pg=PA10&dq=%22Some+mathematical+cultures+make+this+explicit%2C+saying+that+a+function%22)

1. **[^](#cite_ref-4)** [Eccles 1997](#CITEREFEccles1997), p. 91 ([quote 1](https://books.google.com/books?id=ImCSX_gm40oC&pg=PA91&dq=%22The+reader+may+wonder+at+this+variety+of+ways+of+thinking+about+a+function%22), [quote 2](https://books.google.com/books?id=ImCSX_gm40oC&pg=PA91&dq=%22When+defining+a+function+using+a+formula+it+is+important+to+be+clear+about+which+sets+are+the+domain+and+the+codomain+of+the+function%22)); [Mac Lane 1998](#CITEREFMac_Lane1998), [p. 8](https://books.google.com/books?id=MXboNPdTv7QC&pg=PA8&dq=%22Here+%22function%22+means+a+function+with+specified+domain+and+specified+codomain%22); Mac Lane, in [Scott & Jech 1967](#CITEREFScottJech1967), [p. 232](https://books.google.com/books?id=5mf4Vckj0gEC&pg=PA232&dq=%22Note+explicitly+that+the+notion+of+function+is+not+that+customary+in+axiomatic+set+theory%22); [Sharma 2004](#CITEREFSharma2004), [p. 91](https://books.google.com/books?id=IGvDpe6hYiQC&pg=PA91&dq=%22Functions+as+sets+of+ordered+pairs%22); [Stewart & Tall 1977](#CITEREFStewartTall1977), [p. 89](https://books.google.com/books?id=TLelvnIU2sEC&pg=PA89&dq=%22Strictly+speaking+we+cannot+talk+of+%27the%27+codomain+of+a+function%22)

## References

- [Bourbaki, Nicolas](/source/Nicolas_Bourbaki) (1970). *Théorie des ensembles*. Éléments de mathématique. Springer. [ISBN](/source/ISBN_(identifier)) [9783540340348](https://en.wikipedia.org/wiki/Special:BookSources/9783540340348).

- [Eccles, Peter J.](/source/Peter_Eccles_(mathematician)) (1997), *An Introduction to Mathematical Reasoning: Numbers, Sets, and Functions*, Cambridge University Press, [ISBN](/source/ISBN_(identifier)) [978-0-521-59718-0](https://en.wikipedia.org/wiki/Special:BookSources/978-0-521-59718-0)

- [Forster, Thomas](/source/Thomas_Forster_(mathematician)) (2003), *Logic, Induction and Sets*, Cambridge University Press, [ISBN](/source/ISBN_(identifier)) [978-0-521-53361-4](https://en.wikipedia.org/wiki/Special:BookSources/978-0-521-53361-4)

- [Mac Lane, Saunders](/source/Saunders_Mac_Lane) (1998), *[Categories for the working mathematician](/source/Categories_for_the_working_mathematician)* (2nd ed.), Springer, [ISBN](/source/ISBN_(identifier)) [978-0-387-98403-2](https://en.wikipedia.org/wiki/Special:BookSources/978-0-387-98403-2)

- [Scott, Dana S.](/source/Dana_Scott); Jech, Thomas J. (1967), *Axiomatic set theory*, Symposium in Pure Mathematics, American Mathematical Society, [ISBN](/source/ISBN_(identifier)) [978-0-8218-0245-8](https://en.wikipedia.org/wiki/Special:BookSources/978-0-8218-0245-8)

- Sharma, A.K. (2004), *Introduction To Set Theory*, Discovery Publishing House, [ISBN](/source/ISBN_(identifier)) [978-81-7141-877-0](https://en.wikipedia.org/wiki/Special:BookSources/978-81-7141-877-0)

- [Stewart, Ian](/source/Ian_Stewart_(mathematician)); [Tall, David Orme](/source/David_Tall) (1977), *The foundations of mathematics*, Oxford University Press, [ISBN](/source/ISBN_(identifier)) [978-0-19-853165-4](https://en.wikipedia.org/wiki/Special:BookSources/978-0-19-853165-4)

v t e Mathematical logic General Axiom list Cardinality First-order logic Formal proof Formal semantics Foundations of mathematics Information theory Lemma Logical consequence Model Theorem Theory Type theory Theorems (list), paradoxes Gödel's completeness – incompleteness theorems Tarski's undefinability Banach–Tarski paradox Cantor's theorem – paradox – diagonal argument Compactness Halting problem Lindström's Löwenheim–Skolem Russell's paradox Logics Traditional Classical logic Logical truth Tautology Proposition Inference Logical equivalence Consistency Equiconsistency Argument Soundness Validity Syllogism Square of opposition Venn diagram Propositional Boolean algebra Boolean functions Logical connectives Propositional calculus Propositional formula Truth tables Many-valued logic 3 finite ∞ Predicate First-order list Second-order Monadic Higher-order Fixed-point Free Quantifiers Predicate Monadic predicate calculus Set theory Set hereditary Class (Ur-)Element Ordinal number Extensionality Forcing Relation equivalence partition Set operations: intersection union complement Cartesian product power set identities Types of sets Countable Uncountable Empty Inhabited Singleton Finite Infinite Transitive Ultrafilter Recursive Fuzzy Universal Universe constructible Grothendieck Von Neumann Maps, cardinality Function/Map domain codomain image In/Sur/Bi-jection Schröder–Bernstein theorem Isomorphism Gödel numbering Enumeration Large cardinal inaccessible Aleph number Operation binary Theories Zermelo–Fraenkel axiom of choice continuum hypothesis General Kripke–Platek Morse–Kelley Naive New Foundations Tarski–Grothendieck Von Neumann–Bernays–Gödel Ackermann Constructive Formal systems (list), language, syntax Alphabet Arity Automata Axiom schema Expression ground Extension by definition conservative Relation Formation rule Grammar Formula atomic closed ground open Free/bound variable Language Metalanguage Logical connective ¬ ∨ ∧ → ↔ = Predicate functional variable propositional variable Proof Quantifier ∃ ! ∀ rank Sentence atomic spectrum Signature String Substitution Symbol function logical/constant non-logical variable Term Theory list Example axiomatic systems (list) of true arithmetic Peano second-order elementary function primitive recursive Robinson Skolem of the real numbers Tarski's axiomatization of Boolean algebras canonical minimal axioms of geometry Euclidean Elements Hilbert's Tarski's non-Euclidean Principia Mathematica Proof theory Formal proof Natural deduction Logical consequence Rule of inference Sequent calculus Theorem Systems axiomatic deductive Hilbert list Complete theory Independence (from ZFC) Proof of impossibility Ordinal analysis Reverse mathematics Self-verifying theories Model theory Interpretation function of models Model atomic equivalence finite prime saturated spectrum submodel Non-standard model of non-standard arithmetic Diagram elementary Categorical theory Model complete theory Satisfiability Semantics of logic Strength Theories of truth semantic Tarski's Kripke's T-schema Transfer principle Truth predicate Truth value Type Ultraproduct Validity Computability theory Church encoding Church–Turing thesis Computably enumerable Computable function Computable set Decision problem decidable undecidable P NP P versus NP problem Kolmogorov complexity Lambda calculus Primitive recursive function Recursion Recursive set Turing machine Type theory Related Abstract logic Algebraic logic Automated theorem proving Category theory Concrete/Abstract category Category of sets History of logic History of mathematical logic timeline Logicism Mathematical object Philosophy of mathematics Supertask Mathematics portal

---
Adapted from the Wikipedia article [Codomain](https://en.wikipedia.org/wiki/Codomain) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Codomain?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
