
Set operations compare membership of each ordered pair in two relations. Composition connects pairs through an intermediate element; powers repeat this operation to describe walks of a given length.
1. Set Operations on Relations
Let . Their union, intersection, difference, and symmetric difference are also relations from to .
| Operation | Condition for to belong |
|---|---|
| It belongs to at least one of the relations | |
| It belongs to both relations | |
| It belongs to but not to | |
| It belongs to exactly one relation | |
| It does not belong to , but remains within the specified Cartesian product |
The complement depends on the underlying sets: it does not include arbitrary pairs outside . The symmetric difference can also be written as .
Example: Computing set operations. Let , , and
Find , , , , and .
Show solution and steps
The only shared pair is . Therefore,
Union records each pair once. Symmetric difference excludes the shared members. Difference depends on the order of the operands.
Interpreting an application. If records courses a student has completed and records courses required for graduation, then records required courses still unfinished, while records completed requirements. The objects remain student–course pairs; these operations do not discard either component.
Example: Order relations on the real numbers. Let and . Find their union, intersection, two differences, and symmetric difference. Also find the complement of their union in .
Show solution and steps
A real pair satisfies exactly one of , , or . Thus
The union excludes the entire diagonal, so it is not the universal relation. The differences preserve the original relations because no pair belongs to both. The complement result follows from the stated universe .
Inverses and Set Operations
For ,
Reversing each ordered pair preserves the membership conditions in these set operations.
2. Composition
Definition and Order of Evaluation
For and , define
In , follow first and second. At least one intermediate element must exist; it need not be unique. If several intermediate elements produce the same , that pair appears only once in the resulting set.
For each starting element , list all reachable through . Next list all reachable from those through . Retain only the starting and ending elements. The relation on the right is used first, as in function composition.
Example: Composing through an intermediate set. Let
Find and identify the intermediate elements producing its pairs.
Show solution and steps
| Start | Intermediate through | End through | Resulting pairs |
|---|---|---|---|
| 1 | 1, 4 | 1→0; 4→1 | |
| 2 | 3 | 3→1 and 3→2 | |
| 3 | 1, 4 | 1→0; 4→1 |
Thus,
For example, is produced through intermediate element 3. The pair in is never used because no pair in has second component 2.
Associativity and Failure of Commutativity
For relations , , and ,
The arrows indicate the source and target sets of a relation, not that it must be a function. Both sides require elements and satisfying , , and . Changing the parentheses does not change these three-step connections.
Composition is generally not commutative. Reversing the order may fail to match the source and target sets. Even when both relations are on the same set, the results can differ.
Supplementary example: A counterexample to commutativity. On , let and . Find and .
Show solution and steps
Following then gives , so . Following then gives , so . The results are different.
Inverse of a Composition
For and ,
Reverse the connection to obtain . Taking the inverse of a composition reverses the order as well as each relation.
3. Powers and Transitivity
Powers Describe an Exact Number of Steps
For a relation on , its positive integer powers are defined recursively:
A pair belongs to when there is a directed walk of exactly edges from to . Vertices and edges may repeat. Connections using between one and edges are represented by . To allow zero steps as well, include .
Example: Computing successive powers. On , let
Find , , and , and give a general expression for when .
Show solution and steps
Record the endpoint for each starting vertex and walk length:
| Start | 1 step | 2 steps | 3 steps | 4 or more steps |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 | 1 |
| 3 | 2 | 1 | 1 | 1 |
| 4 | 3 | 2 | 1 | 1 |
Consequently,
After three steps, every walk ends at 1. Further steps follow the loop at 1, so for all .
When a zeroth power is used, it is normally defined by , representing a zero-step walk that stays at its starting point. One may also define , but these negative powers do not generally behave as cancellable algebraic inverses.
Zeroth powers and inverse relations. The definition does not imply for a general relation. For and , we obtain . Both and hold when is the graph of a bijection from to itself. Positive powers remain defined by repeated composition.
Testing Transitivity with the Second Power
By definition, contains the starting and ending elements of every two-step connection. Hence
The first equivalence is the definition of transitivity. If every positive power is contained in , taking proves transitivity. For the converse, use induction:
- For , .
- Assume . If , there is an with and .
- The induction hypothesis gives . Transitivity then gives , proving .
Transitivity requires containment, not equality. For instance, is transitive even though . If is both reflexive and transitive, then : precede each existing edge by the loop at its starting vertex. Thus , and every positive power equals .
From Repeated Connections to a Closure
The relation containing all positive-length connections is
It contains . Concatenating two finite walks gives another finite walk, so is transitive. Any transitive relation containing must contain every , and therefore . Thus is the smallest transitive relation containing , called the transitive closure.
Adding only may be insufficient. For , the relation contains and but lacks the required . Three-step connections must also be considered.
4. Review and Self-Check
- Prove that is symmetric for every relation on .
- Must the union of two transitive relations be transitive? What about their intersection?
- For on , find and . Do its powers eventually stabilize?
Show self-check answers
- If comes from , its reverse belongs to . If it comes from , its reverse belongs to . Either way, the union contains the reverse pair.
- The union need not be transitive. On , and are individually transitive, but their union lacks . The intersection is transitive: two consecutive pairs in it belong to both relations, so their shortcut belongs to both and therefore to the intersection.
- and . Every even power is and every odd power is . The sequence is periodic rather than eventually constant.
Glossary and Sources
| Term | Main idea |
|---|---|
| Composition of relations | : first , then |
| Powers of a relation | : exactly steps |
| Symmetric difference | : membership in exactly one relation |
| Transitive closure | The smallest transitive relation containing the original relation |
| Directed walk | A sequence of directed edges in which vertices and edges may repeat |
- Course slides.
- Rosen, 8th edition, Section 9.1: printed pages 606–608, PDF pages 629–631. The closure connection uses the opening of Section 9.4 on printed page 628, PDF page 651.
- Figures 1 and 2 are redrawn from the edge sets in the worked examples. The noncommutativity example, the vacuous and periodic power examples, and the counterexample to cancellation with inverse relations are supplementary derivations.
Assigned textbook exercises: Section 9.1, Exercise 32 on composition, printed page 609 / PDF page 632; Exercise 50(a, b) on counting transitive relations on one and two elements; Exercise 58 on computing through , with the last two exercises on printed page 610 / PDF page 633. The Boolean matrix method in Note 1.4 can assist with higher powers.
Updated: