Relation

A subset of a Cartesian product, viewed as a set of ordered pairs.
Relation

Let XX and YY be sets. A relation from XX to YY is a subset

RX×Y.R \subseteq X\times Y.

If (x,y)R(x,y)\in R, one often writes xRyxRy. A relation on XX is a subset RX×XR\subseteq X\times X.

Relations generalize functions by allowing an input xx to be related to zero, one, or many outputs yy. Equivalence relations and order relations are special kinds of relations that structure sets.

Examples:

  • The “less-than-or-equal” relation on R\mathbb{R} is  R×R\le\ \subseteq \mathbb{R}\times\mathbb{R}, where (x,y)(x,y)\in \le iff xyx\le y.
  • A function f:XYf:X\to Y can be identified with its graph {(x,f(x)):xX}X×Y\{(x,f(x)):x\in X\}\subseteq X\times Y, which is a relation satisfying a uniqueness property.
  • The divisibility relation on N\mathbb{N} is  N×N|\ \subseteq \mathbb{N}\times\mathbb{N}, where (a,b) (a,b)\in |\ iff aa divides bb.