 One important topic in higher mathematics is known as equivalence relations and equivalence classes, so we'll introduce both of those here. So, to begin with, I can talk about what's called a binary relation, and the idea is I have two objects, and I want to some way of comparing them. So, for example, if I have two numbers, A and B, we might have something like this binary relation, which says that A and B have some sort of relationship to each other. Or maybe I have this symbol, and again the idea is that A and B have a specific type of relationship to each other. Now, this symbol and this symbol have very specific meanings that everybody understands, but maybe I need a new type of relation between the two things. So, I'll invent a new symbol, squiggle, A squiggle B, and because nobody knows what this means, I do have to clarify when I can write down A squiggle B, and maybe it's that I can write this whenever A minus B is an even number, and so here's a new binary relation. And so, I can invent binary relations that happen to do whatever purpose I have in mind. So, just because you can invent something doesn't necessarily mean it's useful, the most useful of these binary relations are those that are called equivalence relations. And they are defined as follows. An equivalence relation is a binary relation, and we need three key properties. One is that it has to be reflexive. Something has to be related to itself. It's also nice if our binary relation is symmetric. A related to B implies that B is related to A. I can reverse the order of the term. Similarly, if our binary relation happens to be transitive, well, that's a great big bonus. It tells me that if A is related to B and B is related to C, I can drop out the middle man and I have A related to C. And if my binary relation is reflexive, symmetric, and transitive, it gets promoted to what's called an equivalence relation. So, for example, let's consider the set of integers once again, and we have two binary relations. This one we read as our ordinary equals. This one we read as our ordinary greater than or equal. And let's see which of these two is an equivalence relation. Now, remember, as a mathematical question, that could mean that both are equivalence relations. One of them is an equivalence relation, or maybe neither is an equivalence relation. So, we will have to check out both of them. So, I'm going to take a bunch of things in our set of integers and check out our three required properties. So, for equals, for A equal to A. Yeah, I'll buy that. That seems like our relation satisfies reflexivity. A equals B implies B equals A. Yeah, I agree with that. That sounds good. And let's see, transitive A equals B, B equals C. Can I drop out the middle man? A equals C. Thinking, thinking. Yeah, I think I agree with all of these things. So, this equals is reflexive, symmetric, and transitive, so we get to call it an equivalence relation. Well, how about the other one? So again, I'm going to take a bunch of things in our set Z, and I'll check out is this greater than or equal to reflexive. Is it true that A is greater than or equal to A? Yeah, okay, that sounds good. I like that. How about symmetric A greater than or equal to B implies B is great. Wait a minute, I don't believe that's true. So, that does not work. Greater than or equal to fail symmetry. And because of that, it cannot be called an equivalence relation. Now, what makes equivalence relations so useful is that when I have an equivalence relation, I can produce what's called an equivalence class. And these equivalence classes emerge as follows. What I'm going to do is I'm going to take an element in our set, and I'm going to form the equivalence class of that element by finding everything in the set that is equivalent to our element. And one bit of grammar here, we might say that the equivalence class induces a set of equivalence classes that forms a partition of our set. Now, it should be fairly easy to prove. You should prove them. In other words, the following. If I have something in an equivalence class, then the equivalence class of that something is the same as the equivalence class that it's in. One of two things also happens. Either two equivalence classes are identical or they are completely disjoint. They have nothing in common. This is why they actually form that partition. So both of these should be relatively easy to prove, and you should take the time to prove them as they do remind us about some of the key properties of what an equivalence relation is. For example, let's take a look at this. So I have two things, and these are ordered pairs in N to the set of natural numbers, and I'll define my equivalence relation as follows. AB is equivalent to CD whenever A plus D, the sum of the outer terms, is equal to B plus C, the sum of the inner terms. Now, remember, all of these are in the set of natural numbers, so plus makes sense in the set of natural numbers. And let's see if we can find three distinct equivalence classes and then find a simpler description of the corresponding sets. So that is an equivalence relation. Are you sure about that? Because if it's not an equivalence relation, equivalence classes don't exist, and you'll waste a lot of time looking for the snark. So we can create an equivalence class by choosing an element of N2. So I'll pick one. How about 5, 3? So here I've chosen an element of N2, 5, 3, and it produces the equivalence class, square brackets, around that element. So this is our shorthand notation for the entire equivalence class produced by the element 5, 3. Let's see. Well, I want to produce three distinct equivalence classes, so I'll pick another element. How about 2, 1? So this element 2, 1 corresponds to the equivalence class 2, 1. By 2, I have to make sure that these two equivalence classes are not the same thing. And finally, 3, 2 corresponds to this equivalence class 3, 2. And let's do a quick check here. The next thing that we do notice here is 3, 2, and 2, 1 are equivalent. Remember, they are equivalent whenever the sum of the outer terms is equal to the sum of the inner terms. So 3 plus 1 is 4, 2 plus 2 is 4. These two terms are equivalent. So this has to be in the equivalence class formed by 2, 1, which means that the equivalence class formed by 3, 2 is the same as the equivalence class formed by 2, 1. These are not distinct equivalence classes, so I don't need the second one. What else can I do? Well, I'll pick something else. So the element 1, 1 corresponds to the equivalence class 1, 1. And you should verify that these are actually three distinct equivalence classes. This is not in either of the other two. This is not in either of the other two, and so on. Now, let's consider any of those equivalence classes. We do want to see if we can find a simple description of the corresponding sets. For example, let's take 5, 3. Now, again, our definition, 5, 3, is the equivalence class where we're looking at the things that are equivalent to 5, 3, where x and y are drawn from the set of natural numbers. Now, 2 ordered pairs are equivalent whenever the outer sum is equal to the inner sum. So that's x plus 3 is equal to y plus 5. And maybe I can rewrite that. This is x minus y equals 2. So I could rewrite this equivalence class, 5, 3, to be the set of ordered pairs where the difference is 2, x and y are in the set of natural numbers. Now, you might ask, well, why didn't we just start with this? Why didn't we just start with this and not go through all of this tedium here about talking about equivalence classes? The answer to that is here with this equivalence relation defined, I'm doing things that I can do with any natural numbers that I want. Given any two natural numbers, I can add them, I can add them, and then I can compare them. The reason we didn't start with this is that here, this x minus y, I can't always subtract two natural numbers. I can't subtract 1 minus 7, for example. I'll have to introduce something new for that. And if we're trying to build up our mathematics rigorously, we do have to be careful that we don't leave the yard. So here, my yard is the set of natural numbers. I want to make sure that everything I do can be done within the confines of the set of natural numbers. So this makes sense to us, but that's only because we've learned a lot of mathematics. We've developed a lot of mathematics. At a higher level, we do want to be careful that what we're defining isn't something beyond what we're allowed to define.