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 need to be related.

When $$\left({s, t}\right) \in \mathcal{R}$$, we can write: $$s \mathcal{R} 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.

If $$S = T$$, then $$\mathcal{R} \subseteq S \times S$$, and $$\mathcal{R}$$ is referred to as a relation in $$S$$ or 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 show 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 power $$S^n$$ is simply called an $$n$$-ary relation on $$S$$.