Jump to content

User:Addemf/sandbox/Technical Reasoning/Naive Set Theory 2

From Wikiversity

Basic Set Operations

[edit | edit source]

Pairwise Union

[edit | edit source]
A pictorial representation of the union of sets A and B. The pentagon is in both sets, but in the union we only need to represent it once.

Think of a set as like a bucket of elements. Then the union of two sets is like dumping them together into a combined bucket.

Consider, for example, the sets

The union is then

Note that there is no need to repeat any duplicated elements. As we discussed earlier, a set is defined by membership, so repeating elements does not change what the set is.

Definition: union

If X and Y are any two sets then their union is defined as

Exercise for Unions of Sets of Strings

Consider the character set {'0','1'}.

Let A be the set of all strings of length 1, and B the set of all strings of length 2.

List the elements of the set .

Exercise for Pairwise Union

Suppose that A has 3 elements and B has 6.

If then how many elements are in ?

If A and B have no shared elements, then how many elements are in ?

Exercise for Emptyset Union

If A is any set then what is ?

Exercise for Algebra of Sets?

Can we solve set equations the way that we solve algebraic equations?

Suppose that X is some set which satisfies the equation

Can we determine what X must be?

If we cannot infer what X is, then can we at least make some inference about some of the elements of X?

Pairwise Intersection

[edit | edit source]
A pictorial representation of the intersection of sets A and B.

If the union forms the set of all elements in A or B, then the intersection forms the set of all elements which are in both A and B.

If then their intersection is

Definition: intersection

If X and Y are sets, then their intersection is the set

Exercise for Basic Intersection

Let A be the set of all numbers divisible by 3, and B the set of all numbers divisible by 5.

Find the first three elements of .

Exercise

Let A be any set, and find

Exercise

Let

Compute

and

Exercise

Consider the equation

for sets A, B, C.

Is this always true? That is to say, is it true for every choice of A, B, C?

Is it sometimes true? That is to say, is it true for some choice of A, B, C?

Exercise

If A has 3 elements and B has 6, what is the maximum number of elements in ? What is the minimum number?

Set-Difference

[edit | edit source]
A pictorial representation of the relative complements, for sets A and B.

If A and B are sets then represents the elements of A, but removing the elements which are in B.

If then "A set-difference B" is

and "B set-difference A" is

Definition: set-difference

Let A and B be sets. Then A set-difference B is defined as


Exercise

For any set A, find

and

Exercise

For any sets A and B, find

Exercise

For any sets A and B, consider the equations

For each equation, is it always true?

Is it sometimes true?

Universal Set and Complement

[edit | edit source]
A pictorial representation of the complement of a set.

In many settings, we will be exclusively interested in sets which are all subsets of a single set.

For instance, in some settings we will only be interested in the natural numbers, and all of the sets that we consider will be subsets of it.

Or we might only be interested in the set of real numbers, or other kinds of sets, like the set of all matrices.

Whenever we restrict our interests to the subsets of one particular set, we call that one set the "universal set". We may choose the universal set to be any set that we like.

Once we specify a universal set, we can then define the notion of "the complement of a set".

Suppose that we choose the universal set and consider the subset . Then the complement of A is the set of all elements in the universe which are not in A.

Notice that the choice of universal set will affect the complement of a given set. If the universal set is and then

Exercise

Show that for any universal set U and subset ,

Exercise

Consider the universal set and subsets and .

Find the following sets.

(1.)

(2.)

(3.)

(4.)

We can now state an important relationship between the union, intersection, and complement.

Theorem: U-C De Morgan's

Suppose the universal set is U with subsets A and B. Then

In order to prove that two sets are equal, we must prove that every element in the left set is in the right set; and every element in the right set is in the left set.

In short, the fundamental way to prove a set equality, , is to prove two subset relations.

and

We now do just that, with X identified with the left side, . Y is identified with the right side, .

Proof of of U-C De Morgan's

(1.) If then .


(1.1.) Let .


(1.2.) So .


(1.3.) So x is not in A or B.


(1.4.) So and .


(1.5.) So and .


(1.6.) So .


(2.) So .


(3.) If then .


(3.1.) Let .


(3.2.) So and .


(3.3.) So and .


(3.4.) So x is not in A or B.


(3.5.) So .


(3.6.) So .


(4.) So .


(5.) So .

A representation of the I-C De Morgan's law. The notation is an alternate notation for the complement, .

Notice that the way that this proof flows, is to start from formal statements, like "Let " or "Let ."

From there, we progressively "unpack" this formalism, into a language which is more like a logical or natural language. For example, from "", we eventually arrive at "" and then "x is not in A or B".

At this point we have almost entirely exchanged the formalism for logical expressions. Complements (formal) have all been exchanged for negations (logical). Union (formal) has been exchange for disjunction (logical).

Now that we have exchanged formalism for logical expression, we are free to reason logically. We use that freedom to reason that "x is not in A or B" is logically equivalent to "x is not in A and x is not in B".

After this, we return everything to formalism. At the end of this sequence, we ultimately arrive at the goal: .

In the following proof, we repeat a very similar flow. However, the logic required is a bit different from the above proof.

Theorem: I-C De Morgan's

Let A and B be two sets with universe U. Then

As is common with set equalities, we again prove two subset relations.

Proof of of I-C De Morgan's

(1.) If then .


(1.1.) Let .


(1.2.) So .


(1.3.) So x is not in A and B.


(1.4.) So either , or .


(1.5.) If then .


(1.5.1.) Assume .


(1.5.2.) Then .


(1.5.3.) Then or .


(1.5.4.) Then .


(1.6.) If then .


(1.6.1.) Repeat, mutatis mutandis, lines (1.5.1.) to (1.5.4.).


(1.7.) In all cases, we have .


(2.) So .


(3.) If then .


(3.1.) Let .


(3.2.) So or .


(3.3.) So or .


(3.4.) If then .


(3.4.1.) Assume .


(3.4.2.) Then x is not in A and B.


(3.4.3.) Then .


(3.4.4.) Then .


(3.5.) If then .


(3.5.1.) Repeat, mutatis mutandis, steps like (3.4.1.) through (3.4.4.).


(3.6.) Therefore, in all cases, .


(4.) Therefore .


(5.) Therefore .


Exercise

In the style of the proofs above, prove the so-called "distribution laws"

and

for any sets A, B, C.

Exercise

Prove all of the following set identities, for sets A and B with universe U.

I have named some of the identities, to indicate an analogy between sets and familiar number properties. In many ways acts like the number zero, and U acts like one. Continuing the analogy, often, acts like plus, and acts like times.

Keep in mind that the analogy is just that, an analogy. It is not perfectly accurate, and is important to notice the ways in which the analogy breaks down.


The zero identities.

(1.)

(2.)


The one identities.

(3.)

(4.)


The idempotence identities.

(5.)

(6.)


Double-negation identity.

(7.)


Complement identities.

(8.)

(9.)

Infinitary Set Operations

[edit | edit source]

If we have any finite collection of sets, then we can union all of them together with a finite number of pairwise unions.

However, it can be more compact and convenient to use "big union" notation instead.

What this means is "Start with and the corresponding set . Then take and the set , and then , and so on, up to with each of the corresponding sets. Take the union of all of these."

Definition: union from 1 to n

Let be any "indexed sequence of sets", where the indices are written in the subscripts, from index 1 to n. Then we define the union of for index i from 1 to n as

Equivalently,

Exercise

Let be the set of natural numbers divisible by 2, and the set of natural numbers divisible by 3, and the natural numbers divisible by 4.

Write the first five elements of .

This is a notational convenience, especially valuable when the number of sets is large.

However, we can even generalize the notation to permit so-to-speak "infinite unions".

Definition: union from 1 to

Let be any infinite indexed sequence of sets, from 1 to infinity. Then we define the union of for i from one to as

Exercise

For each i, define as the set of all strings of length i. What, then, is the set

Note that the index begins at 2, and therefore we have not technically defined exactly what this means.

Of course, we just mean the same basic idea as except that we do not include .

Of course we may naturally also extend the notion of intersection to an infinitary intersection.

Definition: big intersection

Let be any indexed sequence of sets, from index 1 to n. We define the union of for index i from 1 to n as

If be any indexed sequence of sets, from 1 to infinity. We define the union of for i from 1 to infinity as

Exercise

Show that the following identities hold for the infinitary operations, for any sequence of sets , and set B, with universe U.

(1.)

(2.)

(3.)

(4.)

The Set Product

[edit | edit source]
A representation of the set product as a table of pairs.

A construction that we will use very often is to construct the set of all pairs, from two given sets.

First we need to be clear about what a pair is.

The "pair" of 1 and 'a' is written as (1,'a'). Mathematically, a pair is very similar to a list of length two. In this example, 1 is the left "coordinate" and 'a' is the right coordinate.

Unlike sets, for pairs order will matter. That is to say, .

Pairs allow for each coordinate to be equal. That is to say, (1,1) is a legitimate pair.

Now consider the sets and B = {'a','b'}. The set of all pairs, with left coordinates in A and right coordinates in B, is

Notice that, for every choice of element and every choice of element , the pair is present in .

Also notice that if A has m elements and if B has n elements, then has elements. This is surely from whence the name "set product" derives.

Suppose that the set C is . If we then write the product of all three sets then this is

Notice that this is made of pairs, for which the left coordinate is itself pairs from A and B; the right coordinate is from C.

Notice that this is not exactly the same thing as . This would result in pairs, which would have left coordinates in A and right coordinates would be pairs from B and C.

Although these are technically different, we will never be interested in this difference.

We will often write as a short-hand for , although you are also free to think of as the set of triples. For instance, you are free to write

Definition: set product

Let A and B be two sets. We define the set product of A and B by

For an indexed sequence of sets for index 1 to n, if we write then we mean to take the products "from left to right". We use the notation to represent .

More generally, represents .

Exercise

List three elements from the set product if A is the set of all strings and B is the set of negative rational numbers.

Exercise

Let . Find and .

Hint: The former should have 4 elements, the latter 8 elements.

The Powerset

[edit | edit source]
A diagram showing the power set of . This is organized by putting smaller sets lower in the picture. Arrows indicate a subset relationship, so long as no other subset is intermediate. For example, is a subset of every set. But we do not draw an arrow from it to because the set is intermediate to them. This is because .

Continuing the theme of constructing new sets from given sets, we next consider forming the set of all subsets.

For example, let . We have seen earlier that is a subset of every set, and hence .

Next, here are all of the subsets of A which have size 1.

Quick side-note: a set of size 1 is called a "singleton".

Next, here are all of the subsets of size 2.

And finally the subset of size 3 is .

Therefore the set of all subsets is

Definition: power set

For any set A, the power set of A is

Notice that because (again, the empty set is a subset of every set, including being a subset of itself) then

I'll remind anyone who needs reminding: is not the same as ! The former has no elements, the later has one which is .

Exercise

Find .

Hint: the result should have elements. (In general, if set A has n elements, then has elements.)