Sources

  • Lecture A (Monday): what a relation is, inverse, composition, the special properties of relations, transitive closure (§3.3).
  • Lecture B (Wednesday): equivalence relations, the quotient set, the construction of , partial orders, Hasse diagrams and an old exam question (§3.4–3.5.2).
  • Numbering follows the lecture notes (DM24 script). In the auto-generated transcript, “Konkurrenz” is a transcription error for congruence (Kongruenz) .

Discrepancies between lecture and script (corrected in these notes)

  • Transitive closure (correction at the start of Lecture B): at the end of Lecture A, the board definition of was written wrongly. As written, it just gave back . The correct definition is .
  • The lecturer called the partition theorem “Theorem 3.1”. In the script it is Theorem 3.11.
  • When he checked that is a partial order, he said it is “reflexive, transitive, symmetric, antisymmetric”. is not symmetric ( but ). He meant reflexive, antisymmetric and transitive.
  • About divisibility he once said “we say this relation is a total order”. He meant the opposite. Divisibility is not a total order (3 and 5 are incomparable), and the rest of his explanation says so.
  • In the proof of the rational-numbers lemma he said “commutativity” and corrected himself to “symmetry”.
  • The discussion in Lecture A is garbled in the recording. It is reconstructed in §4 below: always holds, while differs from on but equals it on and .
  • In the exam-question proof the transcript says “2 mal 3, das nennen wir 5”. It is actually (1) and (3) that give (5) by transitivity.

1. Executive Overview & Core Objectives

A relation (Relation) is just a set of ordered pairs, a subset of . All of the machinery this week follows from that one definition: inverse, composition, and the properties reflexive, symmetric, antisymmetric and transitive. Two combinations of these properties matter most. Equivalence relations (reflexive, symmetric, transitive) correspond exactly to partitions of a set and let us build new objects as quotient sets; for example, . Partial orders (reflexive, antisymmetric, transitive) model “comparison” and are drawn as Hasse diagrams.

Learning objectives. After this week you should be able to:

  • State and use Def. 3.9–3.12: relation, identity relation, inverse, composition. Know the order convention of .
  • Prove set identities between relations, such as Lemma 3.8 , using chains of equivalences.
  • Check, or disprove with a counterexample, each of the properties reflexive, irreflexive, symmetric, antisymmetric and transitive. Know their set-theoretic characterisations.
  • Prove Lemma 3.9: is transitive .
  • Define the transitive closure and use it to express “ancestor”.
  • Prove that a given relation is an equivalence relation, including the case split in the construction.
  • Compute equivalence classes and quotient sets. State and prove Theorem 3.11 (the classes form a partition).
  • Check partial-order axioms, distinguish partial and total orders, find covers and draw Hasse diagrams.
  • Solve the exam-type question “Is transitive?” with a full proof.

2. Core Concepts & Formal Definitions

2.0 Follow-up on ordered pairs (from §3.2, Example 3.1)

Ordered pair as a set


With this definition, . Both components can be reconstructed from the set.

A student asked what goes wrong with the “simpler” definition . Here is a real collision:

yet . The first component can no longer be recovered, so this definition is unusable. With the correct definition, ordered pairs behave exactly as expected and you never need to think about the encoding again.

2.1 Relations

Definition 3.9 (Relation)

A (binary) relation from a set to a set (also called an -relation) is a subset

If , is called a relation on . Instead of we write , and we write if .

Recall the Cartesian product (kartesisches Produkt): (Def. 3.8). A relation is itself a set, namely the set of pairs that are “related”. Not every pair needs to be in it, and which subset it is defines the relation.

Definition 3.10 (Identity relation)

For any set , the identity relation (Identitätsrelation) on is

In the lecture, a student asked whether the identity relation is the same as equality. Yes: since everything is a set, “equality” means set equality, and is exactly equality restricted to . The lecturer prefers to write rather than for the relation, so that "" is never ambiguous between a set equation and a relation symbol.

Further examples from the script:

  • Ex. 3.10: on we have .
  • Ex. 3.12: on is the unit circle.
  • Ex. 3.13: is a relation on .
  • Ex. 3.14: the empty relation and the complete relation .

Example 3.11 / Definition (Congruence modulo )

For , , the relation on is

i.e. divides , i.e. and leave the same remainder when divided by . ( is allowed but uninteresting, since then every pair is related.)

2.2 Representations of relations (§3.3.2)

There are two representations: a Boolean matrix and a directed graph.

  • Matrix representation. For finite and , take the matrix with , and otherwise. This was added at the start of Lecture B.
    • Example: on is the identity matrix .
    • On , is the upper triangular matrix and the lower triangular one (Ex. 3.16).
    • Union, intersection and complement of relations are entry-wise OR, AND and NOT.
    • Inverse = transpose.
    • Composition = matrix product, after which every entry is set back to (a Boolean product). The lecturer stressed that an ordinary integer product can produce entries , so it is “similar to but not the same as” composition until you convert back to .
  • Graph representation. Draw a directed edge iff . For a relation on , loops are allowed.

2.3 Inverse and composition

Definition 3.11 (Inverse relation)

The inverse (Umkehrrelation / inverse Relation) of a relation from to is the relation from to

So . An alternative notation is .

In the graph, the inverse reverses all arrows. In the matrix, it transposes.

Definition 3.12 (Composition)

Let be a relation from to and a relation from to . The composition (Komposition / Verknüpfung) (also written ) is the relation from to

For a relation on , is the -fold composition of with itself (, …).

Exam Trap: order of composition

means first , then . You read left to right, following the arrows. This is the opposite of function composition (“first , then ”). The types must match: the target set of must be the source set of .

The lecturer pointed out that using (“there is some connecting middle element”) is a design choice. One could have demanded “for all middle elements” instead. The version has the natural reading “there is a path ”.

Lemma 3.7 (Associativity)

This is an equality of two subsets of (for , , ). Intuitively it means we can compose relations without worrying about brackets, just as with or . The lecture did not prove it; the script’s proof is in §3.

Lemma 3.8 (Inverse of a composition)

For from to and from to :

As with inverting a product of matrices or a composition of functions, the order reverses. The lecture proved this (§3). In the script it is an exercise.

2.4 Special properties of relations on a set (§3.3.6)

Definition 3.13 (Reflexive)

on is reflexive (reflexiv) if for all , i.e.

In the matrix, the diagonal is all 1s. In the graph, every vertex has a loop.

Definition 3.14 (Irreflexive)

is irreflexive (irreflexiv) if for all , i.e.

Definition 3.15 (Symmetric)

is symmetric (symmetrisch) if for all , i.e.

The matrix is symmetric, and the graph can be drawn undirected.

Definition 3.16 (Antisymmetric)

is antisymmetric (antisymmetrisch) if for all , i.e.

Graph: there is no cycle of length 2 between distinct vertices.

Definition 3.17 (Transitive)

is transitive (transitiv) if for all .
Set-theoretic equivalent (Lemma 3.9): .

PropertyFormulaSet-theoretic formExamplesNon-examples
reflexive, , , , on ,
irreflexive, ,
symmetric, , “married to”
antisymmetric, , , , on , on
transitive, , , , ancestor”knows”, parent

Exam Trap: "ir-" and "anti-" are not negations

  • Not reflexive irreflexive. On , is neither.
  • Not symmetric antisymmetric. On distinct , take . It is not symmetric, because but . It is not antisymmetric either, because but . This was the lecturer’s example in Lecture B.
  • Both at once is possible. is symmetric and antisymmetric. So are and any relation on a one-element set.
  • All four combinations occur: neither, only one, the other only, both.

Exam Trap: is antisymmetric

is never true, so the implication in the definition is vacuously true. Equivalently, . So is irreflexive, antisymmetric and transitive, but it is not a partial order because it is not reflexive.

2.5 Transitive closure (§3.3.7)

Definition 3.18 (Transitive closure)

The transitive closure (transitiver Abschluss) of a relation on is

Here for the set system . This is the corrected definition from the start of Lecture B.

In the graph, iff there is a walk of length from to . So is the reachability relation: iff some finite path leads from to .

Points from the student questions:

  • was deliberately not defined. If it were, it would be , and it is explicitly excluded from the union.
  • Does exist? The lecturer admitted that “I cheated a bit”. That the set exists (it needs an inductive definition) does not follow from the set axioms introduced so far. In effect, the definition postulates it.
  • Is the smallest transitive relation containing ? In the lecture it was simply defined as the union, “not a limit”. It is in fact the smallest transitive superset of ; see Self-Assessment Q5.
  • Ex. 3.30 (script): for convex paper polygons, “obtainable with at most one straight cut” is reflexive and antisymmetric but not transitive. Its transitive closure is the covering relation (“can be completely covered by”), which is a partial order.

2.6 Equivalence relations (§3.4)

Definition 3.19 (Equivalence relation)

An equivalence relation (Äquivalenzrelation) on is a relation that is reflexive, symmetric and transitive. These are usually denoted (the “T” hints at transitivity) or , .

Definition 3.20 (Equivalence class)

For an equivalence relation on and , the equivalence class (Äquivalenzklasse) of is

The subscript may be dropped when it is clear from context.

The lecturer said “all that are related to ” without fixing an order. Because is symmetric, and are the same, so this makes no difference.

Facts:

  • By reflexivity, .
  • Every element of a class can serve as its representative: if then (see the proof of Theorem 3.11).
  • There are two trivial equivalence relations. has a single class, itself. has only singleton classes .

Definition 3.21 (Partition)

A partition (Partition) of is a set of subsets of such that

The blocks are pairwise disjoint and together cover .

Definition 3.22 (Quotient set)


is the quotient set (Quotientenmenge) of by , read ” modulo ”. Its elements are the classes themselves, which are sets.

Theorem 3.11

For an equivalence relation on , the quotient set is a partition of .

Converse. Every partition gives an equivalence relation: iff and lie in the same block. So equivalence relations and partitions are the same abstraction.

Lemma 3.10

The intersection of two equivalence relations on the same set is an equivalence relation.

The lecture gave an example instead of a proof: and , not . In general (Ex. 3.18). Script Ex. 3.34: . This “smells like” the least common multiple, which comes back in the number-theory chapter.

2.7 Partial orders (§3.5)

Definition 3.23 (Partial order, poset)

A partial order (Ordnungsrelation / partielle Ordnung) on is a relation that is reflexive, antisymmetric and transitive. A set with a partial order, written , is a partially ordered set (poset).

This is the equivalence-relation definition with symmetric replaced by antisymmetric. In the graph, a partial order has no cycles apart from loops, though “no cycles” alone does not characterise partial orders.

Strict relation

For a partial order :

is never a partial order on a non-empty , because it is irreflexive. On “all sorts of strange things happen” and every condition holds vacuously.

Definition 3.24 (Comparable)

In a poset , and are comparable (vergleichbar) if or . Otherwise they are incomparable.

Definition 3.25 (Total order)

is a total order (Totalordnung), or linear order, if any two elements are comparable:

Every total order is a partial order, but not conversely.

Divisibility

For : . Whether divides anything is left aside; is excluded so nothing strange happens. is fine, since every divides .

Definition 3.26 (Cover)

In a poset , covers (überdeckt) if and there is no with . In words, is a “smallest” element strictly above .

Script Ex. 3.41: in a company hierarchy, ” covers ” means is the direct superior of .

Definition 3.27 (Hasse diagram)

The Hasse diagram (Hasse-Diagramm) of a finite poset is the directed graph on with an edge iff covers . It is drawn so that larger elements sit higher, which lets us omit the arrowheads.


3. Step-by-Step Derivations & Mathematical Proofs

3.1 Lemma 3.7 (associativity). Script proof; not done in lecture

We prove . The other inclusion is analogous. Let .

The key logical fact is when does not occur free in (Chapter 6).

3.2 Lemma 3.8: (proved in lecture)

Setup. and , so and . Also and , so . The types match.

Strategy. This is an equality of sets, so we show that a pair is in the left side iff it is in the right side. Every step below is an equivalence () with the same justification in both directions, so one chain proves both inclusions at once.

Heuristic from the lecture. Always start by applying the definition of the outermost operation. Since the target contains and , it is a good sign whenever these appear.

The commutativity step was suggested by a student. It is exactly what is needed to bring the expression into the pattern "", which is the definition of .

Intuition

To undo “first , then ”, you undo the last step first: go back along , then back along . It is like taking off socks and shoes.

3.3 Lemma 3.9: transitive (proved in lecture)

Lemma 3.9

A relation on is transitive if and only if .

() Assume is transitive. To show , take an arbitrary element of , i.e. , and show .

  1. means . By the definition of composition there is some with .
  2. By transitivity, .
  3. So .

() Assume . Let and ; we must show .

  1. There exists a middle element (namely ) with . By the definition of composition, , i.e. .
  2. Since , we get , i.e. .

3.4 Theorem 3.11: equivalence classes form a partition

The lecture skipped this proof and only gave intuition. Here is the script’s proof, including the part left as an exercise. It is exam-relevant.

Covering. By reflexivity, for every . Hence ; the inclusion "" holds because all classes are subsets of .

Disjointness. It suffices to show, for fixed :

Then any two classes are either equal or disjoint.

(i), inclusion . Let .

The middle step uses , and transitivity.

(i), inclusion . This is the exercise. Let , so . From , symmetry gives . Transitivity on and gives , so .

(ii), by contradiction. Suppose but there is some . Then and . Symmetry gives , and transitivity with gives . Contradiction.

The contradiction step uses .

Converse (partition equivalence relation). Define iff and lie in the same block.

  • Reflexive: every element lies in some block, which contains it.
  • Symmetric: “in the same block as” is symmetric.
  • Transitive: if share block and share block , then . Blocks are disjoint, so and share a block.

3.5 Lemma 3.10: intersection of equivalence relations (exercise in script)

Let be equivalence relations on and .

  • Reflexive: and , so .
  • Symmetric: if , then for . Hence for both , so .
  • Transitive: if , both pairs lie in each . So for both , hence .

3.6 Lemma (§3.4.3): on is an equivalence relation (proved in lecture)

Setup

: pairs of integers whose second component is non-zero. Elements of are already pairs, so relates two elements, each of which is a pair.

We must show the three properties.

1. Reflexivity. We need , i.e. by definition . This holds by commutativity of multiplication. ✓

2. Symmetry. Assume .

3. Transitivity. Assume and . We want , i.e. . By definition:

Important: , because they are second components of elements of . Case split on :

Case .

  • From (1): . Since , we get .
  • From (2): . Since , we get .
  • So . ✓

Case . Multiply (1) and (2) side by side:

  • appears on both sides, so we may cancel it (an elementary property of : if and then ): .
  • appears on both sides; cancel it: . ✓

The script cancels first, which always works, and then splits on . The lecture split first. Both are fine.

Why split cases? In the case we cannot cancel . Cancelling by would be a division by zero, and that is where a naive proof breaks.

Meaning. is the fraction , with the numerator (Zähler) and the denominator (Nenner), and is exactly the rule for when two fractions are equal (). Hence

A rational number is an equivalence class of fractions. For example, is “one half”.

Remarks from the Q&A:

  • Arithmetic on (addition, multiplication, inverses, taking care with in the denominator) could be defined on representatives, but the course does not do it.
  • itself was not formally constructed. One could, for instance, use explicit signs modulo the relation ” equals ”.
  • will not be defined. The point is that such a foundation exists, and the usual arithmetic rules can then be used.

3.7 Divisibility is a partial order on (lecture)

  • Reflexive: , so .
  • Antisymmetric: if and with , then either , or the divisor is strictly smaller ( and ), which is impossible. Formally: and give , so . With positive integers this forces .
  • Transitive: and give , so .
  • Not total: and .

Exam Trap: divisibility on

On , is not antisymmetric: and but . Here also allows . So is not a poset. Always check the underlying set.

3.8 Exam question: is transitive? (old exam, end of Lecture B)

Question

Let be a poset and . Is transitive? Prove it or give a counterexample.

Answer: yes. The lecturer stressed that this is not “obviously true”. The proof must use antisymmetry, and an answer that just says “obviously” gets no marks.

Direct proof. Assume and ; we must show . Unfold the definition of :

From (1), (3) and transitivity of :

It remains to show ; this is the main part. Suppose, for contradiction, .

  • Substituting into (1) gives .
  • Together with (3), , antisymmetry of gives .
  • This contradicts (4).

So . With (5) this is exactly .

Why antisymmetry is essential

For a relation that is only reflexive and transitive (a preorder), the claim fails. On , take . Then and , but . So is not transitive. Antisymmetry is exactly what rules out “going up and coming back”.


4. Worked Examples & Applications

4.1 Students, courses, lecturers (Lecture A; Ex. 3.8)

Sets: (students), (courses), (lecturers). The board’s arrows are reconstructed from the transcript:

  • (“takes”, belegt) . For example, .
  • (“teaches”, unterrichtet) . and co-teach ; and teach nothing.

Inverse. is “is taught by”, with the same arrows reversed.

Composition. (first BEL, then ). Here is related to iff there is a course that takes and teaches.

PairConnecting course?In relation?
yes
takes ; teaches ; no overlapno
yes
yes
teaches nothingno

4.2 on (Lecture A)

  • Inverse of : the answer is , not . A student answered "", which is wrong: , so the swapped pair is in , but .
  • Decomposition: , since .
  • , as a student correctly answered.
    • "": given , choose the middle element . Then and .
    • "": this is transitivity (Lemma 3.9).
    • In general, a reflexive and transitive satisfies .
    • A student suggested ; that is far too restrictive.
  • is the reconstructed part of the discussion. It consists of the pairs with an element strictly between them.
    • On : . For example, but nothing lies strictly between and .
    • On or : , because always lies between and (density).
    • Lesson: the result depends on the underlying set.

4.3 Properties of on (both lectures)

  • Reflexive (): , and is a multiple of every .
  • Symmetric (): if , then .
  • Transitive: if and , then
  • Hence is an equivalence relation (Ex. 3.31).

Classes for (Lecture B):

In the lecture, a student suggested . This is wrong: is not a multiple of . The correct entries are and .

Note that . ” is a multiple of ” is the same condition as ” is a multiple of ”, because only the factor changes by one. Therefore

which has exactly 5 elements, even though each class is infinite.

Q&A: must the blocks be the same size?

No. Here all classes are “equally infinite”; Week 6 makes “sizes of infinity” precise. In general you can take any unbalanced partition of a finite set and get an equivalence relation from it.

4.4 Equivalence relations on the set of humans (Lecture B)

CandidateReflexiveSymmetricTransitiveEquivalence?
“knows”arguable (assume yes)no (a fan knows a star, not vice versa)nono
full siblings incl. oneself (both parents equal)yes (by fiat)yesyesyes
half siblings (≥ 1 common parent)yesyesno: share a mother, share a fatherno
same ageyesyesyesyes

And on , from a student suggestion: . This is reflexive (), symmetric () and transitive (, a sum of rationals). So it is an equivalence relation.

Intuition: equivalence relations as a coarsening (Vergröberung)

In every example, an equivalence relation sorts elements into boxes: people by age, integers by remainder. Within a box we “forget” all differences.

4.5 Family relations via relation algebra (Lecture A; Ex. 3.9, 3.20, 3.23)

On (idealised humans), let mean ” is a child of ”.

  • : iff is a parent of .
  • , as answered in lecture.
  • Siblings (student suggestion): . Here is related to iff , i.e. and have a common parent . Two caveats:
    • This gives half-siblings: one common parent suffices.
    • Everyone is related to themselves. To exclude that, use .
  • The other order, , means ” and have a common child”, which is something entirely different.
  • Ancestor: in predicate logic this needed an infinite disjunction (“parent or grandparent or great-grandparent or …”). A student suggested ; the lecturer’s reply was “then what is ?”. A finite union still needs a bound. The transitive closure solves this cleanly:

4.6 Hasse diagrams (Lecture B; Ex. 3.43, 3.44)

Divisors of 24 under (Ex. 3.43): .

Cover edges: , , , , , , , , , .

graph BT
    n1["1"] --- n2["2"]
    n1 --- n3["3"]
    n2 --- n4["4"]
    n2 --- n6["6"]
    n3 --- n6
    n4 --- n8["8"]
    n4 --- n12["12"]
    n6 --- n12
    n8 --- n24["24"]
    n12 --- n24
  • There is no edge , because (and also ) lies strictly between them: .
  • Walking up an edge always multiplies by a prime here.

(Ex. 3.44):

graph BT
    E["∅"] --- A["{a}"]
    E --- B["{b}"]
    E --- C["{c}"]
    A --- AB["{a,b}"]
    A --- AC["{a,c}"]
    B --- AB
    B --- BC["{b,c}"]
    C --- AC
    C --- BC
    AB --- ABC["{a,b,c}"]
    AC --- ABC
    BC --- ABC
  • Each edge going up adds exactly one element.
  • A student asked why there is no edge . The reason is that (or ) lies strictly between them, so does not cover .
  • Purpose: draw nothing that can be inferred by transitivity, which keeps the diagram readable.

Exam Trap: drawing Hasse diagrams (a frequent exam question)

  • Draw only cover edges. No loops (reflexivity is implicit), no transitive shortcuts.
  • Smaller elements go below. Arrowheads are omitted.
  • “Smaller” means smaller in the given order, not numerically. In , and are isolated points even though .
  • Covers depend on the set. In (Ex. 3.42) there is no , so are all minimal.

5. Intuition & Conceptual Bridges

  • A relation is a bipartite arrow picture. Relations from to are arrows from to . The inverse reverses the arrows; composition follows two arrows in a row.
  • Relation algebra replaces quantifiers. Each set-theoretic characterisation (, , , ) turns a -formula into a set inclusion. This is often the shortest way to prove things. Example: is always symmetric (Q4).
  • Equivalence relation = “same box”. It is a partition seen from another angle. The quotient set is the set of boxes. This is the way to build new mathematical objects: from fractions, and later (residues modulo ) in the number-theory chapter.
  • Partial order = “consistent ranking with gaps”. Some pairs are simply incomparable, like coprime numbers under or and under . Antisymmetry forbids distinct elements being “mutually below” each other, so there are no cycles; transitivity keeps the ranking consistent.
  • Equivalence vs. order. Both are reflexive and transitive. Symmetric gives “same”; antisymmetric gives “ranked”. The only relations that are both are subsets of (by symmetry and antisymmetry, ), and the reflexive one is itself.
  • Link to logic (Ch. 2/6). Relations are another view of binary predicates; a student asked exactly this. The family example shows the advantage: “ancestor”, which could not be written with a finite formula, becomes .
  • Link to the matrix view (Linear Algebra). Inverse is transpose and composition is a Boolean matrix product. Symmetric relations have symmetric matrices.
  • Coming next.
    • §3.5.3–3.5.5: lexicographic order, minimal/maximal/least/greatest elements, meet, join, lattices.
    • §3.6: functions as special relations, where becomes the inverse function and composition is written in the reverse order.
    • §3.7: countability (Week 6), which the lecturer previewed as “distinguishing infinite from more than infinite”.
    • Chapter 4: number theory, where and return.

6. Summary & Self-Assessment Questions

Cheat sheet

ConceptDefinition / Fact
Relation;
Identity
Inverse; matrix transpose
Composition; first , then
Lemma 3.7
Lemma 3.8
Reflexive
Irreflexive
Symmetric
Antisymmetric
Transitive (Lemma 3.9)
Transitive closure (reachability)
Equivalence relationreflexive + symmetric + transitive
Class / quotient;
Thm 3.11 is a partition; partitions equivalence relations
Lemma 3.10 is an equivalence relation;
with
Partial orderreflexive + antisymmetric + transitive; poset
Strict order; transitive (exam question)
Total order
Cover and no with
Hasse diagramedges = covers only, larger elements above

Practice questions

Q1. How many relations are there on a set with ? How many of them are reflexive? How many are symmetric?

Q2. Prove or disprove: if on is symmetric and transitive, then is reflexive. (Classic argument: "".)

Q3. Is the union of two equivalence relations on the same set again an equivalence relation?

Q4. Prove that for every relation from to , the relation on is symmetric. Interpret it in the student/course example.

Q5. Prove that is transitive and that it is contained in every transitive relation . So is the smallest transitive relation containing .

Q6 (Ex. 3.45). Realise the two Hasse diagrams of Figure 3.2 as divisibility posets.

  • Left: a bottom element; two elements above it; two elements above those, each connected to both lower middle elements (a crossing); a top element.
  • Right: a chain of 2, then a diamond, then one more element on top.