 Welcome back to another screencast about set identities and in this video we're going to take a different track on proving theorems about sets by using some of the set identities that we saw in the previous video to our advantage. Let's just remind ourselves what those are. There are quite a lot of them and you will want to have these at your fingertips, either print it out or just be prepared to pause and rewind. Just to point out a few, a couple of these that we'll refer back to in this video, the associative laws here tell us that as long as if I have a bunch of intersections or a bunch of unions that are grouped together I can regroup them however I want essentially. And the distributive laws give us a kind of like, it's like an arithmetic where we distribute multiplication over addition except we can distribute intersections over unions in a certain kind of way and unions over intersections in a certain kind of way. We also had this theorem here that had a few more identities. For example, this one we proved in the last screencast A minus B is equal to A intersect B complement. Now all of these we either did prove or could prove using the so-called choose an element method where if I'm trying to prove that two sets are equal to each other, which is what mainly all these results are, I would just show that the left-hand side is a subset of the right-hand side and then secondly prove that the right-hand side is a subset of the left-hand side. We're still going to do that sometimes, but we're going to invent a new way of working with set theorems that might be a little bit slicker as long as we can establish these basic properties. So let me show you what I mean here. So I have a proposition here that says for any sets A and B that are subsets of some universal set U, we have that A intersect B union A intersect B complement is equal to A. We're going to prove that. First I want to prove a lemma here that turns out to be useful in our proof and that just says for any set B that's a subset of some universal set U, then B union B complement is equal to U. That seems intuitively obvious if you just think about what a set and its complement are. B union with the set of all things that are not in B ought to be everything in the universe. And it turns out that that's true, but I want to give first of all a quick choose an element method proof of that statement. So let's do this the traditional way to prove two sets are equal. I need to prove that one is a subset of the other and vice versa. So first I'll show that B union B complement is a subset of U. And then a little bit later I'll go the other direction and show that the universal set, the universal set, everything in the universe fits within one of those two sets. So let's write the proof out for these. This should be fairly short. So if I want to show this first subset inclusion here, the first thing I'll do is choose an element. So let's let X belong to B union B complement. Now what that means by the definition of union is that either X belongs to B or X belongs to B complement. So this is a situation where I know that X is in either one set or the other, but I don't know which. So let me do this in two cases. So let's do case one, where X is in B. And case two will be where X belongs to B complement. And in each case, what I like to show here is that X belongs to U. That's why I'm trying to get X into it ultimately. So if X is in B, then X belongs to U automatically because in the statement of the theorem, what we said was that B is a subset of the universal set. So we already know that B is a subset of U, so anything that is in B is automatically in U. Okay, so I've proven the theorem for case one. Now let's go back to case two. If X is in B complement, then what that means is that X is in U minus B. It's in everything in the universe that isn't in B. And so what that means is that X is in U and X is not in B. But right here I have what I want. So right there I'm saying that X is in U. So to say that X is in U just means that I've proven what I wanted. Okay, either way, X belongs to U. And now that proves the first half. I've shown that B union B complement is a subset of U. Now let's move on to the other direction of this proof here. Let's show that U belongs is a subset of B union B complement. So let's choose another element. Let's let Y just be anything in the universal set here. Now I'm going to set up two cases again. Case one will be where Y is in B. And case two, case one there, and case two will be where Y does not belong to B. So certainly any element that I pick in the universal set will fall into one of those two categories, either that point Y is in B or it isn't. There's no middle ground, there are no gray areas. So if Y belongs to B, then automatically Y belongs to B union B complement. Because remember what union means is that Y is either in B or in B complement. So as long as Y is in one of those sets, I've shown that it's in the union. Now that's then that gets case one out of the way. Case two, if Y is not in B, then where is Y? Well, Y would be in B complement. If it's not in B, it must be in the complement. And therefore, by the same reasoning, Y is an element of B union B complement. Okay, so either way, Y is in that union of B and B complement. Okay, and so that proves that half of the lemma. And now that proves the entire lemma completely. So I've proven that B union B complement is a subset of U, and that U is a subset of B union B complement. So the lemma is now completely done. And just to remind ourselves what that lemma says, I'll just circle it up here, that B union B complement is equal to U. So now let's move on to proving the main proposition here. I want to show that A intersect B union A intersect B complement is equal to A. We're going to do this in a very different way here. Now normally, if we were using the choose an element method, I would have to prove this set equality statement with two phases. I'd have to show that all this stuff is a subset of A, and then I have to show that A is a subset of all this stuff. We could still do it that way. However, we can also leverage some of the things we know about set identities to make this go a lot faster. And that sounds appealing. So let's think about this. I want to show this set equation work. So like any equation, let's just think about the left hand side. I'm just going to write down the left hand side of this equation. A intersect B union A intersect B complement. And just think about what this equals. Well, I want you to think back to the distributive laws that I pointed out a little earlier. Keep your eye on this for a second. I'm going to page back a few slides. I have the union of two intersections A intersect B union A intersect B complement. Now, back on these other slides here, where we hit the distributive laws, that looks a lot like this line right here. In fact, the right hand side of this distributive law property is exactly what we're looking at, except C here is being replaced by B complement. I had A intersect B union A intersect something else. Now, what this distributive law allows me to do is rewrite this as the left hand side. A intersect B union C. So let's go forward back to our slides and I'm just going to use rather than choose an element, I'm going to use a known and proven set identity to rewrite this as A intersect B union B complement. And again, the reason that's true, I don't have a lot of room here, but I'll try to cram it in. This is true by the distributive property, the distributive property, the very first one. Okay, so that is certainly true. And I didn't have to choose an element. Now let's keep going. What's this equal to? Well, by our lemma, we just learned that B union B complement is the entire universal set. So I can replace the thing in parentheses with just the universal set. Again, that's by my lemma that I proved. And now let's see what we have here. We have A intersect the universal set. Now I had another set property back here. It was right there. A intersect the universal set is itself. It's called the properties of the empty set and the universal set. And so I can use that property to rewrite what I have in front of me as just A. Again, that's the, we call the properties of the empty set and the universal set. And it was the second one of those properties in the theorem. And notice that proves it. I'm done. Okay, I've proven that this set equals this by the distributive property, which equals this by my lemma, which equals this by the properties of the empty set and the universal set. And so I've proven what I wanted to show. And that's that. That seems a lot easier, doesn't it? So we don't have to necessarily do a choose an element method type of proof here. We can use what we are going to refer to as the algebra of sets method, algebra of sets, because that's what it feels like. It feels like you're doing algebra with sets rather than variables. Using these properties that we built up, I can just chain them together and get what I want instead.