What is the purpose of the Codomain?
If the Domain of a function is all acceptable inputs, and the image of a function is the output, what is the point of using the word Codomain?
For example, I could say the cosine function maps R to R which means that the domain is R, and the codomain is R. The image however of cosine, would be the numbers between -1 and 1 inclusive, so of course they are within the real numbers.
Any thoughts?
$\endgroup$ 23 Answers
$\begingroup$Images don't "behave" well enough. For example, if you want to sum two real-valued functions, you take functions $f:\mathbb{R} \rightarrow \mathbb{R}$ and $g: \mathbb{R} \rightarrow \mathbb{R}$ and sum their outputs. If you restricted to image, you would have to keep track of it every time you did this.
$\endgroup$ 1 $\begingroup$Sometimes we don't know what the range is, but we do know that it's contained in some other set. In this case we can specify a valid domain and codomain even though we don't know what the range is.
We are often interested in surjectivity. Surjectivity is fundamentally tied to the codomain of a function. Concretely, if we have a surjective function $f : A \to B$ and a set $C \supsetneq B$, we can define a function $g : A \to C$, with $g(x)=f(x)$. Then $g$ is not surjective even though $f$ is. So if we drop the distinction between "codomain" and "range", then the notion of surjectivity becomes trivial.
Sometimes we want to study all functions with some fixed domain and codomain (or perhaps a certain large collection of such functions). For instance, all one-variable calculus is about functions from $\mathbb{R}$ to $\mathbb{R}$. Such functions are related to one another even when they have different ranges.
$\endgroup$ 1 $\begingroup$I might have misunderstood what your question is, but anyway, hopefully the following is helpful.
What is a function?
A function is a "rule" that assigns to each element in a set $D$ (called the domain) exactly one element in a set $E$ (called the codomain).
The condomain is just the set where the values of the function are. All functions have domains and codomains. It is part of the definition of a function.
From the comments below, it seems like you might be asking why one can't just take the range as the codomain. The answer, I believe, is in the logic order. We can't ask about the range of a function without having a function. If we have a function, then we already have a codomain.
Now, if you have a function $f: D \to E$ with domain $D$ and codomain $E$, then you can define another function $f': D \to f(D)$ by $f'(x) = f(x)$. If $f$ us surjective, then $f = f'$ otherwise you have two different functions.
The range/image of a function $h: D \to E$ is the subset of the codomain $\{h(x) \in E : x\in D\}$. If the range and codomain are equal as sets, then we call the function surjective.
For example $f: \mathbb{R} \to \mathbb{R}$ given by $f(x) = x^2$ and $g:\mathbb{R} \to [0,\infty)$ given by $g(x) = x^2$ are two different functions because they have different codomains. For example, $f$ is not surjective, while $g$ is surjective.
If I meet you on the street and you tell me about this function called cosine. Then I can ask you what the domain and codomain is. You, technically, don't compute the codomain or the domain. They always follow the function. It makes no sense to talk about a function without the two accompanying sets.
Now in calculus, the codomain is usually assumed to be the real numbers. So here it makes sense to ask about what the range is. We have problems that ask for the domain, but what we usually mean is, as you say: find the set of real numbers where the expressions is defined.
$\endgroup$ 24