OPERATIONS ON RELATIONS

     Table of contents

Union and intersection

Opposite of a relation

Composition of relations

Union and intersection

Since relations from A to B are subsets of $A\times B$, you can form the union or intersection of any two relations.

Examples

On the set $\mathbb{R}$ of real numbers:

•  The union of “ = “ and " <" is (of course!) “ $\le$ ” . 

•  The intersection of “ $\le$ ” and “ $\ge$ ” is “=”.

•  The union of “<” and “>” is “not equal to”.

•  The intersection of “<” and “>” is the empty relation.

Rules of inference

•  For all $a\in A$ and $b\in B$, $a(\alpha\cup\beta)b$ if and only if $a\,\alpha\,b$ or $a\,\beta\,b$ (or both). 

•  For all $a\in A$ and $b\in B$, $a(\alpha\cap\beta)b$ if and only if both $a\,\alpha\,b$ and $a\,\beta\,b$.

Opposite of a relation

Definition: opposite

The opposite of a  relation $\alpha$ from A to B is a relation called $\alpha^{\mathrm{op}}$ from B to A,  defined by $\alpha^{\mathrm{op}}=\{(b,a)\mid(a,b)\in\alpha\}$.  In other words, you get $\alpha^{\mathrm{op}}$ from $\alpha$ by turning around all the pairs in $\alpha$.

Examples

•  On  $\mathbb{R}$ the opposite of " >" is " <" and the opposite of " $\le$ " is " $\ge$ ".

•  For any set A, the opposite of the equals relation on A is the same equals relation

•  More generally, the opposite of any symmetric relation is the same relation.

Composition of relations

Definition: Composition of relations

Let  $\alpha$ be a relation from A to B and $\beta$ a relation from B to C.  The composite $\beta\circ\alpha$ is a relation from A to C defined this way:  $a(\beta\circ\alpha)c$ if and only if there is an element $b\in B$ satisfying $a\,\alpha\,b$ and $b\,\beta\,c$.

Remark

Computer scientists may write $\alpha;\beta$ for $\beta\circ\alpha$

234513579123456αβExample

Let A = {1 ,2, 3, 4 ,5},

B = {3 ,5, 7, 9},

C = {1 ,2 ,3, 4, 5, 6},

α = {(1, 3), (1, 5), (2, 7), (3, 5), (3, 9), (5, 7)} and

$\beta$ = {(3,1), (3,2), (3,3), (7,4), (9,4), (9,5), (9,6)}.

Then

$\beta\circ\alpha$ = {(1,1), (1,2), (1,3), (2,4), (3,4), (3,5), (3,6), (5,4)}. 

So m $\beta\circ\alpha$ n if and only if in the picture there is a sequence of two arrows, the first marked α and the second marked $\beta$, from m to n.

Associativity

Theorem:  If $\alpha$ is a relation from A to B, $\beta$ is a relation from B to C and $\gamma$ is a relation from C to D, then $\gamma\circ(\beta\circ\alpha)=(\gamma\circ\beta)\circ\alpha$.   

It is worthwhile to draw a picture of an example like the one to the right to understand this claim.