3.3 KiB
Relations
Definition: a binary relation
R
between the setsS
andT
is a subset of the Cartesian productS \times T
.
- If
(a,b) \in R
thena
is in relationR
tob
, denoted byaRb
.- The set
S
is called the domain of the relationR
and the setT
the codomain.- If
S=T
thenR
is a relation onS
.- This definition can be expanded to n-ary relations.
Definition: let
R
be a relation from a setS
to a setT
. Then for each elementa \in S
we define[a]_R
to be the set
[a]_R := {b \in T ;|; aRb}.
This set is called the ($R$-) image of
a
.For
b \in T
the set
_R[b] := {a \in S ;|; aRb}
is called the ($R$-) pre-image of
B
or $R$-fiber ofb
.
Relations between finite sets can be described using matrices.
Definition: if
S = \{s_1, \dots, s_n\}
andT = \{t_1, \dots, t_m\}
are finite sets andR \subseteq S \times T
is a binary relation, then the adjacency matrixA_R
of the relationR
is then \times n
matrix whose rows are indexed byS
and columns byT
defined by
A_{s,t} = \begin{cases} 1 &\text{ if } (s,t) \in R, \ 0 &\text{ otherwise}. \end{cases}
For example, the adjacency matrix of relation \leq
on the set \{1,2,3,4,5\}
is the upper triangular matrix
\begin{pmatrix} 1 & 1 & 1 & 1 & 1 \ 0 & 1 & 1 & 1 & 1 \ 0 & 0 & 1 & 1 & 1 \ 0 & 0 & 0 & 1 & 1 \ 0 & 0 & 0 & 0 & 1\end{pmatrix}
Some relations have special properties
Definitions: let
R
be a relation on a setS
. ThenR
is called
- Reflexive if
\forall x \in S
there is(x,x) \in R
.- Irreflexive if
\forall x \in S
there is(x,x) \notin R
.- Symmetric if
\forall x,y \in S
there is thatxRy \implies yRx
.- Antisymmetric if
\forall x,y \in S
there is thatxRy \land yRx \implies x = y
.- Transitive if
\forall x,y,z \in S
there is thatxRy \land yRz \implies xRz
.
Equivalence relations
Definition: a relation
R
on a setS
is called an equivalence relation onS
if and only if it is reflexive, symmetric and transitive.
Lemma: let
R
be an equivalence relation on a setS
. Ifb \in [a]_R
, then[b]_R = [a]_R
.
??? note "Proof:"
Suppose $b \in [a]_R$, therefore $aRb$. If $c \in [b]_R$, then $bRc$ and as $aRb$ there is transitivity $aRc$. In particular $[b]_R \subseteq [a]_R$. By symmetry of $R$, $aRb \implies bRa$ and hence $a \in [b]_R$, obtaining $[a]_R \subseteq [b]_R$.
Definition: let
R
be an equivalence relation on a setS
. Then the sets[s]_R
wheres \in S
are called the $R$-equivalence classes onS
. The set of $R$-equivalence classes is denoted byS/R
.
Theorem: let
R
be an equivalence relation on a setS
. Then the setS/R
of $R$-equivalence classes partitions the setS
.
??? note "Proof:"
Let $\Pi_R$ be the set of $R$-equivalence classes. Then by reflexivity of $R$ we find that each element $a \in S$ is inside the class $[a]_R$ of $\Pi_R$. If an element $a \in S$ is in the classes $[b]_R$ and $[c]_R$ of $\Pi_R$, then by the previous lemma we find $[b]_R = [a]_R$ and $[c]_R = [a]_R$. Then $[b]_R = [c]_R$, therefore each element $a \in S$ is inside a unique member of $\Pi_R$, which therefore is a partition of $S$.