We say two relations $R_1$ and $R_2$ are equal if:

$$R_1\subseteq \prod_{i=1}^n A_i$$ $$R_2\subseteq \prod_{i=1}^m B_i$$ then, $$n = m ,$$ $$A_i=B_i\quad \forall i,\,1\le i \le n,$$ $$let,s_j\,\,and\,\,t_j\,\,be\,\,tuples\,\,of\,\,R_1\,\,and\,\,R_2\,\,respectively$$ $$s.t.,\,\,s_j=<a_1,a_2,a_3,\ldots,a_j>\epsilon\,R_1\land$$ $$t_j=<b_1,b_2,b_3,\ldots,b_j>\epsilon\,R_2$$ $$\Rightarrow\,(a_1=b_1\,\land a_2=b_2\,\land\ldots\land a_n=b_n)$$ $$\forall \,j\,\epsilon \mathbb N)$$

where $A_i$ and $B_i$ are sets.

So, will the below relations be equal? $$Name = \{x,y\}\,\,and\,\,City = \{a,b\}$$ let, $$R_1=\{<p,q>|\quad p\,\epsilon\,Name\land q\,\epsilon\,City,\quad p\,\,was\,\,born\,\,in\,\,city\,\,q\}$$ $$R_2=\{<p,q>|\quad p\,\epsilon\,Name\land q\,\epsilon\,City,\quad p\,\,lives\,\,in\,\,city\,\,q\}$$ suppose we get, $$R_1=\{<x,a>,<y,b>\}$$ $$R_2=\{<x,a>,<y,b>\}$$ That is, x was born in the same city which he/she lives in.
Can we say,$$R_1=R_2$$

  • $\begingroup$ Your definition of equality of relations is wrong. It only accomplishes that both relations are subsets of the same product, not actually equal. $\endgroup$
    – Christoph
    Commented Dec 26, 2020 at 10:57
  • $\begingroup$ Thanks, @Christoph I totally skipped that one condition. I have edited the question. $\endgroup$ Commented Dec 26, 2020 at 11:58
  • $\begingroup$ Your condition on tuples when defining equality of relations is not what you want to say. It implies that $R_1=R_2$, but also that this relation contains only a single tuple. $\endgroup$ Commented Dec 26, 2020 at 15:49
  • $\begingroup$ @MaliceVidrine I have edited the condition. I hope I have removed any sort of ambiguity. $\endgroup$ Commented Dec 26, 2020 at 18:43
  • $\begingroup$ Also let me clear my doubt further. I was confusing equality of two relations with them being same. I think my concepts are pretty much clear now. $\endgroup$ Commented Dec 26, 2020 at 18:57

1 Answer 1


The relations $R_1$ and $R_2$ are equal if and only if both $x$ and $y$ live in the same city as they were born in. That is, for all $p\in\{x,y\}$ and all $q\in\{a,b\}$ we have $$ \text{$p$ was born in city $q$} \quad\Longleftrightarrow\quad \text{$p$ lives in city $q$.} $$

You wrote down the same set of pairs to define $R_1$ and $R_2$, so indeed they are equal.

Equality of relations is a special case of equality of sets, and the sets you wrote down are equal.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .