Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products



Similar documents
Lecture 17 : Equivalence and Order Relations DRAFT

Cartesian Products and Relations

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

So let us begin our quest to find the holy grail of real analysis.

Lecture 16 : Relations and Functions DRAFT

Handout #1: Mathematical Reasoning

INTRODUCTORY SET THEORY

3. Mathematical Induction

The last three chapters introduced three major proof techniques: direct,

8 Divisibility and prime numbers

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Full and Complete Binary Trees

Math 4310 Handout - Quotient Vector Spaces

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Page 331, 38.4 Suppose a is a positive integer and p is a prime. Prove that p a if and only if the prime factorization of a contains p.

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Fundamentele Informatica II

Basic Proof Techniques

1 if 1 x 0 1 if 0 x 1

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Mathematical Induction

CONTENTS 1. Peter Kahn. Spring 2007

Continued Fractions and the Euclidean Algorithm

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

6.3 Conditional Probability and Independence

Practice with Proofs

E3: PROBABILITY AND STATISTICS lecture notes

1.7 Graphs of Functions

6.2 Permutations continued

Mathematical Induction

Mathematical Induction. Mary Barnes Sue Gordon

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

3 Some Integer Functions

LEARNING OBJECTIVES FOR THIS CHAPTER

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

INCIDENCE-BETWEENNESS GEOMETRY

Binary Adders: Half Adders and Full Adders

Solutions to In-Class Problems Week 4, Mon.

SECTION 10-2 Mathematical Induction

This chapter is all about cardinality of sets. At first this looks like a

Mathematical Induction. Lecture 10-11

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

Regular Languages and Finite Automata

4.5 Linear Dependence and Linear Independence

6.4 Normal Distribution

Pigeonhole Principle Solutions

LINEAR INEQUALITIES. Mathematics is the art of saying many things in many different ways. MAXWELL

Discrete Mathematics. Hans Cuypers. October 11, 2007

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Math 223 Abstract Algebra Lecture Notes

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

DIFFERENTIABILITY OF COMPLEX FUNCTIONS. Contents

Math 55: Discrete Mathematics

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 5 9/17/2008 RANDOM VARIABLES

Real Roots of Univariate Polynomials with Real Coefficients

Part 1 Expressions, Equations, and Inequalities: Simplifying and Solving

If n is odd, then 3n + 7 is even.

1. Prove that the empty set is a subset of every set.

Student Outcomes. Lesson Notes. Classwork. Discussion (10 minutes)

Basic Probability Concepts

8 Square matrices continued: Determinants

Lecture 5 Principal Minors and the Hessian

Set Theory Basic Concepts and Definitions

The Fundamental Theorem of Arithmetic

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

Introduction to Topology

26 Integers: Multiplication, Division, and Order

Multi-variable Calculus and Optimization

of Nebraska - Lincoln

8 Primes and Modular Arithmetic

MATH 60 NOTEBOOK CERTIFICATIONS

Section 1.3 P 1 = 1 2. = P n = 1 P 3 = Continuing in this fashion, it should seem reasonable that, for any n = 1, 2, 3,..., =

Discrete Mathematics

Section 1.1 Real Numbers

CHAPTER II THE LIMIT OF A SEQUENCE OF NUMBERS DEFINITION OF THE NUMBER e.

Reading 13 : Finite State Automata and Regular Expressions

Georg Cantor ( ):

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: b + 90c = c + 10b

Sample Induction Proofs

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 3. Spaces with special properties

Chapter 11 Number Theory

Basic Concepts of Set Theory, Functions and Relations

Notes on Determinant

Special Situations in the Simplex Algorithm

Linear Algebra I. Ronald van Luijk, 2012

The Ideal Class Group

MATH Fundamental Mathematics IV

You know from calculus that functions play a fundamental role in mathematics.

Lecture 1: Systems of Linear Equations

MATH10040 Chapter 2: Prime and relatively prime numbers

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Logic in Computer Science: Logic Gates

Conditional Probability, Independence and Bayes Theorem Class 3, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Solutions of Linear Equations in One Variable

Quotient Rings and Field Extensions

Zeros of a Polynomial Function

Transcription:

Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing them, we will discuss properties that a relation may or may not have. These are defined only in terms of elements that must belong to the subset in certain situations. In situations like this where things are defined abstractly, it pays to learn to do a couple of things. The first is to always test the definitions and see what they mean, that is, to get a feeling for which things satisfy the definitions and which don t, and why. The second is to keep in mind a few concrete examples. These can be used when exploring what the definitions are saying. 3.1 Cartesian Products In the Cartesian plane (or x-y plane), we associate the set of points in the plane with the set of all ordered points (x, y), where x and y are both real numbers. The idea of a Cartesian product of sets replaces R in the description by some other set(s), and drops the geometric interpretation. If A and B are sets, the Cartesian product of A and B is the set A B = {(a, b) : (a A) and (b B)}. 1

2 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS The following points are worth special attention: The Cartesian product of two sets is a set. The elements of that set are ordered pairs. In each ordered pair, the first component is an element of A, and the second component is an element of B. The points in the x-y plane correspond to the elements of the set R R. For example, if A = {1, 2, 3} and B = {a, b}, then A B = {(1, a), (1, b), (2, a), (2, b), (3, a), (3, b)} and B A = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3)}. Suppose A has m elements and B has n elements. Then, each element of A is the first component of n ordered pairs in A B: one for each element of B. Thus the number of elements in A B equals m n, the number of elements in A times the number of elements in B. This is one way in which the symbol is suggestive notation for the Cartesian product. What should A be? By definition, it is the set of all ordered pairs (a, b) where a A and b. There are no such pairs, as there are no elements b. Hence A =. Similarly, B =. We says that two ordered pairs are equal if the first components are identical and so are the second components. That is, (a, b) = (c, d) if and only if a = c and b = d. This corresponds to (and generalizes) our idea of equality for ordered pairs of real numbers. The example above shows that A B B A in general. This leads to the question of when they are equal. Certainly they are equal if A = B because then A B = A A = B A. They are also equal when A = or B = because, then A B = = B A. We now show that these are the only possibilities where equality can hold. Proposition 3.1.1 Let A and B be sets. Then A B = B A if and only if A = B, or A =, or B =. Proof. ( ) We prove the contrapositive. Suppose A and B are non-empty sets such that A B. Then one of them has an element which does not belong to the other. Suppose first that there exists x A such that x B.

3.1. CARTESIAN PRODUCTS 3 Since B, the set A B has an ordered pair with first component x, whereas B A has no such ordered pair. Thus A B B A. The argument is similar in the other case, when there exists y B such that y A. ( ). If A = B then A B = A A = B A. If A =, then A B = = B A. The case where B = is similar. The set A (B C) is the set of all ordered pairs where the first component is an element of A, and the second component is an element of B C. That is, the second component is an element of B or an element of C. This is the same collection that would be obtained from the union (A B) (A C), which is made from the union of the set of all ordered pairs where the first component is an element of A and the second component is an element of B, and the set of all ordered pairs where the first component is an element of A, and the second component is an element of C. This is the outline of the proof of the following proposition. Proposition 3.1.2 Let A, B and C be sets. Then, A (B C) = (A B) (A C). Proof. (LHS RHS) Let (x, y) A (B C). Then x A and y (B C). That is, y B or y C. This leads to two cases. If y B, then (x, y) A B, and so (x, y) (A B) (A C). If y C, then (x, y) A C, and so (x, y) (A B) (A C). Therefore, A (B C) (A B) (A C). (RHS LHS) Let (x, y) (A B) (A C). Then (x, y) A B or (x, y) A C. This leads to two cases. If (x, y) A B, then x A and y B. Since y B, we have y B C, so (x, y) A (B C). If (x, y) A C, then x A and y C. Since y C, we have y B C, so (x, y) A (B C). Therefore, (A B) (A C) A (B C). The proposition above can also be proved using set builder notation and showing that the two sets are described by logically equivalent expressions. One hint that this is so is in the informal proof outline that precedes the proposition. Another one is in the proof of the proposition: the second part of the proof above is essentially the first part written from bottom to top. Each step is an equivalence rather than just an implication. The same methods can be used to prove the following similar statements:

4 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS A (B C) = (A B) (A C); (A B) C = (A C) (B C); (A B) C = (A C) (B C). It is a good exercise to investigate, then prove or disprove as appropriate, similar statements involving the Cartesian product and operations like set difference, A \ B, and symmetric difference, A B. 3.2 Relations Suppose A is the set of all students registered at UVic this term, and B is the set of all courses offered at UVic this term. Then A B is the set of all ordered pairs (s, c), where s is a student registered at UVic this term, and c is a course offered at UVic this term. The set A B represents all possible registrations by a current student in a current course. Certain subsets of A B may be of interest, for example the subset consisting of the pairs where the course is in Science and the student is actually registered in the course, or the subset consisting of the pairs where completion of the course would make the student eligible to receive a degree from the Faculty of Fine Arts. The idea is that relationships between the elements of A and the elements of B can be represented by subsets of A B. A binary relation from a set A to a set B is a subset R A B. A binary relation on a set A is a subset of R A A. The word binary arises because the relation contains pairs of objects. Ternary relations (on A, say) would contain triples of elements, quaternary relations would contain quadruples of elements, and in general n-are relations would contain ordered n-tuples of elements. We will only consider binary relations, so we will drop the adjective binary. When we talk about relations, we mean binary relations. We will focus almost exclusively on relations on a set A. A relation may or may not express a particular type of relationship between its elements. The definition says that a relation is simply a subset. Any subset. It could be that the only relationship between x and y is that

3.3. PROPERTIES OF RELATIONS 5 the pair (x, y) belongs to the subset. Subsets like R 1 = and R 2 = A A are perfectly good relations on A. On the other hand, familiar things can be seen as relations. As a sample: Equality between integers is represented by the relation R on Z where (x, y) Z if and only if x = y. Strict inequality between real numbers is represented by the relation S on R where (x, y) S if and only if x > y. The property of being a subset is represented by the relation C on P(U) where (X, Y ) C if and only if X Y. Logical implication between statements p and q is represented by the relation I on the set of all statements (say involving a certain set of Boolean variables) where (p, q) I if and only if p q. Because of these examples, and many others like them involving common mathematical symbols (that express particular relationships), infix notation is used: sometimes we write xry instead of (x, y) R, and say that x is related to y (under R). 3.3 Properties of Relations The relation = on the set of real numbers has the following properties: Every number is equal to itself. If x is equal to y, then y is equal to x. Numbers that are equal to the same number are equal to each other. That is, if x = y and y = z, then x = z. The relation on the set of all propositions (in a finite number of variables) has properties that look strongly similar to these. Every proposition is logically equivalent to itself.

6 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS If p is logically to q, then q is logically equivalent to p. Propositions that are logically equivalent to the same proposition are logically equivalent to each other to each other. That is, if p q and q r, then p r. Similarly, the relation on the set of real numbers has the following properties: x x for every x R. If x y and y x, then x = y. If x y and y z, then x z. The relation on the the power set of a set S has similar properties: X X for every X P(S). If X Y and Y X, then X = Y. If X Y and Y Z, then X Z. The relation on the set of all propositions (in a finite number of variables) looks to have the same properties as the previous two, so long as we accept playing the role of =. There is, however, something subtle and beyond the scope of this discussion, going on in the second bullet point because we use instead of =. p p for every proposition x. If p q and q p, then p q. If p q and q r, then p r. It may or may not be clear that the first bullet point in each of the five collections describes the same abstract property. And the same for the third bullet point. The middle bullet point describes the same abstract property in the first two collections and in the first two of the last three, but these two properties are fundamentally different.

3.3. PROPERTIES OF RELATIONS 7 The first property in the five collections above is reflexivity. The dictionary defines reflexive as meaning directed back on itself. In a relation, we interpret that as meaning every element is related to itself. Thus, each of the relations described above is reflexive. The second property in the first two collections, but not the last three, is symmetry : if x is related to y, then y is related to x. The third property in all five collections is transitivity : if x is related to y, and y is related to z, then x is related to z. The second property in collection three and four is anti-symmetry : if x is related to y and y is related to x, then x is the same as y. Later, we will see that being anti-symmetric is very different from being not symmetric. We will also get a hint of the origin of the (unfortunate) term anti-symmetric. Formal definitions of these properties follow. It is important to realize that each of these is a property that a particular relation might, or might not, have. A relation R on a set A is: reflexive if (x, x) R for every x A. (Written in infix notation, the condition is xrx for every x A.) symmetric if (y, x) R whenever (x, y) R, for all x, y A. (Written in infix notation, the condition is if xry then yrx, for all x, y A.) transitive if (x, z) R whenever (x, y), (y, z) R, for all x, y, z A. (Written in infix notation, the condition is if xry and yrz, then xrz, for all x, y, z A.) anti-symmetric if x = y whenever (x, y) R and (y, x) R, for all x, y A. (Written in infix notation, the condition is if xry and yrx, then x = y, for all x, y A.) Why are we doing this? Relations that are reflexive, symmetric and transitive behave a lot like equals : they partition the set A into disjoint collections of elements that are the same (equivalent) with respect to whatever property

8 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS is used to define the relation. These are called equivalence relations. Relations that are that reflexive, anti-symmetric and transitive behave a lot like less than or equal to in the sense that they imply an ordering of some of the elements of A. To interpret this for the subset relation, think of X Y as reading X precedes or equals Y (there are some pairs of sets for which neither precedes or equals the other). These are called partial orders. What follows are six examples of determining whether or not a relation has the properties defined above. Consider the relation R 1 = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1), (2, 3)} on the set A = {1, 2, 3}. R 1 is reflexive: A = {1, 2, 3} and (1, 1), (2, 2), (3, 3) R 1. R 1 is not symmetric: (2, 3) R 1 but (3, 2) R 1. R 1 is not anti-symmetric: (1, 2), (2, 1) R 1 but 1 2. R 1 is not transitive: (1, 2), (2, 3) R 1 but (1, 3) R 1. The definition says that a relation is symmetric if, whenever a pair (x, y) is in the relation, so is its reversal (y, x). This means that when x y, either both of (x, y) and (y, x) are in the relation, or neither are. The definition says that a relation is anti-symmetric if, when x y, we never have both of (x, y) and (y, x) in the relation. (The definition is phrased in a way that makes it easy to use in proofs.) This means that x y, either (x, y) is in the relation and (y, x) is not in it, or (y, x) is in the relation and (x, y) is not in it, or neither pair is in it. The only possibility that is not permitted to arise in an anti-symmetric relation is for it to contain both (x, y) and (y, x), where x y. (There is no pair of different elements which are related in a symmetric way.) It is possible for a relation to be both symmetric and anti-symmetric, for example A = {(1, 1), (2, 2)} on the set {1, 2, 3}. The relation R 1 above shows that it is also possible for a relation to be neither symmetric nor antisymmetric. Consider the relation R 2 = on any non-empty set A. R 2 is not reflexive. Since A, there exists x A. The ordered pair (x, x) R 2.

3.3. PROPERTIES OF RELATIONS 9 R 2 is symmetric. The implication if (x, y) R 2, then (y, x) R 2 is true because its hypothesis is always false. R 2 is anti-symmetric. The implication if (x, y), (y, x) R 2, then x = y is true because its hypothesis is always false. R 2 is transitive. The implication if (x, y), (y, z) R 2, then (x, z) R 2 is true because its hypothesis is always false. If A =, then what above changes slightly because R 2 is reflexive. Can you explain why? Let R 3 be the subset relation on P(S), the set of all subsets of S = {1, 2, 3, 4}, that is, (X, Y ) R 3 if and only X Y. R 3 is reflexive because X X for every X S (for every X P(S)). R 2 is not symmetric: (, {1}) R 3 because {1} but ({1}, ) R 3 because {1}. R 3 is anti-symmetric. Suppose (X, Y ), (Y, X) R 3. Then X Y and Y X. We proved before that this means X = Y. R 3 is transitive. Suppose (X, Y ), (Y, Z) R 3. Then X Y and Y Z. We proved before that this means X Z, that is (X, Z) R 3. If S =, then what above changes slightly because R 3 is symmetric. Can you explain why? Let R 4 be the relation on N defined by (m, n) R 4 if and only if m n is even. R 4 is reflexive. Let k N. Then k k = 0. Since 0 is even, (k, k) R 4. R 4 is symmetric. Suppose (m, n) R 4. Then m n is even. Since n m = (m n), and the negative of an even number is even, (n, m) R 4. R 4 not anti-symmetric: (1, 3), (3, 1) R 4 but 1 3. R 4 is transitive. Suppose (k, m), (m, n) R 4. Then k m is even, and m n is even. Hence, (k m) + (m n) = k n is even it is the sum of two even numbers. Therefore (k, n) R 4.

10 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS Let A be a set with at least two elements, and let R 5 be the relation A A on A. R 5 is reflexive. It contains all possible ordered pairs of elements of A, so it contains (x, x) for every x A. R 5 is symmetric. It contains all possible ordered pairs of elements of A, so it contains (y, x) whenever it contains (x, y). R 5 not anti-symmetric: since A has at least two elements, there exist a, b A such that a b. Since (a, b), (b, a) A A, the statement follows. R 5 is transitive. It contains all possible ordered pairs of elements of A, so it contains (x, z) whenever it contains (x, y) and (y, z). If A has at most one element, then the above changes. In that case, R 5 is anti-symmetric. Can you explain why? Finally, let R 6 be the relation on Z Z defined by (a, b)r 6 (c, d) if and only if a c and b d. Notice that, here, it is pairs of elements that are being related (to each other) under R 6, so technically R 6 is an set of ordered pairs, of which the components are ordered pairs. The infix notation (a, b)r 6 (c, d) is far less cumbersome that writing ((a, b), (c, d)) R 6. R 6 is reflexive. Let (a, b) Z Z. Since a a and b b, we have (a, b)r 6 (a, b). R 6 is not symmetric: (1, 2)R 6 (3, 4) but (3, 4)R 6 (1, 2). R 6 is anti-symmetric. Suppose (a, b)r 6 (c, d) and (c, d)r 6 (a, b). Then a c and b d, and c a and d b. Therefore a = c and b = d, so that (a, b) = (c, d). R 6 is transitive. Suppose (a, b)r 6 (c, d) and (c, d)r 6 (e, f). We want (a, b)r 6 (e, f). Since (a, b)r 6 (c, d), a c and b d. Since (c, d)r 6 (e, f), c e and d f. Therefore a e and b f, so that (a, b)r 6 (e, f). We close this section with a different sort of example. Suppose R is a relation on {1, 2, 3, 4} that is symmetric and transitive. Suppose also that (1, 2), (2, 3), (1, 4) R. What else must be in R?

3.3. PROPERTIES OF RELATIONS 11 Since R is symmetric, we must have (2, 1), (3, 2), (4, 1) R. Since R is transitive and (1, 2), (2, 1) R, we must have (1, 1) R. Similarly (2, 2), (3, 3), (4, 4) R. Since (1, 2), (2, 3) R, transitivity implies (1, 3) R. Symmetry gives (3, 1) R. Let s summarize what we have done so far in an array. The rows and columns are indexed by {1, 2, 3, 4}, and the entry in row i and column j is the truth value of the statement (i, j) R (that is, it is 1 if the pair (i, j) R and 0 otherwise. 1 1 1 1 1 1 1 0 1 1 1 0 1 0 0 1 Notice that the array is symmetric (in the matrix-theoretic sense): the (i, j)- entry equals the (j, i)-entry. Must (2, 4) be in R? We have (2, 1), (1, 4) R, so (2, 4) R. Thus (4, 2) R by symmetry. What about (3, 4)? We have (3, 1), (1, 4) R, so again the answer is (3, 4) R. Thus (4, 3) R. Therefore R = A A. An array of the type in the previous example rows and columns indexed by elements of A and (i, j)-entry the truth value of the statement (i, j) R denotes a reflexive relation when every entry on the main diagonal equals 1; symmetric relation when it is symmetric about the main diagonal: the (i, j)-entry equals the (j, i)-entry. anti-symmetric relation when there is no i j such that the (i, j)-entry and the (j, i)-entry are both equal to 1. (Entries on the main diagonal don t matter, and it acceptable for the (i, j)-entry and the (j, i)-entry to both equal 0.) It is not easily possible to look at the array and see if the relation is transitive. All of the possibilities need to be checked.

12 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS 3.4 Equivalence Relations An equivalence relation on a set A is a relation on A that is reflexive; symmetric; and transitive Relations with these three properties are similar to =. Suppose R is an equivalence relation on A. Instead of saying (x, y) R or x is related to y under R, for the sake of this discussion let s say x is the same as y. The reflexive property then says everything in A is the same as itself. The symmetric property says if x is the same as y, then y is the same as x. And the transitive property says things that are both the same as the same element are the same as each other. Another translation of these statements arises from replacing is the same as by is equivalent to. The following are examples of equivalence relations: logical equivalence on the set of all propositions; the relation R on Z defined by xry if and only if x y is even; the relation T on {0, 1,..., 24} defined by h 1 T h 2 if any only if h 1 hours is the same time as h 2 hours on a 12-hour clock; the relation S on the set of all computer programs defined by p 1 Sp 2 if and only if p 1 computes the same function at p 2 ; the relation E on the set of all algebraic expressions in x defined by p(x) E q(x) if and only if p(x) = q(x) for every real number x. For example, if p(x) = x 2 1 and q(x) = (x + 1)(x 1), then p(x) E q(x). It is a useful exercise to prove that each of these is an equivalence relation. Every equivalence relation carves up (mathematicians would say partitions ) the underlying set into collections (sets) of equivalent things (things that are the same ), where the meaning of equivalent depends on the definition of the relation. In the examples above:

3.4. EQUIVALENCE RELATIONS 13 logical equivalence partitions the universe of all statements into collections of statements that mean the same thing, and hence can be freely substituted for each other; R partitions the integers into the even integers and the odd integers; T partitions {0, 1,..., 24} into collections of hours that represent the same time on a 12-hour clock; S partitions the set of all computer programs into collections that do the same thing; E partitions the set of all algebraic expressions into collections that give the same numerical value for every real number x, and hence can be freely substituted for each other when manipulating equations. Each of these collections of equivalent things is an example of what is called an equivalence class. Let R be an equivalence relation on A, and x A. The equivalence class of x is the set [x] = {y : yrx}. Let A be a set. A partition of A is a collection of disjoint, non-empty subsets whose union is A. That is, it is a set of subsets of A such that the empty set is not in the collection; and every element of A belongs to exactly one set in the collection. Each set in the collection is called a cell, or block, or element of the partition. A: For example, if A = {a, b, c, d, e}, then the following are all partitions of {{a}, {b, e}, {c, d}}; {A}; {{a, c, e}, {b, d}}; {{a}, {b}, {c}, {d}, {e}}. None of the following are partitions of A:

14 CHAPTER 3. CARTESIAN PRODUCTS AND RELATIONS {{a}, {b, e}, {c, d}, }; {{a, c, e}, {d}}; {{a}, {b}, {c}, {a, d}, {e}}; {a}, {b}, {c}, {d}, {e}. The last example of something that isn t a partition is slippery. It isn t a set, hence it can t be a partition. But this is just a technicality mathematicians frequently write partitions in this way. The point of this example was to make sure you re aware of what happens sometimes, and what is intended. That equivalence relations and partitions are actually two sides of the same coin is the main consequence of the two theorems below. The first theorem says that the collection of equivalence classes is a partition of A (which is consistent with what we observed above). The second theorem says that for any possible partition of A there is an equivalence relation for which the subsets in the collection are exactly the equivalence classes. Theorem 3.4.1 Let R be an equivalence relation on A. Then 1. x [x]; 2. if xry then [x] = [y]; and 3. if x is not related to y under R, then [x] [y] =. Proof. The first statement follows because R is reflexive. To see the second statement, suppose xry. If z [x] then (by definition of equivalence classes) zrx. By transitivity, zry. That is z [y]. Therefore [x] [y]. A similar argument proves that [y] [x], so that [x] = [y]. To see the third statement, we proceed by contradiction. Suppose x is not related to y under R, but [x] [y]. Let z [x] [y]. Then zrx and zry. By symmetry, xrz. And then by transitivity, xry, a contradiction. Therefore, [x] [y] =. Part 1 of the above theorem says that the equivalence classes are all nonempty, and parts 2 and 3 together say that every element of X belongs to exactly one equivalence class. Parts 2 and 3 also tell you how to determine

3.4. EQUIVALENCE RELATIONS 15 if two equivalence classes are the same: [x] = [y] if and only if x is related to y (equivalently, since R is symmetric, y is related to x). For example, suppose R is the relation on R defined by xry if and only if x rounds to the same integer as y. Then R is an equivalence relation (exercise: prove it). The partition of R induced by R is {[n 0.5, n + 0.5) : n Z}, where each half-open interval [n 0.5, n + 0.5) = {x : n + 0.5 x < n + 0.5}. Among [1], [ 2], [ 3], [2], [e], [π] there are exactly three different equivalence classes because [1] = [ 2]; [ 3] = [2], and [e] = [π]. Theorem 3.4.2 Let Π = {X 1, X 2,..., X t } be a partition of a set A. Then the relation R on A defined by xry if and only if x belongs to the same cell of Π as y is an equivalence relation; and Π is the partition of A induced by the set of equivalence classes of R. Proof. The argument that shows R is an equivalence relation is left as an exercise. We argue that Π is the partition of A induced by the set of equivalence classes of R. That is, it must be shown that, for any x A, the equivalence class of x equals the cell of the partition that contains x. Take any x A, and suppose x X i. We need to show that [x] = X i. On the one hand, if y X i then yrx by definition of R. Hence, y [x]. Therefore, X i [x]. On the other hand, if y [x] then yrx. By definition of R, the element y belongs to the same cell of Π as x. That is, y X i. Therefore [x] X i. It now follows that [x] = X i. For example, suppose we want an equivalence relation F on [0, ) for which the partition of R induced by F is {[n, n+1) : n N {0}}. According to the theorem statement, we define xfy if and only if there exists n N {0} such that x, y [n, n + 1). Looking at the definition of F we see that xfy if and only if the integer part of x (the part before the decimal point) is the same as the integer part of y, or equivalently that the greatest integer less than or equal to x (commonly known as the floor of x and denoted x ) is the same as the greatest integer less than or equal to y. In symbols xfy x = y.