 In the previous video for lecture two, we introduced the idea of sets, that is, we have established what is a set in the mathematical sense. And we mentioned that when it comes to sets, things like order and repetition don't matter, the only thing that matters for a set is membership. Is this object an element of the set or not? So for our logic video in lecture two today, we really need to emphasize how does one prove whether an object belongs to a set or not? There is actually a proof template that we're going to begin with. So we're going to start writing some proofs and these are usually fairly elementary proofs to the most part. And let me kind of explain what makes these things so important, but also what makes these things so simple. For most of us, if you're given two pictures of plants, like the ones you see on the screen right now, I bet you could probably correctly identify which of the pictures is that of a tree and which one is not a picture of a tree. Take a moment, pause the video if you need some more time, but decide amongst yourselves as you're watching this, which of these two pictures, the one on the left or the one on the right, which is the picture of a tree? I've probably given you more time than is necessary, but the object on the left, I imagine most of us were very able to quickly identify that that is a tree. Now if you're curious, this thing on the right is not a tree, it is a flower, it's a lily, it's a pretty flower there, but it's not a tree, it's not a tree. There are characteristics of a tree that distinguish it from other plants, and we as humans can recognize those characteristics. We can identify whether a plant belongs to the category of trees or not, or using what we would say is that this picture, this tree that's illustrated on the screen there, it belongs to the set of trees. If we take all of the trees in the world, this plant on the left here belongs to that set. Deciding that this is a tree is the same thing as proving it belongs to a set. In mathematics, we have to do the same thing. Does this object belong to the set or not? Does this plant belong to the subcategory or the genus or whatever? It's all about classification. We often have to decide whether a mathematical object belongs to a specific set or not. Take for example, we have to decide that the number two belongs to the set of integers, but we also can decide that one half does not. When I say decide, I mean, we made a determination there, right? It's not like our choice. Like, I feel like one half is an integer today. No, no, no. There is a definition of the set of integers, and then we have to determine whether does two match that property? Yes, it does, so it belongs to the set. Does one half satisfy that property? No, so it doesn't belong to that set. Every set has a mathematical property which determines whether an element belongs to it or not. In order to determine whether a specific element belongs to the set or not, we simply need to check if the defining membership property of the set is satisfied with its object or if it isn't. And so I should mention that this defining membership, I said that for a reason, right? The defining membership of a set is equivalent to checking a definition. Definitions, mathematically we talked about in lecture one. Sets and definitions are basically the same thing. If you're given a definition, we can define the set of objects that satisfy that definition. For example, we can say that x is equal to the set of trees. There is this biological definition of what a tree is, and so we can then use that definition to define a set. And then once the set's defined, anything that satisfies the definition then belongs to the set. But conversely, given any set, we can make a definition to mean all the things that belong to that set. So it goes hand in hand. The notion of a set and a definition are essentially the same thing. Checking membership of a set is really just checking a definition. All right. And so let's do some examples of such a thing. Now, one strategy for determining whether an object belongs to a set or not is the so-called brute force property, the brute force strategy, brute force algorithm. We alluded to this earlier in lecture two here. And the idea is if I list every member of the set, then I can check, does this belong to the set or not? Because if I can list every member, then that'll take care of it. Now, this is going to work well if you have a small set, right? A finite set with not very many elements. Once these things start to get too big, it becomes way too difficult for a human to check. But you could use technology or computer or a program of some kind. But even still, there's a limit to how well these things can compute them as well. Now, let's look at set A right here. We're going to take the set of all integers such that the absolute value of the integer is less than or equal to four. Now, I want to make a comment about this here. This is set builder notation that we saw in part one of this lecture here, where the first part before the vertical line represents a typical element, an arbitrary element. Really what it's doing, it's defining what we would call the universe. The universe are often referred to as the universal set. Okay? So what this means is that we're going to take all elements that belong to some other set, and we're only going to consider those. And the reason for that is when you talk about absolute value, it makes sense to talk about the absolute value of natural numbers, of integers, of rational numbers, of real numbers. And it even makes sense to talk about the absolute value of a complex number, although in that context, it's usually referred to as the modulus or the magnitude of the complex number. But it is the natural extension of this notion of absolute value. So if I don't specify the universe, then it might be a little bit confusing. Like what objects belong to the set? And so again, a set has to be well-defined. There has to be a clear rule to decide to determine whether objects belong to the set or not. Now, be aware that the rule has to be clear and unambiguous. That doesn't mean it has to be easy. It could be a difficult rule to check. And we'll see an example of that one at the end of this video. But we do have a rule. And so we sometimes have to specify a universe, a universal set to determine where do our objects live. And so in this case, our objects live within the set of integers. So we want all integers whose absolute value is less than or equal to 4. So I can actually list all the elements of A here. So you can take, for example, negative 4, negative 3, negative 2, negative 1, 0, 1, 2, 3 and 4. Knowing properties about the integers, I know that these are the only objects, the only integers, which will belong to the set by this property. So we actually listed all of the elements. This is brute force approach. Now I can decide who belongs or not. I know that the element 2 belongs to the set because I listed them all. I also know that the element 5 does not belong to the set. Now, I don't necessarily have to list all the elements to check these. I could just have them take the numbers 2 and 5 and check their absolute values. The absolute value of 2, of course, is 2. The absolute value of 5 is 5. But using this property, it's a very simple property, I'm able to then list every element that belongs to the set. Now let's change pace a little bit because I want to then dig into this idea of a universal set a little bit more. What if we change the universal set? What if we take the exact same set from before? So let me make sure they're both on the screen here. If we take the exact same set from before a, that is, it's the same set because it means the exact same property. Let's take all numbers whose absolute value is less than or equal to 4. Let us now change the universal set to the be the real numbers. So when you read this set here, this is the set B such that we want all real numbers whose absolute value is less than or equal to 4. Well, this is clearly going to contain all nine of these elements we saw before. There's some new things that belong there as well. Like so three still belongs to the set. We've enlarged the set here, but we also gained things like Pi, right? The irrational number 3.14159, etc. That number has an absolute value which is less than or equal to 4. So Pi belongs to the set. We can also grab something like the negative square root of 2. That belongs to the set as well. The negative square root of 2 is approximately 1.4142. And so when you take the absolute value of the negative square root of 2, you get the positive square root of 2. So that belongs to the set as well. But on the other hand, if you take something like 11 halves, right? Maybe it's easier to see it as a decimal. 11 halves is 5.5. That has absolute value greater than 4. The number is bigger than 4, so it's absolute value greater than 4. So the fraction, the rational number 11 halves does not belong to the set B right here. There are lots of numbers that belong to the set, but there's also lots of numbers that don't belong to the set. I should also mention that the number 1 plus I does not belong to the set B. Well, why doesn't it belong to the set B? I want to mention that if you take the complex modulus of this number 1 plus I, this is equal to 1 squared plus 1 squared inside the square root, of course. The idea is to take the complex modulus of a complex number. You take the square root of the sum of squares where the squares are going to be the real part and the imaginary part. So real imaginary part of this number 1 and 1. So this becomes a square root of 2. Be aware that the absolute value of the square root of 2, excuse me, the square root of 2 we were talking about earlier, 1.4, it is inside this range here. This is a complex number whose modulus is in fact less than equal to 4. But it's not included because 1 plus I is not a real number. The universal set dictates that we only are accepting real numbers. So when we work with these sets to deciding whether something belongs to a set, there's really two things you need to consider. One, you need to check, does the object satisfy the property? But you also have to make sure that does the object live inside the universe of consideration? If it's outside that universe, then it's irrelevant whether it satisfies the property or not. So that's how you check whether an object belongs to a set. Is it within the universe and does it satisfy the property? Does it satisfy the definition? Speaking of definitions, let's give us a very important definition when one talks about sets here. This is the definition of cardinality. The cardinality of a set is the number of elements that belong to that set. And if the set is called A, we typically denote the cardinality of the set as, well, looks like the absolute value of A, but A is not a number. It's not a real number. It's going to be a set. And so this is the notation we use to denote the cardinality of the set. So this is the number of elements that belong to the set. Now, some people use different symbols for cardinality. Like some people use like N of A, but this is very uncommon in advanced mathematics. There's other symbols you can use as well. This is actually quite universal for mathematicians. Now, in like college classes or even high school classes, if students learn about sets, they might use other notation because they're afraid the students won't be able to distinguish this notation from absolute value. But in advanced mathematics, there's so many mathematical ideas and so little notation that you can use that we have to overload symbols all the time. That is reuse symbols to mean different things. How do you tell the difference by context? Because the thing in between the vertical lines is a set and not a number, I know it's not absolute value. You're considering the cardinality. How many elements belong to the set? Now, if this cardinality, that is the number of elements turns out to be a natural number, which be where zero is included in that. We call this a finite set. How could the cardinality of a set be zero? Well, the empty set contains nothing. The empty set has a cardinality of zero. This is actually one of the reasons to justify why the natural number should include zero. The natural numbers, you could define them to be the set. We could define the natural numbers to be those numbers which are cardinalities of finite sets, which include zero in that situation. Now, if a set is not finite, then we call it an infinite set. Be aware that many of the sets we've considered are already infinite. We know our infinite, like the set of natural numbers is infinite. The integers are infinite. The rational numbers are infinite. The real numbers are infinite. The complex numbers are infinite. These are all examples of infinite sets. Now, from the two sets that we were considering on the previous slide here, like remember A was the set of integers whose absolute value was less than equal to four. There were nine elements in that set, so it's a finite set, nine's a natural number. On the other hand, the set B, which is the set of real numbers whose absolute value is less than equal to four, that's actually an infinite set. We couldn't list every single element. We started to describe them, but we can't get all of them. There's too many because it's an example of an infinite set. Before we end this video, I want to introduce one more example that illustrates a very important point that even if a set has a very simple property that defines the set, it can still be very difficult to determine whether an element belongs to the set or not. And therefore, we might not know how big the set is. We might not know its cardinality. It might be infinite or finite. We don't know. Maybe even empty if the property is difficult here. So the example we're going to do is talk about the set of perfect numbers. Now, let N be a natural number. I want you to notice we're starting to use this mathematical notation here. Remember, this symbol is the set of natural numbers, which does include zero. This symbol right here means set membership. So N is an element of the set of natural numbers. So we would read that as let N be a natural number. So we say that N is a perfect number if the sum of all of its divisors is equal to two N. So the sum of all of the divisors of that number, positive divisors here, since we're only talking about natural numbers, we don't include negative numbers as possibilities. We won't worry about negative divisors here. So we want the sum of all of its positive divisors to equal two N. That makes it a perfect number. So let me give you an example of one. Six is a perfect number. One can show that the divisors of six are one, two, three, and six. One divide six, two divide six, three divide six, and six divide six. No other natural number is going to do that. This right here is the set of divisors of six. Now, if we add together all four divisors, we get the following. One plus two is three, plus three is six, plus six is 12. 12 is two times six. Six is an example of a perfect number. And in fact, it is the smallest perfect number. You can check that every natural number less than six is not a perfect number. We'll give an example of one in just a second. With some more experimentation, you could try seven, eight, nine, 10. With enough experimentation, you could show that the next perfect number is actually 28. The divisors of 28 are one, two, four, seven, 14, 28. Given the prime factorization of 28, you could actually come up with this set of divisors, right? 28, you could factor as like four times seven. Seven is a prime number, so it doesn't factor anymore. Four would factor as two and two. So you can list the prime factorization of 28 is two squared times seven. And then, looking at all the possibilities, you have to make a decision like which factors are you going to show up there. You know, one is when you take no prime factors. Two shows up when you only have a two. Four shows up when you have two twos. Seven, two and a seven, and four and seven. I'm not going to go through all of this right now, but we can actually, if we have a prime factorization for an actual number, we can come up with a set of divisors. There's an algorithm that exists for that. Keep that, keep a pin in that. We'll come back to that in a second. So once we have the set of divisors, we can then sum them together, add them. One plus two is three plus four is seven plus seven is 14 plus 14 is 28 plus 28 is 56. Hopefully I said all of those correctly. But anyways, 56 is two times 28. So even if I said my things out loud incorrectly, I hope I didn't. 28 is in fact a perfect number. It's the second, it's the second perfect number. In fact, if you were to go with calendar, a very important mathematical holiday is actually perfects day, perfects day. This would be in the United States, this would be June 28th, because they are the first two perfect numbers. June 28th also sometimes referred to as two pi day, because 6.28 is 3.14 times two. And so much like on pi day, you get a pi to celebrate the number pi on perfect day or two pi day, you eat two pies, which would be just perfect there. All right, so we have two perfect numbers found already, 6 and 28. Let me convince you that not every number is a perfect number. Take for example, five. Five is not a perfect number. Five is actually a prime number. And so it's only divisors are one and five. And if you add those together, one plus five, you get six. Six is not the same thing as 10, 10 being two times five. So five is not a perfect number. And in fact, I could generalize the argument I just had on the screen right here. I could actually show that no prime number is a perfect number. It's not just five that every prime number is going to be imperfect, not perfect for the following argument. This is what a proof is. A proof is generalizing a specific case. And so let P be an arbitrary prime number. The only thing I know about P is that it is a prime number. All right, then its set of divisors is going to be the set one and P by definition. That's what a prime number is. It's a number other than one whose divisor whose divisors are just one in itself. This gives more reasons why we don't include one as a prime number for one. The set of divisors is just one. But for prime numbers, the set of divisors always has a cardinality of two. That's what made one so exceptional. It's the only natural number whose set of divisors is cardinality one. Prime numbers all have cardinality two. So I know exactly what those are. You're going to have one plus P. The sum of divisors is one plus P. Is it possible that one plus P could equal two P? Because that's what a perfect number means. The sum of divisors equals twice the P. But this is just a linear equation. We could solve this from our algebra training here. If I subtract P from both sides, you're going to end up with one equals P. But remember, P is a prime number. And by definition, prime numbers are not equal to one. So we get a contradiction if this was a perfect number. So what we can infer from this is that it's impossible for a prime number to be a perfect number. And so no prime is perfect. And that gives us a very nice proof of this here. So we can prove that prime numbers are not perfect. And it turns out there's other proofs you could provide to show that certain numbers are not perfect. And so if we summarize what we've seen so far, it's not too difficult to determine whether a number is perfect or not if we have a set of divisors. If you have the divisor set, it's pretty simple. Just add and divide by two. Now, admittedly, for very large natural numbers, finding their set of primes turns out to be very, very difficult. That is, it's a difficult computational problem. I alluded to the fact earlier that if you have a prime factorization of a natural number, it's actually quite simple to find its set of divisors. But it turns out that's where the problem is. Factoring large numbers to find their prime factorization is actually a very, very hard problem. If one goes deeper into number theory, we could talk about why is prime factorization a computationally difficult problem. That goes beyond the scope of this course, but I do want to mention that things in cryptography, which is the mathematics of security, that how you can use your credit card online safely, has a lot to do with this problem at hand, that there exists computationally difficult problems. And so eavesdroppers and hackers can't necessarily solve these problems in a short amount of time, and this creates security. Factorization natural numbers exist as a computational difficult problem. Now we're of course talking about numbers which have prime factors that are like hundreds of digits long, millions of digits long, maybe. So that's not going to be within our scope here, but I just want to make mention that assuming we can find a prime factorization of a number, that itself is a hard problem. Then we could check whether you're perfect or not very quickly. But that's something to be to acknowledge here that prime factorization is hard. So this is a computationally hard problem to check for an arbitrary natural number, whether it is perfect or not. But it turns out for even numbers, there's an awesome proof that one can prove we're not going to prove it. But we can prove the following one could get even if we're not going to that if n is an even number. If n is an even number, so it does have to be divisible by two, notice six and 28 are even numbers. If n is an even number, then it turns out n is perfect if and only if n can be written in the following form. That's two p minus one times two p minus one, where in this situation, p is a prime number, and the number two p minus one is likewise a prime number. These are referred to as the Marysine primes, a very important family of prime numbers. Among other reasons, it's connections to perfect numbers. One can show that every perfect number, every even perfect number can be factored in the following way. I want you to consider the numbers six and 28 that we've seen already, right? Six factors as two times three, which two is of course a power of two. In this situation, we're going to use p equals two, two is a prime number. Notice that two to the first is same thing as two to the two minus one power, and three under the hand, this is equal to two squared minus one. That satisfies the formula. If you look at 28, which is four times seven, in that situation, I want you to be aware that four is two squared, so that's going to be two cubed minus one, like so. And then if you consider over here, two cubed minus one, that's seven, so this factorization matches up with these two perfect numbers, six and 28. We have our first two Marysine primes, three and seven, and so using Marysine primes, we can actually construct perfect numbers. And so this dramatically simplifies the problem for even perfect numbers, that the difficulty of finding them comes down to the difficulty of finding these so-called Marysine primes, which it turns out that also is still a very difficult problem. It's unknown how many Marysine primes there are. Currently, there's only 51 known Marysine primes, and as such there's only 51 known perfect numbers. It is unknown whether the set of perfect numbers is infinite, because we know that the number of even perfect numbers will coincide with the number of Marysine primes, but it's still an open conjecture, an open question in number theory, how many Marysine primes are there, at least at the time when this video was recorded, it was unknown. And then there's another very interesting question when it comes to perfect numbers. Is there such a thing as an odd perfect number? The theorem we mentioned before was only about evens. So even perfect numbers aren't one-to-one correspondence with the Marysine primes, but for odd ones, it's unknown. And for hundreds of years, people have searched for odd perfect numbers and none have ever been discovered. And I should mention that this involves, of course, the digital age, where people have written programs, very good programs that their algorithms go beyond the scope of this video here, very good programs that then search for odd perfect numbers and they haven't been found. And so if they exist, these numbers have to be gigantic because, well, we've searched all the small ones, right? We're looking at numbers with like millions and billions of digits, but at last we can't find any odd perfect numbers. Now, that doesn't mean they don't exist. Maybe they're just very elusive. Maybe they're hanging out with Bigfoot in the California mountains somewhere. I don't know. The problem is we don't know they don't exist. Most conjecture there's no odd perfect numbers, but there yet doesn't exist a proof that shows they don't exist. Just because we can't find them doesn't mean they don't exist. There are many examples in mathematics where it took a long time to find the first example of something. And sometimes it took so long that people believed they didn't exist. And then someone was like, aha, a great mathematical discovery happened because someone found something that people believed didn't exist. One such example is the existence of non-Euclidean geometry. People for hundreds of years believed that all geometry was Euclidean, but one of the greatest discoveries of all mathematical history was the discovery of non-Euclidean geometry, proving that something existed that people believed didn't. Is there an odd perfect number? I don't know. It would be pretty awesome if someone found one or also equally awesome if someone proved they didn't exist. And so I present the examples of perfect numbers as just an example. It has a very simple definition. Numbers whose divisors add up to be twice the number, but the membership of the set is very difficult to determine. We don't know if the set is infinite or finite. We don't know if there exists some members. It's at least 51. And we have no idea if odd numbers belong to the set or not. How could such a simple set be so difficult to understand? Well, this happens all the time in mathematics. It sounds scary, but it's actually wonderful and exciting. Mathematics is a great, beautiful puzzle that's waiting to be solved. And mathematicians like you are exactly the type of people who will solve these problems in the future.