Relations: properties, equivalence relations and partial orders
Checking whether a relation is reflexive, symmetric, antisymmetric or transitive, taking composites and closures, and drawing equivalence classes and Hasse diagrams. Classic question types for the final.
Relations are a generalization of functions. In a function every input had exactly one output; in a relation an element can be related to nothing or to many things. This week is a final exam topic. The question types expected on the exam: checking the four properties of a given relation, “Prove that is an equivalence relation”, writing equivalence classes, drawing a Hasse diagram and counting relations.
Golden rules:
- “For every” properties (reflexive) are broken by a single missing pair, and “if … then” properties (symmetric, transitive) are broken by a single counterexample.
- Antisymmetric does not mean “not symmetric”. Both can be true at the same time or false at the same time.
- Equivalence = reflexive + symmetric + transitive. Partial order = reflexive + antisymmetric + transitive.
- For the composite : first , then .
Definitions
A binary relation from to is any subset of . Instead of we write . A relation from to is called a “relation on ”.
Intuition: let be students and be courses. ” takes course ” is a relation. A student may take no courses or five courses. Every function is a relation; the converse is not true.
If there are pairs, and each is either in the relation or not. So there are relations on .
The four properties
Let be a relation on .
| Property | Definition | How it looks in the matrix | To break it |
|---|---|---|---|
| reflexive | the diagonal is all 1 | one missing | |
| irreflexive | the diagonal is all 0 | one present | |
| symmetric | present, absent | ||
| antisymmetric | off the diagonal and are not both 1 | , both present | |
| transitive | (Boolean) | present, absent |
Example 1. on : every (reflexive). but (not symmetric). If and then (antisymmetric). If then (transitive).
Example 2. on :
reflexive? (2,2) missing -> NO
symmetric? (1,2) and (2,1) both present -> YES
antisymmetric? (1,2),(2,1) present but 1 != 2 -> NO
transitive? (2,1),(1,2) present, (2,2) missing -> NO
PITFALL · Skipping the case in the transitivity check. In Example 2, and require . Most students look only at chains of “three distinct elements” and miss this.
TIP · the empty condition. For “if … then” properties, if the premise is never satisfied, the property is automatically true. The empty relation is symmetric, antisymmetric and transitive (but not reflexive if is nonempty).
Counting relations
. There are pairs on the diagonal and off the diagonal; the off-diagonal pairs are grouped into matchings , and there are matchings.
| Type | Number | |
|---|---|---|
| all relations | 512 | |
| reflexive | 64 | |
| symmetric | 64 | |
| antisymmetric | 216 | |
| reflexive and symmetric | 8 |
The logic: in symmetric the diagonal pairs are free (), and each matching is “both or neither” ( choices). In antisymmetric there are 3 choices for each matching: only , only , neither.
Composites and powers of relations
If : and : , then
Like function composition: go first with , then continue with . Powers: , . An important theorem: is transitive for every .
Transitive closure : the smallest transitive relation containing . Think of it as a directed graph: if there is a path from to , then . With matrices, ; in practice the Warshall algorithm is used.
Equivalence relations
A relation that is reflexive, symmetric and transitive is called an equivalence relation. Intuition: a “sameness” relation like “plays on the same team”, “gives the same remainder”, “born in the same year”.
The equivalence class of : .
Basic theorem: equivalence classes are either identical or disjoint, and their union is . So they form a partition. Conversely, every partition defines an equivalence relation (“being in the same block”). That is why the number of equivalence relations on an -element set equals the number of partitions (the Bell number): 5 for , 15 for .
The most classic example: congruence modulo . if and only if . There are classes: .
A fully written proof
Claim. Let be an integer. The relation on is an equivalence relation.
Proof. Reflexive. For every integer , , so and . Symmetric. Suppose . Then for some integer . Hence , and is an integer, so . Transitive. Suppose and . Then and for some integers . Adding, , so and . Since is reflexive, symmetric and transitive, it is an equivalence relation.
In plain words: write each property under a separate heading, write the definition () out explicitly, and at the end add a closing sentence that mentions all three. Instructors give marks per property.
Partial orders
A relation that is reflexive, antisymmetric and transitive is called a partial order; the pair is called a poset. Examples: on numbers, on positive integers, on sets.
It is “partial” because two elements need not be comparable: and . If every pair is comparable it is called a total order.
Hasse diagram
A short way to draw a poset. From the directed graph remove three things:
- the diagonal loops (already known from reflexivity),
- the edges that come from transitivity (the edge - if ),
- the arrow directions (the smaller is drawn lower).
Only the cover pairs remain: with no element in between.
Example. The divisors of 18, , with divisibility:
level 3: 18
/ \
level 2: 6 9
/ \ /
level 1: 2 3
\ /
level 0: 1
edges: 1-2, 1-3, 2-6, 3-6, 3-9, 6-18, 9-18 (7 edges)
Terms: maximal (nothing above it), minimal (nothing below it), greatest/least element (greater/smaller than everyone, must be unique), upper bound (greater than or equal to everything in a subset), least upper bound (the smallest of the upper bounds). For divisibility, lub = lcm, glb = gcd.
n-ary relations (briefly)
A subset of is called an n-ary relation. A database table is exactly this: each row is an -tuple, each column is a field. Selection filters rows, projection removes columns, join matches two tables on common fields. On the final it comes at most as one definition question.
Common mistakes
| Wrong | The truth |
|---|---|
| “Not symmetric, so antisymmetric” | Independent properties; is neither |
| Skipping the chain in transitivity | is needed too |
| Thinking “some present” is enough for reflexive | for every |
| Applying first in | First , then |
| Drawing a transitive edge like - in a Hasse diagram | Only pairs with no element in between |
| Maximal = greatest | There can be several maximal elements; greatest is larger than everyone and unique |
| for counting antisymmetric relations | : 2 choices on the diagonal, 3 per matching |
| Putting an element in two classes when writing equivalence classes | Classes are disjoint; every element is in exactly one class |
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Let on . List the number of ordered pairs in and determine whether is reflexive, symmetric, antisymmetric, transitive.
Show answer
The pairs: , 8 in total.
Every , so it is reflexive. but , so it is not symmetric. and (for positive numbers) give , so it is antisymmetric. If and then , so it is transitive. Conclusion: a partial order.
Show that on is an equivalence relation and list its equivalence classes.
Show answer
Reflexive: are all present. Symmetric: the only off-diagonal pairs are and , and both are present. Transitive: for we have ; for we have ; the other chains involve the diagonal., . The classes and form a partition of the set.
How many binary relations are there on a set with 4 elements?
Show answer
A relation is a subset of . , and each pair is either in or out: .
How many reflexive relations are there on a set with 4 elements?
Show answer
The 4 diagonal pairs must be present. The remaining pairs are free: .
How many antisymmetric relations are there on a set with 3 elements?
Show answer
The 3 pairs on the diagonal are free: . Off the diagonal there are matchings of the form . For each there are 3 choices: only , only , neither (both together is forbidden).
Total .
On let and . Find .
Show answer
. First , then . with : . with , : , . with , : , .
The result is . (In the reverse order , which is different.)
Let be congruence modulo 4 on . Find the equivalence class of 7 and the number of ordered pairs in .
Show answer
.
There are 4 classes (), each with 3 elements. Every ordered pair from within one class is in the relation: . Total .
How many different equivalence relations are there on a set with 4 elements?
Show answer
Equivalence relations correspond one-to-one with partitions. Count by block structure of the 4 elements:
one block : 1. : 4. : 3. : . : 1. Total .
Consider the poset . How many edges does its Hasse diagram have? Find the least upper bound and the greatest lower bound of .
Show answer
A Hasse edge is only a pair with "no element in between" (a cover): , , , , , , . Total 7 ( is not drawn, since 2 lies in between).
Upper bounds: those that are multiples of both 4 and 6, only 12. The least upper bound is 12. Lower bounds: those that divide both, , the greatest is 2.
Let be the relation on with iff is even. Prove that is an equivalence relation and describe its equivalence classes.
Show answer
Reflexive: is even, so .
Symmetric: if is even then is also even.
Transitive: let , . Add: , so , even. Thus .
Classes: = the even numbers, = the odd numbers. ( is even if and only if and have the same parity.)
Find the transitive closure of on .
Show answer
Transitive closure = every for which there is a path in the directed graph. Paths: , , , , , .
The added pairs are , , . Total 6 pairs. (There is no cycle, so no diagonal pairs appear.)
Let iff on . Is reflexive, symmetric, antisymmetric, transitive? Give counterexamples where it fails.
Show answer
Reflexive: , true.
Not symmetric: is in () but is not ( is false).
Not antisymmetric: both () and () are in, but .
Not transitive: and are in, but is not, because is false.
Verification: The properties of every relation were checked by brute force over all pairs with node; the counting formulas were verified by counting one by one for n = 2, 3 (and for equivalence relations n = 4, 2^16 relations); composites, transitive closure (Warshall) and Hasse edges were computed in code (verify/MAT2033/12.mjs).