Relations: Introduction
What is a Relation?
Definition
A binary relation from a set to a set is a subset .
We write:
- to indicate a relation from to
- or to indicate relates and
Intuition
A relation describes how elements of are connected to elements of . Unlike a function, a single can be related to multiple , or to none at all.
Relational Extensionality
Two relations are equal iff they relate the same pairs:
Examples of Relations
The Empty Relation
For any sets , the empty relation relates nothing.
The Full Relation
The full relation relates everything.
The Identity Relation
For a set , the identity relation :
Examples from Computer Science
Program specification: The relation given by .
Operational semantics: A transition relation on machine states where means “state can transition to ”.
Network connectivity: A relation on network nodes, where means “node is directly connected to node ”.
Database relations: A table relating Movies, Directors, Years, and People.
Special Relations on a Single Set
A relation is called an endo-relation or relation on .
Reflexivity
is reflexive if .
Equivalently: .
Symmetry
is symmetric if .
Transitivity
is transitive if .
Antisymmetry
is antisymmetric if .
Examples
| Relation | Reflexive | Symmetric | Transitive | Antisymmetric |
|---|---|---|---|---|
| on any set | Yes | Yes | Yes | Yes |
| on | Yes | No | Yes | Yes |
| on | No | No | Yes | Yes |
| on | Yes | No | Yes | No |
| ”is a sibling of” on people | No | Yes | No | No |
Visualising Relations
Internal Diagrams
Draw elements of on the left, elements of on the right. Draw arrows from to whenever .
Matrix Representation
For finite sets and , represent as an boolean matrix :
Graph Representation (for endo-relations)
Draw elements of as vertices. Draw a directed edge from to whenever .
Summary
- A relation is a subset
- Special relations: empty, full, identity
- Key properties: reflexive, symmetric, transitive, antisymmetric
- Visualise with internal diagrams, matrices, or directed graphs