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 \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 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}$

but this is too unwieldy and overcomplicated to be practical. It also relies on a circular definition. However, it can have the advantage of making the concept clear.

This approach is taken in.

The concept is expanded in Characteristic Function of a Relation.

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.