1.3. Relations#

Relations [89] between two sets X and Y are subsets of the Cartesian product of two sets X×Y.

Relations on a set X are subsets of the Cartesian product X×X. We recall:

X×X={(a,b)|aX and bX}.

In other words, X×X is the collection of all possible ordered pairs of elements of X.

Definition 1.23 (Binary relation)

Given sets X and Y, a binary relation over sets X and Y is defined as a subset R of the Cartesian product X×Y.

If (x,y)R then x is said to be in relation R with y. This is denoted by xRy.

X is called the domain or set of departure of R and Y is called the codomain or set of destination of R.

A binary relation on a set X is defined as a subset of X×X. It is also known as a homogeneous relation.

When XY, then the relation is called a heterogeneous relation.

1.3.1. Types of relations#

Definition 1.24 (Injective relation)

A relation R:XY is called injective if xRy and zRy implies x=z. In other words, for each yY, there is at-most one xX such that xRy.

If X is the set of men, Y is the set of women and R is the relation of marriage, then we are saying that each woman can have at most one husband.

A man may have multiple wives. Some men or women may be unmarried too.

Definition 1.25 (Functional relation)

A relation R:XY is called functional if xRy and xRz implies y=z. In other words, for each xX, there is at-most one yY such that xRy. Such binary relations are also called partial functions.

We are saying that each man can have at most one wife.

A woman may have multiple husbands. Some men or women may be unmarried too.

Definition 1.26 (One-to-one relation)

A relation is called one-to-one if it is injective and functional.

We are saying that each woman can have at most one husband and each man can have at most one wife.

Some men or women may still be unmarried.

Definition 1.27 (One-to-many relation)

A relation is called one-to-many if it is injective but not functional.

While each woman has at most one husband, there are some men who have multiple wives.

Some men or women may still be unmarried.

Definition 1.28 (Many-to-one relation)

A relation is called many-to-one if it is functional but not injective.

While each man can have at most one wife, there are women who have multiple husbands.

Some men or women may still be unmarried.

Definition 1.29 (Many-to-many relation)

A relation is called many-to-many if it is neither injective nor functional.

No spouse, one spouse, multiple spouses, all are permitted.

Definition 1.30 (Serial relation)

A relation R:XY is called serial if for every xX there exists at least one yY such that xRy.

Every man has at least one wife.

Some women may still be unmarried.

Definition 1.31 (Surjective relation)

A relation R:XY is called surjective if for every yY there exists at least one xX such that xRy.

Every woman has at least one husband.

Some men may still be unmarried.

1.3.2. Operations on Relations#

Let R and S be relations over sets X and Y.

Definition 1.32 (Union of relations)

RS={(x,y)|xRy or xSy}.

Definition 1.33 (Intersection of relations)

RS={(x,y)|xRy and xSy}.

Definition 1.34 (Composition of relations)

Let R:XY and S:YZ be two relations. Then, there composition is defined as:

SR{(x,z)X×Z| there exists yY such that xRy and yRz}.

1.3.3. Equivalence Relations#

An interesting type of relations are equivalence relations over a set X.

Definition 1.35 (Equivalence relation)

A relation R on a set X is said to be an equivalence relation if it satisfies the following properties:

  • xRx for each xX (reflexivity).

  • If xRy then yRx (symmetry).

  • If xRy and yRz then xRz (transitivity).

We can now introduce equivalence classes on a set.

Definition 1.36 (Equivalence class)

Let R be an equivalence relation on a set X. Then the equivalence class determined by the element xX is denoted by [x] and is defined as

[x]={yX|xRy}

i.e. all elements in X which are related to x.

We can now look at some properties of equivalence classes and relations.

Proposition 1.3

Any two equivalence classes are either disjoint or else they coincide.

Example 1.4 (Equivalent classes)

Let X bet the set of integers Z. Let R be defined as

xRy2(xy)

i.e. x and y are related if the difference of x and y given by xy is divisible by 2.

Clearly, the set of odd integers and the set of even integers forms two disjoint equivalent classes.

Proposition 1.4

Let R be an equivalence relation on a set X. Since x[x] for each xX, there exists a family {Ai}iI of pairwise disjoint sets (a family of equivalence classes) such that X=iIAi.

Definition 1.37 (Partition)

If a set X can be represented as a union of a family {Ai}iI of pairwise disjoint sets i.e.

X=iIAi

then we say that {Ai}iI is a partition of X.

A partition over a set X also defines an equivalence relation on it.

Proposition 1.5

If there exists a family {Ai}iI of pairwise disjoint sets which partitions a set X, (i.e. X=iIAi), then by letting

R={(x,y)X×X|iI such that x,yAi}

an equivalence relation is defined on X whose equivalence classes are precisely the sets Ai.

In words, the relation R includes only those tuples (x,y) from the Cartesian product X×X for which there exists one set Ai in the family of sets {Ai} such that both x and y belong to Ai.

1.3.4. Order#

Another important type of relation is an order relation over a set X.

Definition 1.38 (Partial order)

A relation, denoted by , on a set X is said to be a partial order for X (or that X is partially ordered by ) if it satisfies the following properties:

  • xx holds for every xX (reflexivity).

  • If xy and yx, then x=y (antisymmetry).

  • If xy and yz, then xz (transitivity).

An alternative notation for xy is yx.

Definition 1.39 (Partially ordered set)

A set equipped with a partial order is known as a partially ordered set (a.k.a poset).

Example 1.5 (Partially ordered set)

Consider a set A={1,2,3}. Consider the power set of A which is

X={,{1},{2},{3},{1,2},{2,3},{1,3},{1,2,3}}.

Define a relation R on X such that xRy if xy.

Clearly

  • xxxX.

  • If xy and yx then x=y.

  • If xy and yz then xy.

Thus the relation R defines a partial order on the power set X.

We can look at how elements are ordered within a set a bit more closely.

Definition 1.40 (Chain)

A subset Y of a partially ordered set X is called a chain if for every x,yY either xy or yx holds.

A chain is also known as totally ordered.

  • In a partially ordered set X, we don’t require that for every x,yX, either xy or yx should hold. Thus there could be elements which are not connected by the order relation.

  • In a totally ordered set Y, for every x,yY we require that either xy or yx holds.

  • If a set is totally ordered, then it is partially ordered also.

Example 1.6 (Chain)

Continuing from previous example consider a subset Y of X defined by

Y={,{1},{1,2},{1,2,3}}.

Clearly, for every x,yY, either xy or yx holds.

Hence Y is a chain or a totally ordered set within X.

Definition 1.41 (Total order)

A relation, denoted by , on a set X is said to be a total order for X (or that X is totally ordered by ) if it satisfies the following properties:

  • xx holds for every xX (reflexivity).

  • If xy and yx, then x=y (antisymmetry).

  • If xy and yz, then xz (transitivity).

  • xy or yx holds for every x,yX (strongly connected).

Definition 1.42 (Totally ordered set)

A set equipped with a total order is known as a totally ordered set.

Example 1.7 (More ordered sets)

  • The set of natural numbers N is totally ordered.

  • The set of integers Z is totally ordered.

  • The set of real numbers R is totally ordered.

  • Suppose we define an order relation in the set of complex numbers as follows. Let x+jy and u+jv be two complex numbers. We say that

    x+jyu+jvxu and yv.

    With this definition, the set of complex numbers C is partially ordered.

  • R is a totally ordered subset of C since the imaginary component is 0 for all real numbers in the complex plane.

  • In fact, any line or a ray or a line segment in the complex plane represents a totally ordered set in the complex plane.

1.3.4.1. Upper Bounds#

We can now define the notion of upper bounds in a partially ordered set.

Definition 1.43 (Upper bound)

If Y is a subset of a partially ordered set X such that yu holds for all yY and for some uX, then u is called an upper bound of Y.

Note that there can be more than one upper bounds of Y. Upper bound is not required to be unique.

Definition 1.44 (Maximal element)

An element mX is called a maximal element whenever the relation mx implies x=m.

This means that there is no other element in X which is greater than m.

A maximal element need not be unique. A partially ordered set may contain more than one maximal element.

Example 1.8 (Maximal elements)

Consider the following set

Z={,{1},{2},{3},{1,2},{2,3},{1,3}}.

The set is partially ordered w.r.t. the relation .

There are three maximal elements in this set namely {1,2},{2,3},{1,3}.

Example 1.9 (Ordered sets without a maximal element)

  • The set of natural numbers N has no maximal element.

What are the conditions under which a maximal element is guaranteed in a partially ordered set X?

Following statement known as Zorn’s lemma guarantees the existence of maximal elements in certain partially ordered sets.

Proposition 1.6

If a chain in a partially ordered set X has an upper bound in X, then X has a maximal element.

1.3.4.2. Lower Bounds#

Following is corresponding notion of lower bounds.

Definition 1.45 (Lower bound)

If Y is a subset of a partially ordered set X such that uy holds for all yY and for some uX, then u is called an lower bound of Y.

Definition 1.46 (Minimal element)

An element mX is called a minimal element whenever the relation xm implies x=m.

As before there can be more than one minimal elements in a set.