NBG Set Theory and Binary Relation

In this chapter, we will discuss further topics on set theory, or more specifically, relations. With set as tool, we can categorize things and try to build connections between them, like defining a function from a preimage to an image. Relation is a superset , i.e., generalization of function, which is crucial to topics that we will discuss later in this chapter.

In real life, relation is referred to as some connections between one person or one group of people to the other.

  1. Imagine a list of students and their grades in a class. Each student (let’s say, by their student ID) is linked to a specific grade. This “student-to-grade” pairing is an example of a functional relation, because every student has one and only one grade assigned.

  2. Consider the relationship “has the same birthday as” among people. If person A has the same birthday as person B, and person B has the same birthday as person C, then person A also has the same birthday as person C. This relationship is an equivalence relation because it’s reflexive (everyone has the same birthday as themselves), symmetric (if A shares a birthday with B, then B shares a birthday with A), and transitive (if A shares a birthday with B, and B with C, then A shares a birthday with C).

  3. Think about the books on a shelf organized by height. Each book can be considered as “shorter than or equal to” the book next to it if you move from left to right. This arrangement demonstrates an order relation because it’s reflexive (each book is the same height as itself), antisymmetric (if one book is both taller and shorter than another, they must be the same book), and transitive (if one book is shorter than a second, and the second is shorter than a third, then the first book is shorter than the third).

The notion is still quite similar in the context of mathematics. From many examples we can see this. Like all the mathematical operations we have defined, the mapping in a function, congruence… To sum up, relation is am abstract topic, yet not hard to understand, since it can be related to the material world easily.

Class

Additionally, we introduce a new concept related to set to explain what is relation. The set theory we discussed in the first part of this book is called Naive Set Theory, which Is actually not the modern set theory. In many aspects, it is not reliable and causes a lot of issues. A very famous example is Russell’s Paradox initiated by the British Philosopher and Mathematician.

Russell’s Paradox illustrates a significant problem in the naive set theory, which assumed sets could include themselves. The paradox is encapsulated in whether the “set of all sets that do not contain themselves” contains itself. If it contains itself, it contradicts its defining property. Conversely, if it does not contain itself, then by definition, it must contain itself. This dilemma indicated the limitations of the naive set theory approach, leading to contradictions. To address these issues, the concept of classes was introduced in NBG Set Theory (von Neumann-Bernays-Gödel set theory).

Classes allow for the conceptualization of collections too large or abstract to be considered as sets, thereby circumventing the paradoxes associated with a more naive interpretation of set theory.

Remark

An interesting fact is that the von Neumann here is exactly John von Neumann, who initiated von Neumann Architecture for computer. It seems that a great Computer Scientist is always also a great Mathematician.

Definition

A class is a collection of objects that are grouped together based on a shared property. Classes differ from sets in that they can represent collections of any size, including those too large to be considered as sets, such as the “class of all sets”. This concept is essential for avoiding paradoxes in set theory, allowing the discussion of large and abstract collections that cannot otherwise be accommodated within the framework of sets.

In NBG set theory, a class is a collection of sets that can be unambiguously defined by a property that all its members share. Formally, a class CC is defined as: C={x:P(x)}C = \{ x : P(x) \} where P(x)P(x) is a property or predicate formulable in the language of set theory, applicable to sets xx. If a class is not a set, it is called a proper class. For example, the class of all sets, which cannot be a member of any class, is a proper class.

Distinguishing set and class in NBG and Naive theory

Naive set theory operates under the general principle that any well-defined collection of objects forms a set. This unrestricted comprehension leads to paradoxes such as Russell’s paradox. In contrast, NBG set theory distinguishes between sets, which are elements of other classes, and classes, which may not necessarily be elements of other classes.

A key distinction in NBG set theory is that a set is a class that is an element of another class, while a proper class, such as the class of all sets, cannot be an element of any class. This distinction helps avoid the paradoxes typical of naive set theory by restricting certain collections from being members of other collections.

Furthermore, in NBG, sets form a subclass of classes, meaning all sets are classes but not all classes are sets. This hierarchical structure allows for a more rigorous foundation for set theory, accommodating larger collections like the class of all sets or the class of all ordinal numbers, which themselves cannot be sets due to their extensive size. We also introduce some of the axioms that is really important for the content here, they are easy to understand, but are important prerequisite for our further discussion.

Axiom

Two classes are equal if and only if they have the same elements. Formally, the axiom is expressed as: AB(x(xAxB)A=B)\forall A \forall B (\forall x (x \in A \leftrightarrow x \in B) \rightarrow A = B)

The other Axiom is on creating new classes.

Axiom

For each open sentence P(x)P(x) there exists a class which consists precisely of those sets which satisfy the condition P(x)P(x).

The class whose existence is postulated by the Axiom is denoted by {x:P(x)}\{x : P(x)\}; thus {x:P(x)}\{x : P(x)\} is a term of the theory NBG and the assertion u{x:P(x)}u \in \{x : P(x)\} is true if and only if uu is a set and P(u)P(u) is true.

Properties and Operations of Class

Since the definition of Class and set are related, there are a lot of overlap in their properties. The union and intersection of two classes are defined in exactly the same way as the union and intersection of two sets in naïve set theory: if AA and BB are classes, then AB={x:(xA)(xB)},AB={x:(xA)(xB)}.\begin{aligned} A \cup B &= \{x : (x \in A) \vee (x \in B)\}, \\ A \cap B &= \{x : (x \in A) \wedge (x \in B)\}. \end{aligned} So a set xx is a member of ABA \cup B if and only if it is a member of either AA or BB (or both); xx is a member of ABA \cap B if and only if it is a member of both AA and BB.

The usual properties of these unions and intersections are established as in naïve set theory. Namely, we have the properties known as idempotence, X(XX=X),X(XX=X),\begin{aligned} \forall X(X \cup X = X), \quad \forall X(X \cap X = X), \end{aligned} associativity, XYZ(X(YZ)=(XY)Z),XYZ(X(YZ)=(XY)Z),\begin{aligned} \forall X \forall Y \forall Z (X \cup (Y \cup Z) = (X \cup Y) \cup Z), \\ \forall X \forall Y \forall Z (X \cap (Y \cap Z) = (X \cap Y) \cap Z), \end{aligned} commutativity, XY(XY=YX),XY(XY=YX),\begin{aligned} \forall X \forall Y (X \cup Y = Y \cup X), \quad \forall X \forall Y (X \cap Y = Y \cap X), \end{aligned} and distributivity, XYZ(X(YZ)=(XY)(XZ)),XYZ(X(YZ)=(XY)(XZ)).\begin{aligned} \forall X \forall Y \forall Z (X \cup (Y \cap Z) = (X \cup Y) \cap (X \cup Z)), \\ \forall X \forall Y \forall Z (X \cap (Y \cup Z) = (X \cap Y) \cup (X \cap Z)). \end{aligned}

Definition

We write xyx \notin y as an abbreviation for ¬(xy)\neg(x \in y). Then for each class AA we define the complement of AA to be the class A={x:xA}.\begin{aligned} \sim A = \{x : x \notin A\}. \end{aligned}

Definition

For two classes AA and BB, the difference A BA~B is defined as: AB or AB={x:(xA)(x∉B)}=A(B).A\sim B \text{ or } A-B=\{x:(x\in A)\land(x\not\in B)\}=A\cap(\thicksim B).

Also, note that double negation and De Morgan’s Law also work for class.

As what we have discussed in set theory that there exist some empty sets, we also have null class and universe class.

Definition

Empty class \emptyset and universe class VV are defined by ={x:xx}   V={x:x=x}.\emptyset=\{x:x\neq x\}\ \ \ V=\{x:x=x\}.

Classes also have their exclusive operations, including intersection and union.

Definition

Let AA be a class; the union and intersection of the class AA are the classes A={x:(y)((yA)(xy))},A={x:(y)((yA)(xy))}\begin{array}{rcl}\bigcup A&=&\{x:(\exists y)((y\in A)\land(x\in y))\},\\ \bigcap A&=&\{x:(\forall y)((y\in A)\to (x\in y))\}\end{array} Where xx is a set and yy is a class.

Thus a class CC belongs to A\bigcup A if and only if CC is a set and CC belongs to at least one of the members of A;CA;C belongs to A\bigcap A if and only if CC is a set and CC belongs to every member of A.A.

The definition is quite different from intersection and union of sets, as class is a generalization of set from higher level abstraction. Also, the intersection and union for sets are binary operations, while unary for one class.

Below is a brief comparison.

Set Union and Intersection:

  1. For two sets AA and BB, their union ABA \cup B is the set of all elements that belong to either AA or BB. Formally: AB={x:xAxB}A \cup B = \{x : x \in A \lor x \in B\}.

  2. For two sets AA and BB, their intersection ABA \cap B is the set of all elements that belong to both AA and BB. Formally: AB={x:xAxB}A \cap B = \{x : x \in A \land x \in B\}.

Class Union and Intersection:

  1. For a class AA, the class union A\bigcup A is the set of all elements xx such that there exists a class yy, where yy is a member of AA, and xx is an element of yy. Formally: A={x:(y)((yA)(xy))}\bigcup A = \{x : (\exists y)((y \in A) \land (x \in y))\}.

  2. For a class AA, the class intersection A\bigcap A is the set of all elements xx such that for every class yy, if yy is a member of AA, then xx is an element of yy. Formally: A={x:(y)((yA)(xy))}\bigcap A = \{x : (\forall y)((y \in A) \to (x \in y))\}.

Comparison:

  1. Set union and intersection operate on two sets, while class union and intersection operate on all member sets of a class.

  2. Set union includes elements that are in either AA or BB, while class union includes elements that are in at least one member of AA.

  3. Set intersection includes elements that are in both AA and BB, while class intersection includes elements that are in all members of AA.

  4. The result of set union and intersection is always a set, while the result of class union and intersection is not necessarily a set , but more likely a class that contains sets.

By comparing these concepts, we can see that class union and intersection are generalizations of set operations at a higher level of abstraction. They allow us to perform operations on the member sets of a class to obtain new sets, which is particularly useful when studying advanced topics in mathematical foundations and set theory.

There are several lemmas related to intersection and union of class.

Lemma

=V\bigcap \emptyset= V and =.\bigcup \emptyset= \emptyset.

Proof

Let CC be a class. Then we have C    C is a set and C belongs to every member of C \in \bigcap \emptyset \iff C \text{ is a set and } C \text{ belongs to every member of } \emptyset Since \emptyset does not literally have any member.     C is a set\iff C \text{ is a set} Any set is a member of universe class     CV.\iff C \in V. Thus =V\bigcap \emptyset = V by the Axiom of Extensionality.

Again let CC be a class. Then C    C is a set and there is a member x of  such that CxC \in \bigcup \emptyset \iff C \text{ is a set and there is a member } x \text{ of } \emptyset \text{ such that } C \in x     C\iff C \in \emptyset (since \emptyset has no members).

So =\bigcup \emptyset = \emptyset by the Axiom of Extensionality.

The inclusive relation of class is very similar to set.

Definition

If AA and BB are classes such that every member of AA is also a member of BB, i.e., such that we have x((xA)(xB)),\forall x ((x \in A) \to (x \in B)), we say that AA is included in BB, BB includes AA or AA is a subclass of BB, and we write ABA \subseteq B or BAB \supseteq A. (If AA is a set and ABA \subseteq B we say that AA is a subset of BB.) If ABA \subseteq B and there is at least one set bb such that bBb \in B but b∉Ab \not\in A, we say that AA is properly included in BB, BB properly includes AA or AA is a proper subclass of BB, and we write ABA \subset B or BAB \supset A.

We can also extend power set to power class. For every class AA we define the power class P(A)P(A) of AA to be the class of all subsets of AA, i.e., P(A)={x:xA}P(A) = \{x : x \subseteq A\}. This brings us to another axiom in NBG set theory.

Axiom

For every set xx there exists a set yy such that uyu \in y if and only if uxu \subseteq x.

The Power Set Axiom thus asserts that every subclass uu of a set xx is actually a set (since it is an element of the set yy whose existence is asserted by the axiom) and furthermore that the power class P(x)P(x) of a set xx is also a set (and so is usually referred to as the power set of xx).

The rest of the axioms are as follows.

Axiom

For all sets xx and yy the class {z:(z=x)(z=y)}\{z : (z = x) \vee (z = y)\} is a set.

The set {z:(z=x)(z=y)}\{z : (z = x) \vee (z = y)\} is denoted by {x,y}\{x, y\} and such a set is called an unordered pair. If x=yx = y the unordered pair {x,y}\{x, y\} is denoted by {x}\{x\} and is called singleton xx.

Remark

In set theory, an unordered pair refers to a collection of two elements in which the sequence of the elements does not matter. This is represented as {a,b}\{a, b\}, indicating a set that contains exactly two distinct elements aa and bb. The fundamental property of unordered pairs is that {a,b}={b,a}\{a, b\} = \{b, a\}, asserting that the order of elements is immaterial.

The concept of an unordered pair is not limited to sets; it extends to classes in certain set theories that distinguish between sets and proper classes. While sets are collections of elements that themselves can be elements of other sets, proper classes are collections too large to be sets and hence cannot be elements of other collections. Nonetheless, the notion of grouping two objects into an unordered pair applies analogously, symbolizing the collection of those objects without regard to order.

Axiom

For every set xx the class x\bigcup x is a set.

We can also extend Cartesian Product to class. Let aa and bb be sets. Then the set {{a},{a,b}}\{\{a\},\{a,b\}\} is denoted by (a,b)(a,b) and is called the ordered pair with first coordinate aa and second coordinate bb. Lét AA and BB be classes; then the Cartesian product of AA and BB is the cclass

A×B={t:(x)(y)((xA)(yB)(t=(x,y)))},A\times B=\{t:(\exists x)(\exists y)((x\in A)\land(y\in B)\land(t=(x,y)))\},

i.e. A×BA\times B is the class of all ordered pairs with first coordinate in AA and second coordinate in B.B.

If P(x,y)P(x,y) is an open sentence involving the free variables xx and yy we shall allow ourselves to write

{(x,y):P(x,y)}\{(x,y):P(x,y)\}

as an abbreviation for

{t:(x)(y)((t=(x,y))P(x,y))}.\{t:(\exists x)(\exists y)((t=(x,y))\land P(x,y))\}.

So we can abbreviate the definition of A×BA\times B to

A×B={(x,y):(xA)(yB)}.A\times B=\{(x,y):(x\in A)\wedge(y\in B)\}.

Binary Relations, Composition and Inverse

In mathematics, the most fundamental and ubiquitous type of relation is the binary relation. This term refers to a relationship between two objects or sets. We understand that a ‘set’ may encompass any concept, not solely in the mathematical sense but also in a material one. Relations may exist objectively between certain objects and not at all for others. Similarly, objects or sets of objects, which exist objectively, hold the potential for an infinite number of relationships with one another. This perspective can seem philosophically abstract, positing that any scenario is conceivable. However, we can convey this more clearly. Recall our discussion of the Cartesian product as a set extension, where we consider two sets, AA and BB. These sets could represent any discernible entity or indiscernible concept. Theoretically, there could be countless relationships among all elements of these sets, and the capacity of two sets to form a Cartesian product is indicative of a general type of relationship. Consequently, the elements of the power set P(A×B)P(A \times B) exemplify all possible cases of a certain kind of relationship.

A vivid mathematical example is the definition of Euclidean spaces, where an infinite number of subspaces can be defined, each representing a unique binary relation within the space.

We first introduce the definition of a binary relation in terms of sets.

Definition

A Binary Relation RR from a set AA to a set BB is a subset of the Cartesian product A×BA \times B. For elements aAa \in A and bBb \in B, if the pair (a,b)(a, b) belongs to the subset RR, then we say aa is related to bb by the relation RR, denoted as aRbaRb, whose negation is aba\not R b.

In last section, we introduced the higher abstraction of sets, which is class. Classes also have Cartesian product,thus, we can give a general definition to all relations using class.

Definition

A relation is a class of ordered pairs.

Let RR be a relation. We define the domain and range of RR to be the classes Dom RR and Range RR given by Dom R={x:(y)((x,y)R)},Range R={y:(x)((x,y)R)}.\begin{array}{rcl}\text{Dom }R&=&\{x:(\exists y)((x,y)\in R)\},\\\text{Range }R&=&\{y:(\exists x)((x,y)\in R)\}.\end{array} If RR is a relation and (x,y)R(x,y)\in R, we say that xx is RR-related to yy and that yy is an RR-relative of xx. Thus Dom RR is the class of all sets that have RR-relatives, and Range RR is the class of all sets that are RR-relatives.

Now we look into several concrete examples of relation.

Example

Consider the set of all points on a plane. The relation defined by the equation of a circle, x2+y2=r2x^2 + y^2 = r^2, includes all points (x,y)(x, y) that satisfy this equation. This relation is not a function because, for most values of xx, there are two possible values of yy that satisfy the equation, one positive and one negative (except for the points where x=±rx = \pm r, where there is only one value of yy).

In contrast, a function would allow each xx to be associated with exactly one yy. For instance, the square function y=x2y = x^2 is a function because each value of xx corresponds to exactly one value of yy.

In the figure we have defined a circle and a quadratic function, clearly we see that a function can never have two yy value for one xx, while this is possible for the circle.

Figure pending: Visual Comparison of a Relation and a Function

Example

Let A be the set {1,2,3,4}. Which ordered pairs are in the relation R={(a,b)aR=\{(a,b)\mid a divides b}?b\}?

Solution: Because (a,b)(a,b) is in R if and only if aa and bb are positive integers not exceeding 4 such that aa divides bb,we see that R={(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}.R=\{(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)\}.

Figure pending: R = {(a, b) ∣ a divides b}

This relation also differs from function, since for member of aa, it is possible to map to multiple members in bb.

Definition

A relation RR is said to be functional if each element of its domain has exactly one RR-relative; a functional relation is also called a function. If RR is a functional relation then for each element aa of its domain we denote the unique RR-relative of aa by R(a).R(a).

This leads us to the next axiom of NBG theory.

Axiom

For every functional relation RR, if the domain of RR is a set then the range of RR is also a set.

Mapping, Composition, and Inverse

In naive set theory and function in part 1 of the book, we gave a rough definitions to mappings. With class, we can make it more concrete.

Definition

A mapping is an ordered pair ((A,B),R)((A,B),R) where AA and BB are sets and RR is a functional relation between AA and BB such that Dom R=A.R=A. If f=((A,B),R)f= ( ( A, B) , R) is a mapping we say that ff is a mapping from AA to B;B; we call AA the domain of f,Bf,B the codomain of ff and RR the graph of ff. If ff is a mapping with domain AA and codomain BB we often write f:AB.f:A\to B. If aa is any element of the set AA then the set R({a})R^{\to}(\{a\}) consists of a single element of BB which we denote by f(a);f(a); we call it the image of a under fa\textbf{ under }f or the value of f at a.f\textbf{ at }a.

It is clear from the definition of the term “mapping” that in order to describe a mapping ff we must give the domain AA and codomain BB of ff and also, for each element aa of the domain we must describe the unique element bab_a of the codomain such that (a,ba)(a,b_a) belongs to the graph of ff, i.e. we must describe for each element aa of AA its image under ff in B.B.

Let f=((A,B),R)f= ( ( A, B) , R) be a mapping from AA to BB. For each subset XX of AA we denote the subset R(X)R^{\to}(X) of BB by f(X);f^{\to}(X); in particular, if aa is any element of AA we have f({a})={f(a)}.f^{\to}(\{a\})=\{f(a)\}. For each subset YY of BB we denote the subset R(Y)R^{\leftarrow }( Y) of AA by f(Y).f^{\leftarrow }( Y) .

Let f=((A,B),R)f=((A,B),R) be a mapping from AA to B;letA1B;\operatorname*{let}A_1 be a subset of A.A. Then the restriction of ff to A1A_1 is the mapping f\mid A_1= \left((A_1,B\),R\cap(A_1\times B)\right).

Earlier, we discussed composition and inverse of function. Now that we have known that function is a kind of relation, can we compose or inverse all other relations? Naturally the answer is yes.

Definition

Let f=((A,B),R)f= ( ( A, B) , R) be a mapping. Then ff is said to be surjective or to be a surjection if we have Range RR =B,= B,i.e. if every element of BB is the image under ff of at least one element of A.A.

Next, ff is injective if the inverse relation R1R^{-1} is functional. Equivalently, each element of the range of RR is the image under ff of exactly one element of AA. In symbols, whenever f(a1)=f(a2)f(a_1)=f(a_2) for a1,a2Aa_1,a_2\in A, we have a1=a2a_1=a_2.

The mapping ff is said to be bijective or to be a bijection if it is both injective and surjective. If AA and BB are sets we say that AisA\textbf{is} equipotent to BB or that Ais equinumerous with BA\textbf{is equinumerous with }B if there exists a bijective mapping from AA to B.B.

Let f=((A,B),R)f=((A,B),R) be a mapping. Then ((B,A),R1)((B,A),R^{-1}) is a mapping if and only if ff is bijective; in this case we write ((B,A),R1)=f1((B,A),R^{-1})=f^{-1} and call f1f^{-1} the inverse mapping of f.f. Clearly f1f^{-1} is a bijection from BB to AA with inverse f.f.

Here are some examples of special mappings.

Example

A function f:ABf: A \to B is surjective if for every element yy in BB, there is at least one element xx in AA such that f(x)=yf(x) = y. For instance, let A={1,2,3}A = \{1, 2, 3\} and B={a,b}B = \{a, b\}. Define ff by f(1)=af(1) = a, f(2)=af(2) = a, and f(3)=bf(3) = b. This function is surjective because every element of BB is the image of at least one element of AA.

Example

A function f:ABf: A \to B is injective if no two different elements in AA map to the same element in BB. For example, let A={1,2,3}A = \{1, 2, 3\} and B={a,b,c,d}B = \{a, b, c, d\}. Define ff by f(1)=af(1) = a, f(2)=bf(2) = b, and f(3)=cf(3) = c. This function is injective because each element of AA maps to a unique element of BB.

Example

A function f:ABf: A \to B is bijective if it is both injective and surjective. For instance, let A={1,2,3}A = \{1, 2, 3\} and B={a,b,c}B = \{a, b, c\}. Define ff by f(1)=af(1) = a, f(2)=bf(2) = b, and f(3)=cf(3) = c. This function is bijective, making AA and BB equinumerous.

Example

If ff is a bijective function from AA to BB, then the inverse f1f^{-1} is a function from BB to AA that reverses the mapping of ff. Using the bijective function ff from the previous example, we define f1f^{-1} by f1(a)=1f^{-1}(a) = 1, f1(b)=2f^{-1}(b) = 2, and f1(c)=3f^{-1}(c) = 3.

Definition

If RR and SS are relations, the composition of RR and SS is the relation SRS\circ R given by SR={(x,z):(y)(((x,y)R)((y,z)S))}.S\circ R=\{(x,z):(\exists y)(((x,y)\in R)\wedge((y,z)\in S))\}. If RR is a relation between AA and BB and SS is a relation between BB and CC then clearly SRS\circ R is a relation between AA and CC, and we have Dom(SR)DomR\operatorname{Dom}\left(S\circ R\right)\subseteq\operatorname{Dom}R and Range (SR)RangeS.(S\circ R)\subseteq\operatorname{Range}S.

The idea of composition also works for mappings.

Definition

Let f=((A,B),R)f= ( ( A, B) , R) and g=((B,C),S)g= ( ( B, C) , S) be mappings. Then clearly ((A,C),SR)((A,C),S\circ R) is also a mapping, which we denote by gfg\circ f and call the composition or composed mapping of ff and gg. For each element aa of AA we have (gf)(a)=g(f(a)).( g\circ f) ( a) = g( f( a) ).

Remark

The other equivalent definition is that Let RR be a relation from a set AA to a set BB and S a relation from BB to a set CC. The compositecomposite of RR and S is the relation consisting of ordered pairs (a,c)(a,c), where aA,cCa\in A, c\in C , and for which there exists an element bBb\in B such that (a,b)R( a, b) \in R and (b,c)S.( b, c) \in S. We denote the composite of RR and SS by SR.S\circ R.

Similarly, we can define inverse relation.

Definition

If AA and BB are classes then a relation between A and BA\textbf{ and }B is a subclass of A×BA\times B, i.e. a relation RR such that Dom RAR\subseteq A and Range RB.R\subseteq B. A relation on a class AA is a subclass of A×A.A\times A.

If RR is a relation, the inverse of RR is the relation R1R^{-1} given by R1={(x,y):(y,x)R}.R^{-1}=\{(x,y):(y,x)\in R\}. If RR is a relation between AA and BB then R1R^{-1} is a relation between BB and A;A; clearly Dom R1=RangeRR^{-1}=\operatorname{Range}R and Range R1=DomR.R^{-1}=\operatorname{Dom}R.

Let RR be a relation, AA any class. Then the image of A under RA\textbf{ under }R is the class consisting of all RR-relatives of all members of A.A. We denote this class by R(A).R^{\to}(A). Thus R(A)={y:(x)((xA)((x,y)R))}.R^{\to}(A)=\{y:(\exists x)((x\in A)\land((x,y)\in R))\}. Again let RR be a relation and kerB\ker B be any class. Then the inverse image of BB under RR is the class (R1)(B),( R^{- 1}) ^{\to }( B) , which we write R(B).R^{\leftarrow}( B) . Thus R(B)={x:(y)((yB)((x,y)R))}.\begin{aligned}R^{\leftarrow}(B)=\{x:(\exists y)((y\in B)\land((x,y)\in R))\}.\end{aligned} With functional relation and mapping, we can define a more specific relation, which very special and practical.

Definition

Let AA be any set; let DA={x:(a)((aA)(x=(a,a)))}D_A=\{x:(\exists a)((a\in A)\land(x=(a,a)))\} (we call DAD_A the diagonal of A×A).A\times A). Then DAD_A is a functional relation between AA and AA with domain A.A. The mapping IA=((A,A),DA)I_A=((A,A),D_A) from AA to AA is called the identity mapping of A.A. Clearly we have IA(a)=aI_{A}(a)=a for each element aa of A.A.

Example

The identity mapping IAI_A for a set AA is a function that maps every element to itself. Here are some examples of identity mappings on various sets:

  • Let B={xR1x1}B = \{x \in \mathbb{R} \mid -1 \leq x \leq 1\}. The identity mapping on BB is IB:BBI_B : B \to B where IB(x)=xI_B(x) = x for all xBx \in B.

  • Let C={apple,banana,cherry}C = \{\text{apple}, \text{banana}, \text{cherry}\}. The identity mapping on CC is IC:CCI_C : C \to C where IC(fruit)=fruitI_C(\text{fruit}) = \text{fruit} for each fruit in set CC.

  • Let D=ZD = \mathbb{Z}. The identity mapping on DD is ID:ZZI_D : \mathbb{Z} \to \mathbb{Z} where ID(n)=nI_D(n) = n for all nZn \in \mathbb{Z}.

The diagonal for each of these sets would be as follows:

  • The diagonal of BB, DBD_B, would be the set of all ordered pairs (x,x)(x, x) such that xBx \in B.

  • The diagonal of CC, DCD_C, would be the set {(apple,apple),(banana,banana),(cherry,cherry)}\{(\text{apple}, \text{apple}), (\text{banana}, \text{banana}), (\text{cherry}, \text{cherry})\}.

  • The diagonal of DD, DDD_D, would be the set of all ordered pairs (n,n)(n, n) such that nZn \in \mathbb{Z}.

In all these cases, the identity mapping illustrates the concept of a function where the input is the same as the output for each element of the set.

Families of Sets

In part 1, we discussed sequence. Sequence is defined (see definition def_sequence) by a relation between index and a mathematical expression related to the index, and commonly the index ii has iNi\in \mathbb{N}. Sequence is actually a special family of set.

Definition

Let II and AA be classes, and FF is a functional relation between II and AA. Then FF is sometimes called a family of elements of AA indexed by II (or with I as index class)I\textbf{ as index class}) and we write (F(i))iI(F(i))_{i\in I} instead of FF. In particular, if EE is a set then a family of elements of P(E)\mathbf{P}(E) is called a family of subsets of EE indexed by I.I. If FF is such a family and we write Xi=F(i)X_i=F(i) for each element ii in II then we denote the family FF by(Xi)iI.\left ( X_i\right ) _{i\in I}.

If XX is a set of subsets of a set EE then the diagonal DXD_X is a family of subsets of EE which may sometimes be denoted by (x)xX.(x)_{x\in X}.

Let F=(Xi)iIF= ( X_{i}) _{i\in I} be a family of subsets of a set E.E. We define the union of the family to be iIXi={x:(i)((iI)(xXi))}.\bigcup_{i\in I}X_i=\{x:(\exists i)((i\in I)\land(x\in X_i))\}. Thus xx belongs to the union of the family (Xi)iI(X_i)_{i\in I} if and only if it belongs to at least one of the sets XiX_i with ii in I.I. Of course if XX is a set of subsets of EE the union of the corresponding family DXD_X coincides with the union of the set XX as previously defined: xXx=X.\bigcup_{x\in X}x=\bigcup X.

Again let (Xi)iI(X_i)_{i\in I} be a family of subsets of a set E.E. The intersection of this family is defined to be iIXi={x:(xE)(i)((iI)(xXi))}.\bigcap_{i\in I}X_i=\{x:(x\in E)\land(\forall i)((i\in I)\Longrightarrow(x\in X_i))\}. So xx belongs to the intersection of the family (Xi)iI(X_i)_{i\in I} if and only if it belongs to all the sets XiX_i with ii in I.I.

We notice that if II is empty then we have iIXi=E.\bigcap_{i\in I}X_i=E. If X i a non-empty set of subsets of EE the intersection of the corresponding family DXD_X coincides with the intersection of the set XX as previously defined:xXx=X.{: }\bigcap _{x\in X}x= \bigcap X.

Example

Consider the set EE and a family of its subsets (Xi)iI(X_i)_{i \in I}, where I={1,2,3}I = \{1, 2, 3\} and

  • X1={a,b}X_1 = \{a, b\}

  • X2={b,c}X_2 = \{b, c\}

  • X3={a,c,d}X_3 = \{a, c, d\}

The union of the family (Xi)iI(X_i)_{i \in I} is the set of elements that are in at least one of the sets XiX_i: iIXi=X1X2X3={a,b,c,d}\bigcup_{i \in I} X_i = X_1 \cup X_2 \cup X_3 = \{a, b, c, d\}

The intersection of the family (Xi)iI(X_i)_{i \in I} is the set of elements that are in every one of the sets XiX_i: iIXi=X1X2X3=\bigcap_{i \in I} X_i = X_1 \cap X_2 \cap X_3 = \emptyset

Definition

Let EE be a set. A sequence in EE is a function from the set of natural numbers N\mathbb{N} to EE. The sequence can be represented as a family of sets (xi)iN(x_i)_{i \in \mathbb{N}}, where each xix_i is an element of EE, and ii is the index representing the position of the element in the sequence.

The nn-th term of the sequence is denoted by xnx_n, and the sequence itself can be written as (xn)n=1(x_n)_{n=1}^{\infty}, which is the family of elements of EE indexed by N\mathbb{N}.

Let (Xi)iI(X_i)_{i\in I} be a family of sets with index set I.I. Let X=iIXi.X=\bigcup_{i\in I}X_i. Then the product of the family (Xi)iI(X_i)_{i\in I} is the set

\prod_{i\in I}X_i=\{f:(f\in\operatorname{Map}(I,X))\wedge(\forall i)((i\in I)\Longrightarrow(f(i)\in X_i))\}.$$ If we write $f(i)=x_i$ for each index $i$ in $I$ it is sometimes helpful to denote the element $f$ of $\prod_{i\in I}X_i$ by $\prod_{i\in I}x_i.$ For each index $j$ in $I$ we define a mapping $\pi_j$ from $\prod_{i\in I}X_i$ to $X_j$ by setting $$\pi_j(f)=f(j)\text{ for every }f\mathrm{~in~}\prod_{i\in I}X_i.

The mapping πj\pi_j is called the jj -th projection mapping from iIXi.\prod_{i\in I}X_i.

Example

Consider two sets X1={a,b}X_1 = \{a, b\} and X2={1,2}X_2 = \{1, 2\}. The index set is I={1,2}I = \{1, 2\}. The product of the family of sets (Xi)iI(X_i)_{i \in I}, which is X1×X2X_1 \times X_2, consists of all ordered pairs where the first element is from X1X_1 and the second is from X2X_2. Thus, the product is: iIXi=X1×X2={(a,1),(a,2),(b,1),(b,2)}\prod_{i \in I} X_i = X_1 \times X_2 = \{(a, 1), (a, 2), (b, 1), (b, 2)\}

Each ordered pair represents a function ff mapping II to the union of X1X_1 and X2X_2. For instance, one such function corresponding to the ordered pair (a,1)(a, 1) is defined by: f(1)=a,f(2)=1f(1) = a, \quad f(2) = 1

Projection mappings πj\pi_j from iIXi\prod_{i \in I} X_i to XjX_j are defined for each index jIj \in I by setting: π1(f)=f(1),π2(f)=f(2)\pi_1(f) = f(1), \quad \pi_2(f) = f(2)

Hence, for our function ff, the projections are: π1(f)=a,π2(f)=1\pi_1(f) = a, \quad \pi_2(f) = 1

Family of Sets is related to another axiom of NBG set theory.

Axiom

Let (Ei)iI(E_i)_{i\in I} be a family of nonempty sets indexed by a set II. Then the product iIEi\prod_{i\in I}E_i is non-empty.

We can also define choice function of class.

Definition

Let (Ei)iI(E_i)_{i\in I} be a family of non-empty sets. By a choice function for this family we mean a mapping ff from II to iIEi\bigcup_{i\in I}E_i such that for every index ii in II we have f(i)Ei;f(i)\in E_i; thus a choice function is an element of the product iIEi.\prod_{i\in I}E_i. If we have EiEj=E_i\cap E_j=\emptyset for every pair of distinct elements i,ji, j of II we say that the family (Ei)iI( E_i) _{i\in I} is pairwisepairwise disjoint)disjoint) then the range of a choice function for (Ei)iI(E_i)_{i\in I} is a subset of iIEi\bigcup_{i\in I}E_i which contains exactly one element from each set of the family. Such a set is called a selection set for the (pairwise disjoint) family (Ei)iI.(E_i)_{i\in I}.

Thus the Axiom of Choice asserts that for every family of non-empty sets there exists a choice function and so for every pairwise disjoint family of non-empty sets there exists a selection set.

Example

Consider the family of non-empty, pairwise disjoint sets: E1={1,2},E2={3,4},E3={5,6},\begin{aligned} E_1 &= \{1, 2\}, \\ E_2 &= \{3, 4\}, \\ E_3 &= \{5, 6\}, \end{aligned} with the index set I={1,2,3}I = \{1, 2, 3\}.

A choice function ff for this family might be defined as: f(1)=1,f(2)=4,f(3)=5.\begin{aligned} f(1) &= 1, \\ f(2) &= 4, \\ f(3) &= 5. \end{aligned} This function ff chooses one element from each set EiE_i, making the selection set for this family {f(1),f(2),f(3)}={1,4,5}\{ f(1), f(2), f(3) \} = \{1, 4, 5\}.

Reflexivity, Symmetry, and Transitivity

With basic relation we have defined, we can now look into some special relations with some specific properties. These properties are important, since these property will be used to further classify relations for us. All special relations could be related to the diagonal of the sets or classes involved in that specific relation.

The first special relation is actually already covered in the diagonal of class, which is the idea of reflexivity, meaning a relation from an object to itself.

Definition

Let RR be a relation on a set XX. The relation RR is said to be reflexive if DXRD_X \subseteq R, where DX={(x,x)xX}D_X = \{(x, x) \mid x \in X\}. That is, for every element xx in XX, the pair (x,x)(x, x) belongs to RR.

Example

Consider the following relations on the set {1,2,3,4}\{1, 2, 3, 4\}:

  • R1={(1,1),(1,2),(2,1),(2,2),(3,4),(4,1),(4,4)}R_1 = \{(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)\}

  • R2={(1,1),(1,2),(2,1)}R_2 = \{(1, 1), (1, 2), (2, 1)\}

  • R3={(1,1),(1,2),(1,4),(2,1),(2,2),(3,3),(4,1),(4,4)}R_3 = \{(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)\}

  • R4={(2,1),(3,1),(3,2),(4,1),(4,2),(4,3)}R_4 = \{(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)\}

  • R5={(1,1),(1,2),(1,3),(1,4),(2,2),(2,3),(2,4),(3,3),(3,4),(4,4)}R_5 = \{(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)\}

  • R6={(3,4)}R_6 = \{(3, 4)\}

Which of these relations are reflexive?

Solution: The relations R3R_3 and R5R_5 are reflexive because they both contain all pairs of the form (a,a)(a, a), namely, (1,1),(2,2),(3,3),(1, 1), (2, 2), (3, 3), and (4,4)(4, 4). The other relations are not reflexive because they do not contain all of these ordered pairs. In particular, R1,R2,R4,R_1, R_2, R_4, and R6R_6 are not reflexive because (3,3)(3, 3) is not in any of these relations.

And as a complement of Reflexivity, we can define Irreflexivity

Definition

A relation RR on a set XX is called irreflexive if DXR=D_X \cap R = \emptyset, i.e., no pair of the form (x,x)(x, x) belongs to RR for any xx in XX.

Now we discuss symmetry of relation.

Definition

A relation RR on a set XX is symmetric if for every x,yx, y in XX, if (x,y)R(x, y) \in R then (y,x)(y, x) is also in RR, i.e., R=R1R = R^{-1}

We can also define the complement of this kind of relation.

Definition

Let RR be a relation on a set XX. The relation RR is said to be asymmetric if for any x,yx, y in XX, whenever (x,y)R(x, y) \in R, then (y,x)R(y, x) \notin R. This implies that no pair can be in both RR and R1R^{-1} unless x=yx = y, which is not permitted for asymmetric relations, thus RR1=R \cap R^{-1} = \emptyset, i.e. RR1R \neq R^{-1}, .

There is also a type of relation called antisymmetric relation.

Definition

A relation RR on a set XX is antisymmetric if for all x,yx, y in XX, if (x,y)R(x, y) \in R and (y,x)R(y, x) \in R, then x=yx = y. That is, RR1DXR \cap R^{-1} \subseteq D_X.

Some may confused by these similar terms. Below are the clarification and some examples.

  • A relation RR on a set XX is symmetric if for any x,yXx, y \in X, whenever (x,y)(x, y) is in RR, then (y,x)(y, x) is also in RR. Symmetry implies a mutual relationship.

  • A relation RR is asymmetric if for any x,yXx, y \in X, whenever (x,y)(x, y) is in RR, (y,x)(y, x) is not in RR. Asymmetry denotes a one-way relationship.

  • A relation RR is antisymmetric if for any x,yXx, y \in X, whenever both (x,y)(x, y) and (y,x)(y, x) are in RR, it must be that x=yx = y. Antisymmetry allows for a hierarchical ordering.

Let’s explore these properties through examples:

Example

The relation “is a sibling of” is symmetric. If Tom is a sibling of Jerry, then Jerry is a sibling of Tom.

Example

The “less than” relation on the real numbers is asymmetric. If 3<43 < 4, then it is not the case that 4<34 < 3.

Example

The “divides” relation for integers is antisymmetric. For example, 66 divides 1212, and 1212 does not divide 66. But we can have 6 divides 6 itself.

Exercises

Exercise

Determine whether each of the following is a set or a class in NBG set theory, and explain why.

  1. The collection of all sets that do not contain themselves.

  2. The set of all natural numbers.

  3. The class of all ordinal numbers.

Solution

Below are the solutions.

  1. The collection of all sets that do not contain themselves is a proper class. This is because any attempt to consider it as a set leads to Russell’s paradox, thus it cannot be a set within any consistent set theory including NBG.

  2. The set of all natural numbers is a set. It is well-defined and does not lead to any paradoxes within NBG set theory. Furthermore, it is an element of the class of all sets.

  3. The class of all ordinal numbers is a proper class because it is too large to be a set. If it were a set, it would lead to contradictions similar to those arising from considering the “set of all sets.”

Exercise

Russel’s Paradox is fixed by introducing more strict set axioms to the set theory. In NBG theory, a proper class is defined as a top-level class that cannot be subclass of any other classes or sets, and this is the key to avoid the paradox in naive set theory. Explain in details that how this concept avoids the case in Russel’s Paradox.

Solution

With the introduction of the concept of classes, we can discuss collections that are too large to be considered as sets, such as the “class of all sets.” Therefore, the set described by Russell’s Paradox, denoted by RR, is no longer considered a legitimate set but rather a “proper class.” This means that we refrain from discussing RR as a set, thereby avoiding the paradox because proper classes are not subject to the operations and axioms that constrain sets. As a result, the axiomatic system does not permit the formation of sets that would lead to Russell’s Paradox.

Exercise

Let A,B,CA,B,C be classes such that AB,BCA\subseteq B,B\subseteq C, CA.C\subseteq A. Prove that A=B=C.A=B=C.

Exercise

Let A,B,CA,B,C be classes such that AB,BC.A\subset B,B\subset C. Prove that AC.A\subset C.

Below are exercises for binary relation.

Representation of Relations

In last section. we discussed binary relation and their properties. This section focuses on ways of representation. Symbolic language is accurate and not prone to make misunderstanding, yet it is not quite easy to understand to human minds. Therefore, we need straightforward ways to visualize them and assure the accuracy in the same time.

Representation By Matrix

The first commonly used method is matrix. A relation between finite sets can be represented using a zero-one matrix. Suppose that RR is a relation from A={a1,a2,,am}A=\{a_1,a_2,\ldots,a_m\} to B={b1,b2,,bn}.B=\{b_1,b_2,\ldots,b_n\}. (Here the elements of the sets AA and BB have been listed in a particular, but arbitrary, order. Furthermore, when A=BA=B we use the same ordering for AA and B.)B.) The relation RR can be represented by the matrix MR=[mij]\mathbf{M}_R=[m_{ij}], where mij={1 if(ai,bj)R,0 if(ai,bj)R.m_{ij}=\left\{\begin{matrix}1\text{ if}(a_i,b_j)\in R,\\0\text{ if}(a_i,b_j)\notin R.\end{matrix}\right.

Example

Consider the binary relation RR on the set X={1,2,3}X = \{1, 2, 3\} defined by the pairs R={(1,2),(2,3),(3,1)}R = \{(1, 2), (2, 3), (3, 1)\}. We can represent RR as a matrix MM where the entry mijm_{ij} is 1 if (i,j)R(i, j) \in R and 0 otherwise. Thus, the matrix MM representing RR is given by: M=[010001100]M = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix} This matrix shows that there is a relation from 1 to 2, 2 to 3, and 3 to 1, as indicated by the ones in the matrix.

What about some other special relations? Here are more examples.

Reflexive Relations in Matrix

We defined reflexivity through the diagonal of a relation matrix. A relation on a set is reflexive if and only if every diagonal entry miim_{ii} is 11. The off-diagonal entries may be chosen independently, so a reflexive relation need not be the identity relation.

Example

A reflexive relation on a set X={1,2,3}X = \{1, 2, 3\} requires that every element is related to itself. Thus, for the relation RR to be reflexive, it must include the pairs R={(1,1),(2,2),(3,3)}R = \{(1, 1), (2, 2), (3, 3)\} at minimum. The matrix MM representing such a reflexive relation RR is given by: M=[1abc1def1]M = \begin{bmatrix} 1 & a & b \\ c & 1 & d \\ e & f & 1 \end{bmatrix} Here, the diagonal elements of the matrix are all set to 1, reflecting the reflexive property that each element is related to itself. This diagonal structure is reminiscent of an identity matrix, where all diagonal elements are 1, and all off-diagonal elements are 0. In the context of relations, the presence of 1s on the diagonal is crucial for reflexivity. However, the values of a,b,c,d,e,a, b, c, d, e, and ff (the off-diagonal elements) do not influence the reflexivity of the relation and can be either 0 or 1. This highlights that while the matrix representing a reflexive relation must have 1s along its diagonal, it does not necessarily need to be an identity matrix.

Symmetric/Antisymmetric/Asymmetry Relation in Matrix

For a symmetric relation, (a,b)R(a,b)\in R if and only if (b,a)R(b,a)\in R. In its matrix, this means mij=mjim_{ij}=m_{ji}, or equivalently M=MTM=M^T. Symmetry does not require the diagonal entries to be 11; that additional condition belongs to reflexivity.

Example

A relation RR on a set X={1,2,3}X = \{1, 2, 3\} is symmetric if for any two elements aa and bb in XX, whenever (a,b)R(a, b) \in R, then (b,a)(b, a) is also in RR. Consider the symmetric relation RR defined by the pairs R={(1,1),(3,3),(1,2),(2,1)}R = \{(1, 1), (3, 3), (1, 2), (2, 1)\}. The matrix MM representing this symmetric relation RR is given by: M=[110100001]M = \begin{bmatrix} 1 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} In this matrix, the entries are symmetric about the main diagonal. The presence of 11 at positions (1,2)(1,2) and (2,1)(2,1) illustrates the symmetric nature of the relation, as both (1,2)(1,2) and (2,1)(2,1) are included in RR.

A reflexive relation, on the other hand, requires that each element be related to itself, leading to 11s along the main diagonal of its matrix. In the example above, the relation is not reflexive because it does not contain (2,2)(2, 2).

Although both reflexive and symmetric properties concern the main diagonal, they describe different aspects of a relation:

  • Reflexivity is about individual elements being self-connected, evidenced by 11s on the diagonal.

  • Symmetry involves pairs of elements and requires that if an element aa is related to an element bb, then bb must also be related to aa, leading to a mirrored symmetry across the diagonal.

A relation can be both reflexive and symmetric but does not need to be one to be the other. For instance, a purely symmetric relation need not include self-pairs like (1,1)(1, 1) unless it is also intended to be reflexive.

An antisymmetric relation on a set XX involves a specific condition: for any two distinct elements α\alpha and bb in XX,if both (a,b)(a,b) and (b,a)(b,a) are in the relation RR, then α\alpha must be equal to bb. This means that if aa\neq bb,it cannot be the case that both (a,b)(a,b) and (b,a)(b,a) are in RR.In terms of matrix representation:

Example

Consider the set X={1,2,3}X = \{1, 2, 3\} and define the relation RR on XX by the pairs R={(1,2),(2,3),(3,3)}R = \{(1, 2), (2, 3), (3, 3)\}. This relation is antisymmetric, which we can observe through its matrix representation. The matrix MM representing the relation RR is given by: M=[010001001]M = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 1 \end{bmatrix} In this matrix, note the following:

  • The entry m12=1m_{12} = 1 (relation from 1 to 2), and m21=0m_{21} = 0 (no relation from 2 to 1), satisfying the antisymmetric condition.

  • Similarly, m23=1m_{23} = 1 and m32=0m_{32} = 0.

  • The diagonal entry m33=1m_{33} = 1 does not violate antisymmetry as self-relations do not affect antisymmetry.

Antisymmetric relations allow entries on the main diagonal (self-relations) but restrict how elements can relate symmetrically off the diagonal, ensuring that if one direction is permitted, the opposite is not unless they are the same element.

An asymmetric relation is a stronger form of an antisymmetric relation. A relation RR on a set XX is asymmetric if, for any elements aa and bb in XX,whenever (a,b)(a,b) is in RR, then (b,a)(b,a) cannot be in RR. This implies that if one direction between two different elements is allowed, the opposite direction is strictly forbidden, making it impossible for both (a,b)(a,b) and (b,a)(b,a) to exist in RR for any ab.a\neq b.

Example

Consider the set X={1,2,3}X = \{1, 2, 3\} and define an asymmetric relation RR on XX by including the pairs R={(1,2),(2,3)}R = \{(1, 2), (2, 3)\}. This relation is asymmetric as it does not contain both (a,b)(a, b) and (b,a)(b, a) for any aa and bb in XX. The matrix MM representing this relation RR is given by: M=[010001000]M = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} In this matrix: - The entry m12=1m_{12} = 1 and m21=0m_{21} = 0, supporting the asymmetric nature by the absence of the reverse relation. - The entry m23=1m_{23} = 1 and m32=0m_{32} = 0, further demonstrating asymmetry.

This matrix shows no reciprocal relations between different elements, which is a defining characteristic of asymmetric relations. Note that self-relations (diagonal entries) are not present in this matrix, aligning with the strict definition of asymmetry which typically excludes self-relations as well.

Operation of Relation Matrix

We can find intersection or union of two relations easily by examining their matrices. This could be done by comparing each element with the same index one by one.

Example

Let A=[010001000]A = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} and B=[110000100]B = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 0 & 0 \\ 1 & 0 & 0 \end{bmatrix} be two relations.

The union ABA \cup B is: AB=[110001100]A \cup B = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}

The intersection ABA \cap B is: AB=[010000000]A \cap B = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}

Matrix is also possible to represent composition of relations. For these relations, in particular, suppose that RR is a relation from AA to BB and SS is a relation from BB to CC. Suppose that AA, BB, and CC have mm, nn, and pp elements, respectively. Let the zero-one matrices for SRS \circ R, RR, and SS be MSR=[tij]M_{S \circ R} = [t_{ij}], MR=[rij]M_R = [r_{ij}], and MS=[sij]M_S = [s_{ij}], respectively (these matrices have sizes m×pm \times p, m×nm \times n, and n×pn \times p, respectively). The ordered pair (ai,cj)(a_i, c_j) belongs to SRS \circ R if and only if there is an element bkb_k such that (ai,bk)(a_i, b_k) belongs to RR and (bk,cj)(b_k, c_j) belongs to SS. It follows that tij=1t_{ij} = 1 if and only if rik=skj=1r_{ik} = s_{kj} = 1 for some kk. From the definition of the Boolean product, this means that MSR=MRMS.M_{S \circ R} = M_R \otimes M_S.

Example
MR=[101110000]andMS=[010001101].M_R = \begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} \quad \text{and} \quad M_S = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 1 \\ \end{bmatrix}.
Solution

The matrix for SRS \otimes R is obtained by performing the Boolean product of MRM_R and MSM_S. This operation is similar to matrix multiplication, except that addition is replaced by the logical OR operation, and multiplication is replaced by the logical AND operation. The result is a matrix that represents the composition of the two relations: MSR=MRMS=[111011000].M_{S \circ R} = M_R \otimes M_S = \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \\ \end{bmatrix}. Each entry in MSRM_{S \circ R} is computed by taking the logical OR of the ANDs of the corresponding row from MRM_R and the column from MSM_S.

Example

where the matrix representing RR is MR=[010011100].M_R = \begin{bmatrix} 0 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 0 \\ \end{bmatrix}.

Solution

The matrix for R2R^2 is found by taking the Boolean product of MRM_R with itself. This operation is analogous to squaring a matrix, where we use Boolean algebra for addition and multiplication: MR2=MR[2]=[011111010].M_{R_2} = M_{R}^{[2]} = \begin{bmatrix} 0 & 1 & 1 \\ 1 & 1 & 1 \\ 0 & 1 & 0 \\ \end{bmatrix}. The entries of MR2M_{R_2} indicate whether there is a path of length 2 between the nodes represented by the matrix indices in the relation RR.

Representation By Digraph

The other way to visualize relation is by using Directed Graph, or Digraph.

Definition

A digraph or directed graph is an ordered pair G=(V,A)G = (V, A) comprising:

  • A non-empty set VV, whose elements are called vertices or nodes.

  • A set AA of ordered pairs of vertices, called arcs, directed edges, arrows, or directed lines.

The directed edge (x,y)A(x, y) \in A is said to point from the vertex xx to the vertex yy. Unlike in an undirected graph, the edges in a digraph have a direction associated with them, indicated by the ordering of the vertices in the pair.

We will discuss further on graph in graph theory, now we just need to know that we will use it to visualize relation. A directed graph can be used to represent a binary relation between a set of elements. Here is an example.

Example

Let set A={a,b,c},B={a,d}A = \{a,b,c\}, B = \{a,d\}, the relation R={(a,a),(a,d),(b,a),(c,a),(c,d)}R=\{(a,a),(a,d), (b,a),(c,a),(c,d)\} could be represented by the following graph.

Using Digraph is a very intuitive approach to visualize relation. In the graph, we use the element in the domain and codomain of the relation as vertex, and the relations are represented using the edges, which are also ordered pairs.

Using a graph is also easy to determine special patterns of relations such as reflexivity, symmetry, etc.

Example

Consider the relation defined from set A={a,b,c}A=\{a,b,c\} to itself, R={(a,a),(b,b),(c,c),(b,a)}R = \{(a,a),(b,b),(c,c),(b,a)\}. This relation could be visualized by the following graph, which is reflexive.

We see that each object has a loop for a reflexive relation.

Example

Consider the relation defined from set A={a,b,c}A=\{a,b,c\} to itself, R1={(a,b),(b,a)(a,c),(c,a)}R_1 = \{(a,b),(b,a)(a,c),(c,a)\}, and R2={(a,a),(b,b)(c,c),(a,b),(b,c)}R_2=\{(a,a),(b,b)(c,c),(a,b),(b,c) \}. This relation could be visualized by the following graphs.

Figure pending: R1 and R2 in Digraph

R1R_1 is symmetric because every edge between distinct objects has a matching edge in the opposite direction. R2R_2 is antisymmetric because the only pairs that occur in both directions are self-loops, although it may contain one-way edges between distinct objects.

For the cases of transitivity, it’s also quite clear in the following example.

Example

Still consider the same set AA and the relation R1={(a,b),(b,c),(a,c)},R2={(a,a),(a,b),(b,b)}R_1 = \{(a,b), (b,c), (a,c)\}, R_2 = \{(a,a), (a,b),(b,b)\}.

Figure pending: The original LaTeX illustration is retained in the source repository and needs a web-native asset export.

Both R1R_1 and R2R_2 are transitive. For R2R_2, transitivity follows in particular from the reflexive loops on aa and bb. A relation that is reflexive, symmetric, and transitive is an equivalence relation, which we discuss next.

Exercises

Exercise

List the ordered pairs in the relations on {1,2,3,4}\{1, 2, 3, 4\} corresponding to these matrices (where the rows and columns correspond to the integers listed in increasing order).

a)[1101101001111011]b)[1110010000111001]c)[0101101001011010]\text{a)} \begin{bmatrix} 1 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ \end{bmatrix} \text{b)} \begin{bmatrix} 1 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 \\ \end{bmatrix} \text{c)} \begin{bmatrix} 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ \end{bmatrix}
Solution
  1. Since the (1,1)th(1,1)^{th} entry is a 11, (1,1)(1,1) is in the relation. Since (1,3)th(1,3)^{th} entry is a 00, (1,3)(1,3) is not in the relation. Continuing in this manner, we see that the relation contains (1,1)(1,1), (1,2)(1,2), (1,4)(1,4), (2,1)(2,1), (2,3)(2,3), (3,2)(3,2), (3,3)(3,3), (3,4)(3,4), (4,1)(4,1), (4,3)(4,3), and (4,4)(4,4).

  2. The relation contains (1,1)(1,1), (1,2)(1,2), (1,3)(1,3), (2,2)(2,2), (3,3)(3,3), (3,4)(3,4), (4,1)(4,1), and (4,4)(4,4).

  3. The relation contains (1,2)(1,2), (1,4)(1,4), (2,1)(2,1), (2,3)(2,3), (3,2)(3,2), (3,4)(3,4), (4,1)(4,1), and (4,3)(4,3).

Exercise

Represent each of these relations on {1,2,3,4}\{1, 2, 3, 4\} with a matrix (with the elements of this set listed in increasing order).

  1. {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}\{(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)\}

  2. {(1,1),(1,4),(2,2),(3,3),(4,1)}\{(1, 1), (1, 4), (2, 2), (3, 3), (4, 1)\}

  3. {(1,2),(1,3),(1,4),(2,1),(2,3),(2,4),(3,1),(3,2),(3,4),(4,1),(4,2),(4,3)}\{(1, 2), (1, 3), (1, 4), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (3, 4), (4, 1), (4, 2), (4, 3)\}

  4. {(2,4),(3,1),(3,2),(3,4)}\{(2, 4), (3, 1), (3, 2), (3, 4)\}

Solution

The relations corresponding to these matrices (from a to d) are:

[0111001100010000][1001010000101000][0111101111011110][0000000111010000]\begin{bmatrix} 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 \end{bmatrix} \begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 1 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix}
Exercise

How many nonzero entries does the matrix representing the relation RR on A={1,2,3,...,1000}A = \{1, 2, 3, ..., 1000\} consisting of the first 1000 positive integers have if RR is

  1. {(a,b)ab}\{(a, b) \mid a \leq b\}?

  2. {(a,b)a=b±1}\{(a, b) \mid a = b \pm 1\}?

  3. {(a,b)a+b=1000}\{(a, b) \mid a + b = 1000\}?

  4. {(a,b)a+b1001}\{(a, b) \mid a + b \leq 1001\}?

  5. {(a,b)a0}\{(a, b) \mid a \neq 0\}?

Solution

Note that the total number of entries in the matrix is 10002=1,000,0001000^2 = 1,000,000.

  1. There is a 11 in the matrix for each pair of distinct positive integers not exceeding 10001000, namely in position (a,b)(a, b) where aba \leq b, as well as 11‘s along the diagonal. Thus the answer is the number of subsets of size 22 from a set of 10001000 elements, plus 10001000, i.e., C(1000,2)+1000=499500+1000=500,500C(1000, 2) + 1000 = 499500 + 1000 = 500,500.

  2. There two 11‘s in each row of the matrix except the first and last rows, in which there is one 11. Therefore the answer is 9982+2=1998998 \cdot 2 + 2 = 1998.

  3. There is a 11 in the matrix at each entry just above and to the left of the “anti-diagonal” (i.e., in positions (1,999),(2,998),...,(999,1)(1, 999), (2, 998), ..., (999, 1). Therefore the answer is 999999.

  4. There is a 11 in the matrix at each entry on or above (to the left of) the “anti-diagonal.” This is the same number of 11‘s as in part (a), so the answer is again 500,500500,500.

  5. The condition is trivially true (since 1a10001 \leq a \leq 1000), so all 1,000,0001,000,000 entries are 11.

Exercise

Draw the directed graph that represents the relation {(a,a),(a,b),(b,c),(c,b),(c,d),(d,a),(d,b).}\{(a, a), (a, b), (b, c), (c, b), (c, d), (d, a), (d, b).\}

Figure pending: The original LaTeX illustration is retained in the source repository and needs a web-native asset export.

Exercise

Let RR be a relation on a set AA. Explain how to use the directed graph representing RR to obtain the directed graph representing the complementary relation R\overline{R}.

Solution

For each pair (a,b)(a, b) of vertices (including the pairs (a,a)(a, a) in which the two vertices are the same), if there is an edge from aa to bb, then erase it, and if there is no edge from aa to bb, put add it in.

Exercise

Given the directed graphs representing two relations, how can the directed graph of the union, intersection, symmetric difference, difference, and composition of these relations be found?

Solution

We assume that the two relations are on the same set. For the union, we simply take the union of the directed graphs, i.e., take the directed graph on the same vertices and put in an edge from ii to jj whenever there is an edge from ii to jj in either of them. For intersection, we simply take the intersection of the directed graphs, i.e., take the directed graph on the same vertices and put in an edge from ii to jj whenever there are edges from ii to jj in both of them. For symmetric difference, we simply take the symmetric difference of the directed graphs, i.e., take the directed graph on the same vertices and put in an edge from ii to jj whenever there is an edge from ii to jj in one, but not both, of them. Similarly, to form the difference, we take the difference of the directed graphs, i.e., take the directed graph on the same vertices and put in an edge from ii to jj whenever there is an edge from ii to jj in the first but not the second. To form the directed graph for the composition SRS \circ R of relations RR and SS, we draw a directed graph on the same set of vertices and put in an edge from ii to jj whenever there is a vertex kk such that there is an edge from ii to kk in RR, and an edge from kk to jj in SS.

Closure of Relations

Exercises

Equivalence Relations

In mathematics, an equivalence relation is a special type of binary relation that allows us to group elements of a set into disjoint subsets called equivalence classes. The idea behind equivalence relations is to capture a meaningful notion of “sameness” or “interchangeability” among elements.

Equivalence relations are characterized by three key properties: reflexivity, symmetry, and transitivity. These properties ensure that the relation partitions the set into equivalence classes, each containing elements that are equivalent in some sense.

Equivalence

Definition

A relation on a set AA is called an equivalence relation if it is reflexive, symmetric, and transitive. Two elements aa and bb that are related by an equivalence relation are called equivalent. The notation aba\sim b is often used to denote that aa and bb are equivalent elements with respect to a particular equivalence relation.

The concept of equivalence relations is a fundamental tool in many branches of mathematics. They allow us to focus on essential characteristics that elements share, abstracting away extraneous details. Some common examples include:

  • Equality of numbers

  • Congruence modulo nn in number theory

  • Similarity of triangles in geometry

  • Having the same cardinality for sets

Equivalence relations provide a way to decompose a set into a collection of equivalence classes, revealing important structural insights. They are essential for understanding quotient structures, modular arithmetic, and the role of abstraction in mathematical thought.

Example

Let mm be an integer with m>1m > 1. Show that the relation R={(a,b)ab (mod m)}R = \{(a, b) \mid a \equiv b \ (\mathrm{mod} \ m)\} is an equivalence relation on the set of integers.

Solution

Recall from Section 4.1 that ab (mod m)a \equiv b \ (\mathrm{mod} \ m) if and only if mm divides aba - b. Note that aa=0a - a = 0 is divisible by mm, because 0=0m0 = 0 \cdot m. Hence, aa (mod m)a \equiv a \ (\mathrm{mod} \ m), so congruence modulo mm is reflexive.

Now suppose that ab (mod m)a \equiv b \ (\mathrm{mod} \ m). Then aba - b is divisible by mm, so ab=kma - b = km, where kk is an integer. It follows that ba=(k)mb - a = (-k)m, so ba (mod m)b \equiv a \ (\mathrm{mod} \ m). Hence, congruence modulo mm is symmetric.

Next, suppose that ab (mod m)a \equiv b \ (\mathrm{mod} \ m) and bc (mod m)b \equiv c \ (\mathrm{mod} \ m). Then mm divides both aba - b and bcb - c. Therefore, there are integers kk and ll with ab=kma - b = km and bc=lmb - c = lm. Adding these two equations shows that ac=(ab)+(bc)=km+lm=(k+l)ma - c = (a - b) + (b - c) = km + lm = (k + l) m. Thus, ac (mod m)a \equiv c \ (\mathrm{mod} \ m). Therefore, congruence modulo mm is transitive.

It follows that congruence modulo mm is an equivalence relation.

Example

Let AA be a non-empty set, and define a relation \sim on the power set P(A)\mathcal{P}(A) (the set of all subsets of AA) as follows: for any subsets X,YAX, Y \subseteq A, XY    X=YX \sim Y \iff |X| = |Y| where X|X| denotes the cardinality (number of elements) of the set XX. In other words, two subsets are related by \sim if and only if they have the same number of elements.

Solution

We can show that the relation \sim defined above is an equivalence relation on P(A)\mathcal{P}(A):

  1. Reflexivity: For any subset XAX \subseteq A, we have X=X|X| = |X|, so XXX \sim X.

  2. Symmetry: If XYX \sim Y, then X=Y|X| = |Y|. Since equality of cardinalities is symmetric, we also have Y=X|Y| = |X|, so YXY \sim X.

  3. Transitivity: If XYX \sim Y and YZY \sim Z, then X=Y|X| = |Y| and Y=Z|Y| = |Z|. By the transitivity of equality, we have X=Z|X| = |Z|, so XZX \sim Z.

The equivalence classes under this relation are called cardinality classes. For a subset XAX \subseteq A, its cardinality class [X][X] consists of all subsets of AA that have the same cardinality as XX:

[X]=YAY=X[X] = {Y \subseteq A \mid |Y| = |X|}

In other words, the cardinality classes partition P(A)\mathcal{P}(A) into disjoint subsets based on the number of elements in each subset. For example, if A=1,2,3A = {1, 2, 3}, then the cardinality classes are:

  • []=[\emptyset] = { \emptyset } (subsets with 0 elements)

  • [1]=1,2,3[{1}] = {{1}, {2}, {3}} (subsets with 1 element)

  • [1,2]=1,2,1,3,2,3[{1, 2}] = {{1, 2}, {1, 3}, {2, 3}} (subsets with 2 elements)

  • [A]=A[A] = {A} (subsets with 3 elements)

This equivalence relation captures the idea that two sets are “equivalent” if they have the same cardinality, regardless of their specific elements. The study of cardinality and the relationships between sets of different sizes is a fundamental aspect of set theory and plays a crucial role in the development of modern mathematics, including the theory of infinite sets and the foundations of mathematics.

Example

Let RR be the relation on the set of real numbers such that xRyxRy if and only if xx and yy are real numbers that differ by less than 1, that is, xy<1|x - y| < 1. Show that RR is not an equivalence relation.

Solution

RR is reflexive because xx=0<1|x - x| = 0 < 1 whenever xRx \in \mathbb{R}. RR is symmetric, for if xRyxRy, where xx and yy are real numbers, then xy<1|x - y| < 1, which tells us that yx=xy<1|y - x| = |x - y| < 1, so that yRxyRx. However, RR is not an equivalence relation because it is not transitive. Take x=2.8x = 2.8, y=1.9y = 1.9, and z=1.1z = 1.1, so that xy=2.81.9=0.9<1|x - y| = |2.8 - 1.9| = 0.9 < 1, yz=1.91.1=0.8<1|y - z| = |1.9 - 1.1| = 0.8 < 1, but xz=2.81.1=1.7>1|x - z| = |2.8 - 1.1| = 1.7 > 1. That is, 2.8R1.92.8R1.9, 1.9R1.11.9R1.1, but not 2.8R1.12.8R1.1.

Equivalence Classes

We can dig deeper into equivalence by partitioning the set where the relation is built upon with respect to a member of the subset. We call this a Equivalence Class.

Definition

Let RR be an equivalence relation on a set A. The set of all elements that are related to an element aa of AA is called the equivalenceequivalence class of aa. The equivalence class of aa with respect to RR is denoted by [a]R[a]_R. When only one relation is under consideration, we can delete the subscript RR and write [a][a] for this equivalence class.

Remark

In set notation we have [a]R={(a,s)R}.[a]_R = \{ (a,s) \in R\}. For some member e[a]Re\in [a]_R, we call ee a representative of the equivalence class.

Example

What is the equivalence class of an integer for the equivalence relation a=ba = |b|?

Solution

Since a=b or a=ba = b \text{ or } a = -b, so [a]={a,a}[a] = \{-a,a\}, which holds for all integer, including 0. We have [3]={3,3}[3] = \{ -3, 3\}, etc.

Example

What are the equivalence classes of 0 and 1 for congruence modulo 2?

Solution

The equivalence class of 0 contains all integers aa such that a0(mod4)a \equiv 0 \pmod{4}. The integers in this class are those divisible by 4. Hence, the equivalence class of 0 for this relation is [0]={,8,4,0,4,8,}.[0] = \{ \ldots, -8, -4, 0, 4, 8, \ldots \}.

The equivalence class of 1 contains all the integers aa such that a1(mod4)a \equiv 1 \pmod{4}. The integers in this class are those that have a remainder of 1 when divided by 4. Hence, the equivalence class of 1 for this relation is [1]={,7,3,1,5,9,}.[1] = \{ \ldots, -7, -3, 1, 5, 9, \ldots \}.

This notion actually allows us to further abstract to congruence classes modulo mm.

Definition

Let mm be a positive integer. The congruence class of an integer aa modulo mm, denoted by [a]m[a]_m, is the set of all integers bb such that ba (mod m)b \equiv a \ (\mathrm{mod} \ m), which means that mm divides bab - a. Formally, the congruence class [a]m[a]_m is defined as: [a]m={bZ  ba (mod m)}={bZ  kZ, b=a+km}.[a]_m = \{ b \in \mathbb{Z} \ | \ b \equiv a \ (\mathrm{mod} \ m) \} = \{ b \in \mathbb{Z} \ | \ \exists k \in \mathbb{Z}, \ b = a + km \}.

Here are some other examples on equivalence class.

Example

Find the equivalence class for 12\frac{1}{2} under the relation of fraction simplification.

Solution

The equivalence class of 12\frac{1}{2} consists of all fractions that simplify to 12\frac{1}{2}, which includes all rational numbers where the numerator is half the denominator. Hence, the equivalence class is: [1/2]={24,36,48,510,}[1/2] = \left\{ \frac{2}{4}, \frac{3}{6}, \frac{4}{8}, \frac{5}{10}, \ldots \right\}

Example

Find the equivalence class for the string “cat” under the relation of having the same length.

Solution

The equivalence class of the string “cat” consists of all strings of length 3. Examples include: ["cat"]={"dog","pen","sun","mom",}[\text{"cat"}] = \{ \text{"dog"}, \text{"pen"}, \text{"sun"}, \text{"mom"}, \ldots \}

Congruence Class can be further interpreted by introducing partition of set. Recall (in definition def

) that the partition of a set are a possible combination of mutually disjoint subsets of a set. Suppose we have some set RR, than we can make form some three-member partition (P1P2P3)=R(P_1\cup P_2\cup P_3) = R, where P1,P2,P3,RP_1,P_2,P_3,\subseteq R. Also we have R=P1+P2+P3|R| = |P_1|+|P_2|+|P_3|. But notice that PiPj,i,j{1,2,3}P_i\cap P_j, i,j \in\{1,2,3\} is \emptyset.

Now let’s relate this to congruence class.

Theorem

Let RR be an equivalence relation on a set AA. These statements for elements aa and bb of AA are equivalent:

(i):aRb(ii):[a]=[b](iii):[a][b](i):aRb\quad(ii):[a]=[b]\quad(iii):[a]\cap[b]\neq\emptyset

Proof

We first show that (i) implies (ii). Assume that aRbaRb. We will prove that [a]=[b][a] = [b] by showing [a][b][a] \subseteq [b] and [b][a][b] \subseteq [a]. Suppose c[a]c \in [a], where cc is any arbitrary member of [a][a]. Then aRcaRc. Because aRbaRb and RR is symmetric, we know that bRabRa. Furthermore, because RR is transitive and bRabRa and aRcaRc, it follows that bRcbRc. Hence, c[b]c \in [b]. This shows that [a][b][a] \subseteq [b], since all elements of [a][a] is also an element of [b][b]. The proof that [b][a][b] \subseteq [a] is similar.

Second, we will show that (ii) implies (iii). Assume that [a]=[b][a] = [b]. It follows that [a][b][a] \cap [b] \neq \emptyset because [a][a] is nonempty (because a[a]a \in [a] since RR is reflexive).

Next, we will show that (iii) implies (i). Suppose that [a][b][a] \cap [b] \neq \emptyset. Then there is an element cc with c[a]c \in [a] and c[b]c \in [b]. In other words, aRcaRc and bRcbRc. By the symmetric property, cRbcRb. Then by transitivity, because aRcaRc and cRbcRb, we have aRbaRb.

Because (i) implies (ii), (ii) implies (iii), and (iii) implies (i), the three statements, (i), (ii), and (iii), are equivalent.

Let RR be an equivalence relation on a set AA. The union of the equivalence classes is the whole set AA, because an element a of AA is in its own equivalence class, and there is no intersection between equivalence class of different elements. aA[a]R=A.\bigcup_{a\in A}[a]_R=A. This is because from theorem one we have

Lemma

If [a]R[b]R[a]_R \neq [b]_R, then [a]R[b]R=.[a]_R\cap[b]_R=\emptyset.

This is because when [a]R=[b]R[a]_R = [b]_R, the intersection cannot be empty.

Lemma

The partition of a set S exists if and only if the family of set index by iIi \in I with respect to subsets AiA_i, Ai,iIA_i \neq \emptyset, \forall i \in I, and AiAj=A_i\cap A_j = \emptyset when iji\neq j. And we have S as a family of set index by ii iIAi=S.\bigcup_{i \in I}A_i = S.

Example

Let A=ZA = \mathbb{Z}, the set of all integers, and let RR be the equivalence relation of congruence modulo 33. Determine if the following statements are true:

  1. 1R41R4

  2. [1]=[4][1] = [4]

  3. [1][4][1] \cap [4] \neq \emptyset

Solution
  1. 1R41R4 is true because 41mod34 \equiv 1 \mod 3.

  2. [1]=[4][1] = [4] is true because both 11 and 44 have the same remainder when divided by 33, which means they are in the same equivalence class modulo 33.

  3. [1][4][1] \cap [4] \neq \emptyset is true because [1][1] contains 44 since 41mod34 \equiv 1 \mod 3, hence 44 is in both [1][1] and [4][4].

As all three statements are true, the statements (i), (ii), and (iii) are equivalent for the given equivalence relation.

Exercises

Exercise

Determine the equivalence class of 22 under the relation of congruence modulo 55.

Solution

The equivalence class of 22 modulo 55, denoted [2]5[2]_5, consists of all integers that leave a remainder of 22 when divided by 55. This can be expressed as: [2]5={,8,3,2,7,12,}[2]_5 = \{ \ldots, -8, -3, 2, 7, 12, \ldots \} where each element is of the form 2+5k2 + 5k for some integer kk.

Exercise

Let SS be the equivalence relation on P({1,2,3,4})\mathcal{P}(\{1, 2, 3, 4\}) defined by XY if and only if X{2}=Y{2}.X \sim Y \text{ if and only if } |X \cup \{2\}| = |Y \cup \{2\}|.

Write down the equivalence classes of SS.

Solution

To find the equivalence classes of the relation SS, we need to analyze how the sets X{2}X \cup \{2\} and Y{2}Y \cup \{2\} affect the cardinality and thus the equivalence.

Consider the power set P({1,2,3,4})\mathcal{P}(\{1, 2, 3, 4\}), which includes all subsets of {1,2,3,4}\{1, 2, 3, 4\}:

P({1,2,3,4})={,{1},{2},{3},{4},{1,2},{1,3},{1,4},{2,3},{2,4},{3,4},{1,2,3},{1,2,4},{1,3,4},{2,3,4},{1,2,3,4}}\begin{aligned} \mathcal{P}(\{1, 2, 3, 4\}) = & \{\emptyset, \{1\}, \{2\}, \{3\}, \{4\}, \{1, 2\}, \{1, 3\}, \{1, 4\}, \{2, 3\}, \{2, 4\}, \\ & \{3, 4\}, \{1, 2, 3\}, \{1, 2, 4\}, \{1, 3, 4\}, \{2, 3, 4\}, \{1, 2, 3, 4\}\} \end{aligned}

We need to group these sets into equivalence classes based on the criterion X{2}=Y{2}|X \cup \{2\}| = |Y \cup \{2\}|.

  1. {,{2}}\{\emptyset, \{2\}\}
  • {2}={2}\emptyset \cup \{2\} = \{2\}, {2}=1|\emptyset \cup \{2\}| = 1

  • {2}{2}={2}\{2\} \cup \{2\} = \{2\}, {2}{2}=1|\{2\} \cup \{2\}| = 1

  1. {{1},{3},{4},{1,2},{2,3},{2,4}}\{\{1\}, \{3\}, \{4\}, \{1, 2\}, \{2, 3\}, \{2, 4\}\}
  • {1}{2}={1,2}\{1\} \cup \{2\} = \{1, 2\}, {1}{2}=2|\{1\} \cup \{2\}| = 2

  • {3}{2}={2,3}\{3\} \cup \{2\} = \{2, 3\}, {3}{2}=2|\{3\} \cup \{2\}| = 2

  • {4}{2}={2,4}\{4\} \cup \{2\} = \{2, 4\}, {4}{2}=2|\{4\} \cup \{2\}| = 2

  • {1,2}{2}={1,2}\{1, 2\} \cup \{2\} = \{1, 2\}, {1,2}{2}=2|\{1, 2\} \cup \{2\}| = 2

  • {2,3}{2}={2,3}\{2, 3\} \cup \{2\} = \{2, 3\}, {2,3}{2}=2|\{2, 3\} \cup \{2\}| = 2

  • {2,4}{2}={2,4}\{2, 4\} \cup \{2\} = \{2, 4\}, {2,4}{2}=2|\{2, 4\} \cup \{2\}| = 2

  1. {{1,3},{1,4},{3,4},{1,2,3},{1,2,4},{2,3,4}}\{\{1, 3\}, \{1, 4\}, \{3, 4\}, \{1, 2, 3\}, \{1, 2, 4\}, \{2, 3, 4\}\}
  • {1,3}{2}={1,2,3}\{1, 3\} \cup \{2\} = \{1, 2, 3\}, {1,3}{2}=3|\{1, 3\} \cup \{2\}| = 3

  • {1,4}{2}={1,2,4}\{1, 4\} \cup \{2\} = \{1, 2, 4\}, {1,4}{2}=3|\{1, 4\} \cup \{2\}| = 3

  • {3,4}{2}={2,3,4}\{3, 4\} \cup \{2\} = \{2, 3, 4\}, {3,4}{2}=3|\{3, 4\} \cup \{2\}| = 3

  • {1,2,3}{2}={1,2,3}\{1, 2, 3\} \cup \{2\} = \{1, 2, 3\}, {1,2,3}{2}=3|\{1, 2, 3\} \cup \{2\}| = 3

  • {1,2,4}{2}={1,2,4}\{1, 2, 4\} \cup \{2\} = \{1, 2, 4\}, {1,2,4}{2}=3|\{1, 2, 4\} \cup \{2\}| = 3

  • {2,3,4}{2}={2,3,4}\{2, 3, 4\} \cup \{2\} = \{2, 3, 4\}, {2,3,4}{2}=3|\{2, 3, 4\} \cup \{2\}| = 3

  1. {{1,3,4},{1,2,3,4}}\{\{1, 3, 4\}, \{1, 2, 3, 4\}\}
  • {1,3,4}{2}={1,2,3,4}\{1, 3, 4\} \cup \{2\} = \{1, 2, 3, 4\}, {1,3,4}{2}=4|\{1, 3, 4\} \cup \{2\}| = 4

  • {1,2,3,4}{2}={1,2,3,4}\{1, 2, 3, 4\} \cup \{2\} = \{1, 2, 3, 4\}, {1,2,3,4}{2}=4|\{1, 2, 3, 4\} \cup \{2\}| = 4

Therefore, the equivalence classes are: {,{2}},{{1},{3},{4},{1,2},{2,3},{2,4}},{{1,3},{1,4},{3,4},{1,2,3},{1,2,4},{2,3,4}},{{1,3,4},{1,2,3,4}}.\begin{aligned} &\{\emptyset, \{2\}\}, \\ &\{\{1\}, \{3\}, \{4\}, \{1, 2\}, \{2, 3\}, \{2, 4\}\}, \\ &\{\{1, 3\}, \{1, 4\}, \{3, 4\}, \{1, 2, 3\}, \{1, 2, 4\}, \{2, 3, 4\}\}, \\ &\{\{1, 3, 4\}, \{1, 2, 3, 4\}\}. \end{aligned}

Exercise

Let A=ZA = \mathbb{Z}, and define RR on AA by xRyxRy if and only if xyx - y is even. Determine if the following statements are true for a=2a = 2 and b=5b = 5:

  1. aRbaRb

  2. [2]=[5][2] = [5]

  3. [2][5][2] \cap [5] \neq \emptyset

Solution
  1. aRbaRb is false because 252 - 5 is odd.

  2. [2]=[5][2] = [5] is false because 22 is in the equivalence class of even remainders while 55 is in the class of odd remainders.

  3. [2][5][2] \cap [5] \neq \emptyset is false because [2][2] contains all even numbers and [5][5] contains all odd numbers, so they have no elements in common.

In this case, statements (i), (ii), and (iii) are not equivalent because the relation RR is not defined as congruence modulo some number but rather by the parity of the difference between elements.

No that we can get partition of a set from a equivalence relation, can we inverse this process? That is, define a equivalence relation with some given set partitions? The answer is yes.

To see this, assume that {AiiI}\{A_i \mid i \in I\} is a partition on SS. Let RR be the relation on SS consisting of the pairs (x,y)(x, y), where xx and yy belong to the same subset AiA_i, in the partition. To show that RR is an equivalence relation we must show that RR is reflexive, symmetric, and transitive.

We see that (a,a)R(a, a) \in R for every aSa \in S, because aa is in the same subset of SS as itself. Hence, RR is reflexive. If (a,b)R(a, b) \in R, then bb and aa are in the same subset of SS in the partition, so that (b,a)R(b, a) \in R as well. Hence, RR is symmetric. If (a,b)R(a, b) \in R and (b,c)R(b, c) \in R, then aa and bb are in the same subset XX of SS in the partition, and bb and cc are in the same subset YY of SS of the partition. Because the subsets of SS in the partition are disjoint and bb belongs to XX and YY, it follows that X=YX = Y. Consequently, aa and cc belong to the same subset of SS in the partition, so (a,c)R(a, c) \in R. Thus, RR is transitive.

It follows that RR is an equivalence relation. The equivalence classes of RR consist of subsets of SS containing related elements, and by the definition of RR, these are the subsets of SS in the partition. The theorem summarizes the connections we have established between equivalence relations and partitions.

Theorem

Let RR be an equivalence relation on a set SS. Then the equivalence classes of RR form a partition of SS. Conversely, given a partition {AiiI}\{A_i \mid i \in I\} of the set SS, there is an equivalence relation RR that has the sets Ai,iIA_i, i \in I, as its equivalence classes.

Example

For example, consider the set S={1,2,3,4,5,6}S = \{1, 2, 3, 4, 5, 6\}.

One possible equivalence relation RR on SS is “congruence modulo 3”. This relation partitions SS into the equivalence classes [1]={1,4}[1] = \{1, 4\}, [2]={2,5}[2] = \{2, 5\}, and [3]={3,6}[3] = \{3, 6\}.

Conversely, consider a partition of SS into subsets A1={1,2}A_1 = \{1, 2\}, A2={3,4}A_2 = \{3, 4\}, and A3={5,6}A_3 = \{5, 6\}. The equivalence relation RR induced by this partition is such that two numbers are related if and only if they are in the same subset AiA_i.

Order Relations

Another important family is formed by order relations, including partial, total, and well orders. We begin with the most general notion, the partial order, and then specialize it.

Partial, Total, and Well Ordering

Definition

A relation RR on a set S is called a partial ordering or partial order if it is reflexive, antisymmetric, and transitive. A set SS together with a partial ordering RR is called a partial ordered set, or poset, and is denoted by (S,R)(S,R). Members of S are called elements of the poset.

Remark

The reason why partial order relation has a specific notation for poset is because that order relation is usually defined on the same set(for the domain and codomain). For equivalence relation, however, we see more relation between different sets.

The most common partial order relation is “greater than or equal to”, “is subset to”, and “divides”.

Example

Show that the greater than or equal to relation \geq is a partial ordering on the set of integers.

Solution: Because aaa \geq a for every integer aa, \geq is reflexive. If aba \geq b and bab \geq a, then a=ba = b. Hence, \geq is antisymmetric. Finally, \geq is transitive because aba \geq b and bcb \geq c imply that aca \geq c. It follows that \geq is a partial ordering on the set of integers and (Z,)(\mathbb{Z}, \geq) is a poset.

Example

The divisibility relation | is a partial ordering on the set of positive integers, because it is reflexive, antisymmetric, and transitive, as was shown in Section 9.1. We see that (Z+,)(\mathbb{Z}^+, |) is a poset.

Example

Show that the inclusion relation \subseteq is a partial ordering on the power set of a set SS.

Solution: Because AAA \subseteq A whenever AA is a subset of SS, \subseteq is reflexive. It is antisymmetric because ABA \subseteq B and BAB \subseteq A imply that A=BA = B. Finally, \subseteq is transitive, because ABA \subseteq B and BCB \subseteq C imply that ACA \subseteq C. Hence, \subseteq is a partial ordering on P(S)P(S), and (P(S),)(P(S), \subseteq) is a poset.

For convenience of representation, we need a symbol to define the operator for an arbitrary partial ordering.

Notation

\preccurlyeq is used to define any arbitrary partial order relation aba \preccurlyeq b on set SS. Alternatively, we also have aba \prec b to denote that aba\preccurlyeq b but aba \neq b.

With this, we can define comparability of the relation. This helps us to distinguish different types of special partial orderings.

Definition

The elements aa and bb of a poset (S, )\preccurlyeq) are called comparable if either aba\preccurlyeq b or bab\preccurlyeq a. When aa and bb are elements of S such that neither aba\preccurlyeq b nor ba,ab\preccurlyeq a,a and bb are called incomparable.

Example

In the poset (Z+,)(\mathbb{Z}^+ ,\mid), are 3 and 9 comparable? Also consider 4 and 5.

Solution

3 and 9 are obviously comparable, since even though 939 \nmid 3, we still have 393 \mid 9. So 3 and 9 are comparable. While 454\nmid 5 and 545\nmid 4, so they are not comparable.

We see that for divisibility, there are cases that the relation is not comparable among the elements that are involved here. Actually this is why we call it partial order, because there are cases that things cannot be compared or cannot build relation. If we can have a very special partial ordering on SS that is comparable for every member of the set, we call it a total ordering or total order relation.

Definition

If (S,)(S, \preccurlyeq) is a poset and every two elements of SS are comparable, SS is called a totally ordered or linearly ordered set, and \preccurlyeq is called a total order or a linear order. A totally ordered set is also called a chain.

Total ordering is also very quite familiar to us, actually, the \leq relation we just mentioned is also a total order relation, and so as \geq.

Here are some other examples.

Example

The set of words in a dictionary with the alphabetical order is a totally ordered set because any two words can be compared based on lexicographic order.

Example

The set of points on a line with a defined direction is a totally ordered set, where any two points can be compared based on their position relative to each other along the line.

So we know that total orderings are special partial orderings. Now, can we manage to find a kind of special relation with respect to total ordering? The answer is yes, and we have actually known this relation, as it is the foundation of the principal of mathematical induction (theorem principle/induc).

Definition

The poset (S,)(S, \preccurlyeq) is a well-ordered set if \preccurlyeq is total ordering and every nonempty subset of SS has a least element.

Here are some example of well-ordering.

Example

The set of natural numbers N\mathbb{N} with the usual order \leq is not only a totally ordered set but also a well-ordered set because every non-empty subset of N\mathbb{N} has a smallest element.

Example

Consider the set S={1nnN}S = \{\frac{1}{n} \mid n \in \mathbb{N}\}. The set SS with the order \leq is a well-ordered set because for any non-empty subset of SS, the element with the largest nn (which exists because N\mathbb{N} is well-ordered) will be the least element of that subset.

Example

The set of positive integers up to 100, {1,2,,100}\{1, 2, \ldots, 100\}, is well-ordered by the usual \leq relation. Any non-empty subset has a minimum element since it is a finite subset of the well-ordered set N\mathbb{N}.

Well ordering secures that each step we made with mathematical induction is correct, since the least element allows us to define a solid base case, so that the rest of the statement could be proved one by one by applying our hypothesis, so that the inductive step could be proven. This could be encapsulated by the following theorem.

Theorem

Suppose that SS is a well-ordered set. Then P(x)P(x) is true for all xSx \in S, if

Inductive Step: For every ySy \in S, if P(x)P(x) is true for all xSx \in S with x<yx < y, then P(y)P(y) is true.

Proof

Suppose it is not the case that P(x)P(x) is true for all xSx \in S. Then there is an element ySy \in S such that P(y)P(y) is false. Consequently, the set A={xSP(x) is false}A = \{ x \in S \mid P(x) \text{ is false} \} is nonempty. Because SS is well-ordered, AA has a least element aa. By the choice of aa as a least element of AA, we know that P(x)P(x) is true for all xSx \in S with x<ax < a. This implies by the inductive step P(a)P(a) is true. This contradiction shows that P(x)P(x) must be true for all xSx \in S.

Remark

We do not need a basis step in a proof using the principle of well-ordered induction because if x0x_0 is the least element of a well-ordered set, the inductive step tells us that P(x0)P(x_0) is true. This follows because there are no elements xSx \in S with x<x0x < x_0, so we know (using a vacuous proof) that P(x)P(x) is true for all xSx \in S with x<x0x < x_0.

Lexicographic Order

In a dictionary, all words are ordered in alphabetical order by the first letter that is different from the other previous words. For example, we have this array of string in alphabetical order: [“a”, “abnormal”, “acknowledge”, “acquire”…]. We can conceptualize this ordering in mathematics with partial order relation, calling lexicographic order.

The concept of lexicographic ordering can be extended beyond strings and applied to the Cartesian product of two posets. We formalize this concept as follows:

Definition

Given two posets (A1,1)(A_1, \preccurlyeq_1) and (A2,2)(A_2, \preccurlyeq_2), the lexicographic ordering \preccurlyeq on A1×A2A_1 \times A_2 compares first coordinates, and compares second coordinates only when the first coordinates are equal. Its strict part is

(a1,a2)(b1,b2)a11b1 or (a1=b1 and a22b2).(a_1,a_2)\prec(b_1,b_2)\quad\Longleftrightarrow\quad a_1\prec_1 b_1\ \text{or}\ (a_1=b_1\ \text{and}\ a_2\prec_2 b_2).

We achieve a partial ordering \preccurlyeq by combining this lexicographic ordering with equality. Here is how we verify it.

Proof

For reflexivity, every pair (a1,a2)(a_1,a_2) is related to itself because a1=a1a_1=a_1 and a22a2a_2\preccurlyeq_2 a_2.

For antisymmetry, suppose both (a1,a2)(b1,b2)(a_1,a_2)\preccurlyeq(b_1,b_2) and (b1,b2)(a1,a2)(b_1,b_2)\preccurlyeq(a_1,a_2). If a1b1a_1\neq b_1, the strict first-coordinate alternatives would point in opposite directions, which is impossible. Hence a1=b1a_1=b_1. The definition then reduces to a22b2a_2\preccurlyeq_2 b_2 and b22a2b_2\preccurlyeq_2 a_2, so a2=b2a_2=b_2 by antisymmetry of 2\preccurlyeq_2.

For transitivity, if the first coordinates are strictly ordered, transitivity of 1\preccurlyeq_1 gives the required first-coordinate comparison. If the first coordinates are equal, the comparison is decided by the second coordinates, where transitivity of 2\preccurlyeq_2 applies. Thus the lexicographic relation is a partial order. It is total when both component orders are total.

Example

Consider two posets, (A1,1)(A_1, \leq_1) where A1={1,2}A_1 = \{1, 2\} with the usual less than or equal relation, and (A2,2)(A_2, \leq_2) where A2={a,b}A_2 = \{a, b\} with a2ba \leq_2 b. The lexicographic order \leq on A1×A2A_1 \times A_2 is given as follows:

For any two elements (a1,a2),(b1,b2)A1×A2(a_1, a_2), (b_1, b_2) \in A_1 \times A_2, we say that (a1,a2)(b1,b2)(a_1, a_2) \leq (b_1, b_2) if:

  1. a1<1b1a_1 <_1 b_1, or

  2. a1=b1a_1 = b_1 and a22b2a_2 \leq_2 b_2.

For example, (1,a)(2,a)(1, a) \leq (2, a) because 1<121 <_1 2, and (2,a)(2,b)(2, a) \leq (2, b) because 2=22 = 2 and a2ba \leq_2 b. Thus, the pair (1,a)(1, a) is considered less than (2,b)(2, b) in the lexicographic ordering because the first element of the first pair (1) is less than the first element of the second pair (2), even though we do not compare the second elements in this case.

Hasse Diagram

Maximal and Minimal Elements

Lattices

Topological Sorting

Exercises

The following exercises are on lexicographic ordering.

Exercise

Do some tricks to the result of the proof in definition lexord to make it a well order relation.

Solution

This could be solved without a second thought that we can make A1,A2A_1,A_2 any sets with smallest element, such as Z1\Z_{1}, all integers greater than or equal 1.

Exercise

Let RR be a binary relation on Z\mathbb{Z} defined by xRy if and only if x<y or xy(mod2).xRy \text{ if and only if } x < y \text{ or } x \equiv y \pmod{2}.

Is RR reflexive? Is RR symmetric? Is RR antisymmetric? Is RR transitive?

Fully justify each answer.

Solution

Let’s analyze the properties of the relation RR.

  • Reflexive: A relation RR on a set AA is reflexive if every element is related to itself, i.e., aRaaRa for all aAa \in A.

    For any integer xZx \in \mathbb{Z}, we have xx(mod2)x \equiv x \pmod{2}. Hence, xRxxRx holds for all xZx \in \mathbb{Z}.

    Therefore, RR is reflexive.

  • Symmetric: A relation RR on a set AA is symmetric if aRbaRb implies bRabRa for all a,bAa, b \in A.

    Consider the pair (2,3)(2, 3). We have 2R32R3 because 2<32 < 3. However, 323 \not R 2 because 3>23 > 2 and 3≢2(mod2)3 \not\equiv 2 \pmod{2}.

    Therefore, RR is not symmetric.

  • Antisymmetric: A relation RR on a set AA is antisymmetric if aRbaRb and bRabRa imply a=ba = b for all a,bAa, b \in A.

    Consider the pair (2,4)(2, 4). We have 2R42R4 because 2<42 < 4, and 4R24R2 because 42(mod2)4 \equiv 2 \pmod{2}. However, 242 \neq 4.

    Therefore, RR is not antisymmetric.

  • Transitive: A relation RR on a set AA is transitive if aRbaRb and bRcbRc imply aRcaRc for all a,b,cAa, b, c \in A.

    Consider the elements 22, 33, and 11. We have 2R32R3 because 2<32 < 3, and 3R13R1 because 31(mod2)3 \equiv 1 \pmod{2}. However, 212 \not R 1 because 212 \not< 1 and 2≢1(mod2)2 \not\equiv 1 \pmod{2}.

    Therefore, RR is not transitive.

Exercise

Explain why the conjunction of a partial order relation and an equivalence relation leads to the previous result.

Solution

A partial order relation is a binary relation that is reflexive, antisymmetric, and transitive. An equivalence relation is a binary relation that is reflexive, symmetric, and transitive.

When we combine a partial order relation with an equivalence relation, the resulting relation can still be reflexive because both component relations are reflexive. However, the antisymmetry of the partial order can conflict with the symmetry of the equivalence relation, leading to a relation that is neither antisymmetric nor symmetric. Furthermore, the transitivity of the partial order might not hold if the conditions of the equivalence relation introduce exceptions, which can break the transitivity in specific cases.

In this particular example: - The reflexive property is preserved because both conditions x<yx < y and xy(mod2)x \equiv y \pmod{2} ensure that xRxxRx. - The symmetry is broken because x<yx < y does not imply y<xy < x. - The antisymmetry is violated when equivalence modulo 2 (xy(mod2)x \equiv y \pmod{2}) holds for distinct xx and yy. - The transitivity is disrupted when combining the partial order (x<yx < y) with equivalence modulo 2, as seen in the counterexample with 2,32, 3, and 11.

Thus, the combined relation RR does not retain all properties of partial orders and equivalence relations.

nn-ary Relations

Exercises