Skip to main content
Logo image

Section 17.1 Basics

relation (working definition)
a rule which assigns to some elements of a set A several elements from a set B
aRb
element a∈A is related to element b∈B by relation R
relation on a set
a relation between elements of the same set
As the name implies, a relation describes some relationship of elements of a set A to elements of a set B.

Example 17.1.2. Pet relation.

Let C represent the set of living cats, and let H represent the set of living humans. Then one relationship between elements of these two sets can be expressed by writing cRh to mean that cat c is the pet of human h.

Example 17.1.3. Parent relation.

Let H represent the set of living humans. Then one type of relationship between elements of this set can be expressed by writing h1Rh2 to mean that human h1 is the parent of human h2.

Example 17.1.4. Division relation.

One type of relationship between elements of N>0 can be expressed by writing m∣n to mean that nonzero natural number m divides nonzero natural number n.
Just as with functions, we want to avoid the use of the undefinable word β€œrule”. Notice that a relation just pairs elements of a set A with elements of a set B; we have seen this before.
relation (formal definition)
a subset of a Cartesian product
With this formal definition, writing RβŠ†AΓ—B becomes the same as saying β€œR is a relation between elements of A and B,” and writing (a,b)∈R becomes the same as writing aRb.

Note 17.1.5.

With this formal definition, a relation on a set A means a subset of AΓ—A.

Remark 17.1.6.

Recall that our formal definition of function states that a function A→B is a special kind of subset of A×B. But every subset of A×B can be considered as a relation, so a function is a special kind of relation.
The difference is that a function A→B must assign exactly one element of B to each element of A, whereas a relation from A to B can assign any number of elements of B (even zero) to each element of A. That is, a relation does not have to be well-defined, and can be left undefined on some elements of A.

Example 17.1.7. Identity relation.

Consider
R={(a,a)|a∈A}βŠ†AΓ—A.
Then a1Ra2 means a1=a2. This relation is the same as the identity function idA:A→A.

Example 17.1.8. Element relation.

Consider
R={(a,C)|a∈C}βŠ†AΓ—P(A).
Then aRC means a∈C. This relation is in general not a function, since it is not well-defined: an element of A can be contained in several subsets of A.
A relation between pairs of objects, such as the ones we have considered so far, is sometimes called a binary relation. But we can consider relationships between collections of more than two objects.
ternary relation
a subset of AΓ—BΓ—C for sets A,B,C

Example 17.1.9. A human (usually) has two biological parents.

Let H represent the set of all living humans. Then we can define a ternary relation RβŠ†H3 by taking (h1,h2,h3)∈R to mean that humans h1,h2 are the parents of human h3.