User:Addemf/sandbox/Scientific Reasoning for Non-scientists/A Precis on Sets

Much of modern mathematics is stated in the language of sets. It is so foundational to mathematics that just about every mathematical subject uses sets in some way to characterize its most essential objects.

For example, in the next lesson we will look at the basics of modern geometry. But in the modern conception of geometry, we will understand lines as sets of points.

If you think about it, we can find some point on a line, and this point is a part of the line. And we can find another point, and another point, and in a way, a line just is nothing other than the totality of all of these points.

Therefore, before talking about anything else, we must discuss sets as the basic language of all other mathematical subjects.

Later in this course, sets will become their own mathematical subject. But this lesson about them is just a very summary introduction, which we need in order to discuss other topics.

Intuition
Sets are sometimes "synonymously" called collections or groupings. They are meant to represent some various individuals, put together in the loosest possible sense.

For instance, we may talk about the set of the first 5 positive natural numbers. We write this as
 * $$\{1,2,3,4,5\}$$

Anything in the set we call an "element", so that this set has 1 as an element, and 2, and so on. To write that something is an element we use the "element of" symbol, $$\in$$. Therefore $$1\in\{1,2,3,4,5\}$$ is a true statement and $$0\in\{1,2,3,4,5\}$$ is false. To express that something is not an element of a set, we write $$\notin$$. Therefore $$0\notin \{1,2,3,4,5\}$$ is a true statement.

Now because sets are only supposed to represent groupings only, they are not supposed to represent orderings. Therefore the set $$\{1,2,3,4,5\}$$ is in fact the same as the set $$\{5,1,4,2,3\}$$, and is the same if we list its elements in any other order as well.

By analogy, think of it like your set of friends, which might be {Shiva, Rama, Ganesh, Krishna}. The set of friends is still the same even if you name them in any other order. After all, the question is not ranking your friends, which would be a much more sensitive topic.

But because we are only interested in which elements the set has, in fact, it doesn't even matter if we repeat elements. For instance, the set $$\{1,1,2,2,2,3,4,5\}$$ has exactly the same elements as $$\{1,2,3,4,5\}$$ and therefore even these are still exactly the same set. We may emphasize the point by writing
 * $$\begin{aligned}

\{1,2,3,4,5\} &= \{5,1,4,2,3\}\\ &= \{1,1,2,2,2,3,4,5\} \end{aligned}$$ which asserts that all three of these are exactly equal as sets.

It is probably important to emphasize early on that, although sets of numbers are very important, they are far from the only kinds of sets that we consider. We can form sets of just about anything.

Above we considered sets of people, which is completely fair. To keep things mathematical, we can talk about sets of equations, like $$\{2x+1 = 5, e^x = 7\}$$.

In fact, we will soon start talking about geometry. In geometry, we regard almost every object as a set of points.

For example, consider the line that runs through coordinates (0,0) and (1,2). Call this line $$\ell$$.

$$\ell$$ contains the points (0,0), and (1,2), and (2,4), and (0.5, 1), and many more. So we regard $$\ell$$ to be the set of all of these points!

We may therefore write, to take random examples, the true statements,


 * $$(0,0)\in\ell$$

and
 * $$(1,1)\notin \ell$$

Set Equality and Subsets
The above illustrates that sets are defined by their elements only, which is to say that they are equal if and only if they have the same elements.

In fact this definition seems to have a natural "component", which is for every element of one set to be an element of another.

Therefore it is immediate by these definitions that $$X=Y$$ if and only if both $$X\subseteq Y$$ and $$Y\subseteq X$$.

Consider the sets
 * $$\begin{aligned}

A & = \{1,2,3\}, & B &= \{2,3,4\}, & C & = \{1,2\} \end{aligned}$$ Of the three sets, decide if any of them is a subset of another.

Show that if X, Y, and Z are sets, with $$ X\subseteq Y$$ and $$Y\subseteq Z$$. Show that $$X\subseteq Z$$

Also note that when we want to say that multiple elements are in a set X, the formally correct way to write this would be something like, for example:


 * $$1\in X, 2\in X, 3\in X$$

Of course this is tedious and therefore we often use the shorthand


 * $$1,2,3\in X$$

Likewise we may sometimes have sets A, B, C, D, and we may wish to say that the first three sets are subsets of D. As a shorthand for this we will write


 * $$A,B,C\subseteq D$$

Set-builder Notation
So far we have been specifying sets by listing their elements. For very large sets, and for infinite sets, this becomes unfeasible.

For instance, how could we write the even numbers from 2 to 100? Writing "{2, 4, 6" an so on, would of course be insane.

We can use ellipses to indicate that the reader should fill in the pattern, and we will sometimes do this. For instance we can write the set of even numbers from 2 to 100 as {2, 4, 6, ..., 100}.

If we want to write the set of all positive even number then we can write {2, 4, 6, ...} to indicate that the pattern never stops.

But what if we want to talk about the set of all numbers divisible by 3, 7, or 8? We could try to start writing this as {3, 6, 7, 8, 9, 12, 14, 15, 16, ...} but my word nobody will look at that and see what the pattern is.

For another example, consider the line defined by the equation $$y=2x+1$$. How would we write all the points in this set? Not an easy task if we try to list them.



Therefore we use "set-builder" notation to express the elements of a set, by telling you the "rule" which determines the membership of elements.

For example, to write the set of numbers divisible by 3, 7, or 8, we may write it as
 * $$\left\{x \text{ is a natural number}: x \text{ is divisible by either } 3, 7, \text{ or }8\right\}$$

Similarly we may write the set of all points on the line $$y=2x+1$$ with set-builder notation, as
 * $$\left\{(x,y) : y = 2x+1\right\}$$

In the simplest case of set-builder notation, it has the form $$\{x \in Y: P(x)\}$$.

Here x is a variable taken from the set Y, and we are meant to imagine that x is "any arbitrary element from Y".

The ":" symbol comes next, read as "such that". Sometimes, instead we use "|" as a perfect synonym. See more information at the Wikipedia page for | Set-builder notation.

After the "such that" symbol, we write some property which "defines the set", which I have called $$P(x)$$. In the example of natural numbers, the property there was the property "x is divisible by 3, 7, or 8".

The example of points on the line $$y=2x+1$$ is different in a couple ways. For one thing there isn't just a single variable, but two variables. Because the set is a set of coordinate points then we need to express each coordinate somehow, making it natural to use a different variable for each coordinate, x and y.

Therefore the set that we "build" with this set-builder notation, is a set of pairs. This is indicated by the fact that the point $$(x,y)$$ is before the "such that", which tells us that the set is made up of the points.

Notice also that I did not specify the set from which the point is taken. We could have said "$$(x,y)$$ is a pair of real numbers" to do this, but it is verbose. Especially if context somehow tells us what set the variables are taken from, we may omit this from our set builder notation for ease of reading.

Finally, in the example of points on a line, the property here is now a two-variable property, $$P(x,y)$$. In particular, here the property is given by the equation $$y=2x+1$$.

Use set-builder notation to write


 * 1) The set of even numbers from 2 to 100.
 * 2) The points on the graph of the function $$f(x) = x^2$$.
 * 3) The interval $$(2,15.1]$$ which is the real numbers from 2 (exclusive) to 15.1 (inclusive).
 * 4) The set of the natural numbers 2, 3, 5, 7, 11, ...

Famous Number Sets


There are a few sets of numbers which we often refer to, since each is often useful for some different purposes. First consider the set of natural numbers,


 * $$\Bbb N = \{0,1,2,\dots\}$$

Note that not every mathematician agrees that 0 is a natural number, and it is ultimately an arbitrary choice. I will choose to call it a natural number, but be aware that some other authors may differ.

If I ever want to specifically talk about the positive natural numbers, I will write instead


 * $$\Bbb N^+=\{1,2,3,\dots\}$$

Another famous set of numbers is the integers, written as


 * $$\Bbb Z = \{\dots,-2,-1,0,1,2,\dots\}$$

The integers might be described verbally as "the natural numbers and their negatives".

Notice that $$\Bbb N\subseteq\Bbb N^+\subseteq\Bbb Z$$ which is a shorthand way of saying that "each is a subset of the next".

When we express a set by writing a few of its members, enough to detect a pattern, and then use ellipses to suggest that the pattern keeps going — this is called "roster notation".

The next most famous number set is the set of all rational numbers, written as $$\Bbb Q$$. This is the set of all numbers which are a ratio of two integers, if the denominator is nonzero. It is not easy to show this by roster notation, although if we made a feeble attempt to do so anyway, we might write
 * $$\Bbb Q = \left\{0, \frac 1 2, -\frac 1 3, \frac 17,5, \dots\right\}$$

Of course the rational number extend to infinity in both directions, and moreover, between any two rational numbers is another rational number. This makes them hard to enumerate (although not impossible!).

Prove that between every two rational numbers is another rational number. Hint: For any two rational numbers, $$\frac p q, \frac r s\in\Bbb Q$$, take their average. Call the average a so that
 * $$ a = \frac{\frac p q +\frac r s}2$$

and show that a is a rational number, and between $$\frac p q$$ and $$\frac r s$$.

Still it is easier if we use set-builder notation to define them. In this way, we write,
 * $$\Bbb Q = \left\{\frac p q:p,q\in\Bbb Z, \text{ and } q\ne 0\right\}$$

Use this definition of the rational numbers, to prove that 0 and 1 (which look like natural numbers) are in fact in the set of rational numbers.

The final number set that we will mention for now is the set of real numbers, denoted $$\Bbb R$$. This is the set of all numbers which have any arbitrary decimal expansion. This is contrasted with the rational numbers, each of which has a decimal expansion with a repeating pattern.

For example, the number $$\frac 1 3 = 0.333...$$ where the repeating pattern is the 3. Technically we could say that $$\frac 1 2 = 0.5000...$$ where the repeating pattern is the 0. More complicated is the pattern for something like $$\frac 1 {11} = 0.090909\dots$$ where the repeating pattern is 09.

On the other hand, it is provable that neither $$\sqrt 2$$ nor $$\pi$$ nor $$e=2.71828...$$ have a repeating pattern as described for rational numbers. These are the "irrational numbers".

The real numbers are made up of the rational together with the irrational numbers, and therefore form a larger set.

Now that we have these number sets available, we will much more often insist on writing set-builder notation with the "set from which the variable was drawn". Therefore in order to talk about the positive even numbers, we will insist on writing
 * $$\{x\in\Bbb N^+: x\text{ is even}\}$$ or equivalently $$\{2x:x \in\Bbb N\}$$

The preference here is for being as explicit as possible as often as possible. Especially when the notation is now short because we have these familiar named sets, it comes at not so much cost.

Likewise we would now write the set of all points on the line $$y=2x+1$$ as
 * $$\{(x,y):y=2x+1, \text{ with } x,y\in\Bbb R\}$$ or equivalently $$\{(x,2x+1):x\in\Bbb R\}$$

Use set-builder notation to write the set of irrational numbers. Recall that these are the real numbers that are not rational numbers.

Set Operations
Very often when specifying a set, the most convenient way to specify it is to start by specifying one property, and then another, and then another. We then way to impose all of these properties simultaneously.

For example, suppose that we want the numbers which are greater than 10, divisible by 3, and its digits sum to 6. Examples of numbers in such a set would be 15 and 24. These are three independent properties, each of which can be imposed "independently" and then joined together later. For each property, we can write its set.


 * $$A = \{x\in\Bbb N^+: 10< x\}$$
 * $$B = \{x\in\Bbb N^+: x \text{ is divisible by } 3\}$$
 * $$C = \{x\in\Bbb N^+: \text{ the digits of } x \text{ sum to } 6\}$$

Each of these is perfectly well-defined in isolation, and to impose all conditions at the same time, we take their intersection. The intersection of two sets is written with the $$\cap$$ symbol between them.

The intersection of A and B is the set consists of the positive natural numbers greater than 10, which are divisible by 3.

List three elements in $$A\cap B$$.

The intersection of all three sets is $$A\cap B\cap C$$ and this consists of exactly the numbers described at the start: greater than 10, and divisible by 3, and its digits sum to 6.

If one wants to be very technical -- and I guess this is "technical reasoning" after all -- then one could specify that $$A\cap B\cap C$$ is short-hand for the more explicit $$(A\cap B)\cap C$$. Which is to say that we take the intersections, one after the other, in the order they're given.

But this is the same as the set $$A\cap (B\cap C)$$, so this issue turns out not to matter. Since this lesson is "just a precis" then we won't be quite so technical just yet.

Consider the sets $$A=\{1,2,3\}, B=\{2,3,4\}, C=\{3,4,5\}$$. Compute every possible "pairwise" intersection:


 * $$A\cap B,\quad B\cap C,\quad A\cap C$$

Note that the intersection of sets is "commutative" in the sense that $$A\cap B = B\cap A$$. Technically we could prove this as a theorem, since it is a claim about an equality of sets. But we will not be so technical right now.

Then compute the three-way intersection in two ways:


 * $$(A\cap B)\cap C$$ and then $$A\cap (B\cap C)$$

For any two sets, X and Y, prove that their intersection is a subset of each.


 * $$ X\cap Y\subseteq X$$ and $$X\cap Y\subseteq Y$$

What should happen if we try to intersect two sets which have no elements in common? For instance, what is $$\{1,2\}\cap \{3\}$$? Of course no element deserves to be in such a set, and therefore, in order to handle cases like this, we have the notion of the empty set.

Suppose the set X has 5 elements, and Y has 2. What is the possible size of their intersection?

Not only do we sometimes want to conjoin properties into a single, more specific property. Sometimes we want to "disjoin" properties.

For example suppose we want to consider the set of all numbers which are either divisible by 2 or divisible by 3. This set would include the numbers 2, 3, 4, 6, 8, 9, and so on.

We may form the individual sets
 * $$A = \{x\in\Bbb N^+: x \text{ is divisible by }2\}$$

and
 * $$B = \{x\in\Bbb N^+: x \text{ is divisible by }3\}$$

then the set of numbers for which one or the other condition holds is their union.

We may write the union of three sets $$X\cup Y\cup Z$$. Just as with intersection, we will not be very concerned about whether to interpret this as either $$(X\cup Y)\cup Z$$ or $$X\cup (Y\cup Z)$$, since each gives the same set at the end.

Compute the union of $$A = \{1,2,3\} $$ and $$B=\{2,3,4\}$$.

Prove that if X and Y are two sets then $$X\cup Y$$ is a superset of both X and Y. That is to say,


 * $$X\subseteq X\cup Y$$

and
 * $$Y\subseteq X\cup Y$$

Let $$A=\{1,2,3\}, B=\{2,3,4\}, C=\{3,4,5\}$$.

Show that $$(A\cup B)\cap C \ne A\cup (B\cap C)$$.

Infer that, when writing unions with intersections, it becomes important to use parentheses to communicate the order in which they are meant to be taken.

Venn diagrams try to make visual the concepts of set operations. If we draw a set as a circle which encompasses all of its element, then the diagram on the right would represent two sets, A and B.



In the diagram, the intersection $$A\cap B$$ is labeled as region 2. Region 1 is all points in A which are not in B. We call such a thing the "relative complement.

Of course region 3 is $$B\smallsetminus A$$ in the diagram.

Region 4 is the set of all elements which are not in either region. In order for this to exist there must be some "universal set" which encompasses every possible element.

For instance, we might have numbers which are even, and numbers which are prime. Say that


 * $$A=\{x\in\Bbb N^+: x \text{ is even}\}$$

and


 * $$B=\{x\in\Bbb N^+: x\text{ is prime}\}$$

If we set $$\Bbb N^+$$ to be the universal set, which encompasses both A and B, then there are many numbers not included in both A and B which are still in the universe of elements. For instance $$1\in\Bbb N^+$$ but $$1\notin A$$ and $$1\notin B$$. Therefore 1 would be in the region labeled 4 of the diagram for these two sets, and with this choice of universal set.

Note that the choice of universal set is a choice. With sets A and B above, respectively containing the even and prime numbers, we could have chosen the universal set to be $$A\cup B$$. This would be perfectly well-defined. It would also have the consequence that region 4 would be empty.

Let the universal set be $$U = \{1,2,3,4,5\}$$ and $$A = \{1\}$$ and $$B=\{2,4\}$$. Find all of the regions of the Venn diagram, which are


 * $$A\smallsetminus B,\quad A\cap B,\quad B\smallsetminus A, \quad U\smallsetminus (A\cup B)$$

Prove that if X is any set with universal set U, then $$(X^c)^c = X$$.

Also prove that if Y is another set with universal set U, then
 * $$X=Y$$ if and only if $$X^c = Y^c$$