Codomain
If f:X→Yf:X\to Yf:X→Y is a function, then the codomain of fff is the set YYY. The codomain is not determined solely by the rule x↦f(x)x\mapsto f(x)x↦f(x); it is specified as part of the function’s type. Many notions (notably surjectivity) depend on the codomain, not just on the actual outputs attained. Examples: If f:R→Rf:\mathbb{R}\to\mathbb{R}f:R→R is given by f(x)=x2f(x)=x^2f(x)=x2, then the codomain is R\mathbb{R}R even though f(x)≥0f(x)\ge 0f(x)≥0 always. If the same rule is viewed as f:R→[0,∞)f:\mathbb{R}\to[0,\infty)f:R→[0,∞), then the codomain is [0,∞)[0,\infty)[0,∞). The codomain of sin:R→R\sin:\mathbb{R}\to\mathbb{R}sin:R→R is R\mathbb{R}R (even though the range is contained in [−1,1][-1,1][−1,1]).