Open In App
Related Articles

Mathematics | Closure of Relations and Equivalence Relations

Improve Article
Save Article
Like Article

Prerequisite : Introduction to Relations, Representation of Relations

Combining Relations :

As we know that relations are just sets of ordered pairs, so all set operations apply to them as well. Two relations can be combined in several ways such as –

  • Union – R_{1} \cup R_{2} consists of all ordered pairs from both relations. Duplicate ordered pairs removed from Union.
  • Intersection – R_{1} \cap R_{2} consists of ordered pairs which are in both relations.
  • Difference – R_{1} - R_{2} consists of all ordered pairs only in R_{1}, but not in R_{2}.
  • Symmetric Difference – R_{1} \oplus R_{2} consists of all ordered pairs which are either in R_{1} or R_{2} but not both.

There is another way two relations can be combined that is analogous to the composition of functions.

Composition – Let R be a relation from A to B and S be a relation from B to C, then the composite of R and S, denoted by S\circ R, is the relation consisting of ordered pairs (a,c) where a \in A, c \in C and for which there exists an element b \in B such that (a, b) \in R and (b, c) \in S.

  • Example – What is the composite of the relations R and S where R is a relation from \{1, 2, 3\} to \{1, 2, 3, 4\} with R = \{(1,1), (1,4), (2,3), (3,1), (3,4)\} and S is a relation from \{1, 2, 3, 4\} to \{0, 1, 2\} with S = \{(1,0), (2,0), (3,1), (3,2), (4,1)\}?
  • Solution – By computing all ordered pairs where the first element belongs to R and the second element belongs to S, we get –
    S\circ R = \{(1,0), (1,1), (2,1), (2,2), (3,0), (3,1)\}

Composition of Relation on itself :

A relation can be composed with itself to obtain a degree of separation between the elements of the set on which R is defined.

Let R be a relation on the set A.
The powers R^n where n = 1, 2,...., are defined recursively by -
R^1 = R and R^{n+1} = R^n \circ R.

Theorem – Let R be a relation on set A, represented by a di-graph. There is a path of length n, where n is a positive integer, from a to b if and only if (a,b) \in R^n.

Important Note : A relation R on set A is transitive if and only if R^n \subset R for n = 1, 2, 3,....

Closure of Relations :

Consider a relation R on set A. R may or may not have a property P, such as reflexivity, symmetry, or transitivity.

If there is a relation S with property P containing R such that S is the subset
of every relation with property P containing R, then S is called the closure of
R with respect to P.

We can obtain closures of relations with respect to property P in the following ways –

  1. Reflexive Closure – \Delta = \{(a,a)\:|\:a\in A\} is the diagonal relation on set A. The reflexive closure of relation R on set A is R\cup \Delta.
  2. Symmetric Closure – Let R be a relation on set A, and let R^{-1} be the inverse of R. The symmetric closure of relation R on set A is R\cup R^{-1}.
  3. Transitive Closure – Let R be a relation on set A. The connectivity relation is defined as – R^* = \bigcup\limits_{n=1}^{\infty} R^n. The transitive closure of R is R^*.

Example – Let R be a relation on set \{1, 2, 3, 4\} with R = \{(1,1), (1,4), (2,3), (3,1), (3,4)\}. Find the reflexive, symmetric, and transitive closure of R.

Solution –
For the given set, \Delta = \{(1, 1), (2, 2), (3, 3), (4, 4)\}. So the reflexive closure of R is R \cup \Delta = \{(1,1), (1,4), (2,2), (2,3), (3,1), (3,3),  (3,4), (4,4)\}

For the symmetric closure we need the inverse of R, which is
R^{-1} = \{(1,1), (1,3), (3,2), (4,1), (4,3)\}.
The symmetric closure of R is-
\{(1,1), (1,3), (1,4), (2,3), (3,1), (3,2), (3,4), (4,1), (4,3)\}

For the transitive closure, we need to find R^*.
\therefore we need to find R^1, R^2, ... , until R^{n} = R^{n-1}. We stop when this condition is achieved since finding higher powers of R would be the same.
R^{1} = \{(1,1), (1,4), (2,3), (3,1), (3,4)\}
R^{2} = \{(1,1), (1,4), (2,1), (2,4), (3,1), (3,4)\}
R^{3} = \{(1,1), (1,4), (2,1), (2,4), (3,1), (3,4)\}
Since, R^{2} = R^{3} we stop the process.
Transitive closure, R^* = R^1 \cup R^2
\{(1,1), (1,4), (2,1), (2,3), (2,4), (3,1), (3,4)\}

Equivalence Relations :

Let R be a relation on set A. If R is reflexive, symmetric, and transitive then it is said to be a equivalence relation.
Consequently, two elements a and b related by an equivalence relation are said to be equivalent.

Example – Show that the relation
R = \{(a,b)\:|\: a\equiv b (mod\:m)\} is an equivalence relation. a\equiv b (mod\:m) is the congruence modulo m function. It is true if and only if m divides a-b.

Solution – To show that the relation is an equivalence relation we must prove that the relation is reflexive, symmetric and transitive.

  1. Reflexive – For any element a, a - a = 0 is divisible by m.
    \therefore a \equiv a (mod\:m). So, congruence modulo m is reflexive.
  2. Symmetric – For any two elements a and b, if (a,b)\in R or a\equiv b (mod\:m) i.e. a - b is divisible by m, then b - a is also divisible by m.
    \therefore b\equiv a (mod\:m). So Congruence Modulo m is symmetric.
  3. Transitive – For any three elements a, b, and c if (a,b), (b,c) \in R then-
    (a-b) mod\:m = 0
    (b-c) mod\:m = 0
    Adding both equations,

         \begin{flalign*} &\Rightarrow (a-b) mod\:m + (b-c) mod\:m = 0\\ &\Rightarrow (a-b+b-c) mod\:m = 0\\ &\Rightarrow (a-c) mod\:m = 0 \end{flalign}

    \therefore a \equiv c (mod\:m). So, R is transitive.

  4. Since the relation R is reflexive, symmetric, and transitive, we conclude that R is an equivalence relation.

    Equivalence Classes :

    Let R be an equivalence relation on set A.
    We know that if (a,b) \in R then a and b are said to be equivalent with respect to R.

    The set of all elements that are related to an element a of A is called the
    equivalence class of a. It is denoted by [a]_{R} or simply [a] if there is only one
    relation to consider.
    [a]_{R} = \{s\: |\: (a,s) \in R\}

    Any element b \in [a]_{R} is said to be the representative of [a]_{R}.
    Important Note : All the equivalence classes of a Relation R on set A are either equal or disjoint and their union gives the set A.
    \bigcup[a]_{R} = A
    The equivalence classes are also called partitions since they are disjoint and their union gives the set on which the relation is defined

    • Example : What are the equivalence classes of the relation Congruence Modulo m?
    • Solution : Let a and b be two numbers such that a \equiv b\:(mod\:m). This means that the remainder obtained by dividing a and b with m is the same.
      Possible values for the remainder- 0, 1, 2, ..., m-1
      Therefore, there are m equivalence classes – [0]_{m}, [1]_{m}, ...,[m-1]_{m}
      [0]_{m} = \{...,-2m, -m, 0, m, 2m,..., \}
      [1]_{m} = \{...,-2m + 1, -m + 1, 1, m + 1, 2m + 1,..., \}
      [m-1]_{m} = \{...,-2m - 1, -m - 1 , m - 1, 2m - 1,..., \}

    GATE CS Corner Questions

    Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them.

    1. GATE CS 2013, Question 1
    2. GATE CS 2005, Question 42
    3. GATE CS 2001, Question 2
    4. GATE CS 2000, Question 28

    References –
    Composition of Relations – Wikipedia
    Discrete Mathematics and its Applications, by Kenneth H Rosen

    This article is contributed by Chirag Manwani. If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

    Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Last Updated : 13 Dec, 2019
Like Article
Save Article
Similar Reads