Mathbook Project

Relations as Sets

Definition Binary relation

A binary relation on a set AA is a subset of A2=A×AA^2 = A \times A. If RA2R \subseteq A^2 is a binary relation on AA and x,yAx, y \in A, we write xRyxRy for (x,y)R(x, y) \in R.

The relation is indeed a rule that defines the set RR of pairs. The most basic relation is identity relation where elements relate themselves (x,x)R(x, x) \in R when xAx \in A, denoted as IdA\text{Id}_A.

Example

Let A={shorts,t-shirt,sweater,socks}A = \{ \textit{shorts}, \textit{t-shirt}, \textit{sweater}, \textit{socks} \}, when we define a relation "items that are normally worn together" the result would be

R={(shorts,t-shirt),(sweater,socks)}. R = \{ (\textit{shorts}, \textit{t-shirt}), (\textit{sweater}, \textit{socks}) \}.

This may remind you of relational databases. Each row consist of pairs in RR such as (shorts,t-shirt)(\textit{shorts}, \textit{t-shirt}) and elements are the columns. If we were to define three columns, we would need to define relation of relations ((shorts,t-shirt),sandals)((\textit{shorts}, \textit{t-shirt}), \textit{sandals}).

Special Properties of Relations

Some kinds of relations turn out to be so common that they have been given special names. To get at exactly how these relations are similar, and how they differ, we categorize them according to some special properties that relation can have. It turns out that some of these special properties are especially important: orders and equivalence relations.

Definition Reflexivity

A relation RA2R \subseteq A^2 is reflexive iff, for every xAx \in A, xRxxRx.

Definition Transitivity

A relation RA2R \subseteq A^2 is transitive iff, whenever xRyxRy and yRzyRz, then also xRzxRz.

Definition Symmetry

A relation RA2R \subseteq A^2 is symmetric iff, whenever xRyxRy, then also yRxyRx.

The anti-symmetric relation is the opposite of symmetric relation, where the reverse is never true except when x=yx = y. However, the relation may not be reflexive.