 Welcome back to our lecture series, Math 3120, Transition to Advanced Mathematics for Students at Southern Utah University. As usual, I'll be your professor today, Dr. Andrew Seldine. And so in this, the first lecture video for lesson 26, we're going to introduce the notion of an equivalence relation. Now, just as a reminder, in our previous lesson, we learned about a partial order, which is one way of trying to quantify comparison. Relations are all about comparison. The relations are the mathematical ways of comparing different types of quantities. Partial orders give us a way of measuring when one object is larger than another, at least some of the times. Equivalence relations, which is probably the most popular relation other than functions themselves, that we would study in this lecture series. An equivalence relation is trying to measure when something is the same. Equivalence relations, as the name suggests, tries to measure sameness, when something is the same. And so let's be explicit in this definition. All right, so an equivalence relation, first and foremost, it is a relation. So we have some set x, we'll call little squiggle there, little twilda, a tilde, is an equivalence relation. So if it's, first of all, a relation, so it'll be a subset of the Cartesian product x cross x. And much like a partial order, it satisfies three axioms. The first axiom is the reflexive property, so that with an equivalence relation, every element is related to itself. So for all x and x, we have x is related to x. We also will have the symmetric property. This is where we disagree with the partial order. Partial orders, we said were reflexive, anti-symmetric, and transitive for a equivalence relation. Instead, we take it to be reflexive, symmetric, and transitive. So in particular, the second axiom, we replace the anti-symmetry with symmetry, and that gives us an equivalence relation. So symmetry, remember, says that if x is related to y, then y is related to x. The direction of the relation is always reversible. And then the transitive axiom, as I remember there, the transitive property says that if x is related to y and y is related to z, then you're going to get that x is related to z. And this gives us an equivalence relation. Now, when it comes to an equivalence relation, we typically take a symbol that in some way or manner resembles an equal sign. So equal sign, I should mention, is the golden standard for an equivalence relation. If two things are equal to each other, they should be the same in all important aspects. Equivalence relations are really the generalization of equality. So this will include things like, you could talk about congruence inside of a geometry. So we could say that two triangles are congruent to each other. That doesn't mean they're equal as triangles. They're not the same triangle, but something about them is the same. Because they're the same in that they have the same angle measures. They have the side measures the same, but they're not the same triangle. They're different places in the plane potentially. And so lots of symbols you could use would be things like the following. Again, these are all examples of symbols that kind of look like equivalence relations, some modification of the equal sign. And so for us, our generic equivalence symbol will be this one. Just so you're wearing latex, this is backslash sim. It's short for similar. And so it's like a symbol. It's like the two objects are similar in some manner, because that's when equivalence relation measures, as opposed to like a partial order, which measures what things are bigger than another. Equivalence is measuring similarity. Now with regard to any equivalence relation, which to show that something that equivalence relation, you check these three properties, it's reflexive, symmetric, and transitive. We'll do some examples of that as well. Let me also introduce another important vocabulary term with regard to equivalence relations. If we have an element X inside of the set X for which this equivalence relation is established, then for that element X, we can define the set, which is typically for us can be denoted bracket X bracket. This set right here is going to be the set of all elements in X that are related to X. So we're gathering everything that's related to X inside of this equivalence relation. This set right here X bracket here, this is called the equivalence class of X. And it represents everything that is equivalent to X inside of the set there. Some things to notice, of course, is that this set is non-empty. X itself belongs to the set because it's a reflexive property. So we get that X is related to X. And so there's always something in these equivalence classes. And we also will see in the future that you can potentially have different elements representing the same equivalence class. This happens if and only if X is related to Y. Again, we'll talk about this another time, a little bit more details here. And so this element is often referred to as the representative of the equivalence class. Because it turns out there's more than one way to represent the equivalence class, but I get a little ahead of myself here. Let's look at some examples of equivalence classes. So we have a better grasp of what's going on here. So one very simple equivalence class is the parity relation. So take the integers Z. So this includes positive, negative, and zero integers. And we could define a relation similar on N and M, which would mean that N is related to M if they have the same parity. This forms an equivalence relation. Now let's see why this parity relation is, in fact, an equivalence relation. We have the first show it's reflexive. So why is it the case that N is related to N? Well, you have two cases. If N is even, so it equals 2k, then that also means that N is even. So if N is even, so is N, so they have the same parity. Conversely, if N is odd, then N is odd. And so in either case, N has the same parity as N. So it's a reflexive relation. What if we take something like N is related to M? So if that happens, well, again, there's two cases. If N has the same parity as M, and if M is even, then that means that N is even because it has the same parity. And that would imply that M is related to N since M has the same parity as N. And in the other case, of course, if M is odd, since N has the same parity as M, that means that N is likewise odd. And therefore, that would imply that since M and N are both odd, that M has the same parity as N. There we go. So you get the symmetric property. Let's now suppose that N is related to M, and we have M is related to, say, k. In that situation, again, we have a couple possibilities. If k is even, then since M has the same parity, that means M is even. Now, since N has the same parity as M, that means N is even. All right? In which case that would imply that N has the same parity as k because they're both even numbers. And you can see where this is going for the second case. If k was an odd number, I guess I can't call it 2k anymore. I just realized I used k over here. Whoops, should have called it something different. But you can see where we're going to call it l this time. I'll fix it. If you have like 2k equals 2l, it's an odd number. Well, then M will likewise be an odd number. And then N will be an odd number. And so we see that k and N have the same parity in the same way. So this is a very trivial argument here. But it's important to establish that this parity relation is an equivalence relation. There's something the same about these numbers. Now, with regard to this relation, there's only going to be two equivalence classes. There's the equivalence class involving odd numbers. So you can represent the odd numbers using the number one here. This would be the collection of all numbers of the form 2k plus one, where k is an arbitrary integer. That's the first equivalence class. The second equivalence class you could represent using the number two. In which case this would be the set of all numbers of the form 2k as k is allowed to range over any integer like so. This is in the collection of even numbers. For the parity relation, there's just these two equivalence classes. But in terms of representatives, you could represent the even numbers with any even number you want. Because if you have the same parity as 2, then you also have the same parity as 4, which you also have the same parity as 6. Any one of the even numbers could represent the class of even numbers and any of the odd numbers could represent the class of odd numbers as well. All right, let's look at the second example that's here on the page. This one's a little bit more involved, but it's really not much more difficult. I will introduce a new symbol here. We know that this right here is the set of real numbers. So we're going to take r bracket x to denote the set of all polynomials with real coefficients. This is terminology, this notation I should say that's borrowed from abstract algebra. So just so you're aware, what this thing looks like is that you're taking the collection of things that look like a0 plus a1x plus a2x squared all the way up to anx to the n, for which all of these, the number n itself is a natural number, including 0. And all of these a's is considered real numbers. So we're taking the collection of all polynomials where n is allowed to vary and the coefficients are allowed to vary as well. So this would include things like, oh, we could say that x squared plus 1 belongs to our set. That would be acceptable. We could take 7x cubed minus 3x squared plus pi x minus the square root of 2. This would also be a polynomial in there. I mean, don't get me wrong, this last one would be like a math 1050 students nightmare. Oh, those poor college algebra students. But nonetheless, this is an example of a polynomial with real coefficients. So that's the set we're describing right here, this r sub x. On the set r sub x, we can define a relation where we say that two polynomials are related to each other if f has the same degree as g. Now remember, the degree of a polynomial is the largest power of the variable x with a non-zero coefficient. So x squared plus 1, this is a polynomial of degree 2. x cubed plus x squared plus 7x minus 5, whatever that would be, degree 3 polynomial. Again, we're just looking for the largest exponent which has a non-zero coefficient. It's the power of the leading term, as you probably remember from previous algebra classes there. I claim that the relation of degrees on the set of polynomials is an equivalence relation. So we have to first convince ourselves that f is related to f. So if a polynomial has a degree called n, then f will have the degree n and so they have the same degree. So this is a reflexive relation here. Now if f is related to g, then we could say that, okay, f has the same degree as g. If the degree of g is n, that means f has degree g, which then means a degree n, excuse me. And then that means that g whose degree is n will be the same as f. So it's a symmetric relation. What about transitivity? So if f of x is related to g of x and if g of x is related to h of x, this means that f has the same degree as g and g has the same degree as h. Well, if the degree of h is n, that means the degree of g will likewise be n. And the degree of f will likewise be n. f and h then have the same degree because it's n. So then we can conclude that f of x is related to h of x, and this then proves the transitivity property, the transitive property. So we then have established, of course, that this is, in fact, an equivalence relation. Whenever we have an equivalence relation, we're often concerned with what are the equivalence classes. Now, it turns out the equivalence classes of this relation, you can take as representatives the monomials x to the n, where n can range over all natural numbers. This does include zero, of course, because you take x to the zero, this will give you the constant polynomials. So this right here would be the set of all polynomials of the form a0 plus a1x, all the way up to anx to the n, where the ai's belong to the r. Now, so that you don't confuse this with the set we were talking about beforehand, this is not rx here, this set, because in rx, the degree n is allowed to vary over any possible natural number. But in the case of this equivalence class, n is a fixed number, and you're just allowing your polynomials coefficients to change, but the power is always the same in each and every one of these. So there's going to be a class for the constant polynomials, there's a class for the linear polynomials, a degree one, there's a class for the quadratic polynomials, degree two, there's a class for the cubic polynomials, degree three, as well as quartic polynomials, and quintic polynomials, and all of the other ones we can keep on going. So for each natural number, that gives you a class of polynomials, and that polynomial degree will then be exactly the n that gives us the equivalence class right there, that's the representative. xn is sort of a very nice, simple representative for the entire class, because it has that information about the degree right there. All right, let's look at two more examples of equivalence relations with their classes. These ones are going to be a little bit more involved, and unlike the previous two, we're going to be a little bit more detailed in our proofs that these, in fact, are equivalence relations. Okay, so let's consider the set x, which is the set of ordered pairs, a comma b, where a and b are integers such that b is not zero. So be aware, this is a subset of z cross z, like so, but we allow for every possible pairing, except for that the second coordinate here cannot be zero. So it's not equal to z cross z, but it's most of z cross z in that situation. So x, that's our set, our set is itself ordered pairs of integers, and we're going to define a relation on this set x, such that the ordered pair, a comma b, is related to c comma d, such that, well, this happens if and only if the product a times d is equal to b times c. So notice that a is the first number of the first pair, and d is the last number of the last pair, while b is the last number of the first pair, and c is the first number of the last pair there. So you look at the product a times d versus b times c. If those two products are equal, then we say that these ordered pairs are equivalent. Now let's go through the details here. We have to check the reflexive property. We want to show that an ordered pair is related to itself. Now note by this formula, if they were the case, like if we were working this thing backwards, we're like, okay, if a comma b was related to a comma b, then that would mean that a times b, this one right here, is equal to b times a, this one right here, which of course, this is the case, because that's just the commutative property of multiplication. So note, so this is our scratch work over here, right? We don't show this to anyone. It's a secret, keep it secret, keep it safe. No, what we do is we actually turn the argument around. It's like, note that ab equals ba, and since ab equals ba, that means the pair ab is similar to the pair ab. So this relation does satisfy the reflexive property. We have a reflexive relation. Now we're going to check for symmetry. In my experience, these arguments kind of go on the difficulty they're listed for equivalence relations. Reflexive is usually pretty simple. Transitive is one of the hardest ones. Symmetry is usually about the middle. This was opposite when it came to the partial order, anti-symmetry was generally the hardest one to prove there. Symmetry is usually not so bad. Let's see what it would look like. With a symmetry argument, if you're going to prove symmetry, you're proving it conditional, you assume that an object is related to another object, and then you have to prove that the reverse direction also is a relation. So you assume if ab is related to cd. So you make that assumption. Then let's unravel the definition. If ab is related to cd, that means that the product ad is equal to the product bc. Now you want to finish with cd is related to ab. So you think about, okay, again, this is the scratch work you do over here that no one sees this one. You throw this napkin away when you're done. If cd were related to ab, what would I be looking for? I would want it then to be that cb is equal to da. Now if you of course relate that to the equation we have before, it's like, okay, well equality is a symmetric relation. So cb is equal to da. That means da equals cb. And we also have that multiplication is commutative. So I can flip these things around ad is equal to bc. So by properties of multiplication and equality, we actually get exactly what we want. So we're turning to the original proof here. If ab is related to cd, that means that ad equals bc. This implies that cb equals da. I didn't justify the steps there because I feel like the audience probably knows those properties. And therefore, since cb equals da, that means that cd is related to ab. This then shows that this is a symmetric relation. So next we have to check the transitive property. All right, so with transitive, this is also a conditional statement, an if then statement. The only difference now is that for the transitive property, your premise is double. There's two statements. It's an and statement. You assume that ab is related to cd and you assume that cd is related to ef. This just gives us extra assumptions. So if ab is related to cd, that means that ad equals bc. That's the definition of this relation. Now if cd is related to ef, then that means that cf is equal to de. That's again how this relation works. Now our goal is we want to show that ab is related to ef. If you unravel the definition there, we need to show that af equals be. So I need to get af on one side of an equation. I needed be to get one side of the equation. I have an equation involves a and b. I have an equation involves c and f. I don't care about c. I'm sorry. The equation involves f and e. cd basically, I don't care about those. But that actually helps us with the connection. D is involved in both equations. C is involved in both equations. So that's how we're going to try to connect these things together. I'm going to take this equation right here and I'm going to multiply both sides of the equation by f. So on the left hand side, we're going to get adf. On the right hand side, we're going to get bcf. But here's how the second equation comes into play here. Cf is the same thing as de. So we make that substitution and so then we have that adf is equal to bdf. And so that's how c plays its role. c is now out of the equation because of that substitution. Now we have this d. But notice how both sides of the equations are d. And there's also a hypothesis we haven't used yet. Remember in describing the set x, we're taking the set of all ordered pairs a, b such that a, b are integers. But what was the other condition? Ah, yeah. We want to b to be nonzero. We haven't yet used the fact that the second coordinate is nonzero. This is exactly where we can use it. D, which was a second coordinate, we can divide both sides by d because it's nonzero. So this is not nonsense. The d's would cancel and then we get the equation that af equals be. And that shows exactly that ab is related to ef, exactly what we were looking for. So this is a relation on this set x. Well, why do I care about this set x so much? Well, let's look at the equivalence relations. Okay. If I were to take a typical equivalence relation, let's take an example like 1, 2. For example, 2 is nonzero. That is a perfectly good relation. I'm looking for all of the ordered pairs a, b such that when I multiply these things together, 1 times b, which is equal to b, is going to equal 2 times a. I'm looking for integers that satisfy this condition. And there's a lot that I can do. Of course, there's 1, 2 itself. There's 2, 4. We'll do it. There's 3, 6. We can also throw in some negative numbers, of course. You can take negative 1, negative 2. That would also work. And this keeps on going and going here. And when you look at these things right here, these ordered pairs, I feel like I've seen these numbers somewhere before. Could I not also say that 1 half is equal to 2 fourths, which is equal to 3 sixth, which is equal to negative 1 over negative 2? All of these ordered pairs are related to each other by this equivalence relation, much in the same way that these fractions are equal to each other. And in fact, this equivalence relation that we just described gives rise to the rational numbers. We can actually define the rational numbers to be the set of equivalence relations, excuse me, the set of equivalence classes where x comes from the set x right here. So this is actually the definition of the rational numbers. The rational numbers is the set of ordered pairs of integers where the second, where the second coordinate is non-zero with the equivalence that two pairs are considered the same with regard to this equation right here. Because after all, when you look at a fraction like 3 sevenths, is this not really just an ordered pair? You have the number on top, you have the number on bottom. There is a specific order to them. That's what a fraction is. A fraction is just an ordered pair. Now a rational number is a fraction whose denominator is not zero and satisfies this equivalent relation. One half and two fourths are different fractions, but they're considered the same rational number. It's the same quantity. And in fact, one half versus two fourths are just two different representations of the same rational number. So this gives us a good example of why equivalence relations are so important to us. We use them all the time, even if we didn't know it. We've talked about the rational numbers many times in this lecture series and you've probably talked about it in many previous mathematics courses. The rational numbers is a set of equivalence classes and we define the rational numbers using these and we often work with the rational numbers using specific representations, but you can switch from one representation to the other because they're equivalent to each other. Let's look at one more example here. This one comes from linear algebra. Let A and B be two N by N matrices. So these are matrices with N rows and N columns. We say that two matrices are similar to each other. A is similar to B and we'll denote it using our usual symbol here. A is similar to B. If there exists a non-singular N by N matrix P such that A equals P, B, P inverse. Now, again, as a reminder, a non-singular matrix means it's a matrix with a matrix inverse. So the reason that we want P to be non-singular is because if P is non-singular, it means P inverse exists. In general, an N by N matrix doesn't have a inverse. It could be a singular matrix. So we're saying, okay, we can connect A and B together using this non-singular matrix. A might be singular, B might be singular, but this matrix that connects them together is a non-singular matrix. I claim that similarity is an equivalence relation. So we have to first show that A is related to itself, that A is similar to itself. Now, notice that A is equal to the identity matrix times A times the identity matrix inverse, which, of course, the inverse of the identity matrix is itself the identity matrix, and the identity matrix has the property that if you times it by any matrix, you get back A. This is why it's called the identity matrix. It acts like a multiplicative identity. So when you look at the right-hand side here, that would simplify. I times A times I inverse will simplify just to be A and I, the identity is a non-singular matrix. So this shows that A is similar to A. We get the reflexive property. All right. Why is similarity a symmetric property? So suppose that A is similar to B. That means there exists a non-singular matrix P such that A is equal to P, B, P inverse. Okay. Now, to show that B is related to A, I'm looking for some non-singular matrix, let's call it Q, such that B equals Q A Q inverse. That's what we're looking for. So who is my candidate for Q? Now, to find Q, I'm actually going to take this equation and we rework it. So notice, these are P is a non-singular matrix. If you times both sides by P, you're going to get that A, P is equal to P, B. Give me a little bit more space there. P, B. Because the next thing I'm going to do is I'm going to multiply on the left by P inverse. Remember, with matrix multiplication, multiplication is non-commutative. So multiply on the left is not the same thing as multiply on the right. We have to be mindful of these things. Okay. Of course, on the, on the right hand side, it simplifies just to be B. And so we can't write a factorization here, B equals, and that's exactly what we have here, B equals P inverse A, P. What we want to do is then take Q to B, P inverse. Now, if Q is P inverse, then Q inverse will equal P inverse, inverse, but the double inverse is just the original matrix P there. So that's exactly what we have here. B equals P inverse times A times P, which is the same thing as P inverse times A times P inverse inverse. Now, since P is a non-singular matrix, P inverse will also be non-singular. So this shows in fact that if A implies, if A is similar to B, then B is similar to A. And this is symmetric relation. Now the last one we want to do here, transitivity. If A, suppose A is similar to B and B is similar to C. Well, since A is similar to B, then there exists an invertible matrix such that A is equal to P, B, P inverse. And likewise, since B is similar to C, there exists a N by N non-singular matrix Q such that B is equal to Q, C, Q inverse. Now in order to show that this is transitive, we have to show that A is related to C, A is similar to C. That means we need to have some matrix we'll call it U, such that A equals U, C, U inverse. That's what we're looking for. Now in this situation, the way we're going to combine these together is actually using multiplication, because properties from linear algebra, the product of non-singular matrices, is likewise non-singular because at one point we're going to have a matrix PQ, which is non-singular. It's invertible because its inverse is actually Q inverse, this is the show called shoe sock principle. If you first put on your socks, then you put on your shoes to undo it, you take off first your shoes, then you take off your socks. The inverse process reverses the directions of things. All right, so let's put this together. Let's start off with our equation for A, A equals P, B, P inverse. Now I'm going to replace the B with this right here. We're going to substitute it in so that we get that A equals PQ, C, Q inverse, P inverse. Rewriting things, you can redo parentheses because matrix multiplication is in fact associative. Redoing the parentheses here, we get the PQ. And then for the second one, like we mentioned a moment ago, Q inverse, P inverse is the same thing as PQ inverse. You can flip the order around so we get exactly this. Since PQ is a non-singular matrix, we now show that A times a non-singular matrix times C, sorry, A is equal to a non-singular matrix times C times the inverse of the non-singular matrix. So this shows that A is similar to C in this situation. This then proves that similarity is in fact an equivalence relation on matrices. Now describing the equivalent classes of similar matrices gets a little bit harder, at least at this point of our educations. Now I should mention that similar matrices deserve the name similar because they're similar because they share certain algebraic properties. For example, similar matrices have the same determinant. They have the same trace. They have the same eigenvalues just to name a few things that they have the same. There's more than of course than that. And every non, every n by n matrix, singular or non-singular, belongs to a similarity class. So it sort of begs the question, well, who should be the representative of that similarity class? In more advanced linear algebra courses, which I'm assuming, if you're watching this video, you probably haven't participated in such a thing yet, the canonical choice of representative is what's often referred to as the Jordan canonical form, which of course I won't say much more about this right now, but the Jordan canonical form is sort of like the best representative of a similarity class because it's a matrix that is almost diagonal. In linear algebra, you might have talked about diagonalizable matrices. Diagonalizable matrices, what that is is basically you're saying that a matrix is diagonalizable if it's similar to a diagonal matrix. And if you're diagonalizable, then your Jordan canonical form will then be a diagonal matrix. And that's sort of like the best matrix in that family, in that similarity class. But of course, not all matrices are diagonalizable. So if you're not diagonalizable, who's the simplest version inside the similarity class? Well, again, this is where this Jordan canonical form goes in. You can be almost diagonal, and this study of topics helps you understand that. But that goes beyond the scope of this lecture series, but just let you be aware that in lots of branches of mathematics, including linear algebra, these equivalence relations are all over the place. And we just need to learn how to discover them and how to prove them. And the proof is just like we saw here. To prove that something is an equivalence relation, you always check three things. You prove that it's reflexive, you prove that it's symmetric, you prove that it's transitive. And that's how you prove that something is an equivalence relation.