In mathematics, a codomain or set of destination of a function is a set into which all of the outputs of the function is constrained to fall. It is the set Y in the notation f: X → Y. The term range is sometimes ambiguously used to refer to either the codomain or the image 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 of f, Y its codomain, and G its graph. The set of all elements of the form f(x), where x ranges over the elements of the domain X, is called the image of f. The image of a function is a subset of its codomain so it might not coincide with it. Namely, a function that is not surjective has elements y in its codomain for which the equation f(x) = y does not have a solution.