 In this final video for lecture four, I want to introduce a very important equivalence relation on the set of integers with its associated partition that comes from the equivalence classes. And this is about modular arithmetic. So let's say we have two integers, R and S. We say that these two integers, so R is congruent to S, modulo N. N is some third positive integer. R and S are any integers. They could be positive, negative, or zero. N will be a positive integer, that's required. We say that R is congruent to S, modulo N, and we'll denote this as R is congruent to S, mod N here. If and only if the difference of the two numbers, R minus S is equal to a multiple of N, or case any integer, arbitrary integer here. So if N divides R minus S, we say this if and only if R is congruent to S, mod N here. All right, that's what it means for integers to be congruent modulo N. And you can define some interesting algebra using modular arithmetic here. If you're interested, take a look at the video link you see suggested to us right now. We're not gonna worry about that too much right here. In this video, we're gonna focus just on showing that this is an equivalence relationship. A little bit of latex advice I wanna mention here, that if you're trying to do this symbol right here, this triple equal sign, this is backslash, backslash E-Q-U-I-V, a short for equivalent. And also if you wanna type set this correctly, I would recommend doing backslash P mod. And then in the braces, you put your modulus, which if it's a multi-digit number, the braces are necessary. P mod is short for parenthesis mod. And if you just do backslash mod, that doesn't usually type things very correctly. It looks kind of sloppy. P mod is a better symbol to use. So a little bit of a text for a moment right there. So this idea of congruence modulo N is an equivalence relationship. We'll argue that in just a second. Let's look at some examples. We say that 10 is congruent to one mod three because 10 minus one is equal to nine and nine is three times three, it's a multiple of three. So 10 is congruent to one mod three. We say that 15 is congruent to zero mod five because 15 minus zero is itself 15, which is three times five. So multiples of five will be congruent to zero mod five. And that's true in general, right? You'll have that a number K is congruent to zero mod N. This happens exactly when N divides K. That's an important observation. On the other hand, 15 is not congruent to zero mod seven because again, 15 minus zero is 15 and 15 is not a multiple of seven. Be aware that congruence depends on the modulus. If you change the modulus, two numbers are not necessarily congruent anymore because 15 is not a multiple of seven here. I wanna mention that if you do wanna do a negate symbol right here in latex, you can typically take your symbol in play here. So like take like a quiv, like we have before, put in front of it not, and that typically will negate the symbol. Sometimes that doesn't always typeset correctly. Like if you take this symbol right here, the divisibility symbol, that's just a symbol you can put on the screen. You could, sorry, by clicking the symbol on your keyboard. To make it look a little bit better, if you do backslash mid, that does a little bit better to give this symbol. And while you can do backslash not, backslash mid, that does give you a line with a slash through it. The slash doesn't look quite right. It looks kind of like this. So instead, there are sometimes you do like backslash in mid. Sometimes they have that, and so that gives you a better typeset. But that's not created for every symbol. Typically you can get away with just typing not in front of your equivalence relationship symbol. So like if you wanna do a congruent symbol, this will be backslash C-O-N-G for congruence there. And you can just do backslash not congruent. That'll slash it. If you wanna latex something like that. 30 is congruent to 48 mod nine, because the difference of 30 and 48 is negative 18. Negative is acceptable here, because negative 18 is divisible by nine. It's negative two times nine. 23 is congruent to two mod seven, because their difference is 21, which is three times seven. You get the idea. That's how we show that to, that gives us an example of congruence modulo N, right? This gives us an equivalence relationship. It's reflexive, symmetric, and transitive, right? How do we show that it's reflexive? Well, if we take a typical integer, we wanna show that it's congruent to itself, given any modulus, right? Now notice that R minus R is equal to zero, and zero times N is equal to zero. And since we can see that N divides R minus R, we see that R is congruent to R mod N. This is for any R and any N. So it's a reflexive. It's reflexive there. So to show symmetry here, we're gonna assume, so if R is congruent to S, and S is congruent to T mod N, then what does that mean? Then we see that R minus S is equal to, we'll say A N, and we also have that S minus T is equal to B N. Now we wanna combine these together. Oh, I'm doing the transitive property on tie, JK everyone. You can go out of order here, transitive property. What am I doing? Oh, well, we'll finish up with the transitive property. No big deal. We can combine these together. Notice that if we take R minus T, this is equal to R minus S plus S minus T, right? The S is canceled out in this situation, but we're expanding this thing. R minus S plus S minus T, this is equal to A N plus B N, and in fact, we're not the N, you're gonna get A plus B times N. And so this then shows us therefore that R is congruent to T mod N. Great, that gives us the transitive property. Now let's do the symmetric one. The order doesn't actually matter. Typically people do reflexes symmetric and transitive, but maybe the symmetric property is harder than the transitive property. I don't think that's the case here, but to show the symmetric property, we only have to show, just to make one assumption, assume R is congruent to S mod N. That implies that R minus S equals A N. That's gonna imply, if we go the other way around, this implies that S minus R is equal to negative A times N. And that implies, of course, that S is congruent to R mod N. So the symmetric property falls pretty quickly here. So congruence module N is an equivalence relationship. And so let me give you an example of this. If we take the integers mod three, you're gonna get exactly three congruence classes. You're gonna get the congruence class that contains zero. This will contain all multiples of three, those things which are congruent to zero mod three. So zero, three, six, nine, 12, 15, 18, also negatives, negative three, negative six, negative nine, et cetera. You're gonna take the numbers which are congruent to one mod three. So it'll be like one, four, seven, negative two, 10. Admittedly, you just get an arithmetic progression here, right? One plus three is four, plus three is seven, plus three is 10, plus three is 13. Those are the numbers congruent to one mod three. And then the other one is two. You'll get two, five, eight. Again, another arithmetic progression. Just add three to get all the other ones as well. There are only gonna be three congruence classes, mod three, because if you divide a number by three, there's only three possible remainders. One will zero, one, and two. And the representatives we use for these equivalence classes are typically the three possible remainders, zero, one, and two. And every number, every integer, if you divide by three, has to be congruent to one of those three by the division algorithm. We'll talk about that a little bit more in the next chapter. This equivalence relationship is a relationship, but it's very important as we talk about the remainders and divisibility in the upcoming chapter. Like we proved previously, equivalence relationships always give us a partition. And so the set of remainders can be partitioned by these three congruence classes, zero, one, and two. Every integer goes into one of these three families, one and only one of these three families. And there's nothing particularly special about three in this situation. If we take any modulus in, we're gonna divide, we're gonna define z in as the following set, z in, equals the set of congruence classes. So there's zero, there's one, there's two, and this will proceed all the way up to n minus one. Because once you hit n, that's just the same thing as the congruence class containing zero here. And so we want z in to be a partition of the integers z, in which case every equivalence class shows up once and only once. So typically we like to denote this as zero. Now I should mention that some people, when they talk about z in, we get a little bit lazy and we don't write the equivalence class. Instead, some people will write this as, this is somewhat of an abuse of notation, zero, one, two, three, up to n minus one. They only write the representative and not the class. That's, again, that's not always the best mathematics because z in is the set of equivalence classes, not the set of integers, zero through n minus one, because we'll be able to use one and n plus one interchangeably when we're working z in here. And so this is something that happens. When one works with equivalence relationships, you get so accustomed with two different representatives being identical that you don't really differentiate between them anymore. When it comes to say fractions, for example, one half and two fourths are considered the same fraction. That's not exactly true. One half and two fourths are the same rational number, but they are different fractions. Well, I mean, they're two different representations of the same ratio, but they're different fractions because one has a numerator of one and one has a numerator of two. Those are not the same fraction, but they're the same rational number. But the subtlety between a fraction and a rational number is so subtle that we often forget that there actually is a distinction. Fractions is a representation of a rational number. And because we're so accustomed to using the equivalence relationship on the rational numbers, we often don't distinguish between the two. We use the symbol one half to describe not just an individual fraction one half, but we also use it to describe the entire equivalence relation for any rational number equivalent to one half. And so the same thing also happens with zn. Properly speaking, we're talking about these congruence classes on the integers, but we become so ingrained that these things are the same that we actually get away with just calling them by the representatives and we don't make any distinction, right? You'll even see in some cases that someone might say that zero is equal to seven, maybe because we're working mod seven, right? They really should say that zero is congruent to seven mod seven because zero and seven are not the same integer, but when you're working in zn, right? When you're working in zn, in this case, is z seven, zero and seven are in fact the same thing. And so it can kind of subtle here. You have to be a little bit careful about these type of nuances, right? That they're not equal, but they are equal. It all has to do with context, right? This is something that people don't always realize when it comes to mathematics. When you're writing a proof, when you're reading a mathematical paper, there's two things you should always keep in mind. One is context and one is audience. When you're writing a proof, you need to think of who is your audience? Who is going to read this proof? Who should be reading this proof? Now, you might think that as this is a, that your proofs you write are related to a class, that your audience is your instructor. No, no, no, no, no, no, no. Though your instructor might be grading your work, your audience you should think of is your classmates. If your classmate were to read your proof, would they understand it? Is there enough details for them to understand it? And assuming that this is just an average classmate, right? They might not understand everything if you skip too many lines, if you make too many unstated assumptions, right? For me, if I was like, oh, this follows by induction, done, that might be a valid proof. But for your classmate, if you're writing an induction proof, you might have to go through more details like, what is the base case? What is the inductive hypothesis? What is the inductive case? You might need to go through those step by step by step. For me, you know, for a professional mathematician, you look at something like this. Oh, a congruence module and is an equivalent relationship. Your proof might be the following, trivial. I have seen mathematical proofs that have done exactly that, the proof is just one word, trivial. I'm not kidding. If you wrote that for your homework assignment, that would not be an acceptable proof for your homework assignment because your audience is to your classmates. Would your typical classmate find this proof trivial? Probably not. And therefore we need to add more detail to it. Audience matters when you write proofs. Also context, as I was talking about, matters a lot as well. Talking about integer congruences in the context of abstract algebra versus combinatorics versus number theory, those different contexts change a little bit how we think about these things. It's very important that you pay attention to those things. And I wanna throw that bit of advice in here at the end of our video as we conclude lecture four. If you feel like you learned something in this lecture, feel free to hit the like button. If you would like to learn more about topics in abstract algebra or other mathematical topics, feel free to subscribe to this channel. If you have any questions for any of these videos, feel free to post them in the comments below. I'll be happy to answer your questions. And I will hopefully see you next time. Lecture five is probably when that'll happen. Bye everyone.