Formal Logic/Preliminaries/Sets

= Sets=

Presentations of logic vary in how much set theory they use. Some are heavily laden with set theory. Though most are not, it is nearly impossible to avoid it completely. It will not be a very important focal point for this book, but we will use a little set theory vocabulary here and there. This section introduces the vocabulary and notation used.

Sets and elements
Mathematicians use 'set' as an undefined primitive term. Some authors resort to quasi-synonyms such as 'collection'.

A set has elements. 'Element' is also undefined in set theory. We say that an element is a member of a set, also an undefined expression. The following are all used synonymously:


 * x is a member of y
 * x is contained in y
 * x is included in y
 * y contains x
 * y includes x

Notation
A set can be specified by enclosing its members within curly braces.


 * $$\{1, 2, 3\}\,\!$$

is the set containing 1, 2, and 3 as members. The curly brace notation can be extended to specify a set using a rule for membership.


 * $$\{x : x = 1 \text{ or } x = 2 \text{ or } x = 3\}\,\!$$ (The set of all x such that x = 1 or x = 2 or x = 3)

is again the set containing 1, 2, and 3 as members.


 * $$\{x : x \text{ is a positive integer}\}\,\!$$, and


 * $$\{1, 2, 3, \ldots\}\,\!$$

both specify the set containing 1, 2, 3, and onwards.

A modified epsilon is used to denote set membership. Thus


 * $$x \in y\,\!$$

indicates that "x is a member of y". We can also say that "x is not a member of y" in this way:


 * $$x \notin y\,\!$$

Characteristics of sets
A set is uniquely identified by its members. The expressions


 * $$\{x: x\ \mathrm{is\ an\ even\ prime}\}\,\!$$
 * $$\{x: x\ \mathrm{is\ a\ positive\ square\ root\ of}\ 4\}\,\!$$
 * $$\{2\}\,\!$$

all specify the same set even though the concept of an even prime is different from the concept of a positive square root. Repetition of members is inconsequential in specifying a set. The expressions


 * $$\{1,\ 2,\ 3\}\,\!$$
 * $$\{1,\ 1,\ 1,\ 1,\ 2,\ 3\}\,\!$$
 * $$\{x: \mathrm{x\ is\ an\ even\ prime\ or}\ x\ \mathrm{is\ a\ positive\ square\ root\ of}\ 4\ \mathrm{or}\ x = 1\ \mathrm{or}\ x = 2\ \mathrm{or}\ x = 3\}\,\!$$

all specify the same set.

Sets are unordered. The expressions


 * $$\{1,\ 2,\ 3\}\,\!$$
 * $$\{3,\ 2,\ 1\}\,\!$$
 * $$\{2,\ 1,\ 3\}\,\!$$

all specify the same set.

Sets can have other sets as members. There is, for example, the set


 * $$\{\{1,\ 2\}, \{2,\ 3\},\ \{1,\ \mathrm{George\ Washington}\}\}\,\!$$

Some special sets
As stated above, sets are defined by their members. Some sets, however, are given names to ease referencing them.

The set with no members is the empty set. The expressions


 * $$\{\}\,\!$$
 * $$\varnothing\,\!$$
 * $$\{x: x \ne x\}\,\!$$

all specify the empty set. Empty sets can also express oxymora ("four-sided triangles" or "birds with radial symmetry") and factual non-existence ("the King of Czechoslovakia in 1994").

A set with exactly one member is called a singleton. A set with exactly two members is called a pair. Thus {1} is a singleton and {1, 2} is a pair.

&omega; is the set of natural numbers, {0, 1, 2, ...}.

Subsets
A set s is a subset of set a if every member of s is a member of a. We use the horseshoe notation to indicate subsets. The expression


 * $$\{1,\ 2\} \subseteq \{1,\ 2,\ 3\}\,\!$$

says that {1, 2} is a subset of {1, 2, 3}. The empty set is a subset of every set. Every set is a subset of itself. A proper subset of a is a subset of a that is not identical to a. The expression


 * $$\{1,\ 2\} \subset \{1,\ 2,\ 3\}\,\!$$

says that {1, 2} is a proper subset of {1, 2, 3}.

Power sets
A power set of a set is the set of all its subsets. A script 'P' is used for the power set.


 * $$\mathcal{P}\{1,\ 2,\ 3\} = \{\varnothing,\ \{1\},\ \{2\},\ \{3\},\ \{1,\ 2\},\ \{1,\ 3\},\ \{2,\ 3\},\ \{1,\ 2,\ 3\}\}\,\!$$

Union
The union of two sets a and b, written a &cup; b, is the set that contains all the members of a and all the members of b (and nothing else). That is,


 * $$a \cup b = \{x: x \in a\ \mathrm{or}\ x \in b\}\,\!$$

As an example,


 * $$\{1,\ 2,\ 3\}\ \cup\ \{2,\ 3,\ 4\} = \{1,\ 2,\ 3,\ 4\}\,\!$$

Intersection
The intersection of two sets a and b, written a &cap; b, is the set that contains everything that is a member of both a and b (and nothing else). That is,


 * $$a \cap b = \{x: x \in a\ \mathrm{and}\ x \in b\}\,\!$$

As an example,


 * $$\{1,\ 2,\ 3\}\ \cap\ \{2,\ 3,\ 4\} = \{2,\ 3\}\,\!$$

Relative complement
The relative complement of a in b, written b \ a (or b &minus; a) is the set containing all the members of b that are not members of a. That is,


 * $$b \setminus a = \{x: x \in b\ \mathrm{and}\ x \notin a\}\,\!$$

As an example,


 * $$\{2,\ 3,\ 4\} \setminus \{1,\ 3\} = \{2,\ 4\}\,\!$$

Ordered sets, relations, and functions
The intuitive notions of ordered set, relation, and function will be used from time to time. For our purposes, the intuitive mathematical notion is the most important. However, these intuitive notions can be defined in terms of sets.

Ordered sets
First, we look at ordered sets. We said that sets are unordered:


 * $$\{a,\ b\} = \{b,\ a\}\,\!$$

But we can define ordered sets, starting with ordered pairs. The angle bracket notation is used for this:


 * $$\langle a,\ b\rangle\ \ne\ \langle b,\ a\rangle\,\!$$

Indeed,


 * $$\langle x,\ y\rangle\ =\ \langle u,\ v\rangle\ \mbox{if and only if}\ x = u\ \mbox{and}\ y = v\,\!$$

Any set theoretic definition giving &lang;a, b&rang; this last property will work. The standard definition of the ordered pair &lang;a, b&rang; runs:


 * $$\langle a,\ b\rangle\ =\ \{\{a\},\ \{a,\ b\}\}\,\!$$

This means that we can use the latter notation when doing operations on an ordered pair.

There are also bigger ordered sets. The ordered triple &lang;a, b, c&rang; is the ordered pair &lang;&lang;a, b&rang;, c&rang;. The ordered quadruple &lang;a, b, c, d&rang; is the ordered pair &lang;&lang;a, b, c&rang;, d&rang;. This, in turn, is the ordered triple &lang;&lang;&lang;a, b&rang;, c&rang;, d&rang;. In general, an ordered n-tuple &lang;a1, a2, ..., an&rang; where n greater than 1 is the ordered pair &lang;&lang;a1, a2, ..., an-1&rang;, an&rang;.

It can be useful to define an ordered 1-tuple as well: &lang;a&rang; = a.

These definitions are somewhat arbitrary, but it is nonetheless convenient for an n-tuple, n &rang; 2, to be an n-1 tuple and indeed an ordered pair. The important property that makes them serve as ordered sets is:


 * $$\langle x_1,\ x_2,\ ...,\ x_n\rangle\ =\ \langle y_1,\ y_2,\ ...,\ y_n\rangle\ \mathrm{if\ and\ only\ if}\ x_1 = y_1,\ x_2 = y_2,\ ...,\ x_n = y_n\,\!$$

Relations
We now turn to relations. Intuitively, the following are relations:


 * x &lt; y
 * x is a square root of y
 * x is a brother of y
 * x is between y and z

The first three are binary or 2-place relations; the fourth is a ternary or 3-place relation. In general, we talk about n-ary relations or n-place relations.

First consider binary relations. A binary relation is a set of ordered pairs. The less than relation would have among its members &lang;1, 2&rang;, &lang;1, 3&rang;, &lang;16, 127&rang;, etc. Indeed, the less than relation defined on the natural numbers &omega; is:


 * $$\{\langle x,\ y\rangle: x \in \omega,\ y \in \omega,\ \mathrm{and}\ x < y\}\,\!$$

Intuitively, &lang;x, y&rang; is a member of the less than relation if x &lt; y. In set theory, we do not worry about whether a relation matches an intuitive concept such as less than. Rather, any set of ordered pairs is a binary relation.

We can also define a 3-place relation as a set of 3-tuples, a 4-place relation as a set of 4-tuples, etc. We only define n-place relations for n &ge; 2. An n-place relation is said to have an arity of n. The following example is a 3-place relation.


 * $$\{\langle 1,\ 2,\ 3\rangle,\ \langle 8,\ 2,\ 1\rangle,\ \langle 653,\ 0,\ 927\rangle\}\,\!$$

Because all n-tuples where n > 1 are also ordered pairs, all n-place relations are also binary relations.

Functions
Finally, we turn to functions. Intuitively, a function is an assignment of values to arguments such that each argument is assigned at most one value. Thus the + 2 function assigns a numerical argument x the value x + 2. Calling this function f, we say f(x) = x + 2. The following define specific functions.


 * $$f_1(x) = x \times x\,\!$$
 * $$f_2(x) =\ \mathrm{the\ smallest\ prime\ number\ larger\ than}\ x\,\!$$
 * $$f_3(x) = 6 / x\ \!$$
 * $$f_4(x) =\ \mathrm{the\ father\ of\ x}\,\!$$

Note that f3 is undefined when x = 0. According to biblical tradition, f4 is undefined when x = Adam or x = Eve. The following do not define functions.


 * $$f_5(x) = \pm \sqrt{x}\,\!$$
 * $$f_6(x) =\ \mathrm{a\ son\ of\ x}\,\!$$

Neither of these assigns unique values to arguments. For every positive x, there are two square roots, one positive and one negative, so f5 is not a function. For many x, x will have multiple sons, so f6 is not a function. If f6 is assigned the value the son of x then a unique value is implied by the rules of language, therefore f6 will be a function.

A function f is a binary relation where, if &lang;x, y&rang; and &lang;x, z&rang; are both members of f, then y = z.

We can define many place functions. Intuitively, the following are definitions of specific many place functions.


 * $$f_7(x,\ y) = x + y\,\!$$
 * $$f_8(x,\ y,\ z) = (x + y) \times z\,\!$$

Thus &lang;4, 7, 11&rang; is a member of the 2-place function f7. &lang;3, 4, 5, 35&rang; is a member of the 3 place function f8

The fact that all n-tuples, n &ge; 2, are ordered pairs (and hence that all n-ary relations are binary relations) becomes convenient here. For n &ge; 1, an n-place function is an n+1 place relation that is a 1-place function. Thus, for a 2-place function f,


 * $$\langle x,\ y,\ z_1\rangle\ \in f\ \mathrm{and}\ \langle x,\ y,\ z_2\rangle\ \in f\ \mathrm{if\ and\ only\ if}\ z_1 = z_2\,\!$$