Definition:Relation

Definition
Let $S \times T$ be the cartesian product of two sets $S$ and $T$.

A relation (in this context, technically speaking, a binary relation) on $S \times T$ is an arbitrary subset $\mathcal R \subseteq S \times T$.

What this means is that a binary relation relates (certain) elements of one set with (certain) elements of another.

Not all elements in $S$ need to be related to every relation in $T$ (but see Trivial Relation, which is a relation in which they are).

When $\left({s, t}\right) \in \mathcal R$, we can write:
 * $s \mathop {\mathcal R} t$

or:
 * $\mathcal R \left({s, t}\right)$.

and can say $s$ bears $\mathcal R$ to $t$.

If $\left({s, t}\right) \notin \mathcal R$, we can write: $s \not \mathcal R t$, that is, by drawing a line through the relation symbol. See Complement of Relation.

Relation as an Ordered Pair
Some sources define a relation between $S$ and $T$ as an ordered pair:
 * $\left({S \times T, P \left({s, t}\right)}\right)$

where:
 * $S \times T$ is the Cartesian product of $S$ and $T$
 * $P \left({s, t}\right)$ is a propositional function on ordered pairs $\left({s, t}\right)$ of $S \times T$.

Such sources then define the graph of the relation as:
 * $\mathcal R = \left\{{\left({s, t}\right) \in S \times T: P \left({s, t}\right)}\right\}$

that is, the set of all $\left({s, t}\right)$ in $S \times T$ for which $P \left({s, t}\right)$ holds.

Hence the graph of a relation is simply what is defined on this page as a relation.

Whether there are any advantages to this form of treatment is debatable. In general, this website will not use this somewhat more elaborate terminology.

This approach is taken in.

Relation as an Ordered Triple
One can define a relation between $S$ and $T$ as an ordered triple:
 * $\mathcal R = \left({S, T, R}\right)$

where $R \subseteq S \times T$.

For $s \in S$ and $t \in T$, we can write $s \mathop {\mathcal R} t$ to mean $\left({s, t}\right) \in R$.

Relation as a Mapping
It is possible to define a relation as a mapping from the cartesian product $S \times T$ to a boolean domain $\left\{{\text{true}, \text{false}}\right\}$:


 * $\mathcal R: S \times T \to \left\{{\text{true}, \text{false}}\right\}: \forall \left({s, t}\right) \in S \times T: \mathcal R \left({s, t}\right) = \begin{cases}

\text{true} & : \left({s, t}\right) \in \mathcal R \\ \text{false} & : \left({s, t}\right) \notin \mathcal R \end{cases}$

This is called the characteristic function of the relation.

However, care needs to be taken that a mapping then cannot be defined as a special relation, as this would be circular.

This approach is taken in.

Also see

 * Mapping


 * Relational Structure


 * Domain
 * Range


 * Entourage


 * Complement of Relation


 * Characteristic Function of a Relation

Linguistic Note
In natural language what we have defined as a relation is usually understood as a relationship.