Definition:Relation

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

A relation (in this context, technically speaking, a binary relation) in $$S$$ to $$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)$$.

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.

Endorelation
If $$S = T$$, then $$\mathcal{R} \subseteq S \times S$$, and $$\mathcal{R}$$ is referred to as an endorelation, or a relation in $$S$$, or a relation on $$S$$.

Generalized Definition
Let $$\mathbb{S} = \prod_{i=1}^n S_i = S_1 \times S_2 \times \ldots \times S_n$$ be the cartesian product of $$n$$ sets $$S_1, S_2, \ldots, S_n$$.

An arbitrary subset $$\mathcal{R} \subseteq \mathbb{S}$$ is a called an $n$-ary relation on $$\mathbb{S}$$.

To indicate that $$\left({s_1, s_2, \ldots, s_n}\right) \in \mathcal{R}$$, we write $$\mathcal{R} \left({s_1, s_2, \ldots, s_n}\right)$$.

A subset of a cartesian space $$S^n$$ is simply called an $$n$$-ary relation on $$S$$.