1 00:00:00,810 --> 00:00:02,640 PROFESSOR: Let's define a few familiar 2 00:00:02,640 --> 00:00:05,310 and standard operations on sets. 3 00:00:05,310 --> 00:00:08,220 So here's a picture of two sets A and B, 4 00:00:08,220 --> 00:00:10,750 where the idea is that the circle represents 5 00:00:10,750 --> 00:00:13,290 the points in A. The other circle represents 6 00:00:13,290 --> 00:00:17,140 the points in B. The overlapping area, this lens-shaped region, 7 00:00:17,140 --> 00:00:19,210 are the points that are in both A and B. 8 00:00:19,210 --> 00:00:21,130 And the background are the points that 9 00:00:21,130 --> 00:00:23,260 are in neither A and B. 10 00:00:23,260 --> 00:00:25,370 So this sort of a general picture 11 00:00:25,370 --> 00:00:27,810 allows you to classify points with respect to And B, 12 00:00:27,810 --> 00:00:31,300 and it's called a Venn diagram, in this case for two sets. 13 00:00:31,300 --> 00:00:32,750 It's still useful for three sets. 14 00:00:32,750 --> 00:00:34,500 It gets more complicated for four sets. 15 00:00:34,500 --> 00:00:38,200 And after that point, they're not really very useful. 16 00:00:38,200 --> 00:00:39,670 But a lot of the basic operations 17 00:00:39,670 --> 00:00:41,650 can be illustrated nicely in terms 18 00:00:41,650 --> 00:00:43,380 of the Venn diagram for two sets, 19 00:00:43,380 --> 00:00:45,970 and that's what we're about to do. 20 00:00:45,970 --> 00:00:48,910 So the first operation is union. 21 00:00:48,910 --> 00:00:52,170 It's the set of points shown here in magenta. 22 00:00:52,170 --> 00:00:55,630 It's the set of points that are in either A or B, all of them. 23 00:00:55,630 --> 00:00:58,540 And so if we were defining this in terms 24 00:00:58,540 --> 00:01:01,830 of set-theoretic notation or predicate notation, 25 00:01:01,830 --> 00:01:05,390 the union symbol-- the U is the union symbol. 26 00:01:05,390 --> 00:01:10,910 So A union B is defined to be those points x that are in A OR 27 00:01:10,910 --> 00:01:11,890 are in B. 28 00:01:11,890 --> 00:01:14,570 And you can already begin to see an intimate relationship 29 00:01:14,570 --> 00:01:18,620 between the union operation and the propositional OR 30 00:01:18,620 --> 00:01:19,440 connective. 31 00:01:19,440 --> 00:01:20,740 But don't confuse them. 32 00:01:20,740 --> 00:01:23,200 If you apply an OR to sets, your compiler 33 00:01:23,200 --> 00:01:25,350 is going to give you a type error. 34 00:01:25,350 --> 00:01:30,460 And if you apply union to propositional variables, 35 00:01:30,460 --> 00:01:33,410 your compiler is also going to give you a type error. 36 00:01:33,410 --> 00:01:36,220 So let's keep the propositional operators 37 00:01:36,220 --> 00:01:38,625 and the set-theoretic operators separate 38 00:01:38,625 --> 00:01:40,760 [? and ?] clearly distinct even though they 39 00:01:40,760 --> 00:01:42,360 resemble each other. 40 00:01:42,360 --> 00:01:43,540 All right. 41 00:01:43,540 --> 00:01:47,480 Next basic operation is intersection where, again, it's 42 00:01:47,480 --> 00:01:49,920 the points that are both in A and B, 43 00:01:49,920 --> 00:01:52,990 the points in common, which are now highlighted in blue. 44 00:01:52,990 --> 00:01:54,990 So the definition of A intersection B-- 45 00:01:54,990 --> 00:01:58,470 we use an upside-down union symbol for intersection-- 46 00:01:58,470 --> 00:02:05,320 it's the set of points that are in A and are in B. 47 00:02:05,320 --> 00:02:07,900 So let's stop for a minute and make 48 00:02:07,900 --> 00:02:11,500 use of the similarity between the set-theoretic operations 49 00:02:11,500 --> 00:02:13,650 and the propositional operators. 50 00:02:13,650 --> 00:02:17,920 Let's look at a set-theoretic identity, which I claim 51 00:02:17,920 --> 00:02:21,419 holds no matter what sets A, B, and C you're talking about. 52 00:02:21,419 --> 00:02:22,960 And we're going to prove it by making 53 00:02:22,960 --> 00:02:25,644 the connection between set-theoretic operations 54 00:02:25,644 --> 00:02:26,810 and propositional operators. 55 00:02:26,810 --> 00:02:28,130 And so let's read the thing. 56 00:02:28,130 --> 00:02:32,920 It says that if you take A union the set B intersection 57 00:02:32,920 --> 00:02:38,030 C, that's equal to the set A union B intersected 58 00:02:38,030 --> 00:02:42,690 with A union C. Now, let's not think through yet 59 00:02:42,690 --> 00:02:45,210 how to make this an intuitive argument. 60 00:02:45,210 --> 00:02:48,580 It's going to really crank out in an automatic way 61 00:02:48,580 --> 00:02:49,500 in a moment. 62 00:02:49,500 --> 00:02:54,120 But we can remember it as saying that you 63 00:02:54,120 --> 00:02:58,630 can think of this as union distributing over intersection. 64 00:02:58,630 --> 00:03:03,100 So if you think of union as times here 65 00:03:03,100 --> 00:03:05,480 and intersection as plus, then we've 66 00:03:05,480 --> 00:03:08,760 got a rule that says that A times B plus C is 67 00:03:08,760 --> 00:03:13,710 A times B plus A times C. 68 00:03:13,710 --> 00:03:17,067 Now, it's also true that if you reverse the role of union 69 00:03:17,067 --> 00:03:19,150 and intersection, you get another distributive law 70 00:03:19,150 --> 00:03:22,470 that AND distributes over union, but never mind that. 71 00:03:22,470 --> 00:03:23,930 Let's just look at this one. 72 00:03:23,930 --> 00:03:26,240 We're trying to prove the distributive law for union 73 00:03:26,240 --> 00:03:27,810 over intersection. 74 00:03:27,810 --> 00:03:31,690 How shall we prove it just from the definitions? 75 00:03:31,690 --> 00:03:33,680 Well, the way we're going to do it 76 00:03:33,680 --> 00:03:37,110 is by showing that the two sets on the left-hand side 77 00:03:37,110 --> 00:03:39,690 and the right-hand side have the same set of elements. 78 00:03:39,690 --> 00:03:42,590 Namely, if I have an element x that 79 00:03:42,590 --> 00:03:45,100 appears in the set described on the left-hand side, 80 00:03:45,100 --> 00:03:48,300 then that point is in the right-hand side. 81 00:03:48,300 --> 00:03:49,460 And it's an if and only if. 82 00:03:49,460 --> 00:03:52,480 So that says that the left-hand side and the right-hand side 83 00:03:52,480 --> 00:03:55,390 expressions defines sets with the same set of points. 84 00:03:55,390 --> 00:03:58,590 This holds for all x. 85 00:03:58,590 --> 00:04:01,070 And it turns out that the proof is 86 00:04:01,070 --> 00:04:06,620 going to follow by analogy to a propositional formula 87 00:04:06,620 --> 00:04:08,840 that we're going to make use of in the proof. 88 00:04:08,840 --> 00:04:12,060 That was a propositional equivalence 89 00:04:12,060 --> 00:04:15,640 that we proved in an earlier talk, namely 90 00:04:15,640 --> 00:04:17,940 that OR distributes over AND. 91 00:04:17,940 --> 00:04:24,090 So P OR Q AND R is equivalent to P OR Q AND P OR R. 92 00:04:24,090 --> 00:04:30,200 So you can see this equivalence in purple 93 00:04:30,200 --> 00:04:34,500 has the same structure as the set-theoretic equality in blue, 94 00:04:34,500 --> 00:04:36,960 except that union's replaced by OR, 95 00:04:36,960 --> 00:04:39,110 intersection's replaced by AND, and set 96 00:04:39,110 --> 00:04:43,040 variables A, B, C is replaced by propositional variables 97 00:04:43,040 --> 00:04:46,090 P, Q, R. 98 00:04:46,090 --> 00:04:47,970 So let's just remember that we've already 99 00:04:47,970 --> 00:04:50,380 proved this propositional equivalence, 100 00:04:50,380 --> 00:04:53,050 and we're going to make use of it in the middle of this proof 101 00:04:53,050 --> 00:04:54,869 that these two sets are equal. 102 00:04:54,869 --> 00:04:56,535 So again, we said we were going to prove 103 00:04:56,535 --> 00:04:57,910 the two sets are equal by showing 104 00:04:57,910 --> 00:04:59,187 they have the same points. 105 00:04:59,187 --> 00:05:00,020 So here's the proof. 106 00:05:00,020 --> 00:05:02,970 It's going to be a lovely if and only if argument the whole way. 107 00:05:02,970 --> 00:05:07,750 So looking at the left-hand side, a point x is in A union 108 00:05:07,750 --> 00:05:11,610 B intersection C by definition of union 109 00:05:11,610 --> 00:05:16,400 if and only if x is an A OR x is in B intersection C. 110 00:05:16,400 --> 00:05:19,710 I've just applied the definition of union there. 111 00:05:19,710 --> 00:05:20,302 OK. 112 00:05:20,302 --> 00:05:21,760 Now, let's look at this expression. 113 00:05:21,760 --> 00:05:24,630 x is in B intersection C. That's the same 114 00:05:24,630 --> 00:05:27,970 as x is in B AND x is in C, again, just using 115 00:05:27,970 --> 00:05:30,680 the definition of intersection. 116 00:05:30,680 --> 00:05:35,480 And now I have a propositional formula involving OR and AND 117 00:05:35,480 --> 00:05:39,870 and the basic assertions about sets of x is a member of one 118 00:05:39,870 --> 00:05:40,925 of those A's, B's, C's. 119 00:05:43,440 --> 00:05:46,280 Now, at this point, I can immediately 120 00:05:46,280 --> 00:05:48,310 apply my propositional equivalence 121 00:05:48,310 --> 00:05:53,400 and say that the assertion x is an A OR x is in B AND x is in C 122 00:05:53,400 --> 00:05:56,890 holds if and only if this expression, x is 123 00:05:56,890 --> 00:06:01,630 an A OR x is in B AND x is in A OR x is in C. Why is that? 124 00:06:01,630 --> 00:06:04,270 Well, I'm just invoking the propositional equivalence. 125 00:06:04,270 --> 00:06:06,610 Let's look at it. 126 00:06:06,610 --> 00:06:13,190 That if I think of the x is in A as proposition P-- 127 00:06:13,190 --> 00:06:16,740 and let's replace all the x [? over ?] A's by P-- 128 00:06:16,740 --> 00:06:21,870 and I think of x is in B as a Q and x is in C as an R, 129 00:06:21,870 --> 00:06:26,200 then I can see that the first set-theoretic assertion has 130 00:06:26,200 --> 00:06:28,480 the form of P OR Q AND R. 131 00:06:28,480 --> 00:06:31,920 And I can transform it by the propositional equivalence 132 00:06:31,920 --> 00:06:35,260 into P OR Q AND P OR R. And then remember 133 00:06:35,260 --> 00:06:38,710 what P and R are to get back to the set-theoretic membership, 134 00:06:38,710 --> 00:06:40,580 basic membership assertions. 135 00:06:40,580 --> 00:06:42,890 So now we've just proved that x is 136 00:06:42,890 --> 00:06:46,690 in A OR x is in B AND x is in A OR x is in C. 137 00:06:46,690 --> 00:06:50,870 And that's if and only if it was in the left-hand side set. 138 00:06:50,870 --> 00:06:53,160 Well, now I'm going to go back the other way. 139 00:06:53,160 --> 00:06:58,110 Namely, this OR, that x is in A OR x is in B, 140 00:06:58,110 --> 00:07:00,130 is the same as saying that x is in A union B, 141 00:07:00,130 --> 00:07:03,350 likewise here just by applying the definition of union. 142 00:07:03,350 --> 00:07:06,460 And this assertion that x is in this set AND x 143 00:07:06,460 --> 00:07:08,260 is in this set is the same as saying that x 144 00:07:08,260 --> 00:07:10,080 is in their intersection. 145 00:07:10,080 --> 00:07:14,400 And I've completed my proof, namely 146 00:07:14,400 --> 00:07:18,119 the point that was in the left-hand side if and only 147 00:07:18,119 --> 00:07:19,410 if it's in the right-hand side. 148 00:07:19,410 --> 00:07:21,660 You have to remember that that was the right-hand side 149 00:07:21,660 --> 00:07:22,510 of the identity. 150 00:07:22,510 --> 00:07:24,750 So this is a general method actually, 151 00:07:24,750 --> 00:07:28,590 where you can take any set-theoretic equality 152 00:07:28,590 --> 00:07:31,897 involving union and intersection and the operations 153 00:07:31,897 --> 00:07:33,980 of difference and complement that we'll talk about 154 00:07:33,980 --> 00:07:40,700 in a moment, and we can convert any such set-theoretic equality 155 00:07:40,700 --> 00:07:44,070 into a propositional equality or a propositional equivalence 156 00:07:44,070 --> 00:07:47,430 so we can check that the propositional assertion is 157 00:07:47,430 --> 00:07:48,510 an equivalence. 158 00:07:48,510 --> 00:07:52,530 And from that, using this method of converting the membership 159 00:07:52,530 --> 00:07:56,510 statements in the set expression into a propositional 160 00:07:56,510 --> 00:07:58,990 combination, we can check, and automatically check, 161 00:07:58,990 --> 00:08:01,920 any kind of set-theoretic identity involving 162 00:08:01,920 --> 00:08:05,810 union, intersection, and minus. 163 00:08:05,810 --> 00:08:09,850 And that, in fact, is the way that automatic engines 164 00:08:09,850 --> 00:08:14,630 like Mathematica can prove these set-theoretic identities. 165 00:08:14,630 --> 00:08:17,330 So let's just for the record put down that last operation. 166 00:08:17,330 --> 00:08:20,050 The difference operation is the set 167 00:08:20,050 --> 00:08:22,910 of elements that are in A AND not in B. 168 00:08:22,910 --> 00:08:26,160 So we'd write it as A minus B is the set of points that 169 00:08:26,160 --> 00:08:30,940 are in A AND not in B. and it's Illustrated 170 00:08:30,940 --> 00:08:35,870 by this region that's highlighted in orange. 171 00:08:35,870 --> 00:08:40,620 And a special case of the minus operation or the difference 172 00:08:40,620 --> 00:08:42,150 operation is complement. 173 00:08:42,150 --> 00:08:46,770 When you know the overall domain that you expect all your sets 174 00:08:46,770 --> 00:08:50,280 to be part of, then you can define a complement 175 00:08:50,280 --> 00:08:53,460 to be everything that's not in A-- the set of x such 176 00:08:53,460 --> 00:08:56,600 that x is not in A, where x is understood to be ranging 177 00:08:56,600 --> 00:08:58,740 over some domain of discourse. 178 00:08:58,740 --> 00:09:00,970 So if we're going to picture that, we're 179 00:09:00,970 --> 00:09:05,740 looking at the whole orange region, all of the stuff that's 180 00:09:05,740 --> 00:09:08,950 not in A if we think of the whole slide 181 00:09:08,950 --> 00:09:13,010 as representing the domain of discourse D.