Predicate logic set notation. Predicate logic most often comes along in the guise of set theory. Now, a set is just a collection of objects. For instance, A set containing the numbers 1,2,3. Or the set containing the species cat, dog, horse, whale. Or the set containing the names of people. Tom, Dick, and Harry. Or the empty set, not containing anything. More often we work within sets. Set R of the real numbers. And such big sets have a tendency to function like the universe of discourse in predicate logic. The objects that make up a set, Are called the elements of the set. So how does this connection between set theory and predicate logic work? Well, in predicate logic, we have a universe of discourse and in set theory we call this universe, the universal set. So, that is the set which we want to discuss. And in predicate logic, we had some statement, P(x), which is true or false, depending on the value of x and x ranges over omega. Now, these two things together define a set S, which is formed by all elements of the universal set such that the predicate is true. So we have S containing of all values of x, in universal set, such that P(x) holds. And we have the complement of S. Which is usually written like this, which are all elements of the universal set such that not P(x) is true. So to give an example. Let omega be the set of natural numbers excluding 1, s0 2, 3, 4, 5, 6 etc. And let P(x) be the condition, x is a prime number. That's is x can only be divided by itself and by number 1, so for instance, P(3) is true. And because 3 cannot be divided by anything else but 3 and 1. And P(4) is false, because we can write 4 as 2 times 2. Now, the set S, Of numbers in omega such that P is true, is the set S of the numbers, such that x is prime. And that is the set, 2, 3, 5, 7, 11, 13 etc.. And the compliment of S would be all numbers bigger than 1, such that x is not prime. So basically, these are all elements which are not in S and which would be 4 6, 8, 9, 10, 12, etc.. There are four main set-theoretic notions. The first one is the subset. A set S is a subset of another set R, if, Every element of S is also an element of R notation, S is a subset of R. We've already seen that. Second notion is the intersection of sets. The intersection, Of the sets S and R is formed, By all elements of S that are also elements of R. Third version, the union. The union of the sets S and R is formed by all elements of S together with all elements of R. And, lastly, The difference, The difference, Of the sets S and R is formed, By all elements, Of S that are not in R. So the notations, we already had the notation for a subset, the notation for the intersection is S, and then a half arc upward R, the union is S half arc downward R. And the difference is S minus R. So let's have a look at an example. And we take for S simply the set with the elements 1, 3, 4, 5. And for R, the set with the elements 1, 2, 3. So S is not a subset of R and neither is R a subset of S. Why? Well, if S were to be a subset of R, we ought to have that every element of S is also an element of R. But, Should do that, right? Not a subset of R for, 4 is an element of S and 4 is not an element of R. So S cannot be a subset of R. R cannot be a subset of S because the element of 2 in R is not an element of S. So that about subsets. What about the intersection of S and R? Well, by definition, these are all the elements of S which are also element of R. Well, 1 is also an element of R, so we can write it down. 3 is also an element of R, so we can write it down. 4 is not an element of R, so it's not in the intersection. And 5 is not an element of R, so it's also not in the intersection. That's simple. The union of the two sets is formed even more easily, you just throw all the elements together. Okay, we've got the union. And what about a difference? Well, the difference of S and R, all elements of S which are not element of R. So let's have a look again,1 is also an element of R, so it's not in the difference. 3 is also element of R, not in difference. 4 is in S, but not in R. So, 4 we can write down. And 5 is an element of S, but not in R. So we can also write down 5. And then, we checked all the elements of S. Now, you may wonder, what about 2? Well, 2 isn't relevant, because we are only looking for elements of S which are not in R. And 2 is not an element of S, so we don't have to check 2.