Let's say we have a function f (x) = x and define its domain D to be the integers. Then according to calculus the image K of f is the set of all integers. However, I cannot quite understand the need to define codomain because isn't the codomain A of f just a set of numbers such that K is a subset of A? Because if that were the case, couldn't we chose any of Q, R, C or even the extended complex plane as the codomain of f? What have I gotten wrong, and what is the motivation for Codomain? :)
-
1Also https://math.stackexchange.com/questions/777563/codomain-of-a-function – Eric Wofsey Jul 08 '17 at 23:26
1 Answers
Any function $f:D\to A$ does in fact correspond to a surjective function $f:D\to K =f(D)$. That said, the concept of codomain is very useful when the image of $f$ is either unspecified, or is not known a priori. Consider for example the following.
"A function $f:\mathbb{Q} \to \mathbb{R}$ cannot be surjective". In this case the function $f$ is unspecified, thus so is its image. However, the proposition is true, and easy to state in terms of codomain.
"Define $f:\mathbb{N}\to\mathbb{N} \cup \{0\}$ as $f(n)$ is the number of ways that $2(n+1)$ can be written as a sum of two primes". It is not currently known whether $0$ does in fact belong to the image of $f$ i.e. whether $\,0 \in f(\mathbb{N})\,$ (though of course Goldbach's conjecture strongly suggests it doesn't).

- 76,497