]> Relations

## 3. Relations

### Definitions

Suppose that $S$ and $T$ are sets. A relation from $S$ to $T$ is a subset of the product set $S T$. As the name suggests, a relation $R$ from $S$ into $T$ is supposed to define a relationship between the elements of $S$ and the elements of $T$, and so we usually use the more suggestive notation $R x y$ when $x y R$. The domain of $R$ is the set of first coordinates and the range of $R$ is the set of second coordinates.

$domain R x S y T x y R$ $range R y T x S x y R$

A relation from a set $S$ to itself is said to be a relation on $S$.

#### Basic Examples

Suppose that $S$ is a set and recall that $S$ denotes the power set of $S$, the collection of all subsets of $S$. The membership relation  from $S$ to $S$ is perhaps the most important and basic relationship in mathematics. Indeed, for us, it's a primitive (undefined) relationship--given $x$ and $A$, we assume that we understand the meaning of the statement $x A$.

Another basic primitive relation is the equality relation  on a given set of objects $S$. That is, given two objects $x$ and $y$, we assume that we understand the meaning of the statement $x y$.

Other basic relations that you have seen are

1. The subset relation  on $S$
2. The order relation  on 

Note that a function $f$ from $S$ into $T$ is a special type of relation. To compare the two types of notation (relation and function), note that $f x y$ means that $y f x$.

### Constructions

#### Set Operations

Since a relation is just a set of ordered pairs, the set operations can be used to build new relations from existing ones. Specifically, if $Q$ and $R$ are relations from $S$ to $T$, then so are $Q R$, $Q R$, and $Q R$. If $R$ is a relation from $S$ to $T$ and $Q R$, then $Q$ is a relation from $S$ to $T$.

Suppose that $Q$ and $R$ are relations from $S$ to $T$. Note that

1. $Q R x y$ if and only if $Q x y$ or $R x y$.
2. $Q R x y$ if and only if $Q x y$ and $R x y$.
3. $Q R x y$ if and only if $Q x y$ but not $R x y$.
4. If $Q R$ then $Q x y$ implies $R x y$.

#### Restrictions

If $R$ is a relation on $S$ and $A$ is a subset of $S$ then $R A R A A$ is a relation on $A$, called the restriction of $R$ to $A$.

#### Inverse

If $R$ is a relation from $S$ to $T$, the inverse of $R$ is the relation from $T$ to $S$ defined by

$R y x if and only if R x y$

Equivalently, $R y x x y R$. Note that any function $f$ from $S$ into $T$ has an inverse relation, but only when the $f$ is one-to-one is the inverse relation also a function.

#### Composition

Suppose that $Q$ is a relation from $S$ to $T$ and that $R$ is a relation from $T$ to $U$. The composition $Q R$ is the relation from $S$ to $U$ defined as follows: for $x S$ and $z U$, $Q R x z$ if and only if there exists $y T$ such that $Q x y$ and $R y z$. Note that the notation is inconsistent with the notation used for composition of functions, essentially because relations are read from left to right, while functions are read from right to left. Hopefully, the inconsistency will not cause confusion, since we will always use function notation for functions.

### Basic Properties

The important classes of relations that we will study in the next couple of sections are characterized by certain basic properties. Suppose that $R$ is a relation on $S$.

1. $R$ is reflexive if $R x x$ for all $x S$.
2. $R$ is irreflexive if no $x S$ satisfies $R x x$
3. $R$ is symmetric if $R x y$ implies $R y x$ for all $x S$ and $y S$.
4. $R$ is anti-symmetric if $R x y$ and $R y x$ implies $x y$ for all $x S$ and $y S$.
5. $R$ is transitive if $R x y$ and $R y z$ implies $R x z$ for all $x S$, $y S$, $z S$

Suppose that $R$ is a relation on $S$. Show that $R$ is reflexive if and only if the equality relation  on $S$ is a subset of $R$.

Suppose that $R$ is a relation on $S$. Show that $R$ is symmetric if and only if $R R$

Suppose that $R$ is a relation on $S$. Show that $R$ is transitive if and only if $R R R$.

Suppose that $R$ is a relation on $S$. Show that $R$ is antisymmetric if and only if $R R$ is a subset of the equality relation  on $S$.

Suppose that $Q$ and $R$ are a relations on $S$. For each property below, show that if both $Q$ and $R$ have the property, then so does $Q R$.

1. reflexive
2. symmetric
3. transitive

Suppose that $R$ is a relations on a set $S$.

1. Give an explicit definition for the property $R$ is not reflexive.
2. Give an explicit definition for the property $R$ is not irreflexive.
3. Are any of the properties $R$ is reflexive, $R$ is not reflexive, $R$ is irreflexive, $R$ is not irreflexive equivalent?

Suppose that $R$ is a relations on a set $S$.

1. Give an explicit definition for the property $R$ is not symmetric.
2. Give an explicit definition for the property $R$ is not antisymmetric.
3. Are any of the properties $R$ is symmetric, $R$ is not symmetric, $R$ is antisymmetric, $R$ is not antisymmetric equivalent?

### Computational Exercises

Let $R$ be the relation defined on  by $R x y$ if and only if $x y$. Determine if $R$ has each of the following properties:

1. reflexive
2. symmetric
3. transitive
4. irreflexive
5. antisymmetric

The relation $R$ in the previous exercise is a member of an important class of equivalence relations.

Let $R$ be the relation defined on  by $R x y$ if and only if $x 2 y 2 1$. Determine if $R$ has each of the following properties:

1. reflexive
2. symmetric
3. transitive
4. irreflexive
5. antisymmetric