Relations as Sets

308 Views Asked by At

Wikipedia defines a relation as a set of ordered pairs.

An example of this is {(1,1), (2,4), (3,9)}

But how could this set fully define a relation? Can’t the relation have one of many different possible codomains? And wouldn’t each of these relations be different?

2

There are 2 best solutions below

0
On

You are right that absent context, this does not fully define a relation, just like saying $f(x)=x^2$ does not really define a function (until I tell you what the domain, and possibly also what the codomain, are).

Basically, given sets $X$ and $Y$, a relation from $X$ to $Y$ is a subset $R$ of $X\times Y$, $R\subseteq X\times Y$; that is, $R$ is a set of ordered pairs with first coordinate in $X$ and second coordinate in $Y$. We think of $R$ as giving the relation that relates the element $a\in X$ to the element $b\in Y$ if and only if the pair $(a,b)$ is an element of $R$.

Just as with functions, to fully describe a relation we need to specify $X$, $Y$, and $R$ (with functions, you want to specify the domain $X$, the codomain $Y$, and the rule for assigning elements of $X$ to elements of $Y$, the “function”). Often because of context we can “get away” with not specifying $X$ and $Y$ explicitly. For example, in Calculus I we agree that our functions will always be defined from a subset of $\mathbb{R}$ to $\mathbb{R}$. We even agree that functions given by formulas are defined from their natural domain to $\mathbb{R}$, so that we can “get away” with just giving the formula $f(x) = x^2$ and we “know” that this is a function from $\mathbb{R}$ to $\mathbb{R}$ without saying the latter.

Similarly, from context or convention we may agree that if we don’t explicitly say what the domain and codomain of the relation are, then we will take them to be some specific set; or we will take them to be “the smallest sets for which the relation $R$ makes sense”, that is, take $X$ to be the set $\{a\mid \text{there is a }b\text{ such that }(a,b)\in R\}$, and take $Y$ to be the set $\{b \mid \text{there is an }a\text{ such that }(a,b)\in R\}$. This usually needs to be agreed on explicitly, though.

6
On

When I took axiomatic set theory, relations were defined as sets of ordered pairs, and functions as a special case. The domain of a relation $R$ was defined as $\operatorname{Dmn}(R) = \{x|\exists y((x,y)\in R)\}$ and the range was defined similarly.

In particular, I recall the example $f:\mathbb{N}\to\mathbb{N}$ defined by $f(n)=n^2$ and the function $g:\mathbb{N}\to\mathbb{R}$defined by $g(n)=n^2$ are the same function, because they are the same sets of ordered pairs.

If I'm not mistaken, in category theory, $f$ and $g$ are different morphisms. (I don't know anything about category theory; I tried to read a book about it once, and couldn't get very far in, but I think I recall this same example, differentiating morphisms from functions, near the beginning of the book.)

So, my understanding is that the Wikipedia article is correct. I agree that you can't specify a function by a formula without giving the domain, unless as in calculus, there is some prior agreement. However, I don't believe that the codomain distinguishes functions, either in a formal or an informal sense. Once we know the domain and the formula, the function is completely determined.