2

In the notation $f : A \rightarrow B$, $A$ is the domain of $f$ and $B$ is the codomain.

  1. 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}$?
  1. 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?

AVS
  • 245
  • For (2), I think it's unusual to use the arrow notation for a relation that isn't a function. For (1), try searching this site for "codomain". In short, the codomain is part of the "data" included in the function along with the pairing of input & output values. – Karl Oct 10 '22 at 16:48

2 Answers2

2

Yes, there is some ambiguity here.

Regarding codomains, a function can have many. As you point out, the function $ \{ (x,x+1) : x \in \mathbb{Z} \}$ can have codomain $\mathbb{Z}$ or any set that contains $\mathbb{Z}$. If you consider a function only as a set of ordered pairs, then you really only see its range, not any specific codomain.

In practice, functions are more often constructed or considered with a specific codomain in mind, and the one given in the notation is this one. For instance, in calculus we often start with a function $ f\colon[a,b] \to \mathbb{R}$, even though we can assume a closed, bounded codomain if $f$ is continuous.

Regarding “from ... to ...,” it's true that a relation from $A$ to $B$ can be a function, but may not necessarily be a function from $A$ to $B$. Your example is a good one. And this is just the conventions of language that arose around functions and relations not coalescing.

At least the use of the term domain is pretty consistent. If a relation $R$ is a function, the domain of $R$ as a relation is the same as its domain as a function. If $f$ is a function from $A$ to $B$, then $A$ is the domain of $f$. But in contrast, if $R$ is a relation from $A$ to $B$, then the domain of $R$ is merely a subset of $A$.

  • So, in my example, $R$ is a relation from $A$ to $B$, but $A$ is not the domain? In the notation of functions in this method using arrows from a set to another, it seems to be agreed upon by most sources that the first set is the domain and second is the codomain, but is the same true for using this notation with relations? I think it must not be, since my textbook has used this notation even in the situation where the first set (A) is not the domain (similar to the example I gave). – AVS Oct 10 '22 at 17:04
  • 1
    I think the domain of $R$ is ${1,2,3,4}$, regardless of whether $R$ is considered a relation or a function. So at least that is consistent. – Matthew Leingang Oct 10 '22 at 20:21
0

Addressing point 1: I think it’s best to think of the codomain as being coded into the definition of a function, if you just want to talk about it’s graph then the domain and range are the only important data, but in many scenarios it’s important to just specify that the range lies within some set. In this case the codomain is important and the function really has the codomain coded within(you can think of the function as $(X,Y,G)$, where $X$ is the domain, $Y$ is the codomain and $G$ is the graph). So when we say $f:X\to Y$ the function really is $(X,Y,G_{f})$.

Addressing point 2: The definition of relation $R$ from $A$ to $B$ is that it is a subset of $A\times B$, there is absolutely no restriction on the other hand a relation is said to be (left) total if the source set equals the domain(See Wikipedia).

Vivaan Daga
  • 5,531