In the notation $f : A \rightarrow B$, $A$ is the domain of $f$ and $B$ is the codomain.
- What actually is the codomain? Defining it as the set into which all outputs of the function are constrained to doesn't seem very solid to me. Is it wrong to say that for the function $x \mapsto x+1, x \in \mathbb{Z}$, one may say that the codomain is $\mathbb{R}$ or $\mathbb{Z}$ or any other superset of $\mathbb{Z}$?
- Let's say I define sets $A = \{1,2,3,4,5\}$ and $B = \{2,4,6,8,10\} $, and a relation, $R:A \to B$ (which means domain is $A$ and codomain is $B$), such that $R = \{(1,2),(2,4),(3,6),(4,8)\} $. In this case, $R$ is a subset of $A \times B$, and I've always thought that this means $R$ is a relation from A to $B$. But if $A$ is the domain, then that means $A$ should be the set of all first elements of all ordered pairs in $R$. But clearly in this case, the element $5$ is in $A$ but it is not the first element of any ordered pair in $R$.
So my question is, is it valid to say that $R$ is a relation from $A \to B$, purely from the fact that $R \subset A \times B$? Does this not contradict the fact that the $R:A \to B$ notation says that $A$ is the domain?